@coveo/quantic 3.43.1 → 3.43.2

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.
@@ -29,7 +29,7 @@ ${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":U
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
32
- `;function KN(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var XN=["1",1,"yes",!0];function Fc(){let e=[];return Wh()&&e.push(window.doNotTrack),cy()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>XN.indexOf(t)!==-1)}var Ib="v15",Eb={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function ZN(e=Eb.default,t=Ib,r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}var JN="38824e1f-37f5-42d3-8372-a4b8fa9df946",cr=class{get defaultOptions(){return{endpoint:Eb.default,isCustomEndpoint:!1,token:"",version:Ib,beforeSendHooks:[],afterSendHooks:[]}}get version(){return bb}constructor(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[U0,q0].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let r={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};Fc()?this.runtime=new El:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(De.view,{newEventType:De.view,addClientIdParameter:!0}),this.addEventTypeMapping(De.click,{newEventType:De.click,addClientIdParameter:!0}),this.addEventTypeMapping(De.custom,{newEventType:De.custom,addClientIdParameter:!0}),this.addEventTypeMapping(De.search,{newEventType:De.search,addClientIdParameter:!0})}initRuntime(t){return Wh()&&ni()?new ay(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(KN()&&console.warn(YN),new iy(t))}get storage(){return this.runtime.storage}determineVisitorId(){return U(this,void 0,void 0,function*(){try{return Wh()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Bo()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Bo()}})}getCurrentVisitorId(){return U(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return U(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return U(this,void 0,void 0,function*(){if(xl(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(lb(t,lb(r,JN)))}})}getParameters(t,...r){return U(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return U(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(Bo()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Fc())return null;try{let r=new URL(t).searchParams.get(zn.cvo_cid);if(r==null)return null;let n=zn.fromString(r);return!n||!ni()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return U(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:a=!1,addClientIdParameter:i=!1}=this.eventTypeMapping[t]||{};return yield[h=>n.length>0?this.parseVariableArgumentsPayload(n,h):h[0],h=>U(this,void 0,void 0,function*(){return Object.assign(Object.assign({},h),{visitorId:o?yield this.getCurrentVisitorId():""})}),h=>U(this,void 0,void 0,function*(){return i?Object.assign(Object.assign({},h),{clientId:yield this.getCurrentVisitorId()}):h}),h=>a?this.ensureAnonymousUserWhenUsingApiKey(h):h,h=>this.beforeSendHooks.reduce((y,b)=>U(this,void 0,void 0,function*(){let w=yield y;return yield b(t,w)}),h)].reduce((h,y)=>U(this,void 0,void 0,function*(){let b=yield h;return yield y(b)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return U(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[A=>this.setTrackingIdIfTrackingIdNotPresent(A),A=>this.removeEmptyPayloadValues(A,t),A=>this.validateParams(A,t),A=>n?jN(A):A,A=>n?this.removeUnknownParameters(A):A,A=>n?this.processCustomParameters(A):this.mapCustomParametersToCustomData(A)].reduce((A,x)=>U(this,void 0,void 0,function*(){let h=yield A;return yield x(h)}),Promise.resolve(r))})}makeEvent(t,...r){return U(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),a=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:a,log:i=>U(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},a),i)}),yield Promise.all(this.afterSendHooks.map(p=>p(t,Object.assign(Object.assign({},o),i)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return U(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return U(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new bl().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(De.search,t)})}sendSearchEvent(t){return U(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Br(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(De.click,t)})}sendClickEvent(t){return U(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Br(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(De.custom,t)})}sendCustomEvent(t){return U(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=Br(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(De.view,t)})}sendViewEvent(t){return U(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return U(this,void 0,void 0,function*(){let r=yield(yield v(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return U(this,void 0,void 0,function*(){return yield(yield v(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,a=r.length;o<a;o++){let i=r[o];if(typeof i=="string")n[t[o]]=i;else if(typeof i=="object")return Object.assign(Object.assign({},n),i)}return n}isKeyAllowedEmpty(t,r){return({[De.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,a)=>Object.assign(Object.assign({},o),{[a]:t[a]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(BN(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=Br(t,["custom"]),o={};r&&Cl(r)&&(o=this.lowercaseKeys(r));let a=GN(n);return Object.assign(Object.assign({},o),a)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=Br(t,["custom"]);if(r&&Cl(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=Br(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==De.view||r==De.click||r==De.search||r==De.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==De.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=Br(t,["userId"]);return WN(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=Br(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Cl(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Cl(n.customData)&&(n.customData.hasOwnProperty("context_website")||n.customData.hasOwnProperty("siteName"))&&(n.trackingId=n.customData.context_website||n.customData.siteName),n)}limit(t,r){return typeof t=="string"?rN(t,r):t}get baseUrl(){return ZN(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},kt;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(kt||(kt={}));var O;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerOpenInlineLink="generatedAnswerOpenInlineLink",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick",e.generatedAnswerFollowupOpenSource="generatedAnswerFollowupOpenSource",e.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach"})(O||(O={}));var sy={[O.triggerNotify]:"queryPipelineTriggers",[O.triggerExecute]:"queryPipelineTriggers",[O.triggerQuery]:"queryPipelineTriggers",[O.triggerRedirect]:"queryPipelineTriggers",[O.queryErrorBack]:"errors",[O.queryErrorClear]:"errors",[O.queryErrorRetry]:"errors",[O.pagerNext]:"getMoreResults",[O.pagerPrevious]:"getMoreResults",[O.pagerNumber]:"getMoreResults",[O.pagerResize]:"getMoreResults",[O.pagerScrolling]:"getMoreResults",[O.facetSearch]:"facet",[O.facetShowLess]:"facet",[O.facetShowMore]:"facet",[O.recommendation]:"recommendation",[O.likeSmartSnippet]:"smartSnippet",[O.dislikeSmartSnippet]:"smartSnippet",[O.expandSmartSnippet]:"smartSnippet",[O.collapseSmartSnippet]:"smartSnippet",[O.openSmartSnippetFeedbackModal]:"smartSnippet",[O.closeSmartSnippetFeedbackModal]:"smartSnippet",[O.sendSmartSnippetReason]:"smartSnippet",[O.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[O.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[O.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[O.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[O.clearRecentQueries]:"recentQueries",[O.recentResultClick]:"recentlyClickedDocuments",[O.clearRecentResults]:"recentlyClickedDocuments",[O.showLessFoldedResults]:"folding",[O.caseDetach]:"case",[O.likeGeneratedAnswer]:"generatedAnswer",[O.dislikeGeneratedAnswer]:"generatedAnswer",[O.openGeneratedAnswerSource]:"generatedAnswer",[O.generatedAnswerOpenInlineLink]:"generatedAnswer",[O.generatedAnswerFollowupOpenSource]:"generatedAnswer",[O.generatedAnswerStreamEnd]:"generatedAnswer",[O.generatedAnswerSourceHover]:"generatedAnswer",[O.generatedAnswerCopyToClipboard]:"generatedAnswer",[O.generatedAnswerHideAnswers]:"generatedAnswer",[O.generatedAnswerShowAnswers]:"generatedAnswer",[O.generatedAnswerExpand]:"generatedAnswer",[O.generatedAnswerCollapse]:"generatedAnswer",[O.generatedAnswerFeedbackSubmit]:"generatedAnswer",[O.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[kt.expandToFullUI]:"interface",[kt.openUserActions]:"User Actions",[kt.showPrecedingSessions]:"User Actions",[kt.showFollowingSessions]:"User Actions",[kt.clickViewedDocument]:"User Actions",[kt.clickPageView]:"User Actions",[kt.createArticle]:"createArticle"},Wn=class{constructor(){this.runtime=new El,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(De.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(De.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(De.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(De.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return bb}};function eD(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function tD(e){return e.map(t=>t.replace(/;/g,""))}function Fb(e){let r=e.join(";");return r.length<=256?r:Fb(e.slice(1))}var yb=e=>{let t=tD(e),r=eD(t);return Fb(r)};function Sb(e){let t=typeof e.partialQueries=="string"?e.partialQueries:yb(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:yb(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var Fl=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Fc();this.coveoAnalyticsClient=n?new Wn:new cr(t)}disable(){this.coveoAnalyticsClient=new Wn}enable(){this.coveoAnalyticsClient=new cr(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(O.interfaceLoad)}logInterfaceLoad(){return U(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(O.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return U(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(O.recommendation)}logRecommendation(){return U(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(O.recommendationOpen,t,r)}logRecommendationOpen(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(O.staticFilterClearAll,t)}logStaticFilterClearAll(t){return U(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(O.staticFilterSelect,t)}logStaticFilterSelect(t){return U(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(O.staticFilterDeselect,t)}logStaticFilterDeselect(t){return U(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(O.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return U(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(O.interfaceChange,t)}logInterfaceChange(t){return U(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(O.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return U(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(O.didyoumeanClick)}logDidYouMeanClick(){return U(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(O.resultsSort,t)}logResultsSort(t){return U(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(O.searchboxSubmit)}logSearchboxSubmit(){return U(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(O.searchboxClear)}logSearchboxClear(){return U(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(O.searchboxAsYouType)}logSearchboxAsYouType(){return U(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(O.breadcrumbFacet,t)}logBreadcrumbFacet(t){return U(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(O.breadcrumbResetAll)}logBreadcrumbResetAll(){return U(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(O.documentQuickview,t,r)}logDocumentQuickview(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(O.documentOpen,t,r)}logDocumentOpen(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(O.omniboxAnalytics,Sb(t))}logOmniboxAnalytics(t){return U(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(O.omniboxFromLink,Sb(t))}logOmniboxFromLink(t){return U(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(O.searchFromLink)}logSearchFromLink(){return U(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(O.triggerNotify,t)}logTriggerNotify(t){return U(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(O.triggerExecute,t)}logTriggerExecute(t){return U(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(O.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return U(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(O.undoTriggerQuery,t)}logUndoTriggerQuery(t){return U(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(O.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return U(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(O.pagerResize,t)}logPagerResize(t){return U(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(O.pagerNumber,t)}logPagerNumber(t){return U(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(O.pagerNext,t)}logPagerNext(t){return U(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(O.pagerPrevious,t)}logPagerPrevious(t){return U(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(O.pagerScrolling)}logPagerScrolling(){return U(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(O.facetClearAll,t)}logFacetClearAll(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(O.facetSearch,t)}logFacetSearch(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(O.facetSelect,t)}logFacetSelect(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(O.facetDeselect,t)}logFacetDeselect(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(O.facetExclude,t)}logFacetExclude(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(O.facetUnexclude,t)}logFacetUnexclude(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(O.facetSelectAll,t)}logFacetSelectAll(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(O.facetUpdateSort,t)}logFacetUpdateSort(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(O.facetShowMore,t)}logFacetShowMore(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(O.facetShowLess,t)}logFacetShowLess(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(O.queryError,t)}logQueryError(t){return U(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return U(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(O.queryErrorBack);return{description:t.description,log:()=>U(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(O.queryErrorBack)})}})}logQueryErrorBack(){return U(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return U(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(O.queryErrorRetry);return{description:t.description,log:()=>U(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(O.queryErrorRetry)})}})}logQueryErrorRetry(){return U(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return U(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(O.queryErrorClear);return{description:t.description,log:()=>U(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(O.queryErrorClear)})}})}logQueryErrorClear(){return U(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(O.likeSmartSnippet)}logLikeSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(O.dislikeSmartSnippet)}logDislikeSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(O.expandSmartSnippet)}logExpandSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(O.collapseSmartSnippet)}logCollapseSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(O.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(O.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return U(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(O.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(O.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return U(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(O.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return U(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(O.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return U(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(O.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return U(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(O.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(O.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(O.copyToClipboard,t,r)}logCopyToClipboard(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(O.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(O.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(O.recentQueryClick)}logRecentQueryClick(){return U(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(O.clearRecentQueries)}logClearRecentQueries(){return U(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(O.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(O.clearRecentResults)}logClearRecentResults(){return U(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(O.noResultsBack)}logNoResultsBack(){return U(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(O.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(O.showLessFoldedResults)}logShowLessFoldedResults(){return U(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return U(this,arguments,void 0,function*(n,o,a=sy[n]){this.coveoAnalyticsClient.getParameters;let i=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),p=Object.assign(Object.assign({},yield this.getBaseEventRequest(i)),{eventType:a,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(p);return{description:this.makeEventDescription(f,n),log:({searchUID:m})=>f.log({lastSearchQueryUid:m})}})}logCustomEvent(t,r){return U(this,arguments,void 0,function*(n,o,a=sy[n]){return(yield this.makeCustomEvent(n,o,a)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return U(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),a=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),i=yield this.coveoAnalyticsClient.makeCustomEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({lastSearchQueryUid:p})}})}logCustomEventWithType(t,r,n){return U(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return U(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:a})=>o.log({searchQueryUid:a})}})}makeClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){let a=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),i=yield this.coveoAnalyticsClient.makeClickEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({searchQueryUid:p})}})}logClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return U(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return U(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof cr?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent(O.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return U(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(O.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return U(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(O.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return U(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerOpenInlineLink(t){return this.makeCustomEvent(O.generatedAnswerOpenInlineLink,t)}logGeneratedAnswerOpenInlineLink(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerOpenInlineLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(O.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFollowupOpenSource(t){return this.makeCustomEvent(O.generatedAnswerFollowupOpenSource,t)}logGeneratedAnswerFollowupOpenSource(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFollowupOpenSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(O.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(O.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(O.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(O.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(O.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(O.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(O.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(O.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(O.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return U(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(O.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return U(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(O.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Tl=Object.assign({},Rc),vb=Object.keys(Tl).map(e=>Tl[e]),oi=class extends Xh{constructor({client:t,uuidGenerator:r=Bo}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);return r!==null?r:t==="setTicket"?this.setTicket:null}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>vb.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(vb.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Tl.pageview,{newEventType:De.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Tl.event,{newEventType:De.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),a=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},a),o),r)}getTicketPayload(){return sN(this.ticket)}};oi.Id="svc";var Pl;(function(e){e.click="click",e.flowStart="flowStart"})(Pl||(Pl={}));var hr;(function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.documentSuggestionClick="documentSuggestionClick",e.documentSuggestionQuickview="documentSuggestionQuickview",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"})(hr||(hr={}));var kl;(function(e){e.quit="Quit",e.solved="Solved"})(kl||(kl={}));var Ol=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Fc();this.coveoAnalyticsClient=o?new cr(t):new Wn,this.svc=new oi({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Wn,this.svc=new oi({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new cr(this.options),this.svc=new oi({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(hr.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(hr.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(hr.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(hr.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(hr.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(hr.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(hr.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(hr.caseCancelled,{reason:kl.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(hr.caseSolved,{reason:kl.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(hr.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Pl.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Pl.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return U(this,void 0,void 0,function*(){var r,n;let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof cr?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,a;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(a=this.provider)===null||a===void 0?void 0:a.getOriginLevel3()}}logClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){var a,i;let p=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(i=(a=this.provider)===null||a===void 0?void 0:a.getSearchUID())!==null&&i!==void 0?i:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(p)})}},rD=e=>{let t={};return e.caseContext&&Object.keys(e.caseContext).forEach(r=>{var n;let o=(n=e.caseContext)===null||n===void 0?void 0:n[r];if(o){let a=`context_${r}`;t[a]=o}}),t},de=(e,t=!0)=>{let{caseContext:r,caseId:n,caseNumber:o}=e,a=Br(e,["caseContext","caseId","caseNumber"]),i=rD(e);return Object.assign(Object.assign(Object.assign({CaseId:n,CaseNumber:o},a),!!i.context_Case_Subject&&{CaseSubject:i.context_Case_Subject}),t&&i)},_l=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Fc();this.coveoAnalyticsClient=n?new Wn:new cr(t)}disable(){this.coveoAnalyticsClient=new Wn}enable(){this.coveoAnalyticsClient=new cr(this.opts)}logInterfaceLoad(t){if(t){let r=de(t);return this.logSearchEvent(O.interfaceLoad,r)}return this.logSearchEvent(O.interfaceLoad)}logRecentQueryClick(t){if(t){let r=de(t);return this.logSearchEvent(O.recentQueryClick,r)}return this.logSearchEvent(O.recentQueryClick)}logClearRecentQueries(t){if(t){let r=de(t);return this.logCustomEvent(O.clearRecentQueries,r)}return this.logCustomEvent(O.clearRecentQueries)}logInterfaceChange(t){let r=de(t);return this.logSearchEvent(O.interfaceChange,r)}logStaticFilterDeselect(t){let r=de(t);return this.logSearchEvent(O.staticFilterDeselect,r)}logFetchMoreResults(t){if(t){let r=de(t);return this.logCustomEvent(O.pagerScrolling,Object.assign(Object.assign({},r),{type:"getMoreResults"}))}return this.logCustomEvent(O.pagerScrolling,{type:"getMoreResults"})}logBreadcrumbFacet(t){let r=de(t);return this.logSearchEvent(O.breadcrumbFacet,r)}logBreadcrumbResetAll(t){if(t){let r=de(t);return this.logSearchEvent(O.breadcrumbResetAll,r)}return this.logSearchEvent(O.breadcrumbResetAll)}logFacetSelect(t){let r=de(t);return this.logSearchEvent(O.facetSelect,r)}logFacetExclude(t){let r=de(t);return this.logSearchEvent(O.facetExclude,r)}logFacetDeselect(t){let r=de(t);return this.logSearchEvent(O.facetDeselect,r)}logFacetUpdateSort(t){let r=de(t);return this.logSearchEvent(O.facetUpdateSort,r)}logFacetClearAll(t){let r=de(t);return this.logSearchEvent(O.facetClearAll,r)}logFacetShowMore(t){let r=de(t,!1);return this.logCustomEvent(O.facetShowMore,r)}logFacetShowLess(t){let r=de(t,!1);return this.logCustomEvent(O.facetShowLess,r)}logQueryError(t){let r=de(t,!1);return this.logCustomEvent(O.queryError,r)}logPagerNumber(t){let r=de(t,!1);return this.logCustomEvent(O.pagerNumber,r)}logPagerNext(t){let r=de(t,!1);return this.logCustomEvent(O.pagerNext,r)}logPagerPrevious(t){let r=de(t,!1);return this.logCustomEvent(O.pagerPrevious,r)}logDidYouMeanAutomatic(t){if(t){let r=de(t);return this.logSearchEvent(O.didyoumeanAutomatic,r)}return this.logSearchEvent(O.didyoumeanAutomatic)}logDidYouMeanClick(t){if(t){let r=de(t);return this.logSearchEvent(O.didyoumeanClick,r)}return this.logSearchEvent(O.didyoumeanClick)}logResultsSort(t){let r=de(t);return this.logSearchEvent(O.resultsSort,r)}logSearchboxSubmit(t){if(t){let r=de(t);return this.logSearchEvent(O.searchboxSubmit,r)}return this.logSearchEvent(O.searchboxSubmit)}logContextChanged(t){let r=de(t);return this.logSearchEvent(kt.contextChanged,r)}logExpandToFullUI(t){let r=de(t);return this.logCustomEvent(kt.expandToFullUI,r)}logOpenUserActions(t){let r=de(t,!1);return this.logCustomEvent(kt.openUserActions,r)}logShowPrecedingSessions(t){let r=de(t,!1);return this.logCustomEvent(kt.showPrecedingSessions,r)}logShowFollowingSessions(t){let r=de(t,!1);return this.logCustomEvent(kt.showFollowingSessions,r)}logViewedDocumentClick(t,r){return this.logCustomEvent(kt.clickViewedDocument,Object.assign(Object.assign({},de(r,!1)),{document:t}))}logPageViewClick(t,r){return this.logCustomEvent(kt.clickPageView,Object.assign(Object.assign({},de(r,!1)),{pageView:t}))}logCreateArticle(t,r){return this.logCustomEvent(kt.createArticle,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logDocumentOpen(t,r,n){return this.logClickEvent(O.documentOpen,t,r,n?de(n,!1):void 0)}logCopyToClipboard(t,r,n){return this.logClickEvent(O.copyToClipboard,t,r,n?de(n,!1):void 0)}logCaseSendEmail(t,r,n){return this.logClickEvent(O.caseSendEmail,t,r,n?de(n,!1):void 0)}logFeedItemTextPost(t,r,n){return this.logClickEvent(O.feedItemTextPost,t,r,n?de(n,!1):void 0)}logDocumentQuickview(t,r,n){let o={documentTitle:t.documentTitle,documentURL:t.documentUrl};return this.logClickEvent(O.documentQuickview,t,r,n?Object.assign(Object.assign({},de(n,!1)),o):o)}logCaseAttach(t,r,n){let o={documentTitle:t.documentTitle,documentURL:t.documentUrl,resultUriHash:t.documentUriHash};return this.logClickEvent(O.caseAttach,t,r,n?Object.assign(Object.assign({},de(n,!1)),o):o)}logCaseDetach(t,r,n){let o=Object.assign(Object.assign(Object.assign({},r&&de(r,!1)),n&&{permanentId:n}),{resultUriHash:t});return this.logCustomEvent(O.caseDetach,o)}logLikeSmartSnippet(t){return this.logCustomEvent(O.likeSmartSnippet,t?de(t,!1):void 0)}logDislikeSmartSnippet(t){return this.logCustomEvent(O.dislikeSmartSnippet,t?de(t,!1):void 0)}logExpandSmartSnippet(t){return this.logCustomEvent(O.expandSmartSnippet,t?de(t,!1):void 0)}logCollapseSmartSnippet(t){return this.logCustomEvent(O.collapseSmartSnippet,t?de(t,!1):void 0)}logOpenSmartSnippetFeedbackModal(t){return this.logCustomEvent(O.openSmartSnippetFeedbackModal,t?de(t,!1):void 0)}logCloseSmartSnippetFeedbackModal(t){return this.logCustomEvent(O.closeSmartSnippetFeedbackModal,t?de(t,!1):void 0)}logSmartSnippetFeedbackReason(t,r,n){return this.logCustomEvent(O.sendSmartSnippetReason,n?Object.assign(Object.assign({},de(n,!1)),{reason:t,details:r}):{reason:t,details:r})}logExpandSmartSnippetSuggestion(t,r){let n="documentId"in t?t:{documentId:t};return this.logCustomEvent(O.expandSmartSnippetSuggestion,r?Object.assign(Object.assign({},de(r,!1)),n):n)}logCollapseSmartSnippetSuggestion(t,r){let n="documentId"in t?t:{documentId:t};return this.logCustomEvent(O.collapseSmartSnippetSuggestion,r?Object.assign(Object.assign({},de(r,!1)),n):n)}logOpenSmartSnippetSource(t,r,n){return this.logClickEvent(O.openSmartSnippetSource,t,r,n?de(n,!1):void 0)}logOpenSmartSnippetSuggestionSource(t,r,n){return this.logClickEvent(O.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},n?Object.assign(Object.assign({},de(n,!1)),r):r)}logOpenSmartSnippetInlineLink(t,r,n){return this.logClickEvent(O.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},n?Object.assign(Object.assign({},de(n,!1)),r):r)}logOpenSmartSnippetSuggestionInlineLink(t,r,n){return this.logClickEvent(O.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},n?Object.assign(Object.assign({},de(n,!1)),r):r)}logLikeGeneratedAnswer(t,r){return this.logCustomEvent(O.likeGeneratedAnswer,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logDislikeGeneratedAnswer(t,r){return this.logCustomEvent(O.dislikeGeneratedAnswer,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logOpenGeneratedAnswerSource(t,r){return this.logCustomEvent(O.openGeneratedAnswerSource,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logGeneratedAnswerCitationClick(t,r,n){return this.logClickEvent(O.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},n?Object.assign(Object.assign({},de(n,!1)),r):r)}logGeneratedAnswerSourceHover(t,r){return this.logCustomEvent(O.generatedAnswerSourceHover,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logGeneratedAnswerCopyToClipboard(t,r){return this.logCustomEvent(O.generatedAnswerCopyToClipboard,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logGeneratedAnswerHideAnswers(t,r){return this.logCustomEvent(O.generatedAnswerHideAnswers,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logGeneratedAnswerShowAnswers(t,r){return this.logCustomEvent(O.generatedAnswerShowAnswers,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logGeneratedAnswerExpand(t,r){return this.logCustomEvent(O.generatedAnswerExpand,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logGeneratedAnswerCollapse(t,r){return this.logCustomEvent(O.generatedAnswerCollapse,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logGeneratedAnswerFeedbackSubmit(t,r){return this.logCustomEvent(O.generatedAnswerFeedbackSubmit,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logGeneratedAnswerFeedbackSubmitV2(t,r){return this.logCustomEvent(O.generatedAnswerFeedbackSubmitV2,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logRephraseGeneratedAnswer(t,r){return this.logSearchEvent(O.rephraseGeneratedAnswer,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logRetryGeneratedAnswer(t){return this.logSearchEvent(O.retryGeneratedAnswer,t?Object.assign({},de(t,!1)):{})}logGeneratedAnswerStreamEnd(t,r){return this.logCustomEvent(O.generatedAnswerStreamEnd,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logGeneratedAnswerCitationDocumentAttach(t,r,n){return this.logClickEvent(O.generatedAnswerCitationDocumentAttach,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},n?Object.assign(Object.assign({},de(n,!1)),r):r)}logCustomEvent(t,r){return U(this,void 0,void 0,function*(){let n=Object.assign(Object.assign({},this.provider.getBaseMetadata()),r),o=Object.assign(Object.assign({},yield this.getBaseCustomEventRequest(n)),{eventType:sy[t],eventValue:t});return this.coveoAnalyticsClient.sendCustomEvent(o)})}logSearchEvent(t,r){return U(this,void 0,void 0,function*(){return this.coveoAnalyticsClient.sendSearchEvent(yield this.getBaseSearchEventRequest(t,r))})}logClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){let a=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(a)})}logShowMoreFoldedResults(t,r,n){return U(this,void 0,void 0,function*(){return this.logClickEvent(O.showMoreFoldedResults,t,r,n?de(n,!1):void 0)})}logShowLessFoldedResults(t){return U(this,void 0,void 0,function*(){return this.logCustomEvent(O.showLessFoldedResults,t?de(t,!1):void 0)})}logTriggerNotify(t,r){return this.logCustomEvent(O.triggerNotify,r?Object.assign(Object.assign({},de(r,!1)),t):t)}getBaseCustomEventRequest(t){return U(this,void 0,void 0,function*(){return Object.assign(Object.assign({},yield this.getBaseEventRequest(t)),{lastSearchQueryUid:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return U(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return U(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign({},this.getOrigins()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof cr?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}};d();c();l();u();d();c();l();u();var ii=()=>"default";var nD=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},Yn=class{constructor(t){le(this,"getState",t);le(this,"state");this.state=t()}getLanguage(){return nD(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[a,i]of Object.entries(n)){let p=`context_${a}`;o[p]=i}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=Hn),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||ii()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};d();c();l();u();var Tb=e=>new cr(e).getCurrentVisitorId(),si=(e,t)=>typeof t=="function"?(...r)=>{let n=Xs(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,ci=(e,t)=>(...r)=>{let n=Xs(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};var Tc=class extends Yn{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},Pb=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o=new Tc(t)})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??mt(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new Ol({enableAnalytics:m,token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:si(e,n),beforeSendHooks:[ci(e,r),(A,x)=>(e.info({...x,type:A,endpoint:p,token:i},"Analytics request"),x)]},o);return m||g.disable(),g};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Nl(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();function oD(e,t){return!!t&&t.facetId in e.facetSet}var Fn=(e,t)=>e.search?.response.facets.find(r=>r.facetId===t),kb=(e,t)=>e.facetSet[t]?.request,dy=(e,t)=>{let r=Fn(e,t);return oD(e,r)?r:void 0};var Ob=(e,t)=>dy(e,t)?.values.filter(r=>r.state!=="idle")||[],Gr=e=>e.search.isLoading;d();c();l();u();function _b(e){if(!e)return{parents:[],values:[]};let t=[],r=e;for(;r.length&&r[0].children.length;)t=[...t,...r],r=r[0].children;let n=r.find(o=>o.state==="selected");return n&&(t=[...t,n],r=[]),{parents:t,values:r}}function $r(e){let{activeValue:t,ancestryMap:r}=aD(e);return t?iD(t,r):[]}function aD(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function iD(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}function sD(e,t){return!!t&&t.facetId in e.categoryFacetSet}var py=(e,t)=>{let r=Fn(e,t);if(sD(e,r))return r},fy=(e,t)=>e.categoryFacetSet[t]?.request,Nb=(e,t)=>{let r=py(e,t);return $r(r?.values??[])},my=(e,t)=>{let r=fy(e,t);return $r(r?.currentValues??[])};d();c();l();u();function ui(){return{}}d();c();l();u();function Db(e,t){return{request:e,tabs:t}}function li(){return{}}d();c();l();u();function qb(e,t){return{request:e,tabs:t}}function di(){return{}}d();c();l();u();function Mb(e,t){return{request:e,hasBreadcrumbs:!0,tabs:t}}function pi(){return{}}var Go=(e,t)=>{let r=Ub(t,e),n=r?r.field:"",o=gy(n,e);return{facetId:e,facetField:n,facetTitle:o}};function fi(e,t){let{facetId:r,facetValue:n}=e,o=Go(r,t),a=Qb(t,r);return{...o,facetValue:a==="hierarchical"?Lb(t,r):n}}function Xt(e){return{facetSet:e.facetSet??pi(),categoryFacetSet:e.categoryFacetSet??ui(),dateFacetSet:e.dateFacetSet??li(),numericFacetSet:e.numericFacetSet??di(),automaticFacetSet:e.automaticFacetSet??Nl()}}var Dl=e=>{let t=[];return lD(e).forEach((r,n)=>{let o=Qb(e,r.facetId),a=gD(r,n+1);if(uD(r)){if(!!!my(e,r.facetId).length)return;t.push({...a,...fD(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((i,p)=>{if(i.state==="idle")return;let f=Vb(i,p+1,o),m=cD(r)?jb(i):pD(i);t.push({...a,...f,...m})})}),dD(e).forEach((r,n)=>{let o=mD(r,n+1);r.values.forEach((a,i)=>{if(a.state==="idle")return;let p=Vb(a,i+1,"specific"),f=jb(a);t.push({...o,...p,...f})})}),t},cD=e=>e.type==="specific",uD=e=>e.type==="hierarchical",lD=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),dD=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Vb=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),pD=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),jb=e=>({displayValue:e.value,value:e.value}),Lb=(e,t)=>my(e,t).map(n=>n.value).join(";"),fD=(e,t)=>{let n=Lb(e,t);return{value:n,valuePosition:1,displayValue:n}},mD=(e,t)=>({title:gy(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),gD=(e,t)=>({title:gy(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),gy=(e,t)=>`${e}_${t}`,Ub=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,Qb=(e,t)=>{let r=Ub(e,t);return r?r.type:"specific"};d();c();l();u();d();c();l();u();var hy=e=>e.configuration.search.locale,Bb=e=>e.configuration.search.timezone,Gb=e=>e.configuration.accessToken,$b=e=>e.configuration.organizationId,Hb=e=>e.configuration.environment,ql=e=>e.configuration?.knowledge?.agentId,zb=e=>e.configuration.knowledge.debugAgentSession;var Ue=e=>{if(hD(e)||yy(e))return e.generatedAnswer?.answerId;if(yD(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},hD=e=>"answer"in e&&"generatedAnswer"in e&&!J(e.generatedAnswer?.answerConfigurationId),yy=e=>{let t=ql(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},yD=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",Sy=e=>e.generatedAnswer?.fieldsToIncludeInCitations,Wb=e=>e.followUpAnswers?.conversationId,SD=e=>e.generatedAnswer?.citations,vD=e=>e.followUpAnswers?.followUpAnswers,AD=ct(vD,e=>e?.flatMap(t=>t.citations)),CD=(e,t)=>t,mi=ct(SD,AD,CD,(e,t,r)=>e?.find(n=>n.id===r)??t?.find(n=>n.id===r));d();c();l();u();var ut=()=>({q:"",enableQuerySyntax:!1});var Pc=class extends Yn{getSearchUID(){let t=this.getState();return t.search?.searchResponseId||t.search?.response.searchUid||At().response.searchUid}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getFacetState(){return Dl(Xt(this.state))}getBaseMetadata(){let t=this.getState(),r=super.getBaseMetadata(),n=Ue(t);return n&&(r.generativeQuestionAnsweringId=n),r}getGeneratedAnswerMetadata(){let t=this.getState();return{...(t.generatedAnswer?.isVisible!==void 0&&{showGeneratedAnswer:t.generatedAnswer.isVisible})}}get queryText(){return this.state.query?.q||ut().q}get responseTime(){return this.state.search?.duration||At().duration}mapResultsToAnalyticsDocument(){return this.state.search?.response.results.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.search?.response.results.length||At().response.results.length}},Yb=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o=new Pc(t)})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??mt(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new _l({enableAnalytics:m,token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:si(e,n),beforeSendHooks:[ci(e,r),(A,x)=>(e.info({...x,type:A,endpoint:p,token:i},"Analytics request"),x)]},o);return m||g.disable(),g};d();c();l();u();d();c();l();u();d();c();l();u();var Ml=(r=>(r.Ascending="ascending",r.Descending="descending",r))(Ml||{}),Vl=(a=>(a.Relevancy="relevancy",a.QRE="qre",a.Date="date",a.Field="field",a.NoSort="nosort",a))(Vl||{}),Hr=e=>{if(Ba(e))return e.map(t=>Hr(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},jl=()=>({by:"relevancy"}),Kb=e=>({by:"date",order:e});var Xb=new Y({values:{by:new Ks({enum:Vl,required:!0}),order:new Ks({enum:Ml}),field:new $}});function ur(){return Hr(jl())}d();c();l();u();d();c();l();u();d();c();l();u();var gi=class e{static set(t,r,n){let o,a,i;n&&(a=new Date,a.setTime(a.getTime()+n));let p=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,m=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(p)||m.test(p)||p.indexOf(".")===-1?vy(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],vy(t,r,a,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let 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 vy(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}d();c();l();u();function bD(){return typeof navigator<"u"}function Zb(){try{return typeof localStorage<"u"}catch{return!1}}function Jb(){try{return typeof sessionStorage<"u"}catch{return!1}}function ex(){return!!(bD()&&navigator.cookieEnabled)}var tx=null;function rx(){return tx||(Zb()?localStorage:ex()?new Ay:Jb()?sessionStorage:new Cy)}var hi=class hi{getItem(t){return gi.get(`${hi.prefix}${t}`)}removeItem(t){gi.erase(`${hi.prefix}${t}`)}setItem(t,r,n){gi.set(`${hi.prefix}${t}`,r,n)}};le(hi,"prefix","coveo_");var Ay=hi;var Cy=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var Ll="__coveo.analytics.history",xD=20,wD=1e3*60,RD=75,$o=class $o{constructor(t){le(this,"store");this.store=t||rx()}static getInstance(t){return $o.instance||($o.instance=new $o(t)),$o.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this6=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this6.cropQueryElement(_this6.stripEmptyQuery(t));let r=yield _this6.getHistoryWithInternalTimeAsync();r!==null?_this6.isValidEntry(t)&&_this6.setHistory([t].concat(r)):_this6.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this7=this;return _asyncToGenerator(function*(){let t=yield _this7.getHistoryWithInternalTimeAsync();return _this7.stripEmptyQueries(_this7.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(Ll);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this8=this;return _asyncToGenerator(function*(){try{let t=yield _this8.store.getItem(Ll);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(Ll,JSON.stringify(t.slice(0,xD)))}catch{}}clear(){try{this.store.removeItem(Ll)}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,RD)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>wD:!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))}};le($o,"instance",null);var by=$o,Vt=by;var kc=class kc extends Yn{constructor(){super(...arguments);le(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return Dl(Xt(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||kc.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||At().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||kc.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Ue(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetValue:n,facetTitle:`${a}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,criteria:n,facetTitle:`${a}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${a}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??ur()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:a,categoryFacetPath:n,categoryFacetTitle:`${a}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],a=o.completions.map(m=>m.expression),i=o.partialQueries.length-1,p=o.partialQueries[i]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:a.indexOf(n),partialQuery:p,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:a.length>0?a:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||ut().q}get responseTime(){return this.state.search?.duration||At().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||At().response.totalCountFiltered}};le(kc,"fallbackPipelineName","default");var Kn=kc,nx=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??mt(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new Fl({token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:si(e,n),beforeSendHooks:[ci(e,r),(A,x)=>(e.info({...x,type:A,endpoint:p,token:i},"Analytics request"),x)]},o);return m||g.disable(),g},xy=()=>{let t=Vt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};d();c();l();u();function Ul(e){let t=ox(e),r=[e,...t].filter(o=>o.parentResult).map(o=>o.parentResult);return iA([e,...t,...r],o=>o.uniqueId)}function ox(e){return e.childResults?e.childResults.flatMap(t=>[t,...ox(t)]):[]}d();c();l();u();var Oc=()=>"";function ix(e,t){return{...new Kn(t).getBaseMetadata(),actionCause:e,type:e}}function ID(e){return Object.assign(e,{instantlyCallable:!0})}function ED(e,t){let r=a=>{let i=me(e,a);return ID(Object.assign(i,{type:i.typePrefix}))},n=r(/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(a,{getState:i,extra:p}){let{analyticsClientMiddleware:f,preprocessRequest:m,logger:g}=p;return yield(yield t({getState:i,analyticsClientMiddleware:f,preprocessRequest:m,logger:g})).log({state:i(),extra:p})});return function(_x19,_x20){return _ref10.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref11=_asyncToGenerator(function*({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f}){let{description:m,log:g}=yield t({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f});return{description:m,action:r(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(A,{getState:x,extra:h}){return yield g({state:x(),extra:h})});return function(_x22,_x23){return _ref12.apply(this,arguments)}}())}});return function prepare(_x21){return _ref11.apply(this,arguments)}}()}),n}var wy=(e,t,r)=>{function n(...o){let a=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return PD(a)}return n},FD=e=>e.configuration.analytics.analyticsMode==="legacy",TD=e=>e.configuration.analytics.analyticsMode==="next",PD=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:a,providerClass:i})=>(r??(r=p=>new i(p)),ED(e,/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*({getState:p,analyticsClientMiddleware:f,preprocessRequest:m,logger:g}){let A=[],x={log:function(){var _ref14=_asyncToGenerator(function*({state:I}){for(let F of A)yield F(I)});return function log(_x25){return _ref14.apply(this,arguments)}}()},h=p(),y=a({getState:p,logger:g,analyticsClientMiddleware:f,preprocessRequest:m,provider:r(p)}),b=yield t(y,p());x.description=b?.description,A.push(/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(I){FD(I)&&(yield kD(b,r,I,g,y.coveoAnalyticsClient))});return function(_x26){return _ref15.apply(this,arguments)}}());let{emit:w}=wc(h);return A.push(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(I){if(TD(I)&&o&&n){let F=n(I);yield jD(w,o,F)}});return function(_x27){return _ref16.apply(this,arguments)}}()),x});return function(_x24){return _ref13.apply(this,arguments)}}()));function kD(_x28,_x29,_x30,_x31,_x32){return _kD.apply(this,arguments)}function _kD(){_kD=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let a=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:a},"Analytics response")});return _kD.apply(this,arguments)}var sx=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref17=_asyncToGenerator(function*(a){r(n,o)});return function log(_x33){return _ref17.apply(this,arguments)}}()}),ze=wy(e=>nx({...e,provider:e.provider||new Kn(e.getState)}),e=>e,Kn),e9=wy(Pb,sx("caseAssist"),Tc),te=e=>wy(Yb,sx(e),Pc),Xe=(e,t)=>{let r=a=>a+(t.pagination?.firstResult??0),n=-1,o=t.search?.results;return n=ux(e,o),n<0&&(n=VD(e,o)),n<0&&(n=0),_D(e,r(n),t)};var Ql=(e,t)=>({sourceName:OD(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||Oc()});function OD(e){let t=e.source;return J(t)?"unknown":t}var Bl=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function _D(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:qD(e),...(ax(e)?{documentCategory:ax(e)}:{}),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:MD(e),queryPipeline:r.pipeline||Oc()}}function ax(e){return e.raw?.objecttype||void 0}var Ze=e=>(e.raw.permanentid||console.warn("Missing field permanentid on result. This might cause many issues with your Coveo deployment. See https://docs.coveo.com/en/1913 and https://docs.coveo.com/en/1640 for more information.",e),{contentIDKey:"permanentid",contentIDValue:e.raw.permanentid||""}),cx={urihash:new $,sourcetype:new $,permanentid:new $},Gl={uniqueId:H,raw:new Y({values:cx}),title:H,uri:H,clickUri:H,rankingModifier:new $({required:!1,emptyAllowed:!0})};function ND(e){return Object.assign({},...Object.keys(cx).map(t=>({[t]:e[t]})))}function DD(e){return Object.assign({},...Object.keys(Gl).map(t=>({[t]:e[t]})),{raw:ND(e.raw)})}function qD(e){let t=e.raw.author;return J(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function MD(e){let t=e.raw.source;return J(t)?"unknown":t}var Ot=e=>new Pe(Gl).validate(DD(e));function VD(e,t){for(let[r,n]of t.entries()){let o=Ul(n);if(ux(e,o)!==-1)return r}return-1}function ux(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function jD(_x34,_x35,_x36){return _jD.apply(this,arguments)}function _jD(){_jD=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _jD.apply(this,arguments)}var Pr=(e,t)=>{let r=Ze(e),n=Xe(e,t);return{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:n.documentTitle,author:n.documentAuthor,url:n.documentUri}};d();c();l();u();var Ry=e=>_(e,{evt:H,type:We}),lx=e=>ze("analytics/generic/search",t=>{Ry(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),dx=e=>ze("analytics/generic/click",(t,r)=>(Ot(e.result),Ry(e),t.makeClickEvent(e.evt,Xe(e.result,r),Ze(e.result),e.meta))),px=e=>ze("analytics/generic/custom",t=>(Ry(e),t.makeCustomEventWithType(e.evt,e.type,e.meta)));var fx=()=>({actionCause:"interfaceLoad"}),yi=()=>({actionCause:"interfaceChange"});d();c();l();u();var Iy=()=>We,mx=()=>H,Si=P("configuration/updateBasicConfiguration",e=>_(e,{accessToken:We,environment:new $({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:We})),vi=P("configuration/updateSearchConfiguration",e=>_(e,{proxyBaseUrl:new $({required:!1,url:!0}),pipeline:new $({required:!1,emptyAllowed:!0}),searchHub:We,timezone:We,locale:We,authenticationProviders:new oe({required:!1,each:H})})),LD={enabled:new fe({default:!0}),originContext:Iy(),originLevel2:Iy(),originLevel3:Iy(),proxyBaseUrl:new $({required:!1,url:!0}),runtimeEnvironment:new $e,anonymous:new fe({default:!1}),deviceId:We,userDisplayName:We,documentLocation:We,trackingId:JA,analyticsMode:new $({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new Y({options:{required:!1},values:sb.reduce((e,t)=>(e[t]=ZA,e),{})})},$l=P("configuration/updateAnalyticsConfiguration",e=>_(e,LD)),Hl=P("configuration/analytics/disable"),zl=P("configuration/analytics/enable"),gx=P("configuration/analytics/originlevel2",e=>_(e,{originLevel2:mx()})),hx=P("configuration/analytics/originlevel3",e=>_(e,{originLevel3:mx()})),yx=P("knowledge/setAgentId",e=>_(e,new $({required:!0})));d();c();l();u();var Wl=P("insightConfiguration/set",e=>_(e,{insightId:H}));d();c();l();u();d();c();l();u();var Sx=()=>({insightId:""});var Yl=pe(Sx(),e=>{e.addCase(Wl,(t,r)=>{t.insightId=r.payload.insightId})});d();c();l();u();d();c();l();u();var Kl=P("searchHub/set",e=>_(e,new $({required:!0,emptyAllowed:!0})));var zr=me("insight/interface/fetch",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,{getState:t,dispatch:r,rejectWithValue:n,extra:{apiClient:o}}){let a=t(),i=yield o.getInterface(UD(a));return He(i)?n(i.error):(r(Kl(i.success.searchHub)),{response:i.success})});return function(_x37,_x38){return _ref18.apply(this,arguments)}}()),UD=e=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:mt(e.configuration.organizationId,e.configuration.environment),insightId:e.insightConfiguration.insightId});d();c();l();u();d();c();l();u();var vx=()=>({loading:!1,config:void 0});var Xn=pe(vx(),e=>{e.addCase(zr.pending,t=>{t.loading=!0,t.error=void 0}).addCase(zr.rejected,(t,r)=>{t.loading=!1,t.error=r.payload}).addCase(zr.fulfilled,(t,r)=>{t.loading=!1,t.error=void 0;let{searchHub:n,...o}=r.payload.response;t.config=o})});d();c();l();u();d();c();l();u();d();c();l();u();function Ax(e){return e.type==="dateRange"}function Cx(e){return`start${e}`}function bx(e){return`end${e}`}var Ey=()=>({dateFacetValueMap:{}});function QD(e,t,r){let n=e.start,o=e.end;return Bn(n)&&(n=tc(n),r.dateFacetValueMap[t][Cx(n)]=e.start),Bn(o)&&(o=tc(o),r.dateFacetValueMap[t][bx(o)]=e.end),{...e,start:n,end:o}}function Fy(e,t){if(Ax(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>QD(o,r,t))}}return e}function Wr(e){let t=Ey();return{request:{...e,facets:e.facets?.map(n=>Fy(n,t))},mappings:t}}function BD(e,t,r){return{...e,start:r.dateFacetValueMap[t][Cx(e.start)]||e.start,end:r.dateFacetValueMap[t][bx(e.end)]||e.end}}function GD(e,t){return e.facetId in t.dateFacetValueMap}function $D(e,t){return GD(e,t)?{...e,values:e.values.map(r=>BD(r,e.facetId,t))}:e}function kr(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>$D(n,t))}}:e}d();c();l();u();d();c();l();u();var Zn=/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield Tb(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(xy()&&{pageId:xy()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:ri(e)})}}});return function Zn(_x39,_x40){return _ref19.apply(this,arguments)}}();var xx=/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e,t){return{accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,url:mt(t.configuration.organizationId,t.configuration.environment),count:t.querySuggest[e].count,insightId:t.insightConfiguration.insightId,q:t.querySet?.[e],timezone:t.configuration.search.timezone,actionsHistory:t.configuration.analytics.enabled?Vt.getInstance().getHistory():[],...(t.insightCaseContext?.caseContext&&{context:t.insightCaseContext.caseContext}),...(t.configuration.analytics.enabled&&{...(t.configuration.analytics.enabled&&(yield Zn(t.configuration.analytics)))})}});return function xx(_x41,_x42){return _ref20.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var Xl=P("didYouMean/enable"),wx=P("didYouMean/disable"),Zl=P("didYouMean/automaticCorrections/disable"),Rx=P("didYouMean/automaticCorrections/enable"),Zt=P("didYouMean/correction",e=>_(e,H)),_c=P("didYouMean/automaticCorrections/mode",e=>_(e,new $({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var HD=P("history/undo"),zD=P("history/redo"),bt=P("history/snapshot"),s7=me("history/back",/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,{dispatch:t}){t(HD()),yield t(tt())});return function(_x43,_x44){return _ref21.apply(this,arguments)}}()),c7=me("history/forward",/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,{dispatch:t}){t(zD()),yield t(tt())});return function(_x45,_x46){return _ref22.apply(this,arguments)}}()),tt=me("history/change",/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x47,_x48){return _ref23.apply(this,arguments)}}());d();c();l();u();d();c();l();u();var Tn=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});d();c();l();u();function Jl(){return{contextValues:{}}}d();c();l();u();var ed=()=>!1;d();c();l();u();function Ix(){return{contextValues:{}}}d();c();l();u();function Ty(){return{enabled:!0,tabs:{}}}function td(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function Ex(){return[]}d();c();l();u();function Yr(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function rd(){return{}}d();c();l();u();function Fx(){return{}}d();c();l();u();function nd(){return{}}function xt(e){return{context:e.context||Jl(),dictionaryFieldContext:e.dictionaryFieldContext||Ix(),facetSet:e.facetSet||pi(),numericFacetSet:e.numericFacetSet||di(),dateFacetSet:e.dateFacetSet||li(),categoryFacetSet:e.categoryFacetSet||ui(),automaticFacetSet:e.automaticFacetSet??Nl(),pagination:e.pagination||Yr(),query:e.query||ut(),tabSet:e.tabSet||nd(),advancedSearchQueries:e.advancedSearchQueries||Tn(),staticFilterSet:e.staticFilterSet||Fx(),querySet:e.querySet||rd(),sortCriteria:e.sortCriteria||ur(),pipeline:e.pipeline||Oc(),searchHub:e.searchHub||ii(),facetOptions:e.facetOptions||td(),facetOrder:e.facetOrder??Ex(),debug:e.debug??ed()}}d();c();l();u();var Wt=P("query/updateQuery",e=>_(e,{q:new $,enableQuerySyntax:new fe}));d();c();l();u();d();c();l();u();var Tx=()=>({caseContext:{},caseId:"",caseNumber:""}),ee=e=>({caseContext:e?.caseContext||{},caseId:e?.caseId,caseNumber:e?.caseNumber});var Py=()=>te("browseResults")("search/logFetchMoreResults",(e,t)=>e.logFetchMoreResults(ee(t.insightCaseContext))),Ai=e=>te("query")("search/queryError",(t,r)=>t.logQueryError({...ee(r.insightCaseContext),query:r.query?.q||ut().q,aq:"",cq:"",dq:"",errorType:e.type,errorMessage:e.message})),Px=(e,t)=>te("contextChanged")("analytics/contextChanged",(r,n)=>{let o={caseId:e,caseNumber:t,caseContext:n.insightCaseContext?.caseContext||{}};r.logContextChanged(o)}),od=()=>te("interfaceLoad")("analytics/interface/load",(e,t)=>e.logInterfaceLoad(ee(t.insightCaseContext))),Jn=()=>te("interfaceChange")("analytics/interface/change",(e,t)=>{e.logInterfaceChange({...ee(t.insightCaseContext),interfaceChangeTo:t.configuration.analytics.originLevel2})});d();c();l();u();d();c();l();u();function Kr(e){return Object.values(e).map(t=>t.request)}d();c();l();u();var kx=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=YD(e),n=WD(e);return Wr({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Qn(e.configuration.search.apiBaseUrl,e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,insightId:e.insightConfiguration.insightId,...(e.configuration.analytics.enabled&&(yield Zn(e.configuration.analytics,t))),q:e.query?.q,...(n.length&&{facets:n}),caseContext:e.insightCaseContext?.caseContext,...(r&&{cq:r}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),tab:e.configuration.analytics.originLevel2,...(e.folding&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.context&&{context:e.context.contextValues}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function kx(_x49,_x50){return _ref24.apply(this,arguments)}}(),Sr=/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0,n=yield kx(e,t);return{...n,request:{...n.request,...(e.pagination&&{firstResult:e.pagination.firstResult,numberOfResults:r()})}}});return function Sr(_x51,_x52){return _ref25.apply(this,arguments)}}(),Ox=/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=yield kx(e);return{...r,request:{...r.request,filterFieldRange:100,cq:`@${e?.folding?.fields.collection}="${t}"`}}});return function Ox(_x53,_x54){return _ref26.apply(this,arguments)}}(),ad=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){let r=yield Sr(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.pagination?.numberOfResults??0)},r});return function ad(_x55,_x56){return _ref27.apply(this,arguments)}}(),id=/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){let r=yield Sr(e,t);return r.request={...r.request,numberOfResults:0},r});return function id(_x57,_x58){return _ref28.apply(this,arguments)}}();function WD(e){return Kr({...e.facetSet,...e.numericFacetSet,...e.dateFacetSet,...e.categoryFacetSet})}function YD(e){return Object.values(e.tabSet||{}).find(n=>n.isActive)?.expression.trim()||""}var Ho=class{constructor(t,r=n=>{this.dispatch(Wt({q:n}))}){le(this,"config",t);le(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x59,_x60){var _this9=this;return _asyncToGenerator(function*({request:t,mappings:r},n){let o=Date.now(),a=kr(yield _this9.extra.apiClient.query(t,n),r),i=Date.now()-o,p=_this9.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:t}}).apply(this,arguments)}process(t){var _this0=this;return _asyncToGenerator(function*(){return _this0.processQueryErrorOrContinue(t)??(yield _this0.processQueryCorrectionsOrContinue(t))??_this0.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return He(t.response)?(this.dispatch(Ai(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this1=this;return _asyncToGenerator(function*(){let r=_this1.getState(),n=_this1.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o)return null;if(!a)return!J(f)&&!J(f.correctedQuery)?_this1.processNextDidYouMeanAutoCorrection(t):null;let m=i.length===0&&p&&p.length!==0,g=!J(f)&&!J(f.correctedQuery);if(!m&&!g)return null;let x=m?yield _this1.processLegacyDidYouMeanAutoCorrection(t):_this1.processNextDidYouMeanAutoCorrection(t);return _this1.dispatch(bt(xt(_this1.getState()))),x})()}processLegacyDidYouMeanAutoCorrection(t){var _this10=this;return _asyncToGenerator(function*(){let r=_this10.getCurrentQuery(),n=_this10.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this10.automaticallyRetryQueryWithCorrection(o);return He(a.response)?(_this10.dispatch(Ai(a.response.error)),_this10.rejectWithValue(a.response.error)):(_this10.dispatch(bt(xt(_this10.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processNextDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}automaticallyRetryQueryWithCorrection(t){var _this11=this;return _asyncToGenerator(function*(){_this11.onUpdateQueryForCorrection(t);let r=_this11.getState(),n=yield _this11.fetchFromAPI(yield Sr(r));return _this11.dispatch(Zt(t)),n})()}processSuccessResponse(t){return this.dispatch(bt(xt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return $n(t.response)?t.response.success:null}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}};d();c();l();u();d();c();l();u();d();c();l();u();var _x=()=>te("didYouMeanClick")("analytics/didyoumean/click",(e,t)=>e.logDidYouMeanClick(ee(t.insightCaseContext))),ky=()=>te("didYouMeanAutomatic")("analytics/didyoumean/automatic",(e,t)=>e.logDidYouMeanAutomatic(ee(t.insightCaseContext)));var zo=class{constructor(t,r=n=>{this.dispatch(Wt({q:n}))}){le(this,"config",t);le(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x61,_x62){var _this12=this;return _asyncToGenerator(function*({request:t,mappings:r},n){let o=Date.now(),a=kr(yield _this12.extra.apiClient.query(t,n),r),i=Date.now()-o,p=_this12.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:t}}).apply(this,arguments)}process(t,r){var _this13=this;return _asyncToGenerator(function*(){return _this13.processQueryErrorOrContinue(t)??(yield _this13.processQueryCorrectionsOrContinue(t,r))??_this13.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return He(t.response)?(this.dispatch(Ai(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t,r){var _this14=this;return _asyncToGenerator(function*(){let n=_this14.getState(),o=_this14.getSuccessResponse(t);if(!o||!n.didYouMean)return null;let{enableDidYouMean:a,automaticallyCorrectQuery:i}=n.didYouMean,{results:p,queryCorrections:f,queryCorrection:m}=o;if(!a||!i)return null;let g=p.length===0&&f&&f.length!==0,A=!J(m)&&!J(m.correctedQuery);if(!g&&!A)return null;let h=g?yield _this14.processLegacyDidYouMeanAutoCorrection(t):_this14.processNextDidYouMeanAutoCorrection(t);return _this14.logOriginalAnalyticsQueryBeforeAutoCorrection(t,r),_this14.dispatch(bt(xt(_this14.getState()))),h})()}processLegacyDidYouMeanAutoCorrection(t){var _this15=this;return _asyncToGenerator(function*(){let r=_this15.getCurrentQuery(),n=_this15.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this15.automaticallyRetryQueryWithCorrection(o);return He(a.response)?(_this15.dispatch(Ai(a.response.error)),_this15.rejectWithValue(a.response.error)):(_this15.dispatch(bt(xt(_this15.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:ky()})})()}processNextDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:ky()}}automaticallyRetryQueryWithCorrection(t){var _this16=this;return _asyncToGenerator(function*(){_this16.dispatch(Wt({q:t}));let r=_this16.getState(),n=yield _this16.fetchFromAPI(yield Sr(r));return _this16.dispatch(Zt(t)),n})()}processSuccessResponse(t){return this.dispatch(bt(xt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return $n(t.response)?t.response.success:null}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??ut().enableQuerySyntax},search:{...At(),duration:r,response:o,results:o.results}}}logOriginalAnalyticsQueryBeforeAutoCorrection(t,r){let n=this.getState(),o=kr(t.response,r.mappings).success;this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,n,o),this.extra)}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get analyticsAction(){return this.config.analyticsAction}};function Oy(_x63,_x64,_x65){return _Oy.apply(this,arguments)}function _Oy(){_Oy=_asyncToGenerator(function*(e,t,r){Nc(e);let n=new zo({...t,analyticsAction:r}),{analyticsClientMiddleware:o,preprocessRequest:a,logger:i}=t.extra,{description:p}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:o,preprocessRequest:a,logger:i}),f=yield Sr(e,p),m=yield n.fetchFromAPI(f);return yield n.process(m,f)});return _Oy.apply(this,arguments)}function _y(_x66,_x67,_x68){return _y2.apply(this,arguments)}function _y2(){_y2=_asyncToGenerator(function*(e,t,r){Nc(e);let n=new zo({...t,analyticsAction:r}),{analyticsClientMiddleware:o,preprocessRequest:a,logger:i}=t.extra,{description:p}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:o,preprocessRequest:a,logger:i}),f=yield Sr(e,p),m=yield n.fetchFromAPI(f);return yield n.process(m,f)});return _y2.apply(this,arguments)}function Ny(_x69,_x70){return _Ny.apply(this,arguments)}function _Ny(){_Ny=_asyncToGenerator(function*(e,t){let r=new zo({...t,analyticsAction:Py}),{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield Py().prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=yield ad(e,i),f=yield r.fetchFromAPI(p);return yield r.process(f,p)});return _Ny.apply(this,arguments)}function Dy(_x71,_x72,_x73){return _Dy.apply(this,arguments)}function _Dy(){_Dy=_asyncToGenerator(function*(e,t,r){let n=new zo({...t,analyticsAction:r}),{analyticsClientMiddleware:o,preprocessRequest:a,logger:i}=t.extra,{description:p}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:o,preprocessRequest:a,logger:i}),f=yield id(e,p),m=yield n.fetchFromAPI(f);return yield n.process(m,f)});return _Dy.apply(this,arguments)}var Nx=me("search/executeSearch",/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Oy(r,t,e)});return function(_x74,_x75){return _ref29.apply(this,arguments)}}()),Dx=me("search/fetchPage",/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t){let r=t.getState();return yield _y(r,t,e)});return function(_x76,_x77){return _ref30.apply(this,arguments)}}()),qx=me("search/fetchMoreResults",/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Ny(r,t)});return function(_x78,_x79){return _ref31.apply(this,arguments)}}()),Mx=me("search/fetchFacetValues",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Dy(r,t,e)});return function(_x80,_x81){return _ref32.apply(this,arguments)}}());var Vx=/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t,{request:r,mappings:n},o){let a=Date.now(),i=kr(yield e.query(r,o),n),p=Date.now()-a,f=t.query?.q||"";return{response:i,duration:p,queryExecuted:f,requestExecuted:r}});return function Vx(_x82,_x83,_x84,_x85){return _ref33.apply(this,arguments)}}(),be=me("search/executeSearch",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Oy(r,t,e.legacy);Nc(r);let n=new Ho({...t}),o=e.next?qy(e.next):void 0,a=yield Sr(r,o),i=yield n.fetchFromAPI(a);return yield n.process(i)});return function(_x86,_x87){return _ref34.apply(this,arguments)}}()),sd=me("search/fetchPage",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return _y(r,t,e.legacy);Nc(r);let n=new Ho({...t}),o=e.next?qy(e.next):void 0,a=yield Sr(r,o),i=yield n.fetchFromAPI(a);return yield n.process(i)});return function(_x88,_x89){return _ref35.apply(this,arguments)}}()),cd=me("search/fetchMoreResults",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ny(r,t);let n=new Ho({...t}),o=qy({actionCause:"browseResults"}),a=yield ad(r,o),i=yield n.fetchFromAPI(a);return yield n.process(i)});return function(_x90,_x91){return _ref36.apply(this,arguments)}}()),Ci=me("search/fetchFacetValues",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Dy(r,t,e.legacy);let n=new Ho({...t}),o=yield id(r),a=yield n.fetchFromAPI(o);return yield n.process(a)});return function(_x92,_x93){return _ref37.apply(this,arguments)}}()),ud=me("querySuggest/fetch",/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,validatePayload:o}}){o(e,{id:H});let a=e.id,i=yield xx(a,t()),p=yield n.querySuggest(i);return He(p)?r(p.error):{id:a,q:i.q,...p.success}});return function(_x94,_x95){return _ref38.apply(this,arguments)}}()),Nc=e=>{e.configuration.analytics.enabled&&Vt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},qy=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();d();c();l();u();var Jt=P("breadcrumb/deselectAll"),ld=P("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var bi=P("facet/updateFacetAutoSelection",e=>_(e,{allow:new fe({required:!0})}));d();c();l();u();d();c();l();u();var dd=class extends Kn{constructor(r){super(r);le(this,"getState",r)}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??ut().q}get responseTime(){return this.activeInstantResultCache?.duration??At().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??At().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var jx=()=>ze("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new dd(e)),Lx=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var My={id:H},KD={...My,q:Ke},fee=P("instantResults/register",e=>_(e,My)),pd=P("instantResults/updateQuery",e=>_(e,KD)),mee=P("instantResults/clearExpired",e=>_(e,My));d();c();l();u();var fd=new ne({required:!0,min:0}),md=P("pagination/registerNumberOfResults",e=>_(e,fd)),gd=P("pagination/updateNumberOfResults",e=>_(e,fd)),hd=P("pagination/registerPage",e=>_(e,fd)),eo=P("pagination/updatePage",e=>_(e,fd)),yd=P("pagination/nextPage"),Sd=P("pagination/previousPage");d();c();l();u();d();c();l();u();var Wo=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...(r&&{actionCause:r.actionCause}),...(r&&{customData:r.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.deviceId&&{deviceId:e.deviceId}),...(e.trackingId&&{trackingId:e.trackingId}),capture:t.capture??t.clientId!=="",source:ri(e)}});var xi=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??Kt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&Wo(e.configuration.analytics,t,r)),...(e.excerptLength&&!J(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();l();u();d();c();l();u();var to=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??Kt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Vt.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield Zn(e.configuration.analytics,t))),...(e.excerptLength&&!J(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function to(_x96,_x97){return _ref39.apply(this,arguments)}}();d();c();l();u();var Vy=()=>ze("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),ro=e=>ze("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||ut().q,aq:r.advancedSearchQueries?.aq||Tn().aq,cq:r.advancedSearchQueries?.cq||Tn().cq,dq:r.advancedSearchQueries?.dq||Tn().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var jy=()=>ze("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic()),Ux=()=>({actionCause:"didYouMeanClick"}),Qx=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();var gte=new Y({values:{undoneQuery:Ke},options:{required:!0}}),Bx=()=>ze("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);d();c();l();u();var wi=P("trigger/query/ignore",e=>_(e,new $({emptyAllowed:!0,required:!0}))),Ri=P("trigger/query/modification",e=>_(e,new Y({values:{originalQuery:We,modification:We}})));d();c();l();u();d();c();l();u();function Dc(e,t){let r={};e.forEach(a=>{r[a.facetId]=a});let n=[];t.forEach(a=>{a in r&&(n.push(r[a]),delete r[a])});let o=Object.values(r);return[...n,...o]}function Gx(e){return Kr(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var Ly={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function XD(e){return Kr(e).map(t=>{let r=Ly[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function ZD(e){return[...XD(e.facetSet??{}),...Gx(e.numericFacetSet??{}),...Gx(e.dateFacetSet??{}),...Kr(e.categoryFacetSet??{})]}function JD(e){return ZD(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function vd(e){return Dc(JD(e),e.facetOrder??[])}var no=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t){let r=rq(e),n=vd(e),o=eq(e),a=yield to(e,t),i=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Wr({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:i(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function no(_x98,_x99){return _ref40.apply(this,arguments)}}();function eq(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(tq).filter(r=>r.currentValues.length>0):void 0}function tq(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function rq(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=nq(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}function nq(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o})}var oo=class{constructor(t,r=n=>{this.dispatch(Wt({q:n}))}){le(this,"config",t);le(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x100,_x101){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=kr(yield _this17.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this17.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return He(t.response)?(this.dispatch(ro(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o||!a)return null;let m=i.length===0&&p&&p.length!==0,g=!J(f)&&!J(f.correctedQuery);if(!m&&!g)return null;let x=m?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(bt(xt(_this19.getState()))),x})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this20.automaticallyRetryQueryWithCorrection(o);return He(a.response)?(_this20.dispatch(ro(a.response.error)),_this20.rejectWithValue(a.response.error)):(_this20.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this20.dispatch(bt(xt(_this20.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:jy()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:jy()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(wi("")),null;_this21.analyticsAction&&(yield _this21.dispatch(_this21.analyticsAction));let a=_this21.getCurrentQuery(),i=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return He(i.response)?(_this21.dispatch(ro(i.response.error)),_this21.rejectWithValue(i.response.error)):(_this21.dispatch(bt(xt(_this21.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a,analyticsAction:Bx()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??ut().enableQuerySyntax},search:{...At(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(bt(xt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return $n(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=yield _this22.fetchFromAPI(yield no(_this22.getState()),{origin:"mainSearch"});return _this22.dispatch(Zt(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Ri({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield no(_this23.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var Cre=me("search/executeSearch",/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Ad(r,t,e)});return function(_x102,_x103){return _ref41.apply(this,arguments)}}()),bre=me("search/fetchPage",/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Qy(r,t,e)});return function(_x104,_x105){return _ref42.apply(this,arguments)}}()),xre=me("search/fetchMoreResults",/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(e,t){let r=t.getState();return yield By(t,r)});return function(_x106,_x107){return _ref43.apply(this,arguments)}}()),wre=me("search/fetchFacetValues",/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(e,t){let r=t.getState();return yield sq(t,e,r)});return function(_x108,_x109){return _ref44.apply(this,arguments)}}()),Rre=me("search/fetchInstantResults",/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e,t){return Uy(e,t)});return function(_x110,_x111){return _ref45.apply(this,arguments)}}()),oq=/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t){let r=yield no(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function oq(_x112,_x113){return _ref46.apply(this,arguments)}}(),aq=/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,t,r){let n=yield to(e);return Wr({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function aq(_x114,_x115,_x116){return _ref47.apply(this,arguments)}}(),iq=/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t){let r=yield no(e,t);return r.request.numberOfResults=0,r});return function iq(_x117,_x118){return _ref48.apply(this,arguments)}}(),$x=e=>{e.configuration.analytics.enabled&&Vt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Uy(_x119,_x120){return _Uy.apply(this,arguments)}function _Uy(){_Uy=_asyncToGenerator(function*(e,t){_(e,{id:H,q:H,maxResultsPerQuery:new ne({required:!0,min:1}),cacheTimeout:new ne});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),a=new oo({...t,analyticsAction:jx()},m=>{t.dispatch(pd({q:m,id:e.id}))}),i=yield aq(o,r,n),p=yield a.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),f=yield a.process(p);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _Uy.apply(this,arguments)}function Qy(_x121,_x122,_x123){return _Qy.apply(this,arguments)}function _Qy(){_Qy=_asyncToGenerator(function*(e,t,r){$x(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new oo({...t,analyticsAction:r}),f=yield no(e,i),m=yield p.fetchFromAPI(f,{origin:"mainSearch"});return yield p.process(m)});return _Qy.apply(this,arguments)}function By(_x124,_x125){return _By.apply(this,arguments)}function _By(){_By=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:a}=yield Vy().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),i=new oo({...e,analyticsAction:Vy()}),p=yield oq(t,a),f=yield i.fetchFromAPI(p,{origin:"mainSearch"});return yield i.process(f)});return _By.apply(this,arguments)}function sq(_x126,_x127,_x128){return _sq.apply(this,arguments)}function _sq(){_sq=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=e.extra,{description:i}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new oo({...e,analyticsAction:t}),f=yield iq(r,i),m=yield p.fetchFromAPI(f,{origin:"facetValues"});return yield p.process(m)});return _sq.apply(this,arguments)}function Ad(_x129,_x130,_x131){return _Ad.apply(this,arguments)}function _Ad(){_Ad=_asyncToGenerator(function*(e,t,r){$x(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=yield no(e,i),f=new oo({...t,analyticsAction:r}),m=yield f.fetchFromAPI(p,{origin:"mainSearch"});return yield f.process(m)});return _Ad.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var Hx=ct(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o}));var vr=/*#__PURE__*/function(){var _ref49=_asyncToGenerator(function*(e,t,r){let n=$y(e),o=cq(e),a=uq(e),i=e.configuration.analytics.analyticsMode==="legacy"?yield to(e,r):xi(e,t,r);return Wr({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:Gy(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:a}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function vr(_x132,_x133,_x134){return _ref49.apply(this,arguments)}}();function Gy(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function cq(e){return Dc(dq(e),e.facetOrder??[])}function uq(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(lq).filter(r=>r.currentValues.length>0):void 0}function lq(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function dq(e){return pq(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function pq(e){return[...fq(e.facetSet??{}),...zx(e.numericFacetSet??{}),...zx(e.dateFacetSet??{}),...Kr(e.categoryFacetSet??{})]}function fq(e){return Kr(e).map(t=>{let r=Ly[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function zx(e){return Kr(e).map(t=>{let r=t.currentValues,n=r.some(({state:a})=>a!=="idle"),o=r.some(a=>a.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function $y(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=Hx(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}var ao=class{constructor(t,r=n=>{this.dispatch(Wt({q:n}))}){le(this,"config",t);le(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x135,_x136){var _this24=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=kr(yield _this24.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this24.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this25=this;return _asyncToGenerator(function*(){return _this25.processQueryErrorOrContinue(t)??(yield _this25.processQueryCorrectionsOrContinue(t))??(yield _this25.processQueryTriggersOrContinue(t))??_this25.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return He(t.response)?(this.dispatch(ro(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this26=this;return _asyncToGenerator(function*(){let r=_this26.getState(),n=_this26.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o)return null;if(!a)return!J(f)&&!J(f.correctedQuery)?_this26.processModernDidYouMeanAutoCorrection(t):null;let m=i.length===0&&p&&p.length!==0,g=!J(f)&&!J(f.correctedQuery);if(!m&&!g)return null;let x=m?yield _this26.processLegacyDidYouMeanAutoCorrection(t):_this26.processModernDidYouMeanAutoCorrection(t);return _this26.dispatch(bt(xt(_this26.getState()))),x})()}processLegacyDidYouMeanAutoCorrection(t){var _this27=this;return _asyncToGenerator(function*(){let r=_this27.getCurrentQuery(),n=_this27.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this27.automaticallyRetryQueryWithCorrection(o);return He(a.response)?(_this27.dispatch(ro(a.response.error)),_this27.rejectWithValue(a.response.error)):(_this27.dispatch(bt(xt(_this27.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this28=this;return _asyncToGenerator(function*(){let r=_this28.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this28.getState().triggers?.queryModification.queryToIgnore===n)return _this28.dispatch(wi("")),null;let a=_this28.getCurrentQuery(),i=yield _this28.automaticallyRetryQueryWithTriggerModification(n);return He(i.response)?(_this28.dispatch(ro(i.response.error)),_this28.rejectWithValue(i.response.error)):(_this28.dispatch(bt(xt(_this28.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a})})()}processSuccessResponse(t){return this.dispatch(bt(xt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return $n(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this29=this;return _asyncToGenerator(function*(){_this29.onUpdateQueryForCorrection(t);let r=_this29.getState(),{actionCause:n}=Qx(),o=yield _this29.fetchFromAPI(yield vr(r,_this29.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this29.dispatch(Zt(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this30=this;return _asyncToGenerator(function*(){return _this30.dispatch(Ri({newQuery:t,originalQuery:_this30.getCurrentQuery()})),_this30.onUpdateQueryForCorrection(t),yield _this30.fetchFromAPI(yield vr(_this30.getState(),_this30.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var Ii=me("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;_(e,{q:new $,enableQuerySyntax:new fe,clearFilters:new fe}),e.clearFilters&&(r(Jt()),r(ld())),r(bi({allow:!0})),r(Wt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(eo(1))}),Wx=P("search/updateSearchAction"),ke=me("search/executeSearch",/*#__PURE__*/function(){var _ref50=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ad(r,t,e.legacy);Yx(r);let n=e.next?Kx(e.next):void 0,o=yield vr(r,t.extra.navigatorContext,n),a=new ao({...t,analyticsAction:n??{}}),i=yield a.fetchFromAPI(o,{origin:"mainSearch"});return yield a.process(i)});return function(_x137,_x138){return _ref50.apply(this,arguments)}}()),Zr=me("search/fetchPage",/*#__PURE__*/function(){var _ref51=_asyncToGenerator(function*(e,t){let r=t.getState();if(Yx(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return Qy(r,t,e.legacy);let n=new ao({...t,analyticsAction:e.next}),o=yield vr(r,t.extra.navigatorContext,e.next),a=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(a)});return function(_x139,_x140){return _ref51.apply(this,arguments)}}()),io=me("search/fetchMoreResults",/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return By(t,r);let n=ix("browseResults",t.getState),o=new ao({...t,analyticsAction:n}),a=yield mq(r,t.extra.navigatorContext,n),i=yield o.fetchFromAPI(a,{origin:"mainSearch"});return yield o.process(i)});return function(_x141,_x142){return _ref52.apply(this,arguments)}}()),Ei=me("search/fetchFacetValues",/*#__PURE__*/function(){var _ref53=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ad(r,t,e.legacy);let n=new ao({...t,analyticsAction:{}}),o=yield hq(r,t.extra.navigatorContext),a=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(a)});return function(_x143,_x144){return _ref53.apply(this,arguments)}}()),Tne=me("search/fetchInstantResults",/*#__PURE__*/function(){var _ref54=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Uy(e,t);_(e,{id:H,q:H,maxResultsPerQuery:new ne({required:!0,min:1}),cacheTimeout:new ne});let{q:n,maxResultsPerQuery:o}=e,a=Kx(Lx()),i=yield gq(r,t.extra.navigatorContext,n,o,a),p=new ao({...t,analyticsAction:a},g=>{t.dispatch(pd({q:g,id:e.id}))}),f=yield p.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),m=yield p.process(f);return"response"in m?{results:m.response.results,searchUid:m.response.searchUid,totalCountFiltered:m.response.totalCountFiltered,duration:m.duration}:m});return function(_x145,_x146){return _ref54.apply(this,arguments)}}()),mq=/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(e,t,r){let n=yield vr(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function mq(_x147,_x148,_x149){return _ref55.apply(this,arguments)}}(),gq=/*#__PURE__*/function(){var _ref56=_asyncToGenerator(function*(e,t,r,n,o){let a=xi(e,t,o);return Wr({...a,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function gq(_x150,_x151,_x152,_x153,_x154){return _ref56.apply(this,arguments)}}(),hq=/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(e,t,r){let n=yield vr(e,t,r);return n.request.numberOfResults=0,n});return function hq(_x155,_x156,_x157){return _ref57.apply(this,arguments)}}(),Yx=e=>{e.configuration.analytics.enabled&&Vt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},Kx=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();function Xx(_x158,_x159){return _Xx.apply(this,arguments)}function _Xx(){_Xx=_asyncToGenerator(function*(e,t){let{search:r,accessToken:n,organizationId:o}=e.configuration,a=e.query?.q||"";return{url:r.apiBaseUrl??Kt(e.configuration.organizationId,e.configuration.environment),accessToken:n,organizationId:o,enableNavigation:!1,q:a,...t,requestedOutputSize:t.requestedOutputSize||0,...(r.authenticationProviders.length&&{authentication:r.authenticationProviders.join(",")})}});return _Xx.apply(this,arguments)}var qc=me("resultPreview/fetchResultContent",/*#__PURE__*/function(){var _ref58=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),a=yield Xx(o,e),i=yield t.apiClient.html(a);return He(i)?n(i.error):{content:i.success,uniqueId:e.uniqueId}});return function(_x160,_x161){return _ref58.apply(this,arguments)}}()),Cd=P("resultPreview/next"),bd=P("resultPreview/previous"),Jx=P("resultPreview/prepare",e=>_(e,{results:new oe({required:!0})})),Zx=2048,xd=me("resultPreview/updateContentURL",/*#__PURE__*/function(){var _ref59=_asyncToGenerator(function*(e,{getState:t,extra:r}){let n=t(),o=BA(yield e.buildResultPreviewRequest(n,{uniqueId:e.uniqueId,requestedOutputSize:e.requestedOutputSize}),e.path);return o?.length>Zx&&r.logger.error(`The content URL was truncated as it exceeds the maximum allowed length of ${Zx} characters.`),{contentURL:o}});return function(_x162,_x163){return _ref59.apply(this,arguments)}}());d();c();l();u();function Hy(){return{uniqueId:"",content:"",isLoading:!1,position:-1,resultsWithPreview:[]}}var zy=e=>{let{content:t,isLoading:r,uniqueId:n,contentURL:o}=Hy();e.content=t,e.isLoading=r,e.uniqueId=n,e.contentURL=o},Wy=e=>e.filter(t=>t.hasHtmlVersion).map(t=>t.uniqueId),Fi=pe(Hy(),e=>{e.addCase(qc.pending,t=>{t.isLoading=!0}).addCase(qc.fulfilled,(t,r)=>{let{content:n,uniqueId:o}=r.payload;t.position=t.resultsWithPreview.indexOf(o),t.content=n,t.uniqueId=o,t.isLoading=!1}).addCase(ke.fulfilled,(t,r)=>{zy(t),t.resultsWithPreview=Wy(r.payload.response.results)}).addCase(io.fulfilled,(t,r)=>{zy(t),t.resultsWithPreview=t.resultsWithPreview.concat(Wy(r.payload.response.results))}).addCase(Zr.fulfilled,zy).addCase(Jx,(t,r)=>{t.resultsWithPreview=Wy(r.payload.results)}).addCase(Cd,t=>{if(t.isLoading)return;let r=t.position+1;r>t.resultsWithPreview.length-1&&(r=0),t.position=r}).addCase(bd,t=>{if(t.isLoading)return;let r=t.position-1;r<0&&(r=t.resultsWithPreview.length-1),t.position=r}).addCase(xd.fulfilled,(t,r)=>{t.contentURL=r.payload.contentURL})});d();c();l();u();d();c();l();u();var so=(e,t)=>{let r=e;return J(r[t])?J(e.raw[t])?null:e.raw[t]:r[t]},yq=e=>t=>e.every(r=>!J(so(t,r))),Sq=e=>t=>e.every(r=>J(so(t,r))),vq=(e,t)=>r=>{let n=ew(e,r);return t.some(o=>n.some(a=>`${a}`.toLowerCase()===o.toLowerCase()))},Aq=(e,t)=>r=>{let n=ew(e,r);return t.every(o=>n.every(a=>`${a}`.toLowerCase()!==o.toLowerCase()))},ew=(e,t)=>{let r=so(t,e);return Nu(r)?r:[r]},tw={getResultProperty:so,fieldsMustBeDefined:yq,fieldsMustNotBeDefined:Sq,fieldMustMatch:vq,fieldMustNotMatch:Aq};function wd(e){return e.search.response.searchUid!==""}function rw(e,t,r){return e.search.results.find(n=>so(n,t)===r)}var Yy=ct(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();d();c();l();u();var Ti=P("app/setError");function Ky(e,t){let r=t.payload??null;r&&(e.response=At().response,e.results=[],e.questionAnswer=Wa()),e.error=r,e.isLoading=!1}function Xy(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function Cq(e,t){Xy(e,t),e.results=t.payload.response.results.map(r=>({...r,searchUid:t.payload.response.searchUid})),e.searchResponseId=t.payload.response.searchUid,e.questionAnswer=t.payload.response.questionAnswer,e.extendedResults=t.payload.response.extendedResults}function nw(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function bq(e,t){e.isLoading=!0,e.searchAction={actionCause:"browseResults"},e.requestId=t.meta.requestId}var Ie=pe(At(),e=>{e.addCase(ke.rejected,(t,r)=>Ky(t,r)),e.addCase(io.rejected,(t,r)=>Ky(t,r)),e.addCase(Zr.rejected,(t,r)=>Ky(t,r)),e.addCase(ke.fulfilled,(t,r)=>{Cq(t,r)}),e.addCase(io.fulfilled,(t,r)=>{Xy(t,r),t.results=[...t.results,...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(Zr.fulfilled,(t,r)=>{Xy(t,r),t.results=[...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(Ei.fulfilled,(t,r)=>{t.response.facets=r.payload.response.facets,t.response.searchUid=r.payload.response.searchUid}),e.addCase(ke.pending,nw),e.addCase(io.pending,bq),e.addCase(Zr.pending,nw),e.addCase(Wx,(t,r)=>{t.searchAction=r.payload}),e.addCase(Ti,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();var Rd=pe(ii(),e=>{e.addCase(Kl,(t,r)=>r.payload).addCase(tt.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(vi,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var ow=class extends Error{constructor(t){super(t[0].message);le(this,"issues");this.name="SchemaError",this.issues=t}};var kn="uninitialized",Jy="pending",Vc="fulfilled",jc="rejected";function aw(e){return{status:e,isUninitialized:e===kn,isLoading:e===Jy,isSuccess:e===Vc,isError:e===jc}}var iw=Lr;function Aw(e,t){if(e===t||!(iw(e)&&iw(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,a=Array.isArray(t)?[]:{};for(let i of r)a[i]=Aw(e[i],t[i]),o&&(o=e[i]===a[i]);return o?e:a}function eS(e,t,r){return e.reduce((n,o,a)=>(t(o,a)&&n.push(r(o,a)),n),[]).flat()}function xq(e){return new RegExp("(^|:)//").test(e)}function wq(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function oS(e){return e!=null}function sw(e){return[...(e?.values()??[])].filter(oS)}function Rq(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var Iq=e=>e.replace(/\/$/,""),Eq=e=>e.replace(/^\//,"");function Fq(e,t){if(!e)return t;if(!t)return e;if(xq(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=Iq(e),t=Eq(t),`${e}${r}${t}`}function Fd(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var tS=()=>new Map,Tq=e=>{let t=new s.AbortController;return setTimeout(()=>{let r="signal timed out",n="TimeoutError";t.abort(typeof DOMException<"u"?new DOMException(r,n):Object.assign(new Error(r),{name:n}))},e),t.signal},Pq=(...e)=>{for(let r of e)if(r.aborted)return s.AbortSignal.abort(r.reason);let t=new s.AbortController;for(let r of e)r.addEventListener("abort",()=>t.abort(r.reason),{signal:t.signal,once:!0});return t.signal},cw=(...e)=>v(...e),kq=e=>e.status>=200&&e.status<=299,Oq=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function uw(e){if(!Lr(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}var _q=e=>typeof e=="object"&&(Lr(e)||Array.isArray(e)||typeof e.toJSON=="function");function Cw({baseUrl:e,prepareHeaders:t=A=>A,fetchFn:r=cw,paramsSerializer:n,isJsonContentType:o=Oq,jsonContentType:a="application/json",jsonReplacer:i,timeout:p,responseHandler:f,validateStatus:m,...g}={}){return typeof v>"u"&&r===cw&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref60=_asyncToGenerator(function*(x,h,y){let{getState:b,extra:w,endpoint:I,forced:F,type:E}=h,k,{url:T,headers:q=new C(g.headers),params:G=void 0,responseHandler:Q=f??"json",validateStatus:j=m??kq,timeout:B=p,...L}=typeof x=="string"?{url:x}:x,N={...g,signal:B?Pq(h.signal,Tq(B)):h.signal,...L};q=new C(uw(q)),N.headers=(yield t(q,{getState:b,arg:x,extra:w,endpoint:I,forced:F,type:E,extraOptions:y}))||q;let D=_q(N.body);if(N.body!=null&&!D&&typeof N.body!="string"&&N.headers.delete("content-type"),!N.headers.has("content-type")&&D&&N.headers.set("content-type",a),D&&o(N.headers)&&(N.body=JSON.stringify(N.body,i)),N.headers.has("accept")||(Q==="json"?N.headers.set("accept","application/json"):Q==="text"&&N.headers.set("accept","text/plain, text/html, */*")),G){let ce=~T.indexOf("?")?"&":"?",ve=n?n(G):new URLSearchParams(uw(G));T+=ce+ve}T=Fq(e,T);let M=new Request(T,N);k={request:new Request(T,N)};let z;try{z=yield r(M)}catch(ce){return{error:{status:(ce instanceof Error||typeof DOMException<"u"&&ce instanceof DOMException)&&ce.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ce)},meta:k}}let re=z.clone();k.response=re;let Z,K="";try{let ce;if(yield Promise.all([A(z,Q).then(ve=>Z=ve,ve=>ce=ve),re.text().then(ve=>K=ve,()=>{})]),ce)throw ce}catch(ce){return{error:{status:"PARSING_ERROR",originalStatus:z.status,data:K,error:String(ce)},meta:k}}return j(z,Z)?{data:Z,meta:k}:{error:{status:z.status,data:Z},meta:k}});return function(_x164,_x165,_x166){return _ref60.apply(this,arguments)}}());function A(_x167,_x168){return _A2.apply(this,arguments)}function _A2(){_A2=_asyncToGenerator(function*(x,h){if(typeof h=="function")return h(x);if(h==="content-type"&&(h=o(x.headers)?"json":"text"),h==="json"){let y=yield x.text();return y.length?JSON.parse(y):null}return x.text()});return _A2.apply(this,arguments)}}var Pi=class{constructor(e,t=void 0){le(this,"value");le(this,"meta");this.value=e,this.meta=t}};function Nq(){return _Nq.apply(this,arguments)}function _Nq(){_Nq=_asyncToGenerator(function*(e=0,t=5,r){let n=Math.min(e,t),o=~~((Math.random()+.4)*(300<<n));yield new Promise((a,i)=>{let p=setTimeout(()=>a(),o);if(r){let f=()=>{clearTimeout(p),i(new Error("Aborted"))};r.aborted?(clearTimeout(p),i(new Error("Aborted"))):r.addEventListener("abort",f,{once:!0})}})});return _Nq.apply(this,arguments)}function bw(e,t){throw Object.assign(new Pi({error:e,meta:t}),{throwImmediately:!0})}function Zy(e){e.aborted&&bw({status:"CUSTOM_ERROR",error:"Aborted"})}var lw={},Dq=(e,t)=>(/*#__PURE__*/function(){var _ref61=_asyncToGenerator(function*(r,n,o){let a=[5,(t||lw).maxRetries,(o||lw).maxRetries].filter(g=>g!==void 0),[i]=a.slice(-1),f={maxRetries:i,backoff:Nq,retryCondition:(g,A,{attempt:x})=>x<=i,...t,...o},m=0;for(;;){Zy(n.signal);try{let g=yield e(r,n,o);if(g.error)throw new Pi(g);return g}catch(g){if(m++,g.throwImmediately){if(g instanceof Pi)return g.value;throw g}if(g instanceof Pi){if(!f.retryCondition(g.value.error,r,{attempt:m,baseQueryApi:n,extraOptions:o}))return g.value}else if(m>f.maxRetries)return{error:g};Zy(n.signal);try{yield f.backoff(m,f.maxRetries,n.signal)}catch(A){throw Zy(n.signal),A}}}});return function(_x169,_x170,_x171){return _ref61.apply(this,arguments)}}()),xw=Object.assign(Dq,{fail:bw}),Pd="__rtkq/",qq="online",Mq="offline";var ww="focused";var aS=P(`${Pd}${ww}`),Rw=P(`${Pd}un${ww}`),iS=P(`${Pd}${qq}`),Iw=P(`${Pd}${Mq}`);var Qc="query",Ew="mutation",Fw="infinitequery";function kd(e){return e.type===Qc}function Vq(e){return e.type===Ew}function Od(e){return e.type===Fw}function Td(e){return kd(e)||Od(e)}function sS(e,t,r,n,o,a){let i=jq(e)?e(t,r,n,o):e;return i?eS(i,oS,p=>a(Tw(p))):[]}function jq(e){return typeof e=="function"}function Tw(e){return typeof e=="string"?{type:e}:e}function Lq(e,t){return e.catch(t)}var ki=(e,t)=>e.endpointDefinitions[t],Lc=Symbol("forceQueryFn"),rS=e=>typeof e[Lc]=="function";function Uq({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:a,getInternalState:i}){let p=T=>i(T)?.runningQueries,f=T=>i(T)?.runningMutations,{unsubscribeQueryResult:m,removeMutationResult:g,updateSubscriptionOptions:A}=o.internalActions;return{buildInitiateQuery:F,buildInitiateInfiniteQuery:E,buildInitiateMutation:k,getRunningQueryThunk:x,getRunningMutationThunk:h,getRunningQueriesThunk:y,getRunningMutationsThunk:b};function x(T,q){return G=>{let Q=ki(a,T),j=e({queryArgs:q,endpointDefinition:Q,endpointName:T});return p(G)?.get(j)}}function h(T,q){return G=>f(G)?.get(q)}function y(){return T=>sw(p(T))}function b(){return T=>sw(f(T))}function w(T){}function I(T,q){let G=(Q,{subscribe:j=!0,forceRefetch:B,subscriptionOptions:L,[Lc]:N,...D}={})=>(M,W)=>{let z=e({queryArgs:Q,endpointDefinition:q,endpointName:T}),re,Z={...D,type:Qc,subscribe:j,forceRefetch:B,subscriptionOptions:L,endpointName:T,originalArgs:Q,queryCacheKey:z,[Lc]:N};if(kd(q))re=t(Z);else{let{direction:Re,initialPageParam:_e,refetchCachedPages:Fe}=D;re=r({...Z,direction:Re,initialPageParam:_e,refetchCachedPages:Fe})}let K=o.endpoints[T].select(Q),ce=M(re),ve=K(W());let{requestId:Ve,abort:nt}=ce,Ge=ve.requestId!==Ve,Je=p(M)?.get(z),et=()=>K(W()),Ee=Object.assign(N?ce.then(et):Ge&&!Je?Promise.resolve(ve):Promise.all([Je,ce]).then(et),{arg:Q,requestId:Ve,subscriptionOptions:L,queryCacheKey:z,abort:nt,unwrap(){return _asyncToGenerator(function*(){let Re=yield Ee;if(Re.isError)throw Re.error;return Re.data})()},refetch:Re=>M(G(Q,{subscribe:!1,forceRefetch:!0,...Re})),unsubscribe(){j&&M(m({queryCacheKey:z,requestId:Ve}))},updateSubscriptionOptions(Re){Ee.subscriptionOptions=Re,M(A({endpointName:T,requestId:Ve,queryCacheKey:z,options:Re}))}});if(!Je&&!Ge&&!N){let Re=p(M);Re.set(z,Ee),Ee.then(()=>{Re.delete(z)})}return Ee};return G}function F(T,q){return I(T,q)}function E(T,q){return I(T,q)}function k(T){return(q,{track:G=!0,fixedCacheKey:Q}={})=>(j,B)=>{let L=n({type:"mutation",endpointName:T,originalArgs:q,track:G,fixedCacheKey:Q}),N=j(L);let{requestId:D,abort:M,unwrap:W}=N,z=Lq(N.unwrap().then(ce=>({data:ce})),ce=>({error:ce})),re=()=>{j(g({requestId:D,fixedCacheKey:Q}))},Z=Object.assign(z,{arg:N.arg,requestId:D,abort:M,unwrap:W,reset:re}),K=f(j);return K.set(D,Z),Z.then(()=>{K.delete(D)}),Q&&(K.set(Q,Z),Z.then(()=>{K.get(Q)===Z&&K.delete(Q)})),Z}}}var Pw=class extends ow{constructor(t,r,n,o){super(t);le(this,"value");le(this,"schemaName");le(this,"_bqMeta");this.value=r,this.schemaName=n,this._bqMeta=o}},Yo=(e,t)=>Array.isArray(e)?e.includes(t):!!e;function Ko(_x172,_x173,_x174,_x175){return _Ko.apply(this,arguments)}function _Ko(){_Ko=_asyncToGenerator(function*(e,t,r,n){let o=yield e["~standard"].validate(t);if(o.issues)throw new Pw(o.issues,t,r,n);return o.value});return _Ko.apply(this,arguments)}function dw(e){return e}var Mc=(e={})=>({...e,[Ac]:!0});function Qq({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:a,selectors:i,onSchemaFailure:p,catchSchemaFailure:f,skipSchemaValidation:m}){let g=(L,N,D,M)=>(W,z)=>{let re=r[L],Z=n({queryArgs:N,endpointDefinition:re,endpointName:L});if(W(o.internalActions.queryResultPatched({queryCacheKey:Z,patches:D})),!M)return;let K=o.endpoints[L].select(N)(z()),ce=sS(re.providesTags,K.data,void 0,N,{},a);W(o.internalActions.updateProvidedBy([{queryCacheKey:Z,providedTags:ce}]))};function A(L,N,D=0){let M=[N,...L];return D&&M.length>D?M.slice(0,-1):M}function x(L,N,D=0){let M=[...L,N];return D&&M.length>D?M.slice(1):M}let h=(L,N,D,M=!0)=>(W,z)=>{let Z=o.endpoints[L].select(N)(z()),K={patches:[],inversePatches:[],undo:()=>W(o.util.patchQueryData(L,N,K.inversePatches,M))};if(Z.status===kn)return K;let ce;if("data"in Z)if(Ht(Z.data)){let[ve,Ve,nt]=kh(Z.data,D);K.patches.push(...Ve),K.inversePatches.push(...nt),ce=ve}else ce=D(Z.data),K.patches.push({op:"replace",path:[],value:ce}),K.inversePatches.push({op:"replace",path:[],value:Z.data});return K.patches.length===0||W(o.util.patchQueryData(L,N,K.patches,M)),K},y=(L,N,D)=>M=>M(o.endpoints[L].initiate(N,{subscribe:!1,forceRefetch:!0,[Lc]:()=>({data:D})})),b=(L,N)=>L.query&&L[N]?L[N]:dw,w=/*#__PURE__*/function(){var _ref62=_asyncToGenerator(function*(L,{signal:N,abort:D,rejectWithValue:M,fulfillWithValue:W,dispatch:z,getState:re,extra:Z}){let K=r[L.endpointName],{metaSchema:ce,skipSchemaValidation:ve=m}=K,Ve=L.type===Qc;try{let nt=dw,Ge={signal:N,abort:D,dispatch:z,getState:re,extra:Z,endpoint:L.endpointName,type:L.type,forced:Ve?I(L,re()):void 0,queryCacheKey:Ve?L.queryCacheKey:void 0},Je=Ve?L[Lc]:void 0,et,Ee=/*#__PURE__*/function(){var _ref63=_asyncToGenerator(function*(_e,Fe,gt,vt){if(Fe==null&&_e.pages.length)return Promise.resolve({data:_e});let Ir={queryArg:L.originalArgs,pageParam:Fe},ir=yield Re(Ir),Vr=vt?A:x;return{data:{pages:Vr(_e.pages,ir.data,gt),pageParams:Vr(_e.pageParams,Fe,gt)},meta:ir.meta}});return function Ee(_x178,_x179,_x180,_x181){return _ref63.apply(this,arguments)}}();function Re(_x182){return _Re.apply(this,arguments)}function _Re(){_Re=_asyncToGenerator(function*(_e){let Fe,{extraOptions:gt,argSchema:vt,rawResponseSchema:Ir,responseSchema:ir}=K;if(vt&&!Yo(ve,"arg")&&(_e=yield Ko(vt,_e,"argSchema",{})),Je?Fe=Je():K.query?(nt=b(K,"transformResponse"),Fe=yield t(K.query(_e),Ge,gt)):Fe=yield K.queryFn(_e,Ge,gt,Er=>t(Er,Ge,gt)),typeof process<"u",Fe.error)throw new Pi(Fe.error,Fe.meta);let{data:Vr}=Fe;Ir&&!Yo(ve,"rawResponse")&&(Vr=yield Ko(Ir,Fe.data,"rawResponseSchema",Fe.meta));let fr=yield nt(Vr,Fe.meta,_e);return ir&&!Yo(ve,"response")&&(fr=yield Ko(ir,fr,"responseSchema",Fe.meta)),{...Fe,data:fr}});return _Re.apply(this,arguments)}if(Ve&&"infiniteQueryOptions"in K){let{infiniteQueryOptions:_e}=K,{maxPages:Fe=1/0}=_e,gt=L.refetchCachedPages??_e.refetchCachedPages??!0,vt,Ir={pages:[],pageParams:[]},ir=i.selectQueryEntry(re(),L.queryCacheKey)?.data,fr=I(L,re())&&!L.direction||!ir?Ir:ir;if("direction"in L&&L.direction&&fr.pages.length){let Er=L.direction==="backward",Eu=(Er?kw:nS)(_e,fr,L.originalArgs);vt=yield Ee(fr,Eu,Fe,Er)}else{let{initialPageParam:Er=_e.initialPageParam}=L,Gs=ir?.pageParams??[],Eu=Gs[0]??Er,Ek=Gs.length;if(vt=yield Ee(fr,Eu,Fe),Je&&(vt={data:vt.data.pages[0]}),gt)for(let Qv=1;Qv<Ek;Qv++){let Fk=nS(_e,vt.data,L.originalArgs);vt=yield Ee(vt.data,Fk,Fe)}}et=vt}else et=yield Re(L.originalArgs);return ce&&!Yo(ve,"meta")&&et.meta&&(et.meta=yield Ko(ce,et.meta,"metaSchema",et.meta)),W(et.data,Mc({fulfilledTimeStamp:Date.now(),baseQueryMeta:et.meta}))}catch(nt){let Ge=nt;if(Ge instanceof Pi){let Je=b(K,"transformErrorResponse"),{rawErrorResponseSchema:et,errorResponseSchema:Ee}=K,{value:Re,meta:_e}=Ge;try{et&&!Yo(ve,"rawErrorResponse")&&(Re=yield Ko(et,Re,"rawErrorResponseSchema",_e)),ce&&!Yo(ve,"meta")&&(_e=yield Ko(ce,_e,"metaSchema",_e));let Fe=yield Je(Re,_e,L.originalArgs);return Ee&&!Yo(ve,"errorResponse")&&(Fe=yield Ko(Ee,Fe,"errorResponseSchema",_e)),M(Fe,Mc({baseQueryMeta:_e}))}catch(Fe){Ge=Fe}}try{if(Ge instanceof Pw){let Je={endpoint:L.endpointName,arg:L.originalArgs,type:L.type,queryCacheKey:Ve?L.queryCacheKey:void 0};K.onSchemaFailure?.(Ge,Je),p?.(Ge,Je);let{catchSchemaFailure:et=f}=K;if(et)return M(et(Ge,Je),Mc({baseQueryMeta:Ge._bqMeta}))}}catch(Je){Ge=Je}throw typeof process<"u",console.error(Ge),Ge}});return function w(_x176,_x177){return _ref62.apply(this,arguments)}}();function I(L,N){let D=i.selectQueryEntry(N,L.queryCacheKey),M=i.selectConfig(N).refetchOnMountOrArgChange,W=D?.fulfilledTimeStamp,z=L.forceRefetch??(L.subscribe&&M);return z?z===!0||(Number(new Date)-Number(W))/1e3>=z:!1}let F=()=>me(`${e}/executeQuery`,w,{getPendingMeta({arg:N}){let D=r[N.endpointName];return Mc({startedTimeStamp:Date.now(),...(Od(D)?{direction:N.direction}:{})})},condition(N,{getState:D}){let M=D(),W=i.selectQueryEntry(M,N.queryCacheKey),z=W?.fulfilledTimeStamp,re=N.originalArgs,Z=W?.originalArgs,K=r[N.endpointName],ce=N.direction;return rS(N)?!0:W?.status==="pending"?!1:I(N,M)||kd(K)&&K?.forceRefetch?.({currentArg:re,previousArg:Z,endpointState:W,state:M})?!0:!(z&&!ce)},dispatchConditionRejection:!0}),E=F(),k=F(),T=me(`${e}/executeMutation`,w,{getPendingMeta(){return Mc({startedTimeStamp:Date.now()})}}),q=L=>"force"in L,G=L=>"ifOlderThan"in L,Q=(L,N,D={})=>(M,W)=>{let z=q(D)&&D.force,re=G(D)&&D.ifOlderThan,Z=(ce=!0)=>{let ve={forceRefetch:ce,subscribe:!1};return o.endpoints[L].initiate(N,ve)},K=o.endpoints[L].select(N)(W());if(z)M(Z());else if(re){let ce=K?.fulfilledTimeStamp;if(!ce){M(Z());return}(Number(new Date)-Number(new Date(ce)))/1e3>=re&&M(Z())}else M(Z(!1))};function j(L){return N=>N?.meta?.arg?.endpointName===L}function B(L,N){return{matchPending:ei(gl(L),j(N)),matchFulfilled:ei(En(L),j(N)),matchRejected:ei(Uo(L),j(N))}}return{queryThunk:E,mutationThunk:T,infiniteQueryThunk:k,prefetch:Q,updateQueryData:h,upsertQueryData:y,patchQueryData:g,buildMatchThunkActions:B}}function nS(e,{pages:t,pageParams:r},n){let o=t.length-1;return e.getNextPageParam(t[o],t,r[o],r,n)}function kw(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function Ow(e,t,r,n){return sS(r[e.meta.arg.endpointName][t],En(e)?e.payload:void 0,bc(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function pw(e){return $t(e)?cl(e):e}function Id(e,t,r){let n=e[t];n&&r(n)}function Uc(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function fw(e,t,r){let n=e[Uc(t)];n&&r(n)}var Ed={};function Bq({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:a,extractRehydrationInfo:i,hasRehydrationInfo:p},assertTagType:f,config:m}){let g=P(`${e}/resetApiState`);function A(j,B,L,N){var D;j[D=B.queryCacheKey]??(j[D]={status:kn,endpointName:B.endpointName}),Id(j,B.queryCacheKey,M=>{M.status=Jy,M.requestId=L&&M.requestId?M.requestId:N.requestId,B.originalArgs!==void 0&&(M.originalArgs=B.originalArgs),M.startedTimeStamp=N.startedTimeStamp;let W=o[N.arg.endpointName];Od(W)&&"direction"in B&&(M.direction=B.direction)})}function x(j,B,L,N){Id(j,B.arg.queryCacheKey,D=>{if(D.requestId!==B.requestId&&!N)return;let{merge:M}=o[B.arg.endpointName];if(D.status=Vc,M){if(D.data!==void 0){let{fulfilledTimeStamp:W,arg:z,baseQueryMeta:re,requestId:Z}=B,K=jo(D.data,ce=>M(ce,L,{arg:z.originalArgs,baseQueryMeta:re,fulfilledTimeStamp:W,requestId:Z}));D.data=K}else D.data=L;}else D.data=o[B.arg.endpointName].structuralSharing??!0?Aw($t(D.data)?dC(D.data):D.data,L):L;delete D.error,D.fulfilledTimeStamp=B.fulfilledTimeStamp})}let h=Qo({name:`${e}/queries`,initialState:Ed,reducers:{removeQueryResult:{reducer(j,{payload:{queryCacheKey:B}}){delete j[B]},prepare:ti()},cacheEntriesUpserted:{reducer(j,B){for(let L of B.payload){let{queryDescription:N,value:D}=L;A(j,N,!0,{arg:N,requestId:B.meta.requestId,startedTimeStamp:B.meta.timestamp}),x(j,{arg:N,requestId:B.meta.requestId,fulfilledTimeStamp:B.meta.timestamp,baseQueryMeta:{}},D,!0)}},prepare:j=>({payload:j.map(N=>{let{endpointName:D,arg:M,value:W}=N,z=o[D];return{queryDescription:{type:Qc,endpointName:D,originalArgs:N.arg,queryCacheKey:n({queryArgs:M,endpointDefinition:z,endpointName:D})},value:W}}),meta:{[Ac]:!0,requestId:xc(),timestamp:Date.now()}})},queryResultPatched:{reducer(j,{payload:{queryCacheKey:B,patches:L}}){Id(j,B,N=>{N.data=Oh(N.data,L.concat())})},prepare:ti()}},extraReducers(j){j.addCase(t.pending,(B,{meta:L,meta:{arg:N}})=>{let D=rS(N);A(B,N,D,L)}).addCase(t.fulfilled,(B,{meta:L,payload:N})=>{let D=rS(L.arg);x(B,L,N,D)}).addCase(t.rejected,(B,{meta:{condition:L,arg:N,requestId:D},error:M,payload:W})=>{Id(B,N.queryCacheKey,z=>{if(!L){if(z.requestId!==D)return;z.status=jc,z.error=W??M}})}).addMatcher(p,(B,L)=>{let{queries:N}=i(L);for(let[D,M]of Object.entries(N))(M?.status===Vc||M?.status===jc)&&(B[D]=M)})}}),y=Qo({name:`${e}/mutations`,initialState:Ed,reducers:{removeMutationResult:{reducer(j,{payload:B}){let L=Uc(B);L in j&&delete j[L]},prepare:ti()}},extraReducers(j){j.addCase(r.pending,(B,{meta:L,meta:{requestId:N,arg:D,startedTimeStamp:M}})=>{D.track&&(B[Uc(L)]={requestId:N,status:Jy,endpointName:D.endpointName,startedTimeStamp:M})}).addCase(r.fulfilled,(B,{payload:L,meta:N})=>{N.arg.track&&fw(B,N,D=>{D.requestId===N.requestId&&(D.status=Vc,D.data=L,D.fulfilledTimeStamp=N.fulfilledTimeStamp)})}).addCase(r.rejected,(B,{payload:L,error:N,meta:D})=>{D.arg.track&&fw(B,D,M=>{M.requestId===D.requestId&&(M.status=jc,M.error=L??N)})}).addMatcher(p,(B,L)=>{let{mutations:N}=i(L);for(let[D,M]of Object.entries(N))(M?.status===Vc||M?.status===jc)&&D!==M?.requestId&&(B[D]=M)})}}),b={tags:{},keys:{}},w=Qo({name:`${e}/invalidation`,initialState:b,reducers:{updateProvidedBy:{reducer(j,B){var L,N,D;for(let{queryCacheKey:M,providedTags:W}of B.payload){I(j,M);for(let{type:z,id:re}of W){let Z=(N=(L=j.tags)[z]??(L[z]={}))[D=re||"__internal_without_id"]??(N[D]=[]);Z.includes(M)||Z.push(M)}j.keys[M]=W}},prepare:ti()}},extraReducers(j){j.addCase(h.actions.removeQueryResult,(B,{payload:{queryCacheKey:L}})=>{I(B,L)}).addMatcher(p,(B,L)=>{var D,M,W;let{provided:N}=i(L);for(let[z,re]of Object.entries(N.tags??{}))for(let[Z,K]of Object.entries(re)){let ce=(M=(D=B.tags)[z]??(D[z]={}))[W=Z||"__internal_without_id"]??(M[W]=[]);for(let ve of K)ce.includes(ve)||ce.push(ve),B.keys[ve]=N.keys[ve]}}).addMatcher(Qr(En(t),bc(t)),(B,L)=>{F(B,[L])}).addMatcher(h.actions.cacheEntriesUpserted.match,(B,L)=>{let N=L.payload.map(({queryDescription:D,value:M})=>({type:"UNKNOWN",payload:M,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:D}}));F(B,N)})}});function I(j,B){let L=pw(j.keys[B]??[]);for(let N of L){let D=N.type,M=N.id??"__internal_without_id",W=j.tags[D]?.[M];W&&(j.tags[D][M]=pw(W).filter(z=>z!==B))}delete j.keys[B]}function F(j,B){let L=B.map(N=>{let D=Ow(N,"providesTags",o,f),{queryCacheKey:M}=N.meta.arg;return{queryCacheKey:M,providedTags:D}});w.caseReducers.updateProvidedBy(j,w.actions.updateProvidedBy(L))}let E=Qo({name:`${e}/subscriptions`,initialState:Ed,reducers:{updateSubscriptionOptions(j,B){},unsubscribeQueryResult(j,B){},internal_getRTKQSubscriptions(){}}}),k=Qo({name:`${e}/internalSubscriptions`,initialState:Ed,reducers:{subscriptionsUpdated:{reducer(j,B){return Oh(j,B.payload)},prepare:ti()}}}),T=Qo({name:`${e}/config`,initialState:{online:Rq(),focused:wq(),middlewareRegistered:!1,...m},reducers:{middlewareRegistered(j,{payload:B}){j.middlewareRegistered=j.middlewareRegistered==="conflict"||a!==B?"conflict":!0}},extraReducers:j=>{j.addCase(iS,B=>{B.online=!0}).addCase(Iw,B=>{B.online=!1}).addCase(aS,B=>{B.focused=!0}).addCase(Rw,B=>{B.focused=!1}).addMatcher(p,B=>({...B}))}}),q=Ka({queries:h.reducer,mutations:y.reducer,provided:w.reducer,subscriptions:k.reducer,config:T.reducer}),G=(j,B)=>q(g.match(B)?void 0:j,B),Q={...T.actions,...h.actions,...E.actions,...k.actions,...y.actions,...w.actions,resetApiState:g};return{reducer:G,actions:Q}}var Xo=Symbol.for("RTKQ/skipToken"),_w={status:kn},mw=jo(_w,()=>{}),gw=jo(_w,()=>{});function Gq({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=E=>mw,o=E=>gw;return{buildQuerySelector:x,buildInfiniteQuerySelector:h,buildMutationSelector:y,selectInvalidatedBy:b,selectCachedArgsForQuery:w,selectApiState:i,selectQueries:p,selectMutations:m,selectQueryEntry:f,selectConfig:g};function a(E){return{...E,...aw(E.status)}}function i(E){return E[t]}function p(E){return i(E)?.queries}function f(E,k){return p(E)?.[k]}function m(E){return i(E)?.mutations}function g(E){return i(E)?.config}function A(E,k,T){return q=>{if(q===Xo)return r(n,T);let G=e({queryArgs:q,endpointDefinition:k,endpointName:E});return r(j=>f(j,G)??mw,T)}}function x(E,k){return A(E,k,a)}function h(E,k){let{infiniteQueryOptions:T}=k;function q(G){let Q={...G,...aw(G.status)},{isLoading:j,isError:B,direction:L}=Q,N=L==="forward",D=L==="backward";return{...Q,hasNextPage:I(T,Q.data,Q.originalArgs),hasPreviousPage:F(T,Q.data,Q.originalArgs),isFetchingNextPage:j&&N,isFetchingPreviousPage:j&&D,isFetchNextPageError:B&&N,isFetchPreviousPageError:B&&D}}return A(E,k,q)}function y(){return E=>{let k;return typeof E=="object"?k=Uc(E)??Xo:k=E,r(k===Xo?o:G=>i(G)?.mutations?.[k]??gw,a)}}function b(E,k){let T=E[t],q=new Set,G=eS(k,oS,Tw);for(let Q of G){let j=T.provided.tags[Q.type];if(!j)continue;let B=(Q.id!==void 0?j[Q.id]:Object.values(j).flat())??[];for(let L of B)q.add(L)}return Array.from(q.values()).flatMap(Q=>{let j=T.queries[Q];return j?{queryCacheKey:Q,endpointName:j.endpointName,originalArgs:j.originalArgs}:[]})}function w(E,k){return eS(Object.values(p(E)),T=>T?.endpointName===k&&T.status!==kn,T=>T.originalArgs)}function I(E,k,T){return k?nS(E,k,T)!=null:!1}function F(E,k,T){return!k||!E.getPreviousPageParam?!1:kw(E,k,T)!=null}}var hw=WeakMap?new WeakMap:void 0,yw=({endpointName:e,queryArgs:t})=>{let r="",n=hw?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(a,i)=>(i=typeof i=="bigint"?{$bigint:i.toString()}:i,i=Lr(i)?Object.keys(i).sort().reduce((p,f)=>(p[f]=i[f],p),{}):i,i));Lr(t)&&hw?.set(t,o),r=o}return`${e}(${r})`};function $q(...e){return function(r){let n=Sc(m=>r.extractRehydrationInfo?.(m,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(m){let g=yw;if("serializeQueryArgs"in m.endpointDefinition){let A=m.endpointDefinition.serializeQueryArgs;g=x=>{let h=A(x);return typeof h=="string"?h:yw({...x,queryArgs:h})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(m)},tagTypes:[...(r.tagTypes||[])]},a={endpointDefinitions:{},batch(m){m()},apiUid:xc(),extractRehydrationInfo:n,hasRehydrationInfo:Sc(m=>n(m)!=null)},i={injectEndpoints:f,enhanceEndpoints({addTagTypes:m,endpoints:g}){if(m)for(let A of m)o.tagTypes.includes(A)||o.tagTypes.push(A);if(g)for(let[A,x]of Object.entries(g))typeof x=="function"?x(ki(a,A)):Object.assign(ki(a,A)||{},x);return i}},p=e.map(m=>m.init(i,o,a));function f(m){let g=m.endpoints({query:A=>({...A,type:Qc}),mutation:A=>({...A,type:Ew}),infiniteQuery:A=>({...A,type:Fw})});for(let[A,x]of Object.entries(g)){if(m.overrideExisting!==!0&&A in a.endpointDefinitions){if(m.overrideExisting==="throw")throw new Error(zt(39));typeof process<"u";continue}typeof process<"u",a.endpointDefinitions[A]=x;for(let h of p)h.injectEndpoint(A,x)}return i}return i.injectEndpoints({endpoints:r.endpoints})}}function Pn(e,...t){return Object.assign(e,...t)}var Hq=({api:e,queryThunk:t,internalState:r,mwApi:n})=>{let o=`${e.reducerPath}/subscriptions`,a=null,i=null,{updateSubscriptionOptions:p,unsubscribeQueryResult:f}=e.internalActions,m=(b,w)=>{if(p.match(w)){let{queryCacheKey:F,requestId:E,options:k}=w.payload,T=b.get(F);return T?.has(E)&&T.set(E,k),!0}if(f.match(w)){let{queryCacheKey:F,requestId:E}=w.payload,k=b.get(F);return k&&k.delete(E),!0}if(e.internalActions.removeQueryResult.match(w))return b.delete(w.payload.queryCacheKey),!0;if(t.pending.match(w)){let{meta:{arg:F,requestId:E}}=w,k=Fd(b,F.queryCacheKey,tS);return F.subscribe&&k.set(E,F.subscriptionOptions??k.get(E)??{}),!0}let I=!1;if(t.rejected.match(w)){let{meta:{condition:F,arg:E,requestId:k}}=w;if(F&&E.subscribe){let T=Fd(b,E.queryCacheKey,tS);T.set(k,E.subscriptionOptions??T.get(k)??{}),I=!0}}return I},g=()=>r.currentSubscriptions,h={getSubscriptions:g,getSubscriptionCount:b=>g().get(b)?.size??0,isRequestSubscribed:(b,w)=>!!g()?.get(b)?.get(w)};function y(b){return JSON.parse(JSON.stringify(Object.fromEntries([...b].map(([w,I])=>[w,Object.fromEntries(I)]))))}return(b,w)=>{if(a||(a=y(r.currentSubscriptions)),e.util.resetApiState.match(b))return a={},r.currentSubscriptions.clear(),i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(b))return[!1,h];let I=m(r.currentSubscriptions,b),F=!0;if(I){i||(i=setTimeout(()=>{let T=y(r.currentSubscriptions),[,q]=kh(a,()=>T);w.next(e.internalActions.subscriptionsUpdated(q)),a=T,i=null},500));let E=typeof b.type=="string"&&!!b.type.startsWith(o),k=t.rejected.match(b)&&b.meta.condition&&!!b.meta.arg.subscribe;F=!E&&!k}return[F,!1]}},zq=2147483647/1e3-1,Wq=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:a,selectConfig:i},getRunningQueryThunk:p,mwApi:f})=>{let{removeQueryResult:m,unsubscribeQueryResult:g,cacheEntriesUpserted:A}=t.internalActions,x=Qr(g.match,r.fulfilled,r.rejected,A.match);function h(E){let k=o.currentSubscriptions.get(E);return k?k.size>0:!1}let y={};function b(E){for(let k of E.values())k?.abort?.()}let w=(E,k)=>{let T=k.getState(),q=i(T);if(x(E)){let G;if(A.match(E))G=E.payload.map(Q=>Q.queryDescription.queryCacheKey);else{let{queryCacheKey:Q}=g.match(E)?E.payload:E.meta.arg;G=[Q]}I(G,k,q)}if(t.util.resetApiState.match(E)){for(let[G,Q]of Object.entries(y))Q&&clearTimeout(Q),delete y[G];b(o.runningQueries),b(o.runningMutations)}if(n.hasRehydrationInfo(E)){let{queries:G}=n.extractRehydrationInfo(E);I(Object.keys(G),k,q)}};function I(E,k,T){let q=k.getState();for(let G of E){let Q=a(q,G);Q?.endpointName&&F(G,Q.endpointName,k,T)}}function F(E,k,T,q){let Q=ki(n,k)?.keepUnusedDataFor??q.keepUnusedDataFor;if(Q===1/0)return;let j=Math.max(0,Math.min(Q,zq));if(!h(E)){let B=y[E];B&&clearTimeout(B),y[E]=setTimeout(()=>{if(!h(E)){let L=a(T.getState(),E);L?.endpointName&&T.dispatch(p(L.endpointName,L.originalArgs))?.abort(),T.dispatch(m({queryCacheKey:E}))}delete y[E]},j*1e3)}}return w},Sw=new Error("Promise never resolved before cacheEntryRemoved."),Yq=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:a,selectors:{selectQueryEntry:i,selectApiState:p}})=>{let f=hl(n),m=hl(o),g=En(n,o),A={},{removeQueryResult:x,removeMutationResult:h,cacheEntriesUpserted:y}=e.internalActions;function b(T,q,G){let Q=A[T];Q?.valueResolved&&(Q.valueResolved({data:q,meta:G}),delete Q.valueResolved)}function w(T){let q=A[T];q&&(delete A[T],q.cacheEntryRemoved())}function I(T){let{arg:q,requestId:G}=T.meta,{endpointName:Q,originalArgs:j}=q;return[Q,j,G]}let F=(T,q,G)=>{let Q=E(T);function j(B,L,N,D){let M=i(G,L),W=i(q.getState(),L);!M&&W&&k(B,D,L,q,N)}if(n.pending.match(T)){let[B,L,N]=I(T);j(B,Q,N,L)}else if(y.match(T))for(let{queryDescription:B,value:L}of T.payload){let{endpointName:N,originalArgs:D,queryCacheKey:M}=B;j(N,M,T.meta.requestId,D),b(M,L,{})}else if(o.pending.match(T)){if(q.getState()[t].mutations[Q]){let[L,N,D]=I(T);k(L,N,Q,q,D)}}else if(g(T))b(Q,T.payload,T.meta.baseQueryMeta);else if(x.match(T)||h.match(T))w(Q);else if(e.util.resetApiState.match(T))for(let B of Object.keys(A))w(B)};function E(T){return f(T)?T.meta.arg.queryCacheKey:m(T)?T.meta.arg.fixedCacheKey??T.meta.requestId:x.match(T)?T.payload.queryCacheKey:h.match(T)?Uc(T.payload):""}function k(T,q,G,Q,j){let B=ki(r,T),L=B?.onCacheEntryAdded;if(!L)return;let N={},D=new Promise(K=>{N.cacheEntryRemoved=K}),M=Promise.race([new Promise(K=>{N.valueResolved=K}),D.then(()=>{throw Sw})]);M.catch(()=>{}),A[G]=N;let W=e.endpoints[T].select(Td(B)?q:G),z=Q.dispatch((K,ce,ve)=>ve),re={...Q,getCacheEntry:()=>W(Q.getState()),requestId:j,extra:z,updateCachedData:Td(B)?K=>Q.dispatch(e.util.updateQueryData(T,q,K)):void 0,cacheDataLoaded:M,cacheEntryRemoved:D},Z=L(q,re);Promise.resolve(Z).catch(K=>{if(K!==Sw)throw K})}return F},Kq=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},Xq=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:a,assertTagType:i,refetchQuery:p,internalState:f})=>{let{removeQueryResult:m}=a.internalActions,g=Qr(En(n),bc(n)),A=Qr(En(o,n),Uo(o,n)),x=[],h=0,y=(I,F)=>{(o.pending.match(I)||n.pending.match(I))&&h++,A(I)&&(h=Math.max(0,h-1)),g(I)?w(Ow(I,"invalidatesTags",r,i),F):A(I)?w([],F):a.util.invalidateTags.match(I)&&w(sS(I.payload,void 0,void 0,void 0,void 0,i),F)};function b(){return h>0}function w(I,F){let E=F.getState(),k=E[e];if(x.push(...I),k.config.invalidationBehavior==="delayed"&&b())return;let T=x;if(x=[],T.length===0)return;let q=a.util.selectInvalidatedBy(E,T);t.batch(()=>{let G=Array.from(q.values());for(let{queryCacheKey:Q}of G){let j=k.queries[Q],B=Fd(f.currentSubscriptions,Q,tS);j&&(B.size===0?F.dispatch(m({queryCacheKey:Q})):j.status!==kn&&F.dispatch(p(j)))}})}return y},Zq=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let{currentPolls:a,currentSubscriptions:i}=o,p=new Set,f=null,m=(w,I)=>{(r.internalActions.updateSubscriptionOptions.match(w)||r.internalActions.unsubscribeQueryResult.match(w))&&g(w.payload.queryCacheKey,I),(t.pending.match(w)||t.rejected.match(w)&&w.meta.condition)&&g(w.meta.arg.queryCacheKey,I),(t.fulfilled.match(w)||t.rejected.match(w)&&!w.meta.condition)&&A(w.meta.arg,I),r.util.resetApiState.match(w)&&(y(),f&&(clearTimeout(f),f=null),p.clear())};function g(w,I){p.add(w),f||(f=setTimeout(()=>{for(let F of p)x({queryCacheKey:F},I);p.clear(),f=null},0))}function A({queryCacheKey:w},I){let F=I.getState()[e],E=F.queries[w],k=i.get(w);if(!E||E.status===kn)return;let{lowestPollingInterval:T,skipPollingIfUnfocused:q}=b(k);if(!Number.isFinite(T))return;let G=a.get(w);G?.timeout&&(clearTimeout(G.timeout),G.timeout=void 0);let Q=Date.now()+T;a.set(w,{nextPollTimestamp:Q,pollingInterval:T,timeout:setTimeout(()=>{(F.config.focused||!q)&&I.dispatch(n(E)),A({queryCacheKey:w},I)},T)})}function x({queryCacheKey:w},I){let E=I.getState()[e].queries[w],k=i.get(w);if(!E||E.status===kn)return;let{lowestPollingInterval:T}=b(k);if(!Number.isFinite(T)){h(w);return}let q=a.get(w),G=Date.now()+T;(!q||G<q.nextPollTimestamp)&&A({queryCacheKey:w},I)}function h(w){let I=a.get(w);I?.timeout&&clearTimeout(I.timeout),a.delete(w)}function y(){for(let w of a.keys())h(w)}function b(w=new Map){let I=!1,F=Number.POSITIVE_INFINITY;for(let E of w.values())E.pollingInterval&&(F=Math.min(E.pollingInterval,F),I=E.skipPollingIfUnfocused||I);return{lowestPollingInterval:F,skipPollingIfUnfocused:I}}return m},Jq=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=gl(r,n),a=Uo(r,n),i=En(r,n),p={};return(m,g)=>{if(o(m)){let{requestId:A,arg:{endpointName:x,originalArgs:h}}=m.meta,y=ki(t,x),b=y?.onQueryStarted;if(b){let w={},I=new Promise((T,q)=>{w.resolve=T,w.reject=q});I.catch(()=>{}),p[A]=w;let F=e.endpoints[x].select(Td(y)?h:A),E=g.dispatch((T,q,G)=>G),k={...g,getCacheEntry:()=>F(g.getState()),requestId:A,extra:E,updateCachedData:Td(y)?T=>g.dispatch(e.util.updateQueryData(x,h,T)):void 0,queryFulfilled:I};b(h,k)}}else if(i(m)){let{requestId:A,baseQueryMeta:x}=m.meta;p[A]?.resolve({data:m.payload,meta:x}),delete p[A]}else if(a(m)){let{requestId:A,rejectedWithValue:x,baseQueryMeta:h}=m.meta;p[A]?.reject({error:m.payload??m.error,isUnhandledError:!x,meta:h}),delete p[A]}}},eM=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:a}=r.internalActions,i=(f,m)=>{aS.match(f)&&p(m,"refetchOnFocus"),iS.match(f)&&p(m,"refetchOnReconnect")};function p(f,m){let g=f.getState()[e],A=g.queries,x=o.currentSubscriptions;t.batch(()=>{for(let h of x.keys()){let y=A[h],b=x.get(h);if(!b||!y)continue;let w=[...b.values()];(w.some(F=>F[m]===!0)||w.every(F=>F[m]===void 0)&&g.config[m])&&(b.size===0?f.dispatch(a({queryCacheKey:h})):y.status!==kn&&f.dispatch(n(y)))}})}return i};function tM(e){let{reducerPath:t,queryThunk:r,api:n,context:o,getInternalState:a}=e,{apiUid:i}=o,p={invalidateTags:P(`${t}/invalidateTags`)},f=x=>x.type.startsWith(`${t}/`),m=[Kq,Wq,Xq,Zq,Yq,Jq];return{middleware:x=>{let h=!1,y=a(x.dispatch),b={...e,internalState:y,refetchQuery:A,isThisApiSliceAction:f,mwApi:x},w=m.map(E=>E(b)),I=Hq(b),F=eM(b);return E=>k=>{if(!ic(k))return E(k);h||(h=!0,x.dispatch(n.internalActions.middlewareRegistered(i)));let T={...x,next:E},q=x.getState(),[G,Q]=I(k,T,q),j;if(G?j=E(k):j=Q,x.getState()[t]&&(F(k,T,q),f(k)||o.hasRehydrationInfo(k)))for(let B of w)B(k,T,q);return j}},actions:p};function A(x){return e.api.endpoints[x.endpointName].initiate(x.originalArgs,{subscribe:!1,forceRefetch:!0})}}var vw=Symbol(),rM=({createSelector:e=ct}={})=>({name:vw,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:a,keepUnusedDataFor:i,refetchOnMountOrArgChange:p,refetchOnFocus:f,refetchOnReconnect:m,invalidationBehavior:g,onSchemaFailure:A,catchSchemaFailure:x,skipSchemaValidation:h},y){SC();let b=Ee=>(typeof process<"u",Ee);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:iS,onOffline:Iw,onFocus:aS,onFocusLost:Rw},util:{}});let w=Gq({serializeQueryArgs:a,reducerPath:o,createSelector:e}),{selectInvalidatedBy:I,selectCachedArgsForQuery:F,buildQuerySelector:E,buildInfiniteQuerySelector:k,buildMutationSelector:T}=w;Pn(t.util,{selectInvalidatedBy:I,selectCachedArgsForQuery:F});let{queryThunk:q,infiniteQueryThunk:G,mutationThunk:Q,patchQueryData:j,updateQueryData:B,upsertQueryData:L,prefetch:N,buildMatchThunkActions:D}=Qq({baseQuery:r,reducerPath:o,context:y,api:t,serializeQueryArgs:a,assertTagType:b,selectors:w,onSchemaFailure:A,catchSchemaFailure:x,skipSchemaValidation:h}),{reducer:M,actions:W}=Bq({context:y,queryThunk:q,infiniteQueryThunk:G,mutationThunk:Q,serializeQueryArgs:a,reducerPath:o,assertTagType:b,config:{refetchOnFocus:f,refetchOnReconnect:m,refetchOnMountOrArgChange:p,keepUnusedDataFor:i,reducerPath:o,invalidationBehavior:g}});Pn(t.util,{patchQueryData:j,updateQueryData:B,upsertQueryData:L,prefetch:N,resetApiState:W.resetApiState,upsertQueryEntries:W.cacheEntriesUpserted}),Pn(t.internalActions,W);let z=new WeakMap,re=Ee=>Fd(z,Ee,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:Z,buildInitiateInfiniteQuery:K,buildInitiateMutation:ce,getRunningMutationThunk:ve,getRunningMutationsThunk:Ve,getRunningQueriesThunk:nt,getRunningQueryThunk:Ge}=Uq({queryThunk:q,mutationThunk:Q,infiniteQueryThunk:G,api:t,serializeQueryArgs:a,context:y,getInternalState:re});Pn(t.util,{getRunningMutationThunk:ve,getRunningMutationsThunk:Ve,getRunningQueryThunk:Ge,getRunningQueriesThunk:nt});let{middleware:Je,actions:et}=tM({reducerPath:o,context:y,queryThunk:q,mutationThunk:Q,infiniteQueryThunk:G,api:t,assertTagType:b,selectors:w,getRunningQueryThunk:Ge,getInternalState:re});return Pn(t.util,et),Pn(t,{reducer:M,middleware:Je}),{name:vw,injectEndpoint(Ee,Re){var gt;let Fe=(gt=t.endpoints)[Ee]??(gt[Ee]={});kd(Re)&&Pn(Fe,{name:Ee,select:E(Ee,Re),initiate:Z(Ee,Re)},D(q,Ee)),Vq(Re)&&Pn(Fe,{name:Ee,select:T(),initiate:ce(Ee)},D(Q,Ee)),Od(Re)&&Pn(Fe,{name:Ee,select:k(Ee,Re),initiate:K(Ee,Re)},D(q,Ee))}}}}),Nw=$q(rM());d();c();l();u();d();c();l();u();var Zo=e=>e.query,Dw=e=>e.query?.enableQuerySyntax;var qw=ct(e=>Zo(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,o)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:o})),_d=ct(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();l();u();d();c();l();u();var Bc=e=>{if(e==="yes")return!0;if(e==="no")return!1};var Oi=(e,t,r)=>ze({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(n,o)=>{let a=t??Ue(o);if(!a)return null;let i=Wb(o);return n.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:a,answerGenerated:e,answerTextIsEmpty:r,...(i&&{conversationId:i})})},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:n=>({answerId:t??Ue(n)??"",answerGenerated:e??!1})}),_i=e=>ze({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",responseId:t.search?.searchResponseId||t.search?.response.searchUid||""})});var Mw=()=>({actionCause:"retryGeneratedAnswer"});d();c();l();u();d();c();l();u();var Vw=ct(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});d();c();l();u();var cS=e=>e.context;d();c();l();u();var uS=e=>e.pipeline;d();c();l();u();var lS=e=>e.searchHub;d();c();l();u();var jt=ct(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),uie=ct(e=>e,e=>{let t=jt(e);return t&&e?e[t].expression:""});d();c();l();u();var jw=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var Lw=e=>e.excerptLength?.length;d();c();l();u();var Jr=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,Uw=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var Qw=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};d();c();l();u();var Bw=e=>e.sortCriteria;var Gw=/*#__PURE__*/function(){var _ref64=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Qn(e.configuration.search.apiBaseUrl,e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function Gw(_x183){return _ref64.apply(this,arguments)}}(),$w=(e,t)=>{let r=Zo(e)?.q,{aq:n,cq:o,dq:a,lq:i}=Ww(e),p=cS(e),f=Wo(e.configuration.analytics,t,{actionCause:Yy(e)}),m=lS(e),g=uS(e),A=Sy(e)??[],x=zw(e),h=jt(e.tabSet)||"default",y=hy(e),b=Bb(e),w=t.referrer||"",I=Uw(e),F=Bw(e),E=nM(e),k=Lw(e),T=Qw(e),q=jw(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(a&&{dq:a}),...(i&&{lq:i}),...(e.query&&{enableQuerySyntax:Dw(e)}),...(p?.contextValues&&{context:p.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:A}},...(m?.length&&{searchHub:m}),...(g?.length&&{pipeline:g}),...(x.length&&{facets:x}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:Gy(e),firstResult:e.pagination.firstResult}),tab:h,locale:y,timezone:b,...(e.debug!==void 0&&{debug:e.debug}),referrer:w,...E,...(T??{}),...(k&&{excerptLength:k}),...(q&&{dictionaryFieldContext:q}),sortCriteria:F,...(I&&{facetOptions:I}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},Hw=(e,t)=>{let r=Zo(e)?.q,n=zw(e),o=Wo(e.configuration.analytics,t,{actionCause:Yy(e)}),a=hy(e),i=jt(e.tabSet)||"default",p=t.referrer,{aq:f,cq:m}=Ww(e),g=lS(e),A=uS(e),x=cS(e),h=Sy(e)??[];return{q:r||"",...(n.length&&{facets:n}),citationsFieldToInclude:h,...(g?.length&&{searchHub:g}),...(A?.length&&{pipeline:A}),...(x?.contextValues&&{context:x.contextValues}),...(f&&{aq:f}),...(m&&{cq:m}),tab:i,referrer:p,...o,locale:a}},zw=e=>vd(e)?.map(t=>Fy(t,Ey())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),nM=e=>({actionsHistory:e.configuration.analytics.enabled?Vt.getInstance().getHistory():[]}),Ww=e=>{let t=Vw(e),r=$y(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var Nd=["searching","thinking","answering"];function Dd(e){return e.toLowerCase()}var qd=["search","generic"];function dS(){return{id:"",isVisible:!0,isEnabled:!0,isLoading:!1,isStreaming:!1,citations:[],liked:!1,disliked:!1,responseFormat:{contentFormat:["text/plain"]},feedbackModalOpen:!1,feedbackSubmitted:!1,fieldsToIncludeInCitations:[],isAnswerGenerated:!1,expanded:!1,cannotAnswer:!1,answerApiQueryParams:void 0,answerId:void 0,answerGenerationMode:"automatic",generationSteps:[]}}d();c();l();u();var Yw=["text/plain","text/markdown"];var Ni=new $({required:!0}),Kw=new $,Di=new fe({required:!0}),pS={id:Ni,title:Ni,uri:Ni,permanentid:Ni,clickUri:Kw},Md=new $({required:!0,constrainTo:Yw}),Xw=new $({required:!0,constrainTo:Nd}),Zw=e=>({...e,name:Dd(e.name)}),qi=P("generatedAnswer/setIsVisible",e=>_(e,Di)),Mi=P("generatedAnswer/setAnswerId",e=>_(e,H)),Vd=P("generatedAnswer/setAnswerGenerationMode",e=>_(e,new $({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),Vi=P("generatedAnswer/setIsEnabled",e=>_(e,Di)),ea=P("generatedAnswer/updateMessage",e=>_(e,{textDelta:Ni})),ta=P("generatedAnswer/updateCitations",e=>_(e,{citations:new oe({required:!0,each:new Y({values:pS})})})),ra=P("generatedAnswer/updateError",e=>_(e,{message:Kw,code:new ne({min:0})})),lr=P("generatedAnswer/resetAnswer"),jd=P("generatedAnswer/like"),Ld=P("generatedAnswer/dislike"),Ud=P("generatedAnswer/feedbackModal/open"),Gc=P("generatedAnswer/expand"),Qd=P("generatedAnswer/collapse"),Bd=P("generatedAnswer/setId",e=>_(e,{id:new $({required:!0})})),Gd=P("generatedAnswer/feedbackModal/close"),ji=P("generatedAnswer/sendFeedback"),en=P("generatedAnswer/setIsLoading",e=>_(e,Di)),Jo=P("generatedAnswer/setIsStreaming",e=>_(e,Di)),na=P("generatedAnswer/setAnswerContentFormat",e=>_(e,Md)),$d=P("generatedAnswer/updateResponseFormat",e=>_(e,{contentFormat:new oe({each:Md,default:["text/plain"]})})),Hd=P("knowledge/updateAnswerConfigurationId",e=>_(e,Ni)),zd=P("generatedAnswer/registerFieldsToIncludeInCitations",e=>_(e,Wu)),$c=P("generatedAnswer/setIsAnswerGenerated",e=>_(e,Di)),oa=P("generatedAnswer/setCannotAnswer",e=>_(e,Di)),fS=P("generatedAnswer/setAnswerApiQueryParams",e=>_(e,new Y({}))),Wd=P("generatedAnswer/startStep",e=>_(Zw(e),{name:Xw,startedAt:new ne({min:0,required:!0})})),Yd=P("generatedAnswer/finishStep",e=>_(Zw(e),{name:Xw,finishedAt:new ne({min:0,required:!0})})),Kd=P("generatedAnswer/startToolCall",e=>_(e,{toolCallName:H,startedAt:new ne({min:0,required:!0}),toolCallId:H})),Xd=P("generatedAnswer/finishToolCall",e=>_(e,{finishedAt:new ne({min:0,required:!0}),toolCallId:H})),Li=P("generatedAnswer/toolCallArgs",e=>_(e,{toolCallId:H,args:new Y({options:{required:!0}}),type:new $({required:!0,constrainTo:qd})})),Jw=me("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref65=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:a}=t,{search:i}=a(),{queryExecuted:p}=i,{setAbortControllerRef:f}=e,m=yield Gw(r),g=(h,y)=>{switch(h){case"genqa.headerMessageType":{let b=JSON.parse(y);n(na(b.contentFormat));break}case"genqa.messageType":n(ea(JSON.parse(y)));break;case"genqa.citationsType":n(ta(JSON.parse(y)));break;case"genqa.endOfStreamType":{let b=JSON.parse(y).answerGenerated,{answerId:w,answer:I}=a().generatedAnswer,E=p.length!==0&&!b,k=!I?.trim();n(oa(E)),n(Jo(!1)),n($c(b)),n(Oi(b,w,b?k:void 0)),n(_i());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${h}"`)}};n(en(!0));let A=h=>h.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,x=o.streamingClient?.streamGeneratedAnswer(m,{write:h=>{A(m)&&(n(en(!1)),h.payload&&h.payloadType&&g(h.payloadType,h.payload))},abort:h=>{A(m)&&n(ra(h))},close:()=>{A(m)&&n(Jo(!1))},resetAnswer:()=>{A(m)&&n(lr())}});x?f(x):n(en(!1))});return function(_x184,_x185){return _ref65.apply(this,arguments)}}()),Zd=me("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref66=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(lr());let a=t();if(a.generatedAnswer.isEnabled===!1){o.warn("[WARNING] The generateAnswer action was dispatched while the generated answer is disabled. No answer will be generated. Enable the generated answer before dispatching generateAnswer.");return}if(a.generatedAnswer.answerConfigurationId){let i=$w(a,n);r(fS(i)),yield r(Jd(i))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x186,_x187){return _ref66.apply(this,arguments)}}());d();c();l();u();var oM=/*#__PURE__*/function(){var _ref67=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:a,organizationId:i}=n.configuration,p=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let m=Qn(n.configuration.search?.apiBaseUrl,i,a);return Cw({baseUrl:`${m}/rest/organizations/${i}/answer/v1/configs/${p}`,fetchFn:function(){var _ref68=_asyncToGenerator(function*(g){if(g instanceof String)throw new Error("The provided 'request' must be a Request object.");let A=g.url,x={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(h=>{x[h]=g[h]}),x.duplex="half",x.body=yield g.text(),v(A,x)});return function fetchFn(_x191){return _ref68.apply(this,arguments)}}()})(f,{...t,signal:null},r)}catch(m){return{error:m}}});return function oM(_x188,_x189,_x190){return _ref67.apply(this,arguments)}}(),ep=Nw({reducerPath:"answer",baseQuery:xw(oM,{maxRetries:3}),endpoints:()=>({})});var aM=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},iM=(e,t)=>{let{textDelta:r}=t;if(typeof r!="string")return;let n=e.answer;!n?.trim()&&!r.trim()||(e.answer=n?.trim()?n.concat(r):r)},sM=(e,t)=>{e.citations=t.citations},cM=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},uM=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)},lM=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&uM(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(aM(t,o),r(na(o.contentFormat)));break;case"genqa.messageType":typeof o.textDelta=="string"&&(iM(t,o),r(ea({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(sM(t,o),r(ta({citations:o.citations})));break;case"genqa.endOfStreamType":{cM(t,o);let a=t.answerId,i=o.answerGenerated??!1,p=i?!t.answer?.trim():void 0;r(Oi(i,a,p)),r(_i());break}}},dM=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,a=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${a}/${r}/generate`},aa=ep.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let{analytics:n,...o}=r;return`${t}(${JSON.stringify(o)})`},onCacheEntryAdded(_x192,_x193){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:a}){yield n;let{configuration:i,generatedAnswer:p,insightConfiguration:f}=r(),{organizationId:m,environment:g,accessToken:A}=i,x=Qn(i.search.apiBaseUrl,m,g),h=dM(x,m,p.answerConfigurationId,f?.insightId);yield Gu(h,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${A}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:v,onopen:function(){var _ref69=_asyncToGenerator(function*(y){let b=y.headers.get("x-answer-id");b&&o(w=>{w.answerId=b,a(Mi(b))})});return function onopen(_x194){return _ref69.apply(this,arguments)}}(),onmessage:y=>{o(b=>{lM(y,b,a)})},onerror:y=>{throw y},onclose:()=>{o(y=>{a(oa(!y.generated))})}})}).apply(this,arguments)}})})}),Jd=e=>aa.endpoints.getAnswer.initiate(e),mS=e=>{let t=_d(e);return aa.endpoints.getAnswer.select(t??Xo)(e)};d();c();l();u();var eR=pe(Hn,e=>e);d();c();l();u();function pM(e){let t=e.payload?.analyticsAction;return tR(e)&&!J(t)}function tR(e){return"type"in e}var rR=e=>t=>r=>{let n;pM(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return tR(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var tp={q:new $,enableQuerySyntax:new fe,aq:new $,cq:new $,firstResult:new ne({min:0}),numberOfResults:new ne({min:0}),sortCriteria:new $,f:new Y,fExcluded:new Y,cf:new Y,nf:new Y,mnf:new Y,df:new Y,debug:new fe,sf:new Y,tab:new $,af:new Y};var ot=P("searchParameters/restore",e=>_(e,tp)),rp=P("searchParameters/restoreTab",e=>_(e,H));d();c();l();u();var np=P("tab/register",e=>{let t=new Y({values:{id:H,expression:Ke}});return _(e,t)}),_t=P("tab/updateActiveTab",e=>_(e,H));d();c();l();u();var op=Fr(Lu(),1),aR=Fr(nR(),1),iR=Fr(oR(),1);op.default.extend(iR.default);op.default.extend(aR.default);var ap=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:op.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"});d();c();l();u();var fM=/(^|; )Coveo-Pendragon=([^;]*)/,mM=/(^|; )Coveo-SearchAgentDebug=([^;]*)/;function sR(){return typeof window>"u"?!1:fM.exec(document.cookie)?.pop()||null}function cR(){return typeof window>"u"?!1:mM.test(document.cookie)}var ip=pe(ap(),e=>e.addCase(Si,(t,r)=>{gM(t,r.payload)}).addCase(vi,(t,r)=>{hM(t,r.payload)}).addCase($l,(t,r)=>{yM(t,r.payload)}).addCase(Hl,t=>{t.analytics.enabled=!1}).addCase(zl,t=>{t.analytics.enabled=!0}).addCase(gx,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(hx,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(_t,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(rp,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(ot,(t,r)=>{J(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(yx,(t,{payload:r})=>{SM(t,r)}));function gM(e,t){J(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",J(t.organizationId)||(e.organizationId=t.organizationId)}function hM(e,t){J(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),J(t.locale)||(e.search.locale=t.locale),J(t.timezone)||(e.search.timezone=t.timezone),J(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function yM(e,t){J(t.enabled)||(e.analytics.enabled=t.enabled),J(t.originContext)||(e.analytics.originContext=t.originContext),J(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),J(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),J(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),J(t.trackingId)||(e.analytics.trackingId=t.trackingId),J(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),J(t.source)||(e.analytics.source=t.source);try{let r=sR();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}J(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),J(t.anonymous)||(e.analytics.anonymous=t.anonymous),J(t.deviceId)||(e.analytics.deviceId=t.deviceId),J(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),J(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}function SM(e,t){e.knowledge.agentId=t;try{cR()&&(e.knowledge.debugAgentSession=!0)}catch{}}var xe=ip;d();c();l();u();function vM(e){return e.instantlyCallable}var uR=()=>e=>t=>e(vM(t)?t():t);d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Nt=[];for(let e=0;e<256;++e)Nt.push((e+256).toString(16).slice(1));function lR(e,t=0){return(Nt[e[t+0]]+Nt[e[t+1]]+Nt[e[t+2]]+Nt[e[t+3]]+"-"+Nt[e[t+4]]+Nt[e[t+5]]+"-"+Nt[e[t+6]]+Nt[e[t+7]]+"-"+Nt[e[t+8]]+Nt[e[t+9]]+"-"+Nt[e[t+10]]+Nt[e[t+11]]+Nt[e[t+12]]+Nt[e[t+13]]+Nt[e[t+14]]+Nt[e[t+15]]).toLowerCase()}d();c();l();u();var vS,AM=new Uint8Array(16);function AS(){if(!vS){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");vS=crypto.getRandomValues.bind(crypto)}return vS(AM)}d();c();l();u();d();c();l();u();var CM=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),CS={randomUUID:CM};function bM(e,t,r){if(CS.randomUUID&&!t&&!e)return CS.randomUUID();e=e||{};let n=e.random??e.rng?.()??AS();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return lR(n)}var co=bM;d();c();l();u();d();c();l();u();var R={};Hs(R,{BRAND:()=>WM,DIRTY:()=>ia,EMPTY_PATH:()=>IM,INVALID:()=>Ce,NEVER:()=>OV,OK:()=>Lt,ParseStatus:()=>Dt,Schema:()=>Ne,ZodAny:()=>po,ZodArray:()=>Dn,ZodBigInt:()=>ca,ZodBoolean:()=>ua,ZodBranded:()=>zc,ZodCatch:()=>Aa,ZodDate:()=>la,ZodDefault:()=>va,ZodDiscriminatedUnion:()=>up,ZodEffects:()=>br,ZodEnum:()=>ya,ZodError:()=>er,ZodFirstPartyTypeKind:()=>we,ZodFunction:()=>dp,ZodIntersection:()=>ma,ZodIssueCode:()=>X,ZodLazy:()=>ga,ZodLiteral:()=>ha,ZodMap:()=>Hi,ZodNaN:()=>Wi,ZodNativeEnum:()=>Sa,ZodNever:()=>Or,ZodNull:()=>pa,ZodNullable:()=>nn,ZodNumber:()=>sa,ZodObject:()=>tr,ZodOptional:()=>Ar,ZodParsedType:()=>ue,ZodPipeline:()=>Wc,ZodPromise:()=>fo,ZodReadonly:()=>Ca,ZodRecord:()=>lp,ZodSchema:()=>Ne,ZodSet:()=>zi,ZodString:()=>lo,ZodSymbol:()=>Gi,ZodTransformer:()=>br,ZodTuple:()=>rn,ZodType:()=>Ne,ZodUndefined:()=>da,ZodUnion:()=>fa,ZodUnknown:()=>Nn,ZodVoid:()=>$i,addIssueToContext:()=>se,any:()=>nV,array:()=>sV,bigint:()=>ZM,boolean:()=>CR,coerce:()=>kV,custom:()=>SR,date:()=>JM,datetimeRegex:()=>hR,defaultErrorMap:()=>On,discriminatedUnion:()=>dV,effect:()=>xV,enum:()=>AV,function:()=>yV,getErrorMap:()=>Ui,getParsedType:()=>tn,instanceof:()=>KM,intersection:()=>pV,isAborted:()=>sp,isAsync:()=>Qi,isDirty:()=>cp,isValid:()=>uo,late:()=>YM,lazy:()=>SV,literal:()=>vV,makeIssue:()=>Hc,map:()=>gV,nan:()=>XM,nativeEnum:()=>CV,never:()=>aV,null:()=>rV,nullable:()=>RV,number:()=>AR,object:()=>cV,objectUtil:()=>bS,oboolean:()=>PV,onumber:()=>TV,optional:()=>wV,ostring:()=>FV,pipeline:()=>EV,preprocess:()=>IV,promise:()=>bV,quotelessJson:()=>xM,record:()=>mV,set:()=>hV,setErrorMap:()=>RM,strictObject:()=>uV,string:()=>vR,symbol:()=>eV,transformer:()=>xV,tuple:()=>fV,undefined:()=>tV,union:()=>lV,unknown:()=>oV,util:()=>Me,void:()=>iV});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Me;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let a={};for(let i of o)a[i]=i;return a},e.getValidEnumValues=o=>{let a=e.objectKeys(o).filter(p=>typeof o[o[p]]!="number"),i={};for(let p of a)i[p]=o[p];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(a){return o[a]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let a=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&a.push(i);return a},e.find=(o,a)=>{for(let i of o)if(a(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,a=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(o,a)=>typeof a=="bigint"?a.toString():a})(Me||(Me={}));var bS;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(bS||(bS={}));var ue=Me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tn=e=>{switch(typeof e){case"undefined":return ue.undefined;case"string":return ue.string;case"number":return Number.isNaN(e)?ue.nan:ue.number;case"boolean":return ue.boolean;case"function":return ue.function;case"bigint":return ue.bigint;case"symbol":return ue.symbol;case"object":return Array.isArray(e)?ue.array:e===null?ue.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ue.promise:typeof Map<"u"&&e instanceof Map?ue.map:typeof Set<"u"&&e instanceof Set?ue.set:typeof Date<"u"&&e instanceof Date?ue.date:ue.object;default:return ue.unknown}};var X=Me.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),xM=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),er=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(a){return a.message},n={_errors:[]},o=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let p=n,f=0;for(;f<i.path.length;){let m=i.path[f];f===i.path.length-1?(p[m]=p[m]||{_errors:[]},p[m]._errors.push(r(i))):p[m]=p[m]||{_errors:[]},p=p[m],f++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let a=o.path[0];r[a]=r[a]||[],r[a].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};er.create=e=>new er(e);var wM=(e,t)=>{let r;switch(e.code){case X.invalid_type:e.received===ue.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case X.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Me.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:r=`Unrecognized key(s) in object: ${Me.joinValues(e.keys,", ")}`;break;case X.invalid_union:r="Invalid input";break;case X.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Me.joinValues(e.options)}`;break;case X.invalid_enum_value:r=`Invalid enum value. Expected ${Me.joinValues(e.options)}, received '${e.received}'`;break;case X.invalid_arguments:r="Invalid function arguments";break;case X.invalid_return_type:r="Invalid function return type";break;case X.invalid_date:r="Invalid date";break;case X.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Me.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case X.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case X.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case X.custom:r="Invalid input";break;case X.invalid_intersection_types:r="Intersection results could not be merged";break;case X.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case X.not_finite:r="Number must be finite";break;default:r=t.defaultError,Me.assertNever(e)}return{message:r}},On=wM;var dR=On;function RM(e){dR=e}function Ui(){return dR}d();c();l();u();var Hc=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...(o.path||[])],i={...o,path:a};if(o.message!==void 0)return{...o,path:a,message:o.message};let p="",f=n.filter(m=>!!m).slice().reverse();for(let m of f)p=m(i,{data:t,defaultError:p}).message;return{...o,path:a,message:p}},IM=[];function se(e,t){let r=Ui(),n=Hc({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===On?void 0:On].filter(o=>!!o)});e.common.issues.push(n)}var Dt=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return Ce;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static mergeObjectAsync(t,r){return _asyncToGenerator(function*(){let n=[];for(let o of r){let a=yield o.key,i=yield o.value;n.push({key:a,value:i})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:a,value:i}=o;if(a.status==="aborted"||i.status==="aborted")return Ce;a.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[a.value]=i.value)}return{status:t.value,value:n}}},Ce=Object.freeze({status:"aborted"}),ia=e=>({status:"dirty",value:e}),Lt=e=>({status:"valid",value:e}),sp=e=>e.status==="aborted",cp=e=>e.status==="dirty",uo=e=>e.status==="valid",Qi=e=>typeof Promise<"u"&&e instanceof Promise;d();c();l();u();d();c();l();u();var ge;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ge||(ge={}));var Cr=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},pR=(e,t)=>{if(uo(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new er(e.common.issues);return this._error=r,this._error}}};function Te(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,p)=>{let{message:f}=e;return i.code==="invalid_enum_value"?{message:f??p.defaultError}:typeof p.data>"u"?{message:f??n??p.defaultError}:i.code!=="invalid_type"?{message:p.defaultError}:{message:f??r??p.defaultError}},description:o}}var Ne=class{get description(){return this._def.description}_getType(t){return tn(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:tn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Dt,ctx:{common:t.parent.common,data:t.data,parsedType:tn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Qi(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tn(t)},o=this._parseSync({data:t,path:n.path,parent:n});return pR(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tn(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return uo(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>uo(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this31=this;return _asyncToGenerator(function*(){let n=yield _this31.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this32=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this32._def.errorMap,parent:null,data:t,parsedType:tn(t)},o=_this32._parse({data:t,path:n.path,parent:n}),a=yield Qi(o)?o:Promise.resolve(o);return pR(n,a)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,a)=>{let i=t(o),p=()=>a.addIssue({code:X.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(p(),!1)):i?!0:(p(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new br({schema:this,typeName:we.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Ar.create(this,this._def)}nullable(){return nn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Dn.create(this)}promise(){return fo.create(this,this._def)}or(t){return fa.create([this,t],this._def)}and(t){return ma.create(this,t,this._def)}transform(t){return new br({...Te(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new va({...Te(this._def),innerType:this,defaultValue:r,typeName:we.ZodDefault})}brand(){return new zc({typeName:we.ZodBranded,type:this,...Te(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Aa({...Te(this._def),innerType:this,catchValue:r,typeName:we.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Wc.create(this,t)}readonly(){return Ca.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},EM=/^c[^\s-]{8,}$/i,FM=/^[0-9a-z]+$/,TM=/^[0-9A-HJKMNP-TV-Z]{26}$/i,PM=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,kM=/^[a-z0-9_-]{21}$/i,OM=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,_M=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,NM=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,DM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",xS,qM=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,MM=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,VM=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,jM=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,LM=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,UM=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,mR="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",QM=new RegExp(`^${mR}$`);function gR(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function BM(e){return new RegExp(`^${gR(e)}$`)}function hR(e){let t=`${mR}T${gR(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function GM(e,t){return!!((t==="v4"||!t)&&qM.test(e)||(t==="v6"||!t)&&VM.test(e))}function $M(e,t){if(!OM.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function HM(e,t){return!!((t==="v4"||!t)&&MM.test(e)||(t==="v6"||!t)&&jM.test(e))}var lo=class e extends Ne{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ue.string){let a=this._getOrReturnCtx(t);return se(a,{code:X.invalid_type,expected:ue.string,received:a.parsedType}),Ce}let n=new Dt,o;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:X.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:X.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let i=t.data.length>a.value,p=t.data.length<a.value;(i||p)&&(o=this._getOrReturnCtx(t,o),i?se(o,{code:X.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):p&&se(o,{code:X.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")NM.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"email",code:X.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")xS||(xS=new RegExp(DM,"u")),xS.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"emoji",code:X.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")PM.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"uuid",code:X.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")kM.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"nanoid",code:X.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")EM.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"cuid",code:X.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")FM.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"cuid2",code:X.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")TM.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"ulid",code:X.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),se(o,{validation:"url",code:X.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"regex",code:X.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?hR(a).test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?QM.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?BM(a).test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?_M.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"duration",code:X.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?GM(t.data,a.version)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"ip",code:X.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?$M(t.data,a.alg)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"jwt",code:X.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?HM(t.data,a.version)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"cidr",code:X.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?LM.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"base64",code:X.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?UM.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"base64url",code:X.invalid_string,message:a.message}),n.dirty()):Me.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:X.invalid_string,...ge.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ge.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ge.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ge.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ge.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ge.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ge.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ge.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ge.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ge.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ge.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ge.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ge.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ge.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...ge.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...ge.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ge.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ge.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...ge.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ge.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ge.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ge.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ge.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ge.errToObj(r)})}nonempty(t){return this.min(1,ge.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};lo.create=e=>new lo({checks:[],typeName:we.ZodString,coerce:e?.coerce??!1,...Te(e)});function zM(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,a=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return a%i/10**o}var sa=class e extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ue.number){let a=this._getOrReturnCtx(t);return se(a,{code:X.invalid_type,expected:ue.number,received:a.parsedType}),Ce}let n,o=new Dt;for(let a of this._def.checks)a.kind==="int"?Me.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),se(n,{code:X.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),se(n,{code:X.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),se(n,{code:X.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?zM(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),se(n,{code:X.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),se(n,{code:X.not_finite,message:a.message}),o.dirty()):Me.assertNever(a);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ge.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ge.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ge.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ge.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ge.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ge.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ge.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ge.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ge.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ge.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Me.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};sa.create=e=>new sa({checks:[],typeName:we.ZodNumber,coerce:e?.coerce||!1,...Te(e)});var ca=class e extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ue.bigint)return this._getInvalidInput(t);let n,o=new Dt;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),se(n,{code:X.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),se(n,{code:X.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),se(n,{code:X.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):Me.assertNever(a);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return se(r,{code:X.invalid_type,expected:ue.bigint,received:r.parsedType}),Ce}gte(t,r){return this.setLimit("min",t,!0,ge.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ge.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ge.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ge.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ge.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};ca.create=e=>new ca({checks:[],typeName:we.ZodBigInt,coerce:e?.coerce??!1,...Te(e)});var ua=class extends Ne{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ue.boolean){let n=this._getOrReturnCtx(t);return se(n,{code:X.invalid_type,expected:ue.boolean,received:n.parsedType}),Ce}return Lt(t.data)}};ua.create=e=>new ua({typeName:we.ZodBoolean,coerce:e?.coerce||!1,...Te(e)});var la=class e extends Ne{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ue.date){let a=this._getOrReturnCtx(t);return se(a,{code:X.invalid_type,expected:ue.date,received:a.parsedType}),Ce}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return se(a,{code:X.invalid_date}),Ce}let n=new Dt,o;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:X.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:X.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Me.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:ge.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ge.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};la.create=e=>new la({checks:[],coerce:e?.coerce||!1,typeName:we.ZodDate,...Te(e)});var Gi=class extends Ne{_parse(t){if(this._getType(t)!==ue.symbol){let n=this._getOrReturnCtx(t);return se(n,{code:X.invalid_type,expected:ue.symbol,received:n.parsedType}),Ce}return Lt(t.data)}};Gi.create=e=>new Gi({typeName:we.ZodSymbol,...Te(e)});var da=class extends Ne{_parse(t){if(this._getType(t)!==ue.undefined){let n=this._getOrReturnCtx(t);return se(n,{code:X.invalid_type,expected:ue.undefined,received:n.parsedType}),Ce}return Lt(t.data)}};da.create=e=>new da({typeName:we.ZodUndefined,...Te(e)});var pa=class extends Ne{_parse(t){if(this._getType(t)!==ue.null){let n=this._getOrReturnCtx(t);return se(n,{code:X.invalid_type,expected:ue.null,received:n.parsedType}),Ce}return Lt(t.data)}};pa.create=e=>new pa({typeName:we.ZodNull,...Te(e)});var po=class extends Ne{constructor(){super(...arguments),this._any=!0}_parse(t){return Lt(t.data)}};po.create=e=>new po({typeName:we.ZodAny,...Te(e)});var Nn=class extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Lt(t.data)}};Nn.create=e=>new Nn({typeName:we.ZodUnknown,...Te(e)});var Or=class extends Ne{_parse(t){let r=this._getOrReturnCtx(t);return se(r,{code:X.invalid_type,expected:ue.never,received:r.parsedType}),Ce}};Or.create=e=>new Or({typeName:we.ZodNever,...Te(e)});var $i=class extends Ne{_parse(t){if(this._getType(t)!==ue.undefined){let n=this._getOrReturnCtx(t);return se(n,{code:X.invalid_type,expected:ue.void,received:n.parsedType}),Ce}return Lt(t.data)}};$i.create=e=>new $i({typeName:we.ZodVoid,...Te(e)});var Dn=class e extends Ne{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==ue.array)return se(r,{code:X.invalid_type,expected:ue.array,received:r.parsedType}),Ce;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,p=r.data.length<o.exactLength.value;(i||p)&&(se(r,{code:i?X.too_big:X.too_small,minimum:p?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(se(r,{code:X.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(se(r,{code:X.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,p)=>o.type._parseAsync(new Cr(r,i,r.path,p)))).then(i=>Dt.mergeArray(n,i));let a=[...r.data].map((i,p)=>o.type._parseSync(new Cr(r,i,r.path,p)));return Dt.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:ge.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:ge.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:ge.toString(r)}})}nonempty(t){return this.min(1,t)}};Dn.create=(e,t)=>new Dn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...Te(t)});function Bi(e){if(e instanceof tr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Ar.create(Bi(n))}return new tr({...e._def,shape:()=>t})}else return e instanceof Dn?new Dn({...e._def,type:Bi(e.element)}):e instanceof Ar?Ar.create(Bi(e.unwrap())):e instanceof nn?nn.create(Bi(e.unwrap())):e instanceof rn?rn.create(e.items.map(t=>Bi(t))):e}var tr=class e extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Me.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ue.object){let m=this._getOrReturnCtx(t);return se(m,{code:X.invalid_type,expected:ue.object,received:m.parsedType}),Ce}let{status:n,ctx:o}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),p=[];if(!(this._def.catchall instanceof Or&&this._def.unknownKeys==="strip"))for(let m in o.data)i.includes(m)||p.push(m);let f=[];for(let m of i){let g=a[m],A=o.data[m];f.push({key:{status:"valid",value:m},value:g._parse(new Cr(o,A,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof Or){let m=this._def.unknownKeys;if(m==="passthrough")for(let g of p)f.push({key:{status:"valid",value:g},value:{status:"valid",value:o.data[g]}});else if(m==="strict")p.length>0&&(se(o,{code:X.unrecognized_keys,keys:p}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let g of p){let A=o.data[g];f.push({key:{status:"valid",value:g},value:m._parse(new Cr(o,A,o.path,g)),alwaysSet:g in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let m=[];for(let g of f){let A=yield g.key,x=yield g.value;m.push({key:A,value:x,alwaysSet:g.alwaysSet})}return m})).then(m=>Dt.mergeObjectSync(n,m)):Dt.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return ge.errToObj,new e({...this._def,unknownKeys:"strict",...(t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:ge.errToObj(t).message??o}:{message:o}}}:{})})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:we.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of Me.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of Me.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Bi(this)}partial(t){let r={};for(let n of Me.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of Me.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Ar;)a=a._def.innerType;r[n]=a}return new e({...this._def,shape:()=>r})}keyof(){return yR(Me.objectKeys(this.shape))}};tr.create=(e,t)=>new tr({shape:()=>e,unknownKeys:"strip",catchall:Or.create(),typeName:we.ZodObject,...Te(t)});tr.strictCreate=(e,t)=>new tr({shape:()=>e,unknownKeys:"strict",catchall:Or.create(),typeName:we.ZodObject,...Te(t)});tr.lazycreate=(e,t)=>new tr({shape:e,unknownKeys:"strip",catchall:Or.create(),typeName:we.ZodObject,...Te(t)});var fa=class extends Ne{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(a){for(let p of a)if(p.result.status==="valid")return p.result;for(let p of a)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let i=a.map(p=>new er(p.ctx.common.issues));return se(r,{code:X.invalid_union,unionErrors:i}),Ce}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref71=_asyncToGenerator(function*(a){let i={...r,common:{...r.common,issues:[]},parent:null};return{result:yield a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}});return function(_x195){return _ref71.apply(this,arguments)}}())).then(o);{let a,i=[];for(let f of n){let m={...r,common:{...r.common,issues:[]},parent:null},g=f._parseSync({data:r.data,path:r.path,parent:m});if(g.status==="valid")return g;g.status==="dirty"&&!a&&(a={result:g,ctx:m}),m.common.issues.length&&i.push(m.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let p=i.map(f=>new er(f));return se(r,{code:X.invalid_union,unionErrors:p}),Ce}}get options(){return this._def.options}};fa.create=(e,t)=>new fa({options:e,typeName:we.ZodUnion,...Te(t)});var _n=e=>e instanceof ga?_n(e.schema):e instanceof br?_n(e.innerType()):e instanceof ha?[e.value]:e instanceof ya?e.options:e instanceof Sa?Me.objectValues(e.enum):e instanceof va?_n(e._def.innerType):e instanceof da?[void 0]:e instanceof pa?[null]:e instanceof Ar?[void 0,..._n(e.unwrap())]:e instanceof nn?[null,..._n(e.unwrap())]:e instanceof zc||e instanceof Ca?_n(e.unwrap()):e instanceof Aa?_n(e._def.innerType):[],up=class e extends Ne{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.object)return se(r,{code:X.invalid_type,expected:ue.object,received:r.parsedType}),Ce;let n=this.discriminator,o=r.data[n],a=this.optionsMap.get(o);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(se(r,{code:X.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let a of r){let i=_n(a.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let p of i){if(o.has(p))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(p)}`);o.set(p,a)}}return new e({typeName:we.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...Te(n)})}};function wS(e,t){let r=tn(e),n=tn(t);if(e===t)return{valid:!0,data:e};if(r===ue.object&&n===ue.object){let o=Me.objectKeys(t),a=Me.objectKeys(e).filter(p=>o.indexOf(p)!==-1),i={...e,...t};for(let p of a){let f=wS(e[p],t[p]);if(!f.valid)return{valid:!1};i[p]=f.data}return{valid:!0,data:i}}else if(r===ue.array&&n===ue.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let a=0;a<e.length;a++){let i=e[a],p=t[a],f=wS(i,p);if(!f.valid)return{valid:!1};o.push(f.data)}return{valid:!0,data:o}}else return r===ue.date&&n===ue.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var ma=class extends Ne{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(a,i)=>{if(sp(a)||sp(i))return Ce;let p=wS(a.value,i.value);return p.valid?((cp(a)||cp(i))&&r.dirty(),{status:r.value,value:p.data}):(se(n,{code:X.invalid_intersection_types}),Ce)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>o(a,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ma.create=(e,t,r)=>new ma({left:e,right:t,typeName:we.ZodIntersection,...Te(r)});var rn=class e extends Ne{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.array)return se(n,{code:X.invalid_type,expected:ue.array,received:n.parsedType}),Ce;if(n.data.length<this._def.items.length)return se(n,{code:X.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&n.data.length>this._def.items.length&&(se(n,{code:X.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((i,p)=>{let f=this._def.items[p]||this._def.rest;return f?f._parse(new Cr(n,i,n.path,p)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>Dt.mergeArray(r,i)):Dt.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};rn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new rn({items:e,typeName:we.ZodTuple,rest:null,...Te(t)})};var lp=class e extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.object)return se(n,{code:X.invalid_type,expected:ue.object,received:n.parsedType}),Ce;let o=[],a=this._def.keyType,i=this._def.valueType;for(let p in n.data)o.push({key:a._parse(new Cr(n,p,n.path,p)),value:i._parse(new Cr(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?Dt.mergeObjectAsync(r,o):Dt.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Ne?new e({keyType:t,valueType:r,typeName:we.ZodRecord,...Te(n)}):new e({keyType:lo.create(),valueType:t,typeName:we.ZodRecord,...Te(r)})}},Hi=class extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.map)return se(n,{code:X.invalid_type,expected:ue.map,received:n.parsedType}),Ce;let o=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([p,f],m)=>({key:o._parse(new Cr(n,p,n.path,[m,"key"])),value:a._parse(new Cr(n,f,n.path,[m,"value"]))}));if(n.common.async){let p=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let f of i){let m=yield f.key,g=yield f.value;if(m.status==="aborted"||g.status==="aborted")return Ce;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}))}else{let p=new Map;for(let f of i){let m=f.key,g=f.value;if(m.status==="aborted"||g.status==="aborted")return Ce;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}}};Hi.create=(e,t,r)=>new Hi({valueType:t,keyType:e,typeName:we.ZodMap,...Te(r)});var zi=class e extends Ne{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.set)return se(n,{code:X.invalid_type,expected:ue.set,received:n.parsedType}),Ce;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(se(n,{code:X.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(se(n,{code:X.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let a=this._def.valueType;function i(f){let m=new Set;for(let g of f){if(g.status==="aborted")return Ce;g.status==="dirty"&&r.dirty(),m.add(g.value)}return{status:r.value,value:m}}let p=[...n.data.values()].map((f,m)=>a._parse(new Cr(n,f,n.path,m)));return n.common.async?Promise.all(p).then(f=>i(f)):i(p)}min(t,r){return new e({...this._def,minSize:{value:t,message:ge.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:ge.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};zi.create=(e,t)=>new zi({valueType:e,minSize:null,maxSize:null,typeName:we.ZodSet,...Te(t)});var dp=class e extends Ne{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.function)return se(r,{code:X.invalid_type,expected:ue.function,received:r.parsedType}),Ce;function n(p,f){return Hc({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ui(),On].filter(m=>!!m),issueData:{code:X.invalid_arguments,argumentsError:f}})}function o(p,f){return Hc({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ui(),On].filter(m=>!!m),issueData:{code:X.invalid_return_type,returnTypeError:f}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof fo){let p=this;return Lt(/*#__PURE__*/_asyncToGenerator(function*(...f){let m=new er([]),g=yield p._def.args.parseAsync(f,a).catch(h=>{throw m.addIssue(n(f,h)),m}),A=yield Reflect.apply(i,this,g);return yield p._def.returns._def.type.parseAsync(A,a).catch(h=>{throw m.addIssue(o(A,h)),m})}))}else{let p=this;return Lt(function(...f){let m=p._def.args.safeParse(f,a);if(!m.success)throw new er([n(f,m.error)]);let g=Reflect.apply(i,this,m.data),A=p._def.returns.safeParse(g,a);if(!A.success)throw new er([o(g,A.error)]);return A.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:rn.create(t).rest(Nn.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||rn.create([]).rest(Nn.create()),returns:r||Nn.create(),typeName:we.ZodFunction,...Te(n)})}},ga=class extends Ne{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};ga.create=(e,t)=>new ga({getter:e,typeName:we.ZodLazy,...Te(t)});var ha=class extends Ne{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return se(r,{received:r.data,code:X.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:t.data}}get value(){return this._def.value}};ha.create=(e,t)=>new ha({value:e,typeName:we.ZodLiteral,...Te(t)});function yR(e,t){return new ya({values:e,typeName:we.ZodEnum,...Te(t)})}var ya=class e extends Ne{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return se(r,{expected:Me.joinValues(n),received:r.parsedType,code:X.invalid_type}),Ce}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return se(r,{received:r.data,code:X.invalid_enum_value,options:n}),Ce}return Lt(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};ya.create=yR;var Sa=class extends Ne{_parse(t){let r=Me.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ue.string&&n.parsedType!==ue.number){let o=Me.objectValues(r);return se(n,{expected:Me.joinValues(o),received:n.parsedType,code:X.invalid_type}),Ce}if(this._cache||(this._cache=new Set(Me.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=Me.objectValues(r);return se(n,{received:n.data,code:X.invalid_enum_value,options:o}),Ce}return Lt(t.data)}get enum(){return this._def.values}};Sa.create=(e,t)=>new Sa({values:e,typeName:we.ZodNativeEnum,...Te(t)});var fo=class extends Ne{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.promise&&r.common.async===!1)return se(r,{code:X.invalid_type,expected:ue.promise,received:r.parsedType}),Ce;let n=r.parsedType===ue.promise?r.data:Promise.resolve(r.data);return Lt(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};fo.create=(e,t)=>new fo({type:e,typeName:we.ZodPromise,...Te(t)});var br=class extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this33=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,a={addIssue:i=>{se(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){let i=o.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(/*#__PURE__*/function(){var _ref74=_asyncToGenerator(function*(p){if(r.value==="aborted")return Ce;let f=yield _this33._def.schema._parseAsync({data:p,path:n.path,parent:n});return f.status==="aborted"?Ce:f.status==="dirty"?ia(f.value):r.value==="dirty"?ia(f.value):f});return function(_x196){return _ref74.apply(this,arguments)}}());{if(r.value==="aborted")return Ce;let p=this._def.schema._parseSync({data:i,path:n.path,parent:n});return p.status==="aborted"?Ce:p.status==="dirty"?ia(p.value):r.value==="dirty"?ia(p.value):p}}if(o.type==="refinement"){let i=p=>{let f=o.refinement(p,a);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(n.common.async===!1){let p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return p.status==="aborted"?Ce:(p.status==="dirty"&&r.dirty(),i(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>p.status==="aborted"?Ce:(p.status==="dirty"&&r.dirty(),i(p.value).then(()=>({status:r.value,value:p.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!uo(i))return Ce;let p=o.transform(i.value,a);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>uo(i)?Promise.resolve(o.transform(i.value,a)).then(p=>({status:r.value,value:p})):Ce);Me.assertNever(o)}};br.create=(e,t,r)=>new br({schema:e,typeName:we.ZodEffects,effect:t,...Te(r)});br.createWithPreprocess=(e,t,r)=>new br({schema:t,effect:{type:"preprocess",transform:e},typeName:we.ZodEffects,...Te(r)});var Ar=class extends Ne{_parse(t){return this._getType(t)===ue.undefined?Lt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ar.create=(e,t)=>new Ar({innerType:e,typeName:we.ZodOptional,...Te(t)});var nn=class extends Ne{_parse(t){return this._getType(t)===ue.null?Lt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};nn.create=(e,t)=>new nn({innerType:e,typeName:we.ZodNullable,...Te(t)});var va=class extends Ne{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===ue.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};va.create=(e,t)=>new va({innerType:e,typeName:we.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Te(t)});var Aa=class extends Ne{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Qi(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new er(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new er(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Aa.create=(e,t)=>new Aa({innerType:e,typeName:we.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Te(t)});var Wi=class extends Ne{_parse(t){if(this._getType(t)!==ue.nan){let n=this._getOrReturnCtx(t);return se(n,{code:X.invalid_type,expected:ue.nan,received:n.parsedType}),Ce}return{status:"valid",value:t.data}}};Wi.create=e=>new Wi({typeName:we.ZodNaN,...Te(e)});var WM=Symbol("zod_brand"),zc=class extends Ne{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Wc=class e extends Ne{_parse(t){var _this34=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let a=yield _this34._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ce:a.status==="dirty"?(r.dirty(),ia(a.value)):_this34._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Ce:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:we.ZodPipeline})}},Ca=class extends Ne{_parse(t){let r=this._def.innerType._parse(t),n=o=>(uo(o)&&(o.value=Object.freeze(o.value)),o);return Qi(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Ca.create=(e,t)=>new Ca({innerType:e,typeName:we.ZodReadonly,...Te(t)});function fR(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function SR(e,t={},r){return e?po.create().superRefine((n,o)=>{let a=e(n);if(a instanceof Promise)return a.then(i=>{if(!i){let p=fR(t,n),f=p.fatal??r??!0;o.addIssue({code:"custom",...p,fatal:f})}});if(!a){let i=fR(t,n),p=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:p})}}):po.create()}var YM={object:tr.lazycreate},we;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(we||(we={}));var KM=(e,t={message:`Input not instance of ${e.name}`})=>SR(r=>r instanceof e,t),vR=lo.create,AR=sa.create,XM=Wi.create,ZM=ca.create,CR=ua.create,JM=la.create,eV=Gi.create,tV=da.create,rV=pa.create,nV=po.create,oV=Nn.create,aV=Or.create,iV=$i.create,sV=Dn.create,cV=tr.create,uV=tr.strictCreate,lV=fa.create,dV=up.create,pV=ma.create,fV=rn.create,mV=lp.create,gV=Hi.create,hV=zi.create,yV=dp.create,SV=ga.create,vV=ha.create,AV=ya.create,CV=Sa.create,bV=fo.create,xV=br.create,wV=Ar.create,RV=nn.create,IV=br.createWithPreprocess,EV=Wc.create,FV=()=>vR().optional(),TV=()=>AR().optional(),PV=()=>CR().optional(),kV={string:e=>lo.create({...e,coerce:!0}),number:e=>sa.create({...e,coerce:!0}),boolean:e=>ua.create({...e,coerce:!0}),bigint:e=>ca.create({...e,coerce:!0}),date:e=>la.create({...e,coerce:!0})};var OV=Ce;var _V=R.object({name:R.string(),arguments:R.string()}),NV=R.object({id:R.string(),type:R.literal("function"),function:_V,encryptedValue:R.string().optional()}),pp=R.object({id:R.string(),role:R.string(),content:R.string().optional(),name:R.string().optional(),encryptedValue:R.string().optional()}),DV=R.object({type:R.literal("text"),text:R.string()}),qV=R.object({type:R.literal("data"),value:R.string(),mimeType:R.string()}),MV=R.object({type:R.literal("url"),value:R.string(),mimeType:R.string().optional()}),fp=R.discriminatedUnion("type",[qV,MV]),VV=R.object({type:R.literal("image"),source:fp,metadata:R.unknown().optional()}),jV=R.object({type:R.literal("audio"),source:fp,metadata:R.unknown().optional()}),LV=R.object({type:R.literal("video"),source:fp,metadata:R.unknown().optional()}),UV=R.object({type:R.literal("document"),source:fp,metadata:R.unknown().optional()});var bR=R.object({type:R.literal("binary"),mimeType:R.string(),id:R.string().optional(),url:R.string().optional(),data:R.string().optional(),filename:R.string().optional()}),xR=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:R.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},ade=bR.superRefine((e,t)=>{xR(e,t)}),QV=R.discriminatedUnion("type",[DV,VV,jV,LV,UV,bR]),BV=QV.superRefine((e,t)=>{e.type==="binary"&&xR(e,t)}),GV=pp.extend({role:R.literal("developer"),content:R.string()}),$V=pp.extend({role:R.literal("system"),content:R.string()}),HV=pp.extend({role:R.literal("assistant"),content:R.string().optional(),toolCalls:R.array(NV).optional()}),zV=pp.extend({role:R.literal("user"),content:R.union([R.string(),R.array(BV)])}),WV=R.object({id:R.string(),content:R.string(),role:R.literal("tool"),toolCallId:R.string(),error:R.string().optional(),encryptedValue:R.string().optional()}),YV=R.object({id:R.string(),role:R.literal("activity"),activityType:R.string(),content:R.record(R.any())}),KV=R.object({id:R.string(),role:R.literal("reasoning"),content:R.string(),encryptedValue:R.string().optional()}),wR=R.discriminatedUnion("role",[GV,$V,HV,zV,WV,YV,KV]),ide=R.union([R.literal("developer"),R.literal("system"),R.literal("assistant"),R.literal("user"),R.literal("tool"),R.literal("activity"),R.literal("reasoning")]),XV=R.object({description:R.string(),value:R.string()}),RR=R.object({name:R.string(),description:R.string(),parameters:R.any(),metadata:R.record(R.any()).optional()}),ZV=R.object({id:R.string(),reason:R.string(),message:R.string().optional(),toolCallId:R.string().optional(),responseSchema:R.record(R.any()).optional(),expiresAt:R.string().optional(),metadata:R.record(R.any()).optional()}),JV=R.object({interruptId:R.string(),status:R.enum(["resolved","cancelled"]),payload:R.any().optional()}),ej=R.object({threadId:R.string(),runId:R.string(),parentRunId:R.string().optional(),state:R.any(),messages:R.array(wR),tools:R.array(RR),context:R.array(XV),forwardedProps:R.any(),resume:R.array(JV).optional()}),tj=R.any(),at=class extends Error{constructor(e){super(e)}},RS=class extends at{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},rj=R.object({name:R.string(),description:R.string().optional()}),nj=R.object({name:R.string().optional(),type:R.string().optional(),description:R.string().optional(),version:R.string().optional(),provider:R.string().optional(),documentationUrl:R.string().optional(),metadata:R.record(R.unknown()).optional()}),oj=R.object({streaming:R.boolean().optional(),websocket:R.boolean().optional(),httpBinary:R.boolean().optional(),pushNotifications:R.boolean().optional(),resumable:R.boolean().optional()}),aj=R.object({supported:R.boolean().optional(),items:R.array(RR).optional(),parallelCalls:R.boolean().optional(),clientProvided:R.boolean().optional()}),ij=R.object({structuredOutput:R.boolean().optional(),supportedMimeTypes:R.array(R.string()).optional()}),sj=R.object({snapshots:R.boolean().optional(),deltas:R.boolean().optional(),memory:R.boolean().optional(),persistentState:R.boolean().optional()}),cj=R.object({supported:R.boolean().optional(),delegation:R.boolean().optional(),handoffs:R.boolean().optional(),subAgents:R.array(rj).optional()}),uj=R.object({supported:R.boolean().optional(),streaming:R.boolean().optional(),encrypted:R.boolean().optional()}),lj=R.object({image:R.boolean().optional(),audio:R.boolean().optional(),video:R.boolean().optional(),pdf:R.boolean().optional(),file:R.boolean().optional()}),dj=R.object({image:R.boolean().optional(),audio:R.boolean().optional()}),pj=R.object({input:lj.optional(),output:dj.optional()}),fj=R.object({codeExecution:R.boolean().optional(),sandboxed:R.boolean().optional(),maxIterations:R.number().optional(),maxExecutionTime:R.number().optional()}),mj=R.object({supported:R.boolean().optional(),approvals:R.boolean().optional(),interventions:R.boolean().optional(),feedback:R.boolean().optional(),interrupts:R.boolean().optional(),approveWithEdits:R.boolean().optional()}),sde=R.object({identity:nj.optional(),transport:oj.optional(),tools:aj.optional(),output:ij.optional(),state:sj.optional(),multiAgent:cj.optional(),reasoning:uj.optional(),multimodal:pj.optional(),execution:fj.optional(),humanInTheLoop:mj.optional(),custom:R.record(R.unknown()).optional()}),IR=R.union([R.literal("developer"),R.literal("system"),R.literal("assistant"),R.literal("user")]),V=function(e){return e.TEXT_MESSAGE_START="TEXT_MESSAGE_START",e.TEXT_MESSAGE_CONTENT="TEXT_MESSAGE_CONTENT",e.TEXT_MESSAGE_END="TEXT_MESSAGE_END",e.TEXT_MESSAGE_CHUNK="TEXT_MESSAGE_CHUNK",e.TOOL_CALL_START="TOOL_CALL_START",e.TOOL_CALL_ARGS="TOOL_CALL_ARGS",e.TOOL_CALL_END="TOOL_CALL_END",e.TOOL_CALL_CHUNK="TOOL_CALL_CHUNK",e.TOOL_CALL_RESULT="TOOL_CALL_RESULT",e.THINKING_START="THINKING_START",e.THINKING_END="THINKING_END",e.THINKING_TEXT_MESSAGE_START="THINKING_TEXT_MESSAGE_START",e.THINKING_TEXT_MESSAGE_CONTENT="THINKING_TEXT_MESSAGE_CONTENT",e.THINKING_TEXT_MESSAGE_END="THINKING_TEXT_MESSAGE_END",e.STATE_SNAPSHOT="STATE_SNAPSHOT",e.STATE_DELTA="STATE_DELTA",e.MESSAGES_SNAPSHOT="MESSAGES_SNAPSHOT",e.ACTIVITY_SNAPSHOT="ACTIVITY_SNAPSHOT",e.ACTIVITY_DELTA="ACTIVITY_DELTA",e.RAW="RAW",e.CUSTOM="CUSTOM",e.RUN_STARTED="RUN_STARTED",e.RUN_FINISHED="RUN_FINISHED",e.RUN_ERROR="RUN_ERROR",e.STEP_STARTED="STEP_STARTED",e.STEP_FINISHED="STEP_FINISHED",e.REASONING_START="REASONING_START",e.REASONING_MESSAGE_START="REASONING_MESSAGE_START",e.REASONING_MESSAGE_CONTENT="REASONING_MESSAGE_CONTENT",e.REASONING_MESSAGE_END="REASONING_MESSAGE_END",e.REASONING_MESSAGE_CHUNK="REASONING_MESSAGE_CHUNK",e.REASONING_END="REASONING_END",e.REASONING_ENCRYPTED_VALUE="REASONING_ENCRYPTED_VALUE",e}({}),Qe=R.object({type:R.nativeEnum(V),timestamp:R.number().optional(),rawEvent:R.any().optional()}).passthrough(),gj=Qe.extend({type:R.literal(V.TEXT_MESSAGE_START),messageId:R.string(),role:IR.default("assistant"),name:R.string().optional()}),ER=Qe.extend({type:R.literal(V.TEXT_MESSAGE_CONTENT),messageId:R.string(),delta:R.string()}),hj=Qe.extend({type:R.literal(V.TEXT_MESSAGE_END),messageId:R.string()}),yj=Qe.extend({type:R.literal(V.TEXT_MESSAGE_CHUNK),messageId:R.string().optional(),role:IR.optional(),delta:R.string().optional(),name:R.string().optional()}),Sj=Qe.extend({type:R.literal(V.THINKING_TEXT_MESSAGE_START)}),vj=ER.omit({messageId:!0,type:!0}).extend({type:R.literal(V.THINKING_TEXT_MESSAGE_CONTENT)}),Aj=Qe.extend({type:R.literal(V.THINKING_TEXT_MESSAGE_END)}),Cj=Qe.extend({type:R.literal(V.TOOL_CALL_START),toolCallId:R.string(),toolCallName:R.string(),parentMessageId:R.string().optional()}),bj=Qe.extend({type:R.literal(V.TOOL_CALL_ARGS),toolCallId:R.string(),delta:R.string()}),xj=Qe.extend({type:R.literal(V.TOOL_CALL_END),toolCallId:R.string()}),wj=Qe.extend({messageId:R.string(),type:R.literal(V.TOOL_CALL_RESULT),toolCallId:R.string(),content:R.string(),role:R.literal("tool").optional()}),Rj=Qe.extend({type:R.literal(V.TOOL_CALL_CHUNK),toolCallId:R.string().optional(),toolCallName:R.string().optional(),parentMessageId:R.string().optional(),delta:R.string().optional()}),Ij=Qe.extend({type:R.literal(V.THINKING_START),title:R.string().optional()}),Ej=Qe.extend({type:R.literal(V.THINKING_END)}),Fj=Qe.extend({type:R.literal(V.STATE_SNAPSHOT),snapshot:tj}),Tj=Qe.extend({type:R.literal(V.STATE_DELTA),delta:R.array(R.any())}),Pj=Qe.extend({type:R.literal(V.MESSAGES_SNAPSHOT),messages:R.array(wR)}),kj=Qe.extend({type:R.literal(V.ACTIVITY_SNAPSHOT),messageId:R.string(),activityType:R.string(),content:R.record(R.any()),replace:R.boolean().optional().default(!0)}),Oj=Qe.extend({type:R.literal(V.ACTIVITY_DELTA),messageId:R.string(),activityType:R.string(),patch:R.array(R.any())}),_j=Qe.extend({type:R.literal(V.RAW),event:R.any(),source:R.string().optional()}),Nj=Qe.extend({type:R.literal(V.CUSTOM),name:R.string(),value:R.any()}),Dj=Qe.extend({type:R.literal(V.RUN_STARTED),threadId:R.string(),runId:R.string(),parentRunId:R.string().optional(),input:ej.optional()}),qj=R.object({type:R.literal("success")}).strict(),Mj=R.object({type:R.literal("interrupt"),interrupts:R.array(ZV).min(1)}).strict(),Vj=R.discriminatedUnion("type",[qj,Mj]),jj=Qe.extend({type:R.literal(V.RUN_FINISHED),threadId:R.string(),runId:R.string(),result:R.any().optional(),outcome:Vj.nullable().optional().transform(e=>e??void 0)}),Lj=Qe.extend({type:R.literal(V.RUN_ERROR),message:R.string(),code:R.string().optional()}),Uj=Qe.extend({type:R.literal(V.STEP_STARTED),stepName:R.string()}),Qj=Qe.extend({type:R.literal(V.STEP_FINISHED),stepName:R.string()}),Bj=R.union([R.literal("tool-call"),R.literal("message")]),Gj=Qe.extend({type:R.literal(V.REASONING_START),messageId:R.string()}),$j=Qe.extend({type:R.literal(V.REASONING_MESSAGE_START),messageId:R.string(),role:R.literal("reasoning")}),Hj=Qe.extend({type:R.literal(V.REASONING_MESSAGE_CONTENT),messageId:R.string(),delta:R.string()}),zj=Qe.extend({type:R.literal(V.REASONING_MESSAGE_END),messageId:R.string()}),Wj=Qe.extend({type:R.literal(V.REASONING_MESSAGE_CHUNK),messageId:R.string().optional(),delta:R.string().optional()}),Yj=Qe.extend({type:R.literal(V.REASONING_END),messageId:R.string()}),Kj=Qe.extend({type:R.literal(V.REASONING_ENCRYPTED_VALUE),subtype:Bj,entityId:R.string(),encryptedValue:R.string()}),mp=R.discriminatedUnion("type",[gj,ER,hj,yj,Ij,Ej,Sj,vj,Aj,Cj,bj,xj,Rj,wj,Fj,Tj,Pj,kj,Oj,_j,Nj,Dj,jj,Lj,Uj,Qj,Gj,$j,Hj,zj,Wj,Yj,Kj]);d();c();l();u();var IS={};Hs(IS,{JsonPatchError:()=>dt,_areEquals:()=>Xc,applyOperation:()=>ba,applyPatch:()=>Cp,applyReducer:()=>tL,deepClone:()=>Jj,getValueByPointer:()=>vp,validate:()=>TR,validator:()=>Ap});d();c();l();u();d();c();l();u();var Xj=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zj=Object.prototype.hasOwnProperty;function hp(e,t){return Zj.call(e,t)}function yp(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var o in e)hp(e,o)&&n.push(o);return n}function qt(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Sp(e){for(var t=0,r=e.length,n;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}function on(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Yc(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function gp(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(gp(e[t]))return!0}else if(typeof e=="object"){for(var n=yp(e),o=n.length,a=0;a<o;a++)if(gp(e[n[a]]))return!0}}return!1}function FR(e,t){var r=[e];for(var n in t){var o=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof o<"u"&&r.push(n+": "+o)}return r.join(`
32
+ `;function KN(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var XN=["1",1,"yes",!0];function Fc(){let e=[];return Wh()&&e.push(window.doNotTrack),cy()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>XN.indexOf(t)!==-1)}var Ib="v15",Eb={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function ZN(e=Eb.default,t=Ib,r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}var JN="38824e1f-37f5-42d3-8372-a4b8fa9df946",cr=class{get defaultOptions(){return{endpoint:Eb.default,isCustomEndpoint:!1,token:"",version:Ib,beforeSendHooks:[],afterSendHooks:[]}}get version(){return bb}constructor(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[U0,q0].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let r={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};Fc()?this.runtime=new El:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(De.view,{newEventType:De.view,addClientIdParameter:!0}),this.addEventTypeMapping(De.click,{newEventType:De.click,addClientIdParameter:!0}),this.addEventTypeMapping(De.custom,{newEventType:De.custom,addClientIdParameter:!0}),this.addEventTypeMapping(De.search,{newEventType:De.search,addClientIdParameter:!0})}initRuntime(t){return Wh()&&ni()?new ay(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(KN()&&console.warn(YN),new iy(t))}get storage(){return this.runtime.storage}determineVisitorId(){return U(this,void 0,void 0,function*(){try{return Wh()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Bo()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Bo()}})}getCurrentVisitorId(){return U(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return U(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return U(this,void 0,void 0,function*(){if(xl(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(lb(t,lb(r,JN)))}})}getParameters(t,...r){return U(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return U(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(Bo()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Fc())return null;try{let r=new URL(t).searchParams.get(zn.cvo_cid);if(r==null)return null;let n=zn.fromString(r);return!n||!ni()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return U(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:a=!1,addClientIdParameter:i=!1}=this.eventTypeMapping[t]||{};return yield[h=>n.length>0?this.parseVariableArgumentsPayload(n,h):h[0],h=>U(this,void 0,void 0,function*(){return Object.assign(Object.assign({},h),{visitorId:o?yield this.getCurrentVisitorId():""})}),h=>U(this,void 0,void 0,function*(){return i?Object.assign(Object.assign({},h),{clientId:yield this.getCurrentVisitorId()}):h}),h=>a?this.ensureAnonymousUserWhenUsingApiKey(h):h,h=>this.beforeSendHooks.reduce((y,b)=>U(this,void 0,void 0,function*(){let w=yield y;return yield b(t,w)}),h)].reduce((h,y)=>U(this,void 0,void 0,function*(){let b=yield h;return yield y(b)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return U(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[A=>this.setTrackingIdIfTrackingIdNotPresent(A),A=>this.removeEmptyPayloadValues(A,t),A=>this.validateParams(A,t),A=>n?jN(A):A,A=>n?this.removeUnknownParameters(A):A,A=>n?this.processCustomParameters(A):this.mapCustomParametersToCustomData(A)].reduce((A,x)=>U(this,void 0,void 0,function*(){let h=yield A;return yield x(h)}),Promise.resolve(r))})}makeEvent(t,...r){return U(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),a=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:a,log:i=>U(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},a),i)}),yield Promise.all(this.afterSendHooks.map(p=>p(t,Object.assign(Object.assign({},o),i)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return U(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return U(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new bl().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(De.search,t)})}sendSearchEvent(t){return U(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Br(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(De.click,t)})}sendClickEvent(t){return U(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Br(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(De.custom,t)})}sendCustomEvent(t){return U(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=Br(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(De.view,t)})}sendViewEvent(t){return U(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return U(this,void 0,void 0,function*(){let r=yield(yield v(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return U(this,void 0,void 0,function*(){return yield(yield v(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,a=r.length;o<a;o++){let i=r[o];if(typeof i=="string")n[t[o]]=i;else if(typeof i=="object")return Object.assign(Object.assign({},n),i)}return n}isKeyAllowedEmpty(t,r){return({[De.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,a)=>Object.assign(Object.assign({},o),{[a]:t[a]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(BN(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=Br(t,["custom"]),o={};r&&Cl(r)&&(o=this.lowercaseKeys(r));let a=GN(n);return Object.assign(Object.assign({},o),a)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=Br(t,["custom"]);if(r&&Cl(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=Br(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==De.view||r==De.click||r==De.search||r==De.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==De.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=Br(t,["userId"]);return WN(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=Br(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Cl(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Cl(n.customData)&&(n.customData.hasOwnProperty("context_website")||n.customData.hasOwnProperty("siteName"))&&(n.trackingId=n.customData.context_website||n.customData.siteName),n)}limit(t,r){return typeof t=="string"?rN(t,r):t}get baseUrl(){return ZN(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},kt;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(kt||(kt={}));var O;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerOpenInlineLink="generatedAnswerOpenInlineLink",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick",e.generatedAnswerFollowupOpenSource="generatedAnswerFollowupOpenSource",e.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach"})(O||(O={}));var sy={[O.triggerNotify]:"queryPipelineTriggers",[O.triggerExecute]:"queryPipelineTriggers",[O.triggerQuery]:"queryPipelineTriggers",[O.triggerRedirect]:"queryPipelineTriggers",[O.queryErrorBack]:"errors",[O.queryErrorClear]:"errors",[O.queryErrorRetry]:"errors",[O.pagerNext]:"getMoreResults",[O.pagerPrevious]:"getMoreResults",[O.pagerNumber]:"getMoreResults",[O.pagerResize]:"getMoreResults",[O.pagerScrolling]:"getMoreResults",[O.facetSearch]:"facet",[O.facetShowLess]:"facet",[O.facetShowMore]:"facet",[O.recommendation]:"recommendation",[O.likeSmartSnippet]:"smartSnippet",[O.dislikeSmartSnippet]:"smartSnippet",[O.expandSmartSnippet]:"smartSnippet",[O.collapseSmartSnippet]:"smartSnippet",[O.openSmartSnippetFeedbackModal]:"smartSnippet",[O.closeSmartSnippetFeedbackModal]:"smartSnippet",[O.sendSmartSnippetReason]:"smartSnippet",[O.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[O.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[O.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[O.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[O.clearRecentQueries]:"recentQueries",[O.recentResultClick]:"recentlyClickedDocuments",[O.clearRecentResults]:"recentlyClickedDocuments",[O.showLessFoldedResults]:"folding",[O.caseDetach]:"case",[O.likeGeneratedAnswer]:"generatedAnswer",[O.dislikeGeneratedAnswer]:"generatedAnswer",[O.openGeneratedAnswerSource]:"generatedAnswer",[O.generatedAnswerOpenInlineLink]:"generatedAnswer",[O.generatedAnswerFollowupOpenSource]:"generatedAnswer",[O.generatedAnswerStreamEnd]:"generatedAnswer",[O.generatedAnswerSourceHover]:"generatedAnswer",[O.generatedAnswerCopyToClipboard]:"generatedAnswer",[O.generatedAnswerHideAnswers]:"generatedAnswer",[O.generatedAnswerShowAnswers]:"generatedAnswer",[O.generatedAnswerExpand]:"generatedAnswer",[O.generatedAnswerCollapse]:"generatedAnswer",[O.generatedAnswerFeedbackSubmit]:"generatedAnswer",[O.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[kt.expandToFullUI]:"interface",[kt.openUserActions]:"User Actions",[kt.showPrecedingSessions]:"User Actions",[kt.showFollowingSessions]:"User Actions",[kt.clickViewedDocument]:"User Actions",[kt.clickPageView]:"User Actions",[kt.createArticle]:"createArticle"},Wn=class{constructor(){this.runtime=new El,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(De.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(De.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(De.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(De.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return bb}};function eD(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function tD(e){return e.map(t=>t.replace(/;/g,""))}function Fb(e){let r=e.join(";");return r.length<=256?r:Fb(e.slice(1))}var yb=e=>{let t=tD(e),r=eD(t);return Fb(r)};function Sb(e){let t=typeof e.partialQueries=="string"?e.partialQueries:yb(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:yb(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var Fl=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Fc();this.coveoAnalyticsClient=n?new Wn:new cr(t)}disable(){this.coveoAnalyticsClient=new Wn}enable(){this.coveoAnalyticsClient=new cr(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(O.interfaceLoad)}logInterfaceLoad(){return U(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(O.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return U(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(O.recommendation)}logRecommendation(){return U(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(O.recommendationOpen,t,r)}logRecommendationOpen(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(O.staticFilterClearAll,t)}logStaticFilterClearAll(t){return U(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(O.staticFilterSelect,t)}logStaticFilterSelect(t){return U(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(O.staticFilterDeselect,t)}logStaticFilterDeselect(t){return U(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(O.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return U(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(O.interfaceChange,t)}logInterfaceChange(t){return U(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(O.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return U(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(O.didyoumeanClick)}logDidYouMeanClick(){return U(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(O.resultsSort,t)}logResultsSort(t){return U(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(O.searchboxSubmit)}logSearchboxSubmit(){return U(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(O.searchboxClear)}logSearchboxClear(){return U(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(O.searchboxAsYouType)}logSearchboxAsYouType(){return U(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(O.breadcrumbFacet,t)}logBreadcrumbFacet(t){return U(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(O.breadcrumbResetAll)}logBreadcrumbResetAll(){return U(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(O.documentQuickview,t,r)}logDocumentQuickview(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(O.documentOpen,t,r)}logDocumentOpen(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(O.omniboxAnalytics,Sb(t))}logOmniboxAnalytics(t){return U(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(O.omniboxFromLink,Sb(t))}logOmniboxFromLink(t){return U(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(O.searchFromLink)}logSearchFromLink(){return U(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(O.triggerNotify,t)}logTriggerNotify(t){return U(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(O.triggerExecute,t)}logTriggerExecute(t){return U(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(O.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return U(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(O.undoTriggerQuery,t)}logUndoTriggerQuery(t){return U(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(O.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return U(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(O.pagerResize,t)}logPagerResize(t){return U(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(O.pagerNumber,t)}logPagerNumber(t){return U(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(O.pagerNext,t)}logPagerNext(t){return U(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(O.pagerPrevious,t)}logPagerPrevious(t){return U(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(O.pagerScrolling)}logPagerScrolling(){return U(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(O.facetClearAll,t)}logFacetClearAll(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(O.facetSearch,t)}logFacetSearch(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(O.facetSelect,t)}logFacetSelect(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(O.facetDeselect,t)}logFacetDeselect(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(O.facetExclude,t)}logFacetExclude(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(O.facetUnexclude,t)}logFacetUnexclude(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(O.facetSelectAll,t)}logFacetSelectAll(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(O.facetUpdateSort,t)}logFacetUpdateSort(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(O.facetShowMore,t)}logFacetShowMore(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(O.facetShowLess,t)}logFacetShowLess(t){return U(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(O.queryError,t)}logQueryError(t){return U(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return U(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(O.queryErrorBack);return{description:t.description,log:()=>U(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(O.queryErrorBack)})}})}logQueryErrorBack(){return U(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return U(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(O.queryErrorRetry);return{description:t.description,log:()=>U(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(O.queryErrorRetry)})}})}logQueryErrorRetry(){return U(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return U(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(O.queryErrorClear);return{description:t.description,log:()=>U(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(O.queryErrorClear)})}})}logQueryErrorClear(){return U(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(O.likeSmartSnippet)}logLikeSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(O.dislikeSmartSnippet)}logDislikeSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(O.expandSmartSnippet)}logExpandSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(O.collapseSmartSnippet)}logCollapseSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(O.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(O.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return U(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(O.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(O.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return U(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(O.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return U(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(O.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return U(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(O.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return U(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(O.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(O.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(O.copyToClipboard,t,r)}logCopyToClipboard(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(O.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(O.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(O.recentQueryClick)}logRecentQueryClick(){return U(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(O.clearRecentQueries)}logClearRecentQueries(){return U(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(O.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(O.clearRecentResults)}logClearRecentResults(){return U(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(O.noResultsBack)}logNoResultsBack(){return U(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(O.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(O.showLessFoldedResults)}logShowLessFoldedResults(){return U(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return U(this,arguments,void 0,function*(n,o,a=sy[n]){this.coveoAnalyticsClient.getParameters;let i=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),p=Object.assign(Object.assign({},yield this.getBaseEventRequest(i)),{eventType:a,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(p);return{description:this.makeEventDescription(f,n),log:({searchUID:m})=>f.log({lastSearchQueryUid:m})}})}logCustomEvent(t,r){return U(this,arguments,void 0,function*(n,o,a=sy[n]){return(yield this.makeCustomEvent(n,o,a)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return U(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),a=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),i=yield this.coveoAnalyticsClient.makeCustomEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({lastSearchQueryUid:p})}})}logCustomEventWithType(t,r,n){return U(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return U(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:a})=>o.log({searchQueryUid:a})}})}makeClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){let a=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),i=yield this.coveoAnalyticsClient.makeClickEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({searchQueryUid:p})}})}logClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return U(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return U(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof cr?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent(O.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return U(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(O.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return U(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(O.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return U(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerOpenInlineLink(t){return this.makeCustomEvent(O.generatedAnswerOpenInlineLink,t)}logGeneratedAnswerOpenInlineLink(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerOpenInlineLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(O.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFollowupOpenSource(t){return this.makeCustomEvent(O.generatedAnswerFollowupOpenSource,t)}logGeneratedAnswerFollowupOpenSource(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFollowupOpenSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(O.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(O.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(O.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(O.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(O.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(O.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(O.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(O.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(O.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return U(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(O.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return U(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(O.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Tl=Object.assign({},Rc),vb=Object.keys(Tl).map(e=>Tl[e]),oi=class extends Xh{constructor({client:t,uuidGenerator:r=Bo}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);return r!==null?r:t==="setTicket"?this.setTicket:null}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>vb.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(vb.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Tl.pageview,{newEventType:De.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Tl.event,{newEventType:De.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),a=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},a),o),r)}getTicketPayload(){return sN(this.ticket)}};oi.Id="svc";var Pl;(function(e){e.click="click",e.flowStart="flowStart"})(Pl||(Pl={}));var hr;(function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.documentSuggestionClick="documentSuggestionClick",e.documentSuggestionQuickview="documentSuggestionQuickview",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"})(hr||(hr={}));var kl;(function(e){e.quit="Quit",e.solved="Solved"})(kl||(kl={}));var Ol=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Fc();this.coveoAnalyticsClient=o?new cr(t):new Wn,this.svc=new oi({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Wn,this.svc=new oi({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new cr(this.options),this.svc=new oi({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(hr.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(hr.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(hr.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(hr.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(hr.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(hr.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(hr.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(hr.caseCancelled,{reason:kl.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(hr.caseSolved,{reason:kl.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(hr.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Pl.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Pl.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return U(this,void 0,void 0,function*(){var r,n;let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof cr?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,a;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(a=this.provider)===null||a===void 0?void 0:a.getOriginLevel3()}}logClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){var a,i;let p=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(i=(a=this.provider)===null||a===void 0?void 0:a.getSearchUID())!==null&&i!==void 0?i:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(p)})}},rD=e=>{let t={};return e.caseContext&&Object.keys(e.caseContext).forEach(r=>{var n;let o=(n=e.caseContext)===null||n===void 0?void 0:n[r];if(o){let a=`context_${r}`;t[a]=o}}),t},de=(e,t=!0)=>{let{caseContext:r,caseId:n,caseNumber:o}=e,a=Br(e,["caseContext","caseId","caseNumber"]),i=rD(e);return Object.assign(Object.assign(Object.assign({CaseId:n,CaseNumber:o},a),!!i.context_Case_Subject&&{CaseSubject:i.context_Case_Subject}),t&&i)},_l=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Fc();this.coveoAnalyticsClient=n?new Wn:new cr(t)}disable(){this.coveoAnalyticsClient=new Wn}enable(){this.coveoAnalyticsClient=new cr(this.opts)}logInterfaceLoad(t){if(t){let r=de(t);return this.logSearchEvent(O.interfaceLoad,r)}return this.logSearchEvent(O.interfaceLoad)}logRecentQueryClick(t){if(t){let r=de(t);return this.logSearchEvent(O.recentQueryClick,r)}return this.logSearchEvent(O.recentQueryClick)}logClearRecentQueries(t){if(t){let r=de(t);return this.logCustomEvent(O.clearRecentQueries,r)}return this.logCustomEvent(O.clearRecentQueries)}logInterfaceChange(t){let r=de(t);return this.logSearchEvent(O.interfaceChange,r)}logStaticFilterDeselect(t){let r=de(t);return this.logSearchEvent(O.staticFilterDeselect,r)}logFetchMoreResults(t){if(t){let r=de(t);return this.logCustomEvent(O.pagerScrolling,Object.assign(Object.assign({},r),{type:"getMoreResults"}))}return this.logCustomEvent(O.pagerScrolling,{type:"getMoreResults"})}logBreadcrumbFacet(t){let r=de(t);return this.logSearchEvent(O.breadcrumbFacet,r)}logBreadcrumbResetAll(t){if(t){let r=de(t);return this.logSearchEvent(O.breadcrumbResetAll,r)}return this.logSearchEvent(O.breadcrumbResetAll)}logFacetSelect(t){let r=de(t);return this.logSearchEvent(O.facetSelect,r)}logFacetExclude(t){let r=de(t);return this.logSearchEvent(O.facetExclude,r)}logFacetDeselect(t){let r=de(t);return this.logSearchEvent(O.facetDeselect,r)}logFacetUpdateSort(t){let r=de(t);return this.logSearchEvent(O.facetUpdateSort,r)}logFacetClearAll(t){let r=de(t);return this.logSearchEvent(O.facetClearAll,r)}logFacetShowMore(t){let r=de(t,!1);return this.logCustomEvent(O.facetShowMore,r)}logFacetShowLess(t){let r=de(t,!1);return this.logCustomEvent(O.facetShowLess,r)}logQueryError(t){let r=de(t,!1);return this.logCustomEvent(O.queryError,r)}logPagerNumber(t){let r=de(t,!1);return this.logCustomEvent(O.pagerNumber,r)}logPagerNext(t){let r=de(t,!1);return this.logCustomEvent(O.pagerNext,r)}logPagerPrevious(t){let r=de(t,!1);return this.logCustomEvent(O.pagerPrevious,r)}logDidYouMeanAutomatic(t){if(t){let r=de(t);return this.logSearchEvent(O.didyoumeanAutomatic,r)}return this.logSearchEvent(O.didyoumeanAutomatic)}logDidYouMeanClick(t){if(t){let r=de(t);return this.logSearchEvent(O.didyoumeanClick,r)}return this.logSearchEvent(O.didyoumeanClick)}logResultsSort(t){let r=de(t);return this.logSearchEvent(O.resultsSort,r)}logSearchboxSubmit(t){if(t){let r=de(t);return this.logSearchEvent(O.searchboxSubmit,r)}return this.logSearchEvent(O.searchboxSubmit)}logContextChanged(t){let r=de(t);return this.logSearchEvent(kt.contextChanged,r)}logExpandToFullUI(t){let r=de(t);return this.logCustomEvent(kt.expandToFullUI,r)}logOpenUserActions(t){let r=de(t,!1);return this.logCustomEvent(kt.openUserActions,r)}logShowPrecedingSessions(t){let r=de(t,!1);return this.logCustomEvent(kt.showPrecedingSessions,r)}logShowFollowingSessions(t){let r=de(t,!1);return this.logCustomEvent(kt.showFollowingSessions,r)}logViewedDocumentClick(t,r){return this.logCustomEvent(kt.clickViewedDocument,Object.assign(Object.assign({},de(r,!1)),{document:t}))}logPageViewClick(t,r){return this.logCustomEvent(kt.clickPageView,Object.assign(Object.assign({},de(r,!1)),{pageView:t}))}logCreateArticle(t,r){return this.logCustomEvent(kt.createArticle,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logDocumentOpen(t,r,n){return this.logClickEvent(O.documentOpen,t,r,n?de(n,!1):void 0)}logCopyToClipboard(t,r,n){return this.logClickEvent(O.copyToClipboard,t,r,n?de(n,!1):void 0)}logCaseSendEmail(t,r,n){return this.logClickEvent(O.caseSendEmail,t,r,n?de(n,!1):void 0)}logFeedItemTextPost(t,r,n){return this.logClickEvent(O.feedItemTextPost,t,r,n?de(n,!1):void 0)}logDocumentQuickview(t,r,n){let o={documentTitle:t.documentTitle,documentURL:t.documentUrl};return this.logClickEvent(O.documentQuickview,t,r,n?Object.assign(Object.assign({},de(n,!1)),o):o)}logCaseAttach(t,r,n){let o={documentTitle:t.documentTitle,documentURL:t.documentUrl,resultUriHash:t.documentUriHash};return this.logClickEvent(O.caseAttach,t,r,n?Object.assign(Object.assign({},de(n,!1)),o):o)}logCaseDetach(t,r,n){let o=Object.assign(Object.assign(Object.assign({},r&&de(r,!1)),n&&{permanentId:n}),{resultUriHash:t});return this.logCustomEvent(O.caseDetach,o)}logLikeSmartSnippet(t){return this.logCustomEvent(O.likeSmartSnippet,t?de(t,!1):void 0)}logDislikeSmartSnippet(t){return this.logCustomEvent(O.dislikeSmartSnippet,t?de(t,!1):void 0)}logExpandSmartSnippet(t){return this.logCustomEvent(O.expandSmartSnippet,t?de(t,!1):void 0)}logCollapseSmartSnippet(t){return this.logCustomEvent(O.collapseSmartSnippet,t?de(t,!1):void 0)}logOpenSmartSnippetFeedbackModal(t){return this.logCustomEvent(O.openSmartSnippetFeedbackModal,t?de(t,!1):void 0)}logCloseSmartSnippetFeedbackModal(t){return this.logCustomEvent(O.closeSmartSnippetFeedbackModal,t?de(t,!1):void 0)}logSmartSnippetFeedbackReason(t,r,n){return this.logCustomEvent(O.sendSmartSnippetReason,n?Object.assign(Object.assign({},de(n,!1)),{reason:t,details:r}):{reason:t,details:r})}logExpandSmartSnippetSuggestion(t,r){let n="documentId"in t?t:{documentId:t};return this.logCustomEvent(O.expandSmartSnippetSuggestion,r?Object.assign(Object.assign({},de(r,!1)),n):n)}logCollapseSmartSnippetSuggestion(t,r){let n="documentId"in t?t:{documentId:t};return this.logCustomEvent(O.collapseSmartSnippetSuggestion,r?Object.assign(Object.assign({},de(r,!1)),n):n)}logOpenSmartSnippetSource(t,r,n){return this.logClickEvent(O.openSmartSnippetSource,t,r,n?de(n,!1):void 0)}logOpenSmartSnippetSuggestionSource(t,r,n){return this.logClickEvent(O.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},n?Object.assign(Object.assign({},de(n,!1)),r):r)}logOpenSmartSnippetInlineLink(t,r,n){return this.logClickEvent(O.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},n?Object.assign(Object.assign({},de(n,!1)),r):r)}logOpenSmartSnippetSuggestionInlineLink(t,r,n){return this.logClickEvent(O.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},n?Object.assign(Object.assign({},de(n,!1)),r):r)}logLikeGeneratedAnswer(t,r){return this.logCustomEvent(O.likeGeneratedAnswer,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logDislikeGeneratedAnswer(t,r){return this.logCustomEvent(O.dislikeGeneratedAnswer,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logOpenGeneratedAnswerSource(t,r){return this.logCustomEvent(O.openGeneratedAnswerSource,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logGeneratedAnswerCitationClick(t,r,n){return this.logClickEvent(O.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},n?Object.assign(Object.assign({},de(n,!1)),r):r)}logGeneratedAnswerSourceHover(t,r){return this.logCustomEvent(O.generatedAnswerSourceHover,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logGeneratedAnswerCopyToClipboard(t,r){return this.logCustomEvent(O.generatedAnswerCopyToClipboard,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logGeneratedAnswerHideAnswers(t,r){return this.logCustomEvent(O.generatedAnswerHideAnswers,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logGeneratedAnswerShowAnswers(t,r){return this.logCustomEvent(O.generatedAnswerShowAnswers,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logGeneratedAnswerExpand(t,r){return this.logCustomEvent(O.generatedAnswerExpand,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logGeneratedAnswerCollapse(t,r){return this.logCustomEvent(O.generatedAnswerCollapse,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logGeneratedAnswerFeedbackSubmit(t,r){return this.logCustomEvent(O.generatedAnswerFeedbackSubmit,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logGeneratedAnswerFeedbackSubmitV2(t,r){return this.logCustomEvent(O.generatedAnswerFeedbackSubmitV2,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logRephraseGeneratedAnswer(t,r){return this.logSearchEvent(O.rephraseGeneratedAnswer,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logRetryGeneratedAnswer(t){return this.logSearchEvent(O.retryGeneratedAnswer,t?Object.assign({},de(t,!1)):{})}logGeneratedAnswerStreamEnd(t,r){return this.logCustomEvent(O.generatedAnswerStreamEnd,r?Object.assign(Object.assign({},de(r,!1)),t):t)}logGeneratedAnswerCitationDocumentAttach(t,r,n){return this.logClickEvent(O.generatedAnswerCitationDocumentAttach,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},n?Object.assign(Object.assign({},de(n,!1)),r):r)}logCustomEvent(t,r){return U(this,void 0,void 0,function*(){let n=Object.assign(Object.assign({},this.provider.getBaseMetadata()),r),o=Object.assign(Object.assign({},yield this.getBaseCustomEventRequest(n)),{eventType:sy[t],eventValue:t});return this.coveoAnalyticsClient.sendCustomEvent(o)})}logSearchEvent(t,r){return U(this,void 0,void 0,function*(){return this.coveoAnalyticsClient.sendSearchEvent(yield this.getBaseSearchEventRequest(t,r))})}logClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){let a=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(a)})}logShowMoreFoldedResults(t,r,n){return U(this,void 0,void 0,function*(){return this.logClickEvent(O.showMoreFoldedResults,t,r,n?de(n,!1):void 0)})}logShowLessFoldedResults(t){return U(this,void 0,void 0,function*(){return this.logCustomEvent(O.showLessFoldedResults,t?de(t,!1):void 0)})}logTriggerNotify(t,r){return this.logCustomEvent(O.triggerNotify,r?Object.assign(Object.assign({},de(r,!1)),t):t)}getBaseCustomEventRequest(t){return U(this,void 0,void 0,function*(){return Object.assign(Object.assign({},yield this.getBaseEventRequest(t)),{lastSearchQueryUid:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return U(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{searchQueryUid:this.provider.getSearchUID(),queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return U(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign({},this.getOrigins()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof cr?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}};d();c();l();u();d();c();l();u();var ii=()=>"default";var nD=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},Yn=class{constructor(t){le(this,"getState",t);le(this,"state");this.state=t()}getLanguage(){return nD(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[a,i]of Object.entries(n)){let p=`context_${a}`;o[p]=i}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=Hn),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||ii()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};d();c();l();u();var Tb=e=>new cr(e).getCurrentVisitorId(),si=(e,t)=>typeof t=="function"?(...r)=>{let n=Xs(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,ci=(e,t)=>(...r)=>{let n=Xs(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};var Tc=class extends Yn{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},Pb=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o=new Tc(t)})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??mt(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new Ol({enableAnalytics:m,token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:si(e,n),beforeSendHooks:[ci(e,r),(A,x)=>(e.info({...x,type:A,endpoint:p,token:i},"Analytics request"),x)]},o);return m||g.disable(),g};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Nl(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();function oD(e,t){return!!t&&t.facetId in e.facetSet}var Fn=(e,t)=>e.search?.response.facets.find(r=>r.facetId===t),kb=(e,t)=>e.facetSet[t]?.request,dy=(e,t)=>{let r=Fn(e,t);return oD(e,r)?r:void 0};var Ob=(e,t)=>dy(e,t)?.values.filter(r=>r.state!=="idle")||[],Gr=e=>e.search.isLoading;d();c();l();u();function _b(e){if(!e)return{parents:[],values:[]};let t=[],r=e;for(;r.length&&r[0].children.length;)t=[...t,...r],r=r[0].children;let n=r.find(o=>o.state==="selected");return n&&(t=[...t,n],r=[]),{parents:t,values:r}}function $r(e){let{activeValue:t,ancestryMap:r}=aD(e);return t?iD(t,r):[]}function aD(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function iD(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}function sD(e,t){return!!t&&t.facetId in e.categoryFacetSet}var py=(e,t)=>{let r=Fn(e,t);if(sD(e,r))return r},fy=(e,t)=>e.categoryFacetSet[t]?.request,Nb=(e,t)=>{let r=py(e,t);return $r(r?.values??[])},my=(e,t)=>{let r=fy(e,t);return $r(r?.currentValues??[])};d();c();l();u();function ui(){return{}}d();c();l();u();function Db(e,t){return{request:e,tabs:t}}function li(){return{}}d();c();l();u();function qb(e,t){return{request:e,tabs:t}}function di(){return{}}d();c();l();u();function Mb(e,t){return{request:e,hasBreadcrumbs:!0,tabs:t}}function pi(){return{}}var Go=(e,t)=>{let r=Ub(t,e),n=r?r.field:"",o=gy(n,e);return{facetId:e,facetField:n,facetTitle:o}};function fi(e,t){let{facetId:r,facetValue:n}=e,o=Go(r,t),a=Qb(t,r);return{...o,facetValue:a==="hierarchical"?Lb(t,r):n}}function Xt(e){return{facetSet:e.facetSet??pi(),categoryFacetSet:e.categoryFacetSet??ui(),dateFacetSet:e.dateFacetSet??li(),numericFacetSet:e.numericFacetSet??di(),automaticFacetSet:e.automaticFacetSet??Nl()}}var Dl=e=>{let t=[];return lD(e).forEach((r,n)=>{let o=Qb(e,r.facetId),a=gD(r,n+1);if(uD(r)){if(!!!my(e,r.facetId).length)return;t.push({...a,...fD(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((i,p)=>{if(i.state==="idle")return;let f=Vb(i,p+1,o),m=cD(r)?jb(i):pD(i);t.push({...a,...f,...m})})}),dD(e).forEach((r,n)=>{let o=mD(r,n+1);r.values.forEach((a,i)=>{if(a.state==="idle")return;let p=Vb(a,i+1,"specific"),f=jb(a);t.push({...o,...p,...f})})}),t},cD=e=>e.type==="specific",uD=e=>e.type==="hierarchical",lD=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),dD=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Vb=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),pD=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),jb=e=>({displayValue:e.value,value:e.value}),Lb=(e,t)=>my(e,t).map(n=>n.value).join(";"),fD=(e,t)=>{let n=Lb(e,t);return{value:n,valuePosition:1,displayValue:n}},mD=(e,t)=>({title:gy(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),gD=(e,t)=>({title:gy(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),gy=(e,t)=>`${e}_${t}`,Ub=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,Qb=(e,t)=>{let r=Ub(e,t);return r?r.type:"specific"};d();c();l();u();d();c();l();u();var hy=e=>e.configuration.search.locale,Bb=e=>e.configuration.search.timezone,Gb=e=>e.configuration.accessToken,$b=e=>e.configuration.organizationId,Hb=e=>e.configuration.environment,ql=e=>e.configuration?.knowledge?.agentId,zb=e=>e.configuration.knowledge.debugAgentSession;var Ue=e=>{if(hD(e)||yy(e))return e.generatedAnswer?.answerId;if(yD(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},hD=e=>"answer"in e&&"generatedAnswer"in e&&!J(e.generatedAnswer?.answerConfigurationId),yy=e=>{let t=ql(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},yD=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",Sy=e=>e.generatedAnswer?.fieldsToIncludeInCitations,Wb=e=>e.followUpAnswers?.conversationId,SD=e=>e.generatedAnswer?.citations,vD=e=>e.followUpAnswers?.followUpAnswers,AD=ct(vD,e=>e?.flatMap(t=>t.citations)),CD=(e,t)=>t,mi=ct(SD,AD,CD,(e,t,r)=>e?.find(n=>n.id===r)??t?.find(n=>n.id===r));d();c();l();u();var ut=()=>({q:"",enableQuerySyntax:!1});var Pc=class extends Yn{getSearchUID(){let t=this.getState();return t.search?.searchResponseId||t.search?.response.searchUid||At().response.searchUid}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getFacetState(){return Dl(Xt(this.state))}getBaseMetadata(){let t=this.getState(),r=super.getBaseMetadata(),n=Ue(t);return n&&(r.generativeQuestionAnsweringId=n),r}getGeneratedAnswerMetadata(){let t=this.getState();return{...(t.generatedAnswer?.isVisible!==void 0&&{showGeneratedAnswer:t.generatedAnswer.isVisible})}}get queryText(){return this.state.query?.q||ut().q}get responseTime(){return this.state.search?.duration||At().duration}mapResultsToAnalyticsDocument(){return this.state.search?.response.results.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.search?.response.results.length||At().response.results.length}},Yb=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o=new Pc(t)})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??mt(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new _l({enableAnalytics:m,token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:si(e,n),beforeSendHooks:[ci(e,r),(A,x)=>(e.info({...x,type:A,endpoint:p,token:i},"Analytics request"),x)]},o);return m||g.disable(),g};d();c();l();u();d();c();l();u();d();c();l();u();var Ml=(r=>(r.Ascending="ascending",r.Descending="descending",r))(Ml||{}),Vl=(a=>(a.Relevancy="relevancy",a.QRE="qre",a.Date="date",a.Field="field",a.NoSort="nosort",a))(Vl||{}),Hr=e=>{if(Ba(e))return e.map(t=>Hr(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},jl=()=>({by:"relevancy"}),Kb=e=>({by:"date",order:e});var Xb=new Y({values:{by:new Ks({enum:Vl,required:!0}),order:new Ks({enum:Ml}),field:new $}});function ur(){return Hr(jl())}d();c();l();u();d();c();l();u();d();c();l();u();var gi=class e{static set(t,r,n){let o,a,i;n&&(a=new Date,a.setTime(a.getTime()+n));let p=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,m=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(p)||m.test(p)||p.indexOf(".")===-1?vy(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],vy(t,r,a,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let 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 vy(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}d();c();l();u();function bD(){return typeof navigator<"u"}function Zb(){try{return typeof localStorage<"u"}catch{return!1}}function Jb(){try{return typeof sessionStorage<"u"}catch{return!1}}function ex(){return!!(bD()&&navigator.cookieEnabled)}var tx=null;function rx(){return tx||(Zb()?localStorage:ex()?new Ay:Jb()?sessionStorage:new Cy)}var hi=class hi{getItem(t){return gi.get(`${hi.prefix}${t}`)}removeItem(t){gi.erase(`${hi.prefix}${t}`)}setItem(t,r,n){gi.set(`${hi.prefix}${t}`,r,n)}};le(hi,"prefix","coveo_");var Ay=hi;var Cy=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var Ll="__coveo.analytics.history",xD=20,wD=1e3*60,RD=75,$o=class $o{constructor(t){le(this,"store");this.store=t||rx()}static getInstance(t){return $o.instance||($o.instance=new $o(t)),$o.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this6=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this6.cropQueryElement(_this6.stripEmptyQuery(t));let r=yield _this6.getHistoryWithInternalTimeAsync();r!==null?_this6.isValidEntry(t)&&_this6.setHistory([t].concat(r)):_this6.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this7=this;return _asyncToGenerator(function*(){let t=yield _this7.getHistoryWithInternalTimeAsync();return _this7.stripEmptyQueries(_this7.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(Ll);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this8=this;return _asyncToGenerator(function*(){try{let t=yield _this8.store.getItem(Ll);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(Ll,JSON.stringify(t.slice(0,xD)))}catch{}}clear(){try{this.store.removeItem(Ll)}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,RD)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>wD:!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))}};le($o,"instance",null);var by=$o,Vt=by;var kc=class kc extends Yn{constructor(){super(...arguments);le(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return Dl(Xt(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||kc.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||At().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||kc.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Ue(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetValue:n,facetTitle:`${a}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,criteria:n,facetTitle:`${a}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${a}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??ur()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:a,categoryFacetPath:n,categoryFacetTitle:`${a}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],a=o.completions.map(m=>m.expression),i=o.partialQueries.length-1,p=o.partialQueries[i]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:a.indexOf(n),partialQuery:p,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:a.length>0?a:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||ut().q}get responseTime(){return this.state.search?.duration||At().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||At().response.totalCountFiltered}};le(kc,"fallbackPipelineName","default");var Kn=kc,nx=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??mt(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new Fl({token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:si(e,n),beforeSendHooks:[ci(e,r),(A,x)=>(e.info({...x,type:A,endpoint:p,token:i},"Analytics request"),x)]},o);return m||g.disable(),g},xy=()=>{let t=Vt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};d();c();l();u();function Ul(e){let t=ox(e),r=[e,...t].filter(o=>o.parentResult).map(o=>o.parentResult);return iA([e,...t,...r],o=>o.uniqueId)}function ox(e){return e.childResults?e.childResults.flatMap(t=>[t,...ox(t)]):[]}d();c();l();u();var Oc=()=>"";function ix(e,t){return{...new Kn(t).getBaseMetadata(),actionCause:e,type:e}}function ID(e){return Object.assign(e,{instantlyCallable:!0})}function ED(e,t){let r=a=>{let i=me(e,a);return ID(Object.assign(i,{type:i.typePrefix}))},n=r(/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(a,{getState:i,extra:p}){let{analyticsClientMiddleware:f,preprocessRequest:m,logger:g}=p;return yield(yield t({getState:i,analyticsClientMiddleware:f,preprocessRequest:m,logger:g})).log({state:i(),extra:p})});return function(_x19,_x20){return _ref10.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref11=_asyncToGenerator(function*({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f}){let{description:m,log:g}=yield t({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f});return{description:m,action:r(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(A,{getState:x,extra:h}){return yield g({state:x(),extra:h})});return function(_x22,_x23){return _ref12.apply(this,arguments)}}())}});return function prepare(_x21){return _ref11.apply(this,arguments)}}()}),n}var wy=(e,t,r)=>{function n(...o){let a=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return PD(a)}return n},FD=e=>e.configuration.analytics.analyticsMode==="legacy",TD=e=>e.configuration.analytics.analyticsMode==="next",PD=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:a,providerClass:i})=>(r??(r=p=>new i(p)),ED(e,/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*({getState:p,analyticsClientMiddleware:f,preprocessRequest:m,logger:g}){let A=[],x={log:function(){var _ref14=_asyncToGenerator(function*({state:I}){for(let F of A)yield F(I)});return function log(_x25){return _ref14.apply(this,arguments)}}()},h=p(),y=a({getState:p,logger:g,analyticsClientMiddleware:f,preprocessRequest:m,provider:r(p)}),b=yield t(y,p());x.description=b?.description,A.push(/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(I){FD(I)&&(yield kD(b,r,I,g,y.coveoAnalyticsClient))});return function(_x26){return _ref15.apply(this,arguments)}}());let{emit:w}=wc(h);return A.push(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(I){if(TD(I)&&o&&n){let F=n(I);yield jD(w,o,F)}});return function(_x27){return _ref16.apply(this,arguments)}}()),x});return function(_x24){return _ref13.apply(this,arguments)}}()));function kD(_x28,_x29,_x30,_x31,_x32){return _kD.apply(this,arguments)}function _kD(){_kD=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let a=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:a},"Analytics response")});return _kD.apply(this,arguments)}var sx=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref17=_asyncToGenerator(function*(a){r(n,o)});return function log(_x33){return _ref17.apply(this,arguments)}}()}),ze=wy(e=>nx({...e,provider:e.provider||new Kn(e.getState)}),e=>e,Kn),e9=wy(Pb,sx("caseAssist"),Tc),te=e=>wy(Yb,sx(e),Pc),Xe=(e,t)=>{let r=a=>a+(t.pagination?.firstResult??0),n=-1,o=t.search?.results;return n=ux(e,o),n<0&&(n=VD(e,o)),n<0&&(n=0),_D(e,r(n),t)};var Ql=(e,t)=>({sourceName:OD(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||Oc()});function OD(e){let t=e.source;return J(t)?"unknown":t}var Bl=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function _D(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:qD(e),...(ax(e)?{documentCategory:ax(e)}:{}),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:MD(e),queryPipeline:r.pipeline||Oc()}}function ax(e){return e.raw?.objecttype||void 0}var Ze=e=>(e.raw.permanentid||console.warn("Missing field permanentid on result. This might cause many issues with your Coveo deployment. See https://docs.coveo.com/en/1913 and https://docs.coveo.com/en/1640 for more information.",e),{contentIDKey:"permanentid",contentIDValue:e.raw.permanentid||""}),cx={urihash:new $,sourcetype:new $,permanentid:new $},Gl={uniqueId:H,raw:new Y({values:cx}),title:H,uri:H,clickUri:H,rankingModifier:new $({required:!1,emptyAllowed:!0})};function ND(e){return Object.assign({},...Object.keys(cx).map(t=>({[t]:e[t]})))}function DD(e){return Object.assign({},...Object.keys(Gl).map(t=>({[t]:e[t]})),{raw:ND(e.raw)})}function qD(e){let t=e.raw.author;return J(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function MD(e){let t=e.raw.source;return J(t)?"unknown":t}var Ot=e=>new Pe(Gl).validate(DD(e));function VD(e,t){for(let[r,n]of t.entries()){let o=Ul(n);if(ux(e,o)!==-1)return r}return-1}function ux(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function jD(_x34,_x35,_x36){return _jD.apply(this,arguments)}function _jD(){_jD=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _jD.apply(this,arguments)}var Pr=(e,t)=>{let r=Ze(e),n=Xe(e,t);return{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:n.documentTitle,author:n.documentAuthor,url:n.documentUri}};d();c();l();u();var Ry=e=>_(e,{evt:H,type:We}),lx=e=>ze("analytics/generic/search",t=>{Ry(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),dx=e=>ze("analytics/generic/click",(t,r)=>(Ot(e.result),Ry(e),t.makeClickEvent(e.evt,Xe(e.result,r),Ze(e.result),e.meta))),px=e=>ze("analytics/generic/custom",t=>(Ry(e),t.makeCustomEventWithType(e.evt,e.type,e.meta)));var fx=()=>({actionCause:"interfaceLoad"}),yi=()=>({actionCause:"interfaceChange"});d();c();l();u();var Iy=()=>We,mx=()=>H,Si=P("configuration/updateBasicConfiguration",e=>_(e,{accessToken:We,environment:new $({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:We})),vi=P("configuration/updateSearchConfiguration",e=>_(e,{proxyBaseUrl:new $({required:!1,url:!0}),pipeline:new $({required:!1,emptyAllowed:!0}),searchHub:We,timezone:We,locale:We,authenticationProviders:new oe({required:!1,each:H})})),LD={enabled:new fe({default:!0}),originContext:Iy(),originLevel2:Iy(),originLevel3:Iy(),proxyBaseUrl:new $({required:!1,url:!0}),runtimeEnvironment:new $e,anonymous:new fe({default:!1}),deviceId:We,userDisplayName:We,documentLocation:We,trackingId:JA,analyticsMode:new $({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new Y({options:{required:!1},values:sb.reduce((e,t)=>(e[t]=ZA,e),{})})},$l=P("configuration/updateAnalyticsConfiguration",e=>_(e,LD)),Hl=P("configuration/analytics/disable"),zl=P("configuration/analytics/enable"),gx=P("configuration/analytics/originlevel2",e=>_(e,{originLevel2:mx()})),hx=P("configuration/analytics/originlevel3",e=>_(e,{originLevel3:mx()})),yx=P("knowledge/setAgentId",e=>_(e,new $({required:!0})));d();c();l();u();var Wl=P("insightConfiguration/set",e=>_(e,{insightId:H}));d();c();l();u();d();c();l();u();var Sx=()=>({insightId:""});var Yl=pe(Sx(),e=>{e.addCase(Wl,(t,r)=>{t.insightId=r.payload.insightId})});d();c();l();u();d();c();l();u();var Kl=P("searchHub/set",e=>_(e,new $({required:!0,emptyAllowed:!0})));var zr=me("insight/interface/fetch",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,{getState:t,dispatch:r,rejectWithValue:n,extra:{apiClient:o}}){let a=t(),i=yield o.getInterface(UD(a));return He(i)?n(i.error):(r(Kl(i.success.searchHub)),{response:i.success})});return function(_x37,_x38){return _ref18.apply(this,arguments)}}()),UD=e=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:mt(e.configuration.organizationId,e.configuration.environment),insightId:e.insightConfiguration.insightId});d();c();l();u();d();c();l();u();var vx=()=>({loading:!1,config:void 0});var Xn=pe(vx(),e=>{e.addCase(zr.pending,t=>{t.loading=!0,t.error=void 0}).addCase(zr.rejected,(t,r)=>{t.loading=!1,t.error=r.payload}).addCase(zr.fulfilled,(t,r)=>{t.loading=!1,t.error=void 0;let{searchHub:n,...o}=r.payload.response;t.config=o})});d();c();l();u();d();c();l();u();d();c();l();u();function Ax(e){return e.type==="dateRange"}function Cx(e){return`start${e}`}function bx(e){return`end${e}`}var Ey=()=>({dateFacetValueMap:{}});function QD(e,t,r){let n=e.start,o=e.end;return Bn(n)&&(n=tc(n),r.dateFacetValueMap[t][Cx(n)]=e.start),Bn(o)&&(o=tc(o),r.dateFacetValueMap[t][bx(o)]=e.end),{...e,start:n,end:o}}function Fy(e,t){if(Ax(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>QD(o,r,t))}}return e}function Wr(e){let t=Ey();return{request:{...e,facets:e.facets?.map(n=>Fy(n,t))},mappings:t}}function BD(e,t,r){return{...e,start:r.dateFacetValueMap[t][Cx(e.start)]||e.start,end:r.dateFacetValueMap[t][bx(e.end)]||e.end}}function GD(e,t){return e.facetId in t.dateFacetValueMap}function $D(e,t){return GD(e,t)?{...e,values:e.values.map(r=>BD(r,e.facetId,t))}:e}function kr(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>$D(n,t))}}:e}d();c();l();u();d();c();l();u();var Zn=/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield Tb(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(xy()&&{pageId:xy()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:ri(e)})}}});return function Zn(_x39,_x40){return _ref19.apply(this,arguments)}}();var xx=/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e,t){return{accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,url:mt(t.configuration.organizationId,t.configuration.environment),count:t.querySuggest[e].count,insightId:t.insightConfiguration.insightId,q:t.querySet?.[e],timezone:t.configuration.search.timezone,actionsHistory:t.configuration.analytics.enabled?Vt.getInstance().getHistory():[],...(t.insightCaseContext?.caseContext&&{context:t.insightCaseContext.caseContext}),...(t.configuration.analytics.enabled&&{...(t.configuration.analytics.enabled&&(yield Zn(t.configuration.analytics)))})}});return function xx(_x41,_x42){return _ref20.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var Xl=P("didYouMean/enable"),wx=P("didYouMean/disable"),Zl=P("didYouMean/automaticCorrections/disable"),Rx=P("didYouMean/automaticCorrections/enable"),Zt=P("didYouMean/correction",e=>_(e,H)),_c=P("didYouMean/automaticCorrections/mode",e=>_(e,new $({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var HD=P("history/undo"),zD=P("history/redo"),bt=P("history/snapshot"),s7=me("history/back",/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,{dispatch:t}){t(HD()),yield t(tt())});return function(_x43,_x44){return _ref21.apply(this,arguments)}}()),c7=me("history/forward",/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,{dispatch:t}){t(zD()),yield t(tt())});return function(_x45,_x46){return _ref22.apply(this,arguments)}}()),tt=me("history/change",/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x47,_x48){return _ref23.apply(this,arguments)}}());d();c();l();u();d();c();l();u();var Tn=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});d();c();l();u();function Jl(){return{contextValues:{}}}d();c();l();u();var ed=()=>!1;d();c();l();u();function Ix(){return{contextValues:{}}}d();c();l();u();function Ty(){return{enabled:!0,tabs:{}}}function td(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function Ex(){return[]}d();c();l();u();function Yr(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function rd(){return{}}d();c();l();u();function Fx(){return{}}d();c();l();u();function nd(){return{}}function xt(e){return{context:e.context||Jl(),dictionaryFieldContext:e.dictionaryFieldContext||Ix(),facetSet:e.facetSet||pi(),numericFacetSet:e.numericFacetSet||di(),dateFacetSet:e.dateFacetSet||li(),categoryFacetSet:e.categoryFacetSet||ui(),automaticFacetSet:e.automaticFacetSet??Nl(),pagination:e.pagination||Yr(),query:e.query||ut(),tabSet:e.tabSet||nd(),advancedSearchQueries:e.advancedSearchQueries||Tn(),staticFilterSet:e.staticFilterSet||Fx(),querySet:e.querySet||rd(),sortCriteria:e.sortCriteria||ur(),pipeline:e.pipeline||Oc(),searchHub:e.searchHub||ii(),facetOptions:e.facetOptions||td(),facetOrder:e.facetOrder??Ex(),debug:e.debug??ed()}}d();c();l();u();var Wt=P("query/updateQuery",e=>_(e,{q:new $,enableQuerySyntax:new fe}));d();c();l();u();d();c();l();u();var Tx=()=>({caseContext:{},caseId:"",caseNumber:""}),ee=e=>({caseContext:e?.caseContext||{},caseId:e?.caseId,caseNumber:e?.caseNumber});var Py=()=>te("browseResults")("search/logFetchMoreResults",(e,t)=>e.logFetchMoreResults(ee(t.insightCaseContext))),Ai=e=>te("query")("search/queryError",(t,r)=>t.logQueryError({...ee(r.insightCaseContext),query:r.query?.q||ut().q,aq:"",cq:"",dq:"",errorType:e.type,errorMessage:e.message})),Px=(e,t)=>te("contextChanged")("analytics/contextChanged",(r,n)=>{let o={caseId:e,caseNumber:t,caseContext:n.insightCaseContext?.caseContext||{}};r.logContextChanged(o)}),od=()=>te("interfaceLoad")("analytics/interface/load",(e,t)=>e.logInterfaceLoad(ee(t.insightCaseContext))),Jn=()=>te("interfaceChange")("analytics/interface/change",(e,t)=>{e.logInterfaceChange({...ee(t.insightCaseContext),interfaceChangeTo:t.configuration.analytics.originLevel2})});d();c();l();u();d();c();l();u();function Kr(e){return Object.values(e).map(t=>t.request)}d();c();l();u();var kx=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=YD(e),n=WD(e);return Wr({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Qn(e.configuration.search.apiBaseUrl,e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,insightId:e.insightConfiguration.insightId,...(e.configuration.analytics.enabled&&(yield Zn(e.configuration.analytics,t))),q:e.query?.q,...(n.length&&{facets:n}),caseContext:e.insightCaseContext?.caseContext,...(r&&{cq:r}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),tab:e.configuration.analytics.originLevel2,...(e.folding&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.context&&{context:e.context.contextValues}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function kx(_x49,_x50){return _ref24.apply(this,arguments)}}(),Sr=/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0,n=yield kx(e,t);return{...n,request:{...n.request,...(e.pagination&&{firstResult:e.pagination.firstResult,numberOfResults:r()})}}});return function Sr(_x51,_x52){return _ref25.apply(this,arguments)}}(),Ox=/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=yield kx(e);return{...r,request:{...r.request,filterFieldRange:100,cq:`@${e?.folding?.fields.collection}="${t}"`}}});return function Ox(_x53,_x54){return _ref26.apply(this,arguments)}}(),ad=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){let r=yield Sr(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.pagination?.numberOfResults??0)},r});return function ad(_x55,_x56){return _ref27.apply(this,arguments)}}(),id=/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){let r=yield Sr(e,t);return r.request={...r.request,numberOfResults:0},r});return function id(_x57,_x58){return _ref28.apply(this,arguments)}}();function WD(e){return Kr({...e.facetSet,...e.numericFacetSet,...e.dateFacetSet,...e.categoryFacetSet})}function YD(e){return Object.values(e.tabSet||{}).find(n=>n.isActive)?.expression.trim()||""}var Ho=class{constructor(t,r=n=>{this.dispatch(Wt({q:n}))}){le(this,"config",t);le(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x59,_x60){var _this9=this;return _asyncToGenerator(function*({request:t,mappings:r},n){let o=Date.now(),a=kr(yield _this9.extra.apiClient.query(t,n),r),i=Date.now()-o,p=_this9.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:t}}).apply(this,arguments)}process(t){var _this0=this;return _asyncToGenerator(function*(){return _this0.processQueryErrorOrContinue(t)??(yield _this0.processQueryCorrectionsOrContinue(t))??_this0.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return He(t.response)?(this.dispatch(Ai(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this1=this;return _asyncToGenerator(function*(){let r=_this1.getState(),n=_this1.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o)return null;if(!a)return!J(f)&&!J(f.correctedQuery)?_this1.processNextDidYouMeanAutoCorrection(t):null;let m=i.length===0&&p&&p.length!==0,g=!J(f)&&!J(f.correctedQuery);if(!m&&!g)return null;let x=m?yield _this1.processLegacyDidYouMeanAutoCorrection(t):_this1.processNextDidYouMeanAutoCorrection(t);return _this1.dispatch(bt(xt(_this1.getState()))),x})()}processLegacyDidYouMeanAutoCorrection(t){var _this10=this;return _asyncToGenerator(function*(){let r=_this10.getCurrentQuery(),n=_this10.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this10.automaticallyRetryQueryWithCorrection(o);return He(a.response)?(_this10.dispatch(Ai(a.response.error)),_this10.rejectWithValue(a.response.error)):(_this10.dispatch(bt(xt(_this10.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processNextDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}automaticallyRetryQueryWithCorrection(t){var _this11=this;return _asyncToGenerator(function*(){_this11.onUpdateQueryForCorrection(t);let r=_this11.getState(),n=yield _this11.fetchFromAPI(yield Sr(r));return _this11.dispatch(Zt(t)),n})()}processSuccessResponse(t){return this.dispatch(bt(xt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return $n(t.response)?t.response.success:null}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}};d();c();l();u();d();c();l();u();d();c();l();u();var _x=()=>te("didYouMeanClick")("analytics/didyoumean/click",(e,t)=>e.logDidYouMeanClick(ee(t.insightCaseContext))),ky=()=>te("didYouMeanAutomatic")("analytics/didyoumean/automatic",(e,t)=>e.logDidYouMeanAutomatic(ee(t.insightCaseContext)));var zo=class{constructor(t,r=n=>{this.dispatch(Wt({q:n}))}){le(this,"config",t);le(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x61,_x62){var _this12=this;return _asyncToGenerator(function*({request:t,mappings:r},n){let o=Date.now(),a=kr(yield _this12.extra.apiClient.query(t,n),r),i=Date.now()-o,p=_this12.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:t}}).apply(this,arguments)}process(t,r){var _this13=this;return _asyncToGenerator(function*(){return _this13.processQueryErrorOrContinue(t)??(yield _this13.processQueryCorrectionsOrContinue(t,r))??_this13.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return He(t.response)?(this.dispatch(Ai(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t,r){var _this14=this;return _asyncToGenerator(function*(){let n=_this14.getState(),o=_this14.getSuccessResponse(t);if(!o||!n.didYouMean)return null;let{enableDidYouMean:a,automaticallyCorrectQuery:i}=n.didYouMean,{results:p,queryCorrections:f,queryCorrection:m}=o;if(!a||!i)return null;let g=p.length===0&&f&&f.length!==0,A=!J(m)&&!J(m.correctedQuery);if(!g&&!A)return null;let h=g?yield _this14.processLegacyDidYouMeanAutoCorrection(t):_this14.processNextDidYouMeanAutoCorrection(t);return _this14.logOriginalAnalyticsQueryBeforeAutoCorrection(t,r),_this14.dispatch(bt(xt(_this14.getState()))),h})()}processLegacyDidYouMeanAutoCorrection(t){var _this15=this;return _asyncToGenerator(function*(){let r=_this15.getCurrentQuery(),n=_this15.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this15.automaticallyRetryQueryWithCorrection(o);return He(a.response)?(_this15.dispatch(Ai(a.response.error)),_this15.rejectWithValue(a.response.error)):(_this15.dispatch(bt(xt(_this15.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:ky()})})()}processNextDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:ky()}}automaticallyRetryQueryWithCorrection(t){var _this16=this;return _asyncToGenerator(function*(){_this16.dispatch(Wt({q:t}));let r=_this16.getState(),n=yield _this16.fetchFromAPI(yield Sr(r));return _this16.dispatch(Zt(t)),n})()}processSuccessResponse(t){return this.dispatch(bt(xt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return $n(t.response)?t.response.success:null}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??ut().enableQuerySyntax},search:{...At(),duration:r,response:o,results:o.results}}}logOriginalAnalyticsQueryBeforeAutoCorrection(t,r){let n=this.getState(),o=kr(t.response,r.mappings).success;this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,n,o),this.extra)}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get analyticsAction(){return this.config.analyticsAction}};function Oy(_x63,_x64,_x65){return _Oy.apply(this,arguments)}function _Oy(){_Oy=_asyncToGenerator(function*(e,t,r){Nc(e);let n=new zo({...t,analyticsAction:r}),{analyticsClientMiddleware:o,preprocessRequest:a,logger:i}=t.extra,{description:p}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:o,preprocessRequest:a,logger:i}),f=yield Sr(e,p),m=yield n.fetchFromAPI(f);return yield n.process(m,f)});return _Oy.apply(this,arguments)}function _y(_x66,_x67,_x68){return _y2.apply(this,arguments)}function _y2(){_y2=_asyncToGenerator(function*(e,t,r){Nc(e);let n=new zo({...t,analyticsAction:r}),{analyticsClientMiddleware:o,preprocessRequest:a,logger:i}=t.extra,{description:p}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:o,preprocessRequest:a,logger:i}),f=yield Sr(e,p),m=yield n.fetchFromAPI(f);return yield n.process(m,f)});return _y2.apply(this,arguments)}function Ny(_x69,_x70){return _Ny.apply(this,arguments)}function _Ny(){_Ny=_asyncToGenerator(function*(e,t){let r=new zo({...t,analyticsAction:Py}),{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield Py().prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=yield ad(e,i),f=yield r.fetchFromAPI(p);return yield r.process(f,p)});return _Ny.apply(this,arguments)}function Dy(_x71,_x72,_x73){return _Dy.apply(this,arguments)}function _Dy(){_Dy=_asyncToGenerator(function*(e,t,r){let n=new zo({...t,analyticsAction:r}),{analyticsClientMiddleware:o,preprocessRequest:a,logger:i}=t.extra,{description:p}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:o,preprocessRequest:a,logger:i}),f=yield id(e,p),m=yield n.fetchFromAPI(f);return yield n.process(m,f)});return _Dy.apply(this,arguments)}var Nx=me("search/executeSearch",/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Oy(r,t,e)});return function(_x74,_x75){return _ref29.apply(this,arguments)}}()),Dx=me("search/fetchPage",/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t){let r=t.getState();return yield _y(r,t,e)});return function(_x76,_x77){return _ref30.apply(this,arguments)}}()),qx=me("search/fetchMoreResults",/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Ny(r,t)});return function(_x78,_x79){return _ref31.apply(this,arguments)}}()),Mx=me("search/fetchFacetValues",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Dy(r,t,e)});return function(_x80,_x81){return _ref32.apply(this,arguments)}}());var Vx=/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t,{request:r,mappings:n},o){let a=Date.now(),i=kr(yield e.query(r,o),n),p=Date.now()-a,f=t.query?.q||"";return{response:i,duration:p,queryExecuted:f,requestExecuted:r}});return function Vx(_x82,_x83,_x84,_x85){return _ref33.apply(this,arguments)}}(),be=me("search/executeSearch",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Oy(r,t,e.legacy);Nc(r);let n=new Ho({...t}),o=e.next?qy(e.next):void 0,a=yield Sr(r,o),i=yield n.fetchFromAPI(a);return yield n.process(i)});return function(_x86,_x87){return _ref34.apply(this,arguments)}}()),sd=me("search/fetchPage",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return _y(r,t,e.legacy);Nc(r);let n=new Ho({...t}),o=e.next?qy(e.next):void 0,a=yield Sr(r,o),i=yield n.fetchFromAPI(a);return yield n.process(i)});return function(_x88,_x89){return _ref35.apply(this,arguments)}}()),cd=me("search/fetchMoreResults",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ny(r,t);let n=new Ho({...t}),o=qy({actionCause:"browseResults"}),a=yield ad(r,o),i=yield n.fetchFromAPI(a);return yield n.process(i)});return function(_x90,_x91){return _ref36.apply(this,arguments)}}()),Ci=me("search/fetchFacetValues",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Dy(r,t,e.legacy);let n=new Ho({...t}),o=yield id(r),a=yield n.fetchFromAPI(o);return yield n.process(a)});return function(_x92,_x93){return _ref37.apply(this,arguments)}}()),ud=me("querySuggest/fetch",/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,validatePayload:o}}){o(e,{id:H});let a=e.id,i=yield xx(a,t()),p=yield n.querySuggest(i);return He(p)?r(p.error):{id:a,q:i.q,...p.success}});return function(_x94,_x95){return _ref38.apply(this,arguments)}}()),Nc=e=>{e.configuration.analytics.enabled&&Vt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},qy=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();d();c();l();u();var Jt=P("breadcrumb/deselectAll"),ld=P("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var bi=P("facet/updateFacetAutoSelection",e=>_(e,{allow:new fe({required:!0})}));d();c();l();u();d();c();l();u();var dd=class extends Kn{constructor(r){super(r);le(this,"getState",r)}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??ut().q}get responseTime(){return this.activeInstantResultCache?.duration??At().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??At().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var jx=()=>ze("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new dd(e)),Lx=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var My={id:H},KD={...My,q:Ke},fee=P("instantResults/register",e=>_(e,My)),pd=P("instantResults/updateQuery",e=>_(e,KD)),mee=P("instantResults/clearExpired",e=>_(e,My));d();c();l();u();var fd=new ne({required:!0,min:0}),md=P("pagination/registerNumberOfResults",e=>_(e,fd)),gd=P("pagination/updateNumberOfResults",e=>_(e,fd)),hd=P("pagination/registerPage",e=>_(e,fd)),eo=P("pagination/updatePage",e=>_(e,fd)),yd=P("pagination/nextPage"),Sd=P("pagination/previousPage");d();c();l();u();d();c();l();u();var Wo=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...(r&&{actionCause:r.actionCause}),...(r&&{customData:r.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.deviceId&&{deviceId:e.deviceId}),...(e.trackingId&&{trackingId:e.trackingId}),capture:t.capture??t.clientId!=="",source:ri(e)}});var xi=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??Kt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&Wo(e.configuration.analytics,t,r)),...(e.excerptLength&&!J(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();l();u();d();c();l();u();var to=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??Kt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Vt.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield Zn(e.configuration.analytics,t))),...(e.excerptLength&&!J(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function to(_x96,_x97){return _ref39.apply(this,arguments)}}();d();c();l();u();var Vy=()=>ze("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),ro=e=>ze("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||ut().q,aq:r.advancedSearchQueries?.aq||Tn().aq,cq:r.advancedSearchQueries?.cq||Tn().cq,dq:r.advancedSearchQueries?.dq||Tn().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var jy=()=>ze("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic()),Ux=()=>({actionCause:"didYouMeanClick"}),Qx=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();var gte=new Y({values:{undoneQuery:Ke},options:{required:!0}}),Bx=()=>ze("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);d();c();l();u();var wi=P("trigger/query/ignore",e=>_(e,new $({emptyAllowed:!0,required:!0}))),Ri=P("trigger/query/modification",e=>_(e,new Y({values:{originalQuery:We,modification:We}})));d();c();l();u();d();c();l();u();function Dc(e,t){let r={};e.forEach(a=>{r[a.facetId]=a});let n=[];t.forEach(a=>{a in r&&(n.push(r[a]),delete r[a])});let o=Object.values(r);return[...n,...o]}function Gx(e){return Kr(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var Ly={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function XD(e){return Kr(e).map(t=>{let r=Ly[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function ZD(e){return[...XD(e.facetSet??{}),...Gx(e.numericFacetSet??{}),...Gx(e.dateFacetSet??{}),...Kr(e.categoryFacetSet??{})]}function JD(e){return ZD(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function vd(e){return Dc(JD(e),e.facetOrder??[])}var no=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t){let r=rq(e),n=vd(e),o=eq(e),a=yield to(e,t),i=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Wr({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:i(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function no(_x98,_x99){return _ref40.apply(this,arguments)}}();function eq(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(tq).filter(r=>r.currentValues.length>0):void 0}function tq(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function rq(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=nq(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}function nq(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o})}var oo=class{constructor(t,r=n=>{this.dispatch(Wt({q:n}))}){le(this,"config",t);le(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x100,_x101){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=kr(yield _this17.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this17.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return He(t.response)?(this.dispatch(ro(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o||!a)return null;let m=i.length===0&&p&&p.length!==0,g=!J(f)&&!J(f.correctedQuery);if(!m&&!g)return null;let x=m?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(bt(xt(_this19.getState()))),x})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this20.automaticallyRetryQueryWithCorrection(o);return He(a.response)?(_this20.dispatch(ro(a.response.error)),_this20.rejectWithValue(a.response.error)):(_this20.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this20.dispatch(bt(xt(_this20.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:jy()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:jy()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(wi("")),null;_this21.analyticsAction&&(yield _this21.dispatch(_this21.analyticsAction));let a=_this21.getCurrentQuery(),i=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return He(i.response)?(_this21.dispatch(ro(i.response.error)),_this21.rejectWithValue(i.response.error)):(_this21.dispatch(bt(xt(_this21.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a,analyticsAction:Bx()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??ut().enableQuerySyntax},search:{...At(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(bt(xt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return $n(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=yield _this22.fetchFromAPI(yield no(_this22.getState()),{origin:"mainSearch"});return _this22.dispatch(Zt(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Ri({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield no(_this23.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var Cre=me("search/executeSearch",/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Ad(r,t,e)});return function(_x102,_x103){return _ref41.apply(this,arguments)}}()),bre=me("search/fetchPage",/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Qy(r,t,e)});return function(_x104,_x105){return _ref42.apply(this,arguments)}}()),xre=me("search/fetchMoreResults",/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(e,t){let r=t.getState();return yield By(t,r)});return function(_x106,_x107){return _ref43.apply(this,arguments)}}()),wre=me("search/fetchFacetValues",/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(e,t){let r=t.getState();return yield sq(t,e,r)});return function(_x108,_x109){return _ref44.apply(this,arguments)}}()),Rre=me("search/fetchInstantResults",/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e,t){return Uy(e,t)});return function(_x110,_x111){return _ref45.apply(this,arguments)}}()),oq=/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t){let r=yield no(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function oq(_x112,_x113){return _ref46.apply(this,arguments)}}(),aq=/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,t,r){let n=yield to(e);return Wr({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function aq(_x114,_x115,_x116){return _ref47.apply(this,arguments)}}(),iq=/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t){let r=yield no(e,t);return r.request.numberOfResults=0,r});return function iq(_x117,_x118){return _ref48.apply(this,arguments)}}(),$x=e=>{e.configuration.analytics.enabled&&Vt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Uy(_x119,_x120){return _Uy.apply(this,arguments)}function _Uy(){_Uy=_asyncToGenerator(function*(e,t){_(e,{id:H,q:H,maxResultsPerQuery:new ne({required:!0,min:1}),cacheTimeout:new ne});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),a=new oo({...t,analyticsAction:jx()},m=>{t.dispatch(pd({q:m,id:e.id}))}),i=yield aq(o,r,n),p=yield a.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),f=yield a.process(p);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _Uy.apply(this,arguments)}function Qy(_x121,_x122,_x123){return _Qy.apply(this,arguments)}function _Qy(){_Qy=_asyncToGenerator(function*(e,t,r){$x(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new oo({...t,analyticsAction:r}),f=yield no(e,i),m=yield p.fetchFromAPI(f,{origin:"mainSearch"});return yield p.process(m)});return _Qy.apply(this,arguments)}function By(_x124,_x125){return _By.apply(this,arguments)}function _By(){_By=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:a}=yield Vy().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),i=new oo({...e,analyticsAction:Vy()}),p=yield oq(t,a),f=yield i.fetchFromAPI(p,{origin:"mainSearch"});return yield i.process(f)});return _By.apply(this,arguments)}function sq(_x126,_x127,_x128){return _sq.apply(this,arguments)}function _sq(){_sq=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=e.extra,{description:i}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new oo({...e,analyticsAction:t}),f=yield iq(r,i),m=yield p.fetchFromAPI(f,{origin:"facetValues"});return yield p.process(m)});return _sq.apply(this,arguments)}function Ad(_x129,_x130,_x131){return _Ad.apply(this,arguments)}function _Ad(){_Ad=_asyncToGenerator(function*(e,t,r){$x(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=yield no(e,i),f=new oo({...t,analyticsAction:r}),m=yield f.fetchFromAPI(p,{origin:"mainSearch"});return yield f.process(m)});return _Ad.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var Hx=ct(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o}));var vr=/*#__PURE__*/function(){var _ref49=_asyncToGenerator(function*(e,t,r){let n=$y(e),o=cq(e),a=uq(e),i=e.configuration.analytics.analyticsMode==="legacy"?yield to(e,r):xi(e,t,r);return Wr({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:Gy(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:a}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function vr(_x132,_x133,_x134){return _ref49.apply(this,arguments)}}();function Gy(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function cq(e){return Dc(dq(e),e.facetOrder??[])}function uq(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(lq).filter(r=>r.currentValues.length>0):void 0}function lq(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function dq(e){return pq(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function pq(e){return[...fq(e.facetSet??{}),...zx(e.numericFacetSet??{}),...zx(e.dateFacetSet??{}),...Kr(e.categoryFacetSet??{})]}function fq(e){return Kr(e).map(t=>{let r=Ly[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function zx(e){return Kr(e).map(t=>{let r=t.currentValues,n=r.some(({state:a})=>a!=="idle"),o=r.some(a=>a.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function $y(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=Hx(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}var ao=class{constructor(t,r=n=>{this.dispatch(Wt({q:n}))}){le(this,"config",t);le(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x135,_x136){var _this24=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=kr(yield _this24.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this24.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this25=this;return _asyncToGenerator(function*(){return _this25.processQueryErrorOrContinue(t)??(yield _this25.processQueryCorrectionsOrContinue(t))??(yield _this25.processQueryTriggersOrContinue(t))??_this25.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return He(t.response)?(this.dispatch(ro(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this26=this;return _asyncToGenerator(function*(){let r=_this26.getState(),n=_this26.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o)return null;if(!a)return!J(f)&&!J(f.correctedQuery)?_this26.processModernDidYouMeanAutoCorrection(t):null;let m=i.length===0&&p&&p.length!==0,g=!J(f)&&!J(f.correctedQuery);if(!m&&!g)return null;let x=m?yield _this26.processLegacyDidYouMeanAutoCorrection(t):_this26.processModernDidYouMeanAutoCorrection(t);return _this26.dispatch(bt(xt(_this26.getState()))),x})()}processLegacyDidYouMeanAutoCorrection(t){var _this27=this;return _asyncToGenerator(function*(){let r=_this27.getCurrentQuery(),n=_this27.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this27.automaticallyRetryQueryWithCorrection(o);return He(a.response)?(_this27.dispatch(ro(a.response.error)),_this27.rejectWithValue(a.response.error)):(_this27.dispatch(bt(xt(_this27.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this28=this;return _asyncToGenerator(function*(){let r=_this28.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this28.getState().triggers?.queryModification.queryToIgnore===n)return _this28.dispatch(wi("")),null;let a=_this28.getCurrentQuery(),i=yield _this28.automaticallyRetryQueryWithTriggerModification(n);return He(i.response)?(_this28.dispatch(ro(i.response.error)),_this28.rejectWithValue(i.response.error)):(_this28.dispatch(bt(xt(_this28.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a})})()}processSuccessResponse(t){return this.dispatch(bt(xt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return $n(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this29=this;return _asyncToGenerator(function*(){_this29.onUpdateQueryForCorrection(t);let r=_this29.getState(),{actionCause:n}=Qx(),o=yield _this29.fetchFromAPI(yield vr(r,_this29.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this29.dispatch(Zt(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this30=this;return _asyncToGenerator(function*(){return _this30.dispatch(Ri({newQuery:t,originalQuery:_this30.getCurrentQuery()})),_this30.onUpdateQueryForCorrection(t),yield _this30.fetchFromAPI(yield vr(_this30.getState(),_this30.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var Ii=me("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;_(e,{q:new $,enableQuerySyntax:new fe,clearFilters:new fe}),e.clearFilters&&(r(Jt()),r(ld())),r(bi({allow:!0})),r(Wt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(eo(1))}),Wx=P("search/updateSearchAction"),ke=me("search/executeSearch",/*#__PURE__*/function(){var _ref50=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ad(r,t,e.legacy);Yx(r);let n=e.next?Kx(e.next):void 0,o=yield vr(r,t.extra.navigatorContext,n),a=new ao({...t,analyticsAction:n??{}}),i=yield a.fetchFromAPI(o,{origin:"mainSearch"});return yield a.process(i)});return function(_x137,_x138){return _ref50.apply(this,arguments)}}()),Zr=me("search/fetchPage",/*#__PURE__*/function(){var _ref51=_asyncToGenerator(function*(e,t){let r=t.getState();if(Yx(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return Qy(r,t,e.legacy);let n=new ao({...t,analyticsAction:e.next}),o=yield vr(r,t.extra.navigatorContext,e.next),a=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(a)});return function(_x139,_x140){return _ref51.apply(this,arguments)}}()),io=me("search/fetchMoreResults",/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return By(t,r);let n=ix("browseResults",t.getState),o=new ao({...t,analyticsAction:n}),a=yield mq(r,t.extra.navigatorContext,n),i=yield o.fetchFromAPI(a,{origin:"mainSearch"});return yield o.process(i)});return function(_x141,_x142){return _ref52.apply(this,arguments)}}()),Ei=me("search/fetchFacetValues",/*#__PURE__*/function(){var _ref53=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ad(r,t,e.legacy);let n=new ao({...t,analyticsAction:{}}),o=yield hq(r,t.extra.navigatorContext),a=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(a)});return function(_x143,_x144){return _ref53.apply(this,arguments)}}()),Tne=me("search/fetchInstantResults",/*#__PURE__*/function(){var _ref54=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Uy(e,t);_(e,{id:H,q:H,maxResultsPerQuery:new ne({required:!0,min:1}),cacheTimeout:new ne});let{q:n,maxResultsPerQuery:o}=e,a=Kx(Lx()),i=yield gq(r,t.extra.navigatorContext,n,o,a),p=new ao({...t,analyticsAction:a},g=>{t.dispatch(pd({q:g,id:e.id}))}),f=yield p.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),m=yield p.process(f);return"response"in m?{results:m.response.results,searchUid:m.response.searchUid,totalCountFiltered:m.response.totalCountFiltered,duration:m.duration}:m});return function(_x145,_x146){return _ref54.apply(this,arguments)}}()),mq=/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(e,t,r){let n=yield vr(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function mq(_x147,_x148,_x149){return _ref55.apply(this,arguments)}}(),gq=/*#__PURE__*/function(){var _ref56=_asyncToGenerator(function*(e,t,r,n,o){let a=xi(e,t,o);return Wr({...a,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function gq(_x150,_x151,_x152,_x153,_x154){return _ref56.apply(this,arguments)}}(),hq=/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(e,t,r){let n=yield vr(e,t,r);return n.request.numberOfResults=0,n});return function hq(_x155,_x156,_x157){return _ref57.apply(this,arguments)}}(),Yx=e=>{e.configuration.analytics.enabled&&Vt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},Kx=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();function Xx(_x158,_x159){return _Xx.apply(this,arguments)}function _Xx(){_Xx=_asyncToGenerator(function*(e,t){let{search:r,accessToken:n,organizationId:o}=e.configuration,a=e.query?.q||"";return{url:r.apiBaseUrl??Kt(e.configuration.organizationId,e.configuration.environment),accessToken:n,organizationId:o,enableNavigation:!1,q:a,...t,requestedOutputSize:t.requestedOutputSize||0,...(r.authenticationProviders.length&&{authentication:r.authenticationProviders.join(",")})}});return _Xx.apply(this,arguments)}var qc=me("resultPreview/fetchResultContent",/*#__PURE__*/function(){var _ref58=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),a=yield Xx(o,e),i=yield t.apiClient.html(a);return He(i)?n(i.error):{content:i.success,uniqueId:e.uniqueId}});return function(_x160,_x161){return _ref58.apply(this,arguments)}}()),Cd=P("resultPreview/next"),bd=P("resultPreview/previous"),Jx=P("resultPreview/prepare",e=>_(e,{results:new oe({required:!0})})),Zx=2048,xd=me("resultPreview/updateContentURL",/*#__PURE__*/function(){var _ref59=_asyncToGenerator(function*(e,{getState:t,extra:r}){let n=t(),o=BA(yield e.buildResultPreviewRequest(n,{uniqueId:e.uniqueId,requestedOutputSize:e.requestedOutputSize}),e.path);return o?.length>Zx&&r.logger.error(`The content URL was truncated as it exceeds the maximum allowed length of ${Zx} characters.`),{contentURL:o}});return function(_x162,_x163){return _ref59.apply(this,arguments)}}());d();c();l();u();function Hy(){return{uniqueId:"",content:"",isLoading:!1,position:-1,resultsWithPreview:[]}}var zy=e=>{let{content:t,isLoading:r,uniqueId:n,contentURL:o}=Hy();e.content=t,e.isLoading=r,e.uniqueId=n,e.contentURL=o},Wy=e=>e.filter(t=>t.hasHtmlVersion).map(t=>t.uniqueId),Fi=pe(Hy(),e=>{e.addCase(qc.pending,t=>{t.isLoading=!0}).addCase(qc.fulfilled,(t,r)=>{let{content:n,uniqueId:o}=r.payload;t.position=t.resultsWithPreview.indexOf(o),t.content=n,t.uniqueId=o,t.isLoading=!1}).addCase(ke.fulfilled,(t,r)=>{zy(t),t.resultsWithPreview=Wy(r.payload.response.results)}).addCase(io.fulfilled,(t,r)=>{zy(t),t.resultsWithPreview=t.resultsWithPreview.concat(Wy(r.payload.response.results))}).addCase(Zr.fulfilled,zy).addCase(Jx,(t,r)=>{t.resultsWithPreview=Wy(r.payload.results)}).addCase(Cd,t=>{if(t.isLoading)return;let r=t.position+1;r>t.resultsWithPreview.length-1&&(r=0),t.position=r}).addCase(bd,t=>{if(t.isLoading)return;let r=t.position-1;r<0&&(r=t.resultsWithPreview.length-1),t.position=r}).addCase(xd.fulfilled,(t,r)=>{t.contentURL=r.payload.contentURL})});d();c();l();u();d();c();l();u();var so=(e,t)=>{let r=e;return J(r[t])?J(e.raw[t])?null:e.raw[t]:r[t]},yq=e=>t=>e.every(r=>!J(so(t,r))),Sq=e=>t=>e.every(r=>J(so(t,r))),vq=(e,t)=>r=>{let n=ew(e,r);return t.some(o=>n.some(a=>`${a}`.toLowerCase()===o.toLowerCase()))},Aq=(e,t)=>r=>{let n=ew(e,r);return t.every(o=>n.every(a=>`${a}`.toLowerCase()!==o.toLowerCase()))},ew=(e,t)=>{let r=so(t,e);return Nu(r)?r:[r]},tw={getResultProperty:so,fieldsMustBeDefined:yq,fieldsMustNotBeDefined:Sq,fieldMustMatch:vq,fieldMustNotMatch:Aq};function wd(e){return e.search.response.searchUid!==""}function rw(e,t,r){return e.search.results.find(n=>so(n,t)===r)}var Yy=ct(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();d();c();l();u();var Ti=P("app/setError");function Ky(e,t){let r=t.payload??null;r&&(e.response=At().response,e.results=[],e.questionAnswer=Wa()),e.error=r,e.isLoading=!1}function Xy(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function Cq(e,t){Xy(e,t),e.results=t.payload.response.results.map(r=>({...r,searchUid:t.payload.response.searchUid})),e.searchResponseId=t.payload.response.searchUid,e.questionAnswer=t.payload.response.questionAnswer,e.extendedResults=t.payload.response.extendedResults}function nw(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function bq(e,t){e.isLoading=!0,e.searchAction={actionCause:"browseResults"},e.requestId=t.meta.requestId}var Ie=pe(At(),e=>{e.addCase(ke.rejected,(t,r)=>Ky(t,r)),e.addCase(io.rejected,(t,r)=>Ky(t,r)),e.addCase(Zr.rejected,(t,r)=>Ky(t,r)),e.addCase(ke.fulfilled,(t,r)=>{Cq(t,r)}),e.addCase(io.fulfilled,(t,r)=>{Xy(t,r),t.results=[...t.results,...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(Zr.fulfilled,(t,r)=>{Xy(t,r),t.results=[...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(Ei.fulfilled,(t,r)=>{t.response.facets=r.payload.response.facets,t.response.searchUid=r.payload.response.searchUid}),e.addCase(ke.pending,nw),e.addCase(io.pending,bq),e.addCase(Zr.pending,nw),e.addCase(Wx,(t,r)=>{t.searchAction=r.payload}),e.addCase(Ti,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();var Rd=pe(ii(),e=>{e.addCase(Kl,(t,r)=>r.payload).addCase(tt.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(vi,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var ow=class extends Error{constructor(t){super(t[0].message);le(this,"issues");this.name="SchemaError",this.issues=t}};var kn="uninitialized",Jy="pending",Vc="fulfilled",jc="rejected";function aw(e){return{status:e,isUninitialized:e===kn,isLoading:e===Jy,isSuccess:e===Vc,isError:e===jc}}var iw=Lr;function Aw(e,t){if(e===t||!(iw(e)&&iw(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,a=Array.isArray(t)?[]:{};for(let i of r)a[i]=Aw(e[i],t[i]),o&&(o=e[i]===a[i]);return o?e:a}function eS(e,t,r){return e.reduce((n,o,a)=>(t(o,a)&&n.push(r(o,a)),n),[]).flat()}function xq(e){return new RegExp("(^|:)//").test(e)}function wq(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function oS(e){return e!=null}function sw(e){return[...(e?.values()??[])].filter(oS)}function Rq(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var Iq=e=>e.replace(/\/$/,""),Eq=e=>e.replace(/^\//,"");function Fq(e,t){if(!e)return t;if(!t)return e;if(xq(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=Iq(e),t=Eq(t),`${e}${r}${t}`}function Fd(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var tS=()=>new Map,Tq=e=>{let t=new s.AbortController;return setTimeout(()=>{let r="signal timed out",n="TimeoutError";t.abort(typeof DOMException<"u"?new DOMException(r,n):Object.assign(new Error(r),{name:n}))},e),t.signal},Pq=(...e)=>{for(let r of e)if(r.aborted)return s.AbortSignal.abort(r.reason);let t=new s.AbortController;for(let r of e)r.addEventListener("abort",()=>t.abort(r.reason),{signal:t.signal,once:!0});return t.signal},cw=(...e)=>v(...e),kq=e=>e.status>=200&&e.status<=299,Oq=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function uw(e){if(!Lr(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}var _q=e=>typeof e=="object"&&(Lr(e)||Array.isArray(e)||typeof e.toJSON=="function");function Cw({baseUrl:e,prepareHeaders:t=A=>A,fetchFn:r=cw,paramsSerializer:n,isJsonContentType:o=Oq,jsonContentType:a="application/json",jsonReplacer:i,timeout:p,responseHandler:f,validateStatus:m,...g}={}){return typeof v>"u"&&r===cw&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref60=_asyncToGenerator(function*(x,h,y){let{getState:b,extra:w,endpoint:I,forced:F,type:E}=h,k,{url:T,headers:q=new C(g.headers),params:G=void 0,responseHandler:Q=f??"json",validateStatus:j=m??kq,timeout:B=p,...L}=typeof x=="string"?{url:x}:x,N={...g,signal:B?Pq(h.signal,Tq(B)):h.signal,...L};q=new C(uw(q)),N.headers=(yield t(q,{getState:b,arg:x,extra:w,endpoint:I,forced:F,type:E,extraOptions:y}))||q;let D=_q(N.body);if(N.body!=null&&!D&&typeof N.body!="string"&&N.headers.delete("content-type"),!N.headers.has("content-type")&&D&&N.headers.set("content-type",a),D&&o(N.headers)&&(N.body=JSON.stringify(N.body,i)),N.headers.has("accept")||(Q==="json"?N.headers.set("accept","application/json"):Q==="text"&&N.headers.set("accept","text/plain, text/html, */*")),G){let ce=~T.indexOf("?")?"&":"?",ve=n?n(G):new URLSearchParams(uw(G));T+=ce+ve}T=Fq(e,T);let M=new Request(T,N);k={request:new Request(T,N)};let z;try{z=yield r(M)}catch(ce){return{error:{status:(ce instanceof Error||typeof DOMException<"u"&&ce instanceof DOMException)&&ce.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ce)},meta:k}}let re=z.clone();k.response=re;let Z,K="";try{let ce;if(yield Promise.all([A(z,Q).then(ve=>Z=ve,ve=>ce=ve),re.text().then(ve=>K=ve,()=>{})]),ce)throw ce}catch(ce){return{error:{status:"PARSING_ERROR",originalStatus:z.status,data:K,error:String(ce)},meta:k}}return j(z,Z)?{data:Z,meta:k}:{error:{status:z.status,data:Z},meta:k}});return function(_x164,_x165,_x166){return _ref60.apply(this,arguments)}}());function A(_x167,_x168){return _A2.apply(this,arguments)}function _A2(){_A2=_asyncToGenerator(function*(x,h){if(typeof h=="function")return h(x);if(h==="content-type"&&(h=o(x.headers)?"json":"text"),h==="json"){let y=yield x.text();return y.length?JSON.parse(y):null}return x.text()});return _A2.apply(this,arguments)}}var Pi=class{constructor(e,t=void 0){le(this,"value");le(this,"meta");this.value=e,this.meta=t}};function Nq(){return _Nq.apply(this,arguments)}function _Nq(){_Nq=_asyncToGenerator(function*(e=0,t=5,r){let n=Math.min(e,t),o=~~((Math.random()+.4)*(300<<n));yield new Promise((a,i)=>{let p=setTimeout(()=>a(),o);if(r){let f=()=>{clearTimeout(p),i(new Error("Aborted"))};r.aborted?(clearTimeout(p),i(new Error("Aborted"))):r.addEventListener("abort",f,{once:!0})}})});return _Nq.apply(this,arguments)}function bw(e,t){throw Object.assign(new Pi({error:e,meta:t}),{throwImmediately:!0})}function Zy(e){e.aborted&&bw({status:"CUSTOM_ERROR",error:"Aborted"})}var lw={},Dq=(e,t)=>(/*#__PURE__*/function(){var _ref61=_asyncToGenerator(function*(r,n,o){let a=[5,(t||lw).maxRetries,(o||lw).maxRetries].filter(g=>g!==void 0),[i]=a.slice(-1),f={maxRetries:i,backoff:Nq,retryCondition:(g,A,{attempt:x})=>x<=i,...t,...o},m=0;for(;;){Zy(n.signal);try{let g=yield e(r,n,o);if(g.error)throw new Pi(g);return g}catch(g){if(m++,g.throwImmediately){if(g instanceof Pi)return g.value;throw g}if(g instanceof Pi){if(!f.retryCondition(g.value.error,r,{attempt:m,baseQueryApi:n,extraOptions:o}))return g.value}else if(m>f.maxRetries)return{error:g};Zy(n.signal);try{yield f.backoff(m,f.maxRetries,n.signal)}catch(A){throw Zy(n.signal),A}}}});return function(_x169,_x170,_x171){return _ref61.apply(this,arguments)}}()),xw=Object.assign(Dq,{fail:bw}),Pd="__rtkq/",qq="online",Mq="offline";var ww="focused";var aS=P(`${Pd}${ww}`),Rw=P(`${Pd}un${ww}`),iS=P(`${Pd}${qq}`),Iw=P(`${Pd}${Mq}`);var Qc="query",Ew="mutation",Fw="infinitequery";function kd(e){return e.type===Qc}function Vq(e){return e.type===Ew}function Od(e){return e.type===Fw}function Td(e){return kd(e)||Od(e)}function sS(e,t,r,n,o,a){let i=jq(e)?e(t,r,n,o):e;return i?eS(i,oS,p=>a(Tw(p))):[]}function jq(e){return typeof e=="function"}function Tw(e){return typeof e=="string"?{type:e}:e}function Lq(e,t){return e.catch(t)}var ki=(e,t)=>e.endpointDefinitions[t],Lc=Symbol("forceQueryFn"),rS=e=>typeof e[Lc]=="function";function Uq({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:a,getInternalState:i}){let p=T=>i(T)?.runningQueries,f=T=>i(T)?.runningMutations,{unsubscribeQueryResult:m,removeMutationResult:g,updateSubscriptionOptions:A}=o.internalActions;return{buildInitiateQuery:F,buildInitiateInfiniteQuery:E,buildInitiateMutation:k,getRunningQueryThunk:x,getRunningMutationThunk:h,getRunningQueriesThunk:y,getRunningMutationsThunk:b};function x(T,q){return G=>{let Q=ki(a,T),j=e({queryArgs:q,endpointDefinition:Q,endpointName:T});return p(G)?.get(j)}}function h(T,q){return G=>f(G)?.get(q)}function y(){return T=>sw(p(T))}function b(){return T=>sw(f(T))}function w(T){}function I(T,q){let G=(Q,{subscribe:j=!0,forceRefetch:B,subscriptionOptions:L,[Lc]:N,...D}={})=>(M,W)=>{let z=e({queryArgs:Q,endpointDefinition:q,endpointName:T}),re,Z={...D,type:Qc,subscribe:j,forceRefetch:B,subscriptionOptions:L,endpointName:T,originalArgs:Q,queryCacheKey:z,[Lc]:N};if(kd(q))re=t(Z);else{let{direction:Re,initialPageParam:_e,refetchCachedPages:Fe}=D;re=r({...Z,direction:Re,initialPageParam:_e,refetchCachedPages:Fe})}let K=o.endpoints[T].select(Q),ce=M(re),ve=K(W());let{requestId:Ve,abort:nt}=ce,Ge=ve.requestId!==Ve,Je=p(M)?.get(z),et=()=>K(W()),Ee=Object.assign(N?ce.then(et):Ge&&!Je?Promise.resolve(ve):Promise.all([Je,ce]).then(et),{arg:Q,requestId:Ve,subscriptionOptions:L,queryCacheKey:z,abort:nt,unwrap(){return _asyncToGenerator(function*(){let Re=yield Ee;if(Re.isError)throw Re.error;return Re.data})()},refetch:Re=>M(G(Q,{subscribe:!1,forceRefetch:!0,...Re})),unsubscribe(){j&&M(m({queryCacheKey:z,requestId:Ve}))},updateSubscriptionOptions(Re){Ee.subscriptionOptions=Re,M(A({endpointName:T,requestId:Ve,queryCacheKey:z,options:Re}))}});if(!Je&&!Ge&&!N){let Re=p(M);Re.set(z,Ee),Ee.then(()=>{Re.delete(z)})}return Ee};return G}function F(T,q){return I(T,q)}function E(T,q){return I(T,q)}function k(T){return(q,{track:G=!0,fixedCacheKey:Q}={})=>(j,B)=>{let L=n({type:"mutation",endpointName:T,originalArgs:q,track:G,fixedCacheKey:Q}),N=j(L);let{requestId:D,abort:M,unwrap:W}=N,z=Lq(N.unwrap().then(ce=>({data:ce})),ce=>({error:ce})),re=()=>{j(g({requestId:D,fixedCacheKey:Q}))},Z=Object.assign(z,{arg:N.arg,requestId:D,abort:M,unwrap:W,reset:re}),K=f(j);return K.set(D,Z),Z.then(()=>{K.delete(D)}),Q&&(K.set(Q,Z),Z.then(()=>{K.get(Q)===Z&&K.delete(Q)})),Z}}}var Pw=class extends ow{constructor(t,r,n,o){super(t);le(this,"value");le(this,"schemaName");le(this,"_bqMeta");this.value=r,this.schemaName=n,this._bqMeta=o}},Yo=(e,t)=>Array.isArray(e)?e.includes(t):!!e;function Ko(_x172,_x173,_x174,_x175){return _Ko.apply(this,arguments)}function _Ko(){_Ko=_asyncToGenerator(function*(e,t,r,n){let o=yield e["~standard"].validate(t);if(o.issues)throw new Pw(o.issues,t,r,n);return o.value});return _Ko.apply(this,arguments)}function dw(e){return e}var Mc=(e={})=>({...e,[Ac]:!0});function Qq({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:a,selectors:i,onSchemaFailure:p,catchSchemaFailure:f,skipSchemaValidation:m}){let g=(L,N,D,M)=>(W,z)=>{let re=r[L],Z=n({queryArgs:N,endpointDefinition:re,endpointName:L});if(W(o.internalActions.queryResultPatched({queryCacheKey:Z,patches:D})),!M)return;let K=o.endpoints[L].select(N)(z()),ce=sS(re.providesTags,K.data,void 0,N,{},a);W(o.internalActions.updateProvidedBy([{queryCacheKey:Z,providedTags:ce}]))};function A(L,N,D=0){let M=[N,...L];return D&&M.length>D?M.slice(0,-1):M}function x(L,N,D=0){let M=[...L,N];return D&&M.length>D?M.slice(1):M}let h=(L,N,D,M=!0)=>(W,z)=>{let Z=o.endpoints[L].select(N)(z()),K={patches:[],inversePatches:[],undo:()=>W(o.util.patchQueryData(L,N,K.inversePatches,M))};if(Z.status===kn)return K;let ce;if("data"in Z)if(Ht(Z.data)){let[ve,Ve,nt]=kh(Z.data,D);K.patches.push(...Ve),K.inversePatches.push(...nt),ce=ve}else ce=D(Z.data),K.patches.push({op:"replace",path:[],value:ce}),K.inversePatches.push({op:"replace",path:[],value:Z.data});return K.patches.length===0||W(o.util.patchQueryData(L,N,K.patches,M)),K},y=(L,N,D)=>M=>M(o.endpoints[L].initiate(N,{subscribe:!1,forceRefetch:!0,[Lc]:()=>({data:D})})),b=(L,N)=>L.query&&L[N]?L[N]:dw,w=/*#__PURE__*/function(){var _ref62=_asyncToGenerator(function*(L,{signal:N,abort:D,rejectWithValue:M,fulfillWithValue:W,dispatch:z,getState:re,extra:Z}){let K=r[L.endpointName],{metaSchema:ce,skipSchemaValidation:ve=m}=K,Ve=L.type===Qc;try{let nt=dw,Ge={signal:N,abort:D,dispatch:z,getState:re,extra:Z,endpoint:L.endpointName,type:L.type,forced:Ve?I(L,re()):void 0,queryCacheKey:Ve?L.queryCacheKey:void 0},Je=Ve?L[Lc]:void 0,et,Ee=/*#__PURE__*/function(){var _ref63=_asyncToGenerator(function*(_e,Fe,gt,vt){if(Fe==null&&_e.pages.length)return Promise.resolve({data:_e});let Ir={queryArg:L.originalArgs,pageParam:Fe},ir=yield Re(Ir),Vr=vt?A:x;return{data:{pages:Vr(_e.pages,ir.data,gt),pageParams:Vr(_e.pageParams,Fe,gt)},meta:ir.meta}});return function Ee(_x178,_x179,_x180,_x181){return _ref63.apply(this,arguments)}}();function Re(_x182){return _Re.apply(this,arguments)}function _Re(){_Re=_asyncToGenerator(function*(_e){let Fe,{extraOptions:gt,argSchema:vt,rawResponseSchema:Ir,responseSchema:ir}=K;if(vt&&!Yo(ve,"arg")&&(_e=yield Ko(vt,_e,"argSchema",{})),Je?Fe=Je():K.query?(nt=b(K,"transformResponse"),Fe=yield t(K.query(_e),Ge,gt)):Fe=yield K.queryFn(_e,Ge,gt,Er=>t(Er,Ge,gt)),typeof process<"u",Fe.error)throw new Pi(Fe.error,Fe.meta);let{data:Vr}=Fe;Ir&&!Yo(ve,"rawResponse")&&(Vr=yield Ko(Ir,Fe.data,"rawResponseSchema",Fe.meta));let fr=yield nt(Vr,Fe.meta,_e);return ir&&!Yo(ve,"response")&&(fr=yield Ko(ir,fr,"responseSchema",Fe.meta)),{...Fe,data:fr}});return _Re.apply(this,arguments)}if(Ve&&"infiniteQueryOptions"in K){let{infiniteQueryOptions:_e}=K,{maxPages:Fe=1/0}=_e,gt=L.refetchCachedPages??_e.refetchCachedPages??!0,vt,Ir={pages:[],pageParams:[]},ir=i.selectQueryEntry(re(),L.queryCacheKey)?.data,fr=I(L,re())&&!L.direction||!ir?Ir:ir;if("direction"in L&&L.direction&&fr.pages.length){let Er=L.direction==="backward",Eu=(Er?kw:nS)(_e,fr,L.originalArgs);vt=yield Ee(fr,Eu,Fe,Er)}else{let{initialPageParam:Er=_e.initialPageParam}=L,Gs=ir?.pageParams??[],Eu=Gs[0]??Er,Ek=Gs.length;if(vt=yield Ee(fr,Eu,Fe),Je&&(vt={data:vt.data.pages[0]}),gt)for(let Qv=1;Qv<Ek;Qv++){let Fk=nS(_e,vt.data,L.originalArgs);vt=yield Ee(vt.data,Fk,Fe)}}et=vt}else et=yield Re(L.originalArgs);return ce&&!Yo(ve,"meta")&&et.meta&&(et.meta=yield Ko(ce,et.meta,"metaSchema",et.meta)),W(et.data,Mc({fulfilledTimeStamp:Date.now(),baseQueryMeta:et.meta}))}catch(nt){let Ge=nt;if(Ge instanceof Pi){let Je=b(K,"transformErrorResponse"),{rawErrorResponseSchema:et,errorResponseSchema:Ee}=K,{value:Re,meta:_e}=Ge;try{et&&!Yo(ve,"rawErrorResponse")&&(Re=yield Ko(et,Re,"rawErrorResponseSchema",_e)),ce&&!Yo(ve,"meta")&&(_e=yield Ko(ce,_e,"metaSchema",_e));let Fe=yield Je(Re,_e,L.originalArgs);return Ee&&!Yo(ve,"errorResponse")&&(Fe=yield Ko(Ee,Fe,"errorResponseSchema",_e)),M(Fe,Mc({baseQueryMeta:_e}))}catch(Fe){Ge=Fe}}try{if(Ge instanceof Pw){let Je={endpoint:L.endpointName,arg:L.originalArgs,type:L.type,queryCacheKey:Ve?L.queryCacheKey:void 0};K.onSchemaFailure?.(Ge,Je),p?.(Ge,Je);let{catchSchemaFailure:et=f}=K;if(et)return M(et(Ge,Je),Mc({baseQueryMeta:Ge._bqMeta}))}}catch(Je){Ge=Je}throw typeof process<"u",console.error(Ge),Ge}});return function w(_x176,_x177){return _ref62.apply(this,arguments)}}();function I(L,N){let D=i.selectQueryEntry(N,L.queryCacheKey),M=i.selectConfig(N).refetchOnMountOrArgChange,W=D?.fulfilledTimeStamp,z=L.forceRefetch??(L.subscribe&&M);return z?z===!0||(Number(new Date)-Number(W))/1e3>=z:!1}let F=()=>me(`${e}/executeQuery`,w,{getPendingMeta({arg:N}){let D=r[N.endpointName];return Mc({startedTimeStamp:Date.now(),...(Od(D)?{direction:N.direction}:{})})},condition(N,{getState:D}){let M=D(),W=i.selectQueryEntry(M,N.queryCacheKey),z=W?.fulfilledTimeStamp,re=N.originalArgs,Z=W?.originalArgs,K=r[N.endpointName],ce=N.direction;return rS(N)?!0:W?.status==="pending"?!1:I(N,M)||kd(K)&&K?.forceRefetch?.({currentArg:re,previousArg:Z,endpointState:W,state:M})?!0:!(z&&!ce)},dispatchConditionRejection:!0}),E=F(),k=F(),T=me(`${e}/executeMutation`,w,{getPendingMeta(){return Mc({startedTimeStamp:Date.now()})}}),q=L=>"force"in L,G=L=>"ifOlderThan"in L,Q=(L,N,D={})=>(M,W)=>{let z=q(D)&&D.force,re=G(D)&&D.ifOlderThan,Z=(ce=!0)=>{let ve={forceRefetch:ce,subscribe:!1};return o.endpoints[L].initiate(N,ve)},K=o.endpoints[L].select(N)(W());if(z)M(Z());else if(re){let ce=K?.fulfilledTimeStamp;if(!ce){M(Z());return}(Number(new Date)-Number(new Date(ce)))/1e3>=re&&M(Z())}else M(Z(!1))};function j(L){return N=>N?.meta?.arg?.endpointName===L}function B(L,N){return{matchPending:ei(gl(L),j(N)),matchFulfilled:ei(En(L),j(N)),matchRejected:ei(Uo(L),j(N))}}return{queryThunk:E,mutationThunk:T,infiniteQueryThunk:k,prefetch:Q,updateQueryData:h,upsertQueryData:y,patchQueryData:g,buildMatchThunkActions:B}}function nS(e,{pages:t,pageParams:r},n){let o=t.length-1;return e.getNextPageParam(t[o],t,r[o],r,n)}function kw(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function Ow(e,t,r,n){return sS(r[e.meta.arg.endpointName][t],En(e)?e.payload:void 0,bc(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function pw(e){return $t(e)?cl(e):e}function Id(e,t,r){let n=e[t];n&&r(n)}function Uc(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function fw(e,t,r){let n=e[Uc(t)];n&&r(n)}var Ed={};function Bq({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:a,extractRehydrationInfo:i,hasRehydrationInfo:p},assertTagType:f,config:m}){let g=P(`${e}/resetApiState`);function A(j,B,L,N){var D;j[D=B.queryCacheKey]??(j[D]={status:kn,endpointName:B.endpointName}),Id(j,B.queryCacheKey,M=>{M.status=Jy,M.requestId=L&&M.requestId?M.requestId:N.requestId,B.originalArgs!==void 0&&(M.originalArgs=B.originalArgs),M.startedTimeStamp=N.startedTimeStamp;let W=o[N.arg.endpointName];Od(W)&&"direction"in B&&(M.direction=B.direction)})}function x(j,B,L,N){Id(j,B.arg.queryCacheKey,D=>{if(D.requestId!==B.requestId&&!N)return;let{merge:M}=o[B.arg.endpointName];if(D.status=Vc,M){if(D.data!==void 0){let{fulfilledTimeStamp:W,arg:z,baseQueryMeta:re,requestId:Z}=B,K=jo(D.data,ce=>M(ce,L,{arg:z.originalArgs,baseQueryMeta:re,fulfilledTimeStamp:W,requestId:Z}));D.data=K}else D.data=L;}else D.data=o[B.arg.endpointName].structuralSharing??!0?Aw($t(D.data)?dC(D.data):D.data,L):L;delete D.error,D.fulfilledTimeStamp=B.fulfilledTimeStamp})}let h=Qo({name:`${e}/queries`,initialState:Ed,reducers:{removeQueryResult:{reducer(j,{payload:{queryCacheKey:B}}){delete j[B]},prepare:ti()},cacheEntriesUpserted:{reducer(j,B){for(let L of B.payload){let{queryDescription:N,value:D}=L;A(j,N,!0,{arg:N,requestId:B.meta.requestId,startedTimeStamp:B.meta.timestamp}),x(j,{arg:N,requestId:B.meta.requestId,fulfilledTimeStamp:B.meta.timestamp,baseQueryMeta:{}},D,!0)}},prepare:j=>({payload:j.map(N=>{let{endpointName:D,arg:M,value:W}=N,z=o[D];return{queryDescription:{type:Qc,endpointName:D,originalArgs:N.arg,queryCacheKey:n({queryArgs:M,endpointDefinition:z,endpointName:D})},value:W}}),meta:{[Ac]:!0,requestId:xc(),timestamp:Date.now()}})},queryResultPatched:{reducer(j,{payload:{queryCacheKey:B,patches:L}}){Id(j,B,N=>{N.data=Oh(N.data,L.concat())})},prepare:ti()}},extraReducers(j){j.addCase(t.pending,(B,{meta:L,meta:{arg:N}})=>{let D=rS(N);A(B,N,D,L)}).addCase(t.fulfilled,(B,{meta:L,payload:N})=>{let D=rS(L.arg);x(B,L,N,D)}).addCase(t.rejected,(B,{meta:{condition:L,arg:N,requestId:D},error:M,payload:W})=>{Id(B,N.queryCacheKey,z=>{if(!L){if(z.requestId!==D)return;z.status=jc,z.error=W??M}})}).addMatcher(p,(B,L)=>{let{queries:N}=i(L);for(let[D,M]of Object.entries(N))(M?.status===Vc||M?.status===jc)&&(B[D]=M)})}}),y=Qo({name:`${e}/mutations`,initialState:Ed,reducers:{removeMutationResult:{reducer(j,{payload:B}){let L=Uc(B);L in j&&delete j[L]},prepare:ti()}},extraReducers(j){j.addCase(r.pending,(B,{meta:L,meta:{requestId:N,arg:D,startedTimeStamp:M}})=>{D.track&&(B[Uc(L)]={requestId:N,status:Jy,endpointName:D.endpointName,startedTimeStamp:M})}).addCase(r.fulfilled,(B,{payload:L,meta:N})=>{N.arg.track&&fw(B,N,D=>{D.requestId===N.requestId&&(D.status=Vc,D.data=L,D.fulfilledTimeStamp=N.fulfilledTimeStamp)})}).addCase(r.rejected,(B,{payload:L,error:N,meta:D})=>{D.arg.track&&fw(B,D,M=>{M.requestId===D.requestId&&(M.status=jc,M.error=L??N)})}).addMatcher(p,(B,L)=>{let{mutations:N}=i(L);for(let[D,M]of Object.entries(N))(M?.status===Vc||M?.status===jc)&&D!==M?.requestId&&(B[D]=M)})}}),b={tags:{},keys:{}},w=Qo({name:`${e}/invalidation`,initialState:b,reducers:{updateProvidedBy:{reducer(j,B){var L,N,D;for(let{queryCacheKey:M,providedTags:W}of B.payload){I(j,M);for(let{type:z,id:re}of W){let Z=(N=(L=j.tags)[z]??(L[z]={}))[D=re||"__internal_without_id"]??(N[D]=[]);Z.includes(M)||Z.push(M)}j.keys[M]=W}},prepare:ti()}},extraReducers(j){j.addCase(h.actions.removeQueryResult,(B,{payload:{queryCacheKey:L}})=>{I(B,L)}).addMatcher(p,(B,L)=>{var D,M,W;let{provided:N}=i(L);for(let[z,re]of Object.entries(N.tags??{}))for(let[Z,K]of Object.entries(re)){let ce=(M=(D=B.tags)[z]??(D[z]={}))[W=Z||"__internal_without_id"]??(M[W]=[]);for(let ve of K)ce.includes(ve)||ce.push(ve),B.keys[ve]=N.keys[ve]}}).addMatcher(Qr(En(t),bc(t)),(B,L)=>{F(B,[L])}).addMatcher(h.actions.cacheEntriesUpserted.match,(B,L)=>{let N=L.payload.map(({queryDescription:D,value:M})=>({type:"UNKNOWN",payload:M,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:D}}));F(B,N)})}});function I(j,B){let L=pw(j.keys[B]??[]);for(let N of L){let D=N.type,M=N.id??"__internal_without_id",W=j.tags[D]?.[M];W&&(j.tags[D][M]=pw(W).filter(z=>z!==B))}delete j.keys[B]}function F(j,B){let L=B.map(N=>{let D=Ow(N,"providesTags",o,f),{queryCacheKey:M}=N.meta.arg;return{queryCacheKey:M,providedTags:D}});w.caseReducers.updateProvidedBy(j,w.actions.updateProvidedBy(L))}let E=Qo({name:`${e}/subscriptions`,initialState:Ed,reducers:{updateSubscriptionOptions(j,B){},unsubscribeQueryResult(j,B){},internal_getRTKQSubscriptions(){}}}),k=Qo({name:`${e}/internalSubscriptions`,initialState:Ed,reducers:{subscriptionsUpdated:{reducer(j,B){return Oh(j,B.payload)},prepare:ti()}}}),T=Qo({name:`${e}/config`,initialState:{online:Rq(),focused:wq(),middlewareRegistered:!1,...m},reducers:{middlewareRegistered(j,{payload:B}){j.middlewareRegistered=j.middlewareRegistered==="conflict"||a!==B?"conflict":!0}},extraReducers:j=>{j.addCase(iS,B=>{B.online=!0}).addCase(Iw,B=>{B.online=!1}).addCase(aS,B=>{B.focused=!0}).addCase(Rw,B=>{B.focused=!1}).addMatcher(p,B=>({...B}))}}),q=Ka({queries:h.reducer,mutations:y.reducer,provided:w.reducer,subscriptions:k.reducer,config:T.reducer}),G=(j,B)=>q(g.match(B)?void 0:j,B),Q={...T.actions,...h.actions,...E.actions,...k.actions,...y.actions,...w.actions,resetApiState:g};return{reducer:G,actions:Q}}var Xo=Symbol.for("RTKQ/skipToken"),_w={status:kn},mw=jo(_w,()=>{}),gw=jo(_w,()=>{});function Gq({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=E=>mw,o=E=>gw;return{buildQuerySelector:x,buildInfiniteQuerySelector:h,buildMutationSelector:y,selectInvalidatedBy:b,selectCachedArgsForQuery:w,selectApiState:i,selectQueries:p,selectMutations:m,selectQueryEntry:f,selectConfig:g};function a(E){return{...E,...aw(E.status)}}function i(E){return E[t]}function p(E){return i(E)?.queries}function f(E,k){return p(E)?.[k]}function m(E){return i(E)?.mutations}function g(E){return i(E)?.config}function A(E,k,T){return q=>{if(q===Xo)return r(n,T);let G=e({queryArgs:q,endpointDefinition:k,endpointName:E});return r(j=>f(j,G)??mw,T)}}function x(E,k){return A(E,k,a)}function h(E,k){let{infiniteQueryOptions:T}=k;function q(G){let Q={...G,...aw(G.status)},{isLoading:j,isError:B,direction:L}=Q,N=L==="forward",D=L==="backward";return{...Q,hasNextPage:I(T,Q.data,Q.originalArgs),hasPreviousPage:F(T,Q.data,Q.originalArgs),isFetchingNextPage:j&&N,isFetchingPreviousPage:j&&D,isFetchNextPageError:B&&N,isFetchPreviousPageError:B&&D}}return A(E,k,q)}function y(){return E=>{let k;return typeof E=="object"?k=Uc(E)??Xo:k=E,r(k===Xo?o:G=>i(G)?.mutations?.[k]??gw,a)}}function b(E,k){let T=E[t],q=new Set,G=eS(k,oS,Tw);for(let Q of G){let j=T.provided.tags[Q.type];if(!j)continue;let B=(Q.id!==void 0?j[Q.id]:Object.values(j).flat())??[];for(let L of B)q.add(L)}return Array.from(q.values()).flatMap(Q=>{let j=T.queries[Q];return j?{queryCacheKey:Q,endpointName:j.endpointName,originalArgs:j.originalArgs}:[]})}function w(E,k){return eS(Object.values(p(E)),T=>T?.endpointName===k&&T.status!==kn,T=>T.originalArgs)}function I(E,k,T){return k?nS(E,k,T)!=null:!1}function F(E,k,T){return!k||!E.getPreviousPageParam?!1:kw(E,k,T)!=null}}var hw=WeakMap?new WeakMap:void 0,yw=({endpointName:e,queryArgs:t})=>{let r="",n=hw?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(a,i)=>(i=typeof i=="bigint"?{$bigint:i.toString()}:i,i=Lr(i)?Object.keys(i).sort().reduce((p,f)=>(p[f]=i[f],p),{}):i,i));Lr(t)&&hw?.set(t,o),r=o}return`${e}(${r})`};function $q(...e){return function(r){let n=Sc(m=>r.extractRehydrationInfo?.(m,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(m){let g=yw;if("serializeQueryArgs"in m.endpointDefinition){let A=m.endpointDefinition.serializeQueryArgs;g=x=>{let h=A(x);return typeof h=="string"?h:yw({...x,queryArgs:h})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(m)},tagTypes:[...(r.tagTypes||[])]},a={endpointDefinitions:{},batch(m){m()},apiUid:xc(),extractRehydrationInfo:n,hasRehydrationInfo:Sc(m=>n(m)!=null)},i={injectEndpoints:f,enhanceEndpoints({addTagTypes:m,endpoints:g}){if(m)for(let A of m)o.tagTypes.includes(A)||o.tagTypes.push(A);if(g)for(let[A,x]of Object.entries(g))typeof x=="function"?x(ki(a,A)):Object.assign(ki(a,A)||{},x);return i}},p=e.map(m=>m.init(i,o,a));function f(m){let g=m.endpoints({query:A=>({...A,type:Qc}),mutation:A=>({...A,type:Ew}),infiniteQuery:A=>({...A,type:Fw})});for(let[A,x]of Object.entries(g)){if(m.overrideExisting!==!0&&A in a.endpointDefinitions){if(m.overrideExisting==="throw")throw new Error(zt(39));typeof process<"u";continue}typeof process<"u",a.endpointDefinitions[A]=x;for(let h of p)h.injectEndpoint(A,x)}return i}return i.injectEndpoints({endpoints:r.endpoints})}}function Pn(e,...t){return Object.assign(e,...t)}var Hq=({api:e,queryThunk:t,internalState:r,mwApi:n})=>{let o=`${e.reducerPath}/subscriptions`,a=null,i=null,{updateSubscriptionOptions:p,unsubscribeQueryResult:f}=e.internalActions,m=(b,w)=>{if(p.match(w)){let{queryCacheKey:F,requestId:E,options:k}=w.payload,T=b.get(F);return T?.has(E)&&T.set(E,k),!0}if(f.match(w)){let{queryCacheKey:F,requestId:E}=w.payload,k=b.get(F);return k&&k.delete(E),!0}if(e.internalActions.removeQueryResult.match(w))return b.delete(w.payload.queryCacheKey),!0;if(t.pending.match(w)){let{meta:{arg:F,requestId:E}}=w,k=Fd(b,F.queryCacheKey,tS);return F.subscribe&&k.set(E,F.subscriptionOptions??k.get(E)??{}),!0}let I=!1;if(t.rejected.match(w)){let{meta:{condition:F,arg:E,requestId:k}}=w;if(F&&E.subscribe){let T=Fd(b,E.queryCacheKey,tS);T.set(k,E.subscriptionOptions??T.get(k)??{}),I=!0}}return I},g=()=>r.currentSubscriptions,h={getSubscriptions:g,getSubscriptionCount:b=>g().get(b)?.size??0,isRequestSubscribed:(b,w)=>!!g()?.get(b)?.get(w)};function y(b){return JSON.parse(JSON.stringify(Object.fromEntries([...b].map(([w,I])=>[w,Object.fromEntries(I)]))))}return(b,w)=>{if(a||(a=y(r.currentSubscriptions)),e.util.resetApiState.match(b))return a={},r.currentSubscriptions.clear(),i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(b))return[!1,h];let I=m(r.currentSubscriptions,b),F=!0;if(I){i||(i=setTimeout(()=>{let T=y(r.currentSubscriptions),[,q]=kh(a,()=>T);w.next(e.internalActions.subscriptionsUpdated(q)),a=T,i=null},500));let E=typeof b.type=="string"&&!!b.type.startsWith(o),k=t.rejected.match(b)&&b.meta.condition&&!!b.meta.arg.subscribe;F=!E&&!k}return[F,!1]}},zq=2147483647/1e3-1,Wq=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:a,selectConfig:i},getRunningQueryThunk:p,mwApi:f})=>{let{removeQueryResult:m,unsubscribeQueryResult:g,cacheEntriesUpserted:A}=t.internalActions,x=Qr(g.match,r.fulfilled,r.rejected,A.match);function h(E){let k=o.currentSubscriptions.get(E);return k?k.size>0:!1}let y={};function b(E){for(let k of E.values())k?.abort?.()}let w=(E,k)=>{let T=k.getState(),q=i(T);if(x(E)){let G;if(A.match(E))G=E.payload.map(Q=>Q.queryDescription.queryCacheKey);else{let{queryCacheKey:Q}=g.match(E)?E.payload:E.meta.arg;G=[Q]}I(G,k,q)}if(t.util.resetApiState.match(E)){for(let[G,Q]of Object.entries(y))Q&&clearTimeout(Q),delete y[G];b(o.runningQueries),b(o.runningMutations)}if(n.hasRehydrationInfo(E)){let{queries:G}=n.extractRehydrationInfo(E);I(Object.keys(G),k,q)}};function I(E,k,T){let q=k.getState();for(let G of E){let Q=a(q,G);Q?.endpointName&&F(G,Q.endpointName,k,T)}}function F(E,k,T,q){let Q=ki(n,k)?.keepUnusedDataFor??q.keepUnusedDataFor;if(Q===1/0)return;let j=Math.max(0,Math.min(Q,zq));if(!h(E)){let B=y[E];B&&clearTimeout(B),y[E]=setTimeout(()=>{if(!h(E)){let L=a(T.getState(),E);L?.endpointName&&T.dispatch(p(L.endpointName,L.originalArgs))?.abort(),T.dispatch(m({queryCacheKey:E}))}delete y[E]},j*1e3)}}return w},Sw=new Error("Promise never resolved before cacheEntryRemoved."),Yq=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:a,selectors:{selectQueryEntry:i,selectApiState:p}})=>{let f=hl(n),m=hl(o),g=En(n,o),A={},{removeQueryResult:x,removeMutationResult:h,cacheEntriesUpserted:y}=e.internalActions;function b(T,q,G){let Q=A[T];Q?.valueResolved&&(Q.valueResolved({data:q,meta:G}),delete Q.valueResolved)}function w(T){let q=A[T];q&&(delete A[T],q.cacheEntryRemoved())}function I(T){let{arg:q,requestId:G}=T.meta,{endpointName:Q,originalArgs:j}=q;return[Q,j,G]}let F=(T,q,G)=>{let Q=E(T);function j(B,L,N,D){let M=i(G,L),W=i(q.getState(),L);!M&&W&&k(B,D,L,q,N)}if(n.pending.match(T)){let[B,L,N]=I(T);j(B,Q,N,L)}else if(y.match(T))for(let{queryDescription:B,value:L}of T.payload){let{endpointName:N,originalArgs:D,queryCacheKey:M}=B;j(N,M,T.meta.requestId,D),b(M,L,{})}else if(o.pending.match(T)){if(q.getState()[t].mutations[Q]){let[L,N,D]=I(T);k(L,N,Q,q,D)}}else if(g(T))b(Q,T.payload,T.meta.baseQueryMeta);else if(x.match(T)||h.match(T))w(Q);else if(e.util.resetApiState.match(T))for(let B of Object.keys(A))w(B)};function E(T){return f(T)?T.meta.arg.queryCacheKey:m(T)?T.meta.arg.fixedCacheKey??T.meta.requestId:x.match(T)?T.payload.queryCacheKey:h.match(T)?Uc(T.payload):""}function k(T,q,G,Q,j){let B=ki(r,T),L=B?.onCacheEntryAdded;if(!L)return;let N={},D=new Promise(K=>{N.cacheEntryRemoved=K}),M=Promise.race([new Promise(K=>{N.valueResolved=K}),D.then(()=>{throw Sw})]);M.catch(()=>{}),A[G]=N;let W=e.endpoints[T].select(Td(B)?q:G),z=Q.dispatch((K,ce,ve)=>ve),re={...Q,getCacheEntry:()=>W(Q.getState()),requestId:j,extra:z,updateCachedData:Td(B)?K=>Q.dispatch(e.util.updateQueryData(T,q,K)):void 0,cacheDataLoaded:M,cacheEntryRemoved:D},Z=L(q,re);Promise.resolve(Z).catch(K=>{if(K!==Sw)throw K})}return F},Kq=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},Xq=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:a,assertTagType:i,refetchQuery:p,internalState:f})=>{let{removeQueryResult:m}=a.internalActions,g=Qr(En(n),bc(n)),A=Qr(En(o,n),Uo(o,n)),x=[],h=0,y=(I,F)=>{(o.pending.match(I)||n.pending.match(I))&&h++,A(I)&&(h=Math.max(0,h-1)),g(I)?w(Ow(I,"invalidatesTags",r,i),F):A(I)?w([],F):a.util.invalidateTags.match(I)&&w(sS(I.payload,void 0,void 0,void 0,void 0,i),F)};function b(){return h>0}function w(I,F){let E=F.getState(),k=E[e];if(x.push(...I),k.config.invalidationBehavior==="delayed"&&b())return;let T=x;if(x=[],T.length===0)return;let q=a.util.selectInvalidatedBy(E,T);t.batch(()=>{let G=Array.from(q.values());for(let{queryCacheKey:Q}of G){let j=k.queries[Q],B=Fd(f.currentSubscriptions,Q,tS);j&&(B.size===0?F.dispatch(m({queryCacheKey:Q})):j.status!==kn&&F.dispatch(p(j)))}})}return y},Zq=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let{currentPolls:a,currentSubscriptions:i}=o,p=new Set,f=null,m=(w,I)=>{(r.internalActions.updateSubscriptionOptions.match(w)||r.internalActions.unsubscribeQueryResult.match(w))&&g(w.payload.queryCacheKey,I),(t.pending.match(w)||t.rejected.match(w)&&w.meta.condition)&&g(w.meta.arg.queryCacheKey,I),(t.fulfilled.match(w)||t.rejected.match(w)&&!w.meta.condition)&&A(w.meta.arg,I),r.util.resetApiState.match(w)&&(y(),f&&(clearTimeout(f),f=null),p.clear())};function g(w,I){p.add(w),f||(f=setTimeout(()=>{for(let F of p)x({queryCacheKey:F},I);p.clear(),f=null},0))}function A({queryCacheKey:w},I){let F=I.getState()[e],E=F.queries[w],k=i.get(w);if(!E||E.status===kn)return;let{lowestPollingInterval:T,skipPollingIfUnfocused:q}=b(k);if(!Number.isFinite(T))return;let G=a.get(w);G?.timeout&&(clearTimeout(G.timeout),G.timeout=void 0);let Q=Date.now()+T;a.set(w,{nextPollTimestamp:Q,pollingInterval:T,timeout:setTimeout(()=>{(F.config.focused||!q)&&I.dispatch(n(E)),A({queryCacheKey:w},I)},T)})}function x({queryCacheKey:w},I){let E=I.getState()[e].queries[w],k=i.get(w);if(!E||E.status===kn)return;let{lowestPollingInterval:T}=b(k);if(!Number.isFinite(T)){h(w);return}let q=a.get(w),G=Date.now()+T;(!q||G<q.nextPollTimestamp)&&A({queryCacheKey:w},I)}function h(w){let I=a.get(w);I?.timeout&&clearTimeout(I.timeout),a.delete(w)}function y(){for(let w of a.keys())h(w)}function b(w=new Map){let I=!1,F=Number.POSITIVE_INFINITY;for(let E of w.values())E.pollingInterval&&(F=Math.min(E.pollingInterval,F),I=E.skipPollingIfUnfocused||I);return{lowestPollingInterval:F,skipPollingIfUnfocused:I}}return m},Jq=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=gl(r,n),a=Uo(r,n),i=En(r,n),p={};return(m,g)=>{if(o(m)){let{requestId:A,arg:{endpointName:x,originalArgs:h}}=m.meta,y=ki(t,x),b=y?.onQueryStarted;if(b){let w={},I=new Promise((T,q)=>{w.resolve=T,w.reject=q});I.catch(()=>{}),p[A]=w;let F=e.endpoints[x].select(Td(y)?h:A),E=g.dispatch((T,q,G)=>G),k={...g,getCacheEntry:()=>F(g.getState()),requestId:A,extra:E,updateCachedData:Td(y)?T=>g.dispatch(e.util.updateQueryData(x,h,T)):void 0,queryFulfilled:I};b(h,k)}}else if(i(m)){let{requestId:A,baseQueryMeta:x}=m.meta;p[A]?.resolve({data:m.payload,meta:x}),delete p[A]}else if(a(m)){let{requestId:A,rejectedWithValue:x,baseQueryMeta:h}=m.meta;p[A]?.reject({error:m.payload??m.error,isUnhandledError:!x,meta:h}),delete p[A]}}},eM=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:a}=r.internalActions,i=(f,m)=>{aS.match(f)&&p(m,"refetchOnFocus"),iS.match(f)&&p(m,"refetchOnReconnect")};function p(f,m){let g=f.getState()[e],A=g.queries,x=o.currentSubscriptions;t.batch(()=>{for(let h of x.keys()){let y=A[h],b=x.get(h);if(!b||!y)continue;let w=[...b.values()];(w.some(F=>F[m]===!0)||w.every(F=>F[m]===void 0)&&g.config[m])&&(b.size===0?f.dispatch(a({queryCacheKey:h})):y.status!==kn&&f.dispatch(n(y)))}})}return i};function tM(e){let{reducerPath:t,queryThunk:r,api:n,context:o,getInternalState:a}=e,{apiUid:i}=o,p={invalidateTags:P(`${t}/invalidateTags`)},f=x=>x.type.startsWith(`${t}/`),m=[Kq,Wq,Xq,Zq,Yq,Jq];return{middleware:x=>{let h=!1,y=a(x.dispatch),b={...e,internalState:y,refetchQuery:A,isThisApiSliceAction:f,mwApi:x},w=m.map(E=>E(b)),I=Hq(b),F=eM(b);return E=>k=>{if(!ic(k))return E(k);h||(h=!0,x.dispatch(n.internalActions.middlewareRegistered(i)));let T={...x,next:E},q=x.getState(),[G,Q]=I(k,T,q),j;if(G?j=E(k):j=Q,x.getState()[t]&&(F(k,T,q),f(k)||o.hasRehydrationInfo(k)))for(let B of w)B(k,T,q);return j}},actions:p};function A(x){return e.api.endpoints[x.endpointName].initiate(x.originalArgs,{subscribe:!1,forceRefetch:!0})}}var vw=Symbol(),rM=({createSelector:e=ct}={})=>({name:vw,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:a,keepUnusedDataFor:i,refetchOnMountOrArgChange:p,refetchOnFocus:f,refetchOnReconnect:m,invalidationBehavior:g,onSchemaFailure:A,catchSchemaFailure:x,skipSchemaValidation:h},y){SC();let b=Ee=>(typeof process<"u",Ee);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:iS,onOffline:Iw,onFocus:aS,onFocusLost:Rw},util:{}});let w=Gq({serializeQueryArgs:a,reducerPath:o,createSelector:e}),{selectInvalidatedBy:I,selectCachedArgsForQuery:F,buildQuerySelector:E,buildInfiniteQuerySelector:k,buildMutationSelector:T}=w;Pn(t.util,{selectInvalidatedBy:I,selectCachedArgsForQuery:F});let{queryThunk:q,infiniteQueryThunk:G,mutationThunk:Q,patchQueryData:j,updateQueryData:B,upsertQueryData:L,prefetch:N,buildMatchThunkActions:D}=Qq({baseQuery:r,reducerPath:o,context:y,api:t,serializeQueryArgs:a,assertTagType:b,selectors:w,onSchemaFailure:A,catchSchemaFailure:x,skipSchemaValidation:h}),{reducer:M,actions:W}=Bq({context:y,queryThunk:q,infiniteQueryThunk:G,mutationThunk:Q,serializeQueryArgs:a,reducerPath:o,assertTagType:b,config:{refetchOnFocus:f,refetchOnReconnect:m,refetchOnMountOrArgChange:p,keepUnusedDataFor:i,reducerPath:o,invalidationBehavior:g}});Pn(t.util,{patchQueryData:j,updateQueryData:B,upsertQueryData:L,prefetch:N,resetApiState:W.resetApiState,upsertQueryEntries:W.cacheEntriesUpserted}),Pn(t.internalActions,W);let z=new WeakMap,re=Ee=>Fd(z,Ee,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:Z,buildInitiateInfiniteQuery:K,buildInitiateMutation:ce,getRunningMutationThunk:ve,getRunningMutationsThunk:Ve,getRunningQueriesThunk:nt,getRunningQueryThunk:Ge}=Uq({queryThunk:q,mutationThunk:Q,infiniteQueryThunk:G,api:t,serializeQueryArgs:a,context:y,getInternalState:re});Pn(t.util,{getRunningMutationThunk:ve,getRunningMutationsThunk:Ve,getRunningQueryThunk:Ge,getRunningQueriesThunk:nt});let{middleware:Je,actions:et}=tM({reducerPath:o,context:y,queryThunk:q,mutationThunk:Q,infiniteQueryThunk:G,api:t,assertTagType:b,selectors:w,getRunningQueryThunk:Ge,getInternalState:re});return Pn(t.util,et),Pn(t,{reducer:M,middleware:Je}),{name:vw,injectEndpoint(Ee,Re){var gt;let Fe=(gt=t.endpoints)[Ee]??(gt[Ee]={});kd(Re)&&Pn(Fe,{name:Ee,select:E(Ee,Re),initiate:Z(Ee,Re)},D(q,Ee)),Vq(Re)&&Pn(Fe,{name:Ee,select:T(),initiate:ce(Ee)},D(Q,Ee)),Od(Re)&&Pn(Fe,{name:Ee,select:k(Ee,Re),initiate:K(Ee,Re)},D(q,Ee))}}}}),Nw=$q(rM());d();c();l();u();d();c();l();u();var Zo=e=>e.query,Dw=e=>e.query?.enableQuerySyntax;var qw=ct(e=>Zo(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,o)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:o})),_d=ct(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();l();u();d();c();l();u();var Bc=e=>{if(e==="yes")return!0;if(e==="no")return!1};var Oi=(e,t,r)=>ze({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(n,o)=>{let a=t??Ue(o);if(!a)return null;let i=Wb(o);return n.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:a,answerGenerated:e,answerTextIsEmpty:r,...(i&&{conversationId:i})})},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:n=>({answerId:t??Ue(n)??"",answerGenerated:e??!1})}),_i=e=>ze({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",responseId:t.search?.searchResponseId||t.search?.response.searchUid||""})});var Mw=()=>({actionCause:"retryGeneratedAnswer"});d();c();l();u();d();c();l();u();var Vw=ct(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});d();c();l();u();var cS=e=>e.context;d();c();l();u();var uS=e=>e.pipeline;d();c();l();u();var lS=e=>e.searchHub;d();c();l();u();var jt=ct(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),uie=ct(e=>e,e=>{let t=jt(e);return t&&e?e[t].expression:""});d();c();l();u();var jw=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var Lw=e=>e.excerptLength?.length;d();c();l();u();var Jr=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,Uw=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var Qw=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};d();c();l();u();var Bw=e=>e.sortCriteria;var Gw=/*#__PURE__*/function(){var _ref64=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Qn(e.configuration.search.apiBaseUrl,e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function Gw(_x183){return _ref64.apply(this,arguments)}}(),$w=(e,t)=>{let r=Zo(e)?.q,{aq:n,cq:o,dq:a,lq:i}=Ww(e),p=cS(e),f=Wo(e.configuration.analytics,t,{actionCause:Yy(e)}),m=lS(e),g=uS(e),A=Sy(e)??[],x=zw(e),h=jt(e.tabSet)||"default",y=hy(e),b=Bb(e),w=t.referrer||"",I=Uw(e),F=Bw(e),E=nM(e),k=Lw(e),T=Qw(e),q=jw(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(a&&{dq:a}),...(i&&{lq:i}),...(e.query&&{enableQuerySyntax:Dw(e)}),...(p?.contextValues&&{context:p.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:A}},...(m?.length&&{searchHub:m}),...(g?.length&&{pipeline:g}),...(x.length&&{facets:x}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:Gy(e),firstResult:e.pagination.firstResult}),tab:h,locale:y,timezone:b,...(e.debug!==void 0&&{debug:e.debug}),referrer:w,...E,...(T??{}),...(k&&{excerptLength:k}),...(q&&{dictionaryFieldContext:q}),sortCriteria:F,...(I&&{facetOptions:I}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},Hw=(e,t)=>{let r=Zo(e)?.q,n=zw(e),o=Wo(e.configuration.analytics,t,{actionCause:Yy(e)}),a=hy(e),i=jt(e.tabSet)||"default",p=t.referrer,{aq:f,cq:m}=Ww(e),g=lS(e),A=uS(e),x=cS(e),h=Sy(e)??[];return{q:r||"",...(n.length&&{facets:n}),citationsFieldToInclude:h,...(g?.length&&{searchHub:g}),...(A?.length&&{pipeline:A}),...(x?.contextValues&&{context:x.contextValues}),...(f&&{aq:f}),...(m&&{cq:m}),tab:i,referrer:p,...o,locale:a}},zw=e=>vd(e)?.map(t=>Fy(t,Ey())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),nM=e=>({actionsHistory:e.configuration.analytics.enabled?Vt.getInstance().getHistory():[]}),Ww=e=>{let t=Vw(e),r=$y(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var Nd=["searching","thinking","answering"];function Dd(e){return e.toLowerCase()}var qd=["search","generic"];function dS(){return{id:"",isVisible:!0,isEnabled:!0,isLoading:!1,isStreaming:!1,citations:[],liked:!1,disliked:!1,responseFormat:{contentFormat:["text/plain"]},feedbackModalOpen:!1,feedbackSubmitted:!1,fieldsToIncludeInCitations:[],isAnswerGenerated:!1,expanded:!1,cannotAnswer:!1,answerApiQueryParams:void 0,answerId:void 0,answerGenerationMode:"automatic",generationSteps:[]}}d();c();l();u();var Yw=["text/plain","text/markdown"];var Ni=new $({required:!0}),Kw=new $,Di=new fe({required:!0}),pS={id:Ni,title:Ni,uri:Ni,permanentid:Ni,clickUri:Kw},Md=new $({required:!0,constrainTo:Yw}),Xw=new $({required:!0,constrainTo:Nd}),Zw=e=>({...e,name:Dd(e.name)}),qi=P("generatedAnswer/setIsVisible",e=>_(e,Di)),Mi=P("generatedAnswer/setAnswerId",e=>_(e,H)),Vd=P("generatedAnswer/setAnswerGenerationMode",e=>_(e,new $({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),Vi=P("generatedAnswer/setIsEnabled",e=>_(e,Di)),ea=P("generatedAnswer/updateMessage",e=>_(e,{textDelta:Ni})),ta=P("generatedAnswer/updateCitations",e=>_(e,{citations:new oe({required:!0,each:new Y({values:pS})})})),ra=P("generatedAnswer/updateError",e=>_(e,{message:Kw,code:new ne({min:0})})),lr=P("generatedAnswer/resetAnswer"),jd=P("generatedAnswer/like"),Ld=P("generatedAnswer/dislike"),Ud=P("generatedAnswer/feedbackModal/open"),Gc=P("generatedAnswer/expand"),Qd=P("generatedAnswer/collapse"),Bd=P("generatedAnswer/setId",e=>_(e,{id:new $({required:!0})})),Gd=P("generatedAnswer/feedbackModal/close"),ji=P("generatedAnswer/sendFeedback"),en=P("generatedAnswer/setIsLoading",e=>_(e,Di)),Jo=P("generatedAnswer/setIsStreaming",e=>_(e,Di)),na=P("generatedAnswer/setAnswerContentFormat",e=>_(e,Md)),$d=P("generatedAnswer/updateResponseFormat",e=>_(e,{contentFormat:new oe({each:Md,default:["text/plain"]})})),Hd=P("knowledge/updateAnswerConfigurationId",e=>_(e,Ni)),zd=P("generatedAnswer/registerFieldsToIncludeInCitations",e=>_(e,Wu)),$c=P("generatedAnswer/setIsAnswerGenerated",e=>_(e,Di)),oa=P("generatedAnswer/setCannotAnswer",e=>_(e,Di)),fS=P("generatedAnswer/setAnswerApiQueryParams",e=>_(e,new Y({}))),Wd=P("generatedAnswer/startStep",e=>_(Zw(e),{name:Xw,startedAt:new ne({min:0,required:!0})})),Yd=P("generatedAnswer/finishStep",e=>_(Zw(e),{name:Xw,finishedAt:new ne({min:0,required:!0})})),Kd=P("generatedAnswer/startToolCall",e=>_(e,{toolCallName:H,startedAt:new ne({min:0,required:!0}),toolCallId:H})),Xd=P("generatedAnswer/finishToolCall",e=>_(e,{finishedAt:new ne({min:0,required:!0}),toolCallId:H})),Li=P("generatedAnswer/toolCallArgs",e=>_(e,{toolCallId:H,args:new Y({options:{required:!0}}),type:new $({required:!0,constrainTo:qd})})),Jw=me("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref65=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:a}=t,{search:i}=a(),{queryExecuted:p}=i,{setAbortControllerRef:f}=e,m=yield Gw(r),g=(h,y)=>{switch(h){case"genqa.headerMessageType":{let b=JSON.parse(y);n(na(b.contentFormat));break}case"genqa.messageType":n(ea(JSON.parse(y)));break;case"genqa.citationsType":n(ta(JSON.parse(y)));break;case"genqa.endOfStreamType":{let b=JSON.parse(y).answerGenerated,{answerId:w,answer:I}=a().generatedAnswer,E=p.length!==0&&!b,k=!I?.trim();n(oa(E)),n(Jo(!1)),n($c(b)),n(Oi(b,w,b?k:void 0)),n(_i());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${h}"`)}};n(en(!0));let A=h=>h.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,x=o.streamingClient?.streamGeneratedAnswer(m,{write:h=>{A(m)&&(n(en(!1)),h.payload&&h.payloadType&&g(h.payloadType,h.payload))},abort:h=>{A(m)&&n(ra(h))},close:()=>{A(m)&&n(Jo(!1))},resetAnswer:()=>{A(m)&&n(lr())}});x?f(x):n(en(!1))});return function(_x184,_x185){return _ref65.apply(this,arguments)}}()),Zd=me("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref66=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(lr());let a=t();if(a.generatedAnswer.isEnabled===!1){o.warn("[WARNING] The generateAnswer action was dispatched while the generated answer is disabled. No answer will be generated. Enable the generated answer before dispatching generateAnswer.");return}if(a.generatedAnswer.answerConfigurationId){let i=$w(a,n);r(fS(i)),yield r(Jd(i))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x186,_x187){return _ref66.apply(this,arguments)}}());d();c();l();u();var oM=/*#__PURE__*/function(){var _ref67=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:a,organizationId:i}=n.configuration,p=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let m=Qn(n.configuration.search?.apiBaseUrl,i,a);return Cw({baseUrl:`${m}/rest/organizations/${i}/answer/v1/configs/${p}`,fetchFn:function(){var _ref68=_asyncToGenerator(function*(g){if(g instanceof String)throw new Error("The provided 'request' must be a Request object.");let A=g.url,x={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(h=>{x[h]=g[h]}),x.duplex="half",x.body=yield g.text(),v(A,x)});return function fetchFn(_x191){return _ref68.apply(this,arguments)}}()})(f,{...t,signal:null},r)}catch(m){return{error:m}}});return function oM(_x188,_x189,_x190){return _ref67.apply(this,arguments)}}(),ep=Nw({reducerPath:"answer",baseQuery:xw(oM,{maxRetries:3}),endpoints:()=>({})});var aM=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},iM=(e,t)=>{let{textDelta:r}=t;if(typeof r!="string")return;let n=e.answer;!n?.trim()&&!r.trim()||(delete e.error,e.answer=n?.trim()?n.concat(r):r)},sM=(e,t)=>{delete e.error,e.citations=t.citations},cM=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},uM=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)},lM=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&uM(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(aM(t,o),r(na(o.contentFormat)));break;case"genqa.messageType":typeof o.textDelta=="string"&&(iM(t,o),r(ea({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(sM(t,o),r(ta({citations:o.citations})));break;case"genqa.endOfStreamType":{cM(t,o);let a=t.answerId,i=o.answerGenerated??!1,p=i?!t.answer?.trim():void 0;r(Oi(i,a,p)),r(_i());break}}},dM=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,a=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${a}/${r}/generate`},aa=ep.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let{analytics:n,...o}=r;return`${t}(${JSON.stringify(o)})`},onCacheEntryAdded(_x192,_x193){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:a}){yield n;let{configuration:i,generatedAnswer:p,insightConfiguration:f}=r(),{organizationId:m,environment:g,accessToken:A}=i,x=Qn(i.search.apiBaseUrl,m,g),h=dM(x,m,p.answerConfigurationId,f?.insightId);yield Gu(h,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${A}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:v,onopen:function(){var _ref69=_asyncToGenerator(function*(y){let b=y.headers.get("x-answer-id");b&&o(w=>{w.answerId=b,a(Mi(b))})});return function onopen(_x194){return _ref69.apply(this,arguments)}}(),onmessage:y=>{o(b=>{lM(y,b,a)})},onerror:y=>{throw y},onclose:()=>{o(y=>{a(oa(!y.generated))})}})}).apply(this,arguments)}})})}),Jd=e=>aa.endpoints.getAnswer.initiate(e),mS=e=>{let t=_d(e);return aa.endpoints.getAnswer.select(t??Xo)(e)};d();c();l();u();var eR=pe(Hn,e=>e);d();c();l();u();function pM(e){let t=e.payload?.analyticsAction;return tR(e)&&!J(t)}function tR(e){return"type"in e}var rR=e=>t=>r=>{let n;pM(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return tR(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var tp={q:new $,enableQuerySyntax:new fe,aq:new $,cq:new $,firstResult:new ne({min:0}),numberOfResults:new ne({min:0}),sortCriteria:new $,f:new Y,fExcluded:new Y,cf:new Y,nf:new Y,mnf:new Y,df:new Y,debug:new fe,sf:new Y,tab:new $,af:new Y};var ot=P("searchParameters/restore",e=>_(e,tp)),rp=P("searchParameters/restoreTab",e=>_(e,H));d();c();l();u();var np=P("tab/register",e=>{let t=new Y({values:{id:H,expression:Ke}});return _(e,t)}),_t=P("tab/updateActiveTab",e=>_(e,H));d();c();l();u();var op=Fr(Lu(),1),aR=Fr(nR(),1),iR=Fr(oR(),1);op.default.extend(iR.default);op.default.extend(aR.default);var ap=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:op.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"});d();c();l();u();var fM=/(^|; )Coveo-Pendragon=([^;]*)/,mM=/(^|; )Coveo-SearchAgentDebug=([^;]*)/;function sR(){return typeof window>"u"?!1:fM.exec(document.cookie)?.pop()||null}function cR(){return typeof window>"u"?!1:mM.test(document.cookie)}var ip=pe(ap(),e=>e.addCase(Si,(t,r)=>{gM(t,r.payload)}).addCase(vi,(t,r)=>{hM(t,r.payload)}).addCase($l,(t,r)=>{yM(t,r.payload)}).addCase(Hl,t=>{t.analytics.enabled=!1}).addCase(zl,t=>{t.analytics.enabled=!0}).addCase(gx,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(hx,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(_t,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(rp,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(ot,(t,r)=>{J(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(yx,(t,{payload:r})=>{SM(t,r)}));function gM(e,t){J(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",J(t.organizationId)||(e.organizationId=t.organizationId)}function hM(e,t){J(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),J(t.locale)||(e.search.locale=t.locale),J(t.timezone)||(e.search.timezone=t.timezone),J(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function yM(e,t){J(t.enabled)||(e.analytics.enabled=t.enabled),J(t.originContext)||(e.analytics.originContext=t.originContext),J(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),J(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),J(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),J(t.trackingId)||(e.analytics.trackingId=t.trackingId),J(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),J(t.source)||(e.analytics.source=t.source);try{let r=sR();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}J(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),J(t.anonymous)||(e.analytics.anonymous=t.anonymous),J(t.deviceId)||(e.analytics.deviceId=t.deviceId),J(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),J(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}function SM(e,t){e.knowledge.agentId=t;try{cR()&&(e.knowledge.debugAgentSession=!0)}catch{}}var xe=ip;d();c();l();u();function vM(e){return e.instantlyCallable}var uR=()=>e=>t=>e(vM(t)?t():t);d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Nt=[];for(let e=0;e<256;++e)Nt.push((e+256).toString(16).slice(1));function lR(e,t=0){return(Nt[e[t+0]]+Nt[e[t+1]]+Nt[e[t+2]]+Nt[e[t+3]]+"-"+Nt[e[t+4]]+Nt[e[t+5]]+"-"+Nt[e[t+6]]+Nt[e[t+7]]+"-"+Nt[e[t+8]]+Nt[e[t+9]]+"-"+Nt[e[t+10]]+Nt[e[t+11]]+Nt[e[t+12]]+Nt[e[t+13]]+Nt[e[t+14]]+Nt[e[t+15]]).toLowerCase()}d();c();l();u();var vS,AM=new Uint8Array(16);function AS(){if(!vS){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");vS=crypto.getRandomValues.bind(crypto)}return vS(AM)}d();c();l();u();d();c();l();u();var CM=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),CS={randomUUID:CM};function bM(e,t,r){if(CS.randomUUID&&!t&&!e)return CS.randomUUID();e=e||{};let n=e.random??e.rng?.()??AS();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return lR(n)}var co=bM;d();c();l();u();d();c();l();u();var R={};Hs(R,{BRAND:()=>WM,DIRTY:()=>ia,EMPTY_PATH:()=>IM,INVALID:()=>Ce,NEVER:()=>OV,OK:()=>Lt,ParseStatus:()=>Dt,Schema:()=>Ne,ZodAny:()=>po,ZodArray:()=>Dn,ZodBigInt:()=>ca,ZodBoolean:()=>ua,ZodBranded:()=>zc,ZodCatch:()=>Aa,ZodDate:()=>la,ZodDefault:()=>va,ZodDiscriminatedUnion:()=>up,ZodEffects:()=>br,ZodEnum:()=>ya,ZodError:()=>er,ZodFirstPartyTypeKind:()=>we,ZodFunction:()=>dp,ZodIntersection:()=>ma,ZodIssueCode:()=>X,ZodLazy:()=>ga,ZodLiteral:()=>ha,ZodMap:()=>Hi,ZodNaN:()=>Wi,ZodNativeEnum:()=>Sa,ZodNever:()=>Or,ZodNull:()=>pa,ZodNullable:()=>nn,ZodNumber:()=>sa,ZodObject:()=>tr,ZodOptional:()=>Ar,ZodParsedType:()=>ue,ZodPipeline:()=>Wc,ZodPromise:()=>fo,ZodReadonly:()=>Ca,ZodRecord:()=>lp,ZodSchema:()=>Ne,ZodSet:()=>zi,ZodString:()=>lo,ZodSymbol:()=>Gi,ZodTransformer:()=>br,ZodTuple:()=>rn,ZodType:()=>Ne,ZodUndefined:()=>da,ZodUnion:()=>fa,ZodUnknown:()=>Nn,ZodVoid:()=>$i,addIssueToContext:()=>se,any:()=>nV,array:()=>sV,bigint:()=>ZM,boolean:()=>CR,coerce:()=>kV,custom:()=>SR,date:()=>JM,datetimeRegex:()=>hR,defaultErrorMap:()=>On,discriminatedUnion:()=>dV,effect:()=>xV,enum:()=>AV,function:()=>yV,getErrorMap:()=>Ui,getParsedType:()=>tn,instanceof:()=>KM,intersection:()=>pV,isAborted:()=>sp,isAsync:()=>Qi,isDirty:()=>cp,isValid:()=>uo,late:()=>YM,lazy:()=>SV,literal:()=>vV,makeIssue:()=>Hc,map:()=>gV,nan:()=>XM,nativeEnum:()=>CV,never:()=>aV,null:()=>rV,nullable:()=>RV,number:()=>AR,object:()=>cV,objectUtil:()=>bS,oboolean:()=>PV,onumber:()=>TV,optional:()=>wV,ostring:()=>FV,pipeline:()=>EV,preprocess:()=>IV,promise:()=>bV,quotelessJson:()=>xM,record:()=>mV,set:()=>hV,setErrorMap:()=>RM,strictObject:()=>uV,string:()=>vR,symbol:()=>eV,transformer:()=>xV,tuple:()=>fV,undefined:()=>tV,union:()=>lV,unknown:()=>oV,util:()=>Me,void:()=>iV});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Me;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let a={};for(let i of o)a[i]=i;return a},e.getValidEnumValues=o=>{let a=e.objectKeys(o).filter(p=>typeof o[o[p]]!="number"),i={};for(let p of a)i[p]=o[p];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(a){return o[a]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let a=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&a.push(i);return a},e.find=(o,a)=>{for(let i of o)if(a(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,a=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(o,a)=>typeof a=="bigint"?a.toString():a})(Me||(Me={}));var bS;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(bS||(bS={}));var ue=Me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tn=e=>{switch(typeof e){case"undefined":return ue.undefined;case"string":return ue.string;case"number":return Number.isNaN(e)?ue.nan:ue.number;case"boolean":return ue.boolean;case"function":return ue.function;case"bigint":return ue.bigint;case"symbol":return ue.symbol;case"object":return Array.isArray(e)?ue.array:e===null?ue.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ue.promise:typeof Map<"u"&&e instanceof Map?ue.map:typeof Set<"u"&&e instanceof Set?ue.set:typeof Date<"u"&&e instanceof Date?ue.date:ue.object;default:return ue.unknown}};var X=Me.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),xM=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),er=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(a){return a.message},n={_errors:[]},o=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let p=n,f=0;for(;f<i.path.length;){let m=i.path[f];f===i.path.length-1?(p[m]=p[m]||{_errors:[]},p[m]._errors.push(r(i))):p[m]=p[m]||{_errors:[]},p=p[m],f++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let a=o.path[0];r[a]=r[a]||[],r[a].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};er.create=e=>new er(e);var wM=(e,t)=>{let r;switch(e.code){case X.invalid_type:e.received===ue.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case X.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Me.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:r=`Unrecognized key(s) in object: ${Me.joinValues(e.keys,", ")}`;break;case X.invalid_union:r="Invalid input";break;case X.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Me.joinValues(e.options)}`;break;case X.invalid_enum_value:r=`Invalid enum value. Expected ${Me.joinValues(e.options)}, received '${e.received}'`;break;case X.invalid_arguments:r="Invalid function arguments";break;case X.invalid_return_type:r="Invalid function return type";break;case X.invalid_date:r="Invalid date";break;case X.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Me.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case X.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case X.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case X.custom:r="Invalid input";break;case X.invalid_intersection_types:r="Intersection results could not be merged";break;case X.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case X.not_finite:r="Number must be finite";break;default:r=t.defaultError,Me.assertNever(e)}return{message:r}},On=wM;var dR=On;function RM(e){dR=e}function Ui(){return dR}d();c();l();u();var Hc=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...(o.path||[])],i={...o,path:a};if(o.message!==void 0)return{...o,path:a,message:o.message};let p="",f=n.filter(m=>!!m).slice().reverse();for(let m of f)p=m(i,{data:t,defaultError:p}).message;return{...o,path:a,message:p}},IM=[];function se(e,t){let r=Ui(),n=Hc({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===On?void 0:On].filter(o=>!!o)});e.common.issues.push(n)}var Dt=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return Ce;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static mergeObjectAsync(t,r){return _asyncToGenerator(function*(){let n=[];for(let o of r){let a=yield o.key,i=yield o.value;n.push({key:a,value:i})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:a,value:i}=o;if(a.status==="aborted"||i.status==="aborted")return Ce;a.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[a.value]=i.value)}return{status:t.value,value:n}}},Ce=Object.freeze({status:"aborted"}),ia=e=>({status:"dirty",value:e}),Lt=e=>({status:"valid",value:e}),sp=e=>e.status==="aborted",cp=e=>e.status==="dirty",uo=e=>e.status==="valid",Qi=e=>typeof Promise<"u"&&e instanceof Promise;d();c();l();u();d();c();l();u();var ge;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ge||(ge={}));var Cr=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},pR=(e,t)=>{if(uo(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new er(e.common.issues);return this._error=r,this._error}}};function Te(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,p)=>{let{message:f}=e;return i.code==="invalid_enum_value"?{message:f??p.defaultError}:typeof p.data>"u"?{message:f??n??p.defaultError}:i.code!=="invalid_type"?{message:p.defaultError}:{message:f??r??p.defaultError}},description:o}}var Ne=class{get description(){return this._def.description}_getType(t){return tn(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:tn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Dt,ctx:{common:t.parent.common,data:t.data,parsedType:tn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Qi(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tn(t)},o=this._parseSync({data:t,path:n.path,parent:n});return pR(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tn(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return uo(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>uo(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this31=this;return _asyncToGenerator(function*(){let n=yield _this31.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this32=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this32._def.errorMap,parent:null,data:t,parsedType:tn(t)},o=_this32._parse({data:t,path:n.path,parent:n}),a=yield Qi(o)?o:Promise.resolve(o);return pR(n,a)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,a)=>{let i=t(o),p=()=>a.addIssue({code:X.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(p(),!1)):i?!0:(p(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new br({schema:this,typeName:we.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Ar.create(this,this._def)}nullable(){return nn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Dn.create(this)}promise(){return fo.create(this,this._def)}or(t){return fa.create([this,t],this._def)}and(t){return ma.create(this,t,this._def)}transform(t){return new br({...Te(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new va({...Te(this._def),innerType:this,defaultValue:r,typeName:we.ZodDefault})}brand(){return new zc({typeName:we.ZodBranded,type:this,...Te(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Aa({...Te(this._def),innerType:this,catchValue:r,typeName:we.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Wc.create(this,t)}readonly(){return Ca.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},EM=/^c[^\s-]{8,}$/i,FM=/^[0-9a-z]+$/,TM=/^[0-9A-HJKMNP-TV-Z]{26}$/i,PM=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,kM=/^[a-z0-9_-]{21}$/i,OM=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,_M=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,NM=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,DM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",xS,qM=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,MM=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,VM=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,jM=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,LM=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,UM=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,mR="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",QM=new RegExp(`^${mR}$`);function gR(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function BM(e){return new RegExp(`^${gR(e)}$`)}function hR(e){let t=`${mR}T${gR(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function GM(e,t){return!!((t==="v4"||!t)&&qM.test(e)||(t==="v6"||!t)&&VM.test(e))}function $M(e,t){if(!OM.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function HM(e,t){return!!((t==="v4"||!t)&&MM.test(e)||(t==="v6"||!t)&&jM.test(e))}var lo=class e extends Ne{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ue.string){let a=this._getOrReturnCtx(t);return se(a,{code:X.invalid_type,expected:ue.string,received:a.parsedType}),Ce}let n=new Dt,o;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:X.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:X.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let i=t.data.length>a.value,p=t.data.length<a.value;(i||p)&&(o=this._getOrReturnCtx(t,o),i?se(o,{code:X.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):p&&se(o,{code:X.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")NM.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"email",code:X.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")xS||(xS=new RegExp(DM,"u")),xS.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"emoji",code:X.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")PM.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"uuid",code:X.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")kM.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"nanoid",code:X.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")EM.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"cuid",code:X.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")FM.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"cuid2",code:X.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")TM.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"ulid",code:X.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),se(o,{validation:"url",code:X.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"regex",code:X.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?hR(a).test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?QM.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?BM(a).test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{code:X.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?_M.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"duration",code:X.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?GM(t.data,a.version)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"ip",code:X.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?$M(t.data,a.alg)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"jwt",code:X.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?HM(t.data,a.version)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"cidr",code:X.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?LM.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"base64",code:X.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?UM.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"base64url",code:X.invalid_string,message:a.message}),n.dirty()):Me.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:X.invalid_string,...ge.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ge.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ge.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ge.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ge.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ge.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ge.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ge.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ge.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ge.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ge.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ge.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ge.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ge.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...ge.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...ge.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ge.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ge.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...ge.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ge.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ge.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ge.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ge.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ge.errToObj(r)})}nonempty(t){return this.min(1,ge.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};lo.create=e=>new lo({checks:[],typeName:we.ZodString,coerce:e?.coerce??!1,...Te(e)});function zM(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,a=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return a%i/10**o}var sa=class e extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ue.number){let a=this._getOrReturnCtx(t);return se(a,{code:X.invalid_type,expected:ue.number,received:a.parsedType}),Ce}let n,o=new Dt;for(let a of this._def.checks)a.kind==="int"?Me.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),se(n,{code:X.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),se(n,{code:X.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),se(n,{code:X.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?zM(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),se(n,{code:X.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),se(n,{code:X.not_finite,message:a.message}),o.dirty()):Me.assertNever(a);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ge.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ge.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ge.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ge.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ge.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ge.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ge.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ge.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ge.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ge.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Me.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};sa.create=e=>new sa({checks:[],typeName:we.ZodNumber,coerce:e?.coerce||!1,...Te(e)});var ca=class e extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ue.bigint)return this._getInvalidInput(t);let n,o=new Dt;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),se(n,{code:X.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),se(n,{code:X.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),se(n,{code:X.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):Me.assertNever(a);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return se(r,{code:X.invalid_type,expected:ue.bigint,received:r.parsedType}),Ce}gte(t,r){return this.setLimit("min",t,!0,ge.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ge.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ge.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ge.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ge.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};ca.create=e=>new ca({checks:[],typeName:we.ZodBigInt,coerce:e?.coerce??!1,...Te(e)});var ua=class extends Ne{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ue.boolean){let n=this._getOrReturnCtx(t);return se(n,{code:X.invalid_type,expected:ue.boolean,received:n.parsedType}),Ce}return Lt(t.data)}};ua.create=e=>new ua({typeName:we.ZodBoolean,coerce:e?.coerce||!1,...Te(e)});var la=class e extends Ne{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ue.date){let a=this._getOrReturnCtx(t);return se(a,{code:X.invalid_type,expected:ue.date,received:a.parsedType}),Ce}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return se(a,{code:X.invalid_date}),Ce}let n=new Dt,o;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:X.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:X.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Me.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:ge.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ge.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};la.create=e=>new la({checks:[],coerce:e?.coerce||!1,typeName:we.ZodDate,...Te(e)});var Gi=class extends Ne{_parse(t){if(this._getType(t)!==ue.symbol){let n=this._getOrReturnCtx(t);return se(n,{code:X.invalid_type,expected:ue.symbol,received:n.parsedType}),Ce}return Lt(t.data)}};Gi.create=e=>new Gi({typeName:we.ZodSymbol,...Te(e)});var da=class extends Ne{_parse(t){if(this._getType(t)!==ue.undefined){let n=this._getOrReturnCtx(t);return se(n,{code:X.invalid_type,expected:ue.undefined,received:n.parsedType}),Ce}return Lt(t.data)}};da.create=e=>new da({typeName:we.ZodUndefined,...Te(e)});var pa=class extends Ne{_parse(t){if(this._getType(t)!==ue.null){let n=this._getOrReturnCtx(t);return se(n,{code:X.invalid_type,expected:ue.null,received:n.parsedType}),Ce}return Lt(t.data)}};pa.create=e=>new pa({typeName:we.ZodNull,...Te(e)});var po=class extends Ne{constructor(){super(...arguments),this._any=!0}_parse(t){return Lt(t.data)}};po.create=e=>new po({typeName:we.ZodAny,...Te(e)});var Nn=class extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Lt(t.data)}};Nn.create=e=>new Nn({typeName:we.ZodUnknown,...Te(e)});var Or=class extends Ne{_parse(t){let r=this._getOrReturnCtx(t);return se(r,{code:X.invalid_type,expected:ue.never,received:r.parsedType}),Ce}};Or.create=e=>new Or({typeName:we.ZodNever,...Te(e)});var $i=class extends Ne{_parse(t){if(this._getType(t)!==ue.undefined){let n=this._getOrReturnCtx(t);return se(n,{code:X.invalid_type,expected:ue.void,received:n.parsedType}),Ce}return Lt(t.data)}};$i.create=e=>new $i({typeName:we.ZodVoid,...Te(e)});var Dn=class e extends Ne{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==ue.array)return se(r,{code:X.invalid_type,expected:ue.array,received:r.parsedType}),Ce;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,p=r.data.length<o.exactLength.value;(i||p)&&(se(r,{code:i?X.too_big:X.too_small,minimum:p?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(se(r,{code:X.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(se(r,{code:X.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,p)=>o.type._parseAsync(new Cr(r,i,r.path,p)))).then(i=>Dt.mergeArray(n,i));let a=[...r.data].map((i,p)=>o.type._parseSync(new Cr(r,i,r.path,p)));return Dt.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:ge.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:ge.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:ge.toString(r)}})}nonempty(t){return this.min(1,t)}};Dn.create=(e,t)=>new Dn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...Te(t)});function Bi(e){if(e instanceof tr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Ar.create(Bi(n))}return new tr({...e._def,shape:()=>t})}else return e instanceof Dn?new Dn({...e._def,type:Bi(e.element)}):e instanceof Ar?Ar.create(Bi(e.unwrap())):e instanceof nn?nn.create(Bi(e.unwrap())):e instanceof rn?rn.create(e.items.map(t=>Bi(t))):e}var tr=class e extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Me.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ue.object){let m=this._getOrReturnCtx(t);return se(m,{code:X.invalid_type,expected:ue.object,received:m.parsedType}),Ce}let{status:n,ctx:o}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),p=[];if(!(this._def.catchall instanceof Or&&this._def.unknownKeys==="strip"))for(let m in o.data)i.includes(m)||p.push(m);let f=[];for(let m of i){let g=a[m],A=o.data[m];f.push({key:{status:"valid",value:m},value:g._parse(new Cr(o,A,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof Or){let m=this._def.unknownKeys;if(m==="passthrough")for(let g of p)f.push({key:{status:"valid",value:g},value:{status:"valid",value:o.data[g]}});else if(m==="strict")p.length>0&&(se(o,{code:X.unrecognized_keys,keys:p}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let g of p){let A=o.data[g];f.push({key:{status:"valid",value:g},value:m._parse(new Cr(o,A,o.path,g)),alwaysSet:g in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let m=[];for(let g of f){let A=yield g.key,x=yield g.value;m.push({key:A,value:x,alwaysSet:g.alwaysSet})}return m})).then(m=>Dt.mergeObjectSync(n,m)):Dt.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return ge.errToObj,new e({...this._def,unknownKeys:"strict",...(t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:ge.errToObj(t).message??o}:{message:o}}}:{})})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:we.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of Me.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of Me.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Bi(this)}partial(t){let r={};for(let n of Me.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of Me.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Ar;)a=a._def.innerType;r[n]=a}return new e({...this._def,shape:()=>r})}keyof(){return yR(Me.objectKeys(this.shape))}};tr.create=(e,t)=>new tr({shape:()=>e,unknownKeys:"strip",catchall:Or.create(),typeName:we.ZodObject,...Te(t)});tr.strictCreate=(e,t)=>new tr({shape:()=>e,unknownKeys:"strict",catchall:Or.create(),typeName:we.ZodObject,...Te(t)});tr.lazycreate=(e,t)=>new tr({shape:e,unknownKeys:"strip",catchall:Or.create(),typeName:we.ZodObject,...Te(t)});var fa=class extends Ne{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(a){for(let p of a)if(p.result.status==="valid")return p.result;for(let p of a)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let i=a.map(p=>new er(p.ctx.common.issues));return se(r,{code:X.invalid_union,unionErrors:i}),Ce}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref71=_asyncToGenerator(function*(a){let i={...r,common:{...r.common,issues:[]},parent:null};return{result:yield a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}});return function(_x195){return _ref71.apply(this,arguments)}}())).then(o);{let a,i=[];for(let f of n){let m={...r,common:{...r.common,issues:[]},parent:null},g=f._parseSync({data:r.data,path:r.path,parent:m});if(g.status==="valid")return g;g.status==="dirty"&&!a&&(a={result:g,ctx:m}),m.common.issues.length&&i.push(m.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let p=i.map(f=>new er(f));return se(r,{code:X.invalid_union,unionErrors:p}),Ce}}get options(){return this._def.options}};fa.create=(e,t)=>new fa({options:e,typeName:we.ZodUnion,...Te(t)});var _n=e=>e instanceof ga?_n(e.schema):e instanceof br?_n(e.innerType()):e instanceof ha?[e.value]:e instanceof ya?e.options:e instanceof Sa?Me.objectValues(e.enum):e instanceof va?_n(e._def.innerType):e instanceof da?[void 0]:e instanceof pa?[null]:e instanceof Ar?[void 0,..._n(e.unwrap())]:e instanceof nn?[null,..._n(e.unwrap())]:e instanceof zc||e instanceof Ca?_n(e.unwrap()):e instanceof Aa?_n(e._def.innerType):[],up=class e extends Ne{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.object)return se(r,{code:X.invalid_type,expected:ue.object,received:r.parsedType}),Ce;let n=this.discriminator,o=r.data[n],a=this.optionsMap.get(o);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(se(r,{code:X.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let a of r){let i=_n(a.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let p of i){if(o.has(p))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(p)}`);o.set(p,a)}}return new e({typeName:we.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...Te(n)})}};function wS(e,t){let r=tn(e),n=tn(t);if(e===t)return{valid:!0,data:e};if(r===ue.object&&n===ue.object){let o=Me.objectKeys(t),a=Me.objectKeys(e).filter(p=>o.indexOf(p)!==-1),i={...e,...t};for(let p of a){let f=wS(e[p],t[p]);if(!f.valid)return{valid:!1};i[p]=f.data}return{valid:!0,data:i}}else if(r===ue.array&&n===ue.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let a=0;a<e.length;a++){let i=e[a],p=t[a],f=wS(i,p);if(!f.valid)return{valid:!1};o.push(f.data)}return{valid:!0,data:o}}else return r===ue.date&&n===ue.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var ma=class extends Ne{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(a,i)=>{if(sp(a)||sp(i))return Ce;let p=wS(a.value,i.value);return p.valid?((cp(a)||cp(i))&&r.dirty(),{status:r.value,value:p.data}):(se(n,{code:X.invalid_intersection_types}),Ce)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>o(a,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ma.create=(e,t,r)=>new ma({left:e,right:t,typeName:we.ZodIntersection,...Te(r)});var rn=class e extends Ne{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.array)return se(n,{code:X.invalid_type,expected:ue.array,received:n.parsedType}),Ce;if(n.data.length<this._def.items.length)return se(n,{code:X.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&n.data.length>this._def.items.length&&(se(n,{code:X.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((i,p)=>{let f=this._def.items[p]||this._def.rest;return f?f._parse(new Cr(n,i,n.path,p)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>Dt.mergeArray(r,i)):Dt.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};rn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new rn({items:e,typeName:we.ZodTuple,rest:null,...Te(t)})};var lp=class e extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.object)return se(n,{code:X.invalid_type,expected:ue.object,received:n.parsedType}),Ce;let o=[],a=this._def.keyType,i=this._def.valueType;for(let p in n.data)o.push({key:a._parse(new Cr(n,p,n.path,p)),value:i._parse(new Cr(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?Dt.mergeObjectAsync(r,o):Dt.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Ne?new e({keyType:t,valueType:r,typeName:we.ZodRecord,...Te(n)}):new e({keyType:lo.create(),valueType:t,typeName:we.ZodRecord,...Te(r)})}},Hi=class extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.map)return se(n,{code:X.invalid_type,expected:ue.map,received:n.parsedType}),Ce;let o=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([p,f],m)=>({key:o._parse(new Cr(n,p,n.path,[m,"key"])),value:a._parse(new Cr(n,f,n.path,[m,"value"]))}));if(n.common.async){let p=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let f of i){let m=yield f.key,g=yield f.value;if(m.status==="aborted"||g.status==="aborted")return Ce;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}))}else{let p=new Map;for(let f of i){let m=f.key,g=f.value;if(m.status==="aborted"||g.status==="aborted")return Ce;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}}};Hi.create=(e,t,r)=>new Hi({valueType:t,keyType:e,typeName:we.ZodMap,...Te(r)});var zi=class e extends Ne{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.set)return se(n,{code:X.invalid_type,expected:ue.set,received:n.parsedType}),Ce;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(se(n,{code:X.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(se(n,{code:X.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let a=this._def.valueType;function i(f){let m=new Set;for(let g of f){if(g.status==="aborted")return Ce;g.status==="dirty"&&r.dirty(),m.add(g.value)}return{status:r.value,value:m}}let p=[...n.data.values()].map((f,m)=>a._parse(new Cr(n,f,n.path,m)));return n.common.async?Promise.all(p).then(f=>i(f)):i(p)}min(t,r){return new e({...this._def,minSize:{value:t,message:ge.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:ge.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};zi.create=(e,t)=>new zi({valueType:e,minSize:null,maxSize:null,typeName:we.ZodSet,...Te(t)});var dp=class e extends Ne{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.function)return se(r,{code:X.invalid_type,expected:ue.function,received:r.parsedType}),Ce;function n(p,f){return Hc({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ui(),On].filter(m=>!!m),issueData:{code:X.invalid_arguments,argumentsError:f}})}function o(p,f){return Hc({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ui(),On].filter(m=>!!m),issueData:{code:X.invalid_return_type,returnTypeError:f}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof fo){let p=this;return Lt(/*#__PURE__*/_asyncToGenerator(function*(...f){let m=new er([]),g=yield p._def.args.parseAsync(f,a).catch(h=>{throw m.addIssue(n(f,h)),m}),A=yield Reflect.apply(i,this,g);return yield p._def.returns._def.type.parseAsync(A,a).catch(h=>{throw m.addIssue(o(A,h)),m})}))}else{let p=this;return Lt(function(...f){let m=p._def.args.safeParse(f,a);if(!m.success)throw new er([n(f,m.error)]);let g=Reflect.apply(i,this,m.data),A=p._def.returns.safeParse(g,a);if(!A.success)throw new er([o(g,A.error)]);return A.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:rn.create(t).rest(Nn.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||rn.create([]).rest(Nn.create()),returns:r||Nn.create(),typeName:we.ZodFunction,...Te(n)})}},ga=class extends Ne{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};ga.create=(e,t)=>new ga({getter:e,typeName:we.ZodLazy,...Te(t)});var ha=class extends Ne{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return se(r,{received:r.data,code:X.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:t.data}}get value(){return this._def.value}};ha.create=(e,t)=>new ha({value:e,typeName:we.ZodLiteral,...Te(t)});function yR(e,t){return new ya({values:e,typeName:we.ZodEnum,...Te(t)})}var ya=class e extends Ne{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return se(r,{expected:Me.joinValues(n),received:r.parsedType,code:X.invalid_type}),Ce}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return se(r,{received:r.data,code:X.invalid_enum_value,options:n}),Ce}return Lt(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};ya.create=yR;var Sa=class extends Ne{_parse(t){let r=Me.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ue.string&&n.parsedType!==ue.number){let o=Me.objectValues(r);return se(n,{expected:Me.joinValues(o),received:n.parsedType,code:X.invalid_type}),Ce}if(this._cache||(this._cache=new Set(Me.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=Me.objectValues(r);return se(n,{received:n.data,code:X.invalid_enum_value,options:o}),Ce}return Lt(t.data)}get enum(){return this._def.values}};Sa.create=(e,t)=>new Sa({values:e,typeName:we.ZodNativeEnum,...Te(t)});var fo=class extends Ne{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.promise&&r.common.async===!1)return se(r,{code:X.invalid_type,expected:ue.promise,received:r.parsedType}),Ce;let n=r.parsedType===ue.promise?r.data:Promise.resolve(r.data);return Lt(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};fo.create=(e,t)=>new fo({type:e,typeName:we.ZodPromise,...Te(t)});var br=class extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this33=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,a={addIssue:i=>{se(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){let i=o.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(/*#__PURE__*/function(){var _ref74=_asyncToGenerator(function*(p){if(r.value==="aborted")return Ce;let f=yield _this33._def.schema._parseAsync({data:p,path:n.path,parent:n});return f.status==="aborted"?Ce:f.status==="dirty"?ia(f.value):r.value==="dirty"?ia(f.value):f});return function(_x196){return _ref74.apply(this,arguments)}}());{if(r.value==="aborted")return Ce;let p=this._def.schema._parseSync({data:i,path:n.path,parent:n});return p.status==="aborted"?Ce:p.status==="dirty"?ia(p.value):r.value==="dirty"?ia(p.value):p}}if(o.type==="refinement"){let i=p=>{let f=o.refinement(p,a);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(n.common.async===!1){let p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return p.status==="aborted"?Ce:(p.status==="dirty"&&r.dirty(),i(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>p.status==="aborted"?Ce:(p.status==="dirty"&&r.dirty(),i(p.value).then(()=>({status:r.value,value:p.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!uo(i))return Ce;let p=o.transform(i.value,a);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>uo(i)?Promise.resolve(o.transform(i.value,a)).then(p=>({status:r.value,value:p})):Ce);Me.assertNever(o)}};br.create=(e,t,r)=>new br({schema:e,typeName:we.ZodEffects,effect:t,...Te(r)});br.createWithPreprocess=(e,t,r)=>new br({schema:t,effect:{type:"preprocess",transform:e},typeName:we.ZodEffects,...Te(r)});var Ar=class extends Ne{_parse(t){return this._getType(t)===ue.undefined?Lt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ar.create=(e,t)=>new Ar({innerType:e,typeName:we.ZodOptional,...Te(t)});var nn=class extends Ne{_parse(t){return this._getType(t)===ue.null?Lt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};nn.create=(e,t)=>new nn({innerType:e,typeName:we.ZodNullable,...Te(t)});var va=class extends Ne{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===ue.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};va.create=(e,t)=>new va({innerType:e,typeName:we.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Te(t)});var Aa=class extends Ne{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Qi(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new er(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new er(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Aa.create=(e,t)=>new Aa({innerType:e,typeName:we.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Te(t)});var Wi=class extends Ne{_parse(t){if(this._getType(t)!==ue.nan){let n=this._getOrReturnCtx(t);return se(n,{code:X.invalid_type,expected:ue.nan,received:n.parsedType}),Ce}return{status:"valid",value:t.data}}};Wi.create=e=>new Wi({typeName:we.ZodNaN,...Te(e)});var WM=Symbol("zod_brand"),zc=class extends Ne{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Wc=class e extends Ne{_parse(t){var _this34=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let a=yield _this34._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ce:a.status==="dirty"?(r.dirty(),ia(a.value)):_this34._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Ce:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:we.ZodPipeline})}},Ca=class extends Ne{_parse(t){let r=this._def.innerType._parse(t),n=o=>(uo(o)&&(o.value=Object.freeze(o.value)),o);return Qi(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Ca.create=(e,t)=>new Ca({innerType:e,typeName:we.ZodReadonly,...Te(t)});function fR(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function SR(e,t={},r){return e?po.create().superRefine((n,o)=>{let a=e(n);if(a instanceof Promise)return a.then(i=>{if(!i){let p=fR(t,n),f=p.fatal??r??!0;o.addIssue({code:"custom",...p,fatal:f})}});if(!a){let i=fR(t,n),p=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:p})}}):po.create()}var YM={object:tr.lazycreate},we;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(we||(we={}));var KM=(e,t={message:`Input not instance of ${e.name}`})=>SR(r=>r instanceof e,t),vR=lo.create,AR=sa.create,XM=Wi.create,ZM=ca.create,CR=ua.create,JM=la.create,eV=Gi.create,tV=da.create,rV=pa.create,nV=po.create,oV=Nn.create,aV=Or.create,iV=$i.create,sV=Dn.create,cV=tr.create,uV=tr.strictCreate,lV=fa.create,dV=up.create,pV=ma.create,fV=rn.create,mV=lp.create,gV=Hi.create,hV=zi.create,yV=dp.create,SV=ga.create,vV=ha.create,AV=ya.create,CV=Sa.create,bV=fo.create,xV=br.create,wV=Ar.create,RV=nn.create,IV=br.createWithPreprocess,EV=Wc.create,FV=()=>vR().optional(),TV=()=>AR().optional(),PV=()=>CR().optional(),kV={string:e=>lo.create({...e,coerce:!0}),number:e=>sa.create({...e,coerce:!0}),boolean:e=>ua.create({...e,coerce:!0}),bigint:e=>ca.create({...e,coerce:!0}),date:e=>la.create({...e,coerce:!0})};var OV=Ce;var _V=R.object({name:R.string(),arguments:R.string()}),NV=R.object({id:R.string(),type:R.literal("function"),function:_V,encryptedValue:R.string().optional()}),pp=R.object({id:R.string(),role:R.string(),content:R.string().optional(),name:R.string().optional(),encryptedValue:R.string().optional()}),DV=R.object({type:R.literal("text"),text:R.string()}),qV=R.object({type:R.literal("data"),value:R.string(),mimeType:R.string()}),MV=R.object({type:R.literal("url"),value:R.string(),mimeType:R.string().optional()}),fp=R.discriminatedUnion("type",[qV,MV]),VV=R.object({type:R.literal("image"),source:fp,metadata:R.unknown().optional()}),jV=R.object({type:R.literal("audio"),source:fp,metadata:R.unknown().optional()}),LV=R.object({type:R.literal("video"),source:fp,metadata:R.unknown().optional()}),UV=R.object({type:R.literal("document"),source:fp,metadata:R.unknown().optional()});var bR=R.object({type:R.literal("binary"),mimeType:R.string(),id:R.string().optional(),url:R.string().optional(),data:R.string().optional(),filename:R.string().optional()}),xR=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:R.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},ade=bR.superRefine((e,t)=>{xR(e,t)}),QV=R.discriminatedUnion("type",[DV,VV,jV,LV,UV,bR]),BV=QV.superRefine((e,t)=>{e.type==="binary"&&xR(e,t)}),GV=pp.extend({role:R.literal("developer"),content:R.string()}),$V=pp.extend({role:R.literal("system"),content:R.string()}),HV=pp.extend({role:R.literal("assistant"),content:R.string().optional(),toolCalls:R.array(NV).optional()}),zV=pp.extend({role:R.literal("user"),content:R.union([R.string(),R.array(BV)])}),WV=R.object({id:R.string(),content:R.string(),role:R.literal("tool"),toolCallId:R.string(),error:R.string().optional(),encryptedValue:R.string().optional()}),YV=R.object({id:R.string(),role:R.literal("activity"),activityType:R.string(),content:R.record(R.any())}),KV=R.object({id:R.string(),role:R.literal("reasoning"),content:R.string(),encryptedValue:R.string().optional()}),wR=R.discriminatedUnion("role",[GV,$V,HV,zV,WV,YV,KV]),ide=R.union([R.literal("developer"),R.literal("system"),R.literal("assistant"),R.literal("user"),R.literal("tool"),R.literal("activity"),R.literal("reasoning")]),XV=R.object({description:R.string(),value:R.string()}),RR=R.object({name:R.string(),description:R.string(),parameters:R.any(),metadata:R.record(R.any()).optional()}),ZV=R.object({id:R.string(),reason:R.string(),message:R.string().optional(),toolCallId:R.string().optional(),responseSchema:R.record(R.any()).optional(),expiresAt:R.string().optional(),metadata:R.record(R.any()).optional()}),JV=R.object({interruptId:R.string(),status:R.enum(["resolved","cancelled"]),payload:R.any().optional()}),ej=R.object({threadId:R.string(),runId:R.string(),parentRunId:R.string().optional(),state:R.any(),messages:R.array(wR),tools:R.array(RR),context:R.array(XV),forwardedProps:R.any(),resume:R.array(JV).optional()}),tj=R.any(),at=class extends Error{constructor(e){super(e)}},RS=class extends at{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},rj=R.object({name:R.string(),description:R.string().optional()}),nj=R.object({name:R.string().optional(),type:R.string().optional(),description:R.string().optional(),version:R.string().optional(),provider:R.string().optional(),documentationUrl:R.string().optional(),metadata:R.record(R.unknown()).optional()}),oj=R.object({streaming:R.boolean().optional(),websocket:R.boolean().optional(),httpBinary:R.boolean().optional(),pushNotifications:R.boolean().optional(),resumable:R.boolean().optional()}),aj=R.object({supported:R.boolean().optional(),items:R.array(RR).optional(),parallelCalls:R.boolean().optional(),clientProvided:R.boolean().optional()}),ij=R.object({structuredOutput:R.boolean().optional(),supportedMimeTypes:R.array(R.string()).optional()}),sj=R.object({snapshots:R.boolean().optional(),deltas:R.boolean().optional(),memory:R.boolean().optional(),persistentState:R.boolean().optional()}),cj=R.object({supported:R.boolean().optional(),delegation:R.boolean().optional(),handoffs:R.boolean().optional(),subAgents:R.array(rj).optional()}),uj=R.object({supported:R.boolean().optional(),streaming:R.boolean().optional(),encrypted:R.boolean().optional()}),lj=R.object({image:R.boolean().optional(),audio:R.boolean().optional(),video:R.boolean().optional(),pdf:R.boolean().optional(),file:R.boolean().optional()}),dj=R.object({image:R.boolean().optional(),audio:R.boolean().optional()}),pj=R.object({input:lj.optional(),output:dj.optional()}),fj=R.object({codeExecution:R.boolean().optional(),sandboxed:R.boolean().optional(),maxIterations:R.number().optional(),maxExecutionTime:R.number().optional()}),mj=R.object({supported:R.boolean().optional(),approvals:R.boolean().optional(),interventions:R.boolean().optional(),feedback:R.boolean().optional(),interrupts:R.boolean().optional(),approveWithEdits:R.boolean().optional()}),sde=R.object({identity:nj.optional(),transport:oj.optional(),tools:aj.optional(),output:ij.optional(),state:sj.optional(),multiAgent:cj.optional(),reasoning:uj.optional(),multimodal:pj.optional(),execution:fj.optional(),humanInTheLoop:mj.optional(),custom:R.record(R.unknown()).optional()}),IR=R.union([R.literal("developer"),R.literal("system"),R.literal("assistant"),R.literal("user")]),V=function(e){return e.TEXT_MESSAGE_START="TEXT_MESSAGE_START",e.TEXT_MESSAGE_CONTENT="TEXT_MESSAGE_CONTENT",e.TEXT_MESSAGE_END="TEXT_MESSAGE_END",e.TEXT_MESSAGE_CHUNK="TEXT_MESSAGE_CHUNK",e.TOOL_CALL_START="TOOL_CALL_START",e.TOOL_CALL_ARGS="TOOL_CALL_ARGS",e.TOOL_CALL_END="TOOL_CALL_END",e.TOOL_CALL_CHUNK="TOOL_CALL_CHUNK",e.TOOL_CALL_RESULT="TOOL_CALL_RESULT",e.THINKING_START="THINKING_START",e.THINKING_END="THINKING_END",e.THINKING_TEXT_MESSAGE_START="THINKING_TEXT_MESSAGE_START",e.THINKING_TEXT_MESSAGE_CONTENT="THINKING_TEXT_MESSAGE_CONTENT",e.THINKING_TEXT_MESSAGE_END="THINKING_TEXT_MESSAGE_END",e.STATE_SNAPSHOT="STATE_SNAPSHOT",e.STATE_DELTA="STATE_DELTA",e.MESSAGES_SNAPSHOT="MESSAGES_SNAPSHOT",e.ACTIVITY_SNAPSHOT="ACTIVITY_SNAPSHOT",e.ACTIVITY_DELTA="ACTIVITY_DELTA",e.RAW="RAW",e.CUSTOM="CUSTOM",e.RUN_STARTED="RUN_STARTED",e.RUN_FINISHED="RUN_FINISHED",e.RUN_ERROR="RUN_ERROR",e.STEP_STARTED="STEP_STARTED",e.STEP_FINISHED="STEP_FINISHED",e.REASONING_START="REASONING_START",e.REASONING_MESSAGE_START="REASONING_MESSAGE_START",e.REASONING_MESSAGE_CONTENT="REASONING_MESSAGE_CONTENT",e.REASONING_MESSAGE_END="REASONING_MESSAGE_END",e.REASONING_MESSAGE_CHUNK="REASONING_MESSAGE_CHUNK",e.REASONING_END="REASONING_END",e.REASONING_ENCRYPTED_VALUE="REASONING_ENCRYPTED_VALUE",e}({}),Qe=R.object({type:R.nativeEnum(V),timestamp:R.number().optional(),rawEvent:R.any().optional()}).passthrough(),gj=Qe.extend({type:R.literal(V.TEXT_MESSAGE_START),messageId:R.string(),role:IR.default("assistant"),name:R.string().optional()}),ER=Qe.extend({type:R.literal(V.TEXT_MESSAGE_CONTENT),messageId:R.string(),delta:R.string()}),hj=Qe.extend({type:R.literal(V.TEXT_MESSAGE_END),messageId:R.string()}),yj=Qe.extend({type:R.literal(V.TEXT_MESSAGE_CHUNK),messageId:R.string().optional(),role:IR.optional(),delta:R.string().optional(),name:R.string().optional()}),Sj=Qe.extend({type:R.literal(V.THINKING_TEXT_MESSAGE_START)}),vj=ER.omit({messageId:!0,type:!0}).extend({type:R.literal(V.THINKING_TEXT_MESSAGE_CONTENT)}),Aj=Qe.extend({type:R.literal(V.THINKING_TEXT_MESSAGE_END)}),Cj=Qe.extend({type:R.literal(V.TOOL_CALL_START),toolCallId:R.string(),toolCallName:R.string(),parentMessageId:R.string().optional()}),bj=Qe.extend({type:R.literal(V.TOOL_CALL_ARGS),toolCallId:R.string(),delta:R.string()}),xj=Qe.extend({type:R.literal(V.TOOL_CALL_END),toolCallId:R.string()}),wj=Qe.extend({messageId:R.string(),type:R.literal(V.TOOL_CALL_RESULT),toolCallId:R.string(),content:R.string(),role:R.literal("tool").optional()}),Rj=Qe.extend({type:R.literal(V.TOOL_CALL_CHUNK),toolCallId:R.string().optional(),toolCallName:R.string().optional(),parentMessageId:R.string().optional(),delta:R.string().optional()}),Ij=Qe.extend({type:R.literal(V.THINKING_START),title:R.string().optional()}),Ej=Qe.extend({type:R.literal(V.THINKING_END)}),Fj=Qe.extend({type:R.literal(V.STATE_SNAPSHOT),snapshot:tj}),Tj=Qe.extend({type:R.literal(V.STATE_DELTA),delta:R.array(R.any())}),Pj=Qe.extend({type:R.literal(V.MESSAGES_SNAPSHOT),messages:R.array(wR)}),kj=Qe.extend({type:R.literal(V.ACTIVITY_SNAPSHOT),messageId:R.string(),activityType:R.string(),content:R.record(R.any()),replace:R.boolean().optional().default(!0)}),Oj=Qe.extend({type:R.literal(V.ACTIVITY_DELTA),messageId:R.string(),activityType:R.string(),patch:R.array(R.any())}),_j=Qe.extend({type:R.literal(V.RAW),event:R.any(),source:R.string().optional()}),Nj=Qe.extend({type:R.literal(V.CUSTOM),name:R.string(),value:R.any()}),Dj=Qe.extend({type:R.literal(V.RUN_STARTED),threadId:R.string(),runId:R.string(),parentRunId:R.string().optional(),input:ej.optional()}),qj=R.object({type:R.literal("success")}).strict(),Mj=R.object({type:R.literal("interrupt"),interrupts:R.array(ZV).min(1)}).strict(),Vj=R.discriminatedUnion("type",[qj,Mj]),jj=Qe.extend({type:R.literal(V.RUN_FINISHED),threadId:R.string(),runId:R.string(),result:R.any().optional(),outcome:Vj.nullable().optional().transform(e=>e??void 0)}),Lj=Qe.extend({type:R.literal(V.RUN_ERROR),message:R.string(),code:R.string().optional()}),Uj=Qe.extend({type:R.literal(V.STEP_STARTED),stepName:R.string()}),Qj=Qe.extend({type:R.literal(V.STEP_FINISHED),stepName:R.string()}),Bj=R.union([R.literal("tool-call"),R.literal("message")]),Gj=Qe.extend({type:R.literal(V.REASONING_START),messageId:R.string()}),$j=Qe.extend({type:R.literal(V.REASONING_MESSAGE_START),messageId:R.string(),role:R.literal("reasoning")}),Hj=Qe.extend({type:R.literal(V.REASONING_MESSAGE_CONTENT),messageId:R.string(),delta:R.string()}),zj=Qe.extend({type:R.literal(V.REASONING_MESSAGE_END),messageId:R.string()}),Wj=Qe.extend({type:R.literal(V.REASONING_MESSAGE_CHUNK),messageId:R.string().optional(),delta:R.string().optional()}),Yj=Qe.extend({type:R.literal(V.REASONING_END),messageId:R.string()}),Kj=Qe.extend({type:R.literal(V.REASONING_ENCRYPTED_VALUE),subtype:Bj,entityId:R.string(),encryptedValue:R.string()}),mp=R.discriminatedUnion("type",[gj,ER,hj,yj,Ij,Ej,Sj,vj,Aj,Cj,bj,xj,Rj,wj,Fj,Tj,Pj,kj,Oj,_j,Nj,Dj,jj,Lj,Uj,Qj,Gj,$j,Hj,zj,Wj,Yj,Kj]);d();c();l();u();var IS={};Hs(IS,{JsonPatchError:()=>dt,_areEquals:()=>Xc,applyOperation:()=>ba,applyPatch:()=>Cp,applyReducer:()=>tL,deepClone:()=>Jj,getValueByPointer:()=>vp,validate:()=>TR,validator:()=>Ap});d();c();l();u();d();c();l();u();var Xj=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zj=Object.prototype.hasOwnProperty;function hp(e,t){return Zj.call(e,t)}function yp(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var o in e)hp(e,o)&&n.push(o);return n}function qt(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Sp(e){for(var t=0,r=e.length,n;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}function on(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Yc(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function gp(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(gp(e[t]))return!0}else if(typeof e=="object"){for(var n=yp(e),o=n.length,a=0;a<o;a++)if(gp(e[n[a]]))return!0}}return!1}function FR(e,t){var r=[e];for(var n in t){var o=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof o<"u"&&r.push(n+": "+o)}return r.join(`
33
33
  `)}var Kc=function(e){Xj(t,e);function t(r,n,o,a,i){var p=this.constructor,f=e.call(this,FR(r,{name:n,index:o,operation:a,tree:i}))||this;return f.name=n,f.index=o,f.operation=a,f.tree=i,Object.setPrototypeOf(f,p.prototype),f.message=FR(r,{name:n,index:o,operation:a,tree:i}),f}return t}(Error);var dt=Kc,Jj=qt,Yi={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=vp(r,this.path);n&&(n=qt(n));var o=ba(r,{op:"remove",path:this.from}).removed;return ba(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=vp(r,this.from);return ba(r,{op:"add",path:this.path,value:qt(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:Xc(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},eL={add:function(e,t,r){return Sp(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){var n=e.splice(t,1);return{newDocument:r,removed:n[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:Yi.move,copy:Yi.copy,test:Yi.test,_get:Yi._get};function vp(e,t){if(t=="")return e;var r={op:"_get",path:t};return ba(e,r),r.value}function ba(e,t,r,n,o,a){if(r===void 0&&(r=!1),n===void 0&&(n=!0),o===void 0&&(o=!0),a===void 0&&(a=0),r&&(typeof r=="function"?r(t,0,e,t.path):Ap(t,0)),t.path===""){var i={newDocument:e};if(t.op==="add")return i.newDocument=t.value,i;if(t.op==="replace")return i.newDocument=t.value,i.removed=e,i;if(t.op==="move"||t.op==="copy")return i.newDocument=vp(e,t.from),t.op==="move"&&(i.removed=e),i;if(t.op==="test"){if(i.test=Xc(e,t.value),i.test===!1)throw new dt("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i.newDocument=e,i}else{if(t.op==="remove")return i.removed=e,i.newDocument=null,i;if(t.op==="_get")return t.value=e,i;if(r)throw new dt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,t,e);return i}}else{n||(e=qt(e));var p=t.path||"",f=p.split("/"),m=e,g=1,A=f.length,x=void 0,h=void 0,y=void 0;for(typeof r=="function"?y=r:y=Ap;;){if(h=f[g],h&&h.indexOf("~")!=-1&&(h=Yc(h)),o&&(h=="__proto__"||h=="prototype"&&g>0&&f[g-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&x===void 0&&(m[h]===void 0?x=f.slice(0,g).join("/"):g==A-1&&(x=t.path),x!==void 0&&y(t,0,e,x)),g++,Array.isArray(m)){if(h==="-")h=m.length;else{if(r&&!Sp(h))throw new dt("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",a,t,e);Sp(h)&&(h=~~h)}if(g>=A){if(r&&t.op==="add"&&h>m.length)throw new dt("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,t,e);var i=eL[t.op].call(t,m,h,e);if(i.test===!1)throw new dt("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}}else if(g>=A){var i=Yi[t.op].call(t,m,h,e);if(i.test===!1)throw new dt("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}if(m=m[h],r&&g<A&&(!m||typeof m!="object"))throw new dt("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",a,t,e)}}}function Cp(e,t,r,n,o){if(n===void 0&&(n=!0),o===void 0&&(o=!0),r&&!Array.isArray(t))throw new dt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=qt(e));for(var a=new Array(t.length),i=0,p=t.length;i<p;i++)a[i]=ba(e,t[i],r,!0,o,i),e=a[i].newDocument;return a.newDocument=e,a}function tL(e,t,r){var n=ba(e,t);if(n.test===!1)throw new dt("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function Ap(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new dt("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(Yi[e.op]){if(typeof e.path!="string")throw new dt("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new dt("Operation `path` property must start with \"/\"","OPERATION_PATH_INVALID",t,e,r);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new dt("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new dt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&gp(e.value))throw new dt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var o=e.path.split("/").length,a=n.split("/").length;if(o!==a+1&&o!==a)throw new dt("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==n)throw new dt("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var i={op:"_get",path:e.from,value:void 0},p=TR([i],r);if(p&&p.name==="OPERATION_PATH_UNRESOLVABLE")throw new dt("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new dt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function TR(e,t,r){try{if(!Array.isArray(e))throw new dt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Cp(qt(t),qt(e),r||!0);else{r=r||Ap;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(o){if(o instanceof dt)return o;throw o}}function Xc(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),o,a,i;if(r&&n){if(a=e.length,a!=t.length)return!1;for(o=a;o--!==0;)if(!Xc(e[o],t[o]))return!1;return!0}if(r!=n)return!1;var p=Object.keys(e);if(a=p.length,a!==Object.keys(t).length)return!1;for(o=a;o--!==0;)if(!t.hasOwnProperty(p[o]))return!1;for(o=a;o--!==0;)if(i=p[o],!Xc(e[i],t[i]))return!1;return!0}return e!==e&&t!==t}var PS={};Hs(PS,{compare:()=>uL,generate:()=>ES,observe:()=>cL,unobserve:()=>sL});d();c();l();u();var FS=new WeakMap,rL=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),nL=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function oL(e){return FS.get(e)}function aL(e,t){return e.observers.get(t)}function iL(e,t){e.observers.delete(t.callback)}function sL(e,t){t.unobserve()}function cL(e,t){var r=[],n,o=oL(e);if(!o)o=new rL(e),FS.set(e,o);else{var a=aL(o,t);n=a&&a.observer}if(n)return n;if(n={},o.value=qt(e),t){n.callback=t,n.next=null;var i=function(){ES(n)},p=function(){clearTimeout(n.next),n.next=setTimeout(i)};typeof window<"u"&&(window.addEventListener("mouseup",p),window.addEventListener("keyup",p),window.addEventListener("mousedown",p),window.addEventListener("keydown",p),window.addEventListener("change",p))}return n.patches=r,n.object=e,n.unobserve=function(){ES(n),clearTimeout(n.next),iL(o,n),typeof window<"u"&&(window.removeEventListener("mouseup",p),window.removeEventListener("keyup",p),window.removeEventListener("mousedown",p),window.removeEventListener("keydown",p),window.removeEventListener("change",p))},o.observers.set(t,new nL(t,n)),n}function ES(e,t){t===void 0&&(t=!1);var r=FS.get(e.object);TS(r.value,e.object,e.patches,"",t),e.patches.length&&Cp(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function TS(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var a=yp(t),i=yp(e),p=!1,f=!1,m=i.length-1;m>=0;m--){var g=i[m],A=e[g];if(hp(t,g)&&!(t[g]===void 0&&A!==void 0&&Array.isArray(t)===!1)){var x=t[g];typeof A=="object"&&A!=null&&typeof x=="object"&&x!=null&&Array.isArray(A)===Array.isArray(x)?TS(A,x,r,n+"/"+on(g),o):A!==x&&(p=!0,o&&r.push({op:"test",path:n+"/"+on(g),value:qt(A)}),r.push({op:"replace",path:n+"/"+on(g),value:qt(x)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+on(g),value:qt(A)}),r.push({op:"remove",path:n+"/"+on(g)}),f=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),p=!0)}if(!(!f&&a.length==i.length))for(var m=0;m<a.length;m++){var g=a[m];!hp(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+on(g),value:qt(t[g])})}}}function uL(e,t,r){r===void 0&&(r=!1);var n=[];return TS(e,t,n,"",r),n}var bp=Object.assign({},IS,PS,{JsonPatchError:Kc,deepClone:qt,escapePathComponent:on,unescapePathComponent:Yc});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var kS=function(e,t){return kS=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},kS(e,t)};function an(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");kS(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function PR(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(A){i(A)}}function f(g){try{m(n.throw(g))}catch(A){i(A)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}function xp(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=p(0),i.throw=p(1),i.return=p(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(g){return f([m,g])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,m[0]&&(r=0)),r;)try{if(n=1,o&&(a=m[0]&2?o.return:m[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,m[1])).done)return a;switch(o=0,a&&(m=[m[0]&2,a.value]),m[0]){case 0:case 1:a=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!a||m[1]>a[0]&&m[1]<a[3])){r.label=m[1];break}if(m[0]===6&&r.label<a[1]){r.label=a[1],a=m;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(m);break}a[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(g){m=[6,g],o=0}finally{n=a=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}}function qn(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ki(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-->0)&&!(o=n.next()).done;)a.push(o.value)}catch(p){i={error:p}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a}function Xi(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function xa(e){return this instanceof xa?(this.v=e,this):new xa(e)}function kR(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,a=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),p("next"),p("throw"),p("return",i),o[Symbol.asyncIterator]=function(){return this},o;function i(h){return function(y){return Promise.resolve(y).then(h,A)}}function p(h,y){n[h]&&(o[h]=function(b){return new Promise(function(w,I){a.push([h,b,w,I])>1||f(h,b)})},y&&(o[h]=y(o[h])))}function f(h,y){try{m(n[h](y))}catch(b){x(a[0][3],b)}}function m(h){h.value instanceof xa?Promise.resolve(h.value.v).then(g,A):x(a[0][2],h)}function g(h){f("next",h)}function A(h){f("throw",h)}function x(h,y){h(y),a.shift(),a.length&&f(a[0][0],a[0][1])}}function OR(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof qn=="function"?qn(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=e[a]&&function(i){return new Promise(function(p,f){i=e[a](i),o(p,f,i.done,i.value)})}}function o(a,i,p,f){Promise.resolve(f).then(function(m){a({value:m,done:p})},i)}}d();c();l();u();function qe(e){return typeof e=="function"}d();c();l();u();d();c();l();u();d();c();l();u();function Zi(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var wp=Zi(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
34
34
  `+r.map(function(n,o){return o+1+") "+n.toString()}).join(`
35
35
  `):"",this.name="UnsubscriptionError",this.errors=r}});d();c();l();u();function Zc(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ji=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,a;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var p=qn(i),f=p.next();!f.done;f=p.next()){var m=f.value;m.remove(this)}}catch(b){t={error:b}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}else i.remove(this);var g=this.initialTeardown;if(qe(g))try{g()}catch(b){a=b instanceof wp?b.errors:[b]}var A=this._finalizers;if(A){this._finalizers=null;try{for(var x=qn(A),h=x.next();!h.done;h=x.next()){var y=h.value;try{_R(y)}catch(b){a=a??[],b instanceof wp?a=Xi(Xi([],Ki(a)),Ki(b.errors)):a.push(b)}}}catch(b){n={error:b}}finally{try{h&&!h.done&&(o=x.return)&&o.call(x)}finally{if(n)throw n.error}}}if(a)throw new wp(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)_R(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Zc(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Zc(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var OS=Ji.EMPTY;function Rp(e){return e instanceof Ji||e&&"closed"in e&&qe(e.remove)&&qe(e.add)&&qe(e.unsubscribe)}function _R(e){qe(e)?e():e.unsubscribe()}d();c();l();u();var _r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};d();c();l();u();d();c();l();u();var es={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=es.delegate;return o?.setTimeout?o.setTimeout.apply(o,Xi([e,t],Ki(r))):setTimeout.apply(void 0,Xi([e,t],Ki(r)))},clearTimeout:function(e){var t=es.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Ip(e){es.setTimeout(function(){var t=_r.onUnhandledError;if(t)t(e);else throw e})}d();c();l();u();function Jc(){}d();c();l();u();var NR=function(){return _S("C",void 0,void 0)}();function DR(e){return _S("E",void 0,e)}function qR(e){return _S("N",e,void 0)}function _S(e,t,r){return{kind:e,value:t,error:r}}d();c();l();u();var wa=null;function ts(e){if(_r.useDeprecatedSynchronousErrorHandling){var t=!wa;if(t&&(wa={errorThrown:!1,error:null}),e(),t){var r=wa,n=r.errorThrown,o=r.error;if(wa=null,n)throw o}}else e()}function MR(e){_r.useDeprecatedSynchronousErrorHandling&&wa&&(wa.errorThrown=!0,wa.error=e)}var eu=function(e){an(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Rp(r)&&r.add(n)):n.destination=fL,n}return t.create=function(r,n,o){return new Fp(r,n,o)},t.prototype.next=function(r){this.isStopped?DS(qR(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?DS(DR(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?DS(NR,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Ji);var lL=Function.prototype.bind;function NS(e,t){return lL.call(e,t)}var dL=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Ep(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Ep(n)}else Ep(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Ep(r)}},e}(),Fp=function(e){an(t,e);function t(r,n,o){var a=e.call(this)||this,i;if(qe(r)||!r)i={next:r??void 0,error:n??void 0,complete:o??void 0};else{var p;a&&_r.useDeprecatedNextContext?(p=Object.create(r),p.unsubscribe=function(){return a.unsubscribe()},i={next:r.next&&NS(r.next,p),error:r.error&&NS(r.error,p),complete:r.complete&&NS(r.complete,p)}):i=r}return a.destination=new dL(i),a}return t}(eu);function Ep(e){_r.useDeprecatedSynchronousErrorHandling?MR(e):Ip(e)}function pL(e){throw e}function DS(e,t){var r=_r.onStoppedNotification;r&&es.setTimeout(function(){return r(e,t)})}var fL={closed:!0,next:Jc,error:pL,complete:Jc};d();c();l();u();var rs=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();d();c();l();u();d();c();l();u();function ns(e){return e}function Tp(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return qS(e)}function qS(e){return e.length===0?ns:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var it=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,a=gL(t)?t:new Fp(t,r,n);return ts(function(){var i=o,p=i.operator,f=i.source;a.add(p?p.call(a,f):f?o._subscribe(a):o._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=VR(r),new r(function(o,a){var i=new Fp({next:function(p){try{t(p)}catch(f){a(f),i.unsubscribe()}},error:a,complete:o});n.subscribe(i)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[rs]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return qS(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=VR(t),new t(function(n,o){var a;r.subscribe(function(i){return a=i},function(i){return o(i)},function(){return n(a)})})},e.create=function(t){return new e(t)},e}();function VR(e){var t;return(t=e??_r.Promise)!==null&&t!==void 0?t:Promise}function mL(e){return e&&qe(e.next)&&qe(e.error)&&qe(e.complete)}function gL(e){return e&&e instanceof eu||mL(e)&&Rp(e)}d();c();l();u();function hL(e){return qe(e?.lift)}function yt(e){return function(t){if(hL(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}d();c();l();u();function wt(e,t,r,n,o){return new yL(e,t,r,n,o)}var yL=function(e){an(t,e);function t(r,n,o,a,i,p){var f=e.call(this,r)||this;return f.onFinalize=i,f.shouldUnsubscribe=p,f._next=n?function(m){try{n(m)}catch(g){r.error(g)}}:e.prototype._next,f._error=a?function(m){try{a(m)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,f._complete=o?function(){try{o()}catch(m){r.error(m)}finally{this.unsubscribe()}}:e.prototype._complete,f}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t}(eu);d();c();l();u();d();c();l();u();var jR=Zi(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var sn=function(e){an(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new LR(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new jR},t.prototype.next=function(r){var n=this;ts(function(){var o,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var i=qn(n.currentObservers),p=i.next();!p.done;p=i.next()){var f=p.value;f.next(r)}}catch(m){o={error:m}}finally{try{p&&!p.done&&(a=i.return)&&a.call(i)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;ts(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},t.prototype.complete=function(){var r=this;ts(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,a=o.hasError,i=o.isStopped,p=o.observers;return a||i?OS:(this.currentObservers=null,p.push(r),new Ji(function(){n.currentObservers=null,Zc(p,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,a=n.thrownError,i=n.isStopped;o?r.error(a):i&&r.complete()},t.prototype.asObservable=function(){var r=new it;return r.source=this,r},t.create=function(r,n){return new LR(r,n)},t}(it);var LR=function(e){an(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:OS},t}(sn);d();c();l();u();d();c();l();u();var MS={now:function(){return(MS.delegate||Date).now()},delegate:void 0};var Pp=function(e){an(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=MS);var a=e.call(this)||this;return a._bufferSize=r,a._windowTime=n,a._timestampProvider=o,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=n===1/0,a._bufferSize=Math.max(1,r),a._windowTime=Math.max(1,n),a}return t.prototype.next=function(r){var n=this,o=n.isStopped,a=n._buffer,i=n._infiniteTimeWindow,p=n._timestampProvider,f=n._windowTime;o||(a.push(r),!i&&a.push(p.now()+f)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,a=o._infiniteTimeWindow,i=o._buffer,p=i.slice(),f=0;f<p.length&&!r.closed;f+=a?1:2)r.next(p[f]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,a=r._buffer,i=r._infiniteTimeWindow,p=(i?1:2)*n;if(n<1/0&&p<a.length&&a.splice(0,a.length-p),!i){for(var f=o.now(),m=0,g=1;g<a.length&&a[g]<=f;g+=2)m=g;m&&a.splice(0,m+1)}},t}(sn);d();c();l();u();var kp=new it(function(e){return e.complete()});d();c();l();u();d();c();l();u();d();c();l();u();function UR(e){return e&&qe(e.schedule)}function SL(e){return e[e.length-1]}function QR(e){return UR(SL(e))?e.pop():void 0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Op=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};d();c();l();u();function _p(e){return qe(e?.then)}d();c();l();u();function Np(e){return qe(e[rs])}d();c();l();u();function Dp(e){return Symbol.asyncIterator&&qe(e?.[Symbol.asyncIterator])}d();c();l();u();function qp(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}d();c();l();u();d();c();l();u();function vL(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Mp=vL();function Vp(e){return qe(e?.[Mp])}d();c();l();u();function jp(e){return kR(this,arguments,function(){var r,n,o,a;return xp(this,function(i){switch(i.label){case 0:r=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,xa(r.read())];case 3:return n=i.sent(),o=n.value,a=n.done,a?[4,xa(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,xa(o)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Lp(e){return qe(e?.getReader)}function Rt(e){if(e instanceof it)return e;if(e!=null){if(Np(e))return AL(e);if(Op(e))return CL(e);if(_p(e))return bL(e);if(Dp(e))return BR(e);if(Vp(e))return xL(e);if(Lp(e))return wL(e)}throw qp(e)}function AL(e){return new it(function(t){var r=e[rs]();if(qe(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function CL(e){return new it(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function bL(e){return new it(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Ip)})}function xL(e){return new it(function(t){var r,n;try{for(var o=qn(e),a=o.next();!a.done;a=o.next()){var i=a.value;if(t.next(i),t.closed)return}}catch(p){r={error:p}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function BR(e){return new it(function(t){RL(e,t).catch(function(r){return t.error(r)})})}function wL(e){return BR(jp(e))}function RL(e,t){var r,n,o,a;return PR(this,void 0,void 0,function(){var i,p;return xp(this,function(f){switch(f.label){case 0:f.trys.push([0,5,6,11]),r=OR(e),f.label=1;case 1:return[4,r.next()];case 2:if(n=f.sent(),!!n.done)return[3,4];if(i=n.value,t.next(i),t.closed)return[2];f.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return p=f.sent(),o={error:p},[3,11];case 6:return f.trys.push([6,,9,10]),n&&!n.done&&(a=r.return)?[4,a.call(r)]:[3,8];case 7:f.sent(),f.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}d();c();l();u();d();c();l();u();function xr(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var a=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(a),!o)return a}function Up(e,t){return t===void 0&&(t=0),yt(function(r,n){r.subscribe(wt(n,function(o){return xr(n,e,function(){return n.next(o)},t)},function(){return xr(n,e,function(){return n.complete()},t)},function(o){return xr(n,e,function(){return n.error(o)},t)}))})}d();c();l();u();function Qp(e,t){return t===void 0&&(t=0),yt(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function GR(e,t){return Rt(e).pipe(Qp(t),Up(t))}d();c();l();u();function $R(e,t){return Rt(e).pipe(Qp(t),Up(t))}d();c();l();u();function HR(e,t){return new it(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}d();c();l();u();function zR(e,t){return new it(function(r){var n;return xr(r,t,function(){n=e[Mp](),xr(r,t,function(){var o,a,i;try{o=n.next(),a=o.value,i=o.done}catch(p){r.error(p);return}i?r.complete():r.next(a)},0,!0)}),function(){return qe(n?.return)&&n.return()}})}d();c();l();u();function Bp(e,t){if(!e)throw new Error("Iterable cannot be null");return new it(function(r){xr(r,t,function(){var n=e[Symbol.asyncIterator]();xr(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}d();c();l();u();function WR(e,t){return Bp(jp(e),t)}function YR(e,t){if(e!=null){if(Np(e))return GR(e,t);if(Op(e))return HR(e,t);if(_p(e))return $R(e,t);if(Dp(e))return Bp(e,t);if(Vp(e))return zR(e,t);if(Lp(e))return WR(e,t)}throw qp(e)}function Ra(e,t){return t?YR(e,t):Rt(e)}function lt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=QR(e);return Ra(e,r)}d();c();l();u();function st(e,t){var r=qe(e)?e:function(){return e},n=function(o){return o.error(r())};return new it(t?function(o){return t.schedule(n,0,o)}:n)}d();c();l();u();d();c();l();u();var KR=Zi(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function Gp(e,t){var r=typeof t=="object";return new Promise(function(n,o){var a=!1,i;e.subscribe({next:function(p){i=p,a=!0},error:o,complete:function(){a?n(i):r?n(t.defaultValue):o(new KR)}})})}d();c();l();u();function Ia(e,t){return yt(function(r,n){var o=0;r.subscribe(wt(n,function(a){n.next(e.call(t,a,o++))}))})}d();c();l();u();d();c();l();u();d();c();l();u();function XR(e,t,r,n,o,a,i,p){var f=[],m=0,g=0,A=!1,x=function(){A&&!f.length&&!m&&t.complete()},h=function(b){return m<n?y(b):f.push(b)},y=function(b){a&&t.next(b),m++;var w=!1;Rt(r(b,g++)).subscribe(wt(t,function(I){o?.(I),a?h(I):t.next(I)},function(){w=!0},void 0,function(){if(w)try{m--;for(var I=function(){var F=f.shift();i?xr(t,i,function(){return y(F)}):y(F)};f.length&&m<n;)I();x()}catch(F){t.error(F)}}))};return e.subscribe(wt(t,h,function(){A=!0,x()})),function(){p?.()}}function rr(e,t,r){return r===void 0&&(r=1/0),qe(t)?rr(function(n,o){return Ia(function(a,i){return t(n,a,o,i)})(Rt(e(n,o)))},r):(typeof t=="number"&&(r=t),yt(function(n,o){return XR(n,o,e,r)}))}function VS(e){return e===void 0&&(e=1/0),rr(ns,e)}d();c();l();u();function $p(e){return new it(function(t){Rt(e()).subscribe(t)})}d();c();l();u();function tu(e){return yt(function(t,r){var n=null,o=!1,a;n=t.subscribe(wt(r,void 0,void 0,function(i){a=Rt(e(i,tu(e)(t))),n?(n.unsubscribe(),n=null,a.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,a.subscribe(r))})}d();c();l();u();function Hp(e,t){return qe(t)?rr(e,t,1):rr(e,1)}d();c();l();u();function jS(e){return yt(function(t,r){var n=!1;t.subscribe(wt(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}d();c();l();u();function Ea(e){return yt(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}d();c();l();u();function LS(e,t){return yt(function(r,n){var o=null,a=0,i=!1,p=function(){return i&&!o&&n.complete()};r.subscribe(wt(n,function(f){o?.unsubscribe();var m=0,g=a++;Rt(e(f,g)).subscribe(o=wt(n,function(A){return n.next(t?t(f,A,g,m++):A)},function(){o=null,p()}))},function(){i=!0,p()}))})}d();c();l();u();function zp(e){return yt(function(t,r){Rt(e).subscribe(wt(r,function(){return r.complete()},Jc)),!r.closed&&t.subscribe(r)})}d();c();l();u();function US(e,t,r){var n=qe(e)||t||r?{next:e,error:t,complete:r}:e;return n?yt(function(o,a){var i;(i=n.subscribe)===null||i===void 0||i.call(n);var p=!0;o.subscribe(wt(a,function(f){var m;(m=n.next)===null||m===void 0||m.call(n,f),a.next(f)},function(){var f;p=!1,(f=n.complete)===null||f===void 0||f.call(n),a.complete()},function(f){var m;p=!1,(m=n.error)===null||m===void 0||m.call(n,f),a.error(f)},function(){var f,m;p&&((f=n.unsubscribe)===null||f===void 0||f.call(n)),(m=n.finalize)===null||m===void 0||m.call(n)}))}):ns}d();c();l();u();d();c();l();u();function ZR(e){return` \r
@@ -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.43.1';
79
+ window.coveoQuanticVersion = '3.43.2';