@coveo/quantic 3.44.1 → 3.44.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.
- package/force-app/main/default/classes/OrganizationEndpointsTest.cls +71 -15
- package/force-app/main/default/classes/RecommendationsControllerTest.cls +1 -1
- package/force-app/main/default/lwc/quanticTabBar/quanticTabBar.js +148 -125
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +16 -16
- package/force-app/main/default/staticresources/coveoheadless/headless.js +17 -17
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +16 -16
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +16 -16
- package/package.json +33 -31
- package/force-app/main/default/lwc/quanticAriaLive/__tests__/quanticAriaLive.test.js +0 -106
- package/force-app/main/default/lwc/quanticBreadcrumbManager/__tests__/quanticBreadcrumbManager.test.js +0 -752
- package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/data.ts +0 -130
- package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/fixture.ts +0 -87
- package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/pageObject.ts +0 -282
- package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/quanticBreadcrumbManager.e2e.ts +0 -208
- package/force-app/main/default/lwc/quanticCarousel/__tests__/quanticCarousel.test.js +0 -262
- package/force-app/main/default/lwc/quanticCaseClassification/__tests__/quanticCaseClassification.test.js +0 -819
- package/force-app/main/default/lwc/quanticCaseClassification/e2e/data.ts +0 -23
- package/force-app/main/default/lwc/quanticCaseClassification/e2e/fixture.ts +0 -51
- package/force-app/main/default/lwc/quanticCaseClassification/e2e/pageObject.ts +0 -152
- package/force-app/main/default/lwc/quanticCaseClassification/e2e/quanticCaseClassification.e2e.ts +0 -269
- package/force-app/main/default/lwc/quanticCategoryFacet/__tests__/quanticCategoryFacet.test.js +0 -1183
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/data.ts +0 -91
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/fixture.ts +0 -79
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/pageObject.ts +0 -55
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/quanticCategoryFacet.e2e.ts +0 -219
- package/force-app/main/default/lwc/quanticCitation/__tests__/quanticCitation.test.js +0 -581
- package/force-app/main/default/lwc/quanticColoredResultBadge/__tests__/quanticColoredResultBadge.test.js +0 -212
- package/force-app/main/default/lwc/quanticDateFacet/__tests__/quanticDateFacet.test.js +0 -688
- package/force-app/main/default/lwc/quanticDateFacet/e2e/data.ts +0 -44
- package/force-app/main/default/lwc/quanticDateFacet/e2e/fixture.ts +0 -72
- package/force-app/main/default/lwc/quanticDateFacet/e2e/pageObject.ts +0 -27
- package/force-app/main/default/lwc/quanticDateFacet/e2e/quanticDateFacet.e2e.ts +0 -167
- package/force-app/main/default/lwc/quanticDidYouMean/__tests__/quanticDidYouMean.test.js +0 -348
- package/force-app/main/default/lwc/quanticDidYouMean/e2e/data.ts +0 -48
- package/force-app/main/default/lwc/quanticDidYouMean/e2e/fixture.ts +0 -84
- package/force-app/main/default/lwc/quanticDidYouMean/e2e/pageObject.ts +0 -173
- package/force-app/main/default/lwc/quanticDidYouMean/e2e/quanticDidYouMean.e2e.ts +0 -219
- package/force-app/main/default/lwc/quanticDocumentSuggestion/__tests__/quanticDocumentSuggestion.test.js +0 -404
- package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/fixture.ts +0 -38
- package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/pageObject.ts +0 -52
- package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/quanticDocumentSuggestion.e2e.ts +0 -102
- package/force-app/main/default/lwc/quanticFacet/__tests__/quanticFacet.test.js +0 -1105
- package/force-app/main/default/lwc/quanticFacet/e2e/data.ts +0 -62
- package/force-app/main/default/lwc/quanticFacet/e2e/fixture.ts +0 -78
- package/force-app/main/default/lwc/quanticFacet/e2e/pageObject.ts +0 -67
- package/force-app/main/default/lwc/quanticFacet/e2e/quanticFacet.e2e.ts +0 -242
- package/force-app/main/default/lwc/quanticFacetCaption/__tests__/quanticFacetCaption.test.js +0 -28
- package/force-app/main/default/lwc/quanticFacetManager/__tests__/quanticFacetManager.test.js +0 -178
- package/force-app/main/default/lwc/quanticFacetManager/e2e/data.ts +0 -59
- package/force-app/main/default/lwc/quanticFacetManager/e2e/fixture.ts +0 -75
- package/force-app/main/default/lwc/quanticFacetManager/e2e/pageObject.ts +0 -23
- package/force-app/main/default/lwc/quanticFacetManager/e2e/quanticFacetManager.e2e.ts +0 -82
- package/force-app/main/default/lwc/quanticFeedback/__tests__/quanticFeedback.test.js +0 -403
- package/force-app/main/default/lwc/quanticFeedbackModal/__tests__/quanticFeedbackModal.test.js +0 -448
- package/force-app/main/default/lwc/quanticFeedbackModalQna/__tests__/quanticFeedbackModalQna.test.js +0 -298
- package/force-app/main/default/lwc/quanticFoldedResultList/__tests__/quanticFoldedResultList.test.js +0 -323
- package/force-app/main/default/lwc/quanticFoldedResultList/e2e/fixture.ts +0 -74
- package/force-app/main/default/lwc/quanticFoldedResultList/e2e/pageObject.ts +0 -81
- package/force-app/main/default/lwc/quanticFoldedResultList/e2e/quanticFoldedResultList.e2e.ts +0 -69
- package/force-app/main/default/lwc/quanticGeneratedAnswer/__tests__/quanticGeneratedAnswer.test.js +0 -1575
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/agentData.ts +0 -279
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/data.ts +0 -56
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/fixture-agent.ts +0 -77
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/fixture.ts +0 -194
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/pageObject.ts +0 -599
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/quanticGeneratedAnswer.e2e.ts +0 -333
- package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/quanticGeneratedAnswerAgent.e2e.ts +0 -298
- package/force-app/main/default/lwc/quanticGeneratedAnswerBody/__tests__/quanticGeneratedAnswerBody.test.js +0 -418
- package/force-app/main/default/lwc/quanticGeneratedAnswerContent/__tests__/quanticGeneratedAnswerContent.test.js +0 -447
- package/force-app/main/default/lwc/quanticGeneratedAnswerCopyToClipboard/__tests__/quanticGeneratedAnswerCopyToClipboard.test.js +0 -129
- package/force-app/main/default/lwc/quanticGeneratedAnswerFollowUpInput/__tests__/quanticGeneratedAnswerFollowUpInput.test.js +0 -466
- package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/__tests__/quanticGeneratedAnswerStreamOfThought.test.js +0 -402
- package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/__tests__/stepsUtils.test.js +0 -118
- package/force-app/main/default/lwc/quanticGeneratedAnswerThread/__tests__/quanticGeneratedAnswerThread.test.js +0 -285
- package/force-app/main/default/lwc/quanticHeading/__tests__/quanticHeading.test.js +0 -71
- package/force-app/main/default/lwc/quanticHeadlessLoader/__tests__/quanticHeadlessLoader.test.js +0 -651
- package/force-app/main/default/lwc/quanticInsightInterface/__tests__/quanticInsightInterface.test.js +0 -194
- package/force-app/main/default/lwc/quanticInsightSummary/__tests__/quanticInsightSummary.test.js +0 -230
- package/force-app/main/default/lwc/quanticModal/__tests__/quanticModal.test.js +0 -205
- package/force-app/main/default/lwc/quanticNotifications/__tests__/quanticNotifications.test.js +0 -309
- package/force-app/main/default/lwc/quanticNotifications/e2e/fixture.ts +0 -62
- package/force-app/main/default/lwc/quanticNotifications/e2e/pageObject.ts +0 -55
- package/force-app/main/default/lwc/quanticNotifications/e2e/quanticNotifications.e2e.ts +0 -47
- package/force-app/main/default/lwc/quanticNumericFacet/__tests__/quanticNumericFacet.test.js +0 -953
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/data.ts +0 -48
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/fixture.ts +0 -75
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/pageObject.ts +0 -59
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/quanticNumericFacet.e2e.ts +0 -186
- package/force-app/main/default/lwc/quanticPager/__tests__/quanticPager.test.js +0 -430
- package/force-app/main/default/lwc/quanticPager/e2e/fixture.ts +0 -65
- package/force-app/main/default/lwc/quanticPager/e2e/pageObject.ts +0 -69
- package/force-app/main/default/lwc/quanticPager/e2e/quanticPager.e2e.ts +0 -106
- package/force-app/main/default/lwc/quanticPlaceholder/__tests__/quanticPlaceholder.test.js +0 -47
- package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/data/defaultTestCase.json +0 -13
- package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/data/youtubeTestCase.json +0 -14
- package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/quanticQuickviewContent.test.js +0 -82
- package/force-app/main/default/lwc/quanticRadioButtonsGroup/__tests__/quanticRadioButtonsGroup.test.js +0 -273
- package/force-app/main/default/lwc/quanticRecentQueriesList/__tests__/quanticRecentQueriesList.test.js +0 -448
- package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/fixture.ts +0 -43
- package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/pageObject.ts +0 -55
- package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/quanticRecentQueriesList.e2e.ts +0 -93
- package/force-app/main/default/lwc/quanticRecentResultsList/__tests__/quanticRecentResultsList.test.js +0 -516
- package/force-app/main/default/lwc/quanticRecentResultsList/e2e/fixture.ts +0 -43
- package/force-app/main/default/lwc/quanticRecentResultsList/e2e/pageObject.ts +0 -61
- package/force-app/main/default/lwc/quanticRecentResultsList/e2e/quanticRecentResultsList.e2e.ts +0 -48
- package/force-app/main/default/lwc/quanticRecommendationList/__tests__/quanticRecommendationList.test.js +0 -491
- package/force-app/main/default/lwc/quanticRecommendationList/e2e/fixture.ts +0 -36
- package/force-app/main/default/lwc/quanticRecommendationList/e2e/pageObject.ts +0 -52
- package/force-app/main/default/lwc/quanticRecommendationList/e2e/quanticRecommendationList.e2e.ts +0 -53
- package/force-app/main/default/lwc/quanticRefineModalContent/__tests__/quanticRefineModalContent.test.js +0 -747
- package/force-app/main/default/lwc/quanticRefineToggle/__tests__/quanticRefineToggle.test.js +0 -544
- package/force-app/main/default/lwc/quanticResultAction/__tests__/quanticResultAction.test.js +0 -262
- package/force-app/main/default/lwc/quanticResultActionBar/__tests__/quanticResultActionBar.test.js +0 -141
- package/force-app/main/default/lwc/quanticResultChildren/__tests__/quanticResultChildren.test.js +0 -340
- package/force-app/main/default/lwc/quanticResultCopyToClipboard/__tests__/quanticResultCopyToClipboard.test.js +0 -300
- package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/fixture.ts +0 -49
- package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/pageObject.ts +0 -49
- package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/quanticResultCopyToClipboard.e2e.ts +0 -40
- package/force-app/main/default/lwc/quanticResultDate/__tests__/quanticResultDate.test.js +0 -144
- package/force-app/main/default/lwc/quanticResultField/__tests__/quanticResultField.test.js +0 -120
- package/force-app/main/default/lwc/quanticResultHighlightedTextField/__tests__/quanticResultHighlightedTextField.test.js +0 -209
- package/force-app/main/default/lwc/quanticResultLink/__tests__/quanticResultLink.test.js +0 -302
- package/force-app/main/default/lwc/quanticResultList/__tests__/quanticResultList.test.js +0 -342
- package/force-app/main/default/lwc/quanticResultList/e2e/fixture.ts +0 -70
- package/force-app/main/default/lwc/quanticResultList/e2e/pageObject.ts +0 -81
- package/force-app/main/default/lwc/quanticResultList/e2e/quanticResultList.e2e.ts +0 -69
- package/force-app/main/default/lwc/quanticResultMultiValueText/__tests__/quanticResultMultiValueText.test.js +0 -235
- package/force-app/main/default/lwc/quanticResultNumber/__tests__/quanticResultNumber.test.js +0 -144
- package/force-app/main/default/lwc/quanticResultPrintableUri/__tests__/quanticResultPrintableUri.test.js +0 -324
- package/force-app/main/default/lwc/quanticResultQuickview/__tests__/quanticResultQuickview.test.js +0 -308
- package/force-app/main/default/lwc/quanticResultQuickview/e2e/fixture.ts +0 -85
- package/force-app/main/default/lwc/quanticResultQuickview/e2e/pageObject.ts +0 -38
- package/force-app/main/default/lwc/quanticResultQuickview/e2e/quanticResultQuickView.e2e.ts +0 -66
- package/force-app/main/default/lwc/quanticResultTemplate/__tests__/quanticResultTemplate.test.js +0 -90
- package/force-app/main/default/lwc/quanticResultText/__tests__/quanticResultText.test.js +0 -155
- package/force-app/main/default/lwc/quanticResultsPerPage/__tests__/quanticResultsPerPage.test.js +0 -464
- package/force-app/main/default/lwc/quanticResultsPerPage/e2e/fixture.ts +0 -78
- package/force-app/main/default/lwc/quanticResultsPerPage/e2e/pageObject.ts +0 -85
- package/force-app/main/default/lwc/quanticResultsPerPage/e2e/quanticResultsPerPage.e2e.ts +0 -97
- package/force-app/main/default/lwc/quanticSearchBox/__tests__/quanticSearchBox.test.js +0 -487
- package/force-app/main/default/lwc/quanticSearchBox/e2e/fixture.ts +0 -86
- package/force-app/main/default/lwc/quanticSearchBox/e2e/pageObject.ts +0 -45
- package/force-app/main/default/lwc/quanticSearchBox/e2e/quanticSearchBox.e2e.ts +0 -159
- package/force-app/main/default/lwc/quanticSearchBoxInput/__tests__/quanticSearchBoxInput.test.js +0 -743
- package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/__tests__/quanticSearchBoxSuggestionsList.test.js +0 -571
- package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/fixture.ts +0 -113
- package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/pageObject.ts +0 -113
- package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/quanticSearchBoxSuggestionsList.e2e.ts +0 -282
- package/force-app/main/default/lwc/quanticSmartSnippet/__tests__/quanticSmartSnippet.test.js +0 -341
- package/force-app/main/default/lwc/quanticSmartSnippet/e2e/data.ts +0 -21
- package/force-app/main/default/lwc/quanticSmartSnippet/e2e/fixture.ts +0 -93
- package/force-app/main/default/lwc/quanticSmartSnippet/e2e/pageObject.ts +0 -196
- package/force-app/main/default/lwc/quanticSmartSnippet/e2e/quanticSmartSnippet.e2e.ts +0 -168
- package/force-app/main/default/lwc/quanticSmartSnippetAnswer/__tests__/quanticSmartSnippetAnswer.test.js +0 -126
- package/force-app/main/default/lwc/quanticSmartSnippetSource/__tests__/quanticSmartSnippetSource.test.js +0 -290
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/__tests__/quanticSmartSnippetSuggestions.test.js +0 -329
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/data.ts +0 -31
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/fixture.ts +0 -95
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/pageObject.ts +0 -160
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/quanticSmartSnippetSuggestions.e2e.ts +0 -127
- package/force-app/main/default/lwc/quanticSort/__tests__/quanticSort.test.js +0 -416
- package/force-app/main/default/lwc/quanticSort/e2e/fixture.ts +0 -62
- package/force-app/main/default/lwc/quanticSort/e2e/pageObject.ts +0 -100
- package/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts +0 -86
- package/force-app/main/default/lwc/quanticSourceCitations/__tests__/quanticSourceCitations.test.js +0 -156
- package/force-app/main/default/lwc/quanticStandaloneSearchBox/__tests__/quanticStandaloneSearchBox.test.js +0 -387
- package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/fixture.ts +0 -54
- package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/pageObject.ts +0 -54
- package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/quanticStandaloneSearchBox.e2e.ts +0 -72
- package/force-app/main/default/lwc/quanticStatefulButton/__tests__/quanticStatefulButton.test.js +0 -222
- package/force-app/main/default/lwc/quanticSummary/__tests__/quanticSummary.test.js +0 -244
- package/force-app/main/default/lwc/quanticTab/__tests__/quanticTab.test.js +0 -333
- package/force-app/main/default/lwc/quanticTab/e2e/fixture.ts +0 -60
- package/force-app/main/default/lwc/quanticTab/e2e/pageObject.ts +0 -68
- package/force-app/main/default/lwc/quanticTab/e2e/quanticTab.e2e.ts +0 -72
- package/force-app/main/default/lwc/quanticTabBar/__tests__/quanticTabBar.test.js +0 -331
- package/force-app/main/default/lwc/quanticTabBar/e2e/fixture.ts +0 -65
- package/force-app/main/default/lwc/quanticTabBar/e2e/pageObject.ts +0 -80
- package/force-app/main/default/lwc/quanticTabBar/e2e/quanticTabBar.e2e.ts +0 -172
- package/force-app/main/default/lwc/quanticThreadItem/__tests__/quanticThreadItem.test.js +0 -314
- package/force-app/main/default/lwc/quanticTimeframeFacet/__tests__/quanticTimeframeFacet.test.js +0 -1059
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/data.ts +0 -66
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/fixture.ts +0 -74
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/pageObject.ts +0 -43
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/quanticTimeframeFacet.e2e.ts +0 -184
- package/force-app/main/default/lwc/quanticTooltip/__tests__/quanticTooltip.test.js +0 -107
- package/force-app/main/default/lwc/quanticUserAction/__tests__/quanticUserAction.test.js +0 -427
- package/force-app/main/default/lwc/quanticUserActionsSession/__tests__/quanticUserActionsSession.test.js +0 -269
- package/force-app/main/default/lwc/quanticUserActionsTimeline/__tests__/data/userActionsState.json +0 -89
- package/force-app/main/default/lwc/quanticUserActionsTimeline/__tests__/quanticUserActionsTimeline.test.js +0 -511
- package/force-app/main/default/lwc/quanticUserActionsToggle/__tests__/quanticUserActionsToggle.test.js +0 -229
- package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/data.ts +0 -32
- package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/fixture.ts +0 -32
- package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/pageObject.ts +0 -71
- package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/quanticUserActionsToggle.e2e.ts +0 -39
- package/force-app/main/default/lwc/quanticUtils/__tests__/accessibilityUtils.test.js +0 -214
- package/force-app/main/default/lwc/quanticUtils/__tests__/citationAnchoringUtils.test.js +0 -84
- package/force-app/main/default/lwc/quanticUtils/__tests__/facetDependenciesUtils.test.js +0 -92
- package/force-app/main/default/lwc/quanticUtils/__tests__/facetStoreUtils.test.js +0 -86
- package/force-app/main/default/lwc/quanticUtils/__tests__/markdownUtils.test.js +0 -109
- package/force-app/main/default/lwc/quanticUtils/__tests__/quanticUtils.test.js +0 -233
- package/force-app/main/default/lwc/quanticUtils/__tests__/timeAndDateUtils.test.js +0 -22
- package/force-app/main/default/lwc/quanticViewedByCustomerBadge/__tests__/quanticViewedByCustomerBadge.test.js +0 -131
|
@@ -14,39 +14,39 @@ function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){
|
|
|
14
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
|
-
*/(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadless",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadless"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var
|
|
18
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,i=!0,p=!1;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return i=f.done,f},e:function(f){p=!0,a=f},f:function(){try{i||r.return==null||r.return()}finally{if(p)throw a}}}}function _y(){return _y=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=Y0(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},_y.apply(null,arguments)}function Ti(e){return Ti=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ti(e)}function W0(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dy(e,t)}function XC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(XC=function(){return!!e})()}function K0(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return H0(e)}function Dy(e,t){return Dy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Dy(e,t)}function Y0(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Ti(e))!==null;);return e}function J0(e,t,r,n){var o=_y(Ti(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(a){return o.apply(r,a)}:o}function X0(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Z0(e){var t=X0(e,"string");return typeof t=="symbol"?t:t+""}function eN(e,t){if(e){if(typeof e=="string")return WC(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?WC(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function tN(e){var t;try{t=new Event("abort")}catch{typeof document<"u"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}return t.reason=e,t}function rN(e){if(e===void 0)if(typeof document>"u")e=new Error("This operation was aborted"),e.name="AbortError";else try{e=new DOMException("signal is aborted without reason"),Object.defineProperty(e,"name",{value:"AbortError"})}catch{e=new Error("This operation was aborted"),e.name="AbortError"}return e}var JC=function(){function e(){qy(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return My(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],a=0,i=o.length;a<i;a++)if(o[a].callback===n){o.splice(a,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],a=o.slice(),i=function(){var g=a[p];try{g.callback.call(n,r)}catch(y){Promise.resolve().then(function(){throw y})}g.options&&g.options.once&&n.removeEventListener(r.type,g.callback)},p=0,f=a.length;p<f;p++)i();return!r.defaultPrevented}}}])}(),jy=function(e){function t(){var r;return qy(this,t),r=z0(this,t),r.listeners||JC.call(r),Object.defineProperty(r,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(r,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(r,"reason",{value:void 0,writable:!0,configurable:!0}),r}return W0(t,e),My(t,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(n){n.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,n)),J0(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,a=o===void 0?"Aborted":o;if(n)throw a}}],[{key:"timeout",value:function(n){var o=new dd;return setTimeout(function(){return o.abort(new DOMException("This signal is timeout in ".concat(n,"ms"),"TimeoutError"))},n),o.signal}},{key:"any",value:function(n){var o=new dd;function a(){o.abort(this.reason),i()}function i(){var g=YC(n),y;try{for(g.s();!(y=g.n()).done;){var x=y.value;x.removeEventListener("abort",a)}}catch(v){g.e(v)}finally{g.f()}}var p=YC(n),f;try{for(p.s();!(f=p.n()).done;){var m=f.value;if(m.aborted){o.abort(m.reason);break}else m.addEventListener("abort",a)}}catch(g){p.e(g)}finally{p.f()}return o.signal}}])}(JC),dd=function(){function e(){qy(this,e),Object.defineProperty(this,"signal",{value:new jy,writable:!0,configurable:!0})}return My(e,[{key:"abort",value:function(r){var n=rN(r),o=tN(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(dd.prototype[Symbol.toStringTag]="AbortController",jy.prototype[Symbol.toStringTag]="AbortSignal");function nN(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function oN(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,a=t.AbortController,i=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,p=i===void 0?!1:i;if(!nN({fetch:r,Request:o,AbortController:a,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:p}))return{fetch:r,Request:f};var f=o;(f&&!f.prototype.hasOwnProperty("signal")||p)&&(f=function(x,v){var C;v&&v.signal&&(C=v.signal,delete v.signal);var b=new o(x,v);return C&&Object.defineProperty(b,"signal",{writable:!1,enumerable:!1,configurable:!0,value:C}),b},f.prototype=o.prototype);var m=r,g=function(x,v){var C=f&&f.prototype.isPrototypeOf(x)?x.signal:v?v.signal:void 0;if(C){var b;try{b=new DOMException("Aborted","AbortError")}catch{b=new Error("Aborted"),b.name="AbortError"}if(C.aborted)return Promise.reject(b);var w=new Promise(function(F,I){C.addEventListener("abort",function(){return I(b)},{once:!0})});return v&&v.signal&&delete v.signal,Promise.race([w,m(x,v)])}return m(x,v)};return{fetch:g,Request:f}}Rl.AbortController=dd;Rl.AbortSignal=jy;Rl.abortableFetch=oN});var ZC,s,S,u=Ii(()=>{"use strict";ZC=Vr(Vy(),1),s=Vr(Vy(),1),{fetch:S}=(0,ZC.abortableFetch)({fetch})});function Ly(e){return typeof e!="string"||e in{}}function Uy(){return Object.create(null)}function ex(e){return typeof e=="string"&&!!e.trim()}function Qy(e,t){var r=e.split(";").filter(ex),n=r.shift();if(!n)return null;var o=aN(n),a=o.name,i=o.value;if(t=t?Object.assign({},pd,t):pd,Ly(a))return null;try{i=t.decodeValues?decodeURIComponent(i):i}catch(f){console.error("set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",f)}var p=Uy();return p.name=a,p.value=i,r.forEach(function(f){var m=f.split("="),g=m.shift().trim().toLowerCase();if(!Ly(g)){var y=m.join("=").trim();if(g==="expires")p.expires=new Date(y);else if(g==="max-age"){var x=parseInt(y,10);Number.isNaN(x)||(p.maxAge=x)}else g==="secure"?p.secure=!0:g==="httponly"?p.httpOnly=!0:g==="samesite"?p.sameSite=y:g==="partitioned"?p.partitioned=!0:g&&(p[g]=y)}}),p}function aN(e){var t="",r="",n=e.split("=");return n.length>1?(t=n.shift(),r=n.join("=")):r=e,{name:t,value:r}}function Pi(e,t){if(t=t?Object.assign({},pd,t):pd,!e)return t.map?Uy():[];if(e.headers)if(typeof e.headers.getSetCookie=="function")e=e.headers.getSetCookie();else if(e.headers["set-cookie"])e=e.headers["set-cookie"];else{var r=e.headers[Object.keys(e.headers).find(function(i){return i.toLowerCase()==="set-cookie"})];!r&&e.headers.cookie&&!t.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),e=r}var n=t.split,o=Array.isArray(e);if(n==="auto"&&(n=!o),o||(e=[e]),e=e.filter(ex),n&&(e=e.map(fd).flat()),t.map){var a=Uy();return e.reduce(function(i,p){var f=Qy(p,t);return f&&!Ly(f.name)&&(i[f.name]=f),i},a)}else return e.map(function(i){return Qy(i,t)}).filter(Boolean)}function fd(e){if(Array.isArray(e))return e;if(typeof e!="string")return[];var t=[],r=0,n,o,a,i,p;function f(){for(;r<e.length&&/\s/.test(e.charAt(r));)r+=1;return r<e.length}function m(){return o=e.charAt(r),o!=="="&&o!==";"&&o!==","}for(;r<e.length;){for(n=r,p=!1;f();)if(o=e.charAt(r),o===","){for(a=r,r+=1,f(),i=r;r<e.length&&m();)r+=1;r<e.length&&e.charAt(r)==="="?(p=!0,r=i,t.push(e.substring(n,a)),n=r):r=a+1}else r+=1;(!p||r>=e.length)&&t.push(e.substring(n,e.length))}return t}var pd,tx=Ii(()=>{"use strict";d();c();u();l();pd={decodeValues:!0,map:!1,silent:!1,split:"auto"};Pi.parseSetCookie=Pi;Pi.parse=Pi;Pi.parseString=Qy;Pi.splitCookiesString=fd});function Fl(e){if(iN.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function By(e){return e.replace(sN,"")}function El(e){if(typeof e!="string"||e.length===0)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>127||!cN(r))return!1}return!0}function cN(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function nx(e){if(typeof e!="string"||e.trim()!==e)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r===0||r===10||r===13)return!1}return!0}var iN,rx,sN,ox,ki,Gy,ax,A,sx=Ii(()=>{"use strict";d();c();u();l();tx();iN=/[^a-z0-9\-#$%&'*+.^_`|~]/i;rx=[`
|
|
19
|
-
`,"\r","\t"," "],sN=new RegExp(`(^[${rx.join("")}]|$[${rx.join("")}])`,"g");ki=Symbol("normalizedHeaders"),Gy=Symbol("rawHeaderNames"),ax=", ",A=class ix{constructor(t){this[ki]={},this[Gy]=new Map,this[ox]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor?.name)||t instanceof ix||typeof h.Headers<"u"&&t instanceof h.Headers?t.forEach((r,n)=>{this.append(n,r)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(ax):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(ax):n)})}[(ox=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*keys(){for(let[t]of this.entries())yield t}*values(){for(let[,t]of this.entries())yield t}*entries(){let t=Object.keys(this[ki]).sort((r,n)=>r.localeCompare(n));for(let r of t)if(r==="set-cookie")for(let n of this.getSetCookie())yield[r,n];else yield[r,this.get(r)]}has(t){if(!El(t))throw new TypeError(`Invalid header name "${t}"`);return this[ki].hasOwnProperty(Fl(t))}get(t){if(!El(t))throw TypeError(`Invalid header name "${t}"`);return this[ki][Fl(t)]??null}set(t,r){if(!El(t)||!nx(r))return;let n=Fl(t),o=By(r);this[ki][n]=By(o),this[Gy].set(n,t)}append(t,r){if(!El(t)||!nx(r))return;let n=Fl(t),o=By(r),a=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,a)}delete(t){if(!El(t)||!this.has(t))return;let r=Fl(t);delete this[ki][r],this[Gy].delete(r)}forEach(t,r){for(let[n,o]of this.entries())t.call(r,o,n,this)}getSetCookie(){let t=this.get("set-cookie");return t===null?[]:t===""?[""]:fd(t)}}});var d=Ii(()=>{"use strict";sx()});var Ax=It(Ol=>{"use strict";d();c();u();l();var xd=Ol&&Ol.__assign||function(){return xd=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},xd.apply(this,arguments)};Object.defineProperty(Ol,"__esModule",{value:!0});var TN={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function PN(e){var t=xd(xd({},TN),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}Ol.getSanitizedOptions=PN});var Cx=It(Zy=>{"use strict";d();c();u();l();Object.defineProperty(Zy,"__esModule",{value:!0});function kN(e){var t=Math.random()*e;return Math.round(t)}Zy.fullJitter=kN});var xx=It(eS=>{"use strict";d();c();u();l();Object.defineProperty(eS,"__esModule",{value:!0});function ON(e){return e}eS.noJitter=ON});var bx=It(tS=>{"use strict";d();c();u();l();Object.defineProperty(tS,"__esModule",{value:!0});var NN=Cx(),_N=xx();function DN(e){return e.jitter==="full"?NN.fullJitter:_N.noJitter}tS.JitterFactory=DN});var nS=It(rS=>{"use strict";d();c();u();l();Object.defineProperty(rS,"__esModule",{value:!0});var qN=bx(),MN=function(){function e(t){this.options=t,this.attempt=0}return e.prototype.apply=function(){var t=this;return new Promise(function(r){return setTimeout(r,t.jitteredDelay)})},e.prototype.setAttemptNumber=function(t){this.attempt=t},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){var t=qN.JitterFactory(this.options);return t(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var t=this.options.startingDelay,r=this.options.timeMultiple,n=this.numOfDelayedAttempts,o=t*Math.pow(r,n);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();rS.Delay=MN});var wx=It(Bn=>{"use strict";d();c();u();l();var jN=Bn&&Bn.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),VN=Bn&&Bn.__awaiter||function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(y){i(y)}}function f(g){try{m(n.throw(g))}catch(y){i(y)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},LN=Bn&&Bn.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:p(0),throw:p(1),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(;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}}};Object.defineProperty(Bn,"__esModule",{value:!0});var UN=nS(),QN=function(e){jN(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return VN(this,void 0,void 0,function(){return LN(this,function(r){return[2,this.isFirstAttempt?!0:e.prototype.apply.call(this)]})})},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(UN.Delay);Bn.SkipFirstDelay=QN});var Rx=It(Nl=>{"use strict";d();c();u();l();var BN=Nl&&Nl.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Nl,"__esModule",{value:!0});var GN=nS(),$N=function(e){BN(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(GN.Delay);Nl.AlwaysDelay=$N});var Fx=It(oS=>{"use strict";d();c();u();l();Object.defineProperty(oS,"__esModule",{value:!0});var HN=wx(),zN=Rx();function WN(e,t){var r=KN(e);return r.setAttemptNumber(t),r}oS.DelayFactory=WN;function KN(e){return e.delayFirstAttempt?new zN.AlwaysDelay(e):new HN.SkipFirstDelay(e)}});var Ex=It(ua=>{"use strict";d();c();u();l();var aS=ua&&ua.__awaiter||function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(y){i(y)}}function f(g){try{m(n.throw(g))}catch(y){i(y)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},iS=ua&&ua.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:p(0),throw:p(1),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(;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}}};Object.defineProperty(ua,"__esModule",{value:!0});var YN=Ax(),JN=Fx();function XN(e,t){return t===void 0&&(t={}),aS(this,void 0,void 0,function(){var r,n;return iS(this,function(o){switch(o.label){case 0:return r=YN.getSanitizedOptions(t),n=new ZN(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}ua.backOff=XN;var ZN=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return aS(this,void 0,void 0,function(){var t,r;return iS(this,function(n){switch(n.label){case 0:if(this.attemptLimitReached)return[3,7];n.label=1;case 1:return n.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return n.sent(),[4,this.request()];case 3:return[2,n.sent()];case 4:return t=n.sent(),this.attemptNumber++,[4,this.options.retry(t,this.attemptNumber)];case 5:if(r=n.sent(),!r||this.attemptLimitReached)throw t;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return aS(this,void 0,void 0,function(){var t;return iS(this,function(r){switch(r.label){case 0:return t=JN.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var jp=It((mv,gv)=>{"use strict";d();c();u();l();(function(e,t){typeof mv=="object"&&typeof gv<"u"?gv.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof h<"u"?h:e||self).dayjs=t()})(mv,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",a="minute",i="hour",p="day",f="week",m="month",g="quarter",y="year",x="date",v="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(N){var _=["th","st","nd","rd"],q=N%100;return"["+N+(_[(q-20)%10]||_[q]||_[0])+"]"}},F=function(N,_,q){var Y=String(N);return!Y||Y.length>=_?N:""+Array(_+1-Y.length).join(q)+N},I={s:F,z:function(N){var _=-N.utcOffset(),q=Math.abs(_),Y=Math.floor(q/60),H=q%60;return(_<=0?"+":"-")+F(Y,2,"0")+":"+F(H,2,"0")},m:function N(_,q){if(_.date()<q.date())return-N(q,_);var Y=12*(q.year()-_.year())+(q.month()-_.month()),H=_.clone().add(Y,m),ne=q-H<0,te=_.clone().add(Y+(ne?-1:1),m);return+(-(Y+(q-H)/(ne?H-te:te-H))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:m,y,w:f,d:p,D:x,h:i,m:a,s:o,ms:n,Q:g}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},E="en",k={};k[E]=w;var T="$isDayjsObject",D=function(N){return N instanceof B||!(!N||!N[T])},G=function N(_,q,Y){var H;if(!_)return E;if(typeof _=="string"){var ne=_.toLowerCase();k[ne]&&(H=ne),q&&(k[ne]=q,H=ne);var te=_.split("-");if(!H&&te.length>1)return N(te[0])}else{var Z=_.name;k[Z]=_,H=Z}return!Y&&H&&(E=H),H||!Y&&E},U=function(N,_){if(D(N))return N.clone();var q=typeof _=="object"?_:{};return q.date=N,q.args=arguments,new B(q)},j=I;j.l=G,j.i=D,j.w=function(N,_){return U(N,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var B=function(){function N(q){this.$L=G(q.locale,null,!0),this.parse(q),this.$x=this.$x||q.x||{},this[T]=!0}var _=N.prototype;return _.parse=function(q){this.$d=function(Y){var H=Y.date,ne=Y.utc;if(H===null)return new Date(NaN);if(j.u(H))return new Date;if(H instanceof Date)return new Date(H);if(typeof H=="string"&&!/Z$/i.test(H)){var te=H.match(C);if(te){var Z=te[2]-1||0,le=(te[7]||"0").substring(0,3);return ne?new Date(Date.UTC(te[1],Z,te[3]||1,te[4]||0,te[5]||0,te[6]||0,le)):new Date(te[1],Z,te[3]||1,te[4]||0,te[5]||0,te[6]||0,le)}}return new Date(H)}(q),this.init()},_.init=function(){var q=this.$d;this.$y=q.getFullYear(),this.$M=q.getMonth(),this.$D=q.getDate(),this.$W=q.getDay(),this.$H=q.getHours(),this.$m=q.getMinutes(),this.$s=q.getSeconds(),this.$ms=q.getMilliseconds()},_.$utils=function(){return j},_.isValid=function(){return this.$d.toString()!==v},_.isSame=function(q,Y){var H=U(q);return this.startOf(Y)<=H&&H<=this.endOf(Y)},_.isAfter=function(q,Y){return U(q)<this.startOf(Y)},_.isBefore=function(q,Y){return this.endOf(Y)<U(q)},_.$g=function(q,Y,H){return j.u(q)?this[Y]:this.set(H,q)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(q,Y){var H=this,ne=!!j.u(Y)||Y,te=j.p(q),Z=function(Ee,Re){var ke=j.w(H.$u?Date.UTC(H.$y,Re,Ee):new Date(H.$y,Re,Ee),H);return ne?ke:ke.endOf(p)},le=function(Ee,Re){return j.w(H.toDate()[Ee].apply(H.toDate("s"),(ne?[0,0,0,0]:[23,59,59,999]).slice(Re)),H)},Se=this.$W,je=this.$M,Je=this.$D,Qe="set"+(this.$u?"UTC":"");switch(te){case y:return ne?Z(1,0):Z(31,11);case m:return ne?Z(1,je):Z(0,je+1);case f:var ze=this.$locale().weekStart||0,We=(Se<ze?Se+7:Se)-ze;return Z(ne?Je-We:Je+(6-We),je);case p:case x:return le(Qe+"Hours",0);case i:return le(Qe+"Minutes",1);case a:return le(Qe+"Seconds",2);case o:return le(Qe+"Milliseconds",3);default:return this.clone()}},_.endOf=function(q){return this.startOf(q,!1)},_.$set=function(q,Y){var H,ne=j.p(q),te="set"+(this.$u?"UTC":""),Z=(H={},H[p]=te+"Date",H[x]=te+"Date",H[m]=te+"Month",H[y]=te+"FullYear",H[i]=te+"Hours",H[a]=te+"Minutes",H[o]=te+"Seconds",H[n]=te+"Milliseconds",H)[ne],le=ne===p?this.$D+(Y-this.$W):Y;if(ne===m||ne===y){var Se=this.clone().set(x,1);Se.$d[Z](le),Se.init(),this.$d=Se.set(x,Math.min(this.$D,Se.daysInMonth())).$d}else Z&&this.$d[Z](le);return this.init(),this},_.set=function(q,Y){return this.clone().$set(q,Y)},_.get=function(q){return this[j.p(q)]()},_.add=function(q,Y){var H,ne=this;q=Number(q);var te=j.p(Y),Z=function(je){var Je=U(ne);return j.w(Je.date(Je.date()+Math.round(je*q)),ne)};if(te===m)return this.set(m,this.$M+q);if(te===y)return this.set(y,this.$y+q);if(te===p)return Z(1);if(te===f)return Z(7);var le=(H={},H[a]=t,H[i]=r,H[o]=e,H)[te]||1,Se=this.$d.getTime()+q*le;return j.w(Se,this)},_.subtract=function(q,Y){return this.add(-1*q,Y)},_.format=function(q){var Y=this,H=this.$locale();if(!this.isValid())return H.invalidDate||v;var ne=q||"YYYY-MM-DDTHH:mm:ssZ",te=j.z(this),Z=this.$H,le=this.$m,Se=this.$M,je=H.weekdays,Je=H.months,Qe=H.meridiem,ze=function(Re,ke,Ie,lt){return Re&&(Re[ke]||Re(Y,ne))||Ie[ke].slice(0,lt)},We=function(Re){return j.s(Z%12||12,Re,"0")},Ee=Qe||function(Re,ke,Ie){var lt=Re<12?"AM":"PM";return Ie?lt.toLowerCase():lt};return ne.replace(b,function(Re,ke){return ke||function(Ie){switch(Ie){case"YY":return String(Y.$y).slice(-2);case"YYYY":return j.s(Y.$y,4,"0");case"M":return Se+1;case"MM":return j.s(Se+1,2,"0");case"MMM":return ze(H.monthsShort,Se,Je,3);case"MMMM":return ze(Je,Se);case"D":return Y.$D;case"DD":return j.s(Y.$D,2,"0");case"d":return String(Y.$W);case"dd":return ze(H.weekdaysMin,Y.$W,je,2);case"ddd":return ze(H.weekdaysShort,Y.$W,je,3);case"dddd":return je[Y.$W];case"H":return String(Z);case"HH":return j.s(Z,2,"0");case"h":return We(1);case"hh":return We(2);case"a":return Ee(Z,le,!0);case"A":return Ee(Z,le,!1);case"m":return String(le);case"mm":return j.s(le,2,"0");case"s":return String(Y.$s);case"ss":return j.s(Y.$s,2,"0");case"SSS":return j.s(Y.$ms,3,"0");case"Z":return te}return null}(Re)||te.replace(":","")})},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(q,Y,H){var ne,te=this,Z=j.p(Y),le=U(q),Se=(le.utcOffset()-this.utcOffset())*t,je=this-le,Je=function(){return j.m(te,le)};switch(Z){case y:ne=Je()/12;break;case m:ne=Je();break;case g:ne=Je()/3;break;case f:ne=(je-Se)/6048e5;break;case p:ne=(je-Se)/864e5;break;case i:ne=je/r;break;case a:ne=je/t;break;case o:ne=je/e;break;default:ne=je}return H?ne:j.a(ne)},_.daysInMonth=function(){return this.endOf(m).$D},_.$locale=function(){return k[this.$L]},_.locale=function(q,Y){if(!q)return this.$L;var H=this.clone(),ne=G(q,Y,!0);return ne&&(H.$L=ne),H},_.clone=function(){return j.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},N}(),V=B.prototype;return U.prototype=V,[["$ms",n],["$s",o],["$m",a],["$H",i],["$W",p],["$M",m],["$y",y],["$D",x]].forEach(function(N){V[N[1]]=function(_){return this.$g(_,N[0],N[1])}}),U.extend=function(N,_){return N.$i||(N(_,B,U),N.$i=!0),U},U.locale=G,U.isDayjs=D,U.unix=function(N){return U(1e3*N)},U.en=k[E],U.Ls=k,U.p={},U})});var iR=It((hv,yv)=>{"use strict";d();c();u();l();(function(e,t){typeof hv=="object"&&typeof yv<"u"?yv.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof h<"u"?h:e||self).dayjs_plugin_quarterOfYear=t()})(hv,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(p){return this.$utils().u(p)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(p-1))};var a=o.add;o.add=function(p,f){return p=Number(p),this.$utils().p(f)===t?this.add(3*p,e):a.bind(this)(p,f)};var i=o.startOf;o.startOf=function(p,f){var m=this.$utils(),g=!!m.u(f)||f;if(m.p(p)===t){var y=this.quarter()-1;return g?this.month(3*y).startOf(e).startOf("day"):this.month(3*y+2).endOf(e).endOf("day")}return i.bind(this)(p,f)}}})});var sR=It((Sv,vv)=>{"use strict";d();c();u();l();(function(e,t){typeof Sv=="object"&&typeof vv<"u"?vv.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof h<"u"?h:e||self).dayjs_plugin_customParseFormat=t()})(Sv,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,o=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,i={},p=function(C){return(C=+C)+(C>68?1900:2e3)},f=function(C){return function(b){this[C]=+b}},m=[/[+-]\d\d:?(\d\d)?|Z/,function(C){(this.zone||(this.zone={})).offset=function(b){if(!b||b==="Z")return 0;var w=b.match(/([+-]|\d\d)/g),F=60*w[1]+(+w[2]||0);return F===0?0:w[0]==="+"?-F:F}(C)}],g=function(C){var b=i[C];return b&&(b.indexOf?b:b.s.concat(b.f))},y=function(C,b){var w,F=i.meridiem;if(F){for(var I=1;I<=24;I+=1)if(C.indexOf(F(I,0,b))>-1){w=I>12;break}}else w=C===(b?"pm":"PM");return w},x={A:[a,function(C){this.afternoon=y(C,!1)}],a:[a,function(C){this.afternoon=y(C,!0)}],Q:[r,function(C){this.month=3*(C-1)+1}],S:[r,function(C){this.milliseconds=100*+C}],SS:[n,function(C){this.milliseconds=10*+C}],SSS:[/\d{3}/,function(C){this.milliseconds=+C}],s:[o,f("seconds")],ss:[o,f("seconds")],m:[o,f("minutes")],mm:[o,f("minutes")],H:[o,f("hours")],h:[o,f("hours")],HH:[o,f("hours")],hh:[o,f("hours")],D:[o,f("day")],DD:[n,f("day")],Do:[a,function(C){var b=i.ordinal,w=C.match(/\d+/);if(this.day=w[0],b)for(var F=1;F<=31;F+=1)b(F).replace(/\[|\]/g,"")===C&&(this.day=F)}],w:[o,f("week")],ww:[n,f("week")],M:[o,f("month")],MM:[n,f("month")],MMM:[a,function(C){var b=g("months"),w=(g("monthsShort")||b.map(function(F){return F.slice(0,3)})).indexOf(C)+1;if(w<1)throw new Error;this.month=w%12||w}],MMMM:[a,function(C){var b=g("months").indexOf(C)+1;if(b<1)throw new Error;this.month=b%12||b}],Y:[/[+-]?\d+/,f("year")],YY:[n,function(C){this.year=p(C)}],YYYY:[/\d{4}/,f("year")],Z:m,ZZ:m};function v(C){var b,w;b=C,w=i&&i.formats;for(var F=(C=b.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(U,j,B){var V=B&&B.toUpperCase();return j||w[B]||e[B]||w[V].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(N,_,q){return _||q.slice(1)})})).match(t),I=F.length,E=0;E<I;E+=1){var k=F[E],T=x[k],D=T&&T[0],G=T&&T[1];F[E]=G?{regex:D,parser:G}:k.replace(/^\[|\]$/g,"")}return function(U){for(var j={},B=0,V=0;B<I;B+=1){var N=F[B];if(typeof N=="string")V+=N.length;else{var _=N.regex,q=N.parser,Y=U.slice(V),H=_.exec(Y)[0];q.call(j,H),U=U.replace(H,"")}}return function(ne){var te=ne.afternoon;if(te!==void 0){var Z=ne.hours;te?Z<12&&(ne.hours+=12):Z===12&&(ne.hours=0),delete ne.afternoon}}(j),j}}return function(C,b,w){w.p.customParseFormat=!0,C&&C.parseTwoDigitYear&&(p=C.parseTwoDigitYear);var F=b.prototype,I=F.parse;F.parse=function(E){var k=E.date,T=E.utc,D=E.args;this.$u=T;var G=D[1];if(typeof G=="string"){var U=D[2]===!0,j=D[3]===!0,B=U||j,V=D[2];j&&(V=D[2]),i=this.$locale(),!U&&V&&(i=w.Ls[V]),this.$d=function(Y,H,ne,te){try{if(["x","X"].indexOf(H)>-1)return new Date((H==="X"?1e3:1)*Y);var Z=v(H)(Y),le=Z.year,Se=Z.month,je=Z.day,Je=Z.hours,Qe=Z.minutes,ze=Z.seconds,We=Z.milliseconds,Ee=Z.zone,Re=Z.week,ke=new Date,Ie=je||(le||Se?1:ke.getDate()),lt=le||ke.getFullYear(),St=0;le&&!Se||(St=Se>0?Se-1:ke.getMonth());var Mr,ar=Je||0,Jr=Qe||0,mr=ze||0,jr=We||0;return Ee?new Date(Date.UTC(lt,St,Ie,ar,Jr,mr,jr+60*Ee.offset*1e3)):ne?new Date(Date.UTC(lt,St,Ie,ar,Jr,mr,jr)):(Mr=new Date(lt,St,Ie,ar,Jr,mr,jr),Re&&(Mr=te(Mr).week(Re).toDate()),Mr)}catch{return new Date("")}}(k,G,T,w),this.init(),V&&V!==!0&&(this.$L=this.locale(V).$L),B&&k!=this.format(G)&&(this.$d=new Date("")),i={}}else if(G instanceof Array)for(var N=G.length,_=1;_<=N;_+=1){D[1]=G[_-1];var q=w.apply(this,D);if(q.isValid()){this.$d=q.$d,this.$L=q.$L,this.init();break}_===N&&(this.$d=new Date(""))}else I.call(this,E)}}})});var jF=It((Xv,Zv)=>{"use strict";d();c();u();l();(function(e,t){typeof Xv=="object"&&typeof Zv<"u"?Zv.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof h<"u"?h:e||self).dayjs_plugin_timezone=t()})(Xv,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var a,i=function(g,y,x){x===void 0&&(x={});var v=new Date(g),C=function(b,w){w===void 0&&(w={});var F=w.timeZoneName||"short",I=b+"|"+F,E=t[I];return E||(E=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:b,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:F}),t[I]=E),E}(y,x);return C.formatToParts(v)},p=function(g,y){for(var x=i(g,y),v=[],C=0;C<x.length;C+=1){var b=x[C],w=b.type,F=b.value,I=e[w];I>=0&&(v[I]=parseInt(F,10))}var E=v[3],k=E===24?0:E,T=v[0]+"-"+v[1]+"-"+v[2]+" "+k+":"+v[4]+":"+v[5]+":000",D=+g;return(o.utc(T).valueOf()-(D-=D%1e3))/6e4},f=n.prototype;f.tz=function(g,y){g===void 0&&(g=a);var x,v=this.utcOffset(),C=this.toDate(),b=C.toLocaleString("en-US",{timeZone:g}),w=Math.round((C-new Date(b))/1e3/60),F=15*-Math.round(C.getTimezoneOffset()/15)-w;if(!Number(F))x=this.utcOffset(0,y);else if(x=o(b,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(F,!0),y){var I=x.utcOffset();x=x.add(v-I,"minute")}return x.$x.$timezone=g,x},f.offsetName=function(g){var y=this.$x.$timezone||o.tz.guess(),x=i(this.valueOf(),y,{timeZoneName:g}).find(function(v){return v.type.toLowerCase()==="timezonename"});return x&&x.value};var m=f.startOf;f.startOf=function(g,y){if(!this.$x||!this.$x.$timezone)return m.call(this,g,y);var x=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return m.call(x,g,y).tz(this.$x.$timezone,!0)},o.tz=function(g,y,x){var v=x&&y,C=x||y||a,b=p(+o(),C);if(typeof g!="string")return o(g).tz(C);var w=function(k,T,D){var G=k-60*T*1e3,U=p(G,D);if(T===U)return[G,T];var j=p(G-=60*(U-T)*1e3,D);return U===j?[G,U]:[k-60*Math.min(U,j)*1e3,Math.max(U,j)]}(o.utc(g,v).valueOf(),b,C),F=w[0],I=w[1],E=o(F).utcOffset(I);return E.$x.$timezone=C,E},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(g){a=g}}})});var VF=It((eA,tA)=>{"use strict";d();c();u();l();(function(e,t){typeof eA=="object"&&typeof tA<"u"?tA.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof h<"u"?h:e||self).dayjs_plugin_utc=t()})(eA,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,a){var i=o.prototype;a.utc=function(v){var C={date:v,utc:!0,args:arguments};return new o(C)},i.utc=function(v){var C=a(this.toDate(),{locale:this.$L,utc:!0});return v?C.add(this.utcOffset(),e):C},i.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var p=i.parse;i.parse=function(v){v.utc&&(this.$u=!0),this.$utils().u(v.$offset)||(this.$offset=v.$offset),p.call(this,v)};var f=i.init;i.init=function(){if(this.$u){var v=this.$d;this.$y=v.getUTCFullYear(),this.$M=v.getUTCMonth(),this.$D=v.getUTCDate(),this.$W=v.getUTCDay(),this.$H=v.getUTCHours(),this.$m=v.getUTCMinutes(),this.$s=v.getUTCSeconds(),this.$ms=v.getUTCMilliseconds()}else f.call(this)};var m=i.utcOffset;i.utcOffset=function(v,C){var b=this.$utils().u;if(b(v))return this.$u?0:b(this.$offset)?m.call(this):this.$offset;if(typeof v=="string"&&(v=function(E){E===void 0&&(E="");var k=E.match(t);if(!k)return null;var T=(""+k[0]).match(r)||["-",0,0],D=T[0],G=60*+T[1]+ +T[2];return G===0?0:D==="+"?G:-G}(v),v===null))return this;var w=Math.abs(v)<=16?60*v:v;if(w===0)return this.utc(C);var F=this.clone();if(C)return F.$offset=w,F.$u=!1,F;var I=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(F=this.local().add(w+I,e)).$offset=w,F.$x.$localOffset=I,F};var g=i.format;i.format=function(v){var C=v||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return g.call(this,C)},i.valueOf=function(){var v=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*v},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var y=i.toDate;i.toDate=function(v){return v==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():y.call(this)};var x=i.diff;i.diff=function(v,C,b){if(v&&this.$u===v.$u)return x.call(this,v,C,b);var w=this.local(),F=a(v).local();return x.call(w,F,C,b)}}})});var XI=It((bwe,JI)=>{"use strict";d();c();u();l();function $B(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}JI.exports=HB;function HB(e,t,r){var n=r&&r.stringify||$B,o=1;if(typeof e=="object"&&e!==null){var a=t.length+o;if(a===1)return e;var i=new Array(a);i[0]=n(e);for(var p=1;p<a;p++)i[p]=n(t[p]);return i.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var m="",g=1-o,y=-1,x=e&&e.length||0,v=0;v<x;){if(e.charCodeAt(v)===37&&v+1<x){switch(y=y>-1?y:0,e.charCodeAt(v+1)){case 100:case 102:if(g>=f||t[g]==null)break;y<v&&(m+=e.slice(y,v)),m+=Number(t[g]),y=v+2,v++;break;case 105:if(g>=f||t[g]==null)break;y<v&&(m+=e.slice(y,v)),m+=Math.floor(Number(t[g])),y=v+2,v++;break;case 79:case 111:case 106:if(g>=f||t[g]===void 0)break;y<v&&(m+=e.slice(y,v));var C=typeof t[g];if(C==="string"){m+="'"+t[g]+"'",y=v+2,v++;break}if(C==="function"){m+=t[g].name||"<anonymous>",y=v+2,v++;break}m+=n(t[g]),y=v+2,v++;break;case 115:if(g>=f)break;y<v&&(m+=e.slice(y,v)),m+=String(t[g]),y=v+2,v++;break;case 37:y<v&&(m+=e.slice(y,v)),m+="%",y=v+2,v++,g--;break}++g}++v}return y===-1?e:(y<x&&(m+=e.slice(y)),m)}});var aT=It((Iwe,kg)=>{"use strict";d();c();u();l();var ZI=XI();kg.exports=oo;var Uu=s1().console||{},zB={mapHttpRequest:Pg,mapHttpResponse:Pg,wrapRequestSerializer:zA,wrapResponseSerializer:zA,wrapErrorSerializer:zA,req:Pg,res:Pg,err:tT,errWithCause:tT};function zo(e,t){return e==="silent"?1/0:t.levels.values[e]}var YA=Symbol("pino.logFuncs"),WA=Symbol("pino.hierarchy"),WB={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function eT(e,t){let r={logger:t,parent:e[WA]};t[WA]=r}function KB(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:Uu[o]||Uu[WB[o]||"log"]||uc}),e[YA]=n}function YB(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function oo(e){e=e||{},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");let r=e.browser.write||Uu;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=YB(e.browser.serialize,n),a=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(a=!1);let i=Object.keys(e.customLevels||{}),p=["error","fatal","warn","info","debug","trace"].concat(i);typeof r=="function"&&p.forEach(function(b){r[b]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let f=e.level||"info",m=Object.create(r);m.log||(m.log=uc),KB(m,p,r),eT({},m),Object.defineProperty(m,"levelVal",{get:y}),Object.defineProperty(m,"level",{get:x,set:v});let g={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,reportCaller:e.browser.reportCaller,levels:p,timestamp:o1(e),messageKey:e.messageKey||"msg",onChild:e.onChild||uc};m.levels=JB(e),m.level=f,m.isLevelEnabled=function(b){return this.levels.values[b]?this.levels.values[b]>=this.levels.values[this.level]:!1},m.setMaxListeners=m.getMaxListeners=m.emit=m.addListener=m.on=m.prependListener=m.once=m.prependOnceListener=m.removeListener=m.removeAllListeners=m.listeners=m.listenerCount=m.eventNames=m.write=m.flush=uc,m.serializers=n,m._serialize=o,m._stdErrSerialize=a,m.child=function(...b){return C.call(this,g,...b)},t&&(m._logEvent=KA());function y(){return zo(this.level,this)}function x(){return this._level}function v(b){if(b!=="silent"&&!this.levels.values[b])throw Error("unknown level "+b);this._level=b,ci(this,g,m,"error"),ci(this,g,m,"fatal"),ci(this,g,m,"warn"),ci(this,g,m,"info"),ci(this,g,m,"debug"),ci(this,g,m,"trace"),i.forEach(w=>{ci(this,g,m,w)})}function C(b,w,F){if(!w)throw new Error("missing bindings for child Pino");F=F||{},o&&w.serializers&&(F.serializers=w.serializers);let I=F.serializers;if(o&&I){var E=Object.assign({},n,I),k=e.browser.serialize===!0?Object.keys(E):o;delete w.serializers,JA([w],k,E,this._stdErrSerialize)}function T(G){this._childLevel=(G._childLevel|0)+1,this.bindings=w,E&&(this.serializers=E,this._serialize=k),t&&(this._logEvent=KA([].concat(G._logEvent.bindings,w)))}T.prototype=this;let D=new T(this);return eT(this,D),D.child=function(...G){return C.call(this,b,...G)},D.level=F.level||this.level,b.onChild(D),D}return m}function JB(e){let t=e.customLevels||{},r=Object.assign({},oo.levels.values,t),n=Object.assign({},oo.levels.labels,XB(t));return{values:r,labels:n}}function XB(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}oo.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};oo.stdSerializers=zB;oo.stdTimeFunctions=Object.assign({},{nullTime:nT,epochTime:oT,unixTime:a1,isoTime:i1});function ZB(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[WA];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function ci(e,t,r,n){if(Object.defineProperty(e,n,{value:zo(e.level,r)>zo(n,r)?uc:r[YA][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===uc){if(!t.transmit)return;let a=t.transmit.level||e.level,i=zo(a,r);if(zo(n,r)<i)return}e[n]=t1(e,t,r,n);let o=ZB(e);o.length!==0&&(e[n]=e1(o,e[n]))}function e1(e,t){return function(){return t.apply(this,[...e,...arguments])}}function t1(e,t,r,n){return function(o){return function(){let i=t.timestamp(),p=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Uu?Uu:this;for(var m=0;m<p.length;m++)p[m]=arguments[m];var g=!1;if(t.serialize&&(JA(p,this._serialize,this.serializers,this._stdErrSerialize),g=!0),t.asObject||t.formatters){let y=r1(this,n,p,i,t);if(t.reportCaller&&y&&y.length>0&&y[0]&&typeof y[0]=="object")try{let x=rT();x&&(y[0].caller=x)}catch{}o.call(f,...y)}else{if(t.reportCaller)try{let y=rT();y&&p.push(y)}catch{}o.apply(f,p)}if(t.transmit){let y=t.transmit.level||e._level,x=zo(y,r),v=zo(n,r);if(v<x)return;n1(this,{ts:i,methodLevel:n,methodValue:v,transmitLevel:y,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:zo(e._level,r)},p,g)}}}(e[YA][n])}function r1(e,t,r,n,o){let{level:a,log:i=y=>y}=o.formatters||{},p=r.slice(),f=p[0],m={},g=(e._childLevel|0)+1;if(g<1&&(g=1),n&&(m.time=n),a){let y=a(t,e.levels.values[t]);Object.assign(m,y)}else m.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(f!==null&&typeof f=="object")for(;g--&&typeof p[0]=="object";)Object.assign(m,p.shift());return[i(m),...p]}else{if(f!==null&&typeof f=="object"){for(;g--&&typeof p[0]=="object";)Object.assign(m,p.shift());f=p.length?ZI(p.shift(),p):void 0}else typeof f=="string"&&(f=ZI(p.shift(),p));return f!==void 0&&(m[o.messageKey]=f),[i(m)]}}function JA(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=oo.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let a in e[o])t.indexOf(a)>-1&&a in r&&(e[o][a]=r[a](e[o][a]))}function n1(e,t,r,n=!1){let o=t.send,a=t.ts,i=t.methodLevel,p=t.methodValue,f=t.val,m=e._logEvent.bindings;n||JA(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=a,e._logEvent.messages=r.filter(function(g){return m.indexOf(g)===-1}),e._logEvent.level.label=i,e._logEvent.level.value=p,o(i,e._logEvent,f),e._logEvent=KA(m)}function KA(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function tT(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)t[r]===void 0&&(t[r]=e[r]);return t}function o1(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?nT:oT}function Pg(){return{}}function zA(e){return e}function uc(){}function nT(){return!1}function oT(){return Date.now()}function a1(){return Math.round(Date.now()/1e3)}function i1(){return new Date(Date.now()).toISOString()}function s1(){function e(t){return typeof t<"u"&&t}try{return typeof h<"u"?h:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),h)}catch{return e(self)||e(window)||e(this)||{}}}kg.exports.default=oo;kg.exports.pino=oo;function rT(){let e=new Error().stack;if(!e)return null;let t=e.split(`
|
|
20
|
-
`);for(let r=1;r<t.length;r++){let n=t[r].trim();if(/(^at\s+)?(createWrap|LOG|set\s*\(|asObject|Object\.apply|Function\.apply)/.test(n)||n.indexOf("browser.js")!==-1||n.indexOf("node:internal")!==-1||n.indexOf("node_modules")!==-1)continue;let o=n.match(/\((.*?):(\d+):(\d+)\)/);if(o||(o=n.match(/at\s+(.*?):(\d+):(\d+)/)),o){let a=o[1],i=o[2],p=o[3];return a+":"+i+":"+p}}return null}});var
|
|
17
|
+
*/(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadless",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadless"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var L0=Object.create;var Ru=Object.defineProperty;var U0=Object.getOwnPropertyDescriptor;var Q0=Object.getOwnPropertyNames;var B0=Object.getPrototypeOf,G0=Object.prototype.hasOwnProperty;var $0=(e,t,r)=>t in e?Ru(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ti=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var It=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Fu=(e,t)=>{for(var r in t)Ru(e,r,{get:t[r],enumerable:!0})},KC=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Q0(t))!G0.call(e,o)&&o!==r&&Ru(e,o,{get:()=>t[o],enumerable:!(n=U0(t,o))||n.enumerable});return e};var jr=(e,t,r)=>(r=e!=null?L0(B0(e)):{},KC(t||!e||!e.__esModule?Ru(r,"default",{value:e,enumerable:!0}):r,e)),H0=e=>KC(Ru({},"__esModule",{value:!0}),e);var me=(e,t,r)=>$0(e,typeof t!="symbol"?t+"":t,r);var y,c=Ti(()=>{"use strict";y=typeof globalThis<"u"?globalThis:window});function pd(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?pd=function(t){return typeof t}:pd=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pd(e)}function K0(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=Y0.bind(this))}function Y0(e,t){var r=this.event&&this.event.type,n=r==="unload"||r==="beforeunload",o="XMLHttpRequest"in this?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");o.open("POST",e,!n),o.withCredentials=!0,o.setRequestHeader("Accept","*/*"),z0(t)?(o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),o.responseType="text"):W0(t)&&t.type&&o.setRequestHeader("Content-Type",t.type);try{o.send(t)}catch{return!1}return!0}var z0,W0,u=Ti(()=>{"use strict";z0=function(t){return typeof t=="string"},W0=function(t){return t instanceof Blob};K0.call((typeof window>"u"?"undefined":pd(window))==="object"?window:{})});var Uy=It(Eu=>{"use strict";d();c();l();u();Object.defineProperty(Eu,"__esModule",{value:!0});function YC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function J0(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function X0(e,t,r){return t=Pi(t),e_(e,ex()?Reflect.construct(t,r||[],Pi(e).constructor):t.apply(e,r))}function Vy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o_(n.key),n)}}function jy(e,t,r){return t&&JC(e.prototype,t),r&&JC(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function XC(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=a_(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
18
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,i=!0,p=!1;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return i=f.done,f},e:function(f){p=!0,a=f},f:function(){try{i||r.return==null||r.return()}finally{if(p)throw a}}}}function qy(){return qy=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=t_(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},qy.apply(null,arguments)}function Pi(e){return Pi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pi(e)}function Z0(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&My(e,t)}function ex(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ex=function(){return!!e})()}function e_(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return J0(e)}function My(e,t){return My=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},My(e,t)}function t_(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Pi(e))!==null;);return e}function r_(e,t,r,n){var o=qy(Pi(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(a){return o.apply(r,a)}:o}function n_(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function o_(e){var t=n_(e,"string");return typeof t=="symbol"?t:t+""}function a_(e,t){if(e){if(typeof e=="string")return YC(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?YC(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function i_(e){var t;try{t=new Event("abort")}catch{typeof document<"u"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}return t.reason=e,t}function s_(e){if(e===void 0)if(typeof document>"u")e=new Error("This operation was aborted"),e.name="AbortError";else try{e=new DOMException("signal is aborted without reason"),Object.defineProperty(e,"name",{value:"AbortError"})}catch{e=new Error("This operation was aborted"),e.name="AbortError"}return e}var ZC=function(){function e(){Vy(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return jy(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],a=0,i=o.length;a<i;a++)if(o[a].callback===n){o.splice(a,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],a=o.slice(),i=function(){var g=a[p];try{g.callback.call(n,r)}catch(S){Promise.resolve().then(function(){throw S})}g.options&&g.options.once&&n.removeEventListener(r.type,g.callback)},p=0,f=a.length;p<f;p++)i();return!r.defaultPrevented}}}])}(),Ly=function(e){function t(){var r;return Vy(this,t),r=X0(this,t),r.listeners||ZC.call(r),Object.defineProperty(r,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(r,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(r,"reason",{value:void 0,writable:!0,configurable:!0}),r}return Z0(t,e),jy(t,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(n){n.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,n)),r_(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,a=o===void 0?"Aborted":o;if(n)throw a}}],[{key:"timeout",value:function(n){var o=new fd;return setTimeout(function(){return o.abort(new DOMException("This signal is timeout in ".concat(n,"ms"),"TimeoutError"))},n),o.signal}},{key:"any",value:function(n){var o=new fd;function a(){o.abort(this.reason),i()}function i(){var g=XC(n),S;try{for(g.s();!(S=g.n()).done;){var x=S.value;x.removeEventListener("abort",a)}}catch(h){g.e(h)}finally{g.f()}}var p=XC(n),f;try{for(p.s();!(f=p.n()).done;){var m=f.value;if(m.aborted){o.abort(m.reason);break}else m.addEventListener("abort",a)}}catch(g){p.e(g)}finally{p.f()}return o.signal}}])}(ZC),fd=function(){function e(){Vy(this,e),Object.defineProperty(this,"signal",{value:new Ly,writable:!0,configurable:!0})}return jy(e,[{key:"abort",value:function(r){var n=s_(r),o=i_(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(fd.prototype[Symbol.toStringTag]="AbortController",Ly.prototype[Symbol.toStringTag]="AbortSignal");function c_(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function u_(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,a=t.AbortController,i=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,p=i===void 0?!1:i;if(!c_({fetch:r,Request:o,AbortController:a,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:p}))return{fetch:r,Request:f};var f=o;(f&&!f.prototype.hasOwnProperty("signal")||p)&&(f=function(x,h){var C;h&&h.signal&&(C=h.signal,delete h.signal);var b=new o(x,h);return C&&Object.defineProperty(b,"signal",{writable:!1,enumerable:!1,configurable:!0,value:C}),b},f.prototype=o.prototype);var m=r,g=function(x,h){var C=f&&f.prototype.isPrototypeOf(x)?x.signal:h?h.signal:void 0;if(C){var b;try{b=new DOMException("Aborted","AbortError")}catch{b=new Error("Aborted"),b.name="AbortError"}if(C.aborted)return Promise.reject(b);var w=new Promise(function(F,I){C.addEventListener("abort",function(){return I(b)},{once:!0})});return h&&h.signal&&delete h.signal,Promise.race([w,m(x,h)])}return m(x,h)};return{fetch:g,Request:f}}Eu.AbortController=fd;Eu.AbortSignal=Ly;Eu.abortableFetch=u_});var tx,s,v,l=Ti(()=>{"use strict";tx=jr(Uy(),1),s=jr(Uy(),1),{fetch:v}=(0,tx.abortableFetch)({fetch})});function Qy(e){return typeof e!="string"||e in{}}function By(){return Object.create(null)}function rx(e){return typeof e=="string"&&!!e.trim()}function Gy(e,t){var r=e.split(";").filter(rx),n=r.shift();if(!n)return null;var o=l_(n),a=o.name,i=o.value;if(t=t?Object.assign({},md,t):md,Qy(a))return null;try{i=t.decodeValues?decodeURIComponent(i):i}catch(f){console.error("set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",f)}var p=By();return p.name=a,p.value=i,r.forEach(function(f){var m=f.split("="),g=m.shift().trim().toLowerCase();if(!Qy(g)){var S=m.join("=").trim();if(g==="expires")p.expires=new Date(S);else if(g==="max-age"){var x=parseInt(S,10);Number.isNaN(x)||(p.maxAge=x)}else g==="secure"?p.secure=!0:g==="httponly"?p.httpOnly=!0:g==="samesite"?p.sameSite=S:g==="partitioned"?p.partitioned=!0:g&&(p[g]=S)}}),p}function l_(e){var t="",r="",n=e.split("=");return n.length>1?(t=n.shift(),r=n.join("=")):r=e,{name:t,value:r}}function ki(e,t){if(t=t?Object.assign({},md,t):md,!e)return t.map?By():[];if(e.headers)if(typeof e.headers.getSetCookie=="function")e=e.headers.getSetCookie();else if(e.headers["set-cookie"])e=e.headers["set-cookie"];else{var r=e.headers[Object.keys(e.headers).find(function(i){return i.toLowerCase()==="set-cookie"})];!r&&e.headers.cookie&&!t.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),e=r}var n=t.split,o=Array.isArray(e);if(n==="auto"&&(n=!o),o||(e=[e]),e=e.filter(rx),n&&(e=e.map(gd).flat()),t.map){var a=By();return e.reduce(function(i,p){var f=Gy(p,t);return f&&!Qy(f.name)&&(i[f.name]=f),i},a)}else return e.map(function(i){return Gy(i,t)}).filter(Boolean)}function gd(e){if(Array.isArray(e))return e;if(typeof e!="string")return[];var t=[],r=0,n,o,a,i,p;function f(){for(;r<e.length&&/\s/.test(e.charAt(r));)r+=1;return r<e.length}function m(){return o=e.charAt(r),o!=="="&&o!==";"&&o!==","}for(;r<e.length;){for(n=r,p=!1;f();)if(o=e.charAt(r),o===","){for(a=r,r+=1,f(),i=r;r<e.length&&m();)r+=1;r<e.length&&e.charAt(r)==="="?(p=!0,r=i,t.push(e.substring(n,a)),n=r):r=a+1}else r+=1;(!p||r>=e.length)&&t.push(e.substring(n,e.length))}return t}var md,nx=Ti(()=>{"use strict";d();c();l();u();md={decodeValues:!0,map:!1,silent:!1,split:"auto"};ki.parseSetCookie=ki;ki.parse=ki;ki.parseString=Gy;ki.splitCookiesString=gd});function Iu(e){if(d_.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function $y(e){return e.replace(p_,"")}function Tu(e){if(typeof e!="string"||e.length===0)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>127||!f_(r))return!1}return!0}function f_(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function ax(e){if(typeof e!="string"||e.trim()!==e)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r===0||r===10||r===13)return!1}return!0}var d_,ox,p_,ix,Oi,Hy,sx,A,ux=Ti(()=>{"use strict";d();c();l();u();nx();d_=/[^a-z0-9\-#$%&'*+.^_`|~]/i;ox=[`
|
|
19
|
+
`,"\r","\t"," "],p_=new RegExp(`(^[${ox.join("")}]|$[${ox.join("")}])`,"g");Oi=Symbol("normalizedHeaders"),Hy=Symbol("rawHeaderNames"),sx=", ",A=class cx{constructor(t){this[Oi]={},this[Hy]=new Map,this[ix]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor?.name)||t instanceof cx||typeof y.Headers<"u"&&t instanceof y.Headers?t.forEach((r,n)=>{this.append(n,r)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(sx):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(sx):n)})}[(ix=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*keys(){for(let[t]of this.entries())yield t}*values(){for(let[,t]of this.entries())yield t}*entries(){let t=Object.keys(this[Oi]).sort((r,n)=>r.localeCompare(n));for(let r of t)if(r==="set-cookie")for(let n of this.getSetCookie())yield[r,n];else yield[r,this.get(r)]}has(t){if(!Tu(t))throw new TypeError(`Invalid header name "${t}"`);return this[Oi].hasOwnProperty(Iu(t))}get(t){if(!Tu(t))throw TypeError(`Invalid header name "${t}"`);return this[Oi][Iu(t)]??null}set(t,r){if(!Tu(t)||!ax(r))return;let n=Iu(t),o=$y(r);this[Oi][n]=$y(o),this[Hy].set(n,t)}append(t,r){if(!Tu(t)||!ax(r))return;let n=Iu(t),o=$y(r),a=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,a)}delete(t){if(!Tu(t)||!this.has(t))return;let r=Iu(t);delete this[Oi][r],this[Hy].delete(r)}forEach(t,r){for(let[n,o]of this.entries())t.call(r,o,n,this)}getSetCookie(){let t=this.get("set-cookie");return t===null?[]:t===""?[""]:gd(t)}}});var d=Ti(()=>{"use strict";ux()});var xx=It(Nu=>{"use strict";d();c();l();u();var wd=Nu&&Nu.__assign||function(){return wd=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},wd.apply(this,arguments)};Object.defineProperty(Nu,"__esModule",{value:!0});var N_={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function D_(e){var t=wd(wd({},N_),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}Nu.getSanitizedOptions=D_});var bx=It(tS=>{"use strict";d();c();l();u();Object.defineProperty(tS,"__esModule",{value:!0});function q_(e){var t=Math.random()*e;return Math.round(t)}tS.fullJitter=q_});var wx=It(rS=>{"use strict";d();c();l();u();Object.defineProperty(rS,"__esModule",{value:!0});function M_(e){return e}rS.noJitter=M_});var Rx=It(nS=>{"use strict";d();c();l();u();Object.defineProperty(nS,"__esModule",{value:!0});var V_=bx(),j_=wx();function L_(e){return e.jitter==="full"?V_.fullJitter:j_.noJitter}nS.JitterFactory=L_});var aS=It(oS=>{"use strict";d();c();l();u();Object.defineProperty(oS,"__esModule",{value:!0});var U_=Rx(),Q_=function(){function e(t){this.options=t,this.attempt=0}return e.prototype.apply=function(){var t=this;return new Promise(function(r){return setTimeout(r,t.jitteredDelay)})},e.prototype.setAttemptNumber=function(t){this.attempt=t},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){var t=U_.JitterFactory(this.options);return t(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var t=this.options.startingDelay,r=this.options.timeMultiple,n=this.numOfDelayedAttempts,o=t*Math.pow(r,n);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();oS.Delay=Q_});var Fx=It(Bn=>{"use strict";d();c();l();u();var B_=Bn&&Bn.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),G_=Bn&&Bn.__awaiter||function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(S){i(S)}}function f(g){try{m(n.throw(g))}catch(S){i(S)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},$_=Bn&&Bn.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:p(0),throw:p(1),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(;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}}};Object.defineProperty(Bn,"__esModule",{value:!0});var H_=aS(),z_=function(e){B_(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return G_(this,void 0,void 0,function(){return $_(this,function(r){return[2,this.isFirstAttempt?!0:e.prototype.apply.call(this)]})})},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(H_.Delay);Bn.SkipFirstDelay=z_});var Ex=It(Du=>{"use strict";d();c();l();u();var W_=Du&&Du.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Du,"__esModule",{value:!0});var K_=aS(),Y_=function(e){W_(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(K_.Delay);Du.AlwaysDelay=Y_});var Ix=It(iS=>{"use strict";d();c();l();u();Object.defineProperty(iS,"__esModule",{value:!0});var J_=Fx(),X_=Ex();function Z_(e,t){var r=eN(e);return r.setAttemptNumber(t),r}iS.DelayFactory=Z_;function eN(e){return e.delayFirstAttempt?new X_.AlwaysDelay(e):new J_.SkipFirstDelay(e)}});var Tx=It(la=>{"use strict";d();c();l();u();var sS=la&&la.__awaiter||function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(S){i(S)}}function f(g){try{m(n.throw(g))}catch(S){i(S)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},cS=la&&la.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:p(0),throw:p(1),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(;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}}};Object.defineProperty(la,"__esModule",{value:!0});var tN=xx(),rN=Ix();function nN(e,t){return t===void 0&&(t={}),sS(this,void 0,void 0,function(){var r,n;return cS(this,function(o){switch(o.label){case 0:return r=tN.getSanitizedOptions(t),n=new oN(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}la.backOff=nN;var oN=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return sS(this,void 0,void 0,function(){var t,r;return cS(this,function(n){switch(n.label){case 0:if(this.attemptLimitReached)return[3,7];n.label=1;case 1:return n.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return n.sent(),[4,this.request()];case 3:return[2,n.sent()];case 4:return t=n.sent(),this.attemptNumber++,[4,this.options.retry(t,this.attemptNumber)];case 5:if(r=n.sent(),!r||this.attemptLimitReached)throw t;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return sS(this,void 0,void 0,function(){var t;return cS(this,function(r){switch(r.label){case 0:return t=rN.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var Lp=It((hv,yv)=>{"use strict";d();c();l();u();(function(e,t){typeof hv=="object"&&typeof yv<"u"?yv.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs=t()})(hv,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",a="minute",i="hour",p="day",f="week",m="month",g="quarter",S="year",x="date",h="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_){var N=["th","st","nd","rd"],q=_%100;return"["+_+(N[(q-20)%10]||N[q]||N[0])+"]"}},F=function(_,N,q){var Y=String(_);return!Y||Y.length>=N?_:""+Array(N+1-Y.length).join(q)+_},I={s:F,z:function(_){var N=-_.utcOffset(),q=Math.abs(N),Y=Math.floor(q/60),H=q%60;return(N<=0?"+":"-")+F(Y,2,"0")+":"+F(H,2,"0")},m:function _(N,q){if(N.date()<q.date())return-_(q,N);var Y=12*(q.year()-N.year())+(q.month()-N.month()),H=N.clone().add(Y,m),ne=q-H<0,te=N.clone().add(Y+(ne?-1:1),m);return+(-(Y+(q-H)/(ne?H-te:te-H))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:m,y:S,w:f,d:p,D:x,h:i,m:a,s:o,ms:n,Q:g}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},E="en",T={};T[E]=w;var P="$isDayjsObject",D=function(_){return _ instanceof U||!(!_||!_[P])},G=function _(N,q,Y){var H;if(!N)return E;if(typeof N=="string"){var ne=N.toLowerCase();T[ne]&&(H=ne),q&&(T[ne]=q,H=ne);var te=N.split("-");if(!H&&te.length>1)return _(te[0])}else{var Z=N.name;T[Z]=N,H=Z}return!Y&&H&&(E=H),H||!Y&&E},Q=function(_,N){if(D(_))return _.clone();var q=typeof N=="object"?N:{};return q.date=_,q.args=arguments,new U(q)},V=I;V.l=G,V.i=D,V.w=function(_,N){return Q(_,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var U=function(){function _(q){this.$L=G(q.locale,null,!0),this.parse(q),this.$x=this.$x||q.x||{},this[P]=!0}var N=_.prototype;return N.parse=function(q){this.$d=function(Y){var H=Y.date,ne=Y.utc;if(H===null)return new Date(NaN);if(V.u(H))return new Date;if(H instanceof Date)return new Date(H);if(typeof H=="string"&&!/Z$/i.test(H)){var te=H.match(C);if(te){var Z=te[2]-1||0,ue=(te[7]||"0").substring(0,3);return ne?new Date(Date.UTC(te[1],Z,te[3]||1,te[4]||0,te[5]||0,te[6]||0,ue)):new Date(te[1],Z,te[3]||1,te[4]||0,te[5]||0,te[6]||0,ue)}}return new Date(H)}(q),this.init()},N.init=function(){var q=this.$d;this.$y=q.getFullYear(),this.$M=q.getMonth(),this.$D=q.getDate(),this.$W=q.getDay(),this.$H=q.getHours(),this.$m=q.getMinutes(),this.$s=q.getSeconds(),this.$ms=q.getMilliseconds()},N.$utils=function(){return V},N.isValid=function(){return this.$d.toString()!==h},N.isSame=function(q,Y){var H=Q(q);return this.startOf(Y)<=H&&H<=this.endOf(Y)},N.isAfter=function(q,Y){return Q(q)<this.startOf(Y)},N.isBefore=function(q,Y){return this.endOf(Y)<Q(q)},N.$g=function(q,Y,H){return V.u(q)?this[Y]:this.set(H,q)},N.unix=function(){return Math.floor(this.valueOf()/1e3)},N.valueOf=function(){return this.$d.getTime()},N.startOf=function(q,Y){var H=this,ne=!!V.u(Y)||Y,te=V.p(q),Z=function(Ee,Re){var ke=V.w(H.$u?Date.UTC(H.$y,Re,Ee):new Date(H.$y,Re,Ee),H);return ne?ke:ke.endOf(p)},ue=function(Ee,Re){return V.w(H.toDate()[Ee].apply(H.toDate("s"),(ne?[0,0,0,0]:[23,59,59,999]).slice(Re)),H)},Se=this.$W,Ve=this.$M,Je=this.$D,Qe="set"+(this.$u?"UTC":"");switch(te){case S:return ne?Z(1,0):Z(31,11);case m:return ne?Z(1,Ve):Z(0,Ve+1);case f:var ze=this.$locale().weekStart||0,We=(Se<ze?Se+7:Se)-ze;return Z(ne?Je-We:Je+(6-We),Ve);case p:case x:return ue(Qe+"Hours",0);case i:return ue(Qe+"Minutes",1);case a:return ue(Qe+"Seconds",2);case o:return ue(Qe+"Milliseconds",3);default:return this.clone()}},N.endOf=function(q){return this.startOf(q,!1)},N.$set=function(q,Y){var H,ne=V.p(q),te="set"+(this.$u?"UTC":""),Z=(H={},H[p]=te+"Date",H[x]=te+"Date",H[m]=te+"Month",H[S]=te+"FullYear",H[i]=te+"Hours",H[a]=te+"Minutes",H[o]=te+"Seconds",H[n]=te+"Milliseconds",H)[ne],ue=ne===p?this.$D+(Y-this.$W):Y;if(ne===m||ne===S){var Se=this.clone().set(x,1);Se.$d[Z](ue),Se.init(),this.$d=Se.set(x,Math.min(this.$D,Se.daysInMonth())).$d}else Z&&this.$d[Z](ue);return this.init(),this},N.set=function(q,Y){return this.clone().$set(q,Y)},N.get=function(q){return this[V.p(q)]()},N.add=function(q,Y){var H,ne=this;q=Number(q);var te=V.p(Y),Z=function(Ve){var Je=Q(ne);return V.w(Je.date(Je.date()+Math.round(Ve*q)),ne)};if(te===m)return this.set(m,this.$M+q);if(te===S)return this.set(S,this.$y+q);if(te===p)return Z(1);if(te===f)return Z(7);var ue=(H={},H[a]=t,H[i]=r,H[o]=e,H)[te]||1,Se=this.$d.getTime()+q*ue;return V.w(Se,this)},N.subtract=function(q,Y){return this.add(-1*q,Y)},N.format=function(q){var Y=this,H=this.$locale();if(!this.isValid())return H.invalidDate||h;var ne=q||"YYYY-MM-DDTHH:mm:ssZ",te=V.z(this),Z=this.$H,ue=this.$m,Se=this.$M,Ve=H.weekdays,Je=H.months,Qe=H.meridiem,ze=function(Re,ke,Ie,ut){return Re&&(Re[ke]||Re(Y,ne))||Ie[ke].slice(0,ut)},We=function(Re){return V.s(Z%12||12,Re,"0")},Ee=Qe||function(Re,ke,Ie){var ut=Re<12?"AM":"PM";return Ie?ut.toLowerCase():ut};return ne.replace(b,function(Re,ke){return ke||function(Ie){switch(Ie){case"YY":return String(Y.$y).slice(-2);case"YYYY":return V.s(Y.$y,4,"0");case"M":return Se+1;case"MM":return V.s(Se+1,2,"0");case"MMM":return ze(H.monthsShort,Se,Je,3);case"MMMM":return ze(Je,Se);case"D":return Y.$D;case"DD":return V.s(Y.$D,2,"0");case"d":return String(Y.$W);case"dd":return ze(H.weekdaysMin,Y.$W,Ve,2);case"ddd":return ze(H.weekdaysShort,Y.$W,Ve,3);case"dddd":return Ve[Y.$W];case"H":return String(Z);case"HH":return V.s(Z,2,"0");case"h":return We(1);case"hh":return We(2);case"a":return Ee(Z,ue,!0);case"A":return Ee(Z,ue,!1);case"m":return String(ue);case"mm":return V.s(ue,2,"0");case"s":return String(Y.$s);case"ss":return V.s(Y.$s,2,"0");case"SSS":return V.s(Y.$ms,3,"0");case"Z":return te}return null}(Re)||te.replace(":","")})},N.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},N.diff=function(q,Y,H){var ne,te=this,Z=V.p(Y),ue=Q(q),Se=(ue.utcOffset()-this.utcOffset())*t,Ve=this-ue,Je=function(){return V.m(te,ue)};switch(Z){case S:ne=Je()/12;break;case m:ne=Je();break;case g:ne=Je()/3;break;case f:ne=(Ve-Se)/6048e5;break;case p:ne=(Ve-Se)/864e5;break;case i:ne=Ve/r;break;case a:ne=Ve/t;break;case o:ne=Ve/e;break;default:ne=Ve}return H?ne:V.a(ne)},N.daysInMonth=function(){return this.endOf(m).$D},N.$locale=function(){return T[this.$L]},N.locale=function(q,Y){if(!q)return this.$L;var H=this.clone(),ne=G(q,Y,!0);return ne&&(H.$L=ne),H},N.clone=function(){return V.w(this.$d,this)},N.toDate=function(){return new Date(this.valueOf())},N.toJSON=function(){return this.isValid()?this.toISOString():null},N.toISOString=function(){return this.$d.toISOString()},N.toString=function(){return this.$d.toUTCString()},_}(),j=U.prototype;return Q.prototype=j,[["$ms",n],["$s",o],["$m",a],["$H",i],["$W",p],["$M",m],["$y",S],["$D",x]].forEach(function(_){j[_[1]]=function(N){return this.$g(N,_[0],_[1])}}),Q.extend=function(_,N){return _.$i||(_(N,U,Q),_.$i=!0),Q},Q.locale=G,Q.isDayjs=D,Q.unix=function(_){return Q(1e3*_)},Q.en=T[E],Q.Ls=T,Q.p={},Q})});var cR=It((Sv,vv)=>{"use strict";d();c();l();u();(function(e,t){typeof Sv=="object"&&typeof vv<"u"?vv.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_quarterOfYear=t()})(Sv,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(p){return this.$utils().u(p)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(p-1))};var a=o.add;o.add=function(p,f){return p=Number(p),this.$utils().p(f)===t?this.add(3*p,e):a.bind(this)(p,f)};var i=o.startOf;o.startOf=function(p,f){var m=this.$utils(),g=!!m.u(f)||f;if(m.p(p)===t){var S=this.quarter()-1;return g?this.month(3*S).startOf(e).startOf("day"):this.month(3*S+2).endOf(e).endOf("day")}return i.bind(this)(p,f)}}})});var uR=It((Av,Cv)=>{"use strict";d();c();l();u();(function(e,t){typeof Av=="object"&&typeof Cv<"u"?Cv.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_customParseFormat=t()})(Av,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,o=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,i={},p=function(C){return(C=+C)+(C>68?1900:2e3)},f=function(C){return function(b){this[C]=+b}},m=[/[+-]\d\d:?(\d\d)?|Z/,function(C){(this.zone||(this.zone={})).offset=function(b){if(!b||b==="Z")return 0;var w=b.match(/([+-]|\d\d)/g),F=60*w[1]+(+w[2]||0);return F===0?0:w[0]==="+"?-F:F}(C)}],g=function(C){var b=i[C];return b&&(b.indexOf?b:b.s.concat(b.f))},S=function(C,b){var w,F=i.meridiem;if(F){for(var I=1;I<=24;I+=1)if(C.indexOf(F(I,0,b))>-1){w=I>12;break}}else w=C===(b?"pm":"PM");return w},x={A:[a,function(C){this.afternoon=S(C,!1)}],a:[a,function(C){this.afternoon=S(C,!0)}],Q:[r,function(C){this.month=3*(C-1)+1}],S:[r,function(C){this.milliseconds=100*+C}],SS:[n,function(C){this.milliseconds=10*+C}],SSS:[/\d{3}/,function(C){this.milliseconds=+C}],s:[o,f("seconds")],ss:[o,f("seconds")],m:[o,f("minutes")],mm:[o,f("minutes")],H:[o,f("hours")],h:[o,f("hours")],HH:[o,f("hours")],hh:[o,f("hours")],D:[o,f("day")],DD:[n,f("day")],Do:[a,function(C){var b=i.ordinal,w=C.match(/\d+/);if(this.day=w[0],b)for(var F=1;F<=31;F+=1)b(F).replace(/\[|\]/g,"")===C&&(this.day=F)}],w:[o,f("week")],ww:[n,f("week")],M:[o,f("month")],MM:[n,f("month")],MMM:[a,function(C){var b=g("months"),w=(g("monthsShort")||b.map(function(F){return F.slice(0,3)})).indexOf(C)+1;if(w<1)throw new Error;this.month=w%12||w}],MMMM:[a,function(C){var b=g("months").indexOf(C)+1;if(b<1)throw new Error;this.month=b%12||b}],Y:[/[+-]?\d+/,f("year")],YY:[n,function(C){this.year=p(C)}],YYYY:[/\d{4}/,f("year")],Z:m,ZZ:m};function h(C){var b,w;b=C,w=i&&i.formats;for(var F=(C=b.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(Q,V,U){var j=U&&U.toUpperCase();return V||w[U]||e[U]||w[j].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(_,N,q){return N||q.slice(1)})})).match(t),I=F.length,E=0;E<I;E+=1){var T=F[E],P=x[T],D=P&&P[0],G=P&&P[1];F[E]=G?{regex:D,parser:G}:T.replace(/^\[|\]$/g,"")}return function(Q){for(var V={},U=0,j=0;U<I;U+=1){var _=F[U];if(typeof _=="string")j+=_.length;else{var N=_.regex,q=_.parser,Y=Q.slice(j),H=N.exec(Y)[0];q.call(V,H),Q=Q.replace(H,"")}}return function(ne){var te=ne.afternoon;if(te!==void 0){var Z=ne.hours;te?Z<12&&(ne.hours+=12):Z===12&&(ne.hours=0),delete ne.afternoon}}(V),V}}return function(C,b,w){w.p.customParseFormat=!0,C&&C.parseTwoDigitYear&&(p=C.parseTwoDigitYear);var F=b.prototype,I=F.parse;F.parse=function(E){var T=E.date,P=E.utc,D=E.args;this.$u=P;var G=D[1];if(typeof G=="string"){var Q=D[2]===!0,V=D[3]===!0,U=Q||V,j=D[2];V&&(j=D[2]),i=this.$locale(),!Q&&j&&(i=w.Ls[j]),this.$d=function(Y,H,ne,te){try{if(["x","X"].indexOf(H)>-1)return new Date((H==="X"?1e3:1)*Y);var Z=h(H)(Y),ue=Z.year,Se=Z.month,Ve=Z.day,Je=Z.hours,Qe=Z.minutes,ze=Z.seconds,We=Z.milliseconds,Ee=Z.zone,Re=Z.week,ke=new Date,Ie=Ve||(ue||Se?1:ke.getDate()),ut=ue||ke.getFullYear(),St=0;ue&&!Se||(St=Se>0?Se-1:ke.getMonth());var Mr,ar=Je||0,Jr=Qe||0,mr=ze||0,Vr=We||0;return Ee?new Date(Date.UTC(ut,St,Ie,ar,Jr,mr,Vr+60*Ee.offset*1e3)):ne?new Date(Date.UTC(ut,St,Ie,ar,Jr,mr,Vr)):(Mr=new Date(ut,St,Ie,ar,Jr,mr,Vr),Re&&(Mr=te(Mr).week(Re).toDate()),Mr)}catch{return new Date("")}}(T,G,P,w),this.init(),j&&j!==!0&&(this.$L=this.locale(j).$L),U&&T!=this.format(G)&&(this.$d=new Date("")),i={}}else if(G instanceof Array)for(var _=G.length,N=1;N<=_;N+=1){D[1]=G[N-1];var q=w.apply(this,D);if(q.isValid()){this.$d=q.$d,this.$L=q.$L,this.init();break}N===_&&(this.$d=new Date(""))}else I.call(this,E)}}})});var LF=It((eA,tA)=>{"use strict";d();c();l();u();(function(e,t){typeof eA=="object"&&typeof tA<"u"?tA.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_timezone=t()})(eA,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var a,i=function(g,S,x){x===void 0&&(x={});var h=new Date(g),C=function(b,w){w===void 0&&(w={});var F=w.timeZoneName||"short",I=b+"|"+F,E=t[I];return E||(E=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:b,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:F}),t[I]=E),E}(S,x);return C.formatToParts(h)},p=function(g,S){for(var x=i(g,S),h=[],C=0;C<x.length;C+=1){var b=x[C],w=b.type,F=b.value,I=e[w];I>=0&&(h[I]=parseInt(F,10))}var E=h[3],T=E===24?0:E,P=h[0]+"-"+h[1]+"-"+h[2]+" "+T+":"+h[4]+":"+h[5]+":000",D=+g;return(o.utc(P).valueOf()-(D-=D%1e3))/6e4},f=n.prototype;f.tz=function(g,S){if(g===void 0&&(g=a),!this.isValid())return this;var x,h=this.utcOffset(),C=this.toDate(),b=C.toLocaleString("en-US",{timeZone:g}),w=p(+C,g);if(!Number(w))x=this.utcOffset(0,S);else if(x=o(b,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(w,!0),S){var F=x.utcOffset();x=x.add(h-F,"minute")}return x.$x.$timezone=g,x},f.offsetName=function(g){var S=this.$x.$timezone||o.tz.guess(),x=i(this.valueOf(),S,{timeZoneName:g}).find(function(h){return h.type.toLowerCase()==="timezonename"});return x&&x.value};var m=f.startOf;f.startOf=function(g,S){if(!this.$x||!this.$x.$timezone)return m.call(this,g,S);var x=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return m.call(x,g,S).tz(this.$x.$timezone,!0)},o.tz=function(g,S,x){var h=x&&S,C=x||S||a,b=p(+o(),C);if(typeof g!="string")return o(g).tz(C);var w=o.utc(g,h).valueOf();if(Number.isNaN(w)){var F=o(NaN);return F.$x.$timezone=C,F}var I=function(D,G,Q){var V=D-60*G*1e3,U=p(V,Q);if(G===U)return[V,G];var j=p(V-=60*(U-G)*1e3,Q);return U===j?[V,U]:[D-60*Math.min(U,j)*1e3,Math.max(U,j)]}(w,b,C),E=I[0],T=I[1],P=o(E).utcOffset(T);return P.$x.$timezone=C,P},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(g){a=g}}})});var UF=It((rA,nA)=>{"use strict";d();c();l();u();(function(e,t){typeof rA=="object"&&typeof nA<"u"?nA.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_utc=t()})(rA,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,a){var i=o.prototype;a.utc=function(h){var C={date:h,utc:!0,args:arguments};return new o(C)},i.utc=function(h){var C=a(this.toDate(),{locale:this.$L,utc:!0});return h?C.add(this.utcOffset(),e):C},i.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var p=i.parse;i.parse=function(h){h.utc&&(this.$u=!0),this.$utils().u(h.$offset)||(this.$offset=h.$offset),p.call(this,h)};var f=i.init;i.init=function(){if(this.$u){var h=this.$d;this.$y=h.getUTCFullYear(),this.$M=h.getUTCMonth(),this.$D=h.getUTCDate(),this.$W=h.getUTCDay(),this.$H=h.getUTCHours(),this.$m=h.getUTCMinutes(),this.$s=h.getUTCSeconds(),this.$ms=h.getUTCMilliseconds()}else f.call(this)};var m=i.utcOffset;i.utcOffset=function(h,C){var b=this.$utils().u;if(b(h))return this.$u?0:b(this.$offset)?m.call(this):this.$offset;if(typeof h=="string"&&(h=function(E){E===void 0&&(E="");var T=E.match(t);if(!T)return null;var P=(""+T[0]).match(r)||["-",0,0],D=P[0],G=60*+P[1]+ +P[2];return G===0?0:D==="+"?G:-G}(h),h===null))return this;var w=Math.abs(h)<=16?60*h:h;if(w===0)return this.utc(C);var F=this.clone();if(C)return F.$offset=w,F.$u=!1,F;var I=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(F=this.local().add(w+I,e)).$offset=w,F.$x.$localOffset=I,F};var g=i.format;i.format=function(h){var C=h||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return g.call(this,C)},i.valueOf=function(){var h=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*h},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var S=i.toDate;i.toDate=function(h){return h==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():S.call(this)};var x=i.diff;i.diff=function(h,C,b){if(h&&this.$u===h.$u)return x.call(this,h,C,b);var w=this.local(),F=a(h).local();return x.call(w,F,C,b)}}})});var nT=It((Pwe,rT)=>{"use strict";d();c();l();u();function JB(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}rT.exports=XB;function XB(e,t,r){var n=r&&r.stringify||JB,o=1;if(typeof e=="object"&&e!==null){var a=t.length+o;if(a===1)return e;var i=new Array(a);i[0]=n(e);for(var p=1;p<a;p++)i[p]=n(t[p]);return i.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var m="",g=1-o,S=-1,x=e&&e.length||0,h=0;h<x;){if(e.charCodeAt(h)===37&&h+1<x){switch(S=S>-1?S:0,e.charCodeAt(h+1)){case 100:case 102:if(g>=f||t[g]==null)break;S<h&&(m+=e.slice(S,h)),m+=Number(t[g]),S=h+2,h++;break;case 105:if(g>=f||t[g]==null)break;S<h&&(m+=e.slice(S,h)),m+=Math.floor(Number(t[g])),S=h+2,h++;break;case 79:case 111:case 106:if(g>=f||t[g]===void 0)break;S<h&&(m+=e.slice(S,h));var C=typeof t[g];if(C==="string"){m+="'"+t[g]+"'",S=h+2,h++;break}if(C==="function"){m+=t[g].name||"<anonymous>",S=h+2,h++;break}m+=n(t[g]),S=h+2,h++;break;case 115:if(g>=f)break;S<h&&(m+=e.slice(S,h)),m+=String(t[g]),S=h+2,h++;break;case 37:S<h&&(m+=e.slice(S,h)),m+="%",S=h+2,h++,g--;break}++g}++h}return S===-1?e:(S<x&&(m+=e.slice(S)),m)}});var lT=It((Dwe,_g)=>{"use strict";d();c();l();u();var oT=nT();_g.exports=oo;var Bl=f1().console||{},ZB={mapHttpRequest:Og,mapHttpResponse:Og,wrapRequestSerializer:KA,wrapResponseSerializer:KA,wrapErrorSerializer:KA,req:Og,res:Og,err:iT,errWithCause:iT};function zo(e,t){return e==="silent"?1/0:t.levels.values[e]}var XA=Symbol("pino.logFuncs"),YA=Symbol("pino.hierarchy"),e1={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function aT(e,t){let r={logger:t,parent:e[YA]};t[YA]=r}function t1(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:Bl[o]||Bl[e1[o]||"log"]||pc}),e[XA]=n}function r1(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function oo(e){e=e||{},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");let r=e.browser.write||Bl;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=r1(e.browser.serialize,n),a=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(a=!1);let i=Object.keys(e.customLevels||{}),p=["error","fatal","warn","info","debug","trace"].concat(i);typeof r=="function"&&p.forEach(function(b){r[b]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let f=e.level||"info",m=Object.create(r);m.log||(m.log=pc),t1(m,p,r),aT({},m),Object.defineProperty(m,"levelVal",{get:S}),Object.defineProperty(m,"level",{get:x,set:h});let g={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,reportCaller:e.browser.reportCaller,levels:p,timestamp:l1(e),messageKey:e.messageKey||"msg",onChild:e.onChild||pc};m.levels=n1(e),m.level=f,m.isLevelEnabled=function(b){return this.levels.values[b]?this.levels.values[b]>=this.levels.values[this.level]:!1},m.setMaxListeners=m.getMaxListeners=m.emit=m.addListener=m.on=m.prependListener=m.once=m.prependOnceListener=m.removeListener=m.removeAllListeners=m.listeners=m.listenerCount=m.eventNames=m.write=m.flush=pc,m.serializers=n,m._serialize=o,m._stdErrSerialize=a,m.child=function(...b){return C.call(this,g,...b)},t&&(m._logEvent=JA());function S(){return zo(this.level,this)}function x(){return this._level}function h(b){if(b!=="silent"&&!this.levels.values[b])throw Error("unknown level "+b);this._level=b,ui(this,g,m,"error"),ui(this,g,m,"fatal"),ui(this,g,m,"warn"),ui(this,g,m,"info"),ui(this,g,m,"debug"),ui(this,g,m,"trace"),i.forEach(w=>{ui(this,g,m,w)})}function C(b,w,F){if(!w)throw new Error("missing bindings for child Pino");F=F||{},o&&w.serializers&&(F.serializers=w.serializers);let I=F.serializers;if(o&&I){var E=Object.assign({},n,I),T=e.browser.serialize===!0?Object.keys(E):o;delete w.serializers,ZA([w],T,E,this._stdErrSerialize)}function P(G){this._childLevel=(G._childLevel|0)+1,this.bindings=w,E&&(this.serializers=E,this._serialize=T),t&&(this._logEvent=JA([].concat(G._logEvent.bindings,w)))}P.prototype=this;let D=new P(this);return aT(this,D),D.child=function(...G){return C.call(this,b,...G)},D.level=F.level||this.level,b.onChild(D),D}return m}function n1(e){let t=e.customLevels||{},r=Object.assign({},oo.levels.values,t),n=Object.assign({},oo.levels.labels,o1(t));return{values:r,labels:n}}function o1(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}oo.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};oo.stdSerializers=ZB;oo.stdTimeFunctions=Object.assign({},{nullTime:cT,epochTime:uT,unixTime:d1,isoTime:p1});function a1(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[YA];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function ui(e,t,r,n){if(Object.defineProperty(e,n,{value:zo(e.level,r)>zo(n,r)?pc:r[XA][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===pc){if(!t.transmit)return;let a=t.transmit.level||e.level,i=zo(a,r);if(zo(n,r)<i)return}e[n]=s1(e,t,r,n);let o=a1(e);o.length!==0&&(e[n]=i1(o,e[n]))}function i1(e,t){return function(){return t.apply(this,[...e,...arguments])}}function s1(e,t,r,n){return function(o){return function(){let i=t.timestamp(),p=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Bl?Bl:this;for(var m=0;m<p.length;m++)p[m]=arguments[m];var g=!1;if(t.serialize&&(ZA(p,this._serialize,this.serializers,this._stdErrSerialize),g=!0),t.asObject||t.formatters){let S=c1(this,n,p,i,t);if(t.reportCaller&&S&&S.length>0&&S[0]&&typeof S[0]=="object")try{let x=sT();x&&(S[0].caller=x)}catch{}o.call(f,...S)}else{if(t.reportCaller)try{let S=sT();S&&p.push(S)}catch{}o.apply(f,p)}if(t.transmit){let S=t.transmit.level||e._level,x=zo(S,r),h=zo(n,r);if(h<x)return;u1(this,{ts:i,methodLevel:n,methodValue:h,transmitLevel:S,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:zo(e._level,r)},p,g)}}}(e[XA][n])}function c1(e,t,r,n,o){let{level:a,log:i=S=>S}=o.formatters||{},p=r.slice(),f=p[0],m={},g=(e._childLevel|0)+1;if(g<1&&(g=1),n&&(m.time=n),a){let S=a(t,e.levels.values[t]);Object.assign(m,S)}else m.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(f!==null&&typeof f=="object")for(;g--&&typeof p[0]=="object";)Object.assign(m,p.shift());return[i(m),...p]}else{if(f!==null&&typeof f=="object"){for(;g--&&typeof p[0]=="object";)Object.assign(m,p.shift());f=p.length?oT(p.shift(),p):void 0}else typeof f=="string"&&(f=oT(p.shift(),p));return f!==void 0&&(m[o.messageKey]=f),[i(m)]}}function ZA(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=oo.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let a in e[o])t.indexOf(a)>-1&&a in r&&(e[o][a]=r[a](e[o][a]))}function u1(e,t,r,n=!1){let o=t.send,a=t.ts,i=t.methodLevel,p=t.methodValue,f=t.val,m=e._logEvent.bindings;n||ZA(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=a,e._logEvent.messages=r.filter(function(g){return m.indexOf(g)===-1}),e._logEvent.level.label=i,e._logEvent.level.value=p,o(i,e._logEvent,f),e._logEvent=JA(m)}function JA(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function iT(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)t[r]===void 0&&(t[r]=e[r]);return t}function l1(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?cT:uT}function Og(){return{}}function KA(e){return e}function pc(){}function cT(){return!1}function uT(){return Date.now()}function d1(){return Math.round(Date.now()/1e3)}function p1(){return new Date(Date.now()).toISOString()}function f1(){function e(t){return typeof t<"u"&&t}try{return typeof y<"u"?y:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),y)}catch{return e(self)||e(window)||e(this)||{}}}_g.exports.default=oo;_g.exports.pino=oo;function sT(){let e=new Error().stack;if(!e)return null;let t=e.split(`
|
|
20
|
+
`);for(let r=1;r<t.length;r++){let n=t[r].trim();if(/(^at\s+)?(createWrap|LOG|set\s*\(|asObject|Object\.apply|Function\.apply)/.test(n)||n.indexOf("browser.js")!==-1||n.indexOf("node:internal")!==-1||n.indexOf("node_modules")!==-1)continue;let o=n.match(/\((.*?):(\d+):(\d+)\)/);if(o||(o=n.match(/at\s+(.*?):(\d+):(\d+)/)),o){let a=o[1],i=o[2],p=o[3];return a+":"+i+":"+p}}return null}});var H3={};Fu(H3,{API_DATE_FORMAT:()=>Fs,DefaultFieldsToInclude:()=>pC,EcommerceDefaultFieldsToInclude:()=>ek,HighlightUtils:()=>Yy,MinimumFieldsToInclude:()=>Wh,ResultTemplatesHelpers:()=>jR,SortBy:()=>xa,SortOrder:()=>cl,VERSION:()=>Ao,baseFacetResponseSelector:()=>Ur,buildAutomaticFacetGenerator:()=>fP,buildBreadcrumbManager:()=>zT,buildCategoryFacet:()=>wP,buildCategoryFieldSuggestions:()=>zP,buildContext:()=>YT,buildController:()=>oe,buildCriterionExpression:()=>rn,buildDateFacet:()=>VP,buildDateFilter:()=>LP,buildDateRange:()=>Yo,buildDateSortCriterion:()=>Ap,buildDictionaryFieldContext:()=>ZT,buildDidYouMean:()=>aP,buildExecuteTrigger:()=>u0,buildFacet:()=>OP,buildFacetConditionsManager:()=>XT,buildFacetManager:()=>sP,buildFieldSortCriterion:()=>Cp,buildFieldSuggestions:()=>WP,buildFoldedResultList:()=>nk,buildGeneratedAnswer:()=>fk,buildHistoryManager:()=>Tk,buildInstantResults:()=>jk,buildInteractiveCitation:()=>hk,buildInteractiveGeneratedAnswerInlineLink:()=>Sk,buildInteractiveInstantResult:()=>Pk,buildInteractiveRecentResult:()=>oO,buildInteractiveResult:()=>pO,buildNoSortCriterion:()=>bp,buildNotifyTrigger:()=>d0,buildNumericFacet:()=>GP,buildNumericFilter:()=>HP,buildNumericRange:()=>Vc,buildPager:()=>Qk,buildQueryError:()=>Gk,buildQueryExpression:()=>G3,buildQueryRankingExpressionSortCriterion:()=>xp,buildQuerySummary:()=>Hk,buildQueryTrigger:()=>p0,buildQuickview:()=>Yk,buildRecentQueriesList:()=>tO,buildRecentResultsList:()=>iO,buildRedirectionTrigger:()=>f0,buildRelevanceInspector:()=>dO,buildRelevanceSortCriterion:()=>is,buildResultList:()=>fO,buildResultTemplatesManager:()=>R0,buildResultsPerPage:()=>gO,buildSearchBox:()=>hy,buildSearchEngine:()=>bT,buildSearchParameterManager:()=>Cy,buildSearchParameterSerializer:()=>ud,buildSearchStatus:()=>VO,buildSmartSnippet:()=>QO,buildSmartSnippetQuestionsList:()=>$O,buildSort:()=>KO,buildStandaloneSearchBox:()=>ZO,buildStaticFilter:()=>e0,buildStaticFilterValue:()=>$C,buildTab:()=>r0,buildTabManager:()=>n0,buildUrlManager:()=>v0,currentPageSelector:()=>mo,currentPagesSelector:()=>ay,deserializeRelativeDate:()=>vR,facetRequestSelector:()=>gp,facetResponseSelectedValuesSelector:()=>Cw,facetResponseSelector:()=>Xi,getAnalyticsNextApiBaseUrl:()=>Rd,getOrganizationEndpoint:()=>gr,getSampleSearchEngineConfiguration:()=>rC,getSearchApiBaseUrl:()=>vt,loadAdvancedSearchQueryActions:()=>ZH,loadAutomaticFacetSetActions:()=>p3,loadBreadcrumbActions:()=>n3,loadCategoryFacetSetActions:()=>f3,loadClickAnalyticsActions:()=>e3,loadConfigurationActions:()=>o3,loadContextActions:()=>i3,loadDateFacetSetActions:()=>g3,loadDebugActions:()=>s3,loadDictionaryFieldContextActions:()=>c3,loadDidYouMeanActions:()=>u3,loadExcerptLengthActions:()=>l3,loadFacetOptionsActions:()=>d3,loadFacetSetActions:()=>m3,loadFieldActions:()=>y3,loadFoldingActions:()=>S3,loadGeneratedAnswerActions:()=>v3,loadGenericAnalyticsActions:()=>t3,loadHistoryActions:()=>A3,loadIPXActionsHistoryActions:()=>XH,loadInstantResultsActions:()=>C3,loadNumericFacetSetActions:()=>h3,loadPaginationActions:()=>x3,loadPipelineActions:()=>b3,loadQueryActions:()=>w3,loadQuerySetActions:()=>R3,loadQuerySuggestActions:()=>F3,loadQuestionAnsweringActions:()=>E3,loadRecentQueriesActions:()=>I3,loadRecentResultsActions:()=>T3,loadResultPreviewActions:()=>P3,loadSearchActions:()=>_3,loadSearchAnalyticsActions:()=>r3,loadSearchConfigurationActions:()=>a3,loadSearchHubActions:()=>N3,loadSearchParameterActions:()=>D3,loadSortCriteriaActions:()=>V3,loadStandaloneSearchBoxSetActions:()=>j3,loadStaticFilterSetActions:()=>L3,loadTabSetActions:()=>U3,maxPageSelector:()=>od,parseCriterionExpression:()=>F0,validateRelativeDate:()=>Oo});module.exports=H0(H3);d();c();l();u();var Yy={};Fu(Yy,{escapeHtml:()=>qi,getHighlightedSuggestion:()=>Ky,highlightString:()=>C_});d();c();l();u();d();c();l();u();function m_(e,t){let r=`
|
|
21
21
|
The following properties are invalid:
|
|
22
22
|
|
|
23
23
|
${e.join(`
|
|
24
24
|
`)}
|
|
25
25
|
|
|
26
26
|
${t}
|
|
27
|
-
`;return new
|
|
28
|
-
${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":yN(g,n,t);break}}}}function yN(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function SN(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function fx(){return{data:"",event:"",id:"",retry:void 0}}var Ky="text/event-stream",vN=1e3,yx="last-event-id";function Sx(){return typeof window<"u"}function vd(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:i,openWhenHidden:p,fetch:f,...m}){return new Promise((g,y)=>{let x={...r};x.accept||(x.accept=Ky);let v;function C(){v?.abort(),document.hidden||k()}!p&&Sx()&&document.addEventListener("visibilitychange",C);let b=vN,w;function F(){Sx()&&document.removeEventListener("visibilitychange",C),clearTimeout(w),v?.abort()}t?.addEventListener("abort",()=>{F(),g()});let I=f??S,E=n??AN;function k(){return _k2.apply(this,arguments)}function _k2(){_k2=_asyncToGenerator(function*(){v=s.AbortController?new s.AbortController:null;try{let T=yield I(e,{...m,headers:x,signal:v?.signal});yield E(T),yield mx(T.body,gx(hx(D=>{D?x[yx]=D:delete x[yx]},D=>{b=D},o))),a?.(),F(),g()}catch(T){if(!v?.signal?.aborted)try{let D=i?.(T)??b;clearTimeout(w),w=setTimeout(k,D)}catch(D){F(),y(D)}}});return _k2.apply(this,arguments)}k()})}function AN(e){let t=e.headers.get("content-type");if(!t?.startsWith(Ky))throw new Error(`Expected content-type to be ${Ky}, Actual: ${t}`)}d();c();u();l();var ho=class{constructor(t){me(this,"_basePath");me(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};var CN=(e,t,r)=>new ho(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,vx=3,xN=5e3,bN="text/event-stream",Xy=1,Yy=class extends Error{},kl=class extends Error{constructor(r){super(r.message);me(this,"payload",r)}},Jy=class{constructor(){me(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},Ad=class{constructor(t){me(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:i}=t,{write:p,abort:f,close:m,resetAnswer:g}=r,y=new Jy;if(!a){this.logger.error("No stream ID found");return}let x=0,v,C=()=>{v&&!y.isActive(v)&&(w?.abort(),g(),F())},b=()=>{y.remove(v),v=px(C,v,xN),y.add(v)},w=new s.AbortController,F=()=>vd(CN(n,o,a),{method:"GET",fetch:S,headers:{Authorization:`Bearer ${i}`,accept:"*/*"},openWhenHidden:!0,signal:w?.signal,onopen(I){return _asyncToGenerator(function*(){if(I.ok&&I.headers.get("content-type")===bN)return;throw I.status>=400&&I.status<500&&I.status!==429?new kl({message:"Error opening stream",code:I.status}):new Yy})()},onmessage:I=>{if(w?.signal.aborted)return;let E=JSON.parse(I.data);if(E.finishReason==="ERROR"){y.remove(v),w?.abort(),f({message:E.errorMessage,code:E.statusCode});return}p(E),x=0,E.finishReason==="COMPLETED"?(y.remove(v),m()):b()},onerror:I=>{if(!w?.signal.aborted){if(y.remove(v),I instanceof kl)throw w?.abort(),f(I),I;if(++x>vx){this.logger.info("Maximum retry exceeded.");let E={message:"Failed to complete stream.",code:Xy};throw w?.abort(),f(E),new kl(E)}this.logger.info(`Retrying...(${x}/${vx})`),g()}}});return F(),w}};d();c();u();l();var Cd=e=>e;d();c();u();l();d();c();u();l();function qi(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function ir(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:qi(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:qi(),extendedResults:{},searchAction:void 0}}d();c();u();l();function yo(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var So=e=>{let{response:t}=e;return t.body?wN(e):RN(t)},wN=e=>EN(e)?IN(e):FN(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},RN=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function FN(e){return e.body.statusCode!==void 0}function EN(e){return e.body.exception!==void 0}var IN=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();u();l();var kx=Vr(Ex(),1);d();c();u();l();var K=new Error("Failed to load reducers."),Mi=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},da=class extends Error{constructor(r,n){super();me(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();u();l();function Ix(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function Tx(e){return typeof e!="object"||!e?!1:Object.values(e).every(e_)}function e_(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Px(e){return e===429}var Lr=class e{static call(t){return _asyncToGenerator(function*(){let r=t_(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...i}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield S(a,i);if(Px(f.status))throw f;return f});return function p(){return _ref.apply(this,arguments)}}();try{let f=yield(0,kx.backOff)(p,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(m){let g=m&&Px(m.status);return g&&(n.info("Platform retrying request"),yield new Promise(y=>setTimeout(y,1e3))),g});return function retry(_x4){return _ref2.apply(this,arguments)}}()});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new Mi;case 404:throw new da(a,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new da(a):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:i}=r,{signal:p,...f}=t,m=Pl(f);try{let g=yield o(t,n,i);return{...t,...g}}catch(g){a.error(g,"Platform request preprocessing failed. Returning default request options.")}return m})()}};function gr(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function ji(e,t,r="prod"){return e??gr(t,r)}function vt(e,t="prod"){return`${gr(e,t)}/rest/search/v2`}function bd(e,t="prod"){return`${gr(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function t_(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,p=e.method==="POST"||e.method==="PUT",f=r_(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...(p&&{body:f}),signal:i}}function r_(e,t){return t==="application/x-www-form-urlencoded"?Tx(e)?Ix(e):"":JSON.stringify(e)}d();c();u();l();var vo=class{constructor(){me(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new s.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};d();c();u();l();d();c();u();l();function Ox(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();u();l();var Gn=(e,t,r,n)=>{let o=new ho(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var Nx=(e,t)=>{let r=new ho(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},_x=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield Lr.call({...Gn(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:yo(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Ox(r),o=yield r.arrayBuffer(),i=new TextDecoder(n).decode(o);return n_(i)?{success:i}:{error:So({response:r,body:i})}});return function _x(_x5,_x6){return _ref3.apply(this,arguments)}}();function n_(e){return typeof e=="string"}d();c();u();l();function o_(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function a_(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function wd(e,t){if(t&&e.name==="AbortError")return{error:a_(e)};if(e instanceof da)return{error:o_(e)};throw e}var Rd=class{constructor(t){me(this,"options",t);me(this,"apiCallsQueues",{unknown:new vo,mainSearch:new vo,facetValues:new vo,foldingCollection:new vo,instantResults:new vo})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield Lr.call({...Gn(t,"POST","application/json","/plan"),requestParams:yo(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return wd(r);let n=yield r.json();return s_(n)?{success:n}:{error:So({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Lr.call({...Gn(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:yo(t),..._this3.options});if(r instanceof Error)return wd(r);let n=yield r.json(),o={response:r,body:n};return i_(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:So(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(p=>Lr.call({...Gn(t,"POST","application/json",""),requestParams:yo(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:p??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return wd(o,r?.disableAbortWarning);let a=yield o.json(),i={response:o,body:a};return Dx(a)?(i.body=qx(a),{success:(yield _this4.options.postprocessSearchResponseMiddleware(i)).body}):{error:So(i)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield Lr.call({...Gn(t,"POST","application/json","/facet"),requestParams:yo(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield Lr.call({...Gn(t,"POST","application/json",""),requestParams:yo(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(Dx(n)){let o={response:r,body:n};return o.body=qx(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:So({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return _x(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield Lr.call({...Gn(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return c_(n)?{success:n}:{error:So({response:r,body:n})}})()}},Fd=e=>e.success!==void 0,At=e=>e.error!==void 0;function Dx(e){return e.results!==void 0}function qx(e){let t=qi();return pe(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function i_(e){return e.completions!==void 0}function s_(e){return e.preprocessingOutput!==void 0}function c_(e){return e.fields!==void 0}d();c();u();l();var Mx=e=>e,jx=e=>e,Vx=e=>e;d();c();u();l();d();c();u();l();var z=new L({required:!0,emptyAllowed:!1}),st=new L({required:!1,emptyAllowed:!1}),Ge=new L({required:!0,emptyAllowed:!0}),PK=new L({required:!1,emptyAllowed:!0}),Ed=new ie({each:z,required:!0}),Lx=new L({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Ux=new L({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),kK=new L({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),$n=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),hr=(e,t)=>{if("required"in t)return{payload:new ve({value:t}).validate({value:e}).value};let o=new X({options:{required:!0},values:t}).validate(e);if(o)throw new Il(o);return{payload:e}},O=(e,t)=>{try{return hr(e,t)}catch(r){return{payload:e,error:$n(r)}}},ut=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Qx(e,t,r,o,"Controller initialization error")},He=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Qx(e,t,r,o,"Controller initialization error")},Qx=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};d();c();u();l();d();c();u();l();d();c();u();l();function Pt(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var l_=typeof Symbol=="function"&&Symbol.observable||"@@observable",Bx=l_,sS=()=>Math.random().toString(36).substring(7).split("").join("."),u_={INIT:`@@redux/INIT${sS()}`,REPLACE:`@@redux/REPLACE${sS()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${sS()}`},Id=u_;function Xr(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function cS(e,t,r){if(typeof e!="function")throw new Error(Pt(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Pt(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Pt(1));return r(cS)(e,t)}let n=e,o=t,a=new Map,i=a,p=0,f=!1;function m(){i===a&&(i=new Map,a.forEach((w,F)=>{i.set(F,w)}))}function g(){if(f)throw new Error(Pt(3));return o}function y(w){if(typeof w!="function")throw new Error(Pt(4));if(f)throw new Error(Pt(5));let F=!0;m();let I=p++;return i.set(I,w),function(){if(F){if(f)throw new Error(Pt(6));F=!1,m(),i.delete(I),a=null}}}function x(w){if(!Xr(w))throw new Error(Pt(7));if(typeof w.type>"u")throw new Error(Pt(8));if(typeof w.type!="string")throw new Error(Pt(17));if(f)throw new Error(Pt(9));try{f=!0,o=n(o,w)}finally{f=!1}return(a=i).forEach(I=>{I()}),w}function v(w){if(typeof w!="function")throw new Error(Pt(10));n=w,x({type:Id.REPLACE})}function C(){let w=y;return{subscribe(F){if(typeof F!="object"||F===null)throw new Error(Pt(11));function I(){let k=F;k.next&&k.next(g())}return I(),{unsubscribe:w(I)}},[Bx](){return this}}}return x({type:Id.INIT}),{dispatch:x,subscribe:y,getState:g,replaceReducer:v,[Bx]:C}}function d_(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Id.INIT})>"u")throw new Error(Pt(12));if(typeof r(void 0,{type:Id.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Pt(13))})}function Vi(e){let t=Object.keys(e),r={};for(let i=0;i<t.length;i++){let p=t[i];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{d_(r)}catch(i){a=i}return function(p={},f){if(a)throw a;let m=!1,g={};for(let y=0;y<n.length;y++){let x=n[y],v=r[x],C=p[x],b=v(C,f);if(typeof b>"u"){let w=f&&f.type;throw new Error(Pt(14))}g[x]=b,m=m||b!==C}return m=m||n.length!==Object.keys(p).length,m?g:p}}function _l(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Gx(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Pt(15))},i={getState:o.getState,dispatch:(f,...m)=>a(f,...m)},p=e.map(f=>f(i));return a=_l(...p)(o.dispatch),{...o,dispatch:a}}}function Dl(e){return Xr(e)&&"type"in e&&typeof e.type=="string"}d();c();u();l();var yS=Symbol.for("immer-nothing"),ql=Symbol.for("immer-draftable"),ht=Symbol.for("immer-state");function kt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var sr=Object,fa=sr.getPrototypeOf,Ml="constructor",Ql="prototype",dS="configurable",Od="enumerable",Pd="writable",jl="value",Yt=e=>!!e&&!!e[ht];function jt(e){return e?Xx(e)||Gl(e)||!!e[ql]||!!e[Ml]?.[ql]||$l(e)||Hl(e):!1}var p_=sr[Ql][Ml].toString(),$x=new WeakMap;function Xx(e){if(!e||!Ui(e))return!1;let t=fa(e);if(t===null||t===sr[Ql])return!0;let r=sr.hasOwnProperty.call(t,Ml)&&t[Ml];if(r===Object)return!0;if(!pa(r))return!1;let n=$x.get(r);return n===void 0&&(n=Function.toString.call(r),$x.set(r,n)),n===p_}function Zx(e){return Yt(e)||kt(15,e),e[ht].base_}function Bl(e,t,r=!0){ma(e)===0?(r?Reflect.ownKeys(e):sr.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function ma(e){let t=e[ht];return t?t.type_:Gl(e)?1:$l(e)?2:Hl(e)?3:0}var Li=(e,t,r=ma(e))=>r===2?e.has(t):sr[Ql].hasOwnProperty.call(e,t),Hn=(e,t,r=ma(e))=>r===2?e.get(t):e[t],Nd=(e,t,r,n=ma(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function f_(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Gl=Array.isArray,$l=e=>e instanceof Map,Hl=e=>e instanceof Set,Ui=e=>typeof e=="object",pa=e=>typeof e=="function",lS=e=>typeof e=="boolean";function m_(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var g_=e=>Ui(e)?e?.[ht]:null,zn=e=>e.copy_||e.base_;var SS=e=>e.modified_?e.copy_:e.base_;function pS(e,t){if($l(e))return new Map(e);if(Hl(e))return new Set(e);if(Gl(e))return Array[Ql].slice.call(e);let r=Xx(e);if(t===!0||t==="class_only"&&!r){let n=sr.getOwnPropertyDescriptors(e);delete n[ht];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],p=n[i];p[Pd]===!1&&(p[Pd]=!0,p[dS]=!0),(p.get||p.set)&&(n[i]={[dS]:!0,[Pd]:!0,[Od]:p[Od],[jl]:e[i]})}return sr.create(fa(e),n)}else{let n=fa(e);if(n!==null&&r)return{...e};let o=sr.create(n);return sr.assign(o,e)}}function vS(e,t=!1){return Vd(e)||Yt(e)||!jt(e)||(ma(e)>1&&sr.defineProperties(e,{set:Td,add:Td,clear:Td,delete:Td}),sr.freeze(e),t&&Bl(e,(r,n)=>{vS(n,!0)},!1)),e}function h_(){kt(2)}var Td={[jl]:h_};function Vd(e){return e===null||!Ui(e)?!0:sr.isFrozen(e)}var _d="MapSet",Dd="Patches",Hx="ArrayMethods",qd={};function ga(e){let t=qd[e];return t||kt(0,e),t}var zx=e=>!!qd[e];function y_(e,t){qd[e]||(qd[e]=t)}var Vl,eb=()=>Vl,S_=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:zx(_d)?ga(_d):void 0,arrayMethodsPlugin_:zx(Hx)?ga(Hx):void 0});function Wx(e,t){t&&(e.patchPlugin_=ga(Dd),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function fS(e){mS(e),e.drafts_.forEach(v_),e.drafts_=null}function mS(e){e===Vl&&(Vl=e.parent_)}var Kx=e=>Vl=S_(Vl,e);function v_(e){let t=e[ht];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Yx(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[ht].modified_&&(fS(t),kt(4)),jt(e)&&(e=Jx(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[ht].base_,e,t)}else e=Jx(t,r);return A_(t,e,!0),fS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==yS?e:void 0}function Jx(e,t){if(Vd(t))return t;let r=t[ht];if(!r)return Md(t,e.handledSet_,e);if(!Ld(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);nb(r,e)}return r.copy_}function A_(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&vS(t,r)}function tb(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Ld=(e,t)=>e.scope_===t,C_=[];function rb(e,t,r,n){let o=zn(e),a=e.type_;if(n!==void 0&&Hn(o,n,a)===t){Nd(o,n,r,a);return}if(!e.draftLocations_){let p=e.draftLocations_=new Map;Bl(o,(f,m)=>{if(Yt(m)){let g=p.get(m)||[];g.push(f),p.set(m,g)}})}let i=e.draftLocations_.get(t)??C_;for(let p of i)Nd(o,p,r,a)}function x_(e,t,r){e.callbacks_.push(function(o){let a=t;if(!a||!Ld(a,o))return;o.mapSetPlugin_?.fixSetContents(a);let i=SS(a);rb(e,a.draft_??a,i,r),nb(a,o)})}function nb(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let o=n.getPath(e);o&&n.generatePatches_(e,o,t)}tb(e)}}function b_(e,t,r){let{scope_:n}=e;if(Yt(r)){let o=r[ht];Ld(o,n)&&o.callbacks_.push(function(){kd(e);let i=SS(o);rb(e,r,i,t)})}else jt(r)&&e.callbacks_.push(function(){let a=zn(e);e.type_===3?a.has(r)&&Md(r,n.handledSet_,n):Hn(a,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Md(Hn(e.copy_,t,e.type_),n.handledSet_,n)})}function Md(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||Yt(e)||t.has(e)||!jt(e)||Vd(e)||(t.add(e),Bl(e,(n,o)=>{if(Yt(o)){let a=o[ht];if(Ld(a,r)){let i=SS(a);Nd(e,n,i,e.type_),tb(a)}}else jt(o)&&Md(o,t,r)})),e}function w_(e,t){let r=Gl(e),n={type_:r?1:0,scope_:t?t.scope_:eb(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,a=jd;r&&(o=[n],a=Ll);let{revoke:i,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=i,[p,n]}var jd={get(e,t){if(t===ht)return e;let r=e.scope_.arrayMethodsPlugin_,n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=zn(e);if(!Li(o,t,e.type_))return F_(e,o,t);let a=o[t];if(e.finalized_||!jt(a)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&m_(t))return a;if(a===uS(e.base_,t)||R_(e,t,a)){kd(e);let i=e.type_===1?+t:t,p=hS(e.scope_,a,e,i);return e.copy_[i]=p}return a},has(e,t){return t in zn(e)},ownKeys(e){return Reflect.ownKeys(zn(e))},set(e,t,r){let n=ob(zn(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=uS(zn(e),t),a=o?.[ht];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(f_(r,o)&&(r!==void 0||Li(e.base_,t,e.type_)))return!0;kd(e),gS(e)}return e.copy_[t]===r&&(r!==void 0||Li(e.copy_,t,e.type_))||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),b_(e,t,r)),!0},deleteProperty(e,t){return kd(e),uS(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),gS(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=zn(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Pd]:!0,[dS]:e.type_!==1||t!=="length",[Od]:n[Od],[jl]:r[t]}},defineProperty(){kt(11)},getPrototypeOf(e){return fa(e.base_)},setPrototypeOf(){kt(12)}},Ll={};for(let e in jd){let t=jd[e];Ll[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Ll.deleteProperty=function(e,t){return Ll.set.call(this,e,t,void 0)};Ll.set=function(e,t,r){return jd.set.call(this,e[0],t,r,e[0])};function uS(e,t){let r=e[ht];return(r?zn(r):e)[t]}function R_(e,t,r){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!jt(r)||r[ht]?!1:e.baseRefs_.has(r)}function F_(e,t,r){let n=ob(t,r);return n?jl in n?n[jl]:n.get?.call(e.draft_):void 0}function ob(e,t){if(!(t in e))return;let r=fa(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=fa(r)}}function gS(e){e.modified_||(e.modified_=!0,e.parent_&&gS(e.parent_))}function kd(e){e.copy_||(e.assigned_=new Map,e.copy_=pS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var E_=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(pa(t)&&!pa(r)){let a=r;r=t;let i=this;return function(f=a,...m){return i.produce(f,g=>r.call(this,g,...m))}}pa(r)||kt(6),n!==void 0&&!pa(n)&&kt(7);let o;if(jt(t)){let a=Kx(this),i=hS(a,t,void 0),p=!0;try{o=r(i),p=!1}finally{p?fS(a):mS(a)}return Wx(a,n),Yx(o,a)}else if(!t||!Ui(t)){if(o=r(t),o===void 0&&(o=t),o===yS&&(o=void 0),this.autoFreeze_&&vS(o,!0),n){let a=[],i=[];ga(Dd).generateReplacementPatches_(t,o,{patches_:a,inversePatches_:i}),n(a,i)}return o}else kt(1,t)},this.produceWithPatches=(t,r)=>{if(pa(t))return(i,...p)=>this.produceWithPatches(i,f=>t(f,...p));let n,o;return[this.produce(t,r,(i,p)=>{n=i,o=p}),n,o]},lS(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),lS(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),lS(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){jt(e)||kt(8),Yt(e)&&(e=Ud(e));let t=Kx(this),r=hS(t,e,void 0);return r[ht].isManual_=!0,mS(t),r}finishDraft(e,t){let r=e&&e[ht];(!r||!r.isManual_)&&kt(9);let{scope_:n}=r;return Wx(n,t),Yx(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=ga(Dd).applyPatches_;return Yt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function hS(e,t,r,n){let[o,a]=$l(t)?ga(_d).proxyMap_(t,r):Hl(t)?ga(_d).proxySet_(t,r):w_(t,r);return(r?.scope_??eb()).drafts_.push(o),a.callbacks_=r?.callbacks_??[],a.key_=n,r&&n!==void 0?x_(r,a,n):a.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:m}=f;a.modified_&&m&&m.generatePatches_(a,[],f)}),o}function Ud(e){return Yt(e)||kt(10,e),ab(e)}function ab(e){if(!jt(e)||Vd(e))return e;let t=e[ht],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=pS(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=pS(e,!0);return Bl(r,(o,a)=>{Nd(r,o,ab(a))},n),t&&(t.finalized_=!1),r}function ib(){function t(C,b=[]){if(C.key_!==void 0){let w=C.parent_.copy_??C.parent_.base_,F=g_(Hn(w,C.key_)),I=Hn(w,C.key_);if(I===void 0||I!==C.draft_&&I!==C.base_&&I!==C.copy_||F!=null&&F.base_!==C.base_)return null;let E=C.parent_.type_===3,k;if(E){let T=C.parent_;k=Array.from(T.drafts_.keys()).indexOf(C.key_)}else k=C.key_;if(!(E&&w.size>k||Li(w,k)))return null;b.push(k)}if(C.parent_)return t(C.parent_,b);b.reverse();try{r(C.copy_,b)}catch{return null}return b}function r(C,b){let w=C;for(let F=0;F<b.length-1;F++){let I=b[F];if(w=Hn(w,I),!Ui(w)||w===null)throw new Error(`Cannot resolve path at '${b.join("/")}'`)}return w}let n="replace",o="add",a="remove";function i(C,b,w){if(C.scope_.processedForPatches_.has(C))return;C.scope_.processedForPatches_.add(C);let{patches_:F,inversePatches_:I}=w;switch(C.type_){case 0:case 2:return f(C,b,F,I);case 1:return p(C,b,F,I);case 3:return m(C,b,F,I)}}function p(C,b,w,F){let{base_:I,assigned_:E}=C,k=C.copy_;k.length<I.length&&([I,k]=[k,I],[w,F]=[F,w]);let T=C.allIndicesReassigned_===!0;for(let D=0;D<I.length;D++){let G=k[D],U=I[D];if((T||E?.get(D.toString()))&&G!==U){let B=G?.[ht];if(B&&B.modified_)continue;let V=b.concat([D]);w.push({op:n,path:V,value:v(G)}),F.push({op:n,path:V,value:v(U)})}}for(let D=I.length;D<k.length;D++){let G=b.concat([D]);w.push({op:o,path:G,value:v(k[D])})}for(let D=k.length-1;I.length<=D;--D){let G=b.concat([D]);F.push({op:a,path:G})}}function f(C,b,w,F){let{base_:I,copy_:E,type_:k}=C;Bl(C.assigned_,(T,D)=>{let G=Hn(I,T,k),U=Hn(E,T,k),j=D?Li(I,T)?n:o:a;if(G===U&&j===n)return;let B=b.concat(T);w.push(j===a?{op:j,path:B}:{op:j,path:B,value:v(U)}),F.push(j===o?{op:a,path:B}:j===a?{op:o,path:B,value:v(G)}:{op:n,path:B,value:v(G)})})}function m(C,b,w,F){let{base_:I,copy_:E}=C,k=0;I.forEach(T=>{if(!E.has(T)){let D=b.concat([k]);w.push({op:a,path:D,value:T}),F.unshift({op:o,path:D,value:T})}k++}),k=0,E.forEach(T=>{if(!I.has(T)){let D=b.concat([k]);w.push({op:o,path:D,value:T}),F.unshift({op:a,path:D,value:T})}k++})}function g(C,b,w){let{patches_:F,inversePatches_:I}=w;F.push({op:n,path:[],value:b===yS?void 0:b}),I.push({op:n,path:[],value:C})}function y(C,b){return b.forEach(w=>{let{path:F,op:I}=w,E=C;for(let G=0;G<F.length-1;G++){let U=ma(E),j=F[G];typeof j!="string"&&typeof j!="number"&&(j=""+j),(U===0||U===1)&&(j==="__proto__"||j===Ml)&&kt(19),pa(E)&&j===Ql&&kt(19),E=Hn(E,j),(E===null||!Ui(E))&&kt(18,F.join("/"))}let k=ma(E),T=x(w.value),D=F[F.length-1];switch(I){case n:switch(k){case 2:return E.set(D,T);case 3:kt(16);default:return E[D]=T}case o:switch(k){case 1:return D==="-"?E.push(T):E.splice(D,0,T);case 2:return E.set(D,T);case 3:return E.add(T);default:return E[D]=T}case a:switch(k){case 1:return E.splice(D,1);case 2:return E.delete(D);case 3:return E.delete(w.value);default:return delete E[D]}default:kt(17,I)}}),C}function x(C){if(!jt(C))return C;if(Gl(C))return C.map(x);if($l(C))return new Map(Array.from(C.entries()).map(([w,F])=>[w,x(F)]));if(Hl(C))return new Set(Array.from(C).map(x));let b=Object.create(fa(C));for(let w in C)b[w]=x(C[w]);return Li(C,ql)&&(b[ql]=C[ql]),b}function v(C){return Yt(C)?x(C):C}y_(Dd,{applyPatches_:y,generatePatches_:i,generateReplacementPatches_:g,getPath:t})}var Ul=new E_,ha=Ul.produce,AS=Ul.produceWithPatches.bind(Ul);var CS=Ul.applyPatches.bind(Ul);d();c();u();l();function I_(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function T_(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){let r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var sb=e=>Array.isArray(e)?e:[e];function P_(e){let t=Array.isArray(e[0])?e[0]:e;return T_(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function k_(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var O_=class{constructor(e){this.value=e}deref(){return this.value}},N_=()=>typeof WeakRef>"u"?O_:WeakRef,lb=N_(),__=0,cb=1;function Qd(){return{s:__,v:void 0,o:null,p:null}}function D_(e){return e instanceof lb?e.deref():e}function zl(e,t={}){let r=Qd(),{resultEqualityCheck:n}=t,o,a=0;function i(){let p=r,{length:f}=arguments;for(let y=0,x=f;y<x;y++){let v=arguments[y];if(typeof v=="function"||typeof v=="object"&&v!==null){let C=p.o;C===null&&(p.o=C=new WeakMap);let b=C.get(v);b===void 0?(p=Qd(),C.set(v,p)):p=b}else{let C=p.p;C===null&&(p.p=C=new Map);let b=C.get(v);b===void 0?(p=Qd(),C.set(v,p)):p=b}}let m=p,g;if(p.s===cb)g=p.v;else if(g=e.apply(null,arguments),a++,n){let y=D_(o);y!=null&&n(y,g)&&(g=y,a!==0&&a--),o=typeof g=="object"&&g!==null||typeof g=="function"?new lb(g):g}return m.s=cb,m.v=g,g}return i.clearCache=()=>{r=Qd(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function q_(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,i=0,p,f={},m=o.pop();typeof m=="object"&&(f=m,m=o.pop()),I_(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let g={...r,...f},{memoize:y,memoizeOptions:x=[],argsMemoize:v=zl,argsMemoizeOptions:C=[]}=g,b=sb(x),w=sb(C),F=P_(o),I=y(function(){return a++,m.apply(null,arguments)},...b),E=!0,k=v(function(){i++;let D=k_(F,arguments);return p=I.apply(null,D),p},...w);return Object.assign(k,{resultFunc:m,memoizedResultFunc:I,dependencies:F,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:y,argsMemoize:v})};return Object.assign(n,{withTypes:()=>n}),n}var tt=q_(zl);d();c();u();l();function ub(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var db=ub(),pb=ub;var M_=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?_l:_l.apply(null,arguments)},dY=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},j_=e=>e&&typeof e.match=="function";function P(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Jt(0));return{type:e,payload:o.payload,...("meta"in o&&{meta:o.meta}),...("error"in o&&{error:o.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>Dl(n)&&n.type===e,r}var Ab=class Wl extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Wl.prototype)}static get[Symbol.species](){return Wl}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Wl(...t[0].concat(this)):new Wl(...t.concat(this))}};function fb(e){return jt(e)?ha(e,()=>{}):e}function Bd(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function V_(e){return typeof e=="boolean"}var L_=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new Ab;return r&&(V_(r)?i.push(db):i.push(pb(r.extraArgument))),i},Kl="RTK_autoBatch",Gi=()=>e=>({payload:e,meta:{[Kl]:!0}}),mb=e=>t=>{setTimeout(t,e)},U_=(e,t)=>r=>{let n=!1,o=()=>{n||(n=!0,cancelAnimationFrame(a),clearTimeout(i),r())},a=e(o),i=setTimeout(o,t)},Q_=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,i=!1,p=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?U_(window.requestAnimationFrame,100):mb(10):e.type==="callback"?e.queueNotification:mb(e.timeout),m=()=>{i=!1,a&&(a=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let y=()=>o&&g(),x=n.subscribe(y);return p.add(g),()=>{x(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Kl],a=!o,a&&(i||(i=!0,f(m))),n.dispatch(g)}finally{o=!0}}})},B_=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Ab(e);return n&&o.push(Q_(typeof n=="object"?n:void 0)),o};function Cb(e){let t=L_(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:a=!0,preloadedState:i=void 0,enhancers:p=void 0}=e||{},f;if(typeof r=="function")f=r;else if(Xr(r))f=Vi(r);else throw new Error(Jt(1));let m;typeof n=="function"?m=n(t):m=t();let g=_l;o&&(g=M_({trace:!1,...(typeof o=="object"&&o)}));let y=Gx(...m),x=B_(y),v=typeof p=="function"?p(x):x(),C=g(...v);return cS(f,i,C)}function xb(e){let t={},r=[],n,o={addCase(a,i){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(Jt(28));if(p in t)throw new Error(Jt(29));return t[p]=i,o},addAsyncThunk(a,i){return i.pending&&(t[a.pending.type]=i.pending),i.rejected&&(t[a.rejected.type]=i.rejected),i.fulfilled&&(t[a.fulfilled.type]=i.fulfilled),i.settled&&r.push({matcher:a.settled,reducer:i.settled}),o},addMatcher(a,i){return r.push({matcher:a,reducer:i}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function G_(e){return typeof e=="function"}function ae(e,t){let[r,n,o]=xb(t),a;if(G_(e))a=()=>fb(e());else{let p=fb(e);a=()=>p}function i(p=a(),f){let m=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return m.filter(g=>!!g).length===0&&(m=[o]),m.reduce((g,y)=>{if(y)if(Yt(g)){let v=y(g,f);return v===void 0?g:v}else{if(jt(g))return ha(g,x=>y(x,f));{let x=y(g,f);if(x===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}}return g},p)}return i.getInitialState=a,i}var bb=(e,t)=>j_(e)?e.match(t):e(t);function Zr(...e){return t=>e.some(r=>bb(r,t))}function Bi(...e){return t=>e.every(r=>bb(r,t))}function zd(e,t){if(!e||!e.meta)return!1;let r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function Yl(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Wd(...e){return e.length===0?t=>zd(t,["pending"]):Yl(e)?Zr(...e.map(t=>t.pending)):Wd()(e[0])}function Sa(...e){return e.length===0?t=>zd(t,["rejected"]):Yl(e)?Zr(...e.map(t=>t.rejected)):Sa()(e[0])}function Jl(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Bi(Sa(...e),t):Yl(e)?Bi(Sa(...e),t):Jl()(e[0])}function Wn(...e){return e.length===0?t=>zd(t,["fulfilled"]):Yl(e)?Zr(...e.map(t=>t.fulfilled)):Wn()(e[0])}function Kd(...e){return e.length===0?t=>zd(t,["pending","fulfilled","rejected"]):Yl(e)?Zr(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Kd()(e[0])}var $_="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Xl=(e=21)=>{let t="",r=e;for(;r--;)t+=$_[Math.random()*64|0];return t},H_=["name","message","stack","code"],xS=class{constructor(e,t){me(this,"payload");me(this,"meta");me(this,"_type");this.payload=e,this.meta=t}},gb=class{constructor(e,t){me(this,"payload");me(this,"meta");me(this,"_type");this.payload=e,this.meta=t}},z_=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of H_)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},hb="External signal was aborted",xe=(()=>{function e(t,r,n){let o=P(t+"/fulfilled",(f,m,g,y)=>({payload:f,meta:{...(y||{}),arg:g,requestId:m,requestStatus:"fulfilled"}})),a=P(t+"/pending",(f,m,g)=>({payload:void 0,meta:{...(g||{}),arg:m,requestId:f,requestStatus:"pending"}})),i=P(t+"/rejected",(f,m,g,y,x)=>({payload:y,error:(n&&n.serializeError||z_)(f||"Rejected"),meta:{...(x||{}),arg:g,requestId:m,rejectedWithValue:!!y,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f,{signal:m}={}){return(g,y,x)=>{let v=n?.idGenerator?n.idGenerator(f):Xl(),C=new s.AbortController,b,w;function F(E){w=E,C.abort()}m&&(m.aborted?F(hb):m.addEventListener("abort",()=>F(hb),{once:!0}));let I=_asyncToGenerator(function*(){let E;try{let T=n?.condition?.(f,{getState:y,extra:x});if(K_(T)&&(T=yield T),T===!1||C.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let D=new Promise((G,U)=>{b=()=>{U({name:"AbortError",message:w||"Aborted"})},C.signal.addEventListener("abort",b,{once:!0})});g(a(v,f,n?.getPendingMeta?.({requestId:v,arg:f},{getState:y,extra:x}))),E=yield Promise.race([D,Promise.resolve(r(f,{dispatch:g,getState:y,extra:x,requestId:v,signal:C.signal,abort:F,rejectWithValue:(G,U)=>new xS(G,U),fulfillWithValue:(G,U)=>new gb(G,U)})).then(G=>{if(G instanceof xS)throw G;return G instanceof gb?o(G.payload,v,f,G.meta):o(G,v,f)})])}catch(T){E=T instanceof xS?i(null,v,f,T.payload,T.meta):i(T,v,f)}finally{b&&C.signal.removeEventListener("abort",b)}return n&&!n.dispatchConditionRejection&&i.match(E)&&E.meta.condition||g(E),E})();return Object.assign(I,{abort:F,requestId:v,arg:f,unwrap(){return I.then(W_)}})}}return Object.assign(p,{pending:a,rejected:i,fulfilled:o,settled:Zr(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function W_(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function K_(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var wb=Symbol.for("rtk-slice-createasyncthunk"),fY={[wb]:xe};function Y_(e,t){return`${e}/${t}`}function J_({creators:e}={}){let t=e?.asyncThunk?.[wb];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Jt(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(Z_()):n.reducers)||{},p=Object.keys(i),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(E,k){let T=typeof E=="string"?E:E.type;if(!T)throw new Error(Jt(12));if(T in f.sliceCaseReducersByType)throw new Error(Jt(13));return f.sliceCaseReducersByType[T]=k,m},addMatcher(E,k){return f.sliceMatchers.push({matcher:E,reducer:k}),m},exposeAction(E,k){return f.actionCreators[E]=k,m},exposeCaseReducer(E,k){return f.sliceCaseReducersByName[E]=k,m}};p.forEach(E=>{let k=i[E],T={reducerName:E,type:Y_(o,E),createNotation:typeof n.reducers=="function"};tD(k)?nD(T,k,m,t):eD(T,k,m)});function g(){let[E={},k=[],T=void 0]=typeof n.extraReducers=="function"?xb(n.extraReducers):[n.extraReducers],D={...E,...f.sliceCaseReducersByType};return ae(n.initialState,G=>{for(let U in D)G.addCase(U,D[U]);for(let U of f.sliceMatchers)G.addMatcher(U.matcher,U.reducer);for(let U of k)G.addMatcher(U.matcher,U.reducer);T&&G.addDefaultCase(T)})}let y=E=>E,x=new Map,v=new WeakMap,C;function b(E,k){return C||(C=g()),C(E,k)}function w(){return C||(C=g()),C.getInitialState()}function F(E,k=!1){function T(G){let U=G[E];return typeof U>"u"&&k&&(U=Bd(v,T,w)),U}function D(G=y){let U=Bd(x,k,()=>new WeakMap);return Bd(U,G,()=>{let j={};for(let[B,V]of Object.entries(n.selectors??{}))j[B]=X_(V,G,()=>Bd(v,G,w),k);return j})}return{reducerPath:E,getSelectors:D,get selectors(){return D(T)},selectSlice:T}}let I={name:o,reducer:b,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:w,...F(a),injectInto(E,{reducerPath:k,...T}={}){let D=k??a;return E.inject({reducerPath:D,reducer:b},T),{...I,...F(D,!0)}}};return I}}function X_(e,t,r,n){function o(a,...i){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...i)}return o.unwrapped=e,o}var va=J_();function Z_(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function eD({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!rD(n))throw new Error(Jt(17));a=n.reducer,i=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?P(e,i):P(e))}function tD(e){return e._reducerDefinitionType==="asyncThunk"}function rD(e){return e._reducerDefinitionType==="reducerWithPrepare"}function nD({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Jt(18));let{payloadCreator:a,fulfilled:i,pending:p,rejected:f,settled:m,options:g}=r,y=o(e,a,g);n.exposeAction(t,y),i&&n.addCase(y.fulfilled,i),p&&n.addCase(y.pending,p),f&&n.addCase(y.rejected,f),m&&n.addMatcher(y.settled,m),n.exposeCaseReducer(t,{fulfilled:i||Gd,pending:p||Gd,rejected:f||Gd,settled:m||Gd})}function Gd(){}var oD="task",Rb="listener",Fb="completed",RS="cancelled",aD=`task-${RS}`,iD=`task-${Fb}`,bS=`${Rb}-${RS}`,sD=`${Rb}-${Fb}`,Yd=class{constructor(e){me(this,"code");me(this,"name","TaskAbortError");me(this,"message");this.code=e,this.message=`${oD} ${RS} (reason: ${e})`}},FS=(e,t)=>{if(typeof e!="function")throw new TypeError(Jt(32))},$d=()=>{},Eb=(e,t=$d)=>(e.catch(t),e),Ib=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),ya=e=>{if(e.aborted)throw new Yd(e.reason)};function Tb(e,t){let r=$d;return new Promise((n,o)=>{let a=()=>o(new Yd(e.reason));if(e.aborted){a();return}r=Ib(e,a),t.finally(()=>r()).then(n,o)}).finally(()=>{r=$d})}var cD=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof Yd?"cancelled":"rejected",error:r}}finally{t?.()}});return function cD(_x7,_x8){return _ref5.apply(this,arguments)}}(),Hd=e=>t=>Eb(Tb(e,t).then(r=>(ya(e),r))),Pb=e=>{let t=Hd(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Qi}=Object,yb={},Jd="listenerMiddleware",lD=(e,t)=>{let r=n=>Ib(e,()=>n.abort(e.reason));return(n,o)=>{FS(n,"taskExecutor");let a=new s.AbortController;r(a);let i=cD(/*#__PURE__*/_asyncToGenerator(function*(){ya(e),ya(a.signal);let p=yield n({pause:Hd(a.signal),delay:Pb(a.signal),signal:a.signal});return ya(a.signal),p}),()=>a.abort(iD));return o?.autoJoin&&t.push(i.catch($d)),{result:Hd(e)(i),cancel(){a.abort(aD)}}}},uD=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){ya(t);let a=()=>{},p=[new Promise((f,m)=>{let g=e({predicate:n,effect:(y,x)=>{x.unsubscribe(),f([y,x.getState(),x.getOriginalState()])}});a=()=>{g(),m()}})];o!=null&&p.push(new Promise(f=>setTimeout(f,o,null)));try{let f=yield Tb(t,Promise.race(p));return ya(t),f}finally{a()}});return function r(_x9,_x0){return _ref7.apply(this,arguments)}}();return(n,o)=>Eb(r(n,o))},kb=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:a}=e;if(t)o=P(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(Jt(21));return FS(a,"options.listener"),{predicate:o,type:t,effect:a}},Ob=Qi(e=>{let{type:t,predicate:r,effect:n}=kb(e);return{id:Xl(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Jt(22))}}},{withTypes:()=>Ob}),Sb=(e,t)=>{let{type:r,effect:n,predicate:o}=kb(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===o)&&a.effect===n)},wS=e=>{e.pending.forEach(t=>{t.abort(bS)})},dD=(e,t)=>()=>{for(let r of t.keys())wS(r);e.clear()},vb=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},Nb=Qi(P(`${Jd}/add`),{withTypes:()=>Nb}),pD=P(`${Jd}/removeAll`),_b=Qi(P(`${Jd}/remove`),{withTypes:()=>_b}),fD=(...e)=>{console.error(`${Jd}/error`,...e)},Db=(e={})=>{let t=new Map,r=new Map,n=v=>{let C=r.get(v)??0;r.set(v,C+1)},o=v=>{let C=r.get(v)??1;C===1?r.delete(v):r.set(v,C-1)},{extra:a,onError:i=fD}=e;FS(i,"onError");let p=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),C=>{v.unsubscribe(),C?.cancelActive&&wS(v)}),f=v=>{let C=Sb(t,v)??Ob(v);return p(C)};Qi(f,{withTypes:()=>f});let m=v=>{let C=Sb(t,v);return C&&(C.unsubscribe(),v.cancelActive&&wS(C)),!!C};Qi(m,{withTypes:()=>m});let g=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(v,C,b,w){let F=new s.AbortController,I=uD(f,F.signal),E=[];try{v.pending.add(F),n(v),yield Promise.resolve(v.effect(C,Qi({},b,{getOriginalState:w,condition:(k,T)=>I(k,T).then(Boolean),take:I,delay:Pb(F.signal),pause:Hd(F.signal),extra:a,signal:F.signal,fork:lD(F.signal,E),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((k,T,D)=>{k!==F&&(k.abort(bS),D.delete(k))})},cancel:()=>{F.abort(bS),v.pending.delete(F)},throwIfCancelled:()=>{ya(F.signal)}})))}catch(k){k instanceof Yd||vb(i,k,{raisedBy:"effect"})}finally{yield Promise.all(E),F.abort(sD),o(v),v.pending.delete(F)}});return function g(_x1,_x10,_x11,_x12){return _ref8.apply(this,arguments)}}(),y=dD(t,r);return{middleware:v=>C=>b=>{if(!Dl(b))return C(b);if(Nb.match(b))return f(b.payload);if(pD.match(b)){y();return}if(_b.match(b))return m(b.payload);let w=v.getState(),F=()=>{if(w===yb)throw new Error(Jt(23));return w},I;try{if(I=C(b),t.size>0){let E=v.getState(),k=Array.from(t.values());for(let T of k){let D=!1;try{D=T.predicate(b,E,w)}catch(G){D=!1,vb(i,G,{raisedBy:"predicate"})}D&&g(T,b,v,F)}}}finally{w=yb}return I},startListening:f,stopListening:m,clearListeners:y}};function Jt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}d();c();u();l();d();c();u();l();d();c();u();l();function qb(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}d();c();u();l();d();c();u();l();d();c();u();l();var Mb=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function mD(e){return typeof e=="string"&&Mb.test(e)}var ES=mD;d();c();u();l();var Ot=[];for(let e=0;e<256;++e)Ot.push((e+256).toString(16).slice(1));function jb(e,t=0){return(Ot[e[t+0]]+Ot[e[t+1]]+Ot[e[t+2]]+Ot[e[t+3]]+"-"+Ot[e[t+4]]+Ot[e[t+5]]+"-"+Ot[e[t+6]]+Ot[e[t+7]]+"-"+Ot[e[t+8]]+Ot[e[t+9]]+"-"+Ot[e[t+10]]+Ot[e[t+11]]+Ot[e[t+12]]+Ot[e[t+13]]+Ot[e[t+14]]+Ot[e[t+15]]).toLowerCase()}d();c();u();l();var gD=new Uint8Array(16);function IS(){return crypto.getRandomValues(gD)}d();c();u();l();function hD(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():yD(e,t,r)}function yD(e,t,r){e=e||{};let n=e.random??e.rng?.()??IS();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 jb(n)}var TS=hD;function SD(_x13){return _SD.apply(this,arguments)}function _SD(){_SD=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:i}=e;if(i!=="disabled")return n.call(r),t.send(o,a,r)});return _SD.apply(this,arguments)}var Gb="2.1.3",PS=128,$b=192,Vb=224,Lb=240,vD=248;function AD(e){return(e&vD)===Lb?4:(e&Lb)===Vb?3:(e&Vb)===$b?2:1}function CD(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&PS)!=PS)break;if(r-=3,(n&$b)!=PS){t-r>=AD(n)*3&&(r=t);break}}return e.substring(0,r)}function xD(e){let{trackingId:t}=e;return{trackingId:t}}function bD(e){return(e.source||[]).concat([`relay@${Gb}`])}function Hb(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:a}=r,i=xD(t),p=r.getClientId();return Object.freeze({type:e,config:i,ts:Date.now(),source:bD(t),clientId:p,userAgent:a(),referrer:Ub(n()),location:Ub(o())})}function Ub(e){return e!==null?CD(e,1024):null}function wD(e,t,r,n){return{...t,meta:Hb(e,r,n)}}var RD="*";function FD(){let e=[];function t({type:f,callback:m}){return e.findIndex(g=>g.type===f&&g.callback===m)}function r(f,m){return f.type==="*"||m===f.type}function n(f){return t(f)<0&&e.push(f),()=>p(f.type,f.callback)}function o(f){e.forEach(m=>{if(r(m,f.meta.type))try{m.callback(f)}catch(g){console.error(g)}})}function a(f){if(f===RD)e.length=0;else for(let m=e.length-1;m>=0;m--)e[m].type===f&&e.splice(m,1)}function i(f){let m=t(f);m>=0&&e.splice(m,1)}function p(f,m){m?i({type:f,callback:m}):a(f)}return{add:n,call:o,remove:p}}function Qb({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...(!!n.mode&&{mode:n.mode}),...(!!n.source&&{source:n.source}),...(!!n.environment&&{environment:n.environment})})}function ED(e){let t=Qb(e);return{get:()=>t,update:r=>{t=Qb({...t,...r})}}}var kS=ID();function ID(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let i=a.replace(/^\s+/,"");if(i.lastIndexOf(n,0)===0)return i.substring(n.length,i.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),i=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${i}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function TD(){return{getItem(e){return kS.getItem(e)||localStorage.getItem(e)},removeItem(e){kS.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),kS.setItem(e,t,31556952e3)}}}var Bb="visitorId";function PD(){let e=document.referrer;return e===""?null:e}function OS(){let e=TD();return{runtime:"browser",send:function(){var _ref9=_asyncToGenerator(function*(t,r,n){let o=S(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});qb().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let i=yield o;if(i?.ok){let p;try{p=yield i.json()}catch{return}for(let f of p.events)if(!f.accepted)throw new Error(`Received event was rejected for processing: ${f.errorMessage}`)}else throw new Error(`Error ${i.status}: Failed to send the event(s).`)});return function send(_x14,_x15,_x16){return _ref9.apply(this,arguments)}}(),getReferrer:()=>PD(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(Bb);if(t&&ES(t))return t;let r=TS();return e.setItem(Bb,r),r}}}function kD(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&e.name==="QuotaExceededError"&&localStorage&&localStorage.length!==0}}function OD(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function ND(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=OD();return t&&r?{...r,runtime:"custom"}:t&&_D()&&kD()?OS():n}function _D(){try{return typeof window=="object"}catch{return!1}}function DD(e){return{get:()=>Object.freeze(ND(e))}}function zb(e){let t=ED(e),r=FD(),n=DD(t);return{emit:function(){var _ref0=_asyncToGenerator(function*(o,a){let i=t.get(),p=n.get(),f=wD(o,a,i,p);return SD({config:i,environment:p,event:f,listenerManager:r})});return function emit(_x17,_x18){return _ref0.apply(this,arguments)}}(),getMeta:o=>Hb(o,t.get(),n.get()),on:(o,a)=>r.add({type:o,callback:a}),off:(o,a)=>r.remove(o,a),updateConfig:o=>t.update(o),version:Gb}}d();c();u();l();function Wb(){return typeof window<"u"&&typeof document<"u"}d();c();u();l();d();c();u();l();var Ao="3.55.2",Kb=["@coveo/atomic","@coveo/quantic"];var $i=tt(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Ao}`));var Zl=tt(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>$i(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i,p)=>{let f=MD(p);return zb({mode:a?"emit":"disabled",url:o??bd(e,t),token:r,trackingId:n??null,source:i,environment:f})}),qD={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref1=_asyncToGenerator(function*(){});return function send(){return _ref1.apply(this,arguments)}}()},MD=e=>{if(!e)return;let t=e();return{...(Wb()?OS():qD),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();u();l();d();c();u();l();function Kn(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Q(e,t,r,n){function o(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(y){i(y)}}function f(g){try{m(n.throw(g))}catch(y){i(y)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}var Ne;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Ne||(Ne={}));function DS(){return typeof window<"u"}function WS(){return typeof navigator<"u"}function Hi(){return typeof document<"u"}function qS(){try{return typeof localStorage<"u"}catch{return!1}}function jD(){try{return typeof sessionStorage<"u"}catch{return!1}}function cw(){return WS()&&navigator.cookieEnabled}var VD=[Ne.click,Ne.custom,Ne.search,Ne.view],LD=(e,t)=>VD.indexOf(e)!==-1?Object.assign({language:Hi()?document.documentElement.lang:"unknown",userAgent:WS()?navigator.userAgent:"unknown"},t):t,tu=class e{static set(t,r,n){var o,a,i,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?Yb(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],Yb(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function Yb(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}function UD(){return qS()?localStorage:cw()?new ru:jD()?sessionStorage:new Wi}var ru=class e{getItem(t){return tu.get(`${e.prefix}${t}`)}removeItem(t){tu.erase(`${e.prefix}${t}`)}setItem(t,r,n){tu.set(`${e.prefix}${t}`,r,n)}};ru.prefix="coveo_";var MS=class{constructor(){this.cookieStorage=new ru}getItem(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)}removeItem(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)}setItem(t,r){localStorage.setItem(t,r),this.cookieStorage.setItem(t,r,31556926e3)}},Wi=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Xd="__coveo.analytics.history",QD=20,BD=1e3*60,GD=75,ep=class{constructor(t){this.store=t||UD()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return Q(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return Q(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Xd);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return Q(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Xd);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Xd,JSON.stringify(t.slice(0,QD)))}catch{}}clear(){try{this.store.removeItem(Xd)}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,GD)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>BD:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var $D=(e,t)=>Q(void 0,void 0,void 0,function*(){return e===Ne.view?(yield HD(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),HD=e=>Q(void 0,void 0,void 0,function*(){let t=new ep,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),zD=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function tp(e){return typeof e=="string"&&zD.test(e)}function Jb(e){if(!tp(e))throw TypeError("Invalid UUID");let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}var Nt=[];for(let e=0;e<256;++e)Nt.push((e+256).toString(16).slice(1));function lw(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()}var WD=new Uint8Array(16);function KD(){return crypto.getRandomValues(WD)}function YD(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let r=0;r<e.length;++r)t[r]=e.charCodeAt(r);return t}var JD="6ba7b810-9dad-11d1-80b4-00c04fd430c8",XD="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function ZD(e,t,r,n,o,a){let i=typeof r=="string"?YD(r):r,p=typeof n=="string"?Jb(n):n;if(typeof n=="string"&&(n=Jb(n)),n?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let f=new Uint8Array(16+i.length);return f.set(p),f.set(i,p.length),f=t(f),f[6]=f[6]&15|e,f[8]=f[8]&63|128,lw(f)}function Aa(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():eq(e,t,r)}function eq(e,t,r){e=e||{};let n=e.random??e.rng?.()??KD();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 lw(n)}function tq(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function NS(e,t){return e<<t|e>>>32-t}function rq(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520],n=new Uint8Array(e.length+1);n.set(e),n[e.length]=128,e=n;let o=e.length/4+2,a=Math.ceil(o/16),i=new Array(a);for(let p=0;p<a;++p){let f=new Uint32Array(16);for(let m=0;m<16;++m)f[m]=e[p*64+m*4]<<24|e[p*64+m*4+1]<<16|e[p*64+m*4+2]<<8|e[p*64+m*4+3];i[p]=f}i[a-1][14]=(e.length-1)*8/2**32,i[a-1][14]=Math.floor(i[a-1][14]),i[a-1][15]=(e.length-1)*8&4294967295;for(let p=0;p<a;++p){let f=new Uint32Array(80);for(let C=0;C<16;++C)f[C]=i[p][C];for(let C=16;C<80;++C)f[C]=NS(f[C-3]^f[C-8]^f[C-14]^f[C-16],1);let m=r[0],g=r[1],y=r[2],x=r[3],v=r[4];for(let C=0;C<80;++C){let b=Math.floor(C/20),w=NS(m,5)+tq(b,g,y,x)+v+t[b]+f[C]>>>0;v=x,x=y,y=NS(g,30)>>>0,g=m,m=w}r[0]=r[0]+m>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+x>>>0,r[4]=r[4]+v>>>0}return Uint8Array.of(r[0]>>24,r[0]>>16,r[0]>>8,r[0],r[1]>>24,r[1]>>16,r[1]>>8,r[1],r[2]>>24,r[2]>>16,r[2]>>8,r[2],r[3]>>24,r[3]>>16,r[3]>>8,r[3],r[4]>>24,r[4]>>16,r[4]>>8,r[4])}function rp(e,t,r,n){return ZD(80,rq,e,t)}rp.DNS=JD;rp.URL=XD;var uw="2.33.0",Xb=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,eu={pageview:"pageview",event:"event"},np=class{constructor({client:t,uuidGenerator:r=Aa}){this.client=t,this.uuidGenerator=r}},jS=class extends np{constructor({client:t,uuidGenerator:r=Aa}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Xb(window.location),this.lastReferrer=Hi()?document.referrer:"",this.addHooks()}getApi(t){return t==="setAction"?this.setAction:null}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:Hi()?document.title:"",encoding:Hi()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===eu.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===eu.pageview?this.nextPageViewId:this.pageViewId,referrer:t===eu.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===eu.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return Xb(window.location)}},Co=class e{constructor(t,r){if(!tp(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return tp(a)?new e(a,Number.parseInt(o)*1e3):null}};Co.cvo_cid="cvo_cid";Co.expirationTime=120;var VS=class extends np{constructor({client:t,uuidGenerator:r=Aa}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return Q(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(Co.cvo_cid,new Co(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};VS.Id="link";var Sr=Object.keys;function Zd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var _S=128,dw=192,Zb=224,ew=240;function nq(e){return(e&248)===ew?4:(e&ew)===Zb?3:(e&Zb)===dw?2:1}function oq(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&_S)!=_S)break;if(r-=3,(n&dw)!=_S){t-r>=nq(n)*3&&(r=t);break}}return e.substring(0,r)}var LS={id:"svc_ticket_id",subject:"svc_ticket_subject",description:"svc_ticket_description",category:"svc_ticket_category",productId:"svc_ticket_product_id",custom:"svc_ticket_custom"},aq=Sr(LS).map(e=>LS[e]),iq=[...aq].join("|"),sq=new RegExp(`^(${iq}$)`),cq={svcAction:"svc_action",svcActionData:"svc_action_data"},lq=e=>Sr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=LS[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),uq=e=>sq.test(e),dq=[uq],tw={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},rw={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},Vt={action:"pa",list:"pal",listSource:"pls"},op={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},pq=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],US={id:"quoteId",affiliation:"quoteAffiliation"},QS={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},fq={add:Vt,bookmark_add:Vt,bookmark_remove:Vt,click:Vt,checkout:Vt,checkout_option:Vt,detail:Vt,impression:Vt,remove:Vt,refund:Object.assign(Object.assign({},Vt),op),purchase:Object.assign(Object.assign({},Vt),op),quickview:Vt,quote:Object.assign(Object.assign({},Vt),US),review:Object.assign(Object.assign({},Vt),QS)},mq=Sr(tw).map(e=>tw[e]),gq=Sr(rw).map(e=>rw[e]),hq=Sr(Vt).map(e=>Vt[e]),yq=Sr(op).map(e=>op[e]),Sq=Sr(QS).map(e=>QS[e]),vq=Sr(US).map(e=>US[e]),Aq=[...mq,"custom"].join("|"),Cq=[...gq,"custom"].join("|"),pw="(pr[0-9]+)",fw="(il[0-9]+pi[0-9]+)",xq=new RegExp(`^${pw}(${Aq})$`),bq=new RegExp(`^(${fw}(${Cq}))|(il[0-9]+nm)$`),wq=new RegExp(`^(${hq.join("|")})$`),Rq=new RegExp(`^(${yq.join("|")})$`),Fq=new RegExp(`^${pw}custom$`),Eq=new RegExp(`^${fw}custom$`),Iq=new RegExp(`^(${[...pq,...Sq,...vq].join("|")})$`),Tq=e=>xq.test(e),Pq=e=>bq.test(e),kq=e=>wq.test(e),Oq=e=>Rq.test(e),Nq=e=>Iq.test(e),_q=[Pq,Tq,kq,Oq,Nq],Dq=[Fq,Eq],qq={anonymizeIp:"aip"},Mq={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},jq={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},Vq=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Lq=Object.assign(Object.assign(Object.assign(Object.assign({},qq),Mq),jq),Vq.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),BS=Object.assign(Object.assign({},Lq),cq),Uq=e=>{let t=!!e.action&&fq[e.action]||{};return Sr(e).reduce((r,n)=>{let o=t[n]||BS[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},Qq=Sr(BS).map(e=>BS[e]),Bq=e=>Qq.indexOf(e)!==-1,Gq=e=>e==="custom",$q=e=>[..._q,...dq,Bq,Gq].some(t=>t(e)),Hq=e=>Sr(e).reduce((t,r)=>{let n=zq(r);return n?Object.assign(Object.assign({},t),Wq(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),zq=e=>{let t;return[...Dq].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},Wq=(e,t)=>Sr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),GS=class{constructor(t){this.opts=t}sendEvent(t,r){return Q(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:i,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),f=this.encodeForEventType(t,p),m=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(i,m)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return Q(this,void 0,void 0,function*(){let o=t,a=r;if(n){let i=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:f}=i;o=p||t;try{a=JSON.parse(f)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return Q(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[Ne.click,Ne.custom,Ne.search,Ne.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},$S=class{sendEvent(t,r){return Q(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return Q(this,void 0,void 0,function*(){return Promise.resolve()})}},nw=h.fetch,ap=class{constructor(t){this.opts=t}sendEvent(t,r){return Q(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,i=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${i}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:m}=f,g=Kn(f,["url"]),y;try{y=yield nw(m,g)}catch(x){console.error("An error has occurred when sending the event.",x);return}if(y.ok){let x=yield y.json();return x.visitorId&&o.setCurrentVisitorId(x.visitorId),x}else{try{y.json()}catch{}throw console.error(`An error has occurred when sending the "${t}" event.`,y,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return Q(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield nw(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Ne.click,Ne.custom,Ne.search,Ne.view].indexOf(t)!==-1}getVisitorIdParam(){return Q(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},HS=class{constructor(t,r){qS()&&cw()?this.storage=new MS:qS()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Wi),this.client=new ap(t),this.beaconClient=new GS(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},zS=class{constructor(t,r){this.storage=r||new Wi,this.client=new ap(t)}getClientDependingOnEventType(t){return this.client}},ip=class{constructor(){this.storage=new Wi,this.client=new $S}getClientDependingOnEventType(t){return this.client}},Kq="xx",Yq=e=>e?.startsWith(Kq)||!1,Jq=`
|
|
27
|
+
`;return new Pu(r)}var Pu=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},ve=class{constructor(e){me(this,"definition");this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let a=this.definition[o].validate(r[o]);a&&n.push(`${o}: ${a}`)}if(n.length)throw m_(n,t);return r}get default(){let e={};for(let t in this.definition){let r=this.definition[t].default;r!==void 0&&(e[t]=r)}return e}},Be=class{constructor(e={}){me(this,"baseConfig");this.baseConfig=e}validate(e){return this.baseConfig.required&&pe(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function Tt(e){return e===void 0}function g_(e){return e===null}function pe(e){return Tt(e)||g_(e)}var de=class{constructor(e={}){me(this,"value");this.value=new Be(e)}validate(e){let t=this.value.validate(e);return t||(h_(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function h_(e){return Tt(e)||hd(e)}function hd(e){return typeof e=="boolean"}var re=class{constructor(e={}){me(this,"config");me(this,"value");this.config=e,this.value=new Be(e)}validate(e){let t=this.value.validate(e);return t||(y_(e)?e<this.config.min?`minimum value of ${this.config.min} not respected.`:e>this.config.max?`maximum value of ${this.config.max} not respected.`:null:"value is not a number.")}get default(){return this.value.default}get required(){return this.value.required}};function y_(e){return Tt(e)||lx(e)}function lx(e){return typeof e=="number"&&!Number.isNaN(e)}var S_=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,L=class{constructor(e={}){me(this,"value");me(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Be(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:a}=this.config,i=this.value.validate(e);if(i)return i;if(Tt(e))return null;if(!_i(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:a&&!(S_.test(e)&&new Date(e).toString()!=="Invalid Date")?"value is not a valid ISO8601 date string":null}get default(){return this.value.default}get required(){return this.value.required}};function _i(e){return Object.prototype.toString.call(e)==="[object String]"}var X=class{constructor(e={}){me(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Tt(e))return this.config.options.required?"value is required and is currently undefined":null;if(!dx(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&pe(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],a=n.validate(o);a!==null&&(t+=` ${a}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function dx(e){return e!==void 0&&typeof e=="object"}var se=class{constructor(e={}){me(this,"config");me(this,"value");this.config=e,this.value=new Be(this.config)}validate(e){if(!pe(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(pe(e))return null;if(this.config.max!==void 0&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(this.config.min!==void 0&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(this.config.each!==void 0){let r="";return e.forEach(n=>{this.config.each.required&&pe(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=` ${o}`)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return hd(e)||_i(e)||lx(e)||dx(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Ni(e){return Array.isArray(e)}var ku=class{constructor(e){me(this,"config");me(this,"value");this.config=e,this.value=new Be(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Tt(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};d();c();l();u();var go=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function yd(e){return Array.isArray(e)}function Sd(e){return e.trim()===""}function px(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function v_(e){return btoa(encodeURI(e))}function vd(e,t){let{[e]:r,...n}=t;return n}function Di(e){return v_(JSON.stringify(e))}var A_=new Set(["1",1,"yes",!0]);function zy(){if(typeof navigator>"u"||typeof window>"u")return!1;let e=navigator,t=window;return[e.globalPrivacyControl,e.doNotTrack,e.msDoNotTrack,t.doNotTrack].some(r=>A_.has(r))}function fx(e){let t={};for(let[r,n]of e)t[r]=n;return t}function mx(e,t,r){return clearTimeout(t),setTimeout(e,r)}function Ou(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Ad(e,t,r={}){let n;return(...o)=>{let a=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),a)return e.apply(void 0,o)}}function C_(e){if(Sd(e.openingDelimiter)||Sd(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(pe(e.content)||Sd(e.content))return e.content;if(e.highlights.length===0)return qi(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let a=e.highlights[o],i=a.offset,p=i+a.length;if(p>t)break;r+=qi(e.content.slice(n,i)),r+=e.openingDelimiter,r+=qi(e.content.slice(i,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=qi(e.content.slice(n))),r}function Ky(e,t){return e=qi(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,a)=>n?Wy(n,t.notMatchDelimiters):o?Wy(o,t.exactMatchDelimiters):a?Wy(a,t.correctionDelimiters):r)}function Wy(e,t){return t?t.open+e+t.close:e}function qi(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,a=>t[a]):e}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function hx(_x2,_x3){return _hx.apply(this,arguments)}function _hx(){_hx=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _hx.apply(this,arguments)}function yx(e){let t,r,n,o=!1;return function(i){t===void 0?(t=i,r=0,n=-1):t=b_(t,i);let p=t.length,f=0;for(;r<p;){o&&(t[r]===10&&(f=++r),o=!1);let m=-1;for(;r<p&&m===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-f);break;case 13:o=!0,m=r;break;case 10:m=r;break}if(m===-1)break;e(t.subarray(f,m),n),f=r,n=-1}f===p?t=void 0:f!==0&&(t=t.subarray(f),r-=f)}}function Sx(e,t,r){let n=gx(),o=new TextDecoder;return function(i,p){if(i.length===0)r?.(n),n=gx();else if(p>0){let f=o.decode(i.subarray(0,p)),m=p+(i[p+1]===32?2:1),g=o.decode(i.subarray(m));switch(f){case"data":n.data=n.data?`${n.data}
|
|
28
|
+
${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":x_(g,n,t);break}}}}function x_(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function b_(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function gx(){return{data:"",event:"",id:"",retry:void 0}}var Jy="text/event-stream",w_=1e3,vx="last-event-id";function Ax(){return typeof window<"u"}function Cd(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:i,openWhenHidden:p,fetch:f,...m}){return new Promise((g,S)=>{let x={...r};x.accept||(x.accept=Jy);let h;function C(){h?.abort(),document.hidden||T()}!p&&Ax()&&document.addEventListener("visibilitychange",C);let b=w_,w;function F(){Ax()&&document.removeEventListener("visibilitychange",C),clearTimeout(w),h?.abort()}t?.addEventListener("abort",()=>{F(),g()});let I=f??v,E=n??R_;function T(){return _T2.apply(this,arguments)}function _T2(){_T2=_asyncToGenerator(function*(){h=s.AbortController?new s.AbortController:null;try{let P=yield I(e,{...m,headers:x,signal:h?.signal});yield E(P),yield hx(P.body,yx(Sx(D=>{D?x[vx]=D:delete x[vx]},D=>{b=D},o))),a?.(),F(),g()}catch(P){if(!h?.signal?.aborted)try{let D=i?.(P)??b;clearTimeout(w),w=setTimeout(T,D)}catch(D){F(),S(D)}}});return _T2.apply(this,arguments)}T()})}function R_(e){let t=e.headers.get("content-type");if(!t?.startsWith(Jy))throw new Error(`Expected content-type to be ${Jy}, Actual: ${t}`)}d();c();l();u();var ho=class{constructor(t){me(this,"_basePath");me(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};var F_=(e,t,r)=>new ho(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,Cx=3,E_=5e3,I_="text/event-stream",eS=1,Xy=class extends Error{},_u=class extends Error{constructor(r){super(r.message);me(this,"payload",r)}},Zy=class{constructor(){me(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},xd=class{constructor(t){me(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:i}=t,{write:p,abort:f,close:m,resetAnswer:g}=r,S=new Zy;if(!a){this.logger.error("No stream ID found");return}let x=0,h,C=()=>{h&&!S.isActive(h)&&(w?.abort(),g(),F())},b=()=>{S.remove(h),h=mx(C,h,E_),S.add(h)},w=new s.AbortController,F=()=>Cd(F_(n,o,a),{method:"GET",fetch:v,headers:{Authorization:`Bearer ${i}`,accept:"*/*"},openWhenHidden:!0,signal:w?.signal,onopen(I){return _asyncToGenerator(function*(){if(I.ok&&I.headers.get("content-type")===I_)return;throw I.status>=400&&I.status<500&&I.status!==429?new _u({message:"Error opening stream",code:I.status}):new Xy})()},onmessage:I=>{if(w?.signal.aborted)return;let E=JSON.parse(I.data);if(E.finishReason==="ERROR"){S.remove(h),w?.abort(),f({message:E.errorMessage,code:E.statusCode});return}p(E),x=0,E.finishReason==="COMPLETED"?(S.remove(h),m()):b()},onerror:I=>{if(!w?.signal.aborted){if(S.remove(h),I instanceof _u)throw w?.abort(),f(I),I;if(++x>Cx){this.logger.info("Maximum retry exceeded.");let E={message:"Failed to complete stream.",code:eS};throw w?.abort(),f(E),new _u(E)}this.logger.info(`Retrying...(${x}/${Cx})`),g()}}});return F(),w}};d();c();l();u();var bd=e=>e;d();c();l();u();d();c();l();u();function Mi(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function ir(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Mi(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Mi(),extendedResults:{},searchAction:void 0}}d();c();l();u();function yo(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var So=e=>{let{response:t}=e;return t.body?T_(e):P_(t)},T_=e=>O_(e)?__(e):k_(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},P_=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function k_(e){return e.body.statusCode!==void 0}function O_(e){return e.body.exception!==void 0}var __=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var _x=jr(Tx(),1);d();c();l();u();var K=new Error("Failed to load reducers."),Vi=class extends Error{constructor(){super(),this.name="UnauthorizedTokenError",this.message="The token being used to perform the request is unauthorized. It may be expired or invalid."}},da=class extends Error{constructor(r,n){super();me(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function Px(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function kx(e){return typeof e!="object"||!e?!1:Object.values(e).every(aN)}function aN(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Ox(e){return e===429}var Lr=class e{static call(t){return _asyncToGenerator(function*(){let r=iN(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...i}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield v(a,i);if(Ox(f.status))throw f;return f});return function p(){return _ref.apply(this,arguments)}}();try{let f=yield(0,_x.backOff)(p,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(m){let g=m&&Ox(m.status);return g&&(n.info("Platform retrying request"),yield new Promise(S=>setTimeout(S,1e3))),g});return function retry(_x4){return _ref2.apply(this,arguments)}}()});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new Vi;case 404:throw new da(a,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new da(a):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:i}=r,{signal:p,...f}=t,m=Ou(f);try{let g=yield o(t,n,i);return{...t,...g}}catch(g){a.error(g,"Platform request preprocessing failed. Returning default request options.")}return m})()}};function gr(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function ji(e,t,r="prod"){return e??gr(t,r)}function vt(e,t="prod"){return`${gr(e,t)}/rest/search/v2`}function Rd(e,t="prod"){return`${gr(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function iN(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,p=e.method==="POST"||e.method==="PUT",f=sN(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...(p&&{body:f}),signal:i}}function sN(e,t){return t==="application/x-www-form-urlencoded"?kx(e)?Px(e):"":JSON.stringify(e)}d();c();l();u();var vo=class{constructor(){me(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new s.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};d();c();l();u();d();c();l();u();function Nx(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var Gn=(e,t,r,n)=>{let o=new ho(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var Dx=(e,t)=>{let r=new ho(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},qx=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield Lr.call({...Gn(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:yo(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Nx(r),o=yield r.arrayBuffer(),i=new TextDecoder(n).decode(o);return cN(i)?{success:i}:{error:So({response:r,body:i})}});return function qx(_x5,_x6){return _ref3.apply(this,arguments)}}();function cN(e){return typeof e=="string"}d();c();l();u();function uN(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function lN(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Fd(e,t){if(t&&e.name==="AbortError")return{error:lN(e)};if(e instanceof da)return{error:uN(e)};throw e}var Ed=class{constructor(t){me(this,"options",t);me(this,"apiCallsQueues",{unknown:new vo,mainSearch:new vo,facetValues:new vo,foldingCollection:new vo,instantResults:new vo})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield Lr.call({...Gn(t,"POST","application/json","/plan"),requestParams:yo(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Fd(r);let n=yield r.json();return pN(n)?{success:n}:{error:So({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Lr.call({...Gn(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:yo(t),..._this3.options});if(r instanceof Error)return Fd(r);let n=yield r.json(),o={response:r,body:n};return dN(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:So(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(p=>Lr.call({...Gn(t,"POST","application/json",""),requestParams:yo(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:p??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Fd(o,r?.disableAbortWarning);let a=yield o.json(),i={response:o,body:a};return Mx(a)?(i.body=Vx(a),{success:(yield _this4.options.postprocessSearchResponseMiddleware(i)).body}):{error:So(i)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield Lr.call({...Gn(t,"POST","application/json","/facet"),requestParams:yo(t),requestMetadata:{method:"facetSearch"},..._this5.options});if(r instanceof Error)throw r;let n=yield r.json(),o={response:r,body:n};return(yield _this5.options.postprocessFacetSearchResponseMiddleware(o)).body})()}recommendations(t){var _this6=this;return _asyncToGenerator(function*(){let r=yield Lr.call({...Gn(t,"POST","application/json",""),requestParams:yo(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(Mx(n)){let o={response:r,body:n};return o.body=Vx(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:So({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return qx(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield Lr.call({...Gn(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return fN(n)?{success:n}:{error:So({response:r,body:n})}})()}},Id=e=>e.success!==void 0,At=e=>e.error!==void 0;function Mx(e){return e.results!==void 0}function Vx(e){let t=Mi();return pe(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function dN(e){return e.completions!==void 0}function pN(e){return e.preprocessingOutput!==void 0}function fN(e){return e.fields!==void 0}d();c();l();u();var jx=e=>e,Lx=e=>e,Ux=e=>e;d();c();l();u();d();c();l();u();var z=new L({required:!0,emptyAllowed:!1}),st=new L({required:!1,emptyAllowed:!1}),Ge=new L({required:!0,emptyAllowed:!0}),qK=new L({required:!1,emptyAllowed:!0}),Td=new se({each:z,required:!0}),Qx=new L({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Bx=new L({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),MK=new L({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),$n=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),hr=(e,t)=>{if("required"in t)return{payload:new ve({value:t}).validate({value:e}).value};let o=new X({options:{required:!0},values:t}).validate(e);if(o)throw new Pu(o);return{payload:e}},O=(e,t)=>{try{return hr(e,t)}catch(r){return{payload:e,error:$n(r)}}},lt=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Gx(e,t,r,o,"Controller initialization error")},He=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Gx(e,t,r,o,"Controller initialization error")},Gx=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};d();c();l();u();d();c();l();u();d();c();l();u();function Pt(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var mN=typeof Symbol=="function"&&Symbol.observable||"@@observable",$x=mN,uS=()=>Math.random().toString(36).substring(7).split("").join("."),gN={INIT:`@@redux/INIT${uS()}`,REPLACE:`@@redux/REPLACE${uS()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${uS()}`},Pd=gN;function Xr(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function lS(e,t,r){if(typeof e!="function")throw new Error(Pt(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Pt(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Pt(1));return r(lS)(e,t)}let n=e,o=t,a=new Map,i=a,p=0,f=!1;function m(){i===a&&(i=new Map,a.forEach((w,F)=>{i.set(F,w)}))}function g(){if(f)throw new Error(Pt(3));return o}function S(w){if(typeof w!="function")throw new Error(Pt(4));if(f)throw new Error(Pt(5));let F=!0;m();let I=p++;return i.set(I,w),function(){if(F){if(f)throw new Error(Pt(6));F=!1,m(),i.delete(I),a=null}}}function x(w){if(!Xr(w))throw new Error(Pt(7));if(typeof w.type>"u")throw new Error(Pt(8));if(typeof w.type!="string")throw new Error(Pt(17));if(f)throw new Error(Pt(9));try{f=!0,o=n(o,w)}finally{f=!1}return(a=i).forEach(I=>{I()}),w}function h(w){if(typeof w!="function")throw new Error(Pt(10));n=w,x({type:Pd.REPLACE})}function C(){let w=S;return{subscribe(F){if(typeof F!="object"||F===null)throw new Error(Pt(11));function I(){let T=F;T.next&&T.next(g())}return I(),{unsubscribe:w(I)}},[$x](){return this}}}return x({type:Pd.INIT}),{dispatch:x,subscribe:S,getState:g,replaceReducer:h,[$x]:C}}function hN(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Pd.INIT})>"u")throw new Error(Pt(12));if(typeof r(void 0,{type:Pd.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Pt(13))})}function Li(e){let t=Object.keys(e),r={};for(let i=0;i<t.length;i++){let p=t[i];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{hN(r)}catch(i){a=i}return function(p={},f){if(a)throw a;let m=!1,g={};for(let S=0;S<n.length;S++){let x=n[S],h=r[x],C=p[x],b=h(C,f);if(typeof b>"u"){let w=f&&f.type;throw new Error(Pt(14))}g[x]=b,m=m||b!==C}return m=m||n.length!==Object.keys(p).length,m?g:p}}function qu(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Hx(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Pt(15))},i={getState:o.getState,dispatch:(f,...m)=>a(f,...m)},p=e.map(f=>f(i));return a=qu(...p)(o.dispatch),{...o,dispatch:a}}}function Mu(e){return Xr(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var vS=Symbol.for("immer-nothing"),Vu=Symbol.for("immer-draftable"),ht=Symbol.for("immer-state");function kt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var sr=Object,fa=sr.getPrototypeOf,ju="constructor",Gu="prototype",fS="configurable",Nd="enumerable",Od="writable",Lu="value",Yt=e=>!!e&&!!e[ht];function Vt(e){return e?eb(e)||Hu(e)||!!e[Vu]||!!e[ju]?.[Vu]||zu(e)||Wu(e):!1}var yN=sr[Gu][ju].toString(),zx=new WeakMap;function eb(e){if(!e||!Qi(e))return!1;let t=fa(e);if(t===null||t===sr[Gu])return!0;let r=sr.hasOwnProperty.call(t,ju)&&t[ju];if(r===Object)return!0;if(!pa(r))return!1;let n=zx.get(r);return n===void 0&&(n=Function.toString.call(r),zx.set(r,n)),n===yN}function tb(e){return Yt(e)||kt(15,e),e[ht].base_}function $u(e,t,r=!0){ma(e)===0?(r?Reflect.ownKeys(e):sr.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function ma(e){let t=e[ht];return t?t.type_:Hu(e)?1:zu(e)?2:Wu(e)?3:0}var Ui=(e,t,r=ma(e))=>r===2?e.has(t):sr[Gu].hasOwnProperty.call(e,t),Hn=(e,t,r=ma(e))=>r===2?e.get(t):e[t],Dd=(e,t,r,n=ma(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function SN(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Hu=Array.isArray,zu=e=>e instanceof Map,Wu=e=>e instanceof Set,Qi=e=>typeof e=="object",pa=e=>typeof e=="function",dS=e=>typeof e=="boolean";function vN(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var AN=e=>Qi(e)?e?.[ht]:null,zn=e=>e.copy_||e.base_;var AS=e=>e.modified_?e.copy_:e.base_;function mS(e,t){if(zu(e))return new Map(e);if(Wu(e))return new Set(e);if(Hu(e))return Array[Gu].slice.call(e);let r=eb(e);if(t===!0||t==="class_only"&&!r){let n=sr.getOwnPropertyDescriptors(e);delete n[ht];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],p=n[i];p[Od]===!1&&(p[Od]=!0,p[fS]=!0),(p.get||p.set)&&(n[i]={[fS]:!0,[Od]:!0,[Nd]:p[Nd],[Lu]:e[i]})}return sr.create(fa(e),n)}else{let n=fa(e);if(n!==null&&r)return{...e};let o=sr.create(n);return sr.assign(o,e)}}function CS(e,t=!1){return Ud(e)||Yt(e)||!Vt(e)||(ma(e)>1&&sr.defineProperties(e,{set:kd,add:kd,clear:kd,delete:kd}),sr.freeze(e),t&&$u(e,(r,n)=>{CS(n,!0)},!1)),e}function CN(){kt(2)}var kd={[Lu]:CN};function Ud(e){return e===null||!Qi(e)?!0:sr.isFrozen(e)}var qd="MapSet",Md="Patches",Wx="ArrayMethods",Vd={};function ga(e){let t=Vd[e];return t||kt(0,e),t}var Kx=e=>!!Vd[e];function xN(e,t){Vd[e]||(Vd[e]=t)}var Uu,rb=()=>Uu,bN=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Kx(qd)?ga(qd):void 0,arrayMethodsPlugin_:Kx(Wx)?ga(Wx):void 0});function Yx(e,t){t&&(e.patchPlugin_=ga(Md),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function gS(e){hS(e),e.drafts_.forEach(wN),e.drafts_=null}function hS(e){e===Uu&&(Uu=e.parent_)}var Jx=e=>Uu=bN(Uu,e);function wN(e){let t=e[ht];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Xx(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[ht].modified_&&(gS(t),kt(4)),Vt(e)&&(e=Zx(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[ht].base_,e,t)}else e=Zx(t,r);return RN(t,e,!0),gS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==vS?e:void 0}function Zx(e,t){if(Ud(t))return t;let r=t[ht];if(!r)return jd(t,e.handledSet_,e);if(!Qd(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);ab(r,e)}return r.copy_}function RN(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&CS(t,r)}function nb(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Qd=(e,t)=>e.scope_===t,FN=[];function ob(e,t,r,n){let o=zn(e),a=e.type_;if(n!==void 0&&Hn(o,n,a)===t){Dd(o,n,r,a);return}if(!e.draftLocations_){let p=e.draftLocations_=new Map;$u(o,(f,m)=>{if(Yt(m)){let g=p.get(m)||[];g.push(f),p.set(m,g)}})}let i=e.draftLocations_.get(t)??FN;for(let p of i)Dd(o,p,r,a)}function EN(e,t,r){e.callbacks_.push(function(o){let a=t;if(!a||!Qd(a,o))return;o.mapSetPlugin_?.fixSetContents(a);let i=AS(a);ob(e,a.draft_??a,i,r),ab(a,o)})}function ab(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let o=n.getPath(e);o&&n.generatePatches_(e,o,t)}nb(e)}}function IN(e,t,r){let{scope_:n}=e;if(Yt(r)){let o=r[ht];Qd(o,n)&&o.callbacks_.push(function(){_d(e);let i=AS(o);ob(e,r,i,t)})}else Vt(r)&&e.callbacks_.push(function(){let a=zn(e);e.type_===3?a.has(r)&&jd(r,n.handledSet_,n):Hn(a,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&jd(Hn(e.copy_,t,e.type_),n.handledSet_,n)})}function jd(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||Yt(e)||t.has(e)||!Vt(e)||Ud(e)||(t.add(e),$u(e,(n,o)=>{if(Yt(o)){let a=o[ht];if(Qd(a,r)){let i=AS(a);Dd(e,n,i,e.type_),nb(a)}}else Vt(o)&&jd(o,t,r)})),e}function TN(e,t){let r=Hu(e),n={type_:r?1:0,scope_:t?t.scope_:rb(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,a=Ld;r&&(o=[n],a=Qu);let{revoke:i,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=i,[p,n]}var Ld={get(e,t){if(t===ht)return e;let r=e.scope_.arrayMethodsPlugin_,n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=zn(e);if(!Ui(o,t,e.type_))return kN(e,o,t);let a=o[t];if(e.finalized_||!Vt(a)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&vN(t))return a;if(a===pS(e.base_,t)||PN(e,t,a)){_d(e);let i=e.type_===1?+t:t,p=SS(e.scope_,a,e,i);return e.copy_[i]=p}return a},has(e,t){return t in zn(e)},ownKeys(e){return Reflect.ownKeys(zn(e))},set(e,t,r){let n=ib(zn(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=pS(zn(e),t),a=o?.[ht];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(SN(r,o)&&(r!==void 0||Ui(e.base_,t,e.type_)))return!0;_d(e),yS(e)}return e.copy_[t]===r&&(r!==void 0||Ui(e.copy_,t,e.type_))||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),IN(e,t,r)),!0},deleteProperty(e,t){return _d(e),pS(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),yS(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=zn(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Od]:!0,[fS]:e.type_!==1||t!=="length",[Nd]:n[Nd],[Lu]:r[t]}},defineProperty(){kt(11)},getPrototypeOf(e){return fa(e.base_)},setPrototypeOf(){kt(12)}},Qu={};for(let e in Ld){let t=Ld[e];Qu[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Qu.deleteProperty=function(e,t){return Qu.set.call(this,e,t,void 0)};Qu.set=function(e,t,r){return Ld.set.call(this,e[0],t,r,e[0])};function pS(e,t){let r=e[ht];return(r?zn(r):e)[t]}function PN(e,t,r){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!Vt(r)||r[ht]?!1:e.baseRefs_.has(r)}function kN(e,t,r){let n=ib(t,r);return n?Lu in n?n[Lu]:n.get?.call(e.draft_):void 0}function ib(e,t){if(!(t in e))return;let r=fa(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=fa(r)}}function yS(e){e.modified_||(e.modified_=!0,e.parent_&&yS(e.parent_))}function _d(e){e.copy_||(e.assigned_=new Map,e.copy_=mS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var ON=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(pa(t)&&!pa(r)){let a=r;r=t;let i=this;return function(f=a,...m){return i.produce(f,g=>r.call(this,g,...m))}}pa(r)||kt(6),n!==void 0&&!pa(n)&&kt(7);let o;if(Vt(t)){let a=Jx(this),i=SS(a,t,void 0),p=!0;try{o=r(i),p=!1}finally{p?gS(a):hS(a)}return Yx(a,n),Xx(o,a)}else if(!t||!Qi(t)){if(o=r(t),o===void 0&&(o=t),o===vS&&(o=void 0),this.autoFreeze_&&CS(o,!0),n){let a=[],i=[];ga(Md).generateReplacementPatches_(t,o,{patches_:a,inversePatches_:i}),n(a,i)}return o}else kt(1,t)},this.produceWithPatches=(t,r)=>{if(pa(t))return(i,...p)=>this.produceWithPatches(i,f=>t(f,...p));let n,o;return[this.produce(t,r,(i,p)=>{n=i,o=p}),n,o]},dS(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),dS(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),dS(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Vt(e)||kt(8),Yt(e)&&(e=Bd(e));let t=Jx(this),r=SS(t,e,void 0);return r[ht].isManual_=!0,hS(t),r}finishDraft(e,t){let r=e&&e[ht];(!r||!r.isManual_)&&kt(9);let{scope_:n}=r;return Yx(n,t),Xx(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));let n=ga(Md).applyPatches_;return Yt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function SS(e,t,r,n){let[o,a]=zu(t)?ga(qd).proxyMap_(t,r):Wu(t)?ga(qd).proxySet_(t,r):TN(t,r);return(r?.scope_??rb()).drafts_.push(o),a.callbacks_=r?.callbacks_??[],a.key_=n,r&&n!==void 0?EN(r,a,n):a.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:m}=f;a.modified_&&m&&m.generatePatches_(a,[],f)}),o}function Bd(e){return Yt(e)||kt(10,e),sb(e)}function sb(e){if(!Vt(e)||Ud(e))return e;let t=e[ht],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=mS(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=mS(e,!0);return $u(r,(o,a)=>{Dd(r,o,sb(a))},n),t&&(t.finalized_=!1),r}function cb(){function t(C,b=[]){if(C.key_!==void 0){let w=C.parent_.copy_??C.parent_.base_,F=AN(Hn(w,C.key_)),I=Hn(w,C.key_);if(I===void 0||I!==C.draft_&&I!==C.base_&&I!==C.copy_||F!=null&&F.base_!==C.base_)return null;let E=C.parent_.type_===3,T;if(E){let P=C.parent_;T=Array.from(P.drafts_.keys()).indexOf(C.key_)}else T=C.key_;if(!(E&&w.size>T||Ui(w,T)))return null;b.push(T)}if(C.parent_)return t(C.parent_,b);b.reverse();try{r(C.copy_,b)}catch{return null}return b}function r(C,b){let w=C;for(let F=0;F<b.length-1;F++){let I=b[F];if(w=Hn(w,I),!Qi(w)||w===null)throw new Error(`Cannot resolve path at '${b.join("/")}'`)}return w}let n="replace",o="add",a="remove";function i(C,b,w){if(C.scope_.processedForPatches_.has(C))return;C.scope_.processedForPatches_.add(C);let{patches_:F,inversePatches_:I}=w;switch(C.type_){case 0:case 2:return f(C,b,F,I);case 1:return p(C,b,F,I);case 3:return m(C,b,F,I)}}function p(C,b,w,F){let{base_:I,assigned_:E}=C,T=C.copy_;T.length<I.length&&([I,T]=[T,I],[w,F]=[F,w]);let P=C.allIndicesReassigned_===!0;for(let D=0;D<I.length;D++){let G=T[D],Q=I[D];if((P||E?.get(D.toString()))&&G!==Q){let U=G?.[ht];if(U&&U.modified_)continue;let j=b.concat([D]);w.push({op:n,path:j,value:h(G)}),F.push({op:n,path:j,value:h(Q)})}}for(let D=I.length;D<T.length;D++){let G=b.concat([D]);w.push({op:o,path:G,value:h(T[D])})}for(let D=T.length-1;I.length<=D;--D){let G=b.concat([D]);F.push({op:a,path:G})}}function f(C,b,w,F){let{base_:I,copy_:E,type_:T}=C;$u(C.assigned_,(P,D)=>{let G=Hn(I,P,T),Q=Hn(E,P,T),V=D?Ui(I,P)?n:o:a;if(G===Q&&V===n)return;let U=b.concat(P);w.push(V===a?{op:V,path:U}:{op:V,path:U,value:h(Q)}),F.push(V===o?{op:a,path:U}:V===a?{op:o,path:U,value:h(G)}:{op:n,path:U,value:h(G)})})}function m(C,b,w,F){let{base_:I,copy_:E}=C,T=0;I.forEach(P=>{if(!E.has(P)){let D=b.concat([T]);w.push({op:a,path:D,value:P}),F.unshift({op:o,path:D,value:P})}T++}),T=0,E.forEach(P=>{if(!I.has(P)){let D=b.concat([T]);w.push({op:o,path:D,value:P}),F.unshift({op:a,path:D,value:P})}T++})}function g(C,b,w){let{patches_:F,inversePatches_:I}=w;F.push({op:n,path:[],value:b===vS?void 0:b}),I.push({op:n,path:[],value:C})}function S(C,b){return b.forEach(w=>{let{path:F,op:I}=w,E=C;for(let G=0;G<F.length-1;G++){let Q=ma(E),V=F[G];typeof V!="string"&&typeof V!="number"&&(V=""+V),(Q===0||Q===1)&&(V==="__proto__"||V===ju)&&kt(19),pa(E)&&V===Gu&&kt(19),E=Hn(E,V),(E===null||!Qi(E))&&kt(18,F.join("/"))}let T=ma(E),P=x(w.value),D=F[F.length-1];switch(I){case n:switch(T){case 2:return E.set(D,P);case 3:kt(16);default:return E[D]=P}case o:switch(T){case 1:return D==="-"?E.push(P):E.splice(D,0,P);case 2:return E.set(D,P);case 3:return E.add(P);default:return E[D]=P}case a:switch(T){case 1:return E.splice(D,1);case 2:return E.delete(D);case 3:return E.delete(w.value);default:return delete E[D]}default:kt(17,I)}}),C}function x(C){if(!Vt(C))return C;if(Hu(C))return C.map(x);if(zu(C))return new Map(Array.from(C.entries()).map(([w,F])=>[w,x(F)]));if(Wu(C))return new Set(Array.from(C).map(x));let b=Object.create(fa(C));for(let w in C)b[w]=x(C[w]);return Ui(C,Vu)&&(b[Vu]=C[Vu]),b}function h(C){return Yt(C)?x(C):C}xN(Md,{applyPatches_:S,generatePatches_:i,generateReplacementPatches_:g,getPath:t})}var _N=y.Iterator,WK=typeof _N?.from=="function";var Bu=new ON,ha=Bu.produce,xS=Bu.produceWithPatches.bind(Bu);var bS=Bu.applyPatches.bind(Bu);d();c();l();u();function NN(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function DN(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){let r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var ub=e=>Array.isArray(e)?e:[e];function qN(e){let t=Array.isArray(e[0])?e[0]:e;return DN(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function MN(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var VN=class{constructor(e){this.value=e}deref(){return this.value}},jN=()=>typeof WeakRef>"u"?VN:WeakRef,db=jN(),LN=0,lb=1;function Gd(){return{s:LN,v:void 0,o:null,p:null}}function UN(e){return e instanceof db?e.deref():e}function Ku(e,t={}){let r=Gd(),{resultEqualityCheck:n}=t,o,a=0;function i(){let p=r,{length:f}=arguments;for(let S=0,x=f;S<x;S++){let h=arguments[S];if(typeof h=="function"||typeof h=="object"&&h!==null){let C=p.o;C===null&&(p.o=C=new WeakMap);let b=C.get(h);b===void 0?(p=Gd(),C.set(h,p)):p=b}else{let C=p.p;C===null&&(p.p=C=new Map);let b=C.get(h);b===void 0?(p=Gd(),C.set(h,p)):p=b}}let m=p,g;if(p.s===lb)g=p.v;else if(g=e.apply(null,arguments),a++,n){let S=UN(o);S!=null&&n(S,g)&&(g=S,a!==0&&a--),o=typeof g=="object"&&g!==null||typeof g=="function"?new db(g):g}return m.s=lb,m.v=g,g}return i.clearCache=()=>{r=Gd(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function QN(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,i=0,p,f={},m=o.pop();typeof m=="object"&&(f=m,m=o.pop()),NN(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let g={...r,...f},{memoize:S,memoizeOptions:x=[],argsMemoize:h=Ku,argsMemoizeOptions:C=[]}=g,b=ub(x),w=ub(C),F=qN(o),I=S(function(){return a++,m.apply(null,arguments)},...b),E=!0,T=h(function(){i++;let D=MN(F,arguments);return p=I.apply(null,D),p},...w);return Object.assign(T,{resultFunc:m,memoizedResultFunc:I,dependencies:F,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:S,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var tt=QN(Ku);d();c();l();u();function pb(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var fb=pb(),mb=pb;var BN=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?qu:qu.apply(null,arguments)},S6=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},GN=e=>e&&typeof e.match=="function";function k(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Jt(0));return{type:e,payload:o.payload,...("meta"in o&&{meta:o.meta}),...("error"in o&&{error:o.error})}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>Mu(n)&&n.type===e,r}var xb=class Yu extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Yu.prototype)}static get[Symbol.species](){return Yu}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Yu(...t[0].concat(this)):new Yu(...t.concat(this))}};function gb(e){return Vt(e)?ha(e,()=>{}):e}function $d(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function $N(e){return typeof e=="boolean"}var HN=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new xb;return r&&($N(r)?i.push(fb):i.push(mb(r.extraArgument))),i},Ju="RTK_autoBatch",$i=()=>e=>({payload:e,meta:{[Ju]:!0}}),hb=e=>t=>{setTimeout(t,e)},zN=(e,t)=>r=>{let n=!1,o=()=>{n||(n=!0,cancelAnimationFrame(a),clearTimeout(i),r())},a=e(o),i=setTimeout(o,t)},WN=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,i=!1,p=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?zN(window.requestAnimationFrame,100):hb(10):e.type==="callback"?e.queueNotification:hb(e.timeout),m=()=>{i=!1,a&&(a=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let S=()=>o&&g(),x=n.subscribe(S);return p.add(g),()=>{x(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Ju],a=!o,a&&(i||(i=!0,f(m))),n.dispatch(g)}finally{o=!0}}})},KN=e=>function(r){let{autoBatch:n=!0}=r??{},o=new xb(e);return n&&o.push(WN(typeof n=="object"?n:void 0)),o};function bb(e){let t=HN(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:a=!0,preloadedState:i=void 0,enhancers:p=void 0}=e||{},f;if(typeof r=="function")f=r;else if(Xr(r))f=Li(r);else throw new Error(Jt(1));let m;typeof n=="function"?m=n(t):m=t();let g=qu;o&&(g=BN({trace:!1,...(typeof o=="object"&&o)}));let S=Hx(...m),x=KN(S),h=typeof p=="function"?p(x):x(),C=g(...h);return lS(f,i,C)}function wb(e){let t={},r=[],n,o={addCase(a,i){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(Jt(28));if(p in t)throw new Error(Jt(29));return t[p]=i,o},addAsyncThunk(a,i){return i.pending&&(t[a.pending.type]=i.pending),i.rejected&&(t[a.rejected.type]=i.rejected),i.fulfilled&&(t[a.fulfilled.type]=i.fulfilled),i.settled&&r.push({matcher:a.settled,reducer:i.settled}),o},addMatcher(a,i){return r.push({matcher:a,reducer:i}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function YN(e){return typeof e=="function"}function ae(e,t){let[r,n,o]=wb(t),a;if(YN(e))a=()=>gb(e());else{let p=gb(e);a=()=>p}function i(p=a(),f){let m=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return m.filter(g=>!!g).length===0&&(m=[o]),m.reduce((g,S)=>{if(S)if(Yt(g)){let h=S(g,f);return h===void 0?g:h}else{if(Vt(g))return ha(g,x=>S(x,f));{let x=S(g,f);if(x===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}}return g},p)}return i.getInitialState=a,i}var Rb=(e,t)=>GN(e)?e.match(t):e(t);function Zr(...e){return t=>e.some(r=>Rb(r,t))}function Gi(...e){return t=>e.every(r=>Rb(r,t))}function Kd(e,t){if(!e||!e.meta)return!1;let r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function Xu(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Yd(...e){return e.length===0?t=>Kd(t,["pending"]):Xu(e)?Zr(...e.map(t=>t.pending)):Yd()(e[0])}function Sa(...e){return e.length===0?t=>Kd(t,["rejected"]):Xu(e)?Zr(...e.map(t=>t.rejected)):Sa()(e[0])}function Zu(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Gi(Sa(...e),t):Xu(e)?Gi(Sa(...e),t):Zu()(e[0])}function Wn(...e){return e.length===0?t=>Kd(t,["fulfilled"]):Xu(e)?Zr(...e.map(t=>t.fulfilled)):Wn()(e[0])}function Jd(...e){return e.length===0?t=>Kd(t,["pending","fulfilled","rejected"]):Xu(e)?Zr(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Jd()(e[0])}var JN="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",el=(e=21)=>{let t="",r=e;for(;r--;)t+=JN[Math.random()*64|0];return t},XN=["name","message","stack","code"],wS=class{constructor(e,t){me(this,"payload");me(this,"meta");me(this,"_type");this.payload=e,this.meta=t}},yb=class{constructor(e,t){me(this,"payload");me(this,"meta");me(this,"_type");this.payload=e,this.meta=t}},ZN=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of XN)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},Sb="External signal was aborted",xe=(()=>{function e(t,r,n){let o=k(t+"/fulfilled",(f,m,g,S)=>({payload:f,meta:{...(S||{}),arg:g,requestId:m,requestStatus:"fulfilled"}})),a=k(t+"/pending",(f,m,g)=>({payload:void 0,meta:{...(g||{}),arg:m,requestId:f,requestStatus:"pending"}})),i=k(t+"/rejected",(f,m,g,S,x)=>({payload:S,error:(n&&n.serializeError||ZN)(f||"Rejected"),meta:{...(x||{}),arg:g,requestId:m,rejectedWithValue:!!S,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f,{signal:m}={}){return(g,S,x)=>{let h=n?.idGenerator?n.idGenerator(f):el(),C=new s.AbortController,b,w;function F(E){w=E,C.abort()}m&&(m.aborted?F(Sb):m.addEventListener("abort",()=>F(Sb),{once:!0}));let I=_asyncToGenerator(function*(){let E;try{let P=n?.condition?.(f,{getState:S,extra:x});if(tD(P)&&(P=yield P),P===!1||C.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let D=new Promise((G,Q)=>{b=()=>{Q({name:"AbortError",message:w||"Aborted"})},C.signal.addEventListener("abort",b,{once:!0})});g(a(h,f,n?.getPendingMeta?.({requestId:h,arg:f},{getState:S,extra:x}))),E=yield Promise.race([D,Promise.resolve(r(f,{dispatch:g,getState:S,extra:x,requestId:h,signal:C.signal,abort:F,rejectWithValue:(G,Q)=>new wS(G,Q),fulfillWithValue:(G,Q)=>new yb(G,Q)})).then(G=>{if(G instanceof wS)throw G;return G instanceof yb?o(G.payload,h,f,G.meta):o(G,h,f)})])}catch(P){E=P instanceof wS?i(null,h,f,P.payload,P.meta):i(P,h,f)}finally{b&&C.signal.removeEventListener("abort",b)}return n&&!n.dispatchConditionRejection&&i.match(E)&&E.meta.condition||g(E),E})();return Object.assign(I,{abort:F,requestId:h,arg:f,unwrap(){return I.then(eD)}})}}return Object.assign(p,{pending:a,rejected:i,fulfilled:o,settled:Zr(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function eD(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function tD(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Fb=Symbol.for("rtk-slice-createasyncthunk"),A6={[Fb]:xe};function rD(e,t){return`${e}/${t}`}function nD({creators:e}={}){let t=e?.asyncThunk?.[Fb];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Jt(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(aD()):n.reducers)||{},p=Object.keys(i),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(E,T){let P=typeof E=="string"?E:E.type;if(!P)throw new Error(Jt(12));if(P in f.sliceCaseReducersByType)throw new Error(Jt(13));return f.sliceCaseReducersByType[P]=T,m},addMatcher(E,T){return f.sliceMatchers.push({matcher:E,reducer:T}),m},exposeAction(E,T){return f.actionCreators[E]=T,m},exposeCaseReducer(E,T){return f.sliceCaseReducersByName[E]=T,m}};p.forEach(E=>{let T=i[E],P={reducerName:E,type:rD(o,E),createNotation:typeof n.reducers=="function"};sD(T)?uD(P,T,m,t):iD(P,T,m)});function g(){let[E={},T=[],P=void 0]=typeof n.extraReducers=="function"?wb(n.extraReducers):[n.extraReducers],D={...E,...f.sliceCaseReducersByType};return ae(n.initialState,G=>{for(let Q in D)G.addCase(Q,D[Q]);for(let Q of f.sliceMatchers)G.addMatcher(Q.matcher,Q.reducer);for(let Q of T)G.addMatcher(Q.matcher,Q.reducer);P&&G.addDefaultCase(P)})}let S=E=>E,x=new Map,h=new WeakMap,C;function b(E,T){return C||(C=g()),C(E,T)}function w(){return C||(C=g()),C.getInitialState()}function F(E,T=!1){function P(G){let Q=G[E];return typeof Q>"u"&&T&&(Q=$d(h,P,w)),Q}function D(G=S){let Q=$d(x,T,()=>new WeakMap);return $d(Q,G,()=>{let V={};for(let[U,j]of Object.entries(n.selectors??{}))V[U]=oD(j,G,()=>$d(h,G,w),T);return V})}return{reducerPath:E,getSelectors:D,get selectors(){return D(P)},selectSlice:P}}let I={name:o,reducer:b,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:w,...F(a),injectInto(E,{reducerPath:T,...P}={}){let D=T??a;return E.inject({reducerPath:D,reducer:b},P),{...I,...F(D,!0)}}};return I}}function oD(e,t,r,n){function o(a,...i){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...i)}return o.unwrapped=e,o}var va=nD();function aD(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function iD({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!cD(n))throw new Error(Jt(17));a=n.reducer,i=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?k(e,i):k(e))}function sD(e){return e._reducerDefinitionType==="asyncThunk"}function cD(e){return e._reducerDefinitionType==="reducerWithPrepare"}function uD({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Jt(18));let{payloadCreator:a,fulfilled:i,pending:p,rejected:f,settled:m,options:g}=r,S=o(e,a,g);n.exposeAction(t,S),i&&n.addCase(S.fulfilled,i),p&&n.addCase(S.pending,p),f&&n.addCase(S.rejected,f),m&&n.addMatcher(S.settled,m),n.exposeCaseReducer(t,{fulfilled:i||Hd,pending:p||Hd,rejected:f||Hd,settled:m||Hd})}function Hd(){}var lD="task",Eb="listener",Ib="completed",ES="cancelled",dD=`task-${ES}`,pD=`task-${Ib}`,RS=`${Eb}-${ES}`,fD=`${Eb}-${Ib}`,Xd=class{constructor(e){me(this,"code");me(this,"name","TaskAbortError");me(this,"message");this.code=e,this.message=`${lD} ${ES} (reason: ${e})`}},IS=(e,t)=>{if(typeof e!="function")throw new TypeError(Jt(32))},zd=()=>{},Tb=(e,t=zd)=>(e.catch(t),e),Pb=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),ya=e=>{if(e.aborted)throw new Xd(e.reason)};function kb(e,t){let r=zd;return new Promise((n,o)=>{let a=()=>o(new Xd(e.reason));if(e.aborted){a();return}r=Pb(e,a),t.finally(()=>r()).then(n,o)}).finally(()=>{r=zd})}var mD=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof Xd?"cancelled":"rejected",error:r}}finally{t?.()}});return function mD(_x7,_x8){return _ref5.apply(this,arguments)}}(),Wd=e=>t=>Tb(kb(e,t).then(r=>(ya(e),r))),Ob=e=>{let t=Wd(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Bi}=Object,vb={},Zd="listenerMiddleware",gD=(e,t)=>{let r=n=>Pb(e,()=>n.abort(e.reason));return(n,o)=>{IS(n,"taskExecutor");let a=new s.AbortController;r(a);let i=mD(/*#__PURE__*/_asyncToGenerator(function*(){ya(e),ya(a.signal);let p=yield n({pause:Wd(a.signal),delay:Ob(a.signal),signal:a.signal});return ya(a.signal),p}),()=>a.abort(pD));return o?.autoJoin&&t.push(i.catch(zd)),{result:Wd(e)(i),cancel(){a.abort(dD)}}}},hD=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){ya(t);let a=()=>{},p=[new Promise((f,m)=>{let g=e({predicate:n,effect:(S,x)=>{x.unsubscribe(),f([S,x.getState(),x.getOriginalState()])}});a=()=>{g(),m()}})];o!=null&&p.push(new Promise(f=>setTimeout(f,o,null)));try{let f=yield kb(t,Promise.race(p));return ya(t),f}finally{a()}});return function r(_x9,_x0){return _ref7.apply(this,arguments)}}();return(n,o)=>Tb(r(n,o))},_b=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:a}=e;if(t)o=k(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(Jt(21));return IS(a,"options.listener"),{predicate:o,type:t,effect:a}},Nb=Bi(e=>{let{type:t,predicate:r,effect:n}=_b(e);return{id:el(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Jt(22))}}},{withTypes:()=>Nb}),Ab=(e,t)=>{let{type:r,effect:n,predicate:o}=_b(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===o)&&a.effect===n)},FS=e=>{e.pending.forEach(t=>{t.abort(RS)})},yD=(e,t)=>()=>{for(let r of t.keys())FS(r);e.clear()},Cb=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},Db=Bi(k(`${Zd}/add`),{withTypes:()=>Db}),SD=k(`${Zd}/removeAll`),qb=Bi(k(`${Zd}/remove`),{withTypes:()=>qb}),vD=(...e)=>{console.error(`${Zd}/error`,...e)},Mb=(e={})=>{let t=new Map,r=new Map,n=h=>{let C=r.get(h)??0;r.set(h,C+1)},o=h=>{let C=r.get(h)??1;C===1?r.delete(h):r.set(h,C-1)},{extra:a,onError:i=vD}=e;IS(i,"onError");let p=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),C=>{h.unsubscribe(),C?.cancelActive&&FS(h)}),f=h=>{let C=Ab(t,h)??Nb(h);return p(C)};Bi(f,{withTypes:()=>f});let m=h=>{let C=Ab(t,h);return C&&(C.unsubscribe(),h.cancelActive&&FS(C)),!!C};Bi(m,{withTypes:()=>m});let g=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(h,C,b,w){let F=new s.AbortController,I=hD(f,F.signal),E=[];try{h.pending.add(F),n(h),yield Promise.resolve(h.effect(C,Bi({},b,{getOriginalState:w,condition:(T,P)=>I(T,P).then(Boolean),take:I,delay:Ob(F.signal),pause:Wd(F.signal),extra:a,signal:F.signal,fork:gD(F.signal,E),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((T,P,D)=>{T!==F&&(T.abort(RS),D.delete(T))})},cancel:()=>{F.abort(RS),h.pending.delete(F)},throwIfCancelled:()=>{ya(F.signal)}})))}catch(T){T instanceof Xd||Cb(i,T,{raisedBy:"effect"})}finally{yield Promise.all(E),F.abort(fD),o(h),h.pending.delete(F)}});return function g(_x1,_x10,_x11,_x12){return _ref8.apply(this,arguments)}}(),S=yD(t,r);return{middleware:h=>C=>b=>{if(!Mu(b))return C(b);if(Db.match(b))return f(b.payload);if(SD.match(b)){S();return}if(qb.match(b))return m(b.payload);let w=h.getState(),F=()=>{if(w===vb)throw new Error(Jt(23));return w},I;try{if(I=C(b),t.size>0){let E=h.getState(),T=Array.from(t.values());for(let P of T){let D=!1;try{D=P.predicate(b,E,w)}catch(G){D=!1,Cb(i,G,{raisedBy:"predicate"})}D&&g(P,b,h,F)}}}finally{w=vb}return I},startListening:f,stopListening:m,clearListeners:S}};function Jt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}d();c();l();u();d();c();l();u();d();c();l();u();function Vb(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}d();c();l();u();d();c();l();u();d();c();l();u();var jb=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function AD(e){return typeof e=="string"&&jb.test(e)}var TS=AD;d();c();l();u();var Ot=[];for(let e=0;e<256;++e)Ot.push((e+256).toString(16).slice(1));function Lb(e,t=0){return(Ot[e[t+0]]+Ot[e[t+1]]+Ot[e[t+2]]+Ot[e[t+3]]+"-"+Ot[e[t+4]]+Ot[e[t+5]]+"-"+Ot[e[t+6]]+Ot[e[t+7]]+"-"+Ot[e[t+8]]+Ot[e[t+9]]+"-"+Ot[e[t+10]]+Ot[e[t+11]]+Ot[e[t+12]]+Ot[e[t+13]]+Ot[e[t+14]]+Ot[e[t+15]]).toLowerCase()}d();c();l();u();var CD=new Uint8Array(16);function PS(){return crypto.getRandomValues(CD)}d();c();l();u();function xD(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():bD(e,t,r)}function bD(e,t,r){e=e||{};let n=e.random??e.rng?.()??PS();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 Lb(n)}var kS=xD;function wD(_x13){return _wD.apply(this,arguments)}function _wD(){_wD=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:i}=e;if(i!=="disabled")return n.call(r),t.send(o,a,r)});return _wD.apply(this,arguments)}var Hb="2.1.3",OS=128,zb=192,Ub=224,Qb=240,RD=248;function FD(e){return(e&RD)===Qb?4:(e&Qb)===Ub?3:(e&Ub)===zb?2:1}function ED(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&OS)!=OS)break;if(r-=3,(n&zb)!=OS){t-r>=FD(n)*3&&(r=t);break}}return e.substring(0,r)}function ID(e){let{trackingId:t}=e;return{trackingId:t}}function TD(e){return(e.source||[]).concat([`relay@${Hb}`])}function Wb(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:a}=r,i=ID(t),p=r.getClientId();return Object.freeze({type:e,config:i,ts:Date.now(),source:TD(t),clientId:p,userAgent:a(),referrer:Bb(n()),location:Bb(o())})}function Bb(e){return e!==null?ED(e,1024):null}function PD(e,t,r,n){return{...t,meta:Wb(e,r,n)}}var kD="*";function OD(){let e=[];function t({type:f,callback:m}){return e.findIndex(g=>g.type===f&&g.callback===m)}function r(f,m){return f.type==="*"||m===f.type}function n(f){return t(f)<0&&e.push(f),()=>p(f.type,f.callback)}function o(f){e.forEach(m=>{if(r(m,f.meta.type))try{m.callback(f)}catch(g){console.error(g)}})}function a(f){if(f===kD)e.length=0;else for(let m=e.length-1;m>=0;m--)e[m].type===f&&e.splice(m,1)}function i(f){let m=t(f);m>=0&&e.splice(m,1)}function p(f,m){m?i({type:f,callback:m}):a(f)}return{add:n,call:o,remove:p}}function Gb({url:e,token:t,trackingId:r,...n}){return Object.freeze({url:e,token:t,trackingId:r,...(!!n.mode&&{mode:n.mode}),...(!!n.source&&{source:n.source}),...(!!n.environment&&{environment:n.environment})})}function _D(e){let t=Gb(e);return{get:()=>t,update:r=>{t=Gb({...t,...r})}}}var _S=ND();function ND(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let i=a.replace(/^\s+/,"");if(i.lastIndexOf(n,0)===0)return i.substring(n.length,i.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),i=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${i}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function DD(){return{getItem(e){return _S.getItem(e)||localStorage.getItem(e)},removeItem(e){_S.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),_S.setItem(e,t,31556952e3)}}}var $b="visitorId";function qD(){let e=document.referrer;return e===""?null:e}function NS(){let e=DD();return{runtime:"browser",send:function(){var _ref9=_asyncToGenerator(function*(t,r,n){let o=v(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});Vb().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let i=yield o;if(i?.ok){let p;try{p=yield i.json()}catch{return}for(let f of p.events)if(!f.accepted)throw new Error(`Received event was rejected for processing: ${f.errorMessage}`)}else throw new Error(`Error ${i.status}: Failed to send the event(s).`)});return function send(_x14,_x15,_x16){return _ref9.apply(this,arguments)}}(),getReferrer:()=>qD(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem($b);if(t&&TS(t))return t;let r=kS();return e.setItem($b,r),r}}}function MD(){try{let e="__storage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&e.name==="QuotaExceededError"&&localStorage&&localStorage.length!==0}}function VD(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function jD(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=VD();return t&&r?{...r,runtime:"custom"}:t&&LD()&&MD()?NS():n}function LD(){try{return typeof window=="object"}catch{return!1}}function UD(e){return{get:()=>Object.freeze(jD(e))}}function Kb(e){let t=_D(e),r=OD(),n=UD(t);return{emit:function(){var _ref0=_asyncToGenerator(function*(o,a){let i=t.get(),p=n.get(),f=PD(o,a,i,p);return wD({config:i,environment:p,event:f,listenerManager:r})});return function emit(_x17,_x18){return _ref0.apply(this,arguments)}}(),getMeta:o=>Wb(o,t.get(),n.get()),on:(o,a)=>r.add({type:o,callback:a}),off:(o,a)=>r.remove(o,a),updateConfig:o=>t.update(o),version:Hb}}d();c();l();u();function Yb(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var Ao="3.55.3",Jb=["@coveo/atomic","@coveo/quantic"];var Hi=tt(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Ao}`));var tl=tt(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Hi(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i,p)=>{let f=BD(p);return Kb({mode:a?"emit":"disabled",url:o??Rd(e,t),token:r,trackingId:n??null,source:i,environment:f})}),QD={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref1=_asyncToGenerator(function*(){});return function send(){return _ref1.apply(this,arguments)}}()},BD=e=>{if(!e)return;let t=e();return{...(Yb()?NS():QD),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();d();c();l();u();function Kn(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function B(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(S){i(S)}}function f(g){try{m(n.throw(g))}catch(S){i(S)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}var _e;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(_e||(_e={}));function MS(){return typeof window<"u"}function YS(){return typeof navigator<"u"}function zi(){return typeof document<"u"}function VS(){try{return typeof localStorage<"u"}catch{return!1}}function GD(){try{return typeof sessionStorage<"u"}catch{return!1}}function lw(){return YS()&&navigator.cookieEnabled}var $D=[_e.click,_e.custom,_e.search,_e.view],HD=(e,t)=>$D.indexOf(e)!==-1?Object.assign({language:zi()?document.documentElement.lang:"unknown",userAgent:YS()?navigator.userAgent:"unknown"},t):t,nl=class e{static set(t,r,n){var o,a,i,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?Xb(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],Xb(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function Xb(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}function zD(){return VS()?localStorage:lw()?new ol:GD()?sessionStorage:new Ki}var ol=class e{getItem(t){return nl.get(`${e.prefix}${t}`)}removeItem(t){nl.erase(`${e.prefix}${t}`)}setItem(t,r,n){nl.set(`${e.prefix}${t}`,r,n)}};ol.prefix="coveo_";var jS=class{constructor(){this.cookieStorage=new ol}getItem(t){return localStorage.getItem(t)||this.cookieStorage.getItem(t)}removeItem(t){this.cookieStorage.removeItem(t),localStorage.removeItem(t)}setItem(t,r){localStorage.setItem(t,r),this.cookieStorage.setItem(t,r,31556926e3)}},Ki=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},ep="__coveo.analytics.history",WD=20,KD=1e3*60,YD=75,rp=class{constructor(t){this.store=t||zD()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return B(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return B(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(ep);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return B(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(ep);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(ep,JSON.stringify(t.slice(0,WD)))}catch{}}clear(){try{this.store.removeItem(ep)}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,YD)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>KD:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var JD=(e,t)=>B(void 0,void 0,void 0,function*(){return e===_e.view?(yield XD(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),XD=e=>B(void 0,void 0,void 0,function*(){let t=new rp,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),ZD=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function np(e){return typeof e=="string"&&ZD.test(e)}function Zb(e){if(!np(e))throw TypeError("Invalid UUID");let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}var _t=[];for(let e=0;e<256;++e)_t.push((e+256).toString(16).slice(1));function dw(e,t=0){return(_t[e[t+0]]+_t[e[t+1]]+_t[e[t+2]]+_t[e[t+3]]+"-"+_t[e[t+4]]+_t[e[t+5]]+"-"+_t[e[t+6]]+_t[e[t+7]]+"-"+_t[e[t+8]]+_t[e[t+9]]+"-"+_t[e[t+10]]+_t[e[t+11]]+_t[e[t+12]]+_t[e[t+13]]+_t[e[t+14]]+_t[e[t+15]]).toLowerCase()}var eq=new Uint8Array(16);function tq(){return crypto.getRandomValues(eq)}function rq(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let r=0;r<e.length;++r)t[r]=e.charCodeAt(r);return t}var nq="6ba7b810-9dad-11d1-80b4-00c04fd430c8",oq="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function aq(e,t,r,n,o,a){let i=typeof r=="string"?rq(r):r,p=typeof n=="string"?Zb(n):n;if(typeof n=="string"&&(n=Zb(n)),n?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let f=new Uint8Array(16+i.length);return f.set(p),f.set(i,p.length),f=t(f),f[6]=f[6]&15|e,f[8]=f[8]&63|128,dw(f)}function Aa(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():iq(e,t,r)}function iq(e,t,r){e=e||{};let n=e.random??e.rng?.()??tq();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 dw(n)}function sq(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function DS(e,t){return e<<t|e>>>32-t}function cq(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520],n=new Uint8Array(e.length+1);n.set(e),n[e.length]=128,e=n;let o=e.length/4+2,a=Math.ceil(o/16),i=new Array(a);for(let p=0;p<a;++p){let f=new Uint32Array(16);for(let m=0;m<16;++m)f[m]=e[p*64+m*4]<<24|e[p*64+m*4+1]<<16|e[p*64+m*4+2]<<8|e[p*64+m*4+3];i[p]=f}i[a-1][14]=(e.length-1)*8/2**32,i[a-1][14]=Math.floor(i[a-1][14]),i[a-1][15]=(e.length-1)*8&4294967295;for(let p=0;p<a;++p){let f=new Uint32Array(80);for(let C=0;C<16;++C)f[C]=i[p][C];for(let C=16;C<80;++C)f[C]=DS(f[C-3]^f[C-8]^f[C-14]^f[C-16],1);let m=r[0],g=r[1],S=r[2],x=r[3],h=r[4];for(let C=0;C<80;++C){let b=Math.floor(C/20),w=DS(m,5)+sq(b,g,S,x)+h+t[b]+f[C]>>>0;h=x,x=S,S=DS(g,30)>>>0,g=m,m=w}r[0]=r[0]+m>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+S>>>0,r[3]=r[3]+x>>>0,r[4]=r[4]+h>>>0}return Uint8Array.of(r[0]>>24,r[0]>>16,r[0]>>8,r[0],r[1]>>24,r[1]>>16,r[1]>>8,r[1],r[2]>>24,r[2]>>16,r[2]>>8,r[2],r[3]>>24,r[3]>>16,r[3]>>8,r[3],r[4]>>24,r[4]>>16,r[4]>>8,r[4])}function op(e,t,r,n){return aq(80,cq,e,t)}op.DNS=nq;op.URL=oq;var pw="2.33.0",ew=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,rl={pageview:"pageview",event:"event"},ap=class{constructor({client:t,uuidGenerator:r=Aa}){this.client=t,this.uuidGenerator=r}},LS=class extends ap{constructor({client:t,uuidGenerator:r=Aa}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=ew(window.location),this.lastReferrer=zi()?document.referrer:"",this.addHooks()}getApi(t){return t==="setAction"?this.setAction:null}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:zi()?document.title:"",encoding:zi()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===rl.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===rl.pageview?this.nextPageViewId:this.pageViewId,referrer:t===rl.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===rl.pageview?this.getCurrentLocationFromPayload(r):this.currentLocation}}getCurrentLocationFromPayload(t){if(t.page){let r=o=>o.replace(/^\/?(.*)$/,"/$1");return`${(o=>o.split("/").slice(0,3).join("/"))(this.currentLocation)}${r(t.page)}`}else return ew(window.location)}},Co=class e{constructor(t,r){if(!np(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return np(a)?new e(a,Number.parseInt(o)*1e3):null}};Co.cvo_cid="cvo_cid";Co.expirationTime=120;var US=class extends ap{constructor({client:t,uuidGenerator:r=Aa}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return B(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(Co.cvo_cid,new Co(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};US.Id="link";var Sr=Object.keys;function tp(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var qS=128,fw=192,tw=224,rw=240;function uq(e){return(e&248)===rw?4:(e&rw)===tw?3:(e&tw)===fw?2:1}function lq(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&qS)!=qS)break;if(r-=3,(n&fw)!=qS){t-r>=uq(n)*3&&(r=t);break}}return e.substring(0,r)}var QS={id:"svc_ticket_id",subject:"svc_ticket_subject",description:"svc_ticket_description",category:"svc_ticket_category",productId:"svc_ticket_product_id",custom:"svc_ticket_custom"},dq=Sr(QS).map(e=>QS[e]),pq=[...dq].join("|"),fq=new RegExp(`^(${pq}$)`),mq={svcAction:"svc_action",svcActionData:"svc_action_data"},gq=e=>Sr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=QS[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),hq=e=>fq.test(e),yq=[hq],nw={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},ow={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},jt={action:"pa",list:"pal",listSource:"pls"},ip={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},Sq=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],BS={id:"quoteId",affiliation:"quoteAffiliation"},GS={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},vq={add:jt,bookmark_add:jt,bookmark_remove:jt,click:jt,checkout:jt,checkout_option:jt,detail:jt,impression:jt,remove:jt,refund:Object.assign(Object.assign({},jt),ip),purchase:Object.assign(Object.assign({},jt),ip),quickview:jt,quote:Object.assign(Object.assign({},jt),BS),review:Object.assign(Object.assign({},jt),GS)},Aq=Sr(nw).map(e=>nw[e]),Cq=Sr(ow).map(e=>ow[e]),xq=Sr(jt).map(e=>jt[e]),bq=Sr(ip).map(e=>ip[e]),wq=Sr(GS).map(e=>GS[e]),Rq=Sr(BS).map(e=>BS[e]),Fq=[...Aq,"custom"].join("|"),Eq=[...Cq,"custom"].join("|"),mw="(pr[0-9]+)",gw="(il[0-9]+pi[0-9]+)",Iq=new RegExp(`^${mw}(${Fq})$`),Tq=new RegExp(`^(${gw}(${Eq}))|(il[0-9]+nm)$`),Pq=new RegExp(`^(${xq.join("|")})$`),kq=new RegExp(`^(${bq.join("|")})$`),Oq=new RegExp(`^${mw}custom$`),_q=new RegExp(`^${gw}custom$`),Nq=new RegExp(`^(${[...Sq,...wq,...Rq].join("|")})$`),Dq=e=>Iq.test(e),qq=e=>Tq.test(e),Mq=e=>Pq.test(e),Vq=e=>kq.test(e),jq=e=>Nq.test(e),Lq=[qq,Dq,Mq,Vq,jq],Uq=[Oq,_q],Qq={anonymizeIp:"aip"},Bq={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},Gq={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},$q=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],Hq=Object.assign(Object.assign(Object.assign(Object.assign({},Qq),Bq),Gq),$q.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),$S=Object.assign(Object.assign({},Hq),mq),zq=e=>{let t=!!e.action&&vq[e.action]||{};return Sr(e).reduce((r,n)=>{let o=t[n]||$S[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},Wq=Sr($S).map(e=>$S[e]),Kq=e=>Wq.indexOf(e)!==-1,Yq=e=>e==="custom",Jq=e=>[...Lq,...yq,Kq,Yq].some(t=>t(e)),Xq=e=>Sr(e).reduce((t,r)=>{let n=Zq(r);return n?Object.assign(Object.assign({},t),eM(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Zq=e=>{let t;return[...Uq].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},eM=(e,t)=>Sr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),HS=class{constructor(t){this.opts=t}sendEvent(t,r){return B(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:i,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),f=this.encodeForEventType(t,p),m=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(i,m)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return B(this,void 0,void 0,function*(){let o=t,a=r;if(n){let i=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:f}=i;o=p||t;try{a=JSON.parse(f)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return B(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[_e.click,_e.custom,_e.search,_e.view].indexOf(t)!==-1}encodeEventToJson(t,r,n){let o=`${t}Event=${encodeURIComponent(JSON.stringify(r))}`;return n&&(o=`access_token=${encodeURIComponent(n)}&${o}`),o}},zS=class{sendEvent(t,r){return B(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return B(this,void 0,void 0,function*(){return Promise.resolve()})}},aw=y.fetch,sp=class{constructor(t){this.opts=t}sendEvent(t,r){return B(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,i=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${i}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:m}=f,g=Kn(f,["url"]),S;try{S=yield aw(m,g)}catch(x){console.error("An error has occurred when sending the event.",x);return}if(S.ok){let x=yield S.json();return x.visitorId&&o.setCurrentVisitorId(x.visitorId),x}else{try{S.json()}catch{}throw console.error(`An error has occurred when sending the "${t}" event.`,S,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return B(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield aw(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[_e.click,_e.custom,_e.search,_e.view].indexOf(t)!==-1}getVisitorIdParam(){return B(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},WS=class{constructor(t,r){VS()&&lw()?this.storage=new jS:VS()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Ki),this.client=new sp(t),this.beaconClient=new HS(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},KS=class{constructor(t,r){this.storage=r||new Ki,this.client=new sp(t)}getClientDependingOnEventType(t){return this.client}},cp=class{constructor(){this.storage=new Ki,this.client=new zS}getClientDependingOnEventType(t){return this.client}},tM="xx",rM=e=>e?.startsWith(tM)||!1,nM=`
|
|
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 Xq(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var Zq=["1",1,"yes",!0];function eM(){let e=[];return DS()&&e.push(window.doNotTrack),WS()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>Zq.indexOf(t)!==-1)}function sp(e){return e===!0?!1:eM()}var mw="v15",gw={default:"https://analytics.cloud.coveo.com/rest/ua"};function tM(e=gw.default,t=mw,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 rM="38824e1f-37f5-42d3-8372-a4b8fa9df946",en=class{get defaultOptions(){return{endpoint:gw.default,isCustomEndpoint:!1,token:"",version:mw,beforeSendHooks:[],afterSendHooks:[]}}get version(){return uw}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=[$D,LD].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};sp(this.options.disableBrowserPrivacySignals)?this.runtime=new ip:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(Ne.view,{newEventType:Ne.view,addClientIdParameter:!0}),this.addEventTypeMapping(Ne.click,{newEventType:Ne.click,addClientIdParameter:!0}),this.addEventTypeMapping(Ne.custom,{newEventType:Ne.custom,addClientIdParameter:!0}),this.addEventTypeMapping(Ne.search,{newEventType:Ne.search,addClientIdParameter:!0})}initRuntime(t){return DS()&&Hi()?new HS(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(Xq()&&console.warn(Jq),new zS(t))}get storage(){return this.runtime.storage}determineVisitorId(){return Q(this,void 0,void 0,function*(){try{return DS()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Aa()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Aa()}})}getCurrentVisitorId(){return Q(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return Q(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return Q(this,void 0,void 0,function*(){if(tp(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(rp(t,rp(r,rM)))}})}getParameters(t,...r){return Q(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return Q(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(Aa()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(sp(this.options.disableBrowserPrivacySignals))return null;try{let r=new URL(t).searchParams.get(Co.cvo_cid);if(r==null)return null;let n=Co.fromString(r);return!n||!Hi()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return Q(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:a=!1,addClientIdParameter:i=!1}=this.eventTypeMapping[t]||{};return yield[v=>n.length>0?this.parseVariableArgumentsPayload(n,v):v[0],v=>Q(this,void 0,void 0,function*(){return Object.assign(Object.assign({},v),{visitorId:o?yield this.getCurrentVisitorId():""})}),v=>Q(this,void 0,void 0,function*(){return i?Object.assign(Object.assign({},v),{clientId:yield this.getCurrentVisitorId()}):v}),v=>a?this.ensureAnonymousUserWhenUsingApiKey(v):v,v=>this.beforeSendHooks.reduce((C,b)=>Q(this,void 0,void 0,function*(){let w=yield C;return yield b(t,w)}),v)].reduce((v,C)=>Q(this,void 0,void 0,function*(){let b=yield v;return yield C(b)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return Q(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[y=>this.setTrackingIdIfTrackingIdNotPresent(y),y=>this.removeEmptyPayloadValues(y,t),y=>this.validateParams(y,t),y=>n?Uq(y):y,y=>n?this.removeUnknownParameters(y):y,y=>n?this.processCustomParameters(y):this.mapCustomParametersToCustomData(y)].reduce((y,x)=>Q(this,void 0,void 0,function*(){let v=yield y;return yield x(v)}),Promise.resolve(r))})}makeEvent(t,...r){return Q(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),a=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:a,log:i=>Q(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 Q(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return Q(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new ep().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(Ne.search,t)})}sendSearchEvent(t){return Q(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Kn(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(Ne.click,t)})}sendClickEvent(t){return Q(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Kn(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(Ne.custom,t)})}sendCustomEvent(t){return Q(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=Kn(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(Ne.view,t)})}sendViewEvent(t){return Q(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return Q(this,void 0,void 0,function*(){let r=yield(yield S(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return Q(this,void 0,void 0,function*(){return yield(yield S(`${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({[Ne.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($q(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=Kn(t,["custom"]),o={};r&&Zd(r)&&(o=this.lowercaseKeys(r));let a=Hq(n);return Object.assign(Object.assign({},o),a)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=Kn(t,["custom"]);if(r&&Zd(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=Kn(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==Ne.view||r==Ne.click||r==Ne.search||r==Ne.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==Ne.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=Kn(t,["userId"]);return Yq(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=Kn(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Zd(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Zd(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"?oq(t,r):t}get baseUrl(){return tM(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},Yn;(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"})(Yn||(Yn={}));var $;(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"})($||($={}));var ow={[$.triggerNotify]:"queryPipelineTriggers",[$.triggerExecute]:"queryPipelineTriggers",[$.triggerQuery]:"queryPipelineTriggers",[$.triggerRedirect]:"queryPipelineTriggers",[$.queryErrorBack]:"errors",[$.queryErrorClear]:"errors",[$.queryErrorRetry]:"errors",[$.pagerNext]:"getMoreResults",[$.pagerPrevious]:"getMoreResults",[$.pagerNumber]:"getMoreResults",[$.pagerResize]:"getMoreResults",[$.pagerScrolling]:"getMoreResults",[$.facetSearch]:"facet",[$.facetShowLess]:"facet",[$.facetShowMore]:"facet",[$.recommendation]:"recommendation",[$.likeSmartSnippet]:"smartSnippet",[$.dislikeSmartSnippet]:"smartSnippet",[$.expandSmartSnippet]:"smartSnippet",[$.collapseSmartSnippet]:"smartSnippet",[$.openSmartSnippetFeedbackModal]:"smartSnippet",[$.closeSmartSnippetFeedbackModal]:"smartSnippet",[$.sendSmartSnippetReason]:"smartSnippet",[$.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.clearRecentQueries]:"recentQueries",[$.recentResultClick]:"recentlyClickedDocuments",[$.clearRecentResults]:"recentlyClickedDocuments",[$.showLessFoldedResults]:"folding",[$.caseDetach]:"case",[$.likeGeneratedAnswer]:"generatedAnswer",[$.dislikeGeneratedAnswer]:"generatedAnswer",[$.openGeneratedAnswerSource]:"generatedAnswer",[$.generatedAnswerOpenInlineLink]:"generatedAnswer",[$.generatedAnswerFollowupOpenSource]:"generatedAnswer",[$.generatedAnswerStreamEnd]:"generatedAnswer",[$.generatedAnswerSourceHover]:"generatedAnswer",[$.generatedAnswerCopyToClipboard]:"generatedAnswer",[$.generatedAnswerHideAnswers]:"generatedAnswer",[$.generatedAnswerShowAnswers]:"generatedAnswer",[$.generatedAnswerExpand]:"generatedAnswer",[$.generatedAnswerCollapse]:"generatedAnswer",[$.generatedAnswerFeedbackSubmit]:"generatedAnswer",[$.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[Yn.expandToFullUI]:"interface",[Yn.openUserActions]:"User Actions",[Yn.showPrecedingSessions]:"User Actions",[Yn.showFollowingSessions]:"User Actions",[Yn.clickViewedDocument]:"User Actions",[Yn.clickPageView]:"User Actions",[Yn.createArticle]:"createArticle"},Ki=class{constructor(){this.runtime=new ip,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(Ne.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(Ne.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(Ne.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(Ne.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return uw}};function nM(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function oM(e){return e.map(t=>t.replace(/;/g,""))}function hw(e){let r=e.join(";");return r.length<=256?r:hw(e.slice(1))}var aw=e=>{let t=oM(e),r=nM(t);return hw(r)};function iw(e){let t=typeof e.partialQueries=="string"?e.partialQueries:aw(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:aw(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var cp=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||sp(t.disableBrowserPrivacySignals);this.coveoAnalyticsClient=n?new Ki:new en(t)}disable(){this.coveoAnalyticsClient=new Ki}enable(){this.coveoAnalyticsClient=new en(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent($.interfaceLoad)}logInterfaceLoad(){return Q(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent($.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent($.recommendation)}logRecommendation(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent($.recommendationOpen,t,r)}logRecommendationOpen(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent($.staticFilterClearAll,t)}logStaticFilterClearAll(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent($.staticFilterSelect,t)}logStaticFilterSelect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent($.staticFilterDeselect,t)}logStaticFilterDeselect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent($.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent($.interfaceChange,t)}logInterfaceChange(t){return Q(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent($.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return Q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent($.didyoumeanClick)}logDidYouMeanClick(){return Q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent($.resultsSort,t)}logResultsSort(t){return Q(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent($.searchboxSubmit)}logSearchboxSubmit(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent($.searchboxClear)}logSearchboxClear(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent($.searchboxAsYouType)}logSearchboxAsYouType(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent($.breadcrumbFacet,t)}logBreadcrumbFacet(t){return Q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent($.breadcrumbResetAll)}logBreadcrumbResetAll(){return Q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent($.documentQuickview,t,r)}logDocumentQuickview(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent($.documentOpen,t,r)}logDocumentOpen(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent($.omniboxAnalytics,iw(t))}logOmniboxAnalytics(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent($.omniboxFromLink,iw(t))}logOmniboxFromLink(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent($.searchFromLink)}logSearchFromLink(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent($.triggerNotify,t)}logTriggerNotify(t){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent($.triggerExecute,t)}logTriggerExecute(t){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent($.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent($.undoTriggerQuery,t)}logUndoTriggerQuery(t){return Q(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent($.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent($.pagerResize,t)}logPagerResize(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent($.pagerNumber,t)}logPagerNumber(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent($.pagerNext,t)}logPagerNext(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent($.pagerPrevious,t)}logPagerPrevious(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent($.pagerScrolling)}logPagerScrolling(){return Q(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent($.facetClearAll,t)}logFacetClearAll(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent($.facetSearch,t)}logFacetSearch(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent($.facetSelect,t)}logFacetSelect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent($.facetDeselect,t)}logFacetDeselect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent($.facetExclude,t)}logFacetExclude(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent($.facetUnexclude,t)}logFacetUnexclude(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent($.facetSelectAll,t)}logFacetSelectAll(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent($.facetUpdateSort,t)}logFacetUpdateSort(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent($.facetShowMore,t)}logFacetShowMore(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent($.facetShowLess,t)}logFacetShowLess(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent($.queryError,t)}logQueryError(t){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorBack);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorBack)})}})}logQueryErrorBack(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorRetry);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorRetry)})}})}logQueryErrorRetry(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorClear);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorClear)})}})}logQueryErrorClear(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent($.likeSmartSnippet)}logLikeSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent($.dislikeSmartSnippet)}logDislikeSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent($.expandSmartSnippet)}logExpandSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent($.collapseSmartSnippet)}logCollapseSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent($.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent($.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return Q(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent($.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent($.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent($.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent($.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent($.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent($.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent($.copyToClipboard,t,r)}logCopyToClipboard(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent($.recentQueryClick)}logRecentQueryClick(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent($.clearRecentQueries)}logClearRecentQueries(){return Q(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent($.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent($.clearRecentResults)}logClearRecentResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent($.noResultsBack)}logNoResultsBack(){return Q(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent($.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent($.showLessFoldedResults)}logShowLessFoldedResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return Q(this,arguments,void 0,function*(n,o,a=ow[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 Q(this,arguments,void 0,function*(n,o,a=ow[n]){return(yield this.makeCustomEvent(n,o,a)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return Q(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),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 Q(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return Q(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:a})=>o.log({searchQueryUid:a})}})}makeClickEvent(t,r,n,o){return Q(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 Q(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return Q(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return Q(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof en?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($.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return Q(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent($.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return Q(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent($.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerOpenInlineLink(t){return this.makeCustomEvent($.generatedAnswerOpenInlineLink,t)}logGeneratedAnswerOpenInlineLink(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerOpenInlineLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent($.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFollowupOpenSource(t){return this.makeCustomEvent($.generatedAnswerFollowupOpenSource,t)}logGeneratedAnswerFollowupOpenSource(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFollowupOpenSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent($.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent($.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent($.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent($.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent($.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent($.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent($.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return Q(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent($.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return Q(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent($.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},lp=Object.assign({},eu),sw=Object.keys(lp).map(e=>lp[e]),zi=class extends jS{constructor({client:t,uuidGenerator:r=Aa}){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])=>sw.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(sw.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(lp.pageview,{newEventType:Ne.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(lp.event,{newEventType:Ne.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 lq(this.ticket)}};zi.Id="svc";var up;(function(e){e.click="click",e.flowStart="flowStart"})(up||(up={}));var yr;(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"})(yr||(yr={}));var dp;(function(e){e.quit="Quit",e.solved="Solved"})(dp||(dp={}));var pp=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!sp(t.disableBrowserPrivacySignals);this.coveoAnalyticsClient=o?new en(t):new Ki,this.svc=new zi({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Ki,this.svc=new zi({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new en(this.options),this.svc=new zi({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(yr.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(yr.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(yr.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(yr.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(yr.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(yr.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(yr.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(yr.caseCancelled,{reason:dp.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(yr.caseSolved,{reason:dp.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(yr.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",up.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",up.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return Q(this,void 0,void 0,function*(){var r,n;let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof en?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 Q(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)})}};d();c();u();l();d();c();u();l();var xo=()=>"default";var aM=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},Ca=class{constructor(t){me(this,"getState",t);me(this,"state");this.state=t()}getLanguage(){return aM(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=Ao),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||xo()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};d();c();u();l();var yw=e=>new en(e).getCurrentVisitorId(),nu=(e,t)=>typeof t=="function"?(...r)=>{let n=Pl(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,ou=(e,t)=>(...r)=>{let n=Pl(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};var au=class extends Ca{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},Sw=({logger:e,getState:t,analyticsClientMiddleware:r=(i,p)=>p,preprocessRequest:n,provider:o=new au(t),disableBrowserPrivacySignals:a})=>{let i=t(),p=i.configuration.accessToken,f=i.configuration.analytics.apiBaseUrl??gr(i.configuration.organizationId,i.configuration.environment,"analytics"),m=i.configuration.analytics.runtimeEnvironment,g=i.configuration.analytics.enabled,y=new pp({enableAnalytics:g,token:p,endpoint:f,runtimeEnvironment:m,disableBrowserPrivacySignals:a,preprocessRequest:nu(e,n),beforeSendHooks:[ou(e,r),(x,v)=>(e.info({...v,type:x,endpoint:f,token:p},"Analytics request"),v)]},o);return g||y.disable(),y};d();c();u();l();d();c();u();l();d();c();u();l();d();c();u();l();function Yi(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();u();l();d();c();u();l();function iM(e,t){return!!t&&t.facetId in e.facetSet}var Ur=(e,t)=>e.search?.response.facets.find(r=>r.facetId===t),fp=(e,t)=>e.facetSet[t]?.request,Ji=(e,t)=>{let r=Ur(e,t);return iM(e,r)?r:void 0},vw=(e,t)=>Ji(e,t)?.values.filter(r=>r.state==="selected")||[],Aw=(e,t)=>Ji(e,t)?.values.filter(r=>r.state!=="idle")||[],tn=e=>e.search.isLoading;d();c();u();l();function Cw(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 cr(e){let{activeValue:t,ancestryMap:r}=sM(e);return t?cM(t,r):[]}function sM(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 cM(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}function lM(e,t){return!!t&&t.facetId in e.categoryFacetSet}var JS=(e,t)=>{let r=Ur(e,t);if(lM(e,r))return r},XS=(e,t)=>e.categoryFacetSet[t]?.request,xw=(e,t)=>{let r=JS(e,t);return cr(r?.values??[])},ZS=(e,t)=>{let r=XS(e,t);return cr(r?.currentValues??[])};d();c();u();l();function Xi(){return{}}d();c();u();l();function bw(e,t){return{request:e,tabs:t}}function Zi(){return{}}d();c();u();l();function ww(e,t){return{request:e,tabs:t}}function es(){return{}}d();c();u();l();function Rw(e,t){return{request:e,hasBreadcrumbs:!0,tabs:t}}function ts(){return{}}var rs=(e,t)=>{let r=Tw(t,e),n=r?r.field:"",o=tv(n,e);return{facetId:e,facetField:n,facetTitle:o}};function ns(e,t){let{facetId:r,facetValue:n}=e,o=rs(r,t),a=Pw(t,r);return{...o,facetValue:a==="hierarchical"?Iw(t,r):n}}function lr(e){return{facetSet:e.facetSet??ts(),categoryFacetSet:e.categoryFacetSet??Xi(),dateFacetSet:e.dateFacetSet??Zi(),numericFacetSet:e.numericFacetSet??es(),automaticFacetSet:e.automaticFacetSet??Yi()}}var ev=e=>{let t=[];return pM(e).forEach((r,n)=>{let o=Pw(e,r.facetId),a=yM(r,n+1);if(dM(r)){if(!!!ZS(e,r.facetId).length)return;t.push({...a,...gM(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((i,p)=>{if(i.state==="idle")return;let f=Fw(i,p+1,o),m=uM(r)?Ew(i):mM(i);t.push({...a,...f,...m})})}),fM(e).forEach((r,n)=>{let o=hM(r,n+1);r.values.forEach((a,i)=>{if(a.state==="idle")return;let p=Fw(a,i+1,"specific"),f=Ew(a);t.push({...o,...p,...f})})}),t},uM=e=>e.type==="specific",dM=e=>e.type==="hierarchical",pM=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),fM=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Fw=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),mM=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),Ew=e=>({displayValue:e.value,value:e.value}),Iw=(e,t)=>ZS(e,t).map(n=>n.value).join(";"),gM=(e,t)=>{let n=Iw(e,t);return{value:n,valuePosition:1,displayValue:n}},hM=(e,t)=>({title:tv(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),yM=(e,t)=>({title:tv(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),tv=(e,t)=>`${e}_${t}`,Tw=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,Pw=(e,t)=>{let r=Tw(e,t);return r?r.type:"specific"};d();c();u();l();d();c();u();l();var rv=e=>e.configuration.search.locale,kw=e=>e.configuration.search.timezone,mp=e=>e.configuration.accessToken,gp=e=>e.configuration.organizationId,hp=e=>e.configuration.environment,yp=e=>e.configuration?.knowledge?.agentId,Ow=e=>e.configuration.knowledge.debugAgentSession;var Ue=e=>{if(SM(e)||nv(e))return e.generatedAnswer?.answerId;if(vM(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},SM=e=>"answer"in e&&"generatedAnswer"in e&&!pe(e.generatedAnswer?.answerConfigurationId),nv=e=>{let t=yp(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},vM=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",ov=e=>e.generatedAnswer?.fieldsToIncludeInCitations,bo=e=>e.followUpAnswers?.conversationId,AM=e=>e.generatedAnswer?.citations,CM=e=>e.followUpAnswers?.followUpAnswers,xM=tt(CM,e=>e?.flatMap(t=>t.citations)),bM=(e,t)=>t,os=tt(AM,xM,bM,(e,t,r)=>e?.find(n=>n.id===r)??t?.find(n=>n.id===r));d();c();u();l();var dt=()=>({q:"",enableQuerySyntax:!1});d();c();u();l();d();c();u();l();d();c();u();l();var iu=(r=>(r.Ascending="ascending",r.Descending="descending",r))(iu||{}),xa=(a=>(a.Relevancy="relevancy",a.QRE="qre",a.Date="date",a.Field="field",a.NoSort="nosort",a))(xa||{}),rn=e=>{if(Ni(e))return e.map(t=>rn(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""}},as=()=>({by:"relevancy"}),Sp=e=>({by:"date",order:e}),vp=(e,t)=>({by:"field",order:t,field:e}),Ap=()=>({by:"qre"}),Cp=()=>({by:"nosort"}),Nw=new X({values:{by:new Tl({enum:xa,required:!0}),order:new Tl({enum:iu}),field:new L}});function vr(){return rn(as())}d();c();u();l();d();c();u();l();d();c();u();l();d();c();u();l();function wM(){return typeof navigator<"u"}function _w(){try{return typeof localStorage<"u"}catch{return!1}}function Dw(){try{return typeof sessionStorage<"u"}catch{return!1}}function qw(){return wM()&&navigator.cookieEnabled}d();c();u();l();var is=class e{static set(t,r,n){var o,a,i,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?Mw(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],Mw(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function Mw(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}function jw(){return _w()?localStorage:qw()?new xp:Dw()?sessionStorage:new av}var xp=class e{getItem(t){return is.get(`${e.prefix}${t}`)}removeItem(t){is.erase(`${e.prefix}${t}`)}setItem(t,r,n){is.set(`${e.prefix}${t}`,r,n)}};xp.prefix="coveo_";var av=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var bp="__coveo.analytics.history",RM=20,FM=1e3*60,EM=75,wp=class{constructor(t){this.store=t||jw()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!=null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(bp);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(bp);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(bp,JSON.stringify(t.slice(0,RM)))}catch{}}clear(){try{this.store.removeItem(bp)}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,EM)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>FM:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var ba=class ba extends wp{static getInstance(t){return ba.instance||(ba.instance=new ba(t)),ba.instance}constructor(t){super(t)}};me(ba,"instance",null);var _t=ba;var su=class su extends Ca{constructor(){super(...arguments);me(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 ev(lr(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||su.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||ir().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||su.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??vr()}}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||dt().q}get responseTime(){return this.state.search?.duration||ir().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||ir().response.totalCountFiltered}};me(su,"fallbackPipelineName","default");var wo=su,Vw=({logger:e,getState:t,analyticsClientMiddleware:r=(i,p)=>p,preprocessRequest:n,provider:o,disableBrowserPrivacySignals:a})=>{let i=t(),p=i.configuration.accessToken,f=i.configuration.analytics.apiBaseUrl??gr(i.configuration.organizationId,i.configuration.environment,"analytics"),m=i.configuration.analytics.runtimeEnvironment,g=i.configuration.analytics.enabled,y=new cp({token:p,endpoint:f,runtimeEnvironment:m,disableBrowserPrivacySignals:a,preprocessRequest:nu(e,n),beforeSendHooks:[ou(e,r),(x,v)=>(e.info({...v,type:x,endpoint:f,token:p},"Analytics request"),v)]},o);return g||y.disable(),y},iv=()=>{let t=_t.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};d();c();u();l();function Rp(e){let t=Lw(e),r=[e,...t].filter(o=>o.parentResult).map(o=>o.parentResult);return ux([e,...t,...r],o=>o.uniqueId)}function Lw(e){return e.childResults?e.childResults.flatMap(t=>[t,...Lw(t)]):[]}d();c();u();l();var nn=()=>"";function Qw(e,t){return{...new wo(t).getBaseMetadata(),actionCause:e,type:e}}function IM(e){return Object.assign(e,{instantlyCallable:!0})}function TM(e,t){let r=a=>{let i=xe(e,a);return IM(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,disableBrowserPrivacySignals:y}=p;return yield(yield t({getState:i,analyticsClientMiddleware:f,preprocessRequest:m,logger:g,disableBrowserPrivacySignals:y})).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,disableBrowserPrivacySignals:m}){let{description:g,log:y}=yield t({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f,disableBrowserPrivacySignals:m});return{description:g,action:r(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(x,{getState:v,extra:C}){return yield y({state:v(),extra:C})});return function(_x22,_x23){return _ref12.apply(this,arguments)}}())}});return function prepare(_x21){return _ref11.apply(this,arguments)}}()}),n}var Bw=(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 OM(a)}return n},PM=e=>e.configuration.analytics.analyticsMode==="legacy",kM=e=>e.configuration.analytics.analyticsMode==="next",OM=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:a,providerClass:i})=>(r??(r=p=>new i(p)),TM(e,/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*({getState:p,analyticsClientMiddleware:f,preprocessRequest:m,logger:g,disableBrowserPrivacySignals:y}){let x=[],v={log:function(){var _ref14=_asyncToGenerator(function*({state:I}){for(let E of x)yield E(I)});return function log(_x25){return _ref14.apply(this,arguments)}}()},C=p(),b=a({getState:p,logger:g,analyticsClientMiddleware:f,preprocessRequest:m,disableBrowserPrivacySignals:y,provider:r(p)}),w=yield t(b,p());v.description=w?.description,x.push(/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(I){PM(I)&&(yield NM(w,r,I,g,b.coveoAnalyticsClient))});return function(_x26){return _ref15.apply(this,arguments)}}());let{emit:F}=Zl(C);return x.push(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(I){if(kM(I)&&o&&n){let E=n(I);yield UM(F,o,E)}});return function(_x27){return _ref16.apply(this,arguments)}}()),v});return function(_x24){return _ref13.apply(this,arguments)}}()));function NM(_x28,_x29,_x30,_x31,_x32){return _NM.apply(this,arguments)}function _NM(){_NM=_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 _NM.apply(this,arguments)}var _M=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)}}()}),J=Bw(e=>Vw({...e,provider:e.provider||new wo(e.getState)}),e=>e,wo),N5=Bw(Sw,_M("caseAssist"),au);var pt=(e,t)=>{let r=a=>a+(t.pagination?.firstResult??0),n=-1,o=t.search?.results;return n=Kw(e,o),n<0&&(n=LM(e,o)),n<0&&(n=0),DM(e,r(n),t)};var Gw=(e,t)=>({sourceName:Hw(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||nn()}),$w=(e,t)=>({sourceName:Hw(e),documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||nn()});function Hw(e){let t=e.source;return pe(t)?"unknown":t}var zw=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function DM(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:jM(e),...(Uw(e)?{documentCategory:Uw(e)}:{}),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:VM(e),queryPipeline:r.pipeline||nn()}}function Uw(e){return e.raw?.objecttype||void 0}var Ke=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||""}),Ww={urihash:new L,sourcetype:new L,permanentid:new L},Fp={uniqueId:z,raw:new X({values:Ww}),title:z,uri:z,clickUri:z,rankingModifier:new L({required:!1,emptyAllowed:!0})};function qM(e){return Object.assign({},...Object.keys(Ww).map(t=>({[t]:e[t]})))}function MM(e){return Object.assign({},...Object.keys(Fp).map(t=>({[t]:e[t]})),{raw:qM(e.raw)})}function jM(e){let t=e.raw.author;return pe(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function VM(e){let t=e.raw.source;return pe(t)?"unknown":t}var Zt=e=>new ve(Fp).validate(MM(e));function LM(e,t){for(let[r,n]of t.entries()){let o=Rp(n);if(Kw(e,o)!==-1)return r}return-1}function Kw(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function UM(_x34,_x35,_x36){return _UM.apply(this,arguments)}function _UM(){_UM=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _UM.apply(this,arguments)}d();c();u();l();var sv=e=>O(e,{evt:z,type:st}),Yw=e=>J("analytics/generic/search",t=>{sv(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),Jw=e=>J("analytics/generic/click",(t,r)=>(Zt(e.result),sv(e),t.makeClickEvent(e.evt,pt(e.result,r),Ke(e.result),e.meta))),Xw=e=>J("analytics/generic/custom",t=>(sv(e),t.makeCustomEventWithType(e.evt,e.type,e.meta))),Ep=()=>J("analytics/interface/load",e=>e.makeInterfaceLoad()),Ro=()=>J("analytics/interface/change",(e,t)=>e.makeInterfaceChange({interfaceChangeTo:t.configuration.analytics.originLevel2})),Ip=()=>J("analytics/interface/searchFromLink",e=>e.makeSearchFromLink()),Tp=e=>J("analytics/interface/omniboxFromLink",t=>t.makeOmniboxFromLink(e)),Zw=()=>({actionCause:"interfaceLoad"}),ss=()=>({actionCause:"interfaceChange"}),eR=()=>({actionCause:"searchFromLink"}),tR=()=>({actionCause:"omniboxFromLink"});d();c();u();l();var cv=()=>st,rR=()=>z,on=P("configuration/updateBasicConfiguration",e=>O(e,{accessToken:st,environment:new L({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:st})),Ar=P("configuration/updateSearchConfiguration",e=>O(e,{proxyBaseUrl:new L({required:!1,url:!0}),pipeline:new L({required:!1,emptyAllowed:!0}),searchHub:st,timezone:st,locale:st,authenticationProviders:new ie({required:!1,each:z})})),QM={enabled:new de({default:!0}),originContext:cv(),originLevel2:cv(),originLevel3:cv(),proxyBaseUrl:new L({required:!1,url:!0}),runtimeEnvironment:new Be,anonymous:new de({default:!1}),deviceId:st,userDisplayName:st,documentLocation:st,trackingId:Ux,analyticsMode:new L({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new X({options:{required:!1},values:Kb.reduce((e,t)=>(e[t]=Lx,e),{})})},Fo=P("configuration/updateAnalyticsConfiguration",e=>O(e,QM)),cs=P("configuration/analytics/disable"),ls=P("configuration/analytics/enable"),Pp=P("configuration/analytics/originlevel2",e=>O(e,{originLevel2:rR()})),kp=P("configuration/analytics/originlevel3",e=>O(e,{originLevel3:rR()})),Op=P("knowledge/setAgentId",e=>O(e,new L({required:!0})));d();c();u();l();d();c();u();l();d();c();u();l();var Np={q:new L,enableQuerySyntax:new de,aq:new L,cq:new L,firstResult:new re({min:0}),numberOfResults:new re({min:0}),sortCriteria:new L,f:new X,fExcluded:new X,cf:new X,nf:new X,mnf:new X,df:new X,debug:new de,sf:new X,tab:new L,af:new X};var Me=P("searchParameters/restore",e=>O(e,Np)),us=P("searchParameters/restoreTab",e=>O(e,z));d();c();u();l();var Eo=P("debug/enable"),ds=P("debug/disable");d();c();u();l();var Io=()=>!1;var ps=ae(Io(),e=>{e.addCase(Eo,()=>!0).addCase(ds,()=>!1).addCase(Me,(t,r)=>r.payload.debug??t)});d();c();u();l();var _p=e=>{if(e==="yes")return!0;if(e==="no")return!1},BM=()=>J("analytics/generatedAnswer/retry",e=>e.makeRetryGeneratedAnswer());function Dp(e,t){return J({prefix:"analytics/generatedAnswer/openAnswerSource",__legacy__getBuilder:(r,n)=>{let o=t??Ue(n),a=os(n,e);if(!o||!a)return null;let i=bo(n);return r.makeGeneratedAnswerCitationClick(Gw(a,n),{generativeQuestionAnsweringId:o,citationId:a.id,documentId:zw(a),...(i&&{conversationId:i})})},analyticsType:"Rga.CitationClick",analyticsPayloadBuilder:r=>{let n=os(r,e);return{answerId:t??Ue(r)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:n?.permanentid??"",title:n?.title,url:n?.clickUri}}}})}function GM(e,t,r){return J({prefix:"analytics/generatedAnswer/hoverCitation",__legacy__getBuilder:(n,o)=>{let a=r??Ue(o),i=os(o,e);if(!a||!i)return null;let p=bo(o);return n.makeGeneratedAnswerSourceHover({generativeQuestionAnsweringId:a,permanentId:i.permanentid,citationId:i.id,citationHoverTimeMs:t,...(p&&{conversationId:p})})},analyticsType:"Rga.CitationHover",analyticsPayloadBuilder:n=>{let o=os(n,e);return{answerId:r??Ue(n)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:o?.permanentid??"",title:o?.title,url:o?.clickUri},citationHoverTimeInMs:t}}})}function $M(e,t){return J({prefix:"analytics/generatedAnswer/openInlineLink",__legacy__getBuilder:r=>r.makeGeneratedAnswerOpenInlineLink({generativeQuestionAnsweringId:t,...e})})}function HM(e){return J({prefix:"analytics/generatedAnswer/like",__legacy__getBuilder:(t,r)=>{let n=e??Ue(r);if(!n)return null;let o=bo(r);return t.makeLikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",action:"like"})})}function zM(e){return J({prefix:"analytics/generatedAnswer/dislike",__legacy__getBuilder:(t,r)=>{let n=e??Ue(r);if(!n)return null;let o=bo(r);return t.makeDislikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",action:"dislike"})})}var WM=e=>J({prefix:"analytics/generatedAnswer/sendFeedback",__legacy__getBuilder:(t,r)=>{let n=Ue(r);return n?t.makeGeneratedAnswerFeedbackSubmitV2({generativeQuestionAnsweringId:n,...e}):null},analyticsType:"Rga.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=Ue(t),{helpful:n,readable:o,documented:a,hallucinationFree:i,correctTopic:p,documentUrl:f,details:m}=e;return{answerId:r??"",helpful:n,details:{readable:_p(o),documented:_p(a),correctTopic:_p(p),hallucinationFree:_p(i)},additionalNotes:m,correctAnswerUrl:f}}}),cu=(e,t,r)=>J({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(n,o)=>{let a=t??Ue(o);if(!a)return null;let i=bo(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})}),To=e=>J({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",responseId:t.search?.searchResponseId||t.search?.response.searchUid||""})}),KM=()=>J({prefix:"analytics/generatedAnswer/show",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerShowAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"show"})}),YM=()=>J({prefix:"analytics/generatedAnswer/hide",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerHideAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"hide"})}),JM=()=>J({prefix:"analytics/generatedAnswer/expand",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerExpand({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"expand"})}),XM=()=>J({prefix:"analytics/generatedAnswer/collapse",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerCollapse({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"collapse"})});function ZM(e){return J({prefix:"analytics/generatedAnswer/copy",__legacy__getBuilder:(t,r)=>{let n=e??Ue(r);if(!n)return null;let o=bo(r);return t.makeGeneratedAnswerCopyToClipboard({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",action:"copyToClipboard"})})}function lv(e,t){return J({prefix:"analytics/generatedAnswer/openFollowUpAnswerSource",__legacy__getBuilder:(r,n)=>{let o=os(n,e);if(!o)return null;let a=bo(n);return a?r.makeGeneratedAnswerFollowupOpenSource({...$w(o,n),generativeQuestionAnsweringId:t,citationId:o.id,permanentId:o.permanentid,conversationId:a}):null}})}var Cr={logCopyGeneratedAnswer:ZM,logGeneratedAnswerHideAnswers:YM,logGeneratedAnswerShowAnswers:KM,logGeneratedAnswerStreamEnd:cu,logGeneratedAnswerFeedback:WM,logDislikeGeneratedAnswer:zM,logLikeGeneratedAnswer:HM,logGeneratedAnswerOpenInlineLink:$M,logHoverCitation:GM,logOpenGeneratedAnswerSource:Dp,logOpenGeneratedAnswerFollowUpSource:lv,logRetryGeneratedAnswer:BM,logGeneratedAnswerExpand:JM,logGeneratedAnswerCollapse:XM};d();c();u();l();d();c();u();l();var uv=P("history/undo"),dv=P("history/redo"),ur=P("history/snapshot"),lu=xe("history/back",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,{dispatch:t}){t(uv()),yield t(qe())});return function(_x37,_x38){return _ref18.apply(this,arguments)}}()),qp=xe("history/forward",/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,{dispatch:t}){t(dv()),yield t(qe())});return function(_x39,_x40){return _ref19.apply(this,arguments)}}()),qe=xe("history/change",/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x41,_x42){return _ref20.apply(this,arguments)}}());d();c();u();l();var fs=P("pipeline/set",e=>O(e,new L({required:!0,emptyAllowed:!0})));var ms=ae(nn(),e=>{e.addCase(fs,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Ar,(t,r)=>r.payload.pipeline||t)});d();c();u();l();d();c();u();l();var ft=P("breadcrumb/deselectAll"),gs=P("breadcrumb/deselectAllNonBreadcrumbs");d();c();u();l();var an=P("facet/updateFacetAutoSelection",e=>O(e,{allow:new de({required:!0})}));d();c();u();l();d();c();u();l();var uu=class extends wo{constructor(r){super(r);me(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??dt().q}get responseTime(){return this.activeInstantResultCache?.duration??ir().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??ir().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var nR=e=>J({prefix:"analytics/instantResult/open",__legacy__getBuilder:(t,r)=>(Zt(e),t.makeDocumentOpen(pt(e,r),Ke(e))),__legacy__provider:t=>new uu(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=pt(e,t),n=Ke(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}}),oR=()=>J("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new uu(e)),aR=()=>({actionCause:"searchboxAsYouType"});d();c();u();l();var pv={id:z},ej={...pv,q:Ge},hs=P("instantResults/register",e=>O(e,pv)),sn=P("instantResults/updateQuery",e=>O(e,ej)),ys=P("instantResults/clearExpired",e=>O(e,pv));d();c();u();l();var Mp=new re({required:!0,min:0}),Ss=P("pagination/registerNumberOfResults",e=>O(e,Mp)),vs=P("pagination/updateNumberOfResults",e=>O(e,Mp)),As=P("pagination/registerPage",e=>O(e,Mp)),cn=P("pagination/updatePage",e=>O(e,Mp)),Cs=P("pagination/nextPage"),xs=P("pagination/previousPage");d();c();u();l();var Lt=P("query/updateQuery",e=>O(e,{q:new L,enableQuerySyntax:new de}));d();c();u();l();d();c();u();l();var Qr=(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:$i(e)}});var bs=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??vt(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&&Qr(e.configuration.analytics,t,r)),...(e.excerptLength&&!pe(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();u();l();d();c();u();l();d();c();u();l();var ws=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield yw(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}),...(iv()&&{pageId:iv()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:$i(e)})}}});return function ws(_x43,_x44){return _ref21.apply(this,arguments)}}();var Po=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??vt(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:_t.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 ws(e.configuration.analytics,t))),...(e.excerptLength&&!pe(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Po(_x45,_x46){return _ref22.apply(this,arguments)}}();d();c();u();l();d();c();u();l();var Br=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var fv=()=>J("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),ko=e=>J("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||dt().q,aq:r.advancedSearchQueries?.aq||Br().aq,cq:r.advancedSearchQueries?.cq||Br().cq,dq:r.advancedSearchQueries?.dq||Br().dq,errorType:e.type,errorMessage:e.message}));d();c();u();l();d();c();u();l();var pu=Vr(jp(),1),uR=Vr(iR(),1);d();c();u();l();var Vp=Vr(jp(),1),cR=Vr(sR(),1);Vp.default.extend(cR.default);var Rs="YYYY/MM/DD@HH:mm:ss",tj="1401-01-01";function wa(e,t){let r=(0,Vp.default)(e,t);return!r.isValid()&&!t?(0,Vp.default)(e,Rs):r}function du(e){return e.format(Rs)}function lR(e){return du(wa(e))===e}function Lp(e,t){let r=wa(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}Av(r)}function Av(e){if(e.isBefore(tj))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}pu.default.extend(uR.default);var dR=["past","now","next"],pR=["minute","hour","day","week","month","quarter","year"],rj=e=>{let t=e==="now";return{amount:new re({required:!t,min:1}),unit:new L({required:!t,constrainTo:pR}),period:new L({required:!0,constrainTo:dR})}};function Oo(e){if(typeof e=="string"&&!ln(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?Cv(e):e;new ve(rj(t.period)).validate(t);let r=mR(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);Av(r)}function fR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function mR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,pu.default)().subtract(r,n);case"next":return(0,pu.default)().add(r,n);case"now":return(0,pu.default)()}}function fu(e){return du(mR(Cv(e)))}function gR(e){return e.toLocaleLowerCase().split("-")}function ln(e){let[t,r,n]=gR(e);if(t==="now")return!0;if(!dR.includes(t)||!pR.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function hR(e){return!!e&&typeof e=="object"&&"period"in e}function Cv(e){let[t,r,n]=gR(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}function yR(e){return Oo(e),Cv(e)}d();c();u();l();function SR(e){return e.type==="dateRange"}function vR(e){return`start${e}`}function AR(e){return`end${e}`}var xv=()=>({dateFacetValueMap:{}});function nj(e,t,r){let n=e.start,o=e.end;return ln(n)&&(n=fu(n),r.dateFacetValueMap[t][vR(n)]=e.start),ln(o)&&(o=fu(o),r.dateFacetValueMap[t][AR(o)]=e.end),{...e,start:n,end:o}}function bv(e,t){if(SR(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>nj(o,r,t))}}return e}function No(e){let t=xv();return{request:{...e,facets:e.facets?.map(n=>bv(n,t))},mappings:t}}function oj(e,t,r){return{...e,start:r.dateFacetValueMap[t][vR(e.start)]||e.start,end:r.dateFacetValueMap[t][AR(e.end)]||e.end}}function aj(e,t){return e.facetId in t.dateFacetValueMap}function ij(e,t){return aj(e,t)?{...e,values:e.values.map(r=>oj(r,e.facetId,t))}:e}function Up(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>ij(n,t))}}:e}d();c();u();l();d();c();u();l();var Fs=P("didYouMean/enable"),Qp=P("didYouMean/disable"),Es=P("didYouMean/automaticCorrections/disable"),Bp=P("didYouMean/automaticCorrections/enable"),xr=P("didYouMean/correction",e=>O(e,z)),Ra=P("didYouMean/automaticCorrections/mode",e=>O(e,new L({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();u();l();var Gp=()=>J("analytics/didyoumean/click",e=>e.makeDidYouMeanClick()),wv=()=>J("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic()),CR=()=>({actionCause:"didYouMeanClick"}),xR=()=>({actionCause:"didYouMeanAutomatic"});d();c();u();l();d();c();u();l();function $p(){return{contextValues:{}}}d();c();u();l();function Hp(){return{contextValues:{}}}d();c();u();l();function Rv(){return{enabled:!0,tabs:{}}}function zp(){return{freezeFacetOrder:!1,facets:{}}}d();c();u();l();function Wp(){return[]}d();c();u();l();function br(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();u();l();function Kp(){return{}}d();c();u();l();function Yp(){return{}}d();c();u();l();function Jp(){return{}}function bR(){return Gr({})}function Gr(e){return{context:e.context||$p(),dictionaryFieldContext:e.dictionaryFieldContext||Hp(),facetSet:e.facetSet||ts(),numericFacetSet:e.numericFacetSet||es(),dateFacetSet:e.dateFacetSet||Zi(),categoryFacetSet:e.categoryFacetSet||Xi(),automaticFacetSet:e.automaticFacetSet??Yi(),pagination:e.pagination||br(),query:e.query||dt(),tabSet:e.tabSet||Jp(),advancedSearchQueries:e.advancedSearchQueries||Br(),staticFilterSet:e.staticFilterSet||Yp(),querySet:e.querySet||Kp(),sortCriteria:e.sortCriteria||vr(),pipeline:e.pipeline||nn(),searchHub:e.searchHub||xo(),facetOptions:e.facetOptions||zp(),facetOrder:e.facetOrder??Wp(),debug:e.debug??Io()}}d();c();u();l();var sj=new X({values:{undoneQuery:Ge},options:{required:!0}}),Xp=()=>J("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null),Zp=e=>J("analytics/trigger/query/undo",t=>(O(e,sj),t.makeUndoTriggerQuery(e))),ef=()=>J("analytics/trigger/notify",(e,t)=>t.triggers?.notifications.length?e.makeTriggerNotify({notifications:t.triggers.notifications}):null),tf=()=>J("analytics/trigger/redirect",(e,t)=>t.triggers?.redirectTo?e.makeTriggerRedirect({redirectedTo:t.triggers.redirectTo}):null),rf=()=>J("analytics/trigger/execute",(e,t)=>t.triggers?.executions.length?e.makeTriggerExecute({executions:t.triggers.executions}):null);d();c();u();l();var _o=P("trigger/query/ignore",e=>O(e,new L({emptyAllowed:!0,required:!0}))),Is=P("trigger/query/modification",e=>O(e,new X({values:{originalQuery:st,modification:st}})));d();c();u();l();d();c();u();l();d();c();u();l();function Do(e){return Object.values(e).map(t=>t.request)}function mu(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 wR(e){return Do(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var Fv={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function cj(e){return Do(e).map(t=>{let r=Fv[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function lj(e){return[...cj(e.facetSet??{}),...wR(e.numericFacetSet??{}),...wR(e.dateFacetSet??{}),...Do(e.categoryFacetSet??{})]}function uj(e){return lj(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function nf(e){return mu(uj(e),e.facetOrder??[])}d();c();u();l();var qo=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t){let r=fj(e),n=nf(e),o=dj(e),a=yield Po(e,t),i=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return No({...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 qo(_x47,_x48){return _ref23.apply(this,arguments)}}();function dj(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(pj).filter(r=>r.currentValues.length>0):void 0}function pj(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function fj(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=mj(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}function mj(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 Mo=class{constructor(t,r=n=>{this.dispatch(Lt({q:n}))}){me(this,"config",t);me(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x49,_x50){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=Up(yield _this10.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this10.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return At(t.response)?(this.dispatch(ko(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery: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=!pe(f)&&!pe(f.correctedQuery);if(!m&&!g)return null;let x=m?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(ur(Gr(_this12.getState()))),x})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this13.automaticallyRetryQueryWithCorrection(o);return At(a.response)?(_this13.dispatch(ko(a.response.error)),_this13.rejectWithValue(a.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(ur(Gr(_this13.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:wv()})})()}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:wv()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(_o("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let a=_this14.getCurrentQuery(),i=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return At(i.response)?(_this14.dispatch(ko(i.response.error)),_this14.rejectWithValue(i.response.error)):(_this14.dispatch(ur(Gr(_this14.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a,analyticsAction:Xp()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??dt().enableQuerySyntax},search:{...ir(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(ur(Gr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return Fd(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield qo(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(xr(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(Is({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield qo(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var RR=xe("search/executeSearch",/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=t.getState();return yield of(r,t,e)});return function(_x51,_x52){return _ref24.apply(this,arguments)}}()),FR=xe("search/fetchPage",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Iv(r,t,e)});return function(_x53,_x54){return _ref25.apply(this,arguments)}}()),ER=xe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Tv(t,r)});return function(_x55,_x56){return _ref26.apply(this,arguments)}}()),IR=xe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Sj(t,e,r)});return function(_x57,_x58){return _ref27.apply(this,arguments)}}()),TR=xe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){return Ev(e,t)});return function(_x59,_x60){return _ref28.apply(this,arguments)}}()),gj=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=yield qo(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function gj(_x61,_x62){return _ref29.apply(this,arguments)}}(),hj=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t,r){let n=yield Po(e);return No({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function hj(_x63,_x64,_x65){return _ref30.apply(this,arguments)}}(),yj=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=yield qo(e,t);return r.request.numberOfResults=0,r});return function yj(_x66,_x67){return _ref31.apply(this,arguments)}}(),PR=e=>{e.configuration.analytics.enabled&&_t.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Ev(_x68,_x69){return _Ev.apply(this,arguments)}function _Ev(){_Ev=_asyncToGenerator(function*(e,t){O(e,{id:z,q:z,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),a=new Mo({...t,analyticsAction:oR()},m=>{t.dispatch(sn({q:m,id:e.id}))}),i=yield hj(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 _Ev.apply(this,arguments)}function Iv(_x70,_x71,_x72){return _Iv.apply(this,arguments)}function _Iv(){_Iv=_asyncToGenerator(function*(e,t,r){PR(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 Mo({...t,analyticsAction:r}),f=yield qo(e,i),m=yield p.fetchFromAPI(f,{origin:"mainSearch"});return yield p.process(m)});return _Iv.apply(this,arguments)}function Tv(_x73,_x74){return _Tv.apply(this,arguments)}function _Tv(){_Tv=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:a}=yield fv().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),i=new Mo({...e,analyticsAction:fv()}),p=yield gj(t,a),f=yield i.fetchFromAPI(p,{origin:"mainSearch"});return yield i.process(f)});return _Tv.apply(this,arguments)}function Sj(_x75,_x76,_x77){return _Sj.apply(this,arguments)}function _Sj(){_Sj=_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 Mo({...e,analyticsAction:t}),f=yield yj(r,i),m=yield p.fetchFromAPI(f,{origin:"facetValues"});return yield p.process(m)});return _Sj.apply(this,arguments)}function of(_x78,_x79,_x80){return _of.apply(this,arguments)}function _of(){_of=_asyncToGenerator(function*(e,t,r){PR(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 qo(e,i),f=new Mo({...t,analyticsAction:r}),m=yield f.fetchFromAPI(p,{origin:"mainSearch"});return yield f.process(m)});return _of.apply(this,arguments)}d();c();u();l();d();c();u();l();d();c();u();l();var kR=tt(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 wr=/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t,r){let n=kv(e),o=vj(e),a=Aj(e),i=e.configuration.analytics.analyticsMode==="legacy"?yield Po(e,r):bs(e,t,r);return No({...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:Pv(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 wr(_x81,_x82,_x83){return _ref32.apply(this,arguments)}}();function Pv(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function vj(e){return mu(xj(e),e.facetOrder??[])}function Aj(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(Cj).filter(r=>r.currentValues.length>0):void 0}function Cj(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function xj(e){return bj(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function bj(e){return[...wj(e.facetSet??{}),...OR(e.numericFacetSet??{}),...OR(e.dateFacetSet??{}),...Do(e.categoryFacetSet??{})]}function wj(e){return Do(e).map(t=>{let r=Fv[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function OR(e){return Do(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 kv(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=kR(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}var jo=class{constructor(t,r=n=>{this.dispatch(Lt({q:n}))}){me(this,"config",t);me(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x84,_x85){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=Up(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 At(t.response)?(this.dispatch(ko(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)return null;if(!a)return!pe(f)&&!pe(f.correctedQuery)?_this19.processModernDidYouMeanAutoCorrection(t):null;let m=i.length===0&&p&&p.length!==0,g=!pe(f)&&!pe(f.correctedQuery);if(!m&&!g)return null;let x=m?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(ur(Gr(_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 At(a.response)?(_this20.dispatch(ko(a.response.error)),_this20.rejectWithValue(a.response.error)):(_this20.dispatch(ur(Gr(_this20.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 _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(_o("")),null;let a=_this21.getCurrentQuery(),i=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return At(i.response)?(_this21.dispatch(ko(i.response.error)),_this21.rejectWithValue(i.response.error)):(_this21.dispatch(ur(Gr(_this21.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a})})()}processSuccessResponse(t){return this.dispatch(ur(Gr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return Fd(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=xR(),o=yield _this22.fetchFromAPI(yield wr(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(xr(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Is({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield wr(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var Ts=xe("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;O(e,{q:new L,enableQuerySyntax:new de,clearFilters:new de}),e.clearFilters&&(r(ft()),r(gs())),r(an({allow:!0})),r(Lt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(cn(1))}),NR=P("search/updateSearchAction"),W=xe("search/executeSearch",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return of(r,t,e.legacy);_R(r);let n=e.next?DR(e.next):void 0,o=yield wr(r,t.extra.navigatorContext,n),a=new jo({...t,analyticsAction:n??{}}),i=yield a.fetchFromAPI(o,{origin:"mainSearch"});return yield a.process(i)});return function(_x86,_x87){return _ref33.apply(this,arguments)}}()),Ut=xe("search/fetchPage",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(_R(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return Iv(r,t,e.legacy);let n=new jo({...t,analyticsAction:e.next}),o=yield wr(r,t.extra.navigatorContext,e.next),a=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(a)});return function(_x88,_x89){return _ref34.apply(this,arguments)}}()),Rr=xe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Tv(t,r);let n=Qw("browseResults",t.getState),o=new jo({...t,analyticsAction:n}),a=yield Rj(r,t.extra.navigatorContext,n),i=yield o.fetchFromAPI(a,{origin:"mainSearch"});return yield o.process(i)});return function(_x90,_x91){return _ref35.apply(this,arguments)}}()),Fr=xe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return of(r,t,e.legacy);let n=new jo({...t,analyticsAction:{}}),o=yield Ej(r,t.extra.navigatorContext),a=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(a)});return function(_x92,_x93){return _ref36.apply(this,arguments)}}()),Ps=xe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ev(e,t);O(e,{id:z,q:z,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re});let{q:n,maxResultsPerQuery:o}=e,a=DR(aR()),i=yield Fj(r,t.extra.navigatorContext,n,o,a),p=new jo({...t,analyticsAction:a},g=>{t.dispatch(sn({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(_x94,_x95){return _ref37.apply(this,arguments)}}()),Rj=/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t,r){let n=yield wr(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function Rj(_x96,_x97,_x98){return _ref38.apply(this,arguments)}}(),Fj=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t,r,n,o){let a=bs(e,t,o);return No({...a,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function Fj(_x99,_x100,_x101,_x102,_x103){return _ref39.apply(this,arguments)}}(),Ej=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t,r){let n=yield wr(e,t,r);return n.request.numberOfResults=0,n});return function Ej(_x104,_x105,_x106){return _ref40.apply(this,arguments)}}(),_R=e=>{e.configuration.analytics.enabled&&_t.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},DR=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();u();l();d();c();u();l();var Vo=(e,t)=>{let r=e;return pe(r[t])?pe(e.raw[t])?null:e.raw[t]:r[t]},Ij=e=>t=>e.every(r=>!pe(Vo(t,r))),Tj=e=>t=>e.every(r=>pe(Vo(t,r))),Pj=(e,t)=>r=>{let n=qR(e,r);return t.some(o=>n.some(a=>`${a}`.toLowerCase()===o.toLowerCase()))},kj=(e,t)=>r=>{let n=qR(e,r);return t.every(o=>n.every(a=>`${a}`.toLowerCase()!==o.toLowerCase()))},qR=(e,t)=>{let r=Vo(t,e);return gd(r)?r:[r]},MR={getResultProperty:Vo,fieldsMustBeDefined:Ij,fieldsMustNotBeDefined:Tj,fieldMustMatch:Pj,fieldMustNotMatch:kj};function gu(e){return e.search.response.searchUid!==""}function jR(e,t,r){return e.search.results.find(n=>Vo(n,t)===r)}var Ov=tt(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();u();l();d();c();u();l();var ks=P("app/setError");function Nv(e,t){let r=t.payload??null;r&&(e.response=ir().response,e.results=[],e.questionAnswer=qi()),e.error=r,e.isLoading=!1}function _v(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function Oj(e,t){_v(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 VR(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function Nj(e,t){e.isLoading=!0,e.searchAction={actionCause:"browseResults"},e.requestId=t.meta.requestId}var he=ae(ir(),e=>{e.addCase(W.rejected,(t,r)=>Nv(t,r)),e.addCase(Rr.rejected,(t,r)=>Nv(t,r)),e.addCase(Ut.rejected,(t,r)=>Nv(t,r)),e.addCase(W.fulfilled,(t,r)=>{Oj(t,r)}),e.addCase(Rr.fulfilled,(t,r)=>{_v(t,r),t.results=[...t.results,...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(Ut.fulfilled,(t,r)=>{_v(t,r),t.results=[...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(Fr.fulfilled,(t,r)=>{t.response.facets=r.payload.response.facets,t.response.searchUid=r.payload.response.searchUid}),e.addCase(W.pending,VR),e.addCase(Rr.pending,Nj),e.addCase(Ut.pending,VR),e.addCase(NR,(t,r)=>{t.searchAction=r.payload}),e.addCase(ks,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();u();l();d();c();u();l();var Os=P("searchHub/set",e=>O(e,new L({required:!0,emptyAllowed:!0})));var Ns=ae(xo(),e=>{e.addCase(Os,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Ar,(t,r)=>r.payload.searchHub||t)});d();c();u();l();d();c();u();l();d();c();u();l();d();c();u();l();var LR=class extends Error{constructor(t){super(t[0].message);me(this,"issues");this.name="SchemaError",this.issues=t}};var Xn="uninitialized",qv="pending",yu="fulfilled",Su="rejected";function UR(e){return{status:e,isUninitialized:e===Xn,isLoading:e===qv,isSuccess:e===yu,isError:e===Su}}var QR=Xr;function rF(e,t){if(e===t||!(QR(e)&&QR(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]=rF(e[i],t[i]),o&&(o=e[i]===a[i]);return o?e:a}function Mv(e,t,r){return e.reduce((n,o,a)=>(t(o,a)&&n.push(r(o,a)),n),[]).flat()}function _j(e){return new RegExp("(^|:)//").test(e)}function Dj(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Uv(e){return e!=null}function BR(e){return[...(e?.values()??[])].filter(Uv)}function qj(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var Mj=e=>e.replace(/\/$/,""),jj=e=>e.replace(/^\//,"");function Vj(e,t){if(!e)return t;if(!t)return e;if(_j(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=Mj(e),t=jj(t),`${e}${r}${t}`}function cf(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var jv=()=>new Map,Lj=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},Uj=(...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},GR=(...e)=>S(...e),Qj=e=>e.status>=200&&e.status<=299,Bj=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function $R(e){if(!Xr(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}var Gj=e=>typeof e=="object"&&(Xr(e)||Array.isArray(e)||typeof e.toJSON=="function");function nF({baseUrl:e,prepareHeaders:t=y=>y,fetchFn:r=GR,paramsSerializer:n,isJsonContentType:o=Bj,jsonContentType:a="application/json",jsonReplacer:i,timeout:p,responseHandler:f,validateStatus:m,...g}={}){return typeof S>"u"&&r===GR&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(x,v,C){let{getState:b,extra:w,endpoint:F,forced:I,type:E}=v,k,{url:T,headers:D=new A(g.headers),params:G=void 0,responseHandler:U=f??"json",validateStatus:j=m??Qj,timeout:B=p,...V}=typeof x=="string"?{url:x}:x,N={...g,signal:B?Uj(v.signal,Lj(B)):v.signal,...V};D=new A($R(D)),N.headers=(yield t(D,{getState:b,arg:x,extra:w,endpoint:F,forced:I,type:E,extraOptions:C}))||D;let _=Gj(N.body);if(N.body!=null&&!_&&typeof N.body!="string"&&N.headers.delete("content-type"),!N.headers.has("content-type")&&_&&N.headers.set("content-type",a),_&&o(N.headers)&&(N.body=JSON.stringify(N.body,i)),N.headers.has("accept")||(U==="json"?N.headers.set("accept","application/json"):U==="text"&&N.headers.set("accept","text/plain, text/html, */*")),G){let le=~T.indexOf("?")?"&":"?",Se=n?n(G):new URLSearchParams($R(G));T+=le+Se}T=Vj(e,T);let q=new Request(T,N);k={request:new Request(T,N)};let H;try{H=yield r(q)}catch(le){return{error:{status:(le instanceof Error||typeof DOMException<"u"&&le instanceof DOMException)&&le.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(le)},meta:k}}let ne=H.clone();k.response=ne;let te,Z="";try{let le;if(yield Promise.all([y(H,U).then(Se=>te=Se,Se=>le=Se),ne.text().then(Se=>Z=Se,()=>{})]),le)throw le}catch(le){return{error:{status:"PARSING_ERROR",originalStatus:H.status,data:Z,error:String(le)},meta:k}}return j(H,te)?{data:te,meta:k}:{error:{status:H.status,data:te},meta:k}});return function(_x107,_x108,_x109){return _ref41.apply(this,arguments)}}());function y(_x110,_x111){return _y2.apply(this,arguments)}function _y2(){_y2=_asyncToGenerator(function*(x,v){if(typeof v=="function")return v(x);if(v==="content-type"&&(v=o(x.headers)?"json":"text"),v==="json"){let C=yield x.text();return C.length?JSON.parse(C):null}return x.text()});return _y2.apply(this,arguments)}}var _s=class{constructor(e,t=void 0){me(this,"value");me(this,"meta");this.value=e,this.meta=t}};function $j(){return _$j.apply(this,arguments)}function _$j(){_$j=_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 _$j.apply(this,arguments)}function oF(e,t){throw Object.assign(new _s({error:e,meta:t}),{throwImmediately:!0})}function Dv(e){e.aborted&&oF({status:"CUSTOM_ERROR",error:"Aborted"})}var HR={},Hj=(e,t)=>(/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(r,n,o){let a=[5,(t||HR).maxRetries,(o||HR).maxRetries].filter(g=>g!==void 0),[i]=a.slice(-1),f={maxRetries:i,backoff:$j,retryCondition:(g,y,{attempt:x})=>x<=i,...t,...o},m=0;for(;;){Dv(n.signal);try{let g=yield e(r,n,o);if(g.error)throw new _s(g);return g}catch(g){if(m++,g.throwImmediately){if(g instanceof _s)return g.value;throw g}if(g instanceof _s){if(!f.retryCondition(g.value.error,r,{attempt:m,baseQueryApi:n,extraOptions:o}))return g.value}else if(m>f.maxRetries)return{error:g};Dv(n.signal);try{yield f.backoff(m,f.maxRetries,n.signal)}catch(y){throw Dv(n.signal),y}}}});return function(_x112,_x113,_x114){return _ref42.apply(this,arguments)}}()),aF=Object.assign(Hj,{fail:oF}),uf="__rtkq/",zj="online",Wj="offline";var iF="focused";var Qv=P(`${uf}${iF}`),sF=P(`${uf}un${iF}`),Bv=P(`${uf}${zj}`),cF=P(`${uf}${Wj}`);var Cu="query",lF="mutation",uF="infinitequery";function df(e){return e.type===Cu}function Kj(e){return e.type===lF}function pf(e){return e.type===uF}function lf(e){return df(e)||pf(e)}function Gv(e,t,r,n,o,a){let i=Yj(e)?e(t,r,n,o):e;return i?Mv(i,Uv,p=>a(dF(p))):[]}function Yj(e){return typeof e=="function"}function dF(e){return typeof e=="string"?{type:e}:e}function Jj(e,t){return e.catch(t)}var Ds=(e,t)=>e.endpointDefinitions[t],vu=Symbol("forceQueryFn"),Vv=e=>typeof e[vu]=="function";function Xj({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:y}=o.internalActions;return{buildInitiateQuery:I,buildInitiateInfiniteQuery:E,buildInitiateMutation:k,getRunningQueryThunk:x,getRunningMutationThunk:v,getRunningQueriesThunk:C,getRunningMutationsThunk:b};function x(T,D){return G=>{let U=Ds(a,T),j=e({queryArgs:D,endpointDefinition:U,endpointName:T});return p(G)?.get(j)}}function v(T,D){return G=>f(G)?.get(D)}function C(){return T=>BR(p(T))}function b(){return T=>BR(f(T))}function w(T){}function F(T,D){let G=(U,{subscribe:j=!0,forceRefetch:B,subscriptionOptions:V,[vu]:N,..._}={})=>(q,Y)=>{let H=e({queryArgs:U,endpointDefinition:D,endpointName:T}),ne,te={..._,type:Cu,subscribe:j,forceRefetch:B,subscriptionOptions:V,endpointName:T,originalArgs:U,queryCacheKey:H,[vu]:N};if(df(D))ne=t(te);else{let{direction:Re,initialPageParam:ke,refetchCachedPages:Ie}=_;ne=r({...te,direction:Re,initialPageParam:ke,refetchCachedPages:Ie})}let Z=o.endpoints[T].select(U),le=q(ne),Se=Z(Y());let{requestId:je,abort:Je}=le,Qe=Se.requestId!==je,ze=p(q)?.get(H),We=()=>Z(Y()),Ee=Object.assign(N?le.then(We):Qe&&!ze?Promise.resolve(Se):Promise.all([ze,le]).then(We),{arg:U,requestId:je,subscriptionOptions:V,queryCacheKey:H,abort:Je,unwrap(){return _asyncToGenerator(function*(){let Re=yield Ee;if(Re.isError)throw Re.error;return Re.data})()},refetch:Re=>q(G(U,{subscribe:!1,forceRefetch:!0,...Re})),unsubscribe(){j&&q(m({queryCacheKey:H,requestId:je}))},updateSubscriptionOptions(Re){Ee.subscriptionOptions=Re,q(y({endpointName:T,requestId:je,queryCacheKey:H,options:Re}))}});if(!ze&&!Qe&&!N){let Re=p(q);Re.set(H,Ee),Ee.then(()=>{Re.delete(H)})}return Ee};return G}function I(T,D){return F(T,D)}function E(T,D){return F(T,D)}function k(T){return(D,{track:G=!0,fixedCacheKey:U}={})=>(j,B)=>{let V=n({type:"mutation",endpointName:T,originalArgs:D,track:G,fixedCacheKey:U}),N=j(V);let{requestId:_,abort:q,unwrap:Y}=N,H=Jj(N.unwrap().then(le=>({data:le})),le=>({error:le})),ne=()=>{j(g({requestId:_,fixedCacheKey:U}))},te=Object.assign(H,{arg:N.arg,requestId:_,abort:q,unwrap:Y,reset:ne}),Z=f(j);return Z.set(_,te),te.then(()=>{Z.delete(_)}),U&&(Z.set(U,te),te.then(()=>{Z.get(U)===te&&Z.delete(U)})),te}}}var pF=class extends LR{constructor(t,r,n,o){super(t);me(this,"value");me(this,"schemaName");me(this,"_bqMeta");this.value=r,this.schemaName=n,this._bqMeta=o}},Ea=(e,t)=>Array.isArray(e)?e.includes(t):!!e;function Ia(_x115,_x116,_x117,_x118){return _Ia.apply(this,arguments)}function _Ia(){_Ia=_asyncToGenerator(function*(e,t,r,n){let o=yield e["~standard"].validate(t);if(o.issues)throw new pF(o.issues,t,r,n);return o.value});return _Ia.apply(this,arguments)}function zR(e){return e}var hu=(e={})=>({...e,[Kl]:!0});function Zj({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:a,selectors:i,onSchemaFailure:p,catchSchemaFailure:f,skipSchemaValidation:m}){let g=(V,N,_,q)=>(Y,H)=>{let ne=r[V],te=n({queryArgs:N,endpointDefinition:ne,endpointName:V});if(Y(o.internalActions.queryResultPatched({queryCacheKey:te,patches:_})),!q)return;let Z=o.endpoints[V].select(N)(H()),le=Gv(ne.providesTags,Z.data,void 0,N,{},a);Y(o.internalActions.updateProvidedBy([{queryCacheKey:te,providedTags:le}]))};function y(V,N,_=0){let q=[N,...V];return _&&q.length>_?q.slice(0,-1):q}function x(V,N,_=0){let q=[...V,N];return _&&q.length>_?q.slice(1):q}let v=(V,N,_,q=!0)=>(Y,H)=>{let te=o.endpoints[V].select(N)(H()),Z={patches:[],inversePatches:[],undo:()=>Y(o.util.patchQueryData(V,N,Z.inversePatches,q))};if(te.status===Xn)return Z;let le;if("data"in te)if(jt(te.data)){let[Se,je,Je]=AS(te.data,_);Z.patches.push(...je),Z.inversePatches.push(...Je),le=Se}else le=_(te.data),Z.patches.push({op:"replace",path:[],value:le}),Z.inversePatches.push({op:"replace",path:[],value:te.data});return Z.patches.length===0||Y(o.util.patchQueryData(V,N,Z.patches,q)),Z},C=(V,N,_)=>q=>q(o.endpoints[V].initiate(N,{subscribe:!1,forceRefetch:!0,[vu]:()=>({data:_})})),b=(V,N)=>V.query&&V[N]?V[N]:zR,w=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(V,{signal:N,abort:_,rejectWithValue:q,fulfillWithValue:Y,dispatch:H,getState:ne,extra:te}){let Z=r[V.endpointName],{metaSchema:le,skipSchemaValidation:Se=m}=Z,je=V.type===Cu;try{let Je=zR,Qe={signal:N,abort:_,dispatch:H,getState:ne,extra:te,endpoint:V.endpointName,type:V.type,forced:je?F(V,ne()):void 0,queryCacheKey:je?V.queryCacheKey:void 0},ze=je?V[vu]:void 0,We,Ee=/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(ke,Ie,lt,St){if(Ie==null&&ke.pages.length)return Promise.resolve({data:ke});let Mr={queryArg:V.originalArgs,pageParam:Ie},ar=yield Re(Mr),Jr=St?y:x;return{data:{pages:Jr(ke.pages,ar.data,lt),pageParams:Jr(ke.pageParams,Ie,lt)},meta:ar.meta}});return function Ee(_x121,_x122,_x123,_x124){return _ref44.apply(this,arguments)}}();function Re(_x125){return _Re.apply(this,arguments)}function _Re(){_Re=_asyncToGenerator(function*(ke){let Ie,{extraOptions:lt,argSchema:St,rawResponseSchema:Mr,responseSchema:ar}=Z;if(St&&!Ea(Se,"arg")&&(ke=yield Ia(St,ke,"argSchema",{})),ze?Ie=ze():Z.query?(Je=b(Z,"transformResponse"),Ie=yield t(Z.query(ke),Qe,lt)):Ie=yield Z.queryFn(ke,Qe,lt,jr=>t(jr,Qe,lt)),typeof process<"u",Ie.error)throw new _s(Ie.error,Ie.meta);let{data:Jr}=Ie;Mr&&!Ea(Se,"rawResponse")&&(Jr=yield Ia(Mr,Ie.data,"rawResponseSchema",Ie.meta));let mr=yield Je(Jr,Ie.meta,ke);return ar&&!Ea(Se,"response")&&(mr=yield Ia(ar,mr,"responseSchema",Ie.meta)),{...Ie,data:mr}});return _Re.apply(this,arguments)}if(je&&"infiniteQueryOptions"in Z){let{infiniteQueryOptions:ke}=Z,{maxPages:Ie=1/0}=ke,lt=V.refetchCachedPages??ke.refetchCachedPages??!0,St,Mr={pages:[],pageParams:[]},ar=i.selectQueryEntry(ne(),V.queryCacheKey)?.data,mr=F(V,ne())&&!V.direction||!ar?Mr:ar;if("direction"in V&&V.direction&&mr.pages.length){let jr=V.direction==="backward",ld=(jr?fF:Lv)(ke,mr,V.originalArgs);St=yield Ee(mr,ld,Ie,jr)}else{let{initialPageParam:jr=ke.initialPageParam}=V,xl=ar?.pageParams??[],ld=xl[0]??jr,N0=xl.length;if(St=yield Ee(mr,ld,Ie),ze&&(St={data:St.data.pages[0]}),lt)for(let HC=1;HC<N0;HC++){let _0=Lv(ke,St.data,V.originalArgs);St=yield Ee(St.data,_0,Ie)}}We=St}else We=yield Re(V.originalArgs);return le&&!Ea(Se,"meta")&&We.meta&&(We.meta=yield Ia(le,We.meta,"metaSchema",We.meta)),Y(We.data,hu({fulfilledTimeStamp:Date.now(),baseQueryMeta:We.meta}))}catch(Je){let Qe=Je;if(Qe instanceof _s){let ze=b(Z,"transformErrorResponse"),{rawErrorResponseSchema:We,errorResponseSchema:Ee}=Z,{value:Re,meta:ke}=Qe;try{We&&!Ea(Se,"rawErrorResponse")&&(Re=yield Ia(We,Re,"rawErrorResponseSchema",ke)),le&&!Ea(Se,"meta")&&(ke=yield Ia(le,ke,"metaSchema",ke));let Ie=yield ze(Re,ke,V.originalArgs);return Ee&&!Ea(Se,"errorResponse")&&(Ie=yield Ia(Ee,Ie,"errorResponseSchema",ke)),q(Ie,hu({baseQueryMeta:ke}))}catch(Ie){Qe=Ie}}try{if(Qe instanceof pF){let ze={endpoint:V.endpointName,arg:V.originalArgs,type:V.type,queryCacheKey:je?V.queryCacheKey:void 0};Z.onSchemaFailure?.(Qe,ze),p?.(Qe,ze);let{catchSchemaFailure:We=f}=Z;if(We)return q(We(Qe,ze),hu({baseQueryMeta:Qe._bqMeta}))}}catch(ze){Qe=ze}throw typeof process<"u",console.error(Qe),Qe}});return function w(_x119,_x120){return _ref43.apply(this,arguments)}}();function F(V,N){let _=i.selectQueryEntry(N,V.queryCacheKey),q=i.selectConfig(N).refetchOnMountOrArgChange,Y=_?.fulfilledTimeStamp,H=V.forceRefetch??(V.subscribe&&q);return H?H===!0||(Number(new Date)-Number(Y))/1e3>=H:!1}let I=()=>xe(`${e}/executeQuery`,w,{getPendingMeta({arg:N}){let _=r[N.endpointName];return hu({startedTimeStamp:Date.now(),...(pf(_)?{direction:N.direction}:{})})},condition(N,{getState:_}){let q=_(),Y=i.selectQueryEntry(q,N.queryCacheKey),H=Y?.fulfilledTimeStamp,ne=N.originalArgs,te=Y?.originalArgs,Z=r[N.endpointName],le=N.direction;return Vv(N)?!0:Y?.status==="pending"?!1:F(N,q)||df(Z)&&Z?.forceRefetch?.({currentArg:ne,previousArg:te,endpointState:Y,state:q})?!0:!(H&&!le)},dispatchConditionRejection:!0}),E=I(),k=I(),T=xe(`${e}/executeMutation`,w,{getPendingMeta(){return hu({startedTimeStamp:Date.now()})}}),D=V=>"force"in V,G=V=>"ifOlderThan"in V,U=(V,N,_={})=>(q,Y)=>{let H=D(_)&&_.force,ne=G(_)&&_.ifOlderThan,te=(le=!0)=>{let Se={forceRefetch:le,subscribe:!1};return o.endpoints[V].initiate(N,Se)},Z=o.endpoints[V].select(N)(Y());if(H)q(te());else if(ne){let le=Z?.fulfilledTimeStamp;if(!le){q(te());return}(Number(new Date)-Number(new Date(le)))/1e3>=ne&&q(te())}else q(te(!1))};function j(V){return N=>N?.meta?.arg?.endpointName===V}function B(V,N){return{matchPending:Bi(Wd(V),j(N)),matchFulfilled:Bi(Wn(V),j(N)),matchRejected:Bi(Sa(V),j(N))}}return{queryThunk:E,mutationThunk:T,infiniteQueryThunk:k,prefetch:U,updateQueryData:v,upsertQueryData:C,patchQueryData:g,buildMatchThunkActions:B}}function Lv(e,{pages:t,pageParams:r},n){let o=t.length-1;return e.getNextPageParam(t[o],t,r[o],r,n)}function fF(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function mF(e,t,r,n){return Gv(r[e.meta.arg.endpointName][t],Wn(e)?e.payload:void 0,Jl(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function WR(e){return Yt(e)?Ud(e):e}function af(e,t,r){let n=e[t];n&&r(n)}function Au(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function KR(e,t,r){let n=e[Au(t)];n&&r(n)}var sf={};function eV({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 y(j,B,V,N){var _;j[_=B.queryCacheKey]??(j[_]={status:Xn,endpointName:B.endpointName}),af(j,B.queryCacheKey,q=>{q.status=qv,q.requestId=V&&q.requestId?q.requestId:N.requestId,B.originalArgs!==void 0&&(q.originalArgs=B.originalArgs),q.startedTimeStamp=N.startedTimeStamp;let Y=o[N.arg.endpointName];pf(Y)&&"direction"in B&&(q.direction=B.direction)})}function x(j,B,V,N){af(j,B.arg.queryCacheKey,_=>{if(_.requestId!==B.requestId&&!N)return;let{merge:q}=o[B.arg.endpointName];if(_.status=yu,q){if(_.data!==void 0){let{fulfilledTimeStamp:Y,arg:H,baseQueryMeta:ne,requestId:te}=B,Z=ha(_.data,le=>q(le,V,{arg:H.originalArgs,baseQueryMeta:ne,fulfilledTimeStamp:Y,requestId:te}));_.data=Z}else _.data=V;}else _.data=o[B.arg.endpointName].structuralSharing??!0?rF(Yt(_.data)?Zx(_.data):_.data,V):V;delete _.error,_.fulfilledTimeStamp=B.fulfilledTimeStamp})}let v=va({name:`${e}/queries`,initialState:sf,reducers:{removeQueryResult:{reducer(j,{payload:{queryCacheKey:B}}){delete j[B]},prepare:Gi()},cacheEntriesUpserted:{reducer(j,B){for(let V of B.payload){let{queryDescription:N,value:_}=V;y(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:{}},_,!0)}},prepare:j=>({payload:j.map(N=>{let{endpointName:_,arg:q,value:Y}=N,H=o[_];return{queryDescription:{type:Cu,endpointName:_,originalArgs:N.arg,queryCacheKey:n({queryArgs:q,endpointDefinition:H,endpointName:_})},value:Y}}),meta:{[Kl]:!0,requestId:Xl(),timestamp:Date.now()}})},queryResultPatched:{reducer(j,{payload:{queryCacheKey:B,patches:V}}){af(j,B,N=>{N.data=CS(N.data,V.concat())})},prepare:Gi()}},extraReducers(j){j.addCase(t.pending,(B,{meta:V,meta:{arg:N}})=>{let _=Vv(N);y(B,N,_,V)}).addCase(t.fulfilled,(B,{meta:V,payload:N})=>{let _=Vv(V.arg);x(B,V,N,_)}).addCase(t.rejected,(B,{meta:{condition:V,arg:N,requestId:_},error:q,payload:Y})=>{af(B,N.queryCacheKey,H=>{if(!V){if(H.requestId!==_)return;H.status=Su,H.error=Y??q}})}).addMatcher(p,(B,V)=>{let{queries:N}=i(V);for(let[_,q]of Object.entries(N))(q?.status===yu||q?.status===Su)&&(B[_]=q)})}}),C=va({name:`${e}/mutations`,initialState:sf,reducers:{removeMutationResult:{reducer(j,{payload:B}){let V=Au(B);V in j&&delete j[V]},prepare:Gi()}},extraReducers(j){j.addCase(r.pending,(B,{meta:V,meta:{requestId:N,arg:_,startedTimeStamp:q}})=>{_.track&&(B[Au(V)]={requestId:N,status:qv,endpointName:_.endpointName,startedTimeStamp:q})}).addCase(r.fulfilled,(B,{payload:V,meta:N})=>{N.arg.track&&KR(B,N,_=>{_.requestId===N.requestId&&(_.status=yu,_.data=V,_.fulfilledTimeStamp=N.fulfilledTimeStamp)})}).addCase(r.rejected,(B,{payload:V,error:N,meta:_})=>{_.arg.track&&KR(B,_,q=>{q.requestId===_.requestId&&(q.status=Su,q.error=V??N)})}).addMatcher(p,(B,V)=>{let{mutations:N}=i(V);for(let[_,q]of Object.entries(N))(q?.status===yu||q?.status===Su)&&_!==q?.requestId&&(B[_]=q)})}}),b={tags:{},keys:{}},w=va({name:`${e}/invalidation`,initialState:b,reducers:{updateProvidedBy:{reducer(j,B){var V,N,_;for(let{queryCacheKey:q,providedTags:Y}of B.payload){F(j,q);for(let{type:H,id:ne}of Y){let te=(N=(V=j.tags)[H]??(V[H]={}))[_=ne||"__internal_without_id"]??(N[_]=[]);te.includes(q)||te.push(q)}j.keys[q]=Y}},prepare:Gi()}},extraReducers(j){j.addCase(v.actions.removeQueryResult,(B,{payload:{queryCacheKey:V}})=>{F(B,V)}).addMatcher(p,(B,V)=>{var _,q,Y;let{provided:N}=i(V);for(let[H,ne]of Object.entries(N.tags??{}))for(let[te,Z]of Object.entries(ne)){let le=(q=(_=B.tags)[H]??(_[H]={}))[Y=te||"__internal_without_id"]??(q[Y]=[]);for(let Se of Z)le.includes(Se)||le.push(Se),B.keys[Se]=N.keys[Se]}}).addMatcher(Zr(Wn(t),Jl(t)),(B,V)=>{I(B,[V])}).addMatcher(v.actions.cacheEntriesUpserted.match,(B,V)=>{let N=V.payload.map(({queryDescription:_,value:q})=>({type:"UNKNOWN",payload:q,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:_}}));I(B,N)})}});function F(j,B){let V=WR(j.keys[B]??[]);for(let N of V){let _=N.type,q=N.id??"__internal_without_id",Y=j.tags[_]?.[q];Y&&(j.tags[_][q]=WR(Y).filter(H=>H!==B))}delete j.keys[B]}function I(j,B){let V=B.map(N=>{let _=mF(N,"providesTags",o,f),{queryCacheKey:q}=N.meta.arg;return{queryCacheKey:q,providedTags:_}});w.caseReducers.updateProvidedBy(j,w.actions.updateProvidedBy(V))}let E=va({name:`${e}/subscriptions`,initialState:sf,reducers:{updateSubscriptionOptions(j,B){},unsubscribeQueryResult(j,B){},internal_getRTKQSubscriptions(){}}}),k=va({name:`${e}/internalSubscriptions`,initialState:sf,reducers:{subscriptionsUpdated:{reducer(j,B){return CS(j,B.payload)},prepare:Gi()}}}),T=va({name:`${e}/config`,initialState:{online:qj(),focused:Dj(),middlewareRegistered:!1,...m},reducers:{middlewareRegistered(j,{payload:B}){j.middlewareRegistered=j.middlewareRegistered==="conflict"||a!==B?"conflict":!0}},extraReducers:j=>{j.addCase(Bv,B=>{B.online=!0}).addCase(cF,B=>{B.online=!1}).addCase(Qv,B=>{B.focused=!0}).addCase(sF,B=>{B.focused=!1}).addMatcher(p,B=>({...B}))}}),D=Vi({queries:v.reducer,mutations:C.reducer,provided:w.reducer,subscriptions:k.reducer,config:T.reducer}),G=(j,B)=>D(g.match(B)?void 0:j,B),U={...T.actions,...v.actions,...E.actions,...k.actions,...C.actions,...w.actions,resetApiState:g};return{reducer:G,actions:U}}var Ta=Symbol.for("RTKQ/skipToken"),gF={status:Xn},YR=ha(gF,()=>{}),JR=ha(gF,()=>{});function tV({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=E=>YR,o=E=>JR;return{buildQuerySelector:x,buildInfiniteQuerySelector:v,buildMutationSelector:C,selectInvalidatedBy:b,selectCachedArgsForQuery:w,selectApiState:i,selectQueries:p,selectMutations:m,selectQueryEntry:f,selectConfig:g};function a(E){return{...E,...UR(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 y(E,k,T){return D=>{if(D===Ta)return r(n,T);let G=e({queryArgs:D,endpointDefinition:k,endpointName:E});return r(j=>f(j,G)??YR,T)}}function x(E,k){return y(E,k,a)}function v(E,k){let{infiniteQueryOptions:T}=k;function D(G){let U={...G,...UR(G.status)},{isLoading:j,isError:B,direction:V}=U,N=V==="forward",_=V==="backward";return{...U,hasNextPage:F(T,U.data,U.originalArgs),hasPreviousPage:I(T,U.data,U.originalArgs),isFetchingNextPage:j&&N,isFetchingPreviousPage:j&&_,isFetchNextPageError:B&&N,isFetchPreviousPageError:B&&_}}return y(E,k,D)}function C(){return E=>{let k;return typeof E=="object"?k=Au(E)??Ta:k=E,r(k===Ta?o:G=>i(G)?.mutations?.[k]??JR,a)}}function b(E,k){let T=E[t],D=new Set,G=Mv(k,Uv,dF);for(let U of G){let j=T.provided.tags[U.type];if(!j)continue;let B=(U.id!==void 0?j[U.id]:Object.values(j).flat())??[];for(let V of B)D.add(V)}return Array.from(D.values()).flatMap(U=>{let j=T.queries[U];return j?{queryCacheKey:U,endpointName:j.endpointName,originalArgs:j.originalArgs}:[]})}function w(E,k){return Mv(Object.values(p(E)),T=>T?.endpointName===k&&T.status!==Xn,T=>T.originalArgs)}function F(E,k,T){return k?Lv(E,k,T)!=null:!1}function I(E,k,T){return!k||!E.getPreviousPageParam?!1:fF(E,k,T)!=null}}var XR=WeakMap?new WeakMap:void 0,ZR=({endpointName:e,queryArgs:t})=>{let r="",n=XR?.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=Xr(i)?Object.keys(i).sort().reduce((p,f)=>(p[f]=i[f],p),{}):i,i));Xr(t)&&XR?.set(t,o),r=o}return`${e}(${r})`};function rV(...e){return function(r){let n=zl(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=ZR;if("serializeQueryArgs"in m.endpointDefinition){let y=m.endpointDefinition.serializeQueryArgs;g=x=>{let v=y(x);return typeof v=="string"?v:ZR({...x,queryArgs:v})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(m)},tagTypes:[...(r.tagTypes||[])]},a={endpointDefinitions:{},batch(m){m()},apiUid:Xl(),extractRehydrationInfo:n,hasRehydrationInfo:zl(m=>n(m)!=null)},i={injectEndpoints:f,enhanceEndpoints({addTagTypes:m,endpoints:g}){if(m)for(let y of m)o.tagTypes.includes(y)||o.tagTypes.push(y);if(g)for(let[y,x]of Object.entries(g))typeof x=="function"?x(Ds(a,y)):Object.assign(Ds(a,y)||{},x);return i}},p=e.map(m=>m.init(i,o,a));function f(m){let g=m.endpoints({query:y=>({...y,type:Cu}),mutation:y=>({...y,type:lF}),infiniteQuery:y=>({...y,type:uF})});for(let[y,x]of Object.entries(g)){if(m.overrideExisting!==!0&&y in a.endpointDefinitions){if(m.overrideExisting==="throw")throw new Error(Jt(39));typeof process<"u";continue}typeof process<"u",a.endpointDefinitions[y]=x;for(let v of p)v.injectEndpoint(y,x)}return i}return i.injectEndpoints({endpoints:r.endpoints})}}function Jn(e,...t){return Object.assign(e,...t)}var nV=({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:I,requestId:E,options:k}=w.payload,T=b.get(I);return T?.has(E)&&T.set(E,k),!0}if(f.match(w)){let{queryCacheKey:I,requestId:E}=w.payload,k=b.get(I);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:I,requestId:E}}=w,k=cf(b,I.queryCacheKey,jv);return I.subscribe&&k.set(E,I.subscriptionOptions??k.get(E)??{}),!0}let F=!1;if(t.rejected.match(w)){let{meta:{condition:I,arg:E,requestId:k}}=w;if(I&&E.subscribe){let T=cf(b,E.queryCacheKey,jv);T.set(k,E.subscriptionOptions??T.get(k)??{}),F=!0}}return F},g=()=>r.currentSubscriptions,v={getSubscriptions:g,getSubscriptionCount:b=>g().get(b)?.size??0,isRequestSubscribed:(b,w)=>!!g()?.get(b)?.get(w)};function C(b){return JSON.parse(JSON.stringify(Object.fromEntries([...b].map(([w,F])=>[w,Object.fromEntries(F)]))))}return(b,w)=>{if(a||(a=C(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,v];let F=m(r.currentSubscriptions,b),I=!0;if(F){i||(i=setTimeout(()=>{let T=C(r.currentSubscriptions),[,D]=AS(a,()=>T);w.next(e.internalActions.subscriptionsUpdated(D)),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;I=!E&&!k}return[I,!1]}},oV=2147483647/1e3-1,aV=({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:y}=t.internalActions,x=Zr(g.match,r.fulfilled,r.rejected,y.match);function v(E){let k=o.currentSubscriptions.get(E);return k?k.size>0:!1}let C={};function b(E){for(let k of E.values())k?.abort?.()}let w=(E,k)=>{let T=k.getState(),D=i(T);if(x(E)){let G;if(y.match(E))G=E.payload.map(U=>U.queryDescription.queryCacheKey);else{let{queryCacheKey:U}=g.match(E)?E.payload:E.meta.arg;G=[U]}F(G,k,D)}if(t.util.resetApiState.match(E)){for(let[G,U]of Object.entries(C))U&&clearTimeout(U),delete C[G];b(o.runningQueries),b(o.runningMutations)}if(n.hasRehydrationInfo(E)){let{queries:G}=n.extractRehydrationInfo(E);F(Object.keys(G),k,D)}};function F(E,k,T){let D=k.getState();for(let G of E){let U=a(D,G);U?.endpointName&&I(G,U.endpointName,k,T)}}function I(E,k,T,D){let U=Ds(n,k)?.keepUnusedDataFor??D.keepUnusedDataFor;if(U===1/0)return;let j=Math.max(0,Math.min(U,oV));if(!v(E)){let B=C[E];B&&clearTimeout(B),C[E]=setTimeout(()=>{if(!v(E)){let V=a(T.getState(),E);V?.endpointName&&T.dispatch(p(V.endpointName,V.originalArgs))?.abort(),T.dispatch(m({queryCacheKey:E}))}delete C[E]},j*1e3)}}return w},eF=new Error("Promise never resolved before cacheEntryRemoved."),iV=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:a,selectors:{selectQueryEntry:i,selectApiState:p}})=>{let f=Kd(n),m=Kd(o),g=Wn(n,o),y={},{removeQueryResult:x,removeMutationResult:v,cacheEntriesUpserted:C}=e.internalActions;function b(T,D,G){let U=y[T];U?.valueResolved&&(U.valueResolved({data:D,meta:G}),delete U.valueResolved)}function w(T){let D=y[T];D&&(delete y[T],D.cacheEntryRemoved())}function F(T){let{arg:D,requestId:G}=T.meta,{endpointName:U,originalArgs:j}=D;return[U,j,G]}let I=(T,D,G)=>{let U=E(T);function j(B,V,N,_){let q=i(G,V),Y=i(D.getState(),V);!q&&Y&&k(B,_,V,D,N)}if(n.pending.match(T)){let[B,V,N]=F(T);j(B,U,N,V)}else if(C.match(T))for(let{queryDescription:B,value:V}of T.payload){let{endpointName:N,originalArgs:_,queryCacheKey:q}=B;j(N,q,T.meta.requestId,_),b(q,V,{})}else if(o.pending.match(T)){if(D.getState()[t].mutations[U]){let[V,N,_]=F(T);k(V,N,U,D,_)}}else if(g(T))b(U,T.payload,T.meta.baseQueryMeta);else if(x.match(T)||v.match(T))w(U);else if(e.util.resetApiState.match(T))for(let B of Object.keys(y))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:v.match(T)?Au(T.payload):""}function k(T,D,G,U,j){let B=Ds(r,T),V=B?.onCacheEntryAdded;if(!V)return;let N={},_=new Promise(Z=>{N.cacheEntryRemoved=Z}),q=Promise.race([new Promise(Z=>{N.valueResolved=Z}),_.then(()=>{throw eF})]);q.catch(()=>{}),y[G]=N;let Y=e.endpoints[T].select(lf(B)?D:G),H=U.dispatch((Z,le,Se)=>Se),ne={...U,getCacheEntry:()=>Y(U.getState()),requestId:j,extra:H,updateCachedData:lf(B)?Z=>U.dispatch(e.util.updateQueryData(T,D,Z)):void 0,cacheDataLoaded:q,cacheEntryRemoved:_},te=V(D,ne);Promise.resolve(te).catch(Z=>{if(Z!==eF)throw Z})}return I},sV=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},cV=({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=Zr(Wn(n),Jl(n)),y=Zr(Wn(o,n),Sa(o,n)),x=[],v=0,C=(F,I)=>{(o.pending.match(F)||n.pending.match(F))&&v++,y(F)&&(v=Math.max(0,v-1)),g(F)?w(mF(F,"invalidatesTags",r,i),I):y(F)?w([],I):a.util.invalidateTags.match(F)&&w(Gv(F.payload,void 0,void 0,void 0,void 0,i),I)};function b(){return v>0}function w(F,I){let E=I.getState(),k=E[e];if(x.push(...F),k.config.invalidationBehavior==="delayed"&&b())return;let T=x;if(x=[],T.length===0)return;let D=a.util.selectInvalidatedBy(E,T);t.batch(()=>{let G=Array.from(D.values());for(let{queryCacheKey:U}of G){let j=k.queries[U],B=cf(f.currentSubscriptions,U,jv);j&&(B.size===0?I.dispatch(m({queryCacheKey:U})):j.status!==Xn&&I.dispatch(p(j)))}})}return C},lV=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let{currentPolls:a,currentSubscriptions:i}=o,p=new Set,f=null,m=(w,F)=>{(r.internalActions.updateSubscriptionOptions.match(w)||r.internalActions.unsubscribeQueryResult.match(w))&&g(w.payload.queryCacheKey,F),(t.pending.match(w)||t.rejected.match(w)&&w.meta.condition)&&g(w.meta.arg.queryCacheKey,F),(t.fulfilled.match(w)||t.rejected.match(w)&&!w.meta.condition)&&y(w.meta.arg,F),r.util.resetApiState.match(w)&&(C(),f&&(clearTimeout(f),f=null),p.clear())};function g(w,F){p.add(w),f||(f=setTimeout(()=>{for(let I of p)x({queryCacheKey:I},F);p.clear(),f=null},0))}function y({queryCacheKey:w},F){let I=F.getState()[e],E=I.queries[w],k=i.get(w);if(!E||E.status===Xn)return;let{lowestPollingInterval:T,skipPollingIfUnfocused:D}=b(k);if(!Number.isFinite(T))return;let G=a.get(w);G?.timeout&&(clearTimeout(G.timeout),G.timeout=void 0);let U=Date.now()+T;a.set(w,{nextPollTimestamp:U,pollingInterval:T,timeout:setTimeout(()=>{(I.config.focused||!D)&&F.dispatch(n(E)),y({queryCacheKey:w},F)},T)})}function x({queryCacheKey:w},F){let E=F.getState()[e].queries[w],k=i.get(w);if(!E||E.status===Xn)return;let{lowestPollingInterval:T}=b(k);if(!Number.isFinite(T)){v(w);return}let D=a.get(w),G=Date.now()+T;(!D||G<D.nextPollTimestamp)&&y({queryCacheKey:w},F)}function v(w){let F=a.get(w);F?.timeout&&clearTimeout(F.timeout),a.delete(w)}function C(){for(let w of a.keys())v(w)}function b(w=new Map){let F=!1,I=Number.POSITIVE_INFINITY;for(let E of w.values())E.pollingInterval&&(I=Math.min(E.pollingInterval,I),F=E.skipPollingIfUnfocused||F);return{lowestPollingInterval:I,skipPollingIfUnfocused:F}}return m},uV=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=Wd(r,n),a=Sa(r,n),i=Wn(r,n),p={};return(m,g)=>{if(o(m)){let{requestId:y,arg:{endpointName:x,originalArgs:v}}=m.meta,C=Ds(t,x),b=C?.onQueryStarted;if(b){let w={},F=new Promise((T,D)=>{w.resolve=T,w.reject=D});F.catch(()=>{}),p[y]=w;let I=e.endpoints[x].select(lf(C)?v:y),E=g.dispatch((T,D,G)=>G),k={...g,getCacheEntry:()=>I(g.getState()),requestId:y,extra:E,updateCachedData:lf(C)?T=>g.dispatch(e.util.updateQueryData(x,v,T)):void 0,queryFulfilled:F};b(v,k)}}else if(i(m)){let{requestId:y,baseQueryMeta:x}=m.meta;p[y]?.resolve({data:m.payload,meta:x}),delete p[y]}else if(a(m)){let{requestId:y,rejectedWithValue:x,baseQueryMeta:v}=m.meta;p[y]?.reject({error:m.payload??m.error,isUnhandledError:!x,meta:v}),delete p[y]}}},dV=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:a}=r.internalActions,i=(f,m)=>{Qv.match(f)&&p(m,"refetchOnFocus"),Bv.match(f)&&p(m,"refetchOnReconnect")};function p(f,m){let g=f.getState()[e],y=g.queries,x=o.currentSubscriptions;t.batch(()=>{for(let v of x.keys()){let C=y[v],b=x.get(v);if(!b||!C)continue;let w=[...b.values()];(w.some(I=>I[m]===!0)||w.every(I=>I[m]===void 0)&&g.config[m])&&(b.size===0?f.dispatch(a({queryCacheKey:v})):C.status!==Xn&&f.dispatch(n(C)))}})}return i};function pV(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=[sV,aV,cV,lV,iV,uV];return{middleware:x=>{let v=!1,C=a(x.dispatch),b={...e,internalState:C,refetchQuery:y,isThisApiSliceAction:f,mwApi:x},w=m.map(E=>E(b)),F=nV(b),I=dV(b);return E=>k=>{if(!Dl(k))return E(k);v||(v=!0,x.dispatch(n.internalActions.middlewareRegistered(i)));let T={...x,next:E},D=x.getState(),[G,U]=F(k,T,D),j;if(G?j=E(k):j=U,x.getState()[t]&&(I(k,T,D),f(k)||o.hasRehydrationInfo(k)))for(let B of w)B(k,T,D);return j}},actions:p};function y(x){return e.api.endpoints[x.endpointName].initiate(x.originalArgs,{subscribe:!1,forceRefetch:!0})}}var tF=Symbol(),fV=({createSelector:e=tt}={})=>({name:tF,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:a,keepUnusedDataFor:i,refetchOnMountOrArgChange:p,refetchOnFocus:f,refetchOnReconnect:m,invalidationBehavior:g,onSchemaFailure:y,catchSchemaFailure:x,skipSchemaValidation:v},C){ib();let b=Ee=>(typeof process<"u",Ee);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:Bv,onOffline:cF,onFocus:Qv,onFocusLost:sF},util:{}});let w=tV({serializeQueryArgs:a,reducerPath:o,createSelector:e}),{selectInvalidatedBy:F,selectCachedArgsForQuery:I,buildQuerySelector:E,buildInfiniteQuerySelector:k,buildMutationSelector:T}=w;Jn(t.util,{selectInvalidatedBy:F,selectCachedArgsForQuery:I});let{queryThunk:D,infiniteQueryThunk:G,mutationThunk:U,patchQueryData:j,updateQueryData:B,upsertQueryData:V,prefetch:N,buildMatchThunkActions:_}=Zj({baseQuery:r,reducerPath:o,context:C,api:t,serializeQueryArgs:a,assertTagType:b,selectors:w,onSchemaFailure:y,catchSchemaFailure:x,skipSchemaValidation:v}),{reducer:q,actions:Y}=eV({context:C,queryThunk:D,infiniteQueryThunk:G,mutationThunk:U,serializeQueryArgs:a,reducerPath:o,assertTagType:b,config:{refetchOnFocus:f,refetchOnReconnect:m,refetchOnMountOrArgChange:p,keepUnusedDataFor:i,reducerPath:o,invalidationBehavior:g}});Jn(t.util,{patchQueryData:j,updateQueryData:B,upsertQueryData:V,prefetch:N,resetApiState:Y.resetApiState,upsertQueryEntries:Y.cacheEntriesUpserted}),Jn(t.internalActions,Y);let H=new WeakMap,ne=Ee=>cf(H,Ee,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:te,buildInitiateInfiniteQuery:Z,buildInitiateMutation:le,getRunningMutationThunk:Se,getRunningMutationsThunk:je,getRunningQueriesThunk:Je,getRunningQueryThunk:Qe}=Xj({queryThunk:D,mutationThunk:U,infiniteQueryThunk:G,api:t,serializeQueryArgs:a,context:C,getInternalState:ne});Jn(t.util,{getRunningMutationThunk:Se,getRunningMutationsThunk:je,getRunningQueryThunk:Qe,getRunningQueriesThunk:Je});let{middleware:ze,actions:We}=pV({reducerPath:o,context:C,queryThunk:D,mutationThunk:U,infiniteQueryThunk:G,api:t,assertTagType:b,selectors:w,getRunningQueryThunk:Qe,getInternalState:ne});return Jn(t.util,We),Jn(t,{reducer:q,middleware:ze}),{name:tF,injectEndpoint(Ee,Re){var lt;let Ie=(lt=t.endpoints)[Ee]??(lt[Ee]={});df(Re)&&Jn(Ie,{name:Ee,select:E(Ee,Re),initiate:te(Ee,Re)},_(D,Ee)),Kj(Re)&&Jn(Ie,{name:Ee,select:T(),initiate:le(Ee)},_(U,Ee)),pf(Re)&&Jn(Ie,{name:Ee,select:k(Ee,Re),initiate:Z(Ee,Re)},_(D,Ee))}}}}),hF=rV(fV());d();c();u();l();d();c();u();l();var Pa=e=>e.query,yF=e=>e.query?.enableQuerySyntax;var SF=tt(e=>Pa(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})),ff=tt(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();u();l();d();c();u();l();d();c();u();l();var vF=tt(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();u();l();var $v=e=>e.context;d();c();u();l();var Hv=e=>e.pipeline;d();c();u();l();var zv=e=>e.searchHub;d();c();u();l();var Qt=tt(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),jie=tt(e=>e,e=>{let t=Qt(e);return t&&e?e[t].expression:""});d();c();u();l();var AF=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();u();l();var CF=e=>e.excerptLength?.length;d();c();u();l();var un=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,xF=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();u();l();var bF=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();u();l();var wF=e=>e.sortCriteria;var RF=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:ji(e.configuration.search.apiBaseUrl,e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function RF(_x126){return _ref45.apply(this,arguments)}}(),FF=(e,t)=>{let r=Pa(e)?.q,{aq:n,cq:o,dq:a,lq:i}=TF(e),p=$v(e),f=Qr(e.configuration.analytics,t,{actionCause:Ov(e)}),m=zv(e),g=Hv(e),y=ov(e)??[],x=IF(e),v=Qt(e.tabSet)||"default",C=rv(e),b=kw(e),w=t.referrer||"",F=xF(e),I=wF(e),E=mV(e),k=CF(e),T=bF(e),D=AF(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(a&&{dq:a}),...(i&&{lq:i}),...(e.query&&{enableQuerySyntax:yF(e)}),...(p?.contextValues&&{context:p.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:y}},...(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:Pv(e),firstResult:e.pagination.firstResult}),tab:v,locale:C,timezone:b,...(e.debug!==void 0&&{debug:e.debug}),referrer:w,...E,...(T??{}),...(k&&{excerptLength:k}),...(D&&{dictionaryFieldContext:D}),sortCriteria:I,...(F&&{facetOptions:F}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},EF=(e,t)=>{let r=Pa(e)?.q,n=IF(e),o=Qr(e.configuration.analytics,t,{actionCause:Ov(e)}),a=rv(e),i=Qt(e.tabSet)||"default",p=t.referrer,{aq:f,cq:m}=TF(e),g=zv(e),y=Hv(e),x=$v(e),v=ov(e)??[];return{q:r||"",...(n.length&&{facets:n}),citationsFieldToInclude:v,...(g?.length&&{searchHub:g}),...(y?.length&&{pipeline:y}),...(x?.contextValues&&{context:x.contextValues}),...(f&&{aq:f}),...(m&&{cq:m}),tab:i,referrer:p,...o,locale:a}},IF=e=>nf(e)?.map(t=>bv(t,xv())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),mV=e=>({actionsHistory:e.configuration.analytics.enabled?_t.getInstance().getHistory():[]}),TF=e=>{let t=vF(e),r=kv(e);return{...t,...(r&&{cq:r})}};d();c();u();l();var mf=["searching","thinking","answering"];function gf(e){return e.toLowerCase()}var hf=["search","generic"];function Wv(){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();u();l();var PF=["text/plain","text/markdown"];var qs=new L({required:!0}),kF=new L,Ms=new de({required:!0}),Kv={id:qs,title:qs,uri:qs,permanentid:qs,clickUri:kF},yf=new L({required:!0,constrainTo:PF}),OF=new L({required:!0,constrainTo:mf}),NF=e=>({...e,name:gf(e.name)}),js=P("generatedAnswer/setIsVisible",e=>O(e,Ms)),Vs=P("generatedAnswer/setAnswerId",e=>O(e,z)),Ls=P("generatedAnswer/setAnswerGenerationMode",e=>O(e,new L({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),Us=P("generatedAnswer/setIsEnabled",e=>O(e,Ms)),Oa=P("generatedAnswer/updateMessage",e=>O(e,{textDelta:qs})),Na=P("generatedAnswer/updateCitations",e=>O(e,{citations:new ie({required:!0,each:new X({values:Kv})})})),_a=P("generatedAnswer/updateError",e=>O(e,{message:kF,code:new re({min:0})})),dr=P("generatedAnswer/resetAnswer"),Sf=P("generatedAnswer/like"),vf=P("generatedAnswer/dislike"),Af=P("generatedAnswer/feedbackModal/open"),xu=P("generatedAnswer/expand"),Cf=P("generatedAnswer/collapse"),xf=P("generatedAnswer/setId",e=>O(e,{id:new L({required:!0})})),bf=P("generatedAnswer/feedbackModal/close"),Qs=P("generatedAnswer/sendFeedback"),dn=P("generatedAnswer/setIsLoading",e=>O(e,Ms)),ka=P("generatedAnswer/setIsStreaming",e=>O(e,Ms)),Da=P("generatedAnswer/setAnswerContentFormat",e=>O(e,yf)),wf=P("generatedAnswer/updateResponseFormat",e=>O(e,{contentFormat:new ie({each:yf,default:["text/plain"]})})),Rf=P("knowledge/updateAnswerConfigurationId",e=>O(e,qs)),Ff=P("generatedAnswer/registerFieldsToIncludeInCitations",e=>O(e,Ed)),bu=P("generatedAnswer/setIsAnswerGenerated",e=>O(e,Ms)),qa=P("generatedAnswer/setCannotAnswer",e=>O(e,Ms)),Yv=P("generatedAnswer/setAnswerApiQueryParams",e=>O(e,new X({}))),Ef=P("generatedAnswer/startStep",e=>O(NF(e),{name:OF,startedAt:new re({min:0,required:!0})})),If=P("generatedAnswer/finishStep",e=>O(NF(e),{name:OF,finishedAt:new re({min:0,required:!0})})),Tf=P("generatedAnswer/startToolCall",e=>O(e,{toolCallName:z,startedAt:new re({min:0,required:!0}),toolCallId:z})),Pf=P("generatedAnswer/finishToolCall",e=>O(e,{finishedAt:new re({min:0,required:!0}),toolCallId:z})),Bs=P("generatedAnswer/toolCallArgs",e=>O(e,{toolCallId:z,args:new X({options:{required:!0}}),type:new L({required:!0,constrainTo:hf})})),_F=xe("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:a}=t,{generatedAnswerAnalyticsClient:i}=o,{search:p}=a(),{queryExecuted:f}=p,{setAbortControllerRef:m}=e,g=yield RF(r),y=(C,b)=>{switch(C){case"genqa.headerMessageType":{let w=JSON.parse(b);n(Da(w.contentFormat));break}case"genqa.messageType":n(Oa(JSON.parse(b)));break;case"genqa.citationsType":n(Na(JSON.parse(b)));break;case"genqa.endOfStreamType":{let w=JSON.parse(b).answerGenerated,{answerId:F,answer:I}=a().generatedAnswer,k=f.length!==0&&!w,T=!I?.trim();n(qa(k)),n(ka(!1)),n(bu(w)),n((i??Cr).logGeneratedAnswerStreamEnd(w,F,w?T:void 0)),n(To());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${C}"`)}};n(dn(!0));let x=C=>C.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,v=o.streamingClient?.streamGeneratedAnswer(g,{write:C=>{x(g)&&(n(dn(!1)),C.payload&&C.payloadType&&y(C.payloadType,C.payload))},abort:C=>{x(g)&&n(_a(C))},close:()=>{x(g)&&n(ka(!1))},resetAnswer:()=>{x(g)&&n(dr())}});v?m(v):n(dn(!1))});return function(_x127,_x128){return _ref46.apply(this,arguments)}}()),kf=xe("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(dr());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=FF(a,n);r(Yv(i)),yield r(Of(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(_x129,_x130){return _ref47.apply(this,arguments)}}());d();c();u();l();var gV=/*#__PURE__*/function(){var _ref48=_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=ji(n.configuration.search?.apiBaseUrl,i,a);return nF({baseUrl:`${m}/rest/organizations/${i}/answer/v1/configs/${p}`,fetchFn:function(){var _ref49=_asyncToGenerator(function*(g){if(g instanceof String)throw new Error("The provided 'request' must be a Request object.");let y=g.url,x={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(v=>{x[v]=g[v]}),x.duplex="half",x.body=yield g.text(),S(y,x)});return function fetchFn(_x134){return _ref49.apply(this,arguments)}}()})(f,{...t,signal:null},r)}catch(m){return{error:m}}});return function gV(_x131,_x132,_x133){return _ref48.apply(this,arguments)}}(),Nf=hF({reducerPath:"answer",baseQuery:aF(gV,{maxRetries:3}),endpoints:()=>({})});var hV=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},yV=(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)},SV=(e,t)=>{delete e.error,e.citations=t.citations},vV=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},AV=(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})`)},CV=(e,t,r,n)=>{let o=JSON.parse(e.data);o.finishReason==="ERROR"&&o.errorMessage&&AV(t,o);let a=o.payload.length?JSON.parse(o.payload):{};switch(o.payloadType){case"genqa.headerMessageType":a.contentFormat&&(hV(t,a),r(Da(a.contentFormat)));break;case"genqa.messageType":typeof a.textDelta=="string"&&(yV(t,a),r(Oa({textDelta:a.textDelta})));break;case"genqa.citationsType":a.citations&&(SV(t,a),r(Na({citations:a.citations})));break;case"genqa.endOfStreamType":{vV(t,a);let i=t.answerId,p=a.answerGenerated??!1,f=p?!t.answer?.trim():void 0;r(n.logGeneratedAnswerStreamEnd(p,i,f)),r(To());break}}},xV=(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`},Ma=Nf.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(_x135,_x136){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:a,extra:i}){yield n;let{configuration:p,generatedAnswer:f,insightConfiguration:m}=r(),{generatedAnswerAnalyticsClient:g}=yield i,{organizationId:y,environment:x,accessToken:v}=p,C=ji(p.search.apiBaseUrl,y,x),b=xV(C,y,f.answerConfigurationId,m?.insightId);yield vd(b,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${v}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:S,onopen:function(){var _ref50=_asyncToGenerator(function*(w){let F=w.headers.get("x-answer-id");F&&o(I=>{I.answerId=F,a(Vs(F))})});return function onopen(_x137){return _ref50.apply(this,arguments)}}(),onmessage:w=>{o(F=>{CV(w,F,a,g??Cr)})},onerror:w=>{throw w},onclose:()=>{o(w=>{a(qa(!w.generated))})}})}).apply(this,arguments)}})})}),Of=e=>Ma.endpoints.getAnswer.initiate(e),Jv=e=>{let t=ff(e);return Ma.endpoints.getAnswer.select(t??Ta)(e)};d();c();u();l();var DF=ae(Ao,e=>e);d();c();u();l();function bV(e){let t=e.payload?.analyticsAction;return qF(e)&&!pe(t)}function qF(e){return"type"in e}var MF=e=>t=>r=>{let n;bV(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return qF(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();u();l();d();c();u();l();d();c();u();l();var Gs=P("tab/register",e=>{let t=new X({values:{id:z,expression:Ge}});return O(e,t)}),yt=P("tab/updateActiveTab",e=>O(e,z));d();c();u();l();var _f=Vr(jp(),1),LF=Vr(jF(),1),UF=Vr(VF(),1);_f.default.extend(UF.default);_f.default.extend(LF.default);var $s=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:_f.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();u();l();var wV=/(^|; )Coveo-Pendragon=([^;]*)/,RV=/(^|; )Coveo-SearchAgentDebug=([^;]*)/;function QF(){return typeof window>"u"?!1:wV.exec(document.cookie)?.pop()||null}function BF(){return typeof window>"u"?!1:RV.test(document.cookie)}var Df=ae($s(),e=>e.addCase(on,(t,r)=>{FV(t,r.payload)}).addCase(Ar,(t,r)=>{EV(t,r.payload)}).addCase(Fo,(t,r)=>{IV(t,r.payload)}).addCase(cs,t=>{t.analytics.enabled=!1}).addCase(ls,t=>{t.analytics.enabled=!0}).addCase(Pp,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(kp,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(yt,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(us,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Me,(t,r)=>{pe(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(Op,(t,{payload:r})=>{TV(t,r)}));function FV(e,t){pe(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",pe(t.organizationId)||(e.organizationId=t.organizationId)}function EV(e,t){pe(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),pe(t.locale)||(e.search.locale=t.locale),pe(t.timezone)||(e.search.timezone=t.timezone),pe(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function IV(e,t){pe(t.enabled)||(e.analytics.enabled=t.enabled),pe(t.originContext)||(e.analytics.originContext=t.originContext),pe(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),pe(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),pe(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),pe(t.trackingId)||(e.analytics.trackingId=t.trackingId),pe(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),pe(t.source)||(e.analytics.source=t.source);try{let r=QF();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}pe(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),pe(t.anonymous)||(e.analytics.anonymous=t.anonymous),pe(t.deviceId)||(e.analytics.deviceId=t.deviceId),pe(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),pe(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}function TV(e,t){e.knowledge.agentId=t;try{BF()&&(e.knowledge.debugAgentSession=!0)}catch{}}var fe=Df;d();c();u();l();function PV(e){return e.instantlyCallable}var GF=()=>e=>t=>e(PV(t)?t():t);d();c();u();l();d();c();u();l();d();c();u();l();d();c();u();l();d();c();u();l();d();c();u();l();var Dt=[];for(let e=0;e<256;++e)Dt.push((e+256).toString(16).slice(1));function $F(e,t=0){return(Dt[e[t+0]]+Dt[e[t+1]]+Dt[e[t+2]]+Dt[e[t+3]]+"-"+Dt[e[t+4]]+Dt[e[t+5]]+"-"+Dt[e[t+6]]+Dt[e[t+7]]+"-"+Dt[e[t+8]]+Dt[e[t+9]]+"-"+Dt[e[t+10]]+Dt[e[t+11]]+Dt[e[t+12]]+Dt[e[t+13]]+Dt[e[t+14]]+Dt[e[t+15]]).toLowerCase()}d();c();u();l();var rA,kV=new Uint8Array(16);function nA(){if(!rA){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");rA=crypto.getRandomValues.bind(crypto)}return rA(kV)}d();c();u();l();d();c();u();l();var OV=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),oA={randomUUID:OV};function NV(e,t,r){if(oA.randomUUID&&!t&&!e)return oA.randomUUID();e=e||{};let n=e.random??e.rng?.()??nA();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 $F(n)}var Lo=NV;d();c();u();l();d();c();u();l();var R={};wl(R,{BRAND:()=>aL,DIRTY:()=>ja,EMPTY_PATH:()=>MV,INVALID:()=>be,NEVER:()=>BL,OK:()=>Bt,ParseStatus:()=>qt,Schema:()=>Oe,ZodAny:()=>Bo,ZodArray:()=>ro,ZodBigInt:()=>La,ZodBoolean:()=>Ua,ZodBranded:()=>Ru,ZodCatch:()=>Xa,ZodDate:()=>Qa,ZodDefault:()=>Ja,ZodDiscriminatedUnion:()=>jf,ZodEffects:()=>Tr,ZodEnum:()=>Ka,ZodError:()=>tr,ZodFirstPartyTypeKind:()=>we,ZodFunction:()=>Lf,ZodIntersection:()=>Ha,ZodIssueCode:()=>ee,ZodLazy:()=>za,ZodLiteral:()=>Wa,ZodMap:()=>Js,ZodNaN:()=>Zs,ZodNativeEnum:()=>Ya,ZodNever:()=>$r,ZodNull:()=>Ga,ZodNullable:()=>mn,ZodNumber:()=>Va,ZodObject:()=>rr,ZodOptional:()=>Er,ZodParsedType:()=>ue,ZodPipeline:()=>Fu,ZodPromise:()=>Go,ZodReadonly:()=>Za,ZodRecord:()=>Vf,ZodSchema:()=>Oe,ZodSet:()=>Xs,ZodString:()=>Qo,ZodSymbol:()=>Ks,ZodTransformer:()=>Tr,ZodTuple:()=>fn,ZodType:()=>Oe,ZodUndefined:()=>Ba,ZodUnion:()=>$a,ZodUnknown:()=>to,ZodVoid:()=>Ys,addIssueToContext:()=>ce,any:()=>mL,array:()=>SL,bigint:()=>lL,boolean:()=>rE,coerce:()=>QL,custom:()=>ZF,date:()=>uL,datetimeRegex:()=>JF,defaultErrorMap:()=>Zn,discriminatedUnion:()=>xL,effect:()=>_L,enum:()=>kL,function:()=>IL,getErrorMap:()=>Hs,getParsedType:()=>pn,instanceof:()=>sL,intersection:()=>bL,isAborted:()=>qf,isAsync:()=>zs,isDirty:()=>Mf,isValid:()=>Uo,late:()=>iL,lazy:()=>TL,literal:()=>PL,makeIssue:()=>wu,map:()=>FL,nan:()=>cL,nativeEnum:()=>OL,never:()=>hL,null:()=>fL,nullable:()=>qL,number:()=>tE,object:()=>vL,objectUtil:()=>aA,oboolean:()=>UL,onumber:()=>LL,optional:()=>DL,ostring:()=>VL,pipeline:()=>jL,preprocess:()=>ML,promise:()=>NL,quotelessJson:()=>_V,record:()=>RL,set:()=>EL,setErrorMap:()=>qV,strictObject:()=>AL,string:()=>eE,symbol:()=>dL,transformer:()=>_L,tuple:()=>wL,undefined:()=>pL,union:()=>CL,unknown:()=>gL,util:()=>De,void:()=>yL});d();c();u();l();d();c();u();l();d();c();u();l();d();c();u();l();d();c();u();l();var De;(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})(De||(De={}));var aA;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(aA||(aA={}));var ue=De.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pn=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 ee=De.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"]),_V=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),tr=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,De.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()}};tr.create=e=>new tr(e);var DV=(e,t)=>{let r;switch(e.code){case ee.invalid_type:e.received===ue.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ee.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,De.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:r=`Unrecognized key(s) in object: ${De.joinValues(e.keys,", ")}`;break;case ee.invalid_union:r="Invalid input";break;case ee.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${De.joinValues(e.options)}`;break;case ee.invalid_enum_value:r=`Invalid enum value. Expected ${De.joinValues(e.options)}, received '${e.received}'`;break;case ee.invalid_arguments:r="Invalid function arguments";break;case ee.invalid_return_type:r="Invalid function return type";break;case ee.invalid_date:r="Invalid date";break;case ee.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}"`:De.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ee.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 ee.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 ee.custom:r="Invalid input";break;case ee.invalid_intersection_types:r="Intersection results could not be merged";break;case ee.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ee.not_finite:r="Number must be finite";break;default:r=t.defaultError,De.assertNever(e)}return{message:r}},Zn=DV;var HF=Zn;function qV(e){HF=e}function Hs(){return HF}d();c();u();l();var wu=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}},MV=[];function ce(e,t){let r=Hs(),n=wu({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Zn?void 0:Zn].filter(o=>!!o)});e.common.issues.push(n)}var qt=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 be;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 be;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}}},be=Object.freeze({status:"aborted"}),ja=e=>({status:"dirty",value:e}),Bt=e=>({status:"valid",value:e}),qf=e=>e.status==="aborted",Mf=e=>e.status==="dirty",Uo=e=>e.status==="valid",zs=e=>typeof Promise<"u"&&e instanceof Promise;d();c();u();l();d();c();u();l();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 Ir=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}},zF=(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 tr(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 Oe=class{get description(){return this._def.description}_getType(t){return pn(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:pn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new qt,ctx:{common:t.parent.common,data:t.data,parsedType:pn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(zs(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:pn(t)},o=this._parseSync({data:t,path:n.path,parent:n});return zF(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:pn(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 _this24=this;return _asyncToGenerator(function*(){let n=yield _this24.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this25=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this25._def.errorMap,parent:null,data:t,parsedType:pn(t)},o=_this25._parse({data:t,path:n.path,parent:n}),a=yield zs(o)?o:Promise.resolve(o);return zF(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:ee.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 Tr({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 Er.create(this,this._def)}nullable(){return mn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ro.create(this)}promise(){return Go.create(this,this._def)}or(t){return $a.create([this,t],this._def)}and(t){return Ha.create(this,t,this._def)}transform(t){return new Tr({...Te(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Ja({...Te(this._def),innerType:this,defaultValue:r,typeName:we.ZodDefault})}brand(){return new Ru({typeName:we.ZodBranded,type:this,...Te(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Xa({...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 Fu.create(this,t)}readonly(){return Za.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},jV=/^c[^\s-]{8,}$/i,VV=/^[0-9a-z]+$/,LV=/^[0-9A-HJKMNP-TV-Z]{26}$/i,UV=/^[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,QV=/^[a-z0-9_-]{21}$/i,BV=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,GV=/^[-+]?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)?)??$/,$V=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,HV="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",iA,zV=/^(?:(?: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])$/,WV=/^(?:(?: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])$/,KV=/^(([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]))$/,YV=/^(([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])$/,JV=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,XV=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,KF="((\\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])))",ZV=new RegExp(`^${KF}$`);function YF(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 eL(e){return new RegExp(`^${YF(e)}$`)}function JF(e){let t=`${KF}T${YF(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 tL(e,t){return!!((t==="v4"||!t)&&zV.test(e)||(t==="v6"||!t)&&KV.test(e))}function rL(e,t){if(!BV.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 nL(e,t){return!!((t==="v4"||!t)&&WV.test(e)||(t==="v6"||!t)&&YV.test(e))}var Qo=class e extends Oe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ue.string){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:ue.string,received:a.parsedType}),be}let n=new qt,o;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.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),ce(o,{code:ee.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?ce(o,{code:ee.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):p&&ce(o,{code:ee.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")$V.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"email",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")iA||(iA=new RegExp(HV,"u")),iA.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"emoji",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")UV.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"uuid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")QV.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"nanoid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")jV.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")VV.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid2",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")LV.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ulid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ce(o,{validation:"url",code:ee.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),ce(o,{validation:"regex",code:ee.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),ce(o,{code:ee.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),ce(o,{code:ee.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?JF(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?ZV.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?eL(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?GV.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"duration",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?tL(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ip",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?rL(t.data,a.alg)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"jwt",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?nL(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cidr",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?JV.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?XV.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64url",code:ee.invalid_string,message:a.message}),n.dirty()):De.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:ee.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}};Qo.create=e=>new Qo({checks:[],typeName:we.ZodString,coerce:e?.coerce??!1,...Te(e)});function oL(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 Va=class e extends Oe{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 ce(a,{code:ee.invalid_type,expected:ue.number,received:a.parsedType}),be}let n,o=new qt;for(let a of this._def.checks)a.kind==="int"?De.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.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),ce(n,{code:ee.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),ce(n,{code:ee.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?oL(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_finite,message:a.message}),o.dirty()):De.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"&&De.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)}};Va.create=e=>new Va({checks:[],typeName:we.ZodNumber,coerce:e?.coerce||!1,...Te(e)});var La=class e extends Oe{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 qt;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),ce(n,{code:ee.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),ce(n,{code:ee.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),ce(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):De.assertNever(a);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return ce(r,{code:ee.invalid_type,expected:ue.bigint,received:r.parsedType}),be}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}};La.create=e=>new La({checks:[],typeName:we.ZodBigInt,coerce:e?.coerce??!1,...Te(e)});var Ua=class extends Oe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ue.boolean){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:ue.boolean,received:n.parsedType}),be}return Bt(t.data)}};Ua.create=e=>new Ua({typeName:we.ZodBoolean,coerce:e?.coerce||!1,...Te(e)});var Qa=class e extends Oe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ue.date){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:ue.date,received:a.parsedType}),be}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_date}),be}let n=new qt,o;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.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),ce(o,{code:ee.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):De.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}};Qa.create=e=>new Qa({checks:[],coerce:e?.coerce||!1,typeName:we.ZodDate,...Te(e)});var Ks=class extends Oe{_parse(t){if(this._getType(t)!==ue.symbol){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:ue.symbol,received:n.parsedType}),be}return Bt(t.data)}};Ks.create=e=>new Ks({typeName:we.ZodSymbol,...Te(e)});var Ba=class extends Oe{_parse(t){if(this._getType(t)!==ue.undefined){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:ue.undefined,received:n.parsedType}),be}return Bt(t.data)}};Ba.create=e=>new Ba({typeName:we.ZodUndefined,...Te(e)});var Ga=class extends Oe{_parse(t){if(this._getType(t)!==ue.null){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:ue.null,received:n.parsedType}),be}return Bt(t.data)}};Ga.create=e=>new Ga({typeName:we.ZodNull,...Te(e)});var Bo=class extends Oe{constructor(){super(...arguments),this._any=!0}_parse(t){return Bt(t.data)}};Bo.create=e=>new Bo({typeName:we.ZodAny,...Te(e)});var to=class extends Oe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Bt(t.data)}};to.create=e=>new to({typeName:we.ZodUnknown,...Te(e)});var $r=class extends Oe{_parse(t){let r=this._getOrReturnCtx(t);return ce(r,{code:ee.invalid_type,expected:ue.never,received:r.parsedType}),be}};$r.create=e=>new $r({typeName:we.ZodNever,...Te(e)});var Ys=class extends Oe{_parse(t){if(this._getType(t)!==ue.undefined){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:ue.void,received:n.parsedType}),be}return Bt(t.data)}};Ys.create=e=>new Ys({typeName:we.ZodVoid,...Te(e)});var ro=class e extends Oe{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==ue.array)return ce(r,{code:ee.invalid_type,expected:ue.array,received:r.parsedType}),be;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,p=r.data.length<o.exactLength.value;(i||p)&&(ce(r,{code:i?ee.too_big:ee.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&&(ce(r,{code:ee.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&&(ce(r,{code:ee.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 Ir(r,i,r.path,p)))).then(i=>qt.mergeArray(n,i));let a=[...r.data].map((i,p)=>o.type._parseSync(new Ir(r,i,r.path,p)));return qt.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)}};ro.create=(e,t)=>new ro({type:e,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...Te(t)});function Ws(e){if(e instanceof rr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Er.create(Ws(n))}return new rr({...e._def,shape:()=>t})}else return e instanceof ro?new ro({...e._def,type:Ws(e.element)}):e instanceof Er?Er.create(Ws(e.unwrap())):e instanceof mn?mn.create(Ws(e.unwrap())):e instanceof fn?fn.create(e.items.map(t=>Ws(t))):e}var rr=class e extends Oe{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=De.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 ce(m,{code:ee.invalid_type,expected:ue.object,received:m.parsedType}),be}let{status:n,ctx:o}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),p=[];if(!(this._def.catchall instanceof $r&&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],y=o.data[m];f.push({key:{status:"valid",value:m},value:g._parse(new Ir(o,y,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof $r){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&&(ce(o,{code:ee.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 y=o.data[g];f.push({key:{status:"valid",value:g},value:m._parse(new Ir(o,y,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 y=yield g.key,x=yield g.value;m.push({key:y,value:x,alwaysSet:g.alwaysSet})}return m})).then(m=>qt.mergeObjectSync(n,m)):qt.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 De.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 De.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Ws(this)}partial(t){let r={};for(let n of De.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 De.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Er;)a=a._def.innerType;r[n]=a}return new e({...this._def,shape:()=>r})}keyof(){return XF(De.objectKeys(this.shape))}};rr.create=(e,t)=>new rr({shape:()=>e,unknownKeys:"strip",catchall:$r.create(),typeName:we.ZodObject,...Te(t)});rr.strictCreate=(e,t)=>new rr({shape:()=>e,unknownKeys:"strict",catchall:$r.create(),typeName:we.ZodObject,...Te(t)});rr.lazycreate=(e,t)=>new rr({shape:e,unknownKeys:"strip",catchall:$r.create(),typeName:we.ZodObject,...Te(t)});var $a=class extends Oe{_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 tr(p.ctx.common.issues));return ce(r,{code:ee.invalid_union,unionErrors:i}),be}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref52=_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(_x138){return _ref52.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 tr(f));return ce(r,{code:ee.invalid_union,unionErrors:p}),be}}get options(){return this._def.options}};$a.create=(e,t)=>new $a({options:e,typeName:we.ZodUnion,...Te(t)});var eo=e=>e instanceof za?eo(e.schema):e instanceof Tr?eo(e.innerType()):e instanceof Wa?[e.value]:e instanceof Ka?e.options:e instanceof Ya?De.objectValues(e.enum):e instanceof Ja?eo(e._def.innerType):e instanceof Ba?[void 0]:e instanceof Ga?[null]:e instanceof Er?[void 0,...eo(e.unwrap())]:e instanceof mn?[null,...eo(e.unwrap())]:e instanceof Ru||e instanceof Za?eo(e.unwrap()):e instanceof Xa?eo(e._def.innerType):[],jf=class e extends Oe{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.object)return ce(r,{code:ee.invalid_type,expected:ue.object,received:r.parsedType}),be;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}):(ce(r,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),be)}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=eo(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 sA(e,t){let r=pn(e),n=pn(t);if(e===t)return{valid:!0,data:e};if(r===ue.object&&n===ue.object){let o=De.objectKeys(t),a=De.objectKeys(e).filter(p=>o.indexOf(p)!==-1),i={...e,...t};for(let p of a){let f=sA(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=sA(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 Ha=class extends Oe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(a,i)=>{if(qf(a)||qf(i))return be;let p=sA(a.value,i.value);return p.valid?((Mf(a)||Mf(i))&&r.dirty(),{status:r.value,value:p.data}):(ce(n,{code:ee.invalid_intersection_types}),be)};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}))}};Ha.create=(e,t,r)=>new Ha({left:e,right:t,typeName:we.ZodIntersection,...Te(r)});var fn=class e extends Oe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.array)return ce(n,{code:ee.invalid_type,expected:ue.array,received:n.parsedType}),be;if(n.data.length<this._def.items.length)return ce(n,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&n.data.length>this._def.items.length&&(ce(n,{code:ee.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 Ir(n,i,n.path,p)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>qt.mergeArray(r,i)):qt.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};fn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fn({items:e,typeName:we.ZodTuple,rest:null,...Te(t)})};var Vf=class e extends Oe{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 ce(n,{code:ee.invalid_type,expected:ue.object,received:n.parsedType}),be;let o=[],a=this._def.keyType,i=this._def.valueType;for(let p in n.data)o.push({key:a._parse(new Ir(n,p,n.path,p)),value:i._parse(new Ir(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?qt.mergeObjectAsync(r,o):qt.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Oe?new e({keyType:t,valueType:r,typeName:we.ZodRecord,...Te(n)}):new e({keyType:Qo.create(),valueType:t,typeName:we.ZodRecord,...Te(r)})}},Js=class extends Oe{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 ce(n,{code:ee.invalid_type,expected:ue.map,received:n.parsedType}),be;let o=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([p,f],m)=>({key:o._parse(new Ir(n,p,n.path,[m,"key"])),value:a._parse(new Ir(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 be;(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 be;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}}};Js.create=(e,t,r)=>new Js({valueType:t,keyType:e,typeName:we.ZodMap,...Te(r)});var Xs=class e extends Oe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.set)return ce(n,{code:ee.invalid_type,expected:ue.set,received:n.parsedType}),be;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(ce(n,{code:ee.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&&(ce(n,{code:ee.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 be;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 Ir(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)}};Xs.create=(e,t)=>new Xs({valueType:e,minSize:null,maxSize:null,typeName:we.ZodSet,...Te(t)});var Lf=class e extends Oe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.function)return ce(r,{code:ee.invalid_type,expected:ue.function,received:r.parsedType}),be;function n(p,f){return wu({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hs(),Zn].filter(m=>!!m),issueData:{code:ee.invalid_arguments,argumentsError:f}})}function o(p,f){return wu({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hs(),Zn].filter(m=>!!m),issueData:{code:ee.invalid_return_type,returnTypeError:f}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Go){let p=this;return Bt(/*#__PURE__*/_asyncToGenerator(function*(...f){let m=new tr([]),g=yield p._def.args.parseAsync(f,a).catch(v=>{throw m.addIssue(n(f,v)),m}),y=yield Reflect.apply(i,this,g);return yield p._def.returns._def.type.parseAsync(y,a).catch(v=>{throw m.addIssue(o(y,v)),m})}))}else{let p=this;return Bt(function(...f){let m=p._def.args.safeParse(f,a);if(!m.success)throw new tr([n(f,m.error)]);let g=Reflect.apply(i,this,m.data),y=p._def.returns.safeParse(g,a);if(!y.success)throw new tr([o(g,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:fn.create(t).rest(to.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||fn.create([]).rest(to.create()),returns:r||to.create(),typeName:we.ZodFunction,...Te(n)})}},za=class extends Oe{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})}};za.create=(e,t)=>new za({getter:e,typeName:we.ZodLazy,...Te(t)});var Wa=class extends Oe{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return ce(r,{received:r.data,code:ee.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:t.data}}get value(){return this._def.value}};Wa.create=(e,t)=>new Wa({value:e,typeName:we.ZodLiteral,...Te(t)});function XF(e,t){return new Ka({values:e,typeName:we.ZodEnum,...Te(t)})}var Ka=class e extends Oe{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{expected:De.joinValues(n),received:r.parsedType,code:ee.invalid_type}),be}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 ce(r,{received:r.data,code:ee.invalid_enum_value,options:n}),be}return Bt(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})}};Ka.create=XF;var Ya=class extends Oe{_parse(t){let r=De.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ue.string&&n.parsedType!==ue.number){let o=De.objectValues(r);return ce(n,{expected:De.joinValues(o),received:n.parsedType,code:ee.invalid_type}),be}if(this._cache||(this._cache=new Set(De.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=De.objectValues(r);return ce(n,{received:n.data,code:ee.invalid_enum_value,options:o}),be}return Bt(t.data)}get enum(){return this._def.values}};Ya.create=(e,t)=>new Ya({values:e,typeName:we.ZodNativeEnum,...Te(t)});var Go=class extends Oe{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.promise&&r.common.async===!1)return ce(r,{code:ee.invalid_type,expected:ue.promise,received:r.parsedType}),be;let n=r.parsedType===ue.promise?r.data:Promise.resolve(r.data);return Bt(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Go.create=(e,t)=>new Go({type:e,typeName:we.ZodPromise,...Te(t)});var Tr=class extends Oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this26=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,a={addIssue:i=>{ce(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 _ref55=_asyncToGenerator(function*(p){if(r.value==="aborted")return be;let f=yield _this26._def.schema._parseAsync({data:p,path:n.path,parent:n});return f.status==="aborted"?be:f.status==="dirty"?ja(f.value):r.value==="dirty"?ja(f.value):f});return function(_x139){return _ref55.apply(this,arguments)}}());{if(r.value==="aborted")return be;let p=this._def.schema._parseSync({data:i,path:n.path,parent:n});return p.status==="aborted"?be:p.status==="dirty"?ja(p.value):r.value==="dirty"?ja(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"?be:(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"?be:(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 be;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})):be);De.assertNever(o)}};Tr.create=(e,t,r)=>new Tr({schema:e,typeName:we.ZodEffects,effect:t,...Te(r)});Tr.createWithPreprocess=(e,t,r)=>new Tr({schema:t,effect:{type:"preprocess",transform:e},typeName:we.ZodEffects,...Te(r)});var Er=class extends Oe{_parse(t){return this._getType(t)===ue.undefined?Bt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Er.create=(e,t)=>new Er({innerType:e,typeName:we.ZodOptional,...Te(t)});var mn=class extends Oe{_parse(t){return this._getType(t)===ue.null?Bt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};mn.create=(e,t)=>new mn({innerType:e,typeName:we.ZodNullable,...Te(t)});var Ja=class extends Oe{_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}};Ja.create=(e,t)=>new Ja({innerType:e,typeName:we.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Te(t)});var Xa=class extends Oe{_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 zs(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new tr(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new tr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Xa.create=(e,t)=>new Xa({innerType:e,typeName:we.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Te(t)});var Zs=class extends Oe{_parse(t){if(this._getType(t)!==ue.nan){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:ue.nan,received:n.parsedType}),be}return{status:"valid",value:t.data}}};Zs.create=e=>new Zs({typeName:we.ZodNaN,...Te(e)});var aL=Symbol("zod_brand"),Ru=class extends Oe{_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}},Fu=class e extends Oe{_parse(t){var _this27=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let a=yield _this27._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?be:a.status==="dirty"?(r.dirty(),ja(a.value)):_this27._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"?be: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})}},Za=class extends Oe{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Uo(o)&&(o.value=Object.freeze(o.value)),o);return zs(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Za.create=(e,t)=>new Za({innerType:e,typeName:we.ZodReadonly,...Te(t)});function WF(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function ZF(e,t={},r){return e?Bo.create().superRefine((n,o)=>{let a=e(n);if(a instanceof Promise)return a.then(i=>{if(!i){let p=WF(t,n),f=p.fatal??r??!0;o.addIssue({code:"custom",...p,fatal:f})}});if(!a){let i=WF(t,n),p=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:p})}}):Bo.create()}var iL={object:rr.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 sL=(e,t={message:`Input not instance of ${e.name}`})=>ZF(r=>r instanceof e,t),eE=Qo.create,tE=Va.create,cL=Zs.create,lL=La.create,rE=Ua.create,uL=Qa.create,dL=Ks.create,pL=Ba.create,fL=Ga.create,mL=Bo.create,gL=to.create,hL=$r.create,yL=Ys.create,SL=ro.create,vL=rr.create,AL=rr.strictCreate,CL=$a.create,xL=jf.create,bL=Ha.create,wL=fn.create,RL=Vf.create,FL=Js.create,EL=Xs.create,IL=Lf.create,TL=za.create,PL=Wa.create,kL=Ka.create,OL=Ya.create,NL=Go.create,_L=Tr.create,DL=Er.create,qL=mn.create,ML=Tr.createWithPreprocess,jL=Fu.create,VL=()=>eE().optional(),LL=()=>tE().optional(),UL=()=>rE().optional(),QL={string:e=>Qo.create({...e,coerce:!0}),number:e=>Va.create({...e,coerce:!0}),boolean:e=>Ua.create({...e,coerce:!0}),bigint:e=>La.create({...e,coerce:!0}),date:e=>Qa.create({...e,coerce:!0})};var BL=be;var GL=R.object({name:R.string(),arguments:R.string()}),$L=R.object({id:R.string(),type:R.literal("function"),function:GL,encryptedValue:R.string().optional()}),Uf=R.object({id:R.string(),role:R.string(),content:R.string().optional(),name:R.string().optional(),encryptedValue:R.string().optional()}),HL=R.object({type:R.literal("text"),text:R.string()}),zL=R.object({type:R.literal("data"),value:R.string(),mimeType:R.string()}),WL=R.object({type:R.literal("url"),value:R.string(),mimeType:R.string().optional()}),Qf=R.discriminatedUnion("type",[zL,WL]),KL=R.object({type:R.literal("image"),source:Qf,metadata:R.unknown().optional()}),YL=R.object({type:R.literal("audio"),source:Qf,metadata:R.unknown().optional()}),JL=R.object({type:R.literal("video"),source:Qf,metadata:R.unknown().optional()}),XL=R.object({type:R.literal("document"),source:Qf,metadata:R.unknown().optional()});var nE=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()}),oE=(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=nE.superRefine((e,t)=>{oE(e,t)}),ZL=R.discriminatedUnion("type",[HL,KL,YL,JL,XL,nE]),eU=ZL.superRefine((e,t)=>{e.type==="binary"&&oE(e,t)}),tU=Uf.extend({role:R.literal("developer"),content:R.string()}),rU=Uf.extend({role:R.literal("system"),content:R.string()}),nU=Uf.extend({role:R.literal("assistant"),content:R.string().optional(),toolCalls:R.array($L).optional()}),oU=Uf.extend({role:R.literal("user"),content:R.union([R.string(),R.array(eU)])}),aU=R.object({id:R.string(),content:R.string(),role:R.literal("tool"),toolCallId:R.string(),error:R.string().optional(),encryptedValue:R.string().optional()}),iU=R.object({id:R.string(),role:R.literal("activity"),activityType:R.string(),content:R.record(R.any())}),sU=R.object({id:R.string(),role:R.literal("reasoning"),content:R.string(),encryptedValue:R.string().optional()}),aE=R.discriminatedUnion("role",[tU,rU,nU,oU,aU,iU,sU]),Cde=R.union([R.literal("developer"),R.literal("system"),R.literal("assistant"),R.literal("user"),R.literal("tool"),R.literal("activity"),R.literal("reasoning")]),cU=R.object({description:R.string(),value:R.string()}),iE=R.object({name:R.string(),description:R.string(),parameters:R.any(),metadata:R.record(R.any()).optional()}),lU=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()}),uU=R.object({interruptId:R.string(),status:R.enum(["resolved","cancelled"]),payload:R.any().optional()}),dU=R.object({threadId:R.string(),runId:R.string(),parentRunId:R.string().optional(),state:R.any(),messages:R.array(aE),tools:R.array(iE),context:R.array(cU),forwardedProps:R.any(),resume:R.array(uU).optional()}),pU=R.any(),Xe=class extends Error{constructor(e){super(e)}},cA=class extends Xe{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},fU=R.object({name:R.string(),description:R.string().optional()}),mU=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()}),gU=R.object({streaming:R.boolean().optional(),websocket:R.boolean().optional(),httpBinary:R.boolean().optional(),pushNotifications:R.boolean().optional(),resumable:R.boolean().optional()}),hU=R.object({supported:R.boolean().optional(),items:R.array(iE).optional(),parallelCalls:R.boolean().optional(),clientProvided:R.boolean().optional()}),yU=R.object({structuredOutput:R.boolean().optional(),supportedMimeTypes:R.array(R.string()).optional()}),SU=R.object({snapshots:R.boolean().optional(),deltas:R.boolean().optional(),memory:R.boolean().optional(),persistentState:R.boolean().optional()}),vU=R.object({supported:R.boolean().optional(),delegation:R.boolean().optional(),handoffs:R.boolean().optional(),subAgents:R.array(fU).optional()}),AU=R.object({supported:R.boolean().optional(),streaming:R.boolean().optional(),encrypted:R.boolean().optional()}),CU=R.object({image:R.boolean().optional(),audio:R.boolean().optional(),video:R.boolean().optional(),pdf:R.boolean().optional(),file:R.boolean().optional()}),xU=R.object({image:R.boolean().optional(),audio:R.boolean().optional()}),bU=R.object({input:CU.optional(),output:xU.optional()}),wU=R.object({codeExecution:R.boolean().optional(),sandboxed:R.boolean().optional(),maxIterations:R.number().optional(),maxExecutionTime:R.number().optional()}),RU=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()}),xde=R.object({identity:mU.optional(),transport:gU.optional(),tools:hU.optional(),output:yU.optional(),state:SU.optional(),multiAgent:vU.optional(),reasoning:AU.optional(),multimodal:bU.optional(),execution:wU.optional(),humanInTheLoop:RU.optional(),custom:R.record(R.unknown()).optional()}),sE=R.union([R.literal("developer"),R.literal("system"),R.literal("assistant"),R.literal("user")]),M=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}({}),Le=R.object({type:R.nativeEnum(M),timestamp:R.number().optional(),rawEvent:R.any().optional()}).passthrough(),FU=Le.extend({type:R.literal(M.TEXT_MESSAGE_START),messageId:R.string(),role:sE.default("assistant"),name:R.string().optional()}),cE=Le.extend({type:R.literal(M.TEXT_MESSAGE_CONTENT),messageId:R.string(),delta:R.string()}),EU=Le.extend({type:R.literal(M.TEXT_MESSAGE_END),messageId:R.string()}),IU=Le.extend({type:R.literal(M.TEXT_MESSAGE_CHUNK),messageId:R.string().optional(),role:sE.optional(),delta:R.string().optional(),name:R.string().optional()}),TU=Le.extend({type:R.literal(M.THINKING_TEXT_MESSAGE_START)}),PU=cE.omit({messageId:!0,type:!0}).extend({type:R.literal(M.THINKING_TEXT_MESSAGE_CONTENT)}),kU=Le.extend({type:R.literal(M.THINKING_TEXT_MESSAGE_END)}),OU=Le.extend({type:R.literal(M.TOOL_CALL_START),toolCallId:R.string(),toolCallName:R.string(),parentMessageId:R.string().optional()}),NU=Le.extend({type:R.literal(M.TOOL_CALL_ARGS),toolCallId:R.string(),delta:R.string()}),_U=Le.extend({type:R.literal(M.TOOL_CALL_END),toolCallId:R.string()}),DU=Le.extend({messageId:R.string(),type:R.literal(M.TOOL_CALL_RESULT),toolCallId:R.string(),content:R.string(),role:R.literal("tool").optional()}),qU=Le.extend({type:R.literal(M.TOOL_CALL_CHUNK),toolCallId:R.string().optional(),toolCallName:R.string().optional(),parentMessageId:R.string().optional(),delta:R.string().optional()}),MU=Le.extend({type:R.literal(M.THINKING_START),title:R.string().optional()}),jU=Le.extend({type:R.literal(M.THINKING_END)}),VU=Le.extend({type:R.literal(M.STATE_SNAPSHOT),snapshot:pU}),LU=Le.extend({type:R.literal(M.STATE_DELTA),delta:R.array(R.any())}),UU=Le.extend({type:R.literal(M.MESSAGES_SNAPSHOT),messages:R.array(aE)}),QU=Le.extend({type:R.literal(M.ACTIVITY_SNAPSHOT),messageId:R.string(),activityType:R.string(),content:R.record(R.any()),replace:R.boolean().optional().default(!0)}),BU=Le.extend({type:R.literal(M.ACTIVITY_DELTA),messageId:R.string(),activityType:R.string(),patch:R.array(R.any())}),GU=Le.extend({type:R.literal(M.RAW),event:R.any(),source:R.string().optional()}),$U=Le.extend({type:R.literal(M.CUSTOM),name:R.string(),value:R.any()}),HU=Le.extend({type:R.literal(M.RUN_STARTED),threadId:R.string(),runId:R.string(),parentRunId:R.string().optional(),input:dU.optional()}),zU=R.object({type:R.literal("success")}).strict(),WU=R.object({type:R.literal("interrupt"),interrupts:R.array(lU).min(1)}).strict(),KU=R.discriminatedUnion("type",[zU,WU]),YU=Le.extend({type:R.literal(M.RUN_FINISHED),threadId:R.string(),runId:R.string(),result:R.any().optional(),outcome:KU.nullable().optional().transform(e=>e??void 0)}),JU=Le.extend({type:R.literal(M.RUN_ERROR),message:R.string(),code:R.string().optional()}),XU=Le.extend({type:R.literal(M.STEP_STARTED),stepName:R.string()}),ZU=Le.extend({type:R.literal(M.STEP_FINISHED),stepName:R.string()}),eQ=R.union([R.literal("tool-call"),R.literal("message")]),tQ=Le.extend({type:R.literal(M.REASONING_START),messageId:R.string()}),rQ=Le.extend({type:R.literal(M.REASONING_MESSAGE_START),messageId:R.string(),role:R.literal("reasoning")}),nQ=Le.extend({type:R.literal(M.REASONING_MESSAGE_CONTENT),messageId:R.string(),delta:R.string()}),oQ=Le.extend({type:R.literal(M.REASONING_MESSAGE_END),messageId:R.string()}),aQ=Le.extend({type:R.literal(M.REASONING_MESSAGE_CHUNK),messageId:R.string().optional(),delta:R.string().optional()}),iQ=Le.extend({type:R.literal(M.REASONING_END),messageId:R.string()}),sQ=Le.extend({type:R.literal(M.REASONING_ENCRYPTED_VALUE),subtype:eQ,entityId:R.string(),encryptedValue:R.string()}),Bf=R.discriminatedUnion("type",[FU,cE,EU,IU,MU,jU,TU,PU,kU,OU,NU,_U,qU,DU,VU,LU,UU,QU,BU,GU,$U,HU,YU,JU,XU,ZU,tQ,rQ,nQ,oQ,aQ,iQ,sQ]);d();c();u();l();var lA={};wl(lA,{JsonPatchError:()=>at,_areEquals:()=>Tu,applyOperation:()=>ei,applyPatch:()=>Yf,applyReducer:()=>pQ,deepClone:()=>uQ,getValueByPointer:()=>Wf,validate:()=>uE,validator:()=>Kf});d();c();u();l();d();c();u();l();var cQ=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)}}(),lQ=Object.prototype.hasOwnProperty;function $f(e,t){return lQ.call(e,t)}function Hf(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)$f(e,o)&&n.push(o);return n}function Mt(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function zf(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 gn(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Eu(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Gf(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Gf(e[t]))return!0}else if(typeof e=="object"){for(var n=Hf(e),o=n.length,a=0;a<o;a++)if(Gf(e[n[a]]))return!0}}return!1}function lE(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
|
-
`)}var Iu=function(e){cQ(t,e);function t(r,n,o,a,i){var p=this.constructor,f=e.call(this,lE(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=lE(r,{name:n,index:o,operation:a,tree:i}),f}return t}(Error);var at=Iu,uQ=Mt,ec={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=Wf(r,this.path);n&&(n=Mt(n));var o=ei(r,{op:"remove",path:this.from}).removed;return ei(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=Wf(r,this.from);return ei(r,{op:"add",path:this.path,value:Mt(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:Tu(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},dQ={add:function(e,t,r){return zf(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:ec.move,copy:ec.copy,test:ec.test,_get:ec._get};function Wf(e,t){if(t=="")return e;var r={op:"_get",path:t};return ei(e,r),r.value}function ei(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):Kf(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=Wf(e,t.from),t.op==="move"&&(i.removed=e),i;if(t.op==="test"){if(i.test=Tu(e,t.value),i.test===!1)throw new at("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 at("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,t,e);return i}}else{n||(e=Mt(e));var p=t.path||"",f=p.split("/"),m=e,g=1,y=f.length,x=void 0,v=void 0,C=void 0;for(typeof r=="function"?C=r:C=Kf;;){if(v=f[g],v&&v.indexOf("~")!=-1&&(v=Eu(v)),o&&(v=="__proto__"||v=="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[v]===void 0?x=f.slice(0,g).join("/"):g==y-1&&(x=t.path),x!==void 0&&C(t,0,e,x)),g++,Array.isArray(m)){if(v==="-")v=m.length;else{if(r&&!zf(v))throw new at("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);zf(v)&&(v=~~v)}if(g>=y){if(r&&t.op==="add"&&v>m.length)throw new at("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=dQ[t.op].call(t,m,v,e);if(i.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}}else if(g>=y){var i=ec[t.op].call(t,m,v,e);if(i.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}if(m=m[v],r&&g<y&&(!m||typeof m!="object"))throw new at("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",a,t,e)}}}function Yf(e,t,r,n,o){if(n===void 0&&(n=!0),o===void 0&&(o=!0),r&&!Array.isArray(t))throw new at("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=Mt(e));for(var a=new Array(t.length),i=0,p=t.length;i<p;i++)a[i]=ei(e,t[i],r,!0,o,i),e=a[i].newDocument;return a.newDocument=e,a}function pQ(e,t,r){var n=ei(e,t);if(n.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function Kf(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new at("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(ec[e.op]){if(typeof e.path!="string")throw new at("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new at("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 at("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 at("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")&&Gf(e.value))throw new at("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 at("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 at("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=uE([i],r);if(p&&p.name==="OPERATION_PATH_UNRESOLVABLE")throw new at("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new at("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function uE(e,t,r){try{if(!Array.isArray(e))throw new at("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Yf(Mt(t),Mt(e),r||!0);else{r=r||Kf;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(o){if(o instanceof at)return o;throw o}}function Tu(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(!Tu(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],!Tu(e[i],t[i]))return!1;return!0}return e!==e&&t!==t}var fA={};wl(fA,{compare:()=>AQ,generate:()=>uA,observe:()=>vQ,unobserve:()=>SQ});d();c();u();l();var dA=new WeakMap,fQ=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),mQ=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function gQ(e){return dA.get(e)}function hQ(e,t){return e.observers.get(t)}function yQ(e,t){e.observers.delete(t.callback)}function SQ(e,t){t.unobserve()}function vQ(e,t){var r=[],n,o=gQ(e);if(!o)o=new fQ(e),dA.set(e,o);else{var a=hQ(o,t);n=a&&a.observer}if(n)return n;if(n={},o.value=Mt(e),t){n.callback=t,n.next=null;var i=function(){uA(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(){uA(n),clearTimeout(n.next),yQ(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 mQ(t,n)),n}function uA(e,t){t===void 0&&(t=!1);var r=dA.get(e.object);pA(r.value,e.object,e.patches,"",t),e.patches.length&&Yf(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function pA(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var a=Hf(t),i=Hf(e),p=!1,f=!1,m=i.length-1;m>=0;m--){var g=i[m],y=e[g];if($f(t,g)&&!(t[g]===void 0&&y!==void 0&&Array.isArray(t)===!1)){var x=t[g];typeof y=="object"&&y!=null&&typeof x=="object"&&x!=null&&Array.isArray(y)===Array.isArray(x)?pA(y,x,r,n+"/"+gn(g),o):y!==x&&(p=!0,o&&r.push({op:"test",path:n+"/"+gn(g),value:Mt(y)}),r.push({op:"replace",path:n+"/"+gn(g),value:Mt(x)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+gn(g),value:Mt(y)}),r.push({op:"remove",path:n+"/"+gn(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];!$f(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+gn(g),value:Mt(t[g])})}}}function AQ(e,t,r){r===void 0&&(r=!1);var n=[];return pA(e,t,n,"",r),n}var Jf=Object.assign({},lA,fA,{JsonPatchError:Iu,deepClone:Mt,escapePathComponent:gn,unescapePathComponent:Eu});d();c();u();l();d();c();u();l();d();c();u();l();d();c();u();l();var mA=function(e,t){return mA=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])},mA(e,t)};function hn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");mA(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function dE(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(y){i(y)}}function f(g){try{m(n.throw(g))}catch(y){i(y)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}function Xf(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 no(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 tc(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 rc(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 ti(e){return this instanceof ti?(this.v=e,this):new ti(e)}function pE(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(v){return function(C){return Promise.resolve(C).then(v,y)}}function p(v,C){n[v]&&(o[v]=function(b){return new Promise(function(w,F){a.push([v,b,w,F])>1||f(v,b)})},C&&(o[v]=C(o[v])))}function f(v,C){try{m(n[v](C))}catch(b){x(a[0][3],b)}}function m(v){v.value instanceof ti?Promise.resolve(v.value.v).then(g,y):x(a[0][2],v)}function g(v){f("next",v)}function y(v){f("throw",v)}function x(v,C){v(C),a.shift(),a.length&&f(a[0][0],a[0][1])}}function fE(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 no=="function"?no(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();u();l();function _e(e){return typeof e=="function"}d();c();u();l();d();c();u();l();d();c();u();l();function nc(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 Zf=nc(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
32
|
+
`;function oM(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var aM=["1",1,"yes",!0];function iM(){let e=[];return MS()&&e.push(window.doNotTrack),YS()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>aM.indexOf(t)!==-1)}function up(e){return e===!0?!1:iM()}var hw="v15",yw={default:"https://analytics.cloud.coveo.com/rest/ua"};function sM(e=yw.default,t=hw,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 cM="38824e1f-37f5-42d3-8372-a4b8fa9df946",en=class{get defaultOptions(){return{endpoint:yw.default,isCustomEndpoint:!1,token:"",version:hw,beforeSendHooks:[],afterSendHooks:[]}}get version(){return pw}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=[JD,HD].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};up(this.options.disableBrowserPrivacySignals)?this.runtime=new cp:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(_e.view,{newEventType:_e.view,addClientIdParameter:!0}),this.addEventTypeMapping(_e.click,{newEventType:_e.click,addClientIdParameter:!0}),this.addEventTypeMapping(_e.custom,{newEventType:_e.custom,addClientIdParameter:!0}),this.addEventTypeMapping(_e.search,{newEventType:_e.search,addClientIdParameter:!0})}initRuntime(t){return MS()&&zi()?new WS(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(oM()&&console.warn(nM),new KS(t))}get storage(){return this.runtime.storage}determineVisitorId(){return B(this,void 0,void 0,function*(){try{return MS()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Aa()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Aa()}})}getCurrentVisitorId(){return B(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return B(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return B(this,void 0,void 0,function*(){if(np(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(op(t,op(r,cM)))}})}getParameters(t,...r){return B(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return B(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(Aa()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(up(this.options.disableBrowserPrivacySignals))return null;try{let r=new URL(t).searchParams.get(Co.cvo_cid);if(r==null)return null;let n=Co.fromString(r);return!n||!zi()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return B(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=>B(this,void 0,void 0,function*(){return Object.assign(Object.assign({},h),{visitorId:o?yield this.getCurrentVisitorId():""})}),h=>B(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((C,b)=>B(this,void 0,void 0,function*(){let w=yield C;return yield b(t,w)}),h)].reduce((h,C)=>B(this,void 0,void 0,function*(){let b=yield h;return yield C(b)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return B(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[S=>this.setTrackingIdIfTrackingIdNotPresent(S),S=>this.removeEmptyPayloadValues(S,t),S=>this.validateParams(S,t),S=>n?zq(S):S,S=>n?this.removeUnknownParameters(S):S,S=>n?this.processCustomParameters(S):this.mapCustomParametersToCustomData(S)].reduce((S,x)=>B(this,void 0,void 0,function*(){let h=yield S;return yield x(h)}),Promise.resolve(r))})}makeEvent(t,...r){return B(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=>B(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 B(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return B(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 rp().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return B(this,void 0,void 0,function*(){return this.makeEvent(_e.search,t)})}sendSearchEvent(t){return B(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Kn(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return B(this,void 0,void 0,function*(){return this.makeEvent(_e.click,t)})}sendClickEvent(t){return B(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Kn(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return B(this,void 0,void 0,function*(){return this.makeEvent(_e.custom,t)})}sendCustomEvent(t){return B(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=Kn(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return B(this,void 0,void 0,function*(){return this.makeEvent(_e.view,t)})}sendViewEvent(t){return B(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return B(this,void 0,void 0,function*(){let r=yield(yield v(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return B(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({[_e.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(Jq(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=Kn(t,["custom"]),o={};r&&tp(r)&&(o=this.lowercaseKeys(r));let a=Xq(n);return Object.assign(Object.assign({},o),a)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=Kn(t,["custom"]);if(r&&tp(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=Kn(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==_e.view||r==_e.click||r==_e.search||r==_e.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==_e.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=Kn(t,["userId"]);return rM(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=Kn(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&tp(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&tp(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"?lq(t,r):t}get baseUrl(){return sM(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},Yn;(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"})(Yn||(Yn={}));var $;(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"})($||($={}));var iw={[$.triggerNotify]:"queryPipelineTriggers",[$.triggerExecute]:"queryPipelineTriggers",[$.triggerQuery]:"queryPipelineTriggers",[$.triggerRedirect]:"queryPipelineTriggers",[$.queryErrorBack]:"errors",[$.queryErrorClear]:"errors",[$.queryErrorRetry]:"errors",[$.pagerNext]:"getMoreResults",[$.pagerPrevious]:"getMoreResults",[$.pagerNumber]:"getMoreResults",[$.pagerResize]:"getMoreResults",[$.pagerScrolling]:"getMoreResults",[$.facetSearch]:"facet",[$.facetShowLess]:"facet",[$.facetShowMore]:"facet",[$.recommendation]:"recommendation",[$.likeSmartSnippet]:"smartSnippet",[$.dislikeSmartSnippet]:"smartSnippet",[$.expandSmartSnippet]:"smartSnippet",[$.collapseSmartSnippet]:"smartSnippet",[$.openSmartSnippetFeedbackModal]:"smartSnippet",[$.closeSmartSnippetFeedbackModal]:"smartSnippet",[$.sendSmartSnippetReason]:"smartSnippet",[$.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.clearRecentQueries]:"recentQueries",[$.recentResultClick]:"recentlyClickedDocuments",[$.clearRecentResults]:"recentlyClickedDocuments",[$.showLessFoldedResults]:"folding",[$.caseDetach]:"case",[$.likeGeneratedAnswer]:"generatedAnswer",[$.dislikeGeneratedAnswer]:"generatedAnswer",[$.openGeneratedAnswerSource]:"generatedAnswer",[$.generatedAnswerOpenInlineLink]:"generatedAnswer",[$.generatedAnswerFollowupOpenSource]:"generatedAnswer",[$.generatedAnswerStreamEnd]:"generatedAnswer",[$.generatedAnswerSourceHover]:"generatedAnswer",[$.generatedAnswerCopyToClipboard]:"generatedAnswer",[$.generatedAnswerHideAnswers]:"generatedAnswer",[$.generatedAnswerShowAnswers]:"generatedAnswer",[$.generatedAnswerExpand]:"generatedAnswer",[$.generatedAnswerCollapse]:"generatedAnswer",[$.generatedAnswerFeedbackSubmit]:"generatedAnswer",[$.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[Yn.expandToFullUI]:"interface",[Yn.openUserActions]:"User Actions",[Yn.showPrecedingSessions]:"User Actions",[Yn.showFollowingSessions]:"User Actions",[Yn.clickViewedDocument]:"User Actions",[Yn.clickPageView]:"User Actions",[Yn.createArticle]:"createArticle"},Yi=class{constructor(){this.runtime=new cp,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(_e.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(_e.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(_e.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(_e.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return pw}};function uM(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function lM(e){return e.map(t=>t.replace(/;/g,""))}function Sw(e){let r=e.join(";");return r.length<=256?r:Sw(e.slice(1))}var sw=e=>{let t=lM(e),r=uM(t);return Sw(r)};function cw(e){let t=typeof e.partialQueries=="string"?e.partialQueries:sw(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:sw(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var lp=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||up(t.disableBrowserPrivacySignals);this.coveoAnalyticsClient=n?new Yi:new en(t)}disable(){this.coveoAnalyticsClient=new Yi}enable(){this.coveoAnalyticsClient=new en(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent($.interfaceLoad)}logInterfaceLoad(){return B(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent($.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return B(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent($.recommendation)}logRecommendation(){return B(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent($.recommendationOpen,t,r)}logRecommendationOpen(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent($.staticFilterClearAll,t)}logStaticFilterClearAll(t){return B(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent($.staticFilterSelect,t)}logStaticFilterSelect(t){return B(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent($.staticFilterDeselect,t)}logStaticFilterDeselect(t){return B(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent($.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return B(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent($.interfaceChange,t)}logInterfaceChange(t){return B(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent($.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return B(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent($.didyoumeanClick)}logDidYouMeanClick(){return B(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent($.resultsSort,t)}logResultsSort(t){return B(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent($.searchboxSubmit)}logSearchboxSubmit(){return B(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent($.searchboxClear)}logSearchboxClear(){return B(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent($.searchboxAsYouType)}logSearchboxAsYouType(){return B(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent($.breadcrumbFacet,t)}logBreadcrumbFacet(t){return B(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent($.breadcrumbResetAll)}logBreadcrumbResetAll(){return B(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent($.documentQuickview,t,r)}logDocumentQuickview(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent($.documentOpen,t,r)}logDocumentOpen(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent($.omniboxAnalytics,cw(t))}logOmniboxAnalytics(t){return B(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent($.omniboxFromLink,cw(t))}logOmniboxFromLink(t){return B(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent($.searchFromLink)}logSearchFromLink(){return B(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent($.triggerNotify,t)}logTriggerNotify(t){return B(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent($.triggerExecute,t)}logTriggerExecute(t){return B(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent($.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return B(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent($.undoTriggerQuery,t)}logUndoTriggerQuery(t){return B(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent($.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return B(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent($.pagerResize,t)}logPagerResize(t){return B(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent($.pagerNumber,t)}logPagerNumber(t){return B(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent($.pagerNext,t)}logPagerNext(t){return B(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent($.pagerPrevious,t)}logPagerPrevious(t){return B(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent($.pagerScrolling)}logPagerScrolling(){return B(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent($.facetClearAll,t)}logFacetClearAll(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent($.facetSearch,t)}logFacetSearch(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent($.facetSelect,t)}logFacetSelect(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent($.facetDeselect,t)}logFacetDeselect(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent($.facetExclude,t)}logFacetExclude(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent($.facetUnexclude,t)}logFacetUnexclude(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent($.facetSelectAll,t)}logFacetSelectAll(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent($.facetUpdateSort,t)}logFacetUpdateSort(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent($.facetShowMore,t)}logFacetShowMore(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent($.facetShowLess,t)}logFacetShowLess(t){return B(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent($.queryError,t)}logQueryError(t){return B(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return B(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorBack);return{description:t.description,log:()=>B(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorBack)})}})}logQueryErrorBack(){return B(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return B(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorRetry);return{description:t.description,log:()=>B(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorRetry)})}})}logQueryErrorRetry(){return B(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return B(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorClear);return{description:t.description,log:()=>B(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorClear)})}})}logQueryErrorClear(){return B(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent($.likeSmartSnippet)}logLikeSmartSnippet(){return B(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent($.dislikeSmartSnippet)}logDislikeSmartSnippet(){return B(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent($.expandSmartSnippet)}logExpandSmartSnippet(){return B(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent($.collapseSmartSnippet)}logCollapseSmartSnippet(){return B(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent($.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return B(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent($.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return B(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent($.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent($.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return B(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent($.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return B(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent($.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return B(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent($.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return B(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent($.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent($.copyToClipboard,t,r)}logCopyToClipboard(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent($.recentQueryClick)}logRecentQueryClick(){return B(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent($.clearRecentQueries)}logClearRecentQueries(){return B(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent($.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent($.clearRecentResults)}logClearRecentResults(){return B(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent($.noResultsBack)}logNoResultsBack(){return B(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent($.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent($.showLessFoldedResults)}logShowLessFoldedResults(){return B(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 B(this,arguments,void 0,function*(n,o,a=iw[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 B(this,arguments,void 0,function*(n,o,a=iw[n]){return(yield this.makeCustomEvent(n,o,a)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return B(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 B(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return B(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 B(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 B(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return B(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 B(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 en?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($.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return B(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent($.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return B(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent($.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return B(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerOpenInlineLink(t){return this.makeCustomEvent($.generatedAnswerOpenInlineLink,t)}logGeneratedAnswerOpenInlineLink(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerOpenInlineLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent($.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFollowupOpenSource(t){return this.makeCustomEvent($.generatedAnswerFollowupOpenSource,t)}logGeneratedAnswerFollowupOpenSource(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFollowupOpenSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent($.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent($.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent($.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent($.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent($.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent($.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent($.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return B(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent($.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return B(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent($.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return B(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},dp=Object.assign({},rl),uw=Object.keys(dp).map(e=>dp[e]),Wi=class extends LS{constructor({client:t,uuidGenerator:r=Aa}){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])=>uw.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(uw.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(dp.pageview,{newEventType:_e.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(dp.event,{newEventType:_e.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 gq(this.ticket)}};Wi.Id="svc";var pp;(function(e){e.click="click",e.flowStart="flowStart"})(pp||(pp={}));var yr;(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"})(yr||(yr={}));var fp;(function(e){e.quit="Quit",e.solved="Solved"})(fp||(fp={}));var mp=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!up(t.disableBrowserPrivacySignals);this.coveoAnalyticsClient=o?new en(t):new Yi,this.svc=new Wi({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Yi,this.svc=new Wi({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new en(this.options),this.svc=new Wi({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(yr.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(yr.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(yr.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(yr.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(yr.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(yr.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(yr.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(yr.caseCancelled,{reason:fp.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(yr.caseSolved,{reason:fp.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(yr.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",pp.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",pp.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return B(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 en?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 B(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)})}};d();c();l();u();d();c();l();u();var xo=()=>"default";var dM=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},Ca=class{constructor(t){me(this,"getState",t);me(this,"state");this.state=t()}getLanguage(){return dM(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=Ao),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||xo()}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 vw=e=>new en(e).getCurrentVisitorId(),al=(e,t)=>typeof t=="function"?(...r)=>{let n=Ou(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,il=(e,t)=>(...r)=>{let n=Ou(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};var sl=class extends Ca{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},Aw=({logger:e,getState:t,analyticsClientMiddleware:r=(i,p)=>p,preprocessRequest:n,provider:o=new sl(t),disableBrowserPrivacySignals:a})=>{let i=t(),p=i.configuration.accessToken,f=i.configuration.analytics.apiBaseUrl??gr(i.configuration.organizationId,i.configuration.environment,"analytics"),m=i.configuration.analytics.runtimeEnvironment,g=i.configuration.analytics.enabled,S=new mp({enableAnalytics:g,token:p,endpoint:f,runtimeEnvironment:m,disableBrowserPrivacySignals:a,preprocessRequest:al(e,n),beforeSendHooks:[il(e,r),(x,h)=>(e.info({...h,type:x,endpoint:f,token:p},"Analytics request"),h)]},o);return g||S.disable(),S};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Ji(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();function pM(e,t){return!!t&&t.facetId in e.facetSet}var Ur=(e,t)=>e.search?.response.facets.find(r=>r.facetId===t),gp=(e,t)=>e.facetSet[t]?.request,Xi=(e,t)=>{let r=Ur(e,t);return pM(e,r)?r:void 0},Cw=(e,t)=>Xi(e,t)?.values.filter(r=>r.state==="selected")||[],xw=(e,t)=>Xi(e,t)?.values.filter(r=>r.state!=="idle")||[],tn=e=>e.search.isLoading;d();c();l();u();function bw(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 cr(e){let{activeValue:t,ancestryMap:r}=fM(e);return t?mM(t,r):[]}function fM(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 mM(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}function gM(e,t){return!!t&&t.facetId in e.categoryFacetSet}var ZS=(e,t)=>{let r=Ur(e,t);if(gM(e,r))return r},ev=(e,t)=>e.categoryFacetSet[t]?.request,ww=(e,t)=>{let r=ZS(e,t);return cr(r?.values??[])},tv=(e,t)=>{let r=ev(e,t);return cr(r?.currentValues??[])};d();c();l();u();function Zi(){return{}}d();c();l();u();function Rw(e,t){return{request:e,tabs:t}}function es(){return{}}d();c();l();u();function Fw(e,t){return{request:e,tabs:t}}function ts(){return{}}d();c();l();u();function Ew(e,t){return{request:e,hasBreadcrumbs:!0,tabs:t}}function rs(){return{}}var ns=(e,t)=>{let r=kw(t,e),n=r?r.field:"",o=nv(n,e);return{facetId:e,facetField:n,facetTitle:o}};function os(e,t){let{facetId:r,facetValue:n}=e,o=ns(r,t),a=Ow(t,r);return{...o,facetValue:a==="hierarchical"?Pw(t,r):n}}function ur(e){return{facetSet:e.facetSet??rs(),categoryFacetSet:e.categoryFacetSet??Zi(),dateFacetSet:e.dateFacetSet??es(),numericFacetSet:e.numericFacetSet??ts(),automaticFacetSet:e.automaticFacetSet??Ji()}}var rv=e=>{let t=[];return SM(e).forEach((r,n)=>{let o=Ow(e,r.facetId),a=bM(r,n+1);if(yM(r)){if(!!!tv(e,r.facetId).length)return;t.push({...a,...CM(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((i,p)=>{if(i.state==="idle")return;let f=Iw(i,p+1,o),m=hM(r)?Tw(i):AM(i);t.push({...a,...f,...m})})}),vM(e).forEach((r,n)=>{let o=xM(r,n+1);r.values.forEach((a,i)=>{if(a.state==="idle")return;let p=Iw(a,i+1,"specific"),f=Tw(a);t.push({...o,...p,...f})})}),t},hM=e=>e.type==="specific",yM=e=>e.type==="hierarchical",SM=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),vM=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Iw=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),AM=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),Tw=e=>({displayValue:e.value,value:e.value}),Pw=(e,t)=>tv(e,t).map(n=>n.value).join(";"),CM=(e,t)=>{let n=Pw(e,t);return{value:n,valuePosition:1,displayValue:n}},xM=(e,t)=>({title:nv(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),bM=(e,t)=>({title:nv(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),nv=(e,t)=>`${e}_${t}`,kw=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,Ow=(e,t)=>{let r=kw(e,t);return r?r.type:"specific"};d();c();l();u();d();c();l();u();var ov=e=>e.configuration.search.locale,_w=e=>e.configuration.search.timezone,hp=e=>e.configuration.accessToken,yp=e=>e.configuration.organizationId,Sp=e=>e.configuration.environment,vp=e=>e.configuration?.knowledge?.agentId,Nw=e=>e.configuration.knowledge.debugAgentSession;var Ue=e=>{if(wM(e)||av(e))return e.generatedAnswer?.answerId;if(RM(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},wM=e=>"answer"in e&&"generatedAnswer"in e&&!pe(e.generatedAnswer?.answerConfigurationId),av=e=>{let t=vp(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},RM=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",iv=e=>e.generatedAnswer?.fieldsToIncludeInCitations,bo=e=>e.followUpAnswers?.conversationId,FM=e=>e.generatedAnswer?.citations,EM=e=>e.followUpAnswers?.followUpAnswers,IM=tt(EM,e=>e?.flatMap(t=>t.citations)),TM=(e,t)=>t,as=tt(FM,IM,TM,(e,t,r)=>e?.find(n=>n.id===r)??t?.find(n=>n.id===r));d();c();l();u();var dt=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();d();c();l();u();var cl=(r=>(r.Ascending="ascending",r.Descending="descending",r))(cl||{}),xa=(a=>(a.Relevancy="relevancy",a.QRE="qre",a.Date="date",a.Field="field",a.NoSort="nosort",a))(xa||{}),rn=e=>{if(Ni(e))return e.map(t=>rn(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""}},is=()=>({by:"relevancy"}),Ap=e=>({by:"date",order:e}),Cp=(e,t)=>({by:"field",order:t,field:e}),xp=()=>({by:"qre"}),bp=()=>({by:"nosort"}),Dw=new X({values:{by:new ku({enum:xa,required:!0}),order:new ku({enum:cl}),field:new L}});function vr(){return rn(is())}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function PM(){return typeof navigator<"u"}function qw(){try{return typeof localStorage<"u"}catch{return!1}}function Mw(){try{return typeof sessionStorage<"u"}catch{return!1}}function Vw(){return PM()&&navigator.cookieEnabled}d();c();l();u();var ss=class e{static set(t,r,n){var o,a,i,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?jw(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],jw(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function jw(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}function Lw(){return qw()?localStorage:Vw()?new wp:Mw()?sessionStorage:new sv}var wp=class e{getItem(t){return ss.get(`${e.prefix}${t}`)}removeItem(t){ss.erase(`${e.prefix}${t}`)}setItem(t,r,n){ss.set(`${e.prefix}${t}`,r,n)}};wp.prefix="coveo_";var sv=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var Rp="__coveo.analytics.history",kM=20,OM=1e3*60,_M=75,Fp=class{constructor(t){this.store=t||Lw()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!=null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(Rp);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(Rp);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(Rp,JSON.stringify(t.slice(0,kM)))}catch{}}clear(){try{this.store.removeItem(Rp)}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,_M)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>OM:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var ba=class ba extends Fp{static getInstance(t){return ba.instance||(ba.instance=new ba(t)),ba.instance}constructor(t){super(t)}};me(ba,"instance",null);var Nt=ba;var ul=class ul extends Ca{constructor(){super(...arguments);me(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 rv(ur(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||ul.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||ir().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||ul.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??vr()}}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||dt().q}get responseTime(){return this.state.search?.duration||ir().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||ir().response.totalCountFiltered}};me(ul,"fallbackPipelineName","default");var wo=ul,Uw=({logger:e,getState:t,analyticsClientMiddleware:r=(i,p)=>p,preprocessRequest:n,provider:o,disableBrowserPrivacySignals:a})=>{let i=t(),p=i.configuration.accessToken,f=i.configuration.analytics.apiBaseUrl??gr(i.configuration.organizationId,i.configuration.environment,"analytics"),m=i.configuration.analytics.runtimeEnvironment,g=i.configuration.analytics.enabled,S=new lp({token:p,endpoint:f,runtimeEnvironment:m,disableBrowserPrivacySignals:a,preprocessRequest:al(e,n),beforeSendHooks:[il(e,r),(x,h)=>(e.info({...h,type:x,endpoint:f,token:p},"Analytics request"),h)]},o);return g||S.disable(),S},cv=()=>{let t=Nt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};d();c();l();u();function Ep(e){let t=Qw(e),r=[e,...t].filter(o=>o.parentResult).map(o=>o.parentResult);return px([e,...t,...r],o=>o.uniqueId)}function Qw(e){return e.childResults?e.childResults.flatMap(t=>[t,...Qw(t)]):[]}d();c();l();u();var nn=()=>"";function Gw(e,t){return{...new wo(t).getBaseMetadata(),actionCause:e,type:e}}function NM(e){return Object.assign(e,{instantlyCallable:!0})}function DM(e,t){let r=a=>{let i=xe(e,a);return NM(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,disableBrowserPrivacySignals:S}=p;return yield(yield t({getState:i,analyticsClientMiddleware:f,preprocessRequest:m,logger:g,disableBrowserPrivacySignals:S})).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,disableBrowserPrivacySignals:m}){let{description:g,log:S}=yield t({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f,disableBrowserPrivacySignals:m});return{description:g,action:r(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(x,{getState:h,extra:C}){return yield S({state:h(),extra:C})});return function(_x22,_x23){return _ref12.apply(this,arguments)}}())}});return function prepare(_x21){return _ref11.apply(this,arguments)}}()}),n}var $w=(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 VM(a)}return n},qM=e=>e.configuration.analytics.analyticsMode==="legacy",MM=e=>e.configuration.analytics.analyticsMode==="next",VM=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:a,providerClass:i})=>(r??(r=p=>new i(p)),DM(e,/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*({getState:p,analyticsClientMiddleware:f,preprocessRequest:m,logger:g,disableBrowserPrivacySignals:S}){let x=[],h={log:function(){var _ref14=_asyncToGenerator(function*({state:I}){for(let E of x)yield E(I)});return function log(_x25){return _ref14.apply(this,arguments)}}()},C=p(),b=a({getState:p,logger:g,analyticsClientMiddleware:f,preprocessRequest:m,disableBrowserPrivacySignals:S,provider:r(p)}),w=yield t(b,p());h.description=w?.description,x.push(/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(I){qM(I)&&(yield jM(w,r,I,g,b.coveoAnalyticsClient))});return function(_x26){return _ref15.apply(this,arguments)}}());let{emit:F}=tl(C);return x.push(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(I){if(MM(I)&&o&&n){let E=n(I);yield zM(F,o,E)}});return function(_x27){return _ref16.apply(this,arguments)}}()),h});return function(_x24){return _ref13.apply(this,arguments)}}()));function jM(_x28,_x29,_x30,_x31,_x32){return _jM.apply(this,arguments)}function _jM(){_jM=_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 _jM.apply(this,arguments)}var LM=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)}}()}),J=$w(e=>Uw({...e,provider:e.provider||new wo(e.getState)}),e=>e,wo),L5=$w(Aw,LM("caseAssist"),sl);var pt=(e,t)=>{let r=a=>a+(t.pagination?.firstResult??0),n=-1,o=t.search?.results;return n=Jw(e,o),n<0&&(n=HM(e,o)),n<0&&(n=0),UM(e,r(n),t)};var Hw=(e,t)=>({sourceName:Ww(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||nn()}),zw=(e,t)=>({sourceName:Ww(e),documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||nn()});function Ww(e){let t=e.source;return pe(t)?"unknown":t}var Kw=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function UM(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:GM(e),...(Bw(e)?{documentCategory:Bw(e)}:{}),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:$M(e),queryPipeline:r.pipeline||nn()}}function Bw(e){return e.raw?.objecttype||void 0}var Ke=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||""}),Yw={urihash:new L,sourcetype:new L,permanentid:new L},Ip={uniqueId:z,raw:new X({values:Yw}),title:z,uri:z,clickUri:z,rankingModifier:new L({required:!1,emptyAllowed:!0})};function QM(e){return Object.assign({},...Object.keys(Yw).map(t=>({[t]:e[t]})))}function BM(e){return Object.assign({},...Object.keys(Ip).map(t=>({[t]:e[t]})),{raw:QM(e.raw)})}function GM(e){let t=e.raw.author;return pe(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function $M(e){let t=e.raw.source;return pe(t)?"unknown":t}var Zt=e=>new ve(Ip).validate(BM(e));function HM(e,t){for(let[r,n]of t.entries()){let o=Ep(n);if(Jw(e,o)!==-1)return r}return-1}function Jw(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function zM(_x34,_x35,_x36){return _zM.apply(this,arguments)}function _zM(){_zM=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _zM.apply(this,arguments)}d();c();l();u();var uv=e=>O(e,{evt:z,type:st}),Xw=e=>J("analytics/generic/search",t=>{uv(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),Zw=e=>J("analytics/generic/click",(t,r)=>(Zt(e.result),uv(e),t.makeClickEvent(e.evt,pt(e.result,r),Ke(e.result),e.meta))),eR=e=>J("analytics/generic/custom",t=>(uv(e),t.makeCustomEventWithType(e.evt,e.type,e.meta))),Tp=()=>J("analytics/interface/load",e=>e.makeInterfaceLoad()),Ro=()=>J("analytics/interface/change",(e,t)=>e.makeInterfaceChange({interfaceChangeTo:t.configuration.analytics.originLevel2})),Pp=()=>J("analytics/interface/searchFromLink",e=>e.makeSearchFromLink()),kp=e=>J("analytics/interface/omniboxFromLink",t=>t.makeOmniboxFromLink(e)),tR=()=>({actionCause:"interfaceLoad"}),cs=()=>({actionCause:"interfaceChange"}),rR=()=>({actionCause:"searchFromLink"}),nR=()=>({actionCause:"omniboxFromLink"});d();c();l();u();var lv=()=>st,oR=()=>z,on=k("configuration/updateBasicConfiguration",e=>O(e,{accessToken:st,environment:new L({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:st})),Ar=k("configuration/updateSearchConfiguration",e=>O(e,{proxyBaseUrl:new L({required:!1,url:!0}),pipeline:new L({required:!1,emptyAllowed:!0}),searchHub:st,timezone:st,locale:st,authenticationProviders:new se({required:!1,each:z})})),WM={enabled:new de({default:!0}),originContext:lv(),originLevel2:lv(),originLevel3:lv(),proxyBaseUrl:new L({required:!1,url:!0}),runtimeEnvironment:new Be,anonymous:new de({default:!1}),deviceId:st,userDisplayName:st,documentLocation:st,trackingId:Bx,analyticsMode:new L({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new X({options:{required:!1},values:Jb.reduce((e,t)=>(e[t]=Qx,e),{})})},Fo=k("configuration/updateAnalyticsConfiguration",e=>O(e,WM)),us=k("configuration/analytics/disable"),ls=k("configuration/analytics/enable"),Op=k("configuration/analytics/originlevel2",e=>O(e,{originLevel2:oR()})),_p=k("configuration/analytics/originlevel3",e=>O(e,{originLevel3:oR()})),Np=k("knowledge/setAgentId",e=>O(e,new L({required:!0})));d();c();l();u();d();c();l();u();d();c();l();u();var Dp={q:new L,enableQuerySyntax:new de,aq:new L,cq:new L,firstResult:new re({min:0}),numberOfResults:new re({min:0}),sortCriteria:new L,f:new X,fExcluded:new X,cf:new X,nf:new X,mnf:new X,df:new X,debug:new de,sf:new X,tab:new L,af:new X};var Me=k("searchParameters/restore",e=>O(e,Dp)),ds=k("searchParameters/restoreTab",e=>O(e,z));d();c();l();u();var Eo=k("debug/enable"),ps=k("debug/disable");d();c();l();u();var Io=()=>!1;var fs=ae(Io(),e=>{e.addCase(Eo,()=>!0).addCase(ps,()=>!1).addCase(Me,(t,r)=>r.payload.debug??t)});d();c();l();u();var qp=e=>{if(e==="yes")return!0;if(e==="no")return!1},KM=()=>J("analytics/generatedAnswer/retry",e=>e.makeRetryGeneratedAnswer());function Mp(e,t){return J({prefix:"analytics/generatedAnswer/openAnswerSource",__legacy__getBuilder:(r,n)=>{let o=t??Ue(n),a=as(n,e);if(!o||!a)return null;let i=bo(n);return r.makeGeneratedAnswerCitationClick(Hw(a,n),{generativeQuestionAnsweringId:o,citationId:a.id,documentId:Kw(a),...(i&&{conversationId:i})})},analyticsType:"Rga.CitationClick",analyticsPayloadBuilder:r=>{let n=as(r,e);return{answerId:t??Ue(r)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:n?.permanentid??"",title:n?.title,url:n?.clickUri}}}})}function YM(e,t,r){return J({prefix:"analytics/generatedAnswer/hoverCitation",__legacy__getBuilder:(n,o)=>{let a=r??Ue(o),i=as(o,e);if(!a||!i)return null;let p=bo(o);return n.makeGeneratedAnswerSourceHover({generativeQuestionAnsweringId:a,permanentId:i.permanentid,citationId:i.id,citationHoverTimeMs:t,...(p&&{conversationId:p})})},analyticsType:"Rga.CitationHover",analyticsPayloadBuilder:n=>{let o=as(n,e);return{answerId:r??Ue(n)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:o?.permanentid??"",title:o?.title,url:o?.clickUri},citationHoverTimeInMs:t}}})}function JM(e,t){return J({prefix:"analytics/generatedAnswer/openInlineLink",__legacy__getBuilder:r=>r.makeGeneratedAnswerOpenInlineLink({generativeQuestionAnsweringId:t,...e})})}function XM(e){return J({prefix:"analytics/generatedAnswer/like",__legacy__getBuilder:(t,r)=>{let n=e??Ue(r);if(!n)return null;let o=bo(r);return t.makeLikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",action:"like"})})}function ZM(e){return J({prefix:"analytics/generatedAnswer/dislike",__legacy__getBuilder:(t,r)=>{let n=e??Ue(r);if(!n)return null;let o=bo(r);return t.makeDislikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",action:"dislike"})})}var eV=e=>J({prefix:"analytics/generatedAnswer/sendFeedback",__legacy__getBuilder:(t,r)=>{let n=Ue(r);return n?t.makeGeneratedAnswerFeedbackSubmitV2({generativeQuestionAnsweringId:n,...e}):null},analyticsType:"Rga.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=Ue(t),{helpful:n,readable:o,documented:a,hallucinationFree:i,correctTopic:p,documentUrl:f,details:m}=e;return{answerId:r??"",helpful:n,details:{readable:qp(o),documented:qp(a),correctTopic:qp(p),hallucinationFree:qp(i)},additionalNotes:m,correctAnswerUrl:f}}}),ll=(e,t,r)=>J({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(n,o)=>{let a=t??Ue(o);if(!a)return null;let i=bo(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})}),To=e=>J({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",responseId:t.search?.searchResponseId||t.search?.response.searchUid||""})}),tV=()=>J({prefix:"analytics/generatedAnswer/show",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerShowAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"show"})}),rV=()=>J({prefix:"analytics/generatedAnswer/hide",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerHideAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"hide"})}),nV=()=>J({prefix:"analytics/generatedAnswer/expand",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerExpand({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"expand"})}),oV=()=>J({prefix:"analytics/generatedAnswer/collapse",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerCollapse({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"collapse"})});function aV(e){return J({prefix:"analytics/generatedAnswer/copy",__legacy__getBuilder:(t,r)=>{let n=e??Ue(r);if(!n)return null;let o=bo(r);return t.makeGeneratedAnswerCopyToClipboard({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",action:"copyToClipboard"})})}function dv(e,t){return J({prefix:"analytics/generatedAnswer/openFollowUpAnswerSource",__legacy__getBuilder:(r,n)=>{let o=as(n,e);if(!o)return null;let a=bo(n);return a?r.makeGeneratedAnswerFollowupOpenSource({...zw(o,n),generativeQuestionAnsweringId:t,citationId:o.id,permanentId:o.permanentid,conversationId:a}):null}})}var Cr={logCopyGeneratedAnswer:aV,logGeneratedAnswerHideAnswers:rV,logGeneratedAnswerShowAnswers:tV,logGeneratedAnswerStreamEnd:ll,logGeneratedAnswerFeedback:eV,logDislikeGeneratedAnswer:ZM,logLikeGeneratedAnswer:XM,logGeneratedAnswerOpenInlineLink:JM,logHoverCitation:YM,logOpenGeneratedAnswerSource:Mp,logOpenGeneratedAnswerFollowUpSource:dv,logRetryGeneratedAnswer:KM,logGeneratedAnswerExpand:nV,logGeneratedAnswerCollapse:oV};d();c();l();u();d();c();l();u();var pv=k("history/undo"),fv=k("history/redo"),lr=k("history/snapshot"),dl=xe("history/back",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,{dispatch:t}){t(pv()),yield t(qe())});return function(_x37,_x38){return _ref18.apply(this,arguments)}}()),Vp=xe("history/forward",/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,{dispatch:t}){t(fv()),yield t(qe())});return function(_x39,_x40){return _ref19.apply(this,arguments)}}()),qe=xe("history/change",/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x41,_x42){return _ref20.apply(this,arguments)}}());d();c();l();u();var ms=k("pipeline/set",e=>O(e,new L({required:!0,emptyAllowed:!0})));var gs=ae(nn(),e=>{e.addCase(ms,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Ar,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var ft=k("breadcrumb/deselectAll"),hs=k("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var an=k("facet/updateFacetAutoSelection",e=>O(e,{allow:new de({required:!0})}));d();c();l();u();d();c();l();u();var pl=class extends wo{constructor(r){super(r);me(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??dt().q}get responseTime(){return this.activeInstantResultCache?.duration??ir().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??ir().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var aR=e=>J({prefix:"analytics/instantResult/open",__legacy__getBuilder:(t,r)=>(Zt(e),t.makeDocumentOpen(pt(e,r),Ke(e))),__legacy__provider:t=>new pl(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=pt(e,t),n=Ke(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}}),iR=()=>J("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new pl(e)),sR=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var mv={id:z},iV={...mv,q:Ge},ys=k("instantResults/register",e=>O(e,mv)),sn=k("instantResults/updateQuery",e=>O(e,iV)),Ss=k("instantResults/clearExpired",e=>O(e,mv));d();c();l();u();var jp=new re({required:!0,min:0}),vs=k("pagination/registerNumberOfResults",e=>O(e,jp)),As=k("pagination/updateNumberOfResults",e=>O(e,jp)),Cs=k("pagination/registerPage",e=>O(e,jp)),cn=k("pagination/updatePage",e=>O(e,jp)),xs=k("pagination/nextPage"),bs=k("pagination/previousPage");d();c();l();u();var Lt=k("query/updateQuery",e=>O(e,{q:new L,enableQuerySyntax:new de}));d();c();l();u();d();c();l();u();var Qr=(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:Hi(e)}});var ws=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??vt(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&&Qr(e.configuration.analytics,t,r)),...(e.excerptLength&&!pe(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();d();c();l();u();var Rs=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield vw(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}),...(cv()&&{pageId:cv()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:Hi(e)})}}});return function Rs(_x43,_x44){return _ref21.apply(this,arguments)}}();var Po=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??vt(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:Nt.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 Rs(e.configuration.analytics,t))),...(e.excerptLength&&!pe(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Po(_x45,_x46){return _ref22.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var Br=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var gv=()=>J("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),ko=e=>J("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||dt().q,aq:r.advancedSearchQueries?.aq||Br().aq,cq:r.advancedSearchQueries?.cq||Br().cq,dq:r.advancedSearchQueries?.dq||Br().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var ml=jr(Lp(),1),pR=jr(cR(),1);d();c();l();u();var Up=jr(Lp(),1),lR=jr(uR(),1);Up.default.extend(lR.default);var Fs="YYYY/MM/DD@HH:mm:ss",sV="1401-01-01";function wa(e,t){let r=(0,Up.default)(e,t);return!r.isValid()&&!t?(0,Up.default)(e,Fs):r}function fl(e){return e.format(Fs)}function dR(e){return fl(wa(e))===e}function Qp(e,t){let r=wa(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}xv(r)}function xv(e){if(e.isBefore(sV))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}ml.default.extend(pR.default);var fR=["past","now","next"],mR=["minute","hour","day","week","month","quarter","year"],cV=e=>{let t=e==="now";return{amount:new re({required:!t,min:1}),unit:new L({required:!t,constrainTo:mR}),period:new L({required:!0,constrainTo:fR})}};function Oo(e){if(typeof e=="string"&&!un(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?bv(e):e;new ve(cV(t.period)).validate(t);let r=hR(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);xv(r)}function gR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function hR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,ml.default)().subtract(r,n);case"next":return(0,ml.default)().add(r,n);case"now":return(0,ml.default)()}}function gl(e){return fl(hR(bv(e)))}function yR(e){return e.toLocaleLowerCase().split("-")}function un(e){let[t,r,n]=yR(e);if(t==="now")return!0;if(!fR.includes(t)||!mR.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function SR(e){return!!e&&typeof e=="object"&&"period"in e}function bv(e){let[t,r,n]=yR(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}function vR(e){return Oo(e),bv(e)}d();c();l();u();function AR(e){return e.type==="dateRange"}function CR(e){return`start${e}`}function xR(e){return`end${e}`}var wv=()=>({dateFacetValueMap:{}});function uV(e,t,r){let n=e.start,o=e.end;return un(n)&&(n=gl(n),r.dateFacetValueMap[t][CR(n)]=e.start),un(o)&&(o=gl(o),r.dateFacetValueMap[t][xR(o)]=e.end),{...e,start:n,end:o}}function Rv(e,t){if(AR(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>uV(o,r,t))}}return e}function _o(e){let t=wv();return{request:{...e,facets:e.facets?.map(n=>Rv(n,t))},mappings:t}}function lV(e,t,r){return{...e,start:r.dateFacetValueMap[t][CR(e.start)]||e.start,end:r.dateFacetValueMap[t][xR(e.end)]||e.end}}function dV(e,t){return e.facetId in t.dateFacetValueMap}function pV(e,t){return dV(e,t)?{...e,values:e.values.map(r=>lV(r,e.facetId,t))}:e}function Bp(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>pV(n,t))}}:e}d();c();l();u();d();c();l();u();var Es=k("didYouMean/enable"),Gp=k("didYouMean/disable"),Is=k("didYouMean/automaticCorrections/disable"),$p=k("didYouMean/automaticCorrections/enable"),xr=k("didYouMean/correction",e=>O(e,z)),Ra=k("didYouMean/automaticCorrections/mode",e=>O(e,new L({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var Hp=()=>J("analytics/didyoumean/click",e=>e.makeDidYouMeanClick()),Fv=()=>J("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic()),bR=()=>({actionCause:"didYouMeanClick"}),wR=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function zp(){return{contextValues:{}}}d();c();l();u();function Wp(){return{contextValues:{}}}d();c();l();u();function Ev(){return{enabled:!0,tabs:{}}}function Kp(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function Yp(){return[]}d();c();l();u();function br(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function Jp(){return{}}d();c();l();u();function Xp(){return{}}d();c();l();u();function Zp(){return{}}function RR(){return Gr({})}function Gr(e){return{context:e.context||zp(),dictionaryFieldContext:e.dictionaryFieldContext||Wp(),facetSet:e.facetSet||rs(),numericFacetSet:e.numericFacetSet||ts(),dateFacetSet:e.dateFacetSet||es(),categoryFacetSet:e.categoryFacetSet||Zi(),automaticFacetSet:e.automaticFacetSet??Ji(),pagination:e.pagination||br(),query:e.query||dt(),tabSet:e.tabSet||Zp(),advancedSearchQueries:e.advancedSearchQueries||Br(),staticFilterSet:e.staticFilterSet||Xp(),querySet:e.querySet||Jp(),sortCriteria:e.sortCriteria||vr(),pipeline:e.pipeline||nn(),searchHub:e.searchHub||xo(),facetOptions:e.facetOptions||Kp(),facetOrder:e.facetOrder??Yp(),debug:e.debug??Io()}}d();c();l();u();var fV=new X({values:{undoneQuery:Ge},options:{required:!0}}),ef=()=>J("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null),tf=e=>J("analytics/trigger/query/undo",t=>(O(e,fV),t.makeUndoTriggerQuery(e))),rf=()=>J("analytics/trigger/notify",(e,t)=>t.triggers?.notifications.length?e.makeTriggerNotify({notifications:t.triggers.notifications}):null),nf=()=>J("analytics/trigger/redirect",(e,t)=>t.triggers?.redirectTo?e.makeTriggerRedirect({redirectedTo:t.triggers.redirectTo}):null),of=()=>J("analytics/trigger/execute",(e,t)=>t.triggers?.executions.length?e.makeTriggerExecute({executions:t.triggers.executions}):null);d();c();l();u();var No=k("trigger/query/ignore",e=>O(e,new L({emptyAllowed:!0,required:!0}))),Ts=k("trigger/query/modification",e=>O(e,new X({values:{originalQuery:st,modification:st}})));d();c();l();u();d();c();l();u();d();c();l();u();function Do(e){return Object.values(e).map(t=>t.request)}function hl(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 FR(e){return Do(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var Iv={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function mV(e){return Do(e).map(t=>{let r=Iv[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function gV(e){return[...mV(e.facetSet??{}),...FR(e.numericFacetSet??{}),...FR(e.dateFacetSet??{}),...Do(e.categoryFacetSet??{})]}function hV(e){return gV(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function af(e){return hl(hV(e),e.facetOrder??[])}d();c();l();u();var qo=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t){let r=vV(e),n=af(e),o=yV(e),a=yield Po(e,t),i=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return _o({...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 qo(_x47,_x48){return _ref23.apply(this,arguments)}}();function yV(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(SV).filter(r=>r.currentValues.length>0):void 0}function SV(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function vV(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=AV(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}function AV(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 Mo=class{constructor(t,r=n=>{this.dispatch(Lt({q:n}))}){me(this,"config",t);me(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x49,_x50){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=Bp(yield _this10.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this10.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return At(t.response)?(this.dispatch(ko(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery: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=!pe(f)&&!pe(f.correctedQuery);if(!m&&!g)return null;let x=m?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(lr(Gr(_this12.getState()))),x})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this13.automaticallyRetryQueryWithCorrection(o);return At(a.response)?(_this13.dispatch(ko(a.response.error)),_this13.rejectWithValue(a.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(lr(Gr(_this13.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:Fv()})})()}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:Fv()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(No("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let a=_this14.getCurrentQuery(),i=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return At(i.response)?(_this14.dispatch(ko(i.response.error)),_this14.rejectWithValue(i.response.error)):(_this14.dispatch(lr(Gr(_this14.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a,analyticsAction:ef()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??dt().enableQuerySyntax},search:{...ir(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(lr(Gr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return Id(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield qo(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(xr(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(Ts({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield qo(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var ER=xe("search/executeSearch",/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=t.getState();return yield sf(r,t,e)});return function(_x51,_x52){return _ref24.apply(this,arguments)}}()),IR=xe("search/fetchPage",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Pv(r,t,e)});return function(_x53,_x54){return _ref25.apply(this,arguments)}}()),TR=xe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=t.getState();return yield kv(t,r)});return function(_x55,_x56){return _ref26.apply(this,arguments)}}()),PR=xe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){let r=t.getState();return yield wV(t,e,r)});return function(_x57,_x58){return _ref27.apply(this,arguments)}}()),kR=xe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){return Tv(e,t)});return function(_x59,_x60){return _ref28.apply(this,arguments)}}()),CV=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=yield qo(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function CV(_x61,_x62){return _ref29.apply(this,arguments)}}(),xV=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t,r){let n=yield Po(e);return _o({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function xV(_x63,_x64,_x65){return _ref30.apply(this,arguments)}}(),bV=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=yield qo(e,t);return r.request.numberOfResults=0,r});return function bV(_x66,_x67){return _ref31.apply(this,arguments)}}(),OR=e=>{e.configuration.analytics.enabled&&Nt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Tv(_x68,_x69){return _Tv.apply(this,arguments)}function _Tv(){_Tv=_asyncToGenerator(function*(e,t){O(e,{id:z,q:z,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),a=new Mo({...t,analyticsAction:iR()},m=>{t.dispatch(sn({q:m,id:e.id}))}),i=yield xV(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 _Tv.apply(this,arguments)}function Pv(_x70,_x71,_x72){return _Pv.apply(this,arguments)}function _Pv(){_Pv=_asyncToGenerator(function*(e,t,r){OR(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 Mo({...t,analyticsAction:r}),f=yield qo(e,i),m=yield p.fetchFromAPI(f,{origin:"mainSearch"});return yield p.process(m)});return _Pv.apply(this,arguments)}function kv(_x73,_x74){return _kv.apply(this,arguments)}function _kv(){_kv=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:a}=yield gv().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),i=new Mo({...e,analyticsAction:gv()}),p=yield CV(t,a),f=yield i.fetchFromAPI(p,{origin:"mainSearch"});return yield i.process(f)});return _kv.apply(this,arguments)}function wV(_x75,_x76,_x77){return _wV.apply(this,arguments)}function _wV(){_wV=_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 Mo({...e,analyticsAction:t}),f=yield bV(r,i),m=yield p.fetchFromAPI(f,{origin:"facetValues"});return yield p.process(m)});return _wV.apply(this,arguments)}function sf(_x78,_x79,_x80){return _sf.apply(this,arguments)}function _sf(){_sf=_asyncToGenerator(function*(e,t,r){OR(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 qo(e,i),f=new Mo({...t,analyticsAction:r}),m=yield f.fetchFromAPI(p,{origin:"mainSearch"});return yield f.process(m)});return _sf.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var _R=tt(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 wr=/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t,r){let n=_v(e),o=RV(e),a=FV(e),i=e.configuration.analytics.analyticsMode==="legacy"?yield Po(e,r):ws(e,t,r);return _o({...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:Ov(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 wr(_x81,_x82,_x83){return _ref32.apply(this,arguments)}}();function Ov(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function RV(e){return hl(IV(e),e.facetOrder??[])}function FV(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(EV).filter(r=>r.currentValues.length>0):void 0}function EV(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function IV(e){return TV(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function TV(e){return[...PV(e.facetSet??{}),...NR(e.numericFacetSet??{}),...NR(e.dateFacetSet??{}),...Do(e.categoryFacetSet??{})]}function PV(e){return Do(e).map(t=>{let r=Iv[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function NR(e){return Do(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 _v(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=_R(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}var Vo=class{constructor(t,r=n=>{this.dispatch(Lt({q:n}))}){me(this,"config",t);me(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x84,_x85){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=Bp(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 At(t.response)?(this.dispatch(ko(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)return null;if(!a)return!pe(f)&&!pe(f.correctedQuery)?_this19.processModernDidYouMeanAutoCorrection(t):null;let m=i.length===0&&p&&p.length!==0,g=!pe(f)&&!pe(f.correctedQuery);if(!m&&!g)return null;let x=m?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(lr(Gr(_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 At(a.response)?(_this20.dispatch(ko(a.response.error)),_this20.rejectWithValue(a.response.error)):(_this20.dispatch(lr(Gr(_this20.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 _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(No("")),null;let a=_this21.getCurrentQuery(),i=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return At(i.response)?(_this21.dispatch(ko(i.response.error)),_this21.rejectWithValue(i.response.error)):(_this21.dispatch(lr(Gr(_this21.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a})})()}processSuccessResponse(t){return this.dispatch(lr(Gr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return Id(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=wR(),o=yield _this22.fetchFromAPI(yield wr(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(xr(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Ts({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield wr(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var Ps=xe("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;O(e,{q:new L,enableQuerySyntax:new de,clearFilters:new de}),e.clearFilters&&(r(ft()),r(hs())),r(an({allow:!0})),r(Lt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(cn(1))}),DR=k("search/updateSearchAction"),W=xe("search/executeSearch",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return sf(r,t,e.legacy);qR(r);let n=e.next?MR(e.next):void 0,o=yield wr(r,t.extra.navigatorContext,n),a=new Vo({...t,analyticsAction:n??{}}),i=yield a.fetchFromAPI(o,{origin:"mainSearch"});return yield a.process(i)});return function(_x86,_x87){return _ref33.apply(this,arguments)}}()),Ut=xe("search/fetchPage",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(qR(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return Pv(r,t,e.legacy);let n=new Vo({...t,analyticsAction:e.next}),o=yield wr(r,t.extra.navigatorContext,e.next),a=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(a)});return function(_x88,_x89){return _ref34.apply(this,arguments)}}()),Rr=xe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return kv(t,r);let n=Gw("browseResults",t.getState),o=new Vo({...t,analyticsAction:n}),a=yield kV(r,t.extra.navigatorContext,n),i=yield o.fetchFromAPI(a,{origin:"mainSearch"});return yield o.process(i)});return function(_x90,_x91){return _ref35.apply(this,arguments)}}()),Fr=xe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return sf(r,t,e.legacy);let n=new Vo({...t,analyticsAction:{}}),o=yield _V(r,t.extra.navigatorContext),a=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(a)});return function(_x92,_x93){return _ref36.apply(this,arguments)}}()),ks=xe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Tv(e,t);O(e,{id:z,q:z,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re});let{q:n,maxResultsPerQuery:o}=e,a=MR(sR()),i=yield OV(r,t.extra.navigatorContext,n,o,a),p=new Vo({...t,analyticsAction:a},g=>{t.dispatch(sn({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(_x94,_x95){return _ref37.apply(this,arguments)}}()),kV=/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t,r){let n=yield wr(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function kV(_x96,_x97,_x98){return _ref38.apply(this,arguments)}}(),OV=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t,r,n,o){let a=ws(e,t,o);return _o({...a,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function OV(_x99,_x100,_x101,_x102,_x103){return _ref39.apply(this,arguments)}}(),_V=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t,r){let n=yield wr(e,t,r);return n.request.numberOfResults=0,n});return function _V(_x104,_x105,_x106){return _ref40.apply(this,arguments)}}(),qR=e=>{e.configuration.analytics.enabled&&Nt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},MR=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();var jo=(e,t)=>{let r=e;return pe(r[t])?pe(e.raw[t])?null:e.raw[t]:r[t]},NV=e=>t=>e.every(r=>!pe(jo(t,r))),DV=e=>t=>e.every(r=>pe(jo(t,r))),qV=(e,t)=>r=>{let n=VR(e,r);return t.some(o=>n.some(a=>`${a}`.toLowerCase()===o.toLowerCase()))},MV=(e,t)=>r=>{let n=VR(e,r);return t.every(o=>n.every(a=>`${a}`.toLowerCase()!==o.toLowerCase()))},VR=(e,t)=>{let r=jo(t,e);return yd(r)?r:[r]},jR={getResultProperty:jo,fieldsMustBeDefined:NV,fieldsMustNotBeDefined:DV,fieldMustMatch:qV,fieldMustNotMatch:MV};function yl(e){return e.search.response.searchUid!==""}function LR(e,t,r){return e.search.results.find(n=>jo(n,t)===r)}var Nv=tt(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();d();c();l();u();var Os=k("app/setError");function Dv(e,t){let r=t.payload??null;r&&(e.response=ir().response,e.results=[],e.questionAnswer=Mi()),e.error=r,e.isLoading=!1}function qv(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function VV(e,t){qv(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 UR(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function jV(e,t){e.isLoading=!0,e.searchAction={actionCause:"browseResults"},e.requestId=t.meta.requestId}var he=ae(ir(),e=>{e.addCase(W.rejected,(t,r)=>Dv(t,r)),e.addCase(Rr.rejected,(t,r)=>Dv(t,r)),e.addCase(Ut.rejected,(t,r)=>Dv(t,r)),e.addCase(W.fulfilled,(t,r)=>{VV(t,r)}),e.addCase(Rr.fulfilled,(t,r)=>{qv(t,r),t.results=[...t.results,...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(Ut.fulfilled,(t,r)=>{qv(t,r),t.results=[...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(Fr.fulfilled,(t,r)=>{t.response.facets=r.payload.response.facets,t.response.searchUid=r.payload.response.searchUid}),e.addCase(W.pending,UR),e.addCase(Rr.pending,jV),e.addCase(Ut.pending,UR),e.addCase(DR,(t,r)=>{t.searchAction=r.payload}),e.addCase(Os,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();d();c();l();u();var _s=k("searchHub/set",e=>O(e,new L({required:!0,emptyAllowed:!0})));var Ns=ae(xo(),e=>{e.addCase(_s,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Ar,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var QR=class extends Error{constructor(t){super(t[0].message);me(this,"issues");this.name="SchemaError",this.issues=t}};var Xn="uninitialized",Vv="pending",vl="fulfilled",Al="rejected";function BR(e){return{status:e,isUninitialized:e===Xn,isLoading:e===Vv,isSuccess:e===vl,isError:e===Al}}var GR=Xr;function oF(e,t){if(e===t||!(GR(e)&&GR(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]=oF(e[i],t[i]),o&&(o=e[i]===a[i]);return o?e:a}function jv(e,t,r){return e.reduce((n,o,a)=>(t(o,a)&&n.push(r(o,a)),n),[]).flat()}function LV(e){return new RegExp("(^|:)//").test(e)}function UV(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Bv(e){return e!=null}function $R(e){return[...(e?.values()??[])].filter(Bv)}function QV(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var BV=e=>e.replace(/\/$/,""),GV=e=>e.replace(/^\//,"");function $V(e,t){if(!e)return t;if(!t)return e;if(LV(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=BV(e),t=GV(t),`${e}${r}${t}`}function lf(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var Lv=()=>new Map,HV=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},zV=(...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},HR=(...e)=>v(...e),WV=e=>e.status>=200&&e.status<=299,KV=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function zR(e){if(!Xr(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}var YV=e=>typeof e=="object"&&(Xr(e)||Array.isArray(e)||typeof e.toJSON=="function");function aF({baseUrl:e,prepareHeaders:t=S=>S,fetchFn:r=HR,paramsSerializer:n,isJsonContentType:o=KV,jsonContentType:a="application/json",jsonReplacer:i,timeout:p,responseHandler:f,validateStatus:m,...g}={}){return typeof v>"u"&&r===HR&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(x,h,C){let{getState:b,extra:w,endpoint:F,forced:I,type:E}=h,T,{url:P,headers:D=new A(g.headers),params:G=void 0,responseHandler:Q=f??"json",validateStatus:V=m??WV,timeout:U=p,...j}=typeof x=="string"?{url:x}:x,_={...g,signal:U?zV(h.signal,HV(U)):h.signal,...j};D=new A(zR(D)),_.headers=(yield t(D,{getState:b,arg:x,extra:w,endpoint:F,forced:I,type:E,extraOptions:C}))||D;let N=YV(_.body);if(_.body!=null&&!N&&typeof _.body!="string"&&_.headers.delete("content-type"),!_.headers.has("content-type")&&N&&_.headers.set("content-type",a),N&&o(_.headers)&&(_.body=JSON.stringify(_.body,i)),_.headers.has("accept")||(Q==="json"?_.headers.set("accept","application/json"):Q==="text"&&_.headers.set("accept","text/plain, text/html, */*")),G){let ue=~P.indexOf("?")?"&":"?",Se=n?n(G):new URLSearchParams(zR(G));P+=ue+Se}P=$V(e,P);let q=new Request(P,_);T={request:new Request(P,_)};let H;try{H=yield r(q)}catch(ue){return{error:{status:(ue instanceof Error||typeof DOMException<"u"&&ue instanceof DOMException)&&ue.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ue)},meta:T}}let ne=H.clone();T.response=ne;let te,Z="";try{let ue;if(yield Promise.all([S(H,Q).then(Se=>te=Se,Se=>ue=Se),ne.text().then(Se=>Z=Se,()=>{})]),ue)throw ue}catch(ue){return{error:{status:"PARSING_ERROR",originalStatus:H.status,data:Z,error:String(ue)},meta:T}}return V(H,te)?{data:te,meta:T}:{error:{status:H.status,data:te},meta:T}});return function(_x107,_x108,_x109){return _ref41.apply(this,arguments)}}());function S(_x110,_x111){return _S2.apply(this,arguments)}function _S2(){_S2=_asyncToGenerator(function*(x,h){if(typeof h=="function")return h(x);if(h==="content-type"&&(h=o(x.headers)?"json":"text"),h==="json"){let C=yield x.text();return C.length?JSON.parse(C):null}return x.text()});return _S2.apply(this,arguments)}}var Ds=class{constructor(e,t=void 0){me(this,"value");me(this,"meta");this.value=e,this.meta=t}};function JV(){return _JV.apply(this,arguments)}function _JV(){_JV=_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 _JV.apply(this,arguments)}function iF(e,t){throw Object.assign(new Ds({error:e,meta:t}),{throwImmediately:!0})}function Mv(e){e.aborted&&iF({status:"CUSTOM_ERROR",error:"Aborted"})}var WR={},XV=(e,t)=>(/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(r,n,o){let a=[5,(t||WR).maxRetries,(o||WR).maxRetries].filter(g=>g!==void 0),[i]=a.slice(-1),f={maxRetries:i,backoff:JV,retryCondition:(g,S,{attempt:x})=>x<=i,...t,...o},m=0;for(;;){Mv(n.signal);try{let g=yield e(r,n,o);if(g.error)throw new Ds(g);return g}catch(g){if(m++,g.throwImmediately){if(g instanceof Ds)return g.value;throw g}if(g instanceof Ds){if(!f.retryCondition(g.value.error,r,{attempt:m,baseQueryApi:n,extraOptions:o}))return g.value}else if(m>f.maxRetries)return{error:g};Mv(n.signal);try{yield f.backoff(m,f.maxRetries,n.signal)}catch(S){throw Mv(n.signal),S}}}});return function(_x112,_x113,_x114){return _ref42.apply(this,arguments)}}()),sF=Object.assign(XV,{fail:iF}),pf="__rtkq/",ZV="online",ej="offline";var cF="focused";var Gv=k(`${pf}${cF}`),uF=k(`${pf}un${cF}`),$v=k(`${pf}${ZV}`),lF=k(`${pf}${ej}`);var bl="query",dF="mutation",pF="infinitequery";function ff(e){return e.type===bl}function tj(e){return e.type===dF}function mf(e){return e.type===pF}function df(e){return ff(e)||mf(e)}function Hv(e,t,r,n,o,a){let i=rj(e)?e(t,r,n,o):e;return i?jv(i,Bv,p=>a(fF(p))):[]}function rj(e){return typeof e=="function"}function fF(e){return typeof e=="string"?{type:e}:e}function nj(e,t){return e.catch(t)}var qs=(e,t)=>e.endpointDefinitions[t],Cl=Symbol("forceQueryFn"),Uv=e=>typeof e[Cl]=="function";function oj({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:a,getInternalState:i}){let p=P=>i(P)?.runningQueries,f=P=>i(P)?.runningMutations,{unsubscribeQueryResult:m,removeMutationResult:g,updateSubscriptionOptions:S}=o.internalActions;return{buildInitiateQuery:I,buildInitiateInfiniteQuery:E,buildInitiateMutation:T,getRunningQueryThunk:x,getRunningMutationThunk:h,getRunningQueriesThunk:C,getRunningMutationsThunk:b};function x(P,D){return G=>{let Q=qs(a,P),V=e({queryArgs:D,endpointDefinition:Q,endpointName:P});return p(G)?.get(V)}}function h(P,D){return G=>f(G)?.get(D)}function C(){return P=>$R(p(P))}function b(){return P=>$R(f(P))}function w(P){}function F(P,D){let G=(Q,{subscribe:V=!0,forceRefetch:U,subscriptionOptions:j,[Cl]:_,...N}={})=>(q,Y)=>{let H=e({queryArgs:Q,endpointDefinition:D,endpointName:P}),ne,te={...N,type:bl,subscribe:V,forceRefetch:U,subscriptionOptions:j,endpointName:P,originalArgs:Q,queryCacheKey:H,[Cl]:_};if(ff(D))ne=t(te);else{let{direction:Re,initialPageParam:ke,refetchCachedPages:Ie}=N;ne=r({...te,direction:Re,initialPageParam:ke,refetchCachedPages:Ie})}let Z=o.endpoints[P].select(Q),ue=q(ne),Se=Z(Y());let{requestId:Ve,abort:Je}=ue,Qe=Se.requestId!==Ve,ze=p(q)?.get(H),We=()=>Z(Y()),Ee=Object.assign(_?ue.then(We):Qe&&!ze?Promise.resolve(Se):Promise.all([ze,ue]).then(We),{arg:Q,requestId:Ve,subscriptionOptions:j,queryCacheKey:H,abort:Je,unwrap(){return _asyncToGenerator(function*(){let Re=yield Ee;if(Re.isError)throw Re.error;return Re.data})()},refetch:Re=>q(G(Q,{subscribe:!1,forceRefetch:!0,...Re})),unsubscribe(){V&&q(m({queryCacheKey:H,requestId:Ve}))},updateSubscriptionOptions(Re){Ee.subscriptionOptions=Re,q(S({endpointName:P,requestId:Ve,queryCacheKey:H,options:Re}))}});if(!ze&&!Qe&&!_){let Re=p(q);Re.set(H,Ee),Ee.then(()=>{Re.delete(H)})}return Ee};return G}function I(P,D){return F(P,D)}function E(P,D){return F(P,D)}function T(P){return(D,{track:G=!0,fixedCacheKey:Q}={})=>(V,U)=>{let j=n({type:"mutation",endpointName:P,originalArgs:D,track:G,fixedCacheKey:Q}),_=V(j);let{requestId:N,abort:q,unwrap:Y}=_,H=nj(_.unwrap().then(ue=>({data:ue})),ue=>({error:ue})),ne=()=>{V(g({requestId:N,fixedCacheKey:Q}))},te=Object.assign(H,{arg:_.arg,requestId:N,abort:q,unwrap:Y,reset:ne}),Z=f(V);return Z.set(N,te),te.then(()=>{Z.delete(N)}),Q&&(Z.set(Q,te),te.then(()=>{Z.get(Q)===te&&Z.delete(Q)})),te}}}var mF=class extends QR{constructor(t,r,n,o){super(t);me(this,"value");me(this,"schemaName");me(this,"_bqMeta");this.value=r,this.schemaName=n,this._bqMeta=o}},Ea=(e,t)=>Array.isArray(e)?e.includes(t):!!e;function Ia(_x115,_x116,_x117,_x118){return _Ia.apply(this,arguments)}function _Ia(){_Ia=_asyncToGenerator(function*(e,t,r,n){let o=yield e["~standard"].validate(t);if(o.issues)throw new mF(o.issues,t,r,n);return o.value});return _Ia.apply(this,arguments)}function KR(e){return e}var Sl=(e={})=>({...e,[Ju]:!0});function aj({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:a,selectors:i,onSchemaFailure:p,catchSchemaFailure:f,skipSchemaValidation:m}){let g=(j,_,N,q)=>(Y,H)=>{let ne=r[j],te=n({queryArgs:_,endpointDefinition:ne,endpointName:j});if(Y(o.internalActions.queryResultPatched({queryCacheKey:te,patches:N})),!q)return;let Z=o.endpoints[j].select(_)(H()),ue=Hv(ne.providesTags,Z.data,void 0,_,{},a);Y(o.internalActions.updateProvidedBy([{queryCacheKey:te,providedTags:ue}]))};function S(j,_,N=0){let q=[_,...j];return N&&q.length>N?q.slice(0,-1):q}function x(j,_,N=0){let q=[...j,_];return N&&q.length>N?q.slice(1):q}let h=(j,_,N,q=!0)=>(Y,H)=>{let te=o.endpoints[j].select(_)(H()),Z={patches:[],inversePatches:[],undo:()=>Y(o.util.patchQueryData(j,_,Z.inversePatches,q))};if(te.status===Xn)return Z;let ue;if("data"in te)if(Vt(te.data)){let[Se,Ve,Je]=xS(te.data,N);Z.patches.push(...Ve),Z.inversePatches.push(...Je),ue=Se}else ue=N(te.data),Z.patches.push({op:"replace",path:[],value:ue}),Z.inversePatches.push({op:"replace",path:[],value:te.data});return Z.patches.length===0||Y(o.util.patchQueryData(j,_,Z.patches,q)),Z},C=(j,_,N)=>q=>q(o.endpoints[j].initiate(_,{subscribe:!1,forceRefetch:!0,[Cl]:()=>({data:N})})),b=(j,_)=>j.query&&j[_]?j[_]:KR,w=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(j,{signal:_,abort:N,rejectWithValue:q,fulfillWithValue:Y,dispatch:H,getState:ne,extra:te}){let Z=r[j.endpointName],{metaSchema:ue,skipSchemaValidation:Se=m}=Z,Ve=j.type===bl;try{let Je=KR,Qe={signal:_,abort:N,dispatch:H,getState:ne,extra:te,endpoint:j.endpointName,type:j.type,forced:Ve?F(j,ne()):void 0,queryCacheKey:Ve?j.queryCacheKey:void 0},ze=Ve?j[Cl]:void 0,We,Ee=/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(ke,Ie,ut,St){if(Ie==null&&ke.pages.length)return Promise.resolve({data:ke});let Mr={queryArg:j.originalArgs,pageParam:Ie},ar=yield Re(Mr),Jr=St?S:x;return{data:{pages:Jr(ke.pages,ar.data,ut),pageParams:Jr(ke.pageParams,Ie,ut)},meta:ar.meta}});return function Ee(_x121,_x122,_x123,_x124){return _ref44.apply(this,arguments)}}();function Re(_x125){return _Re.apply(this,arguments)}function _Re(){_Re=_asyncToGenerator(function*(ke){let Ie,{extraOptions:ut,argSchema:St,rawResponseSchema:Mr,responseSchema:ar}=Z;if(St&&!Ea(Se,"arg")&&(ke=yield Ia(St,ke,"argSchema",{})),ze?Ie=ze():Z.query?(Je=b(Z,"transformResponse"),Ie=yield t(Z.query(ke),Qe,ut)):Ie=yield Z.queryFn(ke,Qe,ut,Vr=>t(Vr,Qe,ut)),typeof process<"u",Ie.error)throw new Ds(Ie.error,Ie.meta);let{data:Jr}=Ie;Mr&&!Ea(Se,"rawResponse")&&(Jr=yield Ia(Mr,Ie.data,"rawResponseSchema",Ie.meta));let mr=yield Je(Jr,Ie.meta,ke);return ar&&!Ea(Se,"response")&&(mr=yield Ia(ar,mr,"responseSchema",Ie.meta)),{...Ie,data:mr}});return _Re.apply(this,arguments)}if(Ve&&"infiniteQueryOptions"in Z){let{infiniteQueryOptions:ke}=Z,{maxPages:Ie=1/0}=ke,ut=j.refetchCachedPages??ke.refetchCachedPages??!0,St,Mr={pages:[],pageParams:[]},ar=i.selectQueryEntry(ne(),j.queryCacheKey)?.data,mr=F(j,ne())&&!j.direction||!ar?Mr:ar;if("direction"in j&&j.direction&&mr.pages.length){let Vr=j.direction==="backward",dd=(Vr?gF:Qv)(ke,mr,j.originalArgs);St=yield Ee(mr,dd,Ie,Vr)}else{let{initialPageParam:Vr=ke.initialPageParam}=j,wu=ar?.pageParams??[],dd=wu[0]??Vr,V0=wu.length;if(St=yield Ee(mr,dd,Ie),ze&&(St={data:St.data.pages[0]}),ut)for(let WC=1;WC<V0;WC++){let j0=Qv(ke,St.data,j.originalArgs);St=yield Ee(St.data,j0,Ie)}}We=St}else We=yield Re(j.originalArgs);return ue&&!Ea(Se,"meta")&&We.meta&&(We.meta=yield Ia(ue,We.meta,"metaSchema",We.meta)),Y(We.data,Sl({fulfilledTimeStamp:Date.now(),baseQueryMeta:We.meta}))}catch(Je){let Qe=Je;if(Qe instanceof Ds){let ze=b(Z,"transformErrorResponse"),{rawErrorResponseSchema:We,errorResponseSchema:Ee}=Z,{value:Re,meta:ke}=Qe;try{We&&!Ea(Se,"rawErrorResponse")&&(Re=yield Ia(We,Re,"rawErrorResponseSchema",ke)),ue&&!Ea(Se,"meta")&&(ke=yield Ia(ue,ke,"metaSchema",ke));let Ie=yield ze(Re,ke,j.originalArgs);return Ee&&!Ea(Se,"errorResponse")&&(Ie=yield Ia(Ee,Ie,"errorResponseSchema",ke)),q(Ie,Sl({baseQueryMeta:ke}))}catch(Ie){Qe=Ie}}try{if(Qe instanceof mF){let ze={endpoint:j.endpointName,arg:j.originalArgs,type:j.type,queryCacheKey:Ve?j.queryCacheKey:void 0};Z.onSchemaFailure?.(Qe,ze),p?.(Qe,ze);let{catchSchemaFailure:We=f}=Z;if(We)return q(We(Qe,ze),Sl({baseQueryMeta:Qe._bqMeta}))}}catch(ze){Qe=ze}throw typeof process<"u",console.error(Qe),Qe}});return function w(_x119,_x120){return _ref43.apply(this,arguments)}}();function F(j,_){let N=i.selectQueryEntry(_,j.queryCacheKey),q=i.selectConfig(_).refetchOnMountOrArgChange,Y=N?.fulfilledTimeStamp,H=j.forceRefetch??(j.subscribe&&q);return H?H===!0||(Number(new Date)-Number(Y))/1e3>=H:!1}let I=()=>xe(`${e}/executeQuery`,w,{getPendingMeta({arg:_}){let N=r[_.endpointName];return Sl({startedTimeStamp:Date.now(),...(mf(N)?{direction:_.direction}:{})})},condition(_,{getState:N}){let q=N(),Y=i.selectQueryEntry(q,_.queryCacheKey),H=Y?.fulfilledTimeStamp,ne=_.originalArgs,te=Y?.originalArgs,Z=r[_.endpointName],ue=_.direction;return Uv(_)?!0:Y?.status==="pending"?!1:F(_,q)||ff(Z)&&Z?.forceRefetch?.({currentArg:ne,previousArg:te,endpointState:Y,state:q})?!0:!(H&&!ue)},dispatchConditionRejection:!0}),E=I(),T=I(),P=xe(`${e}/executeMutation`,w,{getPendingMeta(){return Sl({startedTimeStamp:Date.now()})}}),D=j=>"force"in j,G=j=>"ifOlderThan"in j,Q=(j,_,N={})=>(q,Y)=>{let H=D(N)&&N.force,ne=G(N)&&N.ifOlderThan,te=(ue=!0)=>{let Se={forceRefetch:ue,subscribe:!1};return o.endpoints[j].initiate(_,Se)},Z=o.endpoints[j].select(_)(Y());if(H)q(te());else if(ne){let ue=Z?.fulfilledTimeStamp;if(!ue){q(te());return}(Number(new Date)-Number(new Date(ue)))/1e3>=ne&&q(te())}else q(te(!1))};function V(j){return _=>_?.meta?.arg?.endpointName===j}function U(j,_){return{matchPending:Gi(Yd(j),V(_)),matchFulfilled:Gi(Wn(j),V(_)),matchRejected:Gi(Sa(j),V(_))}}return{queryThunk:E,mutationThunk:P,infiniteQueryThunk:T,prefetch:Q,updateQueryData:h,upsertQueryData:C,patchQueryData:g,buildMatchThunkActions:U}}function Qv(e,{pages:t,pageParams:r},n){let o=t.length-1;return e.getNextPageParam(t[o],t,r[o],r,n)}function gF(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function hF(e,t,r,n){return Hv(r[e.meta.arg.endpointName][t],Wn(e)?e.payload:void 0,Zu(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function YR(e){return Yt(e)?Bd(e):e}function cf(e,t,r){let n=e[t];n&&r(n)}function xl(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function JR(e,t,r){let n=e[xl(t)];n&&r(n)}var uf={};function ij({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:a,extractRehydrationInfo:i,hasRehydrationInfo:p},assertTagType:f,config:m}){let g=k(`${e}/resetApiState`);function S(V,U,j,_){var N;V[N=U.queryCacheKey]??(V[N]={status:Xn,endpointName:U.endpointName}),cf(V,U.queryCacheKey,q=>{q.status=Vv,q.requestId=j&&q.requestId?q.requestId:_.requestId,U.originalArgs!==void 0&&(q.originalArgs=U.originalArgs),q.startedTimeStamp=_.startedTimeStamp;let Y=o[_.arg.endpointName];mf(Y)&&"direction"in U&&(q.direction=U.direction)})}function x(V,U,j,_){cf(V,U.arg.queryCacheKey,N=>{if(N.requestId!==U.requestId&&!_)return;let{merge:q}=o[U.arg.endpointName];if(N.status=vl,q){if(N.data!==void 0){let{fulfilledTimeStamp:Y,arg:H,baseQueryMeta:ne,requestId:te}=U,Z=ha(N.data,ue=>q(ue,j,{arg:H.originalArgs,baseQueryMeta:ne,fulfilledTimeStamp:Y,requestId:te}));N.data=Z}else N.data=j;}else N.data=o[U.arg.endpointName].structuralSharing??!0?oF(Yt(N.data)?tb(N.data):N.data,j):j;delete N.error,N.fulfilledTimeStamp=U.fulfilledTimeStamp})}let h=va({name:`${e}/queries`,initialState:uf,reducers:{removeQueryResult:{reducer(V,{payload:{queryCacheKey:U}}){delete V[U]},prepare:$i()},cacheEntriesUpserted:{reducer(V,U){for(let j of U.payload){let{queryDescription:_,value:N}=j;S(V,_,!0,{arg:_,requestId:U.meta.requestId,startedTimeStamp:U.meta.timestamp}),x(V,{arg:_,requestId:U.meta.requestId,fulfilledTimeStamp:U.meta.timestamp,baseQueryMeta:{}},N,!0)}},prepare:V=>({payload:V.map(_=>{let{endpointName:N,arg:q,value:Y}=_,H=o[N];return{queryDescription:{type:bl,endpointName:N,originalArgs:_.arg,queryCacheKey:n({queryArgs:q,endpointDefinition:H,endpointName:N})},value:Y}}),meta:{[Ju]:!0,requestId:el(),timestamp:Date.now()}})},queryResultPatched:{reducer(V,{payload:{queryCacheKey:U,patches:j}}){cf(V,U,_=>{_.data=bS(_.data,j.concat())})},prepare:$i()}},extraReducers(V){V.addCase(t.pending,(U,{meta:j,meta:{arg:_}})=>{let N=Uv(_);S(U,_,N,j)}).addCase(t.fulfilled,(U,{meta:j,payload:_})=>{let N=Uv(j.arg);x(U,j,_,N)}).addCase(t.rejected,(U,{meta:{condition:j,arg:_,requestId:N},error:q,payload:Y})=>{cf(U,_.queryCacheKey,H=>{if(!j){if(H.requestId!==N)return;H.status=Al,H.error=Y??q}})}).addMatcher(p,(U,j)=>{let{queries:_}=i(j);for(let[N,q]of Object.entries(_))(q?.status===vl||q?.status===Al)&&(U[N]=q)})}}),C=va({name:`${e}/mutations`,initialState:uf,reducers:{removeMutationResult:{reducer(V,{payload:U}){let j=xl(U);j in V&&delete V[j]},prepare:$i()}},extraReducers(V){V.addCase(r.pending,(U,{meta:j,meta:{requestId:_,arg:N,startedTimeStamp:q}})=>{N.track&&(U[xl(j)]={requestId:_,status:Vv,endpointName:N.endpointName,startedTimeStamp:q})}).addCase(r.fulfilled,(U,{payload:j,meta:_})=>{_.arg.track&&JR(U,_,N=>{N.requestId===_.requestId&&(N.status=vl,N.data=j,N.fulfilledTimeStamp=_.fulfilledTimeStamp)})}).addCase(r.rejected,(U,{payload:j,error:_,meta:N})=>{N.arg.track&&JR(U,N,q=>{q.requestId===N.requestId&&(q.status=Al,q.error=j??_)})}).addMatcher(p,(U,j)=>{let{mutations:_}=i(j);for(let[N,q]of Object.entries(_))(q?.status===vl||q?.status===Al)&&N!==q?.requestId&&(U[N]=q)})}}),b={tags:{},keys:{}},w=va({name:`${e}/invalidation`,initialState:b,reducers:{updateProvidedBy:{reducer(V,U){var j,_,N;for(let{queryCacheKey:q,providedTags:Y}of U.payload){F(V,q);for(let{type:H,id:ne}of Y){let te=(_=(j=V.tags)[H]??(j[H]={}))[N=ne||"__internal_without_id"]??(_[N]=[]);te.includes(q)||te.push(q)}V.keys[q]=Y}},prepare:$i()}},extraReducers(V){V.addCase(h.actions.removeQueryResult,(U,{payload:{queryCacheKey:j}})=>{F(U,j)}).addMatcher(p,(U,j)=>{var N,q,Y;let{provided:_}=i(j);for(let[H,ne]of Object.entries(_.tags??{}))for(let[te,Z]of Object.entries(ne)){let ue=(q=(N=U.tags)[H]??(N[H]={}))[Y=te||"__internal_without_id"]??(q[Y]=[]);for(let Se of Z)ue.includes(Se)||ue.push(Se),U.keys[Se]=_.keys[Se]}}).addMatcher(Zr(Wn(t),Zu(t)),(U,j)=>{I(U,[j])}).addMatcher(h.actions.cacheEntriesUpserted.match,(U,j)=>{let _=j.payload.map(({queryDescription:N,value:q})=>({type:"UNKNOWN",payload:q,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:N}}));I(U,_)})}});function F(V,U){let j=YR(V.keys[U]??[]);for(let _ of j){let N=_.type,q=_.id??"__internal_without_id",Y=V.tags[N]?.[q];Y&&(V.tags[N][q]=YR(Y).filter(H=>H!==U))}delete V.keys[U]}function I(V,U){let j=U.map(_=>{let N=hF(_,"providesTags",o,f),{queryCacheKey:q}=_.meta.arg;return{queryCacheKey:q,providedTags:N}});w.caseReducers.updateProvidedBy(V,w.actions.updateProvidedBy(j))}let E=va({name:`${e}/subscriptions`,initialState:uf,reducers:{updateSubscriptionOptions(V,U){},unsubscribeQueryResult(V,U){},internal_getRTKQSubscriptions(){}}}),T=va({name:`${e}/internalSubscriptions`,initialState:uf,reducers:{subscriptionsUpdated:{reducer(V,U){return bS(V,U.payload)},prepare:$i()}}}),P=va({name:`${e}/config`,initialState:{online:QV(),focused:UV(),middlewareRegistered:!1,...m},reducers:{middlewareRegistered(V,{payload:U}){V.middlewareRegistered=V.middlewareRegistered==="conflict"||a!==U?"conflict":!0}},extraReducers:V=>{V.addCase($v,U=>{U.online=!0}).addCase(lF,U=>{U.online=!1}).addCase(Gv,U=>{U.focused=!0}).addCase(uF,U=>{U.focused=!1}).addMatcher(p,U=>({...U}))}}),D=Li({queries:h.reducer,mutations:C.reducer,provided:w.reducer,subscriptions:T.reducer,config:P.reducer}),G=(V,U)=>D(g.match(U)?void 0:V,U),Q={...P.actions,...h.actions,...E.actions,...T.actions,...C.actions,...w.actions,resetApiState:g};return{reducer:G,actions:Q}}var Ta=Symbol.for("RTKQ/skipToken"),yF={status:Xn},XR=ha(yF,()=>{}),ZR=ha(yF,()=>{});function sj({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=E=>XR,o=E=>ZR;return{buildQuerySelector:x,buildInfiniteQuerySelector:h,buildMutationSelector:C,selectInvalidatedBy:b,selectCachedArgsForQuery:w,selectApiState:i,selectQueries:p,selectMutations:m,selectQueryEntry:f,selectConfig:g};function a(E){return{...E,...BR(E.status)}}function i(E){return E[t]}function p(E){return i(E)?.queries}function f(E,T){return p(E)?.[T]}function m(E){return i(E)?.mutations}function g(E){return i(E)?.config}function S(E,T,P){return D=>{if(D===Ta)return r(n,P);let G=e({queryArgs:D,endpointDefinition:T,endpointName:E});return r(V=>f(V,G)??XR,P)}}function x(E,T){return S(E,T,a)}function h(E,T){let{infiniteQueryOptions:P}=T;function D(G){let Q={...G,...BR(G.status)},{isLoading:V,isError:U,direction:j}=Q,_=j==="forward",N=j==="backward";return{...Q,hasNextPage:F(P,Q.data,Q.originalArgs),hasPreviousPage:I(P,Q.data,Q.originalArgs),isFetchingNextPage:V&&_,isFetchingPreviousPage:V&&N,isFetchNextPageError:U&&_,isFetchPreviousPageError:U&&N}}return S(E,T,D)}function C(){return E=>{let T;return typeof E=="object"?T=xl(E)??Ta:T=E,r(T===Ta?o:G=>i(G)?.mutations?.[T]??ZR,a)}}function b(E,T){let P=E[t],D=new Set,G=jv(T,Bv,fF);for(let Q of G){let V=P.provided.tags[Q.type];if(!V)continue;let U=(Q.id!==void 0?V[Q.id]:Object.values(V).flat())??[];for(let j of U)D.add(j)}return Array.from(D.values()).flatMap(Q=>{let V=P.queries[Q];return V?{queryCacheKey:Q,endpointName:V.endpointName,originalArgs:V.originalArgs}:[]})}function w(E,T){return jv(Object.values(p(E)),P=>P?.endpointName===T&&P.status!==Xn,P=>P.originalArgs)}function F(E,T,P){return T?Qv(E,T,P)!=null:!1}function I(E,T,P){return!T||!E.getPreviousPageParam?!1:gF(E,T,P)!=null}}var eF=WeakMap?new WeakMap:void 0,tF=({endpointName:e,queryArgs:t})=>{let r="",n=eF?.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=Xr(i)?Object.keys(i).sort().reduce((p,f)=>(p[f]=i[f],p),{}):i,i));Xr(t)&&eF?.set(t,o),r=o}return`${e}(${r})`};function cj(...e){return function(r){let n=Ku(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=tF;if("serializeQueryArgs"in m.endpointDefinition){let S=m.endpointDefinition.serializeQueryArgs;g=x=>{let h=S(x);return typeof h=="string"?h:tF({...x,queryArgs:h})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(m)},tagTypes:[...(r.tagTypes||[])]},a={endpointDefinitions:{},batch(m){m()},apiUid:el(),extractRehydrationInfo:n,hasRehydrationInfo:Ku(m=>n(m)!=null)},i={injectEndpoints:f,enhanceEndpoints({addTagTypes:m,endpoints:g}){if(m)for(let S of m)o.tagTypes.includes(S)||o.tagTypes.push(S);if(g)for(let[S,x]of Object.entries(g))typeof x=="function"?x(qs(a,S)):Object.assign(qs(a,S)||{},x);return i}},p=e.map(m=>m.init(i,o,a));function f(m){let g=m.endpoints({query:S=>({...S,type:bl}),mutation:S=>({...S,type:dF}),infiniteQuery:S=>({...S,type:pF})});for(let[S,x]of Object.entries(g)){if(m.overrideExisting!==!0&&S in a.endpointDefinitions){if(m.overrideExisting==="throw")throw new Error(Jt(39));typeof process<"u";continue}typeof process<"u",a.endpointDefinitions[S]=x;for(let h of p)h.injectEndpoint(S,x)}return i}return i.injectEndpoints({endpoints:r.endpoints})}}function Jn(e,...t){return Object.assign(e,...t)}var uj=({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:I,requestId:E,options:T}=w.payload,P=b.get(I);return P?.has(E)&&P.set(E,T),!0}if(f.match(w)){let{queryCacheKey:I,requestId:E}=w.payload,T=b.get(I);return T&&T.delete(E),!0}if(e.internalActions.removeQueryResult.match(w))return b.delete(w.payload.queryCacheKey),!0;if(t.pending.match(w)){let{meta:{arg:I,requestId:E}}=w,T=lf(b,I.queryCacheKey,Lv);return I.subscribe&&T.set(E,I.subscriptionOptions??T.get(E)??{}),!0}let F=!1;if(t.rejected.match(w)){let{meta:{condition:I,arg:E,requestId:T}}=w;if(I&&E.subscribe){let P=lf(b,E.queryCacheKey,Lv);P.set(T,E.subscriptionOptions??P.get(T)??{}),F=!0}}return F},g=()=>r.currentSubscriptions,h={getSubscriptions:g,getSubscriptionCount:b=>g().get(b)?.size??0,isRequestSubscribed:(b,w)=>!!g()?.get(b)?.get(w)};function C(b){return JSON.parse(JSON.stringify(Object.fromEntries([...b].map(([w,F])=>[w,Object.fromEntries(F)]))))}return(b,w)=>{if(a||(a=C(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 F=m(r.currentSubscriptions,b),I=!0;if(F){i||(i=setTimeout(()=>{let P=C(r.currentSubscriptions),[,D]=xS(a,()=>P);w.next(e.internalActions.subscriptionsUpdated(D)),a=P,i=null},500));let E=typeof b.type=="string"&&!!b.type.startsWith(o),T=t.rejected.match(b)&&b.meta.condition&&!!b.meta.arg.subscribe;I=!E&&!T}return[I,!1]}},lj=2147483647/1e3-1,dj=({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:S}=t.internalActions,x=Zr(g.match,r.fulfilled,r.rejected,S.match);function h(E){let T=o.currentSubscriptions.get(E);return T?T.size>0:!1}let C={};function b(E){for(let T of E.values())T?.abort?.()}let w=(E,T)=>{let P=T.getState(),D=i(P);if(x(E)){let G;if(S.match(E))G=E.payload.map(Q=>Q.queryDescription.queryCacheKey);else{let{queryCacheKey:Q}=g.match(E)?E.payload:E.meta.arg;G=[Q]}F(G,T,D)}if(t.util.resetApiState.match(E)){for(let[G,Q]of Object.entries(C))Q&&clearTimeout(Q),delete C[G];b(o.runningQueries),b(o.runningMutations)}if(n.hasRehydrationInfo(E)){let{queries:G}=n.extractRehydrationInfo(E);F(Object.keys(G),T,D)}};function F(E,T,P){let D=T.getState();for(let G of E){let Q=a(D,G);Q?.endpointName&&I(G,Q.endpointName,T,P)}}function I(E,T,P,D){let Q=qs(n,T)?.keepUnusedDataFor??D.keepUnusedDataFor;if(Q===1/0)return;let V=Math.max(0,Math.min(Q,lj));if(!h(E)){let U=C[E];U&&clearTimeout(U),C[E]=setTimeout(()=>{if(!h(E)){let j=a(P.getState(),E);j?.endpointName&&P.dispatch(p(j.endpointName,j.originalArgs))?.abort(),P.dispatch(m({queryCacheKey:E}))}delete C[E]},V*1e3)}}return w},rF=new Error("Promise never resolved before cacheEntryRemoved."),pj=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:a,selectors:{selectQueryEntry:i,selectApiState:p}})=>{let f=Jd(n),m=Jd(o),g=Wn(n,o),S={},{removeQueryResult:x,removeMutationResult:h,cacheEntriesUpserted:C}=e.internalActions;function b(P,D,G){let Q=S[P];Q?.valueResolved&&(Q.valueResolved({data:D,meta:G}),delete Q.valueResolved)}function w(P){let D=S[P];D&&(delete S[P],D.cacheEntryRemoved())}function F(P){let{arg:D,requestId:G}=P.meta,{endpointName:Q,originalArgs:V}=D;return[Q,V,G]}let I=(P,D,G)=>{let Q=E(P);function V(U,j,_,N){let q=i(G,j),Y=i(D.getState(),j);!q&&Y&&T(U,N,j,D,_)}if(n.pending.match(P)){let[U,j,_]=F(P);V(U,Q,_,j)}else if(C.match(P))for(let{queryDescription:U,value:j}of P.payload){let{endpointName:_,originalArgs:N,queryCacheKey:q}=U;V(_,q,P.meta.requestId,N),b(q,j,{})}else if(o.pending.match(P)){if(D.getState()[t].mutations[Q]){let[j,_,N]=F(P);T(j,_,Q,D,N)}}else if(g(P))b(Q,P.payload,P.meta.baseQueryMeta);else if(x.match(P)||h.match(P))w(Q);else if(e.util.resetApiState.match(P))for(let U of Object.keys(S))w(U)};function E(P){return f(P)?P.meta.arg.queryCacheKey:m(P)?P.meta.arg.fixedCacheKey??P.meta.requestId:x.match(P)?P.payload.queryCacheKey:h.match(P)?xl(P.payload):""}function T(P,D,G,Q,V){let U=qs(r,P),j=U?.onCacheEntryAdded;if(!j)return;let _={},N=new Promise(Z=>{_.cacheEntryRemoved=Z}),q=Promise.race([new Promise(Z=>{_.valueResolved=Z}),N.then(()=>{throw rF})]);q.catch(()=>{}),S[G]=_;let Y=e.endpoints[P].select(df(U)?D:G),H=Q.dispatch((Z,ue,Se)=>Se),ne={...Q,getCacheEntry:()=>Y(Q.getState()),requestId:V,extra:H,updateCachedData:df(U)?Z=>Q.dispatch(e.util.updateQueryData(P,D,Z)):void 0,cacheDataLoaded:q,cacheEntryRemoved:N},te=j(D,ne);Promise.resolve(te).catch(Z=>{if(Z!==rF)throw Z})}return I},fj=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},mj=({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=Zr(Wn(n),Zu(n)),S=Zr(Wn(o,n),Sa(o,n)),x=[],h=0,C=(F,I)=>{(o.pending.match(F)||n.pending.match(F))&&h++,S(F)&&(h=Math.max(0,h-1)),g(F)?w(hF(F,"invalidatesTags",r,i),I):S(F)?w([],I):a.util.invalidateTags.match(F)&&w(Hv(F.payload,void 0,void 0,void 0,void 0,i),I)};function b(){return h>0}function w(F,I){let E=I.getState(),T=E[e];if(x.push(...F),T.config.invalidationBehavior==="delayed"&&b())return;let P=x;if(x=[],P.length===0)return;let D=a.util.selectInvalidatedBy(E,P);t.batch(()=>{let G=Array.from(D.values());for(let{queryCacheKey:Q}of G){let V=T.queries[Q],U=lf(f.currentSubscriptions,Q,Lv);V&&(U.size===0?I.dispatch(m({queryCacheKey:Q})):V.status!==Xn&&I.dispatch(p(V)))}})}return C},gj=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let{currentPolls:a,currentSubscriptions:i}=o,p=new Set,f=null,m=(w,F)=>{(r.internalActions.updateSubscriptionOptions.match(w)||r.internalActions.unsubscribeQueryResult.match(w))&&g(w.payload.queryCacheKey,F),(t.pending.match(w)||t.rejected.match(w)&&w.meta.condition)&&g(w.meta.arg.queryCacheKey,F),(t.fulfilled.match(w)||t.rejected.match(w)&&!w.meta.condition)&&S(w.meta.arg,F),r.util.resetApiState.match(w)&&(C(),f&&(clearTimeout(f),f=null),p.clear())};function g(w,F){p.add(w),f||(f=setTimeout(()=>{for(let I of p)x({queryCacheKey:I},F);p.clear(),f=null},0))}function S({queryCacheKey:w},F){let I=F.getState()[e],E=I.queries[w],T=i.get(w);if(!E||E.status===Xn)return;let{lowestPollingInterval:P,skipPollingIfUnfocused:D}=b(T);if(!Number.isFinite(P))return;let G=a.get(w);G?.timeout&&(clearTimeout(G.timeout),G.timeout=void 0);let Q=Date.now()+P;a.set(w,{nextPollTimestamp:Q,pollingInterval:P,timeout:setTimeout(()=>{(I.config.focused||!D)&&F.dispatch(n(E)),S({queryCacheKey:w},F)},P)})}function x({queryCacheKey:w},F){let E=F.getState()[e].queries[w],T=i.get(w);if(!E||E.status===Xn)return;let{lowestPollingInterval:P}=b(T);if(!Number.isFinite(P)){h(w);return}let D=a.get(w),G=Date.now()+P;(!D||G<D.nextPollTimestamp)&&S({queryCacheKey:w},F)}function h(w){let F=a.get(w);F?.timeout&&clearTimeout(F.timeout),a.delete(w)}function C(){for(let w of a.keys())h(w)}function b(w=new Map){let F=!1,I=Number.POSITIVE_INFINITY;for(let E of w.values())E.pollingInterval&&(I=Math.min(E.pollingInterval,I),F=E.skipPollingIfUnfocused||F);return{lowestPollingInterval:I,skipPollingIfUnfocused:F}}return m},hj=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=Yd(r,n),a=Sa(r,n),i=Wn(r,n),p={};return(m,g)=>{if(o(m)){let{requestId:S,arg:{endpointName:x,originalArgs:h}}=m.meta,C=qs(t,x),b=C?.onQueryStarted;if(b){let w={},F=new Promise((P,D)=>{w.resolve=P,w.reject=D});F.catch(()=>{}),p[S]=w;let I=e.endpoints[x].select(df(C)?h:S),E=g.dispatch((P,D,G)=>G),T={...g,getCacheEntry:()=>I(g.getState()),requestId:S,extra:E,updateCachedData:df(C)?P=>g.dispatch(e.util.updateQueryData(x,h,P)):void 0,queryFulfilled:F};b(h,T)}}else if(i(m)){let{requestId:S,baseQueryMeta:x}=m.meta;p[S]?.resolve({data:m.payload,meta:x}),delete p[S]}else if(a(m)){let{requestId:S,rejectedWithValue:x,baseQueryMeta:h}=m.meta;p[S]?.reject({error:m.payload??m.error,isUnhandledError:!x,meta:h}),delete p[S]}}},yj=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:a}=r.internalActions,i=(f,m)=>{Gv.match(f)&&p(m,"refetchOnFocus"),$v.match(f)&&p(m,"refetchOnReconnect")};function p(f,m){let g=f.getState()[e],S=g.queries,x=o.currentSubscriptions;t.batch(()=>{for(let h of x.keys()){let C=S[h],b=x.get(h);if(!b||!C)continue;let w=[...b.values()];(w.some(I=>I[m]===!0)||w.every(I=>I[m]===void 0)&&g.config[m])&&(b.size===0?f.dispatch(a({queryCacheKey:h})):C.status!==Xn&&f.dispatch(n(C)))}})}return i};function Sj(e){let{reducerPath:t,queryThunk:r,api:n,context:o,getInternalState:a}=e,{apiUid:i}=o,p={invalidateTags:k(`${t}/invalidateTags`)},f=x=>x.type.startsWith(`${t}/`),m=[fj,dj,mj,gj,pj,hj];return{middleware:x=>{let h=!1,C=a(x.dispatch),b={...e,internalState:C,refetchQuery:S,isThisApiSliceAction:f,mwApi:x},w=m.map(E=>E(b)),F=uj(b),I=yj(b);return E=>T=>{if(!Mu(T))return E(T);h||(h=!0,x.dispatch(n.internalActions.middlewareRegistered(i)));let P={...x,next:E},D=x.getState(),[G,Q]=F(T,P,D),V;if(G?V=E(T):V=Q,x.getState()[t]&&(I(T,P,D),f(T)||o.hasRehydrationInfo(T)))for(let U of w)U(T,P,D);return V}},actions:p};function S(x){return e.api.endpoints[x.endpointName].initiate(x.originalArgs,{subscribe:!1,forceRefetch:!0})}}var nF=Symbol(),vj=({createSelector:e=tt}={})=>({name:nF,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:a,keepUnusedDataFor:i,refetchOnMountOrArgChange:p,refetchOnFocus:f,refetchOnReconnect:m,invalidationBehavior:g,onSchemaFailure:S,catchSchemaFailure:x,skipSchemaValidation:h},C){cb();let b=Ee=>(typeof process<"u",Ee);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:$v,onOffline:lF,onFocus:Gv,onFocusLost:uF},util:{}});let w=sj({serializeQueryArgs:a,reducerPath:o,createSelector:e}),{selectInvalidatedBy:F,selectCachedArgsForQuery:I,buildQuerySelector:E,buildInfiniteQuerySelector:T,buildMutationSelector:P}=w;Jn(t.util,{selectInvalidatedBy:F,selectCachedArgsForQuery:I});let{queryThunk:D,infiniteQueryThunk:G,mutationThunk:Q,patchQueryData:V,updateQueryData:U,upsertQueryData:j,prefetch:_,buildMatchThunkActions:N}=aj({baseQuery:r,reducerPath:o,context:C,api:t,serializeQueryArgs:a,assertTagType:b,selectors:w,onSchemaFailure:S,catchSchemaFailure:x,skipSchemaValidation:h}),{reducer:q,actions:Y}=ij({context:C,queryThunk:D,infiniteQueryThunk:G,mutationThunk:Q,serializeQueryArgs:a,reducerPath:o,assertTagType:b,config:{refetchOnFocus:f,refetchOnReconnect:m,refetchOnMountOrArgChange:p,keepUnusedDataFor:i,reducerPath:o,invalidationBehavior:g}});Jn(t.util,{patchQueryData:V,updateQueryData:U,upsertQueryData:j,prefetch:_,resetApiState:Y.resetApiState,upsertQueryEntries:Y.cacheEntriesUpserted}),Jn(t.internalActions,Y);let H=new WeakMap,ne=Ee=>lf(H,Ee,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:te,buildInitiateInfiniteQuery:Z,buildInitiateMutation:ue,getRunningMutationThunk:Se,getRunningMutationsThunk:Ve,getRunningQueriesThunk:Je,getRunningQueryThunk:Qe}=oj({queryThunk:D,mutationThunk:Q,infiniteQueryThunk:G,api:t,serializeQueryArgs:a,context:C,getInternalState:ne});Jn(t.util,{getRunningMutationThunk:Se,getRunningMutationsThunk:Ve,getRunningQueryThunk:Qe,getRunningQueriesThunk:Je});let{middleware:ze,actions:We}=Sj({reducerPath:o,context:C,queryThunk:D,mutationThunk:Q,infiniteQueryThunk:G,api:t,assertTagType:b,selectors:w,getRunningQueryThunk:Qe,getInternalState:ne});return Jn(t.util,We),Jn(t,{reducer:q,middleware:ze}),{name:nF,injectEndpoint(Ee,Re){var ut;let Ie=(ut=t.endpoints)[Ee]??(ut[Ee]={});ff(Re)&&Jn(Ie,{name:Ee,select:E(Ee,Re),initiate:te(Ee,Re)},N(D,Ee)),tj(Re)&&Jn(Ie,{name:Ee,select:P(),initiate:ue(Ee)},N(Q,Ee)),mf(Re)&&Jn(Ie,{name:Ee,select:T(Ee,Re),initiate:Z(Ee,Re)},N(D,Ee))}}}}),SF=cj(vj());d();c();l();u();d();c();l();u();var Pa=e=>e.query,vF=e=>e.query?.enableQuerySyntax;var AF=tt(e=>Pa(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})),gf=tt(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();l();u();d();c();l();u();d();c();l();u();var CF=tt(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 zv=e=>e.context;d();c();l();u();var Wv=e=>e.pipeline;d();c();l();u();var Kv=e=>e.searchHub;d();c();l();u();var Qt=tt(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),$ie=tt(e=>e,e=>{let t=Qt(e);return t&&e?e[t].expression:""});d();c();l();u();var xF=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var bF=e=>e.excerptLength?.length;d();c();l();u();var ln=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,wF=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var RF=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 FF=e=>e.sortCriteria;var EF=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:ji(e.configuration.search.apiBaseUrl,e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function EF(_x126){return _ref45.apply(this,arguments)}}(),IF=(e,t)=>{let r=Pa(e)?.q,{aq:n,cq:o,dq:a,lq:i}=kF(e),p=zv(e),f=Qr(e.configuration.analytics,t,{actionCause:Nv(e)}),m=Kv(e),g=Wv(e),S=iv(e)??[],x=PF(e),h=Qt(e.tabSet)||"default",C=ov(e),b=_w(e),w=t.referrer||"",F=wF(e),I=FF(e),E=Aj(e),T=bF(e),P=RF(e),D=xF(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(a&&{dq:a}),...(i&&{lq:i}),...(e.query&&{enableQuerySyntax:vF(e)}),...(p?.contextValues&&{context:p.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:S}},...(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:Ov(e),firstResult:e.pagination.firstResult}),tab:h,locale:C,timezone:b,...(e.debug!==void 0&&{debug:e.debug}),referrer:w,...E,...(P??{}),...(T&&{excerptLength:T}),...(D&&{dictionaryFieldContext:D}),sortCriteria:I,...(F&&{facetOptions:F}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},TF=(e,t)=>{let r=Pa(e)?.q,n=PF(e),o=Qr(e.configuration.analytics,t,{actionCause:Nv(e)}),a=ov(e),i=Qt(e.tabSet)||"default",p=t.referrer,{aq:f,cq:m}=kF(e),g=Kv(e),S=Wv(e),x=zv(e),h=iv(e)??[];return{q:r||"",...(n.length&&{facets:n}),citationsFieldToInclude:h,...(g?.length&&{searchHub:g}),...(S?.length&&{pipeline:S}),...(x?.contextValues&&{context:x.contextValues}),...(f&&{aq:f}),...(m&&{cq:m}),tab:i,referrer:p,...o,locale:a}},PF=e=>af(e)?.map(t=>Rv(t,wv())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),Aj=e=>({actionsHistory:e.configuration.analytics.enabled?Nt.getInstance().getHistory():[]}),kF=e=>{let t=CF(e),r=_v(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var hf=["searching","thinking","answering"];function yf(e){return e.toLowerCase()}var Sf=["search","generic"];function Yv(){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 OF=["text/plain","text/markdown"];var Ms=new L({required:!0}),_F=new L,Vs=new de({required:!0}),Jv={id:Ms,title:Ms,uri:Ms,permanentid:Ms,clickUri:_F},vf=new L({required:!0,constrainTo:OF}),NF=new L({required:!0,constrainTo:hf}),DF=e=>({...e,name:yf(e.name)}),js=k("generatedAnswer/setIsVisible",e=>O(e,Vs)),Ls=k("generatedAnswer/setAnswerId",e=>O(e,z)),Us=k("generatedAnswer/setAnswerGenerationMode",e=>O(e,new L({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),Qs=k("generatedAnswer/setIsEnabled",e=>O(e,Vs)),Oa=k("generatedAnswer/updateMessage",e=>O(e,{textDelta:Ms})),_a=k("generatedAnswer/updateCitations",e=>O(e,{citations:new se({required:!0,each:new X({values:Jv})})})),Na=k("generatedAnswer/updateError",e=>O(e,{message:_F,code:new re({min:0})})),dr=k("generatedAnswer/resetAnswer"),Af=k("generatedAnswer/like"),Cf=k("generatedAnswer/dislike"),xf=k("generatedAnswer/feedbackModal/open"),wl=k("generatedAnswer/expand"),bf=k("generatedAnswer/collapse"),wf=k("generatedAnswer/setId",e=>O(e,{id:new L({required:!0})})),Rf=k("generatedAnswer/feedbackModal/close"),Bs=k("generatedAnswer/sendFeedback"),dn=k("generatedAnswer/setIsLoading",e=>O(e,Vs)),ka=k("generatedAnswer/setIsStreaming",e=>O(e,Vs)),Da=k("generatedAnswer/setAnswerContentFormat",e=>O(e,vf)),Ff=k("generatedAnswer/updateResponseFormat",e=>O(e,{contentFormat:new se({each:vf,default:["text/plain"]})})),Ef=k("knowledge/updateAnswerConfigurationId",e=>O(e,Ms)),If=k("generatedAnswer/registerFieldsToIncludeInCitations",e=>O(e,Td)),Rl=k("generatedAnswer/setIsAnswerGenerated",e=>O(e,Vs)),qa=k("generatedAnswer/setCannotAnswer",e=>O(e,Vs)),Xv=k("generatedAnswer/setAnswerApiQueryParams",e=>O(e,new X({}))),Tf=k("generatedAnswer/startStep",e=>O(DF(e),{name:NF,startedAt:new re({min:0,required:!0})})),Pf=k("generatedAnswer/finishStep",e=>O(DF(e),{name:NF,finishedAt:new re({min:0,required:!0})})),kf=k("generatedAnswer/startToolCall",e=>O(e,{toolCallName:z,startedAt:new re({min:0,required:!0}),toolCallId:z})),Of=k("generatedAnswer/finishToolCall",e=>O(e,{finishedAt:new re({min:0,required:!0}),toolCallId:z})),Gs=k("generatedAnswer/toolCallArgs",e=>O(e,{toolCallId:z,args:new X({options:{required:!0}}),type:new L({required:!0,constrainTo:Sf})})),qF=xe("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:a}=t,{generatedAnswerAnalyticsClient:i}=o,{search:p}=a(),{queryExecuted:f}=p,{setAbortControllerRef:m}=e,g=yield EF(r),S=(C,b)=>{switch(C){case"genqa.headerMessageType":{let w=JSON.parse(b);n(Da(w.contentFormat));break}case"genqa.messageType":n(Oa(JSON.parse(b)));break;case"genqa.citationsType":n(_a(JSON.parse(b)));break;case"genqa.endOfStreamType":{let w=JSON.parse(b).answerGenerated,{answerId:F,answer:I}=a().generatedAnswer,T=f.length!==0&&!w,P=!I?.trim();n(qa(T)),n(ka(!1)),n(Rl(w)),n((i??Cr).logGeneratedAnswerStreamEnd(w,F,w?P:void 0)),n(To());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${C}"`)}};n(dn(!0));let x=C=>C.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,h=o.streamingClient?.streamGeneratedAnswer(g,{write:C=>{x(g)&&(n(dn(!1)),C.payload&&C.payloadType&&S(C.payloadType,C.payload))},abort:C=>{x(g)&&n(Na(C))},close:()=>{x(g)&&n(ka(!1))},resetAnswer:()=>{x(g)&&n(dr())}});h?m(h):n(dn(!1))});return function(_x127,_x128){return _ref46.apply(this,arguments)}}()),_f=xe("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(dr());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=IF(a,n);r(Xv(i)),yield r(Nf(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(_x129,_x130){return _ref47.apply(this,arguments)}}());d();c();l();u();var Cj=/*#__PURE__*/function(){var _ref48=_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=ji(n.configuration.search?.apiBaseUrl,i,a);return aF({baseUrl:`${m}/rest/organizations/${i}/answer/v1/configs/${p}`,fetchFn:function(){var _ref49=_asyncToGenerator(function*(g){if(g instanceof String)throw new Error("The provided 'request' must be a Request object.");let S=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(S,x)});return function fetchFn(_x134){return _ref49.apply(this,arguments)}}()})(f,{...t,signal:null},r)}catch(m){return{error:m}}});return function Cj(_x131,_x132,_x133){return _ref48.apply(this,arguments)}}(),Df=SF({reducerPath:"answer",baseQuery:sF(Cj,{maxRetries:3}),endpoints:()=>({})});var xj=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},bj=(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)},wj=(e,t)=>{delete e.error,e.citations=t.citations},Rj=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},Fj=(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})`)},Ej=(e,t,r,n)=>{let o=JSON.parse(e.data);o.finishReason==="ERROR"&&o.errorMessage&&Fj(t,o);let a=o.payload.length?JSON.parse(o.payload):{};switch(o.payloadType){case"genqa.headerMessageType":a.contentFormat&&(xj(t,a),r(Da(a.contentFormat)));break;case"genqa.messageType":typeof a.textDelta=="string"&&(bj(t,a),r(Oa({textDelta:a.textDelta})));break;case"genqa.citationsType":a.citations&&(wj(t,a),r(_a({citations:a.citations})));break;case"genqa.endOfStreamType":{Rj(t,a);let i=t.answerId,p=a.answerGenerated??!1,f=p?!t.answer?.trim():void 0;r(n.logGeneratedAnswerStreamEnd(p,i,f)),r(To());break}}},Ij=(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`},Ma=Df.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(_x135,_x136){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:a,extra:i}){yield n;let{configuration:p,generatedAnswer:f,insightConfiguration:m}=r(),{generatedAnswerAnalyticsClient:g}=i,{organizationId:S,environment:x,accessToken:h}=p,C=ji(p.search.apiBaseUrl,S,x),b=Ij(C,S,f.answerConfigurationId,m?.insightId);yield Cd(b,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${h}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},openWhenHidden:!0,fetch:v,onopen:function(){var _ref50=_asyncToGenerator(function*(w){let F=w.headers.get("x-answer-id");F&&o(I=>{I.answerId=F,a(Ls(F))})});return function onopen(_x137){return _ref50.apply(this,arguments)}}(),onmessage:w=>{o(F=>{Ej(w,F,a,g??Cr)})},onerror:w=>{throw w},onclose:()=>{o(w=>{a(qa(!w.generated))})}})}).apply(this,arguments)}})})}),Nf=e=>Ma.endpoints.getAnswer.initiate(e),Zv=e=>{let t=gf(e);return Ma.endpoints.getAnswer.select(t??Ta)(e)};d();c();l();u();var MF=ae(Ao,e=>e);d();c();l();u();function Tj(e){let t=e.payload?.analyticsAction;return VF(e)&&!pe(t)}function VF(e){return"type"in e}var jF=e=>t=>r=>{let n;Tj(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return VF(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();var $s=k("tab/register",e=>{let t=new X({values:{id:z,expression:Ge}});return O(e,t)}),yt=k("tab/updateActiveTab",e=>O(e,z));d();c();l();u();var qf=jr(Lp(),1),QF=jr(LF(),1),BF=jr(UF(),1);qf.default.extend(BF.default);qf.default.extend(QF.default);var Hs=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:qf.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 Pj=/(^|; )Coveo-Pendragon=([^;]*)/,kj=/(^|; )Coveo-SearchAgentDebug=([^;]*)/;function GF(){return typeof window>"u"?!1:Pj.exec(document.cookie)?.pop()||null}function $F(){return typeof window>"u"?!1:kj.test(document.cookie)}var Mf=ae(Hs(),e=>e.addCase(on,(t,r)=>{Oj(t,r.payload)}).addCase(Ar,(t,r)=>{_j(t,r.payload)}).addCase(Fo,(t,r)=>{Nj(t,r.payload)}).addCase(us,t=>{t.analytics.enabled=!1}).addCase(ls,t=>{t.analytics.enabled=!0}).addCase(Op,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(_p,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(yt,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(ds,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Me,(t,r)=>{pe(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(Np,(t,{payload:r})=>{Dj(t,r)}));function Oj(e,t){pe(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",pe(t.organizationId)||(e.organizationId=t.organizationId)}function _j(e,t){pe(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),pe(t.locale)||(e.search.locale=t.locale),pe(t.timezone)||(e.search.timezone=t.timezone),pe(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function Nj(e,t){pe(t.enabled)||(e.analytics.enabled=t.enabled),pe(t.originContext)||(e.analytics.originContext=t.originContext),pe(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),pe(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),pe(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),pe(t.trackingId)||(e.analytics.trackingId=t.trackingId),pe(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),pe(t.source)||(e.analytics.source=t.source);try{let r=GF();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}pe(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),pe(t.anonymous)||(e.analytics.anonymous=t.anonymous),pe(t.deviceId)||(e.analytics.deviceId=t.deviceId),pe(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),pe(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}function Dj(e,t){e.knowledge.agentId=t;try{$F()&&(e.knowledge.debugAgentSession=!0)}catch{}}var fe=Mf;d();c();l();u();function qj(e){return e.instantlyCallable}var HF=()=>e=>t=>e(qj(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 Dt=[];for(let e=0;e<256;++e)Dt.push((e+256).toString(16).slice(1));function zF(e,t=0){return(Dt[e[t+0]]+Dt[e[t+1]]+Dt[e[t+2]]+Dt[e[t+3]]+"-"+Dt[e[t+4]]+Dt[e[t+5]]+"-"+Dt[e[t+6]]+Dt[e[t+7]]+"-"+Dt[e[t+8]]+Dt[e[t+9]]+"-"+Dt[e[t+10]]+Dt[e[t+11]]+Dt[e[t+12]]+Dt[e[t+13]]+Dt[e[t+14]]+Dt[e[t+15]]).toLowerCase()}d();c();l();u();var oA,Mj=new Uint8Array(16);function aA(){if(!oA){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");oA=crypto.getRandomValues.bind(crypto)}return oA(Mj)}d();c();l();u();d();c();l();u();var Vj=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),iA={randomUUID:Vj};function jj(e,t,r){if(iA.randomUUID&&!t&&!e)return iA.randomUUID();e=e||{};let n=e.random??e.rng?.()??aA();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 zF(n)}var Lo=jj;d();c();l();u();d();c();l();u();var R={};Fu(R,{BRAND:()=>dL,DIRTY:()=>Va,EMPTY_PATH:()=>Bj,INVALID:()=>be,NEVER:()=>KL,OK:()=>Bt,ParseStatus:()=>qt,Schema:()=>Oe,ZodAny:()=>Bo,ZodArray:()=>ro,ZodBigInt:()=>La,ZodBoolean:()=>Ua,ZodBranded:()=>El,ZodCatch:()=>Xa,ZodDate:()=>Qa,ZodDefault:()=>Ja,ZodDiscriminatedUnion:()=>Lf,ZodEffects:()=>Tr,ZodEnum:()=>Ka,ZodError:()=>tr,ZodFirstPartyTypeKind:()=>we,ZodFunction:()=>Qf,ZodIntersection:()=>Ha,ZodIssueCode:()=>ee,ZodLazy:()=>za,ZodLiteral:()=>Wa,ZodMap:()=>Xs,ZodNaN:()=>ec,ZodNativeEnum:()=>Ya,ZodNever:()=>$r,ZodNull:()=>Ga,ZodNullable:()=>mn,ZodNumber:()=>ja,ZodObject:()=>rr,ZodOptional:()=>Er,ZodParsedType:()=>le,ZodPipeline:()=>Il,ZodPromise:()=>Go,ZodReadonly:()=>Za,ZodRecord:()=>Uf,ZodSchema:()=>Oe,ZodSet:()=>Zs,ZodString:()=>Qo,ZodSymbol:()=>Ys,ZodTransformer:()=>Tr,ZodTuple:()=>fn,ZodType:()=>Oe,ZodUndefined:()=>Ba,ZodUnion:()=>$a,ZodUnknown:()=>to,ZodVoid:()=>Js,addIssueToContext:()=>ce,any:()=>AL,array:()=>wL,bigint:()=>gL,boolean:()=>oE,coerce:()=>WL,custom:()=>tE,date:()=>hL,datetimeRegex:()=>ZF,defaultErrorMap:()=>Zn,discriminatedUnion:()=>IL,effect:()=>LL,enum:()=>ML,function:()=>NL,getErrorMap:()=>zs,getParsedType:()=>pn,instanceof:()=>fL,intersection:()=>TL,isAborted:()=>Vf,isAsync:()=>Ws,isDirty:()=>jf,isValid:()=>Uo,late:()=>pL,lazy:()=>DL,literal:()=>qL,makeIssue:()=>Fl,map:()=>OL,nan:()=>mL,nativeEnum:()=>VL,never:()=>xL,null:()=>vL,nullable:()=>QL,number:()=>nE,object:()=>RL,objectUtil:()=>sA,oboolean:()=>zL,onumber:()=>HL,optional:()=>UL,ostring:()=>$L,pipeline:()=>GL,preprocess:()=>BL,promise:()=>jL,quotelessJson:()=>Lj,record:()=>kL,set:()=>_L,setErrorMap:()=>Qj,strictObject:()=>FL,string:()=>rE,symbol:()=>yL,transformer:()=>LL,tuple:()=>PL,undefined:()=>SL,union:()=>EL,unknown:()=>CL,util:()=>De,void:()=>bL});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var De;(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})(De||(De={}));var sA;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(sA||(sA={}));var le=De.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pn=e=>{switch(typeof e){case"undefined":return le.undefined;case"string":return le.string;case"number":return Number.isNaN(e)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(e)?le.array:e===null?le.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?le.promise:typeof Map<"u"&&e instanceof Map?le.map:typeof Set<"u"&&e instanceof Set?le.set:typeof Date<"u"&&e instanceof Date?le.date:le.object;default:return le.unknown}};var ee=De.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"]),Lj=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),tr=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,De.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()}};tr.create=e=>new tr(e);var Uj=(e,t)=>{let r;switch(e.code){case ee.invalid_type:e.received===le.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ee.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,De.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:r=`Unrecognized key(s) in object: ${De.joinValues(e.keys,", ")}`;break;case ee.invalid_union:r="Invalid input";break;case ee.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${De.joinValues(e.options)}`;break;case ee.invalid_enum_value:r=`Invalid enum value. Expected ${De.joinValues(e.options)}, received '${e.received}'`;break;case ee.invalid_arguments:r="Invalid function arguments";break;case ee.invalid_return_type:r="Invalid function return type";break;case ee.invalid_date:r="Invalid date";break;case ee.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}"`:De.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ee.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 ee.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 ee.custom:r="Invalid input";break;case ee.invalid_intersection_types:r="Intersection results could not be merged";break;case ee.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ee.not_finite:r="Number must be finite";break;default:r=t.defaultError,De.assertNever(e)}return{message:r}},Zn=Uj;var WF=Zn;function Qj(e){WF=e}function zs(){return WF}d();c();l();u();var Fl=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}},Bj=[];function ce(e,t){let r=zs(),n=Fl({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Zn?void 0:Zn].filter(o=>!!o)});e.common.issues.push(n)}var qt=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 be;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 be;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}}},be=Object.freeze({status:"aborted"}),Va=e=>({status:"dirty",value:e}),Bt=e=>({status:"valid",value:e}),Vf=e=>e.status==="aborted",jf=e=>e.status==="dirty",Uo=e=>e.status==="valid",Ws=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 Ir=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}},KF=(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 tr(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 Oe=class{get description(){return this._def.description}_getType(t){return pn(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:pn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new qt,ctx:{common:t.parent.common,data:t.data,parsedType:pn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Ws(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:pn(t)},o=this._parseSync({data:t,path:n.path,parent:n});return KF(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:pn(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 _this24=this;return _asyncToGenerator(function*(){let n=yield _this24.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this25=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this25._def.errorMap,parent:null,data:t,parsedType:pn(t)},o=_this25._parse({data:t,path:n.path,parent:n}),a=yield Ws(o)?o:Promise.resolve(o);return KF(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:ee.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 Tr({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 Er.create(this,this._def)}nullable(){return mn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ro.create(this)}promise(){return Go.create(this,this._def)}or(t){return $a.create([this,t],this._def)}and(t){return Ha.create(this,t,this._def)}transform(t){return new Tr({...Te(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Ja({...Te(this._def),innerType:this,defaultValue:r,typeName:we.ZodDefault})}brand(){return new El({typeName:we.ZodBranded,type:this,...Te(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Xa({...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 Il.create(this,t)}readonly(){return Za.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Gj=/^c[^\s-]{8,}$/i,$j=/^[0-9a-z]+$/,Hj=/^[0-9A-HJKMNP-TV-Z]{26}$/i,zj=/^[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,Wj=/^[a-z0-9_-]{21}$/i,Kj=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Yj=/^[-+]?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)?)??$/,Jj=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Xj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",cA,Zj=/^(?:(?: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])$/,eL=/^(?:(?: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])$/,tL=/^(([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]))$/,rL=/^(([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])$/,nL=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,oL=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,JF="((\\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])))",aL=new RegExp(`^${JF}$`);function XF(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 iL(e){return new RegExp(`^${XF(e)}$`)}function ZF(e){let t=`${JF}T${XF(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 sL(e,t){return!!((t==="v4"||!t)&&Zj.test(e)||(t==="v6"||!t)&&tL.test(e))}function cL(e,t){if(!Kj.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 uL(e,t){return!!((t==="v4"||!t)&&eL.test(e)||(t==="v6"||!t)&&rL.test(e))}var Qo=class e extends Oe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==le.string){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:le.string,received:a.parsedType}),be}let n=new qt,o;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.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),ce(o,{code:ee.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?ce(o,{code:ee.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):p&&ce(o,{code:ee.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Jj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"email",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")cA||(cA=new RegExp(Xj,"u")),cA.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"emoji",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")zj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"uuid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")Wj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"nanoid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Gj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")$j.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid2",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Hj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ulid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ce(o,{validation:"url",code:ee.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),ce(o,{validation:"regex",code:ee.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),ce(o,{code:ee.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),ce(o,{code:ee.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?ZF(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?aL.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?iL(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?Yj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"duration",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?sL(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ip",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?cL(t.data,a.alg)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"jwt",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?uL(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cidr",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?nL.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?oL.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64url",code:ee.invalid_string,message:a.message}),n.dirty()):De.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:ee.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}};Qo.create=e=>new Qo({checks:[],typeName:we.ZodString,coerce:e?.coerce??!1,...Te(e)});function lL(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 ja=class e extends Oe{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)!==le.number){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:le.number,received:a.parsedType}),be}let n,o=new qt;for(let a of this._def.checks)a.kind==="int"?De.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.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),ce(n,{code:ee.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),ce(n,{code:ee.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?lL(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_finite,message:a.message}),o.dirty()):De.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"&&De.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)}};ja.create=e=>new ja({checks:[],typeName:we.ZodNumber,coerce:e?.coerce||!1,...Te(e)});var La=class e extends Oe{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)!==le.bigint)return this._getInvalidInput(t);let n,o=new qt;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),ce(n,{code:ee.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),ce(n,{code:ee.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),ce(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):De.assertNever(a);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return ce(r,{code:ee.invalid_type,expected:le.bigint,received:r.parsedType}),be}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}};La.create=e=>new La({checks:[],typeName:we.ZodBigInt,coerce:e?.coerce??!1,...Te(e)});var Ua=class extends Oe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==le.boolean){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.boolean,received:n.parsedType}),be}return Bt(t.data)}};Ua.create=e=>new Ua({typeName:we.ZodBoolean,coerce:e?.coerce||!1,...Te(e)});var Qa=class e extends Oe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==le.date){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:le.date,received:a.parsedType}),be}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_date}),be}let n=new qt,o;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.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),ce(o,{code:ee.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):De.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}};Qa.create=e=>new Qa({checks:[],coerce:e?.coerce||!1,typeName:we.ZodDate,...Te(e)});var Ys=class extends Oe{_parse(t){if(this._getType(t)!==le.symbol){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.symbol,received:n.parsedType}),be}return Bt(t.data)}};Ys.create=e=>new Ys({typeName:we.ZodSymbol,...Te(e)});var Ba=class extends Oe{_parse(t){if(this._getType(t)!==le.undefined){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.undefined,received:n.parsedType}),be}return Bt(t.data)}};Ba.create=e=>new Ba({typeName:we.ZodUndefined,...Te(e)});var Ga=class extends Oe{_parse(t){if(this._getType(t)!==le.null){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.null,received:n.parsedType}),be}return Bt(t.data)}};Ga.create=e=>new Ga({typeName:we.ZodNull,...Te(e)});var Bo=class extends Oe{constructor(){super(...arguments),this._any=!0}_parse(t){return Bt(t.data)}};Bo.create=e=>new Bo({typeName:we.ZodAny,...Te(e)});var to=class extends Oe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Bt(t.data)}};to.create=e=>new to({typeName:we.ZodUnknown,...Te(e)});var $r=class extends Oe{_parse(t){let r=this._getOrReturnCtx(t);return ce(r,{code:ee.invalid_type,expected:le.never,received:r.parsedType}),be}};$r.create=e=>new $r({typeName:we.ZodNever,...Te(e)});var Js=class extends Oe{_parse(t){if(this._getType(t)!==le.undefined){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.void,received:n.parsedType}),be}return Bt(t.data)}};Js.create=e=>new Js({typeName:we.ZodVoid,...Te(e)});var ro=class e extends Oe{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==le.array)return ce(r,{code:ee.invalid_type,expected:le.array,received:r.parsedType}),be;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,p=r.data.length<o.exactLength.value;(i||p)&&(ce(r,{code:i?ee.too_big:ee.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&&(ce(r,{code:ee.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&&(ce(r,{code:ee.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 Ir(r,i,r.path,p)))).then(i=>qt.mergeArray(n,i));let a=[...r.data].map((i,p)=>o.type._parseSync(new Ir(r,i,r.path,p)));return qt.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)}};ro.create=(e,t)=>new ro({type:e,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...Te(t)});function Ks(e){if(e instanceof rr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Er.create(Ks(n))}return new rr({...e._def,shape:()=>t})}else return e instanceof ro?new ro({...e._def,type:Ks(e.element)}):e instanceof Er?Er.create(Ks(e.unwrap())):e instanceof mn?mn.create(Ks(e.unwrap())):e instanceof fn?fn.create(e.items.map(t=>Ks(t))):e}var rr=class e extends Oe{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=De.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==le.object){let m=this._getOrReturnCtx(t);return ce(m,{code:ee.invalid_type,expected:le.object,received:m.parsedType}),be}let{status:n,ctx:o}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),p=[];if(!(this._def.catchall instanceof $r&&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],S=o.data[m];f.push({key:{status:"valid",value:m},value:g._parse(new Ir(o,S,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof $r){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&&(ce(o,{code:ee.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 S=o.data[g];f.push({key:{status:"valid",value:g},value:m._parse(new Ir(o,S,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 S=yield g.key,x=yield g.value;m.push({key:S,value:x,alwaysSet:g.alwaysSet})}return m})).then(m=>qt.mergeObjectSync(n,m)):qt.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 De.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 De.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Ks(this)}partial(t){let r={};for(let n of De.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 De.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Er;)a=a._def.innerType;r[n]=a}return new e({...this._def,shape:()=>r})}keyof(){return eE(De.objectKeys(this.shape))}};rr.create=(e,t)=>new rr({shape:()=>e,unknownKeys:"strip",catchall:$r.create(),typeName:we.ZodObject,...Te(t)});rr.strictCreate=(e,t)=>new rr({shape:()=>e,unknownKeys:"strict",catchall:$r.create(),typeName:we.ZodObject,...Te(t)});rr.lazycreate=(e,t)=>new rr({shape:e,unknownKeys:"strip",catchall:$r.create(),typeName:we.ZodObject,...Te(t)});var $a=class extends Oe{_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 tr(p.ctx.common.issues));return ce(r,{code:ee.invalid_union,unionErrors:i}),be}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref52=_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(_x138){return _ref52.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 tr(f));return ce(r,{code:ee.invalid_union,unionErrors:p}),be}}get options(){return this._def.options}};$a.create=(e,t)=>new $a({options:e,typeName:we.ZodUnion,...Te(t)});var eo=e=>e instanceof za?eo(e.schema):e instanceof Tr?eo(e.innerType()):e instanceof Wa?[e.value]:e instanceof Ka?e.options:e instanceof Ya?De.objectValues(e.enum):e instanceof Ja?eo(e._def.innerType):e instanceof Ba?[void 0]:e instanceof Ga?[null]:e instanceof Er?[void 0,...eo(e.unwrap())]:e instanceof mn?[null,...eo(e.unwrap())]:e instanceof El||e instanceof Za?eo(e.unwrap()):e instanceof Xa?eo(e._def.innerType):[],Lf=class e extends Oe{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==le.object)return ce(r,{code:ee.invalid_type,expected:le.object,received:r.parsedType}),be;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}):(ce(r,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),be)}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=eo(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 uA(e,t){let r=pn(e),n=pn(t);if(e===t)return{valid:!0,data:e};if(r===le.object&&n===le.object){let o=De.objectKeys(t),a=De.objectKeys(e).filter(p=>o.indexOf(p)!==-1),i={...e,...t};for(let p of a){let f=uA(e[p],t[p]);if(!f.valid)return{valid:!1};i[p]=f.data}return{valid:!0,data:i}}else if(r===le.array&&n===le.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=uA(i,p);if(!f.valid)return{valid:!1};o.push(f.data)}return{valid:!0,data:o}}else return r===le.date&&n===le.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Ha=class extends Oe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(a,i)=>{if(Vf(a)||Vf(i))return be;let p=uA(a.value,i.value);return p.valid?((jf(a)||jf(i))&&r.dirty(),{status:r.value,value:p.data}):(ce(n,{code:ee.invalid_intersection_types}),be)};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}))}};Ha.create=(e,t,r)=>new Ha({left:e,right:t,typeName:we.ZodIntersection,...Te(r)});var fn=class e extends Oe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.array)return ce(n,{code:ee.invalid_type,expected:le.array,received:n.parsedType}),be;if(n.data.length<this._def.items.length)return ce(n,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&n.data.length>this._def.items.length&&(ce(n,{code:ee.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 Ir(n,i,n.path,p)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>qt.mergeArray(r,i)):qt.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};fn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fn({items:e,typeName:we.ZodTuple,rest:null,...Te(t)})};var Uf=class e extends Oe{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!==le.object)return ce(n,{code:ee.invalid_type,expected:le.object,received:n.parsedType}),be;let o=[],a=this._def.keyType,i=this._def.valueType;for(let p in n.data)o.push({key:a._parse(new Ir(n,p,n.path,p)),value:i._parse(new Ir(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?qt.mergeObjectAsync(r,o):qt.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Oe?new e({keyType:t,valueType:r,typeName:we.ZodRecord,...Te(n)}):new e({keyType:Qo.create(),valueType:t,typeName:we.ZodRecord,...Te(r)})}},Xs=class extends Oe{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!==le.map)return ce(n,{code:ee.invalid_type,expected:le.map,received:n.parsedType}),be;let o=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([p,f],m)=>({key:o._parse(new Ir(n,p,n.path,[m,"key"])),value:a._parse(new Ir(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 be;(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 be;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}}};Xs.create=(e,t,r)=>new Xs({valueType:t,keyType:e,typeName:we.ZodMap,...Te(r)});var Zs=class e extends Oe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.set)return ce(n,{code:ee.invalid_type,expected:le.set,received:n.parsedType}),be;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(ce(n,{code:ee.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&&(ce(n,{code:ee.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 be;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 Ir(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)}};Zs.create=(e,t)=>new Zs({valueType:e,minSize:null,maxSize:null,typeName:we.ZodSet,...Te(t)});var Qf=class e extends Oe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==le.function)return ce(r,{code:ee.invalid_type,expected:le.function,received:r.parsedType}),be;function n(p,f){return Fl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,zs(),Zn].filter(m=>!!m),issueData:{code:ee.invalid_arguments,argumentsError:f}})}function o(p,f){return Fl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,zs(),Zn].filter(m=>!!m),issueData:{code:ee.invalid_return_type,returnTypeError:f}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Go){let p=this;return Bt(/*#__PURE__*/_asyncToGenerator(function*(...f){let m=new tr([]),g=yield p._def.args.parseAsync(f,a).catch(h=>{throw m.addIssue(n(f,h)),m}),S=yield Reflect.apply(i,this,g);return yield p._def.returns._def.type.parseAsync(S,a).catch(h=>{throw m.addIssue(o(S,h)),m})}))}else{let p=this;return Bt(function(...f){let m=p._def.args.safeParse(f,a);if(!m.success)throw new tr([n(f,m.error)]);let g=Reflect.apply(i,this,m.data),S=p._def.returns.safeParse(g,a);if(!S.success)throw new tr([o(g,S.error)]);return S.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:fn.create(t).rest(to.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||fn.create([]).rest(to.create()),returns:r||to.create(),typeName:we.ZodFunction,...Te(n)})}},za=class extends Oe{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})}};za.create=(e,t)=>new za({getter:e,typeName:we.ZodLazy,...Te(t)});var Wa=class extends Oe{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return ce(r,{received:r.data,code:ee.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:t.data}}get value(){return this._def.value}};Wa.create=(e,t)=>new Wa({value:e,typeName:we.ZodLiteral,...Te(t)});function eE(e,t){return new Ka({values:e,typeName:we.ZodEnum,...Te(t)})}var Ka=class e extends Oe{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{expected:De.joinValues(n),received:r.parsedType,code:ee.invalid_type}),be}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 ce(r,{received:r.data,code:ee.invalid_enum_value,options:n}),be}return Bt(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})}};Ka.create=eE;var Ya=class extends Oe{_parse(t){let r=De.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==le.string&&n.parsedType!==le.number){let o=De.objectValues(r);return ce(n,{expected:De.joinValues(o),received:n.parsedType,code:ee.invalid_type}),be}if(this._cache||(this._cache=new Set(De.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=De.objectValues(r);return ce(n,{received:n.data,code:ee.invalid_enum_value,options:o}),be}return Bt(t.data)}get enum(){return this._def.values}};Ya.create=(e,t)=>new Ya({values:e,typeName:we.ZodNativeEnum,...Te(t)});var Go=class extends Oe{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==le.promise&&r.common.async===!1)return ce(r,{code:ee.invalid_type,expected:le.promise,received:r.parsedType}),be;let n=r.parsedType===le.promise?r.data:Promise.resolve(r.data);return Bt(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Go.create=(e,t)=>new Go({type:e,typeName:we.ZodPromise,...Te(t)});var Tr=class extends Oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this26=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,a={addIssue:i=>{ce(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 _ref55=_asyncToGenerator(function*(p){if(r.value==="aborted")return be;let f=yield _this26._def.schema._parseAsync({data:p,path:n.path,parent:n});return f.status==="aborted"?be:f.status==="dirty"?Va(f.value):r.value==="dirty"?Va(f.value):f});return function(_x139){return _ref55.apply(this,arguments)}}());{if(r.value==="aborted")return be;let p=this._def.schema._parseSync({data:i,path:n.path,parent:n});return p.status==="aborted"?be:p.status==="dirty"?Va(p.value):r.value==="dirty"?Va(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"?be:(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"?be:(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 be;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})):be);De.assertNever(o)}};Tr.create=(e,t,r)=>new Tr({schema:e,typeName:we.ZodEffects,effect:t,...Te(r)});Tr.createWithPreprocess=(e,t,r)=>new Tr({schema:t,effect:{type:"preprocess",transform:e},typeName:we.ZodEffects,...Te(r)});var Er=class extends Oe{_parse(t){return this._getType(t)===le.undefined?Bt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Er.create=(e,t)=>new Er({innerType:e,typeName:we.ZodOptional,...Te(t)});var mn=class extends Oe{_parse(t){return this._getType(t)===le.null?Bt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};mn.create=(e,t)=>new mn({innerType:e,typeName:we.ZodNullable,...Te(t)});var Ja=class extends Oe{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===le.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ja.create=(e,t)=>new Ja({innerType:e,typeName:we.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Te(t)});var Xa=class extends Oe{_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 Ws(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new tr(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new tr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Xa.create=(e,t)=>new Xa({innerType:e,typeName:we.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Te(t)});var ec=class extends Oe{_parse(t){if(this._getType(t)!==le.nan){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.nan,received:n.parsedType}),be}return{status:"valid",value:t.data}}};ec.create=e=>new ec({typeName:we.ZodNaN,...Te(e)});var dL=Symbol("zod_brand"),El=class extends Oe{_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}},Il=class e extends Oe{_parse(t){var _this27=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let a=yield _this27._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?be:a.status==="dirty"?(r.dirty(),Va(a.value)):_this27._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"?be: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})}},Za=class extends Oe{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Uo(o)&&(o.value=Object.freeze(o.value)),o);return Ws(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Za.create=(e,t)=>new Za({innerType:e,typeName:we.ZodReadonly,...Te(t)});function YF(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function tE(e,t={},r){return e?Bo.create().superRefine((n,o)=>{let a=e(n);if(a instanceof Promise)return a.then(i=>{if(!i){let p=YF(t,n),f=p.fatal??r??!0;o.addIssue({code:"custom",...p,fatal:f})}});if(!a){let i=YF(t,n),p=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:p})}}):Bo.create()}var pL={object:rr.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 fL=(e,t={message:`Input not instance of ${e.name}`})=>tE(r=>r instanceof e,t),rE=Qo.create,nE=ja.create,mL=ec.create,gL=La.create,oE=Ua.create,hL=Qa.create,yL=Ys.create,SL=Ba.create,vL=Ga.create,AL=Bo.create,CL=to.create,xL=$r.create,bL=Js.create,wL=ro.create,RL=rr.create,FL=rr.strictCreate,EL=$a.create,IL=Lf.create,TL=Ha.create,PL=fn.create,kL=Uf.create,OL=Xs.create,_L=Zs.create,NL=Qf.create,DL=za.create,qL=Wa.create,ML=Ka.create,VL=Ya.create,jL=Go.create,LL=Tr.create,UL=Er.create,QL=mn.create,BL=Tr.createWithPreprocess,GL=Il.create,$L=()=>rE().optional(),HL=()=>nE().optional(),zL=()=>oE().optional(),WL={string:e=>Qo.create({...e,coerce:!0}),number:e=>ja.create({...e,coerce:!0}),boolean:e=>Ua.create({...e,coerce:!0}),bigint:e=>La.create({...e,coerce:!0}),date:e=>Qa.create({...e,coerce:!0})};var KL=be;var YL=R.object({name:R.string(),arguments:R.string()}),JL=R.object({id:R.string(),type:R.literal("function"),function:YL,encryptedValue:R.string().optional()}),Bf=R.object({id:R.string(),role:R.string(),content:R.string().optional(),name:R.string().optional(),encryptedValue:R.string().optional()}),XL=R.object({type:R.literal("text"),text:R.string()}),ZL=R.object({type:R.literal("data"),value:R.string(),mimeType:R.string()}),eU=R.object({type:R.literal("url"),value:R.string(),mimeType:R.string().optional()}),Gf=R.discriminatedUnion("type",[ZL,eU]),tU=R.object({type:R.literal("image"),source:Gf,metadata:R.unknown().optional()}),rU=R.object({type:R.literal("audio"),source:Gf,metadata:R.unknown().optional()}),nU=R.object({type:R.literal("video"),source:Gf,metadata:R.unknown().optional()}),oU=R.object({type:R.literal("document"),source:Gf,metadata:R.unknown().optional()});var aE=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()}),iE=(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"]})},Ede=aE.superRefine((e,t)=>{iE(e,t)}),aU=R.discriminatedUnion("type",[XL,tU,rU,nU,oU,aE]),iU=aU.superRefine((e,t)=>{e.type==="binary"&&iE(e,t)}),sU=Bf.extend({role:R.literal("developer"),content:R.string()}),cU=Bf.extend({role:R.literal("system"),content:R.string()}),uU=Bf.extend({role:R.literal("assistant"),content:R.string().optional(),toolCalls:R.array(JL).optional()}),lU=Bf.extend({role:R.literal("user"),content:R.union([R.string(),R.array(iU)])}),dU=R.object({id:R.string(),content:R.string(),role:R.literal("tool"),toolCallId:R.string(),error:R.string().optional(),encryptedValue:R.string().optional()}),pU=R.object({id:R.string(),role:R.literal("activity"),activityType:R.string(),content:R.record(R.any())}),fU=R.object({id:R.string(),role:R.literal("reasoning"),content:R.string(),encryptedValue:R.string().optional()}),sE=R.discriminatedUnion("role",[sU,cU,uU,lU,dU,pU,fU]),Ide=R.union([R.literal("developer"),R.literal("system"),R.literal("assistant"),R.literal("user"),R.literal("tool"),R.literal("activity"),R.literal("reasoning")]),mU=R.object({description:R.string(),value:R.string()}),cE=R.object({name:R.string(),description:R.string(),parameters:R.any(),metadata:R.record(R.any()).optional()}),gU=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()}),hU=R.object({interruptId:R.string(),status:R.enum(["resolved","cancelled"]),payload:R.any().optional()}),yU=R.object({threadId:R.string(),runId:R.string(),parentRunId:R.string().optional(),state:R.any(),messages:R.array(sE),tools:R.array(cE),context:R.array(mU),forwardedProps:R.any(),resume:R.array(hU).optional()}),SU=R.any(),Xe=class extends Error{constructor(e){super(e)}},lA=class extends Xe{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},vU=R.object({name:R.string(),description:R.string().optional()}),AU=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()}),CU=R.object({streaming:R.boolean().optional(),websocket:R.boolean().optional(),httpBinary:R.boolean().optional(),pushNotifications:R.boolean().optional(),resumable:R.boolean().optional()}),xU=R.object({supported:R.boolean().optional(),items:R.array(cE).optional(),parallelCalls:R.boolean().optional(),clientProvided:R.boolean().optional()}),bU=R.object({structuredOutput:R.boolean().optional(),supportedMimeTypes:R.array(R.string()).optional()}),wU=R.object({snapshots:R.boolean().optional(),deltas:R.boolean().optional(),memory:R.boolean().optional(),persistentState:R.boolean().optional()}),RU=R.object({supported:R.boolean().optional(),delegation:R.boolean().optional(),handoffs:R.boolean().optional(),subAgents:R.array(vU).optional()}),FU=R.object({supported:R.boolean().optional(),streaming:R.boolean().optional(),encrypted:R.boolean().optional()}),EU=R.object({image:R.boolean().optional(),audio:R.boolean().optional(),video:R.boolean().optional(),pdf:R.boolean().optional(),file:R.boolean().optional()}),IU=R.object({image:R.boolean().optional(),audio:R.boolean().optional()}),TU=R.object({input:EU.optional(),output:IU.optional()}),PU=R.object({codeExecution:R.boolean().optional(),sandboxed:R.boolean().optional(),maxIterations:R.number().optional(),maxExecutionTime:R.number().optional()}),kU=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()}),Tde=R.object({identity:AU.optional(),transport:CU.optional(),tools:xU.optional(),output:bU.optional(),state:wU.optional(),multiAgent:RU.optional(),reasoning:FU.optional(),multimodal:TU.optional(),execution:PU.optional(),humanInTheLoop:kU.optional(),custom:R.record(R.unknown()).optional()}),uE=R.union([R.literal("developer"),R.literal("system"),R.literal("assistant"),R.literal("user")]),M=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}({}),Le=R.object({type:R.nativeEnum(M),timestamp:R.number().optional(),rawEvent:R.any().optional()}).passthrough(),OU=Le.extend({type:R.literal(M.TEXT_MESSAGE_START),messageId:R.string(),role:uE.default("assistant"),name:R.string().optional()}),lE=Le.extend({type:R.literal(M.TEXT_MESSAGE_CONTENT),messageId:R.string(),delta:R.string()}),_U=Le.extend({type:R.literal(M.TEXT_MESSAGE_END),messageId:R.string()}),NU=Le.extend({type:R.literal(M.TEXT_MESSAGE_CHUNK),messageId:R.string().optional(),role:uE.optional(),delta:R.string().optional(),name:R.string().optional()}),DU=Le.extend({type:R.literal(M.THINKING_TEXT_MESSAGE_START)}),qU=lE.omit({messageId:!0,type:!0}).extend({type:R.literal(M.THINKING_TEXT_MESSAGE_CONTENT)}),MU=Le.extend({type:R.literal(M.THINKING_TEXT_MESSAGE_END)}),VU=Le.extend({type:R.literal(M.TOOL_CALL_START),toolCallId:R.string(),toolCallName:R.string(),parentMessageId:R.string().nullable().optional().transform(e=>e??void 0)}),jU=Le.extend({type:R.literal(M.TOOL_CALL_ARGS),toolCallId:R.string(),delta:R.string()}),LU=Le.extend({type:R.literal(M.TOOL_CALL_END),toolCallId:R.string()}),UU=Le.extend({messageId:R.string(),type:R.literal(M.TOOL_CALL_RESULT),toolCallId:R.string(),content:R.string(),role:R.literal("tool").optional()}),QU=Le.extend({type:R.literal(M.TOOL_CALL_CHUNK),toolCallId:R.string().optional(),toolCallName:R.string().optional(),parentMessageId:R.string().nullable().optional().transform(e=>e??void 0),delta:R.string().optional()}),BU=Le.extend({type:R.literal(M.THINKING_START),title:R.string().optional()}),GU=Le.extend({type:R.literal(M.THINKING_END)}),$U=Le.extend({type:R.literal(M.STATE_SNAPSHOT),snapshot:SU}),HU=Le.extend({type:R.literal(M.STATE_DELTA),delta:R.array(R.any())}),zU=Le.extend({type:R.literal(M.MESSAGES_SNAPSHOT),messages:R.array(sE)}),WU=Le.extend({type:R.literal(M.ACTIVITY_SNAPSHOT),messageId:R.string(),activityType:R.string(),content:R.record(R.any()),replace:R.boolean().optional().default(!0)}),KU=Le.extend({type:R.literal(M.ACTIVITY_DELTA),messageId:R.string(),activityType:R.string(),patch:R.array(R.any())}),YU=Le.extend({type:R.literal(M.RAW),event:R.any(),source:R.string().optional()}),JU=Le.extend({type:R.literal(M.CUSTOM),name:R.string(),value:R.any()}),XU=Le.extend({type:R.literal(M.RUN_STARTED),threadId:R.string(),runId:R.string(),parentRunId:R.string().optional(),input:yU.optional()}),ZU=R.object({type:R.literal("success")}).strict(),eQ=R.object({type:R.literal("interrupt"),interrupts:R.array(gU).min(1)}).strict(),tQ=R.discriminatedUnion("type",[ZU,eQ]),dE=R.object({provider:R.string().optional(),model:R.string().optional(),inputTokens:R.number().int().nonnegative().optional(),outputTokens:R.number().int().nonnegative().optional(),totalTokens:R.number().int().nonnegative().optional(),reasoningTokens:R.number().int().nonnegative().optional(),cachedInputTokens:R.number().int().nonnegative().optional()}),rQ=Le.extend({type:R.literal(M.RUN_FINISHED),threadId:R.string(),runId:R.string(),result:R.any().optional(),outcome:tQ.nullable().optional().transform(e=>e??void 0),usage:R.array(dE).optional()}),nQ=Le.extend({type:R.literal(M.RUN_ERROR),message:R.string(),code:R.string().optional(),usage:R.array(dE).optional()}),oQ=Le.extend({type:R.literal(M.STEP_STARTED),stepName:R.string()}),aQ=Le.extend({type:R.literal(M.STEP_FINISHED),stepName:R.string()}),iQ=R.union([R.literal("tool-call"),R.literal("message")]),sQ=Le.extend({type:R.literal(M.REASONING_START),messageId:R.string()}),cQ=Le.extend({type:R.literal(M.REASONING_MESSAGE_START),messageId:R.string(),role:R.literal("reasoning")}),uQ=Le.extend({type:R.literal(M.REASONING_MESSAGE_CONTENT),messageId:R.string(),delta:R.string()}),lQ=Le.extend({type:R.literal(M.REASONING_MESSAGE_END),messageId:R.string()}),dQ=Le.extend({type:R.literal(M.REASONING_MESSAGE_CHUNK),messageId:R.string().optional(),delta:R.string().optional()}),pQ=Le.extend({type:R.literal(M.REASONING_END),messageId:R.string()}),fQ=Le.extend({type:R.literal(M.REASONING_ENCRYPTED_VALUE),subtype:iQ,entityId:R.string(),encryptedValue:R.string()}),$f=R.discriminatedUnion("type",[OU,lE,_U,NU,BU,GU,DU,qU,MU,VU,jU,LU,QU,UU,$U,HU,zU,WU,KU,YU,JU,XU,rQ,nQ,oQ,aQ,sQ,cQ,uQ,lQ,dQ,pQ,fQ]);d();c();l();u();var dA={};Fu(dA,{JsonPatchError:()=>at,_areEquals:()=>kl,applyOperation:()=>ei,applyPatch:()=>Xf,applyReducer:()=>SQ,deepClone:()=>hQ,getValueByPointer:()=>Yf,validate:()=>fE,validator:()=>Jf});d();c();l();u();d();c();l();u();var mQ=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)}}(),gQ=Object.prototype.hasOwnProperty;function zf(e,t){return gQ.call(e,t)}function Wf(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)zf(e,o)&&n.push(o);return n}function Mt(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Kf(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 gn(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Tl(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Hf(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Hf(e[t]))return!0}else if(typeof e=="object"){for(var n=Wf(e),o=n.length,a=0;a<o;a++)if(Hf(e[n[a]]))return!0}}return!1}function pE(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
|
+
`)}var Pl=function(e){mQ(t,e);function t(r,n,o,a,i){var p=this.constructor,f=e.call(this,pE(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=pE(r,{name:n,index:o,operation:a,tree:i}),f}return t}(Error);var at=Pl,hQ=Mt,tc={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=Yf(r,this.path);n&&(n=Mt(n));var o=ei(r,{op:"remove",path:this.from}).removed;return ei(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=Yf(r,this.from);return ei(r,{op:"add",path:this.path,value:Mt(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:kl(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},yQ={add:function(e,t,r){return Kf(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:tc.move,copy:tc.copy,test:tc.test,_get:tc._get};function Yf(e,t){if(t=="")return e;var r={op:"_get",path:t};return ei(e,r),r.value}function ei(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):Jf(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=Yf(e,t.from),t.op==="move"&&(i.removed=e),i;if(t.op==="test"){if(i.test=kl(e,t.value),i.test===!1)throw new at("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 at("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,t,e);return i}}else{n||(e=Mt(e));var p=t.path||"",f=p.split("/"),m=e,g=1,S=f.length,x=void 0,h=void 0,C=void 0;for(typeof r=="function"?C=r:C=Jf;;){if(h=f[g],h&&h.indexOf("~")!=-1&&(h=Tl(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==S-1&&(x=t.path),x!==void 0&&C(t,0,e,x)),g++,Array.isArray(m)){if(h==="-")h=m.length;else{if(r&&!Kf(h))throw new at("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);Kf(h)&&(h=~~h)}if(g>=S){if(r&&t.op==="add"&&h>m.length)throw new at("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=yQ[t.op].call(t,m,h,e);if(i.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}}else if(g>=S){var i=tc[t.op].call(t,m,h,e);if(i.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}if(m=m[h],r&&g<S&&(!m||typeof m!="object"))throw new at("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",a,t,e)}}}function Xf(e,t,r,n,o){if(n===void 0&&(n=!0),o===void 0&&(o=!0),r&&!Array.isArray(t))throw new at("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=Mt(e));for(var a=new Array(t.length),i=0,p=t.length;i<p;i++)a[i]=ei(e,t[i],r,!0,o,i),e=a[i].newDocument;return a.newDocument=e,a}function SQ(e,t,r){var n=ei(e,t);if(n.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function Jf(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new at("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(tc[e.op]){if(typeof e.path!="string")throw new at("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new at("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 at("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 at("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")&&Hf(e.value))throw new at("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 at("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 at("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=fE([i],r);if(p&&p.name==="OPERATION_PATH_UNRESOLVABLE")throw new at("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new at("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function fE(e,t,r){try{if(!Array.isArray(e))throw new at("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Xf(Mt(t),Mt(e),r||!0);else{r=r||Jf;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(o){if(o instanceof at)return o;throw o}}function kl(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(!kl(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],!kl(e[i],t[i]))return!1;return!0}return e!==e&&t!==t}var gA={};Fu(gA,{compare:()=>FQ,generate:()=>pA,observe:()=>RQ,unobserve:()=>wQ});d();c();l();u();var fA=new WeakMap,vQ=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),AQ=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function CQ(e){return fA.get(e)}function xQ(e,t){return e.observers.get(t)}function bQ(e,t){e.observers.delete(t.callback)}function wQ(e,t){t.unobserve()}function RQ(e,t){var r=[],n,o=CQ(e);if(!o)o=new vQ(e),fA.set(e,o);else{var a=xQ(o,t);n=a&&a.observer}if(n)return n;if(n={},o.value=Mt(e),t){n.callback=t,n.next=null;var i=function(){pA(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(){pA(n),clearTimeout(n.next),bQ(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 AQ(t,n)),n}function pA(e,t){t===void 0&&(t=!1);var r=fA.get(e.object);mA(r.value,e.object,e.patches,"",t),e.patches.length&&Xf(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function mA(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var a=Wf(t),i=Wf(e),p=!1,f=!1,m=i.length-1;m>=0;m--){var g=i[m],S=e[g];if(zf(t,g)&&!(t[g]===void 0&&S!==void 0&&Array.isArray(t)===!1)){var x=t[g];typeof S=="object"&&S!=null&&typeof x=="object"&&x!=null&&Array.isArray(S)===Array.isArray(x)?mA(S,x,r,n+"/"+gn(g),o):S!==x&&(p=!0,o&&r.push({op:"test",path:n+"/"+gn(g),value:Mt(S)}),r.push({op:"replace",path:n+"/"+gn(g),value:Mt(x)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+gn(g),value:Mt(S)}),r.push({op:"remove",path:n+"/"+gn(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];!zf(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+gn(g),value:Mt(t[g])})}}}function FQ(e,t,r){r===void 0&&(r=!1);var n=[];return mA(e,t,n,"",r),n}var Zf=Object.assign({},dA,gA,{JsonPatchError:Pl,deepClone:Mt,escapePathComponent:gn,unescapePathComponent:Tl});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var hA=function(e,t){return hA=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])},hA(e,t)};function hn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");hA(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function mE(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(S){i(S)}}function f(g){try{m(n.throw(g))}catch(S){i(S)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}function em(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 no(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 rc(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 nc(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 ti(e){return this instanceof ti?(this.v=e,this):new ti(e)}function gE(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(C){return Promise.resolve(C).then(h,S)}}function p(h,C){n[h]&&(o[h]=function(b){return new Promise(function(w,F){a.push([h,b,w,F])>1||f(h,b)})},C&&(o[h]=C(o[h])))}function f(h,C){try{m(n[h](C))}catch(b){x(a[0][3],b)}}function m(h){h.value instanceof ti?Promise.resolve(h.value.v).then(g,S):x(a[0][2],h)}function g(h){f("next",h)}function S(h){f("throw",h)}function x(h,C){h(C),a.shift(),a.length&&f(a[0][0],a[0][1])}}function hE(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 no=="function"?no(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 Ne(e){return typeof e=="function"}d();c();l();u();d();c();l();u();d();c();l();u();function oc(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 tm=oc(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
|
-
`):"",this.name="UnsubscriptionError",this.errors=r}});d();c();u();l();function Pu(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var oc=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=no(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(_e(g))try{g()}catch(b){a=b instanceof Zf?b.errors:[b]}var y=this._finalizers;if(y){this._finalizers=null;try{for(var x=no(y),v=x.next();!v.done;v=x.next()){var C=v.value;try{mE(C)}catch(b){a=a??[],b instanceof Zf?a=rc(rc([],tc(a)),tc(b.errors)):a.push(b)}}}catch(b){n={error:b}}finally{try{v&&!v.done&&(o=x.return)&&o.call(x)}finally{if(n)throw n.error}}}if(a)throw new Zf(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)mE(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)&&Pu(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Pu(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var gA=oc.EMPTY;function em(e){return e instanceof oc||e&&"closed"in e&&_e(e.remove)&&_e(e.add)&&_e(e.unsubscribe)}function mE(e){_e(e)?e():e.unsubscribe()}d();c();u();l();var Hr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};d();c();u();l();d();c();u();l();var ac={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=ac.delegate;return o?.setTimeout?o.setTimeout.apply(o,rc([e,t],tc(r))):setTimeout.apply(void 0,rc([e,t],tc(r)))},clearTimeout:function(e){var t=ac.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function tm(e){ac.setTimeout(function(){var t=Hr.onUnhandledError;if(t)t(e);else throw e})}d();c();u();l();function ku(){}d();c();u();l();var gE=function(){return hA("C",void 0,void 0)}();function hE(e){return hA("E",void 0,e)}function yE(e){return hA("N",e,void 0)}function hA(e,t,r){return{kind:e,value:t,error:r}}d();c();u();l();var ri=null;function ic(e){if(Hr.useDeprecatedSynchronousErrorHandling){var t=!ri;if(t&&(ri={errorThrown:!1,error:null}),e(),t){var r=ri,n=r.errorThrown,o=r.error;if(ri=null,n)throw o}}else e()}function SE(e){Hr.useDeprecatedSynchronousErrorHandling&&ri&&(ri.errorThrown=!0,ri.error=e)}var Ou=function(e){hn(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,em(r)&&r.add(n)):n.destination=wQ,n}return t.create=function(r,n,o){return new nm(r,n,o)},t.prototype.next=function(r){this.isStopped?SA(yE(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?SA(hE(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?SA(gE,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}(oc);var CQ=Function.prototype.bind;function yA(e,t){return CQ.call(e,t)}var xQ=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){rm(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){rm(n)}else rm(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){rm(r)}},e}(),nm=function(e){hn(t,e);function t(r,n,o){var a=e.call(this)||this,i;if(_e(r)||!r)i={next:r??void 0,error:n??void 0,complete:o??void 0};else{var p;a&&Hr.useDeprecatedNextContext?(p=Object.create(r),p.unsubscribe=function(){return a.unsubscribe()},i={next:r.next&&yA(r.next,p),error:r.error&&yA(r.error,p),complete:r.complete&&yA(r.complete,p)}):i=r}return a.destination=new xQ(i),a}return t}(Ou);function rm(e){Hr.useDeprecatedSynchronousErrorHandling?SE(e):tm(e)}function bQ(e){throw e}function SA(e,t){var r=Hr.onStoppedNotification;r&&ac.setTimeout(function(){return r(e,t)})}var wQ={closed:!0,next:ku,error:bQ,complete:ku};d();c();u();l();var sc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();d();c();u();l();d();c();u();l();function cc(e){return e}function om(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return vA(e)}function vA(e){return e.length===0?cc:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var Ze=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=FQ(t)?t:new nm(t,r,n);return ic(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=vE(r),new r(function(o,a){var i=new nm({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[sc]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return vA(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=vE(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 vE(e){var t;return(t=e??Hr.Promise)!==null&&t!==void 0?t:Promise}function RQ(e){return e&&_e(e.next)&&_e(e.error)&&_e(e.complete)}function FQ(e){return e&&e instanceof Ou||RQ(e)&&em(e)}d();c();u();l();function EQ(e){return _e(e?.lift)}function mt(e){return function(t){if(EQ(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();u();l();function Ct(e,t,r,n,o){return new IQ(e,t,r,n,o)}var IQ=function(e){hn(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}(Ou);d();c();u();l();d();c();u();l();var AE=nc(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var yn=function(e){hn(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 CE(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new AE},t.prototype.next=function(r){var n=this;ic(function(){var o,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var i=no(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;ic(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;ic(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?gA:(this.currentObservers=null,p.push(r),new oc(function(){n.currentObservers=null,Pu(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 Ze;return r.source=this,r},t.create=function(r,n){return new CE(r,n)},t}(Ze);var CE=function(e){hn(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:gA},t}(yn);d();c();u();l();d();c();u();l();var AA={now:function(){return(AA.delegate||Date).now()},delegate:void 0};var am=function(e){hn(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=AA);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}(yn);d();c();u();l();var im=new Ze(function(e){return e.complete()});d();c();u();l();d();c();u();l();d();c();u();l();function xE(e){return e&&_e(e.schedule)}function TQ(e){return e[e.length-1]}function bE(e){return xE(TQ(e))?e.pop():void 0}d();c();u();l();d();c();u();l();d();c();u();l();d();c();u();l();d();c();u();l();var sm=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};d();c();u();l();function cm(e){return _e(e?.then)}d();c();u();l();function lm(e){return _e(e[sc])}d();c();u();l();function um(e){return Symbol.asyncIterator&&_e(e?.[Symbol.asyncIterator])}d();c();u();l();function dm(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();u();l();d();c();u();l();function PQ(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var pm=PQ();function fm(e){return _e(e?.[pm])}d();c();u();l();function mm(e){return pE(this,arguments,function(){var r,n,o,a;return Xf(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,ti(r.read())];case 3:return n=i.sent(),o=n.value,a=n.done,a?[4,ti(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,ti(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 gm(e){return _e(e?.getReader)}function xt(e){if(e instanceof Ze)return e;if(e!=null){if(lm(e))return kQ(e);if(sm(e))return OQ(e);if(cm(e))return NQ(e);if(um(e))return wE(e);if(fm(e))return _Q(e);if(gm(e))return DQ(e)}throw dm(e)}function kQ(e){return new Ze(function(t){var r=e[sc]();if(_e(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function OQ(e){return new Ze(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function NQ(e){return new Ze(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,tm)})}function _Q(e){return new Ze(function(t){var r,n;try{for(var o=no(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 wE(e){return new Ze(function(t){qQ(e,t).catch(function(r){return t.error(r)})})}function DQ(e){return wE(mm(e))}function qQ(e,t){var r,n,o,a;return dE(this,void 0,void 0,function(){var i,p;return Xf(this,function(f){switch(f.label){case 0:f.trys.push([0,5,6,11]),r=fE(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();u();l();d();c();u();l();function Pr(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 hm(e,t){return t===void 0&&(t=0),mt(function(r,n){r.subscribe(Ct(n,function(o){return Pr(n,e,function(){return n.next(o)},t)},function(){return Pr(n,e,function(){return n.complete()},t)},function(o){return Pr(n,e,function(){return n.error(o)},t)}))})}d();c();u();l();function ym(e,t){return t===void 0&&(t=0),mt(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function RE(e,t){return xt(e).pipe(ym(t),hm(t))}d();c();u();l();function FE(e,t){return xt(e).pipe(ym(t),hm(t))}d();c();u();l();function EE(e,t){return new Ze(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}d();c();u();l();function IE(e,t){return new Ze(function(r){var n;return Pr(r,t,function(){n=e[pm](),Pr(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 _e(n?.return)&&n.return()}})}d();c();u();l();function Sm(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ze(function(r){Pr(r,t,function(){var n=e[Symbol.asyncIterator]();Pr(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}d();c();u();l();function TE(e,t){return Sm(mm(e),t)}function PE(e,t){if(e!=null){if(lm(e))return RE(e,t);if(sm(e))return EE(e,t);if(cm(e))return FE(e,t);if(um(e))return Sm(e,t);if(fm(e))return IE(e,t);if(gm(e))return TE(e,t)}throw dm(e)}function ni(e,t){return t?PE(e,t):xt(e)}function ot(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=bE(e);return ni(e,r)}d();c();u();l();function et(e,t){var r=_e(e)?e:function(){return e},n=function(o){return o.error(r())};return new Ze(t?function(o){return t.schedule(n,0,o)}:n)}d();c();u();l();d();c();u();l();var kE=nc(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function vm(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 kE)}})})}d();c();u();l();function oi(e,t){return mt(function(r,n){var o=0;r.subscribe(Ct(n,function(a){n.next(e.call(t,a,o++))}))})}d();c();u();l();d();c();u();l();d();c();u();l();function OE(e,t,r,n,o,a,i,p){var f=[],m=0,g=0,y=!1,x=function(){y&&!f.length&&!m&&t.complete()},v=function(b){return m<n?C(b):f.push(b)},C=function(b){a&&t.next(b),m++;var w=!1;xt(r(b,g++)).subscribe(Ct(t,function(F){o?.(F),a?v(F):t.next(F)},function(){w=!0},void 0,function(){if(w)try{m--;for(var F=function(){var I=f.shift();i?Pr(t,i,function(){return C(I)}):C(I)};f.length&&m<n;)F();x()}catch(I){t.error(I)}}))};return e.subscribe(Ct(t,v,function(){y=!0,x()})),function(){p?.()}}function nr(e,t,r){return r===void 0&&(r=1/0),_e(t)?nr(function(n,o){return oi(function(a,i){return t(n,a,o,i)})(xt(e(n,o)))},r):(typeof t=="number"&&(r=t),mt(function(n,o){return OE(n,o,e,r)}))}function CA(e){return e===void 0&&(e=1/0),nr(cc,e)}d();c();u();l();function Am(e){return new Ze(function(t){xt(e()).subscribe(t)})}d();c();u();l();function Nu(e){return mt(function(t,r){var n=null,o=!1,a;n=t.subscribe(Ct(r,void 0,void 0,function(i){a=xt(e(i,Nu(e)(t))),n?(n.unsubscribe(),n=null,a.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,a.subscribe(r))})}d();c();u();l();function Cm(e,t){return _e(t)?nr(e,t,1):nr(e,1)}d();c();u();l();function xA(e){return mt(function(t,r){var n=!1;t.subscribe(Ct(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}d();c();u();l();function ai(e){return mt(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}d();c();u();l();function bA(e,t){return mt(function(r,n){var o=null,a=0,i=!1,p=function(){return i&&!o&&n.complete()};r.subscribe(Ct(n,function(f){o?.unsubscribe();var m=0,g=a++;xt(e(f,g)).subscribe(o=Ct(n,function(y){return n.next(t?t(f,y,g,m++):y)},function(){o=null,p()}))},function(){i=!0,p()}))})}d();c();u();l();function xm(e){return mt(function(t,r){xt(e).subscribe(Ct(r,function(){return r.complete()},ku)),!r.closed&&t.subscribe(r)})}d();c();u();l();function wA(e,t,r){var n=_e(e)||t||r?{next:e,error:t,complete:r}:e;return n?mt(function(o,a){var i;(i=n.subscribe)===null||i===void 0||i.call(n);var p=!0;o.subscribe(Ct(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)}))}):cc}d();c();u();l();d();c();u();l();function NE(e){return` \r
|
|
36
|
-
`.indexOf(e)>=0}function bm(e){for(var t=["topLevel"],r=0,n,o,a,i=function(I){return t.push(I)},p=function(I){return t[t.length-1]=I},f=function(I){n==null&&(n=r,o=t.length,a=I)},m=function(I){I===a&&(n=void 0,o=void 0,a=void 0)},g=function(){return t.pop()},y=function(){return r--},x=function(I){if("0"<=I&&I<="9"){i("number");return}switch(I){case"\"":i("string");return;case"-":i("numberNeedsDigit");return;case"t":i("true");return;case"f":i("false");return;case"n":i("null");return;case"[":i("arrayNeedsValue");return;case"{":i("objectNeedsKey");return}},v=e.length;r<v;r++){var C=e[r];switch(t[t.length-1]){case"topLevel":x(C);break;case"string":switch(C){case"\"":g();break;case"\\":f("stringEscape"),i("stringEscaped");break}break;case"stringEscaped":C==="u"?i("stringUnicode"):(m("stringEscape"),g());break;case"stringUnicode":r-e.lastIndexOf("u",r)===4&&(m("stringEscape"),g());break;case"number":C==="."?p("numberNeedsDigit"):C==="e"||C==="E"?p("numberNeedsExponent"):(C<"0"||C>"9")&&(y(),g());break;case"numberNeedsDigit":p("number");break;case"numberNeedsExponent":p(C==="+"||C==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(C<"a"||C>"z")&&(y(),g());break;case"arrayNeedsValue":C==="]"?g():NE(C)||(m("collectionItem"),p("arrayNeedsComma"),x(C));break;case"arrayNeedsComma":C==="]"?g():C===","&&(f("collectionItem"),p("arrayNeedsValue"));break;case"objectNeedsKey":C==="}"?g():C==="\""&&(f("collectionItem"),p("objectNeedsColon"),i("string"));break;case"objectNeedsColon":C===":"&&p("objectNeedsValue");break;case"objectNeedsValue":NE(C)||(m("collectionItem"),p("objectNeedsComma"),x(C));break;case"objectNeedsComma":C==="}"?g():C===","&&(f("collectionItem"),p("objectNeedsKey"));break}}o!=null&&(t.length=o);for(var b=[n!=null?e.slice(0,n):e],w=function(I){return b.push(I.slice(e.length-e.lastIndexOf(I[0])))},F=t.length-1;F>=0;F--)switch(t[F]){case"string":b.push("\"");break;case"numberNeedsDigit":case"numberNeedsExponent":b.push("0");break;case"true":w("true");break;case"false":w("false");break;case"null":w("null");break;case"arrayNeedsValue":case"arrayNeedsComma":b.push("]");break;case"objectNeedsKey":case"objectNeedsColon":case"objectNeedsValue":case"objectNeedsComma":b.push("}");break}return b.join("")}d();c();u();l();d();c();u();l();d();c();u();l();function DE(){let e=this.buf,t=this.pos,r=0,n=0;for(let a=0;a<28;a+=7){let i=e[t++];if(r|=(i&127)<<a,(i&128)==0){this.pos=t,this.assertBounds(),this.varint64Lo=r,this.varint64Hi=n;return}}let o=e[t++];if(r|=(o&15)<<28,n=(o&112)>>4,(o&128)==0){this.pos=t,this.assertBounds(),this.varint64Lo=r,this.varint64Hi=n;return}for(let a=3;a<=31;a+=7){let i=e[t++];if(n|=(i&127)<<a,(i&128)==0){this.pos=t,this.assertBounds(),this.varint64Lo=r,this.varint64Hi=n;return}}throw new Error("invalid varint")}var wm=4294967296;function RA(e){let t=e[0]==="-";t&&(e=e.slice(1));let r=1e6,n=0,o=0;function a(i,p){let f=Number(e.slice(i,p));o*=r,n=n*r+f,n>=wm&&(o=o+(n/wm|0),n=n%wm)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?ME(n,o):EA(n,o)}function qE(e,t){let r=EA(e,t),n=r.hi&2147483648;n&&(r=ME(r.lo,r.hi));let o=FA(r.lo,r.hi);return n?"-"+o:o}function FA(e,t){if({lo:e,hi:t}=MQ(e,t),t<=2097151)return String(wm*t+e);let r=e&16777215,n=(e>>>24|t<<8)&16777215,o=t>>16&65535,a=r+n*6777216+o*6710656,i=n+o*8147497,p=o*2,f=1e7;return a>=f&&(i+=Math.floor(a/f),a%=f),i>=f&&(p+=Math.floor(i/f),i%=f),p.toString()+_E(i)+_E(a)}function MQ(e,t){return{lo:e>>>0,hi:t>>>0}}function EA(e,t){return{lo:e|0,hi:t|0}}function ME(e,t){return t=~t,e?e=~e+1:t+=1,EA(e,t)}var _E=e=>{let t=String(e);return"0000000".slice(t.length)+t};function jE(){let e=this.buf[this.pos++];if((e&128)===0)return this.assertBounds(),e;let t=e&127;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)===0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)===0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)===0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!==0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}d();c();u();l();var zr=jQ();function jQ(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!h.Deno||!!h.Bun||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let r=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),o=BigInt("0"),a=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(i){let p=typeof i=="bigint"?i:BigInt(i);if(p>n||p<r)throw new Error(`invalid int64: ${i}`);return p},uParse(i){let p=typeof i=="bigint"?i:BigInt(i);if(p>a||p<o)throw new Error(`invalid uint64: ${i}`);return p},enc(i){return e.setBigInt64(0,this.parse(i),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(i){return e.setBigInt64(0,this.uParse(i),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(i,p){return e.setInt32(0,i,!0),e.setInt32(4,p,!0),e.getBigInt64(0,!0)},uDec(i,p){return e.setInt32(0,i,!0),e.setInt32(4,p,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),VE(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),LE(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),VE(r),RA(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),LE(r),RA(r)},dec(r,n){return qE(r,n)},uDec(r,n){return FA(r,n)}}}function VE(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function LE(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}d();c();u();l();var IA=Symbol.for("@bufbuild/protobuf/text-encoding");function VQ(e){var t;h[IA]=Object.assign(Object.assign({},e),{encodeUtf8Into:(t=e.encodeUtf8Into)!==null&&t!==void 0?t:PA(e.encodeUtf8.bind(e))})}function TA(){let e=h;if(!e[IA]){let t=new e.TextEncoder,r=new e.TextDecoder,n,o={encodeUtf8(i){return t.encode(i)},decodeUtf8(i,p){return p?(n||(n=new e.TextDecoder("utf-8",{fatal:!0})),n.decode(i)):r.decode(i)},checkUtf8(i){try{return encodeURIComponent(i),!0}catch{return!1}}};t.encodeInto&&(o.encodeUtf8Into=t.encodeInto.bind(t));let a=String.prototype.isWellFormed;a&&(o.checkUtf8=i=>a.call(i)),VQ(o)}return e[IA]}function PA(e){return(t,r)=>{let n=e(t);return r.set(n),{written:n.byteLength}}}var $o;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})($o||($o={}));var LQ=34028234663852886e22,UQ=-34028234663852886e22,QQ=4294967295,BQ=2147483647,GQ=-2147483648,Pe=class{constructor(t){this.stackPos=[],this.encodeUtf8Into=t?PA(t):TA().encodeUtf8Into,this.buffer=QE,this.viewCache=HQ,this.pos=0}ensureCapacity(t){let r=this.pos+t;if(r>this.buffer.length){let n=this.buffer.length||$Q;for(;n<r;)n*=2;let o=new Uint8Array(n);this.pos>0&&o.set(this.buffer),this.buffer=o}}view(){let t=this.buffer,r=this.viewCache;if(r.byteLength===t.byteLength)return r;let n=new DataView(t.buffer);return this.viewCache=n,n}finish(){let t=this.buffer.slice(0,this.pos);return this.pos=0,this.stackPos=[],t}fork(){return this.stackPos.push(this.pos),this.ensureCapacity(_u),this.buffer[this.pos++]=0,this}join(){let t=this.stackPos.pop();if(t===void 0)throw new Error("invalid state, fork stack empty");let r=this.pos-t-_u,n=kA(r);return n>_u&&(this.ensureCapacity(n-_u),this.buffer.copyWithin(t+n,t+_u,this.pos)),this.pos=t,this.uint32(r),this.pos+=r,this}tag(t,r){return this.uint32((t<<3|r)>>>0)}raw(t){return this.ensureCapacity(t.length),this.buffer.set(t,this.pos),this.pos+=t.length,this}uint32(t){if(UE(t),this.ensureCapacity(5),t<128)return this.buffer[this.pos++]=t,this;for(;t>127;)this.buffer[this.pos++]=t&127|128,t>>>=7;return this.buffer[this.pos++]=t,this}int32(t){if(OA(t),t>=0)return this.uint32(t);this.ensureCapacity(10);for(let r=0;r<9;r++)this.buffer[this.pos++]=t&127|128,t>>=7;return this.buffer[this.pos++]=1,this}bool(t){return this.ensureCapacity(1),this.buffer[this.pos++]=t?1:0,this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){typeof t!="string"&&(t=String(t));let r=t.length;if(r<=BE){this.ensureCapacity(r+1);let f=this.buffer,m=this.pos;f[m++]=r;let g=0;for(;g<r;g++){let y=t.charCodeAt(g);if(y>127)break;f[m++]=y}if(g==r)return this.pos=m,this}this.ensureCapacity(r*3+5);let n=kA(r),o=this.buffer,a=this.pos,{written:i}=this.encodeUtf8Into(t,o.subarray(a+n)),p=kA(i);return p!=n&&o.copyWithin(a+p,a+n,a+n+i),this.uint32(i),this.pos+=i,this}float(t){return zQ(t),this.ensureCapacity(4),this.view().setFloat32(this.pos,t,!0),this.pos+=4,this}double(t){return this.ensureCapacity(8),this.view().setFloat64(this.pos,t,!0),this.pos+=8,this}fixed32(t){return UE(t),this.ensureCapacity(4),this.view().setUint32(this.pos,t,!0),this.pos+=4,this}sfixed32(t){return OA(t),this.ensureCapacity(4),this.view().setInt32(this.pos,t,!0),this.pos+=4,this}sint32(t){return OA(t),this.uint32((t<<1^t>>31)>>>0)}sfixed64(t){let r=zr.enc(t);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,r.lo,!0),n.setInt32(this.pos+4,r.hi,!0),this.pos+=8,this}fixed64(t){let r=zr.uEnc(t);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,r.lo,!0),n.setInt32(this.pos+4,r.hi,!0),this.pos+=8,this}int64(t){let r=zr.enc(t);return this.writeVarint64(r.lo,r.hi)}sint64(t){let r=zr.enc(t),n=r.hi>>31,o=r.lo<<1^n,a=(r.hi<<1|r.lo>>>31)^n;return this.writeVarint64(o,a)}uint64(t){let r=zr.uEnc(t);return this.writeVarint64(r.lo,r.hi)}writeVarint64(t,r){this.ensureCapacity(10);let n=this.buffer,o=this.pos;for(let p=0;p<28;p=p+7){let f=t>>>p,m=!(!(f>>>7)&&r==0);if(n[o++]=(m?f|128:f)&255,!m)return this.pos=o,this}let a=t>>>28&15|(r&7)<<4,i=r>>3!=0;if(n[o++]=(i?a|128:a)&255,!i)return this.pos=o,this;for(let p=3;p<31;p=p+7){let f=r>>>p,m=!!(f>>>7);if(n[o++]=(m?f|128:f)&255,!m)return this.pos=o,this}return n[o++]=r>>>31&1,this.pos=o,this}},$Q=128,_u=1,QE=new Uint8Array(0),HQ=new DataView(QE.buffer),BE=32;function kA(e){return e<128?1:e<16384?2:e<2097152?3:e<268435456?4:5}var se=class{constructor(t,r=TA().decodeUtf8){this.decodeUtf8=r,this.varint64Lo=0,this.varint64Hi=0,this.varint64=DE,this.uint32=jE,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.pos,r=this.uint32(),n=this.pos-t;if(n>5||n==5&&this.buf[this.pos-1]>15)throw new Error("illegal tag: varint overflows uint32");let o=r>>>3,a=r&7;if(o<=0||a>5)throw new Error("illegal tag: field no "+o+" wire type "+a);return[o,a]}skip(t,r,n=100){let o=this.pos;switch(t){case $o.Varint:for(;this.buf[this.pos++]&128;);break;case $o.Bit64:this.pos+=4;case $o.Bit32:this.pos+=4;break;case $o.LengthDelimited:let a=this.uint32();this.pos+=a;break;case $o.StartGroup:if(n<=0)throw new Error("maximum recursion depth reached");for(;;){let[i,p]=this.tag();if(p===$o.EndGroup){if(r!==void 0&&i!==r)throw new Error("invalid end group tag");break}this.skip(p,i,n-1)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(o,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return this.varint64(),zr.dec(this.varint64Lo,this.varint64Hi)}uint64(){return this.varint64(),zr.uDec(this.varint64Lo,this.varint64Hi)}sint64(){this.varint64();let t=this.varint64Lo,r=this.varint64Hi,n=-(t&1);return t=(t>>>1|(r&1)<<31)^n,r=r>>>1^n,zr.dec(t,r)}bool(){let t=this.buf[this.pos];return t<128?(this.pos++,t!==0):(this.varint64(),this.varint64Lo!==0||this.varint64Hi!==0)}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return zr.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return zr.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(t){let r=this.bytes(),n=r.length;if(n<=BE){let o=new Array(n);for(let a=0;a<n;a++){let i=r[a];if(i>127)return this.decodeUtf8(r,t);o[a]=i}return String.fromCharCode.apply(String,o)}return this.decodeUtf8(r,t)}};function OA(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>BQ||e<GQ)throw new Error("invalid int32: "+e)}function UE(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>QQ||e<0)throw new Error("invalid uint32: "+e)}function zQ(e){if(typeof e=="string"){let t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>LQ||e<UQ))throw new Error("invalid float32: "+e)}var WQ=function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function NA(){return{fields:{}}}var Du={encode(e,t=new Pe){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&qA.encode({key:r,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=NA();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:{if(a!==10)break;let i=qA.decode(r,r.uint32());i.value!==void 0&&(o.fields[i.key]=i.value);continue}}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Du.fromPartial(e??{})},fromPartial(e){let t=NA();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,o])=>(o!==void 0&&(r[n]=o),r),{}),t},wrap(e){let t=NA();if(e!==void 0)for(let r of Object.keys(e))t.fields[r]=e[r];return t},unwrap(e){let t={};if(e.fields)for(let r of Object.keys(e.fields))t[r]=e.fields[r];return t}};function GE(){return{key:"",value:void 0}}var qA={encode(e,t=new Pe){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&ye.encode(ye.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=GE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.key=r.string();continue;case 2:if(a!==18)break;o.value=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return qA.fromPartial(e??{})},fromPartial(e){let t=GE();return t.key=e.key??"",t.value=e.value??void 0,t}};function _A(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var ye={encode(e,t=new Pe){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&Du.encode(Du.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&qu.encode(qu.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=_A();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.nullValue=r.int32();continue;case 2:if(a!==17)break;o.numberValue=r.double();continue;case 3:if(a!==26)break;o.stringValue=r.string();continue;case 4:if(a!==32)break;o.boolValue=r.bool();continue;case 5:if(a!==42)break;o.structValue=Du.unwrap(Du.decode(r,r.uint32()));continue;case 6:if(a!==50)break;o.listValue=qu.unwrap(qu.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return ye.fromPartial(e??{})},fromPartial(e){let t=_A();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=_A();if(e===null)t.nullValue=WQ.NULL_VALUE;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(h.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new h.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function DA(){return{values:[]}}var qu={encode(e,t=new Pe){for(let r of e.values)ye.encode(ye.wrap(r),t.uint32(10).fork()).join();return t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=DA();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.values.push(ye.unwrap(ye.decode(r,r.uint32())));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return qu.fromPartial(e??{})},fromPartial(e){let t=DA();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=DA();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&h.Array.isArray(e.values)?e.values:e}},KQ=function(e){return e[e.ADD=0]="ADD",e[e.REMOVE=1]="REMOVE",e[e.REPLACE=2]="REPLACE",e[e.MOVE=3]="MOVE",e[e.COPY=4]="COPY",e[e.TEST=5]="TEST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function $E(){return{op:0,path:"",from:void 0,value:void 0}}var Fm={encode(e,t=new Pe){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==""&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&ye.encode(ye.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=$E();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.op=r.int32();continue;case 2:if(a!==18)break;o.path=r.string();continue;case 3:if(a!==26)break;o.from=r.string();continue;case 4:if(a!==34)break;o.value=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Fm.fromPartial(e??{})},fromPartial(e){let t=$E();return t.op=e.op??0,t.path=e.path??"",t.from=e.from??void 0,t.value=e.value??void 0,t}};function HE(){return{id:"",type:"",function:void 0}}var Em={encode(e,t=new Pe){return e.id!==""&&t.uint32(10).string(e.id),e.type!==""&&t.uint32(18).string(e.type),e.function!==void 0&&Im.encode(e.function,t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=HE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.id=r.string();continue;case 2:if(a!==18)break;o.type=r.string();continue;case 3:if(a!==26)break;o.function=Im.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Em.fromPartial(e??{})},fromPartial(e){let t=HE();return t.id=e.id??"",t.type=e.type??"",t.function=e.function!==void 0&&e.function!==null?Im.fromPartial(e.function):void 0,t}};function zE(){return{name:"",arguments:""}}var Im={encode(e,t=new Pe){return e.name!==""&&t.uint32(10).string(e.name),e.arguments!==""&&t.uint32(18).string(e.arguments),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=zE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.name=r.string();continue;case 2:if(a!==18)break;o.arguments=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Im.fromPartial(e??{})},fromPartial(e){let t=zE();return t.name=e.name??"",t.arguments=e.arguments??"",t}};function WE(){return{value:"",mimeType:""}}var Tm={encode(e,t=new Pe){return e.value!==""&&t.uint32(10).string(e.value),e.mimeType!==""&&t.uint32(18).string(e.mimeType),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=WE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.value=r.string();continue;case 2:if(a!==18)break;o.mimeType=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Tm.fromPartial(e??{})},fromPartial(e){let t=WE();return t.value=e.value??"",t.mimeType=e.mimeType??"",t}};function KE(){return{value:"",mimeType:void 0}}var Pm={encode(e,t=new Pe){return e.value!==""&&t.uint32(10).string(e.value),e.mimeType!==void 0&&t.uint32(18).string(e.mimeType),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=KE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.value=r.string();continue;case 2:if(a!==18)break;o.mimeType=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Pm.fromPartial(e??{})},fromPartial(e){let t=KE();return t.value=e.value??"",t.mimeType=e.mimeType??void 0,t}};function YE(){return{data:void 0,url:void 0}}var pr={encode(e,t=new Pe){return e.data!==void 0&&Tm.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&Pm.encode(e.url,t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=YE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.data=Tm.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.url=Pm.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return pr.fromPartial(e??{})},fromPartial(e){let t=YE();return t.data=e.data!==void 0&&e.data!==null?Tm.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?Pm.fromPartial(e.url):void 0,t}};function JE(){return{text:""}}var km={encode(e,t=new Pe){return e.text!==""&&t.uint32(10).string(e.text),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=JE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.text=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return km.fromPartial(e??{})},fromPartial(e){let t=JE();return t.text=e.text??"",t}};function XE(){return{source:void 0,metadata:void 0}}var Om={encode(e,t=new Pe){return e.source!==void 0&&pr.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&ye.encode(ye.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=XE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.source=pr.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.metadata=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Om.fromPartial(e??{})},fromPartial(e){let t=XE();return t.source=e.source!==void 0&&e.source!==null?pr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function ZE(){return{source:void 0,metadata:void 0}}var Nm={encode(e,t=new Pe){return e.source!==void 0&&pr.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&ye.encode(ye.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=ZE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.source=pr.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.metadata=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Nm.fromPartial(e??{})},fromPartial(e){let t=ZE();return t.source=e.source!==void 0&&e.source!==null?pr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function eI(){return{source:void 0,metadata:void 0}}var _m={encode(e,t=new Pe){return e.source!==void 0&&pr.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&ye.encode(ye.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=eI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.source=pr.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.metadata=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return _m.fromPartial(e??{})},fromPartial(e){let t=eI();return t.source=e.source!==void 0&&e.source!==null?pr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function tI(){return{source:void 0,metadata:void 0}}var Dm={encode(e,t=new Pe){return e.source!==void 0&&pr.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&ye.encode(ye.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=tI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.source=pr.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.metadata=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Dm.fromPartial(e??{})},fromPartial(e){let t=tI();return t.source=e.source!==void 0&&e.source!==null?pr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function rI(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var qm={encode(e,t=new Pe){return e.text!==void 0&&km.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&Om.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&Nm.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&_m.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&Dm.encode(e.document,t.uint32(42).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=rI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.text=km.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.image=Om.decode(r,r.uint32());continue;case 3:if(a!==26)break;o.audio=Nm.decode(r,r.uint32());continue;case 4:if(a!==34)break;o.video=_m.decode(r,r.uint32());continue;case 5:if(a!==42)break;o.document=Dm.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return qm.fromPartial(e??{})},fromPartial(e){let t=rI();return t.text=e.text!==void 0&&e.text!==null?km.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?Om.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?Nm.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?_m.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?Dm.fromPartial(e.document):void 0,t}};function nI(){return{id:"",role:"",content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[]}}var Mm={encode(e,t=new Pe){e.id!==""&&t.uint32(10).string(e.id),e.role!==""&&t.uint32(18).string(e.role),e.content!==void 0&&t.uint32(26).string(e.content),e.name!==void 0&&t.uint32(34).string(e.name);for(let r of e.toolCalls)Em.encode(r,t.uint32(42).fork()).join();e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error);for(let r of e.contentParts)qm.encode(r,t.uint32(66).fork()).join();return t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=nI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.id=r.string();continue;case 2:if(a!==18)break;o.role=r.string();continue;case 3:if(a!==26)break;o.content=r.string();continue;case 4:if(a!==34)break;o.name=r.string();continue;case 5:if(a!==42)break;o.toolCalls.push(Em.decode(r,r.uint32()));continue;case 6:if(a!==50)break;o.toolCallId=r.string();continue;case 7:if(a!==58)break;o.error=r.string();continue;case 8:if(a!==66)break;o.contentParts.push(qm.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Mm.fromPartial(e??{})},fromPartial(e){let t=nI();return t.id=e.id??"",t.role=e.role??"",t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(r=>Em.fromPartial(r))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(r=>qm.fromPartial(r))||[],t}};function oI(){return{id:"",reason:"",message:void 0,toolCallId:void 0,responseSchema:void 0,expiresAt:void 0,metadata:void 0}}var jm={encode(e,t=new Pe){return e.id!==""&&t.uint32(10).string(e.id),e.reason!==""&&t.uint32(18).string(e.reason),e.message!==void 0&&t.uint32(26).string(e.message),e.toolCallId!==void 0&&t.uint32(34).string(e.toolCallId),e.responseSchema!==void 0&&ye.encode(ye.wrap(e.responseSchema),t.uint32(42).fork()).join(),e.expiresAt!==void 0&&t.uint32(50).string(e.expiresAt),e.metadata!==void 0&&ye.encode(ye.wrap(e.metadata),t.uint32(58).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=oI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.id=r.string();continue;case 2:if(a!==18)break;o.reason=r.string();continue;case 3:if(a!==26)break;o.message=r.string();continue;case 4:if(a!==34)break;o.toolCallId=r.string();continue;case 5:if(a!==42)break;o.responseSchema=ye.unwrap(ye.decode(r,r.uint32()));continue;case 6:if(a!==50)break;o.expiresAt=r.string();continue;case 7:if(a!==58)break;o.metadata=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return jm.fromPartial(e??{})},fromPartial(e){let t=oI();return t.id=e.id??"",t.reason=e.reason??"",t.message=e.message??void 0,t.toolCallId=e.toolCallId??void 0,t.responseSchema=e.responseSchema??void 0,t.expiresAt=e.expiresAt??void 0,t.metadata=e.metadata??void 0,t}},YQ=function(e){return e[e.TEXT_MESSAGE_START=0]="TEXT_MESSAGE_START",e[e.TEXT_MESSAGE_CONTENT=1]="TEXT_MESSAGE_CONTENT",e[e.TEXT_MESSAGE_END=2]="TEXT_MESSAGE_END",e[e.TOOL_CALL_START=3]="TOOL_CALL_START",e[e.TOOL_CALL_ARGS=4]="TOOL_CALL_ARGS",e[e.TOOL_CALL_END=5]="TOOL_CALL_END",e[e.STATE_SNAPSHOT=6]="STATE_SNAPSHOT",e[e.STATE_DELTA=7]="STATE_DELTA",e[e.MESSAGES_SNAPSHOT=8]="MESSAGES_SNAPSHOT",e[e.RAW=9]="RAW",e[e.CUSTOM=10]="CUSTOM",e[e.RUN_STARTED=11]="RUN_STARTED",e[e.RUN_FINISHED=12]="RUN_FINISHED",e[e.RUN_ERROR=13]="RUN_ERROR",e[e.STEP_STARTED=14]="STEP_STARTED",e[e.STEP_FINISHED=15]="STEP_FINISHED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function aI(){return{type:0,timestamp:void 0,rawEvent:void 0}}var Ce={encode(e,t=new Pe){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&ye.encode(ye.wrap(e.rawEvent),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=aI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.type=r.int32();continue;case 2:if(a!==16)break;o.timestamp=JQ(r.int64());continue;case 3:if(a!==26)break;o.rawEvent=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Ce.fromPartial(e??{})},fromPartial(e){let t=aI();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function iI(){return{baseEvent:void 0,messageId:"",role:void 0,name:void 0}}var Vm={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.name!==void 0&&t.uint32(34).string(e.name),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=iI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.role=r.string();continue;case 4:if(a!==34)break;o.name=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Vm.fromPartial(e??{})},fromPartial(e){let t=iI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.role=e.role??void 0,t.name=e.name??void 0,t}};function sI(){return{baseEvent:void 0,messageId:"",delta:""}}var Lm={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=sI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Lm.fromPartial(e??{})},fromPartial(e){let t=sI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.delta=e.delta??"",t}};function cI(){return{baseEvent:void 0,messageId:""}}var Um={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=cI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Um.fromPartial(e??{})},fromPartial(e){let t=cI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t}};function lI(){return{baseEvent:void 0,toolCallId:"",toolCallName:"",parentMessageId:void 0}}var Qm={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.toolCallName!==""&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=lI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.toolCallName=r.string();continue;case 4:if(a!==34)break;o.parentMessageId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Qm.fromPartial(e??{})},fromPartial(e){let t=lI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.toolCallName=e.toolCallName??"",t.parentMessageId=e.parentMessageId??void 0,t}};function uI(){return{baseEvent:void 0,toolCallId:"",delta:""}}var Bm={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=uI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Bm.fromPartial(e??{})},fromPartial(e){let t=uI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.delta=e.delta??"",t}};function dI(){return{baseEvent:void 0,toolCallId:""}}var Gm={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=dI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Gm.fromPartial(e??{})},fromPartial(e){let t=dI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t}};function pI(){return{baseEvent:void 0,snapshot:void 0}}var $m={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&ye.encode(ye.wrap(e.snapshot),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=pI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.snapshot=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return $m.fromPartial(e??{})},fromPartial(e){let t=pI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function fI(){return{baseEvent:void 0,delta:[]}}var Hm={encode(e,t=new Pe){e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.delta)Fm.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=fI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.delta.push(Fm.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Hm.fromPartial(e??{})},fromPartial(e){let t=fI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(r=>Fm.fromPartial(r))||[],t}};function mI(){return{baseEvent:void 0,messages:[]}}var zm={encode(e,t=new Pe){e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.messages)Mm.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=mI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messages.push(Mm.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return zm.fromPartial(e??{})},fromPartial(e){let t=mI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(r=>Mm.fromPartial(r))||[],t}};function gI(){return{baseEvent:void 0,event:void 0,source:void 0}}var Wm={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&ye.encode(ye.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=gI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.event=ye.unwrap(ye.decode(r,r.uint32()));continue;case 3:if(a!==26)break;o.source=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Wm.fromPartial(e??{})},fromPartial(e){let t=gI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function hI(){return{baseEvent:void 0,name:"",value:void 0}}var Km={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==""&&t.uint32(18).string(e.name),e.value!==void 0&&ye.encode(ye.wrap(e.value),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=hI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.name=r.string();continue;case 3:if(a!==26)break;o.value=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Km.fromPartial(e??{})},fromPartial(e){let t=hI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.name=e.name??"",t.value=e.value??void 0,t}};function yI(){return{baseEvent:void 0,threadId:"",runId:""}}var Ym={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=yI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.threadId=r.string();continue;case 3:if(a!==26)break;o.runId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Ym.fromPartial(e??{})},fromPartial(e){let t=yI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t}};function SI(){return{baseEvent:void 0,threadId:"",runId:"",result:void 0,outcome:"",interrupts:[]}}var Jm={encode(e,t=new Pe){e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),e.result!==void 0&&ye.encode(ye.wrap(e.result),t.uint32(34).fork()).join(),e.outcome!==""&&t.uint32(42).string(e.outcome);for(let r of e.interrupts)jm.encode(r,t.uint32(50).fork()).join();return t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=SI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.threadId=r.string();continue;case 3:if(a!==26)break;o.runId=r.string();continue;case 4:if(a!==34)break;o.result=ye.unwrap(ye.decode(r,r.uint32()));continue;case 5:if(a!==42)break;o.outcome=r.string();continue;case 6:if(a!==50)break;o.interrupts.push(jm.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Jm.fromPartial(e??{})},fromPartial(e){let t=SI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t.result=e.result??void 0,t.outcome=e.outcome??"",t.interrupts=e.interrupts?.map(r=>jm.fromPartial(r))||[],t}};function vI(){return{baseEvent:void 0,code:void 0,message:""}}var Xm={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==""&&t.uint32(26).string(e.message),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=vI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.code=r.string();continue;case 3:if(a!==26)break;o.message=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Xm.fromPartial(e??{})},fromPartial(e){let t=vI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??"",t}};function AI(){return{baseEvent:void 0,stepName:""}}var Zm={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=AI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.stepName=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Zm.fromPartial(e??{})},fromPartial(e){let t=AI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function CI(){return{baseEvent:void 0,stepName:""}}var eg={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=CI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.stepName=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return eg.fromPartial(e??{})},fromPartial(e){let t=CI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function xI(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0}}var tg={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),e.name!==void 0&&t.uint32(42).string(e.name),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=xI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.role=r.string();continue;case 4:if(a!==34)break;o.delta=r.string();continue;case 5:if(a!==42)break;o.name=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return tg.fromPartial(e??{})},fromPartial(e){let t=xI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t.name=e.name??void 0,t}};function bI(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var rg={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=bI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.toolCallName=r.string();continue;case 4:if(a!==34)break;o.parentMessageId=r.string();continue;case 5:if(a!==42)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return rg.fromPartial(e??{})},fromPartial(e){let t=bI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t}};function wI(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0}}var RI={encode(e,t=new Pe){return e.textMessageStart!==void 0&&Vm.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&Lm.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&Um.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&Qm.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&Bm.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&Gm.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&$m.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&Hm.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&zm.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&Wm.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&Km.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&Ym.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&Jm.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&Xm.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&Zm.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&eg.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&tg.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&rg.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t},decode(e,t){let r=e instanceof se?e:new se(e),n=t===void 0?r.len:r.pos+t,o=wI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.textMessageStart=Vm.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.textMessageContent=Lm.decode(r,r.uint32());continue;case 3:if(a!==26)break;o.textMessageEnd=Um.decode(r,r.uint32());continue;case 4:if(a!==34)break;o.toolCallStart=Qm.decode(r,r.uint32());continue;case 5:if(a!==42)break;o.toolCallArgs=Bm.decode(r,r.uint32());continue;case 6:if(a!==50)break;o.toolCallEnd=Gm.decode(r,r.uint32());continue;case 7:if(a!==58)break;o.stateSnapshot=$m.decode(r,r.uint32());continue;case 8:if(a!==66)break;o.stateDelta=Hm.decode(r,r.uint32());continue;case 9:if(a!==74)break;o.messagesSnapshot=zm.decode(r,r.uint32());continue;case 10:if(a!==82)break;o.raw=Wm.decode(r,r.uint32());continue;case 11:if(a!==90)break;o.custom=Km.decode(r,r.uint32());continue;case 12:if(a!==98)break;o.runStarted=Ym.decode(r,r.uint32());continue;case 13:if(a!==106)break;o.runFinished=Jm.decode(r,r.uint32());continue;case 14:if(a!==114)break;o.runError=Xm.decode(r,r.uint32());continue;case 15:if(a!==122)break;o.stepStarted=Zm.decode(r,r.uint32());continue;case 16:if(a!==130)break;o.stepFinished=eg.decode(r,r.uint32());continue;case 17:if(a!==138)break;o.textMessageChunk=tg.decode(r,r.uint32());continue;case 18:if(a!==146)break;o.toolCallChunk=rg.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return RI.fromPartial(e??{})},fromPartial(e){let t=wI();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?Vm.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?Lm.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?Um.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?Qm.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?Bm.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?Gm.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?$m.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?Hm.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?zm.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?Wm.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?Km.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?Ym.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?Jm.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?Xm.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?Zm.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?eg.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?tg.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?rg.fromPartial(e.toolCallChunk):void 0,t}};function JQ(e){let t=h.Number(e.toString());if(t>h.Number.MAX_SAFE_INTEGER)throw new h.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(t<h.Number.MIN_SAFE_INTEGER)throw new h.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return t}var Rm=e=>{if(!(!e||typeof e!="object")){if(e.data)return{type:"data",value:e.data.value,mimeType:e.data.mimeType};if(e.url)return{type:"url",value:e.url.value,mimeType:e.url.mimeType}}},XQ=e=>{if(!(!e||typeof e!="object")){if(e.text)return{type:"text",text:e.text.text};if(e.image)return{type:"image",source:Rm(e.image.source),metadata:e.image.metadata};if(e.audio)return{type:"audio",source:Rm(e.audio.source),metadata:e.audio.metadata};if(e.video)return{type:"video",source:Rm(e.video.source),metadata:e.video.metadata};if(e.document)return{type:"document",source:Rm(e.document.source),metadata:e.document.metadata}}};function FI(e){let t=RI.decode(e),r=Object.values(t).find(n=>n!==void 0);if(!r)throw new Error("Invalid event");if(r.type=YQ[r.baseEvent.type],r.timestamp=r.baseEvent.timestamp,r.rawEvent=r.baseEvent.rawEvent,delete r.baseEvent,r.type===M.MESSAGES_SNAPSHOT)for(let n of r.messages){let o=n;if(o.role==="user"&&Array.isArray(o.contentParts)){let a=o.contentParts.map(i=>XQ(i)).filter(i=>i!==void 0);a.length>0&&(o.content=a)}Array.isArray(o.contentParts)&&o.contentParts.length===0&&(o.contentParts=void 0),o.toolCalls?.length===0&&(o.toolCalls=void 0)}if(r.type===M.RUN_FINISHED){let n=r,o=typeof n.outcome=="string"&&n.outcome!==""?n.outcome:void 0,a=Array.isArray(n.interrupts)?n.interrupts:[];delete n.interrupts,o==="interrupt"?n.outcome={type:"interrupt",interrupts:a}:o==="success"?n.outcome={type:"success"}:delete n.outcome}if(r.type===M.STATE_DELTA)for(let n of r.delta)n.op=KQ[n.op].toLowerCase(),Object.keys(n).forEach(o=>{n[o]===void 0&&delete n[o]});return Object.keys(r).forEach(n=>{r[n]===void 0&&delete r[n]}),Bf.parse(r)}var MA="application/vnd.ag-ui.event+proto";d();c();u();l();d();c();u();l();d();c();u();l();var eB=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,jA=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(eB);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},EI=e=>e==="*"||e==="x"||e==="X",II=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},tB=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],rB=(e,t)=>{if(EI(e)||EI(t))return 0;let[r,n]=tB(II(e),II(t));return r>n?1:r<n?-1:0},VA=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=rB(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var Mu=(e,t)=>{let r=jA(e),n=jA(t),o=r.pop(),a=n.pop(),i=VA(r,n);return i!==0?i:o&&a?VA(o.split("."),a.split(".")):o||a?o?-1:1:0};var Ve=e=>{if(typeof structuredClone=="function")return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function ju(){return Lo()}function QA(e){if(Object.freeze(e),typeof e=="object"&&e)for(let t of Object.values(e))typeof t=="object"&&t&&!Object.isFrozen(t)&&QA(t);return e}var TI=512*1024;function PI(e,t,r){let n=0,o=[e,t],a=new WeakSet;for(;o.length>0;){let i=o.pop();if(typeof i=="string"){if(n+=i.length,n>r)return!0}else if(typeof i=="object"&&i){if(a.has(i))continue;if(a.add(i),Array.isArray(i))for(let p=0;p<i.length;p++)o.push(i[p]);else{let p=Object.keys(i);for(let f=0;f<p.length;f++){let m=p[f];if(n+=m.length,n>r)return!0;o.push(i[m])}}}}return!1}function $e(_x140,_x141,_x142,_x143){return _$e.apply(this,arguments)}function _$e(){_$e=_asyncToGenerator(function*(e,t,r,n){let o=typeof process<"u"&&process.env!==void 0,a=o&&!!process.env.VITEST_WORKER_ID,i=o&&!!process.env.VITEST_WORKER_ID,p=i&&!PI(t,r,TI),f=p?Ve(t):t,m=p?Ve(r):r,g=!1,y=!1,x;for(let v of e)try{p&&(QA(f),QA(m));let C=yield n(v,f,m);if(C===void 0)continue;let b=!1;if(C.messages!==void 0&&C.messages!==f&&(f=Ve(C.messages),g=!0,b=!0),C.state!==void 0&&C.state!==m&&(m=Ve(C.state),y=!0,b=!0),p&&b&&PI(f,m,TI)&&(p=!1),x=C.stopPropagation,x===!0)break}catch(C){if(i&&C instanceof TypeError){if(a)throw C;console.error("AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.",C)}else a||console.error("Subscriber error:",C);continue}return{...(g?{messages:Object.isFrozen(f)?Ve(f):f}:{}),...(y?{state:Object.isFrozen(m)?Ve(m):m}:{}),...(x===void 0?{}:{stopPropagation:x})}});return _$e.apply(this,arguments)}function ng(e){if(!e)return{enabled:!1,events:!1,lifecycle:!1,verbose:!1};if(e===!0)return{enabled:!0,events:!0,lifecycle:!0,verbose:!0};let t=e.events??!0,r=e.lifecycle??!0,n=e.verbose??!1;return{enabled:t||r,events:t,lifecycle:r,verbose:n}}function Vu(e){if(e instanceof BA)return e;if(e===!0)return new BA(ng(!0))}var BA=class{constructor(e){this.config=e}event(e,t,r,n){this.config.events&&(this.config.verbose?console.debug(`[${e}] ${t}`,typeof r=="string"?r:JSON.stringify(r)):console.debug(`[${e}] ${t}`,n??r))}lifecycle(e,t,r){this.config.lifecycle&&(r?console.debug(`[${e}] ${t}`,r):console.debug(`[${e}] ${t}`))}get eventsEnabled(){return this.config.events}get lifecycleEnabled(){return this.config.lifecycle}get enabled(){return this.config.enabled}};function LA(e){return e.enabled?new BA(e):void 0}function nB(e,t,r){if(t){let o=e.find(i=>i.id===t);if(o?.role==="assistant")return o;o&&console.warn(`TOOL_CALL_START: parentMessageId '${t}' matches a '${o.role}' message, not assistant \u2014 falling back to toolCallId`);let a={id:o?r:t,role:"assistant",toolCalls:[]};return e.push(a),a}let n={id:r,role:"assistant",toolCalls:[]};return e.push(n),n}var qI=(e,t,r,n,o)=>{let a=Vu(o),i=Ve(r.messages),p=Ve(e.state),f={},m=y=>{y.messages!==void 0&&(i=y.messages,f.messages=y.messages),y.state!==void 0&&(p=y.state,f.state=y.state)},g=()=>{let y=Ve(f);return f={},y.messages!==void 0||y.state!==void 0?ot(y):im};return t.pipe(Cm(/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(y){let x=yield $e(n,i,p,(v,C,b)=>v.onEvent?.({event:y,agent:r,input:e,messages:C,state:b}));if(m(x),x.stopPropagation===!0?a?.event("APPLY","Event dropped:",y,{type:y.type,reason:"stopPropagation by subscriber"}):a?.event("APPLY","Event applied:",y,{type:y.type,subscribers:n.length}),x.stopPropagation===!0)return g();switch(y.type){case M.TEXT_MESSAGE_START:{let v=yield $e(n,i,p,(C,b,w)=>C.onTextMessageStartEvent?.({event:y,messages:b,state:w,agent:r,input:e}));if(m(v),v.stopPropagation!==!0){let{messageId:C,role:b="assistant",name:w}=y;if(!i.find(F=>F.id===C)){let F={id:C,role:b,content:"",...(w!==void 0&&{name:w})};i.push(F),m({messages:i})}}return g()}case M.TEXT_MESSAGE_CONTENT:{let{messageId:v,delta:C}=y,b=i.find(F=>F.id===v);if(!b)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${v}'`),g();let w=yield $e(n,i,p,(F,I,E)=>F.onTextMessageContentEvent?.({event:y,messages:I,state:E,agent:r,input:e,textMessageBuffer:typeof b.content=="string"?b.content:""}));return m(w),w.stopPropagation!==!0&&(b.content=`${typeof b.content=="string"?b.content:""}${C}`,m({messages:i})),g()}case M.TEXT_MESSAGE_END:{let{messageId:v}=y,C=i.find(b=>b.id===v);return C?(m(yield $e(n,i,p,(b,w,F)=>b.onTextMessageEndEvent?.({event:y,messages:w,state:F,agent:r,input:e,textMessageBuffer:typeof C.content=="string"?C.content:""}))),yield Promise.all(n.map(b=>{b.onNewMessage?.({message:C,messages:i,state:p,agent:r,input:e})})),g()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${v}'`),g())}case M.TOOL_CALL_START:{let v=yield $e(n,i,p,(C,b,w)=>C.onToolCallStartEvent?.({event:y,messages:b,state:w,agent:r,input:e}));if(m(v),v.stopPropagation!==!0){let{toolCallId:C,toolCallName:b,parentMessageId:w}=y,F=nB(i,w,C);F.toolCalls??(F.toolCalls=[]),F.toolCalls.push({id:C,type:"function",function:{name:b,arguments:""}}),m({messages:i})}return g()}case M.TOOL_CALL_ARGS:{let{toolCallId:v,delta:C}=y,b=i.find(I=>I.toolCalls?.some(E=>E.id===v));if(!b)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${v}'`),g();let w=b.toolCalls?.find(I=>I.id===v);if(!w)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${v}'`),g();let F=yield $e(n,i,p,(I,E,k)=>{let T=w.function.arguments,D=w.function.name,G={};try{G=bm(T)}catch{}return I.onToolCallArgsEvent?.({event:y,messages:E,state:k,agent:r,input:e,toolCallBuffer:T,toolCallName:D,partialToolCallArgs:G})});return m(F),F.stopPropagation!==!0&&(w.function.arguments+=C,m({messages:i})),g()}case M.TOOL_CALL_END:{let{toolCallId:v}=y,C=i.find(w=>w.toolCalls?.some(F=>F.id===v));if(!C)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${v}'`),g();let b=C.toolCalls?.find(w=>w.id===v);return b?(m(yield $e(n,i,p,(w,F,I)=>{let E=b.function.arguments,k=b.function.name,T={};try{T=JSON.parse(E)}catch{}return w.onToolCallEndEvent?.({event:y,messages:F,state:I,agent:r,input:e,toolCallName:k,toolCallArgs:T})})),yield Promise.all(n.map(w=>{w.onNewToolCall?.({toolCall:b,messages:i,state:p,agent:r,input:e})})),g()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${v}'`),g())}case M.TOOL_CALL_RESULT:{let v=yield $e(n,i,p,(C,b,w)=>C.onToolCallResultEvent?.({event:y,messages:b,state:w,agent:r,input:e}));if(m(v),v.stopPropagation!==!0){let{messageId:C,toolCallId:b,content:w,role:F}=y,I={id:C,toolCallId:b,role:F||"tool",content:w},E=i.findIndex(k=>k.role==="assistant"&&k.toolCalls?.some(T=>T.id===b));if(E===-1)i.push(I);else{let k=E+1;for(;k<i.length&&i[k].role==="tool";)k++;i.splice(k,0,I)}yield Promise.all(n.map(k=>{k.onNewMessage?.({message:I,messages:i,state:p,agent:r,input:e})})),m({messages:i})}return g()}case M.STATE_SNAPSHOT:{let v=yield $e(n,i,p,(C,b,w)=>C.onStateSnapshotEvent?.({event:y,messages:b,state:w,agent:r,input:e}));if(m(v),v.stopPropagation!==!0){let{snapshot:C}=y;p=C,m({state:p})}return g()}case M.STATE_DELTA:{let v=yield $e(n,i,p,(C,b,w)=>C.onStateDeltaEvent?.({event:y,messages:b,state:w,agent:r,input:e}));if(m(v),v.stopPropagation!==!0){let{delta:C}=y;try{p=Jf.applyPatch(p,C,!0,!1).newDocument,m({state:p})}catch(b){let w=b instanceof Error?b.message:String(b);console.warn(`Failed to apply state patch:
|
|
35
|
+
`):"",this.name="UnsubscriptionError",this.errors=r}});d();c();l();u();function Ol(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var ac=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=no(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(Ne(g))try{g()}catch(b){a=b instanceof tm?b.errors:[b]}var S=this._finalizers;if(S){this._finalizers=null;try{for(var x=no(S),h=x.next();!h.done;h=x.next()){var C=h.value;try{yE(C)}catch(b){a=a??[],b instanceof tm?a=nc(nc([],rc(a)),rc(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 tm(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)yE(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)&&Ol(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Ol(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var yA=ac.EMPTY;function rm(e){return e instanceof ac||e&&"closed"in e&&Ne(e.remove)&&Ne(e.add)&&Ne(e.unsubscribe)}function yE(e){Ne(e)?e():e.unsubscribe()}d();c();l();u();var Hr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};d();c();l();u();d();c();l();u();var ic={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=ic.delegate;return o?.setTimeout?o.setTimeout.apply(o,nc([e,t],rc(r))):setTimeout.apply(void 0,nc([e,t],rc(r)))},clearTimeout:function(e){var t=ic.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function nm(e){ic.setTimeout(function(){var t=Hr.onUnhandledError;if(t)t(e);else throw e})}d();c();l();u();function _l(){}d();c();l();u();var SE=function(){return SA("C",void 0,void 0)}();function vE(e){return SA("E",void 0,e)}function AE(e){return SA("N",e,void 0)}function SA(e,t,r){return{kind:e,value:t,error:r}}d();c();l();u();var ri=null;function sc(e){if(Hr.useDeprecatedSynchronousErrorHandling){var t=!ri;if(t&&(ri={errorThrown:!1,error:null}),e(),t){var r=ri,n=r.errorThrown,o=r.error;if(ri=null,n)throw o}}else e()}function CE(e){Hr.useDeprecatedSynchronousErrorHandling&&ri&&(ri.errorThrown=!0,ri.error=e)}var Nl=function(e){hn(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,rm(r)&&r.add(n)):n.destination=PQ,n}return t.create=function(r,n,o){return new am(r,n,o)},t.prototype.next=function(r){this.isStopped?AA(AE(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?AA(vE(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?AA(SE,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}(ac);var EQ=Function.prototype.bind;function vA(e,t){return EQ.call(e,t)}var IQ=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){om(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){om(n)}else om(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){om(r)}},e}(),am=function(e){hn(t,e);function t(r,n,o){var a=e.call(this)||this,i;if(Ne(r)||!r)i={next:r??void 0,error:n??void 0,complete:o??void 0};else{var p;a&&Hr.useDeprecatedNextContext?(p=Object.create(r),p.unsubscribe=function(){return a.unsubscribe()},i={next:r.next&&vA(r.next,p),error:r.error&&vA(r.error,p),complete:r.complete&&vA(r.complete,p)}):i=r}return a.destination=new IQ(i),a}return t}(Nl);function om(e){Hr.useDeprecatedSynchronousErrorHandling?CE(e):nm(e)}function TQ(e){throw e}function AA(e,t){var r=Hr.onStoppedNotification;r&&ic.setTimeout(function(){return r(e,t)})}var PQ={closed:!0,next:_l,error:TQ,complete:_l};d();c();l();u();var cc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();d();c();l();u();d();c();l();u();function uc(e){return e}function im(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return CA(e)}function CA(e){return e.length===0?uc:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var Ze=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=OQ(t)?t:new am(t,r,n);return sc(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=xE(r),new r(function(o,a){var i=new am({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[cc]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return CA(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=xE(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 xE(e){var t;return(t=e??Hr.Promise)!==null&&t!==void 0?t:Promise}function kQ(e){return e&&Ne(e.next)&&Ne(e.error)&&Ne(e.complete)}function OQ(e){return e&&e instanceof Nl||kQ(e)&&rm(e)}d();c();l();u();function _Q(e){return Ne(e?.lift)}function mt(e){return function(t){if(_Q(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 Ct(e,t,r,n,o){return new NQ(e,t,r,n,o)}var NQ=function(e){hn(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}(Nl);d();c();l();u();d();c();l();u();var bE=oc(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var yn=function(e){hn(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 wE(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new bE},t.prototype.next=function(r){var n=this;sc(function(){var o,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var i=no(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;sc(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;sc(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?yA:(this.currentObservers=null,p.push(r),new ac(function(){n.currentObservers=null,Ol(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 Ze;return r.source=this,r},t.create=function(r,n){return new wE(r,n)},t}(Ze);var wE=function(e){hn(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:yA},t}(yn);d();c();l();u();d();c();l();u();var xA={now:function(){return(xA.delegate||Date).now()},delegate:void 0};var sm=function(e){hn(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=xA);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}(yn);d();c();l();u();var cm=new Ze(function(e){return e.complete()});d();c();l();u();d();c();l();u();d();c();l();u();function RE(e){return e&&Ne(e.schedule)}function DQ(e){return e[e.length-1]}function FE(e){return RE(DQ(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 um=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};d();c();l();u();function lm(e){return Ne(e?.then)}d();c();l();u();function dm(e){return Ne(e[cc])}d();c();l();u();function pm(e){return Symbol.asyncIterator&&Ne(e?.[Symbol.asyncIterator])}d();c();l();u();function fm(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 qQ(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var mm=qQ();function gm(e){return Ne(e?.[mm])}d();c();l();u();function hm(e){return gE(this,arguments,function(){var r,n,o,a;return em(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,ti(r.read())];case 3:return n=i.sent(),o=n.value,a=n.done,a?[4,ti(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,ti(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 ym(e){return Ne(e?.getReader)}function xt(e){if(e instanceof Ze)return e;if(e!=null){if(dm(e))return MQ(e);if(um(e))return VQ(e);if(lm(e))return jQ(e);if(pm(e))return EE(e);if(gm(e))return LQ(e);if(ym(e))return UQ(e)}throw fm(e)}function MQ(e){return new Ze(function(t){var r=e[cc]();if(Ne(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function VQ(e){return new Ze(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function jQ(e){return new Ze(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,nm)})}function LQ(e){return new Ze(function(t){var r,n;try{for(var o=no(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 EE(e){return new Ze(function(t){QQ(e,t).catch(function(r){return t.error(r)})})}function UQ(e){return EE(hm(e))}function QQ(e,t){var r,n,o,a;return mE(this,void 0,void 0,function(){var i,p;return em(this,function(f){switch(f.label){case 0:f.trys.push([0,5,6,11]),r=hE(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 Pr(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 Sm(e,t){return t===void 0&&(t=0),mt(function(r,n){r.subscribe(Ct(n,function(o){return Pr(n,e,function(){return n.next(o)},t)},function(){return Pr(n,e,function(){return n.complete()},t)},function(o){return Pr(n,e,function(){return n.error(o)},t)}))})}d();c();l();u();function vm(e,t){return t===void 0&&(t=0),mt(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function IE(e,t){return xt(e).pipe(vm(t),Sm(t))}d();c();l();u();function TE(e,t){return xt(e).pipe(vm(t),Sm(t))}d();c();l();u();function PE(e,t){return new Ze(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 kE(e,t){return new Ze(function(r){var n;return Pr(r,t,function(){n=e[mm](),Pr(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 Ne(n?.return)&&n.return()}})}d();c();l();u();function Am(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ze(function(r){Pr(r,t,function(){var n=e[Symbol.asyncIterator]();Pr(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}d();c();l();u();function OE(e,t){return Am(hm(e),t)}function _E(e,t){if(e!=null){if(dm(e))return IE(e,t);if(um(e))return PE(e,t);if(lm(e))return TE(e,t);if(pm(e))return Am(e,t);if(gm(e))return kE(e,t);if(ym(e))return OE(e,t)}throw fm(e)}function ni(e,t){return t?_E(e,t):xt(e)}function ot(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=FE(e);return ni(e,r)}d();c();l();u();function et(e,t){var r=Ne(e)?e:function(){return e},n=function(o){return o.error(r())};return new Ze(t?function(o){return t.schedule(n,0,o)}:n)}d();c();l();u();d();c();l();u();var NE=oc(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function Cm(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 NE)}})})}d();c();l();u();function oi(e,t){return mt(function(r,n){var o=0;r.subscribe(Ct(n,function(a){n.next(e.call(t,a,o++))}))})}d();c();l();u();d();c();l();u();d();c();l();u();function DE(e,t,r,n,o,a,i,p){var f=[],m=0,g=0,S=!1,x=function(){S&&!f.length&&!m&&t.complete()},h=function(b){return m<n?C(b):f.push(b)},C=function(b){a&&t.next(b),m++;var w=!1;xt(r(b,g++)).subscribe(Ct(t,function(F){o?.(F),a?h(F):t.next(F)},function(){w=!0},void 0,function(){if(w)try{m--;for(var F=function(){var I=f.shift();i?Pr(t,i,function(){return C(I)}):C(I)};f.length&&m<n;)F();x()}catch(I){t.error(I)}}))};return e.subscribe(Ct(t,h,function(){S=!0,x()})),function(){p?.()}}function nr(e,t,r){return r===void 0&&(r=1/0),Ne(t)?nr(function(n,o){return oi(function(a,i){return t(n,a,o,i)})(xt(e(n,o)))},r):(typeof t=="number"&&(r=t),mt(function(n,o){return DE(n,o,e,r)}))}function bA(e){return e===void 0&&(e=1/0),nr(uc,e)}d();c();l();u();function xm(e){return new Ze(function(t){xt(e()).subscribe(t)})}d();c();l();u();function Dl(e){return mt(function(t,r){var n=null,o=!1,a;n=t.subscribe(Ct(r,void 0,void 0,function(i){a=xt(e(i,Dl(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 bm(e,t){return Ne(t)?nr(e,t,1):nr(e,1)}d();c();l();u();function wA(e){return mt(function(t,r){var n=!1;t.subscribe(Ct(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}d();c();l();u();function ai(e){return mt(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}d();c();l();u();function RA(e,t){return mt(function(r,n){var o=null,a=0,i=!1,p=function(){return i&&!o&&n.complete()};r.subscribe(Ct(n,function(f){o?.unsubscribe();var m=0,g=a++;xt(e(f,g)).subscribe(o=Ct(n,function(S){return n.next(t?t(f,S,g,m++):S)},function(){o=null,p()}))},function(){i=!0,p()}))})}d();c();l();u();function wm(e){return mt(function(t,r){xt(e).subscribe(Ct(r,function(){return r.complete()},_l)),!r.closed&&t.subscribe(r)})}d();c();l();u();function FA(e,t,r){var n=Ne(e)||t||r?{next:e,error:t,complete:r}:e;return n?mt(function(o,a){var i;(i=n.subscribe)===null||i===void 0||i.call(n);var p=!0;o.subscribe(Ct(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)}))}):uc}d();c();l();u();d();c();l();u();function qE(e){return` \r
|
|
36
|
+
`.indexOf(e)>=0}function Rm(e){for(var t=["topLevel"],r=0,n,o,a,i=function(I){return t.push(I)},p=function(I){return t[t.length-1]=I},f=function(I){n==null&&(n=r,o=t.length,a=I)},m=function(I){I===a&&(n=void 0,o=void 0,a=void 0)},g=function(){return t.pop()},S=function(){return r--},x=function(I){if("0"<=I&&I<="9"){i("number");return}switch(I){case"\"":i("string");return;case"-":i("numberNeedsDigit");return;case"t":i("true");return;case"f":i("false");return;case"n":i("null");return;case"[":i("arrayNeedsValue");return;case"{":i("objectNeedsKey");return}},h=e.length;r<h;r++){var C=e[r];switch(t[t.length-1]){case"topLevel":x(C);break;case"string":switch(C){case"\"":g();break;case"\\":f("stringEscape"),i("stringEscaped");break}break;case"stringEscaped":C==="u"?i("stringUnicode"):(m("stringEscape"),g());break;case"stringUnicode":r-e.lastIndexOf("u",r)===4&&(m("stringEscape"),g());break;case"number":C==="."?p("numberNeedsDigit"):C==="e"||C==="E"?p("numberNeedsExponent"):(C<"0"||C>"9")&&(S(),g());break;case"numberNeedsDigit":p("number");break;case"numberNeedsExponent":p(C==="+"||C==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(C<"a"||C>"z")&&(S(),g());break;case"arrayNeedsValue":C==="]"?g():qE(C)||(m("collectionItem"),p("arrayNeedsComma"),x(C));break;case"arrayNeedsComma":C==="]"?g():C===","&&(f("collectionItem"),p("arrayNeedsValue"));break;case"objectNeedsKey":C==="}"?g():C==="\""&&(f("collectionItem"),p("objectNeedsColon"),i("string"));break;case"objectNeedsColon":C===":"&&p("objectNeedsValue");break;case"objectNeedsValue":qE(C)||(m("collectionItem"),p("objectNeedsComma"),x(C));break;case"objectNeedsComma":C==="}"?g():C===","&&(f("collectionItem"),p("objectNeedsKey"));break}}o!=null&&(t.length=o);for(var b=[n!=null?e.slice(0,n):e],w=function(I){return b.push(I.slice(e.length-e.lastIndexOf(I[0])))},F=t.length-1;F>=0;F--)switch(t[F]){case"string":b.push("\"");break;case"numberNeedsDigit":case"numberNeedsExponent":b.push("0");break;case"true":w("true");break;case"false":w("false");break;case"null":w("null");break;case"arrayNeedsValue":case"arrayNeedsComma":b.push("]");break;case"objectNeedsKey":case"objectNeedsColon":case"objectNeedsValue":case"objectNeedsComma":b.push("}");break}return b.join("")}d();c();l();u();d();c();l();u();d();c();l();u();function VE(){let e=this.buf,t=this.pos,r=0,n=0;for(let a=0;a<28;a+=7){let i=e[t++];if(r|=(i&127)<<a,(i&128)==0){this.pos=t,this.assertBounds(),this.varint64Lo=r,this.varint64Hi=n;return}}let o=e[t++];if(r|=(o&15)<<28,n=(o&112)>>4,(o&128)==0){this.pos=t,this.assertBounds(),this.varint64Lo=r,this.varint64Hi=n;return}for(let a=3;a<=31;a+=7){let i=e[t++];if(n|=(i&127)<<a,(i&128)==0){this.pos=t,this.assertBounds(),this.varint64Lo=r,this.varint64Hi=n;return}}throw new Error("invalid varint")}var Fm=4294967296;function EA(e){let t=e[0]==="-";t&&(e=e.slice(1));let r=1e6,n=0,o=0;function a(i,p){let f=Number(e.slice(i,p));o*=r,n=n*r+f,n>=Fm&&(o=o+(n/Fm|0),n=n%Fm)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?LE(n,o):TA(n,o)}function jE(e,t){let r=TA(e,t),n=r.hi&2147483648;n&&(r=LE(r.lo,r.hi));let o=IA(r.lo,r.hi);return n?"-"+o:o}function IA(e,t){if({lo:e,hi:t}=BQ(e,t),t<=2097151)return String(Fm*t+e);let r=e&16777215,n=(e>>>24|t<<8)&16777215,o=t>>16&65535,a=r+n*6777216+o*6710656,i=n+o*8147497,p=o*2,f=1e7;return a>=f&&(i+=Math.floor(a/f),a%=f),i>=f&&(p+=Math.floor(i/f),i%=f),p.toString()+ME(i)+ME(a)}function BQ(e,t){return{lo:e>>>0,hi:t>>>0}}function TA(e,t){return{lo:e|0,hi:t|0}}function LE(e,t){return t=~t,e?e=~e+1:t+=1,TA(e,t)}var ME=e=>{let t=String(e);return"0000000".slice(t.length)+t};function UE(){let e=this.buf[this.pos++];if((e&128)===0)return this.assertBounds(),e;let t=e&127;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)===0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)===0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)===0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!==0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}d();c();l();u();var zr=GQ();function GQ(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!y.Deno||!!y.Bun||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let r=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),o=BigInt("0"),a=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(i){let p=typeof i=="bigint"?i:BigInt(i);if(p>n||p<r)throw new Error(`invalid int64: ${i}`);return p},uParse(i){let p=typeof i=="bigint"?i:BigInt(i);if(p>a||p<o)throw new Error(`invalid uint64: ${i}`);return p},enc(i){return e.setBigInt64(0,this.parse(i),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(i){return e.setBigInt64(0,this.uParse(i),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(i,p){return e.setInt32(0,i,!0),e.setInt32(4,p,!0),e.getBigInt64(0,!0)},uDec(i,p){return e.setInt32(0,i,!0),e.setInt32(4,p,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),QE(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),BE(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),QE(r),EA(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),BE(r),EA(r)},dec(r,n){return jE(r,n)},uDec(r,n){return IA(r,n)}}}function QE(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function BE(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}d();c();l();u();var PA=Symbol.for("@bufbuild/protobuf/text-encoding");function $Q(e){var t;y[PA]=Object.assign(Object.assign({},e),{encodeUtf8Into:(t=e.encodeUtf8Into)!==null&&t!==void 0?t:OA(e.encodeUtf8.bind(e))})}function kA(){let e=y;if(!e[PA]){let t=new e.TextEncoder,r=new e.TextDecoder,n,o={encodeUtf8(i){return t.encode(i)},decodeUtf8(i,p){return p?(n||(n=new e.TextDecoder("utf-8",{fatal:!0})),n.decode(i)):r.decode(i)},checkUtf8(i){try{return encodeURIComponent(i),!0}catch{return!1}}};t.encodeInto&&(o.encodeUtf8Into=t.encodeInto.bind(t));let a=String.prototype.isWellFormed;a&&(o.checkUtf8=i=>a.call(i)),$Q(o)}return e[PA]}function OA(e){return(t,r)=>{let n=e(t);return r.set(n),{written:n.byteLength}}}var $o;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})($o||($o={}));var HQ=34028234663852886e22,zQ=-34028234663852886e22,WQ=4294967295,KQ=2147483647,YQ=-2147483648,Pe=class{constructor(t){this.stackPos=[],this.encodeUtf8Into=t?OA(t):kA().encodeUtf8Into,this.buffer=$E,this.viewCache=XQ,this.pos=0}ensureCapacity(t){let r=this.pos+t;if(r>this.buffer.length){let n=this.buffer.length||JQ;for(;n<r;)n*=2;let o=new Uint8Array(n);this.pos>0&&o.set(this.buffer),this.buffer=o}}view(){let t=this.buffer,r=this.viewCache;if(r.byteLength===t.byteLength)return r;let n=new DataView(t.buffer);return this.viewCache=n,n}finish(){let t=this.buffer.slice(0,this.pos);return this.pos=0,this.stackPos=[],t}fork(){return this.stackPos.push(this.pos),this.ensureCapacity(ql),this.buffer[this.pos++]=0,this}join(){let t=this.stackPos.pop();if(t===void 0)throw new Error("invalid state, fork stack empty");let r=this.pos-t-ql,n=_A(r);return n>ql&&(this.ensureCapacity(n-ql),this.buffer.copyWithin(t+n,t+ql,this.pos)),this.pos=t,this.uint32(r),this.pos+=r,this}tag(t,r){return this.uint32((t<<3|r)>>>0)}raw(t){return this.ensureCapacity(t.length),this.buffer.set(t,this.pos),this.pos+=t.length,this}uint32(t){if(GE(t),this.ensureCapacity(5),t<128)return this.buffer[this.pos++]=t,this;for(;t>127;)this.buffer[this.pos++]=t&127|128,t>>>=7;return this.buffer[this.pos++]=t,this}int32(t){if(NA(t),t>=0)return this.uint32(t);this.ensureCapacity(10);for(let r=0;r<9;r++)this.buffer[this.pos++]=t&127|128,t>>=7;return this.buffer[this.pos++]=1,this}bool(t){return this.ensureCapacity(1),this.buffer[this.pos++]=t?1:0,this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){typeof t!="string"&&(t=String(t));let r=t.length;if(r<=HE){this.ensureCapacity(r+1);let f=this.buffer,m=this.pos;f[m++]=r;let g=0;for(;g<r;g++){let S=t.charCodeAt(g);if(S>127)break;f[m++]=S}if(g==r)return this.pos=m,this}this.ensureCapacity(r*3+5);let n=_A(r),o=this.buffer,a=this.pos,{written:i}=this.encodeUtf8Into(t,o.subarray(a+n)),p=_A(i);return p!=n&&o.copyWithin(a+p,a+n,a+n+i),this.uint32(i),this.pos+=i,this}float(t){return ZQ(t),this.ensureCapacity(4),this.view().setFloat32(this.pos,t,!0),this.pos+=4,this}double(t){return this.ensureCapacity(8),this.view().setFloat64(this.pos,t,!0),this.pos+=8,this}fixed32(t){return GE(t),this.ensureCapacity(4),this.view().setUint32(this.pos,t,!0),this.pos+=4,this}sfixed32(t){return NA(t),this.ensureCapacity(4),this.view().setInt32(this.pos,t,!0),this.pos+=4,this}sint32(t){return NA(t),this.uint32((t<<1^t>>31)>>>0)}sfixed64(t){let r=zr.enc(t);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,r.lo,!0),n.setInt32(this.pos+4,r.hi,!0),this.pos+=8,this}fixed64(t){let r=zr.uEnc(t);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,r.lo,!0),n.setInt32(this.pos+4,r.hi,!0),this.pos+=8,this}int64(t){let r=zr.enc(t);return this.writeVarint64(r.lo,r.hi)}sint64(t){let r=zr.enc(t),n=r.hi>>31,o=r.lo<<1^n,a=(r.hi<<1|r.lo>>>31)^n;return this.writeVarint64(o,a)}uint64(t){let r=zr.uEnc(t);return this.writeVarint64(r.lo,r.hi)}writeVarint64(t,r){this.ensureCapacity(10);let n=this.buffer,o=this.pos;for(let p=0;p<28;p=p+7){let f=t>>>p,m=!(!(f>>>7)&&r==0);if(n[o++]=(m?f|128:f)&255,!m)return this.pos=o,this}let a=t>>>28&15|(r&7)<<4,i=r>>3!=0;if(n[o++]=(i?a|128:a)&255,!i)return this.pos=o,this;for(let p=3;p<31;p=p+7){let f=r>>>p,m=!!(f>>>7);if(n[o++]=(m?f|128:f)&255,!m)return this.pos=o,this}return n[o++]=r>>>31&1,this.pos=o,this}},JQ=128,ql=1,$E=new Uint8Array(0),XQ=new DataView($E.buffer),HE=32;function _A(e){return e<128?1:e<16384?2:e<2097152?3:e<268435456?4:5}var ie=class{constructor(t,r=kA().decodeUtf8){this.decodeUtf8=r,this.varint64Lo=0,this.varint64Hi=0,this.varint64=VE,this.uint32=UE,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.pos,r=this.uint32(),n=this.pos-t;if(n>5||n==5&&this.buf[this.pos-1]>15)throw new Error("illegal tag: varint overflows uint32");let o=r>>>3,a=r&7;if(o<=0||a>5)throw new Error("illegal tag: field no "+o+" wire type "+a);return[o,a]}skip(t,r,n=100){let o=this.pos;switch(t){case $o.Varint:for(;this.buf[this.pos++]&128;);break;case $o.Bit64:this.pos+=4;case $o.Bit32:this.pos+=4;break;case $o.LengthDelimited:let a=this.uint32();this.pos+=a;break;case $o.StartGroup:if(n<=0)throw new Error("maximum recursion depth reached");for(;;){let[i,p]=this.tag();if(p===$o.EndGroup){if(r!==void 0&&i!==r)throw new Error("invalid end group tag");break}this.skip(p,i,n-1)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(o,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return this.varint64(),zr.dec(this.varint64Lo,this.varint64Hi)}uint64(){return this.varint64(),zr.uDec(this.varint64Lo,this.varint64Hi)}sint64(){this.varint64();let t=this.varint64Lo,r=this.varint64Hi,n=-(t&1);return t=(t>>>1|(r&1)<<31)^n,r=r>>>1^n,zr.dec(t,r)}bool(){let t=this.buf[this.pos];return t<128?(this.pos++,t!==0):(this.varint64(),this.varint64Lo!==0||this.varint64Hi!==0)}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return zr.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return zr.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(t){let r=this.bytes(),n=r.length;if(n<=HE){let o=new Array(n);for(let a=0;a<n;a++){let i=r[a];if(i>127)return this.decodeUtf8(r,t);o[a]=i}return String.fromCharCode.apply(String,o)}return this.decodeUtf8(r,t)}};function NA(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>KQ||e<YQ)throw new Error("invalid int32: "+e)}function GE(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>WQ||e<0)throw new Error("invalid uint32: "+e)}function ZQ(e){if(typeof e=="string"){let t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>HQ||e<zQ))throw new Error("invalid float32: "+e)}var eB=function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function DA(){return{fields:{}}}var Ml={encode(e,t=new Pe){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&VA.encode({key:r,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=DA();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:{if(a!==10)break;let i=VA.decode(r,r.uint32());i.value!==void 0&&(o.fields[i.key]=i.value);continue}}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Ml.fromPartial(e??{})},fromPartial(e){let t=DA();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,o])=>(o!==void 0&&(r[n]=o),r),{}),t},wrap(e){let t=DA();if(e!==void 0)for(let r of Object.keys(e))t.fields[r]=e[r];return t},unwrap(e){let t={};if(e.fields)for(let r of Object.keys(e.fields))t[r]=e.fields[r];return t}};function zE(){return{key:"",value:void 0}}var VA={encode(e,t=new Pe){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&ye.encode(ye.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=zE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.key=r.string();continue;case 2:if(a!==18)break;o.value=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return VA.fromPartial(e??{})},fromPartial(e){let t=zE();return t.key=e.key??"",t.value=e.value??void 0,t}};function qA(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var ye={encode(e,t=new Pe){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&Ml.encode(Ml.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&Vl.encode(Vl.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=qA();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.nullValue=r.int32();continue;case 2:if(a!==17)break;o.numberValue=r.double();continue;case 3:if(a!==26)break;o.stringValue=r.string();continue;case 4:if(a!==32)break;o.boolValue=r.bool();continue;case 5:if(a!==42)break;o.structValue=Ml.unwrap(Ml.decode(r,r.uint32()));continue;case 6:if(a!==50)break;o.listValue=Vl.unwrap(Vl.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return ye.fromPartial(e??{})},fromPartial(e){let t=qA();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=qA();if(e===null)t.nullValue=eB.NULL_VALUE;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(y.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new y.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function MA(){return{values:[]}}var Vl={encode(e,t=new Pe){for(let r of e.values)ye.encode(ye.wrap(r),t.uint32(10).fork()).join();return t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=MA();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.values.push(ye.unwrap(ye.decode(r,r.uint32())));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Vl.fromPartial(e??{})},fromPartial(e){let t=MA();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=MA();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&y.Array.isArray(e.values)?e.values:e}},tB=function(e){return e[e.ADD=0]="ADD",e[e.REMOVE=1]="REMOVE",e[e.REPLACE=2]="REPLACE",e[e.MOVE=3]="MOVE",e[e.COPY=4]="COPY",e[e.TEST=5]="TEST",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function WE(){return{op:0,path:"",from:void 0,value:void 0}}var Im={encode(e,t=new Pe){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==""&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&ye.encode(ye.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=WE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.op=r.int32();continue;case 2:if(a!==18)break;o.path=r.string();continue;case 3:if(a!==26)break;o.from=r.string();continue;case 4:if(a!==34)break;o.value=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Im.fromPartial(e??{})},fromPartial(e){let t=WE();return t.op=e.op??0,t.path=e.path??"",t.from=e.from??void 0,t.value=e.value??void 0,t}};function KE(){return{id:"",type:"",function:void 0}}var Tm={encode(e,t=new Pe){return e.id!==""&&t.uint32(10).string(e.id),e.type!==""&&t.uint32(18).string(e.type),e.function!==void 0&&Pm.encode(e.function,t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=KE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.id=r.string();continue;case 2:if(a!==18)break;o.type=r.string();continue;case 3:if(a!==26)break;o.function=Pm.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Tm.fromPartial(e??{})},fromPartial(e){let t=KE();return t.id=e.id??"",t.type=e.type??"",t.function=e.function!==void 0&&e.function!==null?Pm.fromPartial(e.function):void 0,t}};function YE(){return{name:"",arguments:""}}var Pm={encode(e,t=new Pe){return e.name!==""&&t.uint32(10).string(e.name),e.arguments!==""&&t.uint32(18).string(e.arguments),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=YE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.name=r.string();continue;case 2:if(a!==18)break;o.arguments=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Pm.fromPartial(e??{})},fromPartial(e){let t=YE();return t.name=e.name??"",t.arguments=e.arguments??"",t}};function JE(){return{value:"",mimeType:""}}var km={encode(e,t=new Pe){return e.value!==""&&t.uint32(10).string(e.value),e.mimeType!==""&&t.uint32(18).string(e.mimeType),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=JE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.value=r.string();continue;case 2:if(a!==18)break;o.mimeType=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return km.fromPartial(e??{})},fromPartial(e){let t=JE();return t.value=e.value??"",t.mimeType=e.mimeType??"",t}};function XE(){return{value:"",mimeType:void 0}}var Om={encode(e,t=new Pe){return e.value!==""&&t.uint32(10).string(e.value),e.mimeType!==void 0&&t.uint32(18).string(e.mimeType),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=XE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.value=r.string();continue;case 2:if(a!==18)break;o.mimeType=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Om.fromPartial(e??{})},fromPartial(e){let t=XE();return t.value=e.value??"",t.mimeType=e.mimeType??void 0,t}};function ZE(){return{data:void 0,url:void 0}}var pr={encode(e,t=new Pe){return e.data!==void 0&&km.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&Om.encode(e.url,t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=ZE();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.data=km.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.url=Om.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return pr.fromPartial(e??{})},fromPartial(e){let t=ZE();return t.data=e.data!==void 0&&e.data!==null?km.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?Om.fromPartial(e.url):void 0,t}};function eI(){return{text:""}}var _m={encode(e,t=new Pe){return e.text!==""&&t.uint32(10).string(e.text),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=eI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.text=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return _m.fromPartial(e??{})},fromPartial(e){let t=eI();return t.text=e.text??"",t}};function tI(){return{source:void 0,metadata:void 0}}var Nm={encode(e,t=new Pe){return e.source!==void 0&&pr.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&ye.encode(ye.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=tI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.source=pr.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.metadata=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Nm.fromPartial(e??{})},fromPartial(e){let t=tI();return t.source=e.source!==void 0&&e.source!==null?pr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function rI(){return{source:void 0,metadata:void 0}}var Dm={encode(e,t=new Pe){return e.source!==void 0&&pr.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&ye.encode(ye.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=rI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.source=pr.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.metadata=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Dm.fromPartial(e??{})},fromPartial(e){let t=rI();return t.source=e.source!==void 0&&e.source!==null?pr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function nI(){return{source:void 0,metadata:void 0}}var qm={encode(e,t=new Pe){return e.source!==void 0&&pr.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&ye.encode(ye.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=nI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.source=pr.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.metadata=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return qm.fromPartial(e??{})},fromPartial(e){let t=nI();return t.source=e.source!==void 0&&e.source!==null?pr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function oI(){return{source:void 0,metadata:void 0}}var Mm={encode(e,t=new Pe){return e.source!==void 0&&pr.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&ye.encode(ye.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=oI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.source=pr.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.metadata=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Mm.fromPartial(e??{})},fromPartial(e){let t=oI();return t.source=e.source!==void 0&&e.source!==null?pr.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function aI(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var Vm={encode(e,t=new Pe){return e.text!==void 0&&_m.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&Nm.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&Dm.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&qm.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&Mm.encode(e.document,t.uint32(42).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=aI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.text=_m.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.image=Nm.decode(r,r.uint32());continue;case 3:if(a!==26)break;o.audio=Dm.decode(r,r.uint32());continue;case 4:if(a!==34)break;o.video=qm.decode(r,r.uint32());continue;case 5:if(a!==42)break;o.document=Mm.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Vm.fromPartial(e??{})},fromPartial(e){let t=aI();return t.text=e.text!==void 0&&e.text!==null?_m.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?Nm.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?Dm.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?qm.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?Mm.fromPartial(e.document):void 0,t}};function iI(){return{id:"",role:"",content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[]}}var jm={encode(e,t=new Pe){e.id!==""&&t.uint32(10).string(e.id),e.role!==""&&t.uint32(18).string(e.role),e.content!==void 0&&t.uint32(26).string(e.content),e.name!==void 0&&t.uint32(34).string(e.name);for(let r of e.toolCalls)Tm.encode(r,t.uint32(42).fork()).join();e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error);for(let r of e.contentParts)Vm.encode(r,t.uint32(66).fork()).join();return t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=iI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.id=r.string();continue;case 2:if(a!==18)break;o.role=r.string();continue;case 3:if(a!==26)break;o.content=r.string();continue;case 4:if(a!==34)break;o.name=r.string();continue;case 5:if(a!==42)break;o.toolCalls.push(Tm.decode(r,r.uint32()));continue;case 6:if(a!==50)break;o.toolCallId=r.string();continue;case 7:if(a!==58)break;o.error=r.string();continue;case 8:if(a!==66)break;o.contentParts.push(Vm.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return jm.fromPartial(e??{})},fromPartial(e){let t=iI();return t.id=e.id??"",t.role=e.role??"",t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(r=>Tm.fromPartial(r))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(r=>Vm.fromPartial(r))||[],t}};function sI(){return{id:"",reason:"",message:void 0,toolCallId:void 0,responseSchema:void 0,expiresAt:void 0,metadata:void 0}}var Lm={encode(e,t=new Pe){return e.id!==""&&t.uint32(10).string(e.id),e.reason!==""&&t.uint32(18).string(e.reason),e.message!==void 0&&t.uint32(26).string(e.message),e.toolCallId!==void 0&&t.uint32(34).string(e.toolCallId),e.responseSchema!==void 0&&ye.encode(ye.wrap(e.responseSchema),t.uint32(42).fork()).join(),e.expiresAt!==void 0&&t.uint32(50).string(e.expiresAt),e.metadata!==void 0&&ye.encode(ye.wrap(e.metadata),t.uint32(58).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=sI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.id=r.string();continue;case 2:if(a!==18)break;o.reason=r.string();continue;case 3:if(a!==26)break;o.message=r.string();continue;case 4:if(a!==34)break;o.toolCallId=r.string();continue;case 5:if(a!==42)break;o.responseSchema=ye.unwrap(ye.decode(r,r.uint32()));continue;case 6:if(a!==50)break;o.expiresAt=r.string();continue;case 7:if(a!==58)break;o.metadata=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Lm.fromPartial(e??{})},fromPartial(e){let t=sI();return t.id=e.id??"",t.reason=e.reason??"",t.message=e.message??void 0,t.toolCallId=e.toolCallId??void 0,t.responseSchema=e.responseSchema??void 0,t.expiresAt=e.expiresAt??void 0,t.metadata=e.metadata??void 0,t}},rB=function(e){return e[e.TEXT_MESSAGE_START=0]="TEXT_MESSAGE_START",e[e.TEXT_MESSAGE_CONTENT=1]="TEXT_MESSAGE_CONTENT",e[e.TEXT_MESSAGE_END=2]="TEXT_MESSAGE_END",e[e.TOOL_CALL_START=3]="TOOL_CALL_START",e[e.TOOL_CALL_ARGS=4]="TOOL_CALL_ARGS",e[e.TOOL_CALL_END=5]="TOOL_CALL_END",e[e.STATE_SNAPSHOT=6]="STATE_SNAPSHOT",e[e.STATE_DELTA=7]="STATE_DELTA",e[e.MESSAGES_SNAPSHOT=8]="MESSAGES_SNAPSHOT",e[e.RAW=9]="RAW",e[e.CUSTOM=10]="CUSTOM",e[e.RUN_STARTED=11]="RUN_STARTED",e[e.RUN_FINISHED=12]="RUN_FINISHED",e[e.RUN_ERROR=13]="RUN_ERROR",e[e.STEP_STARTED=14]="STEP_STARTED",e[e.STEP_FINISHED=15]="STEP_FINISHED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function cI(){return{type:0,timestamp:void 0,rawEvent:void 0}}var Ce={encode(e,t=new Pe){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&ye.encode(ye.wrap(e.rawEvent),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=cI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.type=r.int32();continue;case 2:if(a!==16)break;o.timestamp=lc(r.int64());continue;case 3:if(a!==26)break;o.rawEvent=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Ce.fromPartial(e??{})},fromPartial(e){let t=cI();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function uI(){return{baseEvent:void 0,messageId:"",role:void 0,name:void 0}}var Um={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.name!==void 0&&t.uint32(34).string(e.name),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=uI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.role=r.string();continue;case 4:if(a!==34)break;o.name=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Um.fromPartial(e??{})},fromPartial(e){let t=uI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.role=e.role??void 0,t.name=e.name??void 0,t}};function lI(){return{baseEvent:void 0,messageId:"",delta:""}}var Qm={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=lI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Qm.fromPartial(e??{})},fromPartial(e){let t=lI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.delta=e.delta??"",t}};function dI(){return{baseEvent:void 0,messageId:""}}var Bm={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=dI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Bm.fromPartial(e??{})},fromPartial(e){let t=dI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t}};function pI(){return{baseEvent:void 0,toolCallId:"",toolCallName:"",parentMessageId:void 0}}var Gm={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.toolCallName!==""&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=pI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.toolCallName=r.string();continue;case 4:if(a!==34)break;o.parentMessageId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Gm.fromPartial(e??{})},fromPartial(e){let t=pI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.toolCallName=e.toolCallName??"",t.parentMessageId=e.parentMessageId??void 0,t}};function fI(){return{baseEvent:void 0,toolCallId:"",delta:""}}var $m={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=fI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return $m.fromPartial(e??{})},fromPartial(e){let t=fI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.delta=e.delta??"",t}};function mI(){return{baseEvent:void 0,toolCallId:""}}var Hm={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=mI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Hm.fromPartial(e??{})},fromPartial(e){let t=mI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t}};function gI(){return{baseEvent:void 0,snapshot:void 0}}var zm={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&ye.encode(ye.wrap(e.snapshot),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=gI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.snapshot=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return zm.fromPartial(e??{})},fromPartial(e){let t=gI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function hI(){return{baseEvent:void 0,delta:[]}}var Wm={encode(e,t=new Pe){e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.delta)Im.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=hI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.delta.push(Im.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Wm.fromPartial(e??{})},fromPartial(e){let t=hI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(r=>Im.fromPartial(r))||[],t}};function yI(){return{baseEvent:void 0,messages:[]}}var Km={encode(e,t=new Pe){e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.messages)jm.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=yI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messages.push(jm.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Km.fromPartial(e??{})},fromPartial(e){let t=yI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(r=>jm.fromPartial(r))||[],t}};function SI(){return{baseEvent:void 0,event:void 0,source:void 0}}var Ym={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&ye.encode(ye.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=SI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.event=ye.unwrap(ye.decode(r,r.uint32()));continue;case 3:if(a!==26)break;o.source=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Ym.fromPartial(e??{})},fromPartial(e){let t=SI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function vI(){return{baseEvent:void 0,name:"",value:void 0}}var Jm={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==""&&t.uint32(18).string(e.name),e.value!==void 0&&ye.encode(ye.wrap(e.value),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=vI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.name=r.string();continue;case 3:if(a!==26)break;o.value=ye.unwrap(ye.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Jm.fromPartial(e??{})},fromPartial(e){let t=vI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.name=e.name??"",t.value=e.value??void 0,t}};function AI(){return{baseEvent:void 0,threadId:"",runId:""}}var Xm={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=AI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.threadId=r.string();continue;case 3:if(a!==26)break;o.runId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Xm.fromPartial(e??{})},fromPartial(e){let t=AI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t}};function CI(){return{provider:void 0,model:void 0,inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0}}var ii={encode(e,t=new Pe){return e.provider!==void 0&&t.uint32(10).string(e.provider),e.model!==void 0&&t.uint32(18).string(e.model),e.inputTokens!==void 0&&t.uint32(24).int64(e.inputTokens),e.outputTokens!==void 0&&t.uint32(32).int64(e.outputTokens),e.totalTokens!==void 0&&t.uint32(40).int64(e.totalTokens),e.reasoningTokens!==void 0&&t.uint32(48).int64(e.reasoningTokens),e.cachedInputTokens!==void 0&&t.uint32(56).int64(e.cachedInputTokens),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=CI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.provider=r.string();continue;case 2:if(a!==18)break;o.model=r.string();continue;case 3:if(a!==24)break;o.inputTokens=lc(r.int64());continue;case 4:if(a!==32)break;o.outputTokens=lc(r.int64());continue;case 5:if(a!==40)break;o.totalTokens=lc(r.int64());continue;case 6:if(a!==48)break;o.reasoningTokens=lc(r.int64());continue;case 7:if(a!==56)break;o.cachedInputTokens=lc(r.int64());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return ii.fromPartial(e??{})},fromPartial(e){let t=CI();return t.provider=e.provider??void 0,t.model=e.model??void 0,t.inputTokens=e.inputTokens??void 0,t.outputTokens=e.outputTokens??void 0,t.totalTokens=e.totalTokens??void 0,t.reasoningTokens=e.reasoningTokens??void 0,t.cachedInputTokens=e.cachedInputTokens??void 0,t}};function xI(){return{baseEvent:void 0,threadId:"",runId:"",result:void 0,outcome:"",interrupts:[],usage:[]}}var Zm={encode(e,t=new Pe){e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),e.result!==void 0&&ye.encode(ye.wrap(e.result),t.uint32(34).fork()).join(),e.outcome!==""&&t.uint32(42).string(e.outcome);for(let r of e.interrupts)Lm.encode(r,t.uint32(50).fork()).join();for(let r of e.usage)ii.encode(r,t.uint32(58).fork()).join();return t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=xI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.threadId=r.string();continue;case 3:if(a!==26)break;o.runId=r.string();continue;case 4:if(a!==34)break;o.result=ye.unwrap(ye.decode(r,r.uint32()));continue;case 5:if(a!==42)break;o.outcome=r.string();continue;case 6:if(a!==50)break;o.interrupts.push(Lm.decode(r,r.uint32()));continue;case 7:if(a!==58)break;o.usage.push(ii.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Zm.fromPartial(e??{})},fromPartial(e){let t=xI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t.result=e.result??void 0,t.outcome=e.outcome??"",t.interrupts=e.interrupts?.map(r=>Lm.fromPartial(r))||[],t.usage=e.usage?.map(r=>ii.fromPartial(r))||[],t}};function bI(){return{baseEvent:void 0,code:void 0,message:"",usage:[]}}var eg={encode(e,t=new Pe){e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==""&&t.uint32(26).string(e.message);for(let r of e.usage)ii.encode(r,t.uint32(34).fork()).join();return t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=bI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.code=r.string();continue;case 3:if(a!==26)break;o.message=r.string();continue;case 4:if(a!==34)break;o.usage.push(ii.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return eg.fromPartial(e??{})},fromPartial(e){let t=bI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??"",t.usage=e.usage?.map(r=>ii.fromPartial(r))||[],t}};function wI(){return{baseEvent:void 0,stepName:""}}var tg={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=wI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.stepName=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return tg.fromPartial(e??{})},fromPartial(e){let t=wI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function RI(){return{baseEvent:void 0,stepName:""}}var rg={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=RI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.stepName=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return rg.fromPartial(e??{})},fromPartial(e){let t=RI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function FI(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0}}var ng={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),e.name!==void 0&&t.uint32(42).string(e.name),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=FI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.role=r.string();continue;case 4:if(a!==34)break;o.delta=r.string();continue;case 5:if(a!==42)break;o.name=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return ng.fromPartial(e??{})},fromPartial(e){let t=FI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t.name=e.name??void 0,t}};function EI(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var og={encode(e,t=new Pe){return e.baseEvent!==void 0&&Ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=EI();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=Ce.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.toolCallName=r.string();continue;case 4:if(a!==34)break;o.parentMessageId=r.string();continue;case 5:if(a!==42)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return og.fromPartial(e??{})},fromPartial(e){let t=EI();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Ce.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t}};function II(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0}}var TI={encode(e,t=new Pe){return e.textMessageStart!==void 0&&Um.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&Qm.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&Bm.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&Gm.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&$m.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&Hm.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&zm.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&Wm.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&Km.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&Ym.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&Jm.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&Xm.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&Zm.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&eg.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&tg.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&rg.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&ng.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&og.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=II();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.textMessageStart=Um.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.textMessageContent=Qm.decode(r,r.uint32());continue;case 3:if(a!==26)break;o.textMessageEnd=Bm.decode(r,r.uint32());continue;case 4:if(a!==34)break;o.toolCallStart=Gm.decode(r,r.uint32());continue;case 5:if(a!==42)break;o.toolCallArgs=$m.decode(r,r.uint32());continue;case 6:if(a!==50)break;o.toolCallEnd=Hm.decode(r,r.uint32());continue;case 7:if(a!==58)break;o.stateSnapshot=zm.decode(r,r.uint32());continue;case 8:if(a!==66)break;o.stateDelta=Wm.decode(r,r.uint32());continue;case 9:if(a!==74)break;o.messagesSnapshot=Km.decode(r,r.uint32());continue;case 10:if(a!==82)break;o.raw=Ym.decode(r,r.uint32());continue;case 11:if(a!==90)break;o.custom=Jm.decode(r,r.uint32());continue;case 12:if(a!==98)break;o.runStarted=Xm.decode(r,r.uint32());continue;case 13:if(a!==106)break;o.runFinished=Zm.decode(r,r.uint32());continue;case 14:if(a!==114)break;o.runError=eg.decode(r,r.uint32());continue;case 15:if(a!==122)break;o.stepStarted=tg.decode(r,r.uint32());continue;case 16:if(a!==130)break;o.stepFinished=rg.decode(r,r.uint32());continue;case 17:if(a!==138)break;o.textMessageChunk=ng.decode(r,r.uint32());continue;case 18:if(a!==146)break;o.toolCallChunk=og.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return TI.fromPartial(e??{})},fromPartial(e){let t=II();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?Um.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?Qm.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?Bm.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?Gm.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?$m.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?Hm.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?zm.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?Wm.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?Km.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?Ym.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?Jm.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?Xm.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?Zm.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?eg.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?tg.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?rg.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?ng.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?og.fromPartial(e.toolCallChunk):void 0,t}};function lc(e){let t=y.Number(e.toString());if(t>y.Number.MAX_SAFE_INTEGER)throw new y.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(t<y.Number.MIN_SAFE_INTEGER)throw new y.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return t}var PI=e=>e&&typeof e=="object"?e:void 0;var Em=e=>{let t=PI(e);if(t){if(t.data){let r=t.data;return{type:"data",value:r.value,mimeType:r.mimeType}}if(t.url){let r=t.url;return{type:"url",value:r.value,mimeType:r.mimeType}}}},nB=e=>{let t=PI(e);if(t){if(t.text)return{type:"text",text:t.text.text};if(t.image){let r=t.image;return{type:"image",source:Em(r.source),metadata:r.metadata}}if(t.audio){let r=t.audio;return{type:"audio",source:Em(r.source),metadata:r.metadata}}if(t.video){let r=t.video;return{type:"video",source:Em(r.source),metadata:r.metadata}}if(t.document){let r=t.document;return{type:"document",source:Em(r.source),metadata:r.metadata}}}};function kI(e){let t=TI.decode(e),r=Object.values(t).find(n=>n!==void 0);if(!r)throw new Error("Invalid event");if(r.type=rB[r.baseEvent.type],r.timestamp=r.baseEvent.timestamp,r.rawEvent=r.baseEvent.rawEvent,delete r.baseEvent,r.type===M.MESSAGES_SNAPSHOT)for(let n of r.messages){let o=n;if(o.role==="user"&&Array.isArray(o.contentParts)){let a=o.contentParts.map(i=>nB(i)).filter(i=>i!==void 0);a.length>0&&(o.content=a)}Array.isArray(o.contentParts)&&o.contentParts.length===0&&(o.contentParts=void 0),o.toolCalls?.length===0&&(o.toolCalls=void 0)}if(r.type===M.RUN_FINISHED){let n=r,o=typeof n.outcome=="string"&&n.outcome!==""?n.outcome:void 0,a=Array.isArray(n.interrupts)?n.interrupts:[];delete n.interrupts,o==="interrupt"?n.outcome={type:"interrupt",interrupts:a}:o==="success"?n.outcome={type:"success"}:delete n.outcome}if((r.type===M.RUN_FINISHED||r.type===M.RUN_ERROR)&&Array.isArray(r.usage)&&r.usage.length===0&&delete r.usage,r.type===M.STATE_DELTA)for(let n of r.delta)n.op=tB[n.op].toLowerCase(),Object.keys(n).forEach(o=>{n[o]===void 0&&delete n[o]});return Object.keys(r).forEach(n=>{r[n]===void 0&&delete r[n]}),$f.parse(r)}var jA="application/vnd.ag-ui.event+proto";d();c();l();u();d();c();l();u();d();c();l();u();var aB=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,LA=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(aB);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},OI=e=>e==="*"||e==="x"||e==="X",_I=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},iB=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],sB=(e,t)=>{if(OI(e)||OI(t))return 0;let[r,n]=iB(_I(e),_I(t));return r>n?1:r<n?-1:0},UA=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=sB(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var jl=(e,t)=>{let r=LA(e),n=LA(t),o=r.pop(),a=n.pop(),i=UA(r,n);return i!==0?i:o&&a?UA(o.split("."),a.split(".")):o||a?o?-1:1:0};var je=e=>{if(typeof structuredClone=="function")return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function Ll(){return Lo()}function GA(e){if(Object.freeze(e),typeof e=="object"&&e)for(let t of Object.values(e))typeof t=="object"&&t&&!Object.isFrozen(t)&&GA(t);return e}var NI=512*1024;function DI(e,t,r){let n=0,o=[e,t],a=new WeakSet;for(;o.length>0;){let i=o.pop();if(typeof i=="string"){if(n+=i.length,n>r)return!0}else if(typeof i=="object"&&i){if(a.has(i))continue;if(a.add(i),Array.isArray(i))for(let p=0;p<i.length;p++)o.push(i[p]);else{let p=Object.keys(i);for(let f=0;f<p.length;f++){let m=p[f];if(n+=m.length,n>r)return!0;o.push(i[m])}}}}return!1}function $e(_x140,_x141,_x142,_x143){return _$e.apply(this,arguments)}function _$e(){_$e=_asyncToGenerator(function*(e,t,r,n){let o=typeof process<"u"&&process.env!==void 0,a=o&&!!process.env.VITEST_WORKER_ID,i=o&&!!process.env.VITEST_WORKER_ID,p=i&&!DI(t,r,NI),f=p?je(t):t,m=p?je(r):r,g=!1,S=!1,x;for(let h of e)try{p&&(GA(f),GA(m));let C=yield n(h,f,m);if(C===void 0)continue;let b=!1;if(C.messages!==void 0&&C.messages!==f&&(f=je(C.messages),g=!0,b=!0),C.state!==void 0&&C.state!==m&&(m=je(C.state),S=!0,b=!0),p&&b&&DI(f,m,NI)&&(p=!1),x=C.stopPropagation,x===!0)break}catch(C){if(i&&C instanceof TypeError){if(a)throw C;console.error("AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.",C)}else a||console.error("Subscriber error:",C);continue}return{...(g?{messages:Object.isFrozen(f)?je(f):f}:{}),...(S?{state:Object.isFrozen(m)?je(m):m}:{}),...(x===void 0?{}:{stopPropagation:x})}});return _$e.apply(this,arguments)}function ag(e){if(!e)return{enabled:!1,events:!1,lifecycle:!1,verbose:!1};if(e===!0)return{enabled:!0,events:!0,lifecycle:!0,verbose:!0};let t=e.events??!0,r=e.lifecycle??!0,n=e.verbose??!1;return{enabled:t||r,events:t,lifecycle:r,verbose:n}}function Ul(e){if(e instanceof $A)return e;if(e===!0)return new $A(ag(!0))}var $A=class{constructor(e){this.config=e}event(e,t,r,n){this.config.events&&(this.config.verbose?console.debug(`[${e}] ${t}`,typeof r=="string"?r:JSON.stringify(r)):console.debug(`[${e}] ${t}`,n??r))}lifecycle(e,t,r){this.config.lifecycle&&(r?console.debug(`[${e}] ${t}`,r):console.debug(`[${e}] ${t}`))}get eventsEnabled(){return this.config.events}get lifecycleEnabled(){return this.config.lifecycle}get enabled(){return this.config.enabled}};function QA(e){return e.enabled?new $A(e):void 0}function cB(e,t,r){if(t){let o=e.find(i=>i.id===t);if(o?.role==="assistant")return o;o&&console.warn(`TOOL_CALL_START: parentMessageId '${t}' matches a '${o.role}' message, not assistant \u2014 falling back to toolCallId`);let a={id:o?r:t,role:"assistant",toolCalls:[]};return e.push(a),a}let n={id:r,role:"assistant",toolCalls:[]};return e.push(n),n}var UI=(e,t,r,n,o)=>{let a=Ul(o),i=je(r.messages),p=je(e.state),f={},m=S=>{S.messages!==void 0&&(i=S.messages,f.messages=S.messages),S.state!==void 0&&(p=S.state,f.state=S.state)},g=()=>{let S=je(f);return f={},S.messages!==void 0||S.state!==void 0?ot(S):cm};return t.pipe(bm(/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(S){let x=yield $e(n,i,p,(h,C,b)=>h.onEvent?.({event:S,agent:r,input:e,messages:C,state:b}));if(m(x),x.stopPropagation===!0?a?.event("APPLY","Event dropped:",S,{type:S.type,reason:"stopPropagation by subscriber"}):a?.event("APPLY","Event applied:",S,{type:S.type,subscribers:n.length}),x.stopPropagation===!0)return g();switch(S.type){case M.TEXT_MESSAGE_START:{let h=yield $e(n,i,p,(C,b,w)=>C.onTextMessageStartEvent?.({event:S,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{messageId:C,role:b="assistant",name:w}=S;if(!i.find(F=>F.id===C)){let F={id:C,role:b,content:"",...(w!==void 0&&{name:w})};i.push(F),m({messages:i})}}return g()}case M.TEXT_MESSAGE_CONTENT:{let{messageId:h,delta:C}=S,b=i.find(F=>F.id===h);if(!b)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${h}'`),g();let w=yield $e(n,i,p,(F,I,E)=>F.onTextMessageContentEvent?.({event:S,messages:I,state:E,agent:r,input:e,textMessageBuffer:typeof b.content=="string"?b.content:""}));return m(w),w.stopPropagation!==!0&&(b.content=`${typeof b.content=="string"?b.content:""}${C}`,m({messages:i})),g()}case M.TEXT_MESSAGE_END:{let{messageId:h}=S,C=i.find(b=>b.id===h);return C?(m(yield $e(n,i,p,(b,w,F)=>b.onTextMessageEndEvent?.({event:S,messages:w,state:F,agent:r,input:e,textMessageBuffer:typeof C.content=="string"?C.content:""}))),yield Promise.all(n.map(b=>{b.onNewMessage?.({message:C,messages:i,state:p,agent:r,input:e})})),g()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${h}'`),g())}case M.TOOL_CALL_START:{let h=yield $e(n,i,p,(C,b,w)=>C.onToolCallStartEvent?.({event:S,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{toolCallId:C,toolCallName:b,parentMessageId:w}=S,F=i.find(E=>E.toolCalls?.some(T=>T.id===C))?.toolCalls?.find(E=>E.id===C);if(F)return F.function.name!==b&&(console.warn(`TOOL_CALL_START: tool call '${C}' already exists with name '${F.function.name}' \u2014 updating it to '${b}'`),F.function.name=b,m({messages:i})),g();let I=cB(i,w,C);I.toolCalls??(I.toolCalls=[]),I.toolCalls.push({id:C,type:"function",function:{name:b,arguments:""}}),m({messages:i})}return g()}case M.TOOL_CALL_ARGS:{let{toolCallId:h,delta:C}=S,b=i.find(I=>I.toolCalls?.some(E=>E.id===h));if(!b)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${h}'`),g();let w=b.toolCalls?.find(I=>I.id===h);if(!w)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${h}'`),g();let F=yield $e(n,i,p,(I,E,T)=>{let P=w.function.arguments,D=w.function.name,G={};try{G=Rm(P)}catch{}return I.onToolCallArgsEvent?.({event:S,messages:E,state:T,agent:r,input:e,toolCallBuffer:P,toolCallName:D,partialToolCallArgs:G})});return m(F),F.stopPropagation!==!0&&(w.function.arguments+=C,m({messages:i})),g()}case M.TOOL_CALL_END:{let{toolCallId:h}=S,C=i.find(w=>w.toolCalls?.some(F=>F.id===h));if(!C)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${h}'`),g();let b=C.toolCalls?.find(w=>w.id===h);return b?(m(yield $e(n,i,p,(w,F,I)=>{let E=b.function.arguments,T=b.function.name,P={};try{P=JSON.parse(E)}catch{}return w.onToolCallEndEvent?.({event:S,messages:F,state:I,agent:r,input:e,toolCallName:T,toolCallArgs:P})})),yield Promise.all(n.map(w=>{w.onNewToolCall?.({toolCall:b,messages:i,state:p,agent:r,input:e})})),g()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${h}'`),g())}case M.TOOL_CALL_RESULT:{let h=yield $e(n,i,p,(C,b,w)=>C.onToolCallResultEvent?.({event:S,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{messageId:C,toolCallId:b,content:w,role:F}=S,I={id:C,toolCallId:b,role:F||"tool",content:w},E=i.findIndex(T=>T.role==="assistant"&&T.toolCalls?.some(P=>P.id===b));if(E===-1)i.push(I);else{let T=E+1;for(;T<i.length&&i[T].role==="tool";)T++;i.splice(T,0,I)}yield Promise.all(n.map(T=>{T.onNewMessage?.({message:I,messages:i,state:p,agent:r,input:e})})),m({messages:i})}return g()}case M.STATE_SNAPSHOT:{let h=yield $e(n,i,p,(C,b,w)=>C.onStateSnapshotEvent?.({event:S,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{snapshot:C}=S;p=C,m({state:p})}return g()}case M.STATE_DELTA:{let h=yield $e(n,i,p,(C,b,w)=>C.onStateDeltaEvent?.({event:S,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{delta:C}=S;try{p=Zf.applyPatch(p,C,!0,!1).newDocument,m({state:p})}catch(b){let w=b instanceof Error?b.message:String(b);console.warn(`Failed to apply state patch:
|
|
37
37
|
Current state: ${JSON.stringify(p,null,2)}
|
|
38
38
|
Patch operations: ${JSON.stringify(C,null,2)}
|
|
39
|
-
Error: ${w}`)}}return g()}case M.MESSAGES_SNAPSHOT:{let v=yield $e(n,i,p,(C,b,w)=>C.onMessagesSnapshotEvent?.({event:y,messages:b,state:w,agent:r,input:e}));if(m(v),v.stopPropagation!==!0){let{messages:C}=y,b=new Map(C.map(E=>[E.id,E])),w=C.some(E=>E.role==="reasoning"),F=E=>E.role==="activity"||E.role==="reasoning"&&!w;i=i.filter(E=>F(E)||b.has(E.id)).map(E=>F(E)?E:b.get(E.id));let I=new Set(i.map(E=>E.id));for(let E of C)I.has(E.id)||i.push(E);m({messages:i})}return g()}case M.ACTIVITY_SNAPSHOT:{let v=y,C=i.findIndex(E=>E.id===v.messageId),b=C>=0?i[C]:void 0,w=b?.role==="activity"?b:void 0,F=v.replace??!0,I=yield $e(n,i,p,(E,k,T)=>E.onActivitySnapshotEvent?.({event:v,messages:k,state:T,agent:r,input:e,activityMessage:w,existingMessage:b}));if(m(I),I.stopPropagation!==!0){let E={id:v.messageId,role:"activity",activityType:v.activityType,content:Ve(v.content)},k;C===-1?(i.push(E),k=E):w?F&&(i[C]={...w,activityType:v.activityType,content:Ve(v.content)}):F&&(i[C]=E,k=E),m({messages:i}),k&&(yield Promise.all(n.map(T=>T.onNewMessage?.({message:k,messages:i,state:p,agent:r,input:e}))))}return g()}case M.ACTIVITY_DELTA:{let v=y,C=i.findIndex(I=>I.id===v.messageId);if(C===-1)return g();let b=i[C];if(b.role!=="activity")return console.warn(`ACTIVITY_DELTA: Message '${v.messageId}' is not an activity message`),g();let w=b,F=yield $e(n,i,p,(I,E,k)=>I.onActivityDeltaEvent?.({event:v,messages:E,state:k,agent:r,input:e,activityMessage:w}));if(m(F),F.stopPropagation!==!0)try{let I=Ve(w.content??{}),E=Jf.applyPatch(I,v.patch??[],!0,!1).newDocument;i[C]={...w,content:Ve(E),activityType:v.activityType},m({messages:i})}catch(I){let E=I instanceof Error?I.message:String(I);console.warn(`Failed to apply activity patch for '${v.messageId}': ${E}`)}return g()}case M.RAW:return m(yield $e(n,i,p,(v,C,b)=>v.onRawEvent?.({event:y,messages:C,state:b,agent:r,input:e}))),g();case M.CUSTOM:return m(yield $e(n,i,p,(v,C,b)=>v.onCustomEvent?.({event:y,messages:C,state:b,agent:r,input:e}))),g();case M.RUN_STARTED:{let v=yield $e(n,i,p,(C,b,w)=>C.onRunStartedEvent?.({event:y,messages:b,state:w,agent:r,input:e}));if(m(v),v.stopPropagation!==!0){let C=y;if(C.input?.messages){for(let b of C.input.messages)i.find(w=>w.id===b.id)||i.push(b);m({messages:i})}}return g()}case M.RUN_FINISHED:{let v=y,C=v.outcome?.type==="interrupt"?{event:v,outcome:"interrupt",interrupts:v.outcome.interrupts}:{event:v,outcome:"success",result:v.result},b=yield $e(n,i,p,(w,F,I)=>w.onRunFinishedEvent?.({...C,messages:F,state:I,agent:r,input:e}));return m(b),b.stopPropagation!==!0&&(r.pendingInterrupts=C.outcome==="interrupt"?[...C.interrupts]:[]),g()}case M.RUN_ERROR:return m(yield $e(n,i,p,(v,C,b)=>v.onRunErrorEvent?.({event:y,messages:C,state:b,agent:r,input:e}))),g();case M.STEP_STARTED:return m(yield $e(n,i,p,(v,C,b)=>v.onStepStartedEvent?.({event:y,messages:C,state:b,agent:r,input:e}))),g();case M.STEP_FINISHED:return m(yield $e(n,i,p,(v,C,b)=>v.onStepFinishedEvent?.({event:y,messages:C,state:b,agent:r,input:e}))),g();case M.TEXT_MESSAGE_CHUNK:throw Error("TEXT_MESSAGE_CHUNK must be tranformed before being applied");case M.TOOL_CALL_CHUNK:throw Error("TOOL_CALL_CHUNK must be tranformed before being applied");case M.THINKING_START:return g();case M.THINKING_END:return g();case M.THINKING_TEXT_MESSAGE_START:return g();case M.THINKING_TEXT_MESSAGE_CONTENT:return g();case M.THINKING_TEXT_MESSAGE_END:return g();case M.REASONING_START:return m(yield $e(n,i,p,(v,C,b)=>v.onReasoningStartEvent?.({event:y,messages:C,state:b,agent:r,input:e}))),g();case M.REASONING_MESSAGE_START:{let v=yield $e(n,i,p,(C,b,w)=>C.onReasoningMessageStartEvent?.({event:y,messages:b,state:w,agent:r,input:e}));if(m(v),v.stopPropagation!==!0){let{messageId:C}=y;if(!i.find(b=>b.id===C)){let b={id:C,role:"reasoning",content:""};i.push(b),m({messages:i})}}return g()}case M.REASONING_MESSAGE_CONTENT:{let{messageId:v,delta:C}=y,b=i.find(F=>F.id===v);if(!b)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${v}'`),g();let w=yield $e(n,i,p,(F,I,E)=>F.onReasoningMessageContentEvent?.({event:y,messages:I,state:E,agent:r,input:e,reasoningMessageBuffer:typeof b.content=="string"?b.content:""}));return m(w),w.stopPropagation!==!0&&(b.content=`${typeof b.content=="string"?b.content:""}${C}`,m({messages:i})),g()}case M.REASONING_MESSAGE_END:{let{messageId:v}=y,C=i.find(b=>b.id===v);return C?(m(yield $e(n,i,p,(b,w,F)=>b.onReasoningMessageEndEvent?.({event:y,messages:w,state:F,agent:r,input:e,reasoningMessageBuffer:typeof C.content=="string"?C.content:""}))),yield Promise.all(n.map(b=>{b.onNewMessage?.({message:C,messages:i,state:p,agent:r,input:e})})),g()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${v}'`),g())}case M.REASONING_MESSAGE_CHUNK:throw Error("REASONING_MESSAGE_CHUNK must be transformed before being applied");case M.REASONING_END:return m(yield $e(n,i,p,(v,C,b)=>v.onReasoningEndEvent?.({event:y,messages:C,state:b,agent:r,input:e}))),g();case M.REASONING_ENCRYPTED_VALUE:{let{subtype:v,entityId:C,encryptedValue:b}=y,w=yield $e(n,i,p,(F,I,E)=>F.onReasoningEncryptedValueEvent?.({event:y,messages:I,state:E,agent:r,input:e}));if(m(w),w.stopPropagation!==!0){let F=!1;if(v==="tool-call"){for(let I of i)if(I.role==="assistant"&&I.toolCalls){let E=I.toolCalls.find(k=>k.id===C);if(E){E.encryptedValue=b,F=!0;break}}}else{let I=i.find(E=>E.id===C);I?.role!=="activity"&&I&&(I.encryptedValue=b,F=!0)}F&&(f.messages=i)}return g()}}return y.type,g()});return function(_x144){return _ref57.apply(this,arguments)}}()),CA(),n.length>0?xA({}):y=>y)},UA=e=>t=>{let r=Vu(e),n=new Map,o=new Map,a=!1,i=!1,p=!1,f=new Map,m=!1,g=!1,y=!1,x=()=>{n.clear(),o.clear(),f.clear(),m=!1,g=!1,a=!1,i=!1,y=!0};return t.pipe(nr(v=>{let C=v.type;if(r?.event("VERIFY","Event:",v,{type:v.type}),i)return et(()=>new Xe(`Cannot send event type '${C}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(a&&C!==M.RUN_ERROR&&C!==M.RUN_STARTED)return et(()=>new Xe(`Cannot send event type '${C}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(p){if(C===M.RUN_STARTED){if(y&&!a)return et(()=>new Xe("Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run."));a&&x()}}else if(p=!0,C!==M.RUN_STARTED&&C!==M.RUN_ERROR)return et(()=>new Xe("First event must be 'RUN_STARTED'"));switch(C){case M.TEXT_MESSAGE_START:{let b=v.messageId;return n.has(b)?et(()=>new Xe(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${b}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(n.set(b,!0),ot(v))}case M.TEXT_MESSAGE_CONTENT:{let b=v.messageId;return n.has(b)?ot(v):et(()=>new Xe(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${b}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case M.TEXT_MESSAGE_END:{let b=v.messageId;return n.has(b)?(n.delete(b),ot(v)):et(()=>new Xe(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${b}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case M.TOOL_CALL_START:{let b=v.toolCallId;return o.has(b)?et(()=>new Xe(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${b}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(o.set(b,!0),ot(v))}case M.TOOL_CALL_ARGS:{let b=v.toolCallId;return o.has(b)?ot(v):et(()=>new Xe(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${b}'. Start a tool call with 'TOOL_CALL_START' first.`))}case M.TOOL_CALL_END:{let b=v.toolCallId;return o.has(b)?(o.delete(b),ot(v)):et(()=>new Xe(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${b}'. A 'TOOL_CALL_START' event must be sent first.`))}case M.STEP_STARTED:{let b=v.stepName;return f.has(b)?et(()=>new Xe(`Step "${b}" is already active for 'STEP_STARTED'`)):(f.set(b,!0),ot(v))}case M.STEP_FINISHED:{let b=v.stepName;return f.has(b)?(f.delete(b),ot(v)):et(()=>new Xe(`Cannot send 'STEP_FINISHED' for step "${b}" that was not started`))}case M.RUN_STARTED:return y=!0,ot(v);case M.RUN_FINISHED:if(f.size>0){let b=Array.from(f.keys()).join(", ");return et(()=>new Xe(`Cannot send 'RUN_FINISHED' while steps are still active: ${b}`))}if(n.size>0){let b=Array.from(n.keys()).join(", ");return et(()=>new Xe(`Cannot send 'RUN_FINISHED' while text messages are still active: ${b}`))}if(o.size>0){let b=Array.from(o.keys()).join(", ");return et(()=>new Xe(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${b}`))}return a=!0,ot(v);case M.RUN_ERROR:return i=!0,ot(v);case M.CUSTOM:return ot(v);case M.THINKING_TEXT_MESSAGE_START:return m?g?et(()=>new Xe("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.")):(g=!0,ot(v)):et(()=>new Xe("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first."));case M.THINKING_TEXT_MESSAGE_CONTENT:return g?ot(v):et(()=>new Xe("Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first."));case M.THINKING_TEXT_MESSAGE_END:return g?(g=!1,ot(v)):et(()=>new Xe("Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first."));case M.THINKING_START:return m?et(()=>new Xe("Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.")):(m=!0,ot(v));case M.THINKING_END:return m?(m=!1,ot(v)):et(()=>new Xe("Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."));default:return ot(v)}}))},ii=function(e){return e.HEADERS="headers",e.DATA="data",e}({}),oB=e=>Am(()=>ni(e())).pipe(bA(t=>{if(!t.ok){let o=t.headers.get("content-type")||"";return ni(t.text()).pipe(nr(a=>{let i=a;if(o.includes("application/json"))try{i=JSON.parse(a)}catch{}let p=Error(`HTTP ${t.status}: ${typeof i=="string"?i:JSON.stringify(i)}`);return p.status=t.status,p.payload=i,et(()=>p)}))}let r={type:ii.HEADERS,status:t.status,headers:t.headers},n=t.body?.getReader();return n?new Ze(o=>(o.next(r),_asyncToGenerator(function*(){try{for(;;){let{done:a,value:i}=yield n.read();if(a)break;let p={type:ii.DATA,data:i};o.next(p)}o.complete()}catch(a){o.error(a)}})(),()=>{n.cancel().catch(a=>{if(a?.name!=="AbortError")throw a})})):et(()=>Error("Failed to getReader() from response"))})),aB=(e,t)=>{let r=Vu(t),n=new yn,o=new TextDecoder("utf-8",{fatal:!1}),a="";e.subscribe({next:p=>{if(p.type!==ii.HEADERS&&p.type===ii.DATA&&p.data){let f=o.decode(p.data,{stream:!0});a+=f;let m=a.split(/\n\n/);a=m.pop()||"";for(let g of m)i(g)}},error:p=>n.error(p),complete:()=>{a&&(a+=o.decode(),i(a)),n.complete()}});function i(p){let f=p.split(`
|
|
39
|
+
Error: ${w}`)}}return g()}case M.MESSAGES_SNAPSHOT:{let h=yield $e(n,i,p,(C,b,w)=>C.onMessagesSnapshotEvent?.({event:S,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{messages:C}=S,b=new Map(C.map(T=>[T.id,T])),w=C.some(T=>T.role==="activity"),F=C.some(T=>T.role==="reasoning"),I=T=>T.role==="activity"&&!w||T.role==="reasoning"&&!F;i=i.filter(T=>I(T)||b.has(T.id)).map(T=>I(T)?T:b.get(T.id));let E=new Set(i.map(T=>T.id));for(let T of C)E.has(T.id)||i.push(T);m({messages:i})}return g()}case M.ACTIVITY_SNAPSHOT:{let h=S,C=i.findIndex(E=>E.id===h.messageId),b=C>=0?i[C]:void 0,w=b?.role==="activity"?b:void 0,F=h.replace??!0,I=yield $e(n,i,p,(E,T,P)=>E.onActivitySnapshotEvent?.({event:h,messages:T,state:P,agent:r,input:e,activityMessage:w,existingMessage:b}));if(m(I),I.stopPropagation!==!0){let E={id:h.messageId,role:"activity",activityType:h.activityType,content:je(h.content)},T;C===-1?(i.push(E),T=E):w?F&&(i[C]={...w,activityType:h.activityType,content:je(h.content)}):F&&(i[C]=E,T=E),m({messages:i}),T&&(yield Promise.all(n.map(P=>P.onNewMessage?.({message:T,messages:i,state:p,agent:r,input:e}))))}return g()}case M.ACTIVITY_DELTA:{let h=S,C=i.findIndex(I=>I.id===h.messageId);if(C===-1)return g();let b=i[C];if(b.role!=="activity")return console.warn(`ACTIVITY_DELTA: Message '${h.messageId}' is not an activity message`),g();let w=b,F=yield $e(n,i,p,(I,E,T)=>I.onActivityDeltaEvent?.({event:h,messages:E,state:T,agent:r,input:e,activityMessage:w}));if(m(F),F.stopPropagation!==!0)try{let I=je(w.content??{}),E=Zf.applyPatch(I,h.patch??[],!0,!1).newDocument;i[C]={...w,content:je(E),activityType:h.activityType},m({messages:i})}catch(I){let E=I instanceof Error?I.message:String(I);console.warn(`Failed to apply activity patch for '${h.messageId}': ${E}`)}return g()}case M.RAW:return m(yield $e(n,i,p,(h,C,b)=>h.onRawEvent?.({event:S,messages:C,state:b,agent:r,input:e}))),g();case M.CUSTOM:return m(yield $e(n,i,p,(h,C,b)=>h.onCustomEvent?.({event:S,messages:C,state:b,agent:r,input:e}))),g();case M.RUN_STARTED:{let h=yield $e(n,i,p,(C,b,w)=>C.onRunStartedEvent?.({event:S,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let C=S;if(C.input?.messages){for(let b of C.input.messages)i.find(w=>w.id===b.id)||i.push(b);m({messages:i})}}return g()}case M.RUN_FINISHED:{let h=S,C=h.outcome?.type==="interrupt"?{event:h,outcome:"interrupt",interrupts:h.outcome.interrupts}:{event:h,outcome:"success",result:h.result},b=yield $e(n,i,p,(w,F,I)=>w.onRunFinishedEvent?.({...C,messages:F,state:I,agent:r,input:e}));return m(b),b.stopPropagation!==!0&&(r.pendingInterrupts=C.outcome==="interrupt"?[...C.interrupts]:[]),g()}case M.RUN_ERROR:return m(yield $e(n,i,p,(h,C,b)=>h.onRunErrorEvent?.({event:S,messages:C,state:b,agent:r,input:e}))),g();case M.STEP_STARTED:return m(yield $e(n,i,p,(h,C,b)=>h.onStepStartedEvent?.({event:S,messages:C,state:b,agent:r,input:e}))),g();case M.STEP_FINISHED:return m(yield $e(n,i,p,(h,C,b)=>h.onStepFinishedEvent?.({event:S,messages:C,state:b,agent:r,input:e}))),g();case M.TEXT_MESSAGE_CHUNK:throw Error("TEXT_MESSAGE_CHUNK must be tranformed before being applied");case M.TOOL_CALL_CHUNK:throw Error("TOOL_CALL_CHUNK must be tranformed before being applied");case M.THINKING_START:return g();case M.THINKING_END:return g();case M.THINKING_TEXT_MESSAGE_START:return g();case M.THINKING_TEXT_MESSAGE_CONTENT:return g();case M.THINKING_TEXT_MESSAGE_END:return g();case M.REASONING_START:return m(yield $e(n,i,p,(h,C,b)=>h.onReasoningStartEvent?.({event:S,messages:C,state:b,agent:r,input:e}))),g();case M.REASONING_MESSAGE_START:{let h=yield $e(n,i,p,(C,b,w)=>C.onReasoningMessageStartEvent?.({event:S,messages:b,state:w,agent:r,input:e}));if(m(h),h.stopPropagation!==!0){let{messageId:C}=S;if(!i.find(b=>b.id===C)){let b={id:C,role:"reasoning",content:""};i.push(b),m({messages:i})}}return g()}case M.REASONING_MESSAGE_CONTENT:{let{messageId:h,delta:C}=S,b=i.find(F=>F.id===h);if(!b)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${h}'`),g();let w=yield $e(n,i,p,(F,I,E)=>F.onReasoningMessageContentEvent?.({event:S,messages:I,state:E,agent:r,input:e,reasoningMessageBuffer:typeof b.content=="string"?b.content:""}));return m(w),w.stopPropagation!==!0&&(b.content=`${typeof b.content=="string"?b.content:""}${C}`,m({messages:i})),g()}case M.REASONING_MESSAGE_END:{let{messageId:h}=S,C=i.find(b=>b.id===h);return C?(m(yield $e(n,i,p,(b,w,F)=>b.onReasoningMessageEndEvent?.({event:S,messages:w,state:F,agent:r,input:e,reasoningMessageBuffer:typeof C.content=="string"?C.content:""}))),yield Promise.all(n.map(b=>{b.onNewMessage?.({message:C,messages:i,state:p,agent:r,input:e})})),g()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${h}'`),g())}case M.REASONING_MESSAGE_CHUNK:throw Error("REASONING_MESSAGE_CHUNK must be transformed before being applied");case M.REASONING_END:return m(yield $e(n,i,p,(h,C,b)=>h.onReasoningEndEvent?.({event:S,messages:C,state:b,agent:r,input:e}))),g();case M.REASONING_ENCRYPTED_VALUE:{let{subtype:h,entityId:C,encryptedValue:b}=S,w=yield $e(n,i,p,(F,I,E)=>F.onReasoningEncryptedValueEvent?.({event:S,messages:I,state:E,agent:r,input:e}));if(m(w),w.stopPropagation!==!0){let F=!1;if(h==="tool-call"){for(let I of i)if(I.role==="assistant"&&I.toolCalls){let E=I.toolCalls.find(T=>T.id===C);if(E){E.encryptedValue=b,F=!0;break}}}else{let I=i.find(E=>E.id===C);I?.role!=="activity"&&I&&(I.encryptedValue=b,F=!0)}F&&(f.messages=i)}return g()}}return S.type,g()});return function(_x144){return _ref57.apply(this,arguments)}}()),bA(),n.length>0?wA({}):S=>S)},BA=e=>t=>{let r=Ul(e),n=new Map,o=new Map,a=!1,i=!1,p=!1,f=new Map,m=!1,g=!1,S=!1,x=()=>{n.clear(),o.clear(),f.clear(),m=!1,g=!1,a=!1,i=!1,S=!0};return t.pipe(nr(h=>{let C=h.type;if(r?.event("VERIFY","Event:",h,{type:h.type}),i)return et(()=>new Xe(`Cannot send event type '${C}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(a&&C!==M.RUN_ERROR&&C!==M.RUN_STARTED)return et(()=>new Xe(`Cannot send event type '${C}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(p){if(C===M.RUN_STARTED){if(S&&!a)return et(()=>new Xe("Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run."));a&&x()}}else if(p=!0,C!==M.RUN_STARTED&&C!==M.RUN_ERROR)return et(()=>new Xe("First event must be 'RUN_STARTED'"));switch(C){case M.TEXT_MESSAGE_START:{let b=h.messageId;return n.has(b)?et(()=>new Xe(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${b}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(n.set(b,!0),ot(h))}case M.TEXT_MESSAGE_CONTENT:{let b=h.messageId;return n.has(b)?ot(h):et(()=>new Xe(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${b}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case M.TEXT_MESSAGE_END:{let b=h.messageId;return n.has(b)?(n.delete(b),ot(h)):et(()=>new Xe(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${b}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case M.TOOL_CALL_START:{let b=h.toolCallId;return o.has(b)?et(()=>new Xe(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${b}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(o.set(b,!0),ot(h))}case M.TOOL_CALL_ARGS:{let b=h.toolCallId;return o.has(b)?ot(h):et(()=>new Xe(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${b}'. Start a tool call with 'TOOL_CALL_START' first.`))}case M.TOOL_CALL_END:{let b=h.toolCallId;return o.has(b)?(o.delete(b),ot(h)):et(()=>new Xe(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${b}'. A 'TOOL_CALL_START' event must be sent first.`))}case M.STEP_STARTED:{let b=h.stepName;return f.has(b)?et(()=>new Xe(`Step "${b}" is already active for 'STEP_STARTED'`)):(f.set(b,!0),ot(h))}case M.STEP_FINISHED:{let b=h.stepName;return f.has(b)?(f.delete(b),ot(h)):et(()=>new Xe(`Cannot send 'STEP_FINISHED' for step "${b}" that was not started`))}case M.RUN_STARTED:return S=!0,ot(h);case M.RUN_FINISHED:if(f.size>0){let b=Array.from(f.keys()).join(", ");return et(()=>new Xe(`Cannot send 'RUN_FINISHED' while steps are still active: ${b}`))}if(n.size>0){let b=Array.from(n.keys()).join(", ");return et(()=>new Xe(`Cannot send 'RUN_FINISHED' while text messages are still active: ${b}`))}if(o.size>0){let b=Array.from(o.keys()).join(", ");return et(()=>new Xe(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${b}`))}return a=!0,ot(h);case M.RUN_ERROR:return i=!0,ot(h);case M.CUSTOM:return ot(h);case M.THINKING_TEXT_MESSAGE_START:return m?g?et(()=>new Xe("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.")):(g=!0,ot(h)):et(()=>new Xe("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first."));case M.THINKING_TEXT_MESSAGE_CONTENT:return g?ot(h):et(()=>new Xe("Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first."));case M.THINKING_TEXT_MESSAGE_END:return g?(g=!1,ot(h)):et(()=>new Xe("Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first."));case M.THINKING_START:return m?et(()=>new Xe("Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.")):(m=!0,ot(h));case M.THINKING_END:return m?(m=!1,ot(h)):et(()=>new Xe("Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."));default:return ot(h)}}))},si=function(e){return e.HEADERS="headers",e.DATA="data",e}({}),uB=e=>xm(()=>ni(e())).pipe(RA(t=>{if(!t.ok){let o=t.headers.get("content-type")||"";return ni(t.text()).pipe(nr(a=>{let i=a;if(o.includes("application/json"))try{i=JSON.parse(a)}catch{}let p=Error(`HTTP ${t.status}: ${typeof i=="string"?i:JSON.stringify(i)}`);return p.status=t.status,p.payload=i,et(()=>p)}))}let r={type:si.HEADERS,status:t.status,headers:t.headers},n=t.body?.getReader();return n?new Ze(o=>(o.next(r),_asyncToGenerator(function*(){try{for(;;){let{done:a,value:i}=yield n.read();if(a)break;let p={type:si.DATA,data:i};o.next(p)}o.complete()}catch(a){o.error(a)}})(),()=>{n.cancel().catch(a=>{if(a?.name!=="AbortError")throw a})})):et(()=>Error("Failed to getReader() from response"))})),lB=(e,t)=>{let r=Ul(t),n=new yn,o=new TextDecoder("utf-8",{fatal:!1}),a="";e.subscribe({next:p=>{if(p.type!==si.HEADERS&&p.type===si.DATA&&p.data){let f=o.decode(p.data,{stream:!0});a+=f;let m=a.split(/\n\n/);a=m.pop()||"";for(let g of m)i(g)}},error:p=>n.error(p),complete:()=>{a&&(a+=o.decode(),i(a)),n.complete()}});function i(p){let f=p.split(`
|
|
40
40
|
`),m=[];for(let g of f)g.startsWith("data:")&&m.push(g.slice(5).replace(/^ /,""));if(m.length>0)try{let g=m.join(`
|
|
41
|
-
`),
|
|
42
|
-
`)},AB=(e,t,r)=>n=>{let o={},a=!0,i=!0,p="",f=null,m=null,g=[],y={},x=v=>{typeof v=="object"&&v&&("messages"in v&&delete v.messages,o=v)};return n.pipe(nr(v=>{switch(v.type){case M.TEXT_MESSAGE_START:{let C=v;return[{type:Ye.enum.TextMessageStart,messageId:C.messageId,role:C.role}]}case M.TEXT_MESSAGE_CONTENT:{let C=v;return[{type:Ye.enum.TextMessageContent,messageId:C.messageId,content:C.delta}]}case M.TEXT_MESSAGE_END:{let C=v;return[{type:Ye.enum.TextMessageEnd,messageId:C.messageId}]}case M.TOOL_CALL_START:{let C=v;return g.push({id:C.toolCallId,type:"function",function:{name:C.toolCallName,arguments:""}}),i=!0,y[C.toolCallId]=C.toolCallName,[{type:Ye.enum.ActionExecutionStart,actionExecutionId:C.toolCallId,actionName:C.toolCallName,parentMessageId:C.parentMessageId}]}case M.TOOL_CALL_ARGS:{let C=v,b=g.find(F=>F.id===C.toolCallId);if(!b)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${C.toolCallId}'`),[];b.function.arguments+=C.delta;let w=!1;if(m){let F=m.find(I=>I.tool==b.function.name);if(F)try{let I=JSON.parse(bm(b.function.arguments));F.tool_argument&&F.tool_argument in I?(x({...o,[F.state_key]:I[F.tool_argument]}),w=!0):F.tool_argument||(x({...o,[F.state_key]:I}),w=!0)}catch{}}return[{type:Ye.enum.ActionExecutionArgs,actionExecutionId:C.toolCallId,args:C.delta},...(w?[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}]:[])]}case M.TOOL_CALL_END:{let C=v;return[{type:Ye.enum.ActionExecutionEnd,actionExecutionId:C.toolCallId}]}case M.TOOL_CALL_RESULT:{let C=v;return[{type:Ye.enum.ActionExecutionResult,actionExecutionId:C.toolCallId,result:C.content,actionName:y[C.toolCallId]||"unknown"}]}case M.RAW:return[];case M.CUSTOM:{let C=v;switch(C.name){case"Exit":a=!1;break;case"PredictState":m=C.value;break}return[{type:Ye.enum.MetaEvent,name:C.name,value:C.value}]}case M.STATE_SNAPSHOT:return x(v.snapshot),[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}];case M.STATE_DELTA:{let C=v,b=Jf.applyPatch(o,C.delta,!0,!1);return b?(x(b.newDocument),[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}]):[]}case M.MESSAGES_SNAPSHOT:return f=v.messages,[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify({...o,...(f?{messages:f}:{})}),active:!0}];case M.RUN_STARTED:return[];case M.RUN_FINISHED:return f&&(o.messages=f),Object.keys(o).length===0?[]:[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify({...o,...(f?{messages:CB(f)}:{})}),active:!1}];case M.RUN_ERROR:{let C=v;return[{type:Ye.enum.RunError,message:C.message,code:C.code}]}case M.STEP_STARTED:return p=v.stepName,g=[],m=null,[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:!0}];case M.STEP_FINISHED:return g=[],m=null,[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:!1}];default:return[]}}))};function CB(e){let t=[];for(let r of e)if(r.role==="assistant"||r.role==="user"||r.role==="system"){let n=vB(r.content);if(n){let o={id:r.id,role:r.role,content:n};t.push(o)}if(r.role==="assistant"&&r.toolCalls&&r.toolCalls.length>0)for(let o of r.toolCalls){let a={id:o.id,name:o.function.name,arguments:JSON.parse(o.function.arguments),parentMessageId:r.id};t.push(a)}}else if(r.role==="tool"){let n="unknown";for(let a of e)if(a.role==="assistant"&&a.toolCalls?.length){for(let i of a.toolCalls)if(i.id===r.toolCallId){n=i.function.name;break}}let o={id:r.id,result:r.content,actionExecutionId:r.toolCallId,actionName:n};t.push(o)}return t}var og=e=>t=>{let r=Vu(e),n,o,a,i,p=()=>{if(!n||i!=="text")throw Error("No text message to close");let y={type:M.TEXT_MESSAGE_END,messageId:n.messageId};return i=void 0,n=void 0,r?.event("TRANSFORM","TEXT_MESSAGE_END",y,{messageId:y.messageId}),y},f=()=>{if(!o||i!=="tool")throw Error("No tool call to close");let y={type:M.TOOL_CALL_END,toolCallId:o.toolCallId};return i=void 0,o=void 0,r?.event("TRANSFORM","TOOL_CALL_END",y,{toolCallId:y.toolCallId}),y},m=()=>{if(!a||i!=="reasoning")throw Error("No reasoning message to close");let y={type:M.REASONING_MESSAGE_END,messageId:a.messageId};return i=void 0,a=void 0,r?.event("TRANSFORM","REASONING_MESSAGE_END",y,{messageId:y.messageId}),y},g=()=>i==="text"?[p()]:i==="tool"?[f()]:i==="reasoning"?[m()]:[];return t.pipe(nr(y=>{switch(y.type){case M.TEXT_MESSAGE_START:case M.TEXT_MESSAGE_CONTENT:case M.TEXT_MESSAGE_END:case M.TOOL_CALL_START:case M.TOOL_CALL_ARGS:case M.TOOL_CALL_END:case M.TOOL_CALL_RESULT:case M.STATE_SNAPSHOT:case M.STATE_DELTA:case M.MESSAGES_SNAPSHOT:case M.CUSTOM:case M.RUN_STARTED:case M.RUN_FINISHED:case M.RUN_ERROR:case M.STEP_STARTED:case M.STEP_FINISHED:case M.THINKING_START:case M.THINKING_END:case M.THINKING_TEXT_MESSAGE_START:case M.THINKING_TEXT_MESSAGE_CONTENT:case M.THINKING_TEXT_MESSAGE_END:case M.REASONING_START:case M.REASONING_MESSAGE_START:case M.REASONING_MESSAGE_CONTENT:case M.REASONING_MESSAGE_END:case M.REASONING_END:return[...g(),y];case M.RAW:case M.ACTIVITY_SNAPSHOT:case M.ACTIVITY_DELTA:case M.REASONING_ENCRYPTED_VALUE:return[y];case M.TEXT_MESSAGE_CHUNK:let x=y,v=[];if((i!=="text"||x.messageId!==void 0&&x.messageId!==n?.messageId)&&v.push(...g()),i!=="text"){if(x.messageId===void 0)throw Error("First TEXT_MESSAGE_CHUNK must have a messageId");n={messageId:x.messageId,name:x.name},i="text";let I={type:M.TEXT_MESSAGE_START,messageId:x.messageId,role:x.role||"assistant",...(x.name!==void 0&&{name:x.name})};v.push(I),r?.event("TRANSFORM","TEXT_MESSAGE_START",I,{messageId:x.messageId})}if(x.delta!==void 0){let I={type:M.TEXT_MESSAGE_CONTENT,messageId:n.messageId,delta:x.delta};v.push(I),r?.event("TRANSFORM","TEXT_MESSAGE_CONTENT",I,{messageId:n.messageId})}return v;case M.TOOL_CALL_CHUNK:let C=y,b=[];if((i!=="tool"||C.toolCallId!==void 0&&C.toolCallId!==o?.toolCallId)&&b.push(...g()),i!=="tool"){if(C.toolCallId===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallId");if(C.toolCallName===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallName");o={toolCallId:C.toolCallId,toolCallName:C.toolCallName,parentMessageId:C.parentMessageId},i="tool";let I={type:M.TOOL_CALL_START,toolCallId:C.toolCallId,toolCallName:C.toolCallName,parentMessageId:C.parentMessageId};b.push(I),r?.event("TRANSFORM","TOOL_CALL_START",I,{toolCallId:C.toolCallId,toolCallName:C.toolCallName})}if(C.delta!==void 0){let I={type:M.TOOL_CALL_ARGS,toolCallId:o.toolCallId,delta:C.delta};b.push(I),r?.event("TRANSFORM","TOOL_CALL_ARGS",I,{toolCallId:o.toolCallId})}return b;case M.REASONING_MESSAGE_CHUNK:let w=y,F=[];if((i!=="reasoning"||w.messageId&&w.messageId!==a?.messageId)&&F.push(...g()),i!=="reasoning"){if(w.messageId===void 0)throw Error("First REASONING_MESSAGE_CHUNK must have a messageId");a={messageId:w.messageId},i="reasoning";let I={type:M.REASONING_MESSAGE_START,messageId:w.messageId};F.push(I),r?.event("TRANSFORM","REASONING_MESSAGE_START",I,{messageId:w.messageId})}if(w.delta!==void 0){let I={type:M.REASONING_MESSAGE_CONTENT,messageId:a.messageId,delta:w.delta};F.push(I),r?.event("TRANSFORM","REASONING_MESSAGE_CONTENT",I,{messageId:a.messageId})}return F}return y.type,[]}),ai(()=>{g()}))};function xB(e,t=new Date){return e.expiresAt===void 0?!1:new Date(e.expiresAt)<=t}var ag=class{runNext(e,t){return t.run(e).pipe(og(!1))}runNextWithState(e,t){let r=Ve(e.messages||[]),n=Ve(e.state||{}),o=new am;return qI(e,o,t,[]).subscribe(a=>{a.messages!==void 0&&(r=a.messages),a.state!==void 0&&(n=a.state)}),this.runNext(e,t).pipe(Cm(/*#__PURE__*/function(){var _ref59=_asyncToGenerator(function*(a){return o.next(a),yield new Promise(i=>setTimeout(i,0)),{event:a,messages:Ve(r),state:Ve(n)}});return function(_x145){return _ref59.apply(this,arguments)}}()))}},bB=class extends ag{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function wB(e){let t=e.content;if(Array.isArray(t)){let r=t.filter(n=>typeof n=="object"&&!!n&&"type"in n&&n.type==="text"&&typeof n.text=="string").map(n=>n.text).join("");return{...e,content:r}}return typeof t=="string"?e:{...e,content:""}}var RB=class extends ag{run(e,t){let{parentRunId:r,...n}=e,o={...n,messages:n.messages.map(wB)};return this.runNext(o,t)}},kI="THINKING_START",OI="THINKING_END",NI="THINKING_TEXT_MESSAGE_START",_I="THINKING_TEXT_MESSAGE_CONTENT",DI="THINKING_TEXT_MESSAGE_END",FB=class extends ag{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<"u"&&process.env!==void 0&&process.env.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(oi(r=>this.transformEvent(r)))}transformEvent(e){switch(e.type){case kI:{this.currentReasoningId=ju();let{title:t,...r}=e;return this.warnAboutTransformation(kI,M.REASONING_START),{...r,type:M.REASONING_START,messageId:this.currentReasoningId}}case NI:return this.currentMessageId=ju(),this.warnAboutTransformation(NI,M.REASONING_MESSAGE_START),{...e,type:M.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case _I:{let{delta:t,...r}=e;return this.warnAboutTransformation(_I,M.REASONING_MESSAGE_CONTENT),{...r,type:M.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??ju(),delta:t}}case DI:{let t=this.currentMessageId??ju();return this.warnAboutTransformation(DI,M.REASONING_MESSAGE_END),{...e,type:M.REASONING_MESSAGE_END,messageId:t}}case OI:{let t=this.currentReasoningId??ju();return this.warnAboutTransformation(OI,M.REASONING_END),{...e,type:M.REASONING_END,messageId:t}}default:return e}}};function EB(e){return e.startsWith("image/")?"image":e.startsWith("audio/")?"audio":e.startsWith("video/")?"video":"document"}function IB(e){return typeof e=="object"&&!!e&&"type"in e&&e.type==="binary"&&"mimeType"in e&&typeof e.mimeType=="string"}function TB(e){let t=EB(e.mimeType);return e.data?{type:t,source:{type:"data",value:e.data,mimeType:e.mimeType},...(e.filename?{metadata:{filename:e.filename}}:{})}:e.url?{type:t,source:{type:"url",value:e.url,mimeType:e.mimeType},...(e.filename?{metadata:{filename:e.filename}}:{})}:e}function PB(e){let t=e.content;if(!Array.isArray(t))return e;let r=t.map(n=>IB(n)?TB(n):n);return{...e,content:r}}var kB=class extends ag{run(e,t){let r={...e,messages:e.messages.map(PB)};return this.runNext(r,t)}},OB="0.0.57",NB=class{get maxVersion(){return OB}get debug(){return this._debug}set debug(e){this._debug=ng(e),this._debugLogger=LA(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){typeof e=="boolean"?this._debugLogger=e?LA(ng(!0)):void 0:this._debugLogger=e}constructor({agentId:e,description:t,threadId:r,initialMessages:n,initialState:o,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.agentId=e,this.description=t??"",this.threadId=r??Lo(),this.messages=Ve(n??[]),this.state=Ve(o??{}),this._debug=ng(a),this._debugLogger=LA(this._debug),Mu(this.maxVersion,"0.0.39")<=0&&this.middlewares.unshift(new RB),Mu(this.maxVersion,"0.0.45")<=0&&this.middlewares.unshift(new FB),Mu(this.maxVersion,"0.0.47")<=0&&this.middlewares.unshift(new kB)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(r=>typeof r=="function"?new bB(r):r);return this.middlewares.push(...t),this}runAgent(e,t){var _this28=this;return _asyncToGenerator(function*(){try{_this28.isRunning=!0,_this28.agentId=_this28.agentId??Lo();let r=_this28.prepareRunAgentInput(e);_this28.debugLogger?.lifecycle("LIFECYCLE","Run started:",{agentId:_this28.agentId,threadId:_this28.threadId});let n,o=new Set(_this28.messages.map(f=>f.id)),a=[{onRunFinishedEvent:f=>{f.outcome==="success"&&(n=f.result)}},..._this28.subscribers,t??{}];yield _this28.onInitialize(r,a),_this28.activeRunDetach$=new yn;let i;_this28.activeRunCompletionPromise=new Promise(f=>{i=f}),yield vm(om(()=>_this28.middlewares.length===0?_this28.run(r):_this28.middlewares.reduceRight((f,m)=>({run:g=>m.run(g,f),get messages(){return f.messages},get state(){return f.state}}),_this28).run(r),og(_this28.debugLogger),UA(_this28.debugLogger),f=>f.pipe(xm(_this28.activeRunDetach$)),f=>_this28.apply(r,f,a),f=>_this28.processApplyEvents(r,f,a),Nu(f=>(_this28.debugLogger?.lifecycle("LIFECYCLE","Run errored:",{agentId:_this28.agentId,error:f instanceof Error?f.message:String(f)}),_this28.isRunning=!1,_this28.onError(r,f,a))),ai(()=>{_this28.debugLogger?.lifecycle("LIFECYCLE","Run finished:",{agentId:_this28.agentId,threadId:_this28.threadId}),_this28.isRunning=!1,_this28.onFinalize(r,a),i?.(),i=void 0,_this28.activeRunCompletionPromise=void 0,_this28.activeRunDetach$=void 0}))(ot(null)));let p=Ve(_this28.messages).filter(f=>!o.has(f.id));return{result:n,newMessages:p}}finally{_this28.isRunning=!1}})()}connect(e){throw new cA}connectAgent(e,t){var _this29=this;return _asyncToGenerator(function*(){try{_this29.isRunning=!0,_this29.agentId=_this29.agentId??Lo();let r=_this29.prepareRunAgentInput(e),n,o=new Set(_this29.messages.map(f=>f.id)),a=[{onRunFinishedEvent:f=>{f.outcome==="success"&&(n=f.result)}},..._this29.subscribers,t??{}];yield _this29.onInitialize(r,a),_this29.activeRunDetach$=new yn;let i;_this29.activeRunCompletionPromise=new Promise(f=>{i=f}),yield vm(om(()=>Am(()=>_this29.connect(r)),og(_this29.debugLogger),UA(_this29.debugLogger),f=>f.pipe(xm(_this29.activeRunDetach$)),f=>_this29.apply(r,f,a),f=>_this29.processApplyEvents(r,f,a),Nu(f=>(_this29.isRunning=!1,f instanceof cA?im:_this29.onError(r,f,a))),ai(()=>{_this29.isRunning=!1,_this29.onFinalize(r,a),i?.(),i=void 0,_this29.activeRunCompletionPromise=void 0,_this29.activeRunDetach$=void 0}))(ot(null)),{defaultValue:void 0});let p=Ve(_this29.messages).filter(f=>!o.has(f.id));return{result:n,newMessages:p}}finally{_this29.isRunning=!1}})()}abortRun(){}detachActiveRun(){var _this30=this;return _asyncToGenerator(function*(){if(!_this30.activeRunDetach$)return;let e=_this30.activeRunCompletionPromise??Promise.resolve();_this30.activeRunDetach$.next(),_this30.activeRunDetach$?.complete(),yield e})()}apply(e,t,r){return qI(e,t,this,r,this.debugLogger)}processApplyEvents(e,t,r){return t.pipe(wA(n=>{n.messages&&(this.messages=n.messages,r.forEach(o=>{o.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state&&(this.state=n.state,r.forEach(o=>{o.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=Ve(this.messages).filter(r=>r.role!=="activity");return{threadId:this.threadId,runId:e?.runId||Lo(),tools:Ve(e?.tools??[]),context:Ve(e?.context??[]),forwardedProps:Ve(e?.forwardedProps??{}),state:Ve(this.state),messages:t,...(e?.resume===void 0?{}:{resume:Ve(e.resume)})}}onInitialize(e,t){var _this31=this;return _asyncToGenerator(function*(){if(_this31.pendingInterrupts.length>0){let n=new Set((e.resume??[]).map(a=>a.interruptId)),o=_this31.pendingInterrupts.map(a=>a.id).filter(a=>!n.has(a));if(o.length>0)throw new Xe(`Thread has ${o.length} pending interrupt(s) not addressed by resume: ${o.join(", ")}`);for(let a of _this31.pendingInterrupts)if(xB(a))throw new Xe(`Interrupt ${a.id} expired at ${a.expiresAt}`)}let r=yield $e(t,_this31.messages,_this31.state,(n,o,a)=>n.onRunInitialized?.({messages:o,state:a,agent:_this31,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages&&(_this31.messages=r.messages,e.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this31.messages,state:_this31.state,agent:_this31,input:e})})),r.state&&(_this31.state=r.state,e.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this31.state,messages:_this31.messages,agent:_this31,input:e})})))})()}onError(e,t,r){return ni($e(r,this.messages,this.state,(n,o,a)=>n.onRunFailed?.({error:t,messages:o,state:a,agent:this,input:e}))).pipe(oi(n=>{let o=n;if((o.messages!==void 0||o.state!==void 0)&&(o.messages!==void 0&&(this.messages=o.messages,r.forEach(a=>{a.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),o.state!==void 0&&(this.state=o.state,r.forEach(a=>{a.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),o.stopPropagation!==!0){let a=String(t);if(!(t.name==="AbortError"||t.message==="Fetch is aborted"||t.message==="signal is aborted without reason"||t.message==="component unmounted"||a==="component unmounted"))throw console.error("Agent execution failed:",t),t}return{}}))}onFinalize(e,t){var _this32=this;return _asyncToGenerator(function*(){let r=yield $e(t,_this32.messages,_this32.state,(n,o,a)=>n.onRunFinalized?.({messages:o,state:a,agent:_this32,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages!==void 0&&(_this32.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this32.messages,state:_this32.state,agent:_this32,input:e})})),r.state!==void 0&&(_this32.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this32.state,messages:_this32.messages,agent:_this32,input:e})})))})()}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=Ve(this.messages),e.state=Ve(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=Ve(this.pendingInterrupts),e}addMessage(e){var _this33=this;this.messages.push(e),_asyncToGenerator(function*(){for(let t of _this33.subscribers)yield t.onNewMessage?.({message:e,messages:_this33.messages,state:_this33.state,agent:_this33});if(e.role==="assistant"&&e.toolCalls)for(let t of e.toolCalls)for(let r of _this33.subscribers)yield r.onNewToolCall?.({toolCall:t,messages:_this33.messages,state:_this33.state,agent:_this33});for(let t of _this33.subscribers)yield t.onMessagesChanged?.({messages:_this33.messages,state:_this33.state,agent:_this33})})()}addMessages(e){var _this34=this;this.messages.push(...e),_asyncToGenerator(function*(){for(let t of e){for(let r of _this34.subscribers)yield r.onNewMessage?.({message:t,messages:_this34.messages,state:_this34.state,agent:_this34});if(t.role==="assistant"&&t.toolCalls)for(let r of t.toolCalls)for(let n of _this34.subscribers)yield n.onNewToolCall?.({toolCall:r,messages:_this34.messages,state:_this34.state,agent:_this34})}for(let t of _this34.subscribers)yield t.onMessagesChanged?.({messages:_this34.messages,state:_this34.state,agent:_this34})})()}setMessages(e){var _this35=this;this.messages=Ve(e),_asyncToGenerator(function*(){for(let t of _this35.subscribers)yield t.onMessagesChanged?.({messages:_this35.messages,state:_this35.state,agent:_this35})})()}setState(e){var _this36=this;this.state=Ve(e),_asyncToGenerator(function*(){for(let t of _this36.subscribers)yield t.onStateChanged?.({messages:_this36.messages,state:_this36.state,agent:_this36})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??Lo();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((r,n)=>({run:o=>n.run(o,r),get messages(){return r.messages},get state(){return r.state}}),this).run(t)).pipe(og(this.debugLogger),UA(this.debugLogger),AB(this.threadId,t.runId,this.agentId),r=>r.pipe(oi(n=>(this.debugLogger?.event("LEGACY","Event:",n,{type:n.type}),n))))}},ig=class extends NB{requestInit(e){return{method:"POST",headers:{...this.headers,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(e),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new s.AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new s.AbortController,this.url=e.url,this.headers=Ve(e.headers??{}),this.fetch=e.fetch??((t,r)=>S(t,r))}run(e){return sB(oB(()=>this.fetch(this.url,this.requestInit(e))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=Ve(this.headers??{}),e.fetch=this.fetch;let t=new s.AbortController,r=this.abortController.signal;return r.aborted&&t.abort(r.reason),e.abortController=t,e}};d();c();u();l();var sg=(e,t,r)=>{let n=gr(t,r),o=e?.trim();if(!n||!t||!o)throw new Error("Missing required parameters for answer endpoint");let a=`/api/v1/organizations/${t}/agents`;return`${n}${a}/${o}`};var GA=class extends ig{requestInit(t){let{params:r,accessToken:n,recordDebugSession:o}=t.forwardedProps||{},a={...r,...(o&&{recordDebugSession:!0})};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${n}`,"Content-Type":"application/json",Accept:"text/event-stream, application/json"},body:JSON.stringify(a),signal:this.abortController.signal}}},MI=(e,t,r)=>new GA({url:`${sg(e,t,r)}/answer`});d();c();u();l();d();c();u();l();var _B=new L({required:!0}),jI=new L({required:!0,constrainTo:mf}),VI=e=>({...e,name:gf(e.name)}),cg=P("followUpAnswers/setIsEnabled",e=>O(e,new de({required:!0}))),lg=P("followUpAnswers/setFollowUpAnswersConversationId",e=>O(e,z)),ug=P("followUpAnswers/setFollowUpAnswersConversationToken",e=>O(e,z)),dg=P("followUpAnswers/clearFollowUpAnswersConversationToken"),pg=P("followUpAnswers/createFollowUpAnswer",e=>O(e,{question:z})),Lu=P("followUpAnswers/setActiveFollowUpAnswerId",e=>O(e,z)),fg=P("followUpAnswers/setFollowUpAnswerContentFormat",e=>O(e,{contentFormat:yf,answerId:z})),mg=P("followUpAnswers/setFollowUpIsLoading",e=>O(e,{isLoading:new de({required:!0}),answerId:z})),gg=P("followUpAnswers/setFollowUpIsStreaming",e=>O(e,{isStreaming:new de({required:!0}),answerId:z})),hg=P("followUpAnswers/followUpMessageChunkReceived",e=>O(e,{textDelta:_B,answerId:z})),yg=P("followUpAnswers/followUpCitationsReceived",e=>O(e,{citations:new ie({required:!0,each:new X({values:Kv})}),answerId:z})),Sg=P("followUpAnswers/followUpCompleted",e=>O(e,{answerId:z,cannotAnswer:new de({required:!1})})),vg=P("followUpAnswers/followUpFailed",e=>O(e,{message:new L,code:new re({min:0}),answerId:z})),Ag=P("followUpAnswers/activeFollowUpStartFailed",e=>O(e,{message:new L})),Cg=P("followUpAnswers/likeFollowUp",e=>O(e,{answerId:z})),xg=P("followUpAnswers/dislikeFollowUp",e=>O(e,{answerId:z})),LI=P("followUpAnswers/submitFollowUpFeedback",e=>O(e,{answerId:z})),bg=P("followUpAnswers/resetFollowUpAnswers"),wg=P("followUpAnswers/stepStarted",e=>O(VI(e),{answerId:z,name:jI,startedAt:new re({min:0,required:!0})})),Rg=P("followUpAnswers/stepFinished",e=>O(VI(e),{answerId:z,name:jI,finishedAt:new re({min:0,required:!0})})),Fg=P("followUpAnswers/startToolCall",e=>O(e,{answerId:z,toolCallName:z,startedAt:new re({min:0,required:!0}),toolCallId:z})),Eg=P("followUpAnswers/finishToolCall",e=>O(e,{answerId:z,finishedAt:new re({min:0,required:!0}),toolCallId:z})),lc=P("followUpAnswers/toolCallArgs",e=>O(e,{answerId:z,toolCallId:z,args:new X({options:{required:!0}}),type:new L({required:!0,constrainTo:hf})}));d();c();u();l();var DB={"KNOWLEDGE:SSE_MAX_DURATION_EXCEEDED":1e3,"KNOWLEDGE:SSE_FOLLOW_UP_NOT_SUPPORTED":1001,"KNOWLEDGE:NOT_FOUND":1002,"KNOWLEDGE:SSE_MODELS_NOT_AVAILABLE":1003,"KNOWLEDGE:SSE_INTERNAL_ERROR":1004,"KNOWLEDGE:SSE_TURN_LIMIT_REACHED":1005};function Ig(e){return e?DB[e]??1004:1004}function qB(e){let t=r=>e.code===r;return Object.defineProperties(e,{isMaxDurationExceededError:{value:()=>t(1e3),enumerable:!1},isFollowupNotSupportedError:{value:()=>t(1001),enumerable:!1},isConversationNotFoundError:{value:()=>t(1002),enumerable:!1},isSseModelNotAvailableError:{value:()=>t(1003),enumerable:!1},isSseInternalError:{value:()=>t(1004),enumerable:!1},isSseTurnLimitReachedError:{value:()=>t(1005),enumerable:!1}}),e}function si(e){if(e)return qB({...e})}var UI=e=>{let t="",r=!1;return{onRunStartedEvent:({event:n})=>{t=n.runId,r=!1,e(Vs(n.runId)),e(dn(!1)),e(ka(!0)),e(lg(n.threadId)),e(dg())},onStepStartedEvent:({event:n,agent:o})=>{o.isRunning!==!1&&e(Ef({name:n.stepName,startedAt:n.timestamp??Date.now()}))},onStepFinishedEvent:({event:n,agent:o})=>{o.isRunning!==!1&&e(If({name:n.stepName,finishedAt:n.timestamp??Date.now()}))},onToolCallStartEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{toolCallName:a,toolCallId:i,timestamp:p}=n;e(Tf({toolCallId:i,toolCallName:a,startedAt:p??Date.now()}))},onToolCallEndEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{toolCallId:a,timestamp:i}=n;e(Pf({toolCallId:a,finishedAt:i??Date.now()}))},onToolCallArgsEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{toolCallId:a,delta:i}=n;try{let p=JSON.parse(i);typeof p?.q=="string"?e(Bs({toolCallId:a,args:p,type:"search"})):e(Bs({toolCallId:a,args:{raw:i},type:"generic"}))}catch{console.warn(`Failed to parse tool call args delta as JSON. Using raw string instead. Delta: ${i}`),e(Bs({toolCallId:a,args:{raw:i},type:"generic"}))}},onTextMessageContentEvent:({event:n,agent:o})=>{o.isRunning!==!1&&(n.delta.length>0&&(r=!0),e(Oa({textDelta:n.delta})))},onCustomEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{name:a,value:i}=n;switch(a){case"header":{i?.contentFormat&&e(Da(i.contentFormat)),typeof i?.followUpEnabled=="boolean"&&e(cg(i.followUpEnabled)),i?.conversationToken&&e(ug(i.conversationToken));return}case"citations":{e(Na({citations:i.citations}));return}}},onRunErrorEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let a=Ig(n.code);e(_a({message:n.message,code:a}))},onRunFinishedEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let a=n.result?.completionReason==="ANSWERED",i=a?!r:void 0;e(bu(a)),e(qa(!a)),e(ka(!1)),e(cu(a,t,i)),e(To())}}};var Tg=()=>{let e,t=()=>{e&&(e.isRunning=!1,e.abortRun()),e=void 0};return{run:function(){var _ref64=_asyncToGenerator(function*(n,o,a){t();let i=yp(n),p=gp(n),f=hp(n),m=mp(n),g=Ow(n),y=MI(i,p,f);e=y;let x=UI(o),v=EF(n,a());try{o(dn(!0)),yield y.runAgent({forwardedProps:{params:v,accessToken:m,recordDebugSession:g}},x)}catch(C){o(dn(!1)),o(_a({message:"An error occurred while starting the answer generation."})),console.error("Error running the answer agent:",C)}});return function run(_x146,_x147,_x148){return _ref64.apply(this,arguments)}}(),abortRun:t}};var QI=e=>{let t=Db({extra:e}),r=Tg();return t.startListening({actionCreator:W.pending,effect:function(){var _ref65=_asyncToGenerator(function*(n,o){let a=o.getState();if(!nv(a)||(r.abortRun(),o.dispatch(dr()),o.dispatch(bg()),a.generatedAnswer.isEnabled===!1))return;let i=Pa(a)?.q;!i||i.trim()===""||r.run(a,o.dispatch,e.getNavigatorContext)});return function effect(_x149,_x150){return _ref65.apply(this,arguments)}}()}),t};d();c();u();l();var BI=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let o=n.error;if(n.payload?.ignored||e.error({error:o,action:r},`Action dispatch error ${n.type}`),n.error.name!=="SchemaValidationError")return t(r)},GI=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();u();l();var $A=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:a}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:a}};d();c();u();l();function $I(e,t){let r={...e},n,o=a=>(i,p)=>{let f=a(i,p);return n?n(f,p):f};return{get combinedReducer(){let a=dx(Object.entries(t).filter(([i])=>!(i in r)).map(([i,p])=>[i,()=>p]));return o(Vi({...a,...r}))},containsAll(a){return Object.keys(a).every(p=>p in r)},add(a){Object.keys(a).filter(i=>!(i in r)).forEach(i=>{r[i]=a[i]})},addCrossReducer(a){n=a}}}d();c();u();l();d();c();u();l();function HA(e){if(!e||!MB(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(a=>`%${`00${a.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function HI(e,t=60){if(!e)return!1;let r=HA(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function MB(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function WI(e,t){let r=0,n=null,o=Sd(()=>{r=0},500),a=/*#__PURE__*/function(){var _ref66=_asyncToGenerator(function*(f,m=!1){let g=!n;g&&t&&(n=_asyncToGenerator(function*(){try{return yield t()}catch(x){if(!m)throw x;return null}})().finally(()=>{n=null}));let y=yield n;return g&&y&&f.dispatch(on({accessToken:y})),y});return function a(_x151){return _ref66.apply(this,arguments)}}(),i=/*#__PURE__*/function(){var _ref68=_asyncToGenerator(function*(f){let m=f.getState(),g=VB(m);if(!(!g||!HI(g))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield a(f))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(y){e.warn(y,"Access token renewal failed. A retry will occur if necessary.")}}});return function i(_x152){return _ref68.apply(this,arguments)}}(),p=/*#__PURE__*/function(){var _ref69=_asyncToGenerator(function*(f,m,g){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),zI(f,m.error),m;!n&&(r++,o());try{yield a(f,!0)}catch(x){e.debug(x,"Token renewal failed in reactive path (piggybacked on a proactive renewal). The action will be re-dispatched.")}f.dispatch(g)});return function p(_x153,_x154,_x155){return _ref69.apply(this,arguments)}}();return f=>m=>(/*#__PURE__*/function(){var _ref70=_asyncToGenerator(function*(g){let y=typeof g=="function",x=typeof t=="function";if(!y)return m(g);x&&(yield i(f));let v=yield m(g);return jB(v)?x?yield p(f,v,g):(e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),zI(f,v.error),v):v});return function(_x156){return _ref70.apply(this,arguments)}}())}function jB(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new Mi().name}function zI(e,t){e.dispatch(ks({status:401,statusCode:401,message:t.message,type:t.name}))}function VB(e){return e.configuration.accessToken}d();c();u();l();function KI({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return Cb({reducer:e,preloadedState:t,devTools:{stateSanitizer:a=>a.history?{...a,history:"<<OMIT>>"}:a,name:o,shouldHotReload:!1},middleware:a=>a({thunk:{extraArgument:n}}).prepend(...r).concat(GI(n.logger))})}function LB(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,disableBrowserPrivacySignals:o,...a}=r??{},i={...a,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})},p=i.analyticsMode!=="next",f=i.analyticsMode==="legacy"&&o===!0;return p&&$y()&&!f?(t.info("Analytics disabled since doNotTrack is active."),{...i,enabled:!1}):(p&&$y()&&f&&i.enabled!==!1&&t.warn("Browser privacy signals (Do Not Track and Global Privacy Control) are present but are being ignored because analytics.disableBrowserPrivacySignals is set to true. Legacy analytics events will be sent, and your integration is responsible for privacy compliance."),i)}function YI(e,t){let r={...e.reducers,configuration:fe,version:DF},n=UB({...e,reducers:r},t,fe),{accessToken:o,environment:a,organizationId:i}=e.configuration;n.dispatch(on({accessToken:o,environment:a,organizationId:i}));let p=LB(e.configuration,n.logger);return p&&n.dispatch(Fo(p)),n}function UB(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,a=$I({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&a.addCrossReducer(e.crossReducer);let i=t.logger,p={...t,get relay(){return Zl(m.state,o)},get navigatorContext(){return $A(this.relay,o)}},f=QB(e,p,a),m={addReducers(g){a.containsAll(g)||(a.add(g),f.replaceReducer(a.combinedReducer))},dispatch:f.dispatch,subscribe:f.subscribe,enableAnalytics(){f.dispatch(ls())},disableAnalytics(){f.dispatch(cs())},get state(){return f.getState()},get relay(){return Zl(this.state,o)},get navigatorContext(){return $A(this.relay,o)},logger:i,store:f};return m}function QB(e,t,r){let{preloadedState:n,configuration:o}=e,a=o.name||"coveo-headless",i=BB(e,t.logger,()=>t.navigatorContext);return KI({preloadedState:n,reducer:r.combinedReducer,middlewares:i,thunkExtraArguments:t,name:a})}function BB(e,t,r){let{renewAccessToken:n}=e.configuration,o=WI(t,n),a=QI({getNavigatorContext:r});return[GF,o,BI(t),MF].concat(Ma.middleware,a.middleware,e.middlewares||[])}var GB=`[Warning] A component from the Coveo Headless library has been instantiated with the Analytics Mode: "Next".
|
|
41
|
+
`),S=JSON.parse(g);r?.event("SSE","Event received:",S,{type:S.type}),n.next(S)}catch(g){n.error(g)}}return n.asObservable()},dB=e=>{let t=new yn,r=new Uint8Array;e.subscribe({next:o=>{if(o.type!==si.HEADERS&&o.type===si.DATA&&o.data){let a=new Uint8Array(r.length+o.data.length);a.set(r,0),a.set(o.data,r.length),r=a,n()}},error:o=>t.error(o),complete:()=>{if(r.length>0)try{n()}catch{console.warn("Incomplete or invalid protocol buffer data at stream end")}t.complete()}});function n(){for(;r.length>=4;){let o=4+new DataView(r.buffer,r.byteOffset,4).getUint32(0,!1);if(r.length<o)break;try{let a=r.slice(4,o),i=kI(a);t.next(i),r=r.slice(o)}catch(a){let i=a instanceof Error?a.message:String(a);t.error(Error(`Failed to decode protocol buffer message: ${i}`));return}}}return t.asObservable()},pB=(e,t)=>{let r=Ul(t),n=new yn,o=new sm,a=!1;return e.subscribe({next:i=>{if(o.next(i),i.type===si.HEADERS&&!a){a=!0;let p=i.headers.get("content-type");r?.lifecycle("HTTP","Stream format detected:",{contentType:p,parser:p===jA?"protobuf":"sse"}),p===jA?dB(o).subscribe({next:f=>n.next(f),error:f=>n.error(f),complete:()=>n.complete()}):lB(o,r).subscribe({next:f=>{try{let m=$f.parse(f);r?.event("HTTP","Event validated:",m,{type:m.type,valid:!0}),n.next(m)}catch(m){r?.event("HTTP","Event invalid:",{json:f,error:String(m)}),n.error(m)}},error:f=>{if(f?.name==="AbortError"){n.next({type:M.RUN_ERROR,message:f.message||"Request aborted",code:"abort",rawEvent:f}),n.complete();return}return n.error(f)},complete:()=>n.complete()})}else a||n.error(Error("No headers event received before data events"))},error:i=>{o.error(i),n.error(i)},complete:()=>{o.complete()}}),n.asObservable()},Ye=R.enum(["TextMessageStart","TextMessageContent","TextMessageEnd","ActionExecutionStart","ActionExecutionArgs","ActionExecutionEnd","ActionExecutionResult","AgentStateMessage","MetaEvent","RunStarted","RunFinished","RunError","NodeStarted","NodeFinished"]),fB=R.enum(["LangGraphInterruptEvent","PredictState","Exit"]),mB=R.object({type:R.literal(Ye.enum.TextMessageStart),messageId:R.string(),parentMessageId:R.string().optional(),role:R.string().optional()}),gB=R.object({type:R.literal(Ye.enum.TextMessageContent),messageId:R.string(),content:R.string()}),hB=R.object({type:R.literal(Ye.enum.TextMessageEnd),messageId:R.string()}),yB=R.object({type:R.literal(Ye.enum.ActionExecutionStart),actionExecutionId:R.string(),actionName:R.string(),parentMessageId:R.string().optional()}),SB=R.object({type:R.literal(Ye.enum.ActionExecutionArgs),actionExecutionId:R.string(),args:R.string()}),vB=R.object({type:R.literal(Ye.enum.ActionExecutionEnd),actionExecutionId:R.string()}),AB=R.object({type:R.literal(Ye.enum.ActionExecutionResult),actionName:R.string(),actionExecutionId:R.string(),result:R.string()}),CB=R.object({type:R.literal(Ye.enum.AgentStateMessage),threadId:R.string(),agentName:R.string(),nodeName:R.string(),runId:R.string(),active:R.boolean(),role:R.string(),state:R.string(),running:R.boolean()}),xB=R.object({type:R.literal(Ye.enum.MetaEvent),name:fB,value:R.any()}),bB=R.object({type:R.literal(Ye.enum.RunError),message:R.string(),code:R.string().optional()});R.discriminatedUnion("type",[mB,gB,hB,yB,SB,vB,AB,CB,xB,bB]),R.object({id:R.string(),role:R.string(),content:R.string(),parentMessageId:R.string().optional()}),R.object({id:R.string(),name:R.string(),arguments:R.any(),parentMessageId:R.string().optional()}),R.object({id:R.string(),result:R.any(),actionExecutionId:R.string(),actionName:R.string()});var wB=e=>{if(typeof e=="string")return e;if(!Array.isArray(e))return;let t=e.filter(r=>r.type==="text").map(r=>r.text).filter(r=>r.length>0);if(t.length!==0)return t.join(`
|
|
42
|
+
`)},RB=(e,t,r)=>n=>{let o={},a=!0,i=!0,p="",f=null,m=null,g=[],S={},x=h=>{typeof h=="object"&&h&&("messages"in h&&delete h.messages,o=h)};return n.pipe(nr(h=>{switch(h.type){case M.TEXT_MESSAGE_START:{let C=h;return[{type:Ye.enum.TextMessageStart,messageId:C.messageId,role:C.role}]}case M.TEXT_MESSAGE_CONTENT:{let C=h;return[{type:Ye.enum.TextMessageContent,messageId:C.messageId,content:C.delta}]}case M.TEXT_MESSAGE_END:{let C=h;return[{type:Ye.enum.TextMessageEnd,messageId:C.messageId}]}case M.TOOL_CALL_START:{let C=h;return g.push({id:C.toolCallId,type:"function",function:{name:C.toolCallName,arguments:""}}),i=!0,S[C.toolCallId]=C.toolCallName,[{type:Ye.enum.ActionExecutionStart,actionExecutionId:C.toolCallId,actionName:C.toolCallName,parentMessageId:C.parentMessageId}]}case M.TOOL_CALL_ARGS:{let C=h,b=g.find(F=>F.id===C.toolCallId);if(!b)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${C.toolCallId}'`),[];b.function.arguments+=C.delta;let w=!1;if(m){let F=m.find(I=>I.tool==b.function.name);if(F)try{let I=JSON.parse(Rm(b.function.arguments));F.tool_argument&&F.tool_argument in I?(x({...o,[F.state_key]:I[F.tool_argument]}),w=!0):F.tool_argument||(x({...o,[F.state_key]:I}),w=!0)}catch{}}return[{type:Ye.enum.ActionExecutionArgs,actionExecutionId:C.toolCallId,args:C.delta},...(w?[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}]:[])]}case M.TOOL_CALL_END:{let C=h;return[{type:Ye.enum.ActionExecutionEnd,actionExecutionId:C.toolCallId}]}case M.TOOL_CALL_RESULT:{let C=h;return[{type:Ye.enum.ActionExecutionResult,actionExecutionId:C.toolCallId,result:C.content,actionName:S[C.toolCallId]||"unknown"}]}case M.RAW:return[];case M.CUSTOM:{let C=h;switch(C.name){case"Exit":a=!1;break;case"PredictState":m=C.value;break}return[{type:Ye.enum.MetaEvent,name:C.name,value:C.value}]}case M.STATE_SNAPSHOT:return x(h.snapshot),[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}];case M.STATE_DELTA:{let C=h,b=Zf.applyPatch(o,C.delta,!0,!1);return b?(x(b.newDocument),[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}]):[]}case M.MESSAGES_SNAPSHOT:return f=h.messages,[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify({...o,...(f?{messages:f}:{})}),active:!0}];case M.RUN_STARTED:return[];case M.RUN_FINISHED:return f&&(o.messages=f),Object.keys(o).length===0?[]:[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify({...o,...(f?{messages:FB(f)}:{})}),active:!1}];case M.RUN_ERROR:{let C=h;return[{type:Ye.enum.RunError,message:C.message,code:C.code}]}case M.STEP_STARTED:return p=h.stepName,g=[],m=null,[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:!0}];case M.STEP_FINISHED:return g=[],m=null,[{type:Ye.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:!1}];default:return[]}}))};function FB(e){let t=[];for(let r of e)if(r.role==="assistant"||r.role==="user"||r.role==="system"){let n=wB(r.content);if(n){let o={id:r.id,role:r.role,content:n};t.push(o)}if(r.role==="assistant"&&r.toolCalls&&r.toolCalls.length>0)for(let o of r.toolCalls){let a={id:o.id,name:o.function.name,arguments:JSON.parse(o.function.arguments),parentMessageId:r.id};t.push(a)}}else if(r.role==="tool"){let n="unknown";for(let a of e)if(a.role==="assistant"&&a.toolCalls?.length){for(let i of a.toolCalls)if(i.id===r.toolCallId){n=i.function.name;break}}let o={id:r.id,result:r.content,actionExecutionId:r.toolCallId,actionName:n};t.push(o)}return t}var ig=e=>t=>{let r=Ul(e),n,o,a,i,p=()=>{if(!n||i!=="text")throw Error("No text message to close");let S={type:M.TEXT_MESSAGE_END,messageId:n.messageId};return i=void 0,n=void 0,r?.event("TRANSFORM","TEXT_MESSAGE_END",S,{messageId:S.messageId}),S},f=()=>{if(!o||i!=="tool")throw Error("No tool call to close");let S={type:M.TOOL_CALL_END,toolCallId:o.toolCallId};return i=void 0,o=void 0,r?.event("TRANSFORM","TOOL_CALL_END",S,{toolCallId:S.toolCallId}),S},m=()=>{if(!a||i!=="reasoning")throw Error("No reasoning message to close");let S={type:M.REASONING_MESSAGE_END,messageId:a.messageId};return i=void 0,a=void 0,r?.event("TRANSFORM","REASONING_MESSAGE_END",S,{messageId:S.messageId}),S},g=()=>i==="text"?[p()]:i==="tool"?[f()]:i==="reasoning"?[m()]:[];return t.pipe(nr(S=>{switch(S.type){case M.TEXT_MESSAGE_START:case M.TEXT_MESSAGE_CONTENT:case M.TEXT_MESSAGE_END:case M.TOOL_CALL_START:case M.TOOL_CALL_ARGS:case M.TOOL_CALL_END:case M.TOOL_CALL_RESULT:case M.STATE_SNAPSHOT:case M.STATE_DELTA:case M.MESSAGES_SNAPSHOT:case M.CUSTOM:case M.RUN_STARTED:case M.RUN_FINISHED:case M.RUN_ERROR:case M.STEP_STARTED:case M.STEP_FINISHED:case M.THINKING_START:case M.THINKING_END:case M.THINKING_TEXT_MESSAGE_START:case M.THINKING_TEXT_MESSAGE_CONTENT:case M.THINKING_TEXT_MESSAGE_END:case M.REASONING_START:case M.REASONING_MESSAGE_START:case M.REASONING_MESSAGE_CONTENT:case M.REASONING_MESSAGE_END:case M.REASONING_END:return[...g(),S];case M.RAW:case M.ACTIVITY_SNAPSHOT:case M.ACTIVITY_DELTA:case M.REASONING_ENCRYPTED_VALUE:return[S];case M.TEXT_MESSAGE_CHUNK:{let x=S,h=[];if((i!=="text"||x.messageId!==void 0&&x.messageId!==n?.messageId)&&h.push(...g()),i!=="text"){if(x.messageId===void 0)throw Error("First TEXT_MESSAGE_CHUNK must have a messageId");n={messageId:x.messageId,name:x.name},i="text";let C={type:M.TEXT_MESSAGE_START,messageId:x.messageId,role:x.role||"assistant",...(x.name!==void 0&&{name:x.name})};h.push(C),r?.event("TRANSFORM","TEXT_MESSAGE_START",C,{messageId:x.messageId})}if(x.delta!==void 0){let C={type:M.TEXT_MESSAGE_CONTENT,messageId:n.messageId,delta:x.delta};h.push(C),r?.event("TRANSFORM","TEXT_MESSAGE_CONTENT",C,{messageId:n.messageId})}return h}case M.TOOL_CALL_CHUNK:{let x=S,h=[];if((i!=="tool"||x.toolCallId!==void 0&&x.toolCallId!==o?.toolCallId)&&h.push(...g()),i!=="tool"){if(x.toolCallId===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallId");if(x.toolCallName===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallName");o={toolCallId:x.toolCallId,toolCallName:x.toolCallName,parentMessageId:x.parentMessageId},i="tool";let C={type:M.TOOL_CALL_START,toolCallId:x.toolCallId,toolCallName:x.toolCallName,parentMessageId:x.parentMessageId};h.push(C),r?.event("TRANSFORM","TOOL_CALL_START",C,{toolCallId:x.toolCallId,toolCallName:x.toolCallName})}if(x.delta!==void 0){let C={type:M.TOOL_CALL_ARGS,toolCallId:o.toolCallId,delta:x.delta};h.push(C),r?.event("TRANSFORM","TOOL_CALL_ARGS",C,{toolCallId:o.toolCallId})}return h}case M.REASONING_MESSAGE_CHUNK:{let x=S,h=[];if((i!=="reasoning"||x.messageId&&x.messageId!==a?.messageId)&&h.push(...g()),i!=="reasoning"){if(x.messageId===void 0)throw Error("First REASONING_MESSAGE_CHUNK must have a messageId");a={messageId:x.messageId},i="reasoning";let C={type:M.REASONING_MESSAGE_START,messageId:x.messageId};h.push(C),r?.event("TRANSFORM","REASONING_MESSAGE_START",C,{messageId:x.messageId})}if(x.delta!==void 0){let C={type:M.REASONING_MESSAGE_CONTENT,messageId:a.messageId,delta:x.delta};h.push(C),r?.event("TRANSFORM","REASONING_MESSAGE_CONTENT",C,{messageId:a.messageId})}return h}}return S.type,[]}),ai(()=>{g()}))};function EB(e,t=new Date){return e.expiresAt===void 0?!1:new Date(e.expiresAt)<=t}var sg=class{runNext(e,t){return t.run(e).pipe(ig(!1))}runNextWithState(e,t){let r=je(e.messages||[]),n=je(e.state||{}),o=new sm;return UI(e,o,t,[]).subscribe(a=>{a.messages!==void 0&&(r=a.messages),a.state!==void 0&&(n=a.state)}),this.runNext(e,t).pipe(bm(/*#__PURE__*/function(){var _ref59=_asyncToGenerator(function*(a){return o.next(a),yield new Promise(i=>setTimeout(i,0)),{event:a,messages:je(r),state:je(n)}});return function(_x145){return _ref59.apply(this,arguments)}}()))}},IB=class extends sg{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function TB(e){let t=e.content;if(Array.isArray(t)){let r=t.filter(n=>typeof n=="object"&&!!n&&"type"in n&&n.type==="text"&&typeof n.text=="string").map(n=>n.text).join("");return{...e,content:r}}return typeof t=="string"?e:{...e,content:""}}var PB=class extends sg{run(e,t){let{parentRunId:r,...n}=e,o={...n,messages:n.messages.map(TB)};return this.runNext(o,t)}},qI="THINKING_START",MI="THINKING_END",VI="THINKING_TEXT_MESSAGE_START",jI="THINKING_TEXT_MESSAGE_CONTENT",LI="THINKING_TEXT_MESSAGE_END",kB=class extends sg{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<"u"&&process.env!==void 0&&process.env.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(oi(r=>this.transformEvent(r)))}transformEvent(e){switch(e.type){case qI:{this.currentReasoningId=Ll();let{title:t,...r}=e;return this.warnAboutTransformation(qI,M.REASONING_START),{...r,type:M.REASONING_START,messageId:this.currentReasoningId}}case VI:return this.currentMessageId=Ll(),this.warnAboutTransformation(VI,M.REASONING_MESSAGE_START),{...e,type:M.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case jI:{let{delta:t,...r}=e;return this.warnAboutTransformation(jI,M.REASONING_MESSAGE_CONTENT),{...r,type:M.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??Ll(),delta:t}}case LI:{let t=this.currentMessageId??Ll();return this.warnAboutTransformation(LI,M.REASONING_MESSAGE_END),{...e,type:M.REASONING_MESSAGE_END,messageId:t}}case MI:{let t=this.currentReasoningId??Ll();return this.warnAboutTransformation(MI,M.REASONING_END),{...e,type:M.REASONING_END,messageId:t}}default:return e}}};function OB(e){return e.startsWith("image/")?"image":e.startsWith("audio/")?"audio":e.startsWith("video/")?"video":"document"}function _B(e){return typeof e=="object"&&!!e&&"type"in e&&e.type==="binary"&&"mimeType"in e&&typeof e.mimeType=="string"}function NB(e){let t=OB(e.mimeType);return e.data?{type:t,source:{type:"data",value:e.data,mimeType:e.mimeType},...(e.filename?{metadata:{filename:e.filename}}:{})}:e.url?{type:t,source:{type:"url",value:e.url,mimeType:e.mimeType},...(e.filename?{metadata:{filename:e.filename}}:{})}:e}function DB(e){let t=e.content;if(!Array.isArray(t))return e;let r=t.map(n=>_B(n)?NB(n):n);return{...e,content:r}}var qB=class extends sg{run(e,t){let r={...e,messages:e.messages.map(DB)};return this.runNext(r,t)}},MB="0.0.58",VB=class{get maxVersion(){return MB}get debug(){return this._debug}set debug(e){this._debug=ag(e),this._debugLogger=QA(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){typeof e=="boolean"?this._debugLogger=e?QA(ag(!0)):void 0:this._debugLogger=e}constructor({agentId:e,description:t,threadId:r,initialMessages:n,initialState:o,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.agentId=e,this.description=t??"",this.threadId=r??Lo(),this.messages=je(n??[]),this.state=je(o??{}),this._debug=ag(a),this._debugLogger=QA(this._debug),jl(this.maxVersion,"0.0.39")<=0&&this.middlewares.unshift(new PB),jl(this.maxVersion,"0.0.45")<=0&&this.middlewares.unshift(new kB),jl(this.maxVersion,"0.0.47")<=0&&this.middlewares.unshift(new qB)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(r=>typeof r=="function"?new IB(r):r);return this.middlewares.push(...t),this}runAgent(e,t){var _this28=this;return _asyncToGenerator(function*(){try{_this28.isRunning=!0,_this28.agentId=_this28.agentId??Lo();let r=_this28.prepareRunAgentInput(e);_this28.debugLogger?.lifecycle("LIFECYCLE","Run started:",{agentId:_this28.agentId,threadId:_this28.threadId});let n,o=new Set(_this28.messages.map(f=>f.id)),a=[{onRunFinishedEvent:f=>{f.outcome==="success"&&(n=f.result)}},..._this28.subscribers,t??{}];yield _this28.onInitialize(r,a),_this28.activeRunDetach$=new yn;let i;_this28.activeRunCompletionPromise=new Promise(f=>{i=f}),yield Cm(im(()=>_this28.middlewares.length===0?_this28.run(r):_this28.middlewares.reduceRight((f,m)=>({run:g=>m.run(g,f),get messages(){return f.messages},get state(){return f.state}}),_this28).run(r),ig(_this28.debugLogger),BA(_this28.debugLogger),f=>f.pipe(wm(_this28.activeRunDetach$)),f=>_this28.apply(r,f,a),f=>_this28.processApplyEvents(r,f,a),Dl(f=>(_this28.debugLogger?.lifecycle("LIFECYCLE","Run errored:",{agentId:_this28.agentId,error:f instanceof Error?f.message:String(f)}),_this28.isRunning=!1,_this28.onError(r,f,a))),ai(()=>{_this28.debugLogger?.lifecycle("LIFECYCLE","Run finished:",{agentId:_this28.agentId,threadId:_this28.threadId}),_this28.isRunning=!1,_this28.onFinalize(r,a),i?.(),i=void 0,_this28.activeRunCompletionPromise=void 0,_this28.activeRunDetach$=void 0}))(ot(null)));let p=je(_this28.messages).filter(f=>!o.has(f.id));return{result:n,newMessages:p}}finally{_this28.isRunning=!1}})()}connect(e){throw new lA}connectAgent(e,t){var _this29=this;return _asyncToGenerator(function*(){try{_this29.isRunning=!0,_this29.agentId=_this29.agentId??Lo();let r=_this29.prepareRunAgentInput(e),n,o=new Set(_this29.messages.map(f=>f.id)),a=[{onRunFinishedEvent:f=>{f.outcome==="success"&&(n=f.result)}},..._this29.subscribers,t??{}];yield _this29.onInitialize(r,a),_this29.activeRunDetach$=new yn;let i;_this29.activeRunCompletionPromise=new Promise(f=>{i=f}),yield Cm(im(()=>xm(()=>_this29.connect(r)),ig(_this29.debugLogger),BA(_this29.debugLogger),f=>f.pipe(wm(_this29.activeRunDetach$)),f=>_this29.apply(r,f,a),f=>_this29.processApplyEvents(r,f,a),Dl(f=>(_this29.isRunning=!1,f instanceof lA?cm:_this29.onError(r,f,a))),ai(()=>{_this29.isRunning=!1,_this29.onFinalize(r,a),i?.(),i=void 0,_this29.activeRunCompletionPromise=void 0,_this29.activeRunDetach$=void 0}))(ot(null)),{defaultValue:void 0});let p=je(_this29.messages).filter(f=>!o.has(f.id));return{result:n,newMessages:p}}finally{_this29.isRunning=!1}})()}abortRun(){}detachActiveRun(){var _this30=this;return _asyncToGenerator(function*(){if(!_this30.activeRunDetach$)return;let e=_this30.activeRunCompletionPromise??Promise.resolve();_this30.activeRunDetach$.next(),_this30.activeRunDetach$?.complete(),yield e})()}apply(e,t,r){return UI(e,t,this,r,this.debugLogger)}processApplyEvents(e,t,r){return t.pipe(FA(n=>{n.messages&&(this.messages=n.messages,r.forEach(o=>{o.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state&&(this.state=n.state,r.forEach(o=>{o.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=je(this.messages).filter(r=>r.role!=="activity");return{threadId:this.threadId,runId:e?.runId||Lo(),tools:je(e?.tools??[]),context:je(e?.context??[]),forwardedProps:je(e?.forwardedProps??{}),state:je(this.state),messages:t,...(e?.resume===void 0?{}:{resume:je(e.resume)})}}onInitialize(e,t){var _this31=this;return _asyncToGenerator(function*(){if(_this31.pendingInterrupts.length>0){let n=new Set((e.resume??[]).map(a=>a.interruptId)),o=_this31.pendingInterrupts.map(a=>a.id).filter(a=>!n.has(a));if(o.length>0)throw new Xe(`Thread has ${o.length} pending interrupt(s) not addressed by resume: ${o.join(", ")}`);for(let a of _this31.pendingInterrupts)if(EB(a))throw new Xe(`Interrupt ${a.id} expired at ${a.expiresAt}`)}let r=yield $e(t,_this31.messages,_this31.state,(n,o,a)=>n.onRunInitialized?.({messages:o,state:a,agent:_this31,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages&&(_this31.messages=r.messages,e.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this31.messages,state:_this31.state,agent:_this31,input:e})})),r.state&&(_this31.state=r.state,e.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this31.state,messages:_this31.messages,agent:_this31,input:e})})))})()}onError(e,t,r){return ni($e(r,this.messages,this.state,(n,o,a)=>n.onRunFailed?.({error:t,messages:o,state:a,agent:this,input:e}))).pipe(oi(n=>{let o=n;if((o.messages!==void 0||o.state!==void 0)&&(o.messages!==void 0&&(this.messages=o.messages,r.forEach(a=>{a.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),o.state!==void 0&&(this.state=o.state,r.forEach(a=>{a.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),o.stopPropagation!==!0){let a=String(t);if(!(t.name==="AbortError"||t.message==="Fetch is aborted"||t.message==="signal is aborted without reason"||t.message==="component unmounted"||a==="component unmounted"))throw console.error("Agent execution failed:",t),t}return{}}))}onFinalize(e,t){var _this32=this;return _asyncToGenerator(function*(){let r=yield $e(t,_this32.messages,_this32.state,(n,o,a)=>n.onRunFinalized?.({messages:o,state:a,agent:_this32,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages!==void 0&&(_this32.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this32.messages,state:_this32.state,agent:_this32,input:e})})),r.state!==void 0&&(_this32.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this32.state,messages:_this32.messages,agent:_this32,input:e})})))})()}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=je(this.messages),e.state=je(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=je(this.pendingInterrupts),e}addMessage(e){var _this33=this;this.messages.push(e),_asyncToGenerator(function*(){for(let t of _this33.subscribers)yield t.onNewMessage?.({message:e,messages:_this33.messages,state:_this33.state,agent:_this33});if(e.role==="assistant"&&e.toolCalls)for(let t of e.toolCalls)for(let r of _this33.subscribers)yield r.onNewToolCall?.({toolCall:t,messages:_this33.messages,state:_this33.state,agent:_this33});for(let t of _this33.subscribers)yield t.onMessagesChanged?.({messages:_this33.messages,state:_this33.state,agent:_this33})})()}addMessages(e){var _this34=this;this.messages.push(...e),_asyncToGenerator(function*(){for(let t of e){for(let r of _this34.subscribers)yield r.onNewMessage?.({message:t,messages:_this34.messages,state:_this34.state,agent:_this34});if(t.role==="assistant"&&t.toolCalls)for(let r of t.toolCalls)for(let n of _this34.subscribers)yield n.onNewToolCall?.({toolCall:r,messages:_this34.messages,state:_this34.state,agent:_this34})}for(let t of _this34.subscribers)yield t.onMessagesChanged?.({messages:_this34.messages,state:_this34.state,agent:_this34})})()}setMessages(e){var _this35=this;this.messages=je(e),_asyncToGenerator(function*(){for(let t of _this35.subscribers)yield t.onMessagesChanged?.({messages:_this35.messages,state:_this35.state,agent:_this35})})()}setState(e){var _this36=this;this.state=je(e),_asyncToGenerator(function*(){for(let t of _this36.subscribers)yield t.onStateChanged?.({messages:_this36.messages,state:_this36.state,agent:_this36})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??Lo();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((r,n)=>({run:o=>n.run(o,r),get messages(){return r.messages},get state(){return r.state}}),this).run(t)).pipe(ig(this.debugLogger),BA(this.debugLogger),RB(this.threadId,t.runId,this.agentId),r=>r.pipe(oi(n=>(this.debugLogger?.event("LEGACY","Event:",n,{type:n.type}),n))))}},cg=class extends VB{requestInit(e){return{method:"POST",headers:{...this.headers,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(e),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new s.AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new s.AbortController,this.url=e.url,this.headers=je(e.headers??{}),this.fetch=e.fetch??((t,r)=>v(t,r))}run(e){return pB(uB(()=>this.fetch(this.url,this.requestInit(e))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=je(this.headers??{}),e.fetch=this.fetch;let t=new s.AbortController,r=this.abortController.signal;return r.aborted&&t.abort(r.reason),e.abortController=t,e}};d();c();l();u();var ug=(e,t,r)=>{let n=gr(t,r),o=e?.trim();if(!n||!t||!o)throw new Error("Missing required parameters for answer endpoint");let a=`/api/v1/organizations/${t}/agents`;return`${n}${a}/${o}`};var HA=class extends cg{requestInit(t){let{params:r,accessToken:n,recordDebugSession:o}=t.forwardedProps||{},a={...r,...(o&&{recordDebugSession:!0})};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${n}`,"Content-Type":"application/json",Accept:"text/event-stream, application/json"},body:JSON.stringify(a),signal:this.abortController.signal}}},QI=(e,t,r)=>new HA({url:`${ug(e,t,r)}/answer`});d();c();l();u();d();c();l();u();var jB=new L({required:!0}),BI=new L({required:!0,constrainTo:hf}),GI=e=>({...e,name:yf(e.name)}),lg=k("followUpAnswers/setIsEnabled",e=>O(e,new de({required:!0}))),dg=k("followUpAnswers/setFollowUpAnswersConversationId",e=>O(e,z)),pg=k("followUpAnswers/setFollowUpAnswersConversationToken",e=>O(e,z)),fg=k("followUpAnswers/clearFollowUpAnswersConversationToken"),mg=k("followUpAnswers/createFollowUpAnswer",e=>O(e,{question:z})),Ql=k("followUpAnswers/setActiveFollowUpAnswerId",e=>O(e,z)),gg=k("followUpAnswers/setFollowUpAnswerContentFormat",e=>O(e,{contentFormat:vf,answerId:z})),hg=k("followUpAnswers/setFollowUpIsLoading",e=>O(e,{isLoading:new de({required:!0}),answerId:z})),yg=k("followUpAnswers/setFollowUpIsStreaming",e=>O(e,{isStreaming:new de({required:!0}),answerId:z})),Sg=k("followUpAnswers/followUpMessageChunkReceived",e=>O(e,{textDelta:jB,answerId:z})),vg=k("followUpAnswers/followUpCitationsReceived",e=>O(e,{citations:new se({required:!0,each:new X({values:Jv})}),answerId:z})),Ag=k("followUpAnswers/followUpCompleted",e=>O(e,{answerId:z,cannotAnswer:new de({required:!1})})),Cg=k("followUpAnswers/followUpFailed",e=>O(e,{message:new L,code:new re({min:0}),answerId:z})),xg=k("followUpAnswers/activeFollowUpStartFailed",e=>O(e,{message:new L})),bg=k("followUpAnswers/likeFollowUp",e=>O(e,{answerId:z})),wg=k("followUpAnswers/dislikeFollowUp",e=>O(e,{answerId:z})),$I=k("followUpAnswers/submitFollowUpFeedback",e=>O(e,{answerId:z})),Rg=k("followUpAnswers/resetFollowUpAnswers"),Fg=k("followUpAnswers/stepStarted",e=>O(GI(e),{answerId:z,name:BI,startedAt:new re({min:0,required:!0})})),Eg=k("followUpAnswers/stepFinished",e=>O(GI(e),{answerId:z,name:BI,finishedAt:new re({min:0,required:!0})})),Ig=k("followUpAnswers/startToolCall",e=>O(e,{answerId:z,toolCallName:z,startedAt:new re({min:0,required:!0}),toolCallId:z})),Tg=k("followUpAnswers/finishToolCall",e=>O(e,{answerId:z,finishedAt:new re({min:0,required:!0}),toolCallId:z})),dc=k("followUpAnswers/toolCallArgs",e=>O(e,{answerId:z,toolCallId:z,args:new X({options:{required:!0}}),type:new L({required:!0,constrainTo:Sf})}));d();c();l();u();var LB={"KNOWLEDGE:SSE_MAX_DURATION_EXCEEDED":1e3,"KNOWLEDGE:SSE_FOLLOW_UP_NOT_SUPPORTED":1001,"KNOWLEDGE:NOT_FOUND":1002,"KNOWLEDGE:SSE_MODELS_NOT_AVAILABLE":1003,"KNOWLEDGE:SSE_INTERNAL_ERROR":1004,"KNOWLEDGE:SSE_TURN_LIMIT_REACHED":1005};function Pg(e){return e?LB[e]??1004:1004}function UB(e){let t=r=>e.code===r;return Object.defineProperties(e,{isMaxDurationExceededError:{value:()=>t(1e3),enumerable:!1},isFollowupNotSupportedError:{value:()=>t(1001),enumerable:!1},isConversationNotFoundError:{value:()=>t(1002),enumerable:!1},isSseModelNotAvailableError:{value:()=>t(1003),enumerable:!1},isSseInternalError:{value:()=>t(1004),enumerable:!1},isSseTurnLimitReachedError:{value:()=>t(1005),enumerable:!1}}),e}function ci(e){if(e)return UB({...e})}var HI=e=>{let t="",r=!1;return{onRunStartedEvent:({event:n})=>{t=n.runId,r=!1,e(Ls(n.runId)),e(dn(!1)),e(ka(!0)),e(dg(n.threadId)),e(fg())},onStepStartedEvent:({event:n,agent:o})=>{o.isRunning!==!1&&e(Tf({name:n.stepName,startedAt:n.timestamp??Date.now()}))},onStepFinishedEvent:({event:n,agent:o})=>{o.isRunning!==!1&&e(Pf({name:n.stepName,finishedAt:n.timestamp??Date.now()}))},onToolCallStartEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{toolCallName:a,toolCallId:i,timestamp:p}=n;e(kf({toolCallId:i,toolCallName:a,startedAt:p??Date.now()}))},onToolCallEndEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{toolCallId:a,timestamp:i}=n;e(Of({toolCallId:a,finishedAt:i??Date.now()}))},onToolCallArgsEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{toolCallId:a,delta:i}=n;try{let p=JSON.parse(i);typeof p?.q=="string"?e(Gs({toolCallId:a,args:p,type:"search"})):e(Gs({toolCallId:a,args:{raw:i},type:"generic"}))}catch{console.warn(`Failed to parse tool call args delta as JSON. Using raw string instead. Delta: ${i}`),e(Gs({toolCallId:a,args:{raw:i},type:"generic"}))}},onTextMessageContentEvent:({event:n,agent:o})=>{o.isRunning!==!1&&(n.delta.length>0&&(r=!0),e(Oa({textDelta:n.delta})))},onCustomEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{name:a,value:i}=n;switch(a){case"header":{i?.contentFormat&&e(Da(i.contentFormat)),typeof i?.followUpEnabled=="boolean"&&e(lg(i.followUpEnabled)),i?.conversationToken&&e(pg(i.conversationToken));return}case"citations":{e(_a({citations:i.citations}));return}}},onRunErrorEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let a=Pg(n.code);e(Na({message:n.message,code:a}))},onRunFinishedEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let a=n.result?.completionReason==="ANSWERED",i=a?!r:void 0;e(Rl(a)),e(qa(!a)),e(ka(!1)),e(ll(a,t,i)),e(To())}}};var kg=()=>{let e,t=()=>{e&&(e.isRunning=!1,e.abortRun()),e=void 0};return{run:function(){var _ref64=_asyncToGenerator(function*(n,o,a){t();let i=vp(n),p=yp(n),f=Sp(n),m=hp(n),g=Nw(n),S=QI(i,p,f);e=S;let x=HI(o),h=TF(n,a());try{o(dn(!0)),yield S.runAgent({forwardedProps:{params:h,accessToken:m,recordDebugSession:g}},x)}catch(C){o(dn(!1)),o(Na({message:"An error occurred while starting the answer generation."})),console.error("Error running the answer agent:",C)}});return function run(_x146,_x147,_x148){return _ref64.apply(this,arguments)}}(),abortRun:t}};var zI=e=>{let t=Mb({extra:e}),r=kg();return t.startListening({actionCreator:W.pending,effect:function(){var _ref65=_asyncToGenerator(function*(n,o){let a=o.getState();if(!av(a)||(r.abortRun(),o.dispatch(dr()),o.dispatch(Rg()),a.generatedAnswer.isEnabled===!1))return;let i=Pa(a)?.q;!i||i.trim()===""||r.run(a,o.dispatch,e.getNavigatorContext)});return function effect(_x149,_x150){return _ref65.apply(this,arguments)}}()}),t};d();c();l();u();var WI=e=>()=>t=>r=>{let n=r;if(!n.error)return t(r);let o=n.error;if(n.payload?.ignored||e.error({error:o,action:r},`Action dispatch error ${n.type}`),n.error.name!=="SchemaValidationError")return t(r)},KI=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();l();u();var zA=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:a}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:a}};d();c();l();u();function YI(e,t){let r={...e},n,o=a=>(i,p)=>{let f=a(i,p);return n?n(f,p):f};return{get combinedReducer(){let a=fx(Object.entries(t).filter(([i])=>!(i in r)).map(([i,p])=>[i,()=>p]));return o(Li({...a,...r}))},containsAll(a){return Object.keys(a).every(p=>p in r)},add(a){Object.keys(a).filter(i=>!(i in r)).forEach(i=>{r[i]=a[i]})},addCrossReducer(a){n=a}}}d();c();l();u();d();c();l();u();function WA(e){if(!e||!QB(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(a=>`%${`00${a.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function JI(e,t=60){if(!e)return!1;let r=WA(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function QB(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function ZI(e,t){let r=0,n=null,o=Ad(()=>{r=0},500),a=/*#__PURE__*/function(){var _ref66=_asyncToGenerator(function*(S,x=!1){let h=!n;h&&t&&(n=_asyncToGenerator(function*(){try{return yield t()}catch(b){if(!x)throw b;return null}})().finally(()=>{n=null}));let C=yield n;return h&&C&&S.dispatch(on({accessToken:C})),C});return function a(_x151){return _ref66.apply(this,arguments)}}(),i=S=>{let x=$B(S.getState());return!!x&&JI(x)},p=/*#__PURE__*/function(){var _ref68=_asyncToGenerator(function*(S){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield a(S))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(x){e.warn(x,"Access token renewal failed. A retry will occur if necessary.")}});return function p(_x152){return _ref68.apply(this,arguments)}}(),f=/*#__PURE__*/function(){var _ref69=_asyncToGenerator(function*(S,x,h){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),XI(S,x.error),x;!n&&(r++,o());try{yield a(S,!0)}catch(b){e.debug(b,"Token renewal failed in reactive path (piggybacked on a proactive renewal). The action will be re-dispatched.")}S.dispatch(h)});return function f(_x153,_x154,_x155){return _ref69.apply(this,arguments)}}(),m=(S,x,h)=>GB(h)?t?f(S,h,x):(e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),XI(S,h.error),h):h,g=(S,x,h)=>BB(h)?Promise.resolve(h).then(C=>m(S,x,C)):m(S,x,h);return S=>x=>h=>{if(!(typeof h=="function"))return x(h);let b=()=>g(S,h,x(h));return typeof t=="function"&&i(S)?p(S).then(b):b()}}function BB(e){return(typeof e=="object"||typeof e=="function")&&e!==null&&"then"in e&&typeof e.then=="function"}function GB(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new Vi().name}function XI(e,t){e.dispatch(Os({status:401,statusCode:401,message:t.message,type:t.name}))}function $B(e){return e.configuration.accessToken}d();c();l();u();function eT({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return bb({reducer:e,preloadedState:t,devTools:{stateSanitizer:a=>a.history?{...a,history:"<<OMIT>>"}:a,name:o,shouldHotReload:!1},middleware:a=>a({thunk:{extraArgument:n}}).prepend(...r).concat(KI(n.logger))})}function HB(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,disableBrowserPrivacySignals:o,...a}=r??{},i={...a,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})},p=i.analyticsMode!=="next",f=i.analyticsMode==="legacy"&&o===!0;return p&&zy()&&!f?(t.info("Analytics disabled since doNotTrack is active."),{...i,enabled:!1}):(p&&zy()&&f&&i.enabled!==!1&&t.warn("Browser privacy signals (Do Not Track and Global Privacy Control) are present but are being ignored because analytics.disableBrowserPrivacySignals is set to true. Legacy analytics events will be sent, and your integration is responsible for privacy compliance."),i)}function tT(e,t){let r={...e.reducers,configuration:fe,version:MF},n=zB({...e,reducers:r},t,fe),{accessToken:o,environment:a,organizationId:i}=e.configuration;n.dispatch(on({accessToken:o,environment:a,organizationId:i}));let p=HB(e.configuration,n.logger);return p&&n.dispatch(Fo(p)),n}function zB(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,a=YI({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&a.addCrossReducer(e.crossReducer);let i=t.logger,p={...t,get relay(){return tl(m.state,o)},get navigatorContext(){return zA(this.relay,o)}},f=WB(e,p,a),m={addReducers(g){a.containsAll(g)||(a.add(g),f.replaceReducer(a.combinedReducer))},dispatch:f.dispatch,subscribe:f.subscribe,enableAnalytics(){f.dispatch(ls())},disableAnalytics(){f.dispatch(us())},get state(){return f.getState()},get relay(){return tl(this.state,o)},get navigatorContext(){return zA(this.relay,o)},logger:i,store:f};return m}function WB(e,t,r){let{preloadedState:n,configuration:o}=e,a=o.name||"coveo-headless",i=KB(e,t.logger,()=>t.navigatorContext);return eT({preloadedState:n,reducer:r.combinedReducer,middlewares:i,thunkExtraArguments:t,name:a})}function KB(e,t,r){let{renewAccessToken:n}=e.configuration,o=ZI(t,n),a=zI({getNavigatorContext:r});return[HF,o,WI(t),jF].concat(Ma.middleware,a.middleware,e.middlewares||[])}var YB=`[Warning] A component from the Coveo Headless library has been instantiated with the Analytics Mode: "Next".
|
|
43
43
|
However, this mode is not available for Coveo for Service features, and this configuration may not work as expected.
|
|
44
44
|
Please switch back to the "legacy" analytics mode to ensure proper functionality.
|
|
45
|
-
For more information, refer to the documentation: https://docs.coveo.com/en/o3r90189/build-a-search-ui/event-protocol`;function Ho(e){e==="next"&&console.warn(GB)}d();c();u();l();var iT=Vr(aT(),1);function sT(e){return(0,iT.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();u();l();function cT(e,t){let r=c1(e),n=hr,o=l1(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t,disableBrowserPrivacySignals:e.analytics?.disableBrowserPrivacySignals}}function c1(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function l1(e){return e.preprocessRequest||Cd}d();c();u();l();var XA=(e,t,r,n,o,a)=>{let i=e[t];pe(i)||pe(o)||o!==i&&o!==n&&(a.warn(`Mismatch on access token (JWT Token) ${t} and engine configuration.`),a.warn(`To remove this warning, make sure that access token value [${i}] matches engine configuration value [${r}]`))},ZA=(e,t)=>!(pe(e)||t===e),Qu=e=>{let t=HA(e);return t||!1},dT=(e,t)=>(ZA(e.searchHub,t.searchHub)&&(t.searchHub=e.searchHub),t),lT=(e,t,r,n)=>(XA(e,"searchHub",t.searchHub,xo(),r,n),dT(e,t)),pT=(e,t)=>(ZA(e.pipeline,t.pipeline)&&(t.pipeline=e.pipeline),t),uT=(e,t,r,n)=>(XA(e,"pipeline",t.pipeline,nn(),r,n),pT(e,t)),fT=(e,t)=>(ZA(e.userDisplayName,t.configuration.analytics.userDisplayName)&&(t.configuration.analytics.userDisplayName=e.userDisplayName),t),u1=(e,t,r,n)=>(XA(e,"userDisplayName",t.configuration.analytics.userDisplayName,$s().analytics.userDisplayName,r,n),fT(e,t)),mT=e=>ae({},t=>{t.addCase(Os,(r,n)=>{let o=Qu(r.configuration.accessToken);return o?lT(o,r,n.payload,e):r}).addCase(fs,(r,n)=>{let o=Qu(r.configuration.accessToken);return o?uT(o,r,n.payload,e):r}).addCase(on,(r,n)=>{if(r.configuration.accessToken!==n.payload.accessToken)return r;let{accessToken:o}=n.payload;if(!o)return r;let a=Qu(o);return a?[pT,dT,fT].reduce((i,p)=>p(a,i),r):r}).addCase(Ar,(r,n)=>{let o=Qu(r.configuration.accessToken);if(!o)return r;let a=lT(o,r,n.payload.searchHub,e);return uT(o,a,n.payload?.pipeline,e)}).addCase(Fo,(r,n)=>{let o=Qu(r.configuration.accessToken);return o?u1(o,r,n.payload.userDisplayName,e):r})});d();c();u();l();d();c();u();l();var gT={organizationId:z,accessToken:z,name:new L({required:!1,emptyAllowed:!1}),analytics:new X({options:{required:!1},values:{enabled:new de({required:!1}),originContext:new L({required:!1}),originLevel2:new L({required:!1}),originLevel3:new L({required:!1}),analyticsMode:new L({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new L({required:!1,url:!0}),trackingId:new L({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),disableBrowserPrivacySignals:new de({required:!1})}}),environment:new L({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function hT(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var yT=new ve({...gT,search:new X({options:{required:!1},values:{pipeline:new L({required:!1,emptyAllowed:!0}),searchHub:st,locale:st,timezone:st,authenticationProviders:new ie({required:!1,each:z}),proxyBaseUrl:new L({required:!1,url:!0})}})});function eC(){return{...hT(),search:{searchHub:"default"}}}var d1={debug:ps,pipeline:ms,searchHub:Ns,search:he};function p1(e){let{search:t}=e,{proxyBaseUrl:r,pipeline:n,searchHub:o,timezone:a,locale:i,authenticationProviders:p}=t??{};return{proxyBaseUrl:r,pipeline:n,searchHub:o,timezone:a,locale:i,authenticationProviders:p}}function ST(e){let t=sT(e.loggerOptions),{configuration:r}=e;f1(r,t);let n=m1(r,t),o=g1(t),a={...cT(r,t),apiClient:n,streamingClient:o,generatedAnswerAnalyticsClient:Cr},i={...e,reducers:d1,crossReducer:mT(t)},p=YI(i,a),f=p1(r);return f&&p.dispatch(Ar(f)),{...p,get state(){return p.state},executeFirstSearch(m=Ep()){if(gu(p.state))return;let g=W({legacy:m,next:Zw()});p.dispatch(g)},executeFirstSearchAfterStandaloneSearchBoxRedirect(m){let{cause:g,metadata:y}=m;if(gu(p.state))return;let x=y&&g==="omniboxFromLink",v=W({legacy:x?Tp(y):Ip(),next:x?tR():eR()});p.dispatch(v)}}}function f1(e,t){try{yT.validate(e)}catch(r){throw t.error(r,"Search engine configuration error"),r}}function m1(e,t){let{search:r}=e;return new Rd({logger:t,preprocessRequest:e.preprocessRequest||Cd,postprocessSearchResponseMiddleware:r?.preprocessSearchResponseMiddleware||Mx,postprocessFacetSearchResponseMiddleware:r?.preprocessFacetSearchResponseMiddleware||jx,postprocessQuerySuggestResponseMiddleware:r?.preprocessQuerySuggestResponseMiddleware||Vx})}function g1(e){return new Ad({logger:e})}d();c();u();l();d();c();u();l();d();c();u();l();var li={value:z,numberOfResults:new re({min:0}),state:z};d();c();u();l();var Ae=z;var v1=new re({min:1,default:8,required:!1}),A1=new re({min:1,max:20,default:5,required:!1}),C1={desiredCount:A1,numberOfValues:v1},dc=P("automaticFacet/setOptions",e=>O(e,C1)),pc=P("automaticFacet/deselectAll",e=>O(e,Ae)),x1=z,Sn=P("automaticFacet/toggleSelectValue",e=>O(e,{field:x1,selection:new X({values:li})}));d();c();u();l();d();c();u();l();var b1={state:new Be({required:!0}),numberOfResults:new re({required:!0,min:0}),value:new L({required:!0,emptyAllowed:!0}),path:new ie({required:!0,each:z}),moreValuesAvailable:new de({required:!1})};function tC(e){e.children.forEach(t=>{tC(t)}),hr({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},b1)}var fc={facetId:Ae,field:z,tabs:new X({options:{required:!1},values:{included:new ie({each:new L}),excluded:new ie({each:new L})}}),activeTab:new L({required:!1}),delimitingCharacter:new L({required:!1,emptyAllowed:!0}),filterFacetCount:new de({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Be({required:!1}),basePath:new ie({required:!1,each:z}),filterByBasePath:new de({required:!1})};var vn=P("categoryFacet/register",e=>O(e,fc)),Wo=P("categoryFacet/toggleSelectValue",e=>{try{return hr(e.facetId,z),tC(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:$n(t)}}}),An=P("categoryFacet/deselectAll",e=>O(e,fc.facetId)),ui=P("categoryFacet/updateNumberOfValues",e=>O(e,{facetId:fc.facetId,numberOfValues:fc.numberOfValues})),mc=P("categoryFacet/updateSortCriterion",e=>O(e,{facetId:fc.facetId,criterion:new Be})),Og=P("categoryFacet/updateBasePath",e=>O(e,{facetId:fc.facetId,basePath:new ie({each:z})}));d();c();u();l();var w1={categoryFacetId:Ae,categoryFacetPath:new ie({required:!0,each:z})},R1=(e,{categoryFacetId:t,categoryFacetPath:r})=>{let o=e.categoryFacetSet[t]?.request.field,a=`${o}_${t}`;return{categoryFacetId:t,categoryFacetPath:r,categoryFacetField:o,categoryFacetTitle:a}},Ng=e=>J("analytics/categoryFacet/breadcrumb",(t,r)=>(O(e,w1),t.makeBreadcrumbFacet(R1(r,e)))),vT=()=>({actionCause:"breadcrumbFacet"});d();c();u();l();d();c();u();l();var Fe=P("facetOptions/update",(e={freezeFacetOrder:!0})=>O(e,{freezeFacetOrder:new de({required:!1})})),Gt=P("facetOptions/facet/enable",e=>O(e,Ae)),rt=P("facetOptions/facet/disable",e=>O(e,Ae));d();c();u();l();var or=(e,t)=>typeof e=="object"&&Object.keys({...e}).length===0||!t||!e?!0:e.excluded?.includes(t)?!1:!!(e.included&&(e.included.length===0||e.included.includes(t))||e.excluded&&!e.included);d();c();u();l();d();c();u();l();var Bu={facetId:Ae,captions:new X({options:{required:!1}}),numberOfValues:new re({required:!1,min:1}),query:new L({required:!1,emptyAllowed:!0})};var F1={path:new ie({required:!0,each:z}),displayValue:Ge,rawValue:Ge,count:new re({required:!0,min:0})},gc=P("categoryFacet/selectSearchResult",e=>O(e,{facetId:Ae,value:new X({values:F1})})),hc=P("categoryFacetSearch/register",e=>O(e,Bu));d();c();u();l();function yc(e,t){let{facetId:r,criterion:n}=t,o=e[r]?.request;o&&(o.sortCriteria=n)}function Sc(e){e&&(e.currentValues=e.currentValues.map(t=>({...t,previousState:t.state!=="idle"?t.state:void 0,state:"idle"})),e.preventAutoSelect=!0)}function _g(e,t){e&&(e.numberOfValues=t)}d();c();u();l();function Gu(e,t){let r=e[t];r&&(r.request.numberOfValues=r.initialNumberOfValues,r.request.currentValues=[],r.request.preventAutoSelect=!0)}function Dg(e,t,r){e.currentValues=E1(t,r),e.numberOfValues=t.length?1:r,e.preventAutoSelect=!0}function E1(e,t){if(!e.length)return[];let r=AT(e[0],t),n=r;for(let o of e.splice(1)){let a=AT(o,t);n.children.push(a),n=a}return n.state="selected",n.retrieveChildren=!0,[r]}function AT(e,t){return{value:e,retrieveCount:t,children:[],state:"idle",retrieveChildren:!1}}var Cn=ae(Xi(),e=>{e.addCase(vn,(t,r)=>{let n=r.payload,{facetId:o,tabs:a}=n;if(o in t)return;let i=T1(n),p=i.numberOfValues;t[o]={request:i,initialNumberOfValues:p,tabs:a}}).addCase(qe.fulfilled,(t,r)=>r.payload?.categoryFacetSet??t).addCase(Me,(t,r)=>{let n=r.payload.cf||{},o=r.payload.tab;Object.keys(t).forEach(a=>{let i=t[a],p=i.request;if((i.tabs?.included?.length||i.tabs?.excluded?.length)&&!or(i.tabs,o)){p.currentValues.length&&Dg(p,[],i.initialNumberOfValues);return}let m=n[a]||[];(m.length||p.currentValues.length)&&Dg(p,m,i.initialNumberOfValues)})}).addCase(mc,(t,r)=>{let{facetId:n,criterion:o}=r.payload,a=t[n]?.request;a&&(a.sortCriteria=o)}).addCase(Og,(t,r)=>{let{facetId:n,basePath:o}=r.payload,a=t[n]?.request;a&&(a.basePath=[...o])}).addCase(Wo,(t,r)=>{let{facetId:n,selection:o,retrieveCount:a}=r.payload,i=t[n]?.request;if(!i)return;let{path:p}=o,f=p.slice(0,p.length-1),m=I1(i,f,a);if(m.length){let y=m[0];y.retrieveChildren=!0,y.state="selected",y.previousState="idle",y.children=[];return}let g=xT(o.value,a);g.state="selected",g.previousState="idle",m.push(g),i.numberOfValues=1}).addCase(An,(t,r)=>{let n=r.payload;Gu(t,n)}).addCase(ft,t=>{Object.keys(t).forEach(r=>Gu(t,r))}).addCase(an,(t,r)=>Object.keys(t).forEach(n=>{t[n].request.preventAutoSelect=!r.payload.allow})).addCase(ui,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload,a=t[n]?.request;if(a){if(!a.currentValues.length)return _g(a,o);P1(t,r.payload)}}).addCase(gc,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n];if(!a)return;let i=[...o.path,o.rawValue];Dg(a.request,i,a.initialNumberOfValues)}).addCase(Fr.fulfilled,(t,r)=>{CT(t,r.payload.response.facets)}).addCase(W.fulfilled,(t,r)=>{CT(t,r.payload.response.facets)}).addCase(rt,(t,r)=>{Gu(t,r.payload)}).addCase(yt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!or(a.tabs,n)&&Gu(t,o)})})}),$u={delimitingCharacter:";",filterFacetCount:!0,injectionDepth:1e3,numberOfValues:5,sortCriteria:"occurrences",basePath:[],filterByBasePath:!0,resultsMustMatch:"atLeastOneValue"};function I1(e,t,r){let n=e.currentValues;for(let o of t){let a=n[0];(!a||o!==a.value)&&(a=xT(o,r),n.length=0,n.push(a)),a.retrieveChildren=!1,a.previousState=void 0,a.state="idle",n=a.children}return n}function T1(e){return{...$u,currentValues:[],preventAutoSelect:!1,type:"hierarchical",...e}}function xT(e,t){return{value:e,state:"idle",children:[],retrieveChildren:!0,retrieveCount:t}}function CT(e,t){t.forEach(r=>{if(!k1(e,r))return;let n=r.facetId,o=e[n]?.request;if(!o)return;let a=O1(o,r);o.currentValues=a?[]:o.currentValues,o.preventAutoSelect=!1})}function P1(e,t){let{facetId:r,numberOfValues:n}=t,o=e[r]?.request.currentValues[0];if(o){for(;o.children.length&&o?.state!=="selected";)o=o.children[0];o.retrieveCount=n}}function k1(e,t){return t.facetId in e}function O1(e,t){let r=cr(e.currentValues),n=cr(t.values);return r.length!==n.length}d();c();u();l();d();c();u();l();var xn=new L({regex:/^[a-zA-Z0-9-_]+$/}),bn=new L({required:!0}),bT=new ie({each:new L}),wT=new L,RT=new de,wn=new de,Rn=new re({min:0}),Wr=new re({min:1}),qg=new de({required:!0}),N1=new X,_1=new L,D1={captions:N1,numberOfValues:Wr,query:_1},vc=new X({values:D1}),Mg=new X({options:{required:!1},values:{type:new L({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new ie({required:!0,max:25,each:new L({emptyAllowed:!1,required:!0})})}}),FT=new de,jg=new ie({min:1,max:25,required:!1,each:new L({emptyAllowed:!1,required:!0})});var q1={facetId:Ae,field:new L({required:!0,emptyAllowed:!0}),tabs:new X({options:{required:!1},values:{included:new ie({each:new L}),excluded:new ie({each:new L})}}),activeTab:new L({required:!1}),filterFacetCount:new de({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Be({required:!1}),resultsMustMatch:new Be({required:!1}),allowedValues:Mg,customSort:jg},Fn=P("facet/register",e=>O(e,q1)),En=P("facet/toggleSelectValue",e=>O(e,{facetId:Ae,selection:new X({values:li})})),In=P("facet/toggleExcludeValue",e=>O(e,{facetId:Ae,selection:new X({values:li})})),nt=P("facet/deselectAll",e=>O(e,Ae)),Ac=P("facet/updateSortCriterion",e=>O(e,{facetId:Ae,criterion:new Be({required:!0})})),di=P("facet/updateNumberOfValues",e=>O(e,{facetId:Ae,numberOfValues:new re({required:!0,min:1})})),pi=P("facet/updateIsFieldExpanded",e=>O(e,{facetId:Ae,isFieldExpanded:new de({required:!0})})),ao=P("facet/updateFreezeCurrentValues",e=>O(e,{facetId:Ae,freezeCurrentValues:new de({required:!0})}));d();c();u();l();var Cc=e=>J("analytics/facet/showMore",(t,r)=>{O(e,Ae);let n=rs(e,lr(r));return t.makeFacetShowMore(n)}),xc=e=>J("analytics/facet/showLess",(t,r)=>{O(e,Ae);let n=rs(e,lr(r));return t.makeFacetShowLess(n)}),Tn=e=>J("analytics/facet/sortChange",(t,r)=>{O(e,{facetId:Ae,criterion:new Be({required:!0})});let{facetId:n,criterion:o}=e,a=lr(r),p={...rs(n,a),criteria:o};return t.makeFacetUpdateSort(p)}),bt=e=>J("analytics/facet/reset",(t,r)=>{O(e,Ae);let n=lr(r),o=rs(e,n);return t.makeFacetClearAll(o)}),it=e=>J("analytics/facet/select",(t,r)=>{O(e,{facetId:Ae,facetValue:z});let n=lr(r),o=ns(e,n);return t.makeFacetSelect(o)}),fr=e=>J("analytics/facet/exclude",(t,r)=>{O(e,{facetId:Ae,facetValue:z});let n=lr(r),o=ns(e,n);return t.makeFacetExclude(o)}),Kr=e=>J("analytics/facet/deselect",(t,r)=>{O(e,{facetId:Ae,facetValue:z});let n=lr(r),o=ns(e,n);return t.makeFacetDeselect(o)}),io=e=>J("analytics/facet/unexclude",(t,r)=>{O(e,{facetId:Ae,facetValue:z});let n=lr(r),o=ns(e,n);return t.makeFacetUnexclude(o)}),bc=e=>J("analytics/facet/breadcrumb",(t,r)=>{O(e,{facetId:Ae,facetValue:z});let n=ns(e,lr(r));return t.makeBreadcrumbFacet(n)}),$t=()=>({actionCause:"facetClearAll"}),gt=()=>({actionCause:"facetSelect"}),so=()=>({actionCause:"facetExclude"}),co=()=>({actionCause:"facetDeselect"}),ET=()=>({actionCause:"facetUnexclude"}),Vg=()=>({actionCause:"breadcrumbFacet"});d();c();u();l();d();c();u();l();var IT={facetId:Ae,value:new X({values:{displayValue:Ge,rawValue:Ge,count:new re({required:!0,min:0})}})},Lg=P("facetSearch/register",e=>O(e,Bu)),Ko=P("facetSearch/update",e=>O(e,Bu)),fi=P("facetSearch/toggleSelectValue",e=>O(e,IT)),mi=P("facetSearch/toggleExcludeValue",e=>O(e,IT));var kr=ae(ts(),e=>{e.addCase(Fn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;n in t||(t[n]=Rw(M1(r.payload),o))}).addCase(qe.fulfilled,(t,r)=>{if(r.payload&&Object.keys(r.payload.facetSet).length!==0)return r.payload.facetSet}).addCase(Me,(t,r)=>{let n=r.payload.f||{},o=r.payload.fExcluded||{};Object.keys(t).forEach(i=>{let{request:p}=t[i],f=n[i]||[],m=o[i]||[],g=f.length+m.length,y=p.currentValues.filter(x=>!f.includes(x.value)&&!m.includes(x.value));p.currentValues=[...f.map(PT),...m.map(kT),...y.map(V1)],p.preventAutoSelect=g>0,p.numberOfValues=Math.max(g,p.numberOfValues)})}).addCase(En,(t,r)=>{let{facetId:n,selection:o}=r.payload,a=t[n]?.request;if(!a)return;a.preventAutoSelect=!0;let i=a.currentValues.find(f=>f.value===o.value);if(!i){Ug(a,o);return}let p=i.state==="selected";i.previousState=i.state,i.state=p?"idle":"selected",a.freezeCurrentValues=!0}).addCase(In,(t,r)=>{let{facetId:n,selection:o}=r.payload,a=t[n]?.request;if(!a)return;a.preventAutoSelect=!0;let i=a.currentValues.find(f=>f.value===o.value);if(!i){Ug(a,o);return}let p=i.state==="excluded";i.previousState=i.state,i.state=p?"idle":"excluded",a.freezeCurrentValues=!0}).addCase(ao,(t,r)=>{let{facetId:n,freezeCurrentValues:o}=r.payload,a=t[n]?.request;a&&(a.freezeCurrentValues=o)}).addCase(nt,(t,r)=>{Sc(t[r.payload]?.request)}).addCase(ft,t=>{Object.values(t).filter(r=>r.hasBreadcrumbs).forEach(({request:r})=>Sc(r))}).addCase(gs,t=>{Object.values(t).filter(r=>!r.hasBreadcrumbs).forEach(({request:r})=>Sc(r))}).addCase(an,(t,r)=>Object.values(t).forEach(n=>{n.request.preventAutoSelect=!r.payload.allow})).addCase(Ac,(t,r)=>{yc(t,r.payload)}).addCase(di,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload;_g(t[n]?.request,o)}).addCase(pi,(t,r)=>{let{facetId:n,isFieldExpanded:o}=r.payload,a=t[n]?.request;a&&(a.isFieldExpanded=o)}).addCase(W.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>TT(t[o.facetId]?.request,o))}).addCase(Fr.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>TT(t[o.facetId]?.request,o))}).addCase(fi,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n]?.request;if(!a)return;let{rawValue:i}=o,{currentValues:p}=a,f=p.find(g=>g.value===i);if(f){f.state="selected";return}let m=PT(i);Ug(a,m),a.freezeCurrentValues=!0,a.preventAutoSelect=!0}).addCase(mi,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n]?.request;if(!a)return;let{rawValue:i}=o,{currentValues:p}=a,f=p.find(g=>g.value===i);if(f){f.state="excluded";return}let m=kT(i);Ug(a,m),a.freezeCurrentValues=!0,a.preventAutoSelect=!0}).addCase(rt,(t,r)=>{if(!(r.payload in t))return;let{request:n}=t[r.payload];Sc(n)}).addCase(yt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!or(a.tabs,n)&&Sc(a.request)})})});function Ug(e,t){let{currentValues:r}=e,n=r.findIndex(a=>a.state==="idle"),o=n===-1?r.length:n;e.currentValues.splice(o,0,t),n>-1&&e.currentValues.pop(),e.numberOfValues=e.currentValues.length}function TT(e,t){e&&(e.currentValues=t.values.map(j1),e.freezeCurrentValues=!1,e.preventAutoSelect=!1)}var Hu={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"automatic",resultsMustMatch:"atLeastOneValue"};function M1(e){return{...Hu,type:"specific",currentValues:[],freezeCurrentValues:!1,isFieldExpanded:!1,preventAutoSelect:!1,...e}}function j1(e){let{value:t,state:r}=e;return{value:t,state:r}}function PT(e){return{value:e,state:"selected"}}function kT(e){return{value:e,state:"excluded"}}function V1(e){return{...e,state:"idle"}}d();c();u();l();var Qg=()=>J("analytics/facet/deselectAllBreadcrumbs",e=>e.makeBreadcrumbResetAll());d();c();u();l();d();c();u();l();function Yo(e){let t=OT(e.start,e),r=OT(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function OT(e,t){let{dateFormat:r}=t;return hR(e)?(Oo(e),fR(e)):typeof e=="string"&&ln(e)?(Oo(e),e):(Lp(e,r),du(wa(e,r)))}d();c();u();l();var wc=P("rangeFacet/updateSortCriterion",e=>O(e,{facetId:Ae,criterion:new Be({required:!0})}));d();c();u();l();var gi={state:z,start:new re({required:!0}),end:new re({required:!0}),endInclusive:new de({required:!0}),numberOfResults:new re({required:!0,min:0})},hi={start:z,end:z,endInclusive:new de({required:!0}),state:z,numberOfResults:new re({required:!0,min:0})},yi=e=>({facetId:Ae,selection:typeof e.start=="string"?new X({values:hi}):new X({values:gi})});var L1={start:z,end:z,endInclusive:new de({required:!0}),state:z},U1={facetId:Ae,field:z,tabs:new X({options:{required:!1},values:{included:new ie({each:new L}),excluded:new ie({each:new L})}}),activeTab:new L({required:!1}),currentValues:new ie({required:!1,each:new X({values:L1})}),generateAutomaticRanges:new de({required:!0}),filterFacetCount:new de({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Be({required:!1}),rangeAlgorithm:new Be({required:!1})};function NT(e){return ln(e)?fu(e):e}function Bg(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=Yo(t);if(wa(NT(r)).isAfter(wa(NT(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var Pn=P("dateFacet/register",e=>{try{return hr(e,U1),Bg(e),{payload:e,error:null}}catch(t){return{payload:e,error:$n(t)}}}),kn=P("dateFacet/toggleSelectValue",e=>O(e,{facetId:Ae,selection:new X({values:hi})})),On=P("dateFacet/toggleExcludeValue",e=>O(e,{facetId:Ae,selection:new X({values:hi})})),lo=P("dateFacet/updateFacetValues",e=>{try{return hr(e,{facetId:Ae,values:new ie({each:new X({values:hi})})}),Bg({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:$n(t)}}}),Gg=wc,$g=nt;d();c();u();l();d();c();u();l();var Hg=(e,{facetId:t,selection:r})=>{let o=(e.dateFacetSet[t]||e.numericFacetSet[t]).request.field,a=`${o}_${t}`;return{facetId:t,facetField:o,facetTitle:a,facetRangeEndInclusive:r.endInclusive,facetRangeEnd:`${r.end}`,facetRangeStart:`${r.start}`}},zg=()=>({actionCause:"breadcrumbFacet"});var zu=e=>J("analytics/dateFacet/breadcrumb",(t,r)=>{O(e,yi(e.selection));let n=Hg(r,e);return t.makeBreadcrumbFacet(n)}),rC=zg;d();c();u();l();function Q1(e,t){return!!t&&t.facetId in e.dateFacetSet}var _T=(e,t)=>{let r=Ur(e,t);if(Q1(e,r))return r},DT=(e,t)=>(_T(e,t)||{values:[]}).values.filter(n=>n.state==="selected"),qT=(e,t)=>(_T(e,t)||{values:[]}).values.filter(n=>n.state!=="idle");d();c();u();l();d();c();u();l();var Kg={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"ascending",rangeAlgorithm:"even",resultsMustMatch:"atLeastOneValue"};function Yg(e,t){let{request:r}=t,{facetId:n}=r;if(n in e)return;let o=MT(r);r.numberOfValues=o,e[n]=t}function Jg(e,t,r){let n=e[t]?.request;n&&(n.currentValues=r,n.numberOfValues=MT(n))}function Xg(e,t,r){let n=e[t]?.request;if(!n)return;let o=Wg(n.currentValues,r);if(!o)return;let a=o.state==="selected";o.previousState=o.state,o.state=a?"idle":"selected",n.preventAutoSelect=!0}function Zg(e,t,r){let n=e[t]?.request;if(!n)return;let o=Wg(n.currentValues,r);if(!o)return;let a=o.state==="excluded";o.previousState=o.state,o.state=a?"idle":"excluded",n.preventAutoSelect=!0}function Nn(e,t){let r=e[t]?.request;r&&r.currentValues.forEach(n=>{n.state!=="idle"&&(n.previousState=n.state),n.state="idle"})}function eh(e,t){Object.entries(e).forEach(([r,{request:n}])=>{let o=t[r]||[];n.currentValues.forEach(p=>(!!Wg(o,p)?p.state="selected":typeof t=="object"&&r in t&&p.state!=="idle"&&(p.previousState=p.state,p.state="idle"),p));let a=o.filter(p=>!Wg(n.currentValues,p)),i=n.currentValues;i.push(...a),n.numberOfValues=Math.max(n.numberOfValues,i.length)})}function th(e,t,r){t.forEach(n=>{let o=n.facetId,a=e[o]?.request;if(!a)return;let i=r(n.values);a.currentValues=i,a.preventAutoSelect=!1})}function Wg(e,t){let{start:r,end:n}=t;return e.find(o=>o.start===r&&o.end===n)}function MT(e){let{generateAutomaticRanges:t,currentValues:r,numberOfValues:n}=e;return t?Math.max(n,r.length):r.length}var _n=ae(Zi(),e=>{e.addCase(Pn,(t,r)=>{let{payload:n}=r,{tabs:o}=n,a=B1(n);Yg(t,bw(a,o))}).addCase(qe.fulfilled,(t,r)=>r.payload?.dateFacetSet??t).addCase(Me,(t,r)=>{let n=r.payload.df||{};eh(t,n)}).addCase(kn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Xg(t,n,o)}).addCase(On,(t,r)=>{let{facetId:n,selection:o}=r.payload;Zg(t,n,o)}).addCase(lo,(t,r)=>{let{facetId:n,values:o}=r.payload;Jg(t,n,o)}).addCase($g,(t,r)=>{Nn(t,r.payload)}).addCase(ft,t=>{Object.keys(t).forEach(r=>{Nn(t,r)})}).addCase(Gg,(t,r)=>{yc(t,r.payload)}).addCase(W.fulfilled,(t,r)=>{let n=r.payload.response.facets;th(t,n,G1)}).addCase(rt,(t,r)=>{Nn(t,r.payload)}).addCase(yt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!or(a.tabs,n)&&Nn(t,o)})})});function B1(e){return{...Kg,currentValues:[],preventAutoSelect:!1,type:"dateRange",...e}}function G1(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();u();l();var $1={state:z,start:new re({required:!0}),end:new re({required:!0}),endInclusive:new de({required:!0})},H1={facetId:Ae,field:z,tabs:new X({options:{required:!1},values:{included:new ie({each:new L}),excluded:new ie({each:new L})}}),activeTab:new L({required:!1}),currentValues:new ie({required:!1,each:new X({values:$1})}),generateAutomaticRanges:new de({required:!0}),filterFacetCount:new de({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Be({required:!1}),rangeAlgorithm:new Be({required:!1})};function rh(e){e.currentValues&&e.currentValues.forEach(({start:t,end:r})=>{if(t>r)throw new Error(`The start value is greater than the end value for the numeric range ${t} to ${r}`)})}var Dn=P("numericFacet/register",e=>{try{return O(e,H1),rh(e),{payload:e,error:null}}catch(t){return{payload:e,error:$n(t)}}}),qn=P("numericFacet/toggleSelectValue",e=>O(e,{facetId:Ae,selection:new X({values:gi})})),Mn=P("numericFacet/toggleExcludeValue",e=>O(e,{facetId:Ae,selection:new X({values:gi})})),uo=P("numericFacet/updateFacetValues",e=>{try{return hr(e,{facetId:Ae,values:new ie({each:new X({values:gi})})}),rh({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:$n(t)}}}),nh=wc,oh=nt;d();c();u();l();var Wu=e=>J("analytics/numericFacet/breadcrumb",(t,r)=>{O(e,yi(e.selection));let n=Hg(r,e);return t.makeBreadcrumbFacet(n)}),nC=zg;d();c();u();l();function z1(e,t){return!!t&&t.facetId in e.numericFacetSet}var jT=(e,t)=>{let r=Ur(e,t);if(z1(e,r))return r},VT=(e,t)=>(jT(e,t)||{values:[]}).values.filter(n=>n.state!=="idle"),LT=(e,t)=>(jT(e,t)||{values:[]}).values.filter(n=>n.state==="selected");d();c();u();l();var Or=ae(es(),e=>{e.addCase(Dn,(t,r)=>{let{payload:n}=r,{tabs:o}=n,a=W1(n);Yg(t,ww(a,o))}).addCase(qe.fulfilled,(t,r)=>r.payload?.numericFacetSet??t).addCase(Me,(t,r)=>{let n=r.payload.nf||{};eh(t,n)}).addCase(qn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Xg(t,n,o)}).addCase(Mn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Zg(t,n,o)}).addCase(uo,(t,r)=>{let{facetId:n,values:o}=r.payload;Jg(t,n,o)}).addCase(oh,(t,r)=>{Nn(t,r.payload)}).addCase(ft,t=>{Object.keys(t).forEach(r=>{Nn(t,r)})}).addCase(nh,(t,r)=>{yc(t,r.payload)}).addCase(W.fulfilled,(t,r)=>{let n=r.payload.response.facets;th(t,n,K1)}).addCase(rt,(t,r)=>{Nn(t,r.payload)}).addCase(yt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!or(a.tabs,n)&&Nn(t,o)})})});function W1(e){return{...Kg,currentValues:[],preventAutoSelect:!1,type:"numericalRange",...e}}function K1(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();u();l();d();c();u();l();var Si=z,ah=new X({options:{required:!0},values:{caption:Ge,expression:Ge,state:new L({constrainTo:["idle","selected","excluded"]})}}),ih=new ie({required:!0,each:ah});var Rc=P("staticFilter/register",e=>O(e,{id:Si,values:ih})),po=P("staticFilter/toggleSelect",e=>O(e,{id:Si,value:ah})),fo=P("staticFilter/toggleExclude",e=>O(e,{id:Si,value:ah})),Jo=P("staticFilter/deselectAllFilterValues",e=>O(e,Si)),sh=e=>J("analytics/staticFilter/select",t=>t.makeStaticFilterSelect(e)),Fc=e=>J("analytics/staticFilter/deselect",t=>t.makeStaticFilterDeselect(e)),ch=e=>J("analytics/staticFilter/clearAll",t=>t.makeStaticFilterClearAll(e));d();c();u();l();d();c();u();l();function oe(e){let t,r=new Map,n=()=>r.size===0,o=a=>{try{let i=JSON.stringify(a),p=t!==i;return t=i,p}catch(i){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",i),!0}};return{subscribe(a){a();let i=Symbol(),p;return n()&&(t=JSON.stringify(this.state),p=e.subscribe(()=>{o(this.state)&&r.forEach(f=>f())})),r.set(i,a),()=>{r.delete(i),n()&&p?.()}},get state(){return{}}}}var lh=e=>Object.keys(e.facetSet).map(t=>{let r=e.facetValuesSelector(e.engine.state,t).map(n=>({value:n,deselect:()=>{n.state==="selected"?e.executeToggleSelect({facetId:t,selection:n}):n.state==="excluded"&&e.executeToggleExclude({facetId:t,selection:n})}}));return{facetId:t,field:e.facetSet[t].request.field,values:r}}).filter(t=>t.values.length);function UT(e){let t=oe(e),{dispatch:r}=e;return{...t,get state(){return{facetBreadcrumbs:[],categoryFacetBreadcrumbs:[],numericFacetBreadcrumbs:[],dateFacetBreadcrumbs:[],staticFilterBreadcrumbs:[],hasBreadcrumbs:!1}},deselectAll:()=>{r(ft())},deselectBreadcrumb(n){n.deselect()}}}function QT(e){if(!Y1(e))throw K;let t=UT(e),{dispatch:r}=e,n=()=>e.state,o=()=>{let w={engine:e,facetSet:n().facetSet,executeToggleSelect:({facetId:F,selection:I})=>{r(En({facetId:F,selection:I})),r(ao({facetId:F,freezeCurrentValues:!1})),r(W({legacy:bc({facetId:F,facetValue:I.value}),next:Vg()}))},executeToggleExclude:({facetId:F,selection:I})=>{r(In({facetId:F,selection:I})),r(ao({facetId:F,freezeCurrentValues:!1})),r(W({legacy:bc({facetId:F,facetValue:I.value}),next:Vg()}))},facetValuesSelector:Aw};return lh(w)},a=()=>{let w={engine:e,facetSet:n().numericFacetSet,executeToggleSelect:F=>{r(qn(F)),r(W({legacy:Wu(F),next:nC()}))},executeToggleExclude:F=>{r(Mn(F)),r(W({legacy:Wu(F),next:nC()}))},facetValuesSelector:VT};return lh(w)},i=()=>{let w={engine:e,facetSet:n().dateFacetSet,executeToggleSelect:F=>{r(kn(F)),r(W({legacy:zu(F),next:rC()}))},executeToggleExclude:F=>{r(On(F)),r(W({legacy:zu(F),next:rC()}))},facetValuesSelector:qT};return lh(w)},p=()=>Object.keys(n().categoryFacetSet).map(f).filter(w=>w.path.length),f=w=>{let F=xw(n(),w);return{facetId:w,field:n().categoryFacetSet[w].request.field,path:F,deselect:()=>{r(An(w)),r(W({legacy:Ng({categoryFacetPath:F.map(I=>I.value),categoryFacetId:w}),next:vT()}))}}},m=()=>{let w=n().staticFilterSet??{};return Object.values(w).map(g)},g=w=>{let{id:F,values:I}=w,E=I.filter(k=>k.state!=="idle").map(k=>y(F,k));return{id:F,values:E}},y=(w,F)=>({value:F,deselect:()=>{let{caption:I,expression:E}=F;F.state==="selected"?r(po({id:w,value:F})):F.state==="excluded"&&r(fo({id:w,value:F})),r(W({legacy:Fc({staticFilterId:w,staticFilterValue:{caption:I,expression:E}})}))}}),x=()=>{let w=n().automaticFacetSet?.set??{};return Object.values(w).map(F=>v(F.response)).filter(F=>F.values.length>0)},v=w=>{let{field:F,label:I}=w,E=w.values.filter(k=>k.state!=="idle").map(k=>C(F,k));return{facetId:F,field:F,label:I,values:E}},C=(w,F)=>({value:F,deselect:()=>{r(Sn({field:w,selection:F})),r(W({legacy:bc({facetId:w,facetValue:F.value}),next:Vg()}))}});function b(){return!![...o(),...a(),...i(),...p(),...m(),...x()].length}return{...t,get state(){return{facetBreadcrumbs:o(),categoryFacetBreadcrumbs:p(),numericFacetBreadcrumbs:a(),dateFacetBreadcrumbs:i(),staticFilterBreadcrumbs:m(),automaticFacetBreadcrumbs:x(),hasBreadcrumbs:b()}},deselectAll:()=>{t.deselectAll(),r(W({legacy:Qg(),next:{actionCause:"breadcrumbResetAll"}}))}}}function Y1(e){return e.addReducers({configuration:fe,search:he,facetSet:kr,numericFacetSet:Or,dateFacetSet:_n,categoryFacetSet:Cn}),!0}d();c();u();l();d();c();u();l();d();c();u();l();var J1=new ie({each:z,required:!0}),BT=(e,t)=>(O(e,z),Oi(t)?O(t,z):O(t,J1),{payload:{contextKey:e,contextValue:t}}),vi=P("context/set",e=>{for(let[t,r]of Object.entries(e))BT(t,r);return{payload:e}}),Ai=P("context/add",e=>BT(e.contextKey,e.contextValue)),Ci=P("context/remove",e=>O(e,z));d();c();u();l();var uh=ae($p(),e=>{e.addCase(vi,(t,r)=>{t.contextValues=r.payload}).addCase(Ai,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(Ci,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});d();c();u();l();var X1=["caseId","caseNumber"],Z1={caseId:"caseContext",caseNumber:"caseContext"},Ku=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${Z1[t]} to set this value.}`)}};function oC(e){return X1.includes(e)}var eG=new ve({values:new X({options:{required:!1}})});function GT(e,t={}){if(!nG(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=ut(e,eG,t.initialState,"buildContext");return a.values&&n(vi(a.values)),{...r,get state(){return{values:o().context.contextValues}},set(i){n(vi(i))},...(o().configuration.analytics.analyticsMode==="legacy"?tG(n):rG(n))}}var tG=e=>({add(t,r){e(Ai({contextKey:t,contextValue:r}))},remove(t){e(Ci(t))}}),rG=e=>({add(t,r){if(oC(t))throw new Ku(t);e(Ai({contextKey:t,contextValue:r}))},remove(t){if(oC(t))throw new Ku(t);e(Ci(t))}});function nG(e){return e.addReducers({context:uh}),!0}function $T(e,t){return GT(e,t)}d();c();u();l();d();c();u();l();var wt=ae(zp(),e=>{e.addCase(Fe,(t,r)=>({...t,...r.payload})).addCase(W.fulfilled,t=>{t.freezeFacetOrder=!1}).addCase(W.rejected,t=>{t.freezeFacetOrder=!1}).addCase(qe.fulfilled,(t,r)=>r.payload?.facetOptions??t).addCase(vn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;dh(o,t,n)}).addCase(Fn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;dh(o,t,n)}).addCase(Pn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;dh(o,t,n)}).addCase(Dn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;dh(o,t,n)}).addCase(Gt,(t,r)=>{t.facets[r.payload].enabled=!0}).addCase(rt,(t,r)=>{t.facets[r.payload].enabled=!1}).addCase(Me,(t,r)=>{[...Object.keys(r.payload.f??{}),...Object.keys(r.payload.fExcluded??{}),...Object.keys(r.payload.cf??{}),...Object.keys(r.payload.nf??{}),...Object.keys(r.payload.df??{})].forEach(n=>{n in t||(t.facets[n]=Rv()),t.facets[n].enabled=!0})})});function dh(e,t,r){let n={...Rv(),tabs:e??{}};t.facets[r]=n}d();c();u();l();d();c();u();l();var Ec=ae(Jp(),e=>{e.addCase(Gs,(t,r)=>{let n=r.payload,{id:o}=n;o in t||(t[o]={...n,isActive:!1})}).addCase(yt,(t,r)=>{let n=r.payload;HT(t,n)}).addCase(us,(t,r)=>{let n=r.payload;HT(t,n)}).addCase(qe.fulfilled,(t,r)=>r.payload?.tabSet??t).addCase(Me,(t,r)=>{let n=r.payload.tab;pe(n)||Object.keys(t).forEach(o=>{t[o].isActive=o===n})})});function HT(e,t){t in e&&Object.keys(e).forEach(n=>{e[n].isActive=n===t})}function ph(e){if(!oG(e))throw K;let t=oe(e),r=tt(n=>n.tabSet,n=>Object.values(n).find(a=>a.isActive)?.id??"");return{...t,get state(){return{activeTab:r(e.state)}}}}function oG(e){return e.addReducers({tabSet:Ec}),!0}function zT(e,t){if(!aG(e))throw K;let r=ph(e),n=C=>e.state.facetOptions.facets[C]?.enabled??!1,o=C=>e.state.facetSet?.[C]?.request?.currentValues??e.state.categoryFacetSet?.[C]?.request?.currentValues??e.state.numericFacetSet?.[C]?.request?.currentValues??e.state.dateFacetSet?.[C]?.request?.currentValues??null,a=C=>C in e.state.facetOptions.facets,i=C=>e.state.facetOptions.facets[C]?.tabs,p=()=>_i({isFacetRegistered:a(t.facetId),parentFacets:t.conditions.map(({parentFacetId:C})=>a(C)?{enabled:n(C),values:o(C)}:null),isTabEnabled:or(i(t.facetId),r.state.activeTab)}),f=()=>{let C=p();return C===x?!1:(x=C,!0)},m=()=>t.conditions.length>0?t.conditions.some(C=>{if(!n(C.parentFacetId))return!1;let b=o(C.parentFacetId);return b===null?!1:C.condition(b)}):!0,g=()=>{e.state.facetSet&&Object.entries(e.state.facetSet).forEach(([C,b])=>b.request.freezeCurrentValues&&e.dispatch(ao({facetId:C,freezeCurrentValues:!1})))},y=()=>{if(!a(t.facetId))return;let C=n(t.facetId),b=m(),w=or(i(t.facetId),r.state.activeTab),F=b&&w;C!==F&&(e.dispatch(F?Gt(t.facetId):rt(t.facetId)),g())},x=p(),v=e.subscribe(()=>{f()&&y()});return y(),{stopWatching(){v()}}}function aG(e){return e.addReducers({facetOptions:wt}),!0}d();c();u();l();d();c();u();l();var Ic=P("dictionaryFieldContext/set",e=>{let t=new X({options:{required:!0}}),r=O(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new ie({each:Ge}),a=O(n,o).error;return a?{payload:e,error:a}:{payload:e}}),Tc=P("dictionaryFieldContext/add",e=>{let t=new X({options:{required:!0},values:{field:Ge,key:Ge}});return O(e,t)}),Pc=P("dictionaryFieldContext/remove",e=>O(e,Ge));d();c();u();l();var fh=ae(Hp(),e=>{e.addCase(Ic,(t,r)=>{t.contextValues=r.payload}).addCase(Tc,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(Pc,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function WT(e){if(!iG(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(Ic(o))},add(o,a){r(Tc({field:o,key:a}))},remove(o){r(Pc(o))}}}function iG(e){return e.addReducers({dictionaryFieldContext:fh}),!0}d();c();u();l();d();c();u();l();d();c();u();l();var KT=e=>e.queryCorrection.correctedQuery!==""||e.wasCorrectedTo!=="";d();c();u();l();d();c();u();l();d();c();u();l();var mh=()=>({correctedQuery:"",wordCorrections:[],originalQuery:""}),YT=()=>({correctedQuery:"",corrections:[],originalQuery:""});function JT(){return{enableDidYouMean:!1,wasCorrectedTo:"",wasAutomaticallyCorrected:!1,queryCorrection:mh(),originalQuery:"",automaticallyCorrectQuery:!0,queryCorrectionMode:"legacy"}}var XT=(e,t)=>{let r={...YT(),...t,correctedQuery:t?.correctedQuery||t?.corrections[0]?.correctedQuery||""};e.queryCorrection=r,e.wasCorrectedTo=r.correctedQuery};var gh=ae(JT(),e=>{e.addCase(Fs,t=>{t.enableDidYouMean=!0}).addCase(Qp,t=>{t.enableDidYouMean=!1}).addCase(Bp,t=>{t.automaticallyCorrectQuery=!0}).addCase(Es,t=>{t.automaticallyCorrectQuery=!1}).addCase(W.pending,t=>{t.queryCorrection=mh(),t.wasAutomaticallyCorrected=!1,t.wasCorrectedTo=""}).addCase(W.fulfilled,(t,r)=>{let{queryCorrection:n,queryCorrections:o}=r.payload.response;if(t.queryCorrectionMode==="legacy"){let a=o?.[0]?o[0]:mh();t.queryCorrection=a}t.queryCorrectionMode==="next"&&XT(t,n),t.wasAutomaticallyCorrected=r.payload.automaticallyCorrected,t.originalQuery=r.payload.originalQuery}).addCase(xr,(t,r)=>{t.wasCorrectedTo=r.payload}).addCase(Ra,(t,r)=>{t.queryCorrectionMode=r.payload})});function ZT(e,t={}){if(!sG(e))throw K;let r=oe(e),{dispatch:n}=e;n(Fs()),t.options?.automaticallyCorrectQuery===!1&&n(Es()),n(Ra(t.options?.queryCorrectionMode||"next"));let o=()=>e.state,a=()=>KT(o().didYouMean);return{...r,get state(){let i=o();return{originalQuery:i.didYouMean.originalQuery,wasCorrectedTo:i.didYouMean.wasCorrectedTo,wasAutomaticallyCorrected:i.didYouMean.wasAutomaticallyCorrected,queryCorrection:i.didYouMean.queryCorrection,hasQueryCorrection:a()}},applyCorrection(){n(xr(this.state.queryCorrection.correctedQuery))},updateQueryCorrectionMode(i){n(Ra(i))}}}function sG(e){return e.addReducers({configuration:fe,didYouMean:gh}),!0}function eP(e,t={}){let r=ZT(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},applyCorrection(){r.applyCorrection(),n(W({legacy:Gp(),next:CR()}))}}}d();c();u();l();d();c();u();l();function tP(e){if(!cG(e))throw K;let t=oe(e),r=()=>e.state;return{...t,sort(n){return mu(n,this.state.facetIds)},get state(){return{facetIds:r().search.response.facets.map(a=>a.facetId)}}}}function cG(e){return e.addReducers({search:he,facetOptions:wt}),!0}function rP(e){return tP(e)}d();c();u();l();d();c();u();l();var hh=ae(Yi(),e=>{e.addCase(W.fulfilled,(t,r)=>{t.set={},r.payload.response.generateAutomaticFacets?.facets?.forEach(o=>{t.set[o.field]={response:o}})}).addCase(dc,(t,r)=>{r.payload.desiredCount&&(t.desiredCount=r.payload.desiredCount),r.payload.numberOfValues&&(t.numberOfValues=r.payload.numberOfValues)}).addCase(Sn,(t,r)=>{let{field:n,selection:o}=r.payload,a=t.set[n]?.response;if(!a)return;let i=a.values.find(f=>f.value===o.value);if(!i)return;let p=i.state==="selected";i.state=p?"idle":"selected"}).addCase(pc,(t,r)=>{let n=r.payload,o=t.set[n]?.response;if(o)for(let a of o.values)a.state="idle"}).addCase(Me,(t,r)=>{let n=r.payload.af??{},o=Object.keys(t.set);for(let a in n)if(!t.set[a]){let i=lG(a),p=n[a].map(f=>nP(f));i.values.push(...p),t.set[a]={response:i}}for(let a of o)if(!(a in n)){let i=t.set[a]?.response;for(let p of i.values)p.state="idle"}for(let a in n){let i=t.set[a]?.response;if(i){let p=i.values,f=new Set(n[a]);for(let m of p)f.has(m.value)?(m.state="selected",f.delete(m.value)):m.state="idle";for(let m of f)i.values.push(nP(m))}}}).addCase(qe.fulfilled,(t,r)=>{if(r.payload&&Object.keys(r.payload.automaticFacetSet.set).length!==0)return r.payload.automaticFacetSet}).addCase(ft,t=>{Object.values(t.set).forEach(({response:r})=>{r.values.forEach(n=>{n.state="idle"})})})});function lG(e){return{field:e,values:[],moreValuesAvailable:!1,label:"",indexScore:0}}function nP(e){return{value:e,state:"selected",numberOfResults:0}}d();c();u();l();d();c();u();l();var yh=e=>e.state==="selected",Sh=e=>e.state==="excluded",vh=(e,t)=>{let r={facetId:e,facetValue:t.value};return yh(t)?Kr(r):it(r)},Ah=e=>yh(e)?co():gt(),oP=(e,t)=>{let r={facetId:e,facetValue:t.value};return Sh(t)?io(r):fr(r)},aP=e=>Sh(e)?ET():so();function iP(e,t){let{dispatch:r}=e,n=oe(e),{field:o}=t;return{...n,toggleSelect(a){r(Sn({field:o,selection:a})),r(W({legacy:vh(o,a),next:Ah(a)}))},deselectAll(){r(pc(o)),r(W({legacy:bt(o),next:$t()}))},get state(){let a=e.state.automaticFacetSet?.set[o]?.response;return a?{field:a.field,label:a.label,values:a.values}:{field:"",values:[],label:""}}}}d();c();u();l();function sP(e){return{desiredCount:e.desiredCount,numberOfValues:e.numberOfValues}}function cP(e,t){if(!uG(e))throw K;let{dispatch:r}=e,n=sP(t.options);return r(dc(n)),{...oe(e),get state(){return{automaticFacets:e.state.search.response.generateAutomaticFacets?.facets.map(i=>iP(e,{field:i.field}))??[]}}}}function uG(e){return e.addReducers({automaticFacetSet:hh,configuration:fe,search:he}),!0}d();c();u();l();d();c();u();l();d();c();u();l();function Ch(e,t,r){let{facetId:n}=t;if(e[n])return;let o=!1,a={...jn,...t},i=r();e[n]={options:a,isLoading:o,response:i,initialNumberOfValues:a.numberOfValues,requestId:""}}function xh(e,t){let{facetId:r,...n}=t,o=e[r];o&&(o.options={...o.options,...n})}function bh(e,t,r){let n=e[t];n&&(n.requestId=r,n.isLoading=!0)}function wh(e,t){let r=e[t];r&&(r.isLoading=!1)}function Rh(e,t,r){let{facetId:n,response:o}=t,a=e[n];a&&a.requestId===r&&(a.isLoading=!1,a.response=o)}function Yu(e,t,r){let{facetId:n}=t,o=e[n];o&&(o.requestId="",o.isLoading=!1,o.response=r(),o.options.numberOfValues=o.initialNumberOfValues,o.options.query=jn.query)}function Fh(e,t){Object.keys(e).forEach(r=>Yu(e,{facetId:r},t))}var jn={captions:{},numberOfValues:10,query:""};d();c();u();l();d();c();u();l();var lP=/*#__PURE__*/function(){var _ref71=_asyncToGenerator(function*(e,t,r,n){let o=t.categoryFacetSearchSet[e].options,a=t.categoryFacetSet[e].request,{captions:i,query:p,numberOfValues:f}=o,{field:m,delimitingCharacter:g,basePath:y,filterFacetCount:x}=a,v=dG(a),C=v.length?[v]:[],b=`*${p}*`;return{url:t.configuration.search.apiBaseUrl??vt(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")}),basePath:y,captions:i,numberOfValues:f,query:b,field:m,delimitingCharacter:g,ignorePaths:C,filterFacetCount:x,type:"hierarchical",...(n?{}:{searchContext:(yield wr(t,r)).request})}});return function lP(_x157,_x158,_x159,_x160){return _ref71.apply(this,arguments)}}(),dG=e=>{let t=[],r=e.currentValues[0];for(;r;)t.push(r.value),r=r.children[0];return t};d();c();u();l();var uP=/*#__PURE__*/function(){var _ref72=_asyncToGenerator(function*(e,t,r,n){let{captions:o,query:a,numberOfValues:i}=t.facetSearchSet[e].options,{field:p,currentValues:f,filterFacetCount:m}=t.facetSet[e].request,g=f.filter(x=>x.state!=="idle").map(x=>x.value),y=`*${a}*`;return{url:t.configuration.search.apiBaseUrl??vt(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders&&{authentication:t.configuration.search.authenticationProviders.join(",")}),captions:o,numberOfValues:i,query:y,field:p,ignoreValues:g,filterFacetCount:m,type:"specific",...(n?{}:{searchContext:(yield wr(t,r)).request})}});return function uP(_x161,_x162,_x163,_x164){return _ref72.apply(this,arguments)}}();var dP=e=>(/*#__PURE__*/function(){var _ref73=_asyncToGenerator(function*(t,{getState:r,extra:{apiClient:n,validatePayload:o,navigatorContext:a}}){let i=r(),p;o(t,z),pG(i,t)?p=yield uP(t,i,a,e):p=yield lP(t,i,a,e);let f=yield n.facetSearch(p);return{facetId:t,response:f}});return function(_x165,_x166){return _ref73.apply(this,arguments)}}()),Rt=xe("facetSearch/executeSearch",dP(!1)),Vn=xe("facetSearch/executeSearch",dP(!0)),kc=P("facetSearch/clearResults",e=>O(e,{facetId:Ae})),pG=(e,t)=>e.facetSearchSet!==void 0&&e.facetSet!==void 0&&e.facetSet[t]!==void 0;d();c();u();l();function pP(){return{}}var Oc=ae(pP(),e=>{e.addCase(hc,(t,r)=>{let n=r.payload;Ch(t,n,aC)}).addCase(Ko,(t,r)=>{xh(t,r.payload)}).addCase(Rt.pending,(t,r)=>{let n=r.meta.arg;bh(t,n,r.meta.requestId)}).addCase(Rt.rejected,(t,r)=>{let n=r.meta.arg;wh(t,n)}).addCase(Rt.fulfilled,(t,r)=>{Rh(t,r.payload,r.meta.requestId)}).addCase(kc,(t,{payload:{facetId:r}})=>{Yu(t,{facetId:r},aC)}).addCase(W.fulfilled,t=>{Fh(t,aC)})});function aC(){return{moreValuesAvailable:!1,values:[]}}d();c();u();l();d();c();u();l();d();c();u();l();function fP(e,t){let{field:r,state:n}=e;if(!fG(e))return r;let o=`${r}_`,a=mG(o,n);return hG(r,t),`${o}${a}`}function fG(e){let{field:t,state:r}=e;return mP(r).some(o=>o&&t in o)}function mG(e,t){let n=mP(t).map(o=>Object.keys(o||{})).reduce((o,a)=>o.concat(a),[]);return gG(n,e)+1}function mP(e){let{facetSet:t,numericFacetSet:r,dateFacetSet:n,categoryFacetSet:o}=e;return[t,r,n,o]}function gG(e,t){return e.map(a=>{let i=a.split(t)[1],p=parseInt(i,10);return Number.isNaN(p)?0:p}).sort().pop()??0}function hG(e,t){let r=`A facet with field "${e}" already exists.
|
|
46
|
-
To avoid unexpected behaviour, configure the #id option on the facet controller.`;t.warn(r)}function Ht(e,t){let{state:r,logger:n}=e,{field:o,facetId:a}=t;return a||fP({field:o,state:r},n)}d();c();u();l();d();c();u();l();var gP=["alphanumeric","occurrences"];var hP=new ve({field:bn,tabs:new X({options:{required:!1},values:{included:new ie({each:new L}),excluded:new ie({each:new L})}}),basePath:bT,delimitingCharacter:wT,facetId:xn,facetSearch:vc,filterByBasePath:RT,filterFacetCount:wn,injectionDepth:Rn,numberOfValues:Wr,sortCriteria:new L({constrainTo:gP})});function yP(e,t){if(!yG(e))throw K;let r=oe(e),{dispatch:n}=e,o=Ht(e,t.options),a=t.options.tabs??{},i=Qt(e.state.tabSet),p={...$u,...yd("facetSearch",t.options),field:t.options.field,facetId:o,tabs:a,activeTab:i},f={facetSearch:{...jn,...t.options.facetSearch},...p};He(e,hP,f,"buildCategoryFacet");let m=()=>XS(e.state,o),g=()=>JS(e.state,o),y=()=>tn(e.state),x=()=>un(e.state,o);return n(vn(p)),{...r,toggleSelect(v){let C=f.numberOfValues;n(Wo({facetId:o,selection:v,retrieveCount:C})),n(Fe())},deselectAll(){n(An(o)),n(Fe())},sortBy(v){n(mc({facetId:o,criterion:v})),n(Fe())},isSortedBy(v){return m().sortCriteria===v},showMoreValues(){let{numberOfValues:v}=f,{activeValue:C,valuesAsTrees:b}=this.state,w=(C?.children.length??b.length)+v;n(ui({facetId:o,numberOfValues:w})),n(Fe())},showLessValues(){let{numberOfValues:v}=f;n(ui({facetId:o,numberOfValues:v})),n(Fe())},enable(){n(Gt(o))},disable(){n(rt(o))},get state(){let v=m(),C=g(),b=y(),w=x(),F=C?.values??[],I=F.some(B=>B.children.length>0)??!1,{parents:E,values:k}=Cw(C?.values),T=cr(F),D=T.length?T[T.length-1]:void 0,G=!!D,U=D?.moreValuesAvailable??C?.moreValuesAvailable??!1,j=D?D.children.length>f.numberOfValues:F.length>f.numberOfValues;return{facetId:o,parents:E,selectedValueAncestry:T,values:k,isHierarchical:I,valuesAsTrees:F,activeValue:D,isLoading:b,hasActiveValues:G,canShowMoreValues:U,canShowLessValues:j,sortCriteria:v.sortCriteria,enabled:w}}}}function yG(e){return e.addReducers({categoryFacetSet:Cn,categoryFacetSearchSet:Oc,facetOptions:wt,configuration:fe,search:he}),!0}d();c();u();l();d();c();u();l();d();c();u();l();var SG="coveo-headless-internal-state",Eh=Symbol.for(SG);d();c();u();l();function Nc(e,t){let r=e.dispatch,{options:n,getFacetSearch:o,executeFacetSearchActionCreator:a,executeFieldSuggestActionCreator:i}=t,{facetId:p}=n;return{updateText(f){r(Ko({facetId:p,query:f,numberOfValues:o().initialNumberOfValues}))},showMoreResults(){let{initialNumberOfValues:f,options:m}=o();r(Ko({facetId:p,numberOfValues:m.numberOfValues+f})),r(t.isForFieldSuggestions?i(p):a(p))},search(){r(t.isForFieldSuggestions?i(p):a(p))},clear(){r(kc({facetId:p}))},updateCaptions(f){r(Ko({facetId:p,captions:f}))},get state(){let{response:f,isLoading:m,options:g}=o(),{query:y}=g,x=f.values;return{...f,values:x,isLoading:m,query:y}}}}function SP(e,t){let{dispatch:r}=e,n={...jn,...t.options},{facetId:o}=n,a=()=>"state"in e?e.state.categoryFacetSearchSet[o]:e[Eh].categoryFacetSearchSet[o];r(hc(n));let i=Nc(e,{options:n,getFacetSearch:a,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:t.executeFacetSearchActionCreator,executeFieldSuggestActionCreator:t.executeFieldSuggestActionCreator});return{...i,select(p){r(gc({facetId:o,value:p})),t.select(p)},get state(){return i.state}}}function Ih(e,t){let{executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:o,isForFieldSuggestions:a}=t,{dispatch:i}=e,p={...jn,...t.options},{facetId:f}=p,m=()=>e.state.categoryFacetSearchSet[f],g=SP(e,{options:{...p},executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:o,isForFieldSuggestions:a});i(hc(p));let y=Nc(e,{options:p,getFacetSearch:m,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:Vn});return{...y,...g,get state(){return{...y.state,...g.state}}}}function vP(e,t){if(!vG(e))throw K;let r=yP(e,t),{dispatch:n}=e,o=()=>r.state.facetId,a=Ih(e,{options:{facetId:o(),...t.options.facetSearch},executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:Vn,select:f=>{n(Fe()),n(W({legacy:it({facetId:o(),facetValue:f.rawValue}),next:gt()}))},isForFieldSuggestions:!1}),{state:i,...p}=a;return{...r,facetSearch:p,toggleSelect(f){r.toggleSelect(f),n(W({legacy:AG(o(),f),next:CG(f)}))},deselectAll(){r.deselectAll(),n(W({legacy:bt(o()),next:$t()}))},sortBy(f){r.sortBy(f),n(W({legacy:Tn({facetId:o(),criterion:f})}))},showMoreValues(){r.showMoreValues(),n(Fr({legacy:Cc(o())}))},showLessValues(){r.showLessValues(),n(Fr({legacy:xc(o())}))},get state(){return{...r.state,facetSearch:a.state}}}}function vG(e){return e.addReducers({categoryFacetSet:Cn,categoryFacetSearchSet:Oc,configuration:fe,search:he}),!0}function AG(e,t){let r={facetId:e,facetValue:t.value};return t.state==="selected"?Kr(r):it(r)}function CG(e){return e.state==="selected"?co():gt()}d();c();u();l();d();c();u();l();d();c();u();l();function AP(){return{}}var _c=ae(AP(),e=>{e.addCase(Lg,(t,r)=>{let n=r.payload;Ch(t,n,iC)}).addCase(Ko,(t,r)=>{xh(t,r.payload)}).addCase(Rt.pending,(t,r)=>{let n=r.meta.arg;bh(t,n,r.meta.requestId)}).addCase(Rt.rejected,(t,r)=>{let n=r.meta.arg;wh(t,n)}).addCase(Rt.fulfilled,(t,r)=>{Rh(t,r.payload,r.meta.requestId)}).addCase(kc,(t,{payload:r})=>{Yu(t,r,iC)}).addCase(W.fulfilled,t=>{Fh(t,iC)})});function iC(){return{moreValuesAvailable:!1,values:[]}}d();c();u();l();d();c();u();l();var CP={facetId:Ae,selection:new X({values:li})},xP=xe("facet/executeToggleSelect",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},CP),n(En({facetId:e,selection:t})),n(Fe())}),bP=xe("facet/executeToggleExclude",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},CP),n(In({facetId:e,selection:t})),n(Fe())});d();c();u();l();d();c();u();l();var Dc=["allValues","atLeastOneValue"];d();c();u();l();var Th=["score","alphanumeric","alphanumericDescending","occurrences","automatic","alphanumericNatural","alphanumericNaturalDescending"];var wP=new ve({facetId:xn,tabs:new X({options:{required:!1},values:{included:new ie({each:new L}),excluded:new ie({each:new L})}}),field:bn,filterFacetCount:wn,injectionDepth:Rn,numberOfValues:Wr,sortCriteria:new L({constrainTo:Th}),resultsMustMatch:new L({constrainTo:Dc}),facetSearch:vc});function RP(e,t,r=wP){if(!xG(e))throw K;let{dispatch:n}=e,o=oe(e),a=Ht(e,t.options),i=t.options.tabs??{},p=Qt(e.state.tabSet),f={...Hu,...yd("facetSearch",t.options),field:t.options.field,facetId:a,tabs:i,activeTab:p},m={facetSearch:{...jn,...t.options.facetSearch},...f};He(e,r,m,"buildFacet");let g=()=>fp(e.state,a),y=()=>Ji(e.state,a),x=()=>tn(e.state),v=()=>un(e.state,a),C=()=>{let{currentValues:w}=g();return w.filter(F=>F.state!=="idle").length},b=()=>{let{currentValues:w}=g(),F=m.numberOfValues,I=!!w.find(E=>E.state==="idle");return F<w.length&&I};return n(Fn(f)),{...o,toggleSelect:w=>n(xP({facetId:m.facetId,selection:w})),toggleExclude:w=>n(bP({facetId:m.facetId,selection:w})),toggleSingleSelect:function(w){w.state==="idle"&&n(nt(a)),this.toggleSelect(w)},toggleSingleExclude:function(w){w.state==="idle"&&n(nt(a)),this.toggleExclude(w)},isValueSelected:yh,isValueExcluded:Sh,deselectAll(){n(nt(a)),n(Fe())},sortBy(w){n(Ac({facetId:a,criterion:w})),n(Fe())},isSortedBy(w){return this.state.sortCriterion===w},showMoreValues(){let w=g().numberOfValues,F=m.numberOfValues,I=F-w%F,E=w+I;n(di({facetId:a,numberOfValues:E})),n(pi({facetId:a,isFieldExpanded:!0})),n(Fe())},showLessValues(){let w=m.numberOfValues,F=Math.max(w,C());n(di({facetId:a,numberOfValues:F})),n(pi({facetId:a,isFieldExpanded:!1})),n(Fe())},enable(){n(Gt(a))},disable(){n(rt(a))},get state(){let w=g(),F=y(),I=x(),E=v(),k;typeof w.sortCriteria=="object"?k=w.sortCriteria.order==="descending"?"alphanumericDescending":"alphanumeric":k=w.sortCriteria;let T=F?F.values:[],D=T.some(j=>j.state!=="idle"),G=F?F.moreValuesAvailable:!1,U=w.resultsMustMatch;return{label:F?.label,facetId:a,tabs:i,values:T,sortCriterion:k,resultsMustMatch:U,isLoading:I,hasActiveValues:D,canShowMoreValues:G,canShowLessValues:b(),enabled:E}}}}function xG(e){return e.addReducers({facetSet:kr,facetOptions:wt,configuration:fe,facetSearchSet:_c}),!0}d();c();u();l();function Ph(e,t){let{dispatch:r}=e,{options:n,select:o,exclude:a,isForFieldSuggestions:i,executeFacetSearchActionCreator:p,executeFieldSuggestActionCreator:f}=t,{facetId:m}=n,g=()=>"state"in e?e.state.facetSearchSet[m]:e[Eh].facetSearchSet[m];r(Lg(n));let y=Nc(e,{options:n,getFacetSearch:g,isForFieldSuggestions:i,executeFacetSearchActionCreator:p,executeFieldSuggestActionCreator:f});return{...y,select(x){r(fi({facetId:m,value:x})),o(x)},exclude(x){r(mi({facetId:m,value:x})),a(x)},singleSelect(x){r(nt(m)),r(fi({facetId:m,value:x})),o(x)},singleExclude(x){r(nt(m)),r(mi({facetId:m,value:x})),a(x)},get state(){let{values:x}=y.state;return{...y.state,values:x.map(({count:v,displayValue:C,rawValue:b})=>({count:v,displayValue:C,rawValue:b}))}}}}d();c();u();l();var FP=new ve({facetId:xn,field:bn,tabs:new X({options:{required:!1},values:{included:new ie({each:new L}),excluded:new ie({each:new L})}}),filterFacetCount:wn,injectionDepth:Rn,numberOfValues:Wr,sortCriteria:new L({constrainTo:Th}),resultsMustMatch:new L({constrainTo:Dc}),facetSearch:vc,allowedValues:Mg,hasBreadcrumbs:FT,customSort:jg});function EP(e,t){if(!bG(e))throw K;let{dispatch:r}=e,n=RP(e,{...t,options:{...t.options,...(t.options.allowedValues&&{allowedValues:{type:"simple",values:t.options.allowedValues}})}},FP),o=()=>n.state.facetId,i=(()=>{let{facetSearch:m}=t.options;return Ph(e,{options:{facetId:o(),...m},select:g=>{r(Fe()),r(W({legacy:it({facetId:o(),facetValue:g.rawValue}),next:gt()}))},exclude:g=>{r(Fe()),r(W({legacy:fr({facetId:o(),facetValue:g.rawValue}),next:so()}))},isForFieldSuggestions:!1,executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:Vn})})(),{state:p,...f}=i;return{...n,facetSearch:f,toggleSelect(m){n.toggleSelect(m),r(W({legacy:vh(o(),m),next:Ah(m)}))},toggleExclude(m){n.toggleExclude(m),r(W({legacy:oP(o(),m),next:aP(m)}))},deselectAll(){n.deselectAll(),r(W({legacy:bt(o()),next:$t()}))},sortBy(m){n.sortBy(m),r(W({legacy:Tn({facetId:o(),criterion:m})}))},isSortedBy(m){return this.state.sortCriterion===m},showMoreValues(){n.showMoreValues(),r(Fr({legacy:Cc(o())}))},showLessValues(){n.showLessValues(),r(Fr({legacy:xc(o())}))},get state(){return{...n.state,facetSearch:i.state}}}}function bG(e){return e.addReducers({facetSet:kr,configuration:fe,facetSearchSet:_c,search:he}),!0}d();c();u();l();d();c();u();l();var kh=e=>e.state==="selected",sC=e=>e.state==="excluded",Oh=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return kh(t)?Kr(n):it(n)},Nh=e=>kh(e)?co():gt(),IP=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return sC(t)?io(n):fr(n)};d();c();u();l();d();c();u();l();d();c();u();l();var _h=P("rangeFacet/executeToggleSelect",e=>O(e,yi(e.selection))),Dh=P("rangeFacet/executeToggleExclude",e=>O(e,yi(e.selection)));var TP={facetId:Ae,selection:new X({values:hi})},PP=xe("dateFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,TP),t(kn(e)),t(_h(e)),t(Fe())}),kP=xe("dateFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,TP),t(On(e)),t(Dh(e)),t(Fe())});d();c();u();l();function qh(e,t){if(!e.generateAutomaticRanges&&e.currentValues===void 0){let r=`currentValues should be specified for ${t} when generateAutomaticRanges is false.`;throw new Error(r)}}d();c();u();l();function Mh(e,t){let{facetId:r,getRequest:n}=t,o=oe(e),a=e.dispatch,i=()=>un(e.state,r);return{...o,isValueSelected:kh,isValueExcluded:sC,deselectAll(){a(nt(r)),a(Fe())},sortBy(p){a(wc({facetId:r,criterion:p})),a(Fe())},isSortedBy(p){return this.state.sortCriterion===p},enable(){a(Gt(r))},disable(){a(rt(r))},get state(){let p=n(),f=Ur(e.state,r),m=p.sortCriteria,g=p.resultsMustMatch,y=f?f.values:[],x=tn(e.state),v=i(),C=y.some(w=>w.state!=="idle"),b=f?.domain;return{facetId:r,values:y,sortCriterion:m,resultsMustMatch:g,hasActiveValues:C,isLoading:x,enabled:v,domain:b}}}}d();c();u();l();d();c();u();l();var jh=["idle","selected","excluded"];d();c();u();l();var Vh=["ascending","descending"],Lh=["even","equiprobable"];var wG={start:new L,end:new L,endInclusive:new de,state:new L({constrainTo:jh})},RG=new ve({facetId:xn,field:bn,tabs:new X({options:{required:!1},values:{included:new ie({each:new L}),excluded:new ie({each:new L})}}),generateAutomaticRanges:qg,filterFacetCount:wn,injectionDepth:Rn,numberOfValues:Wr,currentValues:new ie({each:new X({values:wG})}),sortCriteria:new L({constrainTo:Vh}),rangeAlgorithm:new L({constrainTo:Lh})});function Uh(e,t){He(e,RG,t,"buildDateFacet"),Bg(t)}function OP(e,t){if(!FG(e))throw K;qh(t.options,"buildDateFacet");let r=e.dispatch,n=Ht(e,t.options),o=t.options.tabs??{},a=Qt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:a};Uh(e,i),r(Pn(i));let p=Mh(e,{facetId:n,getRequest:()=>e.state.dateFacetSet[n].request});return{...p,toggleSelect:f=>r(PP({facetId:n,selection:f})),toggleSingleSelect:function(f){f.state==="idle"&&r(nt(n)),this.toggleSelect(f)},toggleExclude:f=>r(kP({facetId:n,selection:f})),toggleSingleExclude:function(f){f.state==="idle"&&r(nt(n)),this.toggleExclude(f)},get state(){return p.state}}}function FG(e){return e.addReducers({configuration:fe,search:he,dateFacetSet:_n,facetOptions:wt}),!0}function NP(e,t){let r=OP(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(W({legacy:bt(o()),next:$t()}))},sortBy(a){r.sortBy(a),n(W({legacy:Tn({facetId:o(),criterion:a})}))},toggleSelect:a=>{r.toggleSelect(a),n(W({legacy:Oh(o(),a),next:Nh(a)}))},toggleExclude:a=>{r.toggleExclude(a),n(W({legacy:IP(o(),a)}))},get state(){return r.state}}}d();c();u();l();d();c();u();l();function _P(e,t){if(!EG(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=Ht(e,t.options),i=t.options.tabs??{},p=Qt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:a,tabs:i,activeTab:p};Uh(e,f),n(Pn(f));let m=()=>un(e.state,a);return{...r,clear:()=>{n(lo({facetId:a,values:[]})),n(Fe())},setRange:g=>{let y={...g,state:"selected",numberOfResults:0,endInclusive:!0},x=lo({facetId:a,values:[y]});return x.error?!1:(n(x),n(Fe()),!0)},enable(){n(Gt(a))},disable(){n(rt(a))},get state(){let g=tn(o()),y=m(),x=DT(o(),a),v=x.length?x[0]:void 0;return{facetId:a,isLoading:g,range:v,enabled:y}}}}function EG(e){return e.addReducers({dateFacetSet:_n,facetOptions:wt,configuration:fe,search:he}),!0}function DP(e,t){if(!IG(e))throw K;let r=_P(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(W({legacy:bt(o()),next:$t()}))},setRange:a=>{let i=r.setRange(a);return i&&n(W({legacy:it({facetId:o(),facetValue:`${a.start}..${a.end}`}),next:gt()})),i},get state(){return{...r.state}}}}function IG(e){return e.addReducers({dateFacetSet:_n,configuration:fe,search:he}),!0}d();c();u();l();d();c();u();l();d();c();u();l();var qP={facetId:Ae,selection:new X({values:gi})},MP=xe("numericFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,qP),t(qn(e)),t(_h(e)),t(Fe())}),RQe=xe("numericFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,qP),t(Mn(e)),t(Dh(e)),t(Fe())});d();c();u();l();var TG={start:new re,end:new re,endInclusive:new de,state:new L({constrainTo:jh})},PG=new ve({facetId:xn,tabs:new X({options:{required:!1},values:{included:new ie({each:new L}),excluded:new ie({each:new L})}}),field:bn,generateAutomaticRanges:qg,filterFacetCount:wn,injectionDepth:Rn,numberOfValues:Wr,currentValues:new ie({each:new X({values:TG})}),sortCriteria:new L({constrainTo:Vh}),resultsMustMatch:new L({constrainTo:Dc}),rangeAlgorithm:new L({constrainTo:Lh})});function Qh(e,t){He(e,PG,t,"buildNumericFacet"),rh(t)}d();c();u();l();function qc(e){return{endInclusive:!1,state:"idle",...e}}function jP(e,t){if(!kG(e))throw K;qh(t.options,"buildNumericFacet");let r=e.dispatch,n=Ht(e,t.options),o=t.options.tabs??{},a=Qt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:a};Qh(e,i),r(Dn(i));let p=Mh(e,{facetId:n,getRequest:()=>e.state.numericFacetSet[n].request});return{...p,toggleSelect:f=>r(MP({facetId:n,selection:f})),toggleSingleSelect(f){f.state==="idle"&&r(nt(n)),this.toggleSelect(f)},get state(){return p.state}}}function kG(e){return e.addReducers({numericFacetSet:Or,facetOptions:wt,configuration:fe,search:he}),!0}function VP(e,t){if(!OG(e))throw K;let r=jP(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(W({legacy:bt(o()),next:$t()}))},sortBy(a){r.sortBy(a),n(W({legacy:Tn({facetId:o(),criterion:a})}))},toggleSelect:a=>{r.toggleSelect(a),n(W({legacy:Oh(o(),a),next:Nh(a)}))},get state(){return{...r.state}}}}function OG(e){return e.addReducers({numericFacetSet:Or,configuration:fe,search:he}),!0}d();c();u();l();d();c();u();l();function LP(e,t){if(!NG(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=Ht(e,t.options),i=t.options.tabs??{},p=Qt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:a,tabs:i,activeTab:p};Qh(e,f),n(Dn(f));let m=()=>un(e.state,a);return{...r,clear:()=>{n(uo({facetId:a,values:[]})),n(Fe())},setRange:g=>{let y={...g,state:"selected",numberOfResults:0,endInclusive:!0},x=uo({facetId:a,values:[y]});return x.error?!1:(n(x),n(Fe()),!0)},enable(){n(Gt(a))},disable(){n(rt(a))},get state(){let g=tn(o()),y=m(),x=LT(o(),a),v=x.length?x[0]:void 0;return{facetId:a,isLoading:g,range:v,enabled:y}}}}function NG(e){return e.addReducers({numericFacetSet:Or,facetOptions:wt,configuration:fe,search:he}),!0}function UP(e,t){if(!_G(e))throw K;let r=LP(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(W({legacy:bt(o()),next:$t()}))},setRange:a=>{let i=r.setRange(a);return i&&n(W({legacy:it({facetId:o(),facetValue:`${a.start}..${a.end}`}),next:gt()})),i},get state(){return{...r.state}}}}function _G(e){return e.addReducers({numericFacetSet:Or,configuration:fe,search:he}),!0}d();c();u();l();function QP(e,t){if(!DG(e))throw K;let{facetSearch:r,...n}=t.options.facet,o=Ht(e,n);e.dispatch(vn({...$u,...n,facetId:o}));let a=Ih(e,{options:{...r,facetId:o},executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:Vn,select:p=>{e.dispatch(Fe()),e.dispatch(W({legacy:it({facetId:o,facetValue:p.rawValue}),next:gt()}))},isForFieldSuggestions:!0});return{...oe(e),...a,updateText:p=>{a.updateText(p),a.search()},get state(){return a.state}}}function DG(e){return e.addReducers({categoryFacetSet:Cn,configuration:fe,categoryFacetSearchSet:Oc,search:he}),!0}d();c();u();l();function BP(e,t){if(!qG(e))throw K;let{facetSearch:r,allowedValues:n,...o}=t.options.facet,a=Ht(e,o);e.dispatch(Fn({...Hu,...o,facetId:a,...(n&&{allowedValues:{type:"simple",values:n}})}));let i=Ph(e,{options:{...r,facetId:a},select:f=>{e.dispatch(Fe()),e.dispatch(W({legacy:it({facetId:a,facetValue:f.rawValue}),next:gt()}))},exclude:f=>{e.dispatch(Fe()),e.dispatch(W({legacy:fr({facetId:a,facetValue:f.rawValue}),next:so()}))},isForFieldSuggestions:!0,executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:Vn});return{...oe(e),...i,updateText:f=>{i.updateText(f),i.search()},get state(){return i.state}}}function qG(e){return e.addReducers({facetSet:kr,configuration:fe,facetSearchSet:_c,search:he}),!0}d();c();u();l();d();c();u();l();var cC={collectionField:new L({emptyAllowed:!1,required:!1}),parentField:new L({emptyAllowed:!1,required:!1}),childField:new L({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new re({min:0,required:!1})},Xo=P("folding/register",e=>O(e,cC)),Zo=xe("folding/loadCollection",/*#__PURE__*/function(){var _ref74=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let a=t(),i=a.configuration.analytics.analyticsMode==="legacy"?yield Po(a):bs(a,o),p=yield n.search({...i,q:MG(a),enableQuerySyntax:!0,cq:`@${a.folding.fields.collection}="${e}"`,filterField:a.folding.fields.collection,childField:a.folding.fields.parent,parentField:a.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return At(p)?r(p.error):{collectionId:e,results:p.success.results,searchUid:p.success.searchUid,rootResult:a.folding.collections[e].result}});return function(_x167,_x168){return _ref74.apply(this,arguments)}}());function MG(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}d();c();u();l();var jG=e=>J("analytics/folding/showMore",(t,r)=>(Zt(e),t.makeShowMoreFoldedResults(pt(e,r),Ke(e)))),VG=()=>J("analytics/folding/showLess",e=>e.makeShowLessFoldedResults()),GP={logShowMoreFoldedResults:jG,logShowLessFoldedResults:VG};d();c();u();l();d();c();u();l();d();c();u();l();var Bh=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});function LG(e,t){return e.raw[t.collection]}function lC(e,t){return e.raw[t.parent]}function Ju(e,t){let r=e.raw[t.child];return gd(r)?r[0]:r}function UG(e,t){return(e||t)!==void 0&&e===t}function HP(e,t,r,n=[]){let o=Ju(e,r);return o?n.indexOf(o)!==-1?[]:t.filter(a=>{let i=Ju(a,r)===Ju(e,r);return lC(a,r)===o&&!i}).map(a=>{let i={...a,searchUid:e.searchUid};return{result:i,children:HP(i,t,r,[...n,o])}}):[]}function QG(e,t){return e.find(r=>{let n=lC(r,t)===void 0,o=UG(lC(r,t),Ju(r,t));return n||o})}function zP(e){return e.parentResult?zP(e.parentResult):e}function BG(e,t,r,n){let o=Rp(e),i={...(n??QG(o,t)??zP(e)),searchUid:r},p=HP(i,o,t);return{result:i,children:p,moreResultsAvailable:e.totalNumberOfChildResults>p.length+1,isLoadingMoreResults:!1}}function Gh(e,t,r,n){let o={};return e.forEach(a=>{let i=LG(a,t);i&&(!Ju(a,t)&&!a.parentResult||(o[i]=BG(a,t,r,n)))}),o}function $P(e,t){if(!e.collections[t])throw new Error(`Missing collection ${t} from ${Object.keys(e.collections)}: Folding most probably in an invalid state...`);return e.collections[t]}var $h=ae(Bh(),e=>e.addCase(W.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?Gh(r.response.results,t.fields,r.response.searchUid):{}}).addCase(Ut.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?Gh(r.response.results,t.fields,r.response.searchUid):{}}).addCase(Rr.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?{...t.collections,...Gh(r.response.results,t.fields,r.response.searchUid)}:{}}).addCase(Xo,(t,{payload:r})=>t.enabled?t:{enabled:!0,collections:{},fields:{collection:r.collectionField??t.fields.collection,parent:r.parentField??t.fields.parent,child:r.childField??t.fields.child},filterFieldRange:r.numberOfFoldedResults??t.filterFieldRange}).addCase(Zo.pending,(t,{meta:r})=>{let n=r.arg;$P(t,n).isLoadingMoreResults=!0}).addCase(Zo.rejected,(t,{meta:r})=>{let n=r.arg;$P(t,n).isLoadingMoreResults=!1}).addCase(Zo.fulfilled,(t,{payload:{collectionId:r,results:n,rootResult:o,searchUid:a}})=>{let i=Gh(n,t.fields,a,o);if(!i||!i[r])throw new Error(`Unable to create collection ${r} from received results: ${JSON.stringify(n)}. Folding most probably in an invalid state... `);t.collections[r]=i[r],t.collections[r].moreResultsAvailable=!1}));d();c();u();l();d();c();u();l();var Xu={id:z},Mc=P("querySuggest/register",e=>O(e,{...Xu,count:new re({min:0})})),WP=P("querySuggest/unregister",e=>O(e,Xu)),Ln=P("querySuggest/selectSuggestion",e=>O(e,{...Xu,expression:Ge})),ea=P("querySuggest/clear",e=>O(e,Xu)),ta=xe("querySuggest/fetch",/*#__PURE__*/function(){var _ref75=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,validatePayload:o,navigatorContext:a}}){o(e,Xu);let i=e.id,p=yield GG(i,t(),a),f=yield n.querySuggest(p);return At(f)?r(f.error):{id:i,q:p.q,...f.success}});return function(_x169,_x170){return _ref75.apply(this,arguments)}}()),GG=/*#__PURE__*/function(){var _ref76=_asyncToGenerator(function*(e,t,r){return{accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,url:t.configuration.search.apiBaseUrl??vt(t.configuration.organizationId,t.configuration.environment),count:t.querySuggest[e].count,q:t.querySet[e],locale:t.configuration.search.locale,timezone:t.configuration.search.timezone,actionsHistory:t.configuration.analytics.enabled?_t.getInstance().getHistory():[],...(t.context&&{context:t.context.contextValues}),...(t.pipeline&&{pipeline:t.pipeline}),...(t.searchHub&&{searchHub:t.searchHub}),tab:t.configuration.analytics.originLevel2,...(t.configuration.analytics.enabled&&{...(t.configuration.analytics.enabled&&t.configuration.analytics.analyticsMode==="legacy"?yield ws(t.configuration.analytics):Qr(t.configuration.analytics,r))}),...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")})}});return function GG(_x171,_x172,_x173){return _ref76.apply(this,arguments)}}();var Ft=ae(dt(),e=>e.addCase(Lt,(t,r)=>({...t,...r.payload})).addCase(xr,(t,r)=>{t.q=r.payload}).addCase(Ln,(t,r)=>{t.q=r.payload.expression}).addCase(qe.fulfilled,(t,r)=>r.payload?.query??t).addCase(Me,(t,r)=>{t.q=r.payload.q??t.q,t.enableQuerySyntax=r.payload.enableQuerySyntax??t.enableQuerySyntax}));d();c();u();l();d();c();u();l();var ra=P("fields/registerFieldsToInclude",e=>O(e,Ed)),jc=P("fields/fetchall/enable"),xi=P("fields/fetchall/disable"),Vc=xe("fields/fetchDescription",/*#__PURE__*/function(){var _ref77=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:a,environment:i,organizationId:p}=o.configuration,{apiBaseUrl:f}=o.configuration.search,m=yield t.apiClient.fieldDescriptions({accessToken:a,organizationId:p,url:f??vt(p,i)});return At(m)?n(m.error):m.success.fields});return function(_x174,_x175){return _ref77.apply(this,arguments)}}());d();c();u();l();d();c();u();l();var Hh=["author","language","urihash","objecttype","collection","source","permanentid"],uC=[...Hh,"date","filetype","parents"],KP=[...uC,"ec_price","ec_name","ec_description","ec_brand","ec_category","ec_item_group_id","ec_shortdesc","ec_thumbnails","ec_images","ec_promo_price","ec_in_stock","ec_rating"],YP=()=>({fieldsToInclude:Hh,fetchAllFields:!1,fieldsDescription:[]});var na=ae(YP(),e=>e.addCase(ra,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(jc,t=>{t.fetchAllFields=!0}).addCase(xi,t=>{t.fetchAllFields=!1}).addCase(Vc.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(Xo,(t,{payload:r})=>{let n=Bh().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));d();c();u();l();function Lc(e){if(!$G(e))throw K;let t=oe(e),r=()=>e.state;return{...t,get state(){let n=r();return{hasError:n.search.error!==null,isLoading:n.search.isLoading,hasResults:!!n.search.results.length,firstSearchExecuted:gu(n)}}}}function $G(e){return e.addReducers({search:he}),!0}var HG=new ve({fieldsToInclude:new ie({required:!1,each:new L({required:!0,emptyAllowed:!1})})});function zh(e,t){if(!zG(e))throw K;let r=oe(e),n=Lc(e),{dispatch:o}=e,a=()=>e.state,i=He(e,HG,t?.options,"buildCoreResultList");i.fieldsToInclude&&o(ra(i.fieldsToInclude));let p=()=>e.state.search.results.length<e.state.search.response.totalCountFiltered,f=0,m=0,g=5,y=200,x=!1;return{...r,get state(){let C=a();return{...n.state,results:C.search.results,moreResultsAvailable:p(),searchResponseId:C.search.searchResponseId}},fetchMoreResults:function(){var _ref78=_asyncToGenerator(function*(){if(e.state.search.isLoading)return;if(!p()){e.logger.info("No more results are available for the result list to fetch.");return}if(Date.now()-f<y){if(m++,m>=g){f=Date.now(),!x&&e.logger.error(`The result list method "fetchMoreResults" execution prevented because it has been triggered consecutively ${g} times, with little delay. Please verify the conditions under which the function is called.`),x=!0;return}}else m=0;x=!1,t?.fetchMoreResultsActionCreator&&(yield o(t?.fetchMoreResultsActionCreator()),f=Date.now())});return function fetchMoreResults(){return _ref78.apply(this,arguments)}}()}}function zG(e){return e.addReducers({search:he,configuration:fe,fields:na}),!0}var WG=new ve(cC);function JP(e,t,r){if(!KG(e))throw K;let n=zh(e,t),{dispatch:o}=e,a=()=>e.state,i=t.options?.folding?He(e,WG,t.options.folding,"buildFoldedResultList"):{};return o(Xo({...i})),{...n,loadCollection:p=>{o(t.loadCollectionActionCreator(p.result.raw[e.state.folding.fields.collection])),o(r.logShowMoreFoldedResults(p.result))},logShowMoreFoldedResults:p=>{o(r.logShowMoreFoldedResults(p))},logShowLessFoldedResults:()=>{o(r.logShowLessFoldedResults())},findResultById(p){return dC(this.state.results,f=>f.result.uniqueId===p.result.uniqueId)},findResultByCollection(p){return dC(this.state.results,f=>f.result.raw.foldingcollection===p.result.raw.foldingcollection)},get state(){let p=a();return{...n.state,results:n.state.results.map(f=>{let m=f.raw[p.folding.fields.collection];return!m||!p.folding.collections[m]?{result:f,moreResultsAvailable:!1,isLoadingMoreResults:!1,children:[]}:p.folding.collections[m]})}}}}function KG(e){return e.addReducers({search:he,configuration:Df,folding:$h,query:Ft}),!0}function dC(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(t(n))return n;if(n.children.length){let o=dC(n.children,t);if(o)return o}}return null}function XP(e,t={}){let r=JP(e,{...t,loadCollectionActionCreator:Zo,fetchMoreResultsActionCreator:Rr},GP);return{...r,get state(){return r.state}}}d();c();u();l();d();c();u();l();d();c();u();l();d();c();u();l();function Uc(e){let t=new Set;return e.filter(r=>{let n=!t.has(r.uri);return n&&t.add(r.uri),n})}var Qc=ae(Wv(),e=>e.addCase(js,(t,{payload:r})=>{t.isVisible=r}).addCase(Us,(t,{payload:r})=>{t.isEnabled=r}).addCase(xf,(t,{payload:r})=>{t.id=r.id}).addCase(Oa,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,delete t.error;let n=r.textDelta,o=!!t.answer?.trim(),a=n.trim().length>0;if(o){t.answer+=n;return}t.answer=a?n:void 0}).addCase(Na,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.citations=Uc([...t.citations,...r.citations]),delete t.error}).addCase(_a,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!1,t.error={...r,isRetryable:r.code===Xy},t.citations=[],delete t.answer}).addCase(Sf,t=>{t.liked=!0,t.disliked=!1}).addCase(vf,t=>{t.liked=!1,t.disliked=!0}).addCase(Af,t=>{t.feedbackModalOpen=!0}).addCase(bf,t=>{t.feedbackModalOpen=!1}).addCase(Qs,t=>{t.feedbackSubmitted=!0}).addCase(dr,t=>({...Wv(),...(t.answerConfigurationId?{answerConfigurationId:t.answerConfigurationId}:{}),responseFormat:t.responseFormat,fieldsToIncludeInCitations:t.fieldsToIncludeInCitations,isVisible:t.isVisible,id:t.id,answerGenerationMode:t.answerGenerationMode})).addCase(dn,(t,{payload:r})=>{t.isLoading=r}).addCase(ka,(t,{payload:r})=>{t.isStreaming=r}).addCase(Da,(t,{payload:r})=>{t.answerContentFormat=r}).addCase(wf,(t,{payload:r})=>{t.responseFormat=r}).addCase(Ff,(t,r)=>{t.fieldsToIncludeInCitations=[...new Set(t.fieldsToIncludeInCitations.concat(r.payload))]}).addCase(bu,(t,{payload:r})=>{t.isAnswerGenerated=r}).addCase(xu,t=>{t.expanded=!0}).addCase(Cf,t=>{t.expanded=!1}).addCase(Rf,(t,{payload:r})=>{t.answerConfigurationId=r}).addCase(qa,(t,{payload:r})=>{t.cannotAnswer=r}).addCase(Yv,(t,{payload:r})=>{t.answerApiQueryParams=r}).addCase(Vs,(t,{payload:r})=>{t.answerId=r}).addCase(Ls,(t,{payload:r})=>{t.answerGenerationMode=r}).addCase(Ef,(t,{payload:r})=>{t.generationSteps.push({name:r.name,status:"active",startedAt:r.startedAt})}).addCase(If,(t,{payload:r})=>{let n=t.generationSteps.findLast(o=>o.name===r.name&&o.status==="active");n&&(n.status="completed",n.finishedAt=r.finishedAt)}).addCase(Tf,(t,{payload:r})=>{let{toolCallName:n,toolCallId:o,startedAt:a}=r,i=t.generationSteps.findLast(p=>p.status==="active");i&&(i.toolCalls=i.toolCalls||[],i.toolCalls.push({toolCallName:n,toolCallId:o,startedAt:a,status:"active"}))}).addCase(Bs,(t,{payload:r})=>{let{toolCallId:n,args:o,type:a}=r,p=t.generationSteps.findLast(f=>f.status==="active")?.toolCalls?.find(f=>f.toolCallId===n);p&&(p.toolCallArgs=o,p.type=a==="search"?"search":"generic")}).addCase(Pf,(t,{payload:r})=>{let{toolCallId:n,finishedAt:o}=r,i=t.generationSteps.findLast(p=>p.status==="active")?.toolCalls?.find(p=>p.toolCallId===n);i&&(i.finishedAt=o,i.status="completed")}));d();c();u();l();function Bc(e,t,r={}){if(!YG(e))throw K;let{dispatch:n}=e,o=oe(e),a=()=>e.state,i=r.initialState?.isVisible;i!==void 0&&n(js(i));let p=r.initialState?.isEnabled;p!==void 0&&n(Us(p));let f=r.initialState?.responseFormat;f&&n(wf(f));let m=r.fieldsToIncludeInCitations;return m&&n(Ff(m)),r.initialState?.expanded&&n(xu()),{...o,get state(){let y=a().generatedAnswer;return{...y,error:si(y.error)}},like(){this.state.liked||(n(Sf()),n(t.logLikeGeneratedAnswer(this.state.answerId)))},dislike(){this.state.disliked||(n(vf()),n(t.logDislikeGeneratedAnswer(this.state.answerId)))},openFeedbackModal(){n(Af())},closeFeedbackModal(){n(bf())},sendFeedback(y){n(t.logGeneratedAnswerFeedback(y)),n(Qs())},logCitationClick(y,x){n(t.logOpenGeneratedAnswerSource(y,x))},logCitationHover(y,x,v){n(t.logHoverCitation(y,x,v))},show(){this.state.isVisible||(n(js(!0)),n(t.logGeneratedAnswerShowAnswers()))},hide(){this.state.isVisible&&(n(js(!1)),n(t.logGeneratedAnswerHideAnswers()))},expand(){this.state.expanded||(n(xu()),n(t.logGeneratedAnswerExpand()))},collapse(){this.state.expanded&&(n(Cf()),n(t.logGeneratedAnswerCollapse()))},enable(){this.state.isEnabled||n(Us(!0))},disable(){this.state.isEnabled&&n(Us(!1))},logCopyToClipboard(y){n(t.logCopyGeneratedAnswer(y))},retry(){}}}function YG(e){return e.addReducers({generatedAnswer:Qc}),!0}var zt={engines:{},setAbortControllerRef:(e,t)=>{zt.engines[t].abortController=e},getIsStreamInProgress:e=>!zt.engines[e].abortController||zt.engines[e].abortController?.signal.aborted?(zt.engines[e].abortController=void 0,!1):!0,subscribeToSearchRequests:e=>{let t=()=>{let r=e.state,n=r.search.requestId,o=r.search.extendedResults.generativeQuestionAnsweringId,a=r.generatedAnswer.id;if(zt.engines[a].lastRequestId!==n){if(zt.engines[a].lastRequestId=n,zt.engines[a].abortController?.abort(),r.generatedAnswer.isEnabled===!1)return;e.dispatch(dr())}if(!zt.getIsStreamInProgress(a)&&o&&o!==zt.engines[a].lastStreamId){if(zt.engines[a].lastStreamId=o,r.generatedAnswer.isEnabled===!1)return;e.dispatch(_F({setAbortControllerRef:p=>zt.setAbortControllerRef(p,a)}))}};return e.subscribe(t)}};function ZP(e,t,r={}){if(!JG(e))throw K;let n=Bc(e,t,r),o=()=>e.state;if(e.state.generatedAnswer.id&&!zt.engines[e.state.generatedAnswer.id]&&(zt.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:e.state.search.requestId,lastStreamId:e.state.search.extendedResults.generativeQuestionAnsweringId??""}),!e.state.generatedAnswer.id){let i=go("genQA-",12);e.dispatch(xf({id:i}))}zt.engines[e.state.generatedAnswer.id]||(zt.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:"",lastStreamId:""}),zt.subscribeToSearchRequests(e);let a=i=>"executeFirstSearchAfterStandaloneSearchBoxRedirect"in i;return{...n,get state(){return o().generatedAnswer},retry(){a(e)&&e.dispatch(W({legacy:t.logRetryGeneratedAnswer()}))}}}function JG(e){return e.addReducers({generatedAnswer:Qc}),!0}d();c();u();l();d();c();u();l();var ek=Nf.injectEndpoints({endpoints:e=>({post:e.query({query:t=>({url:"/evaluations",method:"POST",body:t})})})});var Wh=e=>e==="yes"?!0:e==="no"?!1:null,XG=({answerApiState:e,feedback:t,query:r})=>({additionalNotes:t.details??null,answer:{text:e.answer,responseId:e.answerId,format:e.contentFormat??"text/plain"},correctAnswerUrl:t.documentUrl??null,details:{correctTopic:Wh(t.correctTopic),documented:Wh(t.documented),hallucinationFree:Wh(t.hallucinationFree),readable:Wh(t.readable)},helpful:t.helpful,question:r}),ZG=e=>{let t="",r=()=>{let n=e.state,o=SF(n),a=o.requestId;if(a!==t){if(t=a,e.dispatch(dr()),n.generatedAnswer.isEnabled===!1)return;o.q?.length>0&&(e.dispatch(Ls("automatic")),e.dispatch(kf()))}};e.subscribe(r)};function tk(e,t,r={}){if(!e2(e))throw K;Ho(e.state.configuration.analytics.analyticsMode);let{...n}=Bc(e,t,r),o=()=>e.state;return e.dispatch(Rf(r.answerConfigurationId)),ZG(e),{...n,get state(){let a=Jv(e.state).data,i=o().generatedAnswer;return{...i,answer:a?.answer,citations:Uc(a?.citations??[]),error:si({message:a?.error?.message,code:a?.error?.code}),isLoading:a?.isLoading??!1,isStreaming:a?.isStreaming??!1,answerContentFormat:a?.contentFormat??"text/plain",isAnswerGenerated:a?.generated??!1,cannotAnswer:i.cannotAnswer||a?.generated===!1&&!a?.isLoading&&!a?.isStreaming}},retry(){let a=ff(o());e.dispatch(Of(a??Ta))},reset(){e.dispatch(dr())},sendFeedback(a){return _asyncToGenerator(function*(){e.dispatch(t.logGeneratedAnswerFeedback(a));let i=XG({query:o().query.q,feedback:a,answerApiState:Jv(e.state).data});e.dispatch(ek.endpoints.post.initiate(i)),e.dispatch(Qs())})()}}}function e2(e){return e.addReducers({[Ma.reducerPath]:Ma.reducer,query:Ft}),!0}d();c();u();l();d();c();u();l();var pC=class extends ig{requestInit(t){let{q:r,analytics:n,conversationId:o,conversationToken:a,accessToken:i}=t.forwardedProps||{};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${i}`,"Content-Type":"application/json",Accept:"text/event-stream, application/json"},body:JSON.stringify({q:r,analytics:n,conversationId:o,conversationToken:a}),signal:this.abortController.signal}}},rk=(e,t,r)=>new pC({url:`${sg(e,t,r)}/follow-up`});d();c();u();l();var nk=e=>{let t="",r=!1;return{onRunStartedEvent:({event:n})=>{t=n.runId,r=!1,e(Lu(t)),e(mg({answerId:t,isLoading:!1})),e(gg({answerId:t,isStreaming:!0}))},onStepStartedEvent:({event:n})=>{e(wg({name:n.stepName,startedAt:n.timestamp??Date.now(),answerId:t}))},onStepFinishedEvent:({event:n})=>{e(Rg({name:n.stepName,finishedAt:n.timestamp??Date.now(),answerId:t}))},onToolCallStartEvent:({event:n})=>{let{toolCallName:o,toolCallId:a,timestamp:i}=n;e(Fg({answerId:t,toolCallId:a,toolCallName:o,startedAt:i??Date.now()}))},onToolCallEndEvent:({event:n})=>{let{toolCallId:o,timestamp:a}=n;e(Eg({answerId:t,toolCallId:o,finishedAt:a??Date.now()}))},onToolCallArgsEvent:({event:n})=>{let{toolCallId:o,delta:a}=n;try{let i=JSON.parse(a);typeof i?.q=="string"?e(lc({answerId:t,toolCallId:o,args:i,type:"search"})):e(lc({answerId:t,toolCallId:o,args:{raw:a},type:"generic"}))}catch{console.warn(`Failed to parse tool call args delta as JSON. Using raw string instead. Delta: ${a}`),e(lc({answerId:t,toolCallId:o,args:{raw:a},type:"generic"}))}},onTextMessageContentEvent:({event:n})=>{n.delta.length>0&&(r=!0),e(hg({textDelta:n.delta,answerId:t}))},onCustomEvent:({event:n})=>{let{name:o,value:a}=n;switch(o){case"header":{a?.contentFormat&&e(fg({contentFormat:a.contentFormat,answerId:t}));return}case"citations":{e(yg({citations:a.citations,answerId:t}));return}}},onRunErrorEvent:({input:n,event:o})=>{t||(t=n.runId,e(Lu(n.runId)));let a=Ig(o.code);e(vg({message:o.message,code:a,answerId:t})),t=""},onRunFinishedEvent:({event:n})=>{let o=n.result?.completionReason==="ANSWERED",a=o?!r:void 0;e(Sg({cannotAnswer:!o,answerId:t})),e(cu(o,t,a)),e(To(t)),t="",r=!1}}};d();c();u();l();d();c();u();l();function ok(){return{conversationId:"",conversationToken:"",isEnabled:!1,followUpAnswers:[]}}var ak=e=>({question:e,isLoading:!0,isStreaming:!1,citations:[],liked:!1,disliked:!1,feedbackSubmitted:!1,cannotAnswer:!1,isActive:!0,generationSteps:[]});function fC(e){return e.followUpAnswers.find(t=>t.isActive)}function Xt(e,t){return e.followUpAnswers.find(r=>r.answerId===t)}var ik=ae(ok(),e=>e.addCase(cg,(t,{payload:r})=>{t.isEnabled=r}).addCase(lg,(t,{payload:r})=>{t.conversationId=r}).addCase(ug,(t,{payload:r})=>{t.conversationToken=r}).addCase(dg,t=>{t.conversationToken=""}).addCase(pg,(t,{payload:r})=>{let n=fC(t);n&&(n.isActive=!1),t.followUpAnswers.push(ak(r.question))}).addCase(Lu,(t,{payload:r})=>{let n=fC(t);!n||n.answerId||(n.answerId=r)}).addCase(fg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.answerContentFormat=r.contentFormat)}).addCase(mg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.isLoading=r.isLoading)}).addCase(gg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.isStreaming=r.isStreaming)}).addCase(hg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.answer||(n.answer=""),n.answer+=r.textDelta,delete n.error)}).addCase(yg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.citations=Uc([...n.citations,...r.citations]),delete n.error)}).addCase(Sg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.isActive=!1,n.cannotAnswer=!!r.cannotAnswer)}).addCase(vg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message,code:r.code},n.citations=[],delete n.answer)}).addCase(Ag,(t,{payload:r})=>{let n=fC(t);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message},n.citations=[],delete n.answer)}).addCase(Cg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.liked=!0,n.disliked=!1)}).addCase(xg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.liked=!1,n.disliked=!0)}).addCase(LI,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.feedbackSubmitted=!0)}).addCase(wg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.generationSteps=[...n.generationSteps,{name:r.name,status:"active",startedAt:r.startedAt}])}).addCase(Rg,(t,{payload:r})=>{let n=Xt(t,r.answerId);if(!n)return;let o=n.generationSteps.findLast(a=>a.name===r.name&&a.status==="active");o&&(o.status="completed",o.finishedAt=r.finishedAt)}).addCase(bg,t=>{t.followUpAnswers=[],t.conversationId="",t.conversationToken="",t.isEnabled=!1}).addCase(Fg,(t,{payload:r})=>{let{toolCallName:n,toolCallId:o,startedAt:a,answerId:i}=r,p=Xt(t,i);if(!p)return;let f=p.generationSteps.findLast(m=>m.status==="active");f&&(f.toolCalls=f.toolCalls||[],f.toolCalls.push({toolCallName:n,toolCallId:o,startedAt:a,status:"active"}))}).addCase(lc,(t,{payload:r})=>{let{toolCallId:n,args:o,answerId:a,type:i}=r,p=Xt(t,a);if(!p)return;let m=p.generationSteps.findLast(g=>g.status==="active")?.toolCalls?.find(g=>g.toolCallId===n);m&&(m.toolCallArgs=o,m.type=i==="search"?"search":"generic")}).addCase(Eg,(t,{payload:r})=>{let{toolCallId:n,finishedAt:o,answerId:a}=r,i=Xt(t,a);if(!i)return;let f=i.generationSteps.findLast(m=>m.status==="active")?.toolCalls?.find(m=>m.toolCallId===n);f&&(f.finishedAt=o,f.status="completed")}));function sk(e,t,r){if(!r.agentId||r.agentId.trim()==="")throw new Error("agentId is required for GeneratedAnswerWithFollowUps");if(!t2(e))throw K;let n=Bc(e,t,r),o=()=>e.state;e.dispatch(Op(r.agentId));let a=gp(o()),i=mp(o()),p=hp(o()),f=rk(r.agentId,a,p),m=nk(e.dispatch),g=Tg();return{...n,get state(){let y=o().followUpAnswers,x=o().generatedAnswer;return{...x,error:si(x.error),followUpAnswers:{...y,followUpAnswers:y.followUpAnswers.map(v=>({...v,error:si(v.error)}))}}},retry(){g.run(e.state,e.dispatch,()=>e.navigatorContext)},like(y){if(!y||this.state.answerId===y){n.like();return}let x=this.state.followUpAnswers.followUpAnswers.find(v=>v.answerId===y);if(!x){console.warn(`No follow-up answer found with ID ${y}. Cannot like.`);return}x.liked||(e.dispatch(Cg({answerId:y})),e.dispatch(t.logLikeGeneratedAnswer(y)))},dislike(y){if(!y||this.state.answerId===y){n.dislike();return}let x=this.state.followUpAnswers.followUpAnswers.find(v=>v.answerId===y);if(!x){console.warn(`No follow-up answer found with ID ${y}. Cannot dislike.`);return}x.disliked||(e.dispatch(xg({answerId:y})),e.dispatch(t.logDislikeGeneratedAnswer(y)))},logCopyToClipboard(y){if(!y||this.state.answerId===y){n.logCopyToClipboard();return}e.dispatch(t.logCopyGeneratedAnswer(y))},logCitationClick(y,x){let v=Ue(e.state);!x||x===v?e.dispatch(t.logOpenGeneratedAnswerSource(y,x)):t.logOpenGeneratedAnswerFollowUpSource&&e.dispatch(t.logOpenGeneratedAnswerFollowUpSource(y,x))},logCitationHover(y,x,v){if(!v||this.state.answerId===v){n.logCitationHover(y,x);return}e.dispatch(t.logHoverCitation(y,x,v))},askFollowUp(y){var _this37=this;return _asyncToGenerator(function*(){if(!_this37.state.followUpAnswers.isEnabled||!y||y.trim()==="")return;let x=_this37.state.followUpAnswers.conversationId,v=_this37.state.followUpAnswers.conversationToken;if(!x){console.warn("Missing conversationId when generating a follow-up answer. The generateFollowUpAnswer action requires an existing conversation.");return}if(!v){console.warn("Missing conversationToken when generating a follow-up answer. The generateFollowUpAnswer action requires an existing conversation.");return}f.abortRun(),e.dispatch(pg({question:y}));let C=Qr(o().configuration.analytics,e.navigatorContext);try{yield f.runAgent({forwardedProps:{q:y,analytics:C.analytics,conversationId:x,conversationToken:v,accessToken:i}},m)}catch(b){e.dispatch(Ag({message:"An error occurred while starting the follow-up answer generation."})),console.error("Error running the follow-up agent:",b)}})()}}}function t2(e){return e.addReducers({followUpAnswers:ik}),!0}function ck(e,t={}){Ho(e.state.configuration.analytics.analyticsMode);let r;return t.agentId&&t.agentId.trim()!==""?r=sk(e,Cr,{...t,agentId:t.agentId}):t.answerConfigurationId&&t.answerConfigurationId.trim()!==""?r=tk(e,Cr,t):r=ZP(e,Cr,t),{...r,get state(){return r.state}}}d();c();u();l();d();c();u();l();d();c();u();l();function Wt(e,t,r){if(!r2(e))throw K;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},a;return{select:Sd(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){a=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){a&&clearTimeout(a)}}}function r2(e){return e.addReducers({configuration:fe}),!0}function lk(e,t,r){let n=!1,o=()=>{n||(n=!0,e.dispatch(t.logCitationOpen(r.options.citation.id,r.options.answerId)))};return Wt(e,r,()=>{o()})}d();c();u();l();function uk(e){return{logCitationOpen(t,r){let n=Ue(e());return r!==void 0&&n!==void 0&&r!==n?lv(t,r):r!==void 0?Dp(t,r):Dp(t)}}}function dk(e,t){return lk(e,uk(()=>e.state),t)}d();c();u();l();d();c();u();l();function pk(e,t,r){let n=!1;return Wt(e,r,()=>{n||(n=!0,e.dispatch(t.logGeneratedAnswerOpenInlineLink(r.options.link,r.options.answerId)))})}function fk(e,t){return pk(e,Cr,t)}d();c();u();l();d();c();u();l();var Gc=ae(Wp(),e=>{e.addCase(W.fulfilled,n2).addCase(qe.fulfilled,(t,r)=>r.payload?.facetOrder??t)});function n2(e,t){return t.payload.response.facets.map(r=>r.facetId)}d();c();u();l();var Kh=()=>J("history/analytics/forward",e=>e.makeSearchEvent("historyForward")),Yh=()=>J("history/analytics/backward",e=>e.makeSearchEvent("historyBackward")),Jh=()=>J("history/analytics/noresultsback",e=>e.makeNoResultsBack());d();c();u();l();d();c();u();l();var mk=e=>({past:[],present:e,future:[]}),o2=e=>{let{past:t,present:r,future:n}=e;if(!r||t.length===0)return e;let o=t[t.length-1];return{past:t.slice(0,t.length-1),present:o,future:[r,...n]}},a2=e=>{let{past:t,present:r,future:n}=e;if(!r||n.length===0)return e;let o=n[0],a=n.slice(1);return{past:[...t,r],present:o,future:a}},i2=e=>{let{action:t,state:r,reducer:n}=e,{past:o,present:a}=r,i=n(a,t);return a?a===i?r:{past:[...o,a].slice(-10),present:i,future:[]}:mk(i)},gk=e=>{let{actionTypes:t,reducer:r}=e,n=mk();return(o=n,a)=>{switch(a.type){case t.undo:return o2(o);case t.redo:return a2(o);case t.snapshot:return i2({state:o,reducer:r,action:a});default:return o}}};d();c();u();l();d();c();u();l();var{getOwnPropertyNames:s2,getOwnPropertySymbols:c2}=Object,{hasOwnProperty:l2}=Object.prototype;function mC(e,t){return function(n,o,a){return e(n,o,a)&&t(n,o,a)}}function Xh(e){return function(r,n,o){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,o);let{cache:a}=o,i=a.get(r),p=a.get(n);if(i&&p)return i===n&&p===r;a.set(r,n),a.set(n,r);let f=e(r,n,o);return a.delete(r),a.delete(n),f}}function hk(e){return s2(e).concat(c2(e))}var u2=Object.hasOwn||((e,t)=>l2.call(e,t)),d2="__v",p2="__o",f2="_owner",{getOwnPropertyDescriptor:yk,keys:Sk}=Object,bi=Object.is||function(t,r){return t===r?t!==0||1/t===1/r:t!==t&&r!==r};function m2(e,t){return e===t}function g2(e,t){return e.byteLength===t.byteLength&&Zh(new Uint8Array(e),new Uint8Array(t))}function h2(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-->0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function y2(e,t){return e.byteLength===t.byteLength&&Zh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function S2(e,t){return bi(e.getTime(),t.getTime())}function v2(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function vk(e,t,r){let n=e.size;if(n!==t.size)return!1;if(!n)return!0;let o=new Array(n),a=e.entries(),i,p,f=0;for(;(i=a.next())&&!i.done;){let m=t.entries(),g=!1,y=0;for(;(p=m.next())&&!p.done;){if(o[y]){y++;continue}let x=i.value,v=p.value;if(r.equals(x[0],v[0],f,y,e,t,r)&&r.equals(x[1],v[1],x[0],v[0],e,t,r)){g=o[y]=!0;break}y++}if(!g)return!1;f++}return!0}function A2(e,t,r){let n=Sk(e),o=n.length;if(Sk(t).length!==o)return!1;for(;o-->0;)if(!Ck(e,t,r,n[o]))return!1;return!0}function Zu(e,t,r){let n=hk(e),o=n.length;if(hk(t).length!==o)return!1;let a,i,p;for(;o-->0;)if(a=n[o],!Ck(e,t,r,a)||(i=yk(e,a),p=yk(t,a),(i||p)&&(!i||!p||i.configurable!==p.configurable||i.enumerable!==p.enumerable||i.writable!==p.writable)))return!1;return!0}function C2(e,t){return bi(e.valueOf(),t.valueOf())}function x2(e,t){return e.source===t.source&&e.flags===t.flags}function Ak(e,t,r){let n=e.size;if(n!==t.size)return!1;if(!n)return!0;let o=new Array(n),a=e.values(),i,p;for(;(i=a.next())&&!i.done;){let f=t.values(),m=!1,g=0;for(;(p=f.next())&&!p.done;){if(!o[g]&&r.equals(i.value,p.value,i.value,p.value,e,t,r)){m=o[g]=!0;break}g++}if(!m)return!1}return!0}function Zh(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-->0;)if(e[r]!==t[r])return!1;return!0}function b2(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function Ck(e,t,r,n){return(n===f2||n===p2||n===d2)&&(e.$$typeof||t.$$typeof)?!0:u2(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var w2=Object.prototype.toString;function R2(e){let t=T2(e),{areArraysEqual:r,areDatesEqual:n,areFunctionsEqual:o,areMapsEqual:a,areNumbersEqual:i,areObjectsEqual:p,areRegExpsEqual:f,areSetsEqual:m,getUnsupportedCustomComparator:g}=e;return function(x,v,C){if(x===v)return!0;if(x==null||v==null)return!1;let b=typeof x;if(b!==typeof v)return!1;if(b!=="object")return b==="number"||b==="bigint"?i(x,v,C):b==="function"?o(x,v,C):!1;let w=x.constructor;if(w!==v.constructor)return!1;if(w===Object)return p(x,v,C);if(w===Array)return r(x,v,C);if(w===Date)return n(x,v,C);if(w===RegExp)return f(x,v,C);if(w===Map)return a(x,v,C);if(w===Set)return m(x,v,C);if(w===Promise)return!1;if(Array.isArray(x))return r(x,v,C);let F=w2.call(x),I=t[F];if(I)return I(x,v,C);let E=g&&g(x,v,C,F);return E?E(x,v,C):!1}}function F2({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:g2,areArraysEqual:r?Zu:h2,areDataViewsEqual:y2,areDatesEqual:S2,areErrorsEqual:v2,areFunctionsEqual:m2,areMapsEqual:r?mC(vk,Zu):vk,areNumbersEqual:bi,areObjectsEqual:r?Zu:A2,arePrimitiveWrappersEqual:C2,areRegExpsEqual:x2,areSetsEqual:r?mC(Ak,Zu):Ak,areTypedArraysEqual:r?mC(Zh,Zu):Zh,areUrlsEqual:b2,getUnsupportedCustomComparator:void 0};if(t&&(n=Object.assign({},n,t(n))),e){let o=Xh(n.areArraysEqual),a=Xh(n.areMapsEqual),i=Xh(n.areObjectsEqual),p=Xh(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:i,areSetsEqual:p})}return n}function E2(e){return function(t,r,n,o,a,i,p){return e(t,r,p)}}function I2({circular:e,comparator:t,createState:r,equals:n,strict:o}){if(r)return function(p,f){let{cache:m=e?new WeakMap:void 0,meta:g}=r();return t(p,f,{cache:m,equals:n,meta:g,strict:o})};if(e)return function(p,f){return t(p,f,{cache:new WeakMap,equals:n,meta:void 0,strict:o})};let a={cache:void 0,equals:n,meta:void 0,strict:o};return function(p,f){return t(p,f,a)}}function T2({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:o,areFunctionsEqual:a,areMapsEqual:i,areNumbersEqual:p,areObjectsEqual:f,arePrimitiveWrappersEqual:m,areRegExpsEqual:g,areSetsEqual:y,areTypedArraysEqual:x,areUrlsEqual:v}){return{"[object Arguments]":f,"[object Array]":t,"[object ArrayBuffer]":e,"[object AsyncGeneratorFunction]":a,"[object BigInt]":p,"[object BigInt64Array]":x,"[object BigUint64Array]":x,"[object Boolean]":m,"[object DataView]":r,"[object Date]":n,"[object Error]":o,"[object Float16Array]":x,"[object Float32Array]":x,"[object Float64Array]":x,"[object Function]":a,"[object GeneratorFunction]":a,"[object Int8Array]":x,"[object Int16Array]":x,"[object Int32Array]":x,"[object Map]":i,"[object Number]":m,"[object Object]":(C,b,w)=>typeof C.then!="function"&&typeof b.then!="function"&&f(C,b,w),"[object RegExp]":g,"[object Set]":y,"[object String]":m,"[object URL]":v,"[object Uint8Array]":x,"[object Uint8ClampedArray]":x,"[object Uint16Array]":x,"[object Uint32Array]":x}}var gC=Un(),Sze=Un({strict:!0}),vze=Un({circular:!0}),Aze=Un({circular:!0,strict:!0}),Cze=Un({createInternalComparator:()=>bi}),xze=Un({strict:!0,createInternalComparator:()=>bi}),bze=Un({circular:!0,createInternalComparator:()=>bi}),wze=Un({circular:!0,createInternalComparator:()=>bi,strict:!0});function Un(e={}){let{circular:t=!1,createInternalComparator:r,createState:n,strict:o=!1}=e,a=F2(e),i=R2(a),p=r?r(i):E2(i);return I2({circular:t,comparator:i,createState:n,equals:p,strict:o})}function wi(e,t,r=(n,o)=>n===o){return e.length===t.length&&e.findIndex((n,o)=>!r(t[o],n))===-1}function P2(e,t){return e.length!==t.length?!1:e.every(r=>t.findIndex(n=>ed(r,n))!==-1)}var ed=Un({createCustomConfig:e=>({...e,areArraysEqual:P2})});var k2=ae(bR(),e=>{e.addCase(ur,(t,r)=>O2(t,r.payload)?void 0:r.payload)}),O2=(e,t)=>N2(e.context,t.context)&&_2(e.dictionaryFieldContext,t.dictionaryFieldContext)&&U2(e.advancedSearchQueries,t.advancedSearchQueries)&&D2(e.tabSet,t.tabSet)&&q2(e.staticFilterSet,t.staticFilterSet)&&hC(e.facetSet,t.facetSet)&&hC(e.dateFacetSet,t.dateFacetSet)&&hC(e.numericFacetSet,t.numericFacetSet)&&j2(e.automaticFacetSet,t.automaticFacetSet)&&M2(e.categoryFacetSet,t.categoryFacetSet)&&V2(e.pagination,t.pagination)&&L2(e.query,t.query)&&Q2(e,t)&&B2(e.pipeline,t.pipeline)&&G2(e.searchHub,t.searchHub)&&$2(e.facetOrder,t.facetOrder)&&H2(e.debug,t.debug),N2=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),_2=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),D2=(e,t)=>{let r=xk(e),n=xk(t);return r?.id===n?.id},xk=e=>Object.values(e).find(t=>t.isActive),q2=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=bk(e[r]),a=bk(n);if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},bk=e=>e.values.filter(t=>t.state!=="idle"),hC=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=e[r].request.currentValues.filter(i=>i.state!=="idle"),a=n.request.currentValues.filter(i=>i.state!=="idle");if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},M2=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=cr(e[r]?.request.currentValues).map(({value:i})=>i),a=cr(n?.request.currentValues).map(({value:i})=>i);if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},j2=(e,t)=>{for(let[r,n]of Object.entries(t.set)){if(!e.set[r])return!1;let o=e.set[r].response.values.filter(i=>i.state!=="idle"),a=n.response.values.filter(i=>i.state!=="idle");if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},V2=(e,t)=>e.firstResult===t.firstResult&&e.numberOfResults===t.numberOfResults,L2=(e,t)=>JSON.stringify(e)===JSON.stringify(t),U2=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Q2=(e,t)=>e.sortCriteria===t.sortCriteria,B2=(e,t)=>e===t,G2=(e,t)=>e===t,$2=(e,t)=>wi(e,t),H2=(e,t)=>e===t,ey=gk({actionTypes:{redo:dv.type,undo:uv.type,snapshot:ur.type},reducer:k2});function wk(e){if(!z2(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state,o=a=>a.past.length>0&&!pe(a.present);return{...t,subscribe(a){a();let i=JSON.stringify(n().history.present),p=()=>{let f=JSON.stringify(n().history.present);i!==f&&(i=f,a())};return e.subscribe(()=>p())},get state(){return n().history},back(){var _this38=this;return _asyncToGenerator(function*(){o(_this38.state)&&(yield r(lu()),r(W({legacy:Yh()})))})()},forward(){var _this39=this;return _asyncToGenerator(function*(){!_this39.state.future.length||!_this39.state.present||(yield r(qp()),r(W({legacy:Kh()})))})()},backOnNoResults(){var _this40=this;return _asyncToGenerator(function*(){o(_this40.state)&&(yield r(lu()),r(W({legacy:Jh()})))})()}}}function z2(e){return e.addReducers({history:ey,configuration:fe,facetOrder:Gc}),!0}d();c();u();l();d();c();u();l();var W2={results:new ie({required:!0,each:new X({values:Fp})}),maxLength:new re({required:!0,min:1,default:10})},$c=P("recentResults/registerRecentResults",e=>O(e,W2)),Nr=P("recentResults/pushRecentResult",e=>(Zt(e),{payload:e})),Hc=P("recentResults/clearRecentResults");function Rk(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(nR(t.options.result)))};return Wt(e,t,()=>{n(),e.dispatch(Nr(t.options.result))})}d();c();u();l();d();c();u();l();function ty(e){return e?e.expiresAt&&Date.now()>=e.expiresAt:!1}d();c();u();l();d();c();u();l();var Fk=(e,t)=>{let{id:r}=e;if(!t[r])return t[r]={q:"",cache:{}},t},Ek=(e,t)=>{let{q:r,id:n}=e;r&&(t[n].q=r)},Ik=(e,t)=>{let{id:r}=e;Object.entries(t[r].cache).forEach(([n,o])=>{ty(o)&&delete t[r].cache[n]})},Tk=(e,t,r)=>{for(let o in t)for(let a in t[o].cache)t[o].cache[a].isActive=!1;if(!yC(e,t)){K2(e,t,r);return}let n=yC(e,t);n.isLoading=!0,n.isActive=!0,n.error=null},Pk=(e,t,r)=>{let{id:n,q:o,searchUid:a,cacheTimeout:i,totalCountFiltered:p,duration:f}=e;t[n].cache[o]={...yC(e,t),...r,isActive:!0,searchUid:a,isLoading:!1,error:null,expiresAt:i?i+Date.now():0,totalCountFiltered:p,duration:f}},kk=(e,t)=>{let{id:r,q:n,error:o}=e;t[r].cache[n].error=o||null,t[r].cache[n].isLoading=!1,t[r].cache[n].isActive=!1},yC=(e,t)=>{let{q:r,id:n}=e;return t[n].cache[r]||null},K2=(e,t,r)=>{let{q:n,id:o}=e;t[o].cache[n]={isLoading:!0,error:null,expiresAt:0,isActive:!0,searchUid:"",totalCountFiltered:0,duration:0,...r}};d();c();u();l();function Ok(){return{}}var ry=ae(Ok(),e=>{e.addCase(hs,(t,r)=>{Fk(r.payload,t)}),e.addCase(sn,(t,r)=>{Ek(r.payload,t)}),e.addCase(ys,(t,r)=>{Ik(r.payload,t)}),e.addCase(Ps.pending,(t,r)=>{Tk(r.meta.arg,t,{results:[]})}),e.addCase(Ps.fulfilled,(t,r)=>{let n=r.payload.results.map(o=>({...o,searchUid:r.payload.searchUid}));Pk({...r.payload,...r.meta.arg},t,{results:n})}),e.addCase(Ps.rejected,(t,r)=>{kk(r.meta.arg,t)})});d();c();u();l();var Y2={searchBoxId:st,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re},Nk=new ve(Y2);function _k(e,t){if(!J2(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a={searchBoxId:t.options.searchBoxId||go("instant-results-"),cacheTimeout:t.options.cacheTimeout||6e4,maxResultsPerQuery:t.options.maxResultsPerQuery};He(e,Nk,a,"buildInstantResults");let i=a.searchBoxId;n(hs({id:i}));let p=()=>o().instantResults[i],f=y=>p().cache[y],m=()=>p().q,g=()=>{let y=f(m());return y?y.isLoading?[]:y.results:[]};return{...r,updateQuery(y){if(!y)return;let x=f(y);(!x||!x.isLoading&&(x.error||ty(x)))&&n(Ps({id:i,q:y,maxResultsPerQuery:a.maxResultsPerQuery,cacheTimeout:a.cacheTimeout})),n(sn({id:i,q:y}))},clearExpired(){n(ys({id:i}))},get state(){let y=m(),x=f(y);return{q:y,isLoading:x?.isLoading||!1,error:x?.error||null,results:g()}}}}function J2(e){return e.addReducers({instantResults:ry}),!0}d();c();u();l();d();c();u();l();d();c();u();l();d();c();u();l();var _r=ae(br(),e=>{e.addCase(Ss,(t,r)=>{let n=SC(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=td(n,o)}).addCase(vs,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(yt,t=>{t.firstResult=0}).addCase(As,(t,r)=>{let n=r.payload;t.firstResult=td(n,t.numberOfResults)}).addCase(cn,(t,r)=>{let n=r.payload;t.firstResult=td(n,t.numberOfResults)}).addCase(xs,t=>{let r=SC(t),n=Math.max(r-1,1);t.firstResult=td(n,t.numberOfResults)}).addCase(Cs,t=>{let r=SC(t),n=X2(t),o=Math.min(r+1,n);t.firstResult=td(o,t.numberOfResults)}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(Me,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(W.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(Ut.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(nt,t=>{Kt(t)}).addCase(On,t=>{Kt(t)}).addCase(In,t=>{Kt(t)}).addCase(Mn,t=>{Kt(t)}).addCase(mi,t=>{Kt(t)}).addCase(En,t=>{Kt(t)}).addCase(An,t=>{Kt(t)}).addCase(Wo,t=>{Kt(t)}).addCase(gc,t=>{Kt(t)}).addCase(kn,t=>{Kt(t)}).addCase(qn,t=>{Kt(t)}).addCase(ft,t=>{Kt(t)}).addCase(lo,t=>{Kt(t)}).addCase(uo,t=>{Kt(t)}).addCase(fi,t=>{Kt(t)}).addCase(Sn,t=>{Kt(t)})});function Kt(e){e.firstResult=br().firstResult}function SC(e){let{firstResult:t,numberOfResults:r}=e;return vC(t,r)}function X2(e){let{totalCountFiltered:t,numberOfResults:r}=e;return AC(t,r)}function td(e,t){return(e-1)*t}function vC(e,t){return Math.round(e/t)+1}function AC(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function Z2(e){return e.pagination.firstResult}function Dk(e){return e.pagination.numberOfResults}function e$(e){return e.pagination.totalCountFiltered}var mo=e=>{let t=Z2(e),r=Dk(e);return vC(t,r)},rd=e=>{let t=e$(e),r=Dk(e);return AC(t,r)},ny=(e,t)=>{let r=mo(e),n=rd(e),o=t$(r,t);return o=r$(o),o=n$(o,n),o$(o)};function t$(e,t){let r=t%2===0,n=Math.floor(t/2),o=r?n-1:n,a=e-n,i=e+o;return{start:a,end:i}}function r$(e){let t=Math.max(1-e.start,0),r=e.start+t,n=e.end+t;return{start:r,end:n}}function n$(e,t){let r=Math.max(e.end-t,0),n=Math.max(e.start-r,1),o=e.end-r;return{start:n,end:o}}function o$(e){let t=[];for(let r=e.start;r<=e.end;++r)t.push(r);return t}var Wc=()=>J("analytics/pager/resize",(e,t)=>e.makePagerResize({currentResultsPerPage:t.pagination?.numberOfResults||br().numberOfResults})),Kc=()=>J("analytics/pager/number",(e,t)=>e.makePagerNumber({pagerNumber:mo(t)})),oy=()=>J("analytics/pager/next",(e,t)=>e.makePagerNext({pagerNumber:mo(t)})),ay=()=>J("analytics/pager/previous",(e,t)=>e.makePagerPrevious({pagerNumber:mo(t)})),Yc=()=>({actionCause:"browseResults"});d();c();u();l();var a$=new ve({numberOfPages:new re({default:5,min:0})}),i$=new ve({page:new re({min:1})});function qk(e,t={}){if(!s$(e))throw K;let r=oe(e),{dispatch:n}=e,o=He(e,a$,t.options,"buildPager"),i=ut(e,i$,t.initialState,"buildPager").page;i&&n(As(i));let p=()=>mo(e.state),f=()=>{let{numberOfPages:g}=o;return ny(e.state,g)},m=()=>rd(e.state);return{...r,get state(){let g=p(),y=m(),x=g>1&&y>0,v=g<y;return{currentPage:g,currentPages:f(),maxPage:y,hasPreviousPage:x,hasNextPage:v}},selectPage(g){n(cn(g))},nextPage(){n(Cs())},previousPage(){n(xs())},isCurrentPage(g){return g===this.state.currentPage}}}function s$(e){return e.addReducers({configuration:fe,pagination:_r}),!0}function Mk(e,t={}){let{dispatch:r}=e,n=qk(e,t);return{...n,get state(){return n.state},selectPage(o){n.selectPage(o),r(Ut({legacy:Kc(),next:Yc()}))},nextPage(){n.nextPage(),r(Ut({legacy:oy(),next:Yc()}))},previousPage(){n.previousPage(),r(Ut({legacy:ay(),next:Yc()}))}}}d();c();u();l();d();c();u();l();function jk(e){if(!c$(e))throw K;let t=oe(e),r=()=>e.state;return{...t,get state(){return{hasError:r().search.error!==null,error:r().search.error}}}}function c$(e){return e.addReducers({search:he}),!0}function Vk(e){return jk(e)}d();c();u();l();d();c();u();l();function Lk(e){if(!l$(e))throw K;let t=oe(e),r=Lc(e),n=()=>e.state,o=()=>{let a=n().search.duration/1e3;return Math.round((a+Number.EPSILON)*100)/100};return{...t,get state(){return{...r.state,durationInMilliseconds:n().search.duration,durationInSeconds:o(),firstResult:n().pagination.firstResult+1,hasDuration:n().search.duration!==0,hasQuery:n().search.queryExecuted!=="",lastResult:n().pagination.firstResult+n().search.results.length,query:n().search.queryExecuted,total:n().pagination.totalCountFiltered}}}}function l$(e){return e.addReducers({search:he,pagination:_r}),!0}function Uk(e){return Lk(e)}d();c();u();l();d();c();u();l();d();c();u();l();function iy(_x176,_x177){return _iy.apply(this,arguments)}function _iy(){_iy=_asyncToGenerator(function*(e,t){let{search:r,accessToken:n,organizationId:o}=e.configuration,a=e.query?.q||"";return{url:r.apiBaseUrl??vt(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 _iy.apply(this,arguments)}var Ri=xe("resultPreview/fetchResultContent",/*#__PURE__*/function(){var _ref79=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),a=yield iy(o,e),i=yield t.apiClient.html(a);return At(i)?n(i.error):{content:i.success,uniqueId:e.uniqueId}});return function(_x178,_x179){return _ref79.apply(this,arguments)}}()),Jc=P("resultPreview/next"),Xc=P("resultPreview/previous"),Zc=P("resultPreview/prepare",e=>O(e,{results:new ie({required:!0})})),Qk=2048,el=xe("resultPreview/updateContentURL",/*#__PURE__*/function(){var _ref80=_asyncToGenerator(function*(e,{getState:t,extra:r}){let n=t(),o=Nx(yield e.buildResultPreviewRequest(n,{uniqueId:e.uniqueId,requestedOutputSize:e.requestedOutputSize}),e.path);return o?.length>Qk&&r.logger.error(`The content URL was truncated as it exceeds the maximum allowed length of ${Qk} characters.`),{contentURL:o}});return function(_x180,_x181){return _ref80.apply(this,arguments)}}());d();c();u();l();var Bk=e=>J({prefix:"analytics/resultPreview/open",__legacy__getBuilder:(t,r)=>{Zt(e);let n=pt(e,r),o=Ke(e);return t.makeDocumentQuickview(n,o)},analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=pt(e,t),n=Ke(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});d();c();u();l();d();c();u();l();d();c();u();l();function CC(){return{uniqueId:"",content:"",isLoading:!1,position:-1,resultsWithPreview:[]}}var xC=e=>{let{content:t,isLoading:r,uniqueId:n,contentURL:o}=CC();e.content=t,e.isLoading=r,e.uniqueId=n,e.contentURL=o},bC=e=>e.filter(t=>t.hasHtmlVersion).map(t=>t.uniqueId),sy=ae(CC(),e=>{e.addCase(Ri.pending,t=>{t.isLoading=!0}).addCase(Ri.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(W.fulfilled,(t,r)=>{xC(t),t.resultsWithPreview=bC(r.payload.response.results)}).addCase(Rr.fulfilled,(t,r)=>{xC(t),t.resultsWithPreview=t.resultsWithPreview.concat(bC(r.payload.response.results))}).addCase(Ut.fulfilled,xC).addCase(Zc,(t,r)=>{t.resultsWithPreview=bC(r.payload.results)}).addCase(Jc,t=>{if(t.isLoading)return;let r=t.position+1;r>t.resultsWithPreview.length-1&&(r=0),t.position=r}).addCase(Xc,t=>{if(t.isLoading)return;let r=t.position-1;r<0&&(r=t.resultsWithPreview.length-1),t.position=r}).addCase(el.fulfilled,(t,r)=>{t.contentURL=r.payload.contentURL})});function Gk(e,t,r,n,o){if(!u$(e))throw K;let{dispatch:a}=e,i=()=>e.state,p=oe(e),{result:f,maximumPreviewSize:m}=t.options,g=()=>{let{resultsWithPreview:x,position:v}=i().resultPreview;return x[v]},y=x=>{a(el({uniqueId:x,requestedOutputSize:m,buildResultPreviewRequest:r,path:n})),t.options.onlyContentURL||a(Ri({uniqueId:x,requestedOutputSize:m})),o&&o()};return{...p,fetchResultContent(){y(f.uniqueId)},next(){a(Jc()),y(g())},previous(){a(Xc()),y(g())},get state(){let x=i(),v=f.hasHtmlVersion,C=x.resultPreview,b=f.uniqueId===C.uniqueId?C.content:"",w=C.isLoading,F=C.contentURL,I=g();return{content:b,resultHasPreview:v,isLoading:w,contentURL:F,currentResultUniqueId:I}}}}function u$(e){return e.addReducers({configuration:fe,resultPreview:sy}),!0}function $k(e,t){if(!d$(e))throw K;let{dispatch:r}=e,n=()=>e.state,o=()=>n().search.results,p=Gk(e,t,iy,"/html",()=>{e.dispatch(Bk(t.options.result))});return r(Zc({results:o()})),{...p,get state(){return{...p.state,currentResult:o().findIndex(f=>f.uniqueId===p.state.currentResultUniqueId)+1,totalResults:o().length}}}}function d$(e){return e.addReducers({search:he}),!0}d();c();u();l();d();c();u();l();var Hk=()=>J("analytics/recentQueries/clear",e=>e.makeClearRecentQueries()),zk=()=>J("analytics/recentQueries/click",e=>e.makeRecentQueryClick());d();c();u();l();d();c();u();l();var p$={queries:new ie({required:!0,each:new L({emptyAllowed:!1})}),maxLength:new re({required:!0,min:1,default:10})},Fi=P("recentQueries/registerRecentQueries",e=>O(e,p$)),tl=P("recentQueries/clearRecentQueries");d();c();u();l();d();c();u();l();function Wk(){return{queries:[],maxLength:10}}var cy=ae(Wk(),e=>{e.addCase(Fi,f$).addCase(tl,m$).addCase(W.fulfilled,(t,r)=>{let n=r.payload.queryExecuted,o=r.payload.response.results;!n.length||!o.length||g$(n,t)})});function f$(e,t){e.queries=Array.from(new Set(t.payload.queries.map(r=>r.trim().toLowerCase()))).slice(0,t.payload.maxLength),e.maxLength=t.payload.maxLength}function m$(e){e.queries=[]}function g$(e,t){let r=e.trim().toLowerCase();if(r==="")return;let n=Array.from(new Set(t.queries.filter(o=>o.trim().toLowerCase()!==r))).slice(0,t.maxLength-1);t.queries=[r,...n]}var h$={queries:[]},y$={maxLength:10,clearFilters:!0},S$=new ve({queries:new ie({required:!0})}),v$=new ve({maxLength:new re({required:!0,min:1}),clearFilters:new de});function A$(e,t){He(e,v$,t?.options,"buildRecentQueriesList"),ut(e,S$,t?.initialState,"buildRecentQueriesList")}function Kk(e,t){if(!C$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a={...y$,...t?.options},i={...h$,...t?.initialState};A$(e,{options:a,initialState:i});let p={queries:i.queries,maxLength:a.maxLength};return n(Fi(p)),{...r,get state(){let f=o();return{...f.recentQueries,analyticsEnabled:f.configuration.analytics.enabled}},clear(){n(tl())},updateRecentQueries(f){let m=new ie({required:!0,each:new L({required:!0}),min:1}).validate(f);if(m)throw new Error(m);n(Fi({queries:f,maxLength:a.maxLength}))},executeRecentQuery(f){let m=new re({required:!0,min:0,max:this.state.queries.length}).validate(f);if(m)throw new Error(m);let g={q:this.state.queries[f],clearFilters:a.clearFilters};md(e.state.query?.enableQuerySyntax)&&(g.enableQuerySyntax=e.state.query.enableQuerySyntax),n(Ts(g))}}}function C$(e){return e.addReducers({search:he,recentQueries:cy,query:Ft}),!0}function Yk(e,t){let r=Kk(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},clear(){n(Hk()),r.clear()},executeRecentQuery(o){r.executeRecentQuery(o),n(W({legacy:zk(),next:{actionCause:"recentQueriesClick"}}))}}}d();c();u();l();d();c();u();l();var Jk=e=>J("analytics/recentResults/click",(t,r)=>(Zt(e),t.makeRecentResultClick(pt(e,r),Ke(e)))),Xk=()=>J("analytics/recentResults/clear",e=>e.makeClearRecentResults());function Zk(e,t){return Wt(e,t,()=>e.dispatch(Jk(t.options.result)))}d();c();u();l();d();c();u();l();d();c();u();l();function eO(){return{results:[],maxLength:10}}var ly=ae(eO(),e=>{e.addCase($c,(t,r)=>{t.results=r.payload.results.slice(0,r.payload.maxLength),t.maxLength=r.payload.maxLength}).addCase(Hc,t=>{t.results=[]}).addCase(Nr,(t,r)=>{let n=r.payload;t.results=t.results.filter(a=>a.uniqueId!==n.uniqueId);let o=t.results.slice(0,t.maxLength-1);t.results=[n,...o]})});var x$={initialState:{results:[]},options:{maxLength:10}},b$=new ve({results:new ie({required:!0})}),w$=new ve({maxLength:new re({required:!0,min:1})});function R$(e,t){He(e,w$,t?.options,"buildRecentResultsList"),ut(e,b$,t?.initialState,"buildRecentResultsList")}function tO(e,t){if(!F$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a={...x$,...t};R$(e,a);let i={results:a.initialState.results,maxLength:a.options.maxLength};return n($c(i)),{...r,get state(){return o().recentResults},clear(){n(Xk()),n(Hc())}}}function F$(e){return e.addReducers({recentResults:ly}),!0}d();c();u();l();d();c();u();l();d();c();u();l();var nO=e=>{let t=/Document weights:\n((?:.)*?)\n+/g,r=/Terms weights:\n((?:.|\n)*)\n+/g,n=/Total weight: ([0-9]+)/g;if(!e)return null;let o=t.exec(e),a=r.exec(e),i=n.exec(e),p=I$(e),f=oO(o?o[1]:null),m=E$(a),g=i?Number(i[1]):null;return{documentWeights:f,termsWeight:m,totalWeight:g,qreWeights:p}},oO=e=>{let t=/(\w+(?:\s\w+)*): ([-0-9]+)/g,r=/^(\w+(?:\s\w+)*): ([-0-9]+)$/;if(!e)return null;let n=e.match(t);if(!n)return null;let o={};for(let a of n){let i=a.match(r);if(i){let p=i[1],f=i[2];o[p]=Number(f)}}return o},rO=(e,t)=>{let r=[],n;for(;n=t.exec(e),n!==null;)r.push(n);return r},E$=e=>{let t=/((?:[^:]+: [0-9]+, [0-9]+; )+)\n((?:\w+: [0-9]+; )+)/g,r=/([^:]+): ([0-9]+), ([0-9]+); /g;if(!e||!e[1])return null;let n=rO(e[1],t);if(!n)return null;let o={};for(let a of n){let i=rO(a[1],r),p={};for(let m of i)p[m[1]]={Correlation:Number(m[2]),"TF-IDF":Number(m[3])};let f=oO(a[2]);o[Object.keys(p).join(", ")]={terms:p,Weights:f}}return o},I$=e=>{let t=/(Expression:\s".*")\sScore:\s(?!0)([-0-9]+)\n+/g,r=t.exec(e),n=[];for(;r;)n.push({expression:r[1],score:parseInt(r[2],10)}),r=t.exec(e);return n};function aO(e){return e.search.response.results.map(r=>{let n=nO(r.rankingInfo);return{result:r,ranking:n}})}var T$=new ve({enabled:new de({default:!1})});function iO(e,t={}){if(!P$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state;ut(e,T$,t.initialState,"buildRelevanceInspector").enabled&&n(Eo());let i=p=>{e.logger.warn(`Flag [ ${p} ] is now activated. This should *not* be used in any production environment as it negatively impact performance.`)};return{...r,get state(){let p=o(),f=p.debug;if(!p.debug)return{isEnabled:f};let{executionReport:m,basicExpression:g,advancedExpression:y,constantExpression:x,userIdentities:v,rankingExpressions:C}=p.search.response,{fieldsDescription:b,fetchAllFields:w}=p.fields;return{isEnabled:f,rankingInformation:aO(p),executionReport:m,expressions:{basicExpression:g,advancedExpression:y,constantExpression:x},userIdentities:v,rankingExpressions:C,fieldsDescription:b,fetchAllFields:w}},enable(){n(Eo()),i("debug")},disable(){n(ds()),n(xi())},enableFetchAllFields(){n(jc()),i("fetchAllFields")},disableFetchAllFields(){n(xi())},fetchFieldsDescription(){!this.state.isEnabled&&n(Eo()),n(Vc()),i("fieldsDescription"),e.logger.warn(`For production environment, please specify the necessary fields either when instantiating a ResultList controller, or by dispatching a registerFieldsToInclude action.
|
|
45
|
+
For more information, refer to the documentation: https://docs.coveo.com/en/o3r90189/build-a-search-ui/event-protocol`;function Ho(e){e==="next"&&console.warn(YB)}d();c();l();u();var dT=jr(lT(),1);function pT(e){return(0,dT.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();l();u();function fT(e,t){let r=m1(e),n=hr,o=g1(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t,disableBrowserPrivacySignals:e.analytics?.disableBrowserPrivacySignals}}function m1(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function g1(e){return e.preprocessRequest||bd}d();c();l();u();var eC=(e,t,r,n,o,a)=>{let i=e[t];pe(i)||pe(o)||o!==i&&o!==n&&(a.warn(`Mismatch on access token (JWT Token) ${t} and engine configuration.`),a.warn(`To remove this warning, make sure that access token value [${i}] matches engine configuration value [${r}]`))},tC=(e,t)=>!(pe(e)||t===e),Gl=e=>{let t=WA(e);return t||!1},hT=(e,t)=>(tC(e.searchHub,t.searchHub)&&(t.searchHub=e.searchHub),t),mT=(e,t,r,n)=>(eC(e,"searchHub",t.searchHub,xo(),r,n),hT(e,t)),yT=(e,t)=>(tC(e.pipeline,t.pipeline)&&(t.pipeline=e.pipeline),t),gT=(e,t,r,n)=>(eC(e,"pipeline",t.pipeline,nn(),r,n),yT(e,t)),ST=(e,t)=>(tC(e.userDisplayName,t.configuration.analytics.userDisplayName)&&(t.configuration.analytics.userDisplayName=e.userDisplayName),t),h1=(e,t,r,n)=>(eC(e,"userDisplayName",t.configuration.analytics.userDisplayName,Hs().analytics.userDisplayName,r,n),ST(e,t)),vT=e=>ae({},t=>{t.addCase(_s,(r,n)=>{let o=Gl(r.configuration.accessToken);return o?mT(o,r,n.payload,e):r}).addCase(ms,(r,n)=>{let o=Gl(r.configuration.accessToken);return o?gT(o,r,n.payload,e):r}).addCase(on,(r,n)=>{if(r.configuration.accessToken!==n.payload.accessToken)return r;let{accessToken:o}=n.payload;if(!o)return r;let a=Gl(o);return a?[yT,hT,ST].reduce((i,p)=>p(a,i),r):r}).addCase(Ar,(r,n)=>{let o=Gl(r.configuration.accessToken);if(!o)return r;let a=mT(o,r,n.payload.searchHub,e);return gT(o,a,n.payload?.pipeline,e)}).addCase(Fo,(r,n)=>{let o=Gl(r.configuration.accessToken);return o?h1(o,r,n.payload.userDisplayName,e):r})});d();c();l();u();d();c();l();u();var AT={organizationId:z,accessToken:z,name:new L({required:!1,emptyAllowed:!1}),analytics:new X({options:{required:!1},values:{enabled:new de({required:!1}),originContext:new L({required:!1}),originLevel2:new L({required:!1}),originLevel3:new L({required:!1}),analyticsMode:new L({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new L({required:!1,url:!0}),trackingId:new L({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),disableBrowserPrivacySignals:new de({required:!1})}}),environment:new L({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function CT(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var xT=new ve({...AT,search:new X({options:{required:!1},values:{pipeline:new L({required:!1,emptyAllowed:!0}),searchHub:st,locale:st,timezone:st,authenticationProviders:new se({required:!1,each:z}),proxyBaseUrl:new L({required:!1,url:!0})}})});function rC(){return{...CT(),search:{searchHub:"default"}}}var y1={debug:fs,pipeline:gs,searchHub:Ns,search:he};function S1(e){let{search:t}=e,{proxyBaseUrl:r,pipeline:n,searchHub:o,timezone:a,locale:i,authenticationProviders:p}=t??{};return{proxyBaseUrl:r,pipeline:n,searchHub:o,timezone:a,locale:i,authenticationProviders:p}}function bT(e){let t=pT(e.loggerOptions),{configuration:r}=e;v1(r,t);let n=A1(r,t),o=C1(t),a={...fT(r,t),apiClient:n,streamingClient:o,generatedAnswerAnalyticsClient:Cr},i={...e,reducers:y1,crossReducer:vT(t)},p=tT(i,a),f=S1(r);return f&&p.dispatch(Ar(f)),{...p,get state(){return p.state},executeFirstSearch(m=Tp()){if(yl(p.state))return;let g=W({legacy:m,next:tR()});p.dispatch(g)},executeFirstSearchAfterStandaloneSearchBoxRedirect(m){let{cause:g,metadata:S}=m;if(yl(p.state))return;let x=S&&g==="omniboxFromLink",h=W({legacy:x?kp(S):Pp(),next:x?nR():rR()});p.dispatch(h)}}}function v1(e,t){try{xT.validate(e)}catch(r){throw t.error(r,"Search engine configuration error"),r}}function A1(e,t){let{search:r}=e;return new Ed({logger:t,preprocessRequest:e.preprocessRequest||bd,postprocessSearchResponseMiddleware:r?.preprocessSearchResponseMiddleware||jx,postprocessFacetSearchResponseMiddleware:r?.preprocessFacetSearchResponseMiddleware||Lx,postprocessQuerySuggestResponseMiddleware:r?.preprocessQuerySuggestResponseMiddleware||Ux})}function C1(e){return new xd({logger:e})}d();c();l();u();d();c();l();u();d();c();l();u();var li={value:z,numberOfResults:new re({min:0}),state:z};d();c();l();u();var Ae=z;var R1=new re({min:1,default:8,required:!1}),F1=new re({min:1,max:20,default:5,required:!1}),E1={desiredCount:F1,numberOfValues:R1},fc=k("automaticFacet/setOptions",e=>O(e,E1)),mc=k("automaticFacet/deselectAll",e=>O(e,Ae)),I1=z,Sn=k("automaticFacet/toggleSelectValue",e=>O(e,{field:I1,selection:new X({values:li})}));d();c();l();u();d();c();l();u();var T1={state:new Be({required:!0}),numberOfResults:new re({required:!0,min:0}),value:new L({required:!0,emptyAllowed:!0}),path:new se({required:!0,each:z}),moreValuesAvailable:new de({required:!1})};function nC(e){e.children.forEach(t=>{nC(t)}),hr({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},T1)}var gc={facetId:Ae,field:z,tabs:new X({options:{required:!1},values:{included:new se({each:new L}),excluded:new se({each:new L})}}),activeTab:new L({required:!1}),delimitingCharacter:new L({required:!1,emptyAllowed:!0}),filterFacetCount:new de({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Be({required:!1}),basePath:new se({required:!1,each:z}),filterByBasePath:new de({required:!1})};var vn=k("categoryFacet/register",e=>O(e,gc)),Wo=k("categoryFacet/toggleSelectValue",e=>{try{return hr(e.facetId,z),nC(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:$n(t)}}}),An=k("categoryFacet/deselectAll",e=>O(e,gc.facetId)),di=k("categoryFacet/updateNumberOfValues",e=>O(e,{facetId:gc.facetId,numberOfValues:gc.numberOfValues})),hc=k("categoryFacet/updateSortCriterion",e=>O(e,{facetId:gc.facetId,criterion:new Be})),Ng=k("categoryFacet/updateBasePath",e=>O(e,{facetId:gc.facetId,basePath:new se({each:z})}));d();c();l();u();var P1={categoryFacetId:Ae,categoryFacetPath:new se({required:!0,each:z})},k1=(e,{categoryFacetId:t,categoryFacetPath:r})=>{let o=e.categoryFacetSet[t]?.request.field,a=`${o}_${t}`;return{categoryFacetId:t,categoryFacetPath:r,categoryFacetField:o,categoryFacetTitle:a}},Dg=e=>J("analytics/categoryFacet/breadcrumb",(t,r)=>(O(e,P1),t.makeBreadcrumbFacet(k1(r,e)))),wT=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();d();c();l();u();var Fe=k("facetOptions/update",(e={freezeFacetOrder:!0})=>O(e,{freezeFacetOrder:new de({required:!1})})),Gt=k("facetOptions/facet/enable",e=>O(e,Ae)),rt=k("facetOptions/facet/disable",e=>O(e,Ae));d();c();l();u();var or=(e,t)=>typeof e=="object"&&Object.keys({...e}).length===0||!t||!e?!0:e.excluded?.includes(t)?!1:!!(e.included&&(e.included.length===0||e.included.includes(t))||e.excluded&&!e.included);d();c();l();u();d();c();l();u();var $l={facetId:Ae,captions:new X({options:{required:!1}}),numberOfValues:new re({required:!1,min:1}),query:new L({required:!1,emptyAllowed:!0})};var O1={path:new se({required:!0,each:z}),displayValue:Ge,rawValue:Ge,count:new re({required:!0,min:0})},yc=k("categoryFacet/selectSearchResult",e=>O(e,{facetId:Ae,value:new X({values:O1})})),Sc=k("categoryFacetSearch/register",e=>O(e,$l));d();c();l();u();function vc(e,t){let{facetId:r,criterion:n}=t,o=e[r]?.request;o&&(o.sortCriteria=n)}function Ac(e){e&&(e.currentValues=e.currentValues.map(t=>({...t,previousState:t.state!=="idle"?t.state:void 0,state:"idle"})),e.preventAutoSelect=!0)}function qg(e,t){e&&(e.numberOfValues=t)}d();c();l();u();function Hl(e,t){let r=e[t];r&&(r.request.numberOfValues=r.initialNumberOfValues,r.request.currentValues=[],r.request.preventAutoSelect=!0)}function Mg(e,t,r){e.currentValues=_1(t,r),e.numberOfValues=t.length?1:r,e.preventAutoSelect=!0}function _1(e,t){if(!e.length)return[];let r=RT(e[0],t),n=r;for(let o of e.splice(1)){let a=RT(o,t);n.children.push(a),n=a}return n.state="selected",n.retrieveChildren=!0,[r]}function RT(e,t){return{value:e,retrieveCount:t,children:[],state:"idle",retrieveChildren:!1}}var Cn=ae(Zi(),e=>{e.addCase(vn,(t,r)=>{let n=r.payload,{facetId:o,tabs:a}=n;if(o in t)return;let i=D1(n),p=i.numberOfValues;t[o]={request:i,initialNumberOfValues:p,tabs:a}}).addCase(qe.fulfilled,(t,r)=>r.payload?.categoryFacetSet??t).addCase(Me,(t,r)=>{let n=r.payload.cf||{},o=r.payload.tab;Object.keys(t).forEach(a=>{let i=t[a],p=i.request;if((i.tabs?.included?.length||i.tabs?.excluded?.length)&&!or(i.tabs,o)){p.currentValues.length&&Mg(p,[],i.initialNumberOfValues);return}let m=n[a]||[];(m.length||p.currentValues.length)&&Mg(p,m,i.initialNumberOfValues)})}).addCase(hc,(t,r)=>{let{facetId:n,criterion:o}=r.payload,a=t[n]?.request;a&&(a.sortCriteria=o)}).addCase(Ng,(t,r)=>{let{facetId:n,basePath:o}=r.payload,a=t[n]?.request;a&&(a.basePath=[...o])}).addCase(Wo,(t,r)=>{let{facetId:n,selection:o,retrieveCount:a}=r.payload,i=t[n]?.request;if(!i)return;let{path:p}=o,f=p.slice(0,p.length-1),m=N1(i,f,a);if(m.length){let S=m[0];S.retrieveChildren=!0,S.state="selected",S.previousState="idle",S.children=[];return}let g=ET(o.value,a);g.state="selected",g.previousState="idle",m.push(g),i.numberOfValues=1}).addCase(An,(t,r)=>{let n=r.payload;Hl(t,n)}).addCase(ft,t=>{Object.keys(t).forEach(r=>Hl(t,r))}).addCase(an,(t,r)=>Object.keys(t).forEach(n=>{t[n].request.preventAutoSelect=!r.payload.allow})).addCase(di,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload,a=t[n]?.request;if(a){if(!a.currentValues.length)return qg(a,o);q1(t,r.payload)}}).addCase(yc,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n];if(!a)return;let i=[...o.path,o.rawValue];Mg(a.request,i,a.initialNumberOfValues)}).addCase(Fr.fulfilled,(t,r)=>{FT(t,r.payload.response.facets)}).addCase(W.fulfilled,(t,r)=>{FT(t,r.payload.response.facets)}).addCase(rt,(t,r)=>{Hl(t,r.payload)}).addCase(yt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!or(a.tabs,n)&&Hl(t,o)})})}),zl={delimitingCharacter:";",filterFacetCount:!0,injectionDepth:1e3,numberOfValues:5,sortCriteria:"occurrences",basePath:[],filterByBasePath:!0,resultsMustMatch:"atLeastOneValue"};function N1(e,t,r){let n=e.currentValues;for(let o of t){let a=n[0];(!a||o!==a.value)&&(a=ET(o,r),n.length=0,n.push(a)),a.retrieveChildren=!1,a.previousState=void 0,a.state="idle",n=a.children}return n}function D1(e){return{...zl,currentValues:[],preventAutoSelect:!1,type:"hierarchical",...e}}function ET(e,t){return{value:e,state:"idle",children:[],retrieveChildren:!0,retrieveCount:t}}function FT(e,t){t.forEach(r=>{if(!M1(e,r))return;let n=r.facetId,o=e[n]?.request;if(!o)return;let a=V1(o,r);o.currentValues=a?[]:o.currentValues,o.preventAutoSelect=!1})}function q1(e,t){let{facetId:r,numberOfValues:n}=t,o=e[r]?.request.currentValues[0];if(o){for(;o.children.length&&o?.state!=="selected";)o=o.children[0];o.retrieveCount=n}}function M1(e,t){return t.facetId in e}function V1(e,t){let r=cr(e.currentValues),n=cr(t.values);return r.length!==n.length}d();c();l();u();d();c();l();u();var xn=new L({regex:/^[a-zA-Z0-9-_]+$/}),bn=new L({required:!0}),IT=new se({each:new L}),TT=new L,PT=new de,wn=new de,Rn=new re({min:0}),Wr=new re({min:1}),Vg=new de({required:!0}),j1=new X,L1=new L,U1={captions:j1,numberOfValues:Wr,query:L1},Cc=new X({values:U1}),jg=new X({options:{required:!1},values:{type:new L({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new se({required:!0,max:25,each:new L({emptyAllowed:!1,required:!0})})}}),kT=new de,Lg=new se({min:1,max:25,required:!1,each:new L({emptyAllowed:!1,required:!0})});var Q1={facetId:Ae,field:new L({required:!0,emptyAllowed:!0}),tabs:new X({options:{required:!1},values:{included:new se({each:new L}),excluded:new se({each:new L})}}),activeTab:new L({required:!1}),filterFacetCount:new de({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Be({required:!1}),resultsMustMatch:new Be({required:!1}),allowedValues:jg,customSort:Lg},Fn=k("facet/register",e=>O(e,Q1)),En=k("facet/toggleSelectValue",e=>O(e,{facetId:Ae,selection:new X({values:li})})),In=k("facet/toggleExcludeValue",e=>O(e,{facetId:Ae,selection:new X({values:li})})),nt=k("facet/deselectAll",e=>O(e,Ae)),xc=k("facet/updateSortCriterion",e=>O(e,{facetId:Ae,criterion:new Be({required:!0})})),pi=k("facet/updateNumberOfValues",e=>O(e,{facetId:Ae,numberOfValues:new re({required:!0,min:1})})),fi=k("facet/updateIsFieldExpanded",e=>O(e,{facetId:Ae,isFieldExpanded:new de({required:!0})})),ao=k("facet/updateFreezeCurrentValues",e=>O(e,{facetId:Ae,freezeCurrentValues:new de({required:!0})}));d();c();l();u();var bc=e=>J("analytics/facet/showMore",(t,r)=>{O(e,Ae);let n=ns(e,ur(r));return t.makeFacetShowMore(n)}),wc=e=>J("analytics/facet/showLess",(t,r)=>{O(e,Ae);let n=ns(e,ur(r));return t.makeFacetShowLess(n)}),Tn=e=>J("analytics/facet/sortChange",(t,r)=>{O(e,{facetId:Ae,criterion:new Be({required:!0})});let{facetId:n,criterion:o}=e,a=ur(r),p={...ns(n,a),criteria:o};return t.makeFacetUpdateSort(p)}),bt=e=>J("analytics/facet/reset",(t,r)=>{O(e,Ae);let n=ur(r),o=ns(e,n);return t.makeFacetClearAll(o)}),it=e=>J("analytics/facet/select",(t,r)=>{O(e,{facetId:Ae,facetValue:z});let n=ur(r),o=os(e,n);return t.makeFacetSelect(o)}),fr=e=>J("analytics/facet/exclude",(t,r)=>{O(e,{facetId:Ae,facetValue:z});let n=ur(r),o=os(e,n);return t.makeFacetExclude(o)}),Kr=e=>J("analytics/facet/deselect",(t,r)=>{O(e,{facetId:Ae,facetValue:z});let n=ur(r),o=os(e,n);return t.makeFacetDeselect(o)}),io=e=>J("analytics/facet/unexclude",(t,r)=>{O(e,{facetId:Ae,facetValue:z});let n=ur(r),o=os(e,n);return t.makeFacetUnexclude(o)}),Rc=e=>J("analytics/facet/breadcrumb",(t,r)=>{O(e,{facetId:Ae,facetValue:z});let n=os(e,ur(r));return t.makeBreadcrumbFacet(n)}),$t=()=>({actionCause:"facetClearAll"}),gt=()=>({actionCause:"facetSelect"}),so=()=>({actionCause:"facetExclude"}),co=()=>({actionCause:"facetDeselect"}),OT=()=>({actionCause:"facetUnexclude"}),Ug=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();d();c();l();u();var _T={facetId:Ae,value:new X({values:{displayValue:Ge,rawValue:Ge,count:new re({required:!0,min:0})}})},Qg=k("facetSearch/register",e=>O(e,$l)),Ko=k("facetSearch/update",e=>O(e,$l)),mi=k("facetSearch/toggleSelectValue",e=>O(e,_T)),gi=k("facetSearch/toggleExcludeValue",e=>O(e,_T));var kr=ae(rs(),e=>{e.addCase(Fn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;n in t||(t[n]=Ew(B1(r.payload),o))}).addCase(qe.fulfilled,(t,r)=>{if(r.payload&&Object.keys(r.payload.facetSet).length!==0)return r.payload.facetSet}).addCase(Me,(t,r)=>{let n=r.payload.f||{},o=r.payload.fExcluded||{};Object.keys(t).forEach(i=>{let{request:p}=t[i],f=n[i]||[],m=o[i]||[],g=f.length+m.length,S=p.currentValues.filter(x=>!f.includes(x.value)&&!m.includes(x.value));p.currentValues=[...f.map(DT),...m.map(qT),...S.map($1)],p.preventAutoSelect=g>0,p.numberOfValues=Math.max(g,p.numberOfValues)})}).addCase(En,(t,r)=>{let{facetId:n,selection:o}=r.payload,a=t[n]?.request;if(!a)return;a.preventAutoSelect=!0;let i=a.currentValues.find(f=>f.value===o.value);if(!i){Bg(a,o);return}let p=i.state==="selected";i.previousState=i.state,i.state=p?"idle":"selected",a.freezeCurrentValues=!0}).addCase(In,(t,r)=>{let{facetId:n,selection:o}=r.payload,a=t[n]?.request;if(!a)return;a.preventAutoSelect=!0;let i=a.currentValues.find(f=>f.value===o.value);if(!i){Bg(a,o);return}let p=i.state==="excluded";i.previousState=i.state,i.state=p?"idle":"excluded",a.freezeCurrentValues=!0}).addCase(ao,(t,r)=>{let{facetId:n,freezeCurrentValues:o}=r.payload,a=t[n]?.request;a&&(a.freezeCurrentValues=o)}).addCase(nt,(t,r)=>{Ac(t[r.payload]?.request)}).addCase(ft,t=>{Object.values(t).filter(r=>r.hasBreadcrumbs).forEach(({request:r})=>Ac(r))}).addCase(hs,t=>{Object.values(t).filter(r=>!r.hasBreadcrumbs).forEach(({request:r})=>Ac(r))}).addCase(an,(t,r)=>Object.values(t).forEach(n=>{n.request.preventAutoSelect=!r.payload.allow})).addCase(xc,(t,r)=>{vc(t,r.payload)}).addCase(pi,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload;qg(t[n]?.request,o)}).addCase(fi,(t,r)=>{let{facetId:n,isFieldExpanded:o}=r.payload,a=t[n]?.request;a&&(a.isFieldExpanded=o)}).addCase(W.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>NT(t[o.facetId]?.request,o))}).addCase(Fr.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>NT(t[o.facetId]?.request,o))}).addCase(mi,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n]?.request;if(!a)return;let{rawValue:i}=o,{currentValues:p}=a,f=p.find(g=>g.value===i);if(f){f.state="selected";return}let m=DT(i);Bg(a,m),a.freezeCurrentValues=!0,a.preventAutoSelect=!0}).addCase(gi,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n]?.request;if(!a)return;let{rawValue:i}=o,{currentValues:p}=a,f=p.find(g=>g.value===i);if(f){f.state="excluded";return}let m=qT(i);Bg(a,m),a.freezeCurrentValues=!0,a.preventAutoSelect=!0}).addCase(rt,(t,r)=>{if(!(r.payload in t))return;let{request:n}=t[r.payload];Ac(n)}).addCase(yt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!or(a.tabs,n)&&Ac(a.request)})})});function Bg(e,t){let{currentValues:r}=e,n=r.findIndex(a=>a.state==="idle"),o=n===-1?r.length:n;e.currentValues.splice(o,0,t),n>-1&&e.currentValues.pop(),e.numberOfValues=e.currentValues.length}function NT(e,t){e&&(e.currentValues=t.values.map(G1),e.freezeCurrentValues=!1,e.preventAutoSelect=!1)}var Wl={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"automatic",resultsMustMatch:"atLeastOneValue"};function B1(e){return{...Wl,type:"specific",currentValues:[],freezeCurrentValues:!1,isFieldExpanded:!1,preventAutoSelect:!1,...e}}function G1(e){let{value:t,state:r}=e;return{value:t,state:r}}function DT(e){return{value:e,state:"selected"}}function qT(e){return{value:e,state:"excluded"}}function $1(e){return{...e,state:"idle"}}d();c();l();u();var Gg=()=>J("analytics/facet/deselectAllBreadcrumbs",e=>e.makeBreadcrumbResetAll());d();c();l();u();d();c();l();u();function Yo(e){let t=MT(e.start,e),r=MT(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function MT(e,t){let{dateFormat:r}=t;return SR(e)?(Oo(e),gR(e)):typeof e=="string"&&un(e)?(Oo(e),e):(Qp(e,r),fl(wa(e,r)))}d();c();l();u();var Fc=k("rangeFacet/updateSortCriterion",e=>O(e,{facetId:Ae,criterion:new Be({required:!0})}));d();c();l();u();var hi={state:z,start:new re({required:!0}),end:new re({required:!0}),endInclusive:new de({required:!0}),numberOfResults:new re({required:!0,min:0})},yi={start:z,end:z,endInclusive:new de({required:!0}),state:z,numberOfResults:new re({required:!0,min:0})},Si=e=>({facetId:Ae,selection:typeof e.start=="string"?new X({values:yi}):new X({values:hi})});var H1={start:z,end:z,endInclusive:new de({required:!0}),state:z},z1={facetId:Ae,field:z,tabs:new X({options:{required:!1},values:{included:new se({each:new L}),excluded:new se({each:new L})}}),activeTab:new L({required:!1}),currentValues:new se({required:!1,each:new X({values:H1})}),generateAutomaticRanges:new de({required:!0}),filterFacetCount:new de({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Be({required:!1}),rangeAlgorithm:new Be({required:!1})};function VT(e){return un(e)?gl(e):e}function $g(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=Yo(t);if(wa(VT(r)).isAfter(wa(VT(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var Pn=k("dateFacet/register",e=>{try{return hr(e,z1),$g(e),{payload:e,error:null}}catch(t){return{payload:e,error:$n(t)}}}),kn=k("dateFacet/toggleSelectValue",e=>O(e,{facetId:Ae,selection:new X({values:yi})})),On=k("dateFacet/toggleExcludeValue",e=>O(e,{facetId:Ae,selection:new X({values:yi})})),uo=k("dateFacet/updateFacetValues",e=>{try{return hr(e,{facetId:Ae,values:new se({each:new X({values:yi})})}),$g({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:$n(t)}}}),Hg=Fc,zg=nt;d();c();l();u();d();c();l();u();var Wg=(e,{facetId:t,selection:r})=>{let o=(e.dateFacetSet[t]||e.numericFacetSet[t]).request.field,a=`${o}_${t}`;return{facetId:t,facetField:o,facetTitle:a,facetRangeEndInclusive:r.endInclusive,facetRangeEnd:`${r.end}`,facetRangeStart:`${r.start}`}},Kg=()=>({actionCause:"breadcrumbFacet"});var Kl=e=>J("analytics/dateFacet/breadcrumb",(t,r)=>{O(e,Si(e.selection));let n=Wg(r,e);return t.makeBreadcrumbFacet(n)}),oC=Kg;d();c();l();u();function W1(e,t){return!!t&&t.facetId in e.dateFacetSet}var jT=(e,t)=>{let r=Ur(e,t);if(W1(e,r))return r},LT=(e,t)=>(jT(e,t)||{values:[]}).values.filter(n=>n.state==="selected"),UT=(e,t)=>(jT(e,t)||{values:[]}).values.filter(n=>n.state!=="idle");d();c();l();u();d();c();l();u();var Jg={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"ascending",rangeAlgorithm:"even",resultsMustMatch:"atLeastOneValue"};function Xg(e,t){let{request:r}=t,{facetId:n}=r;if(n in e)return;let o=QT(r);r.numberOfValues=o,e[n]=t}function Zg(e,t,r){let n=e[t]?.request;n&&(n.currentValues=r,n.numberOfValues=QT(n))}function eh(e,t,r){let n=e[t]?.request;if(!n)return;let o=Yg(n.currentValues,r);if(!o)return;let a=o.state==="selected";o.previousState=o.state,o.state=a?"idle":"selected",n.preventAutoSelect=!0}function th(e,t,r){let n=e[t]?.request;if(!n)return;let o=Yg(n.currentValues,r);if(!o)return;let a=o.state==="excluded";o.previousState=o.state,o.state=a?"idle":"excluded",n.preventAutoSelect=!0}function _n(e,t){let r=e[t]?.request;r&&r.currentValues.forEach(n=>{n.state!=="idle"&&(n.previousState=n.state),n.state="idle"})}function rh(e,t){Object.entries(e).forEach(([r,{request:n}])=>{let o=t[r]||[];n.currentValues.forEach(p=>(!!Yg(o,p)?p.state="selected":typeof t=="object"&&r in t&&p.state!=="idle"&&(p.previousState=p.state,p.state="idle"),p));let a=o.filter(p=>!Yg(n.currentValues,p)),i=n.currentValues;i.push(...a),n.numberOfValues=Math.max(n.numberOfValues,i.length)})}function nh(e,t,r){t.forEach(n=>{let o=n.facetId,a=e[o]?.request;if(!a)return;let i=r(n.values);a.currentValues=i,a.preventAutoSelect=!1})}function Yg(e,t){let{start:r,end:n}=t;return e.find(o=>o.start===r&&o.end===n)}function QT(e){let{generateAutomaticRanges:t,currentValues:r,numberOfValues:n}=e;return t?Math.max(n,r.length):r.length}var Nn=ae(es(),e=>{e.addCase(Pn,(t,r)=>{let{payload:n}=r,{tabs:o}=n,a=K1(n);Xg(t,Rw(a,o))}).addCase(qe.fulfilled,(t,r)=>r.payload?.dateFacetSet??t).addCase(Me,(t,r)=>{let n=r.payload.df||{};rh(t,n)}).addCase(kn,(t,r)=>{let{facetId:n,selection:o}=r.payload;eh(t,n,o)}).addCase(On,(t,r)=>{let{facetId:n,selection:o}=r.payload;th(t,n,o)}).addCase(uo,(t,r)=>{let{facetId:n,values:o}=r.payload;Zg(t,n,o)}).addCase(zg,(t,r)=>{_n(t,r.payload)}).addCase(ft,t=>{Object.keys(t).forEach(r=>{_n(t,r)})}).addCase(Hg,(t,r)=>{vc(t,r.payload)}).addCase(W.fulfilled,(t,r)=>{let n=r.payload.response.facets;nh(t,n,Y1)}).addCase(rt,(t,r)=>{_n(t,r.payload)}).addCase(yt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!or(a.tabs,n)&&_n(t,o)})})});function K1(e){return{...Jg,currentValues:[],preventAutoSelect:!1,type:"dateRange",...e}}function Y1(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();var J1={state:z,start:new re({required:!0}),end:new re({required:!0}),endInclusive:new de({required:!0})},X1={facetId:Ae,field:z,tabs:new X({options:{required:!1},values:{included:new se({each:new L}),excluded:new se({each:new L})}}),activeTab:new L({required:!1}),currentValues:new se({required:!1,each:new X({values:J1})}),generateAutomaticRanges:new de({required:!0}),filterFacetCount:new de({required:!1}),injectionDepth:new re({required:!1,min:0}),numberOfValues:new re({required:!1,min:1}),sortCriteria:new Be({required:!1}),rangeAlgorithm:new Be({required:!1})};function oh(e){e.currentValues&&e.currentValues.forEach(({start:t,end:r})=>{if(t>r)throw new Error(`The start value is greater than the end value for the numeric range ${t} to ${r}`)})}var Dn=k("numericFacet/register",e=>{try{return O(e,X1),oh(e),{payload:e,error:null}}catch(t){return{payload:e,error:$n(t)}}}),qn=k("numericFacet/toggleSelectValue",e=>O(e,{facetId:Ae,selection:new X({values:hi})})),Mn=k("numericFacet/toggleExcludeValue",e=>O(e,{facetId:Ae,selection:new X({values:hi})})),lo=k("numericFacet/updateFacetValues",e=>{try{return hr(e,{facetId:Ae,values:new se({each:new X({values:hi})})}),oh({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:$n(t)}}}),ah=Fc,ih=nt;d();c();l();u();var Yl=e=>J("analytics/numericFacet/breadcrumb",(t,r)=>{O(e,Si(e.selection));let n=Wg(r,e);return t.makeBreadcrumbFacet(n)}),aC=Kg;d();c();l();u();function Z1(e,t){return!!t&&t.facetId in e.numericFacetSet}var BT=(e,t)=>{let r=Ur(e,t);if(Z1(e,r))return r},GT=(e,t)=>(BT(e,t)||{values:[]}).values.filter(n=>n.state!=="idle"),$T=(e,t)=>(BT(e,t)||{values:[]}).values.filter(n=>n.state==="selected");d();c();l();u();var Or=ae(ts(),e=>{e.addCase(Dn,(t,r)=>{let{payload:n}=r,{tabs:o}=n,a=eG(n);Xg(t,Fw(a,o))}).addCase(qe.fulfilled,(t,r)=>r.payload?.numericFacetSet??t).addCase(Me,(t,r)=>{let n=r.payload.nf||{};rh(t,n)}).addCase(qn,(t,r)=>{let{facetId:n,selection:o}=r.payload;eh(t,n,o)}).addCase(Mn,(t,r)=>{let{facetId:n,selection:o}=r.payload;th(t,n,o)}).addCase(lo,(t,r)=>{let{facetId:n,values:o}=r.payload;Zg(t,n,o)}).addCase(ih,(t,r)=>{_n(t,r.payload)}).addCase(ft,t=>{Object.keys(t).forEach(r=>{_n(t,r)})}).addCase(ah,(t,r)=>{vc(t,r.payload)}).addCase(W.fulfilled,(t,r)=>{let n=r.payload.response.facets;nh(t,n,tG)}).addCase(rt,(t,r)=>{_n(t,r.payload)}).addCase(yt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!or(a.tabs,n)&&_n(t,o)})})});function eG(e){return{...Jg,currentValues:[],preventAutoSelect:!1,type:"numericalRange",...e}}function tG(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();d();c();l();u();var vi=z,sh=new X({options:{required:!0},values:{caption:Ge,expression:Ge,state:new L({constrainTo:["idle","selected","excluded"]})}}),ch=new se({required:!0,each:sh});var Ec=k("staticFilter/register",e=>O(e,{id:vi,values:ch})),po=k("staticFilter/toggleSelect",e=>O(e,{id:vi,value:sh})),fo=k("staticFilter/toggleExclude",e=>O(e,{id:vi,value:sh})),Jo=k("staticFilter/deselectAllFilterValues",e=>O(e,vi)),uh=e=>J("analytics/staticFilter/select",t=>t.makeStaticFilterSelect(e)),Ic=e=>J("analytics/staticFilter/deselect",t=>t.makeStaticFilterDeselect(e)),lh=e=>J("analytics/staticFilter/clearAll",t=>t.makeStaticFilterClearAll(e));d();c();l();u();d();c();l();u();function oe(e){let t,r=new Map,n=()=>r.size===0,o=a=>{try{let i=JSON.stringify(a),p=t!==i;return t=i,p}catch(i){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",i),!0}};return{subscribe(a){a();let i=Symbol(),p;return n()&&(t=JSON.stringify(this.state),p=e.subscribe(()=>{o(this.state)&&r.forEach(f=>f())})),r.set(i,a),()=>{r.delete(i),n()&&p?.()}},get state(){return{}}}}var dh=e=>Object.keys(e.facetSet).map(t=>{let r=e.facetValuesSelector(e.engine.state,t).map(n=>({value:n,deselect:()=>{n.state==="selected"?e.executeToggleSelect({facetId:t,selection:n}):n.state==="excluded"&&e.executeToggleExclude({facetId:t,selection:n})}}));return{facetId:t,field:e.facetSet[t].request.field,values:r}}).filter(t=>t.values.length);function HT(e){let t=oe(e),{dispatch:r}=e;return{...t,get state(){return{facetBreadcrumbs:[],categoryFacetBreadcrumbs:[],numericFacetBreadcrumbs:[],dateFacetBreadcrumbs:[],staticFilterBreadcrumbs:[],hasBreadcrumbs:!1}},deselectAll:()=>{r(ft())},deselectBreadcrumb(n){n.deselect()}}}function zT(e){if(!rG(e))throw K;let t=HT(e),{dispatch:r}=e,n=()=>e.state,o=()=>{let w={engine:e,facetSet:n().facetSet,executeToggleSelect:({facetId:F,selection:I})=>{r(En({facetId:F,selection:I})),r(ao({facetId:F,freezeCurrentValues:!1})),r(W({legacy:Rc({facetId:F,facetValue:I.value}),next:Ug()}))},executeToggleExclude:({facetId:F,selection:I})=>{r(In({facetId:F,selection:I})),r(ao({facetId:F,freezeCurrentValues:!1})),r(W({legacy:Rc({facetId:F,facetValue:I.value}),next:Ug()}))},facetValuesSelector:xw};return dh(w)},a=()=>{let w={engine:e,facetSet:n().numericFacetSet,executeToggleSelect:F=>{r(qn(F)),r(W({legacy:Yl(F),next:aC()}))},executeToggleExclude:F=>{r(Mn(F)),r(W({legacy:Yl(F),next:aC()}))},facetValuesSelector:GT};return dh(w)},i=()=>{let w={engine:e,facetSet:n().dateFacetSet,executeToggleSelect:F=>{r(kn(F)),r(W({legacy:Kl(F),next:oC()}))},executeToggleExclude:F=>{r(On(F)),r(W({legacy:Kl(F),next:oC()}))},facetValuesSelector:UT};return dh(w)},p=()=>Object.keys(n().categoryFacetSet).map(f).filter(w=>w.path.length),f=w=>{let F=ww(n(),w);return{facetId:w,field:n().categoryFacetSet[w].request.field,path:F,deselect:()=>{r(An(w)),r(W({legacy:Dg({categoryFacetPath:F.map(I=>I.value),categoryFacetId:w}),next:wT()}))}}},m=()=>{let w=n().staticFilterSet??{};return Object.values(w).map(g)},g=w=>{let{id:F,values:I}=w,E=I.filter(T=>T.state!=="idle").map(T=>S(F,T));return{id:F,values:E}},S=(w,F)=>({value:F,deselect:()=>{let{caption:I,expression:E}=F;F.state==="selected"?r(po({id:w,value:F})):F.state==="excluded"&&r(fo({id:w,value:F})),r(W({legacy:Ic({staticFilterId:w,staticFilterValue:{caption:I,expression:E}})}))}}),x=()=>{let w=n().automaticFacetSet?.set??{};return Object.values(w).map(F=>h(F.response)).filter(F=>F.values.length>0)},h=w=>{let{field:F,label:I}=w,E=w.values.filter(T=>T.state!=="idle").map(T=>C(F,T));return{facetId:F,field:F,label:I,values:E}},C=(w,F)=>({value:F,deselect:()=>{r(Sn({field:w,selection:F})),r(W({legacy:Rc({facetId:w,facetValue:F.value}),next:Ug()}))}});function b(){return!![...o(),...a(),...i(),...p(),...m(),...x()].length}return{...t,get state(){return{facetBreadcrumbs:o(),categoryFacetBreadcrumbs:p(),numericFacetBreadcrumbs:a(),dateFacetBreadcrumbs:i(),staticFilterBreadcrumbs:m(),automaticFacetBreadcrumbs:x(),hasBreadcrumbs:b()}},deselectAll:()=>{t.deselectAll(),r(W({legacy:Gg(),next:{actionCause:"breadcrumbResetAll"}}))}}}function rG(e){return e.addReducers({configuration:fe,search:he,facetSet:kr,numericFacetSet:Or,dateFacetSet:Nn,categoryFacetSet:Cn}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var nG=new se({each:z,required:!0}),WT=(e,t)=>(O(e,z),_i(t)?O(t,z):O(t,nG),{payload:{contextKey:e,contextValue:t}}),Ai=k("context/set",e=>{for(let[t,r]of Object.entries(e))WT(t,r);return{payload:e}}),Ci=k("context/add",e=>WT(e.contextKey,e.contextValue)),xi=k("context/remove",e=>O(e,z));d();c();l();u();var ph=ae(zp(),e=>{e.addCase(Ai,(t,r)=>{t.contextValues=r.payload}).addCase(Ci,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(xi,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});d();c();l();u();var oG=["caseId","caseNumber"],aG={caseId:"caseContext",caseNumber:"caseContext"},Jl=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${aG[t]} to set this value.}`)}};function iC(e){return oG.includes(e)}var iG=new ve({values:new X({options:{required:!1}})});function KT(e,t={}){if(!uG(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=lt(e,iG,t.initialState,"buildContext");return a.values&&n(Ai(a.values)),{...r,get state(){return{values:o().context.contextValues}},set(i){n(Ai(i))},...(o().configuration.analytics.analyticsMode==="legacy"?sG(n):cG(n))}}var sG=e=>({add(t,r){e(Ci({contextKey:t,contextValue:r}))},remove(t){e(xi(t))}}),cG=e=>({add(t,r){if(iC(t))throw new Jl(t);e(Ci({contextKey:t,contextValue:r}))},remove(t){if(iC(t))throw new Jl(t);e(xi(t))}});function uG(e){return e.addReducers({context:ph}),!0}function YT(e,t){return KT(e,t)}d();c();l();u();d();c();l();u();var wt=ae(Kp(),e=>{e.addCase(Fe,(t,r)=>({...t,...r.payload})).addCase(W.fulfilled,t=>{t.freezeFacetOrder=!1}).addCase(W.rejected,t=>{t.freezeFacetOrder=!1}).addCase(qe.fulfilled,(t,r)=>r.payload?.facetOptions??t).addCase(vn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;fh(o,t,n)}).addCase(Fn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;fh(o,t,n)}).addCase(Pn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;fh(o,t,n)}).addCase(Dn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;fh(o,t,n)}).addCase(Gt,(t,r)=>{t.facets[r.payload].enabled=!0}).addCase(rt,(t,r)=>{t.facets[r.payload].enabled=!1}).addCase(Me,(t,r)=>{[...Object.keys(r.payload.f??{}),...Object.keys(r.payload.fExcluded??{}),...Object.keys(r.payload.cf??{}),...Object.keys(r.payload.nf??{}),...Object.keys(r.payload.df??{})].forEach(n=>{n in t||(t.facets[n]=Ev()),t.facets[n].enabled=!0})})});function fh(e,t,r){let n={...Ev(),tabs:e??{}};t.facets[r]=n}d();c();l();u();d();c();l();u();var Tc=ae(Zp(),e=>{e.addCase($s,(t,r)=>{let n=r.payload,{id:o}=n;o in t||(t[o]={...n,isActive:!1})}).addCase(yt,(t,r)=>{let n=r.payload;JT(t,n)}).addCase(ds,(t,r)=>{let n=r.payload;JT(t,n)}).addCase(qe.fulfilled,(t,r)=>r.payload?.tabSet??t).addCase(Me,(t,r)=>{let n=r.payload.tab;pe(n)||Object.keys(t).forEach(o=>{t[o].isActive=o===n})})});function JT(e,t){t in e&&Object.keys(e).forEach(n=>{e[n].isActive=n===t})}function mh(e){if(!lG(e))throw K;let t=oe(e),r=tt(n=>n.tabSet,n=>Object.values(n).find(a=>a.isActive)?.id??"");return{...t,get state(){return{activeTab:r(e.state)}}}}function lG(e){return e.addReducers({tabSet:Tc}),!0}function XT(e,t){if(!dG(e))throw K;let r=mh(e),n=C=>e.state.facetOptions.facets[C]?.enabled??!1,o=C=>e.state.facetSet?.[C]?.request?.currentValues??e.state.categoryFacetSet?.[C]?.request?.currentValues??e.state.numericFacetSet?.[C]?.request?.currentValues??e.state.dateFacetSet?.[C]?.request?.currentValues??null,a=C=>C in e.state.facetOptions.facets,i=C=>e.state.facetOptions.facets[C]?.tabs,p=()=>Di({isFacetRegistered:a(t.facetId),parentFacets:t.conditions.map(({parentFacetId:C})=>a(C)?{enabled:n(C),values:o(C)}:null),isTabEnabled:or(i(t.facetId),r.state.activeTab)}),f=()=>{let C=p();return C===x?!1:(x=C,!0)},m=()=>t.conditions.length>0?t.conditions.some(C=>{if(!n(C.parentFacetId))return!1;let b=o(C.parentFacetId);return b===null?!1:C.condition(b)}):!0,g=()=>{e.state.facetSet&&Object.entries(e.state.facetSet).forEach(([C,b])=>b.request.freezeCurrentValues&&e.dispatch(ao({facetId:C,freezeCurrentValues:!1})))},S=()=>{if(!a(t.facetId))return;let C=n(t.facetId),b=m(),w=or(i(t.facetId),r.state.activeTab),F=b&&w;C!==F&&(e.dispatch(F?Gt(t.facetId):rt(t.facetId)),g())},x=p(),h=e.subscribe(()=>{f()&&S()});return S(),{stopWatching(){h()}}}function dG(e){return e.addReducers({facetOptions:wt}),!0}d();c();l();u();d();c();l();u();var Pc=k("dictionaryFieldContext/set",e=>{let t=new X({options:{required:!0}}),r=O(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new se({each:Ge}),a=O(n,o).error;return a?{payload:e,error:a}:{payload:e}}),kc=k("dictionaryFieldContext/add",e=>{let t=new X({options:{required:!0},values:{field:Ge,key:Ge}});return O(e,t)}),Oc=k("dictionaryFieldContext/remove",e=>O(e,Ge));d();c();l();u();var gh=ae(Wp(),e=>{e.addCase(Pc,(t,r)=>{t.contextValues=r.payload}).addCase(kc,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(Oc,(t,r)=>{delete t.contextValues[r.payload]}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function ZT(e){if(!pG(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(Pc(o))},add(o,a){r(kc({field:o,key:a}))},remove(o){r(Oc(o))}}}function pG(e){return e.addReducers({dictionaryFieldContext:gh}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var eP=e=>e.queryCorrection.correctedQuery!==""||e.wasCorrectedTo!=="";d();c();l();u();d();c();l();u();d();c();l();u();var hh=()=>({correctedQuery:"",wordCorrections:[],originalQuery:""}),tP=()=>({correctedQuery:"",corrections:[],originalQuery:""});function rP(){return{enableDidYouMean:!1,wasCorrectedTo:"",wasAutomaticallyCorrected:!1,queryCorrection:hh(),originalQuery:"",automaticallyCorrectQuery:!0,queryCorrectionMode:"legacy"}}var nP=(e,t)=>{let r={...tP(),...t,correctedQuery:t?.correctedQuery||t?.corrections[0]?.correctedQuery||""};e.queryCorrection=r,e.wasCorrectedTo=r.correctedQuery};var yh=ae(rP(),e=>{e.addCase(Es,t=>{t.enableDidYouMean=!0}).addCase(Gp,t=>{t.enableDidYouMean=!1}).addCase($p,t=>{t.automaticallyCorrectQuery=!0}).addCase(Is,t=>{t.automaticallyCorrectQuery=!1}).addCase(W.pending,t=>{t.queryCorrection=hh(),t.wasAutomaticallyCorrected=!1,t.wasCorrectedTo=""}).addCase(W.fulfilled,(t,r)=>{let{queryCorrection:n,queryCorrections:o}=r.payload.response;if(t.queryCorrectionMode==="legacy"){let a=o?.[0]?o[0]:hh();t.queryCorrection=a}t.queryCorrectionMode==="next"&&nP(t,n),t.wasAutomaticallyCorrected=r.payload.automaticallyCorrected,t.originalQuery=r.payload.originalQuery}).addCase(xr,(t,r)=>{t.wasCorrectedTo=r.payload}).addCase(Ra,(t,r)=>{t.queryCorrectionMode=r.payload})});function oP(e,t={}){if(!fG(e))throw K;let r=oe(e),{dispatch:n}=e;n(Es()),t.options?.automaticallyCorrectQuery===!1&&n(Is()),n(Ra(t.options?.queryCorrectionMode||"next"));let o=()=>e.state,a=()=>eP(o().didYouMean);return{...r,get state(){let i=o();return{originalQuery:i.didYouMean.originalQuery,wasCorrectedTo:i.didYouMean.wasCorrectedTo,wasAutomaticallyCorrected:i.didYouMean.wasAutomaticallyCorrected,queryCorrection:i.didYouMean.queryCorrection,hasQueryCorrection:a()}},applyCorrection(){n(xr(this.state.queryCorrection.correctedQuery))},updateQueryCorrectionMode(i){n(Ra(i))}}}function fG(e){return e.addReducers({configuration:fe,didYouMean:yh}),!0}function aP(e,t={}){let r=oP(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},applyCorrection(){r.applyCorrection(),n(W({legacy:Hp(),next:bR()}))}}}d();c();l();u();d();c();l();u();function iP(e){if(!mG(e))throw K;let t=oe(e),r=()=>e.state;return{...t,sort(n){return hl(n,this.state.facetIds)},get state(){return{facetIds:r().search.response.facets.map(a=>a.facetId)}}}}function mG(e){return e.addReducers({search:he,facetOptions:wt}),!0}function sP(e){return iP(e)}d();c();l();u();d();c();l();u();var Sh=ae(Ji(),e=>{e.addCase(W.fulfilled,(t,r)=>{t.set={},r.payload.response.generateAutomaticFacets?.facets?.forEach(o=>{t.set[o.field]={response:o}})}).addCase(fc,(t,r)=>{r.payload.desiredCount&&(t.desiredCount=r.payload.desiredCount),r.payload.numberOfValues&&(t.numberOfValues=r.payload.numberOfValues)}).addCase(Sn,(t,r)=>{let{field:n,selection:o}=r.payload,a=t.set[n]?.response;if(!a)return;let i=a.values.find(f=>f.value===o.value);if(!i)return;let p=i.state==="selected";i.state=p?"idle":"selected"}).addCase(mc,(t,r)=>{let n=r.payload,o=t.set[n]?.response;if(o)for(let a of o.values)a.state="idle"}).addCase(Me,(t,r)=>{let n=r.payload.af??{},o=Object.keys(t.set);for(let a in n)if(!t.set[a]){let i=gG(a),p=n[a].map(f=>cP(f));i.values.push(...p),t.set[a]={response:i}}for(let a of o)if(!(a in n)){let i=t.set[a]?.response;for(let p of i.values)p.state="idle"}for(let a in n){let i=t.set[a]?.response;if(i){let p=i.values,f=new Set(n[a]);for(let m of p)f.has(m.value)?(m.state="selected",f.delete(m.value)):m.state="idle";for(let m of f)i.values.push(cP(m))}}}).addCase(qe.fulfilled,(t,r)=>{if(r.payload&&Object.keys(r.payload.automaticFacetSet.set).length!==0)return r.payload.automaticFacetSet}).addCase(ft,t=>{Object.values(t.set).forEach(({response:r})=>{r.values.forEach(n=>{n.state="idle"})})})});function gG(e){return{field:e,values:[],moreValuesAvailable:!1,label:"",indexScore:0}}function cP(e){return{value:e,state:"selected",numberOfResults:0}}d();c();l();u();d();c();l();u();var vh=e=>e.state==="selected",Ah=e=>e.state==="excluded",Ch=(e,t)=>{let r={facetId:e,facetValue:t.value};return vh(t)?Kr(r):it(r)},xh=e=>vh(e)?co():gt(),uP=(e,t)=>{let r={facetId:e,facetValue:t.value};return Ah(t)?io(r):fr(r)},lP=e=>Ah(e)?OT():so();function dP(e,t){let{dispatch:r}=e,n=oe(e),{field:o}=t;return{...n,toggleSelect(a){r(Sn({field:o,selection:a})),r(W({legacy:Ch(o,a),next:xh(a)}))},deselectAll(){r(mc(o)),r(W({legacy:bt(o),next:$t()}))},get state(){let a=e.state.automaticFacetSet?.set[o]?.response;return a?{field:a.field,label:a.label,values:a.values}:{field:"",values:[],label:""}}}}d();c();l();u();function pP(e){return{desiredCount:e.desiredCount,numberOfValues:e.numberOfValues}}function fP(e,t){if(!hG(e))throw K;let{dispatch:r}=e,n=pP(t.options);return r(fc(n)),{...oe(e),get state(){return{automaticFacets:e.state.search.response.generateAutomaticFacets?.facets.map(i=>dP(e,{field:i.field}))??[]}}}}function hG(e){return e.addReducers({automaticFacetSet:Sh,configuration:fe,search:he}),!0}d();c();l();u();d();c();l();u();d();c();l();u();function bh(e,t,r){let{facetId:n}=t;if(e[n])return;let o=!1,a={...Vn,...t},i=r();e[n]={options:a,isLoading:o,response:i,initialNumberOfValues:a.numberOfValues,requestId:""}}function wh(e,t){let{facetId:r,...n}=t,o=e[r];o&&(o.options={...o.options,...n})}function Rh(e,t,r){let n=e[t];n&&(n.requestId=r,n.isLoading=!0)}function Fh(e,t){let r=e[t];r&&(r.isLoading=!1)}function Eh(e,t,r){let{facetId:n,response:o}=t,a=e[n];a&&a.requestId===r&&(a.isLoading=!1,a.response=o)}function Xl(e,t,r){let{facetId:n}=t,o=e[n];o&&(o.requestId="",o.isLoading=!1,o.response=r(),o.options.numberOfValues=o.initialNumberOfValues,o.options.query=Vn.query)}function Ih(e,t){Object.keys(e).forEach(r=>Xl(e,{facetId:r},t))}var Vn={captions:{},numberOfValues:10,query:""};d();c();l();u();d();c();l();u();var mP=/*#__PURE__*/function(){var _ref70=_asyncToGenerator(function*(e,t,r,n){let o=t.categoryFacetSearchSet[e].options,a=t.categoryFacetSet[e].request,{captions:i,query:p,numberOfValues:f}=o,{field:m,delimitingCharacter:g,basePath:S,filterFacetCount:x}=a,h=yG(a),C=h.length?[h]:[],b=`*${p}*`;return{url:t.configuration.search.apiBaseUrl??vt(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")}),basePath:S,captions:i,numberOfValues:f,query:b,field:m,delimitingCharacter:g,ignorePaths:C,filterFacetCount:x,type:"hierarchical",...(n?{}:{searchContext:(yield wr(t,r)).request})}});return function mP(_x156,_x157,_x158,_x159){return _ref70.apply(this,arguments)}}(),yG=e=>{let t=[],r=e.currentValues[0];for(;r;)t.push(r.value),r=r.children[0];return t};d();c();l();u();var gP=/*#__PURE__*/function(){var _ref71=_asyncToGenerator(function*(e,t,r,n){let{captions:o,query:a,numberOfValues:i}=t.facetSearchSet[e].options,{field:p,currentValues:f,filterFacetCount:m}=t.facetSet[e].request,g=f.filter(x=>x.state!=="idle").map(x=>x.value),S=`*${a}*`;return{url:t.configuration.search.apiBaseUrl??vt(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders&&{authentication:t.configuration.search.authenticationProviders.join(",")}),captions:o,numberOfValues:i,query:S,field:p,ignoreValues:g,filterFacetCount:m,type:"specific",...(n?{}:{searchContext:(yield wr(t,r)).request})}});return function gP(_x160,_x161,_x162,_x163){return _ref71.apply(this,arguments)}}();var hP=e=>(/*#__PURE__*/function(){var _ref72=_asyncToGenerator(function*(t,{getState:r,extra:{apiClient:n,validatePayload:o,navigatorContext:a}}){let i=r(),p;o(t,z),SG(i,t)?p=yield gP(t,i,a,e):p=yield mP(t,i,a,e);let f=yield n.facetSearch(p);return{facetId:t,response:f}});return function(_x164,_x165){return _ref72.apply(this,arguments)}}()),Rt=xe("facetSearch/executeSearch",hP(!1)),jn=xe("facetSearch/executeSearch",hP(!0)),_c=k("facetSearch/clearResults",e=>O(e,{facetId:Ae})),SG=(e,t)=>e.facetSearchSet!==void 0&&e.facetSet!==void 0&&e.facetSet[t]!==void 0;d();c();l();u();function yP(){return{}}var Nc=ae(yP(),e=>{e.addCase(Sc,(t,r)=>{let n=r.payload;bh(t,n,sC)}).addCase(Ko,(t,r)=>{wh(t,r.payload)}).addCase(Rt.pending,(t,r)=>{let n=r.meta.arg;Rh(t,n,r.meta.requestId)}).addCase(Rt.rejected,(t,r)=>{let n=r.meta.arg;Fh(t,n)}).addCase(Rt.fulfilled,(t,r)=>{Eh(t,r.payload,r.meta.requestId)}).addCase(_c,(t,{payload:{facetId:r}})=>{Xl(t,{facetId:r},sC)}).addCase(W.fulfilled,t=>{Ih(t,sC)})});function sC(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();d();c();l();u();function SP(e,t){let{field:r,state:n}=e;if(!vG(e))return r;let o=`${r}_`,a=AG(o,n);return xG(r,t),`${o}${a}`}function vG(e){let{field:t,state:r}=e;return vP(r).some(o=>o&&t in o)}function AG(e,t){let n=vP(t).map(o=>Object.keys(o||{})).reduce((o,a)=>o.concat(a),[]);return CG(n,e)+1}function vP(e){let{facetSet:t,numericFacetSet:r,dateFacetSet:n,categoryFacetSet:o}=e;return[t,r,n,o]}function CG(e,t){return e.map(a=>{let i=a.split(t)[1],p=parseInt(i,10);return Number.isNaN(p)?0:p}).sort().pop()??0}function xG(e,t){let r=`A facet with field "${e}" already exists.
|
|
46
|
+
To avoid unexpected behaviour, configure the #id option on the facet controller.`;t.warn(r)}function Ht(e,t){let{state:r,logger:n}=e,{field:o,facetId:a}=t;return a||SP({field:o,state:r},n)}d();c();l();u();d();c();l();u();var AP=["alphanumeric","occurrences"];var CP=new ve({field:bn,tabs:new X({options:{required:!1},values:{included:new se({each:new L}),excluded:new se({each:new L})}}),basePath:IT,delimitingCharacter:TT,facetId:xn,facetSearch:Cc,filterByBasePath:PT,filterFacetCount:wn,injectionDepth:Rn,numberOfValues:Wr,sortCriteria:new L({constrainTo:AP})});function xP(e,t){if(!bG(e))throw K;let r=oe(e),{dispatch:n}=e,o=Ht(e,t.options),a=t.options.tabs??{},i=Qt(e.state.tabSet),p={...zl,...vd("facetSearch",t.options),field:t.options.field,facetId:o,tabs:a,activeTab:i},f={facetSearch:{...Vn,...t.options.facetSearch},...p};He(e,CP,f,"buildCategoryFacet");let m=()=>ev(e.state,o),g=()=>ZS(e.state,o),S=()=>tn(e.state),x=()=>ln(e.state,o);return n(vn(p)),{...r,toggleSelect(h){let C=f.numberOfValues;n(Wo({facetId:o,selection:h,retrieveCount:C})),n(Fe())},deselectAll(){n(An(o)),n(Fe())},sortBy(h){n(hc({facetId:o,criterion:h})),n(Fe())},isSortedBy(h){return m().sortCriteria===h},showMoreValues(){let{numberOfValues:h}=f,{activeValue:C,valuesAsTrees:b}=this.state,w=(C?.children.length??b.length)+h;n(di({facetId:o,numberOfValues:w})),n(Fe())},showLessValues(){let{numberOfValues:h}=f;n(di({facetId:o,numberOfValues:h})),n(Fe())},enable(){n(Gt(o))},disable(){n(rt(o))},get state(){let h=m(),C=g(),b=S(),w=x(),F=C?.values??[],I=F.some(U=>U.children.length>0)??!1,{parents:E,values:T}=bw(C?.values),P=cr(F),D=P.length?P[P.length-1]:void 0,G=!!D,Q=D?.moreValuesAvailable??C?.moreValuesAvailable??!1,V=D?D.children.length>f.numberOfValues:F.length>f.numberOfValues;return{facetId:o,parents:E,selectedValueAncestry:P,values:T,isHierarchical:I,valuesAsTrees:F,activeValue:D,isLoading:b,hasActiveValues:G,canShowMoreValues:Q,canShowLessValues:V,sortCriteria:h.sortCriteria,enabled:w}}}}function bG(e){return e.addReducers({categoryFacetSet:Cn,categoryFacetSearchSet:Nc,facetOptions:wt,configuration:fe,search:he}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var wG="coveo-headless-internal-state",Th=Symbol.for(wG);d();c();l();u();function Dc(e,t){let r=e.dispatch,{options:n,getFacetSearch:o,executeFacetSearchActionCreator:a,executeFieldSuggestActionCreator:i}=t,{facetId:p}=n;return{updateText(f){r(Ko({facetId:p,query:f,numberOfValues:o().initialNumberOfValues}))},showMoreResults(){let{initialNumberOfValues:f,options:m}=o();r(Ko({facetId:p,numberOfValues:m.numberOfValues+f})),r(t.isForFieldSuggestions?i(p):a(p))},search(){r(t.isForFieldSuggestions?i(p):a(p))},clear(){r(_c({facetId:p}))},updateCaptions(f){r(Ko({facetId:p,captions:f}))},get state(){let{response:f,isLoading:m,options:g}=o(),{query:S}=g,x=f.values;return{...f,values:x,isLoading:m,query:S}}}}function bP(e,t){let{dispatch:r}=e,n={...Vn,...t.options},{facetId:o}=n,a=()=>"state"in e?e.state.categoryFacetSearchSet[o]:e[Th].categoryFacetSearchSet[o];r(Sc(n));let i=Dc(e,{options:n,getFacetSearch:a,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:t.executeFacetSearchActionCreator,executeFieldSuggestActionCreator:t.executeFieldSuggestActionCreator});return{...i,select(p){r(yc({facetId:o,value:p})),t.select(p)},get state(){return i.state}}}function Ph(e,t){let{executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:o,isForFieldSuggestions:a}=t,{dispatch:i}=e,p={...Vn,...t.options},{facetId:f}=p,m=()=>e.state.categoryFacetSearchSet[f],g=bP(e,{options:{...p},executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:o,isForFieldSuggestions:a});i(Sc(p));let S=Dc(e,{options:p,getFacetSearch:m,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:jn});return{...S,...g,get state(){return{...S.state,...g.state}}}}function wP(e,t){if(!RG(e))throw K;let r=xP(e,t),{dispatch:n}=e,o=()=>r.state.facetId,a=Ph(e,{options:{facetId:o(),...t.options.facetSearch},executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:jn,select:f=>{n(Fe()),n(W({legacy:it({facetId:o(),facetValue:f.rawValue}),next:gt()}))},isForFieldSuggestions:!1}),{state:i,...p}=a;return{...r,facetSearch:p,toggleSelect(f){r.toggleSelect(f),n(W({legacy:FG(o(),f),next:EG(f)}))},deselectAll(){r.deselectAll(),n(W({legacy:bt(o()),next:$t()}))},sortBy(f){r.sortBy(f),n(W({legacy:Tn({facetId:o(),criterion:f})}))},showMoreValues(){r.showMoreValues(),n(Fr({legacy:bc(o())}))},showLessValues(){r.showLessValues(),n(Fr({legacy:wc(o())}))},get state(){return{...r.state,facetSearch:a.state}}}}function RG(e){return e.addReducers({categoryFacetSet:Cn,categoryFacetSearchSet:Nc,configuration:fe,search:he}),!0}function FG(e,t){let r={facetId:e,facetValue:t.value};return t.state==="selected"?Kr(r):it(r)}function EG(e){return e.state==="selected"?co():gt()}d();c();l();u();d();c();l();u();d();c();l();u();function RP(){return{}}var qc=ae(RP(),e=>{e.addCase(Qg,(t,r)=>{let n=r.payload;bh(t,n,cC)}).addCase(Ko,(t,r)=>{wh(t,r.payload)}).addCase(Rt.pending,(t,r)=>{let n=r.meta.arg;Rh(t,n,r.meta.requestId)}).addCase(Rt.rejected,(t,r)=>{let n=r.meta.arg;Fh(t,n)}).addCase(Rt.fulfilled,(t,r)=>{Eh(t,r.payload,r.meta.requestId)}).addCase(_c,(t,{payload:r})=>{Xl(t,r,cC)}).addCase(W.fulfilled,t=>{Ih(t,cC)})});function cC(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();var FP={facetId:Ae,selection:new X({values:li})},EP=xe("facet/executeToggleSelect",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},FP),n(En({facetId:e,selection:t})),n(Fe())}),IP=xe("facet/executeToggleExclude",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},FP),n(In({facetId:e,selection:t})),n(Fe())});d();c();l();u();d();c();l();u();var Mc=["allValues","atLeastOneValue"];d();c();l();u();var kh=["score","alphanumeric","alphanumericDescending","occurrences","automatic","alphanumericNatural","alphanumericNaturalDescending"];var TP=new ve({facetId:xn,tabs:new X({options:{required:!1},values:{included:new se({each:new L}),excluded:new se({each:new L})}}),field:bn,filterFacetCount:wn,injectionDepth:Rn,numberOfValues:Wr,sortCriteria:new L({constrainTo:kh}),resultsMustMatch:new L({constrainTo:Mc}),facetSearch:Cc});function PP(e,t,r=TP){if(!IG(e))throw K;let{dispatch:n}=e,o=oe(e),a=Ht(e,t.options),i=t.options.tabs??{},p=Qt(e.state.tabSet),f={...Wl,...vd("facetSearch",t.options),field:t.options.field,facetId:a,tabs:i,activeTab:p},m={facetSearch:{...Vn,...t.options.facetSearch},...f};He(e,r,m,"buildFacet");let g=()=>gp(e.state,a),S=()=>Xi(e.state,a),x=()=>tn(e.state),h=()=>ln(e.state,a),C=()=>{let{currentValues:w}=g();return w.filter(F=>F.state!=="idle").length},b=()=>{let{currentValues:w}=g(),F=m.numberOfValues,I=!!w.find(E=>E.state==="idle");return F<w.length&&I};return n(Fn(f)),{...o,toggleSelect:w=>n(EP({facetId:m.facetId,selection:w})),toggleExclude:w=>n(IP({facetId:m.facetId,selection:w})),toggleSingleSelect:function(w){w.state==="idle"&&n(nt(a)),this.toggleSelect(w)},toggleSingleExclude:function(w){w.state==="idle"&&n(nt(a)),this.toggleExclude(w)},isValueSelected:vh,isValueExcluded:Ah,deselectAll(){n(nt(a)),n(Fe())},sortBy(w){n(xc({facetId:a,criterion:w})),n(Fe())},isSortedBy(w){return this.state.sortCriterion===w},showMoreValues(){let w=g().numberOfValues,F=m.numberOfValues,I=F-w%F,E=w+I;n(pi({facetId:a,numberOfValues:E})),n(fi({facetId:a,isFieldExpanded:!0})),n(Fe())},showLessValues(){let w=m.numberOfValues,F=Math.max(w,C());n(pi({facetId:a,numberOfValues:F})),n(fi({facetId:a,isFieldExpanded:!1})),n(Fe())},enable(){n(Gt(a))},disable(){n(rt(a))},get state(){let w=g(),F=S(),I=x(),E=h(),T;typeof w.sortCriteria=="object"?T=w.sortCriteria.order==="descending"?"alphanumericDescending":"alphanumeric":T=w.sortCriteria;let P=F?F.values:[],D=P.some(V=>V.state!=="idle"),G=F?F.moreValuesAvailable:!1,Q=w.resultsMustMatch;return{label:F?.label,facetId:a,tabs:i,values:P,sortCriterion:T,resultsMustMatch:Q,isLoading:I,hasActiveValues:D,canShowMoreValues:G,canShowLessValues:b(),enabled:E}}}}function IG(e){return e.addReducers({facetSet:kr,facetOptions:wt,configuration:fe,facetSearchSet:qc}),!0}d();c();l();u();function Oh(e,t){let{dispatch:r}=e,{options:n,select:o,exclude:a,isForFieldSuggestions:i,executeFacetSearchActionCreator:p,executeFieldSuggestActionCreator:f}=t,{facetId:m}=n,g=()=>"state"in e?e.state.facetSearchSet[m]:e[Th].facetSearchSet[m];r(Qg(n));let S=Dc(e,{options:n,getFacetSearch:g,isForFieldSuggestions:i,executeFacetSearchActionCreator:p,executeFieldSuggestActionCreator:f});return{...S,select(x){r(mi({facetId:m,value:x})),o(x)},exclude(x){r(gi({facetId:m,value:x})),a(x)},singleSelect(x){r(nt(m)),r(mi({facetId:m,value:x})),o(x)},singleExclude(x){r(nt(m)),r(gi({facetId:m,value:x})),a(x)},get state(){let{values:x}=S.state;return{...S.state,values:x.map(({count:h,displayValue:C,rawValue:b})=>({count:h,displayValue:C,rawValue:b}))}}}}d();c();l();u();var kP=new ve({facetId:xn,field:bn,tabs:new X({options:{required:!1},values:{included:new se({each:new L}),excluded:new se({each:new L})}}),filterFacetCount:wn,injectionDepth:Rn,numberOfValues:Wr,sortCriteria:new L({constrainTo:kh}),resultsMustMatch:new L({constrainTo:Mc}),facetSearch:Cc,allowedValues:jg,hasBreadcrumbs:kT,customSort:Lg});function OP(e,t){if(!TG(e))throw K;let{dispatch:r}=e,n=PP(e,{...t,options:{...t.options,...(t.options.allowedValues&&{allowedValues:{type:"simple",values:t.options.allowedValues}})}},kP),o=()=>n.state.facetId,i=(()=>{let{facetSearch:m}=t.options;return Oh(e,{options:{facetId:o(),...m},select:g=>{r(Fe()),r(W({legacy:it({facetId:o(),facetValue:g.rawValue}),next:gt()}))},exclude:g=>{r(Fe()),r(W({legacy:fr({facetId:o(),facetValue:g.rawValue}),next:so()}))},isForFieldSuggestions:!1,executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:jn})})(),{state:p,...f}=i;return{...n,facetSearch:f,toggleSelect(m){n.toggleSelect(m),r(W({legacy:Ch(o(),m),next:xh(m)}))},toggleExclude(m){n.toggleExclude(m),r(W({legacy:uP(o(),m),next:lP(m)}))},deselectAll(){n.deselectAll(),r(W({legacy:bt(o()),next:$t()}))},sortBy(m){n.sortBy(m),r(W({legacy:Tn({facetId:o(),criterion:m})}))},isSortedBy(m){return this.state.sortCriterion===m},showMoreValues(){n.showMoreValues(),r(Fr({legacy:bc(o())}))},showLessValues(){n.showLessValues(),r(Fr({legacy:wc(o())}))},get state(){return{...n.state,facetSearch:i.state}}}}function TG(e){return e.addReducers({facetSet:kr,configuration:fe,facetSearchSet:qc,search:he}),!0}d();c();l();u();d();c();l();u();var _h=e=>e.state==="selected",uC=e=>e.state==="excluded",Nh=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return _h(t)?Kr(n):it(n)},Dh=e=>_h(e)?co():gt(),_P=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return uC(t)?io(n):fr(n)};d();c();l();u();d();c();l();u();d();c();l();u();var qh=k("rangeFacet/executeToggleSelect",e=>O(e,Si(e.selection))),Mh=k("rangeFacet/executeToggleExclude",e=>O(e,Si(e.selection)));var NP={facetId:Ae,selection:new X({values:yi})},DP=xe("dateFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,NP),t(kn(e)),t(qh(e)),t(Fe())}),qP=xe("dateFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,NP),t(On(e)),t(Mh(e)),t(Fe())});d();c();l();u();function Vh(e,t){if(!e.generateAutomaticRanges&&e.currentValues===void 0){let r=`currentValues should be specified for ${t} when generateAutomaticRanges is false.`;throw new Error(r)}}d();c();l();u();function jh(e,t){let{facetId:r,getRequest:n}=t,o=oe(e),a=e.dispatch,i=()=>ln(e.state,r);return{...o,isValueSelected:_h,isValueExcluded:uC,deselectAll(){a(nt(r)),a(Fe())},sortBy(p){a(Fc({facetId:r,criterion:p})),a(Fe())},isSortedBy(p){return this.state.sortCriterion===p},enable(){a(Gt(r))},disable(){a(rt(r))},get state(){let p=n(),f=Ur(e.state,r),m=p.sortCriteria,g=p.resultsMustMatch,S=f?f.values:[],x=tn(e.state),h=i(),C=S.some(w=>w.state!=="idle"),b=f?.domain;return{facetId:r,values:S,sortCriterion:m,resultsMustMatch:g,hasActiveValues:C,isLoading:x,enabled:h,domain:b}}}}d();c();l();u();d();c();l();u();var Lh=["idle","selected","excluded"];d();c();l();u();var Uh=["ascending","descending"],Qh=["even","equiprobable"];var PG={start:new L,end:new L,endInclusive:new de,state:new L({constrainTo:Lh})},kG=new ve({facetId:xn,field:bn,tabs:new X({options:{required:!1},values:{included:new se({each:new L}),excluded:new se({each:new L})}}),generateAutomaticRanges:Vg,filterFacetCount:wn,injectionDepth:Rn,numberOfValues:Wr,currentValues:new se({each:new X({values:PG})}),sortCriteria:new L({constrainTo:Uh}),rangeAlgorithm:new L({constrainTo:Qh})});function Bh(e,t){He(e,kG,t,"buildDateFacet"),$g(t)}function MP(e,t){if(!OG(e))throw K;Vh(t.options,"buildDateFacet");let r=e.dispatch,n=Ht(e,t.options),o=t.options.tabs??{},a=Qt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:a};Bh(e,i),r(Pn(i));let p=jh(e,{facetId:n,getRequest:()=>e.state.dateFacetSet[n].request});return{...p,toggleSelect:f=>r(DP({facetId:n,selection:f})),toggleSingleSelect:function(f){f.state==="idle"&&r(nt(n)),this.toggleSelect(f)},toggleExclude:f=>r(qP({facetId:n,selection:f})),toggleSingleExclude:function(f){f.state==="idle"&&r(nt(n)),this.toggleExclude(f)},get state(){return p.state}}}function OG(e){return e.addReducers({configuration:fe,search:he,dateFacetSet:Nn,facetOptions:wt}),!0}function VP(e,t){let r=MP(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(W({legacy:bt(o()),next:$t()}))},sortBy(a){r.sortBy(a),n(W({legacy:Tn({facetId:o(),criterion:a})}))},toggleSelect:a=>{r.toggleSelect(a),n(W({legacy:Nh(o(),a),next:Dh(a)}))},toggleExclude:a=>{r.toggleExclude(a),n(W({legacy:_P(o(),a)}))},get state(){return r.state}}}d();c();l();u();d();c();l();u();function jP(e,t){if(!_G(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=Ht(e,t.options),i=t.options.tabs??{},p=Qt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:a,tabs:i,activeTab:p};Bh(e,f),n(Pn(f));let m=()=>ln(e.state,a);return{...r,clear:()=>{n(uo({facetId:a,values:[]})),n(Fe())},setRange:g=>{let S={...g,state:"selected",numberOfResults:0,endInclusive:!0},x=uo({facetId:a,values:[S]});return x.error?!1:(n(x),n(Fe()),!0)},enable(){n(Gt(a))},disable(){n(rt(a))},get state(){let g=tn(o()),S=m(),x=LT(o(),a),h=x.length?x[0]:void 0;return{facetId:a,isLoading:g,range:h,enabled:S}}}}function _G(e){return e.addReducers({dateFacetSet:Nn,facetOptions:wt,configuration:fe,search:he}),!0}function LP(e,t){if(!NG(e))throw K;let r=jP(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(W({legacy:bt(o()),next:$t()}))},setRange:a=>{let i=r.setRange(a);return i&&n(W({legacy:it({facetId:o(),facetValue:`${a.start}..${a.end}`}),next:gt()})),i},get state(){return{...r.state}}}}function NG(e){return e.addReducers({dateFacetSet:Nn,configuration:fe,search:he}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var UP={facetId:Ae,selection:new X({values:hi})},QP=xe("numericFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,UP),t(qn(e)),t(qh(e)),t(Fe())}),OQe=xe("numericFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,UP),t(Mn(e)),t(Mh(e)),t(Fe())});d();c();l();u();var DG={start:new re,end:new re,endInclusive:new de,state:new L({constrainTo:Lh})},qG=new ve({facetId:xn,tabs:new X({options:{required:!1},values:{included:new se({each:new L}),excluded:new se({each:new L})}}),field:bn,generateAutomaticRanges:Vg,filterFacetCount:wn,injectionDepth:Rn,numberOfValues:Wr,currentValues:new se({each:new X({values:DG})}),sortCriteria:new L({constrainTo:Uh}),resultsMustMatch:new L({constrainTo:Mc}),rangeAlgorithm:new L({constrainTo:Qh})});function Gh(e,t){He(e,qG,t,"buildNumericFacet"),oh(t)}d();c();l();u();function Vc(e){return{endInclusive:!1,state:"idle",...e}}function BP(e,t){if(!MG(e))throw K;Vh(t.options,"buildNumericFacet");let r=e.dispatch,n=Ht(e,t.options),o=t.options.tabs??{},a=Qt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:a};Gh(e,i),r(Dn(i));let p=jh(e,{facetId:n,getRequest:()=>e.state.numericFacetSet[n].request});return{...p,toggleSelect:f=>r(QP({facetId:n,selection:f})),toggleSingleSelect(f){f.state==="idle"&&r(nt(n)),this.toggleSelect(f)},get state(){return p.state}}}function MG(e){return e.addReducers({numericFacetSet:Or,facetOptions:wt,configuration:fe,search:he}),!0}function GP(e,t){if(!VG(e))throw K;let r=BP(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(W({legacy:bt(o()),next:$t()}))},sortBy(a){r.sortBy(a),n(W({legacy:Tn({facetId:o(),criterion:a})}))},toggleSelect:a=>{r.toggleSelect(a),n(W({legacy:Nh(o(),a),next:Dh(a)}))},get state(){return{...r.state}}}}function VG(e){return e.addReducers({numericFacetSet:Or,configuration:fe,search:he}),!0}d();c();l();u();d();c();l();u();function $P(e,t){if(!jG(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=Ht(e,t.options),i=t.options.tabs??{},p=Qt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:a,tabs:i,activeTab:p};Gh(e,f),n(Dn(f));let m=()=>ln(e.state,a);return{...r,clear:()=>{n(lo({facetId:a,values:[]})),n(Fe())},setRange:g=>{let S={...g,state:"selected",numberOfResults:0,endInclusive:!0},x=lo({facetId:a,values:[S]});return x.error?!1:(n(x),n(Fe()),!0)},enable(){n(Gt(a))},disable(){n(rt(a))},get state(){let g=tn(o()),S=m(),x=$T(o(),a),h=x.length?x[0]:void 0;return{facetId:a,isLoading:g,range:h,enabled:S}}}}function jG(e){return e.addReducers({numericFacetSet:Or,facetOptions:wt,configuration:fe,search:he}),!0}function HP(e,t){if(!LG(e))throw K;let r=$P(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(W({legacy:bt(o()),next:$t()}))},setRange:a=>{let i=r.setRange(a);return i&&n(W({legacy:it({facetId:o(),facetValue:`${a.start}..${a.end}`}),next:gt()})),i},get state(){return{...r.state}}}}function LG(e){return e.addReducers({numericFacetSet:Or,configuration:fe,search:he}),!0}d();c();l();u();function zP(e,t){if(!UG(e))throw K;let{facetSearch:r,...n}=t.options.facet,o=Ht(e,n);e.dispatch(vn({...zl,...n,facetId:o}));let a=Ph(e,{options:{...r,facetId:o},executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:jn,select:p=>{e.dispatch(Fe()),e.dispatch(W({legacy:it({facetId:o,facetValue:p.rawValue}),next:gt()}))},isForFieldSuggestions:!0});return{...oe(e),...a,updateText:p=>{a.updateText(p),a.search()},get state(){return a.state}}}function UG(e){return e.addReducers({categoryFacetSet:Cn,configuration:fe,categoryFacetSearchSet:Nc,search:he}),!0}d();c();l();u();function WP(e,t){if(!QG(e))throw K;let{facetSearch:r,allowedValues:n,...o}=t.options.facet,a=Ht(e,o);e.dispatch(Fn({...Wl,...o,facetId:a,...(n&&{allowedValues:{type:"simple",values:n}})}));let i=Oh(e,{options:{...r,facetId:a},select:f=>{e.dispatch(Fe()),e.dispatch(W({legacy:it({facetId:a,facetValue:f.rawValue}),next:gt()}))},exclude:f=>{e.dispatch(Fe()),e.dispatch(W({legacy:fr({facetId:a,facetValue:f.rawValue}),next:so()}))},isForFieldSuggestions:!0,executeFacetSearchActionCreator:Rt,executeFieldSuggestActionCreator:jn});return{...oe(e),...i,updateText:f=>{i.updateText(f),i.search()},get state(){return i.state}}}function QG(e){return e.addReducers({facetSet:kr,configuration:fe,facetSearchSet:qc,search:he}),!0}d();c();l();u();d();c();l();u();var lC={collectionField:new L({emptyAllowed:!1,required:!1}),parentField:new L({emptyAllowed:!1,required:!1}),childField:new L({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new re({min:0,required:!1})},Xo=k("folding/register",e=>O(e,lC)),Zo=xe("folding/loadCollection",/*#__PURE__*/function(){var _ref73=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let a=t(),i=a.configuration.analytics.analyticsMode==="legacy"?yield Po(a):ws(a,o),p=yield n.search({...i,q:BG(a),enableQuerySyntax:!0,cq:`@${a.folding.fields.collection}="${e}"`,filterField:a.folding.fields.collection,childField:a.folding.fields.parent,parentField:a.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return At(p)?r(p.error):{collectionId:e,results:p.success.results,searchUid:p.success.searchUid,rootResult:a.folding.collections[e].result}});return function(_x166,_x167){return _ref73.apply(this,arguments)}}());function BG(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}d();c();l();u();var GG=e=>J("analytics/folding/showMore",(t,r)=>(Zt(e),t.makeShowMoreFoldedResults(pt(e,r),Ke(e)))),$G=()=>J("analytics/folding/showLess",e=>e.makeShowLessFoldedResults()),KP={logShowMoreFoldedResults:GG,logShowLessFoldedResults:$G};d();c();l();u();d();c();l();u();d();c();l();u();var $h=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});function HG(e,t){return e.raw[t.collection]}function dC(e,t){return e.raw[t.parent]}function Zl(e,t){let r=e.raw[t.child];return yd(r)?r[0]:r}function zG(e,t){return(e||t)!==void 0&&e===t}function JP(e,t,r,n=[]){let o=Zl(e,r);return o?n.indexOf(o)!==-1?[]:t.filter(a=>{let i=Zl(a,r)===Zl(e,r);return dC(a,r)===o&&!i}).map(a=>{let i={...a,searchUid:e.searchUid};return{result:i,children:JP(i,t,r,[...n,o])}}):[]}function WG(e,t){return e.find(r=>{let n=dC(r,t)===void 0,o=zG(dC(r,t),Zl(r,t));return n||o})}function XP(e){return e.parentResult?XP(e.parentResult):e}function KG(e,t,r,n){let o=Ep(e),i={...(n??WG(o,t)??XP(e)),searchUid:r},p=JP(i,o,t);return{result:i,children:p,moreResultsAvailable:e.totalNumberOfChildResults>p.length+1,isLoadingMoreResults:!1}}function Hh(e,t,r,n){let o={};return e.forEach(a=>{let i=HG(a,t);i&&(!Zl(a,t)&&!a.parentResult||(o[i]=KG(a,t,r,n)))}),o}function YP(e,t){if(!e.collections[t])throw new Error(`Missing collection ${t} from ${Object.keys(e.collections)}: Folding most probably in an invalid state...`);return e.collections[t]}var zh=ae($h(),e=>e.addCase(W.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?Hh(r.response.results,t.fields,r.response.searchUid):{}}).addCase(Ut.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?Hh(r.response.results,t.fields,r.response.searchUid):{}}).addCase(Rr.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?{...t.collections,...Hh(r.response.results,t.fields,r.response.searchUid)}:{}}).addCase(Xo,(t,{payload:r})=>t.enabled?t:{enabled:!0,collections:{},fields:{collection:r.collectionField??t.fields.collection,parent:r.parentField??t.fields.parent,child:r.childField??t.fields.child},filterFieldRange:r.numberOfFoldedResults??t.filterFieldRange}).addCase(Zo.pending,(t,{meta:r})=>{let n=r.arg;YP(t,n).isLoadingMoreResults=!0}).addCase(Zo.rejected,(t,{meta:r})=>{let n=r.arg;YP(t,n).isLoadingMoreResults=!1}).addCase(Zo.fulfilled,(t,{payload:{collectionId:r,results:n,rootResult:o,searchUid:a}})=>{let i=Hh(n,t.fields,a,o);if(!i||!i[r])throw new Error(`Unable to create collection ${r} from received results: ${JSON.stringify(n)}. Folding most probably in an invalid state... `);t.collections[r]=i[r],t.collections[r].moreResultsAvailable=!1}));d();c();l();u();d();c();l();u();var ed={id:z},jc=k("querySuggest/register",e=>O(e,{...ed,count:new re({min:0})})),ZP=k("querySuggest/unregister",e=>O(e,ed)),Ln=k("querySuggest/selectSuggestion",e=>O(e,{...ed,expression:Ge})),ea=k("querySuggest/clear",e=>O(e,ed)),ta=xe("querySuggest/fetch",/*#__PURE__*/function(){var _ref74=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,validatePayload:o,navigatorContext:a}}){o(e,ed);let i=e.id,p=yield YG(i,t(),a),f=yield n.querySuggest(p);return At(f)?r(f.error):{id:i,q:p.q,...f.success}});return function(_x168,_x169){return _ref74.apply(this,arguments)}}()),YG=/*#__PURE__*/function(){var _ref75=_asyncToGenerator(function*(e,t,r){return{accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,url:t.configuration.search.apiBaseUrl??vt(t.configuration.organizationId,t.configuration.environment),count:t.querySuggest[e].count,q:t.querySet[e],locale:t.configuration.search.locale,timezone:t.configuration.search.timezone,actionsHistory:t.configuration.analytics.enabled?Nt.getInstance().getHistory():[],...(t.context&&{context:t.context.contextValues}),...(t.pipeline&&{pipeline:t.pipeline}),...(t.searchHub&&{searchHub:t.searchHub}),tab:t.configuration.analytics.originLevel2,...(t.configuration.analytics.enabled&&{...(t.configuration.analytics.enabled&&t.configuration.analytics.analyticsMode==="legacy"?yield Rs(t.configuration.analytics):Qr(t.configuration.analytics,r))}),...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")})}});return function YG(_x170,_x171,_x172){return _ref75.apply(this,arguments)}}();var Ft=ae(dt(),e=>e.addCase(Lt,(t,r)=>({...t,...r.payload})).addCase(xr,(t,r)=>{t.q=r.payload}).addCase(Ln,(t,r)=>{t.q=r.payload.expression}).addCase(qe.fulfilled,(t,r)=>r.payload?.query??t).addCase(Me,(t,r)=>{t.q=r.payload.q??t.q,t.enableQuerySyntax=r.payload.enableQuerySyntax??t.enableQuerySyntax}));d();c();l();u();d();c();l();u();var ra=k("fields/registerFieldsToInclude",e=>O(e,Td)),Lc=k("fields/fetchall/enable"),bi=k("fields/fetchall/disable"),Uc=xe("fields/fetchDescription",/*#__PURE__*/function(){var _ref76=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:a,environment:i,organizationId:p}=o.configuration,{apiBaseUrl:f}=o.configuration.search,m=yield t.apiClient.fieldDescriptions({accessToken:a,organizationId:p,url:f??vt(p,i)});return At(m)?n(m.error):m.success.fields});return function(_x173,_x174){return _ref76.apply(this,arguments)}}());d();c();l();u();d();c();l();u();var Wh=["author","language","urihash","objecttype","collection","source","permanentid"],pC=[...Wh,"date","filetype","parents"],ek=[...pC,"ec_price","ec_name","ec_description","ec_brand","ec_category","ec_item_group_id","ec_shortdesc","ec_thumbnails","ec_images","ec_promo_price","ec_in_stock","ec_rating"],tk=()=>({fieldsToInclude:Wh,fetchAllFields:!1,fieldsDescription:[]});var na=ae(tk(),e=>e.addCase(ra,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(Lc,t=>{t.fetchAllFields=!0}).addCase(bi,t=>{t.fetchAllFields=!1}).addCase(Uc.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(Xo,(t,{payload:r})=>{let n=$h().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));d();c();l();u();function Qc(e){if(!JG(e))throw K;let t=oe(e),r=()=>e.state;return{...t,get state(){let n=r();return{hasError:n.search.error!==null,isLoading:n.search.isLoading,hasResults:!!n.search.results.length,firstSearchExecuted:yl(n)}}}}function JG(e){return e.addReducers({search:he}),!0}var XG=new ve({fieldsToInclude:new se({required:!1,each:new L({required:!0,emptyAllowed:!1})})});function Kh(e,t){if(!ZG(e))throw K;let r=oe(e),n=Qc(e),{dispatch:o}=e,a=()=>e.state,i=He(e,XG,t?.options,"buildCoreResultList");i.fieldsToInclude&&o(ra(i.fieldsToInclude));let p=()=>e.state.search.results.length<e.state.search.response.totalCountFiltered,f=0,m=0,g=5,S=200,x=!1;return{...r,get state(){let C=a();return{...n.state,results:C.search.results,moreResultsAvailable:p(),searchResponseId:C.search.searchResponseId}},fetchMoreResults:function(){var _ref77=_asyncToGenerator(function*(){if(e.state.search.isLoading)return;if(!p()){e.logger.info("No more results are available for the result list to fetch.");return}if(Date.now()-f<S){if(m++,m>=g){f=Date.now(),!x&&e.logger.error(`The result list method "fetchMoreResults" execution prevented because it has been triggered consecutively ${g} times, with little delay. Please verify the conditions under which the function is called.`),x=!0;return}}else m=0;x=!1,t?.fetchMoreResultsActionCreator&&(yield o(t?.fetchMoreResultsActionCreator()),f=Date.now())});return function fetchMoreResults(){return _ref77.apply(this,arguments)}}()}}function ZG(e){return e.addReducers({search:he,configuration:fe,fields:na}),!0}var e2=new ve(lC);function rk(e,t,r){if(!t2(e))throw K;let n=Kh(e,t),{dispatch:o}=e,a=()=>e.state,i=t.options?.folding?He(e,e2,t.options.folding,"buildFoldedResultList"):{};return o(Xo({...i})),{...n,loadCollection:p=>{o(t.loadCollectionActionCreator(p.result.raw[e.state.folding.fields.collection])),o(r.logShowMoreFoldedResults(p.result))},logShowMoreFoldedResults:p=>{o(r.logShowMoreFoldedResults(p))},logShowLessFoldedResults:()=>{o(r.logShowLessFoldedResults())},findResultById(p){return fC(this.state.results,f=>f.result.uniqueId===p.result.uniqueId)},findResultByCollection(p){return fC(this.state.results,f=>f.result.raw.foldingcollection===p.result.raw.foldingcollection)},get state(){let p=a();return{...n.state,results:n.state.results.map(f=>{let m=f.raw[p.folding.fields.collection];return!m||!p.folding.collections[m]?{result:f,moreResultsAvailable:!1,isLoadingMoreResults:!1,children:[]}:p.folding.collections[m]})}}}}function t2(e){return e.addReducers({search:he,configuration:Mf,folding:zh,query:Ft}),!0}function fC(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(t(n))return n;if(n.children.length){let o=fC(n.children,t);if(o)return o}}return null}function nk(e,t={}){let r=rk(e,{...t,loadCollectionActionCreator:Zo,fetchMoreResultsActionCreator:Rr},KP);return{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Bc(e){let t=new Set;return e.filter(r=>{let n=!t.has(r.uri);return n&&t.add(r.uri),n})}var Gc=ae(Yv(),e=>e.addCase(js,(t,{payload:r})=>{t.isVisible=r}).addCase(Qs,(t,{payload:r})=>{t.isEnabled=r}).addCase(wf,(t,{payload:r})=>{t.id=r.id}).addCase(Oa,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,delete t.error;let n=r.textDelta,o=!!t.answer?.trim(),a=n.trim().length>0;if(o){t.answer+=n;return}t.answer=a?n:void 0}).addCase(_a,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.citations=Bc([...t.citations,...r.citations]),delete t.error}).addCase(Na,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!1,t.error={...r,isRetryable:r.code===eS},t.citations=[],delete t.answer}).addCase(Af,t=>{t.liked=!0,t.disliked=!1}).addCase(Cf,t=>{t.liked=!1,t.disliked=!0}).addCase(xf,t=>{t.feedbackModalOpen=!0}).addCase(Rf,t=>{t.feedbackModalOpen=!1}).addCase(Bs,t=>{t.feedbackSubmitted=!0}).addCase(dr,t=>({...Yv(),...(t.answerConfigurationId?{answerConfigurationId:t.answerConfigurationId}:{}),responseFormat:t.responseFormat,fieldsToIncludeInCitations:t.fieldsToIncludeInCitations,isVisible:t.isVisible,id:t.id,answerGenerationMode:t.answerGenerationMode})).addCase(dn,(t,{payload:r})=>{t.isLoading=r}).addCase(ka,(t,{payload:r})=>{t.isStreaming=r}).addCase(Da,(t,{payload:r})=>{t.answerContentFormat=r}).addCase(Ff,(t,{payload:r})=>{t.responseFormat=r}).addCase(If,(t,r)=>{t.fieldsToIncludeInCitations=[...new Set(t.fieldsToIncludeInCitations.concat(r.payload))]}).addCase(Rl,(t,{payload:r})=>{t.isAnswerGenerated=r}).addCase(wl,t=>{t.expanded=!0}).addCase(bf,t=>{t.expanded=!1}).addCase(Ef,(t,{payload:r})=>{t.answerConfigurationId=r}).addCase(qa,(t,{payload:r})=>{t.cannotAnswer=r}).addCase(Xv,(t,{payload:r})=>{t.answerApiQueryParams=r}).addCase(Ls,(t,{payload:r})=>{t.answerId=r}).addCase(Us,(t,{payload:r})=>{t.answerGenerationMode=r}).addCase(Tf,(t,{payload:r})=>{t.generationSteps.push({name:r.name,status:"active",startedAt:r.startedAt})}).addCase(Pf,(t,{payload:r})=>{let n=t.generationSteps.findLast(o=>o.name===r.name&&o.status==="active");n&&(n.status="completed",n.finishedAt=r.finishedAt)}).addCase(kf,(t,{payload:r})=>{let{toolCallName:n,toolCallId:o,startedAt:a}=r,i=t.generationSteps.findLast(p=>p.status==="active");i&&(i.toolCalls=i.toolCalls||[],i.toolCalls.push({toolCallName:n,toolCallId:o,startedAt:a,status:"active"}))}).addCase(Gs,(t,{payload:r})=>{let{toolCallId:n,args:o,type:a}=r,p=t.generationSteps.findLast(f=>f.status==="active")?.toolCalls?.find(f=>f.toolCallId===n);p&&(p.toolCallArgs=o,p.type=a==="search"?"search":"generic")}).addCase(Of,(t,{payload:r})=>{let{toolCallId:n,finishedAt:o}=r,i=t.generationSteps.findLast(p=>p.status==="active")?.toolCalls?.find(p=>p.toolCallId===n);i&&(i.finishedAt=o,i.status="completed")}));d();c();l();u();function $c(e,t,r={}){if(!r2(e))throw K;let{dispatch:n}=e,o=oe(e),a=()=>e.state,i=r.initialState?.isVisible;i!==void 0&&n(js(i));let p=r.initialState?.isEnabled;p!==void 0&&n(Qs(p));let f=r.initialState?.responseFormat;f&&n(Ff(f));let m=r.fieldsToIncludeInCitations;return m&&n(If(m)),r.initialState?.expanded&&n(wl()),{...o,get state(){let S=a().generatedAnswer;return{...S,error:ci(S.error)}},like(){this.state.liked||(n(Af()),n(t.logLikeGeneratedAnswer(this.state.answerId)))},dislike(){this.state.disliked||(n(Cf()),n(t.logDislikeGeneratedAnswer(this.state.answerId)))},openFeedbackModal(){n(xf())},closeFeedbackModal(){n(Rf())},sendFeedback(S){n(t.logGeneratedAnswerFeedback(S)),n(Bs())},logCitationClick(S,x){n(t.logOpenGeneratedAnswerSource(S,x))},logCitationHover(S,x,h){n(t.logHoverCitation(S,x,h))},show(){this.state.isVisible||(n(js(!0)),n(t.logGeneratedAnswerShowAnswers()))},hide(){this.state.isVisible&&(n(js(!1)),n(t.logGeneratedAnswerHideAnswers()))},expand(){this.state.expanded||(n(wl()),n(t.logGeneratedAnswerExpand()))},collapse(){this.state.expanded&&(n(bf()),n(t.logGeneratedAnswerCollapse()))},enable(){this.state.isEnabled||n(Qs(!0))},disable(){this.state.isEnabled&&n(Qs(!1))},logCopyToClipboard(S){n(t.logCopyGeneratedAnswer(S))},retry(){}}}function r2(e){return e.addReducers({generatedAnswer:Gc}),!0}var zt={engines:{},setAbortControllerRef:(e,t)=>{zt.engines[t].abortController=e},getIsStreamInProgress:e=>!zt.engines[e].abortController||zt.engines[e].abortController?.signal.aborted?(zt.engines[e].abortController=void 0,!1):!0,subscribeToSearchRequests:e=>{let t=()=>{let r=e.state,n=r.search.requestId,o=r.search.extendedResults.generativeQuestionAnsweringId,a=r.generatedAnswer.id;if(zt.engines[a].lastRequestId!==n){if(zt.engines[a].lastRequestId=n,zt.engines[a].abortController?.abort(),r.generatedAnswer.isEnabled===!1)return;e.dispatch(dr())}if(!zt.getIsStreamInProgress(a)&&o&&o!==zt.engines[a].lastStreamId){if(zt.engines[a].lastStreamId=o,r.generatedAnswer.isEnabled===!1)return;e.dispatch(qF({setAbortControllerRef:p=>zt.setAbortControllerRef(p,a)}))}};return e.subscribe(t)}};function ok(e,t,r={}){if(!n2(e))throw K;let n=$c(e,t,r),o=()=>e.state;if(e.state.generatedAnswer.id&&!zt.engines[e.state.generatedAnswer.id]&&(zt.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:e.state.search.requestId,lastStreamId:e.state.search.extendedResults.generativeQuestionAnsweringId??""}),!e.state.generatedAnswer.id){let i=go("genQA-",12);e.dispatch(wf({id:i}))}zt.engines[e.state.generatedAnswer.id]||(zt.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:"",lastStreamId:""}),zt.subscribeToSearchRequests(e);let a=i=>"executeFirstSearchAfterStandaloneSearchBoxRedirect"in i;return{...n,get state(){return o().generatedAnswer},retry(){a(e)&&e.dispatch(W({legacy:t.logRetryGeneratedAnswer()}))}}}function n2(e){return e.addReducers({generatedAnswer:Gc}),!0}d();c();l();u();d();c();l();u();var ak=Df.injectEndpoints({endpoints:e=>({post:e.query({query:t=>({url:"/evaluations",method:"POST",body:t})})})});var Yh=e=>e==="yes"?!0:e==="no"?!1:null,o2=({answerApiState:e,feedback:t,query:r})=>({additionalNotes:t.details??null,answer:{text:e.answer,responseId:e.answerId,format:e.contentFormat??"text/plain"},correctAnswerUrl:t.documentUrl??null,details:{correctTopic:Yh(t.correctTopic),documented:Yh(t.documented),hallucinationFree:Yh(t.hallucinationFree),readable:Yh(t.readable)},helpful:t.helpful,question:r}),a2=e=>{let t="",r=()=>{let n=e.state,o=AF(n),a=o.requestId;if(a!==t){if(t=a,e.dispatch(dr()),n.generatedAnswer.isEnabled===!1)return;o.q?.length>0&&(e.dispatch(Us("automatic")),e.dispatch(_f()))}};e.subscribe(r)};function ik(e,t,r={}){if(!i2(e))throw K;Ho(e.state.configuration.analytics.analyticsMode);let{...n}=$c(e,t,r),o=()=>e.state;return e.dispatch(Ef(r.answerConfigurationId)),a2(e),{...n,get state(){let a=Zv(e.state).data,i=o().generatedAnswer;return{...i,answer:a?.answer,citations:Bc(a?.citations??[]),error:ci({message:a?.error?.message,code:a?.error?.code}),isLoading:a?.isLoading??!1,isStreaming:a?.isStreaming??!1,answerContentFormat:a?.contentFormat??"text/plain",isAnswerGenerated:a?.generated??!1,cannotAnswer:i.cannotAnswer||a?.generated===!1&&!a?.isLoading&&!a?.isStreaming}},retry(){let a=gf(o());e.dispatch(Nf(a??Ta))},reset(){e.dispatch(dr())},sendFeedback(a){return _asyncToGenerator(function*(){e.dispatch(t.logGeneratedAnswerFeedback(a));let i=o2({query:o().query.q,feedback:a,answerApiState:Zv(e.state).data});e.dispatch(ak.endpoints.post.initiate(i)),e.dispatch(Bs())})()}}}function i2(e){return e.addReducers({[Ma.reducerPath]:Ma.reducer,query:Ft}),!0}d();c();l();u();d();c();l();u();var mC=class extends cg{requestInit(t){let{q:r,analytics:n,conversationId:o,conversationToken:a,accessToken:i}=t.forwardedProps||{};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${i}`,"Content-Type":"application/json",Accept:"text/event-stream, application/json"},body:JSON.stringify({q:r,analytics:n,conversationId:o,conversationToken:a}),signal:this.abortController.signal}}},sk=(e,t,r)=>new mC({url:`${ug(e,t,r)}/follow-up`});d();c();l();u();var ck=e=>{let t="",r=!1;return{onRunStartedEvent:({event:n})=>{t=n.runId,r=!1,e(Ql(t)),e(hg({answerId:t,isLoading:!1})),e(yg({answerId:t,isStreaming:!0}))},onStepStartedEvent:({event:n})=>{e(Fg({name:n.stepName,startedAt:n.timestamp??Date.now(),answerId:t}))},onStepFinishedEvent:({event:n})=>{e(Eg({name:n.stepName,finishedAt:n.timestamp??Date.now(),answerId:t}))},onToolCallStartEvent:({event:n})=>{let{toolCallName:o,toolCallId:a,timestamp:i}=n;e(Ig({answerId:t,toolCallId:a,toolCallName:o,startedAt:i??Date.now()}))},onToolCallEndEvent:({event:n})=>{let{toolCallId:o,timestamp:a}=n;e(Tg({answerId:t,toolCallId:o,finishedAt:a??Date.now()}))},onToolCallArgsEvent:({event:n})=>{let{toolCallId:o,delta:a}=n;try{let i=JSON.parse(a);typeof i?.q=="string"?e(dc({answerId:t,toolCallId:o,args:i,type:"search"})):e(dc({answerId:t,toolCallId:o,args:{raw:a},type:"generic"}))}catch{console.warn(`Failed to parse tool call args delta as JSON. Using raw string instead. Delta: ${a}`),e(dc({answerId:t,toolCallId:o,args:{raw:a},type:"generic"}))}},onTextMessageContentEvent:({event:n})=>{n.delta.length>0&&(r=!0),e(Sg({textDelta:n.delta,answerId:t}))},onCustomEvent:({event:n})=>{let{name:o,value:a}=n;switch(o){case"header":{a?.contentFormat&&e(gg({contentFormat:a.contentFormat,answerId:t}));return}case"citations":{e(vg({citations:a.citations,answerId:t}));return}}},onRunErrorEvent:({input:n,event:o})=>{t||(t=n.runId,e(Ql(n.runId)));let a=Pg(o.code);e(Cg({message:o.message,code:a,answerId:t})),t=""},onRunFinishedEvent:({event:n})=>{let o=n.result?.completionReason==="ANSWERED",a=o?!r:void 0;e(Ag({cannotAnswer:!o,answerId:t})),e(ll(o,t,a)),e(To(t)),t="",r=!1}}};d();c();l();u();d();c();l();u();function uk(){return{conversationId:"",conversationToken:"",isEnabled:!1,followUpAnswers:[]}}var lk=e=>({question:e,isLoading:!0,isStreaming:!1,citations:[],liked:!1,disliked:!1,feedbackSubmitted:!1,cannotAnswer:!1,isActive:!0,generationSteps:[]});function gC(e){return e.followUpAnswers.find(t=>t.isActive)}function Xt(e,t){return e.followUpAnswers.find(r=>r.answerId===t)}var dk=ae(uk(),e=>e.addCase(lg,(t,{payload:r})=>{t.isEnabled=r}).addCase(dg,(t,{payload:r})=>{t.conversationId=r}).addCase(pg,(t,{payload:r})=>{t.conversationToken=r}).addCase(fg,t=>{t.conversationToken=""}).addCase(mg,(t,{payload:r})=>{let n=gC(t);n&&(n.isActive=!1),t.followUpAnswers.push(lk(r.question))}).addCase(Ql,(t,{payload:r})=>{let n=gC(t);!n||n.answerId||(n.answerId=r)}).addCase(gg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.answerContentFormat=r.contentFormat)}).addCase(hg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.isLoading=r.isLoading)}).addCase(yg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.isStreaming=r.isStreaming)}).addCase(Sg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.answer||(n.answer=""),n.answer+=r.textDelta,delete n.error)}).addCase(vg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.citations=Bc([...n.citations,...r.citations]),delete n.error)}).addCase(Ag,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.isActive=!1,n.cannotAnswer=!!r.cannotAnswer)}).addCase(Cg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message,code:r.code},n.citations=[],delete n.answer)}).addCase(xg,(t,{payload:r})=>{let n=gC(t);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message},n.citations=[],delete n.answer)}).addCase(bg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.liked=!0,n.disliked=!1)}).addCase(wg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.liked=!1,n.disliked=!0)}).addCase($I,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.feedbackSubmitted=!0)}).addCase(Fg,(t,{payload:r})=>{let n=Xt(t,r.answerId);n&&(n.generationSteps=[...n.generationSteps,{name:r.name,status:"active",startedAt:r.startedAt}])}).addCase(Eg,(t,{payload:r})=>{let n=Xt(t,r.answerId);if(!n)return;let o=n.generationSteps.findLast(a=>a.name===r.name&&a.status==="active");o&&(o.status="completed",o.finishedAt=r.finishedAt)}).addCase(Rg,t=>{t.followUpAnswers=[],t.conversationId="",t.conversationToken="",t.isEnabled=!1}).addCase(Ig,(t,{payload:r})=>{let{toolCallName:n,toolCallId:o,startedAt:a,answerId:i}=r,p=Xt(t,i);if(!p)return;let f=p.generationSteps.findLast(m=>m.status==="active");f&&(f.toolCalls=f.toolCalls||[],f.toolCalls.push({toolCallName:n,toolCallId:o,startedAt:a,status:"active"}))}).addCase(dc,(t,{payload:r})=>{let{toolCallId:n,args:o,answerId:a,type:i}=r,p=Xt(t,a);if(!p)return;let m=p.generationSteps.findLast(g=>g.status==="active")?.toolCalls?.find(g=>g.toolCallId===n);m&&(m.toolCallArgs=o,m.type=i==="search"?"search":"generic")}).addCase(Tg,(t,{payload:r})=>{let{toolCallId:n,finishedAt:o,answerId:a}=r,i=Xt(t,a);if(!i)return;let f=i.generationSteps.findLast(m=>m.status==="active")?.toolCalls?.find(m=>m.toolCallId===n);f&&(f.finishedAt=o,f.status="completed")}));function pk(e,t,r){if(!r.agentId||r.agentId.trim()==="")throw new Error("agentId is required for GeneratedAnswerWithFollowUps");if(!s2(e))throw K;let n=$c(e,t,r),o=()=>e.state;e.dispatch(Np(r.agentId));let a=yp(o()),i=hp(o()),p=Sp(o()),f=sk(r.agentId,a,p),m=ck(e.dispatch),g=kg();return{...n,get state(){let S=o().followUpAnswers,x=o().generatedAnswer;return{...x,error:ci(x.error),followUpAnswers:{...S,followUpAnswers:S.followUpAnswers.map(h=>({...h,error:ci(h.error)}))}}},retry(){g.run(e.state,e.dispatch,()=>e.navigatorContext)},like(S){if(!S||this.state.answerId===S){n.like();return}let x=this.state.followUpAnswers.followUpAnswers.find(h=>h.answerId===S);if(!x){console.warn(`No follow-up answer found with ID ${S}. Cannot like.`);return}x.liked||(e.dispatch(bg({answerId:S})),e.dispatch(t.logLikeGeneratedAnswer(S)))},dislike(S){if(!S||this.state.answerId===S){n.dislike();return}let x=this.state.followUpAnswers.followUpAnswers.find(h=>h.answerId===S);if(!x){console.warn(`No follow-up answer found with ID ${S}. Cannot dislike.`);return}x.disliked||(e.dispatch(wg({answerId:S})),e.dispatch(t.logDislikeGeneratedAnswer(S)))},logCopyToClipboard(S){if(!S||this.state.answerId===S){n.logCopyToClipboard();return}e.dispatch(t.logCopyGeneratedAnswer(S))},logCitationClick(S,x){let h=Ue(e.state);!x||x===h?e.dispatch(t.logOpenGeneratedAnswerSource(S,x)):t.logOpenGeneratedAnswerFollowUpSource&&e.dispatch(t.logOpenGeneratedAnswerFollowUpSource(S,x))},logCitationHover(S,x,h){if(!h||this.state.answerId===h){n.logCitationHover(S,x);return}e.dispatch(t.logHoverCitation(S,x,h))},askFollowUp(S){var _this37=this;return _asyncToGenerator(function*(){if(!_this37.state.followUpAnswers.isEnabled||!S||S.trim()==="")return;let x=_this37.state.followUpAnswers.conversationId,h=_this37.state.followUpAnswers.conversationToken;if(!x){console.warn("Missing conversationId when generating a follow-up answer. The generateFollowUpAnswer action requires an existing conversation.");return}if(!h){console.warn("Missing conversationToken when generating a follow-up answer. The generateFollowUpAnswer action requires an existing conversation.");return}f.abortRun(),e.dispatch(mg({question:S}));let C=Qr(o().configuration.analytics,e.navigatorContext);try{yield f.runAgent({forwardedProps:{q:S,analytics:C.analytics,conversationId:x,conversationToken:h,accessToken:i}},m)}catch(b){e.dispatch(xg({message:"An error occurred while starting the follow-up answer generation."})),console.error("Error running the follow-up agent:",b)}})()}}}function s2(e){return e.addReducers({followUpAnswers:dk}),!0}function fk(e,t={}){Ho(e.state.configuration.analytics.analyticsMode);let r;return t.agentId&&t.agentId.trim()!==""?r=pk(e,Cr,{...t,agentId:t.agentId}):t.answerConfigurationId&&t.answerConfigurationId.trim()!==""?r=ik(e,Cr,t):r=ok(e,Cr,t),{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();function Wt(e,t,r){if(!c2(e))throw K;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},a;return{select:Ad(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){a=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){a&&clearTimeout(a)}}}function c2(e){return e.addReducers({configuration:fe}),!0}function mk(e,t,r){let n=!1,o=()=>{n||(n=!0,e.dispatch(t.logCitationOpen(r.options.citation.id,r.options.answerId)))};return Wt(e,r,()=>{o()})}d();c();l();u();function gk(e){return{logCitationOpen(t,r){let n=Ue(e());return r!==void 0&&n!==void 0&&r!==n?dv(t,r):r!==void 0?Mp(t,r):Mp(t)}}}function hk(e,t){return mk(e,gk(()=>e.state),t)}d();c();l();u();d();c();l();u();function yk(e,t,r){let n=!1;return Wt(e,r,()=>{n||(n=!0,e.dispatch(t.logGeneratedAnswerOpenInlineLink(r.options.link,r.options.answerId)))})}function Sk(e,t){return yk(e,Cr,t)}d();c();l();u();d();c();l();u();var Hc=ae(Yp(),e=>{e.addCase(W.fulfilled,u2).addCase(qe.fulfilled,(t,r)=>r.payload?.facetOrder??t)});function u2(e,t){return t.payload.response.facets.map(r=>r.facetId)}d();c();l();u();var Jh=()=>J("history/analytics/forward",e=>e.makeSearchEvent("historyForward")),Xh=()=>J("history/analytics/backward",e=>e.makeSearchEvent("historyBackward")),Zh=()=>J("history/analytics/noresultsback",e=>e.makeNoResultsBack());d();c();l();u();d();c();l();u();var vk=e=>({past:[],present:e,future:[]}),l2=e=>{let{past:t,present:r,future:n}=e;if(!r||t.length===0)return e;let o=t[t.length-1];return{past:t.slice(0,t.length-1),present:o,future:[r,...n]}},d2=e=>{let{past:t,present:r,future:n}=e;if(!r||n.length===0)return e;let o=n[0],a=n.slice(1);return{past:[...t,r],present:o,future:a}},p2=e=>{let{action:t,state:r,reducer:n}=e,{past:o,present:a}=r,i=n(a,t);return a?a===i?r:{past:[...o,a].slice(-10),present:i,future:[]}:vk(i)},Ak=e=>{let{actionTypes:t,reducer:r}=e,n=vk();return(o=n,a)=>{switch(a.type){case t.undo:return l2(o);case t.redo:return d2(o);case t.snapshot:return p2({state:o,reducer:r,action:a});default:return o}}};d();c();l();u();d();c();l();u();var{getOwnPropertyNames:f2,getOwnPropertySymbols:m2}=Object,{hasOwnProperty:g2}=Object.prototype;function hC(e,t){return function(n,o,a){return e(n,o,a)&&t(n,o,a)}}function ey(e){return function(r,n,o){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,o);let{cache:a}=o,i=a.get(r),p=a.get(n);if(i&&p)return i===n&&p===r;a.set(r,n),a.set(n,r);let f=e(r,n,o);return a.delete(r),a.delete(n),f}}function Ck(e){return f2(e).concat(m2(e))}var h2=Object.hasOwn||((e,t)=>g2.call(e,t)),y2="__v",S2="__o",v2="_owner",{getOwnPropertyDescriptor:xk,keys:bk}=Object,wi=Object.is||function(t,r){return t===r?t!==0||1/t===1/r:t!==t&&r!==r};function A2(e,t){return e===t}function C2(e,t){return e.byteLength===t.byteLength&&ty(new Uint8Array(e),new Uint8Array(t))}function x2(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-->0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function b2(e,t){return e.byteLength===t.byteLength&&ty(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function w2(e,t){return wi(e.getTime(),t.getTime())}function R2(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function wk(e,t,r){let n=e.size;if(n!==t.size)return!1;if(!n)return!0;let o=new Array(n),a=e.entries(),i,p,f=0;for(;(i=a.next())&&!i.done;){let m=t.entries(),g=!1,S=0;for(;(p=m.next())&&!p.done;){if(o[S]){S++;continue}let x=i.value,h=p.value;if(r.equals(x[0],h[0],f,S,e,t,r)&&r.equals(x[1],h[1],x[0],h[0],e,t,r)){g=o[S]=!0;break}S++}if(!g)return!1;f++}return!0}function F2(e,t,r){let n=bk(e),o=n.length;if(bk(t).length!==o)return!1;for(;o-->0;)if(!Fk(e,t,r,n[o]))return!1;return!0}function td(e,t,r){let n=Ck(e),o=n.length;if(Ck(t).length!==o)return!1;let a,i,p;for(;o-->0;)if(a=n[o],!Fk(e,t,r,a)||(i=xk(e,a),p=xk(t,a),(i||p)&&(!i||!p||i.configurable!==p.configurable||i.enumerable!==p.enumerable||i.writable!==p.writable)))return!1;return!0}function E2(e,t){return wi(e.valueOf(),t.valueOf())}function I2(e,t){return e.source===t.source&&e.flags===t.flags}function Rk(e,t,r){let n=e.size;if(n!==t.size)return!1;if(!n)return!0;let o=new Array(n),a=e.values(),i,p;for(;(i=a.next())&&!i.done;){let f=t.values(),m=!1,g=0;for(;(p=f.next())&&!p.done;){if(!o[g]&&r.equals(i.value,p.value,i.value,p.value,e,t,r)){m=o[g]=!0;break}g++}if(!m)return!1}return!0}function ty(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-->0;)if(e[r]!==t[r])return!1;return!0}function T2(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function Fk(e,t,r,n){return(n===v2||n===S2||n===y2)&&(e.$$typeof||t.$$typeof)?!0:h2(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var P2=Object.prototype.toString;function k2(e){let t=D2(e),{areArraysEqual:r,areDatesEqual:n,areFunctionsEqual:o,areMapsEqual:a,areNumbersEqual:i,areObjectsEqual:p,areRegExpsEqual:f,areSetsEqual:m,getUnsupportedCustomComparator:g}=e;return function(x,h,C){if(x===h)return!0;if(x==null||h==null)return!1;let b=typeof x;if(b!==typeof h)return!1;if(b!=="object")return b==="number"||b==="bigint"?i(x,h,C):b==="function"?o(x,h,C):!1;let w=x.constructor;if(w!==h.constructor)return!1;if(w===Object)return p(x,h,C);if(w===Array)return r(x,h,C);if(w===Date)return n(x,h,C);if(w===RegExp)return f(x,h,C);if(w===Map)return a(x,h,C);if(w===Set)return m(x,h,C);if(w===Promise)return!1;if(Array.isArray(x))return r(x,h,C);let F=P2.call(x),I=t[F];if(I)return I(x,h,C);let E=g&&g(x,h,C,F);return E?E(x,h,C):!1}}function O2({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:C2,areArraysEqual:r?td:x2,areDataViewsEqual:b2,areDatesEqual:w2,areErrorsEqual:R2,areFunctionsEqual:A2,areMapsEqual:r?hC(wk,td):wk,areNumbersEqual:wi,areObjectsEqual:r?td:F2,arePrimitiveWrappersEqual:E2,areRegExpsEqual:I2,areSetsEqual:r?hC(Rk,td):Rk,areTypedArraysEqual:r?hC(ty,td):ty,areUrlsEqual:T2,getUnsupportedCustomComparator:void 0};if(t&&(n=Object.assign({},n,t(n))),e){let o=ey(n.areArraysEqual),a=ey(n.areMapsEqual),i=ey(n.areObjectsEqual),p=ey(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:i,areSetsEqual:p})}return n}function _2(e){return function(t,r,n,o,a,i,p){return e(t,r,p)}}function N2({circular:e,comparator:t,createState:r,equals:n,strict:o}){if(r)return function(p,f){let{cache:m=e?new WeakMap:void 0,meta:g}=r();return t(p,f,{cache:m,equals:n,meta:g,strict:o})};if(e)return function(p,f){return t(p,f,{cache:new WeakMap,equals:n,meta:void 0,strict:o})};let a={cache:void 0,equals:n,meta:void 0,strict:o};return function(p,f){return t(p,f,a)}}function D2({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:o,areFunctionsEqual:a,areMapsEqual:i,areNumbersEqual:p,areObjectsEqual:f,arePrimitiveWrappersEqual:m,areRegExpsEqual:g,areSetsEqual:S,areTypedArraysEqual:x,areUrlsEqual:h}){return{"[object Arguments]":f,"[object Array]":t,"[object ArrayBuffer]":e,"[object AsyncGeneratorFunction]":a,"[object BigInt]":p,"[object BigInt64Array]":x,"[object BigUint64Array]":x,"[object Boolean]":m,"[object DataView]":r,"[object Date]":n,"[object Error]":o,"[object Float16Array]":x,"[object Float32Array]":x,"[object Float64Array]":x,"[object Function]":a,"[object GeneratorFunction]":a,"[object Int8Array]":x,"[object Int16Array]":x,"[object Int32Array]":x,"[object Map]":i,"[object Number]":m,"[object Object]":(C,b,w)=>typeof C.then!="function"&&typeof b.then!="function"&&f(C,b,w),"[object RegExp]":g,"[object Set]":S,"[object String]":m,"[object URL]":h,"[object Uint8Array]":x,"[object Uint8ClampedArray]":x,"[object Uint16Array]":x,"[object Uint32Array]":x}}var yC=Un(),Rze=Un({strict:!0}),Fze=Un({circular:!0}),Eze=Un({circular:!0,strict:!0}),Ize=Un({createInternalComparator:()=>wi}),Tze=Un({strict:!0,createInternalComparator:()=>wi}),Pze=Un({circular:!0,createInternalComparator:()=>wi}),kze=Un({circular:!0,createInternalComparator:()=>wi,strict:!0});function Un(e={}){let{circular:t=!1,createInternalComparator:r,createState:n,strict:o=!1}=e,a=O2(e),i=k2(a),p=r?r(i):_2(i);return N2({circular:t,comparator:i,createState:n,equals:p,strict:o})}function Ri(e,t,r=(n,o)=>n===o){return e.length===t.length&&e.findIndex((n,o)=>!r(t[o],n))===-1}function q2(e,t){return e.length!==t.length?!1:e.every(r=>t.findIndex(n=>rd(r,n))!==-1)}var rd=Un({createCustomConfig:e=>({...e,areArraysEqual:q2})});var M2=ae(RR(),e=>{e.addCase(lr,(t,r)=>V2(t,r.payload)?void 0:r.payload)}),V2=(e,t)=>j2(e.context,t.context)&&L2(e.dictionaryFieldContext,t.dictionaryFieldContext)&&z2(e.advancedSearchQueries,t.advancedSearchQueries)&&U2(e.tabSet,t.tabSet)&&Q2(e.staticFilterSet,t.staticFilterSet)&&SC(e.facetSet,t.facetSet)&&SC(e.dateFacetSet,t.dateFacetSet)&&SC(e.numericFacetSet,t.numericFacetSet)&&G2(e.automaticFacetSet,t.automaticFacetSet)&&B2(e.categoryFacetSet,t.categoryFacetSet)&&$2(e.pagination,t.pagination)&&H2(e.query,t.query)&&W2(e,t)&&K2(e.pipeline,t.pipeline)&&Y2(e.searchHub,t.searchHub)&&J2(e.facetOrder,t.facetOrder)&&X2(e.debug,t.debug),j2=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),L2=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),U2=(e,t)=>{let r=Ek(e),n=Ek(t);return r?.id===n?.id},Ek=e=>Object.values(e).find(t=>t.isActive),Q2=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=Ik(e[r]),a=Ik(n);if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},Ik=e=>e.values.filter(t=>t.state!=="idle"),SC=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=e[r].request.currentValues.filter(i=>i.state!=="idle"),a=n.request.currentValues.filter(i=>i.state!=="idle");if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},B2=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=cr(e[r]?.request.currentValues).map(({value:i})=>i),a=cr(n?.request.currentValues).map(({value:i})=>i);if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},G2=(e,t)=>{for(let[r,n]of Object.entries(t.set)){if(!e.set[r])return!1;let o=e.set[r].response.values.filter(i=>i.state!=="idle"),a=n.response.values.filter(i=>i.state!=="idle");if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},$2=(e,t)=>e.firstResult===t.firstResult&&e.numberOfResults===t.numberOfResults,H2=(e,t)=>JSON.stringify(e)===JSON.stringify(t),z2=(e,t)=>JSON.stringify(e)===JSON.stringify(t),W2=(e,t)=>e.sortCriteria===t.sortCriteria,K2=(e,t)=>e===t,Y2=(e,t)=>e===t,J2=(e,t)=>Ri(e,t),X2=(e,t)=>e===t,ry=Ak({actionTypes:{redo:fv.type,undo:pv.type,snapshot:lr.type},reducer:M2});function Tk(e){if(!Z2(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state,o=a=>a.past.length>0&&!pe(a.present);return{...t,subscribe(a){a();let i=JSON.stringify(n().history.present),p=()=>{let f=JSON.stringify(n().history.present);i!==f&&(i=f,a())};return e.subscribe(()=>p())},get state(){return n().history},back(){var _this38=this;return _asyncToGenerator(function*(){o(_this38.state)&&(yield r(dl()),r(W({legacy:Xh()})))})()},forward(){var _this39=this;return _asyncToGenerator(function*(){!_this39.state.future.length||!_this39.state.present||(yield r(Vp()),r(W({legacy:Jh()})))})()},backOnNoResults(){var _this40=this;return _asyncToGenerator(function*(){o(_this40.state)&&(yield r(dl()),r(W({legacy:Zh()})))})()}}}function Z2(e){return e.addReducers({history:ry,configuration:fe,facetOrder:Hc}),!0}d();c();l();u();d();c();l();u();var e$={results:new se({required:!0,each:new X({values:Ip})}),maxLength:new re({required:!0,min:1,default:10})},zc=k("recentResults/registerRecentResults",e=>O(e,e$)),_r=k("recentResults/pushRecentResult",e=>(Zt(e),{payload:e})),Wc=k("recentResults/clearRecentResults");function Pk(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(aR(t.options.result)))};return Wt(e,t,()=>{n(),e.dispatch(_r(t.options.result))})}d();c();l();u();d();c();l();u();function ny(e){return e?e.expiresAt&&Date.now()>=e.expiresAt:!1}d();c();l();u();d();c();l();u();var kk=(e,t)=>{let{id:r}=e;if(!t[r])return t[r]={q:"",cache:{}},t},Ok=(e,t)=>{let{q:r,id:n}=e;r&&(t[n].q=r)},_k=(e,t)=>{let{id:r}=e;Object.entries(t[r].cache).forEach(([n,o])=>{ny(o)&&delete t[r].cache[n]})},Nk=(e,t,r)=>{for(let o in t)for(let a in t[o].cache)t[o].cache[a].isActive=!1;if(!vC(e,t)){t$(e,t,r);return}let n=vC(e,t);n.isLoading=!0,n.isActive=!0,n.error=null},Dk=(e,t,r)=>{let{id:n,q:o,searchUid:a,cacheTimeout:i,totalCountFiltered:p,duration:f}=e;t[n].cache[o]={...vC(e,t),...r,isActive:!0,searchUid:a,isLoading:!1,error:null,expiresAt:i?i+Date.now():0,totalCountFiltered:p,duration:f}},qk=(e,t)=>{let{id:r,q:n,error:o}=e;t[r].cache[n].error=o||null,t[r].cache[n].isLoading=!1,t[r].cache[n].isActive=!1},vC=(e,t)=>{let{q:r,id:n}=e;return t[n].cache[r]||null},t$=(e,t,r)=>{let{q:n,id:o}=e;t[o].cache[n]={isLoading:!0,error:null,expiresAt:0,isActive:!0,searchUid:"",totalCountFiltered:0,duration:0,...r}};d();c();l();u();function Mk(){return{}}var oy=ae(Mk(),e=>{e.addCase(ys,(t,r)=>{kk(r.payload,t)}),e.addCase(sn,(t,r)=>{Ok(r.payload,t)}),e.addCase(Ss,(t,r)=>{_k(r.payload,t)}),e.addCase(ks.pending,(t,r)=>{Nk(r.meta.arg,t,{results:[]})}),e.addCase(ks.fulfilled,(t,r)=>{let n=r.payload.results.map(o=>({...o,searchUid:r.payload.searchUid}));Dk({...r.payload,...r.meta.arg},t,{results:n})}),e.addCase(ks.rejected,(t,r)=>{qk(r.meta.arg,t)})});d();c();l();u();var r$={searchBoxId:st,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re},Vk=new ve(r$);function jk(e,t){if(!n$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a={searchBoxId:t.options.searchBoxId||go("instant-results-"),cacheTimeout:t.options.cacheTimeout||6e4,maxResultsPerQuery:t.options.maxResultsPerQuery};He(e,Vk,a,"buildInstantResults");let i=a.searchBoxId;n(ys({id:i}));let p=()=>o().instantResults[i],f=S=>p().cache[S],m=()=>p().q,g=()=>{let S=f(m());return S?S.isLoading?[]:S.results:[]};return{...r,updateQuery(S){if(!S)return;let x=f(S);(!x||!x.isLoading&&(x.error||ny(x)))&&n(ks({id:i,q:S,maxResultsPerQuery:a.maxResultsPerQuery,cacheTimeout:a.cacheTimeout})),n(sn({id:i,q:S}))},clearExpired(){n(Ss({id:i}))},get state(){let S=m(),x=f(S);return{q:S,isLoading:x?.isLoading||!1,error:x?.error||null,results:g()}}}}function n$(e){return e.addReducers({instantResults:oy}),!0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Nr=ae(br(),e=>{e.addCase(vs,(t,r)=>{let n=AC(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=nd(n,o)}).addCase(As,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(yt,t=>{t.firstResult=0}).addCase(Cs,(t,r)=>{let n=r.payload;t.firstResult=nd(n,t.numberOfResults)}).addCase(cn,(t,r)=>{let n=r.payload;t.firstResult=nd(n,t.numberOfResults)}).addCase(bs,t=>{let r=AC(t),n=Math.max(r-1,1);t.firstResult=nd(n,t.numberOfResults)}).addCase(xs,t=>{let r=AC(t),n=o$(t),o=Math.min(r+1,n);t.firstResult=nd(o,t.numberOfResults)}).addCase(qe.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(Me,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(W.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(Ut.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(nt,t=>{Kt(t)}).addCase(On,t=>{Kt(t)}).addCase(In,t=>{Kt(t)}).addCase(Mn,t=>{Kt(t)}).addCase(gi,t=>{Kt(t)}).addCase(En,t=>{Kt(t)}).addCase(An,t=>{Kt(t)}).addCase(Wo,t=>{Kt(t)}).addCase(yc,t=>{Kt(t)}).addCase(kn,t=>{Kt(t)}).addCase(qn,t=>{Kt(t)}).addCase(ft,t=>{Kt(t)}).addCase(uo,t=>{Kt(t)}).addCase(lo,t=>{Kt(t)}).addCase(mi,t=>{Kt(t)}).addCase(Sn,t=>{Kt(t)})});function Kt(e){e.firstResult=br().firstResult}function AC(e){let{firstResult:t,numberOfResults:r}=e;return CC(t,r)}function o$(e){let{totalCountFiltered:t,numberOfResults:r}=e;return xC(t,r)}function nd(e,t){return(e-1)*t}function CC(e,t){return Math.round(e/t)+1}function xC(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function a$(e){return e.pagination.firstResult}function Lk(e){return e.pagination.numberOfResults}function i$(e){return e.pagination.totalCountFiltered}var mo=e=>{let t=a$(e),r=Lk(e);return CC(t,r)},od=e=>{let t=i$(e),r=Lk(e);return xC(t,r)},ay=(e,t)=>{let r=mo(e),n=od(e),o=s$(r,t);return o=c$(o),o=u$(o,n),l$(o)};function s$(e,t){let r=t%2===0,n=Math.floor(t/2),o=r?n-1:n,a=e-n,i=e+o;return{start:a,end:i}}function c$(e){let t=Math.max(1-e.start,0),r=e.start+t,n=e.end+t;return{start:r,end:n}}function u$(e,t){let r=Math.max(e.end-t,0),n=Math.max(e.start-r,1),o=e.end-r;return{start:n,end:o}}function l$(e){let t=[];for(let r=e.start;r<=e.end;++r)t.push(r);return t}var Yc=()=>J("analytics/pager/resize",(e,t)=>e.makePagerResize({currentResultsPerPage:t.pagination?.numberOfResults||br().numberOfResults})),Jc=()=>J("analytics/pager/number",(e,t)=>e.makePagerNumber({pagerNumber:mo(t)})),iy=()=>J("analytics/pager/next",(e,t)=>e.makePagerNext({pagerNumber:mo(t)})),sy=()=>J("analytics/pager/previous",(e,t)=>e.makePagerPrevious({pagerNumber:mo(t)})),Xc=()=>({actionCause:"browseResults"});d();c();l();u();var d$=new ve({numberOfPages:new re({default:5,min:0})}),p$=new ve({page:new re({min:1})});function Uk(e,t={}){if(!f$(e))throw K;let r=oe(e),{dispatch:n}=e,o=He(e,d$,t.options,"buildPager"),i=lt(e,p$,t.initialState,"buildPager").page;i&&n(Cs(i));let p=()=>mo(e.state),f=()=>{let{numberOfPages:g}=o;return ay(e.state,g)},m=()=>od(e.state);return{...r,get state(){let g=p(),S=m(),x=g>1&&S>0,h=g<S;return{currentPage:g,currentPages:f(),maxPage:S,hasPreviousPage:x,hasNextPage:h}},selectPage(g){n(cn(g))},nextPage(){n(xs())},previousPage(){n(bs())},isCurrentPage(g){return g===this.state.currentPage}}}function f$(e){return e.addReducers({configuration:fe,pagination:Nr}),!0}function Qk(e,t={}){let{dispatch:r}=e,n=Uk(e,t);return{...n,get state(){return n.state},selectPage(o){n.selectPage(o),r(Ut({legacy:Jc(),next:Xc()}))},nextPage(){n.nextPage(),r(Ut({legacy:iy(),next:Xc()}))},previousPage(){n.previousPage(),r(Ut({legacy:sy(),next:Xc()}))}}}d();c();l();u();d();c();l();u();function Bk(e){if(!m$(e))throw K;let t=oe(e),r=()=>e.state;return{...t,get state(){return{hasError:r().search.error!==null,error:r().search.error}}}}function m$(e){return e.addReducers({search:he}),!0}function Gk(e){return Bk(e)}d();c();l();u();d();c();l();u();function $k(e){if(!g$(e))throw K;let t=oe(e),r=Qc(e),n=()=>e.state,o=()=>{let a=n().search.duration/1e3;return Math.round((a+Number.EPSILON)*100)/100};return{...t,get state(){return{...r.state,durationInMilliseconds:n().search.duration,durationInSeconds:o(),firstResult:n().pagination.firstResult+1,hasDuration:n().search.duration!==0,hasQuery:n().search.queryExecuted!=="",lastResult:n().pagination.firstResult+n().search.results.length,query:n().search.queryExecuted,total:n().pagination.totalCountFiltered}}}}function g$(e){return e.addReducers({search:he,pagination:Nr}),!0}function Hk(e){return $k(e)}d();c();l();u();d();c();l();u();d();c();l();u();function cy(_x175,_x176){return _cy.apply(this,arguments)}function _cy(){_cy=_asyncToGenerator(function*(e,t){let{search:r,accessToken:n,organizationId:o}=e.configuration,a=e.query?.q||"";return{url:r.apiBaseUrl??vt(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 _cy.apply(this,arguments)}var Fi=xe("resultPreview/fetchResultContent",/*#__PURE__*/function(){var _ref78=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),a=yield cy(o,e),i=yield t.apiClient.html(a);return At(i)?n(i.error):{content:i.success,uniqueId:e.uniqueId}});return function(_x177,_x178){return _ref78.apply(this,arguments)}}()),Zc=k("resultPreview/next"),eu=k("resultPreview/previous"),tu=k("resultPreview/prepare",e=>O(e,{results:new se({required:!0})})),zk=2048,ru=xe("resultPreview/updateContentURL",/*#__PURE__*/function(){var _ref79=_asyncToGenerator(function*(e,{getState:t,extra:r}){let n=t(),o=Dx(yield e.buildResultPreviewRequest(n,{uniqueId:e.uniqueId,requestedOutputSize:e.requestedOutputSize}),e.path);return o?.length>zk&&r.logger.error(`The content URL was truncated as it exceeds the maximum allowed length of ${zk} characters.`),{contentURL:o}});return function(_x179,_x180){return _ref79.apply(this,arguments)}}());d();c();l();u();var Wk=e=>J({prefix:"analytics/resultPreview/open",__legacy__getBuilder:(t,r)=>{Zt(e);let n=pt(e,r),o=Ke(e);return t.makeDocumentQuickview(n,o)},analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=pt(e,t),n=Ke(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});d();c();l();u();d();c();l();u();d();c();l();u();function bC(){return{uniqueId:"",content:"",isLoading:!1,position:-1,resultsWithPreview:[]}}var wC=e=>{let{content:t,isLoading:r,uniqueId:n,contentURL:o}=bC();e.content=t,e.isLoading=r,e.uniqueId=n,e.contentURL=o},RC=e=>e.filter(t=>t.hasHtmlVersion).map(t=>t.uniqueId),uy=ae(bC(),e=>{e.addCase(Fi.pending,t=>{t.isLoading=!0}).addCase(Fi.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(W.fulfilled,(t,r)=>{wC(t),t.resultsWithPreview=RC(r.payload.response.results)}).addCase(Rr.fulfilled,(t,r)=>{wC(t),t.resultsWithPreview=t.resultsWithPreview.concat(RC(r.payload.response.results))}).addCase(Ut.fulfilled,wC).addCase(tu,(t,r)=>{t.resultsWithPreview=RC(r.payload.results)}).addCase(Zc,t=>{if(t.isLoading)return;let r=t.position+1;r>t.resultsWithPreview.length-1&&(r=0),t.position=r}).addCase(eu,t=>{if(t.isLoading)return;let r=t.position-1;r<0&&(r=t.resultsWithPreview.length-1),t.position=r}).addCase(ru.fulfilled,(t,r)=>{t.contentURL=r.payload.contentURL})});function Kk(e,t,r,n,o){if(!h$(e))throw K;let{dispatch:a}=e,i=()=>e.state,p=oe(e),{result:f,maximumPreviewSize:m}=t.options,g=()=>{let{resultsWithPreview:x,position:h}=i().resultPreview;return x[h]},S=x=>{a(ru({uniqueId:x,requestedOutputSize:m,buildResultPreviewRequest:r,path:n})),t.options.onlyContentURL||a(Fi({uniqueId:x,requestedOutputSize:m})),o&&o()};return{...p,fetchResultContent(){S(f.uniqueId)},next(){a(Zc()),S(g())},previous(){a(eu()),S(g())},get state(){let x=i(),h=f.hasHtmlVersion,C=x.resultPreview,b=f.uniqueId===C.uniqueId?C.content:"",w=C.isLoading,F=C.contentURL,I=g();return{content:b,resultHasPreview:h,isLoading:w,contentURL:F,currentResultUniqueId:I}}}}function h$(e){return e.addReducers({configuration:fe,resultPreview:uy}),!0}function Yk(e,t){if(!y$(e))throw K;let{dispatch:r}=e,n=()=>e.state,o=()=>n().search.results,p=Kk(e,t,cy,"/html",()=>{e.dispatch(Wk(t.options.result))});return r(tu({results:o()})),{...p,get state(){return{...p.state,currentResult:o().findIndex(f=>f.uniqueId===p.state.currentResultUniqueId)+1,totalResults:o().length}}}}function y$(e){return e.addReducers({search:he}),!0}d();c();l();u();d();c();l();u();var Jk=()=>J("analytics/recentQueries/clear",e=>e.makeClearRecentQueries()),Xk=()=>J("analytics/recentQueries/click",e=>e.makeRecentQueryClick());d();c();l();u();d();c();l();u();var S$={queries:new se({required:!0,each:new L({emptyAllowed:!1})}),maxLength:new re({required:!0,min:1,default:10})},Ei=k("recentQueries/registerRecentQueries",e=>O(e,S$)),nu=k("recentQueries/clearRecentQueries");d();c();l();u();d();c();l();u();function Zk(){return{queries:[],maxLength:10}}var ly=ae(Zk(),e=>{e.addCase(Ei,v$).addCase(nu,A$).addCase(W.fulfilled,(t,r)=>{let n=r.payload.queryExecuted,o=r.payload.response.results;!n.length||!o.length||C$(n,t)})});function v$(e,t){e.queries=Array.from(new Set(t.payload.queries.map(r=>r.trim().toLowerCase()))).slice(0,t.payload.maxLength),e.maxLength=t.payload.maxLength}function A$(e){e.queries=[]}function C$(e,t){let r=e.trim().toLowerCase();if(r==="")return;let n=Array.from(new Set(t.queries.filter(o=>o.trim().toLowerCase()!==r))).slice(0,t.maxLength-1);t.queries=[r,...n]}var x$={queries:[]},b$={maxLength:10,clearFilters:!0},w$=new ve({queries:new se({required:!0})}),R$=new ve({maxLength:new re({required:!0,min:1}),clearFilters:new de});function F$(e,t){He(e,R$,t?.options,"buildRecentQueriesList"),lt(e,w$,t?.initialState,"buildRecentQueriesList")}function eO(e,t){if(!E$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a={...b$,...t?.options},i={...x$,...t?.initialState};F$(e,{options:a,initialState:i});let p={queries:i.queries,maxLength:a.maxLength};return n(Ei(p)),{...r,get state(){let f=o();return{...f.recentQueries,analyticsEnabled:f.configuration.analytics.enabled}},clear(){n(nu())},updateRecentQueries(f){let m=new se({required:!0,each:new L({required:!0}),min:1}).validate(f);if(m)throw new Error(m);n(Ei({queries:f,maxLength:a.maxLength}))},executeRecentQuery(f){let m=new re({required:!0,min:0,max:this.state.queries.length}).validate(f);if(m)throw new Error(m);let g={q:this.state.queries[f],clearFilters:a.clearFilters};hd(e.state.query?.enableQuerySyntax)&&(g.enableQuerySyntax=e.state.query.enableQuerySyntax),n(Ps(g))}}}function E$(e){return e.addReducers({search:he,recentQueries:ly,query:Ft}),!0}function tO(e,t){let r=eO(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},clear(){n(Jk()),r.clear()},executeRecentQuery(o){r.executeRecentQuery(o),n(W({legacy:Xk(),next:{actionCause:"recentQueriesClick"}}))}}}d();c();l();u();d();c();l();u();var rO=e=>J("analytics/recentResults/click",(t,r)=>(Zt(e),t.makeRecentResultClick(pt(e,r),Ke(e)))),nO=()=>J("analytics/recentResults/clear",e=>e.makeClearRecentResults());function oO(e,t){return Wt(e,t,()=>e.dispatch(rO(t.options.result)))}d();c();l();u();d();c();l();u();d();c();l();u();function aO(){return{results:[],maxLength:10}}var dy=ae(aO(),e=>{e.addCase(zc,(t,r)=>{t.results=r.payload.results.slice(0,r.payload.maxLength),t.maxLength=r.payload.maxLength}).addCase(Wc,t=>{t.results=[]}).addCase(_r,(t,r)=>{let n=r.payload;t.results=t.results.filter(a=>a.uniqueId!==n.uniqueId);let o=t.results.slice(0,t.maxLength-1);t.results=[n,...o]})});var I$={initialState:{results:[]},options:{maxLength:10}},T$=new ve({results:new se({required:!0})}),P$=new ve({maxLength:new re({required:!0,min:1})});function k$(e,t){He(e,P$,t?.options,"buildRecentResultsList"),lt(e,T$,t?.initialState,"buildRecentResultsList")}function iO(e,t){if(!O$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a={...I$,...t};k$(e,a);let i={results:a.initialState.results,maxLength:a.options.maxLength};return n(zc(i)),{...r,get state(){return o().recentResults},clear(){n(nO()),n(Wc())}}}function O$(e){return e.addReducers({recentResults:dy}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var cO=e=>{let t=/Document weights:\n((?:.)*?)\n+/g,r=/Terms weights:\n((?:.|\n)*)\n+/g,n=/Total weight: ([0-9]+)/g;if(!e)return null;let o=t.exec(e),a=r.exec(e),i=n.exec(e),p=N$(e),f=uO(o?o[1]:null),m=_$(a),g=i?Number(i[1]):null;return{documentWeights:f,termsWeight:m,totalWeight:g,qreWeights:p}},uO=e=>{let t=/(\w+(?:\s\w+)*): ([-0-9]+)/g,r=/^(\w+(?:\s\w+)*): ([-0-9]+)$/;if(!e)return null;let n=e.match(t);if(!n)return null;let o={};for(let a of n){let i=a.match(r);if(i){let p=i[1],f=i[2];o[p]=Number(f)}}return o},sO=(e,t)=>{let r=[],n;for(;n=t.exec(e),n!==null;)r.push(n);return r},_$=e=>{let t=/((?:[^:]+: [0-9]+, [0-9]+; )+)\n((?:\w+: [0-9]+; )+)/g,r=/([^:]+): ([0-9]+), ([0-9]+); /g;if(!e||!e[1])return null;let n=sO(e[1],t);if(!n)return null;let o={};for(let a of n){let i=sO(a[1],r),p={};for(let m of i)p[m[1]]={Correlation:Number(m[2]),"TF-IDF":Number(m[3])};let f=uO(a[2]);o[Object.keys(p).join(", ")]={terms:p,Weights:f}}return o},N$=e=>{let t=/(Expression:\s".*")\sScore:\s(?!0)([-0-9]+)\n+/g,r=t.exec(e),n=[];for(;r;)n.push({expression:r[1],score:parseInt(r[2],10)}),r=t.exec(e);return n};function lO(e){return e.search.response.results.map(r=>{let n=cO(r.rankingInfo);return{result:r,ranking:n}})}var D$=new ve({enabled:new de({default:!1})});function dO(e,t={}){if(!q$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state;lt(e,D$,t.initialState,"buildRelevanceInspector").enabled&&n(Eo());let i=p=>{e.logger.warn(`Flag [ ${p} ] is now activated. This should *not* be used in any production environment as it negatively impact performance.`)};return{...r,get state(){let p=o(),f=p.debug;if(!p.debug)return{isEnabled:f};let{executionReport:m,basicExpression:g,advancedExpression:S,constantExpression:x,userIdentities:h,rankingExpressions:C}=p.search.response,{fieldsDescription:b,fetchAllFields:w}=p.fields;return{isEnabled:f,rankingInformation:lO(p),executionReport:m,expressions:{basicExpression:g,advancedExpression:S,constantExpression:x},userIdentities:h,rankingExpressions:C,fieldsDescription:b,fetchAllFields:w}},enable(){n(Eo()),i("debug")},disable(){n(ps()),n(bi())},enableFetchAllFields(){n(Lc()),i("fetchAllFields")},disableFetchAllFields(){n(bi())},fetchFieldsDescription(){!this.state.isEnabled&&n(Eo()),n(Uc()),i("fieldsDescription"),e.logger.warn(`For production environment, please specify the necessary fields either when instantiating a ResultList controller, or by dispatching a registerFieldsToInclude action.
|
|
47
47
|
|
|
48
48
|
https://docs.coveo.com/en/headless/latest/reference/interfaces/Search.ResultListOptions.html
|
|
49
|
-
https://docs.coveo.com/en/headless/latest/reference/interfaces/Search.FieldActionCreators.html#registerfieldstoinclude`)}}}function P$(e){return e.addReducers({debug:ps,search:he,configuration:fe,fields:na}),!0}d();c();u();l();d();c();u();l();var uy=e=>J({prefix:"analytics/result/open",__legacy__getBuilder:(t,r)=>(Zt(e),t.makeDocumentOpen(pt(e,r),Ke(e))),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=pt(e,t),n=Ke(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});function sO(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(uy(t.options.result)))};return Wt(e,t,()=>{n(),e.dispatch(Nr(t.options.result))})}d();c();u();l();function cO(e,t){return zh(e,{...t,fetchMoreResultsActionCreator:Rr})}d();c();u();l();d();c();u();l();var k$=new ve({numberOfResults:new re({min:0})});function lO(e,t={}){if(!O$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,i=ut(e,k$,t.initialState,"buildResultsPerPage").numberOfResults;return i!==void 0&&n(Ss(i)),{...r,get state(){return{numberOfResults:o().pagination.numberOfResults}},set(p){n(vs(p))},isSetTo(p){return p===this.state.numberOfResults}}}function O$(e){return e.addReducers({pagination:_r,configuration:fe}),!0}function uO(e,t={}){if(!N$(e))throw K;let r=lO(e,t),{dispatch:n}=e;return{...r,get state(){return{...r.state}},set(o){r.set(o),n(Ut({legacy:Wc(),next:Yc()}))}}}function N$(e){return e.addReducers({pagination:_r,configuration:fe}),!0}d();c();u();l();d();c();u();l();var oa=()=>J("analytics/searchbox/submit",e=>e.makeSearchboxSubmit()),dy=()=>({actionCause:"searchboxSubmit"});d();c();u();l();d();c();u();l();var dO={id:z,query:Ge},rl=P("querySet/register",e=>O(e,dO)),Ei=P("querySet/update",e=>O(e,dO));d();c();u();l();var aa=ae(Kp(),e=>{e.addCase(rl,(t,r)=>D$(t,r.payload)).addCase(Ei,(t,r)=>{let{id:n,query:o}=r.payload;wC(t,n,o)}).addCase(Ln,(t,r)=>{let{id:n,expression:o}=r.payload;wC(t,n,o)}).addCase(W.fulfilled,(t,r)=>{let{queryExecuted:n}=r.payload;pO(t,n)}).addCase(Me,_$).addCase(qe.fulfilled,(t,r)=>{if(r.payload)for(let[n,o]of Object.entries(r.payload.querySet))wC(t,n,o)})});function _$(e,t){pe(t.payload.q)||pO(e,t.payload.q)}function pO(e,t){Object.keys(e).forEach(r=>{e[r]=t})}var wC=(e,t,r)=>{t in e&&(e[t]=r)},D$=(e,t)=>{let{id:r,query:n}=t;r in e||(e[r]=n)};d();c();u();l();var py=e=>J("analytics/querySuggest",(t,r)=>{let n=RC(r,e);return t.makeOmniboxAnalytics(n)}),fO=()=>({actionCause:"omniboxAnalytics"});function RC(e,t){let{id:r,suggestion:n}=t,o=e.querySuggest?.[r];if(!o)throw new Error(`Unable to determine the query suggest analytics metadata to send because no query suggest with id "${r}" was found. Please check the sent #id.`);let a=o.completions.map(m=>m.expression),i=o.partialQueries.length-1,p=o.partialQueries[i]||"",f=o.responseId;return{suggestionRanking:a.indexOf(n),partialQuery:p,partialQueries:o.partialQueries,suggestions:a,querySuggestResponseId:f}}d();c();u();l();d();c();u();l();function mO(e,t){let r=t.id;r in e||(e[r]=q$(t))}function gO(e,t){let r=e[t.meta.arg.id];r&&(r.currentRequestId=t.meta.requestId,r.isLoading=!0)}function hO(e,t){let r=e[t.meta.arg.id];r&&(r.error=t.payload||null,r.isLoading=!1)}function yO(e,t){let r=e[t.id];r&&(r.responseId="",r.completions=[],r.partialQueries=[])}function q$(e){return{id:"",completions:[],responseId:"",count:5,currentRequestId:"",error:null,partialQueries:[],isLoading:!1,...e}}d();c();u();l();var SO=()=>({});var nl=ae(SO(),e=>e.addCase(Mc,(t,r)=>{mO(t,r.payload)}).addCase(WP,(t,r)=>{delete t[r.payload.id]}).addCase(ta.pending,gO).addCase(ta.fulfilled,(t,r)=>{let n=t[r.meta.arg.id];if(!n||r.meta.requestId!==n.currentRequestId)return;let{q:o}=r.payload;o&&n.partialQueries.push(o.replace(/;/,encodeURIComponent(";"))),n.responseId=r.payload.responseId,n.completions=r.payload.completions,n.isLoading=!1,n.error=null}).addCase(ta.rejected,hO).addCase(ea,(t,r)=>{yO(t,r.payload)}).addCase(ks,(t,r)=>{Object.keys(t).forEach(n=>{let o=t[n];o&&(o.error=r.payload,o.isLoading=!1)})}));d();c();u();l();var fy={enableQuerySyntax:!1,numberOfSuggestions:5,clearFilters:!0},FC={open:new L,close:new L},EC={id:z,numberOfSuggestions:new re({min:0}),enableQuerySyntax:new de,highlightOptions:new X({values:{notMatchDelimiters:new X({values:FC}),exactMatchDelimiters:new X({values:FC}),correctionDelimiters:new X({values:FC})}}),clearFilters:new de},vO=new ve(EC);function AO(e,t){if(!j$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=t.options?.id||go("search_box"),i={id:a,highlightOptions:{...t.options?.highlightOptions},...fy,...t.options};He(e,vO,i,"buildSearchBox"),n(rl({id:a,query:e.state.query.q})),i.numberOfSuggestions&&n(Mc({id:a,count:i.numberOfSuggestions})),i.enableQuerySyntax&&n(Lt({enableQuerySyntax:i.enableQuerySyntax}));let p=()=>e.state.querySet[i.id],f=/*#__PURE__*/function(){var _ref81=_asyncToGenerator(function*(m){let{enableQuerySyntax:g,clearFilters:y}=i;n(Ts({q:p(),enableQuerySyntax:g,clearFilters:y})),t.isNextAnalyticsReady?n(t.executeSearchActionCreator(m)):n(t.executeSearchActionCreator(m.legacy))});return function f(_x182){return _ref81.apply(this,arguments)}}();return{...r,updateText(m){n(Ei({id:a,query:m})),this.showSuggestions()},clear(){n(Ei({id:a,query:""})),n(ea({id:a}))},showSuggestions(){i.numberOfSuggestions&&n(t.fetchQuerySuggestionsActionCreator({id:a}))},selectSuggestion(m){n(Ln({id:a,expression:m})),f({legacy:py({id:a,suggestion:m}),next:fO()}).then(()=>{n(ea({id:a}))})},submit(m=oa(),g){f({legacy:m,next:g}),n(ea({id:a}))},get state(){let m=o(),g=m.querySuggest[i.id],y=M$(g,i.highlightOptions),x=g?g.isLoading:!1;return{searchBoxId:a,value:p(),suggestions:y,isLoading:m.search.isLoading,isLoadingSuggestions:x}}}}function M$(e,t){return e?e.completions.map(r=>({highlightedValue:zy(r.highlighted,t),rawValue:r.expression})):[]}function j$(e){return e.addReducers({query:Ft,querySuggest:nl,configuration:fe,querySet:aa,search:he}),!0}function my(e,t={}){let r=AO(e,{...t,executeSearchActionCreator:W,fetchQuerySuggestionsActionCreator:ta,isNextAnalyticsReady:!0});return{...r,submit(){r.submit(oa(),dy())},get state(){return r.state}}}d();c();u();l();d();c();u();l();d();c();u();l();var ol=()=>J("analytics/sort/results",(e,t)=>e.makeResultsSort({resultsSortBy:t.sortCriteria||vr()})),gy=()=>({actionCause:"resultsSort"});function xO(e,t){return e.q!==t.q?oa():e.sortCriteria!==t.sortCriteria?ol():e.firstResult!==t.firstResult?Kc():e.numberOfResults!==t.numberOfResults?Wc():Dr(e.f,t.f)?nd(e.f,t.f):Dr(e.fExcluded,t.fExcluded)?nd(e.fExcluded,t.fExcluded,!0):Dr(e.cf,t.cf)?nd(e.cf,t.cf):Dr(e.af,t.af)?nd(e.af,t.af):Dr(e.nf,t.nf)?CO(e.nf,t.nf):Dr(e.df,t.df)?CO(e.df,t.df):Ro()}function nd(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),a=n.filter(x=>!o.includes(x));if(a.length){let x=a[0];switch(!0){case e[x].length>1:return bt(x);case r:return io({facetId:x,facetValue:e[x][0]});default:return Kr({facetId:x,facetValue:e[x][0]})}}let i=o.filter(x=>!n.includes(x));if(i.length){let x=i[0];return r?fr({facetId:x,facetValue:t[x][0]}):it({facetId:x,facetValue:t[x][0]})}let p=o.find(x=>t[x].filter(v=>e[x].includes(v)));if(!p)return Ro();let f=e[p],m=t[p],g=m.filter(x=>!f.includes(x));if(g.length)return r?fr({facetId:p,facetValue:g[0]}):it({facetId:p,facetValue:g[0]});let y=f.filter(x=>!m.includes(x));return y.length?r?io({facetId:p,facetValue:y[0]}):Kr({facetId:p,facetValue:y[0]}):Ro()}function CO(e={},t={}){return nd(il(e),il(t))}function bO(e,t){return e.q!==t.q?dy():e.sortCriteria!==t.sortCriteria?gy():Dr(e.f,t.f)?al(e.f,t.f):Dr(e.fExcluded,t.fExcluded)?al(e.fExcluded,t.fExcluded,!0):Dr(e.cf,t.cf)?al(e.cf,t.cf):Dr(e.af,t.af)?al(e.af,t.af):Dr(e.nf,t.nf)?al(il(e.nf),il(t.nf)):Dr(e.df,t.df)?al(il(e.df),il(t.df)):ss()}function Dr(e={},t={}){return JSON.stringify(e)!==JSON.stringify(t)}function al(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),a=n.filter(x=>!o.includes(x));if(a.length){let x=a[0];return e[x].length>1?$t():co()}if(o.filter(x=>!n.includes(x)).length)return r?so():gt();let p=o.find(x=>t[x].filter(v=>e[x].includes(v)));if(!p)return ss();let f=e[p],m=t[p];return m.filter(x=>!f.includes(x)).length?r?so():gt():f.filter(x=>!m.includes(x)).length?co():ss()}function il(e={}){let t={};return Object.keys(e).forEach(r=>{t[r]=e[r].map(n=>`${n.start}..${n.end}`)}),t}d();c();u();l();d();c();u();l();function wO(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{q:n}:{}}function RO(e,t,r){if(e===void 0)return{};let n=t(e);return!gC(n,r)?{sortCriteria:n}:{}}function hy(e,t,r,n){if(e===void 0)return{};let o=Object.entries(e).filter(([a])=>t(a)).map(([a,{request:i}])=>{let p=r(i);return p.length?{[a]:p}:{}}).reduce((a,i)=>({...a,...i}),{});return Object.keys(o).length?{[n]:o}:{}}function FO(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{tab:n}:{}}d();c();u();l();function EO(e){return{q:dt().q,enableQuerySyntax:dt().enableQuerySyntax,aq:e.advancedSearchQueries?.defaultFilters.aq??Br().defaultFilters.aq,cq:e.advancedSearchQueries?.defaultFilters.cq??Br().defaultFilters.cq,firstResult:br().firstResult,numberOfResults:e.pagination?.defaultNumberOfResults??br().defaultNumberOfResults,sortCriteria:vr(),f:{},fExcluded:{},cf:{},nf:{},df:{},debug:Io(),sf:{},tab:"",af:{},mnf:{}}}var V$=new ve({parameters:new X({options:{required:!0},values:Np})});function PO(e,t){let{dispatch:r}=e,n=oe(e);ut(e,V$,t.initialState,"buildSearchParameterManager");let o=IO(e.state.tabSet,t.initialState.parameters);return r(Me(o)),{...n,synchronize(a){let i=IO(e.state.tabSet,yy(e,a));r(Me(i))},get state(){return{parameters:IC(e)}}}}function yy(e,t){let n={...EO(e.state),...t},o={};if(e.state.dateFacetSet)for(let i of Object.keys(e.state.dateFacetSet))o[i]=[];let a={};if(e.state.numericFacetSet)for(let i of Object.keys(e.state.numericFacetSet))a[i]=[];return{...n,df:{...o,...n.df},nf:{...a,...n.nf}}}function IO(e,t){if(pe(t.tab)||!e)return t;if(t.tab==="")return{...t,tab:TO(e)};if(!Object.values(e).some(n=>n.id===t.tab)){let n=Object.values(e).find(o=>o.isActive);return{...t,tab:n?.id??TO(e)}}return t}function TO(e){return Object.keys(e)[0]??""}function IC(e){let t=e.state;return{...wO(t.query,r=>r.q,dt().q),...FO(t.tabSet,r=>{let n=Object.values(r??{}).find(o=>o.isActive);return n?n.id:Object.keys(r??{})[0]},t.tabSet?Object.keys(t.tabSet)[0]:""),...RO(t.sortCriteria,r=>r,vr()),...U$(t),...Q$(t),...B$(t),...G$(t),...$$(t)}}function L$(e){let t=e.tabSet;return t?Object.values(t).find(n=>n.isActive)?.id:void 0}function Sy(e){let t=L$(e);return r=>{let n=e.facetOptions?.facets[r],o=n?.enabled??!0,a=or(n?.tabs,t);return o&&a}}function kO(e){return e.currentValues.filter(t=>t.state==="selected")}function U$(e){let t=e.facetSet;if(t===void 0)return{};let r=Sy(e),n={},o={};for(let[a,{request:i}]of Object.entries(t)){if(!r(a))continue;let p=i.currentValues.filter(m=>m.state==="selected").map(m=>m.value),f=i.currentValues.filter(m=>m.state==="excluded").map(m=>m.value);p.length&&(n[a]=p),f.length&&(o[a]=f)}return{...(Object.keys(n).length?{f:n}:{}),...(Object.keys(o).length?{fExcluded:o}:{})}}function Q$(e){return hy(e.categoryFacetSet,Sy(e),t=>cr(t.currentValues).map(r=>r.value),"cf")}function B$(e){return hy(e.numericFacetSet,Sy(e),kO,"nf")}function G$(e){return hy(e.dateFacetSet,Sy(e),kO,"df")}function $$(e){let t=e.automaticFacetSet?.set;if(t===void 0)return{};let r=Object.entries(t).map(([n,{response:o}])=>{let a=H$(o);return a.length?{[n]:a}:{}}).reduce((n,o)=>({...n,...o}),{});return Object.keys(r).length?{af:r}:{}}function H$(e){return e.values.filter(t=>t.state==="selected").map(t=>t.value)}function vy(e,t){let{dispatch:r}=e,n=PO(e,t);return{...n,synchronize(o){let a=OO(e),i=yy(e,a),p=yy(e,o);ed(i,p)||(n.synchronize(o),r(W({legacy:xO(i,p),next:bO(i,p)})))},get state(){return{parameters:OO(e)}}}}function OO(e){let t=e.state;return{...IC(e),...z$(t),...W$(t),...K$(t),...Y$(t),...J$(t),...eH(t),...X$(t)}}function z$(e){if(e.query===void 0)return{};let t=e.query.enableQuerySyntax;return t!==void 0&&t!==dt().enableQuerySyntax?{enableQuerySyntax:t}:{}}function W$(e){if(e.advancedSearchQueries===void 0)return{};let{aq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.aq?{aq:t}:{}}function K$(e){if(e.advancedSearchQueries===void 0)return{};let{cq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.cq?{cq:t}:{}}function Y$(e){if(e.pagination===void 0)return{};let t=e.pagination.firstResult;return t!==br().firstResult?{firstResult:t}:{}}function J$(e){if(e.pagination===void 0)return{};let{numberOfResults:t,defaultNumberOfResults:r}=e.pagination;return t!==r?{numberOfResults:t}:{}}function X$(e){if(e.staticFilterSet===void 0)return{};let t=Object.entries(e.staticFilterSet).map(([r,n])=>{let o=Z$(n.values);return o.length?{[r]:o}:{}}).reduce((r,n)=>({...r,...n}),{});return Object.keys(t).length?{sf:t}:{}}function Z$(e){return e.filter(t=>t.state==="selected").map(t=>t.caption)}function eH(e){if(e.debug===void 0)return{};let t=e.debug;return t!==Io()?{debug:t}:{}}d();c();u();l();function NO(e){return Lc(e)}d();c();u();l();d();c();u();l();d();c();u();l();var Ay=()=>new X({values:{questionAnswerId:z},options:{required:!0}}),TC=()=>new X({values:{linkText:Ge,linkURL:Ge},options:{required:!0}});function sl(e){return O(e,Ay())}d();c();u();l();function ct(e,t){let r=t??e.search?.questionAnswer?.documentId;return r&&e.search&&jR(e,r.contentIdKey,r.contentIdValue)}function Yr(e,t){let r=e.questionAnswering?.relatedQuestions.findIndex(o=>o.questionAnswerId===t)??-1;return r===-1?null:e.search?.questionAnswer?.relatedQuestions?.[r]??null}var PC=()=>J({prefix:"analytics/smartSnippet/expand",__legacy__getBuilder:e=>e.makeExpandSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{action:"expand",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),kC=()=>J({prefix:"analytics/smartSnippet/collapse",__legacy__getBuilder:e=>e.makeCollapseSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{action:"collapse",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),OC=()=>J({prefix:"analytics/smartSnippet/like",__legacy__getBuilder:e=>e.makeLikeSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{action:"like",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),NC=()=>J({prefix:"analytics/smartSnippet/dislike",__legacy__getBuilder:e=>e.makeDislikeSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{action:"dislike",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),_C=()=>J({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(e,t)=>{let r=ct(t);return e.makeOpenSmartSnippetSource(pt(r,t),Ke(r))},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),od=e=>J({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(t,r)=>{O(e,TC());let n=ct(r);return n?t.makeOpenSmartSnippetInlineLink(pt(n,r),{...Ke(n),...e}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=ct(t),n=Ke(r),o=t.search?.response.searchUid;if(o)return{snippetType:"SmartSnippet",responseId:o,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri}}}}),DC=()=>J("analytics/smartSnippet/feedbackModal/open",e=>e.makeOpenSmartSnippetFeedbackModal()),qC=()=>J("analytics/smartSnippet/feedbackModal/close",e=>e.makeCloseSmartSnippetFeedbackModal()),tH={does_not_answer:"doesNotAnswer",partially_answers:"partiallyAnswers",was_not_a_question:"wasNotAQuestion"},MC=e=>J({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:t=>t.makeSmartSnippetFeedbackReason(e),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=ct(t),n=Ke(r),o=t.search?.response.searchUid;if(o)return{responseId:o,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:tH[e]}}}),jC=e=>J({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:t=>t.makeSmartSnippetFeedbackReason("other",e),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=ct(t),n=Ke(r),o=t.search?.response.searchUid;if(o)return{responseId:o,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:"other",additionalNotes:e}}}),VC=e=>J({prefix:"analytics/smartSnippetSuggestion/expand",__legacy__getBuilder:(t,r)=>{sl(e);let n=Yr(r,e.questionAnswerId);return n?t.makeExpandSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Yr(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=ct(t,r.documentId);return{action:"expand",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),LC=e=>J({prefix:"analytics/smartSnippetSuggestion/collapse",__legacy__getBuilder:(t,r)=>{sl(e);let n=Yr(r,e.questionAnswerId);return n?t.makeCollapseSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Yr(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=ct(t,r.documentId);return{action:"collapse",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),ad=e=>J({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(t,r)=>{O(e,Ay());let n=Yr(r,e.questionAnswerId);if(!n)return null;let o=ct(r,n.documentId);return o?t.makeOpenSmartSnippetSuggestionSource(pt(o,r),{question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=Yr(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=ct(t,r.documentId);return{responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),Cy=(e,t)=>J({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(r,n)=>{O(e,Ay()),O(t,TC());let o=Yr(n,e.questionAnswerId);if(!o)return null;let a=ct(n,o.documentId);return a?r.makeOpenSmartSnippetSuggestionInlineLink(pt(a,n),{question:o.question,answerSnippet:o.answerSnippet,documentId:o.documentId,linkText:t.linkText,linkURL:t.linkURL}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:r=>{let n=Yr(r,e.questionAnswerId),o=r.search?.response.searchUid;if(o&&n){let a=ct(r,n.documentId);return{responseId:o,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:n.documentId.contentIdKey,uniqueFieldValue:n.documentId.contentIdValue,title:a?.title,url:a?.clickUri}}}}}),xy={logExpandSmartSnippet:PC,logCollapseSmartSnippet:kC,logLikeSmartSnippet:OC,logDislikeSmartSnippet:NC,logOpenSmartSnippetSource:_C,logOpenSmartSnippetInlineLink:od,logOpenSmartSnippetFeedbackModal:DC,logCloseSmartSnippetFeedbackModal:qC,logSmartSnippetFeedback:MC,logSmartSnippetDetailedFeedback:jC,logExpandSmartSnippetSuggestion:VC,logCollapseSmartSnippetSuggestion:LC,logOpenSmartSnippetSuggestionSource:ad};d();c();u();l();d();c();u();l();var cl=P("smartSnippet/expand"),ll=P("smartSnippet/collapse"),ul=P("smartSnippet/like"),dl=P("smartSnippet/dislike"),pl=P("smartSnippet/feedbackModal/open"),ia=P("smartSnippet/feedbackModal/close"),fl=P("smartSnippet/related/expand",e=>sl(e)),ml=P("smartSnippet/related/collapse",e=>sl(e));d();c();u();l();d();c();u();l();var UC=()=>({liked:!1,disliked:!1,expanded:!1,feedbackModalOpen:!1,relatedQuestions:[]});var _O=(e,t)=>e.findIndex(r=>r.questionAnswerId===t.questionAnswerId);function DO({question:e,answerSnippet:t,documentId:{contentIdKey:r,contentIdValue:n}}){return _i({question:e,answerSnippet:t,contentIdKey:r,contentIdValue:n})}function rH(e,t){let r=DO(e);return t&&r===t.questionAnswerId?t:{contentIdKey:e.documentId.contentIdKey,contentIdValue:e.documentId.contentIdValue,expanded:!1,questionAnswerId:r}}var Qn=ae(UC(),e=>e.addCase(cl,t=>{t.expanded=!0}).addCase(ll,t=>{t.expanded=!1}).addCase(ul,t=>{t.liked=!0,t.disliked=!1,t.feedbackModalOpen=!1}).addCase(dl,t=>{t.liked=!1,t.disliked=!0}).addCase(pl,t=>{t.feedbackModalOpen=!0}).addCase(ia,t=>{t.feedbackModalOpen=!1}).addCase(W.fulfilled,(t,r)=>{let n=r.payload.response.questionAnswer.relatedQuestions.map((a,i)=>rH(a,t.relatedQuestions[i])),o=DO(r.payload.response.questionAnswer);return t.questionAnswerId===o?{...t,relatedQuestions:n}:{...UC(),relatedQuestions:n,questionAnswerId:o}}).addCase(fl,(t,r)=>{let n=_O(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!0)}).addCase(ml,(t,r)=>{let n=_O(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!1)}));function qO(e,t,r){if(!nH(e))throw K;let n=oe(e),o=()=>e.state,a=()=>ct(o()),i=null,p=Wt(e,{options:{selectionDelay:r?.options?.selectionDelay}},()=>{let f=a();if(!f){i=null;return}let{searchResponseId:m}=o().search;i!==m&&(i=m,e.dispatch(t.logOpenSmartSnippetSource()),e.dispatch(Nr(f)))});return{...n,get state(){let f=o();return{question:f.search.questionAnswer.question,answer:f.search.questionAnswer.answerSnippet,documentId:f.search.questionAnswer.documentId,expanded:f.questionAnswering.expanded,answerFound:f.search.questionAnswer.answerSnippet!=="",liked:f.questionAnswering.liked,disliked:f.questionAnswering.disliked,feedbackModalOpen:f.questionAnswering.feedbackModalOpen,source:a()}},expand(){e.dispatch(t.logExpandSmartSnippet()),e.dispatch(cl())},collapse(){e.dispatch(t.logCollapseSmartSnippet()),e.dispatch(ll())},like(){e.dispatch(t.logLikeSmartSnippet()),e.dispatch(ul())},dislike(){e.dispatch(t.logDislikeSmartSnippet()),e.dispatch(dl())},openFeedbackModal(){e.dispatch(t.logOpenSmartSnippetFeedbackModal()),e.dispatch(pl())},closeFeedbackModal(){e.dispatch(t.logCloseSmartSnippetFeedbackModal()),e.dispatch(ia())},sendFeedback(f){e.dispatch(t.logSmartSnippetFeedback(f)),e.dispatch(ia())},sendDetailedFeedback(f){e.dispatch(t.logSmartSnippetDetailedFeedback(f)),e.dispatch(ia())},selectSource(){p.select()},beginDelayedSelectSource(){p.beginDelayedSelect()},cancelPendingSelectSource(){p.cancelPendingSelect()}}}function nH(e){return e.addReducers({search:he,questionAnswering:Qn}),!0}d();c();u();l();function by(e,t){if(!oH(e))throw K;let r=()=>e.state,n=new Set,o=g=>n.has(g)?!0:(n.add(g),!1),a=null,i=g=>{a!==g&&(a=g,f={},n.clear())},p=(g,y,x)=>Wt(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{o(y)||e.dispatch(x?Cy({questionAnswerId:x},g):od(g))}),f={},m=(g,y)=>{let{searchResponseId:x}=r().search;i(x);let v=_i({...g,questionAnswerId:y});return v in f||(f[v]=p(g,v,y)),f[v]};return{selectInlineLink(g,y){m(g,y)?.select()},beginDelayedSelectInlineLink(g,y){m(g,y)?.beginDelayedSelect()},cancelPendingSelectInlineLink(g,y){m(g,y)?.cancelPendingSelect()}}}function oH(e){return e.addReducers({search:he,questionAnswering:Qn}),!0}function MO(e,t){Ho(e.state.configuration.analytics.analyticsMode);let r=qO(e,xy,t),n=by(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectInlineLink(o){n.selectInlineLink(o)},beginDelayedSelectInlineLink(o){n.beginDelayedSelectInlineLink(o)},cancelPendingSelectInlineLink(o){n.cancelPendingSelectInlineLink(o)}}}d();c();u();l();d();c();u();l();function jO(e,t){if(!aH(e))throw K;let r=oe(e),n=()=>e.state,o=a=>{let{contentIdKey:i,contentIdValue:p}=a;return e.state.search.results.find(f=>Vo(f,i)===p)};return{...r,get state(){let a=n();return{questions:a.search.questionAnswer.relatedQuestions.map((i,p)=>({question:i.question,answer:i.answerSnippet,documentId:i.documentId,questionAnswerId:a.questionAnswering.relatedQuestions[p].questionAnswerId,expanded:a.questionAnswering.relatedQuestions[p].expanded,source:o(i.documentId)}))}},expand(a){let i={questionAnswerId:a};e.dispatch(t.logExpandSmartSnippetSuggestion(i)),e.dispatch(fl(i))},collapse(a){let i={questionAnswerId:a};e.dispatch(t.logCollapseSmartSnippetSuggestion(i)),e.dispatch(ml(i))}}}function aH(e){return e.addReducers({search:he,questionAnswering:Qn}),!0}d();c();u();l();function VO(e,t){if(!iH(e))throw K;let r=()=>e.state,n=y=>{let x=r(),v=Yr(x,y);return v?ct(x,v.documentId):null},o=new Set,a=y=>o.has(y)?!0:(o.add(y),!1),i=null,p=y=>{i!==y&&(i=y,m={},o.clear())},f=(y,x)=>Wt(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{a(x)||(e.dispatch(ad({questionAnswerId:x})),e.dispatch(Nr(y)))}),m={},g=y=>{let{searchResponseId:x}=r().search;p(x);let v=n(y);return v?(y in m||(m[y]=f(v,y)),m[y]):null};return{selectSource(y){g(y)?.select()},beginDelayedSelectSource(y){g(y)?.beginDelayedSelect()},cancelPendingSelectSource(y){g(y)?.cancelPendingSelect()}}}function iH(e){return e.addReducers({search:he,questionAnswering:Qn}),!0}function LO(e,t){Ho(e.state.configuration.analytics.analyticsMode);let r=jO(e,xy),n=by(e,{options:{selectionDelay:t?.options?.selectionDelay}}),o=VO(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectSource(a){o.selectSource(a)},beginDelayedSelectSource(a){o.beginDelayedSelectSource(a)},cancelPendingSelectSource(a){o.cancelPendingSelectSource(a)},selectInlineLink(a,i){n.selectInlineLink(i,a)},beginDelayedSelectInlineLink(a,i){n.beginDelayedSelectInlineLink(i,a)},cancelPendingSelectInlineLink(a,i){n.cancelPendingSelectInlineLink(i,a)}}}d();c();u();l();d();c();u();l();d();c();u();l();var UO={by:new Tl({enum:xa,required:!0})},gl=P("sortCriteria/register",e=>QO(e)),hl=P("sortCriteria/update",e=>QO(e)),QO=e=>Ni(e)?(e.forEach(t=>O(t,UO)),{payload:e}):O(e,UO);d();c();u();l();var wy=ae(vr(),e=>{e.addCase(gl,(t,r)=>rn(r.payload)).addCase(hl,(t,r)=>rn(r.payload)).addCase(qe.fulfilled,(t,r)=>r.payload?.sortCriteria??t).addCase(Me,(t,r)=>r.payload.sortCriteria??t)});function sH(e,t){if(!t)return;let r=new ve({criterion:new ie({each:Nw})}),n=cH(t),o={...t,criterion:n};ut(e,r,o,"buildSort")}function cH(e){return e.criterion?Ni(e.criterion)?e.criterion:[e.criterion]:[]}function BO(e,t){if(!lH(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state;sH(e,t.initialState);let a=t.initialState?.criterion;return a&&n(gl(a)),{...r,sortBy(i){n(hl(i)),n(cn(1))},isSortedBy(i){return this.state.sortCriteria===rn(i)},get state(){return{sortCriteria:o().sortCriteria}}}}function lH(e){return e.addReducers({configuration:fe,sortCriteria:wy}),!0}function GO(e,t={}){let{dispatch:r}=e,n=BO(e,t),o=()=>r(W({legacy:ol(),next:gy()}));return{...n,get state(){return n.state},sortBy(a){n.sortBy(a),o()}}}d();c();u();l();d();c();u();l();d();c();u();l();d();c();u();l();function $O(e){return e.type==="redirect"}var Ry=class{constructor(t){me(this,"response",t)}get basicExpression(){return this.response.parsedInput.basicExpression}get largeExpression(){return this.response.parsedInput.largeExpression}get redirectionUrl(){let t=this.response.preprocessingOutput.triggers.filter($O);return t.length?t[0].content:null}};var yl=P("standaloneSearchBox/register",e=>O(e,{id:z,redirectionUrl:z,overwrite:new de({required:!1})})),Sl=P("standaloneSearchBox/updateRedirectionUrl",e=>O(e,{id:z,redirectionUrl:z})),vl=P("standaloneSearchBox/reset",e=>O(e,{id:z})),Al=P("standaloneSearchBox/updateAnalyticsToSearchFromLink",e=>O(e,{id:z})),Cl=P("standaloneSearchBox/updateAnalyticsToOmniboxFromLink"),sa=xe("standaloneSearchBox/fetchRedirect",/*#__PURE__*/function(){var _ref82=_asyncToGenerator(function*(e,{dispatch:t,getState:r,rejectWithValue:n,extra:{apiClient:o,validatePayload:a,navigatorContext:i}}){a(e,{id:new L({emptyAllowed:!1})});let p=yield dH(r(),i),f=yield o.plan(p);if(At(f))return n(f.error);let{redirectionUrl:m}=new Ry(f.success);return m&&t(uH(m)),m||""});return function(_x183,_x184){return _ref82.apply(this,arguments)}}()),uH=e=>J("analytics/standaloneSearchBox/redirect",t=>t.makeTriggerRedirect({redirectedTo:e})),dH=/*#__PURE__*/function(){var _ref83=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??vt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,timezone:e.configuration.search.timezone,q:e.query.q,...(e.context&&{context:e.context.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.query.enableQuerySyntax!==void 0&&{enableQuerySyntax:e.query.enableQuerySyntax}),...(e.configuration.analytics.enabled&&e.configuration.analytics.analyticsMode==="legacy"?yield ws(e.configuration.analytics):Qr(e.configuration.analytics,t)),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function dH(_x185,_x186){return _ref83.apply(this,arguments)}}();d();c();u();l();d();c();u();l();function HO(){return{}}var Fy=ae(HO(),e=>e.addCase(yl,(t,r)=>{let{id:n,redirectionUrl:o,overwrite:a}=r.payload;!a&&n in t||(t[n]=QC(o))}).addCase(vl,(t,r)=>{let{id:n}=r.payload,o=t[n];if(o){t[n]=QC(o.defaultRedirectionUrl);return}}).addCase(Sl,(t,r)=>{let{id:n,redirectionUrl:o}=r.payload;n in t&&(t[n]=QC(o))}).addCase(sa.pending,(t,r)=>{let n=t[r.meta.arg.id];n&&(n.isLoading=!0)}).addCase(sa.fulfilled,(t,r)=>{let n=r.payload,o=t[r.meta.arg.id];o&&(o.redirectTo=n||o.defaultRedirectionUrl,o.isLoading=!1)}).addCase(sa.rejected,(t,r)=>{let n=t[r.meta.arg.id];n&&(n.isLoading=!1)}).addCase(Al,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="searchFromLink")}).addCase(Cl,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="omniboxFromLink",n.analytics.metadata=r.payload.metadata)}));function QC(e){return{defaultRedirectionUrl:e,redirectTo:"",isLoading:!1,analytics:{cause:"",metadata:null}}}d();c();u();l();var zO=new ve({...EC,redirectionUrl:new L({required:!0,emptyAllowed:!1}),overwrite:new de({required:!1})});function WO(e,t){if(!pH(e))throw K;let{dispatch:r}=e,n=()=>e.state,o=t.options.id||go("standalone_search_box"),a={id:o,highlightOptions:{...t.options.highlightOptions},...fy,overwrite:!1,...t.options};He(e,zO,a,"buildStandaloneSearchBox");let i=my(e,{options:a});return r(yl({id:o,redirectionUrl:a.redirectionUrl,overwrite:a.overwrite})),{...i,updateText(p){i.updateText(p),r(Al({id:o}))},selectSuggestion(p){let f=RC(n(),{id:o,suggestion:p});r(Ln({id:o,expression:p})),r(Cl({id:o,metadata:f})),this.submit()},afterRedirection(){r(vl({id:o}))},updateRedirectUrl(p){r(Sl({id:o,redirectionUrl:p}))},submit(){r(Lt({q:this.state.value,enableQuerySyntax:a.enableQuerySyntax})),r(sa({id:o}))},get state(){let f=n().standaloneSearchBoxSet[o];return{...i.state,isLoading:f.isLoading,redirectTo:f.redirectTo,analytics:f.analytics}}}}function pH(e){return e.addReducers({standaloneSearchBoxSet:Fy,configuration:fe,query:Ft,querySuggest:nl}),!0}d();c();u();l();d();c();u();l();var Ey=ae(Yp(),e=>e.addCase(Rc,(t,r)=>{let n=r.payload,{id:o}=n;o in t||(t[o]=n)}).addCase(po,(t,r)=>{let{id:n,value:o}=r.payload,a=t[n];if(!a)return;let i=a.values.find(f=>f.caption===o.caption);if(!i)return;let p=i.state==="selected";i.state=p?"idle":"selected"}).addCase(fo,(t,r)=>{let{id:n,value:o}=r.payload,a=t[n];if(!a)return;let i=a.values.find(f=>f.caption===o.caption);if(!i)return;let p=i.state==="excluded";i.state=p?"idle":"excluded"}).addCase(Jo,(t,r)=>{let n=r.payload,o=t[n];o&&o.values.forEach(a=>{a.state="idle"})}).addCase(ft,t=>{Object.values(t).forEach(r=>{r.values.forEach(n=>{n.state="idle"})})}).addCase(Me,(t,r)=>{let n=r.payload.sf||{};Object.entries(t).forEach(([o,a])=>{let i=n[o]||[];a.values.forEach(p=>{p.state=i.includes(p.caption)?"selected":"idle"})})}));d();c();u();l();function BC(e){return{state:"idle",...e}}var fH=new ve({id:Si,values:ih});function KO(e,t){if(!mH(e))throw K;He(e,fH,t.options,"buildStaticFilter");let r=oe(e),{dispatch:n}=e,o=()=>e.state,{id:a}=t.options;return n(Rc(t.options)),{...r,toggleSelect(i){n(po({id:a,value:i})),n(W({legacy:Iy(a,i)}))},toggleSingleSelect(i){i.state==="idle"&&n(Jo(a)),n(po({id:a,value:i})),n(W({legacy:Iy(a,i)}))},toggleExclude(i){n(fo({id:a,value:i})),n(W({legacy:Iy(a,i)}))},toggleSingleExclude(i){i.state==="idle"&&n(Jo(a)),n(fo({id:a,value:i})),n(W({legacy:Iy(a,i)}))},deselectAll(){n(Jo(a)),n(W({legacy:ch({staticFilterId:a})}))},isValueSelected(i){return i.state==="selected"},isValueExcluded(i){return i.state==="excluded"},get state(){let i=o().staticFilterSet[a]?.values||[],p=i.some(f=>f.state!=="idle");return{id:a,values:i,hasActiveValues:p}}}}function mH(e){return e.addReducers({staticFilterSet:Ey}),!0}function Iy(e,t){let{caption:r,expression:n,state:o}=t;return(o==="idle"?sh:Fc)({staticFilterId:e,staticFilterValue:{caption:r,expression:n}})}d();c();u();l();d();c();u();l();var gH=new ve({expression:Ge,id:z,clearFiltersOnTabChange:new de}),hH=new ve({isActive:new de});function YO(e,t){if(SH(t.options.id),!yH(e))throw K;let r=oe(e),{dispatch:n}=e;He(e,gH,t.options,"buildTab");let o=ut(e,hH,t.initialState,"buildTab"),{id:a,expression:i}=t.options;return n(Gs({id:a,expression:i})),Object.keys(e.state.tabSet).length===1&&(o.isActive=!0),o.isActive&&n(yt(a)),{...r,select(){t.options.clearFiltersOnTabChange&&n(Ts({q:"",clearFilters:!0})),n(yt(a))},get state(){return{isActive:e.state.tabSet[a]?.isActive}}}}function yH(e){return e.addReducers({configuration:fe,tabSet:Ec}),!0}function SH(e){let t=$s().analytics.originLevel2;if(e===t)throw new Error(`The #id option on the Tab controller cannot use the reserved value "${t}". Please specify a different value.`)}function JO(e,t){let{dispatch:r}=e,n=YO(e,t),o=()=>r(W({legacy:Ro(),next:ss()}));return{...n,get state(){return n.state},select(){n.select(),o()}}}d();c();u();l();function XO(e){let t=ph(e);return{...t,get state(){return t.state}}}d();c();u();l();d();c();u();l();d();c();u();l();function ZO(e){return e.query="",e.queryModification={originalQuery:"",newQuery:"",queryToIgnore:e.queryModification.queryToIgnore},e}function e0(e,t){let r=[],n=[],o=[],a=[];return t.forEach(i=>{switch(i.type){case"redirect":r.push(i.content);break;case"query":n.push(i.content);break;case"execute":o.push({functionName:i.content.name,params:i.content.params});break;case"notify":a.push(i.content);break}}),e.redirectTo=r[0]??"",e.query=e.queryModification.newQuery,e.executions=o,e.notifications=a,e}function t0(e,t){return e.queryModification={...t,queryToIgnore:""},e}function r0(e,t){return e.queryModification.queryToIgnore=t,e}d();c();u();l();var n0=()=>({redirectTo:"",query:"",executions:[],notifications:[],queryModification:{originalQuery:"",newQuery:"",queryToIgnore:""}});var ca=ae(n0(),e=>e.addCase(W.pending,ZO).addCase(W.fulfilled,(t,r)=>e0(t,r.payload.response.triggers)).addCase(Is,(t,r)=>t0(t,r.payload)).addCase(_o,(t,r)=>r0(t,r.payload)));function o0(e){if(!vH(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state,o=n().triggers.executions;return{...t,subscribe(a){let i=()=>{let p=!wi(this.state.executions,o,(f,m)=>f.functionName===m.functionName&&wi(f.params,m.params));o=this.state.executions,p&&this.state.executions.length&&(a(),r(rf()))};return i(),e.subscribe(i)},get state(){return{executions:n().triggers.executions}}}}function vH(e){return e.addReducers({triggers:ca}),!0}d();c();u();l();d();c();u();l();function a0(e,t){let r=t.options.logNotifyTriggerActionCreator;if(!AH(e))throw K;let n=oe(e),{dispatch:o}=e,a=()=>e.state,i=a().triggers.notifications;return{...n,subscribe(p){let f=()=>{let m=!wi(i,this.state.notifications);i=this.state.notifications,m&&(p(),o(r()))};return f(),e.subscribe(f)},get state(){return{notifications:a().triggers.notifications}}}}function AH(e){return e.addReducers({triggers:ca}),!0}function i0(e){return a0(e,{options:{logNotifyTriggerActionCreator:ef}})}d();c();u();l();function s0(e){if(!CH(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state,o=()=>n().triggers.queryModification.newQuery,a=()=>n().triggers.queryModification.originalQuery;return{...t,get state(){return{newQuery:o(),originalQuery:a(),wasQueryModified:o()!==""}},undo(){r(_o(o())),r(Lt({q:a()})),r(W({legacy:Zp({undoneQuery:o()})}))}}}function CH(e){return e.addReducers({triggers:ca,query:Ft}),!0}d();c();u();l();function c0(e){if(!xH(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state,o=n().triggers.redirectTo;return{...t,subscribe(a){let i=()=>{let p=o!==this.state.redirectTo;o=this.state.redirectTo,p&&this.state.redirectTo&&(a(),r(tf()))};return i(),e.subscribe(i)},get state(){return{redirectTo:n().triggers.redirectTo}}}}function xH(e){return e.addReducers({triggers:ca}),!0}d();c();u();l();d();c();u();l();var u0="..",GC="...",bH=/^(f|fExcluded|cf|nf|df|sf|af|mnf)-(.+)$/,wH={f:!0,fExcluded:!0,cf:!0,sf:!0,af:!0,nf:!0,df:!0,mnf:!0},Ty="&",id="=";function sd(){return{serialize:EH(IH),deserialize:_H}}function cd(e){return e in wH}function RH(e){return e in{q:!0,aq:!0,cq:!0,enableQuerySyntax:!0,firstResult:!0,numberOfResults:!0,sortCriteria:!0,debug:!0,tab:!0}}function FH(e){let r=e in{nf:!0,df:!0,mnf:!0};return cd(e)&&r}function d0(e){return RH(e)||cd(e)}var EH=e=>t=>Object.entries(t).map(e).filter(r=>r).join(Ty);function IH(e){let[t,r]=e;return d0(t)?cd(t)&&!FH(t)?PH(r)?OH(t,r):"":t==="nf"||t==="df"?kH(r)?NH(t,r):"":TH(t,r):""}function TH(e,t){return`${e}${id}${encodeURIComponent(t)}`}function PH(e){return $C(e)?p0(e,r=>typeof r=="string"):!1}function kH(e){return $C(e)?p0(e,r=>$C(r)&&"start"in r&&"end"in r):!1}function $C(e){return!!(e&&typeof e=="object")}function p0(e,t){return Object.entries(e).filter(n=>{let o=n[1];return!Array.isArray(o)||!o.every(t)}).length===0}function OH(e,t){return Object.entries(t).map(([r,n])=>`${e}-${r}${id}${n.map(o=>encodeURIComponent(o)).join(",")}`).join(Ty)}function NH(e,t){return Object.entries(t).map(([r,n])=>{let o=n.map(({start:a,end:i,endInclusive:p})=>`${a}${p?GC:u0}${i}`).join(",");return`${e}-${r}${id}${o}`}).join(Ty)}function _H(e){return e.split(Ty).map(n=>DH(n)).map(n=>qH(n)).filter(LH).map(n=>UH(n)).reduce((n,o)=>{let[a,i]=o;if(cd(a)){let p={...n[a],...i};return{...n,[a]:p}}return{...n,[a]:i}},{})}function DH(e){let[t,...r]=e.split(id),n=r.join(id);return[t,n]}function qH(e,t=bH){let[r,n]=e,o=t.exec(r);if(!o)return e;let a=o[1],i=o[2],p=n.split(","),f=MH(a,p),m={[i]:f};return[a,JSON.stringify(m)]}function MH(e,t){return e==="nf"||e==="mnf"?jH(t,"selected"):e==="df"?VH(t,"selected"):t}function jH(e,t){let r=[];for(let n of e){let{startAsString:o,endAsString:a,isEndInclusive:i}=f0(n),p=parseFloat(o),f=parseFloat(a);!Number.isFinite(p)||!Number.isFinite(f)||r.push(qc({start:p,end:f,state:t,endInclusive:i}))}return r}function l0(e){try{return lR(e)?(Lp(e,Rs),!0):ln(e)?(Oo(e),!0):!1}catch{return!1}}function VH(e,t){let r=[];for(let n of e){let{isEndInclusive:o,startAsString:a,endAsString:i}=f0(n);!l0(a)||!l0(i)||r.push(Yo({start:a,end:i,state:t,endInclusive:o}))}return r}function LH(e){let t=d0(e[0]),r=e.length===2;return t&&r}function UH(e,t=!0){let[r,n]=e;return r==="enableQuerySyntax"?[r,n==="true"]:r==="debug"?[r,n==="true"]:r==="firstResult"?[r,parseInt(n,10)]:r==="numberOfResults"?[r,parseInt(n,10)]:cd(r)?[r,QH(n)]:[r,t?decodeURIComponent(n):n]}function QH(e){let t=JSON.parse(e),r={};return Object.entries(t).forEach(n=>{let[o,a]=n;r[o]=a.map(i=>Oi(i)?decodeURIComponent(i):i)}),r}function f0(e){let t=e.indexOf(GC)!==-1,[r,n]=e.split(t?GC:u0);return{isEndInclusive:t,startAsString:r,endAsString:n}}var BH=new ve({fragment:new L});function m0(e,t){let r;function n(){r=e.state.search.requestId}function o(){return r!==e.state.search.requestId}if(!$H(e))throw K;ut(e,BH,t.initialState,"buildUrlManager");let a=oe(e),i=t.initialState.fragment;n();let p=vy(e,{initialState:{parameters:Py(i)}});return{...a,subscribe(f){let m=()=>{let g=this.state.fragment;!GH(i,g)&&o()&&(i=g,f()),n()};return m(),e.subscribe(m)},get state(){return{fragment:sd().serialize(p.state.parameters)}},synchronize(f){i=f;let m=Py(f);p.synchronize(m)}}}function GH(e,t){if(e===t)return!0;let r=Py(e),n=Py(t);return ed(r,n)}function Py(e){return sd().deserialize(e)}function $H(e){return e.addReducers({configuration:fe}),!0}d();c();u();l();d();c();u();l();var g0=xe("analytics/addPageViewEntry",/*#__PURE__*/function(){var _ref84=_asyncToGenerator(function*(e,{getState:t}){t().configuration.analytics.enabled&&_t.getInstance().addElement({name:"PageView",value:e,time:JSON.stringify(new Date)})});return function(_x187,_x188){return _ref84.apply(this,arguments)}}());function HH(e){return e.addReducers({}),{addPageViewEntryInActionsHistory:g0}}d();c();u();l();d();c();u();l();d();c();u();l();var la=()=>new L({required:!1,emptyAllowed:!0}),ky=P("advancedSearchQueries/update",e=>O(e,{aq:la(),cq:la(),lq:la(),dq:la()})),Oy=P("advancedSearchQueries/register",e=>O(e,{aq:la(),cq:la(),lq:la(),dq:la()}));var h0=ae(Br(),e=>{e.addCase(ky,(t,r)=>{let{aq:n,cq:o,lq:a,dq:i}=r.payload;Tt(n)||(t.aq=n,t.aqWasSet=!0),Tt(o)||(t.cq=o,t.cqWasSet=!0),Tt(a)||(t.lq=a,t.lqWasSet=!0),Tt(i)||(t.dq=i,t.dqWasSet=!0)}).addCase(Oy,(t,r)=>{let{aq:n,cq:o,lq:a,dq:i}=r.payload;Tt(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),Tt(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),Tt(a)||(t.defaultFilters.lq=a,t.lqWasSet||(t.lq=a)),Tt(i)||(t.defaultFilters.dq=i,t.dqWasSet||(t.dq=i))}).addCase(qe.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(Me,(t,r)=>{let{aq:n,cq:o}=r.payload;Tt(n)||(t.aq=n,t.aqWasSet=!0),Tt(o)||(t.cq=o,t.cqWasSet=!0)})});function zH(e){return e.addReducers({advancedSearchQueries:h0}),{updateAdvancedSearchQueries:ky,registerAdvancedSearchQueries:Oy}}d();c();u();l();function WH(e){return e.addReducers({}),{logDocumentOpen:uy,logOpenSmartSnippetSource:_C,logOpenSmartSnippetSuggestionSource:ad,logOpenSmartSnippetInlineLink:od,logOpenSmartSnippetSuggestionInlineLink:Cy}}d();c();u();l();function KH(e){return e.addReducers({}),{logSearchEvent:Yw,logClickEvent:Jw,logCustomEvent:Xw}}d();c();u();l();function YH(e){return e.addReducers({}),{logClearBreadcrumbs:Qg,logInterfaceLoad:Ep,logSearchFromLink:Ip,logOmniboxFromLink:Tp,logInterfaceChange:Ro,logDidYouMeanClick:Gp,logCategoryFacetBreadcrumb:Ng,logFacetBreadcrumb:bc,logFacetClearAll:bt,logFacetUnexclude:io,logFacetExclude:fr,logFacetDeselect:Kr,logFacetSelect:it,logFacetShowLess:xc,logFacetShowMore:Cc,logFacetUpdateSort:Tn,logDateFacetBreadcrumb:zu,logNumericFacetBreadcrumb:Wu,logNavigateBackward:Yh,logNavigateForward:Kh,logPageNext:oy,logPageNumber:Kc,logPagePrevious:ay,logPagerResize:Wc,logSearchboxSubmit:oa,logQuerySuggestionClick:py,logResultsSort:ol,logDislikeSmartSnippet:NC,logLikeSmartSnippet:OC,logOpenSmartSnippetFeedbackModal:DC,logCloseSmartSnippetFeedbackModal:qC,logSmartSnippetFeedback:MC,logSmartSnippetDetailedFeedback:jC,logExpandSmartSnippet:PC,logCollapseSmartSnippet:kC,logExpandSmartSnippetSuggestion:VC,logCollapseSmartSnippetSuggestion:LC,logNoResultsBack:Jh,logStaticFilterSelect:sh,logStaticFilterDeselect:Fc,logStaticFilterClearAll:ch,logTriggerQuery:Xp,logUndoTriggerQuery:Zp,logNotifyTrigger:ef,logTriggerRedirect:tf,logTriggerExecute:rf}}d();c();u();l();function JH(e){return e.addReducers({}),{deselectAllBreadcrumbs:ft,deselectAllNonBreadcrumbs:gs}}d();c();u();l();function XH(e){return e.addReducers({configuration:fe}),{disableAnalytics:cs,enableAnalytics:ls,setOriginLevel2:Pp,setOriginLevel3:kp,updateAnalyticsConfiguration:Fo,updateBasicConfiguration:on}}d();c();u();l();function ZH(e){return e.addReducers({configuration:fe,pipeline:ms,searchHub:Ns}),{updateSearchConfiguration:Ar}}d();c();u();l();function e3(e){return e.addReducers({context:uh}),{addContext:Ai,removeContext:Ci,setContext:vi}}d();c();u();l();function t3(e){return e.addReducers({debug:ps}),{disableDebug:ds,enableDebug:Eo}}d();c();u();l();function r3(e){return e.addReducers({dictionaryFieldContext:fh}),{addContext:Tc,removeContext:Pc,setContext:Ic}}d();c();u();l();function n3(e){return e.addReducers({didYouMean:gh,query:Ft}),{applyDidYouMeanCorrection:xr,disableDidYouMean:Qp,enableDidYouMean:Fs,enableAutomaticQueryCorrection:Bp,disableAutomaticQueryCorrection:Es,setCorrectionMode:Ra}}d();c();u();l();d();c();u();l();d();c();u();l();var Ny=P("excerptLength/set",e=>O(e,new re({min:0,required:!0})));d();c();u();l();function y0(){return{length:void 0}}var S0=ae(y0(),e=>{e.addCase(Ny,(t,r)=>{t.length=r.payload})});function o3(e){return e.addReducers({excerptLength:S0}),{setExcerptLength:Ny}}d();c();u();l();function a3(e){return e.addReducers({facetOptions:wt}),{updateFacetOptions:Fe,enableFacet:Gt,disableFacet:rt}}d();c();u();l();function i3(e){return e.addReducers({automaticFacetSet:hh}),{setOptions:dc,deselectAllAutomaticFacetValues:pc,toggleSelectAutomaticFacetValue:Sn}}d();c();u();l();function s3(e){return e.addReducers({categoryFacetSet:Cn}),{deselectAllCategoryFacetValues:An,registerCategoryFacet:vn,toggleSelectCategoryFacetValue:Wo,updateCategoryFacetNumberOfValues:ui,updateCategoryFacetSortCriterion:mc,updateFacetAutoSelection:an,updateCategoryFacetBasePath:Og}}d();c();u();l();function c3(e){return e.addReducers({facetSet:kr}),{deselectAllFacetValues:nt,registerFacet:Fn,toggleSelectFacetValue:En,toggleExcludeFacetValue:In,updateFacetIsFieldExpanded:pi,updateFacetNumberOfValues:di,updateFacetSortCriterion:Ac,updateFreezeCurrentValues:ao,updateFacetAutoSelection:an}}d();c();u();l();function l3(e){return e.addReducers({dateFacetSet:_n}),{deselectAllDateFacetValues:$g,registerDateFacet:Pn,toggleSelectDateFacetValue:kn,toggleExcludeDateFacetValue:On,updateDateFacetSortCriterion:Gg,updateDateFacetValues:lo}}d();c();u();l();function u3(e){return e.addReducers({numericFacetSet:Or}),{deselectAllNumericFacetValues:oh,registerNumericFacet:Dn,toggleSelectNumericFacetValue:qn,toggleExcludeNumericFacetValue:Mn,updateNumericFacetSortCriterion:nh,updateNumericFacetValues:uo}}d();c();u();l();function d3(e){return e.addReducers({fields:na}),{registerFieldsToInclude:ra,enableFetchAllFields:jc,disableFetchAllFields:xi,fetchFieldsDescription:Vc}}d();c();u();l();function p3(e){return e.addReducers({folding:$h}),{registerFolding:Xo,loadCollection:Zo}}d();c();u();l();function f3(e){return e.addReducers({generatedAnswer:Qc}),{generateAnswer:kf,resetAnswer:dr,setAnswerGenerationMode:Ls}}d();c();u();l();function m3(e){return e.addReducers({history:ey,facetOrder:Gc}),{back:lu,forward:qp}}d();c();u();l();function g3(e){return e.addReducers({instantResults:ry}),{registerInstantResults:hs,updateInstantResultsQuery:sn,clearExpiredResults:ys}}d();c();u();l();function h3(e){return e.addReducers({pagination:_r}),{nextPage:Cs,previousPage:xs,registerNumberOfResults:Ss,registerPage:As,updateNumberOfResults:vs,updatePage:cn}}d();c();u();l();function y3(e){return e.addReducers({pipeline:ms}),{setPipeline:fs}}d();c();u();l();function S3(e){return e.addReducers({query:Ft}),{updateQuery:Lt}}d();c();u();l();function v3(e){return e.addReducers({querySet:aa}),{registerQuerySetQuery:rl,updateQuerySetQuery:Ei}}d();c();u();l();function A3(e){return e.addReducers({querySuggest:nl,querySet:aa}),{clearQuerySuggest:ea,fetchQuerySuggestions:ta,registerQuerySuggest:Mc,selectQuerySuggestion:Ln}}d();c();u();l();function C3(e){return e.addReducers({questionAnswering:Qn}),{collapseSmartSnippet:ll,expandSmartSnippet:cl,dislikeSmartSnippet:dl,likeSmartSnippet:ul,openFeedbackModal:pl,closeFeedbackModal:ia,expandSmartSnippetRelatedQuestion:fl,collapseSmartSnippetRelatedQuestion:ml}}d();c();u();l();function x3(e){return e.addReducers({recentQueries:cy}),{registerRecentQueries:Fi,clearRecentQueries:tl}}d();c();u();l();function b3(e){return e.addReducers({recentResults:ly}),{registerRecentResults:$c,clearRecentResults:Hc,pushRecentResult:Nr}}d();c();u();l();function w3(e){return e.addReducers({resultPreview:sy}),{fetchResultContent:Ri,updateContentURL:el,nextPreview:Jc,previousPreview:Xc,preparePreviewPagination:Zc}}d();c();u();l();d();c();u();l();var R3=new ve({content:new Be({required:!0}),conditions:new Be({required:!0}),priority:new re({required:!1,default:0,min:0}),fields:new ie({required:!1,each:z})});function v0(){let e=[],t=r=>{let n=R3.validate(r);if(!r.conditions.every(a=>a instanceof Function))throw new Il("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(a=>a(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(a=>a(r)));return n?n.linkContent:null}}}function A0(e){if(!F3(e))throw K;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=v0();return{registerTemplates:(...o)=>{t(...o);let a=[];o.forEach(i=>{i.fields&&a.push(...i.fields)}),e.dispatch(ra(a))},selectTemplate:r,selectLinkTemplate:n}}function F3(e){return e.addReducers({fields:na}),!0}d();c();u();l();function E3(e){return e.addReducers({search:he}),{executeSearch:RR,fetchMoreResults:ER,fetchFacetValues:IR,fetchPage:FR,fetchInstantResults:TR}}d();c();u();l();function I3(e){return e.addReducers({searchHub:Ns}),{setSearchHub:Os}}d();c();u();l();function T3(e){return e.addReducers({facetOrder:Gc,facetSet:kr,pagination:_r,query:Ft,querySet:aa}),{restoreSearchParameters:Me,restoreTab:us}}d();c();u();l();function P3(e){let{by:t,order:r}=e;switch(t){case"relevancy":return as();case"qre":return Ap();case"nosort":return Cp();case"date":if(!r)throw new Error("An order (i.e., ascending or descending) should be specified for a sort criterion sorted by \"date\"");return Sp(r);default:if(!r)throw new Error(`An order (i.e., ascending or descending) should be specified for a sort criterion sorted by a field, such as "${t}"`);return vp(t,r)}}function k3(e){return e===void 0||e==="ascending"||e==="descending"}function C0(e){let t=e.split(","),r=new Error(`Wrong criterion expression format for "${e}"`);if(!t.length)throw r;return t.map(n=>{let o=n.trim().split(" "),a=o[0].toLowerCase(),i=o[1]?.toLowerCase();if(o.length>2||a==="")throw r;if(!k3(i))throw new Error(`Wrong criterion sort order "${i}" in expression "${e}". Order should either be "ascending" or "descending"`);return P3({by:a,order:i})})}d();c();u();l();function O3(e){return e.addReducers({sortCriteria:wy}),{registerSortCriterion:gl,updateSortCriterion:hl}}d();c();u();l();function N3(e){return e.addReducers({standaloneSearchBoxSet:Fy}),{registerStandaloneSearchBox:yl,fetchRedirectUrl:sa,updateStandaloneSearchBoxRedirectionUrl:Sl,updateAnalyticsToSearchFromLink:Al,updateAnalyticsToOmniboxFromLink:Cl,resetStandaloneSearchBox:vl}}d();c();u();l();function _3(e){return e.addReducers({staticFilterSet:Ey}),{registerStaticFilter:Rc,toggleSelectStaticFilterValue:po,toggleExcludeStaticFilterValue:fo,deselectAllStaticFilterValues:Jo}}d();c();u();l();function D3(e){return e.addReducers({tabSet:Ec}),{registerTab:Gs,updateActiveTab:yt}}d();c();u();l();d();c();u();l();d();c();u();l();function Et(e){return e.negate?"NOT ":""}d();c();u();l();function qr(e){return{contains:"=",differentThan:"<>",fuzzyMatch:"~=",greaterThan:">",greaterThanOrEqual:">=",isExactly:"==",lowerThan:"<",lowerThanOrEqual:"<=",phoneticMatch:"%=",regexMatch:"/=",wildcardMatch:"*="}[e]}function x0(e){return{toQuerySyntax(){let{field:t,value:r}=e,n=qr(e.operator);return`${Et(e)}@${t}${n}${r}`}}}d();c();u();l();function b0(e){return{toQuerySyntax(){let t=Et(e),{field:r,from:n,to:o}=e,a=qr("isExactly");return`${t}@${r}${a}${n}..${o}`}}}d();c();u();l();function w0(e){return{toQuerySyntax(){let t=Et(e),{expression:r}=e;return`${t}"${r}"`}}}d();c();u();l();function R0(e){return{toQuerySyntax(){let t=Et(e),{field:r}=e;return`${t}@${r}`}}}d();c();u();l();function F0(e){return{toQuerySyntax(){let{expression:t,negate:r}=e;return r?`NOT (${t})`:t}}}d();c();u();l();function E0(e){return{toQuerySyntax(){let t=Et(e),{startTerm:r,otherTerms:n}=e,o=q3(n),a=`${r} ${o}`;return e.negate?`${t}(${a})`:a}}}function q3(e){return e.map(t=>{let{endTerm:r,maxKeywordsBetween:n}=t;return`near:${n} ${r}`}).join(" ")}d();c();u();l();function I0(e){return{toQuerySyntax(){let{field:t,value:r}=e,n=Et(e),o=qr(e.operator);return`${n}@${t}${o}${r}`}}}d();c();u();l();function T0(e){return{toQuerySyntax(){let t=Et(e),{field:r,from:n,to:o}=e,a=qr("isExactly");return`${t}@${r}${a}${n}..${o}`}}}d();c();u();l();function P0(e){return{toQuerySyntax(){let{name:t,parameters:r}=e,n=M3(r);return`$${t}(${n})`}}}function M3(e){return Object.entries(e).map(t=>{let[r,n]=t,o=typeof n=="string"?n:n.toQuerySyntax();return`${r}: ${o}`}).join(", ")}d();c();u();l();function k0(e){return{toQuerySyntax(){let t=Et(e),{field:r,operator:n,value:o}=e,a=qr(n),i=n==="fuzzyMatch"?` $quoteVar(value: ${o})`:`("${o}")`;return`${t}@${r}${a}${i}`}}}d();c();u();l();function O0(e){return{toQuerySyntax(){let{field:t}=e,r=Et(e),n=qr(e.operator),o=e.values.map(i=>`"${i}"`),a=o.length===1?o[0]:`(${o.join(",")})`;return`${r}@${t}${n}${a}`}}}function j3(){let e=[],t="and";return{addExpression(r){return e.push(r),this},addKeyword(r){return e.push(F0(r)),this},addNear(r){return e.push(E0(r)),this},addExactMatch(r){return e.push(w0(r)),this},addFieldExists(r){return e.push(R0(r)),this},addStringField(r){return e.push(O0(r)),this},addStringFacetField(r){return e.push(k0(r)),this},addNumericField(r){return e.push(I0(r)),this},addNumericRangeField(r){return e.push(T0(r)),this},addDateField(r){return e.push(x0(r)),this},addDateRangeField(r){return e.push(b0(r)),this},addQueryExtension(r){return e.push(P0(r)),this},joinUsing(r){return t=r,this},toQuerySyntax(){let r=V3(t),n=e.map(o=>o.toQuerySyntax()).join(`) ${r} (`);return e.length<=1?n:`(${n})`}}}function V3(e){return e==="and"?"AND":"OR"}/**
|
|
49
|
+
https://docs.coveo.com/en/headless/latest/reference/interfaces/Search.FieldActionCreators.html#registerfieldstoinclude`)}}}function q$(e){return e.addReducers({debug:fs,search:he,configuration:fe,fields:na}),!0}d();c();l();u();d();c();l();u();var py=e=>J({prefix:"analytics/result/open",__legacy__getBuilder:(t,r)=>(Zt(e),t.makeDocumentOpen(pt(e,r),Ke(e))),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=pt(e,t),n=Ke(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});function pO(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(py(t.options.result)))};return Wt(e,t,()=>{n(),e.dispatch(_r(t.options.result))})}d();c();l();u();function fO(e,t){return Kh(e,{...t,fetchMoreResultsActionCreator:Rr})}d();c();l();u();d();c();l();u();var M$=new ve({numberOfResults:new re({min:0})});function mO(e,t={}){if(!V$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,i=lt(e,M$,t.initialState,"buildResultsPerPage").numberOfResults;return i!==void 0&&n(vs(i)),{...r,get state(){return{numberOfResults:o().pagination.numberOfResults}},set(p){n(As(p))},isSetTo(p){return p===this.state.numberOfResults}}}function V$(e){return e.addReducers({pagination:Nr,configuration:fe}),!0}function gO(e,t={}){if(!j$(e))throw K;let r=mO(e,t),{dispatch:n}=e;return{...r,get state(){return{...r.state}},set(o){r.set(o),n(Ut({legacy:Yc(),next:Xc()}))}}}function j$(e){return e.addReducers({pagination:Nr,configuration:fe}),!0}d();c();l();u();d();c();l();u();var oa=()=>J("analytics/searchbox/submit",e=>e.makeSearchboxSubmit()),fy=()=>({actionCause:"searchboxSubmit"});d();c();l();u();d();c();l();u();var hO={id:z,query:Ge},ou=k("querySet/register",e=>O(e,hO)),Ii=k("querySet/update",e=>O(e,hO));d();c();l();u();var aa=ae(Jp(),e=>{e.addCase(ou,(t,r)=>U$(t,r.payload)).addCase(Ii,(t,r)=>{let{id:n,query:o}=r.payload;FC(t,n,o)}).addCase(Ln,(t,r)=>{let{id:n,expression:o}=r.payload;FC(t,n,o)}).addCase(W.fulfilled,(t,r)=>{let{queryExecuted:n}=r.payload;yO(t,n)}).addCase(Me,L$).addCase(qe.fulfilled,(t,r)=>{if(r.payload)for(let[n,o]of Object.entries(r.payload.querySet))FC(t,n,o)})});function L$(e,t){pe(t.payload.q)||yO(e,t.payload.q)}function yO(e,t){Object.keys(e).forEach(r=>{e[r]=t})}var FC=(e,t,r)=>{t in e&&(e[t]=r)},U$=(e,t)=>{let{id:r,query:n}=t;r in e||(e[r]=n)};d();c();l();u();var my=e=>J("analytics/querySuggest",(t,r)=>{let n=EC(r,e);return t.makeOmniboxAnalytics(n)}),SO=()=>({actionCause:"omniboxAnalytics"});function EC(e,t){let{id:r,suggestion:n}=t,o=e.querySuggest?.[r];if(!o)throw new Error(`Unable to determine the query suggest analytics metadata to send because no query suggest with id "${r}" was found. Please check the sent #id.`);let a=o.completions.map(m=>m.expression),i=o.partialQueries.length-1,p=o.partialQueries[i]||"",f=o.responseId;return{suggestionRanking:a.indexOf(n),partialQuery:p,partialQueries:o.partialQueries,suggestions:a,querySuggestResponseId:f}}d();c();l();u();d();c();l();u();function vO(e,t){let r=t.id;r in e||(e[r]=Q$(t))}function AO(e,t){let r=e[t.meta.arg.id];r&&(r.currentRequestId=t.meta.requestId,r.isLoading=!0)}function CO(e,t){let r=e[t.meta.arg.id];r&&(r.error=t.payload||null,r.isLoading=!1)}function xO(e,t){let r=e[t.id];r&&(r.responseId="",r.completions=[],r.partialQueries=[])}function Q$(e){return{id:"",completions:[],responseId:"",count:5,currentRequestId:"",error:null,partialQueries:[],isLoading:!1,...e}}d();c();l();u();var bO=()=>({});var au=ae(bO(),e=>e.addCase(jc,(t,r)=>{vO(t,r.payload)}).addCase(ZP,(t,r)=>{delete t[r.payload.id]}).addCase(ta.pending,AO).addCase(ta.fulfilled,(t,r)=>{let n=t[r.meta.arg.id];if(!n||r.meta.requestId!==n.currentRequestId)return;let{q:o}=r.payload;o&&n.partialQueries.push(o.replace(/;/,encodeURIComponent(";"))),n.responseId=r.payload.responseId,n.completions=r.payload.completions,n.isLoading=!1,n.error=null}).addCase(ta.rejected,CO).addCase(ea,(t,r)=>{xO(t,r.payload)}).addCase(Os,(t,r)=>{Object.keys(t).forEach(n=>{let o=t[n];o&&(o.error=r.payload,o.isLoading=!1)})}));d();c();l();u();var gy={enableQuerySyntax:!1,numberOfSuggestions:5,clearFilters:!0},IC={open:new L,close:new L},TC={id:z,numberOfSuggestions:new re({min:0}),enableQuerySyntax:new de,highlightOptions:new X({values:{notMatchDelimiters:new X({values:IC}),exactMatchDelimiters:new X({values:IC}),correctionDelimiters:new X({values:IC})}}),clearFilters:new de},wO=new ve(TC);function RO(e,t){if(!G$(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state,a=t.options?.id||go("search_box"),i={id:a,highlightOptions:{...t.options?.highlightOptions},...gy,...t.options};He(e,wO,i,"buildSearchBox"),n(ou({id:a,query:e.state.query.q})),i.numberOfSuggestions&&n(jc({id:a,count:i.numberOfSuggestions})),i.enableQuerySyntax&&n(Lt({enableQuerySyntax:i.enableQuerySyntax}));let p=()=>e.state.querySet[i.id],f=/*#__PURE__*/function(){var _ref80=_asyncToGenerator(function*(m){let{enableQuerySyntax:g,clearFilters:S}=i;n(Ps({q:p(),enableQuerySyntax:g,clearFilters:S})),t.isNextAnalyticsReady?n(t.executeSearchActionCreator(m)):n(t.executeSearchActionCreator(m.legacy))});return function f(_x181){return _ref80.apply(this,arguments)}}();return{...r,updateText(m){n(Ii({id:a,query:m})),this.showSuggestions()},clear(){n(Ii({id:a,query:""})),n(ea({id:a}))},showSuggestions(){i.numberOfSuggestions&&n(t.fetchQuerySuggestionsActionCreator({id:a}))},selectSuggestion(m){n(Ln({id:a,expression:m})),f({legacy:my({id:a,suggestion:m}),next:SO()}).then(()=>{n(ea({id:a}))})},submit(m=oa(),g){f({legacy:m,next:g}),n(ea({id:a}))},get state(){let m=o(),g=m.querySuggest[i.id],S=B$(g,i.highlightOptions),x=g?g.isLoading:!1;return{searchBoxId:a,value:p(),suggestions:S,isLoading:m.search.isLoading,isLoadingSuggestions:x}}}}function B$(e,t){return e?e.completions.map(r=>({highlightedValue:Ky(r.highlighted,t),rawValue:r.expression})):[]}function G$(e){return e.addReducers({query:Ft,querySuggest:au,configuration:fe,querySet:aa,search:he}),!0}function hy(e,t={}){let r=RO(e,{...t,executeSearchActionCreator:W,fetchQuerySuggestionsActionCreator:ta,isNextAnalyticsReady:!0});return{...r,submit(){r.submit(oa(),fy())},get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();var iu=()=>J("analytics/sort/results",(e,t)=>e.makeResultsSort({resultsSortBy:t.sortCriteria||vr()})),yy=()=>({actionCause:"resultsSort"});function EO(e,t){return e.q!==t.q?oa():e.sortCriteria!==t.sortCriteria?iu():e.firstResult!==t.firstResult?Jc():e.numberOfResults!==t.numberOfResults?Yc():Dr(e.f,t.f)?ad(e.f,t.f):Dr(e.fExcluded,t.fExcluded)?ad(e.fExcluded,t.fExcluded,!0):Dr(e.cf,t.cf)?ad(e.cf,t.cf):Dr(e.af,t.af)?ad(e.af,t.af):Dr(e.nf,t.nf)?FO(e.nf,t.nf):Dr(e.df,t.df)?FO(e.df,t.df):Ro()}function ad(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),a=n.filter(x=>!o.includes(x));if(a.length){let x=a[0];switch(!0){case e[x].length>1:return bt(x);case r:return io({facetId:x,facetValue:e[x][0]});default:return Kr({facetId:x,facetValue:e[x][0]})}}let i=o.filter(x=>!n.includes(x));if(i.length){let x=i[0];return r?fr({facetId:x,facetValue:t[x][0]}):it({facetId:x,facetValue:t[x][0]})}let p=o.find(x=>t[x].filter(h=>e[x].includes(h)));if(!p)return Ro();let f=e[p],m=t[p],g=m.filter(x=>!f.includes(x));if(g.length)return r?fr({facetId:p,facetValue:g[0]}):it({facetId:p,facetValue:g[0]});let S=f.filter(x=>!m.includes(x));return S.length?r?io({facetId:p,facetValue:S[0]}):Kr({facetId:p,facetValue:S[0]}):Ro()}function FO(e={},t={}){return ad(cu(e),cu(t))}function IO(e,t){return e.q!==t.q?fy():e.sortCriteria!==t.sortCriteria?yy():Dr(e.f,t.f)?su(e.f,t.f):Dr(e.fExcluded,t.fExcluded)?su(e.fExcluded,t.fExcluded,!0):Dr(e.cf,t.cf)?su(e.cf,t.cf):Dr(e.af,t.af)?su(e.af,t.af):Dr(e.nf,t.nf)?su(cu(e.nf),cu(t.nf)):Dr(e.df,t.df)?su(cu(e.df),cu(t.df)):cs()}function Dr(e={},t={}){return JSON.stringify(e)!==JSON.stringify(t)}function su(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),a=n.filter(x=>!o.includes(x));if(a.length){let x=a[0];return e[x].length>1?$t():co()}if(o.filter(x=>!n.includes(x)).length)return r?so():gt();let p=o.find(x=>t[x].filter(h=>e[x].includes(h)));if(!p)return cs();let f=e[p],m=t[p];return m.filter(x=>!f.includes(x)).length?r?so():gt():f.filter(x=>!m.includes(x)).length?co():cs()}function cu(e={}){let t={};return Object.keys(e).forEach(r=>{t[r]=e[r].map(n=>`${n.start}..${n.end}`)}),t}d();c();l();u();d();c();l();u();function TO(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{q:n}:{}}function PO(e,t,r){if(e===void 0)return{};let n=t(e);return!yC(n,r)?{sortCriteria:n}:{}}function Sy(e,t,r,n){if(e===void 0)return{};let o=Object.entries(e).filter(([a])=>t(a)).map(([a,{request:i}])=>{let p=r(i);return p.length?{[a]:p}:{}}).reduce((a,i)=>({...a,...i}),{});return Object.keys(o).length?{[n]:o}:{}}function kO(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{tab:n}:{}}d();c();l();u();function OO(e){return{q:dt().q,enableQuerySyntax:dt().enableQuerySyntax,aq:e.advancedSearchQueries?.defaultFilters.aq??Br().defaultFilters.aq,cq:e.advancedSearchQueries?.defaultFilters.cq??Br().defaultFilters.cq,firstResult:br().firstResult,numberOfResults:e.pagination?.defaultNumberOfResults??br().defaultNumberOfResults,sortCriteria:vr(),f:{},fExcluded:{},cf:{},nf:{},df:{},debug:Io(),sf:{},tab:"",af:{},mnf:{}}}var $$=new ve({parameters:new X({options:{required:!0},values:Dp})});function DO(e,t){let{dispatch:r}=e,n=oe(e);lt(e,$$,t.initialState,"buildSearchParameterManager");let o=_O(e.state.tabSet,t.initialState.parameters);return r(Me(o)),{...n,synchronize(a){let i=_O(e.state.tabSet,vy(e,a));r(Me(i))},get state(){return{parameters:PC(e)}}}}function vy(e,t){let n={...OO(e.state),...t},o={};if(e.state.dateFacetSet)for(let i of Object.keys(e.state.dateFacetSet))o[i]=[];let a={};if(e.state.numericFacetSet)for(let i of Object.keys(e.state.numericFacetSet))a[i]=[];return{...n,df:{...o,...n.df},nf:{...a,...n.nf}}}function _O(e,t){if(pe(t.tab)||!e)return t;if(t.tab==="")return{...t,tab:NO(e)};if(!Object.values(e).some(n=>n.id===t.tab)){let n=Object.values(e).find(o=>o.isActive);return{...t,tab:n?.id??NO(e)}}return t}function NO(e){return Object.keys(e)[0]??""}function PC(e){let t=e.state;return{...TO(t.query,r=>r.q,dt().q),...kO(t.tabSet,r=>{let n=Object.values(r??{}).find(o=>o.isActive);return n?n.id:Object.keys(r??{})[0]},t.tabSet?Object.keys(t.tabSet)[0]:""),...PO(t.sortCriteria,r=>r,vr()),...z$(t),...W$(t),...K$(t),...Y$(t),...J$(t)}}function H$(e){let t=e.tabSet;return t?Object.values(t).find(n=>n.isActive)?.id:void 0}function Ay(e){let t=H$(e);return r=>{let n=e.facetOptions?.facets[r],o=n?.enabled??!0,a=or(n?.tabs,t);return o&&a}}function qO(e){return e.currentValues.filter(t=>t.state==="selected")}function z$(e){let t=e.facetSet;if(t===void 0)return{};let r=Ay(e),n={},o={};for(let[a,{request:i}]of Object.entries(t)){if(!r(a))continue;let p=i.currentValues.filter(m=>m.state==="selected").map(m=>m.value),f=i.currentValues.filter(m=>m.state==="excluded").map(m=>m.value);p.length&&(n[a]=p),f.length&&(o[a]=f)}return{...(Object.keys(n).length?{f:n}:{}),...(Object.keys(o).length?{fExcluded:o}:{})}}function W$(e){return Sy(e.categoryFacetSet,Ay(e),t=>cr(t.currentValues).map(r=>r.value),"cf")}function K$(e){return Sy(e.numericFacetSet,Ay(e),qO,"nf")}function Y$(e){return Sy(e.dateFacetSet,Ay(e),qO,"df")}function J$(e){let t=e.automaticFacetSet?.set;if(t===void 0)return{};let r=Object.entries(t).map(([n,{response:o}])=>{let a=X$(o);return a.length?{[n]:a}:{}}).reduce((n,o)=>({...n,...o}),{});return Object.keys(r).length?{af:r}:{}}function X$(e){return e.values.filter(t=>t.state==="selected").map(t=>t.value)}function Cy(e,t){let{dispatch:r}=e,n=DO(e,t);return{...n,synchronize(o){let a=MO(e),i=vy(e,a),p=vy(e,o);rd(i,p)||(n.synchronize(o),r(W({legacy:EO(i,p),next:IO(i,p)})))},get state(){return{parameters:MO(e)}}}}function MO(e){let t=e.state;return{...PC(e),...Z$(t),...eH(t),...tH(t),...rH(t),...nH(t),...iH(t),...oH(t)}}function Z$(e){if(e.query===void 0)return{};let t=e.query.enableQuerySyntax;return t!==void 0&&t!==dt().enableQuerySyntax?{enableQuerySyntax:t}:{}}function eH(e){if(e.advancedSearchQueries===void 0)return{};let{aq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.aq?{aq:t}:{}}function tH(e){if(e.advancedSearchQueries===void 0)return{};let{cq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.cq?{cq:t}:{}}function rH(e){if(e.pagination===void 0)return{};let t=e.pagination.firstResult;return t!==br().firstResult?{firstResult:t}:{}}function nH(e){if(e.pagination===void 0)return{};let{numberOfResults:t,defaultNumberOfResults:r}=e.pagination;return t!==r?{numberOfResults:t}:{}}function oH(e){if(e.staticFilterSet===void 0)return{};let t=Object.entries(e.staticFilterSet).map(([r,n])=>{let o=aH(n.values);return o.length?{[r]:o}:{}}).reduce((r,n)=>({...r,...n}),{});return Object.keys(t).length?{sf:t}:{}}function aH(e){return e.filter(t=>t.state==="selected").map(t=>t.caption)}function iH(e){if(e.debug===void 0)return{};let t=e.debug;return t!==Io()?{debug:t}:{}}d();c();l();u();function VO(e){return Qc(e)}d();c();l();u();d();c();l();u();d();c();l();u();var xy=()=>new X({values:{questionAnswerId:z},options:{required:!0}}),kC=()=>new X({values:{linkText:Ge,linkURL:Ge},options:{required:!0}});function uu(e){return O(e,xy())}d();c();l();u();function ct(e,t){let r=t??e.search?.questionAnswer?.documentId;return r&&e.search&&LR(e,r.contentIdKey,r.contentIdValue)}function Yr(e,t){let r=e.questionAnswering?.relatedQuestions.findIndex(o=>o.questionAnswerId===t)??-1;return r===-1?null:e.search?.questionAnswer?.relatedQuestions?.[r]??null}var OC=()=>J({prefix:"analytics/smartSnippet/expand",__legacy__getBuilder:e=>e.makeExpandSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{action:"expand",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),_C=()=>J({prefix:"analytics/smartSnippet/collapse",__legacy__getBuilder:e=>e.makeCollapseSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{action:"collapse",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),NC=()=>J({prefix:"analytics/smartSnippet/like",__legacy__getBuilder:e=>e.makeLikeSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{action:"like",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),DC=()=>J({prefix:"analytics/smartSnippet/dislike",__legacy__getBuilder:e=>e.makeDislikeSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{action:"dislike",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),qC=()=>J({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(e,t)=>{let r=ct(t);return e.makeOpenSmartSnippetSource(pt(r,t),Ke(r))},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:e=>{let t=ct(e),r=Ke(t),n=e.search?.response.searchUid;if(n)return{snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),id=e=>J({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(t,r)=>{O(e,kC());let n=ct(r);return n?t.makeOpenSmartSnippetInlineLink(pt(n,r),{...Ke(n),...e}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=ct(t),n=Ke(r),o=t.search?.response.searchUid;if(o)return{snippetType:"SmartSnippet",responseId:o,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri}}}}),MC=()=>J("analytics/smartSnippet/feedbackModal/open",e=>e.makeOpenSmartSnippetFeedbackModal()),VC=()=>J("analytics/smartSnippet/feedbackModal/close",e=>e.makeCloseSmartSnippetFeedbackModal()),sH={does_not_answer:"doesNotAnswer",partially_answers:"partiallyAnswers",was_not_a_question:"wasNotAQuestion"},jC=e=>J({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:t=>t.makeSmartSnippetFeedbackReason(e),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=ct(t),n=Ke(r),o=t.search?.response.searchUid;if(o)return{responseId:o,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:sH[e]}}}),LC=e=>J({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:t=>t.makeSmartSnippetFeedbackReason("other",e),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=ct(t),n=Ke(r),o=t.search?.response.searchUid;if(o)return{responseId:o,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:"other",additionalNotes:e}}}),UC=e=>J({prefix:"analytics/smartSnippetSuggestion/expand",__legacy__getBuilder:(t,r)=>{uu(e);let n=Yr(r,e.questionAnswerId);return n?t.makeExpandSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Yr(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=ct(t,r.documentId);return{action:"expand",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),QC=e=>J({prefix:"analytics/smartSnippetSuggestion/collapse",__legacy__getBuilder:(t,r)=>{uu(e);let n=Yr(r,e.questionAnswerId);return n?t.makeCollapseSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Yr(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=ct(t,r.documentId);return{action:"collapse",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),sd=e=>J({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(t,r)=>{O(e,xy());let n=Yr(r,e.questionAnswerId);if(!n)return null;let o=ct(r,n.documentId);return o?t.makeOpenSmartSnippetSuggestionSource(pt(o,r),{question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=Yr(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=ct(t,r.documentId);return{responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),by=(e,t)=>J({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(r,n)=>{O(e,xy()),O(t,kC());let o=Yr(n,e.questionAnswerId);if(!o)return null;let a=ct(n,o.documentId);return a?r.makeOpenSmartSnippetSuggestionInlineLink(pt(a,n),{question:o.question,answerSnippet:o.answerSnippet,documentId:o.documentId,linkText:t.linkText,linkURL:t.linkURL}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:r=>{let n=Yr(r,e.questionAnswerId),o=r.search?.response.searchUid;if(o&&n){let a=ct(r,n.documentId);return{responseId:o,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:n.documentId.contentIdKey,uniqueFieldValue:n.documentId.contentIdValue,title:a?.title,url:a?.clickUri}}}}}),wy={logExpandSmartSnippet:OC,logCollapseSmartSnippet:_C,logLikeSmartSnippet:NC,logDislikeSmartSnippet:DC,logOpenSmartSnippetSource:qC,logOpenSmartSnippetInlineLink:id,logOpenSmartSnippetFeedbackModal:MC,logCloseSmartSnippetFeedbackModal:VC,logSmartSnippetFeedback:jC,logSmartSnippetDetailedFeedback:LC,logExpandSmartSnippetSuggestion:UC,logCollapseSmartSnippetSuggestion:QC,logOpenSmartSnippetSuggestionSource:sd};d();c();l();u();d();c();l();u();var lu=k("smartSnippet/expand"),du=k("smartSnippet/collapse"),pu=k("smartSnippet/like"),fu=k("smartSnippet/dislike"),mu=k("smartSnippet/feedbackModal/open"),ia=k("smartSnippet/feedbackModal/close"),gu=k("smartSnippet/related/expand",e=>uu(e)),hu=k("smartSnippet/related/collapse",e=>uu(e));d();c();l();u();d();c();l();u();var BC=()=>({liked:!1,disliked:!1,expanded:!1,feedbackModalOpen:!1,relatedQuestions:[]});var jO=(e,t)=>e.findIndex(r=>r.questionAnswerId===t.questionAnswerId);function LO({question:e,answerSnippet:t,documentId:{contentIdKey:r,contentIdValue:n}}){return Di({question:e,answerSnippet:t,contentIdKey:r,contentIdValue:n})}function cH(e,t){let r=LO(e);return t&&r===t.questionAnswerId?t:{contentIdKey:e.documentId.contentIdKey,contentIdValue:e.documentId.contentIdValue,expanded:!1,questionAnswerId:r}}var Qn=ae(BC(),e=>e.addCase(lu,t=>{t.expanded=!0}).addCase(du,t=>{t.expanded=!1}).addCase(pu,t=>{t.liked=!0,t.disliked=!1,t.feedbackModalOpen=!1}).addCase(fu,t=>{t.liked=!1,t.disliked=!0}).addCase(mu,t=>{t.feedbackModalOpen=!0}).addCase(ia,t=>{t.feedbackModalOpen=!1}).addCase(W.fulfilled,(t,r)=>{let n=r.payload.response.questionAnswer.relatedQuestions.map((a,i)=>cH(a,t.relatedQuestions[i])),o=LO(r.payload.response.questionAnswer);return t.questionAnswerId===o?{...t,relatedQuestions:n}:{...BC(),relatedQuestions:n,questionAnswerId:o}}).addCase(gu,(t,r)=>{let n=jO(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!0)}).addCase(hu,(t,r)=>{let n=jO(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!1)}));function UO(e,t,r){if(!uH(e))throw K;let n=oe(e),o=()=>e.state,a=()=>ct(o()),i=null,p=Wt(e,{options:{selectionDelay:r?.options?.selectionDelay}},()=>{let f=a();if(!f){i=null;return}let{searchResponseId:m}=o().search;i!==m&&(i=m,e.dispatch(t.logOpenSmartSnippetSource()),e.dispatch(_r(f)))});return{...n,get state(){let f=o();return{question:f.search.questionAnswer.question,answer:f.search.questionAnswer.answerSnippet,documentId:f.search.questionAnswer.documentId,expanded:f.questionAnswering.expanded,answerFound:f.search.questionAnswer.answerSnippet!=="",liked:f.questionAnswering.liked,disliked:f.questionAnswering.disliked,feedbackModalOpen:f.questionAnswering.feedbackModalOpen,source:a()}},expand(){e.dispatch(t.logExpandSmartSnippet()),e.dispatch(lu())},collapse(){e.dispatch(t.logCollapseSmartSnippet()),e.dispatch(du())},like(){e.dispatch(t.logLikeSmartSnippet()),e.dispatch(pu())},dislike(){e.dispatch(t.logDislikeSmartSnippet()),e.dispatch(fu())},openFeedbackModal(){e.dispatch(t.logOpenSmartSnippetFeedbackModal()),e.dispatch(mu())},closeFeedbackModal(){e.dispatch(t.logCloseSmartSnippetFeedbackModal()),e.dispatch(ia())},sendFeedback(f){e.dispatch(t.logSmartSnippetFeedback(f)),e.dispatch(ia())},sendDetailedFeedback(f){e.dispatch(t.logSmartSnippetDetailedFeedback(f)),e.dispatch(ia())},selectSource(){p.select()},beginDelayedSelectSource(){p.beginDelayedSelect()},cancelPendingSelectSource(){p.cancelPendingSelect()}}}function uH(e){return e.addReducers({search:he,questionAnswering:Qn}),!0}d();c();l();u();function Ry(e,t){if(!lH(e))throw K;let r=()=>e.state,n=new Set,o=g=>n.has(g)?!0:(n.add(g),!1),a=null,i=g=>{a!==g&&(a=g,f={},n.clear())},p=(g,S,x)=>Wt(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{o(S)||e.dispatch(x?by({questionAnswerId:x},g):id(g))}),f={},m=(g,S)=>{let{searchResponseId:x}=r().search;i(x);let h=Di({...g,questionAnswerId:S});return h in f||(f[h]=p(g,h,S)),f[h]};return{selectInlineLink(g,S){m(g,S)?.select()},beginDelayedSelectInlineLink(g,S){m(g,S)?.beginDelayedSelect()},cancelPendingSelectInlineLink(g,S){m(g,S)?.cancelPendingSelect()}}}function lH(e){return e.addReducers({search:he,questionAnswering:Qn}),!0}function QO(e,t){Ho(e.state.configuration.analytics.analyticsMode);let r=UO(e,wy,t),n=Ry(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectInlineLink(o){n.selectInlineLink(o)},beginDelayedSelectInlineLink(o){n.beginDelayedSelectInlineLink(o)},cancelPendingSelectInlineLink(o){n.cancelPendingSelectInlineLink(o)}}}d();c();l();u();d();c();l();u();function BO(e,t){if(!dH(e))throw K;let r=oe(e),n=()=>e.state,o=a=>{let{contentIdKey:i,contentIdValue:p}=a;return e.state.search.results.find(f=>jo(f,i)===p)};return{...r,get state(){let a=n();return{questions:a.search.questionAnswer.relatedQuestions.map((i,p)=>({question:i.question,answer:i.answerSnippet,documentId:i.documentId,questionAnswerId:a.questionAnswering.relatedQuestions[p].questionAnswerId,expanded:a.questionAnswering.relatedQuestions[p].expanded,source:o(i.documentId)}))}},expand(a){let i={questionAnswerId:a};e.dispatch(t.logExpandSmartSnippetSuggestion(i)),e.dispatch(gu(i))},collapse(a){let i={questionAnswerId:a};e.dispatch(t.logCollapseSmartSnippetSuggestion(i)),e.dispatch(hu(i))}}}function dH(e){return e.addReducers({search:he,questionAnswering:Qn}),!0}d();c();l();u();function GO(e,t){if(!pH(e))throw K;let r=()=>e.state,n=S=>{let x=r(),h=Yr(x,S);return h?ct(x,h.documentId):null},o=new Set,a=S=>o.has(S)?!0:(o.add(S),!1),i=null,p=S=>{i!==S&&(i=S,m={},o.clear())},f=(S,x)=>Wt(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{a(x)||(e.dispatch(sd({questionAnswerId:x})),e.dispatch(_r(S)))}),m={},g=S=>{let{searchResponseId:x}=r().search;p(x);let h=n(S);return h?(S in m||(m[S]=f(h,S)),m[S]):null};return{selectSource(S){g(S)?.select()},beginDelayedSelectSource(S){g(S)?.beginDelayedSelect()},cancelPendingSelectSource(S){g(S)?.cancelPendingSelect()}}}function pH(e){return e.addReducers({search:he,questionAnswering:Qn}),!0}function $O(e,t){Ho(e.state.configuration.analytics.analyticsMode);let r=BO(e,wy),n=Ry(e,{options:{selectionDelay:t?.options?.selectionDelay}}),o=GO(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectSource(a){o.selectSource(a)},beginDelayedSelectSource(a){o.beginDelayedSelectSource(a)},cancelPendingSelectSource(a){o.cancelPendingSelectSource(a)},selectInlineLink(a,i){n.selectInlineLink(i,a)},beginDelayedSelectInlineLink(a,i){n.beginDelayedSelectInlineLink(i,a)},cancelPendingSelectInlineLink(a,i){n.cancelPendingSelectInlineLink(i,a)}}}d();c();l();u();d();c();l();u();d();c();l();u();var HO={by:new ku({enum:xa,required:!0})},yu=k("sortCriteria/register",e=>zO(e)),Su=k("sortCriteria/update",e=>zO(e)),zO=e=>Ni(e)?(e.forEach(t=>O(t,HO)),{payload:e}):O(e,HO);d();c();l();u();var Fy=ae(vr(),e=>{e.addCase(yu,(t,r)=>rn(r.payload)).addCase(Su,(t,r)=>rn(r.payload)).addCase(qe.fulfilled,(t,r)=>r.payload?.sortCriteria??t).addCase(Me,(t,r)=>r.payload.sortCriteria??t)});function fH(e,t){if(!t)return;let r=new ve({criterion:new se({each:Dw})}),n=mH(t),o={...t,criterion:n};lt(e,r,o,"buildSort")}function mH(e){return e.criterion?Ni(e.criterion)?e.criterion:[e.criterion]:[]}function WO(e,t){if(!gH(e))throw K;let r=oe(e),{dispatch:n}=e,o=()=>e.state;fH(e,t.initialState);let a=t.initialState?.criterion;return a&&n(yu(a)),{...r,sortBy(i){n(Su(i)),n(cn(1))},isSortedBy(i){return this.state.sortCriteria===rn(i)},get state(){return{sortCriteria:o().sortCriteria}}}}function gH(e){return e.addReducers({configuration:fe,sortCriteria:Fy}),!0}function KO(e,t={}){let{dispatch:r}=e,n=WO(e,t),o=()=>r(W({legacy:iu(),next:yy()}));return{...n,get state(){return n.state},sortBy(a){n.sortBy(a),o()}}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function YO(e){return e.type==="redirect"}var Ey=class{constructor(t){me(this,"response",t)}get basicExpression(){return this.response.parsedInput.basicExpression}get largeExpression(){return this.response.parsedInput.largeExpression}get redirectionUrl(){let t=this.response.preprocessingOutput.triggers.filter(YO);return t.length?t[0].content:null}};var vu=k("standaloneSearchBox/register",e=>O(e,{id:z,redirectionUrl:z,overwrite:new de({required:!1})})),Au=k("standaloneSearchBox/updateRedirectionUrl",e=>O(e,{id:z,redirectionUrl:z})),Cu=k("standaloneSearchBox/reset",e=>O(e,{id:z})),xu=k("standaloneSearchBox/updateAnalyticsToSearchFromLink",e=>O(e,{id:z})),bu=k("standaloneSearchBox/updateAnalyticsToOmniboxFromLink"),sa=xe("standaloneSearchBox/fetchRedirect",/*#__PURE__*/function(){var _ref81=_asyncToGenerator(function*(e,{dispatch:t,getState:r,rejectWithValue:n,extra:{apiClient:o,validatePayload:a,navigatorContext:i}}){a(e,{id:new L({emptyAllowed:!1})});let p=yield yH(r(),i),f=yield o.plan(p);if(At(f))return n(f.error);let{redirectionUrl:m}=new Ey(f.success);return m&&t(hH(m)),m||""});return function(_x182,_x183){return _ref81.apply(this,arguments)}}()),hH=e=>J("analytics/standaloneSearchBox/redirect",t=>t.makeTriggerRedirect({redirectedTo:e})),yH=/*#__PURE__*/function(){var _ref82=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??vt(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,timezone:e.configuration.search.timezone,q:e.query.q,...(e.context&&{context:e.context.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.query.enableQuerySyntax!==void 0&&{enableQuerySyntax:e.query.enableQuerySyntax}),...(e.configuration.analytics.enabled&&e.configuration.analytics.analyticsMode==="legacy"?yield Rs(e.configuration.analytics):Qr(e.configuration.analytics,t)),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function yH(_x184,_x185){return _ref82.apply(this,arguments)}}();d();c();l();u();d();c();l();u();function JO(){return{}}var Iy=ae(JO(),e=>e.addCase(vu,(t,r)=>{let{id:n,redirectionUrl:o,overwrite:a}=r.payload;!a&&n in t||(t[n]=GC(o))}).addCase(Cu,(t,r)=>{let{id:n}=r.payload,o=t[n];if(o){t[n]=GC(o.defaultRedirectionUrl);return}}).addCase(Au,(t,r)=>{let{id:n,redirectionUrl:o}=r.payload;n in t&&(t[n]=GC(o))}).addCase(sa.pending,(t,r)=>{let n=t[r.meta.arg.id];n&&(n.isLoading=!0)}).addCase(sa.fulfilled,(t,r)=>{let n=r.payload,o=t[r.meta.arg.id];o&&(o.redirectTo=n||o.defaultRedirectionUrl,o.isLoading=!1)}).addCase(sa.rejected,(t,r)=>{let n=t[r.meta.arg.id];n&&(n.isLoading=!1)}).addCase(xu,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="searchFromLink")}).addCase(bu,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="omniboxFromLink",n.analytics.metadata=r.payload.metadata)}));function GC(e){return{defaultRedirectionUrl:e,redirectTo:"",isLoading:!1,analytics:{cause:"",metadata:null}}}d();c();l();u();var XO=new ve({...TC,redirectionUrl:new L({required:!0,emptyAllowed:!1}),overwrite:new de({required:!1})});function ZO(e,t){if(!SH(e))throw K;let{dispatch:r}=e,n=()=>e.state,o=t.options.id||go("standalone_search_box"),a={id:o,highlightOptions:{...t.options.highlightOptions},...gy,overwrite:!1,...t.options};He(e,XO,a,"buildStandaloneSearchBox");let i=hy(e,{options:a});return r(vu({id:o,redirectionUrl:a.redirectionUrl,overwrite:a.overwrite})),{...i,updateText(p){i.updateText(p),r(xu({id:o}))},selectSuggestion(p){let f=EC(n(),{id:o,suggestion:p});r(Ln({id:o,expression:p})),r(bu({id:o,metadata:f})),this.submit()},afterRedirection(){r(Cu({id:o}))},updateRedirectUrl(p){r(Au({id:o,redirectionUrl:p}))},submit(){r(Lt({q:this.state.value,enableQuerySyntax:a.enableQuerySyntax})),r(sa({id:o}))},get state(){let f=n().standaloneSearchBoxSet[o];return{...i.state,isLoading:f.isLoading,redirectTo:f.redirectTo,analytics:f.analytics}}}}function SH(e){return e.addReducers({standaloneSearchBoxSet:Iy,configuration:fe,query:Ft,querySuggest:au}),!0}d();c();l();u();d();c();l();u();var Ty=ae(Xp(),e=>e.addCase(Ec,(t,r)=>{let n=r.payload,{id:o}=n;o in t||(t[o]=n)}).addCase(po,(t,r)=>{let{id:n,value:o}=r.payload,a=t[n];if(!a)return;let i=a.values.find(f=>f.caption===o.caption);if(!i)return;let p=i.state==="selected";i.state=p?"idle":"selected"}).addCase(fo,(t,r)=>{let{id:n,value:o}=r.payload,a=t[n];if(!a)return;let i=a.values.find(f=>f.caption===o.caption);if(!i)return;let p=i.state==="excluded";i.state=p?"idle":"excluded"}).addCase(Jo,(t,r)=>{let n=r.payload,o=t[n];o&&o.values.forEach(a=>{a.state="idle"})}).addCase(ft,t=>{Object.values(t).forEach(r=>{r.values.forEach(n=>{n.state="idle"})})}).addCase(Me,(t,r)=>{let n=r.payload.sf||{};Object.entries(t).forEach(([o,a])=>{let i=n[o]||[];a.values.forEach(p=>{p.state=i.includes(p.caption)?"selected":"idle"})})}));d();c();l();u();function $C(e){return{state:"idle",...e}}var vH=new ve({id:vi,values:ch});function e0(e,t){if(!AH(e))throw K;He(e,vH,t.options,"buildStaticFilter");let r=oe(e),{dispatch:n}=e,o=()=>e.state,{id:a}=t.options;return n(Ec(t.options)),{...r,toggleSelect(i){n(po({id:a,value:i})),n(W({legacy:Py(a,i)}))},toggleSingleSelect(i){i.state==="idle"&&n(Jo(a)),n(po({id:a,value:i})),n(W({legacy:Py(a,i)}))},toggleExclude(i){n(fo({id:a,value:i})),n(W({legacy:Py(a,i)}))},toggleSingleExclude(i){i.state==="idle"&&n(Jo(a)),n(fo({id:a,value:i})),n(W({legacy:Py(a,i)}))},deselectAll(){n(Jo(a)),n(W({legacy:lh({staticFilterId:a})}))},isValueSelected(i){return i.state==="selected"},isValueExcluded(i){return i.state==="excluded"},get state(){let i=o().staticFilterSet[a]?.values||[],p=i.some(f=>f.state!=="idle");return{id:a,values:i,hasActiveValues:p}}}}function AH(e){return e.addReducers({staticFilterSet:Ty}),!0}function Py(e,t){let{caption:r,expression:n,state:o}=t;return(o==="idle"?uh:Ic)({staticFilterId:e,staticFilterValue:{caption:r,expression:n}})}d();c();l();u();d();c();l();u();var CH=new ve({expression:Ge,id:z,clearFiltersOnTabChange:new de}),xH=new ve({isActive:new de});function t0(e,t){if(wH(t.options.id),!bH(e))throw K;let r=oe(e),{dispatch:n}=e;He(e,CH,t.options,"buildTab");let o=lt(e,xH,t.initialState,"buildTab"),{id:a,expression:i}=t.options;return n($s({id:a,expression:i})),Object.keys(e.state.tabSet).length===1&&(o.isActive=!0),o.isActive&&n(yt(a)),{...r,select(){t.options.clearFiltersOnTabChange&&n(Ps({q:"",clearFilters:!0})),n(yt(a))},get state(){return{isActive:e.state.tabSet[a]?.isActive}}}}function bH(e){return e.addReducers({configuration:fe,tabSet:Tc}),!0}function wH(e){let t=Hs().analytics.originLevel2;if(e===t)throw new Error(`The #id option on the Tab controller cannot use the reserved value "${t}". Please specify a different value.`)}function r0(e,t){let{dispatch:r}=e,n=t0(e,t),o=()=>r(W({legacy:Ro(),next:cs()}));return{...n,get state(){return n.state},select(){n.select(),o()}}}d();c();l();u();function n0(e){let t=mh(e);return{...t,get state(){return t.state}}}d();c();l();u();d();c();l();u();d();c();l();u();function o0(e){return e.query="",e.queryModification={originalQuery:"",newQuery:"",queryToIgnore:e.queryModification.queryToIgnore},e}function a0(e,t){let r=[],n=[],o=[],a=[];return t.forEach(i=>{switch(i.type){case"redirect":r.push(i.content);break;case"query":n.push(i.content);break;case"execute":o.push({functionName:i.content.name,params:i.content.params});break;case"notify":a.push(i.content);break}}),e.redirectTo=r[0]??"",e.query=e.queryModification.newQuery,e.executions=o,e.notifications=a,e}function i0(e,t){return e.queryModification={...t,queryToIgnore:""},e}function s0(e,t){return e.queryModification.queryToIgnore=t,e}d();c();l();u();var c0=()=>({redirectTo:"",query:"",executions:[],notifications:[],queryModification:{originalQuery:"",newQuery:"",queryToIgnore:""}});var ca=ae(c0(),e=>e.addCase(W.pending,o0).addCase(W.fulfilled,(t,r)=>a0(t,r.payload.response.triggers)).addCase(Ts,(t,r)=>i0(t,r.payload)).addCase(No,(t,r)=>s0(t,r.payload)));function u0(e){if(!RH(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state,o=n().triggers.executions;return{...t,subscribe(a){let i=()=>{let p=!Ri(this.state.executions,o,(f,m)=>f.functionName===m.functionName&&Ri(f.params,m.params));o=this.state.executions,p&&this.state.executions.length&&(a(),r(of()))};return i(),e.subscribe(i)},get state(){return{executions:n().triggers.executions}}}}function RH(e){return e.addReducers({triggers:ca}),!0}d();c();l();u();d();c();l();u();function l0(e,t){let r=t.options.logNotifyTriggerActionCreator;if(!FH(e))throw K;let n=oe(e),{dispatch:o}=e,a=()=>e.state,i=a().triggers.notifications;return{...n,subscribe(p){let f=()=>{let m=!Ri(i,this.state.notifications);i=this.state.notifications,m&&(p(),o(r()))};return f(),e.subscribe(f)},get state(){return{notifications:a().triggers.notifications}}}}function FH(e){return e.addReducers({triggers:ca}),!0}function d0(e){return l0(e,{options:{logNotifyTriggerActionCreator:rf}})}d();c();l();u();function p0(e){if(!EH(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state,o=()=>n().triggers.queryModification.newQuery,a=()=>n().triggers.queryModification.originalQuery;return{...t,get state(){return{newQuery:o(),originalQuery:a(),wasQueryModified:o()!==""}},undo(){r(No(o())),r(Lt({q:a()})),r(W({legacy:tf({undoneQuery:o()})}))}}}function EH(e){return e.addReducers({triggers:ca,query:Ft}),!0}d();c();l();u();function f0(e){if(!IH(e))throw K;let t=oe(e),{dispatch:r}=e,n=()=>e.state,o=n().triggers.redirectTo;return{...t,subscribe(a){let i=()=>{let p=o!==this.state.redirectTo;o=this.state.redirectTo,p&&this.state.redirectTo&&(a(),r(nf()))};return i(),e.subscribe(i)},get state(){return{redirectTo:n().triggers.redirectTo}}}}function IH(e){return e.addReducers({triggers:ca}),!0}d();c();l();u();d();c();l();u();var g0="..",HC="...",TH=/^(f|fExcluded|cf|nf|df|sf|af|mnf)-(.+)$/,PH={f:!0,fExcluded:!0,cf:!0,sf:!0,af:!0,nf:!0,df:!0,mnf:!0},ky="&",cd="=";function ud(){return{serialize:_H(NH),deserialize:LH}}function ld(e){return e in PH}function kH(e){return e in{q:!0,aq:!0,cq:!0,enableQuerySyntax:!0,firstResult:!0,numberOfResults:!0,sortCriteria:!0,debug:!0,tab:!0}}function OH(e){let r=e in{nf:!0,df:!0,mnf:!0};return ld(e)&&r}function h0(e){return kH(e)||ld(e)}var _H=e=>t=>Object.entries(t).map(e).filter(r=>r).join(ky);function NH(e){let[t,r]=e;return h0(t)?ld(t)&&!OH(t)?qH(r)?VH(t,r):"":t==="nf"||t==="df"?MH(r)?jH(t,r):"":DH(t,r):""}function DH(e,t){return`${e}${cd}${encodeURIComponent(t)}`}function qH(e){return zC(e)?y0(e,r=>typeof r=="string"):!1}function MH(e){return zC(e)?y0(e,r=>zC(r)&&"start"in r&&"end"in r):!1}function zC(e){return!!(e&&typeof e=="object")}function y0(e,t){return Object.entries(e).filter(n=>{let o=n[1];return!Array.isArray(o)||!o.every(t)}).length===0}function VH(e,t){return Object.entries(t).map(([r,n])=>`${e}-${r}${cd}${n.map(o=>encodeURIComponent(o)).join(",")}`).join(ky)}function jH(e,t){return Object.entries(t).map(([r,n])=>{let o=n.map(({start:a,end:i,endInclusive:p})=>`${a}${p?HC:g0}${i}`).join(",");return`${e}-${r}${cd}${o}`}).join(ky)}function LH(e){return e.split(ky).map(n=>UH(n)).map(n=>QH(n)).filter(HH).map(n=>zH(n)).reduce((n,o)=>{let[a,i]=o;if(ld(a)){let p={...n[a],...i};return{...n,[a]:p}}return{...n,[a]:i}},{})}function UH(e){let[t,...r]=e.split(cd),n=r.join(cd);return[t,n]}function QH(e,t=TH){let[r,n]=e,o=t.exec(r);if(!o)return e;let a=o[1],i=o[2],p=n.split(","),f=BH(a,p),m={[i]:f};return[a,JSON.stringify(m)]}function BH(e,t){return e==="nf"||e==="mnf"?GH(t,"selected"):e==="df"?$H(t,"selected"):t}function GH(e,t){let r=[];for(let n of e){let{startAsString:o,endAsString:a,isEndInclusive:i}=S0(n),p=parseFloat(o),f=parseFloat(a);!Number.isFinite(p)||!Number.isFinite(f)||r.push(Vc({start:p,end:f,state:t,endInclusive:i}))}return r}function m0(e){try{return dR(e)?(Qp(e,Fs),!0):un(e)?(Oo(e),!0):!1}catch{return!1}}function $H(e,t){let r=[];for(let n of e){let{isEndInclusive:o,startAsString:a,endAsString:i}=S0(n);!m0(a)||!m0(i)||r.push(Yo({start:a,end:i,state:t,endInclusive:o}))}return r}function HH(e){let t=h0(e[0]),r=e.length===2;return t&&r}function zH(e,t=!0){let[r,n]=e;return r==="enableQuerySyntax"?[r,n==="true"]:r==="debug"?[r,n==="true"]:r==="firstResult"?[r,parseInt(n,10)]:r==="numberOfResults"?[r,parseInt(n,10)]:ld(r)?[r,WH(n)]:[r,t?decodeURIComponent(n):n]}function WH(e){let t=JSON.parse(e),r={};return Object.entries(t).forEach(n=>{let[o,a]=n;r[o]=a.map(i=>_i(i)?decodeURIComponent(i):i)}),r}function S0(e){let t=e.indexOf(HC)!==-1,[r,n]=e.split(t?HC:g0);return{isEndInclusive:t,startAsString:r,endAsString:n}}var KH=new ve({fragment:new L});function v0(e,t){let r;function n(){r=e.state.search.requestId}function o(){return r!==e.state.search.requestId}if(!JH(e))throw K;lt(e,KH,t.initialState,"buildUrlManager");let a=oe(e),i=t.initialState.fragment;n();let p=Cy(e,{initialState:{parameters:Oy(i)}});return{...a,subscribe(f){let m=()=>{let g=this.state.fragment;!YH(i,g)&&o()&&(i=g,f()),n()};return m(),e.subscribe(m)},get state(){return{fragment:ud().serialize(p.state.parameters)}},synchronize(f){i=f;let m=Oy(f);p.synchronize(m)}}}function YH(e,t){if(e===t)return!0;let r=Oy(e),n=Oy(t);return rd(r,n)}function Oy(e){return ud().deserialize(e)}function JH(e){return e.addReducers({configuration:fe}),!0}d();c();l();u();d();c();l();u();var A0=xe("analytics/addPageViewEntry",/*#__PURE__*/function(){var _ref83=_asyncToGenerator(function*(e,{getState:t}){t().configuration.analytics.enabled&&Nt.getInstance().addElement({name:"PageView",value:e,time:JSON.stringify(new Date)})});return function(_x186,_x187){return _ref83.apply(this,arguments)}}());function XH(e){return e.addReducers({}),{addPageViewEntryInActionsHistory:A0}}d();c();l();u();d();c();l();u();d();c();l();u();var ua=()=>new L({required:!1,emptyAllowed:!0}),_y=k("advancedSearchQueries/update",e=>O(e,{aq:ua(),cq:ua(),lq:ua(),dq:ua()})),Ny=k("advancedSearchQueries/register",e=>O(e,{aq:ua(),cq:ua(),lq:ua(),dq:ua()}));var C0=ae(Br(),e=>{e.addCase(_y,(t,r)=>{let{aq:n,cq:o,lq:a,dq:i}=r.payload;Tt(n)||(t.aq=n,t.aqWasSet=!0),Tt(o)||(t.cq=o,t.cqWasSet=!0),Tt(a)||(t.lq=a,t.lqWasSet=!0),Tt(i)||(t.dq=i,t.dqWasSet=!0)}).addCase(Ny,(t,r)=>{let{aq:n,cq:o,lq:a,dq:i}=r.payload;Tt(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),Tt(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),Tt(a)||(t.defaultFilters.lq=a,t.lqWasSet||(t.lq=a)),Tt(i)||(t.defaultFilters.dq=i,t.dqWasSet||(t.dq=i))}).addCase(qe.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(Me,(t,r)=>{let{aq:n,cq:o}=r.payload;Tt(n)||(t.aq=n,t.aqWasSet=!0),Tt(o)||(t.cq=o,t.cqWasSet=!0)})});function ZH(e){return e.addReducers({advancedSearchQueries:C0}),{updateAdvancedSearchQueries:_y,registerAdvancedSearchQueries:Ny}}d();c();l();u();function e3(e){return e.addReducers({}),{logDocumentOpen:py,logOpenSmartSnippetSource:qC,logOpenSmartSnippetSuggestionSource:sd,logOpenSmartSnippetInlineLink:id,logOpenSmartSnippetSuggestionInlineLink:by}}d();c();l();u();function t3(e){return e.addReducers({}),{logSearchEvent:Xw,logClickEvent:Zw,logCustomEvent:eR}}d();c();l();u();function r3(e){return e.addReducers({}),{logClearBreadcrumbs:Gg,logInterfaceLoad:Tp,logSearchFromLink:Pp,logOmniboxFromLink:kp,logInterfaceChange:Ro,logDidYouMeanClick:Hp,logCategoryFacetBreadcrumb:Dg,logFacetBreadcrumb:Rc,logFacetClearAll:bt,logFacetUnexclude:io,logFacetExclude:fr,logFacetDeselect:Kr,logFacetSelect:it,logFacetShowLess:wc,logFacetShowMore:bc,logFacetUpdateSort:Tn,logDateFacetBreadcrumb:Kl,logNumericFacetBreadcrumb:Yl,logNavigateBackward:Xh,logNavigateForward:Jh,logPageNext:iy,logPageNumber:Jc,logPagePrevious:sy,logPagerResize:Yc,logSearchboxSubmit:oa,logQuerySuggestionClick:my,logResultsSort:iu,logDislikeSmartSnippet:DC,logLikeSmartSnippet:NC,logOpenSmartSnippetFeedbackModal:MC,logCloseSmartSnippetFeedbackModal:VC,logSmartSnippetFeedback:jC,logSmartSnippetDetailedFeedback:LC,logExpandSmartSnippet:OC,logCollapseSmartSnippet:_C,logExpandSmartSnippetSuggestion:UC,logCollapseSmartSnippetSuggestion:QC,logNoResultsBack:Zh,logStaticFilterSelect:uh,logStaticFilterDeselect:Ic,logStaticFilterClearAll:lh,logTriggerQuery:ef,logUndoTriggerQuery:tf,logNotifyTrigger:rf,logTriggerRedirect:nf,logTriggerExecute:of}}d();c();l();u();function n3(e){return e.addReducers({}),{deselectAllBreadcrumbs:ft,deselectAllNonBreadcrumbs:hs}}d();c();l();u();function o3(e){return e.addReducers({configuration:fe}),{disableAnalytics:us,enableAnalytics:ls,setOriginLevel2:Op,setOriginLevel3:_p,updateAnalyticsConfiguration:Fo,updateBasicConfiguration:on}}d();c();l();u();function a3(e){return e.addReducers({configuration:fe,pipeline:gs,searchHub:Ns}),{updateSearchConfiguration:Ar}}d();c();l();u();function i3(e){return e.addReducers({context:ph}),{addContext:Ci,removeContext:xi,setContext:Ai}}d();c();l();u();function s3(e){return e.addReducers({debug:fs}),{disableDebug:ps,enableDebug:Eo}}d();c();l();u();function c3(e){return e.addReducers({dictionaryFieldContext:gh}),{addContext:kc,removeContext:Oc,setContext:Pc}}d();c();l();u();function u3(e){return e.addReducers({didYouMean:yh,query:Ft}),{applyDidYouMeanCorrection:xr,disableDidYouMean:Gp,enableDidYouMean:Es,enableAutomaticQueryCorrection:$p,disableAutomaticQueryCorrection:Is,setCorrectionMode:Ra}}d();c();l();u();d();c();l();u();d();c();l();u();var Dy=k("excerptLength/set",e=>O(e,new re({min:0,required:!0})));d();c();l();u();function x0(){return{length:void 0}}var b0=ae(x0(),e=>{e.addCase(Dy,(t,r)=>{t.length=r.payload})});function l3(e){return e.addReducers({excerptLength:b0}),{setExcerptLength:Dy}}d();c();l();u();function d3(e){return e.addReducers({facetOptions:wt}),{updateFacetOptions:Fe,enableFacet:Gt,disableFacet:rt}}d();c();l();u();function p3(e){return e.addReducers({automaticFacetSet:Sh}),{setOptions:fc,deselectAllAutomaticFacetValues:mc,toggleSelectAutomaticFacetValue:Sn}}d();c();l();u();function f3(e){return e.addReducers({categoryFacetSet:Cn}),{deselectAllCategoryFacetValues:An,registerCategoryFacet:vn,toggleSelectCategoryFacetValue:Wo,updateCategoryFacetNumberOfValues:di,updateCategoryFacetSortCriterion:hc,updateFacetAutoSelection:an,updateCategoryFacetBasePath:Ng}}d();c();l();u();function m3(e){return e.addReducers({facetSet:kr}),{deselectAllFacetValues:nt,registerFacet:Fn,toggleSelectFacetValue:En,toggleExcludeFacetValue:In,updateFacetIsFieldExpanded:fi,updateFacetNumberOfValues:pi,updateFacetSortCriterion:xc,updateFreezeCurrentValues:ao,updateFacetAutoSelection:an}}d();c();l();u();function g3(e){return e.addReducers({dateFacetSet:Nn}),{deselectAllDateFacetValues:zg,registerDateFacet:Pn,toggleSelectDateFacetValue:kn,toggleExcludeDateFacetValue:On,updateDateFacetSortCriterion:Hg,updateDateFacetValues:uo}}d();c();l();u();function h3(e){return e.addReducers({numericFacetSet:Or}),{deselectAllNumericFacetValues:ih,registerNumericFacet:Dn,toggleSelectNumericFacetValue:qn,toggleExcludeNumericFacetValue:Mn,updateNumericFacetSortCriterion:ah,updateNumericFacetValues:lo}}d();c();l();u();function y3(e){return e.addReducers({fields:na}),{registerFieldsToInclude:ra,enableFetchAllFields:Lc,disableFetchAllFields:bi,fetchFieldsDescription:Uc}}d();c();l();u();function S3(e){return e.addReducers({folding:zh}),{registerFolding:Xo,loadCollection:Zo}}d();c();l();u();function v3(e){return e.addReducers({generatedAnswer:Gc}),{generateAnswer:_f,resetAnswer:dr,setAnswerGenerationMode:Us}}d();c();l();u();function A3(e){return e.addReducers({history:ry,facetOrder:Hc}),{back:dl,forward:Vp}}d();c();l();u();function C3(e){return e.addReducers({instantResults:oy}),{registerInstantResults:ys,updateInstantResultsQuery:sn,clearExpiredResults:Ss}}d();c();l();u();function x3(e){return e.addReducers({pagination:Nr}),{nextPage:xs,previousPage:bs,registerNumberOfResults:vs,registerPage:Cs,updateNumberOfResults:As,updatePage:cn}}d();c();l();u();function b3(e){return e.addReducers({pipeline:gs}),{setPipeline:ms}}d();c();l();u();function w3(e){return e.addReducers({query:Ft}),{updateQuery:Lt}}d();c();l();u();function R3(e){return e.addReducers({querySet:aa}),{registerQuerySetQuery:ou,updateQuerySetQuery:Ii}}d();c();l();u();function F3(e){return e.addReducers({querySuggest:au,querySet:aa}),{clearQuerySuggest:ea,fetchQuerySuggestions:ta,registerQuerySuggest:jc,selectQuerySuggestion:Ln}}d();c();l();u();function E3(e){return e.addReducers({questionAnswering:Qn}),{collapseSmartSnippet:du,expandSmartSnippet:lu,dislikeSmartSnippet:fu,likeSmartSnippet:pu,openFeedbackModal:mu,closeFeedbackModal:ia,expandSmartSnippetRelatedQuestion:gu,collapseSmartSnippetRelatedQuestion:hu}}d();c();l();u();function I3(e){return e.addReducers({recentQueries:ly}),{registerRecentQueries:Ei,clearRecentQueries:nu}}d();c();l();u();function T3(e){return e.addReducers({recentResults:dy}),{registerRecentResults:zc,clearRecentResults:Wc,pushRecentResult:_r}}d();c();l();u();function P3(e){return e.addReducers({resultPreview:uy}),{fetchResultContent:Fi,updateContentURL:ru,nextPreview:Zc,previousPreview:eu,preparePreviewPagination:tu}}d();c();l();u();d();c();l();u();var k3=new ve({content:new Be({required:!0}),conditions:new Be({required:!0}),priority:new re({required:!1,default:0,min:0}),fields:new se({required:!1,each:z})});function w0(){let e=[],t=r=>{let n=k3.validate(r);if(!r.conditions.every(a=>a instanceof Function))throw new Pu("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(a=>a(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(a=>a(r)));return n?n.linkContent:null}}}function R0(e){if(!O3(e))throw K;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=w0();return{registerTemplates:(...o)=>{t(...o);let a=[];o.forEach(i=>{i.fields&&a.push(...i.fields)}),e.dispatch(ra(a))},selectTemplate:r,selectLinkTemplate:n}}function O3(e){return e.addReducers({fields:na}),!0}d();c();l();u();function _3(e){return e.addReducers({search:he}),{executeSearch:ER,fetchMoreResults:TR,fetchFacetValues:PR,fetchPage:IR,fetchInstantResults:kR}}d();c();l();u();function N3(e){return e.addReducers({searchHub:Ns}),{setSearchHub:_s}}d();c();l();u();function D3(e){return e.addReducers({facetOrder:Hc,facetSet:kr,pagination:Nr,query:Ft,querySet:aa}),{restoreSearchParameters:Me,restoreTab:ds}}d();c();l();u();function q3(e){let{by:t,order:r}=e;switch(t){case"relevancy":return is();case"qre":return xp();case"nosort":return bp();case"date":if(!r)throw new Error("An order (i.e., ascending or descending) should be specified for a sort criterion sorted by \"date\"");return Ap(r);default:if(!r)throw new Error(`An order (i.e., ascending or descending) should be specified for a sort criterion sorted by a field, such as "${t}"`);return Cp(t,r)}}function M3(e){return e===void 0||e==="ascending"||e==="descending"}function F0(e){let t=e.split(","),r=new Error(`Wrong criterion expression format for "${e}"`);if(!t.length)throw r;return t.map(n=>{let o=n.trim().split(" "),a=o[0].toLowerCase(),i=o[1]?.toLowerCase();if(o.length>2||a==="")throw r;if(!M3(i))throw new Error(`Wrong criterion sort order "${i}" in expression "${e}". Order should either be "ascending" or "descending"`);return q3({by:a,order:i})})}d();c();l();u();function V3(e){return e.addReducers({sortCriteria:Fy}),{registerSortCriterion:yu,updateSortCriterion:Su}}d();c();l();u();function j3(e){return e.addReducers({standaloneSearchBoxSet:Iy}),{registerStandaloneSearchBox:vu,fetchRedirectUrl:sa,updateStandaloneSearchBoxRedirectionUrl:Au,updateAnalyticsToSearchFromLink:xu,updateAnalyticsToOmniboxFromLink:bu,resetStandaloneSearchBox:Cu}}d();c();l();u();function L3(e){return e.addReducers({staticFilterSet:Ty}),{registerStaticFilter:Ec,toggleSelectStaticFilterValue:po,toggleExcludeStaticFilterValue:fo,deselectAllStaticFilterValues:Jo}}d();c();l();u();function U3(e){return e.addReducers({tabSet:Tc}),{registerTab:$s,updateActiveTab:yt}}d();c();l();u();d();c();l();u();d();c();l();u();function Et(e){return e.negate?"NOT ":""}d();c();l();u();function qr(e){return{contains:"=",differentThan:"<>",fuzzyMatch:"~=",greaterThan:">",greaterThanOrEqual:">=",isExactly:"==",lowerThan:"<",lowerThanOrEqual:"<=",phoneticMatch:"%=",regexMatch:"/=",wildcardMatch:"*="}[e]}function E0(e){return{toQuerySyntax(){let{field:t,value:r}=e,n=qr(e.operator);return`${Et(e)}@${t}${n}${r}`}}}d();c();l();u();function I0(e){return{toQuerySyntax(){let t=Et(e),{field:r,from:n,to:o}=e,a=qr("isExactly");return`${t}@${r}${a}${n}..${o}`}}}d();c();l();u();function T0(e){return{toQuerySyntax(){let t=Et(e),{expression:r}=e;return`${t}"${r}"`}}}d();c();l();u();function P0(e){return{toQuerySyntax(){let t=Et(e),{field:r}=e;return`${t}@${r}`}}}d();c();l();u();function k0(e){return{toQuerySyntax(){let{expression:t,negate:r}=e;return r?`NOT (${t})`:t}}}d();c();l();u();function O0(e){return{toQuerySyntax(){let t=Et(e),{startTerm:r,otherTerms:n}=e,o=Q3(n),a=`${r} ${o}`;return e.negate?`${t}(${a})`:a}}}function Q3(e){return e.map(t=>{let{endTerm:r,maxKeywordsBetween:n}=t;return`near:${n} ${r}`}).join(" ")}d();c();l();u();function _0(e){return{toQuerySyntax(){let{field:t,value:r}=e,n=Et(e),o=qr(e.operator);return`${n}@${t}${o}${r}`}}}d();c();l();u();function N0(e){return{toQuerySyntax(){let t=Et(e),{field:r,from:n,to:o}=e,a=qr("isExactly");return`${t}@${r}${a}${n}..${o}`}}}d();c();l();u();function D0(e){return{toQuerySyntax(){let{name:t,parameters:r}=e,n=B3(r);return`$${t}(${n})`}}}function B3(e){return Object.entries(e).map(t=>{let[r,n]=t,o=typeof n=="string"?n:n.toQuerySyntax();return`${r}: ${o}`}).join(", ")}d();c();l();u();function q0(e){return{toQuerySyntax(){let t=Et(e),{field:r,operator:n,value:o}=e,a=qr(n),i=n==="fuzzyMatch"?` $quoteVar(value: ${o})`:`("${o}")`;return`${t}@${r}${a}${i}`}}}d();c();l();u();function M0(e){return{toQuerySyntax(){let{field:t}=e,r=Et(e),n=qr(e.operator),o=e.values.map(i=>`"${i}"`),a=o.length===1?o[0]:`(${o.join(",")})`;return`${r}@${t}${n}${a}`}}}function G3(){let e=[],t="and";return{addExpression(r){return e.push(r),this},addKeyword(r){return e.push(k0(r)),this},addNear(r){return e.push(O0(r)),this},addExactMatch(r){return e.push(T0(r)),this},addFieldExists(r){return e.push(P0(r)),this},addStringField(r){return e.push(M0(r)),this},addStringFacetField(r){return e.push(q0(r)),this},addNumericField(r){return e.push(_0(r)),this},addNumericRangeField(r){return e.push(N0(r)),this},addDateField(r){return e.push(E0(r)),this},addDateRangeField(r){return e.push(I0(r)),this},addQueryExtension(r){return e.push(D0(r)),this},joinUsing(r){return t=r,this},toQuerySyntax(){let r=$3(t),n=e.map(o=>o.toQuerySyntax()).join(`) ${r} (`);return e.length<=1?n:`(${n})`}}}function $3(e){return e==="and"?"AND":"OR"}/**
|
|
50
50
|
* @license
|
|
51
51
|
*
|
|
52
52
|
* Copyright 2026 Coveo Solutions Inc.
|
|
@@ -79,4 +79,4 @@ fast-json-patch/module/duplex.mjs:
|
|
|
79
79
|
*)
|
|
80
80
|
*/if(__exports!=exports)module.exports=exports;return module.exports});
|
|
81
81
|
|
|
82
|
-
window.coveoQuanticVersion = '3.44.
|
|
82
|
+
window.coveoQuanticVersion = '3.44.2';
|