@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.
Files changed (203) hide show
  1. package/force-app/main/default/classes/OrganizationEndpointsTest.cls +71 -15
  2. package/force-app/main/default/classes/RecommendationsControllerTest.cls +1 -1
  3. package/force-app/main/default/lwc/quanticTabBar/quanticTabBar.js +148 -125
  4. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +16 -16
  5. package/force-app/main/default/staticresources/coveoheadless/headless.js +17 -17
  6. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +16 -16
  7. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +16 -16
  8. package/package.json +33 -31
  9. package/force-app/main/default/lwc/quanticAriaLive/__tests__/quanticAriaLive.test.js +0 -106
  10. package/force-app/main/default/lwc/quanticBreadcrumbManager/__tests__/quanticBreadcrumbManager.test.js +0 -752
  11. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/data.ts +0 -130
  12. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/fixture.ts +0 -87
  13. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/pageObject.ts +0 -282
  14. package/force-app/main/default/lwc/quanticBreadcrumbManager/e2e/quanticBreadcrumbManager.e2e.ts +0 -208
  15. package/force-app/main/default/lwc/quanticCarousel/__tests__/quanticCarousel.test.js +0 -262
  16. package/force-app/main/default/lwc/quanticCaseClassification/__tests__/quanticCaseClassification.test.js +0 -819
  17. package/force-app/main/default/lwc/quanticCaseClassification/e2e/data.ts +0 -23
  18. package/force-app/main/default/lwc/quanticCaseClassification/e2e/fixture.ts +0 -51
  19. package/force-app/main/default/lwc/quanticCaseClassification/e2e/pageObject.ts +0 -152
  20. package/force-app/main/default/lwc/quanticCaseClassification/e2e/quanticCaseClassification.e2e.ts +0 -269
  21. package/force-app/main/default/lwc/quanticCategoryFacet/__tests__/quanticCategoryFacet.test.js +0 -1183
  22. package/force-app/main/default/lwc/quanticCategoryFacet/e2e/data.ts +0 -91
  23. package/force-app/main/default/lwc/quanticCategoryFacet/e2e/fixture.ts +0 -79
  24. package/force-app/main/default/lwc/quanticCategoryFacet/e2e/pageObject.ts +0 -55
  25. package/force-app/main/default/lwc/quanticCategoryFacet/e2e/quanticCategoryFacet.e2e.ts +0 -219
  26. package/force-app/main/default/lwc/quanticCitation/__tests__/quanticCitation.test.js +0 -581
  27. package/force-app/main/default/lwc/quanticColoredResultBadge/__tests__/quanticColoredResultBadge.test.js +0 -212
  28. package/force-app/main/default/lwc/quanticDateFacet/__tests__/quanticDateFacet.test.js +0 -688
  29. package/force-app/main/default/lwc/quanticDateFacet/e2e/data.ts +0 -44
  30. package/force-app/main/default/lwc/quanticDateFacet/e2e/fixture.ts +0 -72
  31. package/force-app/main/default/lwc/quanticDateFacet/e2e/pageObject.ts +0 -27
  32. package/force-app/main/default/lwc/quanticDateFacet/e2e/quanticDateFacet.e2e.ts +0 -167
  33. package/force-app/main/default/lwc/quanticDidYouMean/__tests__/quanticDidYouMean.test.js +0 -348
  34. package/force-app/main/default/lwc/quanticDidYouMean/e2e/data.ts +0 -48
  35. package/force-app/main/default/lwc/quanticDidYouMean/e2e/fixture.ts +0 -84
  36. package/force-app/main/default/lwc/quanticDidYouMean/e2e/pageObject.ts +0 -173
  37. package/force-app/main/default/lwc/quanticDidYouMean/e2e/quanticDidYouMean.e2e.ts +0 -219
  38. package/force-app/main/default/lwc/quanticDocumentSuggestion/__tests__/quanticDocumentSuggestion.test.js +0 -404
  39. package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/fixture.ts +0 -38
  40. package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/pageObject.ts +0 -52
  41. package/force-app/main/default/lwc/quanticDocumentSuggestion/e2e/quanticDocumentSuggestion.e2e.ts +0 -102
  42. package/force-app/main/default/lwc/quanticFacet/__tests__/quanticFacet.test.js +0 -1105
  43. package/force-app/main/default/lwc/quanticFacet/e2e/data.ts +0 -62
  44. package/force-app/main/default/lwc/quanticFacet/e2e/fixture.ts +0 -78
  45. package/force-app/main/default/lwc/quanticFacet/e2e/pageObject.ts +0 -67
  46. package/force-app/main/default/lwc/quanticFacet/e2e/quanticFacet.e2e.ts +0 -242
  47. package/force-app/main/default/lwc/quanticFacetCaption/__tests__/quanticFacetCaption.test.js +0 -28
  48. package/force-app/main/default/lwc/quanticFacetManager/__tests__/quanticFacetManager.test.js +0 -178
  49. package/force-app/main/default/lwc/quanticFacetManager/e2e/data.ts +0 -59
  50. package/force-app/main/default/lwc/quanticFacetManager/e2e/fixture.ts +0 -75
  51. package/force-app/main/default/lwc/quanticFacetManager/e2e/pageObject.ts +0 -23
  52. package/force-app/main/default/lwc/quanticFacetManager/e2e/quanticFacetManager.e2e.ts +0 -82
  53. package/force-app/main/default/lwc/quanticFeedback/__tests__/quanticFeedback.test.js +0 -403
  54. package/force-app/main/default/lwc/quanticFeedbackModal/__tests__/quanticFeedbackModal.test.js +0 -448
  55. package/force-app/main/default/lwc/quanticFeedbackModalQna/__tests__/quanticFeedbackModalQna.test.js +0 -298
  56. package/force-app/main/default/lwc/quanticFoldedResultList/__tests__/quanticFoldedResultList.test.js +0 -323
  57. package/force-app/main/default/lwc/quanticFoldedResultList/e2e/fixture.ts +0 -74
  58. package/force-app/main/default/lwc/quanticFoldedResultList/e2e/pageObject.ts +0 -81
  59. package/force-app/main/default/lwc/quanticFoldedResultList/e2e/quanticFoldedResultList.e2e.ts +0 -69
  60. package/force-app/main/default/lwc/quanticGeneratedAnswer/__tests__/quanticGeneratedAnswer.test.js +0 -1575
  61. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/agentData.ts +0 -279
  62. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/data.ts +0 -56
  63. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/fixture-agent.ts +0 -77
  64. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/fixture.ts +0 -194
  65. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/pageObject.ts +0 -599
  66. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/quanticGeneratedAnswer.e2e.ts +0 -333
  67. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/quanticGeneratedAnswerAgent.e2e.ts +0 -298
  68. package/force-app/main/default/lwc/quanticGeneratedAnswerBody/__tests__/quanticGeneratedAnswerBody.test.js +0 -418
  69. package/force-app/main/default/lwc/quanticGeneratedAnswerContent/__tests__/quanticGeneratedAnswerContent.test.js +0 -447
  70. package/force-app/main/default/lwc/quanticGeneratedAnswerCopyToClipboard/__tests__/quanticGeneratedAnswerCopyToClipboard.test.js +0 -129
  71. package/force-app/main/default/lwc/quanticGeneratedAnswerFollowUpInput/__tests__/quanticGeneratedAnswerFollowUpInput.test.js +0 -466
  72. package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/__tests__/quanticGeneratedAnswerStreamOfThought.test.js +0 -402
  73. package/force-app/main/default/lwc/quanticGeneratedAnswerStreamOfThought/__tests__/stepsUtils.test.js +0 -118
  74. package/force-app/main/default/lwc/quanticGeneratedAnswerThread/__tests__/quanticGeneratedAnswerThread.test.js +0 -285
  75. package/force-app/main/default/lwc/quanticHeading/__tests__/quanticHeading.test.js +0 -71
  76. package/force-app/main/default/lwc/quanticHeadlessLoader/__tests__/quanticHeadlessLoader.test.js +0 -651
  77. package/force-app/main/default/lwc/quanticInsightInterface/__tests__/quanticInsightInterface.test.js +0 -194
  78. package/force-app/main/default/lwc/quanticInsightSummary/__tests__/quanticInsightSummary.test.js +0 -230
  79. package/force-app/main/default/lwc/quanticModal/__tests__/quanticModal.test.js +0 -205
  80. package/force-app/main/default/lwc/quanticNotifications/__tests__/quanticNotifications.test.js +0 -309
  81. package/force-app/main/default/lwc/quanticNotifications/e2e/fixture.ts +0 -62
  82. package/force-app/main/default/lwc/quanticNotifications/e2e/pageObject.ts +0 -55
  83. package/force-app/main/default/lwc/quanticNotifications/e2e/quanticNotifications.e2e.ts +0 -47
  84. package/force-app/main/default/lwc/quanticNumericFacet/__tests__/quanticNumericFacet.test.js +0 -953
  85. package/force-app/main/default/lwc/quanticNumericFacet/e2e/data.ts +0 -48
  86. package/force-app/main/default/lwc/quanticNumericFacet/e2e/fixture.ts +0 -75
  87. package/force-app/main/default/lwc/quanticNumericFacet/e2e/pageObject.ts +0 -59
  88. package/force-app/main/default/lwc/quanticNumericFacet/e2e/quanticNumericFacet.e2e.ts +0 -186
  89. package/force-app/main/default/lwc/quanticPager/__tests__/quanticPager.test.js +0 -430
  90. package/force-app/main/default/lwc/quanticPager/e2e/fixture.ts +0 -65
  91. package/force-app/main/default/lwc/quanticPager/e2e/pageObject.ts +0 -69
  92. package/force-app/main/default/lwc/quanticPager/e2e/quanticPager.e2e.ts +0 -106
  93. package/force-app/main/default/lwc/quanticPlaceholder/__tests__/quanticPlaceholder.test.js +0 -47
  94. package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/data/defaultTestCase.json +0 -13
  95. package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/data/youtubeTestCase.json +0 -14
  96. package/force-app/main/default/lwc/quanticQuickviewContent/__tests__/quanticQuickviewContent.test.js +0 -82
  97. package/force-app/main/default/lwc/quanticRadioButtonsGroup/__tests__/quanticRadioButtonsGroup.test.js +0 -273
  98. package/force-app/main/default/lwc/quanticRecentQueriesList/__tests__/quanticRecentQueriesList.test.js +0 -448
  99. package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/fixture.ts +0 -43
  100. package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/pageObject.ts +0 -55
  101. package/force-app/main/default/lwc/quanticRecentQueriesList/e2e/quanticRecentQueriesList.e2e.ts +0 -93
  102. package/force-app/main/default/lwc/quanticRecentResultsList/__tests__/quanticRecentResultsList.test.js +0 -516
  103. package/force-app/main/default/lwc/quanticRecentResultsList/e2e/fixture.ts +0 -43
  104. package/force-app/main/default/lwc/quanticRecentResultsList/e2e/pageObject.ts +0 -61
  105. package/force-app/main/default/lwc/quanticRecentResultsList/e2e/quanticRecentResultsList.e2e.ts +0 -48
  106. package/force-app/main/default/lwc/quanticRecommendationList/__tests__/quanticRecommendationList.test.js +0 -491
  107. package/force-app/main/default/lwc/quanticRecommendationList/e2e/fixture.ts +0 -36
  108. package/force-app/main/default/lwc/quanticRecommendationList/e2e/pageObject.ts +0 -52
  109. package/force-app/main/default/lwc/quanticRecommendationList/e2e/quanticRecommendationList.e2e.ts +0 -53
  110. package/force-app/main/default/lwc/quanticRefineModalContent/__tests__/quanticRefineModalContent.test.js +0 -747
  111. package/force-app/main/default/lwc/quanticRefineToggle/__tests__/quanticRefineToggle.test.js +0 -544
  112. package/force-app/main/default/lwc/quanticResultAction/__tests__/quanticResultAction.test.js +0 -262
  113. package/force-app/main/default/lwc/quanticResultActionBar/__tests__/quanticResultActionBar.test.js +0 -141
  114. package/force-app/main/default/lwc/quanticResultChildren/__tests__/quanticResultChildren.test.js +0 -340
  115. package/force-app/main/default/lwc/quanticResultCopyToClipboard/__tests__/quanticResultCopyToClipboard.test.js +0 -300
  116. package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/fixture.ts +0 -49
  117. package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/pageObject.ts +0 -49
  118. package/force-app/main/default/lwc/quanticResultCopyToClipboard/e2e/quanticResultCopyToClipboard.e2e.ts +0 -40
  119. package/force-app/main/default/lwc/quanticResultDate/__tests__/quanticResultDate.test.js +0 -144
  120. package/force-app/main/default/lwc/quanticResultField/__tests__/quanticResultField.test.js +0 -120
  121. package/force-app/main/default/lwc/quanticResultHighlightedTextField/__tests__/quanticResultHighlightedTextField.test.js +0 -209
  122. package/force-app/main/default/lwc/quanticResultLink/__tests__/quanticResultLink.test.js +0 -302
  123. package/force-app/main/default/lwc/quanticResultList/__tests__/quanticResultList.test.js +0 -342
  124. package/force-app/main/default/lwc/quanticResultList/e2e/fixture.ts +0 -70
  125. package/force-app/main/default/lwc/quanticResultList/e2e/pageObject.ts +0 -81
  126. package/force-app/main/default/lwc/quanticResultList/e2e/quanticResultList.e2e.ts +0 -69
  127. package/force-app/main/default/lwc/quanticResultMultiValueText/__tests__/quanticResultMultiValueText.test.js +0 -235
  128. package/force-app/main/default/lwc/quanticResultNumber/__tests__/quanticResultNumber.test.js +0 -144
  129. package/force-app/main/default/lwc/quanticResultPrintableUri/__tests__/quanticResultPrintableUri.test.js +0 -324
  130. package/force-app/main/default/lwc/quanticResultQuickview/__tests__/quanticResultQuickview.test.js +0 -308
  131. package/force-app/main/default/lwc/quanticResultQuickview/e2e/fixture.ts +0 -85
  132. package/force-app/main/default/lwc/quanticResultQuickview/e2e/pageObject.ts +0 -38
  133. package/force-app/main/default/lwc/quanticResultQuickview/e2e/quanticResultQuickView.e2e.ts +0 -66
  134. package/force-app/main/default/lwc/quanticResultTemplate/__tests__/quanticResultTemplate.test.js +0 -90
  135. package/force-app/main/default/lwc/quanticResultText/__tests__/quanticResultText.test.js +0 -155
  136. package/force-app/main/default/lwc/quanticResultsPerPage/__tests__/quanticResultsPerPage.test.js +0 -464
  137. package/force-app/main/default/lwc/quanticResultsPerPage/e2e/fixture.ts +0 -78
  138. package/force-app/main/default/lwc/quanticResultsPerPage/e2e/pageObject.ts +0 -85
  139. package/force-app/main/default/lwc/quanticResultsPerPage/e2e/quanticResultsPerPage.e2e.ts +0 -97
  140. package/force-app/main/default/lwc/quanticSearchBox/__tests__/quanticSearchBox.test.js +0 -487
  141. package/force-app/main/default/lwc/quanticSearchBox/e2e/fixture.ts +0 -86
  142. package/force-app/main/default/lwc/quanticSearchBox/e2e/pageObject.ts +0 -45
  143. package/force-app/main/default/lwc/quanticSearchBox/e2e/quanticSearchBox.e2e.ts +0 -159
  144. package/force-app/main/default/lwc/quanticSearchBoxInput/__tests__/quanticSearchBoxInput.test.js +0 -743
  145. package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/__tests__/quanticSearchBoxSuggestionsList.test.js +0 -571
  146. package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/fixture.ts +0 -113
  147. package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/pageObject.ts +0 -113
  148. package/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/e2e/quanticSearchBoxSuggestionsList.e2e.ts +0 -282
  149. package/force-app/main/default/lwc/quanticSmartSnippet/__tests__/quanticSmartSnippet.test.js +0 -341
  150. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/data.ts +0 -21
  151. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/fixture.ts +0 -93
  152. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/pageObject.ts +0 -196
  153. package/force-app/main/default/lwc/quanticSmartSnippet/e2e/quanticSmartSnippet.e2e.ts +0 -168
  154. package/force-app/main/default/lwc/quanticSmartSnippetAnswer/__tests__/quanticSmartSnippetAnswer.test.js +0 -126
  155. package/force-app/main/default/lwc/quanticSmartSnippetSource/__tests__/quanticSmartSnippetSource.test.js +0 -290
  156. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/__tests__/quanticSmartSnippetSuggestions.test.js +0 -329
  157. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/data.ts +0 -31
  158. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/fixture.ts +0 -95
  159. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/pageObject.ts +0 -160
  160. package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/e2e/quanticSmartSnippetSuggestions.e2e.ts +0 -127
  161. package/force-app/main/default/lwc/quanticSort/__tests__/quanticSort.test.js +0 -416
  162. package/force-app/main/default/lwc/quanticSort/e2e/fixture.ts +0 -62
  163. package/force-app/main/default/lwc/quanticSort/e2e/pageObject.ts +0 -100
  164. package/force-app/main/default/lwc/quanticSort/e2e/quanticSort.e2e.ts +0 -86
  165. package/force-app/main/default/lwc/quanticSourceCitations/__tests__/quanticSourceCitations.test.js +0 -156
  166. package/force-app/main/default/lwc/quanticStandaloneSearchBox/__tests__/quanticStandaloneSearchBox.test.js +0 -387
  167. package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/fixture.ts +0 -54
  168. package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/pageObject.ts +0 -54
  169. package/force-app/main/default/lwc/quanticStandaloneSearchBox/e2e/quanticStandaloneSearchBox.e2e.ts +0 -72
  170. package/force-app/main/default/lwc/quanticStatefulButton/__tests__/quanticStatefulButton.test.js +0 -222
  171. package/force-app/main/default/lwc/quanticSummary/__tests__/quanticSummary.test.js +0 -244
  172. package/force-app/main/default/lwc/quanticTab/__tests__/quanticTab.test.js +0 -333
  173. package/force-app/main/default/lwc/quanticTab/e2e/fixture.ts +0 -60
  174. package/force-app/main/default/lwc/quanticTab/e2e/pageObject.ts +0 -68
  175. package/force-app/main/default/lwc/quanticTab/e2e/quanticTab.e2e.ts +0 -72
  176. package/force-app/main/default/lwc/quanticTabBar/__tests__/quanticTabBar.test.js +0 -331
  177. package/force-app/main/default/lwc/quanticTabBar/e2e/fixture.ts +0 -65
  178. package/force-app/main/default/lwc/quanticTabBar/e2e/pageObject.ts +0 -80
  179. package/force-app/main/default/lwc/quanticTabBar/e2e/quanticTabBar.e2e.ts +0 -172
  180. package/force-app/main/default/lwc/quanticThreadItem/__tests__/quanticThreadItem.test.js +0 -314
  181. package/force-app/main/default/lwc/quanticTimeframeFacet/__tests__/quanticTimeframeFacet.test.js +0 -1059
  182. package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/data.ts +0 -66
  183. package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/fixture.ts +0 -74
  184. package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/pageObject.ts +0 -43
  185. package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/quanticTimeframeFacet.e2e.ts +0 -184
  186. package/force-app/main/default/lwc/quanticTooltip/__tests__/quanticTooltip.test.js +0 -107
  187. package/force-app/main/default/lwc/quanticUserAction/__tests__/quanticUserAction.test.js +0 -427
  188. package/force-app/main/default/lwc/quanticUserActionsSession/__tests__/quanticUserActionsSession.test.js +0 -269
  189. package/force-app/main/default/lwc/quanticUserActionsTimeline/__tests__/data/userActionsState.json +0 -89
  190. package/force-app/main/default/lwc/quanticUserActionsTimeline/__tests__/quanticUserActionsTimeline.test.js +0 -511
  191. package/force-app/main/default/lwc/quanticUserActionsToggle/__tests__/quanticUserActionsToggle.test.js +0 -229
  192. package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/data.ts +0 -32
  193. package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/fixture.ts +0 -32
  194. package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/pageObject.ts +0 -71
  195. package/force-app/main/default/lwc/quanticUserActionsToggle/e2e/quanticUserActionsToggle.e2e.ts +0 -39
  196. package/force-app/main/default/lwc/quanticUtils/__tests__/accessibilityUtils.test.js +0 -214
  197. package/force-app/main/default/lwc/quanticUtils/__tests__/citationAnchoringUtils.test.js +0 -84
  198. package/force-app/main/default/lwc/quanticUtils/__tests__/facetDependenciesUtils.test.js +0 -92
  199. package/force-app/main/default/lwc/quanticUtils/__tests__/facetStoreUtils.test.js +0 -86
  200. package/force-app/main/default/lwc/quanticUtils/__tests__/markdownUtils.test.js +0 -109
  201. package/force-app/main/default/lwc/quanticUtils/__tests__/quanticUtils.test.js +0 -233
  202. package/force-app/main/default/lwc/quanticUtils/__tests__/timeAndDateUtils.test.js +0 -22
  203. package/force-app/main/default/lwc/quanticViewedByCustomerBadge/__tests__/quanticViewedByCustomerBadge.test.js +0 -131
@@ -14,32 +14,32 @@ 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("CoveoHeadlessRecommendation",["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["CoveoHeadlessRecommendation"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var Ww=Object.create;var ei=Object.defineProperty;var Kw=Object.getOwnPropertyDescriptor;var Yw=Object.getOwnPropertyNames;var Xw=Object.getPrototypeOf,Zw=Object.prototype.hasOwnProperty;var Jw=(e,t,r)=>t in e?ei(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Bn=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var Ze=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},ti=(e,t)=>{for(var r in t)ei(e,r,{get:t[r],enumerable:!0})},Pf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Yw(t))!Zw.call(e,o)&&o!==r&&ei(e,o,{get:()=>t[o],enumerable:!(n=Kw(t,o))||n.enumerable});return e};var qt=(e,t,r)=>(r=e!=null?Ww(Xw(e)):{},Pf(t||!e||!e.__esModule?ei(r,"default",{value:e,enumerable:!0}):r,e)),eA=e=>Pf(ei({},"__esModule",{value:!0}),e);var ae=(e,t,r)=>Jw(e,typeof t!="symbol"?t+"":t,r);var b,d=Bn(()=>{"use strict";b=typeof globalThis<"u"?globalThis:window});function xa(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xa=function(t){return typeof t}:xa=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xa(e)}function nA(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=oA.bind(this))}function oA(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","*/*"),tA(t)?(o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),o.responseType="text"):rA(t)&&t.type&&o.setRequestHeader("Content-Type",t.type);try{o.send(t)}catch{return!1}return!0}var tA,rA,p=Bn(()=>{"use strict";tA=function(t){return typeof t=="string"},rA=function(t){return t instanceof Blob};nA.call((typeof window>"u"?"undefined":xa(window))==="object"?window:{})});var Sl=Ze(ri=>{"use strict";m();d();f();p();Object.defineProperty(ri,"__esModule",{value:!0});function Nf(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 iA(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aA(e,t,r){return t=Gn(t),cA(e,qf()?Reflect.construct(t,r||[],Gn(e).constructor):t.apply(e,r))}function hl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ff(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,pA(n.key),n)}}function yl(e,t,r){return t&&Ff(e.prototype,t),r&&Ff(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Df(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=fA(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(c){throw c},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 i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var c=r.next();return a=c.done,c},e:function(c){s=!0,i=c},f:function(){try{a||r.return==null||r.return()}finally{if(s)throw i}}}}function ml(){return ml=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=uA(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},ml.apply(null,arguments)}function Gn(e){return Gn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gn(e)}function sA(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&&gl(e,t)}function qf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qf=function(){return!!e})()}function cA(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 iA(e)}function gl(e,t){return gl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},gl(e,t)}function uA(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Gn(e))!==null;);return e}function lA(e,t,r,n){var o=ml(Gn(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(i){return o.apply(r,i)}:o}function dA(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 pA(e){var t=dA(e,"string");return typeof t=="symbol"?t:t+""}function fA(e,t){if(e){if(typeof e=="string")return Nf(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)?Nf(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function mA(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 gA(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 Mf=function(){function e(){hl(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return yl(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],i=0,a=o.length;i<a;i++)if(o[i].callback===n){o.splice(i,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],i=o.slice(),a=function(){var g=i[s];try{g.callback.call(n,r)}catch(v){Promise.resolve().then(function(){throw v})}g.options&&g.options.once&&n.removeEventListener(r.type,g.callback)},s=0,c=i.length;s<c;s++)a();return!r.defaultPrevented}}}])}(),vl=function(e){function t(){var r;return hl(this,t),r=aA(this,t),r.listeners||Mf.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 sA(t,e),yl(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)),lA(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,i=o===void 0?"Aborted":o;if(n)throw i}}],[{key:"timeout",value:function(n){var o=new Ca;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 Ca;function i(){o.abort(this.reason),a()}function a(){var g=Df(n),v;try{for(g.s();!(v=g.n()).done;){var E=v.value;E.removeEventListener("abort",i)}}catch(y){g.e(y)}finally{g.f()}}var s=Df(n),c;try{for(s.s();!(c=s.n()).done;){var u=c.value;if(u.aborted){o.abort(u.reason);break}else u.addEventListener("abort",i)}}catch(g){s.e(g)}finally{s.f()}return o.signal}}])}(Mf),Ca=function(){function e(){hl(this,e),Object.defineProperty(this,"signal",{value:new vl,writable:!0,configurable:!0})}return yl(e,[{key:"abort",value:function(r){var n=gA(r),o=mA(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(Ca.prototype[Symbol.toStringTag]="AbortController",vl.prototype[Symbol.toStringTag]="AbortSignal");function hA(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 yA(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,i=t.AbortController,a=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,s=a===void 0?!1:a;if(!hA({fetch:r,Request:o,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:r,Request:c};var c=o;(c&&!c.prototype.hasOwnProperty("signal")||s)&&(c=function(E,y){var h;y&&y.signal&&(h=y.signal,delete y.signal);var S=new o(E,y);return h&&Object.defineProperty(S,"signal",{writable:!1,enumerable:!1,configurable:!0,value:h}),S},c.prototype=o.prototype);var u=r,g=function(E,y){var h=c&&c.prototype.isPrototypeOf(E)?E.signal:y?y.signal:void 0;if(h){var S;try{S=new DOMException("Aborted","AbortError")}catch{S=new Error("Aborted"),S.name="AbortError"}if(h.aborted)return Promise.reject(S);var C=new Promise(function(R,T){h.addEventListener("abort",function(){return T(S)},{once:!0})});return y&&y.signal&&delete y.signal,Promise.race([C,u(E,y)])}return u(E,y)};return{fetch:g,Request:c}}ri.AbortController=Ca;ri.AbortSignal=vl;ri.abortableFetch=yA});var jf,l,A,f=Bn(()=>{"use strict";jf=qt(Sl(),1),l=qt(Sl(),1),{fetch:A}=(0,jf.abortableFetch)({fetch})});function bl(e){return typeof e!="string"||e in{}}function wl(){return Object.create(null)}function Lf(e){return typeof e=="string"&&!!e.trim()}function Al(e,t){var r=e.split(";").filter(Lf),n=r.shift();if(!n)return null;var o=vA(n),i=o.name,a=o.value;if(t=t?Object.assign({},Ea,t):Ea,bl(i))return null;try{a=t.decodeValues?decodeURIComponent(a):a}catch(c){console.error("set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",c)}var s=wl();return s.name=i,s.value=a,r.forEach(function(c){var u=c.split("="),g=u.shift().trim().toLowerCase();if(!bl(g)){var v=u.join("=").trim();if(g==="expires")s.expires=new Date(v);else if(g==="max-age"){var E=parseInt(v,10);Number.isNaN(E)||(s.maxAge=E)}else g==="secure"?s.secure=!0:g==="httponly"?s.httpOnly=!0:g==="samesite"?s.sameSite=v:g==="partitioned"?s.partitioned=!0:g&&(s[g]=v)}}),s}function vA(e){var t="",r="",n=e.split("=");return n.length>1?(t=n.shift(),r=n.join("=")):r=e,{name:t,value:r}}function $n(e,t){if(t=t?Object.assign({},Ea,t):Ea,!e)return t.map?wl():[];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(a){return a.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(Lf),n&&(e=e.map(Ra).flat()),t.map){var i=wl();return e.reduce(function(a,s){var c=Al(s,t);return c&&!bl(c.name)&&(a[c.name]=c),a},i)}else return e.map(function(a){return Al(a,t)}).filter(Boolean)}function Ra(e){if(Array.isArray(e))return e;if(typeof e!="string")return[];var t=[],r=0,n,o,i,a,s;function c(){for(;r<e.length&&/\s/.test(e.charAt(r));)r+=1;return r<e.length}function u(){return o=e.charAt(r),o!=="="&&o!==";"&&o!==","}for(;r<e.length;){for(n=r,s=!1;c();)if(o=e.charAt(r),o===","){for(i=r,r+=1,c(),a=r;r<e.length&&u();)r+=1;r<e.length&&e.charAt(r)==="="?(s=!0,r=a,t.push(e.substring(n,i)),n=r):r=i+1}else r+=1;(!s||r>=e.length)&&t.push(e.substring(n,e.length))}return t}var Ea,Uf=Bn(()=>{"use strict";m();d();f();p();Ea={decodeValues:!0,map:!1,silent:!1,split:"auto"};$n.parseSetCookie=$n;$n.parse=$n;$n.parseString=Al;$n.splitCookiesString=Ra});function ni(e){if(SA.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function xl(e){return e.replace(bA,"")}function oi(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||!wA(r))return!1}return!0}function wA(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function Bf(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 SA,Vf,bA,Gf,Qn,Cl,$f,x,Hf=Bn(()=>{"use strict";m();d();f();p();Uf();SA=/[^a-z0-9\-#$%&'*+.^_`|~]/i;Vf=[`
19
- `,"\r","\t"," "],bA=new RegExp(`(^[${Vf.join("")}]|$[${Vf.join("")}])`,"g");Qn=Symbol("normalizedHeaders"),Cl=Symbol("rawHeaderNames"),$f=", ",x=class Qf{constructor(t){this[Qn]={},this[Cl]=new Map,this[Gf]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor?.name)||t instanceof Qf||typeof b.Headers<"u"&&t instanceof b.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($f):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join($f):n)})}[(Gf=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[Qn]).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(!oi(t))throw new TypeError(`Invalid header name "${t}"`);return this[Qn].hasOwnProperty(ni(t))}get(t){if(!oi(t))throw TypeError(`Invalid header name "${t}"`);return this[Qn][ni(t)]??null}set(t,r){if(!oi(t)||!Bf(r))return;let n=ni(t),o=xl(r);this[Qn][n]=xl(o),this[Cl].set(n,t)}append(t,r){if(!oi(t)||!Bf(r))return;let n=ni(t),o=xl(r),i=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,i)}delete(t){if(!oi(t)||!this.has(t))return;let r=ni(t);delete this[Qn][r],this[Cl].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===""?[""]:Ra(t)}}});var m=Bn(()=>{"use strict";Hf()});var Jf=Ze(si=>{"use strict";m();d();f();p();var ka=si&&si.__assign||function(){return ka=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},ka.apply(this,arguments)};Object.defineProperty(si,"__esModule",{value:!0});var kA={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function OA(e){var t=ka(ka({},kA),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}si.getSanitizedOptions=OA});var em=Ze(_l=>{"use strict";m();d();f();p();Object.defineProperty(_l,"__esModule",{value:!0});function PA(e){var t=Math.random()*e;return Math.round(t)}_l.fullJitter=PA});var tm=Ze(kl=>{"use strict";m();d();f();p();Object.defineProperty(kl,"__esModule",{value:!0});function NA(e){return e}kl.noJitter=NA});var rm=Ze(Ol=>{"use strict";m();d();f();p();Object.defineProperty(Ol,"__esModule",{value:!0});var FA=em(),DA=tm();function MA(e){return e.jitter==="full"?FA.fullJitter:DA.noJitter}Ol.JitterFactory=MA});var Nl=Ze(Pl=>{"use strict";m();d();f();p();Object.defineProperty(Pl,"__esModule",{value:!0});var qA=rm(),jA=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=qA.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}();Pl.Delay=jA});var nm=Ze(or=>{"use strict";m();d();f();p();var LA=or&&or.__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 i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},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)}}(),UA=or&&or.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(g){try{u(n.next(g))}catch(v){a(v)}}function c(g){try{u(n.throw(g))}catch(v){a(v)}}function u(g){g.done?i(g.value):o(g.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},VA=or&&or.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(g){return c([u,g])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(g){u=[6,g],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(or,"__esModule",{value:!0});var BA=Nl(),GA=function(e){LA(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return UA(this,void 0,void 0,function(){return VA(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}(BA.Delay);or.SkipFirstDelay=GA});var om=Ze(ci=>{"use strict";m();d();f();p();var $A=ci&&ci.__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 i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},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(ci,"__esModule",{value:!0});var QA=Nl(),HA=function(e){$A(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(QA.Delay);ci.AlwaysDelay=HA});var im=Ze(Fl=>{"use strict";m();d();f();p();Object.defineProperty(Fl,"__esModule",{value:!0});var zA=nm(),WA=om();function KA(e,t){var r=YA(e);return r.setAttemptNumber(t),r}Fl.DelayFactory=KA;function YA(e){return e.delayFirstAttempt?new WA.AlwaysDelay(e):new zA.SkipFirstDelay(e)}});var am=Ze(Zr=>{"use strict";m();d();f();p();var Dl=Zr&&Zr.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(g){try{u(n.next(g))}catch(v){a(v)}}function c(g){try{u(n.throw(g))}catch(v){a(v)}}function u(g){g.done?i(g.value):o(g.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},Ml=Zr&&Zr.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(g){return c([u,g])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(g){u=[6,g],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Zr,"__esModule",{value:!0});var XA=Jf(),ZA=im();function JA(e,t){return t===void 0&&(t={}),Dl(this,void 0,void 0,function(){var r,n;return Ml(this,function(o){switch(o.label){case 0:return r=XA.getSanitizedOptions(t),n=new ex(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}Zr.backOff=JA;var ex=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Dl(this,void 0,void 0,function(){var t,r;return Ml(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 Dl(this,void 0,void 0,function(){var t;return Ml(this,function(r){switch(r.label){case 0:return t=ZA.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var Js=Ze((Jd,ep)=>{"use strict";m();d();f();p();(function(e,t){typeof Jd=="object"&&typeof ep<"u"?ep.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs=t()})(Jd,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",s="day",c="week",u="month",g="quarter",v="year",E="date",y="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|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,C={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(P){var N=["th","st","nd","rd"],F=P%100;return"["+P+(N[(F-20)%10]||N[F]||N[0])+"]"}},R=function(P,N,F){var H=String(P);return!H||H.length>=N?P:""+Array(N+1-H.length).join(F)+P},T={s:R,z:function(P){var N=-P.utcOffset(),F=Math.abs(N),H=Math.floor(F/60),Q=F%60;return(N<=0?"+":"-")+R(H,2,"0")+":"+R(Q,2,"0")},m:function P(N,F){if(N.date()<F.date())return-P(F,N);var H=12*(F.year()-N.year())+(F.month()-N.month()),Q=N.clone().add(H,u),Z=F-Q<0,X=N.clone().add(H+(Z?-1:1),u);return+(-(H+(F-Q)/(Z?Q-X:X-Q))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:u,y:v,w:c,d:s,D:E,h:a,m:i,s:o,ms:n,Q:g}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},I="en",k={};k[I]=C;var _="$isDayjsObject",D=function(P){return P instanceof V||!(!P||!P[_])},G=function P(N,F,H){var Q;if(!N)return I;if(typeof N=="string"){var Z=N.toLowerCase();k[Z]&&(Q=Z),F&&(k[Z]=F,Q=Z);var X=N.split("-");if(!Q&&X.length>1)return P(X[0])}else{var W=N.name;k[W]=N,Q=W}return!H&&Q&&(I=Q),Q||!H&&I},L=function(P,N){if(D(P))return P.clone();var F=typeof N=="object"?N:{};return F.date=P,F.args=arguments,new V(F)},j=T;j.l=G,j.i=D,j.w=function(P,N){return L(P,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var V=function(){function P(F){this.$L=G(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[_]=!0}var N=P.prototype;return N.parse=function(F){this.$d=function(H){var Q=H.date,Z=H.utc;if(Q===null)return new Date(NaN);if(j.u(Q))return new Date;if(Q instanceof Date)return new Date(Q);if(typeof Q=="string"&&!/Z$/i.test(Q)){var X=Q.match(h);if(X){var W=X[2]-1||0,te=(X[7]||"0").substring(0,3);return Z?new Date(Date.UTC(X[1],W,X[3]||1,X[4]||0,X[5]||0,X[6]||0,te)):new Date(X[1],W,X[3]||1,X[4]||0,X[5]||0,X[6]||0,te)}}return new Date(Q)}(F),this.init()},N.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},N.$utils=function(){return j},N.isValid=function(){return this.$d.toString()!==y},N.isSame=function(F,H){var Q=L(F);return this.startOf(H)<=Q&&Q<=this.endOf(H)},N.isAfter=function(F,H){return L(F)<this.startOf(H)},N.isBefore=function(F,H){return this.endOf(H)<L(F)},N.$g=function(F,H,Q){return j.u(F)?this[H]:this.set(Q,F)},N.unix=function(){return Math.floor(this.valueOf()/1e3)},N.valueOf=function(){return this.$d.getTime()},N.startOf=function(F,H){var Q=this,Z=!!j.u(H)||H,X=j.p(F),W=function(ge,me){var be=j.w(Q.$u?Date.UTC(Q.$y,me,ge):new Date(Q.$y,me,ge),Q);return Z?be:be.endOf(s)},te=function(ge,me){return j.w(Q.toDate()[ge].apply(Q.toDate("s"),(Z?[0,0,0,0]:[23,59,59,999]).slice(me)),Q)},ue=this.$W,Ee=this.$M,je=this.$D,ke="set"+(this.$u?"UTC":"");switch(X){case v:return Z?W(1,0):W(31,11);case u:return Z?W(1,Ee):W(0,Ee+1);case c:var Ne=this.$locale().weekStart||0,Fe=(ue<Ne?ue+7:ue)-Ne;return W(Z?je-Fe:je+(6-Fe),Ee);case s:case E:return te(ke+"Hours",0);case a:return te(ke+"Minutes",1);case i:return te(ke+"Seconds",2);case o:return te(ke+"Milliseconds",3);default:return this.clone()}},N.endOf=function(F){return this.startOf(F,!1)},N.$set=function(F,H){var Q,Z=j.p(F),X="set"+(this.$u?"UTC":""),W=(Q={},Q[s]=X+"Date",Q[E]=X+"Date",Q[u]=X+"Month",Q[v]=X+"FullYear",Q[a]=X+"Hours",Q[i]=X+"Minutes",Q[o]=X+"Seconds",Q[n]=X+"Milliseconds",Q)[Z],te=Z===s?this.$D+(H-this.$W):H;if(Z===u||Z===v){var ue=this.clone().set(E,1);ue.$d[W](te),ue.init(),this.$d=ue.set(E,Math.min(this.$D,ue.daysInMonth())).$d}else W&&this.$d[W](te);return this.init(),this},N.set=function(F,H){return this.clone().$set(F,H)},N.get=function(F){return this[j.p(F)]()},N.add=function(F,H){var Q,Z=this;F=Number(F);var X=j.p(H),W=function(Ee){var je=L(Z);return j.w(je.date(je.date()+Math.round(Ee*F)),Z)};if(X===u)return this.set(u,this.$M+F);if(X===v)return this.set(v,this.$y+F);if(X===s)return W(1);if(X===c)return W(7);var te=(Q={},Q[i]=t,Q[a]=r,Q[o]=e,Q)[X]||1,ue=this.$d.getTime()+F*te;return j.w(ue,this)},N.subtract=function(F,H){return this.add(-1*F,H)},N.format=function(F){var H=this,Q=this.$locale();if(!this.isValid())return Q.invalidDate||y;var Z=F||"YYYY-MM-DDTHH:mm:ssZ",X=j.z(this),W=this.$H,te=this.$m,ue=this.$M,Ee=Q.weekdays,je=Q.months,ke=Q.meridiem,Ne=function(me,be,he,He){return me&&(me[be]||me(H,Z))||he[be].slice(0,He)},Fe=function(me){return j.s(W%12||12,me,"0")},ge=ke||function(me,be,he){var He=me<12?"AM":"PM";return he?He.toLowerCase():He};return Z.replace(S,function(me,be){return be||function(he){switch(he){case"YY":return String(H.$y).slice(-2);case"YYYY":return j.s(H.$y,4,"0");case"M":return ue+1;case"MM":return j.s(ue+1,2,"0");case"MMM":return Ne(Q.monthsShort,ue,je,3);case"MMMM":return Ne(je,ue);case"D":return H.$D;case"DD":return j.s(H.$D,2,"0");case"d":return String(H.$W);case"dd":return Ne(Q.weekdaysMin,H.$W,Ee,2);case"ddd":return Ne(Q.weekdaysShort,H.$W,Ee,3);case"dddd":return Ee[H.$W];case"H":return String(W);case"HH":return j.s(W,2,"0");case"h":return Fe(1);case"hh":return Fe(2);case"a":return ge(W,te,!0);case"A":return ge(W,te,!1);case"m":return String(te);case"mm":return j.s(te,2,"0");case"s":return String(H.$s);case"ss":return j.s(H.$s,2,"0");case"SSS":return j.s(H.$ms,3,"0");case"Z":return X}return null}(me)||X.replace(":","")})},N.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},N.diff=function(F,H,Q){var Z,X=this,W=j.p(H),te=L(F),ue=(te.utcOffset()-this.utcOffset())*t,Ee=this-te,je=function(){return j.m(X,te)};switch(W){case v:Z=je()/12;break;case u:Z=je();break;case g:Z=je()/3;break;case c:Z=(Ee-ue)/6048e5;break;case s:Z=(Ee-ue)/864e5;break;case a:Z=Ee/r;break;case i:Z=Ee/t;break;case o:Z=Ee/e;break;default:Z=Ee}return Q?Z:j.a(Z)},N.daysInMonth=function(){return this.endOf(u).$D},N.$locale=function(){return k[this.$L]},N.locale=function(F,H){if(!F)return this.$L;var Q=this.clone(),Z=G(F,H,!0);return Z&&(Q.$L=Z),Q},N.clone=function(){return j.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()},P}(),q=V.prototype;return L.prototype=q,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",s],["$M",u],["$y",v],["$D",E]].forEach(function(P){q[P[1]]=function(N){return this.$g(N,P[0],P[1])}}),L.extend=function(P,N){return P.$i||(P(N,V,L),P.$i=!0),L},L.locale=G,L.isDayjs=D,L.unix=function(P){return L(1e3*P)},L.en=k[I],L.Ls=k,L.p={},L})});var dy=Ze((tp,rp)=>{"use strict";m();d();f();p();(function(e,t){typeof tp=="object"&&typeof rp<"u"?rp.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_quarterOfYear=t()})(tp,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(s){return this.$utils().u(s)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(s-1))};var i=o.add;o.add=function(s,c){return s=Number(s),this.$utils().p(c)===t?this.add(3*s,e):i.bind(this)(s,c)};var a=o.startOf;o.startOf=function(s,c){var u=this.$utils(),g=!!u.u(c)||c;if(u.p(s)===t){var v=this.quarter()-1;return g?this.month(3*v).startOf(e).startOf("day"):this.month(3*v+2).endOf(e).endOf("day")}return a.bind(this)(s,c)}}})});var py=Ze((np,op)=>{"use strict";m();d();f();p();(function(e,t){typeof np=="object"&&typeof op<"u"?op.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_customParseFormat=t()})(np,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?/,i=/\d*[^-_:/,()\s\d]+/,a={},s=function(h){return(h=+h)+(h>68?1900:2e3)},c=function(h){return function(S){this[h]=+S}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(h){(this.zone||(this.zone={})).offset=function(S){if(!S||S==="Z")return 0;var C=S.match(/([+-]|\d\d)/g),R=60*C[1]+(+C[2]||0);return R===0?0:C[0]==="+"?-R:R}(h)}],g=function(h){var S=a[h];return S&&(S.indexOf?S:S.s.concat(S.f))},v=function(h,S){var C,R=a.meridiem;if(R){for(var T=1;T<=24;T+=1)if(h.indexOf(R(T,0,S))>-1){C=T>12;break}}else C=h===(S?"pm":"PM");return C},E={A:[i,function(h){this.afternoon=v(h,!1)}],a:[i,function(h){this.afternoon=v(h,!0)}],Q:[r,function(h){this.month=3*(h-1)+1}],S:[r,function(h){this.milliseconds=100*+h}],SS:[n,function(h){this.milliseconds=10*+h}],SSS:[/\d{3}/,function(h){this.milliseconds=+h}],s:[o,c("seconds")],ss:[o,c("seconds")],m:[o,c("minutes")],mm:[o,c("minutes")],H:[o,c("hours")],h:[o,c("hours")],HH:[o,c("hours")],hh:[o,c("hours")],D:[o,c("day")],DD:[n,c("day")],Do:[i,function(h){var S=a.ordinal,C=h.match(/\d+/);if(this.day=C[0],S)for(var R=1;R<=31;R+=1)S(R).replace(/\[|\]/g,"")===h&&(this.day=R)}],w:[o,c("week")],ww:[n,c("week")],M:[o,c("month")],MM:[n,c("month")],MMM:[i,function(h){var S=g("months"),C=(g("monthsShort")||S.map(function(R){return R.slice(0,3)})).indexOf(h)+1;if(C<1)throw new Error;this.month=C%12||C}],MMMM:[i,function(h){var S=g("months").indexOf(h)+1;if(S<1)throw new Error;this.month=S%12||S}],Y:[/[+-]?\d+/,c("year")],YY:[n,function(h){this.year=s(h)}],YYYY:[/\d{4}/,c("year")],Z:u,ZZ:u};function y(h){var S,C;S=h,C=a&&a.formats;for(var R=(h=S.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(L,j,V){var q=V&&V.toUpperCase();return j||C[V]||e[V]||C[q].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(P,N,F){return N||F.slice(1)})})).match(t),T=R.length,I=0;I<T;I+=1){var k=R[I],_=E[k],D=_&&_[0],G=_&&_[1];R[I]=G?{regex:D,parser:G}:k.replace(/^\[|\]$/g,"")}return function(L){for(var j={},V=0,q=0;V<T;V+=1){var P=R[V];if(typeof P=="string")q+=P.length;else{var N=P.regex,F=P.parser,H=L.slice(q),Q=N.exec(H)[0];F.call(j,Q),L=L.replace(Q,"")}}return function(Z){var X=Z.afternoon;if(X!==void 0){var W=Z.hours;X?W<12&&(Z.hours+=12):W===12&&(Z.hours=0),delete Z.afternoon}}(j),j}}return function(h,S,C){C.p.customParseFormat=!0,h&&h.parseTwoDigitYear&&(s=h.parseTwoDigitYear);var R=S.prototype,T=R.parse;R.parse=function(I){var k=I.date,_=I.utc,D=I.args;this.$u=_;var G=D[1];if(typeof G=="string"){var L=D[2]===!0,j=D[3]===!0,V=L||j,q=D[2];j&&(q=D[2]),a=this.$locale(),!L&&q&&(a=C.Ls[q]),this.$d=function(H,Q,Z,X){try{if(["x","X"].indexOf(Q)>-1)return new Date((Q==="X"?1e3:1)*H);var W=y(Q)(H),te=W.year,ue=W.month,Ee=W.day,je=W.hours,ke=W.minutes,Ne=W.seconds,Fe=W.milliseconds,ge=W.zone,me=W.week,be=new Date,he=Ee||(te||ue?1:be.getDate()),He=te||be.getFullYear(),Ke=0;te&&!ue||(Ke=ue>0?ue-1:be.getMonth());var Dt,At=je||0,Gt=ke||0,Rt=Ne||0,Mt=Fe||0;return ge?new Date(Date.UTC(He,Ke,he,At,Gt,Rt,Mt+60*ge.offset*1e3)):Z?new Date(Date.UTC(He,Ke,he,At,Gt,Rt,Mt)):(Dt=new Date(He,Ke,he,At,Gt,Rt,Mt),me&&(Dt=X(Dt).week(me).toDate()),Dt)}catch{return new Date("")}}(k,G,_,C),this.init(),q&&q!==!0&&(this.$L=this.locale(q).$L),V&&k!=this.format(G)&&(this.$d=new Date("")),a={}}else if(G instanceof Array)for(var P=G.length,N=1;N<=P;N+=1){D[1]=G[N-1];var F=C.apply(this,D);if(F.isValid()){this.$d=F.$d,this.$L=F.$L,this.init();break}N===P&&(this.$d=new Date(""))}else T.call(this,I)}}})});var cv=Ze((Sp,bp)=>{"use strict";m();d();f();p();(function(e,t){typeof Sp=="object"&&typeof bp<"u"?bp.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_timezone=t()})(Sp,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var i,a=function(g,v,E){E===void 0&&(E={});var y=new Date(g),h=function(S,C){C===void 0&&(C={});var R=C.timeZoneName||"short",T=S+"|"+R,I=t[T];return I||(I=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:R}),t[T]=I),I}(v,E);return h.formatToParts(y)},s=function(g,v){for(var E=a(g,v),y=[],h=0;h<E.length;h+=1){var S=E[h],C=S.type,R=S.value,T=e[C];T>=0&&(y[T]=parseInt(R,10))}var I=y[3],k=I===24?0:I,_=y[0]+"-"+y[1]+"-"+y[2]+" "+k+":"+y[4]+":"+y[5]+":000",D=+g;return(o.utc(_).valueOf()-(D-=D%1e3))/6e4},c=n.prototype;c.tz=function(g,v){g===void 0&&(g=i);var E,y=this.utcOffset(),h=this.toDate(),S=h.toLocaleString("en-US",{timeZone:g}),C=Math.round((h-new Date(S))/1e3/60),R=15*-Math.round(h.getTimezoneOffset()/15)-C;if(!Number(R))E=this.utcOffset(0,v);else if(E=o(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(R,!0),v){var T=E.utcOffset();E=E.add(y-T,"minute")}return E.$x.$timezone=g,E},c.offsetName=function(g){var v=this.$x.$timezone||o.tz.guess(),E=a(this.valueOf(),v,{timeZoneName:g}).find(function(y){return y.type.toLowerCase()==="timezonename"});return E&&E.value};var u=c.startOf;c.startOf=function(g,v){if(!this.$x||!this.$x.$timezone)return u.call(this,g,v);var E=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return u.call(E,g,v).tz(this.$x.$timezone,!0)},o.tz=function(g,v,E){var y=E&&v,h=E||v||i,S=s(+o(),h);if(typeof g!="string")return o(g).tz(h);var C=function(k,_,D){var G=k-60*_*1e3,L=s(G,D);if(_===L)return[G,_];var j=s(G-=60*(L-_)*1e3,D);return L===j?[G,L]:[k-60*Math.min(L,j)*1e3,Math.max(L,j)]}(o.utc(g,y).valueOf(),S,h),R=C[0],T=C[1],I=o(R).utcOffset(T);return I.$x.$timezone=h,I},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(g){i=g}}})});var uv=Ze((wp,Ap)=>{"use strict";m();d();f();p();(function(e,t){typeof wp=="object"&&typeof Ap<"u"?Ap.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_utc=t()})(wp,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,i){var a=o.prototype;i.utc=function(y){var h={date:y,utc:!0,args:arguments};return new o(h)},a.utc=function(y){var h=i(this.toDate(),{locale:this.$L,utc:!0});return y?h.add(this.utcOffset(),e):h},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(y){y.utc&&(this.$u=!0),this.$utils().u(y.$offset)||(this.$offset=y.$offset),s.call(this,y)};var c=a.init;a.init=function(){if(this.$u){var y=this.$d;this.$y=y.getUTCFullYear(),this.$M=y.getUTCMonth(),this.$D=y.getUTCDate(),this.$W=y.getUTCDay(),this.$H=y.getUTCHours(),this.$m=y.getUTCMinutes(),this.$s=y.getUTCSeconds(),this.$ms=y.getUTCMilliseconds()}else c.call(this)};var u=a.utcOffset;a.utcOffset=function(y,h){var S=this.$utils().u;if(S(y))return this.$u?0:S(this.$offset)?u.call(this):this.$offset;if(typeof y=="string"&&(y=function(I){I===void 0&&(I="");var k=I.match(t);if(!k)return null;var _=(""+k[0]).match(r)||["-",0,0],D=_[0],G=60*+_[1]+ +_[2];return G===0?0:D==="+"?G:-G}(y),y===null))return this;var C=Math.abs(y)<=16?60*y:y;if(C===0)return this.utc(h);var R=this.clone();if(h)return R.$offset=C,R.$u=!1,R;var T=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(R=this.local().add(C+T,e)).$offset=C,R.$x.$localOffset=T,R};var g=a.format;a.format=function(y){var h=y||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return g.call(this,h)},a.valueOf=function(){var y=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*y},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var v=a.toDate;a.toDate=function(y){return y==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():v.call(this)};var E=a.diff;a.diff=function(y,h,S){if(y&&this.$u===y.$u)return E.call(this,y,h,S);var C=this.local(),R=i(y).local();return E.call(C,R,h,S)}}})});var zb=Ze((Rue,Hb)=>{"use strict";m();d();f();p();function aP(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}Hb.exports=sP;function sP(e,t,r){var n=r&&r.stringify||aP,o=1;if(typeof e=="object"&&e!==null){var i=t.length+o;if(i===1)return e;var a=new Array(i);a[0]=n(e);for(var s=1;s<i;s++)a[s]=n(t[s]);return a.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var u="",g=1-o,v=-1,E=e&&e.length||0,y=0;y<E;){if(e.charCodeAt(y)===37&&y+1<E){switch(v=v>-1?v:0,e.charCodeAt(y+1)){case 100:case 102:if(g>=c||t[g]==null)break;v<y&&(u+=e.slice(v,y)),u+=Number(t[g]),v=y+2,y++;break;case 105:if(g>=c||t[g]==null)break;v<y&&(u+=e.slice(v,y)),u+=Math.floor(Number(t[g])),v=y+2,y++;break;case 79:case 111:case 106:if(g>=c||t[g]===void 0)break;v<y&&(u+=e.slice(v,y));var h=typeof t[g];if(h==="string"){u+="'"+t[g]+"'",v=y+2,y++;break}if(h==="function"){u+=t[g].name||"<anonymous>",v=y+2,y++;break}u+=n(t[g]),v=y+2,y++;break;case 115:if(g>=c)break;v<y&&(u+=e.slice(v,y)),u+=String(t[g]),v=y+2,y++;break;case 37:v<y&&(u+=e.slice(v,y)),u+="%",v=y+2,y++,g--;break}++g}++y}return v===-1?e:(v<E&&(u+=e.slice(v)),u)}});var ew=Ze((Oue,tl)=>{"use strict";m();d();f();p();var Wb=zb();tl.exports=br;var ya=AP().console||{},cP={mapHttpRequest:el,mapHttpResponse:el,wrapRequestSerializer:bf,wrapResponseSerializer:bf,wrapErrorSerializer:bf,req:el,res:el,err:Yb,errWithCause:Yb};function Kr(e,t){return e==="silent"?1/0:t.levels.values[e]}var xf=Symbol("pino.logFuncs"),wf=Symbol("pino.hierarchy"),uP={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function Kb(e,t){let r={logger:t,parent:e[wf]};t[wf]=r}function lP(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:ya[o]||ya[uP[o]||"log"]||zo}),e[xf]=n}function dP(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function br(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||ya;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=dP(e.browser.serialize,n),i=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(i=!1);let a=Object.keys(e.customLevels||{}),s=["error","fatal","warn","info","debug","trace"].concat(a);typeof r=="function"&&s.forEach(function(S){r[S]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let c=e.level||"info",u=Object.create(r);u.log||(u.log=zo),lP(u,s,r),Kb({},u),Object.defineProperty(u,"levelVal",{get:v}),Object.defineProperty(u,"level",{get:E,set:y});let g={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,reportCaller:e.browser.reportCaller,levels:s,timestamp:SP(e),messageKey:e.messageKey||"msg",onChild:e.onChild||zo};u.levels=pP(e),u.level=c,u.isLevelEnabled=function(S){return this.levels.values[S]?this.levels.values[S]>=this.levels.values[this.level]:!1},u.setMaxListeners=u.getMaxListeners=u.emit=u.addListener=u.on=u.prependListener=u.once=u.prependOnceListener=u.removeListener=u.removeAllListeners=u.listeners=u.listenerCount=u.eventNames=u.write=u.flush=zo,u.serializers=n,u._serialize=o,u._stdErrSerialize=i,u.child=function(...S){return h.call(this,g,...S)},t&&(u._logEvent=Af());function v(){return Kr(this.level,this)}function E(){return this._level}function y(S){if(S!=="silent"&&!this.levels.values[S])throw Error("unknown level "+S);this._level=S,jn(this,g,u,"error"),jn(this,g,u,"fatal"),jn(this,g,u,"warn"),jn(this,g,u,"info"),jn(this,g,u,"debug"),jn(this,g,u,"trace"),a.forEach(C=>{jn(this,g,u,C)})}function h(S,C,R){if(!C)throw new Error("missing bindings for child Pino");R=R||{},o&&C.serializers&&(R.serializers=C.serializers);let T=R.serializers;if(o&&T){var I=Object.assign({},n,T),k=e.browser.serialize===!0?Object.keys(I):o;delete C.serializers,Cf([C],k,I,this._stdErrSerialize)}function _(G){this._childLevel=(G._childLevel|0)+1,this.bindings=C,I&&(this.serializers=I,this._serialize=k),t&&(this._logEvent=Af([].concat(G._logEvent.bindings,C)))}_.prototype=this;let D=new _(this);return Kb(this,D),D.child=function(...G){return h.call(this,S,...G)},D.level=R.level||this.level,S.onChild(D),D}return u}function pP(e){let t=e.customLevels||{},r=Object.assign({},br.levels.values,t),n=Object.assign({},br.levels.labels,fP(t));return{values:r,labels:n}}function fP(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}br.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"}};br.stdSerializers=cP;br.stdTimeFunctions=Object.assign({},{nullTime:Zb,epochTime:Jb,unixTime:bP,isoTime:wP});function mP(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[wf];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function jn(e,t,r,n){if(Object.defineProperty(e,n,{value:Kr(e.level,r)>Kr(n,r)?zo:r[xf][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===zo){if(!t.transmit)return;let i=t.transmit.level||e.level,a=Kr(i,r);if(Kr(n,r)<a)return}e[n]=hP(e,t,r,n);let o=mP(e);o.length!==0&&(e[n]=gP(o,e[n]))}function gP(e,t){return function(){return t.apply(this,[...e,...arguments])}}function hP(e,t,r,n){return function(o){return function(){let a=t.timestamp(),s=new Array(arguments.length),c=Object.getPrototypeOf&&Object.getPrototypeOf(this)===ya?ya:this;for(var u=0;u<s.length;u++)s[u]=arguments[u];var g=!1;if(t.serialize&&(Cf(s,this._serialize,this.serializers,this._stdErrSerialize),g=!0),t.asObject||t.formatters){let v=yP(this,n,s,a,t);if(t.reportCaller&&v&&v.length>0&&v[0]&&typeof v[0]=="object")try{let E=Xb();E&&(v[0].caller=E)}catch{}o.call(c,...v)}else{if(t.reportCaller)try{let v=Xb();v&&s.push(v)}catch{}o.apply(c,s)}if(t.transmit){let v=t.transmit.level||e._level,E=Kr(v,r),y=Kr(n,r);if(y<E)return;vP(this,{ts:a,methodLevel:n,methodValue:y,transmitLevel:v,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:Kr(e._level,r)},s,g)}}}(e[xf][n])}function yP(e,t,r,n,o){let{level:i,log:a=v=>v}=o.formatters||{},s=r.slice(),c=s[0],u={},g=(e._childLevel|0)+1;if(g<1&&(g=1),n&&(u.time=n),i){let v=i(t,e.levels.values[t]);Object.assign(u,v)}else u.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(c!==null&&typeof c=="object")for(;g--&&typeof s[0]=="object";)Object.assign(u,s.shift());return[a(u),...s]}else{if(c!==null&&typeof c=="object"){for(;g--&&typeof s[0]=="object";)Object.assign(u,s.shift());c=s.length?Wb(s.shift(),s):void 0}else typeof c=="string"&&(c=Wb(s.shift(),s));return c!==void 0&&(u[o.messageKey]=c),[a(u)]}}function Cf(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=br.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let i in e[o])t.indexOf(i)>-1&&i in r&&(e[o][i]=r[i](e[o][i]))}function vP(e,t,r,n=!1){let o=t.send,i=t.ts,a=t.methodLevel,s=t.methodValue,c=t.val,u=e._logEvent.bindings;n||Cf(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(g){return u.indexOf(g)===-1}),e._logEvent.level.label=a,e._logEvent.level.value=s,o(a,e._logEvent,c),e._logEvent=Af(u)}function Af(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function Yb(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 SP(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Zb:Jb}function el(){return{}}function bf(e){return e}function zo(){}function Zb(){return!1}function Jb(){return Date.now()}function bP(){return Math.round(Date.now()/1e3)}function wP(){return new Date(Date.now()).toISOString()}function AP(){function e(t){return typeof t<"u"&&t}try{return typeof b<"u"?b:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),b)}catch{return e(self)||e(window)||e(this)||{}}}tl.exports.default=br;tl.exports.pino=br;function Xb(){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 i=o[1],a=o[2],s=o[3];return i+":"+a+":"+s}}return null}});var AN={};ti(AN,{DefaultFieldsToInclude:()=>kf,EcommerceDefaultFieldsToInclude:()=>Bw,HighlightUtils:()=>Tl,MinimumFieldsToInclude:()=>pl,ResultTemplatesHelpers:()=>Oy,buildContext:()=>lw,buildController:()=>Yr,buildDictionaryFieldContext:()=>dw,buildInteractiveResult:()=>jw,buildRecommendationEngine:()=>sw,buildRecommendationList:()=>Mw,buildResultTemplatesManager:()=>Qw,getAnalyticsNextApiBaseUrl:()=>Oa,getOrganizationEndpoint:()=>It,getSampleRecommendationEngineConfiguration:()=>Ef,loadAdvancedSearchQueryActions:()=>sN,loadClickAnalyticsActions:()=>vN,loadConfigurationActions:()=>cN,loadContextActions:()=>lN,loadDebugActions:()=>dN,loadDictionaryFieldContextActions:()=>pN,loadFieldActions:()=>gN,loadPaginationActions:()=>_f,loadPipelineActions:()=>hN,loadRecommendationActions:()=>yN,loadSearchConfigurationActions:()=>uN,loadSearchHubActions:()=>wN});module.exports=eA(AN);m();d();f();p();var Tl={};ti(Tl,{escapeHtml:()=>Hn,getHighlightedSuggestion:()=>_A,highlightString:()=>TA});m();d();f();p();m();d();f();p();function AA(e,t){let r=`
17
+ */(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadlessRecommendation",["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["CoveoHeadlessRecommendation"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var Jw=Object.create;var ri=Object.defineProperty;var eA=Object.getOwnPropertyDescriptor;var tA=Object.getOwnPropertyNames;var rA=Object.getPrototypeOf,nA=Object.prototype.hasOwnProperty;var oA=(e,t,r)=>t in e?ri(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Gn=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var Ze=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},ni=(e,t)=>{for(var r in t)ri(e,r,{get:t[r],enumerable:!0})},Ff=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of tA(t))!nA.call(e,o)&&o!==r&&ri(e,o,{get:()=>t[o],enumerable:!(n=eA(t,o))||n.enumerable});return e};var qt=(e,t,r)=>(r=e!=null?Jw(rA(e)):{},Ff(t||!e||!e.__esModule?ri(r,"default",{value:e,enumerable:!0}):r,e)),iA=e=>Ff(ri({},"__esModule",{value:!0}),e);var ae=(e,t,r)=>oA(e,typeof t!="symbol"?t+"":t,r);var w,d=Gn(()=>{"use strict";w=typeof globalThis<"u"?globalThis:window});function Ea(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ea=function(t){return typeof t}:Ea=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ea(e)}function cA(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=uA.bind(this))}function uA(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","*/*"),aA(t)?(o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),o.responseType="text"):sA(t)&&t.type&&o.setRequestHeader("Content-Type",t.type);try{o.send(t)}catch{return!1}return!0}var aA,sA,p=Gn(()=>{"use strict";aA=function(t){return typeof t=="string"},sA=function(t){return t instanceof Blob};cA.call((typeof window>"u"?"undefined":Ea(window))==="object"?window:{})});var wl=Ze(oi=>{"use strict";m();d();f();p();Object.defineProperty(oi,"__esModule",{value:!0});function Df(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 lA(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dA(e,t,r){return t=$n(t),fA(e,Lf()?Reflect.construct(t,r||[],$n(e).constructor):t.apply(e,r))}function vl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mf(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,yA(n.key),n)}}function Sl(e,t,r){return t&&Mf(e.prototype,t),r&&Mf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function qf(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=vA(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(c){throw c},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 i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var c=r.next();return a=c.done,c},e:function(c){s=!0,i=c},f:function(){try{a||r.return==null||r.return()}finally{if(s)throw i}}}}function hl(){return hl=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=mA(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},hl.apply(null,arguments)}function $n(e){return $n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$n(e)}function pA(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&&yl(e,t)}function Lf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Lf=function(){return!!e})()}function fA(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 lA(e)}function yl(e,t){return yl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},yl(e,t)}function mA(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=$n(e))!==null;);return e}function gA(e,t,r,n){var o=hl($n(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(i){return o.apply(r,i)}:o}function hA(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 yA(e){var t=hA(e,"string");return typeof t=="symbol"?t:t+""}function vA(e,t){if(e){if(typeof e=="string")return Df(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)?Df(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function SA(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 bA(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 jf=function(){function e(){vl(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return Sl(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],i=0,a=o.length;i<a;i++)if(o[i].callback===n){o.splice(i,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],i=o.slice(),a=function(){var h=i[s];try{h.callback.call(n,r)}catch(v){Promise.resolve().then(function(){throw v})}h.options&&h.options.once&&n.removeEventListener(r.type,h.callback)},s=0,c=i.length;s<c;s++)a();return!r.defaultPrevented}}}])}(),bl=function(e){function t(){var r;return vl(this,t),r=dA(this,t),r.listeners||jf.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 pA(t,e),Sl(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)),gA(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,i=o===void 0?"Aborted":o;if(n)throw i}}],[{key:"timeout",value:function(n){var o=new Ra;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 Ra;function i(){o.abort(this.reason),a()}function a(){var h=qf(n),v;try{for(h.s();!(v=h.n()).done;){var C=v.value;C.removeEventListener("abort",i)}}catch(g){h.e(g)}finally{h.f()}}var s=qf(n),c;try{for(s.s();!(c=s.n()).done;){var u=c.value;if(u.aborted){o.abort(u.reason);break}else u.addEventListener("abort",i)}}catch(h){s.e(h)}finally{s.f()}return o.signal}}])}(jf),Ra=function(){function e(){vl(this,e),Object.defineProperty(this,"signal",{value:new bl,writable:!0,configurable:!0})}return Sl(e,[{key:"abort",value:function(r){var n=bA(r),o=SA(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(Ra.prototype[Symbol.toStringTag]="AbortController",bl.prototype[Symbol.toStringTag]="AbortSignal");function wA(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 AA(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,i=t.AbortController,a=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,s=a===void 0?!1:a;if(!wA({fetch:r,Request:o,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:r,Request:c};var c=o;(c&&!c.prototype.hasOwnProperty("signal")||s)&&(c=function(C,g){var y;g&&g.signal&&(y=g.signal,delete g.signal);var S=new o(C,g);return y&&Object.defineProperty(S,"signal",{writable:!1,enumerable:!1,configurable:!0,value:y}),S},c.prototype=o.prototype);var u=r,h=function(C,g){var y=c&&c.prototype.isPrototypeOf(C)?C.signal:g?g.signal:void 0;if(y){var S;try{S=new DOMException("Aborted","AbortError")}catch{S=new Error("Aborted"),S.name="AbortError"}if(y.aborted)return Promise.reject(S);var E=new Promise(function(R,k){y.addEventListener("abort",function(){return k(S)},{once:!0})});return g&&g.signal&&delete g.signal,Promise.race([E,u(C,g)])}return u(C,g)};return{fetch:h,Request:c}}oi.AbortController=Ra;oi.AbortSignal=bl;oi.abortableFetch=AA});var Uf,l,A,f=Gn(()=>{"use strict";Uf=qt(wl(),1),l=qt(wl(),1),{fetch:A}=(0,Uf.abortableFetch)({fetch})});function Al(e){return typeof e!="string"||e in{}}function xl(){return Object.create(null)}function Vf(e){return typeof e=="string"&&!!e.trim()}function Cl(e,t){var r=e.split(";").filter(Vf),n=r.shift();if(!n)return null;var o=xA(n),i=o.name,a=o.value;if(t=t?Object.assign({},Ia,t):Ia,Al(i))return null;try{a=t.decodeValues?decodeURIComponent(a):a}catch(c){console.error("set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",c)}var s=xl();return s.name=i,s.value=a,r.forEach(function(c){var u=c.split("="),h=u.shift().trim().toLowerCase();if(!Al(h)){var v=u.join("=").trim();if(h==="expires")s.expires=new Date(v);else if(h==="max-age"){var C=parseInt(v,10);Number.isNaN(C)||(s.maxAge=C)}else h==="secure"?s.secure=!0:h==="httponly"?s.httpOnly=!0:h==="samesite"?s.sameSite=v:h==="partitioned"?s.partitioned=!0:h&&(s[h]=v)}}),s}function xA(e){var t="",r="",n=e.split("=");return n.length>1?(t=n.shift(),r=n.join("=")):r=e,{name:t,value:r}}function Qn(e,t){if(t=t?Object.assign({},Ia,t):Ia,!e)return t.map?xl():[];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(a){return a.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(Vf),n&&(e=e.map(Ta).flat()),t.map){var i=xl();return e.reduce(function(a,s){var c=Cl(s,t);return c&&!Al(c.name)&&(a[c.name]=c),a},i)}else return e.map(function(a){return Cl(a,t)}).filter(Boolean)}function Ta(e){if(Array.isArray(e))return e;if(typeof e!="string")return[];var t=[],r=0,n,o,i,a,s;function c(){for(;r<e.length&&/\s/.test(e.charAt(r));)r+=1;return r<e.length}function u(){return o=e.charAt(r),o!=="="&&o!==";"&&o!==","}for(;r<e.length;){for(n=r,s=!1;c();)if(o=e.charAt(r),o===","){for(i=r,r+=1,c(),a=r;r<e.length&&u();)r+=1;r<e.length&&e.charAt(r)==="="?(s=!0,r=a,t.push(e.substring(n,i)),n=r):r=i+1}else r+=1;(!s||r>=e.length)&&t.push(e.substring(n,e.length))}return t}var Ia,Bf=Gn(()=>{"use strict";m();d();f();p();Ia={decodeValues:!0,map:!1,silent:!1,split:"auto"};Qn.parseSetCookie=Qn;Qn.parse=Qn;Qn.parseString=Cl;Qn.splitCookiesString=Ta});function ii(e){if(CA.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function El(e){return e.replace(EA,"")}function ai(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||!RA(r))return!1}return!0}function RA(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function $f(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 CA,Gf,EA,Qf,Hn,Rl,Hf,x,Wf=Gn(()=>{"use strict";m();d();f();p();Bf();CA=/[^a-z0-9\-#$%&'*+.^_`|~]/i;Gf=[`
19
+ `,"\r","\t"," "],EA=new RegExp(`(^[${Gf.join("")}]|$[${Gf.join("")}])`,"g");Hn=Symbol("normalizedHeaders"),Rl=Symbol("rawHeaderNames"),Hf=", ",x=class zf{constructor(t){this[Hn]={},this[Rl]=new Map,this[Qf]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor?.name)||t instanceof zf||typeof w.Headers<"u"&&t instanceof w.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(Hf):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(Hf):n)})}[(Qf=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[Hn]).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(!ai(t))throw new TypeError(`Invalid header name "${t}"`);return this[Hn].hasOwnProperty(ii(t))}get(t){if(!ai(t))throw TypeError(`Invalid header name "${t}"`);return this[Hn][ii(t)]??null}set(t,r){if(!ai(t)||!$f(r))return;let n=ii(t),o=El(r);this[Hn][n]=El(o),this[Rl].set(n,t)}append(t,r){if(!ai(t)||!$f(r))return;let n=ii(t),o=El(r),i=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,i)}delete(t){if(!ai(t)||!this.has(t))return;let r=ii(t);delete this[Hn][r],this[Rl].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===""?[""]:Ta(t)}}});var m=Gn(()=>{"use strict";Wf()});var tm=Ze(ui=>{"use strict";m();d();f();p();var Pa=ui&&ui.__assign||function(){return Pa=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},Pa.apply(this,arguments)};Object.defineProperty(ui,"__esModule",{value:!0});var DA={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function MA(e){var t=Pa(Pa({},DA),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}ui.getSanitizedOptions=MA});var rm=Ze(Ol=>{"use strict";m();d();f();p();Object.defineProperty(Ol,"__esModule",{value:!0});function qA(e){var t=Math.random()*e;return Math.round(t)}Ol.fullJitter=qA});var nm=Ze(Pl=>{"use strict";m();d();f();p();Object.defineProperty(Pl,"__esModule",{value:!0});function jA(e){return e}Pl.noJitter=jA});var om=Ze(Nl=>{"use strict";m();d();f();p();Object.defineProperty(Nl,"__esModule",{value:!0});var LA=rm(),UA=nm();function VA(e){return e.jitter==="full"?LA.fullJitter:UA.noJitter}Nl.JitterFactory=VA});var Dl=Ze(Fl=>{"use strict";m();d();f();p();Object.defineProperty(Fl,"__esModule",{value:!0});var BA=om(),GA=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=BA.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}();Fl.Delay=GA});var im=Ze(or=>{"use strict";m();d();f();p();var $A=or&&or.__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 i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},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)}}(),QA=or&&or.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(v){a(v)}}function c(h){try{u(n.throw(h))}catch(v){a(v)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},HA=or&&or.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(h){return c([u,h])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(h){u=[6,h],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(or,"__esModule",{value:!0});var zA=Dl(),WA=function(e){$A(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return QA(this,void 0,void 0,function(){return HA(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}(zA.Delay);or.SkipFirstDelay=WA});var am=Ze(li=>{"use strict";m();d();f();p();var KA=li&&li.__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 i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},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(li,"__esModule",{value:!0});var YA=Dl(),XA=function(e){KA(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(YA.Delay);li.AlwaysDelay=XA});var sm=Ze(Ml=>{"use strict";m();d();f();p();Object.defineProperty(Ml,"__esModule",{value:!0});var ZA=im(),JA=am();function ex(e,t){var r=tx(e);return r.setAttemptNumber(t),r}Ml.DelayFactory=ex;function tx(e){return e.delayFirstAttempt?new JA.AlwaysDelay(e):new ZA.SkipFirstDelay(e)}});var cm=Ze(Zr=>{"use strict";m();d();f();p();var ql=Zr&&Zr.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(v){a(v)}}function c(h){try{u(n.throw(h))}catch(v){a(v)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},jl=Zr&&Zr.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(h){return c([u,h])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(h){u=[6,h],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Zr,"__esModule",{value:!0});var rx=tm(),nx=sm();function ox(e,t){return t===void 0&&(t={}),ql(this,void 0,void 0,function(){var r,n;return jl(this,function(o){switch(o.label){case 0:return r=rx.getSanitizedOptions(t),n=new ix(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}Zr.backOff=ox;var ix=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return ql(this,void 0,void 0,function(){var t,r;return jl(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 ql(this,void 0,void 0,function(){var t;return jl(this,function(r){switch(r.label){case 0:return t=nx.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var tc=Ze((tp,rp)=>{"use strict";m();d();f();p();(function(e,t){typeof tp=="object"&&typeof rp<"u"?rp.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof w<"u"?w:e||self).dayjs=t()})(tp,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",s="day",c="week",u="month",h="quarter",v="year",C="date",g="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|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,E={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(P){var N=["th","st","nd","rd"],F=P%100;return"["+P+(N[(F-20)%10]||N[F]||N[0])+"]"}},R=function(P,N,F){var H=String(P);return!H||H.length>=N?P:""+Array(N+1-H.length).join(F)+P},k={s:R,z:function(P){var N=-P.utcOffset(),F=Math.abs(N),H=Math.floor(F/60),Q=F%60;return(N<=0?"+":"-")+R(H,2,"0")+":"+R(Q,2,"0")},m:function P(N,F){if(N.date()<F.date())return-P(F,N);var H=12*(F.year()-N.year())+(F.month()-N.month()),Q=N.clone().add(H,u),Z=F-Q<0,X=N.clone().add(H+(Z?-1:1),u);return+(-(H+(F-Q)/(Z?Q-X:X-Q))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:u,y:v,w:c,d:s,D:C,h:a,m:i,s:o,ms:n,Q:h}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},I="en",T={};T[I]=E;var _="$isDayjsObject",D=function(P){return P instanceof L||!(!P||!P[_])},G=function P(N,F,H){var Q;if(!N)return I;if(typeof N=="string"){var Z=N.toLowerCase();T[Z]&&(Q=Z),F&&(T[Z]=F,Q=Z);var X=N.split("-");if(!Q&&X.length>1)return P(X[0])}else{var W=N.name;T[W]=N,Q=W}return!H&&Q&&(I=Q),Q||!H&&I},V=function(P,N){if(D(P))return P.clone();var F=typeof N=="object"?N:{};return F.date=P,F.args=arguments,new L(F)},j=k;j.l=G,j.i=D,j.w=function(P,N){return V(P,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var L=function(){function P(F){this.$L=G(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[_]=!0}var N=P.prototype;return N.parse=function(F){this.$d=function(H){var Q=H.date,Z=H.utc;if(Q===null)return new Date(NaN);if(j.u(Q))return new Date;if(Q instanceof Date)return new Date(Q);if(typeof Q=="string"&&!/Z$/i.test(Q)){var X=Q.match(y);if(X){var W=X[2]-1||0,te=(X[7]||"0").substring(0,3);return Z?new Date(Date.UTC(X[1],W,X[3]||1,X[4]||0,X[5]||0,X[6]||0,te)):new Date(X[1],W,X[3]||1,X[4]||0,X[5]||0,X[6]||0,te)}}return new Date(Q)}(F),this.init()},N.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},N.$utils=function(){return j},N.isValid=function(){return this.$d.toString()!==g},N.isSame=function(F,H){var Q=V(F);return this.startOf(H)<=Q&&Q<=this.endOf(H)},N.isAfter=function(F,H){return V(F)<this.startOf(H)},N.isBefore=function(F,H){return this.endOf(H)<V(F)},N.$g=function(F,H,Q){return j.u(F)?this[H]:this.set(Q,F)},N.unix=function(){return Math.floor(this.valueOf()/1e3)},N.valueOf=function(){return this.$d.getTime()},N.startOf=function(F,H){var Q=this,Z=!!j.u(H)||H,X=j.p(F),W=function(ge,me){var be=j.w(Q.$u?Date.UTC(Q.$y,me,ge):new Date(Q.$y,me,ge),Q);return Z?be:be.endOf(s)},te=function(ge,me){return j.w(Q.toDate()[ge].apply(Q.toDate("s"),(Z?[0,0,0,0]:[23,59,59,999]).slice(me)),Q)},ue=this.$W,Ee=this.$M,je=this.$D,ke="set"+(this.$u?"UTC":"");switch(X){case v:return Z?W(1,0):W(31,11);case u:return Z?W(1,Ee):W(0,Ee+1);case c:var Ne=this.$locale().weekStart||0,Fe=(ue<Ne?ue+7:ue)-Ne;return W(Z?je-Fe:je+(6-Fe),Ee);case s:case C:return te(ke+"Hours",0);case a:return te(ke+"Minutes",1);case i:return te(ke+"Seconds",2);case o:return te(ke+"Milliseconds",3);default:return this.clone()}},N.endOf=function(F){return this.startOf(F,!1)},N.$set=function(F,H){var Q,Z=j.p(F),X="set"+(this.$u?"UTC":""),W=(Q={},Q[s]=X+"Date",Q[C]=X+"Date",Q[u]=X+"Month",Q[v]=X+"FullYear",Q[a]=X+"Hours",Q[i]=X+"Minutes",Q[o]=X+"Seconds",Q[n]=X+"Milliseconds",Q)[Z],te=Z===s?this.$D+(H-this.$W):H;if(Z===u||Z===v){var ue=this.clone().set(C,1);ue.$d[W](te),ue.init(),this.$d=ue.set(C,Math.min(this.$D,ue.daysInMonth())).$d}else W&&this.$d[W](te);return this.init(),this},N.set=function(F,H){return this.clone().$set(F,H)},N.get=function(F){return this[j.p(F)]()},N.add=function(F,H){var Q,Z=this;F=Number(F);var X=j.p(H),W=function(Ee){var je=V(Z);return j.w(je.date(je.date()+Math.round(Ee*F)),Z)};if(X===u)return this.set(u,this.$M+F);if(X===v)return this.set(v,this.$y+F);if(X===s)return W(1);if(X===c)return W(7);var te=(Q={},Q[i]=t,Q[a]=r,Q[o]=e,Q)[X]||1,ue=this.$d.getTime()+F*te;return j.w(ue,this)},N.subtract=function(F,H){return this.add(-1*F,H)},N.format=function(F){var H=this,Q=this.$locale();if(!this.isValid())return Q.invalidDate||g;var Z=F||"YYYY-MM-DDTHH:mm:ssZ",X=j.z(this),W=this.$H,te=this.$m,ue=this.$M,Ee=Q.weekdays,je=Q.months,ke=Q.meridiem,Ne=function(me,be,he,He){return me&&(me[be]||me(H,Z))||he[be].slice(0,He)},Fe=function(me){return j.s(W%12||12,me,"0")},ge=ke||function(me,be,he){var He=me<12?"AM":"PM";return he?He.toLowerCase():He};return Z.replace(S,function(me,be){return be||function(he){switch(he){case"YY":return String(H.$y).slice(-2);case"YYYY":return j.s(H.$y,4,"0");case"M":return ue+1;case"MM":return j.s(ue+1,2,"0");case"MMM":return Ne(Q.monthsShort,ue,je,3);case"MMMM":return Ne(je,ue);case"D":return H.$D;case"DD":return j.s(H.$D,2,"0");case"d":return String(H.$W);case"dd":return Ne(Q.weekdaysMin,H.$W,Ee,2);case"ddd":return Ne(Q.weekdaysShort,H.$W,Ee,3);case"dddd":return Ee[H.$W];case"H":return String(W);case"HH":return j.s(W,2,"0");case"h":return Fe(1);case"hh":return Fe(2);case"a":return ge(W,te,!0);case"A":return ge(W,te,!1);case"m":return String(te);case"mm":return j.s(te,2,"0");case"s":return String(H.$s);case"ss":return j.s(H.$s,2,"0");case"SSS":return j.s(H.$ms,3,"0");case"Z":return X}return null}(me)||X.replace(":","")})},N.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},N.diff=function(F,H,Q){var Z,X=this,W=j.p(H),te=V(F),ue=(te.utcOffset()-this.utcOffset())*t,Ee=this-te,je=function(){return j.m(X,te)};switch(W){case v:Z=je()/12;break;case u:Z=je();break;case h:Z=je()/3;break;case c:Z=(Ee-ue)/6048e5;break;case s:Z=(Ee-ue)/864e5;break;case a:Z=Ee/r;break;case i:Z=Ee/t;break;case o:Z=Ee/e;break;default:Z=Ee}return Q?Z:j.a(Z)},N.daysInMonth=function(){return this.endOf(u).$D},N.$locale=function(){return T[this.$L]},N.locale=function(F,H){if(!F)return this.$L;var Q=this.clone(),Z=G(F,H,!0);return Z&&(Q.$L=Z),Q},N.clone=function(){return j.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()},P}(),q=L.prototype;return V.prototype=q,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",s],["$M",u],["$y",v],["$D",C]].forEach(function(P){q[P[1]]=function(N){return this.$g(N,P[0],P[1])}}),V.extend=function(P,N){return P.$i||(P(N,L,V),P.$i=!0),V},V.locale=G,V.isDayjs=D,V.unix=function(P){return V(1e3*P)},V.en=T[I],V.Ls=T,V.p={},V})});var fy=Ze((np,op)=>{"use strict";m();d();f();p();(function(e,t){typeof np=="object"&&typeof op<"u"?op.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof w<"u"?w:e||self).dayjs_plugin_quarterOfYear=t()})(np,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(s){return this.$utils().u(s)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(s-1))};var i=o.add;o.add=function(s,c){return s=Number(s),this.$utils().p(c)===t?this.add(3*s,e):i.bind(this)(s,c)};var a=o.startOf;o.startOf=function(s,c){var u=this.$utils(),h=!!u.u(c)||c;if(u.p(s)===t){var v=this.quarter()-1;return h?this.month(3*v).startOf(e).startOf("day"):this.month(3*v+2).endOf(e).endOf("day")}return a.bind(this)(s,c)}}})});var my=Ze((ip,ap)=>{"use strict";m();d();f();p();(function(e,t){typeof ip=="object"&&typeof ap<"u"?ap.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof w<"u"?w:e||self).dayjs_plugin_customParseFormat=t()})(ip,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?/,i=/\d*[^-_:/,()\s\d]+/,a={},s=function(y){return(y=+y)+(y>68?1900:2e3)},c=function(y){return function(S){this[y]=+S}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=function(S){if(!S||S==="Z")return 0;var E=S.match(/([+-]|\d\d)/g),R=60*E[1]+(+E[2]||0);return R===0?0:E[0]==="+"?-R:R}(y)}],h=function(y){var S=a[y];return S&&(S.indexOf?S:S.s.concat(S.f))},v=function(y,S){var E,R=a.meridiem;if(R){for(var k=1;k<=24;k+=1)if(y.indexOf(R(k,0,S))>-1){E=k>12;break}}else E=y===(S?"pm":"PM");return E},C={A:[i,function(y){this.afternoon=v(y,!1)}],a:[i,function(y){this.afternoon=v(y,!0)}],Q:[r,function(y){this.month=3*(y-1)+1}],S:[r,function(y){this.milliseconds=100*+y}],SS:[n,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[o,c("seconds")],ss:[o,c("seconds")],m:[o,c("minutes")],mm:[o,c("minutes")],H:[o,c("hours")],h:[o,c("hours")],HH:[o,c("hours")],hh:[o,c("hours")],D:[o,c("day")],DD:[n,c("day")],Do:[i,function(y){var S=a.ordinal,E=y.match(/\d+/);if(this.day=E[0],S)for(var R=1;R<=31;R+=1)S(R).replace(/\[|\]/g,"")===y&&(this.day=R)}],w:[o,c("week")],ww:[n,c("week")],M:[o,c("month")],MM:[n,c("month")],MMM:[i,function(y){var S=h("months"),E=(h("monthsShort")||S.map(function(R){return R.slice(0,3)})).indexOf(y)+1;if(E<1)throw new Error;this.month=E%12||E}],MMMM:[i,function(y){var S=h("months").indexOf(y)+1;if(S<1)throw new Error;this.month=S%12||S}],Y:[/[+-]?\d+/,c("year")],YY:[n,function(y){this.year=s(y)}],YYYY:[/\d{4}/,c("year")],Z:u,ZZ:u};function g(y){var S,E;S=y,E=a&&a.formats;for(var R=(y=S.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(V,j,L){var q=L&&L.toUpperCase();return j||E[L]||e[L]||E[q].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(P,N,F){return N||F.slice(1)})})).match(t),k=R.length,I=0;I<k;I+=1){var T=R[I],_=C[T],D=_&&_[0],G=_&&_[1];R[I]=G?{regex:D,parser:G}:T.replace(/^\[|\]$/g,"")}return function(V){for(var j={},L=0,q=0;L<k;L+=1){var P=R[L];if(typeof P=="string")q+=P.length;else{var N=P.regex,F=P.parser,H=V.slice(q),Q=N.exec(H)[0];F.call(j,Q),V=V.replace(Q,"")}}return function(Z){var X=Z.afternoon;if(X!==void 0){var W=Z.hours;X?W<12&&(Z.hours+=12):W===12&&(Z.hours=0),delete Z.afternoon}}(j),j}}return function(y,S,E){E.p.customParseFormat=!0,y&&y.parseTwoDigitYear&&(s=y.parseTwoDigitYear);var R=S.prototype,k=R.parse;R.parse=function(I){var T=I.date,_=I.utc,D=I.args;this.$u=_;var G=D[1];if(typeof G=="string"){var V=D[2]===!0,j=D[3]===!0,L=V||j,q=D[2];j&&(q=D[2]),a=this.$locale(),!V&&q&&(a=E.Ls[q]),this.$d=function(H,Q,Z,X){try{if(["x","X"].indexOf(Q)>-1)return new Date((Q==="X"?1e3:1)*H);var W=g(Q)(H),te=W.year,ue=W.month,Ee=W.day,je=W.hours,ke=W.minutes,Ne=W.seconds,Fe=W.milliseconds,ge=W.zone,me=W.week,be=new Date,he=Ee||(te||ue?1:be.getDate()),He=te||be.getFullYear(),Ke=0;te&&!ue||(Ke=ue>0?ue-1:be.getMonth());var Dt,At=je||0,Gt=ke||0,Rt=Ne||0,Mt=Fe||0;return ge?new Date(Date.UTC(He,Ke,he,At,Gt,Rt,Mt+60*ge.offset*1e3)):Z?new Date(Date.UTC(He,Ke,he,At,Gt,Rt,Mt)):(Dt=new Date(He,Ke,he,At,Gt,Rt,Mt),me&&(Dt=X(Dt).week(me).toDate()),Dt)}catch{return new Date("")}}(T,G,_,E),this.init(),q&&q!==!0&&(this.$L=this.locale(q).$L),L&&T!=this.format(G)&&(this.$d=new Date("")),a={}}else if(G instanceof Array)for(var P=G.length,N=1;N<=P;N+=1){D[1]=G[N-1];var F=E.apply(this,D);if(F.isValid()){this.$d=F.$d,this.$L=F.$L,this.init();break}N===P&&(this.$d=new Date(""))}else k.call(this,I)}}})});var lv=Ze((wp,Ap)=>{"use strict";m();d();f();p();(function(e,t){typeof wp=="object"&&typeof Ap<"u"?Ap.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof w<"u"?w:e||self).dayjs_plugin_timezone=t()})(wp,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var i,a=function(h,v,C){C===void 0&&(C={});var g=new Date(h),y=function(S,E){E===void 0&&(E={});var R=E.timeZoneName||"short",k=S+"|"+R,I=t[k];return I||(I=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:R}),t[k]=I),I}(v,C);return y.formatToParts(g)},s=function(h,v){for(var C=a(h,v),g=[],y=0;y<C.length;y+=1){var S=C[y],E=S.type,R=S.value,k=e[E];k>=0&&(g[k]=parseInt(R,10))}var I=g[3],T=I===24?0:I,_=g[0]+"-"+g[1]+"-"+g[2]+" "+T+":"+g[4]+":"+g[5]+":000",D=+h;return(o.utc(_).valueOf()-(D-=D%1e3))/6e4},c=n.prototype;c.tz=function(h,v){if(h===void 0&&(h=i),!this.isValid())return this;var C,g=this.utcOffset(),y=this.toDate(),S=y.toLocaleString("en-US",{timeZone:h}),E=s(+y,h);if(!Number(E))C=this.utcOffset(0,v);else if(C=o(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(E,!0),v){var R=C.utcOffset();C=C.add(g-R,"minute")}return C.$x.$timezone=h,C},c.offsetName=function(h){var v=this.$x.$timezone||o.tz.guess(),C=a(this.valueOf(),v,{timeZoneName:h}).find(function(g){return g.type.toLowerCase()==="timezonename"});return C&&C.value};var u=c.startOf;c.startOf=function(h,v){if(!this.$x||!this.$x.$timezone)return u.call(this,h,v);var C=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return u.call(C,h,v).tz(this.$x.$timezone,!0)},o.tz=function(h,v,C){var g=C&&v,y=C||v||i,S=s(+o(),y);if(typeof h!="string")return o(h).tz(y);var E=o.utc(h,g).valueOf();if(Number.isNaN(E)){var R=o(NaN);return R.$x.$timezone=y,R}var k=function(D,G,V){var j=D-60*G*1e3,L=s(j,V);if(G===L)return[j,G];var q=s(j-=60*(L-G)*1e3,V);return L===q?[j,L]:[D-60*Math.min(L,q)*1e3,Math.max(L,q)]}(E,S,y),I=k[0],T=k[1],_=o(I).utcOffset(T);return _.$x.$timezone=y,_},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(h){i=h}}})});var dv=Ze((xp,Cp)=>{"use strict";m();d();f();p();(function(e,t){typeof xp=="object"&&typeof Cp<"u"?Cp.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof w<"u"?w:e||self).dayjs_plugin_utc=t()})(xp,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,i){var a=o.prototype;i.utc=function(g){var y={date:g,utc:!0,args:arguments};return new o(y)},a.utc=function(g){var y=i(this.toDate(),{locale:this.$L,utc:!0});return g?y.add(this.utcOffset(),e):y},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(g){g.utc&&(this.$u=!0),this.$utils().u(g.$offset)||(this.$offset=g.$offset),s.call(this,g)};var c=a.init;a.init=function(){if(this.$u){var g=this.$d;this.$y=g.getUTCFullYear(),this.$M=g.getUTCMonth(),this.$D=g.getUTCDate(),this.$W=g.getUTCDay(),this.$H=g.getUTCHours(),this.$m=g.getUTCMinutes(),this.$s=g.getUTCSeconds(),this.$ms=g.getUTCMilliseconds()}else c.call(this)};var u=a.utcOffset;a.utcOffset=function(g,y){var S=this.$utils().u;if(S(g))return this.$u?0:S(this.$offset)?u.call(this):this.$offset;if(typeof g=="string"&&(g=function(I){I===void 0&&(I="");var T=I.match(t);if(!T)return null;var _=(""+T[0]).match(r)||["-",0,0],D=_[0],G=60*+_[1]+ +_[2];return G===0?0:D==="+"?G:-G}(g),g===null))return this;var E=Math.abs(g)<=16?60*g:g;if(E===0)return this.utc(y);var R=this.clone();if(y)return R.$offset=E,R.$u=!1,R;var k=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(R=this.local().add(E+k,e)).$offset=E,R.$x.$localOffset=k,R};var h=a.format;a.format=function(g){var y=g||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,y)},a.valueOf=function(){var g=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*g},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var v=a.toDate;a.toDate=function(g){return g==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():v.call(this)};var C=a.diff;a.diff=function(g,y,S){if(g&&this.$u===g.$u)return C.call(this,g,y,S);var E=this.local(),R=i(g).local();return C.call(E,R,y,S)}}})});var Zb=Ze((Nue,Xb)=>{"use strict";m();d();f();p();function pP(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}Xb.exports=fP;function fP(e,t,r){var n=r&&r.stringify||pP,o=1;if(typeof e=="object"&&e!==null){var i=t.length+o;if(i===1)return e;var a=new Array(i);a[0]=n(e);for(var s=1;s<i;s++)a[s]=n(t[s]);return a.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var u="",h=1-o,v=-1,C=e&&e.length||0,g=0;g<C;){if(e.charCodeAt(g)===37&&g+1<C){switch(v=v>-1?v:0,e.charCodeAt(g+1)){case 100:case 102:if(h>=c||t[h]==null)break;v<g&&(u+=e.slice(v,g)),u+=Number(t[h]),v=g+2,g++;break;case 105:if(h>=c||t[h]==null)break;v<g&&(u+=e.slice(v,g)),u+=Math.floor(Number(t[h])),v=g+2,g++;break;case 79:case 111:case 106:if(h>=c||t[h]===void 0)break;v<g&&(u+=e.slice(v,g));var y=typeof t[h];if(y==="string"){u+="'"+t[h]+"'",v=g+2,g++;break}if(y==="function"){u+=t[h].name||"<anonymous>",v=g+2,g++;break}u+=n(t[h]),v=g+2,g++;break;case 115:if(h>=c)break;v<g&&(u+=e.slice(v,g)),u+=String(t[h]),v=g+2,g++;break;case 37:v<g&&(u+=e.slice(v,g)),u+="%",v=g+2,g++,h--;break}++h}++g}return v===-1?e:(v<C&&(u+=e.slice(v)),u)}});var iw=Ze((jue,nl)=>{"use strict";m();d();f();p();var Jb=Zb();nl.exports=br;var Sa=TP().console||{},mP={mapHttpRequest:rl,mapHttpResponse:rl,wrapRequestSerializer:Af,wrapResponseSerializer:Af,wrapErrorSerializer:Af,req:rl,res:rl,err:tw,errWithCause:tw};function Kr(e,t){return e==="silent"?1/0:t.levels.values[e]}var Ef=Symbol("pino.logFuncs"),xf=Symbol("pino.hierarchy"),gP={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function ew(e,t){let r={logger:t,parent:e[xf]};t[xf]=r}function hP(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:Sa[o]||Sa[gP[o]||"log"]||Ko}),e[Ef]=n}function yP(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function br(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||Sa;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=yP(e.browser.serialize,n),i=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(i=!1);let a=Object.keys(e.customLevels||{}),s=["error","fatal","warn","info","debug","trace"].concat(a);typeof r=="function"&&s.forEach(function(S){r[S]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let c=e.level||"info",u=Object.create(r);u.log||(u.log=Ko),hP(u,s,r),ew({},u),Object.defineProperty(u,"levelVal",{get:v}),Object.defineProperty(u,"level",{get:C,set:g});let h={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,reportCaller:e.browser.reportCaller,levels:s,timestamp:EP(e),messageKey:e.messageKey||"msg",onChild:e.onChild||Ko};u.levels=vP(e),u.level=c,u.isLevelEnabled=function(S){return this.levels.values[S]?this.levels.values[S]>=this.levels.values[this.level]:!1},u.setMaxListeners=u.getMaxListeners=u.emit=u.addListener=u.on=u.prependListener=u.once=u.prependOnceListener=u.removeListener=u.removeAllListeners=u.listeners=u.listenerCount=u.eventNames=u.write=u.flush=Ko,u.serializers=n,u._serialize=o,u._stdErrSerialize=i,u.child=function(...S){return y.call(this,h,...S)},t&&(u._logEvent=Cf());function v(){return Kr(this.level,this)}function C(){return this._level}function g(S){if(S!=="silent"&&!this.levels.values[S])throw Error("unknown level "+S);this._level=S,Ln(this,h,u,"error"),Ln(this,h,u,"fatal"),Ln(this,h,u,"warn"),Ln(this,h,u,"info"),Ln(this,h,u,"debug"),Ln(this,h,u,"trace"),a.forEach(E=>{Ln(this,h,u,E)})}function y(S,E,R){if(!E)throw new Error("missing bindings for child Pino");R=R||{},o&&E.serializers&&(R.serializers=E.serializers);let k=R.serializers;if(o&&k){var I=Object.assign({},n,k),T=e.browser.serialize===!0?Object.keys(I):o;delete E.serializers,Rf([E],T,I,this._stdErrSerialize)}function _(G){this._childLevel=(G._childLevel|0)+1,this.bindings=E,I&&(this.serializers=I,this._serialize=T),t&&(this._logEvent=Cf([].concat(G._logEvent.bindings,E)))}_.prototype=this;let D=new _(this);return ew(this,D),D.child=function(...G){return y.call(this,S,...G)},D.level=R.level||this.level,S.onChild(D),D}return u}function vP(e){let t=e.customLevels||{},r=Object.assign({},br.levels.values,t),n=Object.assign({},br.levels.labels,SP(t));return{values:r,labels:n}}function SP(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}br.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"}};br.stdSerializers=mP;br.stdTimeFunctions=Object.assign({},{nullTime:nw,epochTime:ow,unixTime:RP,isoTime:IP});function bP(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[xf];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function Ln(e,t,r,n){if(Object.defineProperty(e,n,{value:Kr(e.level,r)>Kr(n,r)?Ko:r[Ef][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===Ko){if(!t.transmit)return;let i=t.transmit.level||e.level,a=Kr(i,r);if(Kr(n,r)<a)return}e[n]=AP(e,t,r,n);let o=bP(e);o.length!==0&&(e[n]=wP(o,e[n]))}function wP(e,t){return function(){return t.apply(this,[...e,...arguments])}}function AP(e,t,r,n){return function(o){return function(){let a=t.timestamp(),s=new Array(arguments.length),c=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Sa?Sa:this;for(var u=0;u<s.length;u++)s[u]=arguments[u];var h=!1;if(t.serialize&&(Rf(s,this._serialize,this.serializers,this._stdErrSerialize),h=!0),t.asObject||t.formatters){let v=xP(this,n,s,a,t);if(t.reportCaller&&v&&v.length>0&&v[0]&&typeof v[0]=="object")try{let C=rw();C&&(v[0].caller=C)}catch{}o.call(c,...v)}else{if(t.reportCaller)try{let v=rw();v&&s.push(v)}catch{}o.apply(c,s)}if(t.transmit){let v=t.transmit.level||e._level,C=Kr(v,r),g=Kr(n,r);if(g<C)return;CP(this,{ts:a,methodLevel:n,methodValue:g,transmitLevel:v,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:Kr(e._level,r)},s,h)}}}(e[Ef][n])}function xP(e,t,r,n,o){let{level:i,log:a=v=>v}=o.formatters||{},s=r.slice(),c=s[0],u={},h=(e._childLevel|0)+1;if(h<1&&(h=1),n&&(u.time=n),i){let v=i(t,e.levels.values[t]);Object.assign(u,v)}else u.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(c!==null&&typeof c=="object")for(;h--&&typeof s[0]=="object";)Object.assign(u,s.shift());return[a(u),...s]}else{if(c!==null&&typeof c=="object"){for(;h--&&typeof s[0]=="object";)Object.assign(u,s.shift());c=s.length?Jb(s.shift(),s):void 0}else typeof c=="string"&&(c=Jb(s.shift(),s));return c!==void 0&&(u[o.messageKey]=c),[a(u)]}}function Rf(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=br.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let i in e[o])t.indexOf(i)>-1&&i in r&&(e[o][i]=r[i](e[o][i]))}function CP(e,t,r,n=!1){let o=t.send,i=t.ts,a=t.methodLevel,s=t.methodValue,c=t.val,u=e._logEvent.bindings;n||Rf(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(h){return u.indexOf(h)===-1}),e._logEvent.level.label=a,e._logEvent.level.value=s,o(a,e._logEvent,c),e._logEvent=Cf(u)}function Cf(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function tw(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 EP(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?nw:ow}function rl(){return{}}function Af(e){return e}function Ko(){}function nw(){return!1}function ow(){return Date.now()}function RP(){return Math.round(Date.now()/1e3)}function IP(){return new Date(Date.now()).toISOString()}function TP(){function e(t){return typeof t<"u"&&t}try{return typeof w<"u"?w:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),w)}catch{return e(self)||e(window)||e(this)||{}}}nl.exports.default=br;nl.exports.pino=br;function rw(){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 i=o[1],a=o[2],s=o[3];return i+":"+a+":"+s}}return null}});var TN={};ni(TN,{DefaultFieldsToInclude:()=>Pf,EcommerceDefaultFieldsToInclude:()=>zw,HighlightUtils:()=>kl,MinimumFieldsToInclude:()=>ml,ResultTemplatesHelpers:()=>Ny,buildContext:()=>gw,buildController:()=>Yr,buildDictionaryFieldContext:()=>hw,buildInteractiveResult:()=>Gw,buildRecommendationEngine:()=>pw,buildRecommendationList:()=>Vw,buildResultTemplatesManager:()=>Yw,getAnalyticsNextApiBaseUrl:()=>Na,getOrganizationEndpoint:()=>It,getSampleRecommendationEngineConfiguration:()=>If,loadAdvancedSearchQueryActions:()=>fN,loadClickAnalyticsActions:()=>CN,loadConfigurationActions:()=>mN,loadContextActions:()=>hN,loadDebugActions:()=>yN,loadDictionaryFieldContextActions:()=>vN,loadFieldActions:()=>wN,loadPaginationActions:()=>Of,loadPipelineActions:()=>AN,loadRecommendationActions:()=>xN,loadSearchConfigurationActions:()=>gN,loadSearchHubActions:()=>IN});module.exports=iA(TN);m();d();f();p();var kl={};ni(kl,{escapeHtml:()=>zn,getHighlightedSuggestion:()=>FA,highlightString:()=>NA});m();d();f();p();m();d();f();p();function IA(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 ii(r)}var ii=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},ht=class{constructor(e){ae(this,"definition");this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw AA(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}},De=class{constructor(e={}){ae(this,"baseConfig");this.baseConfig=e}validate(e){return this.baseConfig.required&&se(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 Je(e){return e===void 0}function xA(e){return e===null}function se(e){return Je(e)||xA(e)}var fe=class{constructor(e={}){ae(this,"value");this.value=new De(e)}validate(e){let t=this.value.validate(e);return t||(CA(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function CA(e){return Je(e)||zf(e)}function zf(e){return typeof e=="boolean"}var oe=class{constructor(e={}){ae(this,"config");ae(this,"value");this.config=e,this.value=new De(e)}validate(e){let t=this.value.validate(e);return t||(EA(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 EA(e){return Je(e)||Wf(e)}function Wf(e){return typeof e=="number"&&!Number.isNaN(e)}var RA=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,z=class{constructor(e={}){ae(this,"value");ae(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new De(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(Je(e))return null;if(!Ia(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(", ")}.`:i&&!(RA.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 Ia(e){return Object.prototype.toString.call(e)==="[object String]"}var ne=class{constructor(e={}){ae(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Je(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Kf(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&se(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Kf(e){return e!==void 0&&typeof e=="object"}var ve=class{constructor(e={}){ae(this,"config");ae(this,"value");this.config=e,this.value=new De(this.config)}validate(e){if(!se(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(se(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&&se(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 zf(e)||Ia(e)||Wf(e)||Kf(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Yf(e){return Array.isArray(e)}var El=class{constructor(e){ae(this,"config");ae(this,"value");this.config=e,this.value=new De(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Je(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}};m();d();f();p();function Xf(e){return Array.isArray(e)}function Ta(e){return e.trim()===""}var IA=new Set(["1",1,"yes",!0]);function Rl(){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=>IA.has(r))}function Zf(e){let t={};for(let[r,n]of e)t[r]=n;return t}function ai(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function _a(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function TA(e){if(Ta(e.openingDelimiter)||Ta(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(se(e.content)||Ta(e.content))return e.content;if(e.highlights.length===0)return Hn(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,s=a+i.length;if(s>t)break;r+=Hn(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Hn(e.content.slice(a,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=Hn(e.content.slice(n))),r}function _A(e,t){return e=Hn(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Il(n,t.notMatchDelimiters):o?Il(o,t.exactMatchDelimiters):i?Il(i,t.correctionDelimiters):r)}function Il(e,t){return t?t.open+e+t.close:e}function Hn(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}m();d();f();p();var lm=qt(am(),1);m();d();f();p();var $t=new Error("Failed to load reducers."),zn=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."}},Jr=class extends Error{constructor(r,n){super();ae(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};m();d();f();p();function sm(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function cm(e){return typeof e!="object"||!e?!1:Object.values(e).every(tx)}function tx(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function um(e){return e===429}var jt=class e{static call(t){return _asyncToGenerator(function*(){let r=rx(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,s=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let c=yield A(i,a);if(um(c.status))throw c;return c});return function s(){return _ref.apply(this,arguments)}}();try{let c=yield(0,lm.backOff)(s,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(u){let g=u&&um(u.status);return g&&(n.info("Platform retrying request"),yield new Promise(v=>setTimeout(v,1e3))),g});return function retry(_x2){return _ref2.apply(this,arguments)}}()});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new zn;case 404:throw new Jr(i,c.status);default:return n.info({response:c,requestInfo:o},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new Jr(i):c}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:s,...c}=t,u=ai(c);try{let g=yield o(t,n,a);return{...t,...g}}catch(g){i.error(g,"Platform request preprocessing failed. Returning default request options.")}return u})()}};function It(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function Wn(e,t,r="prod"){return e??It(t,r)}function wr(e,t="prod"){return`${It(e,t)}/rest/search/v2`}function Oa(e,t="prod"){return`${It(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function rx(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,s=e.method==="POST"||e.method==="PUT",c=nx(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(s&&{body:c}),signal:a}}function nx(e,t){return t==="application/x-www-form-urlencoded"?cm(e)?sm(e):"":JSON.stringify(e)}m();d();f();p();m();d();f();p();var Pa=e=>e;m();d();f();p();m();d();f();p();function Na(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Qt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Na(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Na(),extendedResults:{},searchAction:void 0}}m();d();f();p();function Ar(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var xr=e=>{let{response:t}=e;return t.body?ox(e):ix(t)},ox=e=>sx(e)?cx(e):ax(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},ix=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function ax(e){return e.body.statusCode!==void 0}function sx(e){return e.body.exception!==void 0}var cx=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});m();d();f();p();var Cr=class{constructor(){ae(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new l.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)}})()}};m();d();f();p();m();d();f();p();var ui=class{constructor(t){ae(this,"_basePath");ae(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}};m();d();f();p();function dm(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}m();d();f();p();var ir=(e,t,r,n)=>{let o=new ui(`${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 pm=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield jt.call({...ir(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:Ar(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=dm(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return ux(a)?{success:a}:{error:xr({response:r,body:a})}});return function pm(_x3,_x4){return _ref3.apply(this,arguments)}}();function ux(e){return typeof e=="string"}m();d();f();p();function lx(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function dx(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Fa(e,t){if(t&&e.name==="AbortError")return{error:dx(e)};if(e instanceof Jr)return{error:lx(e)};throw e}var Da=class{constructor(t){ae(this,"options",t);ae(this,"apiCallsQueues",{unknown:new Cr,mainSearch:new Cr,facetValues:new Cr,foldingCollection:new Cr,instantResults:new Cr})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield jt.call({...ir(t,"POST","application/json","/plan"),requestParams:Ar(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Fa(r);let n=yield r.json();return fx(n)?{success:n}:{error:xr({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield jt.call({...ir(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:Ar(t),..._this3.options});if(r instanceof Error)return Fa(r);let n=yield r.json(),o={response:r,body:n};return px(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:xr(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(s=>jt.call({...ir(t,"POST","application/json",""),requestParams:Ar(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:s??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Fa(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return fm(i)?(a.body=mm(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:xr(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield jt.call({...ir(t,"POST","application/json","/facet"),requestParams:Ar(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 jt.call({...ir(t,"POST","application/json",""),requestParams:Ar(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(fm(n)){let o={response:r,body:n};return o.body=mm(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:xr({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return pm(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield jt.call({...ir(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return mx(n)?{success:n}:{error:xr({response:r,body:n})}})()}},Ma=e=>e.success!==void 0,yt=e=>e.error!==void 0;function fm(e){return e.results!==void 0}function mm(e){let t=Na();return se(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function px(e){return e.completions!==void 0}function fx(e){return e.preprocessingOutput!==void 0}function mx(e){return e.fields!==void 0}m();d();f();p();var gm=e=>e,hm=e=>e,ym=e=>e;m();d();f();p();m();d();f();p();m();d();f();p();function et(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var gx=typeof Symbol=="function"&&Symbol.observable||"@@observable",vm=gx,ql=()=>Math.random().toString(36).substring(7).split("").join("."),hx={INIT:`@@redux/INIT${ql()}`,REPLACE:`@@redux/REPLACE${ql()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ql()}`},qa=hx;function Ht(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 jl(e,t,r){if(typeof e!="function")throw new Error(et(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(et(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(et(1));return r(jl)(e,t)}let n=e,o=t,i=new Map,a=i,s=0,c=!1;function u(){a===i&&(a=new Map,i.forEach((C,R)=>{a.set(R,C)}))}function g(){if(c)throw new Error(et(3));return o}function v(C){if(typeof C!="function")throw new Error(et(4));if(c)throw new Error(et(5));let R=!0;u();let T=s++;return a.set(T,C),function(){if(R){if(c)throw new Error(et(6));R=!1,u(),a.delete(T),i=null}}}function E(C){if(!Ht(C))throw new Error(et(7));if(typeof C.type>"u")throw new Error(et(8));if(typeof C.type!="string")throw new Error(et(17));if(c)throw new Error(et(9));try{c=!0,o=n(o,C)}finally{c=!1}return(i=a).forEach(T=>{T()}),C}function y(C){if(typeof C!="function")throw new Error(et(10));n=C,E({type:qa.REPLACE})}function h(){let C=v;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(et(11));function T(){let k=R;k.next&&k.next(g())}return T(),{unsubscribe:C(T)}},[vm](){return this}}}return E({type:qa.INIT}),{dispatch:E,subscribe:v,getState:g,replaceReducer:y,[vm]:h}}function yx(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:qa.INIT})>"u")throw new Error(et(12));if(typeof r(void 0,{type:qa.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(et(13))})}function Kn(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let s=t[a];typeof e[s]=="function"&&(r[s]=e[s])}let n=Object.keys(r),o,i;try{yx(r)}catch(a){i=a}return function(s={},c){if(i)throw i;let u=!1,g={};for(let v=0;v<n.length;v++){let E=n[v],y=r[E],h=s[E],S=y(h,c);if(typeof S>"u"){let C=c&&c.type;throw new Error(et(14))}g[E]=S,u=u||S!==h}return u=u||n.length!==Object.keys(s).length,u?g:s}}function li(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Sm(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(et(15))},a={getState:o.getState,dispatch:(c,...u)=>i(c,...u)},s=e.map(c=>c(a));return i=li(...s)(o.dispatch),{...o,dispatch:i}}}function di(e){return Ht(e)&&"type"in e&&typeof e.type=="string"}m();d();f();p();var zl=Symbol.for("immer-nothing"),pi=Symbol.for("immer-draftable"),We=Symbol.for("immer-state");function tt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var xt=Object,tn=xt.getPrototypeOf,fi="constructor",vi="prototype",Vl="configurable",Va="enumerable",La="writable",mi="value",ft=e=>!!e&&!!e[We];function ut(e){return e?Im(e)||bi(e)||!!e[pi]||!!e[fi]?.[pi]||wi(e)||Ai(e):!1}var vx=xt[vi][fi].toString(),bm=new WeakMap;function Im(e){if(!e||!Xn(e))return!1;let t=tn(e);if(t===null||t===xt[vi])return!0;let r=xt.hasOwnProperty.call(t,fi)&&t[fi];if(r===Object)return!0;if(!en(r))return!1;let n=bm.get(r);return n===void 0&&(n=Function.toString.call(r),bm.set(r,n)),n===vx}function Tm(e){return ft(e)||tt(15,e),e[We].base_}function Si(e,t,r=!0){rn(e)===0?(r?Reflect.ownKeys(e):xt.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function rn(e){let t=e[We];return t?t.type_:bi(e)?1:wi(e)?2:Ai(e)?3:0}var Yn=(e,t,r=rn(e))=>r===2?e.has(t):xt[vi].hasOwnProperty.call(e,t),ar=(e,t,r=rn(e))=>r===2?e.get(t):e[t],Ba=(e,t,r,n=rn(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function Sx(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var bi=Array.isArray,wi=e=>e instanceof Map,Ai=e=>e instanceof Set,Xn=e=>typeof e=="object",en=e=>typeof e=="function",Ll=e=>typeof e=="boolean";function bx(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var wx=e=>Xn(e)?e?.[We]:null,sr=e=>e.copy_||e.base_;var Wl=e=>e.modified_?e.copy_:e.base_;function Bl(e,t){if(wi(e))return new Map(e);if(Ai(e))return new Set(e);if(bi(e))return Array[vi].slice.call(e);let r=Im(e);if(t===!0||t==="class_only"&&!r){let n=xt.getOwnPropertyDescriptors(e);delete n[We];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],s=n[a];s[La]===!1&&(s[La]=!0,s[Vl]=!0),(s.get||s.set)&&(n[a]={[Vl]:!0,[La]:!0,[Va]:s[Va],[mi]:e[a]})}return xt.create(tn(e),n)}else{let n=tn(e);if(n!==null&&r)return{...e};let o=xt.create(n);return xt.assign(o,e)}}function Kl(e,t=!1){return Wa(e)||ft(e)||!ut(e)||(rn(e)>1&&xt.defineProperties(e,{set:ja,add:ja,clear:ja,delete:ja}),xt.freeze(e),t&&Si(e,(r,n)=>{Kl(n,!0)},!1)),e}function Ax(){tt(2)}var ja={[mi]:Ax};function Wa(e){return e===null||!Xn(e)?!0:xt.isFrozen(e)}var Ga="MapSet",$a="Patches",wm="ArrayMethods",Qa={};function nn(e){let t=Qa[e];return t||tt(0,e),t}var Am=e=>!!Qa[e];function xx(e,t){Qa[e]||(Qa[e]=t)}var gi,_m=()=>gi,Cx=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Am(Ga)?nn(Ga):void 0,arrayMethodsPlugin_:Am(wm)?nn(wm):void 0});function xm(e,t){t&&(e.patchPlugin_=nn($a),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Gl(e){$l(e),e.drafts_.forEach(Ex),e.drafts_=null}function $l(e){e===gi&&(gi=e.parent_)}var Cm=e=>gi=Cx(gi,e);function Ex(e){let t=e[We];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Em(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[We].modified_&&(Gl(t),tt(4)),ut(e)&&(e=Rm(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[We].base_,e,t)}else e=Rm(t,r);return Rx(t,e,!0),Gl(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==zl?e:void 0}function Rm(e,t){if(Wa(t))return t;let r=t[We];if(!r)return Ha(t,e.handledSet_,e);if(!Ka(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);Pm(r,e)}return r.copy_}function Rx(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Kl(t,r)}function km(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Ka=(e,t)=>e.scope_===t,Ix=[];function Om(e,t,r,n){let o=sr(e),i=e.type_;if(n!==void 0&&ar(o,n,i)===t){Ba(o,n,r,i);return}if(!e.draftLocations_){let s=e.draftLocations_=new Map;Si(o,(c,u)=>{if(ft(u)){let g=s.get(u)||[];g.push(c),s.set(u,g)}})}let a=e.draftLocations_.get(t)??Ix;for(let s of a)Ba(o,s,r,i)}function Tx(e,t,r){e.callbacks_.push(function(o){let i=t;if(!i||!Ka(i,o))return;o.mapSetPlugin_?.fixSetContents(i);let a=Wl(i);Om(e,i.draft_??i,a,r),Pm(i,o)})}function Pm(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)}km(e)}}function _x(e,t,r){let{scope_:n}=e;if(ft(r)){let o=r[We];Ka(o,n)&&o.callbacks_.push(function(){Ua(e);let a=Wl(o);Om(e,r,a,t)})}else ut(r)&&e.callbacks_.push(function(){let i=sr(e);e.type_===3?i.has(r)&&Ha(r,n.handledSet_,n):ar(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Ha(ar(e.copy_,t,e.type_),n.handledSet_,n)})}function Ha(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||ft(e)||t.has(e)||!ut(e)||Wa(e)||(t.add(e),Si(e,(n,o)=>{if(ft(o)){let i=o[We];if(Ka(i,r)){let a=Wl(i);Ba(e,n,a,e.type_),km(i)}}else ut(o)&&Ha(o,t,r)})),e}function kx(e,t){let r=bi(e),n={type_:r?1:0,scope_:t?t.scope_:_m(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,i=za;r&&(o=[n],i=hi);let{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,[s,n]}var za={get(e,t){if(t===We)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=sr(e);if(!Yn(o,t,e.type_))return Px(e,o,t);let i=o[t];if(e.finalized_||!ut(i)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&bx(t))return i;if(i===Ul(e.base_,t)||Ox(e,t,i)){Ua(e);let a=e.type_===1?+t:t,s=Hl(e.scope_,i,e,a);return e.copy_[a]=s}return i},has(e,t){return t in sr(e)},ownKeys(e){return Reflect.ownKeys(sr(e))},set(e,t,r){let n=Nm(sr(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Ul(sr(e),t),i=o?.[We];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(Sx(r,o)&&(r!==void 0||Yn(e.base_,t,e.type_)))return!0;Ua(e),Ql(e)}return e.copy_[t]===r&&(r!==void 0||Yn(e.copy_,t,e.type_))||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),_x(e,t,r)),!0},deleteProperty(e,t){return Ua(e),Ul(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Ql(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=sr(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[La]:!0,[Vl]:e.type_!==1||t!=="length",[Va]:n[Va],[mi]:r[t]}},defineProperty(){tt(11)},getPrototypeOf(e){return tn(e.base_)},setPrototypeOf(){tt(12)}},hi={};for(let e in za){let t=za[e];hi[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}hi.deleteProperty=function(e,t){return hi.set.call(this,e,t,void 0)};hi.set=function(e,t,r){return za.set.call(this,e[0],t,r,e[0])};function Ul(e,t){let r=e[We];return(r?sr(r):e)[t]}function Ox(e,t,r){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!ut(r)||r[We]?!1:e.baseRefs_.has(r)}function Px(e,t,r){let n=Nm(t,r);return n?mi in n?n[mi]:n.get?.call(e.draft_):void 0}function Nm(e,t){if(!(t in e))return;let r=tn(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=tn(r)}}function Ql(e){e.modified_||(e.modified_=!0,e.parent_&&Ql(e.parent_))}function Ua(e){e.copy_||(e.assigned_=new Map,e.copy_=Bl(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Nx=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(en(t)&&!en(r)){let i=r;r=t;let a=this;return function(c=i,...u){return a.produce(c,g=>r.call(this,g,...u))}}en(r)||tt(6),n!==void 0&&!en(n)&&tt(7);let o;if(ut(t)){let i=Cm(this),a=Hl(i,t,void 0),s=!0;try{o=r(a),s=!1}finally{s?Gl(i):$l(i)}return xm(i,n),Em(o,i)}else if(!t||!Xn(t)){if(o=r(t),o===void 0&&(o=t),o===zl&&(o=void 0),this.autoFreeze_&&Kl(o,!0),n){let i=[],a=[];nn($a).generateReplacementPatches_(t,o,{patches_:i,inversePatches_:a}),n(i,a)}return o}else tt(1,t)},this.produceWithPatches=(t,r)=>{if(en(t))return(a,...s)=>this.produceWithPatches(a,c=>t(c,...s));let n,o;return[this.produce(t,r,(a,s)=>{n=a,o=s}),n,o]},Ll(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Ll(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Ll(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ut(e)||tt(8),ft(e)&&(e=Ya(e));let t=Cm(this),r=Hl(t,e,void 0);return r[We].isManual_=!0,$l(t),r}finishDraft(e,t){let r=e&&e[We];(!r||!r.isManual_)&&tt(9);let{scope_:n}=r;return xm(n,t),Em(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=nn($a).applyPatches_;return ft(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Hl(e,t,r,n){let[o,i]=wi(t)?nn(Ga).proxyMap_(t,r):Ai(t)?nn(Ga).proxySet_(t,r):kx(t,r);return(r?.scope_??_m()).drafts_.push(o),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?Tx(r,i,n):i.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:u}=c;i.modified_&&u&&u.generatePatches_(i,[],c)}),o}function Ya(e){return ft(e)||tt(10,e),Fm(e)}function Fm(e){if(!ut(e)||Wa(e))return e;let t=e[We],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Bl(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Bl(e,!0);return Si(r,(o,i)=>{Ba(r,o,Fm(i))},n),t&&(t.finalized_=!1),r}function Dm(){function t(h,S=[]){if(h.key_!==void 0){let C=h.parent_.copy_??h.parent_.base_,R=wx(ar(C,h.key_)),T=ar(C,h.key_);if(T===void 0||T!==h.draft_&&T!==h.base_&&T!==h.copy_||R!=null&&R.base_!==h.base_)return null;let I=h.parent_.type_===3,k;if(I){let _=h.parent_;k=Array.from(_.drafts_.keys()).indexOf(h.key_)}else k=h.key_;if(!(I&&C.size>k||Yn(C,k)))return null;S.push(k)}if(h.parent_)return t(h.parent_,S);S.reverse();try{r(h.copy_,S)}catch{return null}return S}function r(h,S){let C=h;for(let R=0;R<S.length-1;R++){let T=S[R];if(C=ar(C,T),!Xn(C)||C===null)throw new Error(`Cannot resolve path at '${S.join("/")}'`)}return C}let n="replace",o="add",i="remove";function a(h,S,C){if(h.scope_.processedForPatches_.has(h))return;h.scope_.processedForPatches_.add(h);let{patches_:R,inversePatches_:T}=C;switch(h.type_){case 0:case 2:return c(h,S,R,T);case 1:return s(h,S,R,T);case 3:return u(h,S,R,T)}}function s(h,S,C,R){let{base_:T,assigned_:I}=h,k=h.copy_;k.length<T.length&&([T,k]=[k,T],[C,R]=[R,C]);let _=h.allIndicesReassigned_===!0;for(let D=0;D<T.length;D++){let G=k[D],L=T[D];if((_||I?.get(D.toString()))&&G!==L){let V=G?.[We];if(V&&V.modified_)continue;let q=S.concat([D]);C.push({op:n,path:q,value:y(G)}),R.push({op:n,path:q,value:y(L)})}}for(let D=T.length;D<k.length;D++){let G=S.concat([D]);C.push({op:o,path:G,value:y(k[D])})}for(let D=k.length-1;T.length<=D;--D){let G=S.concat([D]);R.push({op:i,path:G})}}function c(h,S,C,R){let{base_:T,copy_:I,type_:k}=h;Si(h.assigned_,(_,D)=>{let G=ar(T,_,k),L=ar(I,_,k),j=D?Yn(T,_)?n:o:i;if(G===L&&j===n)return;let V=S.concat(_);C.push(j===i?{op:j,path:V}:{op:j,path:V,value:y(L)}),R.push(j===o?{op:i,path:V}:j===i?{op:o,path:V,value:y(G)}:{op:n,path:V,value:y(G)})})}function u(h,S,C,R){let{base_:T,copy_:I}=h,k=0;T.forEach(_=>{if(!I.has(_)){let D=S.concat([k]);C.push({op:i,path:D,value:_}),R.unshift({op:o,path:D,value:_})}k++}),k=0,I.forEach(_=>{if(!T.has(_)){let D=S.concat([k]);C.push({op:o,path:D,value:_}),R.unshift({op:i,path:D,value:_})}k++})}function g(h,S,C){let{patches_:R,inversePatches_:T}=C;R.push({op:n,path:[],value:S===zl?void 0:S}),T.push({op:n,path:[],value:h})}function v(h,S){return S.forEach(C=>{let{path:R,op:T}=C,I=h;for(let G=0;G<R.length-1;G++){let L=rn(I),j=R[G];typeof j!="string"&&typeof j!="number"&&(j=""+j),(L===0||L===1)&&(j==="__proto__"||j===fi)&&tt(19),en(I)&&j===vi&&tt(19),I=ar(I,j),(I===null||!Xn(I))&&tt(18,R.join("/"))}let k=rn(I),_=E(C.value),D=R[R.length-1];switch(T){case n:switch(k){case 2:return I.set(D,_);case 3:tt(16);default:return I[D]=_}case o:switch(k){case 1:return D==="-"?I.push(_):I.splice(D,0,_);case 2:return I.set(D,_);case 3:return I.add(_);default:return I[D]=_}case i:switch(k){case 1:return I.splice(D,1);case 2:return I.delete(D);case 3:return I.delete(C.value);default:return delete I[D]}default:tt(17,T)}}),h}function E(h){if(!ut(h))return h;if(bi(h))return h.map(E);if(wi(h))return new Map(Array.from(h.entries()).map(([C,R])=>[C,E(R)]));if(Ai(h))return new Set(Array.from(h).map(E));let S=Object.create(tn(h));for(let C in h)S[C]=E(h[C]);return Yn(h,pi)&&(S[pi]=h[pi]),S}function y(h){return ft(h)?E(h):h}xx($a,{applyPatches_:v,generatePatches_:a,generateReplacementPatches_:g,getPath:t})}var yi=new Nx,on=yi.produce,Yl=yi.produceWithPatches.bind(yi);var Xl=yi.applyPatches.bind(yi);m();d();f();p();function Fx(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Dx(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 Mm=e=>Array.isArray(e)?e:[e];function Mx(e){let t=Array.isArray(e[0])?e[0]:e;return Dx(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function qx(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var jx=class{constructor(e){this.value=e}deref(){return this.value}},Lx=()=>typeof WeakRef>"u"?jx:WeakRef,jm=Lx(),Ux=0,qm=1;function Xa(){return{s:Ux,v:void 0,o:null,p:null}}function Vx(e){return e instanceof jm?e.deref():e}function xi(e,t={}){let r=Xa(),{resultEqualityCheck:n}=t,o,i=0;function a(){let s=r,{length:c}=arguments;for(let v=0,E=c;v<E;v++){let y=arguments[v];if(typeof y=="function"||typeof y=="object"&&y!==null){let h=s.o;h===null&&(s.o=h=new WeakMap);let S=h.get(y);S===void 0?(s=Xa(),h.set(y,s)):s=S}else{let h=s.p;h===null&&(s.p=h=new Map);let S=h.get(y);S===void 0?(s=Xa(),h.set(y,s)):s=S}}let u=s,g;if(s.s===qm)g=s.v;else if(g=e.apply(null,arguments),i++,n){let v=Vx(o);v!=null&&n(v,g)&&(g=v,i!==0&&i--),o=typeof g=="object"&&g!==null||typeof g=="function"?new jm(g):g}return u.s=qm,u.v=g,g}return a.clearCache=()=>{r=Xa(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function Bx(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,s,c={},u=o.pop();typeof u=="object"&&(c=u,u=o.pop()),Fx(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);let g={...r,...c},{memoize:v,memoizeOptions:E=[],argsMemoize:y=xi,argsMemoizeOptions:h=[]}=g,S=Mm(E),C=Mm(h),R=Mx(o),T=v(function(){return i++,u.apply(null,arguments)},...S),I=!0,k=y(function(){a++;let D=qx(R,arguments);return s=T.apply(null,D),s},...C);return Object.assign(k,{resultFunc:u,memoizedResultFunc:T,dependencies:R,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:v,argsMemoize:y})};return Object.assign(n,{withTypes:()=>n}),n}var $e=Bx(xi);m();d();f();p();function Lm(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var Um=Lm(),Vm=Lm;var Gx=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?li:li.apply(null,arguments)},Sq=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},$x=e=>e&&typeof e.match=="function";function O(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(mt(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=>di(n)&&n.type===e,r}var Km=class Ci extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ci.prototype)}static get[Symbol.species](){return Ci}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ci(...t[0].concat(this)):new Ci(...t.concat(this))}};function Bm(e){return ut(e)?on(e,()=>{}):e}function Za(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Qx(e){return typeof e=="boolean"}var Hx=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Km;return r&&(Qx(r)?a.push(Um):a.push(Vm(r.extraArgument))),a},Ei="RTK_autoBatch",eo=()=>e=>({payload:e,meta:{[Ei]:!0}}),Gm=e=>t=>{setTimeout(t,e)},zx=(e,t)=>r=>{let n=!1,o=()=>{n||(n=!0,cancelAnimationFrame(i),clearTimeout(a),r())},i=e(o),a=setTimeout(o,t)},Wx=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?zx(window.requestAnimationFrame,100):Gm(10):e.type==="callback"?e.queueNotification:Gm(e.timeout),u=()=>{a=!1,i&&(i=!1,s.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let v=()=>o&&g(),E=n.subscribe(v);return s.add(g),()=>{E(),s.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Ei],i=!o,i&&(a||(a=!0,c(u))),n.dispatch(g)}finally{o=!0}}})},Kx=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Km(e);return n&&o.push(Wx(typeof n=="object"?n:void 0)),o};function Ym(e){let t=Hx(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{},c;if(typeof r=="function")c=r;else if(Ht(r))c=Kn(r);else throw new Error(mt(1));let u;typeof n=="function"?u=n(t):u=t();let g=li;o&&(g=Gx({trace:!1,...(typeof o=="object"&&o)}));let v=Sm(...u),E=Kx(v),y=typeof s=="function"?s(E):E(),h=g(...y);return jl(c,a,h)}function Xm(e){let t={},r=[],n,o={addCase(i,a){let s=typeof i=="string"?i:i.type;if(!s)throw new Error(mt(28));if(s in t)throw new Error(mt(29));return t[s]=a,o},addAsyncThunk(i,a){return a.pending&&(t[i.pending.type]=a.pending),a.rejected&&(t[i.rejected.type]=a.rejected),a.fulfilled&&(t[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function Yx(e){return typeof e=="function"}function Be(e,t){let[r,n,o]=Xm(t),i;if(Yx(e))i=()=>Bm(e());else{let s=Bm(e);i=()=>s}function a(s=i(),c){let u=[r[c.type],...n.filter(({matcher:g})=>g(c)).map(({reducer:g})=>g)];return u.filter(g=>!!g).length===0&&(u=[o]),u.reduce((g,v)=>{if(v)if(ft(g)){let y=v(g,c);return y===void 0?g:y}else{if(ut(g))return on(g,E=>v(E,c));{let E=v(g,c);if(E===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return E}}return g},s)}return a.getInitialState=i,a}var Zm=(e,t)=>$x(e)?e.match(t):e(t);function zt(...e){return t=>e.some(r=>Zm(r,t))}function Jn(...e){return t=>e.every(r=>Zm(r,t))}function rs(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 Ri(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function ns(...e){return e.length===0?t=>rs(t,["pending"]):Ri(e)?zt(...e.map(t=>t.pending)):ns()(e[0])}function sn(...e){return e.length===0?t=>rs(t,["rejected"]):Ri(e)?zt(...e.map(t=>t.rejected)):sn()(e[0])}function Ii(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Jn(sn(...e),t):Ri(e)?Jn(sn(...e),t):Ii()(e[0])}function cr(...e){return e.length===0?t=>rs(t,["fulfilled"]):Ri(e)?zt(...e.map(t=>t.fulfilled)):cr()(e[0])}function os(...e){return e.length===0?t=>rs(t,["pending","fulfilled","rejected"]):Ri(e)?zt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):os()(e[0])}var Xx="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ti=(e=21)=>{let t="",r=e;for(;r--;)t+=Xx[Math.random()*64|0];return t},Zx=["name","message","stack","code"],Zl=class{constructor(e,t){ae(this,"payload");ae(this,"meta");ae(this,"_type");this.payload=e,this.meta=t}},$m=class{constructor(e,t){ae(this,"payload");ae(this,"meta");ae(this,"_type");this.payload=e,this.meta=t}},Jx=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of Zx)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},Qm="External signal was aborted",Ie=(()=>{function e(t,r,n){let o=O(t+"/fulfilled",(c,u,g,v)=>({payload:c,meta:{...(v||{}),arg:g,requestId:u,requestStatus:"fulfilled"}})),i=O(t+"/pending",(c,u,g)=>({payload:void 0,meta:{...(g||{}),arg:u,requestId:c,requestStatus:"pending"}})),a=O(t+"/rejected",(c,u,g,v,E)=>({payload:v,error:(n&&n.serializeError||Jx)(c||"Rejected"),meta:{...(E||{}),arg:g,requestId:u,rejectedWithValue:!!v,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function s(c,{signal:u}={}){return(g,v,E)=>{let y=n?.idGenerator?n.idGenerator(c):Ti(),h=new l.AbortController,S,C;function R(I){C=I,h.abort()}u&&(u.aborted?R(Qm):u.addEventListener("abort",()=>R(Qm),{once:!0}));let T=_asyncToGenerator(function*(){let I;try{let _=n?.condition?.(c,{getState:v,extra:E});if(tC(_)&&(_=yield _),_===!1||h.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let D=new Promise((G,L)=>{S=()=>{L({name:"AbortError",message:C||"Aborted"})},h.signal.addEventListener("abort",S,{once:!0})});g(i(y,c,n?.getPendingMeta?.({requestId:y,arg:c},{getState:v,extra:E}))),I=yield Promise.race([D,Promise.resolve(r(c,{dispatch:g,getState:v,extra:E,requestId:y,signal:h.signal,abort:R,rejectWithValue:(G,L)=>new Zl(G,L),fulfillWithValue:(G,L)=>new $m(G,L)})).then(G=>{if(G instanceof Zl)throw G;return G instanceof $m?o(G.payload,y,c,G.meta):o(G,y,c)})])}catch(_){I=_ instanceof Zl?a(null,y,c,_.payload,_.meta):a(_,y,c)}finally{S&&h.signal.removeEventListener("abort",S)}return n&&!n.dispatchConditionRejection&&a.match(I)&&I.meta.condition||g(I),I})();return Object.assign(T,{abort:R,requestId:y,arg:c,unwrap(){return T.then(eC)}})}}return Object.assign(s,{pending:i,rejected:a,fulfilled:o,settled:zt(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function eC(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function tC(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Jm=Symbol.for("rtk-slice-createasyncthunk"),wq={[Jm]:Ie};function rC(e,t){return`${e}/${t}`}function nC({creators:e}={}){let t=e?.asyncThunk?.[Jm];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(mt(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(iC()):n.reducers)||{},s=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(I,k){let _=typeof I=="string"?I:I.type;if(!_)throw new Error(mt(12));if(_ in c.sliceCaseReducersByType)throw new Error(mt(13));return c.sliceCaseReducersByType[_]=k,u},addMatcher(I,k){return c.sliceMatchers.push({matcher:I,reducer:k}),u},exposeAction(I,k){return c.actionCreators[I]=k,u},exposeCaseReducer(I,k){return c.sliceCaseReducersByName[I]=k,u}};s.forEach(I=>{let k=a[I],_={reducerName:I,type:rC(o,I),createNotation:typeof n.reducers=="function"};sC(k)?uC(_,k,u,t):aC(_,k,u)});function g(){let[I={},k=[],_=void 0]=typeof n.extraReducers=="function"?Xm(n.extraReducers):[n.extraReducers],D={...I,...c.sliceCaseReducersByType};return Be(n.initialState,G=>{for(let L in D)G.addCase(L,D[L]);for(let L of c.sliceMatchers)G.addMatcher(L.matcher,L.reducer);for(let L of k)G.addMatcher(L.matcher,L.reducer);_&&G.addDefaultCase(_)})}let v=I=>I,E=new Map,y=new WeakMap,h;function S(I,k){return h||(h=g()),h(I,k)}function C(){return h||(h=g()),h.getInitialState()}function R(I,k=!1){function _(G){let L=G[I];return typeof L>"u"&&k&&(L=Za(y,_,C)),L}function D(G=v){let L=Za(E,k,()=>new WeakMap);return Za(L,G,()=>{let j={};for(let[V,q]of Object.entries(n.selectors??{}))j[V]=oC(q,G,()=>Za(y,G,C),k);return j})}return{reducerPath:I,getSelectors:D,get selectors(){return D(_)},selectSlice:_}}let T={name:o,reducer:S,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:C,...R(i),injectInto(I,{reducerPath:k,..._}={}){let D=k??i;return I.inject({reducerPath:D,reducer:S},_),{...T,...R(D,!0)}}};return T}}function oC(e,t,r,n){function o(i,...a){let s=t(i);return typeof s>"u"&&n&&(s=r()),e(s,...a)}return o.unwrapped=e,o}var cn=nC();function iC(){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 aC({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!cC(n))throw new Error(mt(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?O(e,a):O(e))}function sC(e){return e._reducerDefinitionType==="asyncThunk"}function cC(e){return e._reducerDefinitionType==="reducerWithPrepare"}function uC({type:e,reducerName:t},r,n,o){if(!o)throw new Error(mt(18));let{payloadCreator:i,fulfilled:a,pending:s,rejected:c,settled:u,options:g}=r,v=o(e,i,g);n.exposeAction(t,v),a&&n.addCase(v.fulfilled,a),s&&n.addCase(v.pending,s),c&&n.addCase(v.rejected,c),u&&n.addMatcher(v.settled,u),n.exposeCaseReducer(t,{fulfilled:a||Ja,pending:s||Ja,rejected:c||Ja,settled:u||Ja})}function Ja(){}var lC="task",eg="listener",tg="completed",td="cancelled",dC=`task-${td}`,pC=`task-${tg}`,Jl=`${eg}-${td}`,fC=`${eg}-${tg}`,is=class{constructor(e){ae(this,"code");ae(this,"name","TaskAbortError");ae(this,"message");this.code=e,this.message=`${lC} ${td} (reason: ${e})`}},rd=(e,t)=>{if(typeof e!="function")throw new TypeError(mt(32))},es=()=>{},rg=(e,t=es)=>(e.catch(t),e),ng=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),an=e=>{if(e.aborted)throw new is(e.reason)};function og(e,t){let r=es;return new Promise((n,o)=>{let i=()=>o(new is(e.reason));if(e.aborted){i();return}r=ng(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=es})}var mC=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof is?"cancelled":"rejected",error:r}}finally{t?.()}});return function mC(_x5,_x6){return _ref5.apply(this,arguments)}}(),ts=e=>t=>rg(og(e,t).then(r=>(an(e),r))),ig=e=>{let t=ts(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Zn}=Object,Hm={},as="listenerMiddleware",gC=(e,t)=>{let r=n=>ng(e,()=>n.abort(e.reason));return(n,o)=>{rd(n,"taskExecutor");let i=new l.AbortController;r(i);let a=mC(/*#__PURE__*/_asyncToGenerator(function*(){an(e),an(i.signal);let s=yield n({pause:ts(i.signal),delay:ig(i.signal),signal:i.signal});return an(i.signal),s}),()=>i.abort(pC));return o?.autoJoin&&t.push(a.catch(es)),{result:ts(e)(a),cancel(){i.abort(dC)}}}},hC=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){an(t);let i=()=>{},s=[new Promise((c,u)=>{let g=e({predicate:n,effect:(v,E)=>{E.unsubscribe(),c([v,E.getState(),E.getOriginalState()])}});i=()=>{g(),u()}})];o!=null&&s.push(new Promise(c=>setTimeout(c,o,null)));try{let c=yield og(t,Promise.race(s));return an(t),c}finally{i()}});return function r(_x7,_x8){return _ref7.apply(this,arguments)}}();return(n,o)=>rg(r(n,o))},ag=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=O(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(mt(21));return rd(i,"options.listener"),{predicate:o,type:t,effect:i}},sg=Zn(e=>{let{type:t,predicate:r,effect:n}=ag(e);return{id:Ti(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(mt(22))}}},{withTypes:()=>sg}),zm=(e,t)=>{let{type:r,effect:n,predicate:o}=ag(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},ed=e=>{e.pending.forEach(t=>{t.abort(Jl)})},yC=(e,t)=>()=>{for(let r of t.keys())ed(r);e.clear()},Wm=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},cg=Zn(O(`${as}/add`),{withTypes:()=>cg}),vC=O(`${as}/removeAll`),ug=Zn(O(`${as}/remove`),{withTypes:()=>ug}),SC=(...e)=>{console.error(`${as}/error`,...e)},lg=(e={})=>{let t=new Map,r=new Map,n=y=>{let h=r.get(y)??0;r.set(y,h+1)},o=y=>{let h=r.get(y)??1;h===1?r.delete(y):r.set(y,h-1)},{extra:i,onError:a=SC}=e;rd(a,"onError");let s=y=>(y.unsubscribe=()=>t.delete(y.id),t.set(y.id,y),h=>{y.unsubscribe(),h?.cancelActive&&ed(y)}),c=y=>{let h=zm(t,y)??sg(y);return s(h)};Zn(c,{withTypes:()=>c});let u=y=>{let h=zm(t,y);return h&&(h.unsubscribe(),y.cancelActive&&ed(h)),!!h};Zn(u,{withTypes:()=>u});let g=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(y,h,S,C){let R=new l.AbortController,T=hC(c,R.signal),I=[];try{y.pending.add(R),n(y),yield Promise.resolve(y.effect(h,Zn({},S,{getOriginalState:C,condition:(k,_)=>T(k,_).then(Boolean),take:T,delay:ig(R.signal),pause:ts(R.signal),extra:i,signal:R.signal,fork:gC(R.signal,I),unsubscribe:y.unsubscribe,subscribe:()=>{t.set(y.id,y)},cancelActiveListeners:()=>{y.pending.forEach((k,_,D)=>{k!==R&&(k.abort(Jl),D.delete(k))})},cancel:()=>{R.abort(Jl),y.pending.delete(R)},throwIfCancelled:()=>{an(R.signal)}})))}catch(k){k instanceof is||Wm(a,k,{raisedBy:"effect"})}finally{yield Promise.all(I),R.abort(fC),o(y),y.pending.delete(R)}});return function g(_x9,_x0,_x1,_x10){return _ref8.apply(this,arguments)}}(),v=yC(t,r);return{middleware:y=>h=>S=>{if(!di(S))return h(S);if(cg.match(S))return c(S.payload);if(vC.match(S)){v();return}if(ug.match(S))return u(S.payload);let C=y.getState(),R=()=>{if(C===Hm)throw new Error(mt(23));return C},T;try{if(T=h(S),t.size>0){let I=y.getState(),k=Array.from(t.values());for(let _ of k){let D=!1;try{D=_.predicate(S,I,C)}catch(G){D=!1,Wm(a,G,{raisedBy:"predicate"})}D&&g(_,S,y,R)}}}finally{C=Hm}return T},startListening:c,stopListening:u,clearListeners:v}};function mt(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. `}m();d();f();p();var Y=new z({required:!0,emptyAllowed:!1}),rt=new z({required:!1,emptyAllowed:!1}),nt=new z({required:!0,emptyAllowed:!0}),Nq=new z({required:!1,emptyAllowed:!0}),ss=new ve({each:Y,required:!0}),dg=new z({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),pg=new z({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Fq=new z({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),ur=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Tt=(e,t)=>{if("required"in t)return{payload:new ht({value:t}).validate({value:e}).value};let o=new ne({options:{required:!0},values:t}).validate(e);if(o)throw new ii(o);return{payload:e}},B=(e,t)=>{try{return Tt(e,t)}catch(r){return{payload:e,error:ur(r)}}},fg=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return gg(e,t,r,o,"Controller initialization error")},mg=(e,t,r,n)=>{let o=`Check the options of ${n}`;return gg(e,t,r,o,"Controller initialization error")},gg=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};m();d();f();p();var to="3.55.2",hg=["@coveo/atomic","@coveo/quantic"];var nd=()=>rt,yg=()=>Y,Er=O("configuration/updateBasicConfiguration",e=>B(e,{accessToken:rt,environment:new z({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:rt})),Wt=O("configuration/updateSearchConfiguration",e=>B(e,{proxyBaseUrl:new z({required:!1,url:!0}),pipeline:new z({required:!1,emptyAllowed:!0}),searchHub:rt,timezone:rt,locale:rt,authenticationProviders:new ve({required:!1,each:Y})})),bC={enabled:new fe({default:!0}),originContext:nd(),originLevel2:nd(),originLevel3:nd(),proxyBaseUrl:new z({required:!1,url:!0}),runtimeEnvironment:new De,anonymous:new fe({default:!1}),deviceId:rt,userDisplayName:rt,documentLocation:rt,trackingId:pg,analyticsMode:new z({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new ne({options:{required:!1},values:hg.reduce((e,t)=>(e[t]=dg,e),{})})},ro=O("configuration/updateAnalyticsConfiguration",e=>B(e,bC)),no=O("configuration/analytics/disable"),oo=O("configuration/analytics/enable"),cs=O("configuration/analytics/originlevel2",e=>B(e,{originLevel2:yg()})),us=O("configuration/analytics/originlevel3",e=>B(e,{originLevel3:yg()})),vg=O("knowledge/setAgentId",e=>B(e,new z({required:!0})));m();d();f();p();m();d();f();p();m();d();f();p();var Sg={q:new z,enableQuerySyntax:new fe,aq:new z,cq:new z,firstResult:new oe({min:0}),numberOfResults:new oe({min:0}),sortCriteria:new z,f:new ne,fExcluded:new ne,cf:new ne,nf:new ne,mnf:new ne,df:new ne,debug:new fe,sf:new ne,tab:new z,af:new ne};var Rr=O("searchParameters/restore",e=>B(e,Sg)),bg=O("searchParameters/restoreTab",e=>B(e,Y));m();d();f();p();var ls=O("debug/enable"),ds=O("debug/disable");m();d();f();p();var ps=()=>!1;var fs=Be(ps(),e=>{e.addCase(ls,()=>!0).addCase(ds,()=>!1).addCase(Rr,(t,r)=>r.payload.debug??t)});m();d();f();p();var io=O("pipeline/set",e=>B(e,new z({required:!0,emptyAllowed:!0})));m();d();f();p();m();d();f();p();var wC=O("history/undo"),AC=O("history/redo"),Kt=O("history/snapshot"),Gj=Ie("history/back",/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(e,{dispatch:t}){t(wC()),yield t(vt())});return function(_x11,_x12){return _ref9.apply(this,arguments)}}()),$j=Ie("history/forward",/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(e,{dispatch:t}){t(AC()),yield t(vt())});return function(_x13,_x14){return _ref0.apply(this,arguments)}}()),vt=Ie("history/change",/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x15,_x16){return _ref1.apply(this,arguments)}}());m();d();f();p();var Ir=()=>"";var ao=Be(Ir(),e=>{e.addCase(io,(t,r)=>r.payload).addCase(vt.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Wt,(t,r)=>r.payload.pipeline||t)});m();d();f();p();m();d();f();p();var ms=O("app/setError");m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();function xC(){return typeof navigator<"u"}function wg(){try{return typeof localStorage<"u"}catch{return!1}}function Ag(){try{return typeof sessionStorage<"u"}catch{return!1}}function xg(){return xC()&&navigator.cookieEnabled}m();d();f();p();var so=class e{static set(t,r,n){var o,i,a,s;n&&(i=new Date,i.setTime(i.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?Cg(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],Cg(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Cg(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}function Eg(){return wg()?localStorage:xg()?new gs:Ag()?sessionStorage:new od}var gs=class e{getItem(t){return so.get(`${e.prefix}${t}`)}removeItem(t){so.erase(`${e.prefix}${t}`)}setItem(t,r,n){so.set(`${e.prefix}${t}`,r,n)}};gs.prefix="coveo_";var od=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var hs="__coveo.analytics.history",CC=20,EC=1e3*60,RC=75,ys=class{constructor(t){this.store=t||Eg()}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(hs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(hs);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(hs,JSON.stringify(t.slice(0,CC)))}catch{}}clear(){try{this.store.removeItem(hs)}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,RC)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>EC:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}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 un=class un extends ys{static getInstance(t){return un.instance||(un.instance=new un(t)),un.instance}constructor(t){super(t)}};ae(un,"instance",null);var gt=un;m();d();f();p();m();d();f();p();var co=$e(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${to}`));m();d();f();p();m();d();f();p();function lr(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function U(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(g){try{u(n.next(g))}catch(v){a(v)}}function c(g){try{u(n.throw(g))}catch(v){a(v)}}function u(g){g.done?i(g.value):o(g.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}var Ae;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Ae||(Ae={}));function sd(){return typeof window<"u"}function bd(){return typeof navigator<"u"}function uo(){return typeof document<"u"}function cd(){try{return typeof localStorage<"u"}catch{return!1}}function IC(){try{return typeof sessionStorage<"u"}catch{return!1}}function jg(){return bd()&&navigator.cookieEnabled}var TC=[Ae.click,Ae.custom,Ae.search,Ae.view],_C=(e,t)=>TC.indexOf(e)!==-1?Object.assign({language:uo()?document.documentElement.lang:"unknown",userAgent:bd()?navigator.userAgent:"unknown"},t):t,ki=class e{static set(t,r,n){var o,i,a,s;n&&(i=new Date,i.setTime(i.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?Rg(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],Rg(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Rg(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}function kC(){return cd()?localStorage:jg()?new Oi:IC()?sessionStorage:new po}var Oi=class e{getItem(t){return ki.get(`${e.prefix}${t}`)}removeItem(t){ki.erase(`${e.prefix}${t}`)}setItem(t,r,n){ki.set(`${e.prefix}${t}`,r,n)}};Oi.prefix="coveo_";var ud=class{constructor(){this.cookieStorage=new Oi}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)}},po=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},vs="__coveo.analytics.history",OC=20,PC=1e3*60,NC=75,bs=class{constructor(t){this.store=t||kC()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return U(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return U(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(vs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return U(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(vs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(vs,JSON.stringify(t.slice(0,OC)))}catch{}}clear(){try{this.store.removeItem(vs)}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,NC)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>PC:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}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 FC=(e,t)=>U(void 0,void 0,void 0,function*(){return e===Ae.view?(yield DC(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),DC=e=>U(void 0,void 0,void 0,function*(){let t=new bs,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),MC=/^(?:[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 ws(e){return typeof e=="string"&&MC.test(e)}function Ig(e){if(!ws(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 ot=[];for(let e=0;e<256;++e)ot.push((e+256).toString(16).slice(1));function Lg(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()}var qC=new Uint8Array(16);function jC(){return crypto.getRandomValues(qC)}function LC(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 UC="6ba7b810-9dad-11d1-80b4-00c04fd430c8",VC="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function BC(e,t,r,n,o,i){let a=typeof r=="string"?LC(r):r,s=typeof n=="string"?Ig(n):n;if(typeof n=="string"&&(n=Ig(n)),n?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+a.length);return c.set(s),c.set(a,s.length),c=t(c),c[6]=c[6]&15|e,c[8]=c[8]&63|128,Lg(c)}function ln(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():GC(e,t,r)}function GC(e,t,r){e=e||{};let n=e.random??e.rng?.()??jC();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 Lg(n)}function $C(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 id(e,t){return e<<t|e>>>32-t}function QC(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,i=Math.ceil(o/16),a=new Array(i);for(let s=0;s<i;++s){let c=new Uint32Array(16);for(let u=0;u<16;++u)c[u]=e[s*64+u*4]<<24|e[s*64+u*4+1]<<16|e[s*64+u*4+2]<<8|e[s*64+u*4+3];a[s]=c}a[i-1][14]=(e.length-1)*8/2**32,a[i-1][14]=Math.floor(a[i-1][14]),a[i-1][15]=(e.length-1)*8&4294967295;for(let s=0;s<i;++s){let c=new Uint32Array(80);for(let h=0;h<16;++h)c[h]=a[s][h];for(let h=16;h<80;++h)c[h]=id(c[h-3]^c[h-8]^c[h-14]^c[h-16],1);let u=r[0],g=r[1],v=r[2],E=r[3],y=r[4];for(let h=0;h<80;++h){let S=Math.floor(h/20),C=id(u,5)+$C(S,g,v,E)+y+t[S]+c[h]>>>0;y=E,E=v,v=id(g,30)>>>0,g=u,u=C}r[0]=r[0]+u>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+v>>>0,r[3]=r[3]+E>>>0,r[4]=r[4]+y>>>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 As(e,t,r,n){return BC(80,QC,e,t)}As.DNS=UC;As.URL=VC;var Ug="2.33.0",Tg=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,_i={pageview:"pageview",event:"event"},xs=class{constructor({client:t,uuidGenerator:r=ln}){this.client=t,this.uuidGenerator=r}},ld=class extends xs{constructor({client:t,uuidGenerator:r=ln}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Tg(window.location),this.lastReferrer=uo()?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:uo()?document.title:"",encoding:uo()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===_i.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===_i.pageview?this.nextPageViewId:this.pageViewId,referrer:t===_i.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===_i.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 Tg(window.location)}},Tr=class e{constructor(t,r){if(!ws(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 i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return ws(i)?new e(i,Number.parseInt(o)*1e3):null}};Tr.cvo_cid="cvo_cid";Tr.expirationTime=120;var dd=class extends xs{constructor({client:t,uuidGenerator:r=ln}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return U(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(Tr.cvo_cid,new Tr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};dd.Id="link";var kt=Object.keys;function Ss(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var ad=128,Vg=192,_g=224,kg=240;function HC(e){return(e&248)===kg?4:(e&kg)===_g?3:(e&_g)===Vg?2:1}function zC(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&ad)!=ad)break;if(r-=3,(n&Vg)!=ad){t-r>=HC(n)*3&&(r=t);break}}return e.substring(0,r)}var pd={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"},WC=kt(pd).map(e=>pd[e]),KC=[...WC].join("|"),YC=new RegExp(`^(${KC}$)`),XC={svcAction:"svc_action",svcActionData:"svc_action_data"},ZC=e=>kt(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=pd[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),JC=e=>YC.test(e),eE=[JC],Og={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Pg={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},lt={action:"pa",list:"pal",listSource:"pls"},Cs={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},tE=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],fd={id:"quoteId",affiliation:"quoteAffiliation"},md={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},rE={add:lt,bookmark_add:lt,bookmark_remove:lt,click:lt,checkout:lt,checkout_option:lt,detail:lt,impression:lt,remove:lt,refund:Object.assign(Object.assign({},lt),Cs),purchase:Object.assign(Object.assign({},lt),Cs),quickview:lt,quote:Object.assign(Object.assign({},lt),fd),review:Object.assign(Object.assign({},lt),md)},nE=kt(Og).map(e=>Og[e]),oE=kt(Pg).map(e=>Pg[e]),iE=kt(lt).map(e=>lt[e]),aE=kt(Cs).map(e=>Cs[e]),sE=kt(md).map(e=>md[e]),cE=kt(fd).map(e=>fd[e]),uE=[...nE,"custom"].join("|"),lE=[...oE,"custom"].join("|"),Bg="(pr[0-9]+)",Gg="(il[0-9]+pi[0-9]+)",dE=new RegExp(`^${Bg}(${uE})$`),pE=new RegExp(`^(${Gg}(${lE}))|(il[0-9]+nm)$`),fE=new RegExp(`^(${iE.join("|")})$`),mE=new RegExp(`^(${aE.join("|")})$`),gE=new RegExp(`^${Bg}custom$`),hE=new RegExp(`^${Gg}custom$`),yE=new RegExp(`^(${[...tE,...sE,...cE].join("|")})$`),vE=e=>dE.test(e),SE=e=>pE.test(e),bE=e=>fE.test(e),wE=e=>mE.test(e),AE=e=>yE.test(e),xE=[SE,vE,bE,wE,AE],CE=[gE,hE],EE={anonymizeIp:"aip"},RE={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},IE={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},TE=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],_E=Object.assign(Object.assign(Object.assign(Object.assign({},EE),RE),IE),TE.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),gd=Object.assign(Object.assign({},_E),XC),kE=e=>{let t=!!e.action&&rE[e.action]||{};return kt(e).reduce((r,n)=>{let o=t[n]||gd[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},OE=kt(gd).map(e=>gd[e]),PE=e=>OE.indexOf(e)!==-1,NE=e=>e==="custom",FE=e=>[...xE,...eE,PE,NE].some(t=>t(e)),DE=e=>kt(e).reduce((t,r)=>{let n=ME(r);return n?Object.assign(Object.assign({},t),qE(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),ME=e=>{let t;return[...CE].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},qE=(e,t)=>kt(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),hd=class{constructor(t){this.opts=t}sendEvent(t,r){return U(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:s}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),c=this.encodeForEventType(t,s),u=new Blob([c],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,u)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return U(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:s,body:c}=a;o=s||t;try{i=JSON.parse(c)}catch(u){console.error("Unable to process the request body as a JSON string",u)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return U(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[Ae.click,Ae.custom,Ae.search,Ae.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}},yd=class{sendEvent(t,r){return U(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return U(this,void 0,void 0,function*(){return Promise.resolve()})}},Ng=b.fetch,Es=class{constructor(t){this.opts=t}sendEvent(t,r){return U(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},c=Object.assign(Object.assign({},s),i?yield i(s,"analyticsFetch"):{}),{url:u}=c,g=lr(c,["url"]),v;try{v=yield Ng(u,g)}catch(E){console.error("An error has occurred when sending the event.",E);return}if(v.ok){let E=yield v.json();return E.visitorId&&o.setCurrentVisitorId(E.visitorId),E}else{try{v.json()}catch{}throw console.error(`An error has occurred when sending the "${t}" event.`,v,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return U(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Ng(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Ae.click,Ae.custom,Ae.search,Ae.view].indexOf(t)!==-1}getVisitorIdParam(){return U(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},vd=class{constructor(t,r){cd()&&jg()?this.storage=new ud:cd()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new po),this.client=new Es(t),this.beaconClient=new hd(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Sd=class{constructor(t,r){this.storage=r||new po,this.client=new Es(t)}getClientDependingOnEventType(t){return this.client}},Rs=class{constructor(){this.storage=new po,this.client=new yd}getClientDependingOnEventType(t){return this.client}},jE="xx",LE=e=>e?.startsWith(jE)||!1,UE=`
27
+ `;return new si(r)}var si=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},ht=class{constructor(e){ae(this,"definition");this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw IA(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}},De=class{constructor(e={}){ae(this,"baseConfig");this.baseConfig=e}validate(e){return this.baseConfig.required&&se(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 Je(e){return e===void 0}function TA(e){return e===null}function se(e){return Je(e)||TA(e)}var fe=class{constructor(e={}){ae(this,"value");this.value=new De(e)}validate(e){let t=this.value.validate(e);return t||(_A(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function _A(e){return Je(e)||Kf(e)}function Kf(e){return typeof e=="boolean"}var oe=class{constructor(e={}){ae(this,"config");ae(this,"value");this.config=e,this.value=new De(e)}validate(e){let t=this.value.validate(e);return t||(kA(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 kA(e){return Je(e)||Yf(e)}function Yf(e){return typeof e=="number"&&!Number.isNaN(e)}var OA=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,z=class{constructor(e={}){ae(this,"value");ae(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new De(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(Je(e))return null;if(!_a(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(", ")}.`:i&&!(OA.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 _a(e){return Object.prototype.toString.call(e)==="[object String]"}var ne=class{constructor(e={}){ae(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Je(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Xf(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&se(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Xf(e){return e!==void 0&&typeof e=="object"}var Se=class{constructor(e={}){ae(this,"config");ae(this,"value");this.config=e,this.value=new De(this.config)}validate(e){if(!se(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(se(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&&se(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 Kf(e)||_a(e)||Yf(e)||Xf(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Zf(e){return Array.isArray(e)}var Il=class{constructor(e){ae(this,"config");ae(this,"value");this.config=e,this.value=new De(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Je(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}};m();d();f();p();function Jf(e){return Array.isArray(e)}function ka(e){return e.trim()===""}var PA=new Set(["1",1,"yes",!0]);function Tl(){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=>PA.has(r))}function em(e){let t={};for(let[r,n]of e)t[r]=n;return t}function ci(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Oa(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function NA(e){if(ka(e.openingDelimiter)||ka(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(se(e.content)||ka(e.content))return e.content;if(e.highlights.length===0)return zn(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,s=a+i.length;if(s>t)break;r+=zn(e.content.slice(n,a)),r+=e.openingDelimiter,r+=zn(e.content.slice(a,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=zn(e.content.slice(n))),r}function FA(e,t){return e=zn(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?_l(n,t.notMatchDelimiters):o?_l(o,t.exactMatchDelimiters):i?_l(i,t.correctionDelimiters):r)}function _l(e,t){return t?t.open+e+t.close:e}function zn(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;","\"":"&quot;","'":"&#x27;","`":"&#x60;"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}m();d();f();p();var pm=qt(cm(),1);m();d();f();p();var $t=new Error("Failed to load reducers."),Wn=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."}},Jr=class extends Error{constructor(r,n){super();ae(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};m();d();f();p();function um(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function lm(e){return typeof e!="object"||!e?!1:Object.values(e).every(ax)}function ax(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function dm(e){return e===429}var jt=class e{static call(t){return _asyncToGenerator(function*(){let r=sx(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,s=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let c=yield A(i,a);if(dm(c.status))throw c;return c});return function s(){return _ref.apply(this,arguments)}}();try{let c=yield(0,pm.backOff)(s,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(u){let h=u&&dm(u.status);return h&&(n.info("Platform retrying request"),yield new Promise(v=>setTimeout(v,1e3))),h});return function retry(_x2){return _ref2.apply(this,arguments)}}()});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new Wn;case 404:throw new Jr(i,c.status);default:return n.info({response:c,requestInfo:o},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new Jr(i):c}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:s,...c}=t,u=ci(c);try{let h=yield o(t,n,a);return{...t,...h}}catch(h){i.error(h,"Platform request preprocessing failed. Returning default request options.")}return u})()}};function It(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function Kn(e,t,r="prod"){return e??It(t,r)}function wr(e,t="prod"){return`${It(e,t)}/rest/search/v2`}function Na(e,t="prod"){return`${It(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function sx(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,s=e.method==="POST"||e.method==="PUT",c=cx(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(s&&{body:c}),signal:a}}function cx(e,t){return t==="application/x-www-form-urlencoded"?lm(e)?um(e):"":JSON.stringify(e)}m();d();f();p();m();d();f();p();var Fa=e=>e;m();d();f();p();m();d();f();p();function Da(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Qt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Da(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Da(),extendedResults:{},searchAction:void 0}}m();d();f();p();function Ar(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var xr=e=>{let{response:t}=e;return t.body?ux(e):lx(t)},ux=e=>px(e)?fx(e):dx(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},lx=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function dx(e){return e.body.statusCode!==void 0}function px(e){return e.body.exception!==void 0}var fx=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});m();d();f();p();var Cr=class{constructor(){ae(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new l.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)}})()}};m();d();f();p();m();d();f();p();var di=class{constructor(t){ae(this,"_basePath");ae(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}};m();d();f();p();function fm(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}m();d();f();p();var ir=(e,t,r,n)=>{let o=new di(`${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 mm=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield jt.call({...ir(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:Ar(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=fm(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return mx(a)?{success:a}:{error:xr({response:r,body:a})}});return function mm(_x3,_x4){return _ref3.apply(this,arguments)}}();function mx(e){return typeof e=="string"}m();d();f();p();function gx(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function hx(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Ma(e,t){if(t&&e.name==="AbortError")return{error:hx(e)};if(e instanceof Jr)return{error:gx(e)};throw e}var qa=class{constructor(t){ae(this,"options",t);ae(this,"apiCallsQueues",{unknown:new Cr,mainSearch:new Cr,facetValues:new Cr,foldingCollection:new Cr,instantResults:new Cr})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield jt.call({...ir(t,"POST","application/json","/plan"),requestParams:Ar(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Ma(r);let n=yield r.json();return vx(n)?{success:n}:{error:xr({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield jt.call({...ir(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:Ar(t),..._this3.options});if(r instanceof Error)return Ma(r);let n=yield r.json(),o={response:r,body:n};return yx(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:xr(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(s=>jt.call({...ir(t,"POST","application/json",""),requestParams:Ar(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:s??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Ma(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return gm(i)?(a.body=hm(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:xr(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield jt.call({...ir(t,"POST","application/json","/facet"),requestParams:Ar(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 jt.call({...ir(t,"POST","application/json",""),requestParams:Ar(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(gm(n)){let o={response:r,body:n};return o.body=hm(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:xr({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return mm(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield jt.call({...ir(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return Sx(n)?{success:n}:{error:xr({response:r,body:n})}})()}},ja=e=>e.success!==void 0,yt=e=>e.error!==void 0;function gm(e){return e.results!==void 0}function hm(e){let t=Da();return se(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function yx(e){return e.completions!==void 0}function vx(e){return e.preprocessingOutput!==void 0}function Sx(e){return e.fields!==void 0}m();d();f();p();var ym=e=>e,vm=e=>e,Sm=e=>e;m();d();f();p();m();d();f();p();m();d();f();p();function et(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var bx=typeof Symbol=="function"&&Symbol.observable||"@@observable",bm=bx,Ll=()=>Math.random().toString(36).substring(7).split("").join("."),wx={INIT:`@@redux/INIT${Ll()}`,REPLACE:`@@redux/REPLACE${Ll()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Ll()}`},La=wx;function Ht(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 Ul(e,t,r){if(typeof e!="function")throw new Error(et(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(et(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(et(1));return r(Ul)(e,t)}let n=e,o=t,i=new Map,a=i,s=0,c=!1;function u(){a===i&&(a=new Map,i.forEach((E,R)=>{a.set(R,E)}))}function h(){if(c)throw new Error(et(3));return o}function v(E){if(typeof E!="function")throw new Error(et(4));if(c)throw new Error(et(5));let R=!0;u();let k=s++;return a.set(k,E),function(){if(R){if(c)throw new Error(et(6));R=!1,u(),a.delete(k),i=null}}}function C(E){if(!Ht(E))throw new Error(et(7));if(typeof E.type>"u")throw new Error(et(8));if(typeof E.type!="string")throw new Error(et(17));if(c)throw new Error(et(9));try{c=!0,o=n(o,E)}finally{c=!1}return(i=a).forEach(k=>{k()}),E}function g(E){if(typeof E!="function")throw new Error(et(10));n=E,C({type:La.REPLACE})}function y(){let E=v;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(et(11));function k(){let T=R;T.next&&T.next(h())}return k(),{unsubscribe:E(k)}},[bm](){return this}}}return C({type:La.INIT}),{dispatch:C,subscribe:v,getState:h,replaceReducer:g,[bm]:y}}function Ax(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:La.INIT})>"u")throw new Error(et(12));if(typeof r(void 0,{type:La.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(et(13))})}function Yn(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let s=t[a];typeof e[s]=="function"&&(r[s]=e[s])}let n=Object.keys(r),o,i;try{Ax(r)}catch(a){i=a}return function(s={},c){if(i)throw i;let u=!1,h={};for(let v=0;v<n.length;v++){let C=n[v],g=r[C],y=s[C],S=g(y,c);if(typeof S>"u"){let E=c&&c.type;throw new Error(et(14))}h[C]=S,u=u||S!==y}return u=u||n.length!==Object.keys(s).length,u?h:s}}function pi(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function wm(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(et(15))},a={getState:o.getState,dispatch:(c,...u)=>i(c,...u)},s=e.map(c=>c(a));return i=pi(...s)(o.dispatch),{...o,dispatch:i}}}function fi(e){return Ht(e)&&"type"in e&&typeof e.type=="string"}m();d();f();p();var Kl=Symbol.for("immer-nothing"),mi=Symbol.for("immer-draftable"),We=Symbol.for("immer-state");function tt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var xt=Object,tn=xt.getPrototypeOf,gi="constructor",bi="prototype",Gl="configurable",Ga="enumerable",Va="writable",hi="value",ft=e=>!!e&&!!e[We];function ut(e){return e?_m(e)||Ai(e)||!!e[mi]||!!e[gi]?.[mi]||xi(e)||Ci(e):!1}var xx=xt[bi][gi].toString(),Am=new WeakMap;function _m(e){if(!e||!Zn(e))return!1;let t=tn(e);if(t===null||t===xt[bi])return!0;let r=xt.hasOwnProperty.call(t,gi)&&t[gi];if(r===Object)return!0;if(!en(r))return!1;let n=Am.get(r);return n===void 0&&(n=Function.toString.call(r),Am.set(r,n)),n===xx}function km(e){return ft(e)||tt(15,e),e[We].base_}function wi(e,t,r=!0){rn(e)===0?(r?Reflect.ownKeys(e):xt.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function rn(e){let t=e[We];return t?t.type_:Ai(e)?1:xi(e)?2:Ci(e)?3:0}var Xn=(e,t,r=rn(e))=>r===2?e.has(t):xt[bi].hasOwnProperty.call(e,t),ar=(e,t,r=rn(e))=>r===2?e.get(t):e[t],$a=(e,t,r,n=rn(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function Cx(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Ai=Array.isArray,xi=e=>e instanceof Map,Ci=e=>e instanceof Set,Zn=e=>typeof e=="object",en=e=>typeof e=="function",Vl=e=>typeof e=="boolean";function Ex(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Rx=e=>Zn(e)?e?.[We]:null,sr=e=>e.copy_||e.base_;var Yl=e=>e.modified_?e.copy_:e.base_;function $l(e,t){if(xi(e))return new Map(e);if(Ci(e))return new Set(e);if(Ai(e))return Array[bi].slice.call(e);let r=_m(e);if(t===!0||t==="class_only"&&!r){let n=xt.getOwnPropertyDescriptors(e);delete n[We];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],s=n[a];s[Va]===!1&&(s[Va]=!0,s[Gl]=!0),(s.get||s.set)&&(n[a]={[Gl]:!0,[Va]:!0,[Ga]:s[Ga],[hi]:e[a]})}return xt.create(tn(e),n)}else{let n=tn(e);if(n!==null&&r)return{...e};let o=xt.create(n);return xt.assign(o,e)}}function Xl(e,t=!1){return Ya(e)||ft(e)||!ut(e)||(rn(e)>1&&xt.defineProperties(e,{set:Ua,add:Ua,clear:Ua,delete:Ua}),xt.freeze(e),t&&wi(e,(r,n)=>{Xl(n,!0)},!1)),e}function Ix(){tt(2)}var Ua={[hi]:Ix};function Ya(e){return e===null||!Zn(e)?!0:xt.isFrozen(e)}var Qa="MapSet",Ha="Patches",xm="ArrayMethods",za={};function nn(e){let t=za[e];return t||tt(0,e),t}var Cm=e=>!!za[e];function Tx(e,t){za[e]||(za[e]=t)}var yi,Om=()=>yi,_x=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Cm(Qa)?nn(Qa):void 0,arrayMethodsPlugin_:Cm(xm)?nn(xm):void 0});function Em(e,t){t&&(e.patchPlugin_=nn(Ha),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ql(e){Hl(e),e.drafts_.forEach(kx),e.drafts_=null}function Hl(e){e===yi&&(yi=e.parent_)}var Rm=e=>yi=_x(yi,e);function kx(e){let t=e[We];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Im(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[We].modified_&&(Ql(t),tt(4)),ut(e)&&(e=Tm(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[We].base_,e,t)}else e=Tm(t,r);return Ox(t,e,!0),Ql(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Kl?e:void 0}function Tm(e,t){if(Ya(t))return t;let r=t[We];if(!r)return Wa(t,e.handledSet_,e);if(!Xa(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);Fm(r,e)}return r.copy_}function Ox(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Xl(t,r)}function Pm(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Xa=(e,t)=>e.scope_===t,Px=[];function Nm(e,t,r,n){let o=sr(e),i=e.type_;if(n!==void 0&&ar(o,n,i)===t){$a(o,n,r,i);return}if(!e.draftLocations_){let s=e.draftLocations_=new Map;wi(o,(c,u)=>{if(ft(u)){let h=s.get(u)||[];h.push(c),s.set(u,h)}})}let a=e.draftLocations_.get(t)??Px;for(let s of a)$a(o,s,r,i)}function Nx(e,t,r){e.callbacks_.push(function(o){let i=t;if(!i||!Xa(i,o))return;o.mapSetPlugin_?.fixSetContents(i);let a=Yl(i);Nm(e,i.draft_??i,a,r),Fm(i,o)})}function Fm(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)}Pm(e)}}function Fx(e,t,r){let{scope_:n}=e;if(ft(r)){let o=r[We];Xa(o,n)&&o.callbacks_.push(function(){Ba(e);let a=Yl(o);Nm(e,r,a,t)})}else ut(r)&&e.callbacks_.push(function(){let i=sr(e);e.type_===3?i.has(r)&&Wa(r,n.handledSet_,n):ar(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Wa(ar(e.copy_,t,e.type_),n.handledSet_,n)})}function Wa(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||ft(e)||t.has(e)||!ut(e)||Ya(e)||(t.add(e),wi(e,(n,o)=>{if(ft(o)){let i=o[We];if(Xa(i,r)){let a=Yl(i);$a(e,n,a,e.type_),Pm(i)}}else ut(o)&&Wa(o,t,r)})),e}function Dx(e,t){let r=Ai(e),n={type_:r?1:0,scope_:t?t.scope_:Om(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,i=Ka;r&&(o=[n],i=vi);let{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,[s,n]}var Ka={get(e,t){if(t===We)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=sr(e);if(!Xn(o,t,e.type_))return qx(e,o,t);let i=o[t];if(e.finalized_||!ut(i)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&Ex(t))return i;if(i===Bl(e.base_,t)||Mx(e,t,i)){Ba(e);let a=e.type_===1?+t:t,s=Wl(e.scope_,i,e,a);return e.copy_[a]=s}return i},has(e,t){return t in sr(e)},ownKeys(e){return Reflect.ownKeys(sr(e))},set(e,t,r){let n=Dm(sr(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Bl(sr(e),t),i=o?.[We];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(Cx(r,o)&&(r!==void 0||Xn(e.base_,t,e.type_)))return!0;Ba(e),zl(e)}return e.copy_[t]===r&&(r!==void 0||Xn(e.copy_,t,e.type_))||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),Fx(e,t,r)),!0},deleteProperty(e,t){return Ba(e),Bl(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),zl(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=sr(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Va]:!0,[Gl]:e.type_!==1||t!=="length",[Ga]:n[Ga],[hi]:r[t]}},defineProperty(){tt(11)},getPrototypeOf(e){return tn(e.base_)},setPrototypeOf(){tt(12)}},vi={};for(let e in Ka){let t=Ka[e];vi[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}vi.deleteProperty=function(e,t){return vi.set.call(this,e,t,void 0)};vi.set=function(e,t,r){return Ka.set.call(this,e[0],t,r,e[0])};function Bl(e,t){let r=e[We];return(r?sr(r):e)[t]}function Mx(e,t,r){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!ut(r)||r[We]?!1:e.baseRefs_.has(r)}function qx(e,t,r){let n=Dm(t,r);return n?hi in n?n[hi]:n.get?.call(e.draft_):void 0}function Dm(e,t){if(!(t in e))return;let r=tn(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=tn(r)}}function zl(e){e.modified_||(e.modified_=!0,e.parent_&&zl(e.parent_))}function Ba(e){e.copy_||(e.assigned_=new Map,e.copy_=$l(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var jx=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(en(t)&&!en(r)){let i=r;r=t;let a=this;return function(c=i,...u){return a.produce(c,h=>r.call(this,h,...u))}}en(r)||tt(6),n!==void 0&&!en(n)&&tt(7);let o;if(ut(t)){let i=Rm(this),a=Wl(i,t,void 0),s=!0;try{o=r(a),s=!1}finally{s?Ql(i):Hl(i)}return Em(i,n),Im(o,i)}else if(!t||!Zn(t)){if(o=r(t),o===void 0&&(o=t),o===Kl&&(o=void 0),this.autoFreeze_&&Xl(o,!0),n){let i=[],a=[];nn(Ha).generateReplacementPatches_(t,o,{patches_:i,inversePatches_:a}),n(i,a)}return o}else tt(1,t)},this.produceWithPatches=(t,r)=>{if(en(t))return(a,...s)=>this.produceWithPatches(a,c=>t(c,...s));let n,o;return[this.produce(t,r,(a,s)=>{n=a,o=s}),n,o]},Vl(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Vl(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Vl(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ut(e)||tt(8),ft(e)&&(e=Za(e));let t=Rm(this),r=Wl(t,e,void 0);return r[We].isManual_=!0,Hl(t),r}finishDraft(e,t){let r=e&&e[We];(!r||!r.isManual_)&&tt(9);let{scope_:n}=r;return Em(n,t),Im(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=nn(Ha).applyPatches_;return ft(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Wl(e,t,r,n){let[o,i]=xi(t)?nn(Qa).proxyMap_(t,r):Ci(t)?nn(Qa).proxySet_(t,r):Dx(t,r);return(r?.scope_??Om()).drafts_.push(o),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?Nx(r,i,n):i.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:u}=c;i.modified_&&u&&u.generatePatches_(i,[],c)}),o}function Za(e){return ft(e)||tt(10,e),Mm(e)}function Mm(e){if(!ut(e)||Ya(e))return e;let t=e[We],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=$l(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=$l(e,!0);return wi(r,(o,i)=>{$a(r,o,Mm(i))},n),t&&(t.finalized_=!1),r}function qm(){function t(y,S=[]){if(y.key_!==void 0){let E=y.parent_.copy_??y.parent_.base_,R=Rx(ar(E,y.key_)),k=ar(E,y.key_);if(k===void 0||k!==y.draft_&&k!==y.base_&&k!==y.copy_||R!=null&&R.base_!==y.base_)return null;let I=y.parent_.type_===3,T;if(I){let _=y.parent_;T=Array.from(_.drafts_.keys()).indexOf(y.key_)}else T=y.key_;if(!(I&&E.size>T||Xn(E,T)))return null;S.push(T)}if(y.parent_)return t(y.parent_,S);S.reverse();try{r(y.copy_,S)}catch{return null}return S}function r(y,S){let E=y;for(let R=0;R<S.length-1;R++){let k=S[R];if(E=ar(E,k),!Zn(E)||E===null)throw new Error(`Cannot resolve path at '${S.join("/")}'`)}return E}let n="replace",o="add",i="remove";function a(y,S,E){if(y.scope_.processedForPatches_.has(y))return;y.scope_.processedForPatches_.add(y);let{patches_:R,inversePatches_:k}=E;switch(y.type_){case 0:case 2:return c(y,S,R,k);case 1:return s(y,S,R,k);case 3:return u(y,S,R,k)}}function s(y,S,E,R){let{base_:k,assigned_:I}=y,T=y.copy_;T.length<k.length&&([k,T]=[T,k],[E,R]=[R,E]);let _=y.allIndicesReassigned_===!0;for(let D=0;D<k.length;D++){let G=T[D],V=k[D];if((_||I?.get(D.toString()))&&G!==V){let L=G?.[We];if(L&&L.modified_)continue;let q=S.concat([D]);E.push({op:n,path:q,value:g(G)}),R.push({op:n,path:q,value:g(V)})}}for(let D=k.length;D<T.length;D++){let G=S.concat([D]);E.push({op:o,path:G,value:g(T[D])})}for(let D=T.length-1;k.length<=D;--D){let G=S.concat([D]);R.push({op:i,path:G})}}function c(y,S,E,R){let{base_:k,copy_:I,type_:T}=y;wi(y.assigned_,(_,D)=>{let G=ar(k,_,T),V=ar(I,_,T),j=D?Xn(k,_)?n:o:i;if(G===V&&j===n)return;let L=S.concat(_);E.push(j===i?{op:j,path:L}:{op:j,path:L,value:g(V)}),R.push(j===o?{op:i,path:L}:j===i?{op:o,path:L,value:g(G)}:{op:n,path:L,value:g(G)})})}function u(y,S,E,R){let{base_:k,copy_:I}=y,T=0;k.forEach(_=>{if(!I.has(_)){let D=S.concat([T]);E.push({op:i,path:D,value:_}),R.unshift({op:o,path:D,value:_})}T++}),T=0,I.forEach(_=>{if(!k.has(_)){let D=S.concat([T]);E.push({op:o,path:D,value:_}),R.unshift({op:i,path:D,value:_})}T++})}function h(y,S,E){let{patches_:R,inversePatches_:k}=E;R.push({op:n,path:[],value:S===Kl?void 0:S}),k.push({op:n,path:[],value:y})}function v(y,S){return S.forEach(E=>{let{path:R,op:k}=E,I=y;for(let G=0;G<R.length-1;G++){let V=rn(I),j=R[G];typeof j!="string"&&typeof j!="number"&&(j=""+j),(V===0||V===1)&&(j==="__proto__"||j===gi)&&tt(19),en(I)&&j===bi&&tt(19),I=ar(I,j),(I===null||!Zn(I))&&tt(18,R.join("/"))}let T=rn(I),_=C(E.value),D=R[R.length-1];switch(k){case n:switch(T){case 2:return I.set(D,_);case 3:tt(16);default:return I[D]=_}case o:switch(T){case 1:return D==="-"?I.push(_):I.splice(D,0,_);case 2:return I.set(D,_);case 3:return I.add(_);default:return I[D]=_}case i:switch(T){case 1:return I.splice(D,1);case 2:return I.delete(D);case 3:return I.delete(E.value);default:return delete I[D]}default:tt(17,k)}}),y}function C(y){if(!ut(y))return y;if(Ai(y))return y.map(C);if(xi(y))return new Map(Array.from(y.entries()).map(([E,R])=>[E,C(R)]));if(Ci(y))return new Set(Array.from(y).map(C));let S=Object.create(tn(y));for(let E in y)S[E]=C(y[E]);return Xn(y,mi)&&(S[mi]=y[mi]),S}function g(y){return ft(y)?C(y):y}Tx(Ha,{applyPatches_:v,generatePatches_:a,generateReplacementPatches_:h,getPath:t})}var Lx=w.Iterator,rq=typeof Lx?.from=="function";var Si=new jx,on=Si.produce,Zl=Si.produceWithPatches.bind(Si);var Jl=Si.applyPatches.bind(Si);m();d();f();p();function Ux(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Vx(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 jm=e=>Array.isArray(e)?e:[e];function Bx(e){let t=Array.isArray(e[0])?e[0]:e;return Vx(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Gx(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var $x=class{constructor(e){this.value=e}deref(){return this.value}},Qx=()=>typeof WeakRef>"u"?$x:WeakRef,Um=Qx(),Hx=0,Lm=1;function Ja(){return{s:Hx,v:void 0,o:null,p:null}}function zx(e){return e instanceof Um?e.deref():e}function Ei(e,t={}){let r=Ja(),{resultEqualityCheck:n}=t,o,i=0;function a(){let s=r,{length:c}=arguments;for(let v=0,C=c;v<C;v++){let g=arguments[v];if(typeof g=="function"||typeof g=="object"&&g!==null){let y=s.o;y===null&&(s.o=y=new WeakMap);let S=y.get(g);S===void 0?(s=Ja(),y.set(g,s)):s=S}else{let y=s.p;y===null&&(s.p=y=new Map);let S=y.get(g);S===void 0?(s=Ja(),y.set(g,s)):s=S}}let u=s,h;if(s.s===Lm)h=s.v;else if(h=e.apply(null,arguments),i++,n){let v=zx(o);v!=null&&n(v,h)&&(h=v,i!==0&&i--),o=typeof h=="object"&&h!==null||typeof h=="function"?new Um(h):h}return u.s=Lm,u.v=h,h}return a.clearCache=()=>{r=Ja(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function Wx(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,s,c={},u=o.pop();typeof u=="object"&&(c=u,u=o.pop()),Ux(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);let h={...r,...c},{memoize:v,memoizeOptions:C=[],argsMemoize:g=Ei,argsMemoizeOptions:y=[]}=h,S=jm(C),E=jm(y),R=Bx(o),k=v(function(){return i++,u.apply(null,arguments)},...S),I=!0,T=g(function(){a++;let D=Gx(R,arguments);return s=k.apply(null,D),s},...E);return Object.assign(T,{resultFunc:u,memoizedResultFunc:k,dependencies:R,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:v,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var $e=Wx(Ei);m();d();f();p();function Vm(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var Bm=Vm(),Gm=Vm;var Kx=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?pi:pi.apply(null,arguments)},Rq=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},Yx=e=>e&&typeof e.match=="function";function O(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(mt(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=>fi(n)&&n.type===e,r}var Xm=class Ri extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ri.prototype)}static get[Symbol.species](){return Ri}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ri(...t[0].concat(this)):new Ri(...t.concat(this))}};function $m(e){return ut(e)?on(e,()=>{}):e}function es(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Xx(e){return typeof e=="boolean"}var Zx=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Xm;return r&&(Xx(r)?a.push(Bm):a.push(Gm(r.extraArgument))),a},Ii="RTK_autoBatch",to=()=>e=>({payload:e,meta:{[Ii]:!0}}),Qm=e=>t=>{setTimeout(t,e)},Jx=(e,t)=>r=>{let n=!1,o=()=>{n||(n=!0,cancelAnimationFrame(i),clearTimeout(a),r())},i=e(o),a=setTimeout(o,t)},eC=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?Jx(window.requestAnimationFrame,100):Qm(10):e.type==="callback"?e.queueNotification:Qm(e.timeout),u=()=>{a=!1,i&&(i=!1,s.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let v=()=>o&&h(),C=n.subscribe(v);return s.add(h),()=>{C(),s.delete(h)}},dispatch(h){try{return o=!h?.meta?.[Ii],i=!o,i&&(a||(a=!0,c(u))),n.dispatch(h)}finally{o=!0}}})},tC=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Xm(e);return n&&o.push(eC(typeof n=="object"?n:void 0)),o};function Zm(e){let t=Zx(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{},c;if(typeof r=="function")c=r;else if(Ht(r))c=Yn(r);else throw new Error(mt(1));let u;typeof n=="function"?u=n(t):u=t();let h=pi;o&&(h=Kx({trace:!1,...(typeof o=="object"&&o)}));let v=wm(...u),C=tC(v),g=typeof s=="function"?s(C):C(),y=h(...g);return Ul(c,a,y)}function Jm(e){let t={},r=[],n,o={addCase(i,a){let s=typeof i=="string"?i:i.type;if(!s)throw new Error(mt(28));if(s in t)throw new Error(mt(29));return t[s]=a,o},addAsyncThunk(i,a){return a.pending&&(t[i.pending.type]=a.pending),a.rejected&&(t[i.rejected.type]=a.rejected),a.fulfilled&&(t[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function rC(e){return typeof e=="function"}function Be(e,t){let[r,n,o]=Jm(t),i;if(rC(e))i=()=>$m(e());else{let s=$m(e);i=()=>s}function a(s=i(),c){let u=[r[c.type],...n.filter(({matcher:h})=>h(c)).map(({reducer:h})=>h)];return u.filter(h=>!!h).length===0&&(u=[o]),u.reduce((h,v)=>{if(v)if(ft(h)){let g=v(h,c);return g===void 0?h:g}else{if(ut(h))return on(h,C=>v(C,c));{let C=v(h,c);if(C===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return C}}return h},s)}return a.getInitialState=i,a}var eg=(e,t)=>Yx(e)?e.match(t):e(t);function zt(...e){return t=>e.some(r=>eg(r,t))}function eo(...e){return t=>e.every(r=>eg(r,t))}function os(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 Ti(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function is(...e){return e.length===0?t=>os(t,["pending"]):Ti(e)?zt(...e.map(t=>t.pending)):is()(e[0])}function sn(...e){return e.length===0?t=>os(t,["rejected"]):Ti(e)?zt(...e.map(t=>t.rejected)):sn()(e[0])}function _i(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?eo(sn(...e),t):Ti(e)?eo(sn(...e),t):_i()(e[0])}function cr(...e){return e.length===0?t=>os(t,["fulfilled"]):Ti(e)?zt(...e.map(t=>t.fulfilled)):cr()(e[0])}function as(...e){return e.length===0?t=>os(t,["pending","fulfilled","rejected"]):Ti(e)?zt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):as()(e[0])}var nC="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",ki=(e=21)=>{let t="",r=e;for(;r--;)t+=nC[Math.random()*64|0];return t},oC=["name","message","stack","code"],ed=class{constructor(e,t){ae(this,"payload");ae(this,"meta");ae(this,"_type");this.payload=e,this.meta=t}},Hm=class{constructor(e,t){ae(this,"payload");ae(this,"meta");ae(this,"_type");this.payload=e,this.meta=t}},iC=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of oC)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},zm="External signal was aborted",Ie=(()=>{function e(t,r,n){let o=O(t+"/fulfilled",(c,u,h,v)=>({payload:c,meta:{...(v||{}),arg:h,requestId:u,requestStatus:"fulfilled"}})),i=O(t+"/pending",(c,u,h)=>({payload:void 0,meta:{...(h||{}),arg:u,requestId:c,requestStatus:"pending"}})),a=O(t+"/rejected",(c,u,h,v,C)=>({payload:v,error:(n&&n.serializeError||iC)(c||"Rejected"),meta:{...(C||{}),arg:h,requestId:u,rejectedWithValue:!!v,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function s(c,{signal:u}={}){return(h,v,C)=>{let g=n?.idGenerator?n.idGenerator(c):ki(),y=new l.AbortController,S,E;function R(I){E=I,y.abort()}u&&(u.aborted?R(zm):u.addEventListener("abort",()=>R(zm),{once:!0}));let k=_asyncToGenerator(function*(){let I;try{let _=n?.condition?.(c,{getState:v,extra:C});if(sC(_)&&(_=yield _),_===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let D=new Promise((G,V)=>{S=()=>{V({name:"AbortError",message:E||"Aborted"})},y.signal.addEventListener("abort",S,{once:!0})});h(i(g,c,n?.getPendingMeta?.({requestId:g,arg:c},{getState:v,extra:C}))),I=yield Promise.race([D,Promise.resolve(r(c,{dispatch:h,getState:v,extra:C,requestId:g,signal:y.signal,abort:R,rejectWithValue:(G,V)=>new ed(G,V),fulfillWithValue:(G,V)=>new Hm(G,V)})).then(G=>{if(G instanceof ed)throw G;return G instanceof Hm?o(G.payload,g,c,G.meta):o(G,g,c)})])}catch(_){I=_ instanceof ed?a(null,g,c,_.payload,_.meta):a(_,g,c)}finally{S&&y.signal.removeEventListener("abort",S)}return n&&!n.dispatchConditionRejection&&a.match(I)&&I.meta.condition||h(I),I})();return Object.assign(k,{abort:R,requestId:g,arg:c,unwrap(){return k.then(aC)}})}}return Object.assign(s,{pending:i,rejected:a,fulfilled:o,settled:zt(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function aC(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function sC(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var tg=Symbol.for("rtk-slice-createasyncthunk"),Tq={[tg]:Ie};function cC(e,t){return`${e}/${t}`}function uC({creators:e}={}){let t=e?.asyncThunk?.[tg];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(mt(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(dC()):n.reducers)||{},s=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(I,T){let _=typeof I=="string"?I:I.type;if(!_)throw new Error(mt(12));if(_ in c.sliceCaseReducersByType)throw new Error(mt(13));return c.sliceCaseReducersByType[_]=T,u},addMatcher(I,T){return c.sliceMatchers.push({matcher:I,reducer:T}),u},exposeAction(I,T){return c.actionCreators[I]=T,u},exposeCaseReducer(I,T){return c.sliceCaseReducersByName[I]=T,u}};s.forEach(I=>{let T=a[I],_={reducerName:I,type:cC(o,I),createNotation:typeof n.reducers=="function"};fC(T)?gC(_,T,u,t):pC(_,T,u)});function h(){let[I={},T=[],_=void 0]=typeof n.extraReducers=="function"?Jm(n.extraReducers):[n.extraReducers],D={...I,...c.sliceCaseReducersByType};return Be(n.initialState,G=>{for(let V in D)G.addCase(V,D[V]);for(let V of c.sliceMatchers)G.addMatcher(V.matcher,V.reducer);for(let V of T)G.addMatcher(V.matcher,V.reducer);_&&G.addDefaultCase(_)})}let v=I=>I,C=new Map,g=new WeakMap,y;function S(I,T){return y||(y=h()),y(I,T)}function E(){return y||(y=h()),y.getInitialState()}function R(I,T=!1){function _(G){let V=G[I];return typeof V>"u"&&T&&(V=es(g,_,E)),V}function D(G=v){let V=es(C,T,()=>new WeakMap);return es(V,G,()=>{let j={};for(let[L,q]of Object.entries(n.selectors??{}))j[L]=lC(q,G,()=>es(g,G,E),T);return j})}return{reducerPath:I,getSelectors:D,get selectors(){return D(_)},selectSlice:_}}let k={name:o,reducer:S,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:E,...R(i),injectInto(I,{reducerPath:T,..._}={}){let D=T??i;return I.inject({reducerPath:D,reducer:S},_),{...k,...R(D,!0)}}};return k}}function lC(e,t,r,n){function o(i,...a){let s=t(i);return typeof s>"u"&&n&&(s=r()),e(s,...a)}return o.unwrapped=e,o}var cn=uC();function dC(){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 pC({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!mC(n))throw new Error(mt(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?O(e,a):O(e))}function fC(e){return e._reducerDefinitionType==="asyncThunk"}function mC(e){return e._reducerDefinitionType==="reducerWithPrepare"}function gC({type:e,reducerName:t},r,n,o){if(!o)throw new Error(mt(18));let{payloadCreator:i,fulfilled:a,pending:s,rejected:c,settled:u,options:h}=r,v=o(e,i,h);n.exposeAction(t,v),a&&n.addCase(v.fulfilled,a),s&&n.addCase(v.pending,s),c&&n.addCase(v.rejected,c),u&&n.addMatcher(v.settled,u),n.exposeCaseReducer(t,{fulfilled:a||ts,pending:s||ts,rejected:c||ts,settled:u||ts})}function ts(){}var hC="task",rg="listener",ng="completed",nd="cancelled",yC=`task-${nd}`,vC=`task-${ng}`,td=`${rg}-${nd}`,SC=`${rg}-${ng}`,ss=class{constructor(e){ae(this,"code");ae(this,"name","TaskAbortError");ae(this,"message");this.code=e,this.message=`${hC} ${nd} (reason: ${e})`}},od=(e,t)=>{if(typeof e!="function")throw new TypeError(mt(32))},rs=()=>{},og=(e,t=rs)=>(e.catch(t),e),ig=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),an=e=>{if(e.aborted)throw new ss(e.reason)};function ag(e,t){let r=rs;return new Promise((n,o)=>{let i=()=>o(new ss(e.reason));if(e.aborted){i();return}r=ig(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=rs})}var bC=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof ss?"cancelled":"rejected",error:r}}finally{t?.()}});return function bC(_x5,_x6){return _ref5.apply(this,arguments)}}(),ns=e=>t=>og(ag(e,t).then(r=>(an(e),r))),sg=e=>{let t=ns(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Jn}=Object,Wm={},cs="listenerMiddleware",wC=(e,t)=>{let r=n=>ig(e,()=>n.abort(e.reason));return(n,o)=>{od(n,"taskExecutor");let i=new l.AbortController;r(i);let a=bC(/*#__PURE__*/_asyncToGenerator(function*(){an(e),an(i.signal);let s=yield n({pause:ns(i.signal),delay:sg(i.signal),signal:i.signal});return an(i.signal),s}),()=>i.abort(vC));return o?.autoJoin&&t.push(a.catch(rs)),{result:ns(e)(a),cancel(){i.abort(yC)}}}},AC=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){an(t);let i=()=>{},s=[new Promise((c,u)=>{let h=e({predicate:n,effect:(v,C)=>{C.unsubscribe(),c([v,C.getState(),C.getOriginalState()])}});i=()=>{h(),u()}})];o!=null&&s.push(new Promise(c=>setTimeout(c,o,null)));try{let c=yield ag(t,Promise.race(s));return an(t),c}finally{i()}});return function r(_x7,_x8){return _ref7.apply(this,arguments)}}();return(n,o)=>og(r(n,o))},cg=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=O(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(mt(21));return od(i,"options.listener"),{predicate:o,type:t,effect:i}},ug=Jn(e=>{let{type:t,predicate:r,effect:n}=cg(e);return{id:ki(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(mt(22))}}},{withTypes:()=>ug}),Km=(e,t)=>{let{type:r,effect:n,predicate:o}=cg(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},rd=e=>{e.pending.forEach(t=>{t.abort(td)})},xC=(e,t)=>()=>{for(let r of t.keys())rd(r);e.clear()},Ym=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},lg=Jn(O(`${cs}/add`),{withTypes:()=>lg}),CC=O(`${cs}/removeAll`),dg=Jn(O(`${cs}/remove`),{withTypes:()=>dg}),EC=(...e)=>{console.error(`${cs}/error`,...e)},pg=(e={})=>{let t=new Map,r=new Map,n=g=>{let y=r.get(g)??0;r.set(g,y+1)},o=g=>{let y=r.get(g)??1;y===1?r.delete(g):r.set(g,y-1)},{extra:i,onError:a=EC}=e;od(a,"onError");let s=g=>(g.unsubscribe=()=>t.delete(g.id),t.set(g.id,g),y=>{g.unsubscribe(),y?.cancelActive&&rd(g)}),c=g=>{let y=Km(t,g)??ug(g);return s(y)};Jn(c,{withTypes:()=>c});let u=g=>{let y=Km(t,g);return y&&(y.unsubscribe(),g.cancelActive&&rd(y)),!!y};Jn(u,{withTypes:()=>u});let h=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(g,y,S,E){let R=new l.AbortController,k=AC(c,R.signal),I=[];try{g.pending.add(R),n(g),yield Promise.resolve(g.effect(y,Jn({},S,{getOriginalState:E,condition:(T,_)=>k(T,_).then(Boolean),take:k,delay:sg(R.signal),pause:ns(R.signal),extra:i,signal:R.signal,fork:wC(R.signal,I),unsubscribe:g.unsubscribe,subscribe:()=>{t.set(g.id,g)},cancelActiveListeners:()=>{g.pending.forEach((T,_,D)=>{T!==R&&(T.abort(td),D.delete(T))})},cancel:()=>{R.abort(td),g.pending.delete(R)},throwIfCancelled:()=>{an(R.signal)}})))}catch(T){T instanceof ss||Ym(a,T,{raisedBy:"effect"})}finally{yield Promise.all(I),R.abort(SC),o(g),g.pending.delete(R)}});return function h(_x9,_x0,_x1,_x10){return _ref8.apply(this,arguments)}}(),v=xC(t,r);return{middleware:g=>y=>S=>{if(!fi(S))return y(S);if(lg.match(S))return c(S.payload);if(CC.match(S)){v();return}if(dg.match(S))return u(S.payload);let E=g.getState(),R=()=>{if(E===Wm)throw new Error(mt(23));return E},k;try{if(k=y(S),t.size>0){let I=g.getState(),T=Array.from(t.values());for(let _ of T){let D=!1;try{D=_.predicate(S,I,E)}catch(G){D=!1,Ym(a,G,{raisedBy:"predicate"})}D&&h(_,S,g,R)}}}finally{E=Wm}return k},startListening:c,stopListening:u,clearListeners:v}};function mt(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. `}m();d();f();p();var Y=new z({required:!0,emptyAllowed:!1}),rt=new z({required:!1,emptyAllowed:!1}),nt=new z({required:!0,emptyAllowed:!0}),Uq=new z({required:!1,emptyAllowed:!0}),us=new Se({each:Y,required:!0}),fg=new z({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),mg=new z({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Vq=new z({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),ur=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Tt=(e,t)=>{if("required"in t)return{payload:new ht({value:t}).validate({value:e}).value};let o=new ne({options:{required:!0},values:t}).validate(e);if(o)throw new si(o);return{payload:e}},B=(e,t)=>{try{return Tt(e,t)}catch(r){return{payload:e,error:ur(r)}}},gg=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return yg(e,t,r,o,"Controller initialization error")},hg=(e,t,r,n)=>{let o=`Check the options of ${n}`;return yg(e,t,r,o,"Controller initialization error")},yg=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};m();d();f();p();var ro="3.55.3",vg=["@coveo/atomic","@coveo/quantic"];var id=()=>rt,Sg=()=>Y,Er=O("configuration/updateBasicConfiguration",e=>B(e,{accessToken:rt,environment:new z({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:rt})),Wt=O("configuration/updateSearchConfiguration",e=>B(e,{proxyBaseUrl:new z({required:!1,url:!0}),pipeline:new z({required:!1,emptyAllowed:!0}),searchHub:rt,timezone:rt,locale:rt,authenticationProviders:new Se({required:!1,each:Y})})),RC={enabled:new fe({default:!0}),originContext:id(),originLevel2:id(),originLevel3:id(),proxyBaseUrl:new z({required:!1,url:!0}),runtimeEnvironment:new De,anonymous:new fe({default:!1}),deviceId:rt,userDisplayName:rt,documentLocation:rt,trackingId:mg,analyticsMode:new z({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new ne({options:{required:!1},values:vg.reduce((e,t)=>(e[t]=fg,e),{})})},no=O("configuration/updateAnalyticsConfiguration",e=>B(e,RC)),oo=O("configuration/analytics/disable"),io=O("configuration/analytics/enable"),ls=O("configuration/analytics/originlevel2",e=>B(e,{originLevel2:Sg()})),ds=O("configuration/analytics/originlevel3",e=>B(e,{originLevel3:Sg()})),bg=O("knowledge/setAgentId",e=>B(e,new z({required:!0})));m();d();f();p();m();d();f();p();m();d();f();p();var wg={q:new z,enableQuerySyntax:new fe,aq:new z,cq:new z,firstResult:new oe({min:0}),numberOfResults:new oe({min:0}),sortCriteria:new z,f:new ne,fExcluded:new ne,cf:new ne,nf:new ne,mnf:new ne,df:new ne,debug:new fe,sf:new ne,tab:new z,af:new ne};var Rr=O("searchParameters/restore",e=>B(e,wg)),Ag=O("searchParameters/restoreTab",e=>B(e,Y));m();d();f();p();var ps=O("debug/enable"),fs=O("debug/disable");m();d();f();p();var ms=()=>!1;var gs=Be(ms(),e=>{e.addCase(ps,()=>!0).addCase(fs,()=>!1).addCase(Rr,(t,r)=>r.payload.debug??t)});m();d();f();p();var ao=O("pipeline/set",e=>B(e,new z({required:!0,emptyAllowed:!0})));m();d();f();p();m();d();f();p();var IC=O("history/undo"),TC=O("history/redo"),Kt=O("history/snapshot"),Yj=Ie("history/back",/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(e,{dispatch:t}){t(IC()),yield t(vt())});return function(_x11,_x12){return _ref9.apply(this,arguments)}}()),Xj=Ie("history/forward",/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(e,{dispatch:t}){t(TC()),yield t(vt())});return function(_x13,_x14){return _ref0.apply(this,arguments)}}()),vt=Ie("history/change",/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x15,_x16){return _ref1.apply(this,arguments)}}());m();d();f();p();var Ir=()=>"";var so=Be(Ir(),e=>{e.addCase(ao,(t,r)=>r.payload).addCase(vt.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Wt,(t,r)=>r.payload.pipeline||t)});m();d();f();p();m();d();f();p();var hs=O("app/setError");m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();function _C(){return typeof navigator<"u"}function xg(){try{return typeof localStorage<"u"}catch{return!1}}function Cg(){try{return typeof sessionStorage<"u"}catch{return!1}}function Eg(){return _C()&&navigator.cookieEnabled}m();d();f();p();var co=class e{static set(t,r,n){var o,i,a,s;n&&(i=new Date,i.setTime(i.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?Rg(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],Rg(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Rg(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}function Ig(){return xg()?localStorage:Eg()?new ys:Cg()?sessionStorage:new ad}var ys=class e{getItem(t){return co.get(`${e.prefix}${t}`)}removeItem(t){co.erase(`${e.prefix}${t}`)}setItem(t,r,n){co.set(`${e.prefix}${t}`,r,n)}};ys.prefix="coveo_";var ad=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var vs="__coveo.analytics.history",kC=20,OC=1e3*60,PC=75,Ss=class{constructor(t){this.store=t||Ig()}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(vs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(vs);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(vs,JSON.stringify(t.slice(0,kC)))}catch{}}clear(){try{this.store.removeItem(vs)}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,PC)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>OC:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}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 un=class un extends Ss{static getInstance(t){return un.instance||(un.instance=new un(t)),un.instance}constructor(t){super(t)}};ae(un,"instance",null);var gt=un;m();d();f();p();m();d();f();p();var uo=$e(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${ro}`));m();d();f();p();m();d();f();p();function lr(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function U(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(v){a(v)}}function c(h){try{u(n.throw(h))}catch(v){a(v)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}var Ae;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Ae||(Ae={}));function ud(){return typeof window<"u"}function Ad(){return typeof navigator<"u"}function lo(){return typeof document<"u"}function ld(){try{return typeof localStorage<"u"}catch{return!1}}function NC(){try{return typeof sessionStorage<"u"}catch{return!1}}function Ug(){return Ad()&&navigator.cookieEnabled}var FC=[Ae.click,Ae.custom,Ae.search,Ae.view],DC=(e,t)=>FC.indexOf(e)!==-1?Object.assign({language:lo()?document.documentElement.lang:"unknown",userAgent:Ad()?navigator.userAgent:"unknown"},t):t,Pi=class e{static set(t,r,n){var o,i,a,s;n&&(i=new Date,i.setTime(i.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?Tg(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],Tg(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Tg(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}function MC(){return ld()?localStorage:Ug()?new Ni:NC()?sessionStorage:new fo}var Ni=class e{getItem(t){return Pi.get(`${e.prefix}${t}`)}removeItem(t){Pi.erase(`${e.prefix}${t}`)}setItem(t,r,n){Pi.set(`${e.prefix}${t}`,r,n)}};Ni.prefix="coveo_";var dd=class{constructor(){this.cookieStorage=new Ni}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)}},fo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},bs="__coveo.analytics.history",qC=20,jC=1e3*60,LC=75,As=class{constructor(t){this.store=t||MC()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return U(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return U(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(bs);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return U(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(bs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(bs,JSON.stringify(t.slice(0,qC)))}catch{}}clear(){try{this.store.removeItem(bs)}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,LC)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>jC:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}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 UC=(e,t)=>U(void 0,void 0,void 0,function*(){return e===Ae.view?(yield VC(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),VC=e=>U(void 0,void 0,void 0,function*(){let t=new As,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),BC=/^(?:[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 xs(e){return typeof e=="string"&&BC.test(e)}function _g(e){if(!xs(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 ot=[];for(let e=0;e<256;++e)ot.push((e+256).toString(16).slice(1));function Vg(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()}var GC=new Uint8Array(16);function $C(){return crypto.getRandomValues(GC)}function QC(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 HC="6ba7b810-9dad-11d1-80b4-00c04fd430c8",zC="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function WC(e,t,r,n,o,i){let a=typeof r=="string"?QC(r):r,s=typeof n=="string"?_g(n):n;if(typeof n=="string"&&(n=_g(n)),n?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+a.length);return c.set(s),c.set(a,s.length),c=t(c),c[6]=c[6]&15|e,c[8]=c[8]&63|128,Vg(c)}function ln(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():KC(e,t,r)}function KC(e,t,r){e=e||{};let n=e.random??e.rng?.()??$C();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 Vg(n)}function YC(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 sd(e,t){return e<<t|e>>>32-t}function XC(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,i=Math.ceil(o/16),a=new Array(i);for(let s=0;s<i;++s){let c=new Uint32Array(16);for(let u=0;u<16;++u)c[u]=e[s*64+u*4]<<24|e[s*64+u*4+1]<<16|e[s*64+u*4+2]<<8|e[s*64+u*4+3];a[s]=c}a[i-1][14]=(e.length-1)*8/2**32,a[i-1][14]=Math.floor(a[i-1][14]),a[i-1][15]=(e.length-1)*8&4294967295;for(let s=0;s<i;++s){let c=new Uint32Array(80);for(let y=0;y<16;++y)c[y]=a[s][y];for(let y=16;y<80;++y)c[y]=sd(c[y-3]^c[y-8]^c[y-14]^c[y-16],1);let u=r[0],h=r[1],v=r[2],C=r[3],g=r[4];for(let y=0;y<80;++y){let S=Math.floor(y/20),E=sd(u,5)+YC(S,h,v,C)+g+t[S]+c[y]>>>0;g=C,C=v,v=sd(h,30)>>>0,h=u,u=E}r[0]=r[0]+u>>>0,r[1]=r[1]+h>>>0,r[2]=r[2]+v>>>0,r[3]=r[3]+C>>>0,r[4]=r[4]+g>>>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 Cs(e,t,r,n){return WC(80,XC,e,t)}Cs.DNS=HC;Cs.URL=zC;var Bg="2.33.0",kg=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Oi={pageview:"pageview",event:"event"},Es=class{constructor({client:t,uuidGenerator:r=ln}){this.client=t,this.uuidGenerator=r}},pd=class extends Es{constructor({client:t,uuidGenerator:r=ln}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=kg(window.location),this.lastReferrer=lo()?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:lo()?document.title:"",encoding:lo()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===Oi.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Oi.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Oi.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Oi.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 kg(window.location)}},Tr=class e{constructor(t,r){if(!xs(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 i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return xs(i)?new e(i,Number.parseInt(o)*1e3):null}};Tr.cvo_cid="cvo_cid";Tr.expirationTime=120;var fd=class extends Es{constructor({client:t,uuidGenerator:r=ln}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return U(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(Tr.cvo_cid,new Tr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};fd.Id="link";var kt=Object.keys;function ws(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var cd=128,Gg=192,Og=224,Pg=240;function ZC(e){return(e&248)===Pg?4:(e&Pg)===Og?3:(e&Og)===Gg?2:1}function JC(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&cd)!=cd)break;if(r-=3,(n&Gg)!=cd){t-r>=ZC(n)*3&&(r=t);break}}return e.substring(0,r)}var md={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"},eE=kt(md).map(e=>md[e]),tE=[...eE].join("|"),rE=new RegExp(`^(${tE}$)`),nE={svcAction:"svc_action",svcActionData:"svc_action_data"},oE=e=>kt(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=md[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),iE=e=>rE.test(e),aE=[iE],Ng={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},Fg={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},lt={action:"pa",list:"pal",listSource:"pls"},Rs={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},sE=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],gd={id:"quoteId",affiliation:"quoteAffiliation"},hd={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},cE={add:lt,bookmark_add:lt,bookmark_remove:lt,click:lt,checkout:lt,checkout_option:lt,detail:lt,impression:lt,remove:lt,refund:Object.assign(Object.assign({},lt),Rs),purchase:Object.assign(Object.assign({},lt),Rs),quickview:lt,quote:Object.assign(Object.assign({},lt),gd),review:Object.assign(Object.assign({},lt),hd)},uE=kt(Ng).map(e=>Ng[e]),lE=kt(Fg).map(e=>Fg[e]),dE=kt(lt).map(e=>lt[e]),pE=kt(Rs).map(e=>Rs[e]),fE=kt(hd).map(e=>hd[e]),mE=kt(gd).map(e=>gd[e]),gE=[...uE,"custom"].join("|"),hE=[...lE,"custom"].join("|"),$g="(pr[0-9]+)",Qg="(il[0-9]+pi[0-9]+)",yE=new RegExp(`^${$g}(${gE})$`),vE=new RegExp(`^(${Qg}(${hE}))|(il[0-9]+nm)$`),SE=new RegExp(`^(${dE.join("|")})$`),bE=new RegExp(`^(${pE.join("|")})$`),wE=new RegExp(`^${$g}custom$`),AE=new RegExp(`^${Qg}custom$`),xE=new RegExp(`^(${[...sE,...fE,...mE].join("|")})$`),CE=e=>yE.test(e),EE=e=>vE.test(e),RE=e=>SE.test(e),IE=e=>bE.test(e),TE=e=>xE.test(e),_E=[EE,CE,RE,IE,TE],kE=[wE,AE],OE={anonymizeIp:"aip"},PE={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},NE={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},FE=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],DE=Object.assign(Object.assign(Object.assign(Object.assign({},OE),PE),NE),FE.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),yd=Object.assign(Object.assign({},DE),nE),ME=e=>{let t=!!e.action&&cE[e.action]||{};return kt(e).reduce((r,n)=>{let o=t[n]||yd[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},qE=kt(yd).map(e=>yd[e]),jE=e=>qE.indexOf(e)!==-1,LE=e=>e==="custom",UE=e=>[..._E,...aE,jE,LE].some(t=>t(e)),VE=e=>kt(e).reduce((t,r)=>{let n=BE(r);return n?Object.assign(Object.assign({},t),GE(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),BE=e=>{let t;return[...kE].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},GE=(e,t)=>kt(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),vd=class{constructor(t){this.opts=t}sendEvent(t,r){return U(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:s}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),c=this.encodeForEventType(t,s),u=new Blob([c],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,u)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return U(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:s,body:c}=a;o=s||t;try{i=JSON.parse(c)}catch(u){console.error("Unable to process the request body as a JSON string",u)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return U(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[Ae.click,Ae.custom,Ae.search,Ae.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}},Sd=class{sendEvent(t,r){return U(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return U(this,void 0,void 0,function*(){return Promise.resolve()})}},Dg=w.fetch,Is=class{constructor(t){this.opts=t}sendEvent(t,r){return U(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},c=Object.assign(Object.assign({},s),i?yield i(s,"analyticsFetch"):{}),{url:u}=c,h=lr(c,["url"]),v;try{v=yield Dg(u,h)}catch(C){console.error("An error has occurred when sending the event.",C);return}if(v.ok){let C=yield v.json();return C.visitorId&&o.setCurrentVisitorId(C.visitorId),C}else{try{v.json()}catch{}throw console.error(`An error has occurred when sending the "${t}" event.`,v,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return U(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Dg(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Ae.click,Ae.custom,Ae.search,Ae.view].indexOf(t)!==-1}getVisitorIdParam(){return U(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},bd=class{constructor(t,r){ld()&&Ug()?this.storage=new dd:ld()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new fo),this.client=new Is(t),this.beaconClient=new vd(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},wd=class{constructor(t,r){this.storage=r||new fo,this.client=new Is(t)}getClientDependingOnEventType(t){return this.client}},Ts=class{constructor(){this.storage=new fo,this.client=new Sd}getClientDependingOnEventType(t){return this.client}},$E="xx",QE=e=>e?.startsWith($E)||!1,HE=`
28
28
  We've detected you're using React Native but have not provided the corresponding runtime,
29
29
  for an optimal experience please use the "coveo.analytics/react-native" subpackage.
30
30
  Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
31
- `;function VE(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var BE=["1",1,"yes",!0];function GE(){let e=[];return sd()&&e.push(window.doNotTrack),bd()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>BE.indexOf(t)!==-1)}function Is(e){return e===!0?!1:GE()}var $g="v15",Qg={default:"https://analytics.cloud.coveo.com/rest/ua"};function $E(e=Qg.default,t=$g,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 QE="38824e1f-37f5-42d3-8372-a4b8fa9df946",Yt=class{get defaultOptions(){return{endpoint:Qg.default,isCustomEndpoint:!1,token:"",version:$g,beforeSendHooks:[],afterSendHooks:[]}}get version(){return Ug}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=[FC,_C].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};Is(this.options.disableBrowserPrivacySignals)?this.runtime=new Rs:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(Ae.view,{newEventType:Ae.view,addClientIdParameter:!0}),this.addEventTypeMapping(Ae.click,{newEventType:Ae.click,addClientIdParameter:!0}),this.addEventTypeMapping(Ae.custom,{newEventType:Ae.custom,addClientIdParameter:!0}),this.addEventTypeMapping(Ae.search,{newEventType:Ae.search,addClientIdParameter:!0})}initRuntime(t){return sd()&&uo()?new vd(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(VE()&&console.warn(UE),new Sd(t))}get storage(){return this.runtime.storage}determineVisitorId(){return U(this,void 0,void 0,function*(){try{return sd()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||ln()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),ln()}})}getCurrentVisitorId(){return U(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return U(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return U(this,void 0,void 0,function*(){if(ws(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(As(t,As(r,QE)))}})}getParameters(t,...r){return U(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return U(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(ln()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Is(this.options.disableBrowserPrivacySignals))return null;try{let r=new URL(t).searchParams.get(Tr.cvo_cid);if(r==null)return null;let n=Tr.fromString(r);return!n||!uo()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return U(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[y=>n.length>0?this.parseVariableArgumentsPayload(n,y):y[0],y=>U(this,void 0,void 0,function*(){return Object.assign(Object.assign({},y),{visitorId:o?yield this.getCurrentVisitorId():""})}),y=>U(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},y),{clientId:yield this.getCurrentVisitorId()}):y}),y=>i?this.ensureAnonymousUserWhenUsingApiKey(y):y,y=>this.beforeSendHooks.reduce((h,S)=>U(this,void 0,void 0,function*(){let C=yield h;return yield S(t,C)}),y)].reduce((y,h)=>U(this,void 0,void 0,function*(){let S=yield y;return yield h(S)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return U(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[v=>this.setTrackingIdIfTrackingIdNotPresent(v),v=>this.removeEmptyPayloadValues(v,t),v=>this.validateParams(v,t),v=>n?kE(v):v,v=>n?this.removeUnknownParameters(v):v,v=>n?this.processCustomParameters(v):this.mapCustomParametersToCustomData(v)].reduce((v,E)=>U(this,void 0,void 0,function*(){let y=yield v;return yield E(y)}),Promise.resolve(r))})}makeEvent(t,...r){return U(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>U(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(s=>s(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return U(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return U(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new bs().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(Ae.search,t)})}sendSearchEvent(t){return U(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=lr(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(Ae.click,t)})}sendClickEvent(t){return U(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=lr(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(Ae.custom,t)})}sendCustomEvent(t){return U(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=lr(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(Ae.view,t)})}sendViewEvent(t){return U(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return U(this,void 0,void 0,function*(){let r=yield(yield A(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return U(this,void 0,void 0,function*(){return yield(yield A(`${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,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[Ae.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,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(FE(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=lr(t,["custom"]),o={};r&&Ss(r)&&(o=this.lowercaseKeys(r));let i=DE(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=lr(t,["custom"]);if(r&&Ss(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=lr(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==Ae.view||r==Ae.click||r==Ae.search||r==Ae.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==Ae.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=lr(t,["userId"]);return LE(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=lr(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Ss(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Ss(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"?zC(t,r):t}get baseUrl(){return $E(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},dr;(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"})(dr||(dr={}));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 Fg={[$.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",[dr.expandToFullUI]:"interface",[dr.openUserActions]:"User Actions",[dr.showPrecedingSessions]:"User Actions",[dr.showFollowingSessions]:"User Actions",[dr.clickViewedDocument]:"User Actions",[dr.clickPageView]:"User Actions",[dr.createArticle]:"createArticle"},fo=class{constructor(){this.runtime=new Rs,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(Ae.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(Ae.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(Ae.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(Ae.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return Ug}};function HE(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function zE(e){return e.map(t=>t.replace(/;/g,""))}function Hg(e){let r=e.join(";");return r.length<=256?r:Hg(e.slice(1))}var Dg=e=>{let t=zE(e),r=HE(t);return Hg(r)};function Mg(e){let t=typeof e.partialQueries=="string"?e.partialQueries:Dg(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:Dg(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var Ts=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Is(t.disableBrowserPrivacySignals);this.coveoAnalyticsClient=n?new fo:new Yt(t)}disable(){this.coveoAnalyticsClient=new fo}enable(){this.coveoAnalyticsClient=new Yt(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent($.interfaceLoad)}logInterfaceLoad(){return U(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent($.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return U(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent($.recommendation)}logRecommendation(){return U(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent($.recommendationOpen,t,r)}logRecommendationOpen(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent($.staticFilterClearAll,t)}logStaticFilterClearAll(t){return U(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent($.staticFilterSelect,t)}logStaticFilterSelect(t){return U(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent($.staticFilterDeselect,t)}logStaticFilterDeselect(t){return U(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent($.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return U(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent($.interfaceChange,t)}logInterfaceChange(t){return U(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent($.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return U(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent($.didyoumeanClick)}logDidYouMeanClick(){return U(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 U(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent($.searchboxSubmit)}logSearchboxSubmit(){return U(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent($.searchboxClear)}logSearchboxClear(){return U(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent($.searchboxAsYouType)}logSearchboxAsYouType(){return U(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 U(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent($.breadcrumbResetAll)}logBreadcrumbResetAll(){return U(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent($.documentQuickview,t,r)}logDocumentQuickview(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent($.documentOpen,t,r)}logDocumentOpen(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent($.omniboxAnalytics,Mg(t))}logOmniboxAnalytics(t){return U(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent($.omniboxFromLink,Mg(t))}logOmniboxFromLink(t){return U(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent($.searchFromLink)}logSearchFromLink(){return U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent($.pagerScrolling)}logPagerScrolling(){return U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return U(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorBack);return{description:t.description,log:()=>U(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorBack)})}})}logQueryErrorBack(){return U(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return U(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorRetry);return{description:t.description,log:()=>U(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorRetry)})}})}logQueryErrorRetry(){return U(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return U(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorClear);return{description:t.description,log:()=>U(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorClear)})}})}logQueryErrorClear(){return U(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent($.likeSmartSnippet)}logLikeSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent($.dislikeSmartSnippet)}logDislikeSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent($.expandSmartSnippet)}logExpandSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent($.collapseSmartSnippet)}logCollapseSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent($.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent($.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return U(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent($.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent($.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return U(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent($.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return U(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent($.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return U(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent($.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return U(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent($.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent($.copyToClipboard,t,r)}logCopyToClipboard(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent($.recentQueryClick)}logRecentQueryClick(){return U(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent($.clearRecentQueries)}logClearRecentQueries(){return U(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent($.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent($.clearRecentResults)}logClearRecentResults(){return U(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent($.noResultsBack)}logNoResultsBack(){return U(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent($.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent($.showLessFoldedResults)}logShowLessFoldedResults(){return U(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return U(this,arguments,void 0,function*(n,o,i=Fg[n]){this.coveoAnalyticsClient.getParameters;let a=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),s=Object.assign(Object.assign({},yield this.getBaseEventRequest(a)),{eventType:i,eventValue:n}),c=yield this.coveoAnalyticsClient.makeCustomEvent(s);return{description:this.makeEventDescription(c,n),log:({searchUID:u})=>c.log({lastSearchQueryUid:u})}})}logCustomEvent(t,r){return U(this,arguments,void 0,function*(n,o,i=Fg[n]){return(yield this.makeCustomEvent(n,o,i)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return U(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:s})=>a.log({lastSearchQueryUid:s})}})}logCustomEventWithType(t,r,n){return U(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return U(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:s})=>a.log({searchQueryUid:s})}})}logClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return U(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return U(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof Yt?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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent($.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return U(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 U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},_s=Object.assign({},_i),qg=Object.keys(_s).map(e=>_s[e]),lo=class extends ld{constructor({client:t,uuidGenerator:r=ln}){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])=>qg.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(qg.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(_s.pageview,{newEventType:Ae.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(_s.event,{newEventType:Ae.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}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return ZC(this.ticket)}};lo.Id="svc";var ks;(function(e){e.click="click",e.flowStart="flowStart"})(ks||(ks={}));var _t;(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"})(_t||(_t={}));var Os;(function(e){e.quit="Quit",e.solved="Solved"})(Os||(Os={}));var Ps=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Is(t.disableBrowserPrivacySignals);this.coveoAnalyticsClient=o?new Yt(t):new fo,this.svc=new lo({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new fo,this.svc=new lo({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Yt(this.options),this.svc=new lo({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(_t.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(_t.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(_t.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(_t.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(_t.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(_t.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(_t.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(_t.caseCancelled,{reason:Os.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(_t.caseSolved,{reason:Os.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(_t.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",ks.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",ks.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return U(this,void 0,void 0,function*(){var r,n;let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof Yt?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;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:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){var i,a;let s=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(s)})}};var zg=e=>new Yt(e).getCurrentVisitorId(),Pi=(e,t)=>typeof t=="function"?(...r)=>{let n=ai(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,Ni=(e,t)=>(...r)=>{let n=ai(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();function Ns(){return{desiredCount:5,numberOfValues:8,set:{}}}m();d();f();p();m();d();f();p();m();d();f();p();function Wg(e){let{activeValue:t,ancestryMap:r}=WE(e);return t?KE(t,r):[]}function WE(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 KE(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var YE=(e,t)=>e.categoryFacetSet[t]?.request;var xd=(e,t)=>{let r=YE(e,t);return Wg(r?.currentValues??[])};m();d();f();p();function Fs(){return{}}m();d();f();p();function Ds(){return{}}m();d();f();p();function Ms(){return{}}m();d();f();p();function qs(){return{}}function Cd(e){return{facetSet:e.facetSet??qs(),categoryFacetSet:e.categoryFacetSet??Fs(),dateFacetSet:e.dateFacetSet??Ds(),numericFacetSet:e.numericFacetSet??Ms(),automaticFacetSet:e.automaticFacetSet??Ns()}}var Ed=e=>{let t=[];return JE(e).forEach((r,n)=>{let o=sR(e,r.facetId),i=iR(r,n+1);if(ZE(r)){if(!!!xd(e,r.facetId).length)return;t.push({...i,...nR(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,s)=>{if(a.state==="idle")return;let c=Kg(a,s+1,o),u=XE(r)?Yg(a):tR(a);t.push({...i,...c,...u})})}),eR(e).forEach((r,n)=>{let o=oR(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let s=Kg(i,a+1,"specific"),c=Yg(i);t.push({...o,...s,...c})})}),t},XE=e=>e.type==="specific",ZE=e=>e.type==="hierarchical",JE=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),eR=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Kg=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),tR=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),Yg=e=>({displayValue:e.value,value:e.value}),rR=(e,t)=>xd(e,t).map(n=>n.value).join(";"),nR=(e,t)=>{let n=rR(e,t);return{value:n,valuePosition:1,displayValue:n}},oR=(e,t)=>({title:Xg(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),iR=(e,t)=>({title:Xg(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),Xg=(e,t)=>`${e}_${t}`,aR=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,sR=(e,t)=>{let r=aR(e,t);return r?r.type:"specific"};m();d();f();p();m();d();f();p();var Rd=e=>e.configuration.search.locale,Zg=e=>e.configuration.search.timezone,Jg=e=>e.configuration.accessToken,eh=e=>e.configuration.organizationId,th=e=>e.configuration.environment,js=e=>e.configuration?.knowledge?.agentId,rh=e=>e.configuration.knowledge.debugAgentSession;var Me=e=>{if(cR(e)||Id(e))return e.generatedAnswer?.answerId;if(uR(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},cR=e=>"answer"in e&&"generatedAnswer"in e&&!se(e.generatedAnswer?.answerConfigurationId),Id=e=>{let t=js(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},uR=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",Td=e=>e.generatedAnswer?.fieldsToIncludeInCitations,_r=e=>e.followUpAnswers?.conversationId,lR=e=>e.generatedAnswer?.citations,dR=e=>e.followUpAnswers?.followUpAnswers,pR=$e(dR,e=>e?.flatMap(t=>t.citations)),fR=(e,t)=>t,mo=$e(lR,pR,fR,(e,t,r)=>e?.find(n=>n.id===r)??t?.find(n=>n.id===r));m();d();f();p();var Ct=()=>({q:"",enableQuerySyntax:!1});m();d();f();p();m();d();f();p();var nh=(r=>(r.Ascending="ascending",r.Descending="descending",r))(nh||{}),oh=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(oh||{}),_d=e=>{if(Yf(e))return e.map(t=>_d(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""}},ih=()=>({by:"relevancy"});var q1=new ne({values:{by:new El({enum:oh,required:!0}),order:new El({enum:nh}),field:new z}});function Ls(){return _d(ih())}m();d();f();p();m();d();f();p();var go=()=>"default";var mR=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},pr=class{constructor(t){ae(this,"getState",t);ae(this,"state");this.state=t()}getLanguage(){return mR(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let s=`context_${i}`;o[s]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=to),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||go()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};var Fi=class Fi extends pr{constructor(){super(...arguments);ae(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 Ed(Cd(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||Fi.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||Qt().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||Fi.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Me(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??Ls()}}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 i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],i=o.completions.map(u=>u.expression),a=o.partialQueries.length-1,s=o.partialQueries[a]||"",c=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:s,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:c}}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||Ct().q}get responseTime(){return this.state.search?.duration||Qt().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||Qt().response.totalCountFiltered}};ae(Fi,"fallbackPipelineName","default");var kr=Fi,ah=({logger:e,getState:t,analyticsClientMiddleware:r=(a,s)=>s,preprocessRequest:n,provider:o,disableBrowserPrivacySignals:i})=>{let a=t(),s=a.configuration.accessToken,c=a.configuration.analytics.apiBaseUrl??It(a.configuration.organizationId,a.configuration.environment,"analytics"),u=a.configuration.analytics.runtimeEnvironment,g=a.configuration.analytics.enabled,v=new Ts({token:s,endpoint:c,runtimeEnvironment:u,disableBrowserPrivacySignals:i,preprocessRequest:Pi(e,n),beforeSendHooks:[Ni(e,r),(E,y)=>(e.info({...y,type:E,endpoint:c,token:s},"Analytics request"),y)]},o);return g||v.disable(),v},kd=()=>{let t=gt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};var Us=/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield zg(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}),...(kd()&&{pageId:kd()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:co(e)})}}});return function Us(_x17,_x18){return _ref10.apply(this,arguments)}}();m();d();f();p();m();d();f();p();m();d();f();p();var ho=()=>({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""});var Di=class extends pr{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:Ct().q,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||ho().searchUid}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.recommendation?.pipeline||this.state.pipeline||"default";return t?r:void 0}get responseTime(){return this.state.recommendation?.duration||ho().duration}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.recommendation?.recommendations.length||ho().recommendations.length}};m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();function sh(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}m();d();f();p();m();d();f();p();m();d();f();p();var ch=/^(?:[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 gR(e){return typeof e=="string"&&ch.test(e)}var Od=gR;m();d();f();p();var it=[];for(let e=0;e<256;++e)it.push((e+256).toString(16).slice(1));function uh(e,t=0){return(it[e[t+0]]+it[e[t+1]]+it[e[t+2]]+it[e[t+3]]+"-"+it[e[t+4]]+it[e[t+5]]+"-"+it[e[t+6]]+it[e[t+7]]+"-"+it[e[t+8]]+it[e[t+9]]+"-"+it[e[t+10]]+it[e[t+11]]+it[e[t+12]]+it[e[t+13]]+it[e[t+14]]+it[e[t+15]]).toLowerCase()}m();d();f();p();var hR=new Uint8Array(16);function Pd(){return crypto.getRandomValues(hR)}m();d();f();p();function yR(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():vR(e,t,r)}function vR(e,t,r){e=e||{};let n=e.random??e.rng?.()??Pd();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 uh(n)}var Nd=yR;function SR(_x19){return _SR.apply(this,arguments)}function _SR(){_SR=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;if(a!=="disabled")return n.call(r),t.send(o,i,r)});return _SR.apply(this,arguments)}var gh="2.1.3",Fd=128,hh=192,lh=224,dh=240,bR=248;function wR(e){return(e&bR)===dh?4:(e&dh)===lh?3:(e&lh)===hh?2:1}function AR(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&Fd)!=Fd)break;if(r-=3,(n&hh)!=Fd){t-r>=wR(n)*3&&(r=t);break}}return e.substring(0,r)}function xR(e){let{trackingId:t}=e;return{trackingId:t}}function CR(e){return(e.source||[]).concat([`relay@${gh}`])}function yh(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:i}=r,a=xR(t),s=r.getClientId();return Object.freeze({type:e,config:a,ts:Date.now(),source:CR(t),clientId:s,userAgent:i(),referrer:ph(n()),location:ph(o())})}function ph(e){return e!==null?AR(e,1024):null}function ER(e,t,r,n){return{...t,meta:yh(e,r,n)}}var RR="*";function IR(){let e=[];function t({type:c,callback:u}){return e.findIndex(g=>g.type===c&&g.callback===u)}function r(c,u){return c.type==="*"||u===c.type}function n(c){return t(c)<0&&e.push(c),()=>s(c.type,c.callback)}function o(c){e.forEach(u=>{if(r(u,c.meta.type))try{u.callback(c)}catch(g){console.error(g)}})}function i(c){if(c===RR)e.length=0;else for(let u=e.length-1;u>=0;u--)e[u].type===c&&e.splice(u,1)}function a(c){let u=t(c);u>=0&&e.splice(u,1)}function s(c,u){u?a({type:c,callback:u}):i(c)}return{add:n,call:o,remove:s}}function fh({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 TR(e){let t=fh(e);return{get:()=>t,update:r=>{t=fh({...t,...r})}}}var Dd=_R();function _R(){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 i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,s=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${s};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function kR(){return{getItem(e){return Dd.getItem(e)||localStorage.getItem(e)},removeItem(e){Dd.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Dd.setItem(e,t,31556952e3)}}}var mh="visitorId";function OR(){let e=document.referrer;return e===""?null:e}function Md(){let e=kR();return{runtime:"browser",send:function(){var _ref11=_asyncToGenerator(function*(t,r,n){let o=A(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});sh().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let a=yield o;if(a?.ok){let s;try{s=yield a.json()}catch{return}for(let c of s.events)if(!c.accepted)throw new Error(`Received event was rejected for processing: ${c.errorMessage}`)}else throw new Error(`Error ${a.status}: Failed to send the event(s).`)});return function send(_x20,_x21,_x22){return _ref11.apply(this,arguments)}}(),getReferrer:()=>OR(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(mh);if(t&&Od(t))return t;let r=Nd();return e.setItem(mh,r),r}}}function PR(){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 NR(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function FR(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=NR();return t&&r?{...r,runtime:"custom"}:t&&DR()&&PR()?Md():n}function DR(){try{return typeof window=="object"}catch{return!1}}function MR(e){return{get:()=>Object.freeze(FR(e))}}function vh(e){let t=TR(e),r=IR(),n=MR(t);return{emit:function(){var _ref12=_asyncToGenerator(function*(o,i){let a=t.get(),s=n.get(),c=ER(o,i,a,s);return SR({config:a,environment:s,event:c,listenerManager:r})});return function emit(_x23,_x24){return _ref12.apply(this,arguments)}}(),getMeta:o=>yh(o,t.get(),n.get()),on:(o,i)=>r.add({type:o,callback:i}),off:(o,i)=>r.remove(o,i),updateConfig:o=>t.update(o),version:gh}}m();d();f();p();function Sh(){return typeof window<"u"&&typeof document<"u"}var Mi=$e(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>co(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,s)=>{let c=jR(s);return vh({mode:i?"emit":"disabled",url:o??Oa(e,t),token:r,trackingId:n??null,source:a,environment:c})}),qR={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref13=_asyncToGenerator(function*(){});return function send(){return _ref13.apply(this,arguments)}}()},jR=e=>{if(!e)return;let t=e();return{...(Sh()?Md():qR),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};m();d();f();p();var qi=class extends pr{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},bh=({logger:e,getState:t,analyticsClientMiddleware:r=(a,s)=>s,preprocessRequest:n,provider:o=new qi(t),disableBrowserPrivacySignals:i})=>{let a=t(),s=a.configuration.accessToken,c=a.configuration.analytics.apiBaseUrl??It(a.configuration.organizationId,a.configuration.environment,"analytics"),u=a.configuration.analytics.runtimeEnvironment,g=a.configuration.analytics.enabled,v=new Ps({enableAnalytics:g,token:s,endpoint:c,runtimeEnvironment:u,disableBrowserPrivacySignals:i,preprocessRequest:Pi(e,n),beforeSendHooks:[Ni(e,r),(E,y)=>(e.info({...y,type:E,endpoint:c,token:s},"Analytics request"),y)]},o);return g||v.disable(),v};m();d();f();p();m();d();f();p();function Ah(e,t){return{...new kr(t).getBaseMetadata(),actionCause:e,type:e}}function LR(e){return Object.assign(e,{instantlyCallable:!0})}function UR(e,t){let r=i=>{let a=Ie(e,i);return LR(Object.assign(a,{type:a.typePrefix}))},n=r(/*#__PURE__*/function(){var _ref14=_asyncToGenerator(function*(i,{getState:a,extra:s}){let{analyticsClientMiddleware:c,preprocessRequest:u,logger:g,disableBrowserPrivacySignals:v}=s;return yield(yield t({getState:a,analyticsClientMiddleware:c,preprocessRequest:u,logger:g,disableBrowserPrivacySignals:v})).log({state:a(),extra:s})});return function(_x25,_x26){return _ref14.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref15=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:s,logger:c,disableBrowserPrivacySignals:u}){let{description:g,log:v}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:s,logger:c,disableBrowserPrivacySignals:u});return{description:g,action:r(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(E,{getState:y,extra:h}){return yield v({state:y(),extra:h})});return function(_x28,_x29){return _ref16.apply(this,arguments)}}())}});return function prepare(_x27){return _ref15.apply(this,arguments)}}()}),n}var xh=(e,t,r)=>{function n(...o){let i=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 GR(i)}return n},VR=e=>e.configuration.analytics.analyticsMode==="legacy",BR=e=>e.configuration.analytics.analyticsMode==="next",GR=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=s=>new a(s)),UR(e,/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*({getState:s,analyticsClientMiddleware:c,preprocessRequest:u,logger:g,disableBrowserPrivacySignals:v}){let E=[],y={log:function(){var _ref18=_asyncToGenerator(function*({state:T}){for(let I of E)yield I(T)});return function log(_x31){return _ref18.apply(this,arguments)}}()},h=s(),S=i({getState:s,logger:g,analyticsClientMiddleware:c,preprocessRequest:u,disableBrowserPrivacySignals:v,provider:r(s)}),C=yield t(S,s());y.description=C?.description,E.push(/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(T){VR(T)&&(yield $R(C,r,T,g,S.coveoAnalyticsClient))});return function(_x32){return _ref19.apply(this,arguments)}}());let{emit:R}=Mi(h);return E.push(/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(T){if(BR(T)&&o&&n){let I=n(T);yield XR(R,o,I)}});return function(_x33){return _ref20.apply(this,arguments)}}()),y});return function(_x30){return _ref17.apply(this,arguments)}}()));function $R(_x34,_x35,_x36,_x37,_x38){return _$R.apply(this,arguments)}function _$R(){_$R=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _$R.apply(this,arguments)}var QR=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref21=_asyncToGenerator(function*(i){r(n,o)});return function log(_x39){return _ref21.apply(this,arguments)}}()}),Pe=xh(e=>ah({...e,provider:e.provider||new kr(e.getState)}),e=>e,kr),VB=xh(bh,QR("caseAssist"),qi);var qd=(e,t)=>{let r=t.recommendation?.recommendations.findIndex(({uniqueId:n})=>e.uniqueId===n)||0;return HR(e,r,t)},Ch=(e,t)=>({sourceName:Rh(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||Ir()}),Eh=(e,t)=>({sourceName:Rh(e),documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||Ir()});function Rh(e){let t=e.source;return se(t)?"unknown":t}var Ih=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function HR(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:KR(e),...(wh(e)?{documentCategory:wh(e)}:{}),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:YR(e),queryPipeline:r.pipeline||Ir()}}function wh(e){return e.raw?.objecttype||void 0}var Vs=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||""}),Th={urihash:new z,sourcetype:new z,permanentid:new z},_h={uniqueId:Y,raw:new ne({values:Th}),title:Y,uri:Y,clickUri:Y,rankingModifier:new z({required:!1,emptyAllowed:!0})};function zR(e){return Object.assign({},...Object.keys(Th).map(t=>({[t]:e[t]})))}function WR(e){return Object.assign({},...Object.keys(_h).map(t=>({[t]:e[t]})),{raw:zR(e.raw)})}function KR(e){let t=e.raw.author;return se(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function YR(e){let t=e.raw.source;return se(t)?"unknown":t}var jd=e=>new ht(_h).validate(WR(e));function XR(_x40,_x41,_x42){return _XR.apply(this,arguments)}function _XR(){_XR=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _XR.apply(this,arguments)}m();d();f();p();var kh=()=>Pe("analytics/recommendation/update",e=>e.makeRecommendationInterfaceLoad(),e=>new Di(e)),Oh=()=>({actionCause:"recommendationInterfaceLoad"}),Gs=e=>Pe({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(jd(e),t.makeRecommendationOpen(qd(e,r),Vs(e))),__legacy__provider:t=>new Di(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=qd(e,t),n=Vs(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});var yo=O("recommendation/set",e=>B(e,{id:Y})),Or=Ie("recommendation/get",/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=Date.now(),a=yield ZR(o),s=yield n.recommendations(a),c=Date.now()-i;return yt(s)?r(s.error):{recommendations:s.success.results,analyticsAction:kh(),duration:c,searchUid:s.success.searchUid,splitTestRun:s.success.splitTestRun,pipeline:s.success.pipeline}});return function(_x43,_x44){return _ref22.apply(this,arguments)}}()),ZR=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??wr(e.configuration.organizationId,e.configuration.environment),recommendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?gt.getInstance().getHistory():[],...(e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.context&&{context:e.context.contextValues}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.configuration.analytics.enabled&&(yield JR(e,Oh()))),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}),...(e.pagination&&{numberOfResults:e.pagination.numberOfResults})}});return function ZR(_x45){return _ref23.apply(this,arguments)}}(),JR=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=e.configuration.analytics.analyticsMode==="legacy"?void 0:{actionCause:t.actionCause,type:t.actionCause};return yield Us(e.configuration.analytics,r)});return function JR(_x46,_x47){return _ref24.apply(this,arguments)}}();var vo=Be(ho(),e=>{e.addCase(yo,(t,r)=>{t.id=r.payload.id}).addCase(Or.rejected,(t,r)=>{t.error=r.payload?r.payload:null,t.isLoading=!1}).addCase(Or.fulfilled,(t,r)=>{t.error=null,t.recommendations=r.payload.recommendations.map(n=>({...n,searchUid:r.payload.searchUid})),t.duration=r.payload.duration,t.isLoading=!1,t.searchUid=r.payload.searchUid,t.splitTestRun=r.payload.splitTestRun,t.pipeline=r.payload.pipeline}).addCase(Or.pending,t=>{t.isLoading=!0}).addCase(ms,(t,r)=>{t.error=r.payload,t.isLoading=!1})});m();d();f();p();var So=O("searchHub/set",e=>B(e,new z({required:!0,emptyAllowed:!0})));m();d();f();p();var bo=Be(go(),e=>{e.addCase(So,(t,r)=>r.payload).addCase(vt.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Wt,(t,r)=>r.payload.searchHub||t)});m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var Ph=class extends Error{constructor(t){super(t[0].message);ae(this,"issues");this.name="SchemaError",this.issues=t}};var mr="uninitialized",Vd="pending",Li="fulfilled",Ui="rejected";function Nh(e){return{status:e,isUninitialized:e===mr,isLoading:e===Vd,isSuccess:e===Li,isError:e===Ui}}var Fh=Ht;function Wh(e,t){if(e===t||!(Fh(e)&&Fh(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=Wh(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function Bd(e,t,r){return e.reduce((n,o,i)=>(t(o,i)&&n.push(r(o,i)),n),[]).flat()}function eI(e){return new RegExp("(^|:)//").test(e)}function tI(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Hd(e){return e!=null}function Dh(e){return[...(e?.values()??[])].filter(Hd)}function rI(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var nI=e=>e.replace(/\/$/,""),oI=e=>e.replace(/^\//,"");function iI(e,t){if(!e)return t;if(!t)return e;if(eI(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=nI(e),t=oI(t),`${e}${r}${t}`}function Hs(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var Gd=()=>new Map,aI=e=>{let t=new l.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},sI=(...e)=>{for(let r of e)if(r.aborted)return l.AbortSignal.abort(r.reason);let t=new l.AbortController;for(let r of e)r.addEventListener("abort",()=>t.abort(r.reason),{signal:t.signal,once:!0});return t.signal},Mh=(...e)=>A(...e),cI=e=>e.status>=200&&e.status<=299,uI=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function qh(e){if(!Ht(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}var lI=e=>typeof e=="object"&&(Ht(e)||Array.isArray(e)||typeof e.toJSON=="function");function Kh({baseUrl:e,prepareHeaders:t=v=>v,fetchFn:r=Mh,paramsSerializer:n,isJsonContentType:o=uI,jsonContentType:i="application/json",jsonReplacer:a,timeout:s,responseHandler:c,validateStatus:u,...g}={}){return typeof A>"u"&&r===Mh&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(E,y,h){let{getState:S,extra:C,endpoint:R,forced:T,type:I}=y,k,{url:_,headers:D=new x(g.headers),params:G=void 0,responseHandler:L=c??"json",validateStatus:j=u??cI,timeout:V=s,...q}=typeof E=="string"?{url:E}:E,P={...g,signal:V?sI(y.signal,aI(V)):y.signal,...q};D=new x(qh(D)),P.headers=(yield t(D,{getState:S,arg:E,extra:C,endpoint:R,forced:T,type:I,extraOptions:h}))||D;let N=lI(P.body);if(P.body!=null&&!N&&typeof P.body!="string"&&P.headers.delete("content-type"),!P.headers.has("content-type")&&N&&P.headers.set("content-type",i),N&&o(P.headers)&&(P.body=JSON.stringify(P.body,a)),P.headers.has("accept")||(L==="json"?P.headers.set("accept","application/json"):L==="text"&&P.headers.set("accept","text/plain, text/html, */*")),G){let te=~_.indexOf("?")?"&":"?",ue=n?n(G):new URLSearchParams(qh(G));_+=te+ue}_=iI(e,_);let F=new Request(_,P);k={request:new Request(_,P)};let Q;try{Q=yield r(F)}catch(te){return{error:{status:(te instanceof Error||typeof DOMException<"u"&&te instanceof DOMException)&&te.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(te)},meta:k}}let Z=Q.clone();k.response=Z;let X,W="";try{let te;if(yield Promise.all([v(Q,L).then(ue=>X=ue,ue=>te=ue),Z.text().then(ue=>W=ue,()=>{})]),te)throw te}catch(te){return{error:{status:"PARSING_ERROR",originalStatus:Q.status,data:W,error:String(te)},meta:k}}return j(Q,X)?{data:X,meta:k}:{error:{status:Q.status,data:X},meta:k}});return function(_x48,_x49,_x50){return _ref25.apply(this,arguments)}}());function v(_x51,_x52){return _v2.apply(this,arguments)}function _v2(){_v2=_asyncToGenerator(function*(E,y){if(typeof y=="function")return y(E);if(y==="content-type"&&(y=o(E.headers)?"json":"text"),y==="json"){let h=yield E.text();return h.length?JSON.parse(h):null}return E.text()});return _v2.apply(this,arguments)}}var wo=class{constructor(e,t=void 0){ae(this,"value");ae(this,"meta");this.value=e,this.meta=t}};function dI(){return _dI.apply(this,arguments)}function _dI(){_dI=_asyncToGenerator(function*(e=0,t=5,r){let n=Math.min(e,t),o=~~((Math.random()+.4)*(300<<n));yield new Promise((i,a)=>{let s=setTimeout(()=>i(),o);if(r){let c=()=>{clearTimeout(s),a(new Error("Aborted"))};r.aborted?(clearTimeout(s),a(new Error("Aborted"))):r.addEventListener("abort",c,{once:!0})}})});return _dI.apply(this,arguments)}function Yh(e,t){throw Object.assign(new wo({error:e,meta:t}),{throwImmediately:!0})}function Ld(e){e.aborted&&Yh({status:"CUSTOM_ERROR",error:"Aborted"})}var jh={},pI=(e,t)=>(/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(r,n,o){let i=[5,(t||jh).maxRetries,(o||jh).maxRetries].filter(g=>g!==void 0),[a]=i.slice(-1),c={maxRetries:a,backoff:dI,retryCondition:(g,v,{attempt:E})=>E<=a,...t,...o},u=0;for(;;){Ld(n.signal);try{let g=yield e(r,n,o);if(g.error)throw new wo(g);return g}catch(g){if(u++,g.throwImmediately){if(g instanceof wo)return g.value;throw g}if(g instanceof wo){if(!c.retryCondition(g.value.error,r,{attempt:u,baseQueryApi:n,extraOptions:o}))return g.value}else if(u>c.maxRetries)return{error:g};Ld(n.signal);try{yield c.backoff(u,c.maxRetries,n.signal)}catch(v){throw Ld(n.signal),v}}}});return function(_x53,_x54,_x55){return _ref26.apply(this,arguments)}}()),Xh=Object.assign(pI,{fail:Yh}),Ws="__rtkq/",fI="online",mI="offline";var Zh="focused";var zd=O(`${Ws}${Zh}`),Jh=O(`${Ws}un${Zh}`),Wd=O(`${Ws}${fI}`),ey=O(`${Ws}${mI}`);var Gi="query",ty="mutation",ry="infinitequery";function Ks(e){return e.type===Gi}function gI(e){return e.type===ty}function Ys(e){return e.type===ry}function zs(e){return Ks(e)||Ys(e)}function Kd(e,t,r,n,o,i){let a=hI(e)?e(t,r,n,o):e;return a?Bd(a,Hd,s=>i(ny(s))):[]}function hI(e){return typeof e=="function"}function ny(e){return typeof e=="string"?{type:e}:e}function yI(e,t){return e.catch(t)}var Ao=(e,t)=>e.endpointDefinitions[t],Vi=Symbol("forceQueryFn"),$d=e=>typeof e[Vi]=="function";function vI({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i,getInternalState:a}){let s=_=>a(_)?.runningQueries,c=_=>a(_)?.runningMutations,{unsubscribeQueryResult:u,removeMutationResult:g,updateSubscriptionOptions:v}=o.internalActions;return{buildInitiateQuery:T,buildInitiateInfiniteQuery:I,buildInitiateMutation:k,getRunningQueryThunk:E,getRunningMutationThunk:y,getRunningQueriesThunk:h,getRunningMutationsThunk:S};function E(_,D){return G=>{let L=Ao(i,_),j=e({queryArgs:D,endpointDefinition:L,endpointName:_});return s(G)?.get(j)}}function y(_,D){return G=>c(G)?.get(D)}function h(){return _=>Dh(s(_))}function S(){return _=>Dh(c(_))}function C(_){}function R(_,D){let G=(L,{subscribe:j=!0,forceRefetch:V,subscriptionOptions:q,[Vi]:P,...N}={})=>(F,H)=>{let Q=e({queryArgs:L,endpointDefinition:D,endpointName:_}),Z,X={...N,type:Gi,subscribe:j,forceRefetch:V,subscriptionOptions:q,endpointName:_,originalArgs:L,queryCacheKey:Q,[Vi]:P};if(Ks(D))Z=t(X);else{let{direction:me,initialPageParam:be,refetchCachedPages:he}=N;Z=r({...X,direction:me,initialPageParam:be,refetchCachedPages:he})}let W=o.endpoints[_].select(L),te=F(Z),ue=W(H());let{requestId:Ee,abort:je}=te,ke=ue.requestId!==Ee,Ne=s(F)?.get(Q),Fe=()=>W(H()),ge=Object.assign(P?te.then(Fe):ke&&!Ne?Promise.resolve(ue):Promise.all([Ne,te]).then(Fe),{arg:L,requestId:Ee,subscriptionOptions:q,queryCacheKey:Q,abort:je,unwrap(){return _asyncToGenerator(function*(){let me=yield ge;if(me.isError)throw me.error;return me.data})()},refetch:me=>F(G(L,{subscribe:!1,forceRefetch:!0,...me})),unsubscribe(){j&&F(u({queryCacheKey:Q,requestId:Ee}))},updateSubscriptionOptions(me){ge.subscriptionOptions=me,F(v({endpointName:_,requestId:Ee,queryCacheKey:Q,options:me}))}});if(!Ne&&!ke&&!P){let me=s(F);me.set(Q,ge),ge.then(()=>{me.delete(Q)})}return ge};return G}function T(_,D){return R(_,D)}function I(_,D){return R(_,D)}function k(_){return(D,{track:G=!0,fixedCacheKey:L}={})=>(j,V)=>{let q=n({type:"mutation",endpointName:_,originalArgs:D,track:G,fixedCacheKey:L}),P=j(q);let{requestId:N,abort:F,unwrap:H}=P,Q=yI(P.unwrap().then(te=>({data:te})),te=>({error:te})),Z=()=>{j(g({requestId:N,fixedCacheKey:L}))},X=Object.assign(Q,{arg:P.arg,requestId:N,abort:F,unwrap:H,reset:Z}),W=c(j);return W.set(N,X),X.then(()=>{W.delete(N)}),L&&(W.set(L,X),X.then(()=>{W.get(L)===X&&W.delete(L)})),X}}}var oy=class extends Ph{constructor(t,r,n,o){super(t);ae(this,"value");ae(this,"schemaName");ae(this,"_bqMeta");this.value=r,this.schemaName=n,this._bqMeta=o}},dn=(e,t)=>Array.isArray(e)?e.includes(t):!!e;function pn(_x56,_x57,_x58,_x59){return _pn.apply(this,arguments)}function _pn(){_pn=_asyncToGenerator(function*(e,t,r,n){let o=yield e["~standard"].validate(t);if(o.issues)throw new oy(o.issues,t,r,n);return o.value});return _pn.apply(this,arguments)}function Lh(e){return e}var ji=(e={})=>({...e,[Ei]:!0});function SI({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a,onSchemaFailure:s,catchSchemaFailure:c,skipSchemaValidation:u}){let g=(q,P,N,F)=>(H,Q)=>{let Z=r[q],X=n({queryArgs:P,endpointDefinition:Z,endpointName:q});if(H(o.internalActions.queryResultPatched({queryCacheKey:X,patches:N})),!F)return;let W=o.endpoints[q].select(P)(Q()),te=Kd(Z.providesTags,W.data,void 0,P,{},i);H(o.internalActions.updateProvidedBy([{queryCacheKey:X,providedTags:te}]))};function v(q,P,N=0){let F=[P,...q];return N&&F.length>N?F.slice(0,-1):F}function E(q,P,N=0){let F=[...q,P];return N&&F.length>N?F.slice(1):F}let y=(q,P,N,F=!0)=>(H,Q)=>{let X=o.endpoints[q].select(P)(Q()),W={patches:[],inversePatches:[],undo:()=>H(o.util.patchQueryData(q,P,W.inversePatches,F))};if(X.status===mr)return W;let te;if("data"in X)if(ut(X.data)){let[ue,Ee,je]=Yl(X.data,N);W.patches.push(...Ee),W.inversePatches.push(...je),te=ue}else te=N(X.data),W.patches.push({op:"replace",path:[],value:te}),W.inversePatches.push({op:"replace",path:[],value:X.data});return W.patches.length===0||H(o.util.patchQueryData(q,P,W.patches,F)),W},h=(q,P,N)=>F=>F(o.endpoints[q].initiate(P,{subscribe:!1,forceRefetch:!0,[Vi]:()=>({data:N})})),S=(q,P)=>q.query&&q[P]?q[P]:Lh,C=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(q,{signal:P,abort:N,rejectWithValue:F,fulfillWithValue:H,dispatch:Q,getState:Z,extra:X}){let W=r[q.endpointName],{metaSchema:te,skipSchemaValidation:ue=u}=W,Ee=q.type===Gi;try{let je=Lh,ke={signal:P,abort:N,dispatch:Q,getState:Z,extra:X,endpoint:q.endpointName,type:q.type,forced:Ee?R(q,Z()):void 0,queryCacheKey:Ee?q.queryCacheKey:void 0},Ne=Ee?q[Vi]:void 0,Fe,ge=/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(be,he,He,Ke){if(he==null&&be.pages.length)return Promise.resolve({data:be});let Dt={queryArg:q.originalArgs,pageParam:he},At=yield me(Dt),Gt=Ke?v:E;return{data:{pages:Gt(be.pages,At.data,He),pageParams:Gt(be.pageParams,he,He)},meta:At.meta}});return function ge(_x62,_x63,_x64,_x65){return _ref28.apply(this,arguments)}}();function me(_x66){return _me.apply(this,arguments)}function _me(){_me=_asyncToGenerator(function*(be){let he,{extraOptions:He,argSchema:Ke,rawResponseSchema:Dt,responseSchema:At}=W;if(Ke&&!dn(ue,"arg")&&(be=yield pn(Ke,be,"argSchema",{})),Ne?he=Ne():W.query?(je=S(W,"transformResponse"),he=yield t(W.query(be),ke,He)):he=yield W.queryFn(be,ke,He,Mt=>t(Mt,ke,He)),typeof process<"u",he.error)throw new wo(he.error,he.meta);let{data:Gt}=he;Dt&&!dn(ue,"rawResponse")&&(Gt=yield pn(Dt,he.data,"rawResponseSchema",he.meta));let Rt=yield je(Gt,he.meta,be);return At&&!dn(ue,"response")&&(Rt=yield pn(At,Rt,"responseSchema",he.meta)),{...he,data:Rt}});return _me.apply(this,arguments)}if(Ee&&"infiniteQueryOptions"in W){let{infiniteQueryOptions:be}=W,{maxPages:he=1/0}=be,He=q.refetchCachedPages??be.refetchCachedPages??!0,Ke,Dt={pages:[],pageParams:[]},At=a.selectQueryEntry(Z(),q.queryCacheKey)?.data,Rt=R(q,Z())&&!q.direction||!At?Dt:At;if("direction"in q&&q.direction&&Rt.pages.length){let Mt=q.direction==="backward",Aa=(Mt?iy:Qd)(be,Rt,q.originalArgs);Ke=yield ge(Rt,Aa,he,Mt)}else{let{initialPageParam:Mt=be.initialPageParam}=q,Jo=At?.pageParams??[],Aa=Jo[0]??Mt,Hw=Jo.length;if(Ke=yield ge(Rt,Aa,he),Ne&&(Ke={data:Ke.data.pages[0]}),He)for(let Of=1;Of<Hw;Of++){let zw=Qd(be,Ke.data,q.originalArgs);Ke=yield ge(Ke.data,zw,he)}}Fe=Ke}else Fe=yield me(q.originalArgs);return te&&!dn(ue,"meta")&&Fe.meta&&(Fe.meta=yield pn(te,Fe.meta,"metaSchema",Fe.meta)),H(Fe.data,ji({fulfilledTimeStamp:Date.now(),baseQueryMeta:Fe.meta}))}catch(je){let ke=je;if(ke instanceof wo){let Ne=S(W,"transformErrorResponse"),{rawErrorResponseSchema:Fe,errorResponseSchema:ge}=W,{value:me,meta:be}=ke;try{Fe&&!dn(ue,"rawErrorResponse")&&(me=yield pn(Fe,me,"rawErrorResponseSchema",be)),te&&!dn(ue,"meta")&&(be=yield pn(te,be,"metaSchema",be));let he=yield Ne(me,be,q.originalArgs);return ge&&!dn(ue,"errorResponse")&&(he=yield pn(ge,he,"errorResponseSchema",be)),F(he,ji({baseQueryMeta:be}))}catch(he){ke=he}}try{if(ke instanceof oy){let Ne={endpoint:q.endpointName,arg:q.originalArgs,type:q.type,queryCacheKey:Ee?q.queryCacheKey:void 0};W.onSchemaFailure?.(ke,Ne),s?.(ke,Ne);let{catchSchemaFailure:Fe=c}=W;if(Fe)return F(Fe(ke,Ne),ji({baseQueryMeta:ke._bqMeta}))}}catch(Ne){ke=Ne}throw typeof process<"u",console.error(ke),ke}});return function C(_x60,_x61){return _ref27.apply(this,arguments)}}();function R(q,P){let N=a.selectQueryEntry(P,q.queryCacheKey),F=a.selectConfig(P).refetchOnMountOrArgChange,H=N?.fulfilledTimeStamp,Q=q.forceRefetch??(q.subscribe&&F);return Q?Q===!0||(Number(new Date)-Number(H))/1e3>=Q:!1}let T=()=>Ie(`${e}/executeQuery`,C,{getPendingMeta({arg:P}){let N=r[P.endpointName];return ji({startedTimeStamp:Date.now(),...(Ys(N)?{direction:P.direction}:{})})},condition(P,{getState:N}){let F=N(),H=a.selectQueryEntry(F,P.queryCacheKey),Q=H?.fulfilledTimeStamp,Z=P.originalArgs,X=H?.originalArgs,W=r[P.endpointName],te=P.direction;return $d(P)?!0:H?.status==="pending"?!1:R(P,F)||Ks(W)&&W?.forceRefetch?.({currentArg:Z,previousArg:X,endpointState:H,state:F})?!0:!(Q&&!te)},dispatchConditionRejection:!0}),I=T(),k=T(),_=Ie(`${e}/executeMutation`,C,{getPendingMeta(){return ji({startedTimeStamp:Date.now()})}}),D=q=>"force"in q,G=q=>"ifOlderThan"in q,L=(q,P,N={})=>(F,H)=>{let Q=D(N)&&N.force,Z=G(N)&&N.ifOlderThan,X=(te=!0)=>{let ue={forceRefetch:te,subscribe:!1};return o.endpoints[q].initiate(P,ue)},W=o.endpoints[q].select(P)(H());if(Q)F(X());else if(Z){let te=W?.fulfilledTimeStamp;if(!te){F(X());return}(Number(new Date)-Number(new Date(te)))/1e3>=Z&&F(X())}else F(X(!1))};function j(q){return P=>P?.meta?.arg?.endpointName===q}function V(q,P){return{matchPending:Jn(ns(q),j(P)),matchFulfilled:Jn(cr(q),j(P)),matchRejected:Jn(sn(q),j(P))}}return{queryThunk:I,mutationThunk:_,infiniteQueryThunk:k,prefetch:L,updateQueryData:y,upsertQueryData:h,patchQueryData:g,buildMatchThunkActions:V}}function Qd(e,{pages:t,pageParams:r},n){let o=t.length-1;return e.getNextPageParam(t[o],t,r[o],r,n)}function iy(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function ay(e,t,r,n){return Kd(r[e.meta.arg.endpointName][t],cr(e)?e.payload:void 0,Ii(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function Uh(e){return ft(e)?Ya(e):e}function $s(e,t,r){let n=e[t];n&&r(n)}function Bi(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Vh(e,t,r){let n=e[Bi(t)];n&&r(n)}var Qs={};function bI({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:s},assertTagType:c,config:u}){let g=O(`${e}/resetApiState`);function v(j,V,q,P){var N;j[N=V.queryCacheKey]??(j[N]={status:mr,endpointName:V.endpointName}),$s(j,V.queryCacheKey,F=>{F.status=Vd,F.requestId=q&&F.requestId?F.requestId:P.requestId,V.originalArgs!==void 0&&(F.originalArgs=V.originalArgs),F.startedTimeStamp=P.startedTimeStamp;let H=o[P.arg.endpointName];Ys(H)&&"direction"in V&&(F.direction=V.direction)})}function E(j,V,q,P){$s(j,V.arg.queryCacheKey,N=>{if(N.requestId!==V.requestId&&!P)return;let{merge:F}=o[V.arg.endpointName];if(N.status=Li,F){if(N.data!==void 0){let{fulfilledTimeStamp:H,arg:Q,baseQueryMeta:Z,requestId:X}=V,W=on(N.data,te=>F(te,q,{arg:Q.originalArgs,baseQueryMeta:Z,fulfilledTimeStamp:H,requestId:X}));N.data=W}else N.data=q;}else N.data=o[V.arg.endpointName].structuralSharing??!0?Wh(ft(N.data)?Tm(N.data):N.data,q):q;delete N.error,N.fulfilledTimeStamp=V.fulfilledTimeStamp})}let y=cn({name:`${e}/queries`,initialState:Qs,reducers:{removeQueryResult:{reducer(j,{payload:{queryCacheKey:V}}){delete j[V]},prepare:eo()},cacheEntriesUpserted:{reducer(j,V){for(let q of V.payload){let{queryDescription:P,value:N}=q;v(j,P,!0,{arg:P,requestId:V.meta.requestId,startedTimeStamp:V.meta.timestamp}),E(j,{arg:P,requestId:V.meta.requestId,fulfilledTimeStamp:V.meta.timestamp,baseQueryMeta:{}},N,!0)}},prepare:j=>({payload:j.map(P=>{let{endpointName:N,arg:F,value:H}=P,Q=o[N];return{queryDescription:{type:Gi,endpointName:N,originalArgs:P.arg,queryCacheKey:n({queryArgs:F,endpointDefinition:Q,endpointName:N})},value:H}}),meta:{[Ei]:!0,requestId:Ti(),timestamp:Date.now()}})},queryResultPatched:{reducer(j,{payload:{queryCacheKey:V,patches:q}}){$s(j,V,P=>{P.data=Xl(P.data,q.concat())})},prepare:eo()}},extraReducers(j){j.addCase(t.pending,(V,{meta:q,meta:{arg:P}})=>{let N=$d(P);v(V,P,N,q)}).addCase(t.fulfilled,(V,{meta:q,payload:P})=>{let N=$d(q.arg);E(V,q,P,N)}).addCase(t.rejected,(V,{meta:{condition:q,arg:P,requestId:N},error:F,payload:H})=>{$s(V,P.queryCacheKey,Q=>{if(!q){if(Q.requestId!==N)return;Q.status=Ui,Q.error=H??F}})}).addMatcher(s,(V,q)=>{let{queries:P}=a(q);for(let[N,F]of Object.entries(P))(F?.status===Li||F?.status===Ui)&&(V[N]=F)})}}),h=cn({name:`${e}/mutations`,initialState:Qs,reducers:{removeMutationResult:{reducer(j,{payload:V}){let q=Bi(V);q in j&&delete j[q]},prepare:eo()}},extraReducers(j){j.addCase(r.pending,(V,{meta:q,meta:{requestId:P,arg:N,startedTimeStamp:F}})=>{N.track&&(V[Bi(q)]={requestId:P,status:Vd,endpointName:N.endpointName,startedTimeStamp:F})}).addCase(r.fulfilled,(V,{payload:q,meta:P})=>{P.arg.track&&Vh(V,P,N=>{N.requestId===P.requestId&&(N.status=Li,N.data=q,N.fulfilledTimeStamp=P.fulfilledTimeStamp)})}).addCase(r.rejected,(V,{payload:q,error:P,meta:N})=>{N.arg.track&&Vh(V,N,F=>{F.requestId===N.requestId&&(F.status=Ui,F.error=q??P)})}).addMatcher(s,(V,q)=>{let{mutations:P}=a(q);for(let[N,F]of Object.entries(P))(F?.status===Li||F?.status===Ui)&&N!==F?.requestId&&(V[N]=F)})}}),S={tags:{},keys:{}},C=cn({name:`${e}/invalidation`,initialState:S,reducers:{updateProvidedBy:{reducer(j,V){var q,P,N;for(let{queryCacheKey:F,providedTags:H}of V.payload){R(j,F);for(let{type:Q,id:Z}of H){let X=(P=(q=j.tags)[Q]??(q[Q]={}))[N=Z||"__internal_without_id"]??(P[N]=[]);X.includes(F)||X.push(F)}j.keys[F]=H}},prepare:eo()}},extraReducers(j){j.addCase(y.actions.removeQueryResult,(V,{payload:{queryCacheKey:q}})=>{R(V,q)}).addMatcher(s,(V,q)=>{var N,F,H;let{provided:P}=a(q);for(let[Q,Z]of Object.entries(P.tags??{}))for(let[X,W]of Object.entries(Z)){let te=(F=(N=V.tags)[Q]??(N[Q]={}))[H=X||"__internal_without_id"]??(F[H]=[]);for(let ue of W)te.includes(ue)||te.push(ue),V.keys[ue]=P.keys[ue]}}).addMatcher(zt(cr(t),Ii(t)),(V,q)=>{T(V,[q])}).addMatcher(y.actions.cacheEntriesUpserted.match,(V,q)=>{let P=q.payload.map(({queryDescription:N,value:F})=>({type:"UNKNOWN",payload:F,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:N}}));T(V,P)})}});function R(j,V){let q=Uh(j.keys[V]??[]);for(let P of q){let N=P.type,F=P.id??"__internal_without_id",H=j.tags[N]?.[F];H&&(j.tags[N][F]=Uh(H).filter(Q=>Q!==V))}delete j.keys[V]}function T(j,V){let q=V.map(P=>{let N=ay(P,"providesTags",o,c),{queryCacheKey:F}=P.meta.arg;return{queryCacheKey:F,providedTags:N}});C.caseReducers.updateProvidedBy(j,C.actions.updateProvidedBy(q))}let I=cn({name:`${e}/subscriptions`,initialState:Qs,reducers:{updateSubscriptionOptions(j,V){},unsubscribeQueryResult(j,V){},internal_getRTKQSubscriptions(){}}}),k=cn({name:`${e}/internalSubscriptions`,initialState:Qs,reducers:{subscriptionsUpdated:{reducer(j,V){return Xl(j,V.payload)},prepare:eo()}}}),_=cn({name:`${e}/config`,initialState:{online:rI(),focused:tI(),middlewareRegistered:!1,...u},reducers:{middlewareRegistered(j,{payload:V}){j.middlewareRegistered=j.middlewareRegistered==="conflict"||i!==V?"conflict":!0}},extraReducers:j=>{j.addCase(Wd,V=>{V.online=!0}).addCase(ey,V=>{V.online=!1}).addCase(zd,V=>{V.focused=!0}).addCase(Jh,V=>{V.focused=!1}).addMatcher(s,V=>({...V}))}}),D=Kn({queries:y.reducer,mutations:h.reducer,provided:C.reducer,subscriptions:k.reducer,config:_.reducer}),G=(j,V)=>D(g.match(V)?void 0:j,V),L={..._.actions,...y.actions,...I.actions,...k.actions,...h.actions,...C.actions,resetApiState:g};return{reducer:G,actions:L}}var Ud=Symbol.for("RTKQ/skipToken"),sy={status:mr},Bh=on(sy,()=>{}),Gh=on(sy,()=>{});function wI({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=I=>Bh,o=I=>Gh;return{buildQuerySelector:E,buildInfiniteQuerySelector:y,buildMutationSelector:h,selectInvalidatedBy:S,selectCachedArgsForQuery:C,selectApiState:a,selectQueries:s,selectMutations:u,selectQueryEntry:c,selectConfig:g};function i(I){return{...I,...Nh(I.status)}}function a(I){return I[t]}function s(I){return a(I)?.queries}function c(I,k){return s(I)?.[k]}function u(I){return a(I)?.mutations}function g(I){return a(I)?.config}function v(I,k,_){return D=>{if(D===Ud)return r(n,_);let G=e({queryArgs:D,endpointDefinition:k,endpointName:I});return r(j=>c(j,G)??Bh,_)}}function E(I,k){return v(I,k,i)}function y(I,k){let{infiniteQueryOptions:_}=k;function D(G){let L={...G,...Nh(G.status)},{isLoading:j,isError:V,direction:q}=L,P=q==="forward",N=q==="backward";return{...L,hasNextPage:R(_,L.data,L.originalArgs),hasPreviousPage:T(_,L.data,L.originalArgs),isFetchingNextPage:j&&P,isFetchingPreviousPage:j&&N,isFetchNextPageError:V&&P,isFetchPreviousPageError:V&&N}}return v(I,k,D)}function h(){return I=>{let k;return typeof I=="object"?k=Bi(I)??Ud:k=I,r(k===Ud?o:G=>a(G)?.mutations?.[k]??Gh,i)}}function S(I,k){let _=I[t],D=new Set,G=Bd(k,Hd,ny);for(let L of G){let j=_.provided.tags[L.type];if(!j)continue;let V=(L.id!==void 0?j[L.id]:Object.values(j).flat())??[];for(let q of V)D.add(q)}return Array.from(D.values()).flatMap(L=>{let j=_.queries[L];return j?{queryCacheKey:L,endpointName:j.endpointName,originalArgs:j.originalArgs}:[]})}function C(I,k){return Bd(Object.values(s(I)),_=>_?.endpointName===k&&_.status!==mr,_=>_.originalArgs)}function R(I,k,_){return k?Qd(I,k,_)!=null:!1}function T(I,k,_){return!k||!I.getPreviousPageParam?!1:iy(I,k,_)!=null}}var $h=WeakMap?new WeakMap:void 0,Qh=({endpointName:e,queryArgs:t})=>{let r="",n=$h?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=Ht(a)?Object.keys(a).sort().reduce((s,c)=>(s[c]=a[c],s),{}):a,a));Ht(t)&&$h?.set(t,o),r=o}return`${e}(${r})`};function AI(...e){return function(r){let n=xi(u=>r.extractRehydrationInfo?.(u,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(u){let g=Qh;if("serializeQueryArgs"in u.endpointDefinition){let v=u.endpointDefinition.serializeQueryArgs;g=E=>{let y=v(E);return typeof y=="string"?y:Qh({...E,queryArgs:y})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(u)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(u){u()},apiUid:Ti(),extractRehydrationInfo:n,hasRehydrationInfo:xi(u=>n(u)!=null)},a={injectEndpoints:c,enhanceEndpoints({addTagTypes:u,endpoints:g}){if(u)for(let v of u)o.tagTypes.includes(v)||o.tagTypes.push(v);if(g)for(let[v,E]of Object.entries(g))typeof E=="function"?E(Ao(i,v)):Object.assign(Ao(i,v)||{},E);return a}},s=e.map(u=>u.init(a,o,i));function c(u){let g=u.endpoints({query:v=>({...v,type:Gi}),mutation:v=>({...v,type:ty}),infiniteQuery:v=>({...v,type:ry})});for(let[v,E]of Object.entries(g)){if(u.overrideExisting!==!0&&v in i.endpointDefinitions){if(u.overrideExisting==="throw")throw new Error(mt(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[v]=E;for(let y of s)y.injectEndpoint(v,E)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function fr(e,...t){return Object.assign(e,...t)}var xI=({api:e,queryThunk:t,internalState:r,mwApi:n})=>{let o=`${e.reducerPath}/subscriptions`,i=null,a=null,{updateSubscriptionOptions:s,unsubscribeQueryResult:c}=e.internalActions,u=(S,C)=>{if(s.match(C)){let{queryCacheKey:T,requestId:I,options:k}=C.payload,_=S.get(T);return _?.has(I)&&_.set(I,k),!0}if(c.match(C)){let{queryCacheKey:T,requestId:I}=C.payload,k=S.get(T);return k&&k.delete(I),!0}if(e.internalActions.removeQueryResult.match(C))return S.delete(C.payload.queryCacheKey),!0;if(t.pending.match(C)){let{meta:{arg:T,requestId:I}}=C,k=Hs(S,T.queryCacheKey,Gd);return T.subscribe&&k.set(I,T.subscriptionOptions??k.get(I)??{}),!0}let R=!1;if(t.rejected.match(C)){let{meta:{condition:T,arg:I,requestId:k}}=C;if(T&&I.subscribe){let _=Hs(S,I.queryCacheKey,Gd);_.set(k,I.subscriptionOptions??_.get(k)??{}),R=!0}}return R},g=()=>r.currentSubscriptions,y={getSubscriptions:g,getSubscriptionCount:S=>g().get(S)?.size??0,isRequestSubscribed:(S,C)=>!!g()?.get(S)?.get(C)};function h(S){return JSON.parse(JSON.stringify(Object.fromEntries([...S].map(([C,R])=>[C,Object.fromEntries(R)]))))}return(S,C)=>{if(i||(i=h(r.currentSubscriptions)),e.util.resetApiState.match(S))return i={},r.currentSubscriptions.clear(),a=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(S))return[!1,y];let R=u(r.currentSubscriptions,S),T=!0;if(R){a||(a=setTimeout(()=>{let _=h(r.currentSubscriptions),[,D]=Yl(i,()=>_);C.next(e.internalActions.subscriptionsUpdated(D)),i=_,a=null},500));let I=typeof S.type=="string"&&!!S.type.startsWith(o),k=t.rejected.match(S)&&S.meta.condition&&!!S.meta.arg.subscribe;T=!I&&!k}return[T,!1]}},CI=2147483647/1e3-1,EI=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a},getRunningQueryThunk:s,mwApi:c})=>{let{removeQueryResult:u,unsubscribeQueryResult:g,cacheEntriesUpserted:v}=t.internalActions,E=zt(g.match,r.fulfilled,r.rejected,v.match);function y(I){let k=o.currentSubscriptions.get(I);return k?k.size>0:!1}let h={};function S(I){for(let k of I.values())k?.abort?.()}let C=(I,k)=>{let _=k.getState(),D=a(_);if(E(I)){let G;if(v.match(I))G=I.payload.map(L=>L.queryDescription.queryCacheKey);else{let{queryCacheKey:L}=g.match(I)?I.payload:I.meta.arg;G=[L]}R(G,k,D)}if(t.util.resetApiState.match(I)){for(let[G,L]of Object.entries(h))L&&clearTimeout(L),delete h[G];S(o.runningQueries),S(o.runningMutations)}if(n.hasRehydrationInfo(I)){let{queries:G}=n.extractRehydrationInfo(I);R(Object.keys(G),k,D)}};function R(I,k,_){let D=k.getState();for(let G of I){let L=i(D,G);L?.endpointName&&T(G,L.endpointName,k,_)}}function T(I,k,_,D){let L=Ao(n,k)?.keepUnusedDataFor??D.keepUnusedDataFor;if(L===1/0)return;let j=Math.max(0,Math.min(L,CI));if(!y(I)){let V=h[I];V&&clearTimeout(V),h[I]=setTimeout(()=>{if(!y(I)){let q=i(_.getState(),I);q?.endpointName&&_.dispatch(s(q.endpointName,q.originalArgs))?.abort(),_.dispatch(u({queryCacheKey:I}))}delete h[I]},j*1e3)}}return C},Hh=new Error("Promise never resolved before cacheEntryRemoved."),RI=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:s}})=>{let c=os(n),u=os(o),g=cr(n,o),v={},{removeQueryResult:E,removeMutationResult:y,cacheEntriesUpserted:h}=e.internalActions;function S(_,D,G){let L=v[_];L?.valueResolved&&(L.valueResolved({data:D,meta:G}),delete L.valueResolved)}function C(_){let D=v[_];D&&(delete v[_],D.cacheEntryRemoved())}function R(_){let{arg:D,requestId:G}=_.meta,{endpointName:L,originalArgs:j}=D;return[L,j,G]}let T=(_,D,G)=>{let L=I(_);function j(V,q,P,N){let F=a(G,q),H=a(D.getState(),q);!F&&H&&k(V,N,q,D,P)}if(n.pending.match(_)){let[V,q,P]=R(_);j(V,L,P,q)}else if(h.match(_))for(let{queryDescription:V,value:q}of _.payload){let{endpointName:P,originalArgs:N,queryCacheKey:F}=V;j(P,F,_.meta.requestId,N),S(F,q,{})}else if(o.pending.match(_)){if(D.getState()[t].mutations[L]){let[q,P,N]=R(_);k(q,P,L,D,N)}}else if(g(_))S(L,_.payload,_.meta.baseQueryMeta);else if(E.match(_)||y.match(_))C(L);else if(e.util.resetApiState.match(_))for(let V of Object.keys(v))C(V)};function I(_){return c(_)?_.meta.arg.queryCacheKey:u(_)?_.meta.arg.fixedCacheKey??_.meta.requestId:E.match(_)?_.payload.queryCacheKey:y.match(_)?Bi(_.payload):""}function k(_,D,G,L,j){let V=Ao(r,_),q=V?.onCacheEntryAdded;if(!q)return;let P={},N=new Promise(W=>{P.cacheEntryRemoved=W}),F=Promise.race([new Promise(W=>{P.valueResolved=W}),N.then(()=>{throw Hh})]);F.catch(()=>{}),v[G]=P;let H=e.endpoints[_].select(zs(V)?D:G),Q=L.dispatch((W,te,ue)=>ue),Z={...L,getCacheEntry:()=>H(L.getState()),requestId:j,extra:Q,updateCachedData:zs(V)?W=>L.dispatch(e.util.updateQueryData(_,D,W)):void 0,cacheDataLoaded:F,cacheEntryRemoved:N},X=q(D,Z);Promise.resolve(X).catch(W=>{if(W!==Hh)throw W})}return T},II=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},TI=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:s,internalState:c})=>{let{removeQueryResult:u}=i.internalActions,g=zt(cr(n),Ii(n)),v=zt(cr(o,n),sn(o,n)),E=[],y=0,h=(R,T)=>{(o.pending.match(R)||n.pending.match(R))&&y++,v(R)&&(y=Math.max(0,y-1)),g(R)?C(ay(R,"invalidatesTags",r,a),T):v(R)?C([],T):i.util.invalidateTags.match(R)&&C(Kd(R.payload,void 0,void 0,void 0,void 0,a),T)};function S(){return y>0}function C(R,T){let I=T.getState(),k=I[e];if(E.push(...R),k.config.invalidationBehavior==="delayed"&&S())return;let _=E;if(E=[],_.length===0)return;let D=i.util.selectInvalidatedBy(I,_);t.batch(()=>{let G=Array.from(D.values());for(let{queryCacheKey:L}of G){let j=k.queries[L],V=Hs(c.currentSubscriptions,L,Gd);j&&(V.size===0?T.dispatch(u({queryCacheKey:L})):j.status!==mr&&T.dispatch(s(j)))}})}return h},_I=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let{currentPolls:i,currentSubscriptions:a}=o,s=new Set,c=null,u=(C,R)=>{(r.internalActions.updateSubscriptionOptions.match(C)||r.internalActions.unsubscribeQueryResult.match(C))&&g(C.payload.queryCacheKey,R),(t.pending.match(C)||t.rejected.match(C)&&C.meta.condition)&&g(C.meta.arg.queryCacheKey,R),(t.fulfilled.match(C)||t.rejected.match(C)&&!C.meta.condition)&&v(C.meta.arg,R),r.util.resetApiState.match(C)&&(h(),c&&(clearTimeout(c),c=null),s.clear())};function g(C,R){s.add(C),c||(c=setTimeout(()=>{for(let T of s)E({queryCacheKey:T},R);s.clear(),c=null},0))}function v({queryCacheKey:C},R){let T=R.getState()[e],I=T.queries[C],k=a.get(C);if(!I||I.status===mr)return;let{lowestPollingInterval:_,skipPollingIfUnfocused:D}=S(k);if(!Number.isFinite(_))return;let G=i.get(C);G?.timeout&&(clearTimeout(G.timeout),G.timeout=void 0);let L=Date.now()+_;i.set(C,{nextPollTimestamp:L,pollingInterval:_,timeout:setTimeout(()=>{(T.config.focused||!D)&&R.dispatch(n(I)),v({queryCacheKey:C},R)},_)})}function E({queryCacheKey:C},R){let I=R.getState()[e].queries[C],k=a.get(C);if(!I||I.status===mr)return;let{lowestPollingInterval:_}=S(k);if(!Number.isFinite(_)){y(C);return}let D=i.get(C),G=Date.now()+_;(!D||G<D.nextPollTimestamp)&&v({queryCacheKey:C},R)}function y(C){let R=i.get(C);R?.timeout&&clearTimeout(R.timeout),i.delete(C)}function h(){for(let C of i.keys())y(C)}function S(C=new Map){let R=!1,T=Number.POSITIVE_INFINITY;for(let I of C.values())I.pollingInterval&&(T=Math.min(I.pollingInterval,T),R=I.skipPollingIfUnfocused||R);return{lowestPollingInterval:T,skipPollingIfUnfocused:R}}return u},kI=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=ns(r,n),i=sn(r,n),a=cr(r,n),s={};return(u,g)=>{if(o(u)){let{requestId:v,arg:{endpointName:E,originalArgs:y}}=u.meta,h=Ao(t,E),S=h?.onQueryStarted;if(S){let C={},R=new Promise((_,D)=>{C.resolve=_,C.reject=D});R.catch(()=>{}),s[v]=C;let T=e.endpoints[E].select(zs(h)?y:v),I=g.dispatch((_,D,G)=>G),k={...g,getCacheEntry:()=>T(g.getState()),requestId:v,extra:I,updateCachedData:zs(h)?_=>g.dispatch(e.util.updateQueryData(E,y,_)):void 0,queryFulfilled:R};S(y,k)}}else if(a(u)){let{requestId:v,baseQueryMeta:E}=u.meta;s[v]?.resolve({data:u.payload,meta:E}),delete s[v]}else if(i(u)){let{requestId:v,rejectedWithValue:E,baseQueryMeta:y}=u.meta;s[v]?.reject({error:u.payload??u.error,isUnhandledError:!E,meta:y}),delete s[v]}}},OI=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(c,u)=>{zd.match(c)&&s(u,"refetchOnFocus"),Wd.match(c)&&s(u,"refetchOnReconnect")};function s(c,u){let g=c.getState()[e],v=g.queries,E=o.currentSubscriptions;t.batch(()=>{for(let y of E.keys()){let h=v[y],S=E.get(y);if(!S||!h)continue;let C=[...S.values()];(C.some(T=>T[u]===!0)||C.every(T=>T[u]===void 0)&&g.config[u])&&(S.size===0?c.dispatch(i({queryCacheKey:y})):h.status!==mr&&c.dispatch(n(h)))}})}return a};function PI(e){let{reducerPath:t,queryThunk:r,api:n,context:o,getInternalState:i}=e,{apiUid:a}=o,s={invalidateTags:O(`${t}/invalidateTags`)},c=E=>E.type.startsWith(`${t}/`),u=[II,EI,TI,_I,RI,kI];return{middleware:E=>{let y=!1,h=i(E.dispatch),S={...e,internalState:h,refetchQuery:v,isThisApiSliceAction:c,mwApi:E},C=u.map(I=>I(S)),R=xI(S),T=OI(S);return I=>k=>{if(!di(k))return I(k);y||(y=!0,E.dispatch(n.internalActions.middlewareRegistered(a)));let _={...E,next:I},D=E.getState(),[G,L]=R(k,_,D),j;if(G?j=I(k):j=L,E.getState()[t]&&(T(k,_,D),c(k)||o.hasRehydrationInfo(k)))for(let V of C)V(k,_,D);return j}},actions:s};function v(E){return e.api.endpoints[E.endpointName].initiate(E.originalArgs,{subscribe:!1,forceRefetch:!0})}}var zh=Symbol(),NI=({createSelector:e=$e}={})=>({name:zh,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:s,refetchOnFocus:c,refetchOnReconnect:u,invalidationBehavior:g,onSchemaFailure:v,catchSchemaFailure:E,skipSchemaValidation:y},h){Dm();let S=ge=>(typeof process<"u",ge);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:Wd,onOffline:ey,onFocus:zd,onFocusLost:Jh},util:{}});let C=wI({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:R,selectCachedArgsForQuery:T,buildQuerySelector:I,buildInfiniteQuerySelector:k,buildMutationSelector:_}=C;fr(t.util,{selectInvalidatedBy:R,selectCachedArgsForQuery:T});let{queryThunk:D,infiniteQueryThunk:G,mutationThunk:L,patchQueryData:j,updateQueryData:V,upsertQueryData:q,prefetch:P,buildMatchThunkActions:N}=SI({baseQuery:r,reducerPath:o,context:h,api:t,serializeQueryArgs:i,assertTagType:S,selectors:C,onSchemaFailure:v,catchSchemaFailure:E,skipSchemaValidation:y}),{reducer:F,actions:H}=bI({context:h,queryThunk:D,infiniteQueryThunk:G,mutationThunk:L,serializeQueryArgs:i,reducerPath:o,assertTagType:S,config:{refetchOnFocus:c,refetchOnReconnect:u,refetchOnMountOrArgChange:s,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:g}});fr(t.util,{patchQueryData:j,updateQueryData:V,upsertQueryData:q,prefetch:P,resetApiState:H.resetApiState,upsertQueryEntries:H.cacheEntriesUpserted}),fr(t.internalActions,H);let Q=new WeakMap,Z=ge=>Hs(Q,ge,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:X,buildInitiateInfiniteQuery:W,buildInitiateMutation:te,getRunningMutationThunk:ue,getRunningMutationsThunk:Ee,getRunningQueriesThunk:je,getRunningQueryThunk:ke}=vI({queryThunk:D,mutationThunk:L,infiniteQueryThunk:G,api:t,serializeQueryArgs:i,context:h,getInternalState:Z});fr(t.util,{getRunningMutationThunk:ue,getRunningMutationsThunk:Ee,getRunningQueryThunk:ke,getRunningQueriesThunk:je});let{middleware:Ne,actions:Fe}=PI({reducerPath:o,context:h,queryThunk:D,mutationThunk:L,infiniteQueryThunk:G,api:t,assertTagType:S,selectors:C,getRunningQueryThunk:ke,getInternalState:Z});return fr(t.util,Fe),fr(t,{reducer:F,middleware:Ne}),{name:zh,injectEndpoint(ge,me){var He;let he=(He=t.endpoints)[ge]??(He[ge]={});Ks(me)&&fr(he,{name:ge,select:I(ge,me),initiate:X(ge,me)},N(D,ge)),gI(me)&&fr(he,{name:ge,select:_(),initiate:te(ge)},N(L,ge)),Ys(me)&&fr(he,{name:ge,select:k(ge,me),initiate:W(ge,me)},N(D,ge))}}}}),cy=AI(NI());m();d();f();p();m();d();f();p();var fn=e=>e.query,uy=e=>e.query?.enableQuerySyntax;var b3=$e(e=>fn(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})),FI=$e(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);m();d();f();p();m();d();f();p();var Xs=e=>{if(e==="yes")return!0;if(e==="no")return!1},DI=()=>Pe("analytics/generatedAnswer/retry",e=>e.makeRetryGeneratedAnswer());function MI(e,t){return Pe({prefix:"analytics/generatedAnswer/openAnswerSource",__legacy__getBuilder:(r,n)=>{let o=t??Me(n),i=mo(n,e);if(!o||!i)return null;let a=_r(n);return r.makeGeneratedAnswerCitationClick(Ch(i,n),{generativeQuestionAnsweringId:o,citationId:i.id,documentId:Ih(i),...(a&&{conversationId:a})})},analyticsType:"Rga.CitationClick",analyticsPayloadBuilder:r=>{let n=mo(r,e);return{answerId:t??Me(r)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:n?.permanentid??"",title:n?.title,url:n?.clickUri}}}})}function qI(e,t,r){return Pe({prefix:"analytics/generatedAnswer/hoverCitation",__legacy__getBuilder:(n,o)=>{let i=r??Me(o),a=mo(o,e);if(!i||!a)return null;let s=_r(o);return n.makeGeneratedAnswerSourceHover({generativeQuestionAnsweringId:i,permanentId:a.permanentid,citationId:a.id,citationHoverTimeMs:t,...(s&&{conversationId:s})})},analyticsType:"Rga.CitationHover",analyticsPayloadBuilder:n=>{let o=mo(n,e);return{answerId:r??Me(n)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:o?.permanentid??"",title:o?.title,url:o?.clickUri},citationHoverTimeInMs:t}}})}function jI(e,t){return Pe({prefix:"analytics/generatedAnswer/openInlineLink",__legacy__getBuilder:r=>r.makeGeneratedAnswerOpenInlineLink({generativeQuestionAnsweringId:t,...e})})}function LI(e){return Pe({prefix:"analytics/generatedAnswer/like",__legacy__getBuilder:(t,r)=>{let n=e??Me(r);if(!n)return null;let o=_r(r);return t.makeLikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Me(t)??"",action:"like"})})}function UI(e){return Pe({prefix:"analytics/generatedAnswer/dislike",__legacy__getBuilder:(t,r)=>{let n=e??Me(r);if(!n)return null;let o=_r(r);return t.makeDislikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Me(t)??"",action:"dislike"})})}var VI=e=>Pe({prefix:"analytics/generatedAnswer/sendFeedback",__legacy__getBuilder:(t,r)=>{let n=Me(r);return n?t.makeGeneratedAnswerFeedbackSubmitV2({generativeQuestionAnsweringId:n,...e}):null},analyticsType:"Rga.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=Me(t),{helpful:n,readable:o,documented:i,hallucinationFree:a,correctTopic:s,documentUrl:c,details:u}=e;return{answerId:r??"",helpful:n,details:{readable:Xs(o),documented:Xs(i),correctTopic:Xs(s),hallucinationFree:Xs(a)},additionalNotes:u,correctAnswerUrl:c}}}),Yd=(e,t,r)=>Pe({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(n,o)=>{let i=t??Me(o);if(!i)return null;let a=_r(o);return n.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:i,answerGenerated:e,answerTextIsEmpty:r,...(a&&{conversationId:a})})},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:n=>({answerId:t??Me(n)??"",answerGenerated:e??!1})}),xo=e=>Pe({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:t=>({answerId:e??Me(t)??"",responseId:t.search?.searchResponseId||t.search?.response.searchUid||""})}),BI=()=>Pe({prefix:"analytics/generatedAnswer/show",__legacy__getBuilder:(e,t)=>{let r=Me(t);return r?e.makeGeneratedAnswerShowAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Me(e)??"",action:"show"})}),GI=()=>Pe({prefix:"analytics/generatedAnswer/hide",__legacy__getBuilder:(e,t)=>{let r=Me(t);return r?e.makeGeneratedAnswerHideAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Me(e)??"",action:"hide"})}),$I=()=>Pe({prefix:"analytics/generatedAnswer/expand",__legacy__getBuilder:(e,t)=>{let r=Me(t);return r?e.makeGeneratedAnswerExpand({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Me(e)??"",action:"expand"})}),QI=()=>Pe({prefix:"analytics/generatedAnswer/collapse",__legacy__getBuilder:(e,t)=>{let r=Me(t);return r?e.makeGeneratedAnswerCollapse({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Me(e)??"",action:"collapse"})});function HI(e){return Pe({prefix:"analytics/generatedAnswer/copy",__legacy__getBuilder:(t,r)=>{let n=e??Me(r);if(!n)return null;let o=_r(r);return t.makeGeneratedAnswerCopyToClipboard({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Me(t)??"",action:"copyToClipboard"})})}function zI(e,t){return Pe({prefix:"analytics/generatedAnswer/openFollowUpAnswerSource",__legacy__getBuilder:(r,n)=>{let o=mo(n,e);if(!o)return null;let i=_r(n);return i?r.makeGeneratedAnswerFollowupOpenSource({...Eh(o,n),generativeQuestionAnsweringId:t,citationId:o.id,permanentId:o.permanentid,conversationId:i}):null}})}var Zs={logCopyGeneratedAnswer:HI,logGeneratedAnswerHideAnswers:GI,logGeneratedAnswerShowAnswers:BI,logGeneratedAnswerStreamEnd:Yd,logGeneratedAnswerFeedback:VI,logDislikeGeneratedAnswer:UI,logLikeGeneratedAnswer:LI,logGeneratedAnswerOpenInlineLink:jI,logHoverCitation:qI,logOpenGeneratedAnswerSource:MI,logOpenGeneratedAnswerFollowUpSource:zI,logRetryGeneratedAnswer:DI,logGeneratedAnswerExpand:$I,logGeneratedAnswerCollapse:QI};m();d();f();p();m();d();f();p();var ly=$e(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})}});m();d();f();p();var $i=(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:co(e)}});m();d();f();p();var Xd=e=>e.context;m();d();f();p();var Zd=e=>e.pipeline;m();d();f();p();m();d();f();p();var Qi=qt(Js(),1),hy=qt(dy(),1);m();d();f();p();var ec=qt(Js(),1),fy=qt(py(),1);ec.default.extend(fy.default);var my="YYYY/MM/DD@HH:mm:ss",WI="1401-01-01";function Co(e,t){let r=(0,ec.default)(e,t);return!r.isValid()&&!t?(0,ec.default)(e,my):r}function tc(e){return e.format(my)}function gy(e,t){let r=Co(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}`)}ip(r)}function ip(e){if(e.isBefore(WI))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}Qi.default.extend(hy.default);var yy=["past","now","next"],vy=["minute","hour","day","week","month","quarter","year"],KI=e=>{let t=e==="now";return{amount:new oe({required:!t,min:1}),unit:new z({required:!t,constrainTo:vy}),period:new z({required:!0,constrainTo:yy})}};function ap(e){if(typeof e=="string"&&!Pr(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?xy(e):e;new ht(KI(t.period)).validate(t);let r=by(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);ip(r)}function Sy(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function by(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,Qi.default)().subtract(r,n);case"next":return(0,Qi.default)().add(r,n);case"now":return(0,Qi.default)()}}function Hi(e){return tc(by(xy(e)))}function wy(e){return e.toLocaleLowerCase().split("-")}function Pr(e){let[t,r,n]=wy(e);if(t==="now")return!0;if(!yy.includes(t)||!vy.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function Ay(e){return!!e&&typeof e=="object"&&"period"in e}function xy(e){let[t,r,n]=wy(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}m();d();f();p();function Cy(e){return e.type==="dateRange"}function Ey(e){return`start${e}`}function Ry(e){return`end${e}`}var sp=()=>({dateFacetValueMap:{}});function YI(e,t,r){let n=e.start,o=e.end;return Pr(n)&&(n=Hi(n),r.dateFacetValueMap[t][Ey(n)]=e.start),Pr(o)&&(o=Hi(o),r.dateFacetValueMap[t][Ry(o)]=e.end),{...e,start:n,end:o}}function cp(e,t){if(Cy(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>YI(o,r,t))}}return e}function Nr(e){let t=sp();return{request:{...e,facets:e.facets?.map(n=>cp(n,t))},mappings:t}}function XI(e,t,r){return{...e,start:r.dateFacetValueMap[t][Ey(e.start)]||e.start,end:r.dateFacetValueMap[t][Ry(e.end)]||e.end}}function ZI(e,t){return e.facetId in t.dateFacetValueMap}function JI(e,t){return ZI(e,t)?{...e,values:e.values.map(r=>XI(r,e.facetId,t))}:e}function rc(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>JI(n,t))}}:e}m();d();f();p();m();d();f();p();m();d();f();p();function Fr(e){return Object.values(e).map(t=>t.request)}function up(e,t){let r={};e.forEach(i=>{r[i.facetId]=i});let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function Iy(e){return Fr(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var lp={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function eT(e){return Fr(e).map(t=>{let r=lp[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function tT(e){return[...eT(e.facetSet??{}),...Iy(e.numericFacetSet??{}),...Iy(e.dateFacetSet??{}),...Fr(e.categoryFacetSet??{})]}function rT(e){return tT(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function nc(e){return up(rT(e),e.facetOrder??[])}m();d();f();p();m();d();f();p();var Dr=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??wr(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:gt.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 Us(e.configuration.analytics,t))),...(e.excerptLength&&!se(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Dr(_x67,_x68){return _ref29.apply(this,arguments)}}();m();d();f();p();var Eo=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??wr(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&&$i(e.configuration.analytics,t,r)),...(e.excerptLength&&!se(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});m();d();f();p();var Ty=$e(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Mr=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t,r){let n=pp(e),o=nT(e),i=oT(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield Dr(e,r):Eo(e,t,r);return Nr({...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"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:dp(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:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Mr(_x69,_x70,_x71){return _ref30.apply(this,arguments)}}();function dp(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function nT(e){return up(aT(e),e.facetOrder??[])}function oT(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(iT).filter(r=>r.currentValues.length>0):void 0}function iT(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function aT(e){return sT(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function sT(e){return[...cT(e.facetSet??{}),..._y(e.numericFacetSet??{}),..._y(e.dateFacetSet??{}),...Fr(e.categoryFacetSet??{})]}function cT(e){return Fr(e).map(t=>{let r=lp[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function _y(e){return Fr(e).map(t=>{let r=t.currentValues,n=r.some(({state:i})=>i!=="idle"),o=r.some(i=>i.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function pp(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=Ty(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}m();d();f();p();m();d();f();p();var zi=(e,t)=>{let r=e;return se(r[t])?se(e.raw[t])?null:e.raw[t]:r[t]},uT=e=>t=>e.every(r=>!se(zi(t,r))),lT=e=>t=>e.every(r=>se(zi(t,r))),dT=(e,t)=>r=>{let n=ky(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},pT=(e,t)=>r=>{let n=ky(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},ky=(e,t)=>{let r=zi(t,e);return Xf(r)?r:[r]},Oy={getResultProperty:zi,fieldsMustBeDefined:uT,fieldsMustNotBeDefined:lT,fieldMustMatch:dT,fieldMustNotMatch:pT};var fp=$e(e=>e.search,e=>e?.searchAction?.actionCause||"");m();d();f();p();var mp=e=>e.searchHub;m();d();f();p();var oc=$e(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),tH=$e(e=>e,e=>{let t=oc(e);return t&&e?e[t].expression:""});m();d();f();p();var Py=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};m();d();f();p();var Ny=e=>e.excerptLength?.length;m();d();f();p();var Fy=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};m();d();f();p();var Dy=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};m();d();f();p();var My=e=>e.sortCriteria;var qy=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Wn(e.configuration.search.apiBaseUrl,e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function qy(_x72){return _ref31.apply(this,arguments)}}(),jy=(e,t)=>{let r=fn(e)?.q,{aq:n,cq:o,dq:i,lq:a}=Vy(e),s=Xd(e),c=$i(e.configuration.analytics,t,{actionCause:fp(e)}),u=mp(e),g=Zd(e),v=Td(e)??[],E=Uy(e),y=oc(e.tabSet)||"default",h=Rd(e),S=Zg(e),C=t.referrer||"",R=Fy(e),T=My(e),I=fT(e),k=Ny(e),_=Dy(e),D=Py(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(i&&{dq:i}),...(a&&{lq:a}),...(e.query&&{enableQuerySyntax:uy(e)}),...(s?.contextValues&&{context:s.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:v}},...(u?.length&&{searchHub:u}),...(g?.length&&{pipeline:g}),...(E.length&&{facets:E}),...(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:dp(e),firstResult:e.pagination.firstResult}),tab:y,locale:h,timezone:S,...(e.debug!==void 0&&{debug:e.debug}),referrer:C,...I,...(_??{}),...(k&&{excerptLength:k}),...(D&&{dictionaryFieldContext:D}),sortCriteria:T,...(R&&{facetOptions:R}),...c,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},Ly=(e,t)=>{let r=fn(e)?.q,n=Uy(e),o=$i(e.configuration.analytics,t,{actionCause:fp(e)}),i=Rd(e),a=oc(e.tabSet)||"default",s=t.referrer,{aq:c,cq:u}=Vy(e),g=mp(e),v=Zd(e),E=Xd(e),y=Td(e)??[];return{q:r||"",...(n.length&&{facets:n}),citationsFieldToInclude:y,...(g?.length&&{searchHub:g}),...(v?.length&&{pipeline:v}),...(E?.contextValues&&{context:E.contextValues}),...(c&&{aq:c}),...(u&&{cq:u}),tab:a,referrer:s,...o,locale:i}},Uy=e=>nc(e)?.map(t=>cp(t,sp())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),fT=e=>({actionsHistory:e.configuration.analytics.enabled?gt.getInstance().getHistory():[]}),Vy=e=>{let t=ly(e),r=pp(e);return{...t,...(r&&{cq:r})}};m();d();f();p();var ic=["searching","thinking","answering"];function ac(e){return e.toLowerCase()}var sc=["search","generic"];m();d();f();p();var By=["text/plain","text/markdown"];var Ro=new z({required:!0}),Gy=new z,Io=new fe({required:!0}),gp={id:Ro,title:Ro,uri:Ro,permanentid:Ro,clickUri:Gy},cc=new z({required:!0,constrainTo:By}),$y=new z({required:!0,constrainTo:ic}),Qy=e=>({...e,name:ac(e.name)}),wz=O("generatedAnswer/setIsVisible",e=>B(e,Io)),uc=O("generatedAnswer/setAnswerId",e=>B(e,Y)),Az=O("generatedAnswer/setAnswerGenerationMode",e=>B(e,new z({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),xz=O("generatedAnswer/setIsEnabled",e=>B(e,Io)),Ki=O("generatedAnswer/updateMessage",e=>B(e,{textDelta:Ro})),Yi=O("generatedAnswer/updateCitations",e=>B(e,{citations:new ve({required:!0,each:new ne({values:gp})})})),Xi=O("generatedAnswer/updateError",e=>B(e,{message:Gy,code:new oe({min:0})})),lc=O("generatedAnswer/resetAnswer"),Cz=O("generatedAnswer/like"),Ez=O("generatedAnswer/dislike"),Rz=O("generatedAnswer/feedbackModal/open"),Iz=O("generatedAnswer/expand"),Tz=O("generatedAnswer/collapse"),_z=O("generatedAnswer/setId",e=>B(e,{id:new z({required:!0})})),kz=O("generatedAnswer/feedbackModal/close"),Oz=O("generatedAnswer/sendFeedback"),qr=O("generatedAnswer/setIsLoading",e=>B(e,Io)),Wi=O("generatedAnswer/setIsStreaming",e=>B(e,Io)),Zi=O("generatedAnswer/setAnswerContentFormat",e=>B(e,cc)),Pz=O("generatedAnswer/updateResponseFormat",e=>B(e,{contentFormat:new ve({each:cc,default:["text/plain"]})})),Nz=O("knowledge/updateAnswerConfigurationId",e=>B(e,Ro)),Fz=O("generatedAnswer/registerFieldsToIncludeInCitations",e=>B(e,ss)),hp=O("generatedAnswer/setIsAnswerGenerated",e=>B(e,Io)),Ji=O("generatedAnswer/setCannotAnswer",e=>B(e,Io)),mT=O("generatedAnswer/setAnswerApiQueryParams",e=>B(e,new ne({}))),Hy=O("generatedAnswer/startStep",e=>B(Qy(e),{name:$y,startedAt:new oe({min:0,required:!0})})),zy=O("generatedAnswer/finishStep",e=>B(Qy(e),{name:$y,finishedAt:new oe({min:0,required:!0})})),Wy=O("generatedAnswer/startToolCall",e=>B(e,{toolCallName:Y,startedAt:new oe({min:0,required:!0}),toolCallId:Y})),Ky=O("generatedAnswer/finishToolCall",e=>B(e,{finishedAt:new oe({min:0,required:!0}),toolCallId:Y})),dc=O("generatedAnswer/toolCallArgs",e=>B(e,{toolCallId:Y,args:new ne({options:{required:!0}}),type:new z({required:!0,constrainTo:sc})})),Dz=Ie("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{generatedAnswerAnalyticsClient:a}=o,{search:s}=i(),{queryExecuted:c}=s,{setAbortControllerRef:u}=e,g=yield qy(r),v=(h,S)=>{switch(h){case"genqa.headerMessageType":{let C=JSON.parse(S);n(Zi(C.contentFormat));break}case"genqa.messageType":n(Ki(JSON.parse(S)));break;case"genqa.citationsType":n(Yi(JSON.parse(S)));break;case"genqa.endOfStreamType":{let C=JSON.parse(S).answerGenerated,{answerId:R,answer:T}=i().generatedAnswer,k=c.length!==0&&!C,_=!T?.trim();n(Ji(k)),n(Wi(!1)),n(hp(C)),n((a??Zs).logGeneratedAnswerStreamEnd(C,R,C?_:void 0)),n(xo());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${h}"`)}};n(qr(!0));let E=h=>h.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,y=o.streamingClient?.streamGeneratedAnswer(g,{write:h=>{E(g)&&(n(qr(!1)),h.payload&&h.payloadType&&v(h.payloadType,h.payload))},abort:h=>{E(g)&&n(Xi(h))},close:()=>{E(g)&&n(Wi(!1))},resetAnswer:()=>{E(g)&&n(lc())}});y?u(y):n(qr(!1))});return function(_x73,_x74){return _ref32.apply(this,arguments)}}()),Mz=Ie("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(lc());let i=t();if(i.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(i.generatedAnswer.answerConfigurationId){let a=jy(i,n);r(mT(a)),yield r(Yy(a))}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(_x75,_x76){return _ref33.apply(this,arguments)}}());m();d();f();p();m();d();f();p();function Zy(_x77,_x78){return _Zy.apply(this,arguments)}function _Zy(){_Zy=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _Zy.apply(this,arguments)}function Jy(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=hT(t,a);let s=t.length,c=0;for(;r<s;){o&&(t[r]===10&&(c=++r),o=!1);let u=-1;for(;r<s&&u===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-c);break;case 13:o=!0,u=r;break;case 10:u=r;break}if(u===-1)break;e(t.subarray(c,u),n),c=r,n=-1}c===s?t=void 0:c!==0&&(t=t.subarray(c),r-=c)}}function ev(e,t,r){let n=Xy(),o=new TextDecoder;return function(a,s){if(a.length===0)r?.(n),n=Xy();else if(s>0){let c=o.decode(a.subarray(0,s)),u=s+(a[s+1]===32?2:1),g=o.decode(a.subarray(u));switch(c){case"data":n.data=n.data?`${n.data}
32
- ${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":gT(g,n,t);break}}}}function gT(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function hT(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Xy(){return{data:"",event:"",id:"",retry:void 0}}var yp="text/event-stream",yT=1e3,tv="last-event-id";function rv(){return typeof window<"u"}function nv(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:s,fetch:c,...u}){return new Promise((g,v)=>{let E={...r};E.accept||(E.accept=yp);let y;function h(){y?.abort(),document.hidden||k()}!s&&rv()&&document.addEventListener("visibilitychange",h);let S=yT,C;function R(){rv()&&document.removeEventListener("visibilitychange",h),clearTimeout(C),y?.abort()}t?.addEventListener("abort",()=>{R(),g()});let T=c??A,I=n??vT;function k(){return _k2.apply(this,arguments)}function _k2(){_k2=_asyncToGenerator(function*(){y=l.AbortController?new l.AbortController:null;try{let _=yield T(e,{...u,headers:E,signal:y?.signal});yield I(_),yield Zy(_.body,Jy(ev(D=>{D?E[tv]=D:delete E[tv]},D=>{S=D},o))),i?.(),R(),g()}catch(_){if(!y?.signal?.aborted)try{let D=a?.(_)??S;clearTimeout(C),C=setTimeout(k,D)}catch(D){R(),v(D)}}});return _k2.apply(this,arguments)}k()})}function vT(e){let t=e.headers.get("content-type");if(!t?.startsWith(yp))throw new Error(`Expected content-type to be ${yp}, Actual: ${t}`)}m();d();f();p();var ST=/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,s=n.generatedAnswer.answerConfigurationId,c={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let u=Wn(n.configuration.search?.apiBaseUrl,a,i);return Kh({baseUrl:`${u}/rest/organizations/${a}/answer/v1/configs/${s}`,fetchFn:function(){var _ref35=_asyncToGenerator(function*(g){if(g instanceof String)throw new Error("The provided 'request' must be a Request object.");let v=g.url,E={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(y=>{E[y]=g[y]}),E.duplex="half",E.body=yield g.text(),A(v,E)});return function fetchFn(_x82){return _ref35.apply(this,arguments)}}()})(c,{...t,signal:null},r)}catch(u){return{error:u}}});return function ST(_x79,_x80,_x81){return _ref34.apply(this,arguments)}}(),ov=cy({reducerPath:"answer",baseQuery:Xh(ST,{maxRetries:3}),endpoints:()=>({})});var bT=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},wT=(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)},AT=(e,t)=>{delete e.error,e.citations=t.citations},xT=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},CT=(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})`)},ET=(e,t,r,n)=>{let o=JSON.parse(e.data);o.finishReason==="ERROR"&&o.errorMessage&&CT(t,o);let i=o.payload.length?JSON.parse(o.payload):{};switch(o.payloadType){case"genqa.headerMessageType":i.contentFormat&&(bT(t,i),r(Zi(i.contentFormat)));break;case"genqa.messageType":typeof i.textDelta=="string"&&(wT(t,i),r(Ki({textDelta:i.textDelta})));break;case"genqa.citationsType":i.citations&&(AT(t,i),r(Yi({citations:i.citations})));break;case"genqa.endOfStreamType":{xT(t,i);let a=t.answerId,s=i.answerGenerated??!1,c=s?!t.answer?.trim():void 0;r(n.logGeneratedAnswerStreamEnd(s,a,c)),r(xo());break}}},RT=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,i=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${i}/${r}/generate`},vp=ov.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(_x83,_x84){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i,extra:a}){yield n;let{configuration:s,generatedAnswer:c,insightConfiguration:u}=r(),{generatedAnswerAnalyticsClient:g}=yield a,{organizationId:v,environment:E,accessToken:y}=s,h=Wn(s.search.apiBaseUrl,v,E),S=RT(h,v,c.answerConfigurationId,u?.insightId);yield nv(S,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${y}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:A,onopen:function(){var _ref36=_asyncToGenerator(function*(C){let R=C.headers.get("x-answer-id");R&&o(T=>{T.answerId=R,i(uc(R))})});return function onopen(_x85){return _ref36.apply(this,arguments)}}(),onmessage:C=>{o(R=>{ET(C,R,i,g??Zs)})},onerror:C=>{throw C},onclose:()=>{o(C=>{i(Ji(!C.generated))})}})}).apply(this,arguments)}})})}),Yy=e=>vp.endpoints.getAnswer.initiate(e);m();d();f();p();var iv=Be(to,e=>e);m();d();f();p();function IT(e){let t=e.payload?.analyticsAction;return av(e)&&!se(t)}function av(e){return"type"in e}var sv=e=>t=>r=>{let n;IT(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return av(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};m();d();f();p();m();d();f();p();m();d();f();p();var N4=O("tab/register",e=>{let t=new ne({values:{id:Y,expression:nt}});return B(e,t)}),pc=O("tab/updateActiveTab",e=>B(e,Y));m();d();f();p();var fc=qt(Js(),1),lv=qt(cv(),1),dv=qt(uv(),1);fc.default.extend(dv.default);fc.default.extend(lv.default);var pv=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:fc.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"});m();d();f();p();var TT=/(^|; )Coveo-Pendragon=([^;]*)/,_T=/(^|; )Coveo-SearchAgentDebug=([^;]*)/;function fv(){return typeof window>"u"?!1:TT.exec(document.cookie)?.pop()||null}function mv(){return typeof window>"u"?!1:_T.test(document.cookie)}var gv=Be(pv(),e=>e.addCase(Er,(t,r)=>{kT(t,r.payload)}).addCase(Wt,(t,r)=>{OT(t,r.payload)}).addCase(ro,(t,r)=>{PT(t,r.payload)}).addCase(no,t=>{t.analytics.enabled=!1}).addCase(oo,t=>{t.analytics.enabled=!0}).addCase(cs,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(us,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(pc,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(bg,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Rr,(t,r)=>{se(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(vg,(t,{payload:r})=>{NT(t,r)}));function kT(e,t){se(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",se(t.organizationId)||(e.organizationId=t.organizationId)}function OT(e,t){se(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),se(t.locale)||(e.search.locale=t.locale),se(t.timezone)||(e.search.timezone=t.timezone),se(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function PT(e,t){se(t.enabled)||(e.analytics.enabled=t.enabled),se(t.originContext)||(e.analytics.originContext=t.originContext),se(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),se(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),se(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),se(t.trackingId)||(e.analytics.trackingId=t.trackingId),se(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),se(t.source)||(e.analytics.source=t.source);try{let r=fv();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}se(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),se(t.anonymous)||(e.analytics.anonymous=t.anonymous),se(t.deviceId)||(e.analytics.deviceId=t.deviceId),se(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),se(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}function NT(e,t){e.knowledge.agentId=t;try{mv()&&(e.knowledge.debugAgentSession=!0)}catch{}}var Lt=gv;m();d();f();p();function FT(e){return e.instantlyCallable}var hv=()=>e=>t=>e(FT(t)?t():t);m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var at=[];for(let e=0;e<256;++e)at.push((e+256).toString(16).slice(1));function yv(e,t=0){return(at[e[t+0]]+at[e[t+1]]+at[e[t+2]]+at[e[t+3]]+"-"+at[e[t+4]]+at[e[t+5]]+"-"+at[e[t+6]]+at[e[t+7]]+"-"+at[e[t+8]]+at[e[t+9]]+"-"+at[e[t+10]]+at[e[t+11]]+at[e[t+12]]+at[e[t+13]]+at[e[t+14]]+at[e[t+15]]).toLowerCase()}m();d();f();p();var xp,DT=new Uint8Array(16);function Cp(){if(!xp){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");xp=crypto.getRandomValues.bind(crypto)}return xp(DT)}m();d();f();p();m();d();f();p();var MT=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ep={randomUUID:MT};function qT(e,t,r){if(Ep.randomUUID&&!t&&!e)return Ep.randomUUID();e=e||{};let n=e.random??e.rng?.()??Cp();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 yv(n)}var jr=qT;m();d();f();p();m();d();f();p();var w={};ti(w,{BRAND:()=>u0,DIRTY:()=>gn,EMPTY_PATH:()=>VT,INVALID:()=>de,NEVER:()=>z0,OK:()=>dt,ParseStatus:()=>st,Schema:()=>we,ZodAny:()=>Vr,ZodArray:()=>vr,ZodBigInt:()=>yn,ZodBoolean:()=>vn,ZodBranded:()=>ta,ZodCatch:()=>_n,ZodDate:()=>Sn,ZodDefault:()=>Tn,ZodDiscriminatedUnion:()=>hc,ZodEffects:()=>Nt,ZodEnum:()=>Rn,ZodError:()=>St,ZodFirstPartyTypeKind:()=>pe,ZodFunction:()=>vc,ZodIntersection:()=>xn,ZodIssueCode:()=>K,ZodLazy:()=>Cn,ZodLiteral:()=>En,ZodMap:()=>No,ZodNaN:()=>Do,ZodNativeEnum:()=>In,ZodNever:()=>Ut,ZodNull:()=>wn,ZodNullable:()=>Jt,ZodNumber:()=>hn,ZodObject:()=>bt,ZodOptional:()=>Ot,ZodParsedType:()=>re,ZodPipeline:()=>ra,ZodPromise:()=>Br,ZodReadonly:()=>kn,ZodRecord:()=>yc,ZodSchema:()=>we,ZodSet:()=>Fo,ZodString:()=>Ur,ZodSymbol:()=>Oo,ZodTransformer:()=>Nt,ZodTuple:()=>Zt,ZodType:()=>we,ZodUndefined:()=>bn,ZodUnion:()=>An,ZodUnknown:()=>yr,ZodVoid:()=>Po,addIssueToContext:()=>ee,any:()=>v0,array:()=>A0,bigint:()=>f0,boolean:()=>Tv,coerce:()=>H0,custom:()=>Ev,date:()=>m0,datetimeRegex:()=>xv,defaultErrorMap:()=>gr,discriminatedUnion:()=>R0,effect:()=>j0,enum:()=>D0,function:()=>P0,getErrorMap:()=>To,getParsedType:()=>Xt,instanceof:()=>d0,intersection:()=>I0,isAborted:()=>mc,isAsync:()=>_o,isDirty:()=>gc,isValid:()=>Lr,late:()=>l0,lazy:()=>N0,literal:()=>F0,makeIssue:()=>ea,map:()=>k0,nan:()=>p0,nativeEnum:()=>M0,never:()=>b0,null:()=>y0,nullable:()=>U0,number:()=>Iv,object:()=>x0,objectUtil:()=>Rp,oboolean:()=>Q0,onumber:()=>$0,optional:()=>L0,ostring:()=>G0,pipeline:()=>B0,preprocess:()=>V0,promise:()=>q0,quotelessJson:()=>jT,record:()=>_0,set:()=>O0,setErrorMap:()=>UT,strictObject:()=>C0,string:()=>Rv,symbol:()=>g0,transformer:()=>j0,tuple:()=>T0,undefined:()=>h0,union:()=>E0,unknown:()=>S0,util:()=>Ce,void:()=>w0});m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var Ce;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(s=>typeof o[o[s]]!="number"),a={};for(let s of i)a[s]=o[s];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},e.find=(o,i)=>{for(let a of o)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Ce||(Ce={}));var Rp;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Rp||(Rp={}));var re=Ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xt=e=>{switch(typeof e){case"undefined":return re.undefined;case"string":return re.string;case"number":return Number.isNaN(e)?re.nan:re.number;case"boolean":return re.boolean;case"function":return re.function;case"bigint":return re.bigint;case"symbol":return re.symbol;case"object":return Array.isArray(e)?re.array:e===null?re.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?re.promise:typeof Map<"u"&&e instanceof Map?re.map:typeof Set<"u"&&e instanceof Set?re.set:typeof Date<"u"&&e instanceof Date?re.date:re.object;default:return re.unknown}};var K=Ce.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"]),jT=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),St=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(i){return i.message},n={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let s=n,c=0;for(;c<a.path.length;){let u=a.path[c];c===a.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(r(a))):s[u]=s[u]||{_errors:[]},s=s[u],c++}}};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,Ce.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 i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};St.create=e=>new St(e);var LT=(e,t)=>{let r;switch(e.code){case K.invalid_type:e.received===re.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case K.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ce.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ce.joinValues(e.keys,", ")}`;break;case K.invalid_union:r="Invalid input";break;case K.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ce.joinValues(e.options)}`;break;case K.invalid_enum_value:r=`Invalid enum value. Expected ${Ce.joinValues(e.options)}, received '${e.received}'`;break;case K.invalid_arguments:r="Invalid function arguments";break;case K.invalid_return_type:r="Invalid function return type";break;case K.invalid_date:r="Invalid date";break;case K.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}"`:Ce.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case K.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 K.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 K.custom:r="Invalid input";break;case K.invalid_intersection_types:r="Intersection results could not be merged";break;case K.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case K.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ce.assertNever(e)}return{message:r}},gr=LT;var vv=gr;function UT(e){vv=e}function To(){return vv}m();d();f();p();var ea=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...(o.path||[])],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let s="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)s=u(a,{data:t,defaultError:s}).message;return{...o,path:i,message:s}},VT=[];function ee(e,t){let r=To(),n=ea({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===gr?void 0:gr].filter(o=>!!o)});e.common.issues.push(n)}var st=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 de;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 i=yield o.key,a=yield o.value;n.push({key:i,value:a})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return de;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(n[i.value]=a.value)}return{status:t.value,value:n}}},de=Object.freeze({status:"aborted"}),gn=e=>({status:"dirty",value:e}),dt=e=>({status:"valid",value:e}),mc=e=>e.status==="aborted",gc=e=>e.status==="dirty",Lr=e=>e.status==="valid",_o=e=>typeof Promise<"u"&&e instanceof Promise;m();d();f();p();m();d();f();p();var ie;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ie||(ie={}));var Pt=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}},Sv=(e,t)=>{if(Lr(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 St(e.common.issues);return this._error=r,this._error}}};function ye(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:(a,s)=>{let{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??n??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:c??r??s.defaultError}},description:o}}var we=class{get description(){return this._def.description}_getType(t){return Xt(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Xt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new st,ctx:{common:t.parent.common,data:t.data,parsedType:Xt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(_o(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:Xt(t)},o=this._parseSync({data:t,path:n.path,parent:n});return Sv(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xt(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Lr(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=>Lr(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this10=this;return _asyncToGenerator(function*(){let n=yield _this10.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this11=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this11._def.errorMap,parent:null,data:t,parsedType:Xt(t)},o=_this11._parse({data:t,path:n.path,parent:n}),i=yield _o(o)?o:Promise.resolve(o);return Sv(n,i)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let a=t(o),s=()=>i.addIssue({code:K.custom,...n(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(s(),!1)):a?!0:(s(),!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 Nt({schema:this,typeName:pe.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 Ot.create(this,this._def)}nullable(){return Jt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return vr.create(this)}promise(){return Br.create(this,this._def)}or(t){return An.create([this,t],this._def)}and(t){return xn.create(this,t,this._def)}transform(t){return new Nt({...ye(this._def),schema:this,typeName:pe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Tn({...ye(this._def),innerType:this,defaultValue:r,typeName:pe.ZodDefault})}brand(){return new ta({typeName:pe.ZodBranded,type:this,...ye(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new _n({...ye(this._def),innerType:this,catchValue:r,typeName:pe.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ra.create(this,t)}readonly(){return kn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},BT=/^c[^\s-]{8,}$/i,GT=/^[0-9a-z]+$/,$T=/^[0-9A-HJKMNP-TV-Z]{26}$/i,QT=/^[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,HT=/^[a-z0-9_-]{21}$/i,zT=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,WT=/^[-+]?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)?)??$/,KT=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,YT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ip,XT=/^(?:(?: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])$/,ZT=/^(?:(?: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])$/,JT=/^(([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]))$/,e0=/^(([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])$/,t0=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,r0=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,wv="((\\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])))",n0=new RegExp(`^${wv}$`);function Av(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 o0(e){return new RegExp(`^${Av(e)}$`)}function xv(e){let t=`${wv}T${Av(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 i0(e,t){return!!((t==="v4"||!t)&&XT.test(e)||(t==="v6"||!t)&&JT.test(e))}function a0(e,t){if(!zT.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 s0(e,t){return!!((t==="v4"||!t)&&ZT.test(e)||(t==="v6"||!t)&&e0.test(e))}var Ur=class e extends we{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==re.string){let i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_type,expected:re.string,received:i.parsedType}),de}let n=new st,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,s=t.data.length<i.value;(a||s)&&(o=this._getOrReturnCtx(t,o),a?ee(o,{code:K.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&ee(o,{code:K.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")KT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"email",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Ip||(Ip=new RegExp(YT,"u")),Ip.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"emoji",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")QT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"uuid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")HT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"nanoid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")BT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"cuid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")GT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"cuid2",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")$T.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"ulid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ee(o,{validation:"url",code:K.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"regex",code:K.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?xv(i).test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?n0.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?o0(i).test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?WT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"duration",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?i0(t.data,i.version)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"ip",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?a0(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"jwt",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?s0(t.data,i.version)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"cidr",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?t0.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"base64",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?r0.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"base64url",code:K.invalid_string,message:i.message}),n.dirty()):Ce.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:K.invalid_string,...ie.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ie.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ie.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ie.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ie.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ie.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ie.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ie.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ie.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ie.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ie.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ie.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ie.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ie.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,...ie.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,...ie.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ie.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ie.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...ie.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ie.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ie.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ie.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ie.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ie.errToObj(r)})}nonempty(t){return this.min(1,ie.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}};Ur.create=e=>new Ur({checks:[],typeName:pe.ZodString,coerce:e?.coerce??!1,...ye(e)});function c0(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return i%a/10**o}var hn=class e extends we{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)!==re.number){let i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_type,expected:re.number,received:i.parsedType}),de}let n,o=new st;for(let i of this._def.checks)i.kind==="int"?Ce.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ee(n,{code:K.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?c0(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ee(n,{code:K.not_finite,message:i.message}),o.dirty()):Ce.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ie.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ie.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ie.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ie.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ie.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ie.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ie.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ie.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ie.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ie.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ie.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ie.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ie.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ie.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"&&Ce.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)}};hn.create=e=>new hn({checks:[],typeName:pe.ZodNumber,coerce:e?.coerce||!1,...ye(e)});var yn=class e extends we{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)!==re.bigint)return this._getInvalidInput(t);let n,o=new st;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Ce.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.bigint,received:r.parsedType}),de}gte(t,r){return this.setLimit("min",t,!0,ie.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ie.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ie.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ie.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ie.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:ie.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ie.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ie.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ie.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ie.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}};yn.create=e=>new yn({checks:[],typeName:pe.ZodBigInt,coerce:e?.coerce??!1,...ye(e)});var vn=class extends we{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==re.boolean){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.boolean,received:n.parsedType}),de}return dt(t.data)}};vn.create=e=>new vn({typeName:pe.ZodBoolean,coerce:e?.coerce||!1,...ye(e)});var Sn=class e extends we{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==re.date){let i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_type,expected:re.date,received:i.parsedType}),de}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_date}),de}let n=new st,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Ce.assertNever(i);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:ie.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ie.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}};Sn.create=e=>new Sn({checks:[],coerce:e?.coerce||!1,typeName:pe.ZodDate,...ye(e)});var Oo=class extends we{_parse(t){if(this._getType(t)!==re.symbol){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.symbol,received:n.parsedType}),de}return dt(t.data)}};Oo.create=e=>new Oo({typeName:pe.ZodSymbol,...ye(e)});var bn=class extends we{_parse(t){if(this._getType(t)!==re.undefined){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.undefined,received:n.parsedType}),de}return dt(t.data)}};bn.create=e=>new bn({typeName:pe.ZodUndefined,...ye(e)});var wn=class extends we{_parse(t){if(this._getType(t)!==re.null){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.null,received:n.parsedType}),de}return dt(t.data)}};wn.create=e=>new wn({typeName:pe.ZodNull,...ye(e)});var Vr=class extends we{constructor(){super(...arguments),this._any=!0}_parse(t){return dt(t.data)}};Vr.create=e=>new Vr({typeName:pe.ZodAny,...ye(e)});var yr=class extends we{constructor(){super(...arguments),this._unknown=!0}_parse(t){return dt(t.data)}};yr.create=e=>new yr({typeName:pe.ZodUnknown,...ye(e)});var Ut=class extends we{_parse(t){let r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.never,received:r.parsedType}),de}};Ut.create=e=>new Ut({typeName:pe.ZodNever,...ye(e)});var Po=class extends we{_parse(t){if(this._getType(t)!==re.undefined){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.void,received:n.parsedType}),de}return dt(t.data)}};Po.create=e=>new Po({typeName:pe.ZodVoid,...ye(e)});var vr=class e extends we{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==re.array)return ee(r,{code:K.invalid_type,expected:re.array,received:r.parsedType}),de;if(o.exactLength!==null){let a=r.data.length>o.exactLength.value,s=r.data.length<o.exactLength.value;(a||s)&&(ee(r,{code:a?K.too_big:K.too_small,minimum:s?o.exactLength.value:void 0,maximum:a?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&&(ee(r,{code:K.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&&(ee(r,{code:K.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((a,s)=>o.type._parseAsync(new Pt(r,a,r.path,s)))).then(a=>st.mergeArray(n,a));let i=[...r.data].map((a,s)=>o.type._parseSync(new Pt(r,a,r.path,s)));return st.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:ie.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:ie.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:ie.toString(r)}})}nonempty(t){return this.min(1,t)}};vr.create=(e,t)=>new vr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:pe.ZodArray,...ye(t)});function ko(e){if(e instanceof bt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Ot.create(ko(n))}return new bt({...e._def,shape:()=>t})}else return e instanceof vr?new vr({...e._def,type:ko(e.element)}):e instanceof Ot?Ot.create(ko(e.unwrap())):e instanceof Jt?Jt.create(ko(e.unwrap())):e instanceof Zt?Zt.create(e.items.map(t=>ko(t))):e}var bt=class e extends we{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=Ce.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==re.object){let u=this._getOrReturnCtx(t);return ee(u,{code:K.invalid_type,expected:re.object,received:u.parsedType}),de}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Ut&&this._def.unknownKeys==="strip"))for(let u in o.data)a.includes(u)||s.push(u);let c=[];for(let u of a){let g=i[u],v=o.data[u];c.push({key:{status:"valid",value:u},value:g._parse(new Pt(o,v,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof Ut){let u=this._def.unknownKeys;if(u==="passthrough")for(let g of s)c.push({key:{status:"valid",value:g},value:{status:"valid",value:o.data[g]}});else if(u==="strict")s.length>0&&(ee(o,{code:K.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let g of s){let v=o.data[g];c.push({key:{status:"valid",value:g},value:u._parse(new Pt(o,v,o.path,g)),alwaysSet:g in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let u=[];for(let g of c){let v=yield g.key,E=yield g.value;u.push({key:v,value:E,alwaysSet:g.alwaysSet})}return u})).then(u=>st.mergeObjectSync(n,u)):st.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return ie.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:ie.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:pe.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 Ce.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 Ce.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return ko(this)}partial(t){let r={};for(let n of Ce.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 Ce.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Ot;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return Cv(Ce.objectKeys(this.shape))}};bt.create=(e,t)=>new bt({shape:()=>e,unknownKeys:"strip",catchall:Ut.create(),typeName:pe.ZodObject,...ye(t)});bt.strictCreate=(e,t)=>new bt({shape:()=>e,unknownKeys:"strict",catchall:Ut.create(),typeName:pe.ZodObject,...ye(t)});bt.lazycreate=(e,t)=>new bt({shape:e,unknownKeys:"strip",catchall:Ut.create(),typeName:pe.ZodObject,...ye(t)});var An=class extends we{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let s of i)if(s.result.status==="valid")return s.result;for(let s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(s=>new St(s.ctx.common.issues));return ee(r,{code:K.invalid_union,unionErrors:a}),de}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(i){let a={...r,common:{...r.common,issues:[]},parent:null};return{result:yield i._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}});return function(_x86){return _ref38.apply(this,arguments)}}())).then(o);{let i,a=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},g=c._parseSync({data:r.data,path:r.path,parent:u});if(g.status==="valid")return g;g.status==="dirty"&&!i&&(i={result:g,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let s=a.map(c=>new St(c));return ee(r,{code:K.invalid_union,unionErrors:s}),de}}get options(){return this._def.options}};An.create=(e,t)=>new An({options:e,typeName:pe.ZodUnion,...ye(t)});var hr=e=>e instanceof Cn?hr(e.schema):e instanceof Nt?hr(e.innerType()):e instanceof En?[e.value]:e instanceof Rn?e.options:e instanceof In?Ce.objectValues(e.enum):e instanceof Tn?hr(e._def.innerType):e instanceof bn?[void 0]:e instanceof wn?[null]:e instanceof Ot?[void 0,...hr(e.unwrap())]:e instanceof Jt?[null,...hr(e.unwrap())]:e instanceof ta||e instanceof kn?hr(e.unwrap()):e instanceof _n?hr(e._def.innerType):[],hc=class e extends we{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==re.object)return ee(r,{code:K.invalid_type,expected:re.object,received:r.parsedType}),de;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(ee(r,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),de)}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 i of r){let a=hr(i.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of a){if(o.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);o.set(s,i)}}return new e({typeName:pe.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...ye(n)})}};function Tp(e,t){let r=Xt(e),n=Xt(t);if(e===t)return{valid:!0,data:e};if(r===re.object&&n===re.object){let o=Ce.objectKeys(t),i=Ce.objectKeys(e).filter(s=>o.indexOf(s)!==-1),a={...e,...t};for(let s of i){let c=Tp(e[s],t[s]);if(!c.valid)return{valid:!1};a[s]=c.data}return{valid:!0,data:a}}else if(r===re.array&&n===re.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let a=e[i],s=t[i],c=Tp(a,s);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===re.date&&n===re.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var xn=class extends we{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,a)=>{if(mc(i)||mc(a))return de;let s=Tp(i.value,a.value);return s.valid?((gc(i)||gc(a))&&r.dirty(),{status:r.value,value:s.data}):(ee(n,{code:K.invalid_intersection_types}),de)};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(([i,a])=>o(i,a)):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}))}};xn.create=(e,t,r)=>new xn({left:e,right:t,typeName:pe.ZodIntersection,...ye(r)});var Zt=class e extends we{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==re.array)return ee(n,{code:K.invalid_type,expected:re.array,received:n.parsedType}),de;if(n.data.length<this._def.items.length)return ee(n,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),de;!this._def.rest&&n.data.length>this._def.items.length&&(ee(n,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((a,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new Pt(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>st.mergeArray(r,a)):st.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Zt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zt({items:e,typeName:pe.ZodTuple,rest:null,...ye(t)})};var yc=class e extends we{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!==re.object)return ee(n,{code:K.invalid_type,expected:re.object,received:n.parsedType}),de;let o=[],i=this._def.keyType,a=this._def.valueType;for(let s in n.data)o.push({key:i._parse(new Pt(n,s,n.path,s)),value:a._parse(new Pt(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?st.mergeObjectAsync(r,o):st.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof we?new e({keyType:t,valueType:r,typeName:pe.ZodRecord,...ye(n)}):new e({keyType:Ur.create(),valueType:t,typeName:pe.ZodRecord,...ye(r)})}},No=class extends we{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!==re.map)return ee(n,{code:K.invalid_type,expected:re.map,received:n.parsedType}),de;let o=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([s,c],u)=>({key:o._parse(new Pt(n,s,n.path,[u,"key"])),value:i._parse(new Pt(n,c,n.path,[u,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let c of a){let u=yield c.key,g=yield c.value;if(u.status==="aborted"||g.status==="aborted")return de;(u.status==="dirty"||g.status==="dirty")&&r.dirty(),s.set(u.value,g.value)}return{status:r.value,value:s}}))}else{let s=new Map;for(let c of a){let u=c.key,g=c.value;if(u.status==="aborted"||g.status==="aborted")return de;(u.status==="dirty"||g.status==="dirty")&&r.dirty(),s.set(u.value,g.value)}return{status:r.value,value:s}}}};No.create=(e,t,r)=>new No({valueType:t,keyType:e,typeName:pe.ZodMap,...ye(r)});var Fo=class e extends we{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==re.set)return ee(n,{code:K.invalid_type,expected:re.set,received:n.parsedType}),de;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(ee(n,{code:K.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&&(ee(n,{code:K.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function a(c){let u=new Set;for(let g of c){if(g.status==="aborted")return de;g.status==="dirty"&&r.dirty(),u.add(g.value)}return{status:r.value,value:u}}let s=[...n.data.values()].map((c,u)=>i._parse(new Pt(n,c,n.path,u)));return n.common.async?Promise.all(s).then(c=>a(c)):a(s)}min(t,r){return new e({...this._def,minSize:{value:t,message:ie.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:ie.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Fo.create=(e,t)=>new Fo({valueType:e,minSize:null,maxSize:null,typeName:pe.ZodSet,...ye(t)});var vc=class e extends we{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==re.function)return ee(r,{code:K.invalid_type,expected:re.function,received:r.parsedType}),de;function n(s,c){return ea({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,To(),gr].filter(u=>!!u),issueData:{code:K.invalid_arguments,argumentsError:c}})}function o(s,c){return ea({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,To(),gr].filter(u=>!!u),issueData:{code:K.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Br){let s=this;return dt(/*#__PURE__*/_asyncToGenerator(function*(...c){let u=new St([]),g=yield s._def.args.parseAsync(c,i).catch(y=>{throw u.addIssue(n(c,y)),u}),v=yield Reflect.apply(a,this,g);return yield s._def.returns._def.type.parseAsync(v,i).catch(y=>{throw u.addIssue(o(v,y)),u})}))}else{let s=this;return dt(function(...c){let u=s._def.args.safeParse(c,i);if(!u.success)throw new St([n(c,u.error)]);let g=Reflect.apply(a,this,u.data),v=s._def.returns.safeParse(g,i);if(!v.success)throw new St([o(g,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Zt.create(t).rest(yr.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||Zt.create([]).rest(yr.create()),returns:r||yr.create(),typeName:pe.ZodFunction,...ye(n)})}},Cn=class extends we{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})}};Cn.create=(e,t)=>new Cn({getter:e,typeName:pe.ZodLazy,...ye(t)});var En=class extends we{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return ee(r,{received:r.data,code:K.invalid_literal,expected:this._def.value}),de}return{status:"valid",value:t.data}}get value(){return this._def.value}};En.create=(e,t)=>new En({value:e,typeName:pe.ZodLiteral,...ye(t)});function Cv(e,t){return new Rn({values:e,typeName:pe.ZodEnum,...ye(t)})}var Rn=class e extends we{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return ee(r,{expected:Ce.joinValues(n),received:r.parsedType,code:K.invalid_type}),de}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 ee(r,{received:r.data,code:K.invalid_enum_value,options:n}),de}return dt(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})}};Rn.create=Cv;var In=class extends we{_parse(t){let r=Ce.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==re.string&&n.parsedType!==re.number){let o=Ce.objectValues(r);return ee(n,{expected:Ce.joinValues(o),received:n.parsedType,code:K.invalid_type}),de}if(this._cache||(this._cache=new Set(Ce.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=Ce.objectValues(r);return ee(n,{received:n.data,code:K.invalid_enum_value,options:o}),de}return dt(t.data)}get enum(){return this._def.values}};In.create=(e,t)=>new In({values:e,typeName:pe.ZodNativeEnum,...ye(t)});var Br=class extends we{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==re.promise&&r.common.async===!1)return ee(r,{code:K.invalid_type,expected:re.promise,received:r.parsedType}),de;let n=r.parsedType===re.promise?r.data:Promise.resolve(r.data);return dt(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Br.create=(e,t)=>new Br({type:e,typeName:pe.ZodPromise,...ye(t)});var Nt=class extends we{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===pe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this12=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:a=>{ee(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(n.data,i);if(n.common.async)return Promise.resolve(a).then(/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(s){if(r.value==="aborted")return de;let c=yield _this12._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?de:c.status==="dirty"?gn(c.value):r.value==="dirty"?gn(c.value):c});return function(_x87){return _ref41.apply(this,arguments)}}());{if(r.value==="aborted")return de;let s=this._def.schema._parseSync({data:a,path:n.path,parent:n});return s.status==="aborted"?de:s.status==="dirty"?gn(s.value):r.value==="dirty"?gn(s.value):s}}if(o.type==="refinement"){let a=s=>{let c=o.refinement(s,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?de:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?de:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(o.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Lr(a))return de;let s=o.transform(a.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>Lr(a)?Promise.resolve(o.transform(a.value,i)).then(s=>({status:r.value,value:s})):de);Ce.assertNever(o)}};Nt.create=(e,t,r)=>new Nt({schema:e,typeName:pe.ZodEffects,effect:t,...ye(r)});Nt.createWithPreprocess=(e,t,r)=>new Nt({schema:t,effect:{type:"preprocess",transform:e},typeName:pe.ZodEffects,...ye(r)});var Ot=class extends we{_parse(t){return this._getType(t)===re.undefined?dt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ot.create=(e,t)=>new Ot({innerType:e,typeName:pe.ZodOptional,...ye(t)});var Jt=class extends we{_parse(t){return this._getType(t)===re.null?dt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Jt.create=(e,t)=>new Jt({innerType:e,typeName:pe.ZodNullable,...ye(t)});var Tn=class extends we{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===re.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Tn.create=(e,t)=>new Tn({innerType:e,typeName:pe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ye(t)});var _n=class extends we{_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 _o(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new St(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new St(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};_n.create=(e,t)=>new _n({innerType:e,typeName:pe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ye(t)});var Do=class extends we{_parse(t){if(this._getType(t)!==re.nan){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.nan,received:n.parsedType}),de}return{status:"valid",value:t.data}}};Do.create=e=>new Do({typeName:pe.ZodNaN,...ye(e)});var u0=Symbol("zod_brand"),ta=class extends we{_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}},ra=class e extends we{_parse(t){var _this13=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let i=yield _this13._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?de:i.status==="dirty"?(r.dirty(),gn(i.value)):_this13._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?de: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:pe.ZodPipeline})}},kn=class extends we{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Lr(o)&&(o.value=Object.freeze(o.value)),o);return _o(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};kn.create=(e,t)=>new kn({innerType:e,typeName:pe.ZodReadonly,...ye(t)});function bv(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Ev(e,t={},r){return e?Vr.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(a=>{if(!a){let s=bv(t,n),c=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:c})}});if(!i){let a=bv(t,n),s=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:s})}}):Vr.create()}var l0={object:bt.lazycreate},pe;(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"})(pe||(pe={}));var d0=(e,t={message:`Input not instance of ${e.name}`})=>Ev(r=>r instanceof e,t),Rv=Ur.create,Iv=hn.create,p0=Do.create,f0=yn.create,Tv=vn.create,m0=Sn.create,g0=Oo.create,h0=bn.create,y0=wn.create,v0=Vr.create,S0=yr.create,b0=Ut.create,w0=Po.create,A0=vr.create,x0=bt.create,C0=bt.strictCreate,E0=An.create,R0=hc.create,I0=xn.create,T0=Zt.create,_0=yc.create,k0=No.create,O0=Fo.create,P0=vc.create,N0=Cn.create,F0=En.create,D0=Rn.create,M0=In.create,q0=Br.create,j0=Nt.create,L0=Ot.create,U0=Jt.create,V0=Nt.createWithPreprocess,B0=ra.create,G0=()=>Rv().optional(),$0=()=>Iv().optional(),Q0=()=>Tv().optional(),H0={string:e=>Ur.create({...e,coerce:!0}),number:e=>hn.create({...e,coerce:!0}),boolean:e=>vn.create({...e,coerce:!0}),bigint:e=>yn.create({...e,coerce:!0}),date:e=>Sn.create({...e,coerce:!0})};var z0=de;var W0=w.object({name:w.string(),arguments:w.string()}),K0=w.object({id:w.string(),type:w.literal("function"),function:W0,encryptedValue:w.string().optional()}),Sc=w.object({id:w.string(),role:w.string(),content:w.string().optional(),name:w.string().optional(),encryptedValue:w.string().optional()}),Y0=w.object({type:w.literal("text"),text:w.string()}),X0=w.object({type:w.literal("data"),value:w.string(),mimeType:w.string()}),Z0=w.object({type:w.literal("url"),value:w.string(),mimeType:w.string().optional()}),bc=w.discriminatedUnion("type",[X0,Z0]),J0=w.object({type:w.literal("image"),source:bc,metadata:w.unknown().optional()}),e_=w.object({type:w.literal("audio"),source:bc,metadata:w.unknown().optional()}),t_=w.object({type:w.literal("video"),source:bc,metadata:w.unknown().optional()}),r_=w.object({type:w.literal("document"),source:bc,metadata:w.unknown().optional()});var _v=w.object({type:w.literal("binary"),mimeType:w.string(),id:w.string().optional(),url:w.string().optional(),data:w.string().optional(),filename:w.string().optional()}),kv=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:w.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},l8=_v.superRefine((e,t)=>{kv(e,t)}),n_=w.discriminatedUnion("type",[Y0,J0,e_,t_,r_,_v]),o_=n_.superRefine((e,t)=>{e.type==="binary"&&kv(e,t)}),i_=Sc.extend({role:w.literal("developer"),content:w.string()}),a_=Sc.extend({role:w.literal("system"),content:w.string()}),s_=Sc.extend({role:w.literal("assistant"),content:w.string().optional(),toolCalls:w.array(K0).optional()}),c_=Sc.extend({role:w.literal("user"),content:w.union([w.string(),w.array(o_)])}),u_=w.object({id:w.string(),content:w.string(),role:w.literal("tool"),toolCallId:w.string(),error:w.string().optional(),encryptedValue:w.string().optional()}),l_=w.object({id:w.string(),role:w.literal("activity"),activityType:w.string(),content:w.record(w.any())}),d_=w.object({id:w.string(),role:w.literal("reasoning"),content:w.string(),encryptedValue:w.string().optional()}),Ov=w.discriminatedUnion("role",[i_,a_,s_,c_,u_,l_,d_]),d8=w.union([w.literal("developer"),w.literal("system"),w.literal("assistant"),w.literal("user"),w.literal("tool"),w.literal("activity"),w.literal("reasoning")]),p_=w.object({description:w.string(),value:w.string()}),Pv=w.object({name:w.string(),description:w.string(),parameters:w.any(),metadata:w.record(w.any()).optional()}),f_=w.object({id:w.string(),reason:w.string(),message:w.string().optional(),toolCallId:w.string().optional(),responseSchema:w.record(w.any()).optional(),expiresAt:w.string().optional(),metadata:w.record(w.any()).optional()}),m_=w.object({interruptId:w.string(),status:w.enum(["resolved","cancelled"]),payload:w.any().optional()}),g_=w.object({threadId:w.string(),runId:w.string(),parentRunId:w.string().optional(),state:w.any(),messages:w.array(Ov),tools:w.array(Pv),context:w.array(p_),forwardedProps:w.any(),resume:w.array(m_).optional()}),h_=w.any(),Le=class extends Error{constructor(e){super(e)}},_p=class extends Le{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},y_=w.object({name:w.string(),description:w.string().optional()}),v_=w.object({name:w.string().optional(),type:w.string().optional(),description:w.string().optional(),version:w.string().optional(),provider:w.string().optional(),documentationUrl:w.string().optional(),metadata:w.record(w.unknown()).optional()}),S_=w.object({streaming:w.boolean().optional(),websocket:w.boolean().optional(),httpBinary:w.boolean().optional(),pushNotifications:w.boolean().optional(),resumable:w.boolean().optional()}),b_=w.object({supported:w.boolean().optional(),items:w.array(Pv).optional(),parallelCalls:w.boolean().optional(),clientProvided:w.boolean().optional()}),w_=w.object({structuredOutput:w.boolean().optional(),supportedMimeTypes:w.array(w.string()).optional()}),A_=w.object({snapshots:w.boolean().optional(),deltas:w.boolean().optional(),memory:w.boolean().optional(),persistentState:w.boolean().optional()}),x_=w.object({supported:w.boolean().optional(),delegation:w.boolean().optional(),handoffs:w.boolean().optional(),subAgents:w.array(y_).optional()}),C_=w.object({supported:w.boolean().optional(),streaming:w.boolean().optional(),encrypted:w.boolean().optional()}),E_=w.object({image:w.boolean().optional(),audio:w.boolean().optional(),video:w.boolean().optional(),pdf:w.boolean().optional(),file:w.boolean().optional()}),R_=w.object({image:w.boolean().optional(),audio:w.boolean().optional()}),I_=w.object({input:E_.optional(),output:R_.optional()}),T_=w.object({codeExecution:w.boolean().optional(),sandboxed:w.boolean().optional(),maxIterations:w.number().optional(),maxExecutionTime:w.number().optional()}),__=w.object({supported:w.boolean().optional(),approvals:w.boolean().optional(),interventions:w.boolean().optional(),feedback:w.boolean().optional(),interrupts:w.boolean().optional(),approveWithEdits:w.boolean().optional()}),p8=w.object({identity:v_.optional(),transport:S_.optional(),tools:b_.optional(),output:w_.optional(),state:A_.optional(),multiAgent:x_.optional(),reasoning:C_.optional(),multimodal:I_.optional(),execution:T_.optional(),humanInTheLoop:__.optional(),custom:w.record(w.unknown()).optional()}),Nv=w.union([w.literal("developer"),w.literal("system"),w.literal("assistant"),w.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}({}),Te=w.object({type:w.nativeEnum(M),timestamp:w.number().optional(),rawEvent:w.any().optional()}).passthrough(),k_=Te.extend({type:w.literal(M.TEXT_MESSAGE_START),messageId:w.string(),role:Nv.default("assistant"),name:w.string().optional()}),Fv=Te.extend({type:w.literal(M.TEXT_MESSAGE_CONTENT),messageId:w.string(),delta:w.string()}),O_=Te.extend({type:w.literal(M.TEXT_MESSAGE_END),messageId:w.string()}),P_=Te.extend({type:w.literal(M.TEXT_MESSAGE_CHUNK),messageId:w.string().optional(),role:Nv.optional(),delta:w.string().optional(),name:w.string().optional()}),N_=Te.extend({type:w.literal(M.THINKING_TEXT_MESSAGE_START)}),F_=Fv.omit({messageId:!0,type:!0}).extend({type:w.literal(M.THINKING_TEXT_MESSAGE_CONTENT)}),D_=Te.extend({type:w.literal(M.THINKING_TEXT_MESSAGE_END)}),M_=Te.extend({type:w.literal(M.TOOL_CALL_START),toolCallId:w.string(),toolCallName:w.string(),parentMessageId:w.string().optional()}),q_=Te.extend({type:w.literal(M.TOOL_CALL_ARGS),toolCallId:w.string(),delta:w.string()}),j_=Te.extend({type:w.literal(M.TOOL_CALL_END),toolCallId:w.string()}),L_=Te.extend({messageId:w.string(),type:w.literal(M.TOOL_CALL_RESULT),toolCallId:w.string(),content:w.string(),role:w.literal("tool").optional()}),U_=Te.extend({type:w.literal(M.TOOL_CALL_CHUNK),toolCallId:w.string().optional(),toolCallName:w.string().optional(),parentMessageId:w.string().optional(),delta:w.string().optional()}),V_=Te.extend({type:w.literal(M.THINKING_START),title:w.string().optional()}),B_=Te.extend({type:w.literal(M.THINKING_END)}),G_=Te.extend({type:w.literal(M.STATE_SNAPSHOT),snapshot:h_}),$_=Te.extend({type:w.literal(M.STATE_DELTA),delta:w.array(w.any())}),Q_=Te.extend({type:w.literal(M.MESSAGES_SNAPSHOT),messages:w.array(Ov)}),H_=Te.extend({type:w.literal(M.ACTIVITY_SNAPSHOT),messageId:w.string(),activityType:w.string(),content:w.record(w.any()),replace:w.boolean().optional().default(!0)}),z_=Te.extend({type:w.literal(M.ACTIVITY_DELTA),messageId:w.string(),activityType:w.string(),patch:w.array(w.any())}),W_=Te.extend({type:w.literal(M.RAW),event:w.any(),source:w.string().optional()}),K_=Te.extend({type:w.literal(M.CUSTOM),name:w.string(),value:w.any()}),Y_=Te.extend({type:w.literal(M.RUN_STARTED),threadId:w.string(),runId:w.string(),parentRunId:w.string().optional(),input:g_.optional()}),X_=w.object({type:w.literal("success")}).strict(),Z_=w.object({type:w.literal("interrupt"),interrupts:w.array(f_).min(1)}).strict(),J_=w.discriminatedUnion("type",[X_,Z_]),ek=Te.extend({type:w.literal(M.RUN_FINISHED),threadId:w.string(),runId:w.string(),result:w.any().optional(),outcome:J_.nullable().optional().transform(e=>e??void 0)}),tk=Te.extend({type:w.literal(M.RUN_ERROR),message:w.string(),code:w.string().optional()}),rk=Te.extend({type:w.literal(M.STEP_STARTED),stepName:w.string()}),nk=Te.extend({type:w.literal(M.STEP_FINISHED),stepName:w.string()}),ok=w.union([w.literal("tool-call"),w.literal("message")]),ik=Te.extend({type:w.literal(M.REASONING_START),messageId:w.string()}),ak=Te.extend({type:w.literal(M.REASONING_MESSAGE_START),messageId:w.string(),role:w.literal("reasoning")}),sk=Te.extend({type:w.literal(M.REASONING_MESSAGE_CONTENT),messageId:w.string(),delta:w.string()}),ck=Te.extend({type:w.literal(M.REASONING_MESSAGE_END),messageId:w.string()}),uk=Te.extend({type:w.literal(M.REASONING_MESSAGE_CHUNK),messageId:w.string().optional(),delta:w.string().optional()}),lk=Te.extend({type:w.literal(M.REASONING_END),messageId:w.string()}),dk=Te.extend({type:w.literal(M.REASONING_ENCRYPTED_VALUE),subtype:ok,entityId:w.string(),encryptedValue:w.string()}),wc=w.discriminatedUnion("type",[k_,Fv,O_,P_,V_,B_,N_,F_,D_,M_,q_,j_,U_,L_,G_,$_,Q_,H_,z_,W_,K_,Y_,ek,tk,rk,nk,ik,ak,sk,ck,uk,lk,dk]);m();d();f();p();var kp={};ti(kp,{JsonPatchError:()=>Qe,_areEquals:()=>ia,applyOperation:()=>On,applyPatch:()=>Tc,applyReducer:()=>hk,deepClone:()=>mk,getValueByPointer:()=>Rc,validate:()=>Mv,validator:()=>Ic});m();d();f();p();m();d();f();p();var pk=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},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)}}(),fk=Object.prototype.hasOwnProperty;function xc(e,t){return fk.call(e,t)}function Cc(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)xc(e,o)&&n.push(o);return n}function ct(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Ec(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 er(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function na(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Ac(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Ac(e[t]))return!0}else if(typeof e=="object"){for(var n=Cc(e),o=n.length,i=0;i<o;i++)if(Ac(e[n[i]]))return!0}}return!1}function Dv(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 oa=function(e){pk(t,e);function t(r,n,o,i,a){var s=this.constructor,c=e.call(this,Dv(r,{name:n,index:o,operation:i,tree:a}))||this;return c.name=n,c.index=o,c.operation=i,c.tree=a,Object.setPrototypeOf(c,s.prototype),c.message=Dv(r,{name:n,index:o,operation:i,tree:a}),c}return t}(Error);var Qe=oa,mk=ct,Mo={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=Rc(r,this.path);n&&(n=ct(n));var o=On(r,{op:"remove",path:this.from}).removed;return On(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=Rc(r,this.from);return On(r,{op:"add",path:this.path,value:ct(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:ia(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},gk={add:function(e,t,r){return Ec(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:Mo.move,copy:Mo.copy,test:Mo.test,_get:Mo._get};function Rc(e,t){if(t=="")return e;var r={op:"_get",path:t};return On(e,r),r.value}function On(e,t,r,n,o,i){if(r===void 0&&(r=!1),n===void 0&&(n=!0),o===void 0&&(o=!0),i===void 0&&(i=0),r&&(typeof r=="function"?r(t,0,e,t.path):Ic(t,0)),t.path===""){var a={newDocument:e};if(t.op==="add")return a.newDocument=t.value,a;if(t.op==="replace")return a.newDocument=t.value,a.removed=e,a;if(t.op==="move"||t.op==="copy")return a.newDocument=Rc(e,t.from),t.op==="move"&&(a.removed=e),a;if(t.op==="test"){if(a.test=ia(e,t.value),a.test===!1)throw new Qe("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a.newDocument=e,a}else{if(t.op==="remove")return a.removed=e,a.newDocument=null,a;if(t.op==="_get")return t.value=e,a;if(r)throw new Qe("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",i,t,e);return a}}else{n||(e=ct(e));var s=t.path||"",c=s.split("/"),u=e,g=1,v=c.length,E=void 0,y=void 0,h=void 0;for(typeof r=="function"?h=r:h=Ic;;){if(y=c[g],y&&y.indexOf("~")!=-1&&(y=na(y)),o&&(y=="__proto__"||y=="prototype"&&g>0&&c[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&&E===void 0&&(u[y]===void 0?E=c.slice(0,g).join("/"):g==v-1&&(E=t.path),E!==void 0&&h(t,0,e,E)),g++,Array.isArray(u)){if(y==="-")y=u.length;else{if(r&&!Ec(y))throw new Qe("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",i,t,e);Ec(y)&&(y=~~y)}if(g>=v){if(r&&t.op==="add"&&y>u.length)throw new Qe("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",i,t,e);var a=gk[t.op].call(t,u,y,e);if(a.test===!1)throw new Qe("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}}else if(g>=v){var a=Mo[t.op].call(t,u,y,e);if(a.test===!1)throw new Qe("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}if(u=u[y],r&&g<v&&(!u||typeof u!="object"))throw new Qe("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",i,t,e)}}}function Tc(e,t,r,n,o){if(n===void 0&&(n=!0),o===void 0&&(o=!0),r&&!Array.isArray(t))throw new Qe("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=ct(e));for(var i=new Array(t.length),a=0,s=t.length;a<s;a++)i[a]=On(e,t[a],r,!0,o,a),e=i[a].newDocument;return i.newDocument=e,i}function hk(e,t,r){var n=On(e,t);if(n.test===!1)throw new Qe("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function Ic(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new Qe("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(Mo[e.op]){if(typeof e.path!="string")throw new Qe("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Qe("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 Qe("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 Qe("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")&&Ac(e.value))throw new Qe("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,i=n.split("/").length;if(o!==i+1&&o!==i)throw new Qe("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 Qe("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 a={op:"_get",path:e.from,value:void 0},s=Mv([a],r);if(s&&s.name==="OPERATION_PATH_UNRESOLVABLE")throw new Qe("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new Qe("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function Mv(e,t,r){try{if(!Array.isArray(e))throw new Qe("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Tc(ct(t),ct(e),r||!0);else{r=r||Ic;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(o){if(o instanceof Qe)return o;throw o}}function ia(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,i,a;if(r&&n){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(!ia(e[o],t[o]))return!1;return!0}if(r!=n)return!1;var s=Object.keys(e);if(i=s.length,i!==Object.keys(t).length)return!1;for(o=i;o--!==0;)if(!t.hasOwnProperty(s[o]))return!1;for(o=i;o--!==0;)if(a=s[o],!ia(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var Fp={};ti(Fp,{compare:()=>Ck,generate:()=>Op,observe:()=>xk,unobserve:()=>Ak});m();d();f();p();var Pp=new WeakMap,yk=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),vk=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function Sk(e){return Pp.get(e)}function bk(e,t){return e.observers.get(t)}function wk(e,t){e.observers.delete(t.callback)}function Ak(e,t){t.unobserve()}function xk(e,t){var r=[],n,o=Sk(e);if(!o)o=new yk(e),Pp.set(e,o);else{var i=bk(o,t);n=i&&i.observer}if(n)return n;if(n={},o.value=ct(e),t){n.callback=t,n.next=null;var a=function(){Op(n)},s=function(){clearTimeout(n.next),n.next=setTimeout(a)};typeof window<"u"&&(window.addEventListener("mouseup",s),window.addEventListener("keyup",s),window.addEventListener("mousedown",s),window.addEventListener("keydown",s),window.addEventListener("change",s))}return n.patches=r,n.object=e,n.unobserve=function(){Op(n),clearTimeout(n.next),wk(o,n),typeof window<"u"&&(window.removeEventListener("mouseup",s),window.removeEventListener("keyup",s),window.removeEventListener("mousedown",s),window.removeEventListener("keydown",s),window.removeEventListener("change",s))},o.observers.set(t,new vk(t,n)),n}function Op(e,t){t===void 0&&(t=!1);var r=Pp.get(e.object);Np(r.value,e.object,e.patches,"",t),e.patches.length&&Tc(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function Np(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var i=Cc(t),a=Cc(e),s=!1,c=!1,u=a.length-1;u>=0;u--){var g=a[u],v=e[g];if(xc(t,g)&&!(t[g]===void 0&&v!==void 0&&Array.isArray(t)===!1)){var E=t[g];typeof v=="object"&&v!=null&&typeof E=="object"&&E!=null&&Array.isArray(v)===Array.isArray(E)?Np(v,E,r,n+"/"+er(g),o):v!==E&&(s=!0,o&&r.push({op:"test",path:n+"/"+er(g),value:ct(v)}),r.push({op:"replace",path:n+"/"+er(g),value:ct(E)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+er(g),value:ct(v)}),r.push({op:"remove",path:n+"/"+er(g)}),c=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),s=!0)}if(!(!c&&i.length==a.length))for(var u=0;u<i.length;u++){var g=i[u];!xc(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+er(g),value:ct(t[g])})}}}function Ck(e,t,r){r===void 0&&(r=!1);var n=[];return Np(e,t,n,"",r),n}var _c=Object.assign({},kp,Fp,{JsonPatchError:oa,deepClone:ct,escapePathComponent:er,unescapePathComponent:na});m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var Dp=function(e,t){return Dp=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])},Dp(e,t)};function tr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Dp(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function qv(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(g){try{u(n.next(g))}catch(v){a(v)}}function c(g){try{u(n.throw(g))}catch(v){a(v)}}function u(g){g.done?i(g.value):o(g.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}function kc(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(g){return c([u,g])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(r=0)),r;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(g){u=[6,g],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Sr(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 qo(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-->0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function jo(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function Pn(e){return this instanceof Pn?(this.v=e,this):new Pn(e)}function jv(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(y){return function(h){return Promise.resolve(h).then(y,v)}}function s(y,h){n[y]&&(o[y]=function(S){return new Promise(function(C,R){i.push([y,S,C,R])>1||c(y,S)})},h&&(o[y]=h(o[y])))}function c(y,h){try{u(n[y](h))}catch(S){E(i[0][3],S)}}function u(y){y.value instanceof Pn?Promise.resolve(y.value.v).then(g,v):E(i[0][2],y)}function g(y){c("next",y)}function v(y){c("throw",y)}function E(y,h){y(h),i.shift(),i.length&&c(i[0][0],i[0][1])}}function Lv(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 Sr=="function"?Sr(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(s,c){a=e[i](a),o(s,c,a.done,a.value)})}}function o(i,a,s,c){Promise.resolve(c).then(function(u){i({value:u,done:s})},a)}}m();d();f();p();function xe(e){return typeof e=="function"}m();d();f();p();m();d();f();p();m();d();f();p();function Lo(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 Oc=Lo(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
31
+ `;function zE(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var WE=["1",1,"yes",!0];function KE(){let e=[];return ud()&&e.push(window.doNotTrack),Ad()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>WE.indexOf(t)!==-1)}function _s(e){return e===!0?!1:KE()}var Hg="v15",zg={default:"https://analytics.cloud.coveo.com/rest/ua"};function YE(e=zg.default,t=Hg,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 XE="38824e1f-37f5-42d3-8372-a4b8fa9df946",Yt=class{get defaultOptions(){return{endpoint:zg.default,isCustomEndpoint:!1,token:"",version:Hg,beforeSendHooks:[],afterSendHooks:[]}}get version(){return Bg}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=[UC,DC].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};_s(this.options.disableBrowserPrivacySignals)?this.runtime=new Ts:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(Ae.view,{newEventType:Ae.view,addClientIdParameter:!0}),this.addEventTypeMapping(Ae.click,{newEventType:Ae.click,addClientIdParameter:!0}),this.addEventTypeMapping(Ae.custom,{newEventType:Ae.custom,addClientIdParameter:!0}),this.addEventTypeMapping(Ae.search,{newEventType:Ae.search,addClientIdParameter:!0})}initRuntime(t){return ud()&&lo()?new bd(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(zE()&&console.warn(HE),new wd(t))}get storage(){return this.runtime.storage}determineVisitorId(){return U(this,void 0,void 0,function*(){try{return ud()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||ln()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),ln()}})}getCurrentVisitorId(){return U(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return U(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return U(this,void 0,void 0,function*(){if(xs(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(Cs(t,Cs(r,XE)))}})}getParameters(t,...r){return U(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return U(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(ln()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(_s(this.options.disableBrowserPrivacySignals))return null;try{let r=new URL(t).searchParams.get(Tr.cvo_cid);if(r==null)return null;let n=Tr.fromString(r);return!n||!lo()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return U(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[g=>n.length>0?this.parseVariableArgumentsPayload(n,g):g[0],g=>U(this,void 0,void 0,function*(){return Object.assign(Object.assign({},g),{visitorId:o?yield this.getCurrentVisitorId():""})}),g=>U(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},g),{clientId:yield this.getCurrentVisitorId()}):g}),g=>i?this.ensureAnonymousUserWhenUsingApiKey(g):g,g=>this.beforeSendHooks.reduce((y,S)=>U(this,void 0,void 0,function*(){let E=yield y;return yield S(t,E)}),g)].reduce((g,y)=>U(this,void 0,void 0,function*(){let S=yield g;return yield y(S)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return U(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[v=>this.setTrackingIdIfTrackingIdNotPresent(v),v=>this.removeEmptyPayloadValues(v,t),v=>this.validateParams(v,t),v=>n?ME(v):v,v=>n?this.removeUnknownParameters(v):v,v=>n?this.processCustomParameters(v):this.mapCustomParametersToCustomData(v)].reduce((v,C)=>U(this,void 0,void 0,function*(){let g=yield v;return yield C(g)}),Promise.resolve(r))})}makeEvent(t,...r){return U(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>U(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(s=>s(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return U(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return U(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new As().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(Ae.search,t)})}sendSearchEvent(t){return U(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=lr(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(Ae.click,t)})}sendClickEvent(t){return U(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=lr(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(Ae.custom,t)})}sendCustomEvent(t){return U(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=lr(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return U(this,void 0,void 0,function*(){return this.makeEvent(Ae.view,t)})}sendViewEvent(t){return U(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return U(this,void 0,void 0,function*(){let r=yield(yield A(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return U(this,void 0,void 0,function*(){return yield(yield A(`${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,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[Ae.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,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(UE(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=lr(t,["custom"]),o={};r&&ws(r)&&(o=this.lowercaseKeys(r));let i=VE(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=lr(t,["custom"]);if(r&&ws(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=lr(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==Ae.view||r==Ae.click||r==Ae.search||r==Ae.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==Ae.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=lr(t,["userId"]);return QE(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=lr(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&ws(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&ws(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"?JC(t,r):t}get baseUrl(){return YE(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},dr;(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"})(dr||(dr={}));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 Mg={[$.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",[dr.expandToFullUI]:"interface",[dr.openUserActions]:"User Actions",[dr.showPrecedingSessions]:"User Actions",[dr.showFollowingSessions]:"User Actions",[dr.clickViewedDocument]:"User Actions",[dr.clickPageView]:"User Actions",[dr.createArticle]:"createArticle"},mo=class{constructor(){this.runtime=new Ts,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(Ae.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(Ae.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(Ae.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(Ae.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return Bg}};function ZE(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function JE(e){return e.map(t=>t.replace(/;/g,""))}function Wg(e){let r=e.join(";");return r.length<=256?r:Wg(e.slice(1))}var qg=e=>{let t=JE(e),r=ZE(t);return Wg(r)};function jg(e){let t=typeof e.partialQueries=="string"?e.partialQueries:qg(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:qg(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var ks=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||_s(t.disableBrowserPrivacySignals);this.coveoAnalyticsClient=n?new mo:new Yt(t)}disable(){this.coveoAnalyticsClient=new mo}enable(){this.coveoAnalyticsClient=new Yt(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent($.interfaceLoad)}logInterfaceLoad(){return U(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent($.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return U(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent($.recommendation)}logRecommendation(){return U(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent($.recommendationOpen,t,r)}logRecommendationOpen(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent($.staticFilterClearAll,t)}logStaticFilterClearAll(t){return U(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent($.staticFilterSelect,t)}logStaticFilterSelect(t){return U(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent($.staticFilterDeselect,t)}logStaticFilterDeselect(t){return U(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent($.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return U(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent($.interfaceChange,t)}logInterfaceChange(t){return U(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent($.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return U(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent($.didyoumeanClick)}logDidYouMeanClick(){return U(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 U(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent($.searchboxSubmit)}logSearchboxSubmit(){return U(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent($.searchboxClear)}logSearchboxClear(){return U(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent($.searchboxAsYouType)}logSearchboxAsYouType(){return U(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 U(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent($.breadcrumbResetAll)}logBreadcrumbResetAll(){return U(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent($.documentQuickview,t,r)}logDocumentQuickview(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent($.documentOpen,t,r)}logDocumentOpen(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent($.omniboxAnalytics,jg(t))}logOmniboxAnalytics(t){return U(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent($.omniboxFromLink,jg(t))}logOmniboxFromLink(t){return U(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent($.searchFromLink)}logSearchFromLink(){return U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent($.pagerScrolling)}logPagerScrolling(){return U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return U(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorBack);return{description:t.description,log:()=>U(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorBack)})}})}logQueryErrorBack(){return U(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return U(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorRetry);return{description:t.description,log:()=>U(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorRetry)})}})}logQueryErrorRetry(){return U(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return U(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorClear);return{description:t.description,log:()=>U(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorClear)})}})}logQueryErrorClear(){return U(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent($.likeSmartSnippet)}logLikeSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent($.dislikeSmartSnippet)}logDislikeSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent($.expandSmartSnippet)}logExpandSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent($.collapseSmartSnippet)}logCollapseSmartSnippet(){return U(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent($.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent($.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return U(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent($.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent($.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return U(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent($.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return U(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent($.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return U(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent($.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return U(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent($.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent($.copyToClipboard,t,r)}logCopyToClipboard(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent($.recentQueryClick)}logRecentQueryClick(){return U(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent($.clearRecentQueries)}logClearRecentQueries(){return U(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent($.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent($.clearRecentResults)}logClearRecentResults(){return U(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent($.noResultsBack)}logNoResultsBack(){return U(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent($.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent($.showLessFoldedResults)}logShowLessFoldedResults(){return U(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return U(this,arguments,void 0,function*(n,o,i=Mg[n]){this.coveoAnalyticsClient.getParameters;let a=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),s=Object.assign(Object.assign({},yield this.getBaseEventRequest(a)),{eventType:i,eventValue:n}),c=yield this.coveoAnalyticsClient.makeCustomEvent(s);return{description:this.makeEventDescription(c,n),log:({searchUID:u})=>c.log({lastSearchQueryUid:u})}})}logCustomEvent(t,r){return U(this,arguments,void 0,function*(n,o,i=Mg[n]){return(yield this.makeCustomEvent(n,o,i)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return U(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:s})=>a.log({lastSearchQueryUid:s})}})}logCustomEventWithType(t,r,n){return U(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return U(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return U(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:s})=>a.log({searchQueryUid:s})}})}logClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return U(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return U(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof Yt?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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(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 U(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent($.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return U(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 U(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Os=Object.assign({},Oi),Lg=Object.keys(Os).map(e=>Os[e]),po=class extends pd{constructor({client:t,uuidGenerator:r=ln}){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])=>Lg.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(Lg.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Os.pageview,{newEventType:Ae.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Os.event,{newEventType:Ae.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}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return oE(this.ticket)}};po.Id="svc";var Ps;(function(e){e.click="click",e.flowStart="flowStart"})(Ps||(Ps={}));var _t;(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"})(_t||(_t={}));var Ns;(function(e){e.quit="Quit",e.solved="Solved"})(Ns||(Ns={}));var Fs=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!_s(t.disableBrowserPrivacySignals);this.coveoAnalyticsClient=o?new Yt(t):new mo,this.svc=new po({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new mo,this.svc=new po({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Yt(this.options),this.svc=new po({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(_t.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(_t.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(_t.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(_t.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(_t.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(_t.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(_t.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(_t.caseCancelled,{reason:Ns.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(_t.caseSolved,{reason:Ns.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(_t.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Ps.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Ps.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return U(this,void 0,void 0,function*(){var r,n;let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof Yt?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;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:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){return U(this,void 0,void 0,function*(){var i,a;let s=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(s)})}};var Kg=e=>new Yt(e).getCurrentVisitorId(),Fi=(e,t)=>typeof t=="function"?(...r)=>{let n=ci(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,Di=(e,t)=>(...r)=>{let n=ci(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();function Ds(){return{desiredCount:5,numberOfValues:8,set:{}}}m();d();f();p();m();d();f();p();m();d();f();p();function Yg(e){let{activeValue:t,ancestryMap:r}=eR(e);return t?tR(t,r):[]}function eR(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 tR(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var rR=(e,t)=>e.categoryFacetSet[t]?.request;var Ed=(e,t)=>{let r=rR(e,t);return Yg(r?.currentValues??[])};m();d();f();p();function Ms(){return{}}m();d();f();p();function qs(){return{}}m();d();f();p();function js(){return{}}m();d();f();p();function Ls(){return{}}function Rd(e){return{facetSet:e.facetSet??Ls(),categoryFacetSet:e.categoryFacetSet??Ms(),dateFacetSet:e.dateFacetSet??qs(),numericFacetSet:e.numericFacetSet??js(),automaticFacetSet:e.automaticFacetSet??Ds()}}var Id=e=>{let t=[];return iR(e).forEach((r,n)=>{let o=fR(e,r.facetId),i=dR(r,n+1);if(oR(r)){if(!!!Ed(e,r.facetId).length)return;t.push({...i,...uR(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,s)=>{if(a.state==="idle")return;let c=Xg(a,s+1,o),u=nR(r)?Zg(a):sR(a);t.push({...i,...c,...u})})}),aR(e).forEach((r,n)=>{let o=lR(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let s=Xg(i,a+1,"specific"),c=Zg(i);t.push({...o,...s,...c})})}),t},nR=e=>e.type==="specific",oR=e=>e.type==="hierarchical",iR=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),aR=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Xg=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),sR=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),Zg=e=>({displayValue:e.value,value:e.value}),cR=(e,t)=>Ed(e,t).map(n=>n.value).join(";"),uR=(e,t)=>{let n=cR(e,t);return{value:n,valuePosition:1,displayValue:n}},lR=(e,t)=>({title:Jg(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),dR=(e,t)=>({title:Jg(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),Jg=(e,t)=>`${e}_${t}`,pR=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,fR=(e,t)=>{let r=pR(e,t);return r?r.type:"specific"};m();d();f();p();m();d();f();p();var Td=e=>e.configuration.search.locale,eh=e=>e.configuration.search.timezone,th=e=>e.configuration.accessToken,rh=e=>e.configuration.organizationId,nh=e=>e.configuration.environment,Us=e=>e.configuration?.knowledge?.agentId,oh=e=>e.configuration.knowledge.debugAgentSession;var Me=e=>{if(mR(e)||_d(e))return e.generatedAnswer?.answerId;if(gR(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},mR=e=>"answer"in e&&"generatedAnswer"in e&&!se(e.generatedAnswer?.answerConfigurationId),_d=e=>{let t=Us(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},gR=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",kd=e=>e.generatedAnswer?.fieldsToIncludeInCitations,_r=e=>e.followUpAnswers?.conversationId,hR=e=>e.generatedAnswer?.citations,yR=e=>e.followUpAnswers?.followUpAnswers,vR=$e(yR,e=>e?.flatMap(t=>t.citations)),SR=(e,t)=>t,go=$e(hR,vR,SR,(e,t,r)=>e?.find(n=>n.id===r)??t?.find(n=>n.id===r));m();d();f();p();var Ct=()=>({q:"",enableQuerySyntax:!1});m();d();f();p();m();d();f();p();var ih=(r=>(r.Ascending="ascending",r.Descending="descending",r))(ih||{}),ah=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(ah||{}),Od=e=>{if(Zf(e))return e.map(t=>Od(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""}},sh=()=>({by:"relevancy"});var $1=new ne({values:{by:new Il({enum:ah,required:!0}),order:new Il({enum:ih}),field:new z}});function Vs(){return Od(sh())}m();d();f();p();m();d();f();p();var ho=()=>"default";var bR=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},pr=class{constructor(t){ae(this,"getState",t);ae(this,"state");this.state=t()}getLanguage(){return bR(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let s=`context_${i}`;o[s]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=ro),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||ho()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};var Mi=class Mi extends pr{constructor(){super(...arguments);ae(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 Id(Rd(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||Mi.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||Qt().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||Mi.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Me(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??Vs()}}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 i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],i=o.completions.map(u=>u.expression),a=o.partialQueries.length-1,s=o.partialQueries[a]||"",c=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:s,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:c}}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||Ct().q}get responseTime(){return this.state.search?.duration||Qt().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||Qt().response.totalCountFiltered}};ae(Mi,"fallbackPipelineName","default");var kr=Mi,ch=({logger:e,getState:t,analyticsClientMiddleware:r=(a,s)=>s,preprocessRequest:n,provider:o,disableBrowserPrivacySignals:i})=>{let a=t(),s=a.configuration.accessToken,c=a.configuration.analytics.apiBaseUrl??It(a.configuration.organizationId,a.configuration.environment,"analytics"),u=a.configuration.analytics.runtimeEnvironment,h=a.configuration.analytics.enabled,v=new ks({token:s,endpoint:c,runtimeEnvironment:u,disableBrowserPrivacySignals:i,preprocessRequest:Fi(e,n),beforeSendHooks:[Di(e,r),(C,g)=>(e.info({...g,type:C,endpoint:c,token:s},"Analytics request"),g)]},o);return h||v.disable(),v},Pd=()=>{let t=gt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};var Bs=/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield Kg(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}),...(Pd()&&{pageId:Pd()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:uo(e)})}}});return function Bs(_x17,_x18){return _ref10.apply(this,arguments)}}();m();d();f();p();m();d();f();p();m();d();f();p();var yo=()=>({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""});var qi=class extends pr{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:Ct().q,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||yo().searchUid}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.recommendation?.pipeline||this.state.pipeline||"default";return t?r:void 0}get responseTime(){return this.state.recommendation?.duration||yo().duration}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.recommendation?.recommendations.length||yo().recommendations.length}};m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();function uh(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}m();d();f();p();m();d();f();p();m();d();f();p();var lh=/^(?:[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 wR(e){return typeof e=="string"&&lh.test(e)}var Nd=wR;m();d();f();p();var it=[];for(let e=0;e<256;++e)it.push((e+256).toString(16).slice(1));function dh(e,t=0){return(it[e[t+0]]+it[e[t+1]]+it[e[t+2]]+it[e[t+3]]+"-"+it[e[t+4]]+it[e[t+5]]+"-"+it[e[t+6]]+it[e[t+7]]+"-"+it[e[t+8]]+it[e[t+9]]+"-"+it[e[t+10]]+it[e[t+11]]+it[e[t+12]]+it[e[t+13]]+it[e[t+14]]+it[e[t+15]]).toLowerCase()}m();d();f();p();var AR=new Uint8Array(16);function Fd(){return crypto.getRandomValues(AR)}m();d();f();p();function xR(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():CR(e,t,r)}function CR(e,t,r){e=e||{};let n=e.random??e.rng?.()??Fd();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 dh(n)}var Dd=xR;function ER(_x19){return _ER.apply(this,arguments)}function _ER(){_ER=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;if(a!=="disabled")return n.call(r),t.send(o,i,r)});return _ER.apply(this,arguments)}var yh="2.1.3",Md=128,vh=192,ph=224,fh=240,RR=248;function IR(e){return(e&RR)===fh?4:(e&fh)===ph?3:(e&ph)===vh?2:1}function TR(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&Md)!=Md)break;if(r-=3,(n&vh)!=Md){t-r>=IR(n)*3&&(r=t);break}}return e.substring(0,r)}function _R(e){let{trackingId:t}=e;return{trackingId:t}}function kR(e){return(e.source||[]).concat([`relay@${yh}`])}function Sh(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:i}=r,a=_R(t),s=r.getClientId();return Object.freeze({type:e,config:a,ts:Date.now(),source:kR(t),clientId:s,userAgent:i(),referrer:mh(n()),location:mh(o())})}function mh(e){return e!==null?TR(e,1024):null}function OR(e,t,r,n){return{...t,meta:Sh(e,r,n)}}var PR="*";function NR(){let e=[];function t({type:c,callback:u}){return e.findIndex(h=>h.type===c&&h.callback===u)}function r(c,u){return c.type==="*"||u===c.type}function n(c){return t(c)<0&&e.push(c),()=>s(c.type,c.callback)}function o(c){e.forEach(u=>{if(r(u,c.meta.type))try{u.callback(c)}catch(h){console.error(h)}})}function i(c){if(c===PR)e.length=0;else for(let u=e.length-1;u>=0;u--)e[u].type===c&&e.splice(u,1)}function a(c){let u=t(c);u>=0&&e.splice(u,1)}function s(c,u){u?a({type:c,callback:u}):i(c)}return{add:n,call:o,remove:s}}function gh({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 FR(e){let t=gh(e);return{get:()=>t,update:r=>{t=gh({...t,...r})}}}var qd=DR();function DR(){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 i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,s=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${s};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function MR(){return{getItem(e){return qd.getItem(e)||localStorage.getItem(e)},removeItem(e){qd.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),qd.setItem(e,t,31556952e3)}}}var hh="visitorId";function qR(){let e=document.referrer;return e===""?null:e}function jd(){let e=MR();return{runtime:"browser",send:function(){var _ref11=_asyncToGenerator(function*(t,r,n){let o=A(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});uh().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let a=yield o;if(a?.ok){let s;try{s=yield a.json()}catch{return}for(let c of s.events)if(!c.accepted)throw new Error(`Received event was rejected for processing: ${c.errorMessage}`)}else throw new Error(`Error ${a.status}: Failed to send the event(s).`)});return function send(_x20,_x21,_x22){return _ref11.apply(this,arguments)}}(),getReferrer:()=>qR(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(hh);if(t&&Nd(t))return t;let r=Dd();return e.setItem(hh,r),r}}}function jR(){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 LR(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function UR(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=LR();return t&&r?{...r,runtime:"custom"}:t&&VR()&&jR()?jd():n}function VR(){try{return typeof window=="object"}catch{return!1}}function BR(e){return{get:()=>Object.freeze(UR(e))}}function bh(e){let t=FR(e),r=NR(),n=BR(t);return{emit:function(){var _ref12=_asyncToGenerator(function*(o,i){let a=t.get(),s=n.get(),c=OR(o,i,a,s);return ER({config:a,environment:s,event:c,listenerManager:r})});return function emit(_x23,_x24){return _ref12.apply(this,arguments)}}(),getMeta:o=>Sh(o,t.get(),n.get()),on:(o,i)=>r.add({type:o,callback:i}),off:(o,i)=>r.remove(o,i),updateConfig:o=>t.update(o),version:yh}}m();d();f();p();function wh(){return typeof window<"u"&&typeof document<"u"}var ji=$e(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>uo(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,s)=>{let c=$R(s);return bh({mode:i?"emit":"disabled",url:o??Na(e,t),token:r,trackingId:n??null,source:a,environment:c})}),GR={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref13=_asyncToGenerator(function*(){});return function send(){return _ref13.apply(this,arguments)}}()},$R=e=>{if(!e)return;let t=e();return{...(wh()?jd():GR),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};m();d();f();p();var Li=class extends pr{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},Ah=({logger:e,getState:t,analyticsClientMiddleware:r=(a,s)=>s,preprocessRequest:n,provider:o=new Li(t),disableBrowserPrivacySignals:i})=>{let a=t(),s=a.configuration.accessToken,c=a.configuration.analytics.apiBaseUrl??It(a.configuration.organizationId,a.configuration.environment,"analytics"),u=a.configuration.analytics.runtimeEnvironment,h=a.configuration.analytics.enabled,v=new Fs({enableAnalytics:h,token:s,endpoint:c,runtimeEnvironment:u,disableBrowserPrivacySignals:i,preprocessRequest:Fi(e,n),beforeSendHooks:[Di(e,r),(C,g)=>(e.info({...g,type:C,endpoint:c,token:s},"Analytics request"),g)]},o);return h||v.disable(),v};m();d();f();p();m();d();f();p();function Ch(e,t){return{...new kr(t).getBaseMetadata(),actionCause:e,type:e}}function QR(e){return Object.assign(e,{instantlyCallable:!0})}function HR(e,t){let r=i=>{let a=Ie(e,i);return QR(Object.assign(a,{type:a.typePrefix}))},n=r(/*#__PURE__*/function(){var _ref14=_asyncToGenerator(function*(i,{getState:a,extra:s}){let{analyticsClientMiddleware:c,preprocessRequest:u,logger:h,disableBrowserPrivacySignals:v}=s;return yield(yield t({getState:a,analyticsClientMiddleware:c,preprocessRequest:u,logger:h,disableBrowserPrivacySignals:v})).log({state:a(),extra:s})});return function(_x25,_x26){return _ref14.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref15=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:s,logger:c,disableBrowserPrivacySignals:u}){let{description:h,log:v}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:s,logger:c,disableBrowserPrivacySignals:u});return{description:h,action:r(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(C,{getState:g,extra:y}){return yield v({state:g(),extra:y})});return function(_x28,_x29){return _ref16.apply(this,arguments)}}())}});return function prepare(_x27){return _ref15.apply(this,arguments)}}()}),n}var Eh=(e,t,r)=>{function n(...o){let i=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 KR(i)}return n},zR=e=>e.configuration.analytics.analyticsMode==="legacy",WR=e=>e.configuration.analytics.analyticsMode==="next",KR=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=s=>new a(s)),HR(e,/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*({getState:s,analyticsClientMiddleware:c,preprocessRequest:u,logger:h,disableBrowserPrivacySignals:v}){let C=[],g={log:function(){var _ref18=_asyncToGenerator(function*({state:k}){for(let I of C)yield I(k)});return function log(_x31){return _ref18.apply(this,arguments)}}()},y=s(),S=i({getState:s,logger:h,analyticsClientMiddleware:c,preprocessRequest:u,disableBrowserPrivacySignals:v,provider:r(s)}),E=yield t(S,s());g.description=E?.description,C.push(/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(k){zR(k)&&(yield YR(E,r,k,h,S.coveoAnalyticsClient))});return function(_x32){return _ref19.apply(this,arguments)}}());let{emit:R}=ji(y);return C.push(/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(k){if(WR(k)&&o&&n){let I=n(k);yield nI(R,o,I)}});return function(_x33){return _ref20.apply(this,arguments)}}()),g});return function(_x30){return _ref17.apply(this,arguments)}}()));function YR(_x34,_x35,_x36,_x37,_x38){return _YR.apply(this,arguments)}function _YR(){_YR=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _YR.apply(this,arguments)}var XR=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref21=_asyncToGenerator(function*(i){r(n,o)});return function log(_x39){return _ref21.apply(this,arguments)}}()}),Pe=Eh(e=>ch({...e,provider:e.provider||new kr(e.getState)}),e=>e,kr),WB=Eh(Ah,XR("caseAssist"),Li);var Ld=(e,t)=>{let r=t.recommendation?.recommendations.findIndex(({uniqueId:n})=>e.uniqueId===n)||0;return ZR(e,r,t)},Rh=(e,t)=>({sourceName:Th(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||Ir()}),Ih=(e,t)=>({sourceName:Th(e),documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||Ir()});function Th(e){let t=e.source;return se(t)?"unknown":t}var _h=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function ZR(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:tI(e),...(xh(e)?{documentCategory:xh(e)}:{}),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:rI(e),queryPipeline:r.pipeline||Ir()}}function xh(e){return e.raw?.objecttype||void 0}var Gs=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||""}),kh={urihash:new z,sourcetype:new z,permanentid:new z},Oh={uniqueId:Y,raw:new ne({values:kh}),title:Y,uri:Y,clickUri:Y,rankingModifier:new z({required:!1,emptyAllowed:!0})};function JR(e){return Object.assign({},...Object.keys(kh).map(t=>({[t]:e[t]})))}function eI(e){return Object.assign({},...Object.keys(Oh).map(t=>({[t]:e[t]})),{raw:JR(e.raw)})}function tI(e){let t=e.raw.author;return se(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function rI(e){let t=e.raw.source;return se(t)?"unknown":t}var Ud=e=>new ht(Oh).validate(eI(e));function nI(_x40,_x41,_x42){return _nI.apply(this,arguments)}function _nI(){_nI=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _nI.apply(this,arguments)}m();d();f();p();var Ph=()=>Pe("analytics/recommendation/update",e=>e.makeRecommendationInterfaceLoad(),e=>new qi(e)),Nh=()=>({actionCause:"recommendationInterfaceLoad"}),Qs=e=>Pe({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(Ud(e),t.makeRecommendationOpen(Ld(e,r),Gs(e))),__legacy__provider:t=>new qi(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=Ld(e,t),n=Gs(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});var vo=O("recommendation/set",e=>B(e,{id:Y})),Or=Ie("recommendation/get",/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=Date.now(),a=yield oI(o),s=yield n.recommendations(a),c=Date.now()-i;return yt(s)?r(s.error):{recommendations:s.success.results,analyticsAction:Ph(),duration:c,searchUid:s.success.searchUid,splitTestRun:s.success.splitTestRun,pipeline:s.success.pipeline}});return function(_x43,_x44){return _ref22.apply(this,arguments)}}()),oI=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??wr(e.configuration.organizationId,e.configuration.environment),recommendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?gt.getInstance().getHistory():[],...(e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.context&&{context:e.context.contextValues}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.configuration.analytics.enabled&&(yield iI(e,Nh()))),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}),...(e.pagination&&{numberOfResults:e.pagination.numberOfResults})}});return function oI(_x45){return _ref23.apply(this,arguments)}}(),iI=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=e.configuration.analytics.analyticsMode==="legacy"?void 0:{actionCause:t.actionCause,type:t.actionCause};return yield Bs(e.configuration.analytics,r)});return function iI(_x46,_x47){return _ref24.apply(this,arguments)}}();var So=Be(yo(),e=>{e.addCase(vo,(t,r)=>{t.id=r.payload.id}).addCase(Or.rejected,(t,r)=>{t.error=r.payload?r.payload:null,t.isLoading=!1}).addCase(Or.fulfilled,(t,r)=>{t.error=null,t.recommendations=r.payload.recommendations.map(n=>({...n,searchUid:r.payload.searchUid})),t.duration=r.payload.duration,t.isLoading=!1,t.searchUid=r.payload.searchUid,t.splitTestRun=r.payload.splitTestRun,t.pipeline=r.payload.pipeline}).addCase(Or.pending,t=>{t.isLoading=!0}).addCase(hs,(t,r)=>{t.error=r.payload,t.isLoading=!1})});m();d();f();p();var bo=O("searchHub/set",e=>B(e,new z({required:!0,emptyAllowed:!0})));m();d();f();p();var wo=Be(ho(),e=>{e.addCase(bo,(t,r)=>r.payload).addCase(vt.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Wt,(t,r)=>r.payload.searchHub||t)});m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var Fh=class extends Error{constructor(t){super(t[0].message);ae(this,"issues");this.name="SchemaError",this.issues=t}};var mr="uninitialized",Gd="pending",Vi="fulfilled",Bi="rejected";function Dh(e){return{status:e,isUninitialized:e===mr,isLoading:e===Gd,isSuccess:e===Vi,isError:e===Bi}}var Mh=Ht;function Yh(e,t){if(e===t||!(Mh(e)&&Mh(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=Yh(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function $d(e,t,r){return e.reduce((n,o,i)=>(t(o,i)&&n.push(r(o,i)),n),[]).flat()}function aI(e){return new RegExp("(^|:)//").test(e)}function sI(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Wd(e){return e!=null}function qh(e){return[...(e?.values()??[])].filter(Wd)}function cI(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var uI=e=>e.replace(/\/$/,""),lI=e=>e.replace(/^\//,"");function dI(e,t){if(!e)return t;if(!t)return e;if(aI(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=uI(e),t=lI(t),`${e}${r}${t}`}function Ws(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var Qd=()=>new Map,pI=e=>{let t=new l.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},fI=(...e)=>{for(let r of e)if(r.aborted)return l.AbortSignal.abort(r.reason);let t=new l.AbortController;for(let r of e)r.addEventListener("abort",()=>t.abort(r.reason),{signal:t.signal,once:!0});return t.signal},jh=(...e)=>A(...e),mI=e=>e.status>=200&&e.status<=299,gI=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function Lh(e){if(!Ht(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}var hI=e=>typeof e=="object"&&(Ht(e)||Array.isArray(e)||typeof e.toJSON=="function");function Xh({baseUrl:e,prepareHeaders:t=v=>v,fetchFn:r=jh,paramsSerializer:n,isJsonContentType:o=gI,jsonContentType:i="application/json",jsonReplacer:a,timeout:s,responseHandler:c,validateStatus:u,...h}={}){return typeof A>"u"&&r===jh&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(C,g,y){let{getState:S,extra:E,endpoint:R,forced:k,type:I}=g,T,{url:_,headers:D=new x(h.headers),params:G=void 0,responseHandler:V=c??"json",validateStatus:j=u??mI,timeout:L=s,...q}=typeof C=="string"?{url:C}:C,P={...h,signal:L?fI(g.signal,pI(L)):g.signal,...q};D=new x(Lh(D)),P.headers=(yield t(D,{getState:S,arg:C,extra:E,endpoint:R,forced:k,type:I,extraOptions:y}))||D;let N=hI(P.body);if(P.body!=null&&!N&&typeof P.body!="string"&&P.headers.delete("content-type"),!P.headers.has("content-type")&&N&&P.headers.set("content-type",i),N&&o(P.headers)&&(P.body=JSON.stringify(P.body,a)),P.headers.has("accept")||(V==="json"?P.headers.set("accept","application/json"):V==="text"&&P.headers.set("accept","text/plain, text/html, */*")),G){let te=~_.indexOf("?")?"&":"?",ue=n?n(G):new URLSearchParams(Lh(G));_+=te+ue}_=dI(e,_);let F=new Request(_,P);T={request:new Request(_,P)};let Q;try{Q=yield r(F)}catch(te){return{error:{status:(te instanceof Error||typeof DOMException<"u"&&te instanceof DOMException)&&te.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(te)},meta:T}}let Z=Q.clone();T.response=Z;let X,W="";try{let te;if(yield Promise.all([v(Q,V).then(ue=>X=ue,ue=>te=ue),Z.text().then(ue=>W=ue,()=>{})]),te)throw te}catch(te){return{error:{status:"PARSING_ERROR",originalStatus:Q.status,data:W,error:String(te)},meta:T}}return j(Q,X)?{data:X,meta:T}:{error:{status:Q.status,data:X},meta:T}});return function(_x48,_x49,_x50){return _ref25.apply(this,arguments)}}());function v(_x51,_x52){return _v2.apply(this,arguments)}function _v2(){_v2=_asyncToGenerator(function*(C,g){if(typeof g=="function")return g(C);if(g==="content-type"&&(g=o(C.headers)?"json":"text"),g==="json"){let y=yield C.text();return y.length?JSON.parse(y):null}return C.text()});return _v2.apply(this,arguments)}}var Ao=class{constructor(e,t=void 0){ae(this,"value");ae(this,"meta");this.value=e,this.meta=t}};function yI(){return _yI.apply(this,arguments)}function _yI(){_yI=_asyncToGenerator(function*(e=0,t=5,r){let n=Math.min(e,t),o=~~((Math.random()+.4)*(300<<n));yield new Promise((i,a)=>{let s=setTimeout(()=>i(),o);if(r){let c=()=>{clearTimeout(s),a(new Error("Aborted"))};r.aborted?(clearTimeout(s),a(new Error("Aborted"))):r.addEventListener("abort",c,{once:!0})}})});return _yI.apply(this,arguments)}function Zh(e,t){throw Object.assign(new Ao({error:e,meta:t}),{throwImmediately:!0})}function Vd(e){e.aborted&&Zh({status:"CUSTOM_ERROR",error:"Aborted"})}var Uh={},vI=(e,t)=>(/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(r,n,o){let i=[5,(t||Uh).maxRetries,(o||Uh).maxRetries].filter(h=>h!==void 0),[a]=i.slice(-1),c={maxRetries:a,backoff:yI,retryCondition:(h,v,{attempt:C})=>C<=a,...t,...o},u=0;for(;;){Vd(n.signal);try{let h=yield e(r,n,o);if(h.error)throw new Ao(h);return h}catch(h){if(u++,h.throwImmediately){if(h instanceof Ao)return h.value;throw h}if(h instanceof Ao){if(!c.retryCondition(h.value.error,r,{attempt:u,baseQueryApi:n,extraOptions:o}))return h.value}else if(u>c.maxRetries)return{error:h};Vd(n.signal);try{yield c.backoff(u,c.maxRetries,n.signal)}catch(v){throw Vd(n.signal),v}}}});return function(_x53,_x54,_x55){return _ref26.apply(this,arguments)}}()),Jh=Object.assign(vI,{fail:Zh}),Ys="__rtkq/",SI="online",bI="offline";var ey="focused";var Kd=O(`${Ys}${ey}`),ty=O(`${Ys}un${ey}`),Yd=O(`${Ys}${SI}`),ry=O(`${Ys}${bI}`);var Qi="query",ny="mutation",oy="infinitequery";function Xs(e){return e.type===Qi}function wI(e){return e.type===ny}function Zs(e){return e.type===oy}function Ks(e){return Xs(e)||Zs(e)}function Xd(e,t,r,n,o,i){let a=AI(e)?e(t,r,n,o):e;return a?$d(a,Wd,s=>i(iy(s))):[]}function AI(e){return typeof e=="function"}function iy(e){return typeof e=="string"?{type:e}:e}function xI(e,t){return e.catch(t)}var xo=(e,t)=>e.endpointDefinitions[t],Gi=Symbol("forceQueryFn"),Hd=e=>typeof e[Gi]=="function";function CI({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i,getInternalState:a}){let s=_=>a(_)?.runningQueries,c=_=>a(_)?.runningMutations,{unsubscribeQueryResult:u,removeMutationResult:h,updateSubscriptionOptions:v}=o.internalActions;return{buildInitiateQuery:k,buildInitiateInfiniteQuery:I,buildInitiateMutation:T,getRunningQueryThunk:C,getRunningMutationThunk:g,getRunningQueriesThunk:y,getRunningMutationsThunk:S};function C(_,D){return G=>{let V=xo(i,_),j=e({queryArgs:D,endpointDefinition:V,endpointName:_});return s(G)?.get(j)}}function g(_,D){return G=>c(G)?.get(D)}function y(){return _=>qh(s(_))}function S(){return _=>qh(c(_))}function E(_){}function R(_,D){let G=(V,{subscribe:j=!0,forceRefetch:L,subscriptionOptions:q,[Gi]:P,...N}={})=>(F,H)=>{let Q=e({queryArgs:V,endpointDefinition:D,endpointName:_}),Z,X={...N,type:Qi,subscribe:j,forceRefetch:L,subscriptionOptions:q,endpointName:_,originalArgs:V,queryCacheKey:Q,[Gi]:P};if(Xs(D))Z=t(X);else{let{direction:me,initialPageParam:be,refetchCachedPages:he}=N;Z=r({...X,direction:me,initialPageParam:be,refetchCachedPages:he})}let W=o.endpoints[_].select(V),te=F(Z),ue=W(H());let{requestId:Ee,abort:je}=te,ke=ue.requestId!==Ee,Ne=s(F)?.get(Q),Fe=()=>W(H()),ge=Object.assign(P?te.then(Fe):ke&&!Ne?Promise.resolve(ue):Promise.all([Ne,te]).then(Fe),{arg:V,requestId:Ee,subscriptionOptions:q,queryCacheKey:Q,abort:je,unwrap(){return _asyncToGenerator(function*(){let me=yield ge;if(me.isError)throw me.error;return me.data})()},refetch:me=>F(G(V,{subscribe:!1,forceRefetch:!0,...me})),unsubscribe(){j&&F(u({queryCacheKey:Q,requestId:Ee}))},updateSubscriptionOptions(me){ge.subscriptionOptions=me,F(v({endpointName:_,requestId:Ee,queryCacheKey:Q,options:me}))}});if(!Ne&&!ke&&!P){let me=s(F);me.set(Q,ge),ge.then(()=>{me.delete(Q)})}return ge};return G}function k(_,D){return R(_,D)}function I(_,D){return R(_,D)}function T(_){return(D,{track:G=!0,fixedCacheKey:V}={})=>(j,L)=>{let q=n({type:"mutation",endpointName:_,originalArgs:D,track:G,fixedCacheKey:V}),P=j(q);let{requestId:N,abort:F,unwrap:H}=P,Q=xI(P.unwrap().then(te=>({data:te})),te=>({error:te})),Z=()=>{j(h({requestId:N,fixedCacheKey:V}))},X=Object.assign(Q,{arg:P.arg,requestId:N,abort:F,unwrap:H,reset:Z}),W=c(j);return W.set(N,X),X.then(()=>{W.delete(N)}),V&&(W.set(V,X),X.then(()=>{W.get(V)===X&&W.delete(V)})),X}}}var ay=class extends Fh{constructor(t,r,n,o){super(t);ae(this,"value");ae(this,"schemaName");ae(this,"_bqMeta");this.value=r,this.schemaName=n,this._bqMeta=o}},dn=(e,t)=>Array.isArray(e)?e.includes(t):!!e;function pn(_x56,_x57,_x58,_x59){return _pn.apply(this,arguments)}function _pn(){_pn=_asyncToGenerator(function*(e,t,r,n){let o=yield e["~standard"].validate(t);if(o.issues)throw new ay(o.issues,t,r,n);return o.value});return _pn.apply(this,arguments)}function Vh(e){return e}var Ui=(e={})=>({...e,[Ii]:!0});function EI({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a,onSchemaFailure:s,catchSchemaFailure:c,skipSchemaValidation:u}){let h=(q,P,N,F)=>(H,Q)=>{let Z=r[q],X=n({queryArgs:P,endpointDefinition:Z,endpointName:q});if(H(o.internalActions.queryResultPatched({queryCacheKey:X,patches:N})),!F)return;let W=o.endpoints[q].select(P)(Q()),te=Xd(Z.providesTags,W.data,void 0,P,{},i);H(o.internalActions.updateProvidedBy([{queryCacheKey:X,providedTags:te}]))};function v(q,P,N=0){let F=[P,...q];return N&&F.length>N?F.slice(0,-1):F}function C(q,P,N=0){let F=[...q,P];return N&&F.length>N?F.slice(1):F}let g=(q,P,N,F=!0)=>(H,Q)=>{let X=o.endpoints[q].select(P)(Q()),W={patches:[],inversePatches:[],undo:()=>H(o.util.patchQueryData(q,P,W.inversePatches,F))};if(X.status===mr)return W;let te;if("data"in X)if(ut(X.data)){let[ue,Ee,je]=Zl(X.data,N);W.patches.push(...Ee),W.inversePatches.push(...je),te=ue}else te=N(X.data),W.patches.push({op:"replace",path:[],value:te}),W.inversePatches.push({op:"replace",path:[],value:X.data});return W.patches.length===0||H(o.util.patchQueryData(q,P,W.patches,F)),W},y=(q,P,N)=>F=>F(o.endpoints[q].initiate(P,{subscribe:!1,forceRefetch:!0,[Gi]:()=>({data:N})})),S=(q,P)=>q.query&&q[P]?q[P]:Vh,E=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(q,{signal:P,abort:N,rejectWithValue:F,fulfillWithValue:H,dispatch:Q,getState:Z,extra:X}){let W=r[q.endpointName],{metaSchema:te,skipSchemaValidation:ue=u}=W,Ee=q.type===Qi;try{let je=Vh,ke={signal:P,abort:N,dispatch:Q,getState:Z,extra:X,endpoint:q.endpointName,type:q.type,forced:Ee?R(q,Z()):void 0,queryCacheKey:Ee?q.queryCacheKey:void 0},Ne=Ee?q[Gi]:void 0,Fe,ge=/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(be,he,He,Ke){if(he==null&&be.pages.length)return Promise.resolve({data:be});let Dt={queryArg:q.originalArgs,pageParam:he},At=yield me(Dt),Gt=Ke?v:C;return{data:{pages:Gt(be.pages,At.data,He),pageParams:Gt(be.pageParams,he,He)},meta:At.meta}});return function ge(_x62,_x63,_x64,_x65){return _ref28.apply(this,arguments)}}();function me(_x66){return _me.apply(this,arguments)}function _me(){_me=_asyncToGenerator(function*(be){let he,{extraOptions:He,argSchema:Ke,rawResponseSchema:Dt,responseSchema:At}=W;if(Ke&&!dn(ue,"arg")&&(be=yield pn(Ke,be,"argSchema",{})),Ne?he=Ne():W.query?(je=S(W,"transformResponse"),he=yield t(W.query(be),ke,He)):he=yield W.queryFn(be,ke,He,Mt=>t(Mt,ke,He)),typeof process<"u",he.error)throw new Ao(he.error,he.meta);let{data:Gt}=he;Dt&&!dn(ue,"rawResponse")&&(Gt=yield pn(Dt,he.data,"rawResponseSchema",he.meta));let Rt=yield je(Gt,he.meta,be);return At&&!dn(ue,"response")&&(Rt=yield pn(At,Rt,"responseSchema",he.meta)),{...he,data:Rt}});return _me.apply(this,arguments)}if(Ee&&"infiniteQueryOptions"in W){let{infiniteQueryOptions:be}=W,{maxPages:he=1/0}=be,He=q.refetchCachedPages??be.refetchCachedPages??!0,Ke,Dt={pages:[],pageParams:[]},At=a.selectQueryEntry(Z(),q.queryCacheKey)?.data,Rt=R(q,Z())&&!q.direction||!At?Dt:At;if("direction"in q&&q.direction&&Rt.pages.length){let Mt=q.direction==="backward",Ca=(Mt?sy:zd)(be,Rt,q.originalArgs);Ke=yield ge(Rt,Ca,he,Mt)}else{let{initialPageParam:Mt=be.initialPageParam}=q,ti=At?.pageParams??[],Ca=ti[0]??Mt,Xw=ti.length;if(Ke=yield ge(Rt,Ca,he),Ne&&(Ke={data:Ke.data.pages[0]}),He)for(let Nf=1;Nf<Xw;Nf++){let Zw=zd(be,Ke.data,q.originalArgs);Ke=yield ge(Ke.data,Zw,he)}}Fe=Ke}else Fe=yield me(q.originalArgs);return te&&!dn(ue,"meta")&&Fe.meta&&(Fe.meta=yield pn(te,Fe.meta,"metaSchema",Fe.meta)),H(Fe.data,Ui({fulfilledTimeStamp:Date.now(),baseQueryMeta:Fe.meta}))}catch(je){let ke=je;if(ke instanceof Ao){let Ne=S(W,"transformErrorResponse"),{rawErrorResponseSchema:Fe,errorResponseSchema:ge}=W,{value:me,meta:be}=ke;try{Fe&&!dn(ue,"rawErrorResponse")&&(me=yield pn(Fe,me,"rawErrorResponseSchema",be)),te&&!dn(ue,"meta")&&(be=yield pn(te,be,"metaSchema",be));let he=yield Ne(me,be,q.originalArgs);return ge&&!dn(ue,"errorResponse")&&(he=yield pn(ge,he,"errorResponseSchema",be)),F(he,Ui({baseQueryMeta:be}))}catch(he){ke=he}}try{if(ke instanceof ay){let Ne={endpoint:q.endpointName,arg:q.originalArgs,type:q.type,queryCacheKey:Ee?q.queryCacheKey:void 0};W.onSchemaFailure?.(ke,Ne),s?.(ke,Ne);let{catchSchemaFailure:Fe=c}=W;if(Fe)return F(Fe(ke,Ne),Ui({baseQueryMeta:ke._bqMeta}))}}catch(Ne){ke=Ne}throw typeof process<"u",console.error(ke),ke}});return function E(_x60,_x61){return _ref27.apply(this,arguments)}}();function R(q,P){let N=a.selectQueryEntry(P,q.queryCacheKey),F=a.selectConfig(P).refetchOnMountOrArgChange,H=N?.fulfilledTimeStamp,Q=q.forceRefetch??(q.subscribe&&F);return Q?Q===!0||(Number(new Date)-Number(H))/1e3>=Q:!1}let k=()=>Ie(`${e}/executeQuery`,E,{getPendingMeta({arg:P}){let N=r[P.endpointName];return Ui({startedTimeStamp:Date.now(),...(Zs(N)?{direction:P.direction}:{})})},condition(P,{getState:N}){let F=N(),H=a.selectQueryEntry(F,P.queryCacheKey),Q=H?.fulfilledTimeStamp,Z=P.originalArgs,X=H?.originalArgs,W=r[P.endpointName],te=P.direction;return Hd(P)?!0:H?.status==="pending"?!1:R(P,F)||Xs(W)&&W?.forceRefetch?.({currentArg:Z,previousArg:X,endpointState:H,state:F})?!0:!(Q&&!te)},dispatchConditionRejection:!0}),I=k(),T=k(),_=Ie(`${e}/executeMutation`,E,{getPendingMeta(){return Ui({startedTimeStamp:Date.now()})}}),D=q=>"force"in q,G=q=>"ifOlderThan"in q,V=(q,P,N={})=>(F,H)=>{let Q=D(N)&&N.force,Z=G(N)&&N.ifOlderThan,X=(te=!0)=>{let ue={forceRefetch:te,subscribe:!1};return o.endpoints[q].initiate(P,ue)},W=o.endpoints[q].select(P)(H());if(Q)F(X());else if(Z){let te=W?.fulfilledTimeStamp;if(!te){F(X());return}(Number(new Date)-Number(new Date(te)))/1e3>=Z&&F(X())}else F(X(!1))};function j(q){return P=>P?.meta?.arg?.endpointName===q}function L(q,P){return{matchPending:eo(is(q),j(P)),matchFulfilled:eo(cr(q),j(P)),matchRejected:eo(sn(q),j(P))}}return{queryThunk:I,mutationThunk:_,infiniteQueryThunk:T,prefetch:V,updateQueryData:g,upsertQueryData:y,patchQueryData:h,buildMatchThunkActions:L}}function zd(e,{pages:t,pageParams:r},n){let o=t.length-1;return e.getNextPageParam(t[o],t,r[o],r,n)}function sy(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function cy(e,t,r,n){return Xd(r[e.meta.arg.endpointName][t],cr(e)?e.payload:void 0,_i(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function Bh(e){return ft(e)?Za(e):e}function Hs(e,t,r){let n=e[t];n&&r(n)}function $i(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Gh(e,t,r){let n=e[$i(t)];n&&r(n)}var zs={};function RI({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:s},assertTagType:c,config:u}){let h=O(`${e}/resetApiState`);function v(j,L,q,P){var N;j[N=L.queryCacheKey]??(j[N]={status:mr,endpointName:L.endpointName}),Hs(j,L.queryCacheKey,F=>{F.status=Gd,F.requestId=q&&F.requestId?F.requestId:P.requestId,L.originalArgs!==void 0&&(F.originalArgs=L.originalArgs),F.startedTimeStamp=P.startedTimeStamp;let H=o[P.arg.endpointName];Zs(H)&&"direction"in L&&(F.direction=L.direction)})}function C(j,L,q,P){Hs(j,L.arg.queryCacheKey,N=>{if(N.requestId!==L.requestId&&!P)return;let{merge:F}=o[L.arg.endpointName];if(N.status=Vi,F){if(N.data!==void 0){let{fulfilledTimeStamp:H,arg:Q,baseQueryMeta:Z,requestId:X}=L,W=on(N.data,te=>F(te,q,{arg:Q.originalArgs,baseQueryMeta:Z,fulfilledTimeStamp:H,requestId:X}));N.data=W}else N.data=q;}else N.data=o[L.arg.endpointName].structuralSharing??!0?Yh(ft(N.data)?km(N.data):N.data,q):q;delete N.error,N.fulfilledTimeStamp=L.fulfilledTimeStamp})}let g=cn({name:`${e}/queries`,initialState:zs,reducers:{removeQueryResult:{reducer(j,{payload:{queryCacheKey:L}}){delete j[L]},prepare:to()},cacheEntriesUpserted:{reducer(j,L){for(let q of L.payload){let{queryDescription:P,value:N}=q;v(j,P,!0,{arg:P,requestId:L.meta.requestId,startedTimeStamp:L.meta.timestamp}),C(j,{arg:P,requestId:L.meta.requestId,fulfilledTimeStamp:L.meta.timestamp,baseQueryMeta:{}},N,!0)}},prepare:j=>({payload:j.map(P=>{let{endpointName:N,arg:F,value:H}=P,Q=o[N];return{queryDescription:{type:Qi,endpointName:N,originalArgs:P.arg,queryCacheKey:n({queryArgs:F,endpointDefinition:Q,endpointName:N})},value:H}}),meta:{[Ii]:!0,requestId:ki(),timestamp:Date.now()}})},queryResultPatched:{reducer(j,{payload:{queryCacheKey:L,patches:q}}){Hs(j,L,P=>{P.data=Jl(P.data,q.concat())})},prepare:to()}},extraReducers(j){j.addCase(t.pending,(L,{meta:q,meta:{arg:P}})=>{let N=Hd(P);v(L,P,N,q)}).addCase(t.fulfilled,(L,{meta:q,payload:P})=>{let N=Hd(q.arg);C(L,q,P,N)}).addCase(t.rejected,(L,{meta:{condition:q,arg:P,requestId:N},error:F,payload:H})=>{Hs(L,P.queryCacheKey,Q=>{if(!q){if(Q.requestId!==N)return;Q.status=Bi,Q.error=H??F}})}).addMatcher(s,(L,q)=>{let{queries:P}=a(q);for(let[N,F]of Object.entries(P))(F?.status===Vi||F?.status===Bi)&&(L[N]=F)})}}),y=cn({name:`${e}/mutations`,initialState:zs,reducers:{removeMutationResult:{reducer(j,{payload:L}){let q=$i(L);q in j&&delete j[q]},prepare:to()}},extraReducers(j){j.addCase(r.pending,(L,{meta:q,meta:{requestId:P,arg:N,startedTimeStamp:F}})=>{N.track&&(L[$i(q)]={requestId:P,status:Gd,endpointName:N.endpointName,startedTimeStamp:F})}).addCase(r.fulfilled,(L,{payload:q,meta:P})=>{P.arg.track&&Gh(L,P,N=>{N.requestId===P.requestId&&(N.status=Vi,N.data=q,N.fulfilledTimeStamp=P.fulfilledTimeStamp)})}).addCase(r.rejected,(L,{payload:q,error:P,meta:N})=>{N.arg.track&&Gh(L,N,F=>{F.requestId===N.requestId&&(F.status=Bi,F.error=q??P)})}).addMatcher(s,(L,q)=>{let{mutations:P}=a(q);for(let[N,F]of Object.entries(P))(F?.status===Vi||F?.status===Bi)&&N!==F?.requestId&&(L[N]=F)})}}),S={tags:{},keys:{}},E=cn({name:`${e}/invalidation`,initialState:S,reducers:{updateProvidedBy:{reducer(j,L){var q,P,N;for(let{queryCacheKey:F,providedTags:H}of L.payload){R(j,F);for(let{type:Q,id:Z}of H){let X=(P=(q=j.tags)[Q]??(q[Q]={}))[N=Z||"__internal_without_id"]??(P[N]=[]);X.includes(F)||X.push(F)}j.keys[F]=H}},prepare:to()}},extraReducers(j){j.addCase(g.actions.removeQueryResult,(L,{payload:{queryCacheKey:q}})=>{R(L,q)}).addMatcher(s,(L,q)=>{var N,F,H;let{provided:P}=a(q);for(let[Q,Z]of Object.entries(P.tags??{}))for(let[X,W]of Object.entries(Z)){let te=(F=(N=L.tags)[Q]??(N[Q]={}))[H=X||"__internal_without_id"]??(F[H]=[]);for(let ue of W)te.includes(ue)||te.push(ue),L.keys[ue]=P.keys[ue]}}).addMatcher(zt(cr(t),_i(t)),(L,q)=>{k(L,[q])}).addMatcher(g.actions.cacheEntriesUpserted.match,(L,q)=>{let P=q.payload.map(({queryDescription:N,value:F})=>({type:"UNKNOWN",payload:F,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:N}}));k(L,P)})}});function R(j,L){let q=Bh(j.keys[L]??[]);for(let P of q){let N=P.type,F=P.id??"__internal_without_id",H=j.tags[N]?.[F];H&&(j.tags[N][F]=Bh(H).filter(Q=>Q!==L))}delete j.keys[L]}function k(j,L){let q=L.map(P=>{let N=cy(P,"providesTags",o,c),{queryCacheKey:F}=P.meta.arg;return{queryCacheKey:F,providedTags:N}});E.caseReducers.updateProvidedBy(j,E.actions.updateProvidedBy(q))}let I=cn({name:`${e}/subscriptions`,initialState:zs,reducers:{updateSubscriptionOptions(j,L){},unsubscribeQueryResult(j,L){},internal_getRTKQSubscriptions(){}}}),T=cn({name:`${e}/internalSubscriptions`,initialState:zs,reducers:{subscriptionsUpdated:{reducer(j,L){return Jl(j,L.payload)},prepare:to()}}}),_=cn({name:`${e}/config`,initialState:{online:cI(),focused:sI(),middlewareRegistered:!1,...u},reducers:{middlewareRegistered(j,{payload:L}){j.middlewareRegistered=j.middlewareRegistered==="conflict"||i!==L?"conflict":!0}},extraReducers:j=>{j.addCase(Yd,L=>{L.online=!0}).addCase(ry,L=>{L.online=!1}).addCase(Kd,L=>{L.focused=!0}).addCase(ty,L=>{L.focused=!1}).addMatcher(s,L=>({...L}))}}),D=Yn({queries:g.reducer,mutations:y.reducer,provided:E.reducer,subscriptions:T.reducer,config:_.reducer}),G=(j,L)=>D(h.match(L)?void 0:j,L),V={..._.actions,...g.actions,...I.actions,...T.actions,...y.actions,...E.actions,resetApiState:h};return{reducer:G,actions:V}}var Bd=Symbol.for("RTKQ/skipToken"),uy={status:mr},$h=on(uy,()=>{}),Qh=on(uy,()=>{});function II({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=I=>$h,o=I=>Qh;return{buildQuerySelector:C,buildInfiniteQuerySelector:g,buildMutationSelector:y,selectInvalidatedBy:S,selectCachedArgsForQuery:E,selectApiState:a,selectQueries:s,selectMutations:u,selectQueryEntry:c,selectConfig:h};function i(I){return{...I,...Dh(I.status)}}function a(I){return I[t]}function s(I){return a(I)?.queries}function c(I,T){return s(I)?.[T]}function u(I){return a(I)?.mutations}function h(I){return a(I)?.config}function v(I,T,_){return D=>{if(D===Bd)return r(n,_);let G=e({queryArgs:D,endpointDefinition:T,endpointName:I});return r(j=>c(j,G)??$h,_)}}function C(I,T){return v(I,T,i)}function g(I,T){let{infiniteQueryOptions:_}=T;function D(G){let V={...G,...Dh(G.status)},{isLoading:j,isError:L,direction:q}=V,P=q==="forward",N=q==="backward";return{...V,hasNextPage:R(_,V.data,V.originalArgs),hasPreviousPage:k(_,V.data,V.originalArgs),isFetchingNextPage:j&&P,isFetchingPreviousPage:j&&N,isFetchNextPageError:L&&P,isFetchPreviousPageError:L&&N}}return v(I,T,D)}function y(){return I=>{let T;return typeof I=="object"?T=$i(I)??Bd:T=I,r(T===Bd?o:G=>a(G)?.mutations?.[T]??Qh,i)}}function S(I,T){let _=I[t],D=new Set,G=$d(T,Wd,iy);for(let V of G){let j=_.provided.tags[V.type];if(!j)continue;let L=(V.id!==void 0?j[V.id]:Object.values(j).flat())??[];for(let q of L)D.add(q)}return Array.from(D.values()).flatMap(V=>{let j=_.queries[V];return j?{queryCacheKey:V,endpointName:j.endpointName,originalArgs:j.originalArgs}:[]})}function E(I,T){return $d(Object.values(s(I)),_=>_?.endpointName===T&&_.status!==mr,_=>_.originalArgs)}function R(I,T,_){return T?zd(I,T,_)!=null:!1}function k(I,T,_){return!T||!I.getPreviousPageParam?!1:sy(I,T,_)!=null}}var Hh=WeakMap?new WeakMap:void 0,zh=({endpointName:e,queryArgs:t})=>{let r="",n=Hh?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=Ht(a)?Object.keys(a).sort().reduce((s,c)=>(s[c]=a[c],s),{}):a,a));Ht(t)&&Hh?.set(t,o),r=o}return`${e}(${r})`};function TI(...e){return function(r){let n=Ei(u=>r.extractRehydrationInfo?.(u,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(u){let h=zh;if("serializeQueryArgs"in u.endpointDefinition){let v=u.endpointDefinition.serializeQueryArgs;h=C=>{let g=v(C);return typeof g=="string"?g:zh({...C,queryArgs:g})}}else r.serializeQueryArgs&&(h=r.serializeQueryArgs);return h(u)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(u){u()},apiUid:ki(),extractRehydrationInfo:n,hasRehydrationInfo:Ei(u=>n(u)!=null)},a={injectEndpoints:c,enhanceEndpoints({addTagTypes:u,endpoints:h}){if(u)for(let v of u)o.tagTypes.includes(v)||o.tagTypes.push(v);if(h)for(let[v,C]of Object.entries(h))typeof C=="function"?C(xo(i,v)):Object.assign(xo(i,v)||{},C);return a}},s=e.map(u=>u.init(a,o,i));function c(u){let h=u.endpoints({query:v=>({...v,type:Qi}),mutation:v=>({...v,type:ny}),infiniteQuery:v=>({...v,type:oy})});for(let[v,C]of Object.entries(h)){if(u.overrideExisting!==!0&&v in i.endpointDefinitions){if(u.overrideExisting==="throw")throw new Error(mt(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[v]=C;for(let g of s)g.injectEndpoint(v,C)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function fr(e,...t){return Object.assign(e,...t)}var _I=({api:e,queryThunk:t,internalState:r,mwApi:n})=>{let o=`${e.reducerPath}/subscriptions`,i=null,a=null,{updateSubscriptionOptions:s,unsubscribeQueryResult:c}=e.internalActions,u=(S,E)=>{if(s.match(E)){let{queryCacheKey:k,requestId:I,options:T}=E.payload,_=S.get(k);return _?.has(I)&&_.set(I,T),!0}if(c.match(E)){let{queryCacheKey:k,requestId:I}=E.payload,T=S.get(k);return T&&T.delete(I),!0}if(e.internalActions.removeQueryResult.match(E))return S.delete(E.payload.queryCacheKey),!0;if(t.pending.match(E)){let{meta:{arg:k,requestId:I}}=E,T=Ws(S,k.queryCacheKey,Qd);return k.subscribe&&T.set(I,k.subscriptionOptions??T.get(I)??{}),!0}let R=!1;if(t.rejected.match(E)){let{meta:{condition:k,arg:I,requestId:T}}=E;if(k&&I.subscribe){let _=Ws(S,I.queryCacheKey,Qd);_.set(T,I.subscriptionOptions??_.get(T)??{}),R=!0}}return R},h=()=>r.currentSubscriptions,g={getSubscriptions:h,getSubscriptionCount:S=>h().get(S)?.size??0,isRequestSubscribed:(S,E)=>!!h()?.get(S)?.get(E)};function y(S){return JSON.parse(JSON.stringify(Object.fromEntries([...S].map(([E,R])=>[E,Object.fromEntries(R)]))))}return(S,E)=>{if(i||(i=y(r.currentSubscriptions)),e.util.resetApiState.match(S))return i={},r.currentSubscriptions.clear(),a=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(S))return[!1,g];let R=u(r.currentSubscriptions,S),k=!0;if(R){a||(a=setTimeout(()=>{let _=y(r.currentSubscriptions),[,D]=Zl(i,()=>_);E.next(e.internalActions.subscriptionsUpdated(D)),i=_,a=null},500));let I=typeof S.type=="string"&&!!S.type.startsWith(o),T=t.rejected.match(S)&&S.meta.condition&&!!S.meta.arg.subscribe;k=!I&&!T}return[k,!1]}},kI=2147483647/1e3-1,OI=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a},getRunningQueryThunk:s,mwApi:c})=>{let{removeQueryResult:u,unsubscribeQueryResult:h,cacheEntriesUpserted:v}=t.internalActions,C=zt(h.match,r.fulfilled,r.rejected,v.match);function g(I){let T=o.currentSubscriptions.get(I);return T?T.size>0:!1}let y={};function S(I){for(let T of I.values())T?.abort?.()}let E=(I,T)=>{let _=T.getState(),D=a(_);if(C(I)){let G;if(v.match(I))G=I.payload.map(V=>V.queryDescription.queryCacheKey);else{let{queryCacheKey:V}=h.match(I)?I.payload:I.meta.arg;G=[V]}R(G,T,D)}if(t.util.resetApiState.match(I)){for(let[G,V]of Object.entries(y))V&&clearTimeout(V),delete y[G];S(o.runningQueries),S(o.runningMutations)}if(n.hasRehydrationInfo(I)){let{queries:G}=n.extractRehydrationInfo(I);R(Object.keys(G),T,D)}};function R(I,T,_){let D=T.getState();for(let G of I){let V=i(D,G);V?.endpointName&&k(G,V.endpointName,T,_)}}function k(I,T,_,D){let V=xo(n,T)?.keepUnusedDataFor??D.keepUnusedDataFor;if(V===1/0)return;let j=Math.max(0,Math.min(V,kI));if(!g(I)){let L=y[I];L&&clearTimeout(L),y[I]=setTimeout(()=>{if(!g(I)){let q=i(_.getState(),I);q?.endpointName&&_.dispatch(s(q.endpointName,q.originalArgs))?.abort(),_.dispatch(u({queryCacheKey:I}))}delete y[I]},j*1e3)}}return E},Wh=new Error("Promise never resolved before cacheEntryRemoved."),PI=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:s}})=>{let c=as(n),u=as(o),h=cr(n,o),v={},{removeQueryResult:C,removeMutationResult:g,cacheEntriesUpserted:y}=e.internalActions;function S(_,D,G){let V=v[_];V?.valueResolved&&(V.valueResolved({data:D,meta:G}),delete V.valueResolved)}function E(_){let D=v[_];D&&(delete v[_],D.cacheEntryRemoved())}function R(_){let{arg:D,requestId:G}=_.meta,{endpointName:V,originalArgs:j}=D;return[V,j,G]}let k=(_,D,G)=>{let V=I(_);function j(L,q,P,N){let F=a(G,q),H=a(D.getState(),q);!F&&H&&T(L,N,q,D,P)}if(n.pending.match(_)){let[L,q,P]=R(_);j(L,V,P,q)}else if(y.match(_))for(let{queryDescription:L,value:q}of _.payload){let{endpointName:P,originalArgs:N,queryCacheKey:F}=L;j(P,F,_.meta.requestId,N),S(F,q,{})}else if(o.pending.match(_)){if(D.getState()[t].mutations[V]){let[q,P,N]=R(_);T(q,P,V,D,N)}}else if(h(_))S(V,_.payload,_.meta.baseQueryMeta);else if(C.match(_)||g.match(_))E(V);else if(e.util.resetApiState.match(_))for(let L of Object.keys(v))E(L)};function I(_){return c(_)?_.meta.arg.queryCacheKey:u(_)?_.meta.arg.fixedCacheKey??_.meta.requestId:C.match(_)?_.payload.queryCacheKey:g.match(_)?$i(_.payload):""}function T(_,D,G,V,j){let L=xo(r,_),q=L?.onCacheEntryAdded;if(!q)return;let P={},N=new Promise(W=>{P.cacheEntryRemoved=W}),F=Promise.race([new Promise(W=>{P.valueResolved=W}),N.then(()=>{throw Wh})]);F.catch(()=>{}),v[G]=P;let H=e.endpoints[_].select(Ks(L)?D:G),Q=V.dispatch((W,te,ue)=>ue),Z={...V,getCacheEntry:()=>H(V.getState()),requestId:j,extra:Q,updateCachedData:Ks(L)?W=>V.dispatch(e.util.updateQueryData(_,D,W)):void 0,cacheDataLoaded:F,cacheEntryRemoved:N},X=q(D,Z);Promise.resolve(X).catch(W=>{if(W!==Wh)throw W})}return k},NI=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},FI=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:s,internalState:c})=>{let{removeQueryResult:u}=i.internalActions,h=zt(cr(n),_i(n)),v=zt(cr(o,n),sn(o,n)),C=[],g=0,y=(R,k)=>{(o.pending.match(R)||n.pending.match(R))&&g++,v(R)&&(g=Math.max(0,g-1)),h(R)?E(cy(R,"invalidatesTags",r,a),k):v(R)?E([],k):i.util.invalidateTags.match(R)&&E(Xd(R.payload,void 0,void 0,void 0,void 0,a),k)};function S(){return g>0}function E(R,k){let I=k.getState(),T=I[e];if(C.push(...R),T.config.invalidationBehavior==="delayed"&&S())return;let _=C;if(C=[],_.length===0)return;let D=i.util.selectInvalidatedBy(I,_);t.batch(()=>{let G=Array.from(D.values());for(let{queryCacheKey:V}of G){let j=T.queries[V],L=Ws(c.currentSubscriptions,V,Qd);j&&(L.size===0?k.dispatch(u({queryCacheKey:V})):j.status!==mr&&k.dispatch(s(j)))}})}return y},DI=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let{currentPolls:i,currentSubscriptions:a}=o,s=new Set,c=null,u=(E,R)=>{(r.internalActions.updateSubscriptionOptions.match(E)||r.internalActions.unsubscribeQueryResult.match(E))&&h(E.payload.queryCacheKey,R),(t.pending.match(E)||t.rejected.match(E)&&E.meta.condition)&&h(E.meta.arg.queryCacheKey,R),(t.fulfilled.match(E)||t.rejected.match(E)&&!E.meta.condition)&&v(E.meta.arg,R),r.util.resetApiState.match(E)&&(y(),c&&(clearTimeout(c),c=null),s.clear())};function h(E,R){s.add(E),c||(c=setTimeout(()=>{for(let k of s)C({queryCacheKey:k},R);s.clear(),c=null},0))}function v({queryCacheKey:E},R){let k=R.getState()[e],I=k.queries[E],T=a.get(E);if(!I||I.status===mr)return;let{lowestPollingInterval:_,skipPollingIfUnfocused:D}=S(T);if(!Number.isFinite(_))return;let G=i.get(E);G?.timeout&&(clearTimeout(G.timeout),G.timeout=void 0);let V=Date.now()+_;i.set(E,{nextPollTimestamp:V,pollingInterval:_,timeout:setTimeout(()=>{(k.config.focused||!D)&&R.dispatch(n(I)),v({queryCacheKey:E},R)},_)})}function C({queryCacheKey:E},R){let I=R.getState()[e].queries[E],T=a.get(E);if(!I||I.status===mr)return;let{lowestPollingInterval:_}=S(T);if(!Number.isFinite(_)){g(E);return}let D=i.get(E),G=Date.now()+_;(!D||G<D.nextPollTimestamp)&&v({queryCacheKey:E},R)}function g(E){let R=i.get(E);R?.timeout&&clearTimeout(R.timeout),i.delete(E)}function y(){for(let E of i.keys())g(E)}function S(E=new Map){let R=!1,k=Number.POSITIVE_INFINITY;for(let I of E.values())I.pollingInterval&&(k=Math.min(I.pollingInterval,k),R=I.skipPollingIfUnfocused||R);return{lowestPollingInterval:k,skipPollingIfUnfocused:R}}return u},MI=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=is(r,n),i=sn(r,n),a=cr(r,n),s={};return(u,h)=>{if(o(u)){let{requestId:v,arg:{endpointName:C,originalArgs:g}}=u.meta,y=xo(t,C),S=y?.onQueryStarted;if(S){let E={},R=new Promise((_,D)=>{E.resolve=_,E.reject=D});R.catch(()=>{}),s[v]=E;let k=e.endpoints[C].select(Ks(y)?g:v),I=h.dispatch((_,D,G)=>G),T={...h,getCacheEntry:()=>k(h.getState()),requestId:v,extra:I,updateCachedData:Ks(y)?_=>h.dispatch(e.util.updateQueryData(C,g,_)):void 0,queryFulfilled:R};S(g,T)}}else if(a(u)){let{requestId:v,baseQueryMeta:C}=u.meta;s[v]?.resolve({data:u.payload,meta:C}),delete s[v]}else if(i(u)){let{requestId:v,rejectedWithValue:C,baseQueryMeta:g}=u.meta;s[v]?.reject({error:u.payload??u.error,isUnhandledError:!C,meta:g}),delete s[v]}}},qI=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(c,u)=>{Kd.match(c)&&s(u,"refetchOnFocus"),Yd.match(c)&&s(u,"refetchOnReconnect")};function s(c,u){let h=c.getState()[e],v=h.queries,C=o.currentSubscriptions;t.batch(()=>{for(let g of C.keys()){let y=v[g],S=C.get(g);if(!S||!y)continue;let E=[...S.values()];(E.some(k=>k[u]===!0)||E.every(k=>k[u]===void 0)&&h.config[u])&&(S.size===0?c.dispatch(i({queryCacheKey:g})):y.status!==mr&&c.dispatch(n(y)))}})}return a};function jI(e){let{reducerPath:t,queryThunk:r,api:n,context:o,getInternalState:i}=e,{apiUid:a}=o,s={invalidateTags:O(`${t}/invalidateTags`)},c=C=>C.type.startsWith(`${t}/`),u=[NI,OI,FI,DI,PI,MI];return{middleware:C=>{let g=!1,y=i(C.dispatch),S={...e,internalState:y,refetchQuery:v,isThisApiSliceAction:c,mwApi:C},E=u.map(I=>I(S)),R=_I(S),k=qI(S);return I=>T=>{if(!fi(T))return I(T);g||(g=!0,C.dispatch(n.internalActions.middlewareRegistered(a)));let _={...C,next:I},D=C.getState(),[G,V]=R(T,_,D),j;if(G?j=I(T):j=V,C.getState()[t]&&(k(T,_,D),c(T)||o.hasRehydrationInfo(T)))for(let L of E)L(T,_,D);return j}},actions:s};function v(C){return e.api.endpoints[C.endpointName].initiate(C.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Kh=Symbol(),LI=({createSelector:e=$e}={})=>({name:Kh,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:s,refetchOnFocus:c,refetchOnReconnect:u,invalidationBehavior:h,onSchemaFailure:v,catchSchemaFailure:C,skipSchemaValidation:g},y){qm();let S=ge=>(typeof process<"u",ge);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:Yd,onOffline:ry,onFocus:Kd,onFocusLost:ty},util:{}});let E=II({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:R,selectCachedArgsForQuery:k,buildQuerySelector:I,buildInfiniteQuerySelector:T,buildMutationSelector:_}=E;fr(t.util,{selectInvalidatedBy:R,selectCachedArgsForQuery:k});let{queryThunk:D,infiniteQueryThunk:G,mutationThunk:V,patchQueryData:j,updateQueryData:L,upsertQueryData:q,prefetch:P,buildMatchThunkActions:N}=EI({baseQuery:r,reducerPath:o,context:y,api:t,serializeQueryArgs:i,assertTagType:S,selectors:E,onSchemaFailure:v,catchSchemaFailure:C,skipSchemaValidation:g}),{reducer:F,actions:H}=RI({context:y,queryThunk:D,infiniteQueryThunk:G,mutationThunk:V,serializeQueryArgs:i,reducerPath:o,assertTagType:S,config:{refetchOnFocus:c,refetchOnReconnect:u,refetchOnMountOrArgChange:s,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:h}});fr(t.util,{patchQueryData:j,updateQueryData:L,upsertQueryData:q,prefetch:P,resetApiState:H.resetApiState,upsertQueryEntries:H.cacheEntriesUpserted}),fr(t.internalActions,H);let Q=new WeakMap,Z=ge=>Ws(Q,ge,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:X,buildInitiateInfiniteQuery:W,buildInitiateMutation:te,getRunningMutationThunk:ue,getRunningMutationsThunk:Ee,getRunningQueriesThunk:je,getRunningQueryThunk:ke}=CI({queryThunk:D,mutationThunk:V,infiniteQueryThunk:G,api:t,serializeQueryArgs:i,context:y,getInternalState:Z});fr(t.util,{getRunningMutationThunk:ue,getRunningMutationsThunk:Ee,getRunningQueryThunk:ke,getRunningQueriesThunk:je});let{middleware:Ne,actions:Fe}=jI({reducerPath:o,context:y,queryThunk:D,mutationThunk:V,infiniteQueryThunk:G,api:t,assertTagType:S,selectors:E,getRunningQueryThunk:ke,getInternalState:Z});return fr(t.util,Fe),fr(t,{reducer:F,middleware:Ne}),{name:Kh,injectEndpoint(ge,me){var He;let he=(He=t.endpoints)[ge]??(He[ge]={});Xs(me)&&fr(he,{name:ge,select:I(ge,me),initiate:X(ge,me)},N(D,ge)),wI(me)&&fr(he,{name:ge,select:_(),initiate:te(ge)},N(V,ge)),Zs(me)&&fr(he,{name:ge,select:T(ge,me),initiate:W(ge,me)},N(D,ge))}}}}),ly=TI(LI());m();d();f();p();m();d();f();p();var fn=e=>e.query,dy=e=>e.query?.enableQuerySyntax;var I3=$e(e=>fn(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})),UI=$e(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);m();d();f();p();m();d();f();p();var Js=e=>{if(e==="yes")return!0;if(e==="no")return!1},VI=()=>Pe("analytics/generatedAnswer/retry",e=>e.makeRetryGeneratedAnswer());function BI(e,t){return Pe({prefix:"analytics/generatedAnswer/openAnswerSource",__legacy__getBuilder:(r,n)=>{let o=t??Me(n),i=go(n,e);if(!o||!i)return null;let a=_r(n);return r.makeGeneratedAnswerCitationClick(Rh(i,n),{generativeQuestionAnsweringId:o,citationId:i.id,documentId:_h(i),...(a&&{conversationId:a})})},analyticsType:"Rga.CitationClick",analyticsPayloadBuilder:r=>{let n=go(r,e);return{answerId:t??Me(r)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:n?.permanentid??"",title:n?.title,url:n?.clickUri}}}})}function GI(e,t,r){return Pe({prefix:"analytics/generatedAnswer/hoverCitation",__legacy__getBuilder:(n,o)=>{let i=r??Me(o),a=go(o,e);if(!i||!a)return null;let s=_r(o);return n.makeGeneratedAnswerSourceHover({generativeQuestionAnsweringId:i,permanentId:a.permanentid,citationId:a.id,citationHoverTimeMs:t,...(s&&{conversationId:s})})},analyticsType:"Rga.CitationHover",analyticsPayloadBuilder:n=>{let o=go(n,e);return{answerId:r??Me(n)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:o?.permanentid??"",title:o?.title,url:o?.clickUri},citationHoverTimeInMs:t}}})}function $I(e,t){return Pe({prefix:"analytics/generatedAnswer/openInlineLink",__legacy__getBuilder:r=>r.makeGeneratedAnswerOpenInlineLink({generativeQuestionAnsweringId:t,...e})})}function QI(e){return Pe({prefix:"analytics/generatedAnswer/like",__legacy__getBuilder:(t,r)=>{let n=e??Me(r);if(!n)return null;let o=_r(r);return t.makeLikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Me(t)??"",action:"like"})})}function HI(e){return Pe({prefix:"analytics/generatedAnswer/dislike",__legacy__getBuilder:(t,r)=>{let n=e??Me(r);if(!n)return null;let o=_r(r);return t.makeDislikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Me(t)??"",action:"dislike"})})}var zI=e=>Pe({prefix:"analytics/generatedAnswer/sendFeedback",__legacy__getBuilder:(t,r)=>{let n=Me(r);return n?t.makeGeneratedAnswerFeedbackSubmitV2({generativeQuestionAnsweringId:n,...e}):null},analyticsType:"Rga.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=Me(t),{helpful:n,readable:o,documented:i,hallucinationFree:a,correctTopic:s,documentUrl:c,details:u}=e;return{answerId:r??"",helpful:n,details:{readable:Js(o),documented:Js(i),correctTopic:Js(s),hallucinationFree:Js(a)},additionalNotes:u,correctAnswerUrl:c}}}),Zd=(e,t,r)=>Pe({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(n,o)=>{let i=t??Me(o);if(!i)return null;let a=_r(o);return n.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:i,answerGenerated:e,answerTextIsEmpty:r,...(a&&{conversationId:a})})},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:n=>({answerId:t??Me(n)??"",answerGenerated:e??!1})}),Co=e=>Pe({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:t=>({answerId:e??Me(t)??"",responseId:t.search?.searchResponseId||t.search?.response.searchUid||""})}),WI=()=>Pe({prefix:"analytics/generatedAnswer/show",__legacy__getBuilder:(e,t)=>{let r=Me(t);return r?e.makeGeneratedAnswerShowAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Me(e)??"",action:"show"})}),KI=()=>Pe({prefix:"analytics/generatedAnswer/hide",__legacy__getBuilder:(e,t)=>{let r=Me(t);return r?e.makeGeneratedAnswerHideAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Me(e)??"",action:"hide"})}),YI=()=>Pe({prefix:"analytics/generatedAnswer/expand",__legacy__getBuilder:(e,t)=>{let r=Me(t);return r?e.makeGeneratedAnswerExpand({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Me(e)??"",action:"expand"})}),XI=()=>Pe({prefix:"analytics/generatedAnswer/collapse",__legacy__getBuilder:(e,t)=>{let r=Me(t);return r?e.makeGeneratedAnswerCollapse({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Me(e)??"",action:"collapse"})});function ZI(e){return Pe({prefix:"analytics/generatedAnswer/copy",__legacy__getBuilder:(t,r)=>{let n=e??Me(r);if(!n)return null;let o=_r(r);return t.makeGeneratedAnswerCopyToClipboard({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Me(t)??"",action:"copyToClipboard"})})}function JI(e,t){return Pe({prefix:"analytics/generatedAnswer/openFollowUpAnswerSource",__legacy__getBuilder:(r,n)=>{let o=go(n,e);if(!o)return null;let i=_r(n);return i?r.makeGeneratedAnswerFollowupOpenSource({...Ih(o,n),generativeQuestionAnsweringId:t,citationId:o.id,permanentId:o.permanentid,conversationId:i}):null}})}var ec={logCopyGeneratedAnswer:ZI,logGeneratedAnswerHideAnswers:KI,logGeneratedAnswerShowAnswers:WI,logGeneratedAnswerStreamEnd:Zd,logGeneratedAnswerFeedback:zI,logDislikeGeneratedAnswer:HI,logLikeGeneratedAnswer:QI,logGeneratedAnswerOpenInlineLink:$I,logHoverCitation:GI,logOpenGeneratedAnswerSource:BI,logOpenGeneratedAnswerFollowUpSource:JI,logRetryGeneratedAnswer:VI,logGeneratedAnswerExpand:YI,logGeneratedAnswerCollapse:XI};m();d();f();p();m();d();f();p();var py=$e(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})}});m();d();f();p();var Hi=(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:uo(e)}});m();d();f();p();var Jd=e=>e.context;m();d();f();p();var ep=e=>e.pipeline;m();d();f();p();m();d();f();p();var zi=qt(tc(),1),vy=qt(fy(),1);m();d();f();p();var rc=qt(tc(),1),gy=qt(my(),1);rc.default.extend(gy.default);var hy="YYYY/MM/DD@HH:mm:ss",eT="1401-01-01";function Eo(e,t){let r=(0,rc.default)(e,t);return!r.isValid()&&!t?(0,rc.default)(e,hy):r}function nc(e){return e.format(hy)}function yy(e,t){let r=Eo(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}`)}sp(r)}function sp(e){if(e.isBefore(eT))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}zi.default.extend(vy.default);var Sy=["past","now","next"],by=["minute","hour","day","week","month","quarter","year"],tT=e=>{let t=e==="now";return{amount:new oe({required:!t,min:1}),unit:new z({required:!t,constrainTo:by}),period:new z({required:!0,constrainTo:Sy})}};function cp(e){if(typeof e=="string"&&!Pr(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?Ey(e):e;new ht(tT(t.period)).validate(t);let r=Ay(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);sp(r)}function wy(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function Ay(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,zi.default)().subtract(r,n);case"next":return(0,zi.default)().add(r,n);case"now":return(0,zi.default)()}}function Wi(e){return nc(Ay(Ey(e)))}function xy(e){return e.toLocaleLowerCase().split("-")}function Pr(e){let[t,r,n]=xy(e);if(t==="now")return!0;if(!Sy.includes(t)||!by.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function Cy(e){return!!e&&typeof e=="object"&&"period"in e}function Ey(e){let[t,r,n]=xy(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}m();d();f();p();function Ry(e){return e.type==="dateRange"}function Iy(e){return`start${e}`}function Ty(e){return`end${e}`}var up=()=>({dateFacetValueMap:{}});function rT(e,t,r){let n=e.start,o=e.end;return Pr(n)&&(n=Wi(n),r.dateFacetValueMap[t][Iy(n)]=e.start),Pr(o)&&(o=Wi(o),r.dateFacetValueMap[t][Ty(o)]=e.end),{...e,start:n,end:o}}function lp(e,t){if(Ry(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>rT(o,r,t))}}return e}function Nr(e){let t=up();return{request:{...e,facets:e.facets?.map(n=>lp(n,t))},mappings:t}}function nT(e,t,r){return{...e,start:r.dateFacetValueMap[t][Iy(e.start)]||e.start,end:r.dateFacetValueMap[t][Ty(e.end)]||e.end}}function oT(e,t){return e.facetId in t.dateFacetValueMap}function iT(e,t){return oT(e,t)?{...e,values:e.values.map(r=>nT(r,e.facetId,t))}:e}function oc(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>iT(n,t))}}:e}m();d();f();p();m();d();f();p();m();d();f();p();function Fr(e){return Object.values(e).map(t=>t.request)}function dp(e,t){let r={};e.forEach(i=>{r[i.facetId]=i});let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function _y(e){return Fr(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var pp={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function aT(e){return Fr(e).map(t=>{let r=pp[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function sT(e){return[...aT(e.facetSet??{}),..._y(e.numericFacetSet??{}),..._y(e.dateFacetSet??{}),...Fr(e.categoryFacetSet??{})]}function cT(e){return sT(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function ic(e){return dp(cT(e),e.facetOrder??[])}m();d();f();p();m();d();f();p();var Dr=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??wr(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:gt.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 Bs(e.configuration.analytics,t))),...(e.excerptLength&&!se(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Dr(_x67,_x68){return _ref29.apply(this,arguments)}}();m();d();f();p();var Ro=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??wr(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&&Hi(e.configuration.analytics,t,r)),...(e.excerptLength&&!se(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});m();d();f();p();var ky=$e(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Mr=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t,r){let n=mp(e),o=uT(e),i=lT(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield Dr(e,r):Ro(e,t,r);return Nr({...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"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:fp(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:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Mr(_x69,_x70,_x71){return _ref30.apply(this,arguments)}}();function fp(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function uT(e){return dp(pT(e),e.facetOrder??[])}function lT(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(dT).filter(r=>r.currentValues.length>0):void 0}function dT(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function pT(e){return fT(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function fT(e){return[...mT(e.facetSet??{}),...Oy(e.numericFacetSet??{}),...Oy(e.dateFacetSet??{}),...Fr(e.categoryFacetSet??{})]}function mT(e){return Fr(e).map(t=>{let r=pp[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function Oy(e){return Fr(e).map(t=>{let r=t.currentValues,n=r.some(({state:i})=>i!=="idle"),o=r.some(i=>i.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function mp(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=ky(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}m();d();f();p();m();d();f();p();var Ki=(e,t)=>{let r=e;return se(r[t])?se(e.raw[t])?null:e.raw[t]:r[t]},gT=e=>t=>e.every(r=>!se(Ki(t,r))),hT=e=>t=>e.every(r=>se(Ki(t,r))),yT=(e,t)=>r=>{let n=Py(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},vT=(e,t)=>r=>{let n=Py(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},Py=(e,t)=>{let r=Ki(t,e);return Jf(r)?r:[r]},Ny={getResultProperty:Ki,fieldsMustBeDefined:gT,fieldsMustNotBeDefined:hT,fieldMustMatch:yT,fieldMustNotMatch:vT};var gp=$e(e=>e.search,e=>e?.searchAction?.actionCause||"");m();d();f();p();var hp=e=>e.searchHub;m();d();f();p();var ac=$e(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),cH=$e(e=>e,e=>{let t=ac(e);return t&&e?e[t].expression:""});m();d();f();p();var Fy=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};m();d();f();p();var Dy=e=>e.excerptLength?.length;m();d();f();p();var My=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};m();d();f();p();var qy=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};m();d();f();p();var jy=e=>e.sortCriteria;var Ly=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Kn(e.configuration.search.apiBaseUrl,e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function Ly(_x72){return _ref31.apply(this,arguments)}}(),Uy=(e,t)=>{let r=fn(e)?.q,{aq:n,cq:o,dq:i,lq:a}=Gy(e),s=Jd(e),c=Hi(e.configuration.analytics,t,{actionCause:gp(e)}),u=hp(e),h=ep(e),v=kd(e)??[],C=By(e),g=ac(e.tabSet)||"default",y=Td(e),S=eh(e),E=t.referrer||"",R=My(e),k=jy(e),I=ST(e),T=Dy(e),_=qy(e),D=Fy(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(i&&{dq:i}),...(a&&{lq:a}),...(e.query&&{enableQuerySyntax:dy(e)}),...(s?.contextValues&&{context:s.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:v}},...(u?.length&&{searchHub:u}),...(h?.length&&{pipeline:h}),...(C.length&&{facets:C}),...(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:fp(e),firstResult:e.pagination.firstResult}),tab:g,locale:y,timezone:S,...(e.debug!==void 0&&{debug:e.debug}),referrer:E,...I,...(_??{}),...(T&&{excerptLength:T}),...(D&&{dictionaryFieldContext:D}),sortCriteria:k,...(R&&{facetOptions:R}),...c,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},Vy=(e,t)=>{let r=fn(e)?.q,n=By(e),o=Hi(e.configuration.analytics,t,{actionCause:gp(e)}),i=Td(e),a=ac(e.tabSet)||"default",s=t.referrer,{aq:c,cq:u}=Gy(e),h=hp(e),v=ep(e),C=Jd(e),g=kd(e)??[];return{q:r||"",...(n.length&&{facets:n}),citationsFieldToInclude:g,...(h?.length&&{searchHub:h}),...(v?.length&&{pipeline:v}),...(C?.contextValues&&{context:C.contextValues}),...(c&&{aq:c}),...(u&&{cq:u}),tab:a,referrer:s,...o,locale:i}},By=e=>ic(e)?.map(t=>lp(t,up())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),ST=e=>({actionsHistory:e.configuration.analytics.enabled?gt.getInstance().getHistory():[]}),Gy=e=>{let t=py(e),r=mp(e);return{...t,...(r&&{cq:r})}};m();d();f();p();var sc=["searching","thinking","answering"];function cc(e){return e.toLowerCase()}var uc=["search","generic"];m();d();f();p();var $y=["text/plain","text/markdown"];var Io=new z({required:!0}),Qy=new z,To=new fe({required:!0}),yp={id:Io,title:Io,uri:Io,permanentid:Io,clickUri:Qy},lc=new z({required:!0,constrainTo:$y}),Hy=new z({required:!0,constrainTo:sc}),zy=e=>({...e,name:cc(e.name)}),T4=O("generatedAnswer/setIsVisible",e=>B(e,To)),dc=O("generatedAnswer/setAnswerId",e=>B(e,Y)),_4=O("generatedAnswer/setAnswerGenerationMode",e=>B(e,new z({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),k4=O("generatedAnswer/setIsEnabled",e=>B(e,To)),Xi=O("generatedAnswer/updateMessage",e=>B(e,{textDelta:Io})),Zi=O("generatedAnswer/updateCitations",e=>B(e,{citations:new Se({required:!0,each:new ne({values:yp})})})),Ji=O("generatedAnswer/updateError",e=>B(e,{message:Qy,code:new oe({min:0})})),pc=O("generatedAnswer/resetAnswer"),O4=O("generatedAnswer/like"),P4=O("generatedAnswer/dislike"),N4=O("generatedAnswer/feedbackModal/open"),F4=O("generatedAnswer/expand"),D4=O("generatedAnswer/collapse"),M4=O("generatedAnswer/setId",e=>B(e,{id:new z({required:!0})})),q4=O("generatedAnswer/feedbackModal/close"),j4=O("generatedAnswer/sendFeedback"),qr=O("generatedAnswer/setIsLoading",e=>B(e,To)),Yi=O("generatedAnswer/setIsStreaming",e=>B(e,To)),ea=O("generatedAnswer/setAnswerContentFormat",e=>B(e,lc)),L4=O("generatedAnswer/updateResponseFormat",e=>B(e,{contentFormat:new Se({each:lc,default:["text/plain"]})})),U4=O("knowledge/updateAnswerConfigurationId",e=>B(e,Io)),V4=O("generatedAnswer/registerFieldsToIncludeInCitations",e=>B(e,us)),vp=O("generatedAnswer/setIsAnswerGenerated",e=>B(e,To)),ta=O("generatedAnswer/setCannotAnswer",e=>B(e,To)),bT=O("generatedAnswer/setAnswerApiQueryParams",e=>B(e,new ne({}))),Wy=O("generatedAnswer/startStep",e=>B(zy(e),{name:Hy,startedAt:new oe({min:0,required:!0})})),Ky=O("generatedAnswer/finishStep",e=>B(zy(e),{name:Hy,finishedAt:new oe({min:0,required:!0})})),Yy=O("generatedAnswer/startToolCall",e=>B(e,{toolCallName:Y,startedAt:new oe({min:0,required:!0}),toolCallId:Y})),Xy=O("generatedAnswer/finishToolCall",e=>B(e,{finishedAt:new oe({min:0,required:!0}),toolCallId:Y})),fc=O("generatedAnswer/toolCallArgs",e=>B(e,{toolCallId:Y,args:new ne({options:{required:!0}}),type:new z({required:!0,constrainTo:uc})})),B4=Ie("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{generatedAnswerAnalyticsClient:a}=o,{search:s}=i(),{queryExecuted:c}=s,{setAbortControllerRef:u}=e,h=yield Ly(r),v=(y,S)=>{switch(y){case"genqa.headerMessageType":{let E=JSON.parse(S);n(ea(E.contentFormat));break}case"genqa.messageType":n(Xi(JSON.parse(S)));break;case"genqa.citationsType":n(Zi(JSON.parse(S)));break;case"genqa.endOfStreamType":{let E=JSON.parse(S).answerGenerated,{answerId:R,answer:k}=i().generatedAnswer,T=c.length!==0&&!E,_=!k?.trim();n(ta(T)),n(Yi(!1)),n(vp(E)),n((a??ec).logGeneratedAnswerStreamEnd(E,R,E?_:void 0)),n(Co());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${y}"`)}};n(qr(!0));let C=y=>y.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,g=o.streamingClient?.streamGeneratedAnswer(h,{write:y=>{C(h)&&(n(qr(!1)),y.payload&&y.payloadType&&v(y.payloadType,y.payload))},abort:y=>{C(h)&&n(Ji(y))},close:()=>{C(h)&&n(Yi(!1))},resetAnswer:()=>{C(h)&&n(pc())}});g?u(g):n(qr(!1))});return function(_x73,_x74){return _ref32.apply(this,arguments)}}()),G4=Ie("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(pc());let i=t();if(i.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(i.generatedAnswer.answerConfigurationId){let a=Uy(i,n);r(bT(a)),yield r(Zy(a))}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(_x75,_x76){return _ref33.apply(this,arguments)}}());m();d();f();p();m();d();f();p();function ev(_x77,_x78){return _ev.apply(this,arguments)}function _ev(){_ev=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _ev.apply(this,arguments)}function tv(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=AT(t,a);let s=t.length,c=0;for(;r<s;){o&&(t[r]===10&&(c=++r),o=!1);let u=-1;for(;r<s&&u===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-c);break;case 13:o=!0,u=r;break;case 10:u=r;break}if(u===-1)break;e(t.subarray(c,u),n),c=r,n=-1}c===s?t=void 0:c!==0&&(t=t.subarray(c),r-=c)}}function rv(e,t,r){let n=Jy(),o=new TextDecoder;return function(a,s){if(a.length===0)r?.(n),n=Jy();else if(s>0){let c=o.decode(a.subarray(0,s)),u=s+(a[s+1]===32?2:1),h=o.decode(a.subarray(u));switch(c){case"data":n.data=n.data?`${n.data}
32
+ ${h}`:h;break;case"event":n.event=h;break;case"id":e(n.id=h);break;case"retry":wT(h,n,t);break}}}}function wT(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function AT(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Jy(){return{data:"",event:"",id:"",retry:void 0}}var Sp="text/event-stream",xT=1e3,nv="last-event-id";function ov(){return typeof window<"u"}function iv(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:s,fetch:c,...u}){return new Promise((h,v)=>{let C={...r};C.accept||(C.accept=Sp);let g;function y(){g?.abort(),document.hidden||T()}!s&&ov()&&document.addEventListener("visibilitychange",y);let S=xT,E;function R(){ov()&&document.removeEventListener("visibilitychange",y),clearTimeout(E),g?.abort()}t?.addEventListener("abort",()=>{R(),h()});let k=c??A,I=n??CT;function T(){return _T2.apply(this,arguments)}function _T2(){_T2=_asyncToGenerator(function*(){g=l.AbortController?new l.AbortController:null;try{let _=yield k(e,{...u,headers:C,signal:g?.signal});yield I(_),yield ev(_.body,tv(rv(D=>{D?C[nv]=D:delete C[nv]},D=>{S=D},o))),i?.(),R(),h()}catch(_){if(!g?.signal?.aborted)try{let D=a?.(_)??S;clearTimeout(E),E=setTimeout(T,D)}catch(D){R(),v(D)}}});return _T2.apply(this,arguments)}T()})}function CT(e){let t=e.headers.get("content-type");if(!t?.startsWith(Sp))throw new Error(`Expected content-type to be ${Sp}, Actual: ${t}`)}m();d();f();p();var ET=/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,s=n.generatedAnswer.answerConfigurationId,c={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let u=Kn(n.configuration.search?.apiBaseUrl,a,i);return Xh({baseUrl:`${u}/rest/organizations/${a}/answer/v1/configs/${s}`,fetchFn:function(){var _ref35=_asyncToGenerator(function*(h){if(h instanceof String)throw new Error("The provided 'request' must be a Request object.");let v=h.url,C={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(g=>{C[g]=h[g]}),C.duplex="half",C.body=yield h.text(),A(v,C)});return function fetchFn(_x82){return _ref35.apply(this,arguments)}}()})(c,{...t,signal:null},r)}catch(u){return{error:u}}});return function ET(_x79,_x80,_x81){return _ref34.apply(this,arguments)}}(),av=ly({reducerPath:"answer",baseQuery:Jh(ET,{maxRetries:3}),endpoints:()=>({})});var RT=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},IT=(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)},TT=(e,t)=>{delete e.error,e.citations=t.citations},_T=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},kT=(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})`)},OT=(e,t,r,n)=>{let o=JSON.parse(e.data);o.finishReason==="ERROR"&&o.errorMessage&&kT(t,o);let i=o.payload.length?JSON.parse(o.payload):{};switch(o.payloadType){case"genqa.headerMessageType":i.contentFormat&&(RT(t,i),r(ea(i.contentFormat)));break;case"genqa.messageType":typeof i.textDelta=="string"&&(IT(t,i),r(Xi({textDelta:i.textDelta})));break;case"genqa.citationsType":i.citations&&(TT(t,i),r(Zi({citations:i.citations})));break;case"genqa.endOfStreamType":{_T(t,i);let a=t.answerId,s=i.answerGenerated??!1,c=s?!t.answer?.trim():void 0;r(n.logGeneratedAnswerStreamEnd(s,a,c)),r(Co());break}}},PT=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,i=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${i}/${r}/generate`},bp=av.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(_x83,_x84){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i,extra:a}){yield n;let{configuration:s,generatedAnswer:c,insightConfiguration:u}=r(),{generatedAnswerAnalyticsClient:h}=a,{organizationId:v,environment:C,accessToken:g}=s,y=Kn(s.search.apiBaseUrl,v,C),S=PT(y,v,c.answerConfigurationId,u?.insightId);yield iv(S,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${g}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},openWhenHidden:!0,fetch:A,onopen:function(){var _ref36=_asyncToGenerator(function*(E){let R=E.headers.get("x-answer-id");R&&o(k=>{k.answerId=R,i(dc(R))})});return function onopen(_x85){return _ref36.apply(this,arguments)}}(),onmessage:E=>{o(R=>{OT(E,R,i,h??ec)})},onerror:E=>{throw E},onclose:()=>{o(E=>{i(ta(!E.generated))})}})}).apply(this,arguments)}})})}),Zy=e=>bp.endpoints.getAnswer.initiate(e);m();d();f();p();var sv=Be(ro,e=>e);m();d();f();p();function NT(e){let t=e.payload?.analyticsAction;return cv(e)&&!se(t)}function cv(e){return"type"in e}var uv=e=>t=>r=>{let n;NT(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return cv(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};m();d();f();p();m();d();f();p();m();d();f();p();var Uz=O("tab/register",e=>{let t=new ne({values:{id:Y,expression:nt}});return B(e,t)}),mc=O("tab/updateActiveTab",e=>B(e,Y));m();d();f();p();var gc=qt(tc(),1),pv=qt(lv(),1),fv=qt(dv(),1);gc.default.extend(fv.default);gc.default.extend(pv.default);var mv=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:gc.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"});m();d();f();p();var FT=/(^|; )Coveo-Pendragon=([^;]*)/,DT=/(^|; )Coveo-SearchAgentDebug=([^;]*)/;function gv(){return typeof window>"u"?!1:FT.exec(document.cookie)?.pop()||null}function hv(){return typeof window>"u"?!1:DT.test(document.cookie)}var yv=Be(mv(),e=>e.addCase(Er,(t,r)=>{MT(t,r.payload)}).addCase(Wt,(t,r)=>{qT(t,r.payload)}).addCase(no,(t,r)=>{jT(t,r.payload)}).addCase(oo,t=>{t.analytics.enabled=!1}).addCase(io,t=>{t.analytics.enabled=!0}).addCase(ls,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(ds,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(mc,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Ag,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Rr,(t,r)=>{se(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(bg,(t,{payload:r})=>{LT(t,r)}));function MT(e,t){se(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",se(t.organizationId)||(e.organizationId=t.organizationId)}function qT(e,t){se(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),se(t.locale)||(e.search.locale=t.locale),se(t.timezone)||(e.search.timezone=t.timezone),se(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function jT(e,t){se(t.enabled)||(e.analytics.enabled=t.enabled),se(t.originContext)||(e.analytics.originContext=t.originContext),se(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),se(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),se(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),se(t.trackingId)||(e.analytics.trackingId=t.trackingId),se(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),se(t.source)||(e.analytics.source=t.source);try{let r=gv();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}se(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),se(t.anonymous)||(e.analytics.anonymous=t.anonymous),se(t.deviceId)||(e.analytics.deviceId=t.deviceId),se(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),se(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}function LT(e,t){e.knowledge.agentId=t;try{hv()&&(e.knowledge.debugAgentSession=!0)}catch{}}var Lt=yv;m();d();f();p();function UT(e){return e.instantlyCallable}var vv=()=>e=>t=>e(UT(t)?t():t);m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var at=[];for(let e=0;e<256;++e)at.push((e+256).toString(16).slice(1));function Sv(e,t=0){return(at[e[t+0]]+at[e[t+1]]+at[e[t+2]]+at[e[t+3]]+"-"+at[e[t+4]]+at[e[t+5]]+"-"+at[e[t+6]]+at[e[t+7]]+"-"+at[e[t+8]]+at[e[t+9]]+"-"+at[e[t+10]]+at[e[t+11]]+at[e[t+12]]+at[e[t+13]]+at[e[t+14]]+at[e[t+15]]).toLowerCase()}m();d();f();p();var Ep,VT=new Uint8Array(16);function Rp(){if(!Ep){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ep=crypto.getRandomValues.bind(crypto)}return Ep(VT)}m();d();f();p();m();d();f();p();var BT=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ip={randomUUID:BT};function GT(e,t,r){if(Ip.randomUUID&&!t&&!e)return Ip.randomUUID();e=e||{};let n=e.random??e.rng?.()??Rp();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 Sv(n)}var jr=GT;m();d();f();p();m();d();f();p();var b={};ni(b,{BRAND:()=>g0,DIRTY:()=>gn,EMPTY_PATH:()=>zT,INVALID:()=>de,NEVER:()=>J0,OK:()=>dt,ParseStatus:()=>st,Schema:()=>we,ZodAny:()=>Vr,ZodArray:()=>vr,ZodBigInt:()=>yn,ZodBoolean:()=>vn,ZodBranded:()=>na,ZodCatch:()=>_n,ZodDate:()=>Sn,ZodDefault:()=>Tn,ZodDiscriminatedUnion:()=>vc,ZodEffects:()=>Nt,ZodEnum:()=>Rn,ZodError:()=>St,ZodFirstPartyTypeKind:()=>pe,ZodFunction:()=>bc,ZodIntersection:()=>xn,ZodIssueCode:()=>K,ZodLazy:()=>Cn,ZodLiteral:()=>En,ZodMap:()=>Fo,ZodNaN:()=>Mo,ZodNativeEnum:()=>In,ZodNever:()=>Ut,ZodNull:()=>wn,ZodNullable:()=>Jt,ZodNumber:()=>hn,ZodObject:()=>bt,ZodOptional:()=>Ot,ZodParsedType:()=>re,ZodPipeline:()=>oa,ZodPromise:()=>Br,ZodReadonly:()=>kn,ZodRecord:()=>Sc,ZodSchema:()=>we,ZodSet:()=>Do,ZodString:()=>Ur,ZodSymbol:()=>Po,ZodTransformer:()=>Nt,ZodTuple:()=>Zt,ZodType:()=>we,ZodUndefined:()=>bn,ZodUnion:()=>An,ZodUnknown:()=>yr,ZodVoid:()=>No,addIssueToContext:()=>ee,any:()=>C0,array:()=>T0,bigint:()=>S0,boolean:()=>kv,coerce:()=>Z0,custom:()=>Iv,date:()=>b0,datetimeRegex:()=>Ev,defaultErrorMap:()=>gr,discriminatedUnion:()=>P0,effect:()=>$0,enum:()=>V0,function:()=>j0,getErrorMap:()=>_o,getParsedType:()=>Xt,instanceof:()=>y0,intersection:()=>N0,isAborted:()=>hc,isAsync:()=>ko,isDirty:()=>yc,isValid:()=>Lr,late:()=>h0,lazy:()=>L0,literal:()=>U0,makeIssue:()=>ra,map:()=>M0,nan:()=>v0,nativeEnum:()=>B0,never:()=>R0,null:()=>x0,nullable:()=>H0,number:()=>_v,object:()=>_0,objectUtil:()=>Tp,oboolean:()=>X0,onumber:()=>Y0,optional:()=>Q0,ostring:()=>K0,pipeline:()=>W0,preprocess:()=>z0,promise:()=>G0,quotelessJson:()=>$T,record:()=>D0,set:()=>q0,setErrorMap:()=>HT,strictObject:()=>k0,string:()=>Tv,symbol:()=>w0,transformer:()=>$0,tuple:()=>F0,undefined:()=>A0,union:()=>O0,unknown:()=>E0,util:()=>Ce,void:()=>I0});m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var Ce;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(s=>typeof o[o[s]]!="number"),a={};for(let s of i)a[s]=o[s];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},e.find=(o,i)=>{for(let a of o)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Ce||(Ce={}));var Tp;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Tp||(Tp={}));var re=Ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xt=e=>{switch(typeof e){case"undefined":return re.undefined;case"string":return re.string;case"number":return Number.isNaN(e)?re.nan:re.number;case"boolean":return re.boolean;case"function":return re.function;case"bigint":return re.bigint;case"symbol":return re.symbol;case"object":return Array.isArray(e)?re.array:e===null?re.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?re.promise:typeof Map<"u"&&e instanceof Map?re.map:typeof Set<"u"&&e instanceof Set?re.set:typeof Date<"u"&&e instanceof Date?re.date:re.object;default:return re.unknown}};var K=Ce.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"]),$T=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),St=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(i){return i.message},n={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let s=n,c=0;for(;c<a.path.length;){let u=a.path[c];c===a.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(r(a))):s[u]=s[u]||{_errors:[]},s=s[u],c++}}};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,Ce.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 i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};St.create=e=>new St(e);var QT=(e,t)=>{let r;switch(e.code){case K.invalid_type:e.received===re.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case K.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ce.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ce.joinValues(e.keys,", ")}`;break;case K.invalid_union:r="Invalid input";break;case K.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ce.joinValues(e.options)}`;break;case K.invalid_enum_value:r=`Invalid enum value. Expected ${Ce.joinValues(e.options)}, received '${e.received}'`;break;case K.invalid_arguments:r="Invalid function arguments";break;case K.invalid_return_type:r="Invalid function return type";break;case K.invalid_date:r="Invalid date";break;case K.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}"`:Ce.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case K.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 K.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 K.custom:r="Invalid input";break;case K.invalid_intersection_types:r="Intersection results could not be merged";break;case K.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case K.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ce.assertNever(e)}return{message:r}},gr=QT;var bv=gr;function HT(e){bv=e}function _o(){return bv}m();d();f();p();var ra=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...(o.path||[])],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let s="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)s=u(a,{data:t,defaultError:s}).message;return{...o,path:i,message:s}},zT=[];function ee(e,t){let r=_o(),n=ra({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===gr?void 0:gr].filter(o=>!!o)});e.common.issues.push(n)}var st=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 de;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 i=yield o.key,a=yield o.value;n.push({key:i,value:a})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return de;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(n[i.value]=a.value)}return{status:t.value,value:n}}},de=Object.freeze({status:"aborted"}),gn=e=>({status:"dirty",value:e}),dt=e=>({status:"valid",value:e}),hc=e=>e.status==="aborted",yc=e=>e.status==="dirty",Lr=e=>e.status==="valid",ko=e=>typeof Promise<"u"&&e instanceof Promise;m();d();f();p();m();d();f();p();var ie;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ie||(ie={}));var Pt=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}},wv=(e,t)=>{if(Lr(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 St(e.common.issues);return this._error=r,this._error}}};function ye(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:(a,s)=>{let{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??n??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:c??r??s.defaultError}},description:o}}var we=class{get description(){return this._def.description}_getType(t){return Xt(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Xt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new st,ctx:{common:t.parent.common,data:t.data,parsedType:Xt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(ko(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:Xt(t)},o=this._parseSync({data:t,path:n.path,parent:n});return wv(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Xt(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Lr(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=>Lr(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this10=this;return _asyncToGenerator(function*(){let n=yield _this10.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this11=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this11._def.errorMap,parent:null,data:t,parsedType:Xt(t)},o=_this11._parse({data:t,path:n.path,parent:n}),i=yield ko(o)?o:Promise.resolve(o);return wv(n,i)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let a=t(o),s=()=>i.addIssue({code:K.custom,...n(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(s(),!1)):a?!0:(s(),!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 Nt({schema:this,typeName:pe.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 Ot.create(this,this._def)}nullable(){return Jt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return vr.create(this)}promise(){return Br.create(this,this._def)}or(t){return An.create([this,t],this._def)}and(t){return xn.create(this,t,this._def)}transform(t){return new Nt({...ye(this._def),schema:this,typeName:pe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Tn({...ye(this._def),innerType:this,defaultValue:r,typeName:pe.ZodDefault})}brand(){return new na({typeName:pe.ZodBranded,type:this,...ye(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new _n({...ye(this._def),innerType:this,catchValue:r,typeName:pe.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return oa.create(this,t)}readonly(){return kn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},WT=/^c[^\s-]{8,}$/i,KT=/^[0-9a-z]+$/,YT=/^[0-9A-HJKMNP-TV-Z]{26}$/i,XT=/^[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,ZT=/^[a-z0-9_-]{21}$/i,JT=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,e0=/^[-+]?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)?)??$/,t0=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,r0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",_p,n0=/^(?:(?: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])$/,o0=/^(?:(?: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])$/,i0=/^(([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]))$/,a0=/^(([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])$/,s0=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,c0=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,xv="((\\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])))",u0=new RegExp(`^${xv}$`);function Cv(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 l0(e){return new RegExp(`^${Cv(e)}$`)}function Ev(e){let t=`${xv}T${Cv(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 d0(e,t){return!!((t==="v4"||!t)&&n0.test(e)||(t==="v6"||!t)&&i0.test(e))}function p0(e,t){if(!JT.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 f0(e,t){return!!((t==="v4"||!t)&&o0.test(e)||(t==="v6"||!t)&&a0.test(e))}var Ur=class e extends we{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==re.string){let i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_type,expected:re.string,received:i.parsedType}),de}let n=new st,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,s=t.data.length<i.value;(a||s)&&(o=this._getOrReturnCtx(t,o),a?ee(o,{code:K.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&ee(o,{code:K.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")t0.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"email",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")_p||(_p=new RegExp(r0,"u")),_p.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"emoji",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")XT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"uuid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")ZT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"nanoid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")WT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"cuid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")KT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"cuid2",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")YT.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"ulid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ee(o,{validation:"url",code:K.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"regex",code:K.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Ev(i).test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?u0.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?l0(i).test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?e0.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"duration",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?d0(t.data,i.version)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"ip",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?p0(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"jwt",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?f0(t.data,i.version)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"cidr",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?s0.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"base64",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?c0.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"base64url",code:K.invalid_string,message:i.message}),n.dirty()):Ce.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:K.invalid_string,...ie.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ie.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ie.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ie.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ie.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ie.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ie.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ie.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ie.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ie.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ie.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ie.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ie.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ie.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,...ie.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,...ie.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ie.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ie.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...ie.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ie.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ie.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ie.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ie.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ie.errToObj(r)})}nonempty(t){return this.min(1,ie.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}};Ur.create=e=>new Ur({checks:[],typeName:pe.ZodString,coerce:e?.coerce??!1,...ye(e)});function m0(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return i%a/10**o}var hn=class e extends we{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)!==re.number){let i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_type,expected:re.number,received:i.parsedType}),de}let n,o=new st;for(let i of this._def.checks)i.kind==="int"?Ce.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ee(n,{code:K.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?m0(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ee(n,{code:K.not_finite,message:i.message}),o.dirty()):Ce.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ie.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ie.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ie.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ie.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ie.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ie.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ie.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ie.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ie.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ie.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ie.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ie.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ie.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ie.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"&&Ce.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)}};hn.create=e=>new hn({checks:[],typeName:pe.ZodNumber,coerce:e?.coerce||!1,...ye(e)});var yn=class e extends we{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)!==re.bigint)return this._getInvalidInput(t);let n,o=new st;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:K.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Ce.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.bigint,received:r.parsedType}),de}gte(t,r){return this.setLimit("min",t,!0,ie.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ie.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ie.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ie.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ie.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:ie.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ie.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ie.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ie.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ie.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}};yn.create=e=>new yn({checks:[],typeName:pe.ZodBigInt,coerce:e?.coerce??!1,...ye(e)});var vn=class extends we{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==re.boolean){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.boolean,received:n.parsedType}),de}return dt(t.data)}};vn.create=e=>new vn({typeName:pe.ZodBoolean,coerce:e?.coerce||!1,...ye(e)});var Sn=class e extends we{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==re.date){let i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_type,expected:re.date,received:i.parsedType}),de}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return ee(i,{code:K.invalid_date}),de}let n=new st,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Ce.assertNever(i);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:ie.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ie.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}};Sn.create=e=>new Sn({checks:[],coerce:e?.coerce||!1,typeName:pe.ZodDate,...ye(e)});var Po=class extends we{_parse(t){if(this._getType(t)!==re.symbol){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.symbol,received:n.parsedType}),de}return dt(t.data)}};Po.create=e=>new Po({typeName:pe.ZodSymbol,...ye(e)});var bn=class extends we{_parse(t){if(this._getType(t)!==re.undefined){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.undefined,received:n.parsedType}),de}return dt(t.data)}};bn.create=e=>new bn({typeName:pe.ZodUndefined,...ye(e)});var wn=class extends we{_parse(t){if(this._getType(t)!==re.null){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.null,received:n.parsedType}),de}return dt(t.data)}};wn.create=e=>new wn({typeName:pe.ZodNull,...ye(e)});var Vr=class extends we{constructor(){super(...arguments),this._any=!0}_parse(t){return dt(t.data)}};Vr.create=e=>new Vr({typeName:pe.ZodAny,...ye(e)});var yr=class extends we{constructor(){super(...arguments),this._unknown=!0}_parse(t){return dt(t.data)}};yr.create=e=>new yr({typeName:pe.ZodUnknown,...ye(e)});var Ut=class extends we{_parse(t){let r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.never,received:r.parsedType}),de}};Ut.create=e=>new Ut({typeName:pe.ZodNever,...ye(e)});var No=class extends we{_parse(t){if(this._getType(t)!==re.undefined){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.void,received:n.parsedType}),de}return dt(t.data)}};No.create=e=>new No({typeName:pe.ZodVoid,...ye(e)});var vr=class e extends we{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==re.array)return ee(r,{code:K.invalid_type,expected:re.array,received:r.parsedType}),de;if(o.exactLength!==null){let a=r.data.length>o.exactLength.value,s=r.data.length<o.exactLength.value;(a||s)&&(ee(r,{code:a?K.too_big:K.too_small,minimum:s?o.exactLength.value:void 0,maximum:a?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&&(ee(r,{code:K.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&&(ee(r,{code:K.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((a,s)=>o.type._parseAsync(new Pt(r,a,r.path,s)))).then(a=>st.mergeArray(n,a));let i=[...r.data].map((a,s)=>o.type._parseSync(new Pt(r,a,r.path,s)));return st.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:ie.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:ie.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:ie.toString(r)}})}nonempty(t){return this.min(1,t)}};vr.create=(e,t)=>new vr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:pe.ZodArray,...ye(t)});function Oo(e){if(e instanceof bt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Ot.create(Oo(n))}return new bt({...e._def,shape:()=>t})}else return e instanceof vr?new vr({...e._def,type:Oo(e.element)}):e instanceof Ot?Ot.create(Oo(e.unwrap())):e instanceof Jt?Jt.create(Oo(e.unwrap())):e instanceof Zt?Zt.create(e.items.map(t=>Oo(t))):e}var bt=class e extends we{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=Ce.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==re.object){let u=this._getOrReturnCtx(t);return ee(u,{code:K.invalid_type,expected:re.object,received:u.parsedType}),de}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Ut&&this._def.unknownKeys==="strip"))for(let u in o.data)a.includes(u)||s.push(u);let c=[];for(let u of a){let h=i[u],v=o.data[u];c.push({key:{status:"valid",value:u},value:h._parse(new Pt(o,v,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof Ut){let u=this._def.unknownKeys;if(u==="passthrough")for(let h of s)c.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(u==="strict")s.length>0&&(ee(o,{code:K.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let h of s){let v=o.data[h];c.push({key:{status:"valid",value:h},value:u._parse(new Pt(o,v,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let u=[];for(let h of c){let v=yield h.key,C=yield h.value;u.push({key:v,value:C,alwaysSet:h.alwaysSet})}return u})).then(u=>st.mergeObjectSync(n,u)):st.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return ie.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:ie.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:pe.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 Ce.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 Ce.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Oo(this)}partial(t){let r={};for(let n of Ce.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 Ce.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Ot;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return Rv(Ce.objectKeys(this.shape))}};bt.create=(e,t)=>new bt({shape:()=>e,unknownKeys:"strip",catchall:Ut.create(),typeName:pe.ZodObject,...ye(t)});bt.strictCreate=(e,t)=>new bt({shape:()=>e,unknownKeys:"strict",catchall:Ut.create(),typeName:pe.ZodObject,...ye(t)});bt.lazycreate=(e,t)=>new bt({shape:e,unknownKeys:"strip",catchall:Ut.create(),typeName:pe.ZodObject,...ye(t)});var An=class extends we{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let s of i)if(s.result.status==="valid")return s.result;for(let s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(s=>new St(s.ctx.common.issues));return ee(r,{code:K.invalid_union,unionErrors:a}),de}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(i){let a={...r,common:{...r.common,issues:[]},parent:null};return{result:yield i._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}});return function(_x86){return _ref38.apply(this,arguments)}}())).then(o);{let i,a=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},h=c._parseSync({data:r.data,path:r.path,parent:u});if(h.status==="valid")return h;h.status==="dirty"&&!i&&(i={result:h,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let s=a.map(c=>new St(c));return ee(r,{code:K.invalid_union,unionErrors:s}),de}}get options(){return this._def.options}};An.create=(e,t)=>new An({options:e,typeName:pe.ZodUnion,...ye(t)});var hr=e=>e instanceof Cn?hr(e.schema):e instanceof Nt?hr(e.innerType()):e instanceof En?[e.value]:e instanceof Rn?e.options:e instanceof In?Ce.objectValues(e.enum):e instanceof Tn?hr(e._def.innerType):e instanceof bn?[void 0]:e instanceof wn?[null]:e instanceof Ot?[void 0,...hr(e.unwrap())]:e instanceof Jt?[null,...hr(e.unwrap())]:e instanceof na||e instanceof kn?hr(e.unwrap()):e instanceof _n?hr(e._def.innerType):[],vc=class e extends we{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==re.object)return ee(r,{code:K.invalid_type,expected:re.object,received:r.parsedType}),de;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(ee(r,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),de)}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 i of r){let a=hr(i.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of a){if(o.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);o.set(s,i)}}return new e({typeName:pe.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...ye(n)})}};function kp(e,t){let r=Xt(e),n=Xt(t);if(e===t)return{valid:!0,data:e};if(r===re.object&&n===re.object){let o=Ce.objectKeys(t),i=Ce.objectKeys(e).filter(s=>o.indexOf(s)!==-1),a={...e,...t};for(let s of i){let c=kp(e[s],t[s]);if(!c.valid)return{valid:!1};a[s]=c.data}return{valid:!0,data:a}}else if(r===re.array&&n===re.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let a=e[i],s=t[i],c=kp(a,s);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===re.date&&n===re.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var xn=class extends we{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,a)=>{if(hc(i)||hc(a))return de;let s=kp(i.value,a.value);return s.valid?((yc(i)||yc(a))&&r.dirty(),{status:r.value,value:s.data}):(ee(n,{code:K.invalid_intersection_types}),de)};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(([i,a])=>o(i,a)):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}))}};xn.create=(e,t,r)=>new xn({left:e,right:t,typeName:pe.ZodIntersection,...ye(r)});var Zt=class e extends we{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==re.array)return ee(n,{code:K.invalid_type,expected:re.array,received:n.parsedType}),de;if(n.data.length<this._def.items.length)return ee(n,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),de;!this._def.rest&&n.data.length>this._def.items.length&&(ee(n,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((a,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new Pt(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>st.mergeArray(r,a)):st.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Zt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zt({items:e,typeName:pe.ZodTuple,rest:null,...ye(t)})};var Sc=class e extends we{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!==re.object)return ee(n,{code:K.invalid_type,expected:re.object,received:n.parsedType}),de;let o=[],i=this._def.keyType,a=this._def.valueType;for(let s in n.data)o.push({key:i._parse(new Pt(n,s,n.path,s)),value:a._parse(new Pt(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?st.mergeObjectAsync(r,o):st.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof we?new e({keyType:t,valueType:r,typeName:pe.ZodRecord,...ye(n)}):new e({keyType:Ur.create(),valueType:t,typeName:pe.ZodRecord,...ye(r)})}},Fo=class extends we{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!==re.map)return ee(n,{code:K.invalid_type,expected:re.map,received:n.parsedType}),de;let o=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([s,c],u)=>({key:o._parse(new Pt(n,s,n.path,[u,"key"])),value:i._parse(new Pt(n,c,n.path,[u,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let c of a){let u=yield c.key,h=yield c.value;if(u.status==="aborted"||h.status==="aborted")return de;(u.status==="dirty"||h.status==="dirty")&&r.dirty(),s.set(u.value,h.value)}return{status:r.value,value:s}}))}else{let s=new Map;for(let c of a){let u=c.key,h=c.value;if(u.status==="aborted"||h.status==="aborted")return de;(u.status==="dirty"||h.status==="dirty")&&r.dirty(),s.set(u.value,h.value)}return{status:r.value,value:s}}}};Fo.create=(e,t,r)=>new Fo({valueType:t,keyType:e,typeName:pe.ZodMap,...ye(r)});var Do=class e extends we{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==re.set)return ee(n,{code:K.invalid_type,expected:re.set,received:n.parsedType}),de;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(ee(n,{code:K.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&&(ee(n,{code:K.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function a(c){let u=new Set;for(let h of c){if(h.status==="aborted")return de;h.status==="dirty"&&r.dirty(),u.add(h.value)}return{status:r.value,value:u}}let s=[...n.data.values()].map((c,u)=>i._parse(new Pt(n,c,n.path,u)));return n.common.async?Promise.all(s).then(c=>a(c)):a(s)}min(t,r){return new e({...this._def,minSize:{value:t,message:ie.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:ie.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Do.create=(e,t)=>new Do({valueType:e,minSize:null,maxSize:null,typeName:pe.ZodSet,...ye(t)});var bc=class e extends we{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==re.function)return ee(r,{code:K.invalid_type,expected:re.function,received:r.parsedType}),de;function n(s,c){return ra({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_o(),gr].filter(u=>!!u),issueData:{code:K.invalid_arguments,argumentsError:c}})}function o(s,c){return ra({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_o(),gr].filter(u=>!!u),issueData:{code:K.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Br){let s=this;return dt(/*#__PURE__*/_asyncToGenerator(function*(...c){let u=new St([]),h=yield s._def.args.parseAsync(c,i).catch(g=>{throw u.addIssue(n(c,g)),u}),v=yield Reflect.apply(a,this,h);return yield s._def.returns._def.type.parseAsync(v,i).catch(g=>{throw u.addIssue(o(v,g)),u})}))}else{let s=this;return dt(function(...c){let u=s._def.args.safeParse(c,i);if(!u.success)throw new St([n(c,u.error)]);let h=Reflect.apply(a,this,u.data),v=s._def.returns.safeParse(h,i);if(!v.success)throw new St([o(h,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Zt.create(t).rest(yr.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||Zt.create([]).rest(yr.create()),returns:r||yr.create(),typeName:pe.ZodFunction,...ye(n)})}},Cn=class extends we{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})}};Cn.create=(e,t)=>new Cn({getter:e,typeName:pe.ZodLazy,...ye(t)});var En=class extends we{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return ee(r,{received:r.data,code:K.invalid_literal,expected:this._def.value}),de}return{status:"valid",value:t.data}}get value(){return this._def.value}};En.create=(e,t)=>new En({value:e,typeName:pe.ZodLiteral,...ye(t)});function Rv(e,t){return new Rn({values:e,typeName:pe.ZodEnum,...ye(t)})}var Rn=class e extends we{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return ee(r,{expected:Ce.joinValues(n),received:r.parsedType,code:K.invalid_type}),de}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 ee(r,{received:r.data,code:K.invalid_enum_value,options:n}),de}return dt(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})}};Rn.create=Rv;var In=class extends we{_parse(t){let r=Ce.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==re.string&&n.parsedType!==re.number){let o=Ce.objectValues(r);return ee(n,{expected:Ce.joinValues(o),received:n.parsedType,code:K.invalid_type}),de}if(this._cache||(this._cache=new Set(Ce.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=Ce.objectValues(r);return ee(n,{received:n.data,code:K.invalid_enum_value,options:o}),de}return dt(t.data)}get enum(){return this._def.values}};In.create=(e,t)=>new In({values:e,typeName:pe.ZodNativeEnum,...ye(t)});var Br=class extends we{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==re.promise&&r.common.async===!1)return ee(r,{code:K.invalid_type,expected:re.promise,received:r.parsedType}),de;let n=r.parsedType===re.promise?r.data:Promise.resolve(r.data);return dt(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Br.create=(e,t)=>new Br({type:e,typeName:pe.ZodPromise,...ye(t)});var Nt=class extends we{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===pe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this12=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:a=>{ee(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(n.data,i);if(n.common.async)return Promise.resolve(a).then(/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(s){if(r.value==="aborted")return de;let c=yield _this12._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?de:c.status==="dirty"?gn(c.value):r.value==="dirty"?gn(c.value):c});return function(_x87){return _ref41.apply(this,arguments)}}());{if(r.value==="aborted")return de;let s=this._def.schema._parseSync({data:a,path:n.path,parent:n});return s.status==="aborted"?de:s.status==="dirty"?gn(s.value):r.value==="dirty"?gn(s.value):s}}if(o.type==="refinement"){let a=s=>{let c=o.refinement(s,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?de:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?de:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(o.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Lr(a))return de;let s=o.transform(a.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>Lr(a)?Promise.resolve(o.transform(a.value,i)).then(s=>({status:r.value,value:s})):de);Ce.assertNever(o)}};Nt.create=(e,t,r)=>new Nt({schema:e,typeName:pe.ZodEffects,effect:t,...ye(r)});Nt.createWithPreprocess=(e,t,r)=>new Nt({schema:t,effect:{type:"preprocess",transform:e},typeName:pe.ZodEffects,...ye(r)});var Ot=class extends we{_parse(t){return this._getType(t)===re.undefined?dt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ot.create=(e,t)=>new Ot({innerType:e,typeName:pe.ZodOptional,...ye(t)});var Jt=class extends we{_parse(t){return this._getType(t)===re.null?dt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Jt.create=(e,t)=>new Jt({innerType:e,typeName:pe.ZodNullable,...ye(t)});var Tn=class extends we{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===re.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Tn.create=(e,t)=>new Tn({innerType:e,typeName:pe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ye(t)});var _n=class extends we{_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 ko(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new St(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new St(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};_n.create=(e,t)=>new _n({innerType:e,typeName:pe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ye(t)});var Mo=class extends we{_parse(t){if(this._getType(t)!==re.nan){let n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.nan,received:n.parsedType}),de}return{status:"valid",value:t.data}}};Mo.create=e=>new Mo({typeName:pe.ZodNaN,...ye(e)});var g0=Symbol("zod_brand"),na=class extends we{_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}},oa=class e extends we{_parse(t){var _this13=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let i=yield _this13._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?de:i.status==="dirty"?(r.dirty(),gn(i.value)):_this13._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?de: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:pe.ZodPipeline})}},kn=class extends we{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Lr(o)&&(o.value=Object.freeze(o.value)),o);return ko(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};kn.create=(e,t)=>new kn({innerType:e,typeName:pe.ZodReadonly,...ye(t)});function Av(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Iv(e,t={},r){return e?Vr.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(a=>{if(!a){let s=Av(t,n),c=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:c})}});if(!i){let a=Av(t,n),s=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:s})}}):Vr.create()}var h0={object:bt.lazycreate},pe;(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"})(pe||(pe={}));var y0=(e,t={message:`Input not instance of ${e.name}`})=>Iv(r=>r instanceof e,t),Tv=Ur.create,_v=hn.create,v0=Mo.create,S0=yn.create,kv=vn.create,b0=Sn.create,w0=Po.create,A0=bn.create,x0=wn.create,C0=Vr.create,E0=yr.create,R0=Ut.create,I0=No.create,T0=vr.create,_0=bt.create,k0=bt.strictCreate,O0=An.create,P0=vc.create,N0=xn.create,F0=Zt.create,D0=Sc.create,M0=Fo.create,q0=Do.create,j0=bc.create,L0=Cn.create,U0=En.create,V0=Rn.create,B0=In.create,G0=Br.create,$0=Nt.create,Q0=Ot.create,H0=Jt.create,z0=Nt.createWithPreprocess,W0=oa.create,K0=()=>Tv().optional(),Y0=()=>_v().optional(),X0=()=>kv().optional(),Z0={string:e=>Ur.create({...e,coerce:!0}),number:e=>hn.create({...e,coerce:!0}),boolean:e=>vn.create({...e,coerce:!0}),bigint:e=>yn.create({...e,coerce:!0}),date:e=>Sn.create({...e,coerce:!0})};var J0=de;var e_=b.object({name:b.string(),arguments:b.string()}),t_=b.object({id:b.string(),type:b.literal("function"),function:e_,encryptedValue:b.string().optional()}),wc=b.object({id:b.string(),role:b.string(),content:b.string().optional(),name:b.string().optional(),encryptedValue:b.string().optional()}),r_=b.object({type:b.literal("text"),text:b.string()}),n_=b.object({type:b.literal("data"),value:b.string(),mimeType:b.string()}),o_=b.object({type:b.literal("url"),value:b.string(),mimeType:b.string().optional()}),Ac=b.discriminatedUnion("type",[n_,o_]),i_=b.object({type:b.literal("image"),source:Ac,metadata:b.unknown().optional()}),a_=b.object({type:b.literal("audio"),source:Ac,metadata:b.unknown().optional()}),s_=b.object({type:b.literal("video"),source:Ac,metadata:b.unknown().optional()}),c_=b.object({type:b.literal("document"),source:Ac,metadata:b.unknown().optional()});var Ov=b.object({type:b.literal("binary"),mimeType:b.string(),id:b.string().optional(),url:b.string().optional(),data:b.string().optional(),filename:b.string().optional()}),Pv=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:b.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},y8=Ov.superRefine((e,t)=>{Pv(e,t)}),u_=b.discriminatedUnion("type",[r_,i_,a_,s_,c_,Ov]),l_=u_.superRefine((e,t)=>{e.type==="binary"&&Pv(e,t)}),d_=wc.extend({role:b.literal("developer"),content:b.string()}),p_=wc.extend({role:b.literal("system"),content:b.string()}),f_=wc.extend({role:b.literal("assistant"),content:b.string().optional(),toolCalls:b.array(t_).optional()}),m_=wc.extend({role:b.literal("user"),content:b.union([b.string(),b.array(l_)])}),g_=b.object({id:b.string(),content:b.string(),role:b.literal("tool"),toolCallId:b.string(),error:b.string().optional(),encryptedValue:b.string().optional()}),h_=b.object({id:b.string(),role:b.literal("activity"),activityType:b.string(),content:b.record(b.any())}),y_=b.object({id:b.string(),role:b.literal("reasoning"),content:b.string(),encryptedValue:b.string().optional()}),Nv=b.discriminatedUnion("role",[d_,p_,f_,m_,g_,h_,y_]),v8=b.union([b.literal("developer"),b.literal("system"),b.literal("assistant"),b.literal("user"),b.literal("tool"),b.literal("activity"),b.literal("reasoning")]),v_=b.object({description:b.string(),value:b.string()}),Fv=b.object({name:b.string(),description:b.string(),parameters:b.any(),metadata:b.record(b.any()).optional()}),S_=b.object({id:b.string(),reason:b.string(),message:b.string().optional(),toolCallId:b.string().optional(),responseSchema:b.record(b.any()).optional(),expiresAt:b.string().optional(),metadata:b.record(b.any()).optional()}),b_=b.object({interruptId:b.string(),status:b.enum(["resolved","cancelled"]),payload:b.any().optional()}),w_=b.object({threadId:b.string(),runId:b.string(),parentRunId:b.string().optional(),state:b.any(),messages:b.array(Nv),tools:b.array(Fv),context:b.array(v_),forwardedProps:b.any(),resume:b.array(b_).optional()}),A_=b.any(),Le=class extends Error{constructor(e){super(e)}},Op=class extends Le{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},x_=b.object({name:b.string(),description:b.string().optional()}),C_=b.object({name:b.string().optional(),type:b.string().optional(),description:b.string().optional(),version:b.string().optional(),provider:b.string().optional(),documentationUrl:b.string().optional(),metadata:b.record(b.unknown()).optional()}),E_=b.object({streaming:b.boolean().optional(),websocket:b.boolean().optional(),httpBinary:b.boolean().optional(),pushNotifications:b.boolean().optional(),resumable:b.boolean().optional()}),R_=b.object({supported:b.boolean().optional(),items:b.array(Fv).optional(),parallelCalls:b.boolean().optional(),clientProvided:b.boolean().optional()}),I_=b.object({structuredOutput:b.boolean().optional(),supportedMimeTypes:b.array(b.string()).optional()}),T_=b.object({snapshots:b.boolean().optional(),deltas:b.boolean().optional(),memory:b.boolean().optional(),persistentState:b.boolean().optional()}),__=b.object({supported:b.boolean().optional(),delegation:b.boolean().optional(),handoffs:b.boolean().optional(),subAgents:b.array(x_).optional()}),k_=b.object({supported:b.boolean().optional(),streaming:b.boolean().optional(),encrypted:b.boolean().optional()}),O_=b.object({image:b.boolean().optional(),audio:b.boolean().optional(),video:b.boolean().optional(),pdf:b.boolean().optional(),file:b.boolean().optional()}),P_=b.object({image:b.boolean().optional(),audio:b.boolean().optional()}),N_=b.object({input:O_.optional(),output:P_.optional()}),F_=b.object({codeExecution:b.boolean().optional(),sandboxed:b.boolean().optional(),maxIterations:b.number().optional(),maxExecutionTime:b.number().optional()}),D_=b.object({supported:b.boolean().optional(),approvals:b.boolean().optional(),interventions:b.boolean().optional(),feedback:b.boolean().optional(),interrupts:b.boolean().optional(),approveWithEdits:b.boolean().optional()}),S8=b.object({identity:C_.optional(),transport:E_.optional(),tools:R_.optional(),output:I_.optional(),state:T_.optional(),multiAgent:__.optional(),reasoning:k_.optional(),multimodal:N_.optional(),execution:F_.optional(),humanInTheLoop:D_.optional(),custom:b.record(b.unknown()).optional()}),Dv=b.union([b.literal("developer"),b.literal("system"),b.literal("assistant"),b.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}({}),Te=b.object({type:b.nativeEnum(M),timestamp:b.number().optional(),rawEvent:b.any().optional()}).passthrough(),M_=Te.extend({type:b.literal(M.TEXT_MESSAGE_START),messageId:b.string(),role:Dv.default("assistant"),name:b.string().optional()}),Mv=Te.extend({type:b.literal(M.TEXT_MESSAGE_CONTENT),messageId:b.string(),delta:b.string()}),q_=Te.extend({type:b.literal(M.TEXT_MESSAGE_END),messageId:b.string()}),j_=Te.extend({type:b.literal(M.TEXT_MESSAGE_CHUNK),messageId:b.string().optional(),role:Dv.optional(),delta:b.string().optional(),name:b.string().optional()}),L_=Te.extend({type:b.literal(M.THINKING_TEXT_MESSAGE_START)}),U_=Mv.omit({messageId:!0,type:!0}).extend({type:b.literal(M.THINKING_TEXT_MESSAGE_CONTENT)}),V_=Te.extend({type:b.literal(M.THINKING_TEXT_MESSAGE_END)}),B_=Te.extend({type:b.literal(M.TOOL_CALL_START),toolCallId:b.string(),toolCallName:b.string(),parentMessageId:b.string().nullable().optional().transform(e=>e??void 0)}),G_=Te.extend({type:b.literal(M.TOOL_CALL_ARGS),toolCallId:b.string(),delta:b.string()}),$_=Te.extend({type:b.literal(M.TOOL_CALL_END),toolCallId:b.string()}),Q_=Te.extend({messageId:b.string(),type:b.literal(M.TOOL_CALL_RESULT),toolCallId:b.string(),content:b.string(),role:b.literal("tool").optional()}),H_=Te.extend({type:b.literal(M.TOOL_CALL_CHUNK),toolCallId:b.string().optional(),toolCallName:b.string().optional(),parentMessageId:b.string().nullable().optional().transform(e=>e??void 0),delta:b.string().optional()}),z_=Te.extend({type:b.literal(M.THINKING_START),title:b.string().optional()}),W_=Te.extend({type:b.literal(M.THINKING_END)}),K_=Te.extend({type:b.literal(M.STATE_SNAPSHOT),snapshot:A_}),Y_=Te.extend({type:b.literal(M.STATE_DELTA),delta:b.array(b.any())}),X_=Te.extend({type:b.literal(M.MESSAGES_SNAPSHOT),messages:b.array(Nv)}),Z_=Te.extend({type:b.literal(M.ACTIVITY_SNAPSHOT),messageId:b.string(),activityType:b.string(),content:b.record(b.any()),replace:b.boolean().optional().default(!0)}),J_=Te.extend({type:b.literal(M.ACTIVITY_DELTA),messageId:b.string(),activityType:b.string(),patch:b.array(b.any())}),ek=Te.extend({type:b.literal(M.RAW),event:b.any(),source:b.string().optional()}),tk=Te.extend({type:b.literal(M.CUSTOM),name:b.string(),value:b.any()}),rk=Te.extend({type:b.literal(M.RUN_STARTED),threadId:b.string(),runId:b.string(),parentRunId:b.string().optional(),input:w_.optional()}),nk=b.object({type:b.literal("success")}).strict(),ok=b.object({type:b.literal("interrupt"),interrupts:b.array(S_).min(1)}).strict(),ik=b.discriminatedUnion("type",[nk,ok]),qv=b.object({provider:b.string().optional(),model:b.string().optional(),inputTokens:b.number().int().nonnegative().optional(),outputTokens:b.number().int().nonnegative().optional(),totalTokens:b.number().int().nonnegative().optional(),reasoningTokens:b.number().int().nonnegative().optional(),cachedInputTokens:b.number().int().nonnegative().optional()}),ak=Te.extend({type:b.literal(M.RUN_FINISHED),threadId:b.string(),runId:b.string(),result:b.any().optional(),outcome:ik.nullable().optional().transform(e=>e??void 0),usage:b.array(qv).optional()}),sk=Te.extend({type:b.literal(M.RUN_ERROR),message:b.string(),code:b.string().optional(),usage:b.array(qv).optional()}),ck=Te.extend({type:b.literal(M.STEP_STARTED),stepName:b.string()}),uk=Te.extend({type:b.literal(M.STEP_FINISHED),stepName:b.string()}),lk=b.union([b.literal("tool-call"),b.literal("message")]),dk=Te.extend({type:b.literal(M.REASONING_START),messageId:b.string()}),pk=Te.extend({type:b.literal(M.REASONING_MESSAGE_START),messageId:b.string(),role:b.literal("reasoning")}),fk=Te.extend({type:b.literal(M.REASONING_MESSAGE_CONTENT),messageId:b.string(),delta:b.string()}),mk=Te.extend({type:b.literal(M.REASONING_MESSAGE_END),messageId:b.string()}),gk=Te.extend({type:b.literal(M.REASONING_MESSAGE_CHUNK),messageId:b.string().optional(),delta:b.string().optional()}),hk=Te.extend({type:b.literal(M.REASONING_END),messageId:b.string()}),yk=Te.extend({type:b.literal(M.REASONING_ENCRYPTED_VALUE),subtype:lk,entityId:b.string(),encryptedValue:b.string()}),xc=b.discriminatedUnion("type",[M_,Mv,q_,j_,z_,W_,L_,U_,V_,B_,G_,$_,H_,Q_,K_,Y_,X_,Z_,J_,ek,tk,rk,ak,sk,ck,uk,dk,pk,fk,mk,gk,hk,yk]);m();d();f();p();var Pp={};ni(Pp,{JsonPatchError:()=>Qe,_areEquals:()=>sa,applyOperation:()=>On,applyPatch:()=>kc,applyReducer:()=>Ak,deepClone:()=>bk,getValueByPointer:()=>Tc,validate:()=>Lv,validator:()=>_c});m();d();f();p();m();d();f();p();var vk=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},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)}}(),Sk=Object.prototype.hasOwnProperty;function Ec(e,t){return Sk.call(e,t)}function Rc(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)Ec(e,o)&&n.push(o);return n}function ct(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Ic(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 er(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function ia(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Cc(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Cc(e[t]))return!0}else if(typeof e=="object"){for(var n=Rc(e),o=n.length,i=0;i<o;i++)if(Cc(e[n[i]]))return!0}}return!1}function jv(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 aa=function(e){vk(t,e);function t(r,n,o,i,a){var s=this.constructor,c=e.call(this,jv(r,{name:n,index:o,operation:i,tree:a}))||this;return c.name=n,c.index=o,c.operation=i,c.tree=a,Object.setPrototypeOf(c,s.prototype),c.message=jv(r,{name:n,index:o,operation:i,tree:a}),c}return t}(Error);var Qe=aa,bk=ct,qo={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=Tc(r,this.path);n&&(n=ct(n));var o=On(r,{op:"remove",path:this.from}).removed;return On(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=Tc(r,this.from);return On(r,{op:"add",path:this.path,value:ct(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:sa(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},wk={add:function(e,t,r){return Ic(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:qo.move,copy:qo.copy,test:qo.test,_get:qo._get};function Tc(e,t){if(t=="")return e;var r={op:"_get",path:t};return On(e,r),r.value}function On(e,t,r,n,o,i){if(r===void 0&&(r=!1),n===void 0&&(n=!0),o===void 0&&(o=!0),i===void 0&&(i=0),r&&(typeof r=="function"?r(t,0,e,t.path):_c(t,0)),t.path===""){var a={newDocument:e};if(t.op==="add")return a.newDocument=t.value,a;if(t.op==="replace")return a.newDocument=t.value,a.removed=e,a;if(t.op==="move"||t.op==="copy")return a.newDocument=Tc(e,t.from),t.op==="move"&&(a.removed=e),a;if(t.op==="test"){if(a.test=sa(e,t.value),a.test===!1)throw new Qe("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a.newDocument=e,a}else{if(t.op==="remove")return a.removed=e,a.newDocument=null,a;if(t.op==="_get")return t.value=e,a;if(r)throw new Qe("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",i,t,e);return a}}else{n||(e=ct(e));var s=t.path||"",c=s.split("/"),u=e,h=1,v=c.length,C=void 0,g=void 0,y=void 0;for(typeof r=="function"?y=r:y=_c;;){if(g=c[h],g&&g.indexOf("~")!=-1&&(g=ia(g)),o&&(g=="__proto__"||g=="prototype"&&h>0&&c[h-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&&C===void 0&&(u[g]===void 0?C=c.slice(0,h).join("/"):h==v-1&&(C=t.path),C!==void 0&&y(t,0,e,C)),h++,Array.isArray(u)){if(g==="-")g=u.length;else{if(r&&!Ic(g))throw new Qe("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",i,t,e);Ic(g)&&(g=~~g)}if(h>=v){if(r&&t.op==="add"&&g>u.length)throw new Qe("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",i,t,e);var a=wk[t.op].call(t,u,g,e);if(a.test===!1)throw new Qe("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}}else if(h>=v){var a=qo[t.op].call(t,u,g,e);if(a.test===!1)throw new Qe("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}if(u=u[g],r&&h<v&&(!u||typeof u!="object"))throw new Qe("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",i,t,e)}}}function kc(e,t,r,n,o){if(n===void 0&&(n=!0),o===void 0&&(o=!0),r&&!Array.isArray(t))throw new Qe("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=ct(e));for(var i=new Array(t.length),a=0,s=t.length;a<s;a++)i[a]=On(e,t[a],r,!0,o,a),e=i[a].newDocument;return i.newDocument=e,i}function Ak(e,t,r){var n=On(e,t);if(n.test===!1)throw new Qe("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function _c(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new Qe("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(qo[e.op]){if(typeof e.path!="string")throw new Qe("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Qe("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 Qe("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 Qe("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")&&Cc(e.value))throw new Qe("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,i=n.split("/").length;if(o!==i+1&&o!==i)throw new Qe("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 Qe("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 a={op:"_get",path:e.from,value:void 0},s=Lv([a],r);if(s&&s.name==="OPERATION_PATH_UNRESOLVABLE")throw new Qe("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new Qe("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function Lv(e,t,r){try{if(!Array.isArray(e))throw new Qe("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)kc(ct(t),ct(e),r||!0);else{r=r||_c;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(o){if(o instanceof Qe)return o;throw o}}function sa(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,i,a;if(r&&n){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(!sa(e[o],t[o]))return!1;return!0}if(r!=n)return!1;var s=Object.keys(e);if(i=s.length,i!==Object.keys(t).length)return!1;for(o=i;o--!==0;)if(!t.hasOwnProperty(s[o]))return!1;for(o=i;o--!==0;)if(a=s[o],!sa(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var Mp={};ni(Mp,{compare:()=>kk,generate:()=>Np,observe:()=>_k,unobserve:()=>Tk});m();d();f();p();var Fp=new WeakMap,xk=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),Ck=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function Ek(e){return Fp.get(e)}function Rk(e,t){return e.observers.get(t)}function Ik(e,t){e.observers.delete(t.callback)}function Tk(e,t){t.unobserve()}function _k(e,t){var r=[],n,o=Ek(e);if(!o)o=new xk(e),Fp.set(e,o);else{var i=Rk(o,t);n=i&&i.observer}if(n)return n;if(n={},o.value=ct(e),t){n.callback=t,n.next=null;var a=function(){Np(n)},s=function(){clearTimeout(n.next),n.next=setTimeout(a)};typeof window<"u"&&(window.addEventListener("mouseup",s),window.addEventListener("keyup",s),window.addEventListener("mousedown",s),window.addEventListener("keydown",s),window.addEventListener("change",s))}return n.patches=r,n.object=e,n.unobserve=function(){Np(n),clearTimeout(n.next),Ik(o,n),typeof window<"u"&&(window.removeEventListener("mouseup",s),window.removeEventListener("keyup",s),window.removeEventListener("mousedown",s),window.removeEventListener("keydown",s),window.removeEventListener("change",s))},o.observers.set(t,new Ck(t,n)),n}function Np(e,t){t===void 0&&(t=!1);var r=Fp.get(e.object);Dp(r.value,e.object,e.patches,"",t),e.patches.length&&kc(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function Dp(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var i=Rc(t),a=Rc(e),s=!1,c=!1,u=a.length-1;u>=0;u--){var h=a[u],v=e[h];if(Ec(t,h)&&!(t[h]===void 0&&v!==void 0&&Array.isArray(t)===!1)){var C=t[h];typeof v=="object"&&v!=null&&typeof C=="object"&&C!=null&&Array.isArray(v)===Array.isArray(C)?Dp(v,C,r,n+"/"+er(h),o):v!==C&&(s=!0,o&&r.push({op:"test",path:n+"/"+er(h),value:ct(v)}),r.push({op:"replace",path:n+"/"+er(h),value:ct(C)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+er(h),value:ct(v)}),r.push({op:"remove",path:n+"/"+er(h)}),c=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),s=!0)}if(!(!c&&i.length==a.length))for(var u=0;u<i.length;u++){var h=i[u];!Ec(e,h)&&t[h]!==void 0&&r.push({op:"add",path:n+"/"+er(h),value:ct(t[h])})}}}function kk(e,t,r){r===void 0&&(r=!1);var n=[];return Dp(e,t,n,"",r),n}var Oc=Object.assign({},Pp,Mp,{JsonPatchError:aa,deepClone:ct,escapePathComponent:er,unescapePathComponent:ia});m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var qp=function(e,t){return qp=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])},qp(e,t)};function tr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");qp(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Uv(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(v){a(v)}}function c(h){try{u(n.throw(h))}catch(v){a(v)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}function Pc(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(h){return c([u,h])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(r=0)),r;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(h){u=[6,h],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Sr(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 jo(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-->0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function Lo(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function Pn(e){return this instanceof Pn?(this.v=e,this):new Pn(e)}function Vv(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(g){return function(y){return Promise.resolve(y).then(g,v)}}function s(g,y){n[g]&&(o[g]=function(S){return new Promise(function(E,R){i.push([g,S,E,R])>1||c(g,S)})},y&&(o[g]=y(o[g])))}function c(g,y){try{u(n[g](y))}catch(S){C(i[0][3],S)}}function u(g){g.value instanceof Pn?Promise.resolve(g.value.v).then(h,v):C(i[0][2],g)}function h(g){c("next",g)}function v(g){c("throw",g)}function C(g,y){g(y),i.shift(),i.length&&c(i[0][0],i[0][1])}}function Bv(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 Sr=="function"?Sr(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(s,c){a=e[i](a),o(s,c,a.done,a.value)})}}function o(i,a,s,c){Promise.resolve(c).then(function(u){i({value:u,done:s})},a)}}m();d();f();p();function xe(e){return typeof e=="function"}m();d();f();p();m();d();f();p();m();d();f();p();function Uo(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 Nc=Uo(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}});m();d();f();p();function aa(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Uo=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,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=Sr(a),c=s.next();!c.done;c=s.next()){var u=c.value;u.remove(this)}}catch(S){t={error:S}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var g=this.initialTeardown;if(xe(g))try{g()}catch(S){i=S instanceof Oc?S.errors:[S]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var E=Sr(v),y=E.next();!y.done;y=E.next()){var h=y.value;try{Uv(h)}catch(S){i=i??[],S instanceof Oc?i=jo(jo([],qo(i)),qo(S.errors)):i.push(S)}}}catch(S){n={error:S}}finally{try{y&&!y.done&&(o=E.return)&&o.call(E)}finally{if(n)throw n.error}}}if(i)throw new Oc(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Uv(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)&&aa(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&aa(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var Mp=Uo.EMPTY;function Pc(e){return e instanceof Uo||e&&"closed"in e&&xe(e.remove)&&xe(e.add)&&xe(e.unsubscribe)}function Uv(e){xe(e)?e():e.unsubscribe()}m();d();f();p();var Vt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};m();d();f();p();m();d();f();p();var Vo={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Vo.delegate;return o?.setTimeout?o.setTimeout.apply(o,jo([e,t],qo(r))):setTimeout.apply(void 0,jo([e,t],qo(r)))},clearTimeout:function(e){var t=Vo.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Nc(e){Vo.setTimeout(function(){var t=Vt.onUnhandledError;if(t)t(e);else throw e})}m();d();f();p();function sa(){}m();d();f();p();var Vv=function(){return qp("C",void 0,void 0)}();function Bv(e){return qp("E",void 0,e)}function Gv(e){return qp("N",e,void 0)}function qp(e,t,r){return{kind:e,value:t,error:r}}m();d();f();p();var Nn=null;function Bo(e){if(Vt.useDeprecatedSynchronousErrorHandling){var t=!Nn;if(t&&(Nn={errorThrown:!1,error:null}),e(),t){var r=Nn,n=r.errorThrown,o=r.error;if(Nn=null,n)throw o}}else e()}function $v(e){Vt.useDeprecatedSynchronousErrorHandling&&Nn&&(Nn.errorThrown=!0,Nn.error=e)}var ca=function(e){tr(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Pc(r)&&r.add(n)):n.destination=Tk,n}return t.create=function(r,n,o){return new Dc(r,n,o)},t.prototype.next=function(r){this.isStopped?Lp(Gv(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?Lp(Bv(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?Lp(Vv,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}(Uo);var Ek=Function.prototype.bind;function jp(e,t){return Ek.call(e,t)}var Rk=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){Fc(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Fc(n)}else Fc(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Fc(r)}},e}(),Dc=function(e){tr(t,e);function t(r,n,o){var i=e.call(this)||this,a;if(xe(r)||!r)a={next:r??void 0,error:n??void 0,complete:o??void 0};else{var s;i&&Vt.useDeprecatedNextContext?(s=Object.create(r),s.unsubscribe=function(){return i.unsubscribe()},a={next:r.next&&jp(r.next,s),error:r.error&&jp(r.error,s),complete:r.complete&&jp(r.complete,s)}):a=r}return i.destination=new Rk(a),i}return t}(ca);function Fc(e){Vt.useDeprecatedSynchronousErrorHandling?$v(e):Nc(e)}function Ik(e){throw e}function Lp(e,t){var r=Vt.onStoppedNotification;r&&Vo.setTimeout(function(){return r(e,t)})}var Tk={closed:!0,next:sa,error:Ik,complete:sa};m();d();f();p();var Go=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();m();d();f();p();m();d();f();p();function $o(e){return e}function Mc(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Up(e)}function Up(e){return e.length===0?$o:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var Ue=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,i=kk(t)?t:new Dc(t,r,n);return Bo(function(){var a=o,s=a.operator,c=a.source;i.add(s?s.call(i,c):c?o._subscribe(i):o._trySubscribe(i))}),i},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=Qv(r),new r(function(o,i){var a=new Dc({next:function(s){try{t(s)}catch(c){i(c),a.unsubscribe()}},error:i,complete:o});n.subscribe(a)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[Go]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Up(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Qv(t),new t(function(n,o){var i;r.subscribe(function(a){return i=a},function(a){return o(a)},function(){return n(i)})})},e.create=function(t){return new e(t)},e}();function Qv(e){var t;return(t=e??Vt.Promise)!==null&&t!==void 0?t:Promise}function _k(e){return e&&xe(e.next)&&xe(e.error)&&xe(e.complete)}function kk(e){return e&&e instanceof ca||_k(e)&&Pc(e)}m();d();f();p();function Ok(e){return xe(e?.lift)}function ze(e){return function(t){if(Ok(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")}}m();d();f();p();function Ye(e,t,r,n,o){return new Pk(e,t,r,n,o)}var Pk=function(e){tr(t,e);function t(r,n,o,i,a,s){var c=e.call(this,r)||this;return c.onFinalize=a,c.shouldUnsubscribe=s,c._next=n?function(u){try{n(u)}catch(g){r.error(g)}}:e.prototype._next,c._error=i?function(u){try{i(u)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,c._complete=o?function(){try{o()}catch(u){r.error(u)}finally{this.unsubscribe()}}:e.prototype._complete,c}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}(ca);m();d();f();p();m();d();f();p();var Hv=Lo(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var rr=function(e){tr(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 zv(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Hv},t.prototype.next=function(r){var n=this;Bo(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=Sr(n.currentObservers),s=a.next();!s.done;s=a.next()){var c=s.value;c.next(r)}}catch(u){o={error:u}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;Bo(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;Bo(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,i=o.hasError,a=o.isStopped,s=o.observers;return i||a?Mp:(this.currentObservers=null,s.push(r),new Uo(function(){n.currentObservers=null,aa(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,a=n.isStopped;o?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new Ue;return r.source=this,r},t.create=function(r,n){return new zv(r,n)},t}(Ue);var zv=function(e){tr(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:Mp},t}(rr);m();d();f();p();m();d();f();p();var Vp={now:function(){return(Vp.delegate||Date).now()},delegate:void 0};var qc=function(e){tr(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=Vp);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(r){var n=this,o=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,s=n._timestampProvider,c=n._windowTime;o||(i.push(r),!a&&i.push(s.now()+c)),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,i=o._infiniteTimeWindow,a=o._buffer,s=a.slice(),c=0;c<s.length&&!r.closed;c+=i?1:2)r.next(s[c]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,i=r._buffer,a=r._infiniteTimeWindow,s=(a?1:2)*n;if(n<1/0&&s<i.length&&i.splice(0,i.length-s),!a){for(var c=o.now(),u=0,g=1;g<i.length&&i[g]<=c;g+=2)u=g;u&&i.splice(0,u+1)}},t}(rr);m();d();f();p();var jc=new Ue(function(e){return e.complete()});m();d();f();p();m();d();f();p();m();d();f();p();function Wv(e){return e&&xe(e.schedule)}function Nk(e){return e[e.length-1]}function Kv(e){return Wv(Nk(e))?e.pop():void 0}m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var Lc=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};m();d();f();p();function Uc(e){return xe(e?.then)}m();d();f();p();function Vc(e){return xe(e[Go])}m();d();f();p();function Bc(e){return Symbol.asyncIterator&&xe(e?.[Symbol.asyncIterator])}m();d();f();p();function Gc(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.")}m();d();f();p();m();d();f();p();function Fk(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var $c=Fk();function Qc(e){return xe(e?.[$c])}m();d();f();p();function Hc(e){return jv(this,arguments,function(){var r,n,o,i;return kc(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Pn(r.read())];case 3:return n=a.sent(),o=n.value,i=n.done,i?[4,Pn(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Pn(o)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function zc(e){return xe(e?.getReader)}function Xe(e){if(e instanceof Ue)return e;if(e!=null){if(Vc(e))return Dk(e);if(Lc(e))return Mk(e);if(Uc(e))return qk(e);if(Bc(e))return Yv(e);if(Qc(e))return jk(e);if(zc(e))return Lk(e)}throw Gc(e)}function Dk(e){return new Ue(function(t){var r=e[Go]();if(xe(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Mk(e){return new Ue(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function qk(e){return new Ue(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Nc)})}function jk(e){return new Ue(function(t){var r,n;try{for(var o=Sr(e),i=o.next();!i.done;i=o.next()){var a=i.value;if(t.next(a),t.closed)return}}catch(s){r={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function Yv(e){return new Ue(function(t){Uk(e,t).catch(function(r){return t.error(r)})})}function Lk(e){return Yv(Hc(e))}function Uk(e,t){var r,n,o,i;return qv(this,void 0,void 0,function(){var a,s;return kc(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=Lv(e),c.label=1;case 1:return[4,r.next()];case 2:if(n=c.sent(),!!n.done)return[3,4];if(a=n.value,t.next(a),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),o={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(i=r.return)?[4,i.call(r)]:[3,8];case 7:c.sent(),c.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]}})})}m();d();f();p();m();d();f();p();function Ft(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var i=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(i),!o)return i}function Wc(e,t){return t===void 0&&(t=0),ze(function(r,n){r.subscribe(Ye(n,function(o){return Ft(n,e,function(){return n.next(o)},t)},function(){return Ft(n,e,function(){return n.complete()},t)},function(o){return Ft(n,e,function(){return n.error(o)},t)}))})}m();d();f();p();function Kc(e,t){return t===void 0&&(t=0),ze(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function Xv(e,t){return Xe(e).pipe(Kc(t),Wc(t))}m();d();f();p();function Zv(e,t){return Xe(e).pipe(Kc(t),Wc(t))}m();d();f();p();function Jv(e,t){return new Ue(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}m();d();f();p();function eS(e,t){return new Ue(function(r){var n;return Ft(r,t,function(){n=e[$c](),Ft(r,t,function(){var o,i,a;try{o=n.next(),i=o.value,a=o.done}catch(s){r.error(s);return}a?r.complete():r.next(i)},0,!0)}),function(){return xe(n?.return)&&n.return()}})}m();d();f();p();function Yc(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ue(function(r){Ft(r,t,function(){var n=e[Symbol.asyncIterator]();Ft(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}m();d();f();p();function tS(e,t){return Yc(Hc(e),t)}function rS(e,t){if(e!=null){if(Vc(e))return Xv(e,t);if(Lc(e))return Jv(e,t);if(Uc(e))return Zv(e,t);if(Bc(e))return Yc(e,t);if(Qc(e))return eS(e,t);if(zc(e))return tS(e,t)}throw Gc(e)}function Fn(e,t){return t?rS(e,t):Xe(e)}function Ge(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Kv(e);return Fn(e,r)}m();d();f();p();function Ve(e,t){var r=xe(e)?e:function(){return e},n=function(o){return o.error(r())};return new Ue(t?function(o){return t.schedule(n,0,o)}:n)}m();d();f();p();m();d();f();p();var nS=Lo(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function Xc(e,t){var r=typeof t=="object";return new Promise(function(n,o){var i=!1,a;e.subscribe({next:function(s){a=s,i=!0},error:o,complete:function(){i?n(a):r?n(t.defaultValue):o(new nS)}})})}m();d();f();p();function Dn(e,t){return ze(function(r,n){var o=0;r.subscribe(Ye(n,function(i){n.next(e.call(t,i,o++))}))})}m();d();f();p();m();d();f();p();m();d();f();p();function oS(e,t,r,n,o,i,a,s){var c=[],u=0,g=0,v=!1,E=function(){v&&!c.length&&!u&&t.complete()},y=function(S){return u<n?h(S):c.push(S)},h=function(S){i&&t.next(S),u++;var C=!1;Xe(r(S,g++)).subscribe(Ye(t,function(R){o?.(R),i?y(R):t.next(R)},function(){C=!0},void 0,function(){if(C)try{u--;for(var R=function(){var T=c.shift();a?Ft(t,a,function(){return h(T)}):h(T)};c.length&&u<n;)R();E()}catch(T){t.error(T)}}))};return e.subscribe(Ye(t,y,function(){v=!0,E()})),function(){s?.()}}function wt(e,t,r){return r===void 0&&(r=1/0),xe(t)?wt(function(n,o){return Dn(function(i,a){return t(n,i,o,a)})(Xe(e(n,o)))},r):(typeof t=="number"&&(r=t),ze(function(n,o){return oS(n,o,e,r)}))}function Bp(e){return e===void 0&&(e=1/0),wt($o,e)}m();d();f();p();function Zc(e){return new Ue(function(t){Xe(e()).subscribe(t)})}m();d();f();p();function ua(e){return ze(function(t,r){var n=null,o=!1,i;n=t.subscribe(Ye(r,void 0,void 0,function(a){i=Xe(e(a,ua(e)(t))),n?(n.unsubscribe(),n=null,i.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,i.subscribe(r))})}m();d();f();p();function Jc(e,t){return xe(t)?wt(e,t,1):wt(e,1)}m();d();f();p();function Gp(e){return ze(function(t,r){var n=!1;t.subscribe(Ye(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}m();d();f();p();function Mn(e){return ze(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}m();d();f();p();function $p(e,t){return ze(function(r,n){var o=null,i=0,a=!1,s=function(){return a&&!o&&n.complete()};r.subscribe(Ye(n,function(c){o?.unsubscribe();var u=0,g=i++;Xe(e(c,g)).subscribe(o=Ye(n,function(v){return n.next(t?t(c,v,g,u++):v)},function(){o=null,s()}))},function(){a=!0,s()}))})}m();d();f();p();function eu(e){return ze(function(t,r){Xe(e).subscribe(Ye(r,function(){return r.complete()},sa)),!r.closed&&t.subscribe(r)})}m();d();f();p();function Qp(e,t,r){var n=xe(e)||t||r?{next:e,error:t,complete:r}:e;return n?ze(function(o,i){var a;(a=n.subscribe)===null||a===void 0||a.call(n);var s=!0;o.subscribe(Ye(i,function(c){var u;(u=n.next)===null||u===void 0||u.call(n,c),i.next(c)},function(){var c;s=!1,(c=n.complete)===null||c===void 0||c.call(n),i.complete()},function(c){var u;s=!1,(u=n.error)===null||u===void 0||u.call(n,c),i.error(c)},function(){var c,u;s&&((c=n.unsubscribe)===null||c===void 0||c.call(n)),(u=n.finalize)===null||u===void 0||u.call(n)}))}):$o}m();d();f();p();m();d();f();p();function iS(e){return` \r
36
- `.indexOf(e)>=0}function tu(e){for(var t=["topLevel"],r=0,n,o,i,a=function(T){return t.push(T)},s=function(T){return t[t.length-1]=T},c=function(T){n==null&&(n=r,o=t.length,i=T)},u=function(T){T===i&&(n=void 0,o=void 0,i=void 0)},g=function(){return t.pop()},v=function(){return r--},E=function(T){if("0"<=T&&T<="9"){a("number");return}switch(T){case"\"":a("string");return;case"-":a("numberNeedsDigit");return;case"t":a("true");return;case"f":a("false");return;case"n":a("null");return;case"[":a("arrayNeedsValue");return;case"{":a("objectNeedsKey");return}},y=e.length;r<y;r++){var h=e[r];switch(t[t.length-1]){case"topLevel":E(h);break;case"string":switch(h){case"\"":g();break;case"\\":c("stringEscape"),a("stringEscaped");break}break;case"stringEscaped":h==="u"?a("stringUnicode"):(u("stringEscape"),g());break;case"stringUnicode":r-e.lastIndexOf("u",r)===4&&(u("stringEscape"),g());break;case"number":h==="."?s("numberNeedsDigit"):h==="e"||h==="E"?s("numberNeedsExponent"):(h<"0"||h>"9")&&(v(),g());break;case"numberNeedsDigit":s("number");break;case"numberNeedsExponent":s(h==="+"||h==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(h<"a"||h>"z")&&(v(),g());break;case"arrayNeedsValue":h==="]"?g():iS(h)||(u("collectionItem"),s("arrayNeedsComma"),E(h));break;case"arrayNeedsComma":h==="]"?g():h===","&&(c("collectionItem"),s("arrayNeedsValue"));break;case"objectNeedsKey":h==="}"?g():h==="\""&&(c("collectionItem"),s("objectNeedsColon"),a("string"));break;case"objectNeedsColon":h===":"&&s("objectNeedsValue");break;case"objectNeedsValue":iS(h)||(u("collectionItem"),s("objectNeedsComma"),E(h));break;case"objectNeedsComma":h==="}"?g():h===","&&(c("collectionItem"),s("objectNeedsKey"));break}}o!=null&&(t.length=o);for(var S=[n!=null?e.slice(0,n):e],C=function(T){return S.push(T.slice(e.length-e.lastIndexOf(T[0])))},R=t.length-1;R>=0;R--)switch(t[R]){case"string":S.push("\"");break;case"numberNeedsDigit":case"numberNeedsExponent":S.push("0");break;case"true":C("true");break;case"false":C("false");break;case"null":C("null");break;case"arrayNeedsValue":case"arrayNeedsComma":S.push("]");break;case"objectNeedsKey":case"objectNeedsColon":case"objectNeedsValue":case"objectNeedsComma":S.push("}");break}return S.join("")}m();d();f();p();m();d();f();p();m();d();f();p();function sS(){let e=this.buf,t=this.pos,r=0,n=0;for(let i=0;i<28;i+=7){let a=e[t++];if(r|=(a&127)<<i,(a&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 i=3;i<=31;i+=7){let a=e[t++];if(n|=(a&127)<<i,(a&128)==0){this.pos=t,this.assertBounds(),this.varint64Lo=r,this.varint64Hi=n;return}}throw new Error("invalid varint")}var ru=4294967296;function Hp(e){let t=e[0]==="-";t&&(e=e.slice(1));let r=1e6,n=0,o=0;function i(a,s){let c=Number(e.slice(a,s));o*=r,n=n*r+c,n>=ru&&(o=o+(n/ru|0),n=n%ru)}return i(-24,-18),i(-18,-12),i(-12,-6),i(-6),t?uS(n,o):Wp(n,o)}function cS(e,t){let r=Wp(e,t),n=r.hi&2147483648;n&&(r=uS(r.lo,r.hi));let o=zp(r.lo,r.hi);return n?"-"+o:o}function zp(e,t){if({lo:e,hi:t}=Vk(e,t),t<=2097151)return String(ru*t+e);let r=e&16777215,n=(e>>>24|t<<8)&16777215,o=t>>16&65535,i=r+n*6777216+o*6710656,a=n+o*8147497,s=o*2,c=1e7;return i>=c&&(a+=Math.floor(i/c),i%=c),a>=c&&(s+=Math.floor(a/c),a%=c),s.toString()+aS(a)+aS(i)}function Vk(e,t){return{lo:e>>>0,hi:t>>>0}}function Wp(e,t){return{lo:e|0,hi:t|0}}function uS(e,t){return t=~t,e?e=~e+1:t+=1,Wp(e,t)}var aS=e=>{let t=String(e);return"0000000".slice(t.length)+t};function lS(){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}m();d();f();p();var Bt=Bk();function Bk(){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"&&(!!b.Deno||!!b.Bun||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let r=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),o=BigInt("0"),i=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(a){let s=typeof a=="bigint"?a:BigInt(a);if(s>n||s<r)throw new Error(`invalid int64: ${a}`);return s},uParse(a){let s=typeof a=="bigint"?a:BigInt(a);if(s>i||s<o)throw new Error(`invalid uint64: ${a}`);return s},enc(a){return e.setBigInt64(0,this.parse(a),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(a){return e.setBigInt64(0,this.uParse(a),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(a,s){return e.setInt32(0,a,!0),e.setInt32(4,s,!0),e.getBigInt64(0,!0)},uDec(a,s){return e.setInt32(0,a,!0),e.setInt32(4,s,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),dS(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),pS(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),dS(r),Hp(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),pS(r),Hp(r)},dec(r,n){return cS(r,n)},uDec(r,n){return zp(r,n)}}}function dS(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function pS(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}m();d();f();p();var Kp=Symbol.for("@bufbuild/protobuf/text-encoding");function Gk(e){var t;b[Kp]=Object.assign(Object.assign({},e),{encodeUtf8Into:(t=e.encodeUtf8Into)!==null&&t!==void 0?t:Xp(e.encodeUtf8.bind(e))})}function Yp(){let e=b;if(!e[Kp]){let t=new e.TextEncoder,r=new e.TextDecoder,n,o={encodeUtf8(a){return t.encode(a)},decodeUtf8(a,s){return s?(n||(n=new e.TextDecoder("utf-8",{fatal:!0})),n.decode(a)):r.decode(a)},checkUtf8(a){try{return encodeURIComponent(a),!0}catch{return!1}}};t.encodeInto&&(o.encodeUtf8Into=t.encodeInto.bind(t));let i=String.prototype.isWellFormed;i&&(o.checkUtf8=a=>i.call(a)),Gk(o)}return e[Kp]}function Xp(e){return(t,r)=>{let n=e(t);return r.set(n),{written:n.byteLength}}}var Gr;(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"})(Gr||(Gr={}));var $k=34028234663852886e22,Qk=-34028234663852886e22,Hk=4294967295,zk=2147483647,Wk=-2147483648,Se=class{constructor(t){this.stackPos=[],this.encodeUtf8Into=t?Xp(t):Yp().encodeUtf8Into,this.buffer=mS,this.viewCache=Yk,this.pos=0}ensureCapacity(t){let r=this.pos+t;if(r>this.buffer.length){let n=this.buffer.length||Kk;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(la),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-la,n=Zp(r);return n>la&&(this.ensureCapacity(n-la),this.buffer.copyWithin(t+n,t+la,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(fS(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(Jp(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<=gS){this.ensureCapacity(r+1);let c=this.buffer,u=this.pos;c[u++]=r;let g=0;for(;g<r;g++){let v=t.charCodeAt(g);if(v>127)break;c[u++]=v}if(g==r)return this.pos=u,this}this.ensureCapacity(r*3+5);let n=Zp(r),o=this.buffer,i=this.pos,{written:a}=this.encodeUtf8Into(t,o.subarray(i+n)),s=Zp(a);return s!=n&&o.copyWithin(i+s,i+n,i+n+a),this.uint32(a),this.pos+=a,this}float(t){return Xk(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 fS(t),this.ensureCapacity(4),this.view().setUint32(this.pos,t,!0),this.pos+=4,this}sfixed32(t){return Jp(t),this.ensureCapacity(4),this.view().setInt32(this.pos,t,!0),this.pos+=4,this}sint32(t){return Jp(t),this.uint32((t<<1^t>>31)>>>0)}sfixed64(t){let r=Bt.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=Bt.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=Bt.enc(t);return this.writeVarint64(r.lo,r.hi)}sint64(t){let r=Bt.enc(t),n=r.hi>>31,o=r.lo<<1^n,i=(r.hi<<1|r.lo>>>31)^n;return this.writeVarint64(o,i)}uint64(t){let r=Bt.uEnc(t);return this.writeVarint64(r.lo,r.hi)}writeVarint64(t,r){this.ensureCapacity(10);let n=this.buffer,o=this.pos;for(let s=0;s<28;s=s+7){let c=t>>>s,u=!(!(c>>>7)&&r==0);if(n[o++]=(u?c|128:c)&255,!u)return this.pos=o,this}let i=t>>>28&15|(r&7)<<4,a=r>>3!=0;if(n[o++]=(a?i|128:i)&255,!a)return this.pos=o,this;for(let s=3;s<31;s=s+7){let c=r>>>s,u=!!(c>>>7);if(n[o++]=(u?c|128:c)&255,!u)return this.pos=o,this}return n[o++]=r>>>31&1,this.pos=o,this}},Kk=128,la=1,mS=new Uint8Array(0),Yk=new DataView(mS.buffer),gS=32;function Zp(e){return e<128?1:e<16384?2:e<2097152?3:e<268435456?4:5}var J=class{constructor(t,r=Yp().decodeUtf8){this.decodeUtf8=r,this.varint64Lo=0,this.varint64Hi=0,this.varint64=sS,this.uint32=lS,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,i=r&7;if(o<=0||i>5)throw new Error("illegal tag: field no "+o+" wire type "+i);return[o,i]}skip(t,r,n=100){let o=this.pos;switch(t){case Gr.Varint:for(;this.buf[this.pos++]&128;);break;case Gr.Bit64:this.pos+=4;case Gr.Bit32:this.pos+=4;break;case Gr.LengthDelimited:let i=this.uint32();this.pos+=i;break;case Gr.StartGroup:if(n<=0)throw new Error("maximum recursion depth reached");for(;;){let[a,s]=this.tag();if(s===Gr.EndGroup){if(r!==void 0&&a!==r)throw new Error("invalid end group tag");break}this.skip(s,a,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(),Bt.dec(this.varint64Lo,this.varint64Hi)}uint64(){return this.varint64(),Bt.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,Bt.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 Bt.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Bt.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<=gS){let o=new Array(n);for(let i=0;i<n;i++){let a=r[i];if(a>127)return this.decodeUtf8(r,t);o[i]=a}return String.fromCharCode.apply(String,o)}return this.decodeUtf8(r,t)}};function Jp(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>zk||e<Wk)throw new Error("invalid int32: "+e)}function fS(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>Hk||e<0)throw new Error("invalid uint32: "+e)}function Xk(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>$k||e<Qk))throw new Error("invalid float32: "+e)}var Zk=function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function ef(){return{fields:{}}}var da={encode(e,t=new Se){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&nf.encode({key:r,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=ef();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;let a=nf.decode(r,r.uint32());a.value!==void 0&&(o.fields[a.key]=a.value);continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return da.fromPartial(e??{})},fromPartial(e){let t=ef();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,o])=>(o!==void 0&&(r[n]=o),r),{}),t},wrap(e){let t=ef();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 hS(){return{key:"",value:void 0}}var nf={encode(e,t=new Se){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&ce.encode(ce.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=hS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.key=r.string();continue;case 2:if(i!==18)break;o.value=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return nf.fromPartial(e??{})},fromPartial(e){let t=hS();return t.key=e.key??"",t.value=e.value??void 0,t}};function tf(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var ce={encode(e,t=new Se){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&&da.encode(da.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&pa.encode(pa.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=tf();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.nullValue=r.int32();continue;case 2:if(i!==17)break;o.numberValue=r.double();continue;case 3:if(i!==26)break;o.stringValue=r.string();continue;case 4:if(i!==32)break;o.boolValue=r.bool();continue;case 5:if(i!==42)break;o.structValue=da.unwrap(da.decode(r,r.uint32()));continue;case 6:if(i!==50)break;o.listValue=pa.unwrap(pa.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return ce.fromPartial(e??{})},fromPartial(e){let t=tf();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=tf();if(e===null)t.nullValue=Zk.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(b.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new b.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 rf(){return{values:[]}}var pa={encode(e,t=new Se){for(let r of e.values)ce.encode(ce.wrap(r),t.uint32(10).fork()).join();return t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=rf();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.values.push(ce.unwrap(ce.decode(r,r.uint32())));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return pa.fromPartial(e??{})},fromPartial(e){let t=rf();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=rf();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&b.Array.isArray(e.values)?e.values:e}},Jk=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 yS(){return{op:0,path:"",from:void 0,value:void 0}}var ou={encode(e,t=new Se){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&&ce.encode(ce.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=yS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.op=r.int32();continue;case 2:if(i!==18)break;o.path=r.string();continue;case 3:if(i!==26)break;o.from=r.string();continue;case 4:if(i!==34)break;o.value=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return ou.fromPartial(e??{})},fromPartial(e){let t=yS();return t.op=e.op??0,t.path=e.path??"",t.from=e.from??void 0,t.value=e.value??void 0,t}};function vS(){return{id:"",type:"",function:void 0}}var iu={encode(e,t=new Se){return e.id!==""&&t.uint32(10).string(e.id),e.type!==""&&t.uint32(18).string(e.type),e.function!==void 0&&au.encode(e.function,t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=vS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.id=r.string();continue;case 2:if(i!==18)break;o.type=r.string();continue;case 3:if(i!==26)break;o.function=au.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return iu.fromPartial(e??{})},fromPartial(e){let t=vS();return t.id=e.id??"",t.type=e.type??"",t.function=e.function!==void 0&&e.function!==null?au.fromPartial(e.function):void 0,t}};function SS(){return{name:"",arguments:""}}var au={encode(e,t=new Se){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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=SS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.name=r.string();continue;case 2:if(i!==18)break;o.arguments=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return au.fromPartial(e??{})},fromPartial(e){let t=SS();return t.name=e.name??"",t.arguments=e.arguments??"",t}};function bS(){return{value:"",mimeType:""}}var su={encode(e,t=new Se){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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=bS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.value=r.string();continue;case 2:if(i!==18)break;o.mimeType=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return su.fromPartial(e??{})},fromPartial(e){let t=bS();return t.value=e.value??"",t.mimeType=e.mimeType??"",t}};function wS(){return{value:"",mimeType:void 0}}var cu={encode(e,t=new Se){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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=wS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.value=r.string();continue;case 2:if(i!==18)break;o.mimeType=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return cu.fromPartial(e??{})},fromPartial(e){let t=wS();return t.value=e.value??"",t.mimeType=e.mimeType??void 0,t}};function AS(){return{data:void 0,url:void 0}}var Et={encode(e,t=new Se){return e.data!==void 0&&su.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&cu.encode(e.url,t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=AS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.data=su.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.url=cu.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Et.fromPartial(e??{})},fromPartial(e){let t=AS();return t.data=e.data!==void 0&&e.data!==null?su.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?cu.fromPartial(e.url):void 0,t}};function xS(){return{text:""}}var uu={encode(e,t=new Se){return e.text!==""&&t.uint32(10).string(e.text),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=xS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.text=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return uu.fromPartial(e??{})},fromPartial(e){let t=xS();return t.text=e.text??"",t}};function CS(){return{source:void 0,metadata:void 0}}var lu={encode(e,t=new Se){return e.source!==void 0&&Et.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&ce.encode(ce.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=CS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.source=Et.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.metadata=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return lu.fromPartial(e??{})},fromPartial(e){let t=CS();return t.source=e.source!==void 0&&e.source!==null?Et.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function ES(){return{source:void 0,metadata:void 0}}var du={encode(e,t=new Se){return e.source!==void 0&&Et.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&ce.encode(ce.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=ES();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.source=Et.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.metadata=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return du.fromPartial(e??{})},fromPartial(e){let t=ES();return t.source=e.source!==void 0&&e.source!==null?Et.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function RS(){return{source:void 0,metadata:void 0}}var pu={encode(e,t=new Se){return e.source!==void 0&&Et.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&ce.encode(ce.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=RS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.source=Et.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.metadata=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return pu.fromPartial(e??{})},fromPartial(e){let t=RS();return t.source=e.source!==void 0&&e.source!==null?Et.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function IS(){return{source:void 0,metadata:void 0}}var fu={encode(e,t=new Se){return e.source!==void 0&&Et.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&ce.encode(ce.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=IS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.source=Et.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.metadata=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return fu.fromPartial(e??{})},fromPartial(e){let t=IS();return t.source=e.source!==void 0&&e.source!==null?Et.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function TS(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var mu={encode(e,t=new Se){return e.text!==void 0&&uu.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&lu.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&du.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&pu.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&fu.encode(e.document,t.uint32(42).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=TS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.text=uu.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.image=lu.decode(r,r.uint32());continue;case 3:if(i!==26)break;o.audio=du.decode(r,r.uint32());continue;case 4:if(i!==34)break;o.video=pu.decode(r,r.uint32());continue;case 5:if(i!==42)break;o.document=fu.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return mu.fromPartial(e??{})},fromPartial(e){let t=TS();return t.text=e.text!==void 0&&e.text!==null?uu.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?lu.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?du.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?pu.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?fu.fromPartial(e.document):void 0,t}};function _S(){return{id:"",role:"",content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[]}}var gu={encode(e,t=new Se){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)iu.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)mu.encode(r,t.uint32(66).fork()).join();return t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=_S();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.id=r.string();continue;case 2:if(i!==18)break;o.role=r.string();continue;case 3:if(i!==26)break;o.content=r.string();continue;case 4:if(i!==34)break;o.name=r.string();continue;case 5:if(i!==42)break;o.toolCalls.push(iu.decode(r,r.uint32()));continue;case 6:if(i!==50)break;o.toolCallId=r.string();continue;case 7:if(i!==58)break;o.error=r.string();continue;case 8:if(i!==66)break;o.contentParts.push(mu.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return gu.fromPartial(e??{})},fromPartial(e){let t=_S();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=>iu.fromPartial(r))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(r=>mu.fromPartial(r))||[],t}};function kS(){return{id:"",reason:"",message:void 0,toolCallId:void 0,responseSchema:void 0,expiresAt:void 0,metadata:void 0}}var hu={encode(e,t=new Se){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&&ce.encode(ce.wrap(e.responseSchema),t.uint32(42).fork()).join(),e.expiresAt!==void 0&&t.uint32(50).string(e.expiresAt),e.metadata!==void 0&&ce.encode(ce.wrap(e.metadata),t.uint32(58).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=kS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.id=r.string();continue;case 2:if(i!==18)break;o.reason=r.string();continue;case 3:if(i!==26)break;o.message=r.string();continue;case 4:if(i!==34)break;o.toolCallId=r.string();continue;case 5:if(i!==42)break;o.responseSchema=ce.unwrap(ce.decode(r,r.uint32()));continue;case 6:if(i!==50)break;o.expiresAt=r.string();continue;case 7:if(i!==58)break;o.metadata=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return hu.fromPartial(e??{})},fromPartial(e){let t=kS();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}},eO=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 OS(){return{type:0,timestamp:void 0,rawEvent:void 0}}var le={encode(e,t=new Se){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&ce.encode(ce.wrap(e.rawEvent),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=OS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.type=r.int32();continue;case 2:if(i!==16)break;o.timestamp=tO(r.int64());continue;case 3:if(i!==26)break;o.rawEvent=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return le.fromPartial(e??{})},fromPartial(e){let t=OS();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function PS(){return{baseEvent:void 0,messageId:"",role:void 0,name:void 0}}var yu={encode(e,t=new Se){return e.baseEvent!==void 0&&le.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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=PS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.role=r.string();continue;case 4:if(i!==34)break;o.name=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return yu.fromPartial(e??{})},fromPartial(e){let t=PS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.role=e.role??void 0,t.name=e.name??void 0,t}};function NS(){return{baseEvent:void 0,messageId:"",delta:""}}var vu={encode(e,t=new Se){return e.baseEvent!==void 0&&le.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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=NS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return vu.fromPartial(e??{})},fromPartial(e){let t=NS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.delta=e.delta??"",t}};function FS(){return{baseEvent:void 0,messageId:""}}var Su={encode(e,t=new Se){return e.baseEvent!==void 0&&le.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=FS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Su.fromPartial(e??{})},fromPartial(e){let t=FS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t}};function DS(){return{baseEvent:void 0,toolCallId:"",toolCallName:"",parentMessageId:void 0}}var bu={encode(e,t=new Se){return e.baseEvent!==void 0&&le.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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=DS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.toolCallName=r.string();continue;case 4:if(i!==34)break;o.parentMessageId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return bu.fromPartial(e??{})},fromPartial(e){let t=DS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.toolCallName=e.toolCallName??"",t.parentMessageId=e.parentMessageId??void 0,t}};function MS(){return{baseEvent:void 0,toolCallId:"",delta:""}}var wu={encode(e,t=new Se){return e.baseEvent!==void 0&&le.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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=MS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return wu.fromPartial(e??{})},fromPartial(e){let t=MS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.delta=e.delta??"",t}};function qS(){return{baseEvent:void 0,toolCallId:""}}var Au={encode(e,t=new Se){return e.baseEvent!==void 0&&le.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=qS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Au.fromPartial(e??{})},fromPartial(e){let t=qS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t}};function jS(){return{baseEvent:void 0,snapshot:void 0}}var xu={encode(e,t=new Se){return e.baseEvent!==void 0&&le.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&ce.encode(ce.wrap(e.snapshot),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=jS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.snapshot=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return xu.fromPartial(e??{})},fromPartial(e){let t=jS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function LS(){return{baseEvent:void 0,delta:[]}}var Cu={encode(e,t=new Se){e.baseEvent!==void 0&&le.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.delta)ou.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=LS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.delta.push(ou.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Cu.fromPartial(e??{})},fromPartial(e){let t=LS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(r=>ou.fromPartial(r))||[],t}};function US(){return{baseEvent:void 0,messages:[]}}var Eu={encode(e,t=new Se){e.baseEvent!==void 0&&le.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.messages)gu.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=US();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messages.push(gu.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Eu.fromPartial(e??{})},fromPartial(e){let t=US();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(r=>gu.fromPartial(r))||[],t}};function VS(){return{baseEvent:void 0,event:void 0,source:void 0}}var Ru={encode(e,t=new Se){return e.baseEvent!==void 0&&le.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&ce.encode(ce.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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=VS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.event=ce.unwrap(ce.decode(r,r.uint32()));continue;case 3:if(i!==26)break;o.source=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ru.fromPartial(e??{})},fromPartial(e){let t=VS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function BS(){return{baseEvent:void 0,name:"",value:void 0}}var Iu={encode(e,t=new Se){return e.baseEvent!==void 0&&le.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==""&&t.uint32(18).string(e.name),e.value!==void 0&&ce.encode(ce.wrap(e.value),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=BS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.name=r.string();continue;case 3:if(i!==26)break;o.value=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Iu.fromPartial(e??{})},fromPartial(e){let t=BS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.name=e.name??"",t.value=e.value??void 0,t}};function GS(){return{baseEvent:void 0,threadId:"",runId:""}}var Tu={encode(e,t=new Se){return e.baseEvent!==void 0&&le.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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=GS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.threadId=r.string();continue;case 3:if(i!==26)break;o.runId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Tu.fromPartial(e??{})},fromPartial(e){let t=GS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t}};function $S(){return{baseEvent:void 0,threadId:"",runId:"",result:void 0,outcome:"",interrupts:[]}}var _u={encode(e,t=new Se){e.baseEvent!==void 0&&le.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&&ce.encode(ce.wrap(e.result),t.uint32(34).fork()).join(),e.outcome!==""&&t.uint32(42).string(e.outcome);for(let r of e.interrupts)hu.encode(r,t.uint32(50).fork()).join();return t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=$S();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.threadId=r.string();continue;case 3:if(i!==26)break;o.runId=r.string();continue;case 4:if(i!==34)break;o.result=ce.unwrap(ce.decode(r,r.uint32()));continue;case 5:if(i!==42)break;o.outcome=r.string();continue;case 6:if(i!==50)break;o.interrupts.push(hu.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return _u.fromPartial(e??{})},fromPartial(e){let t=$S();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.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=>hu.fromPartial(r))||[],t}};function QS(){return{baseEvent:void 0,code:void 0,message:""}}var ku={encode(e,t=new Se){return e.baseEvent!==void 0&&le.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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=QS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.code=r.string();continue;case 3:if(i!==26)break;o.message=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return ku.fromPartial(e??{})},fromPartial(e){let t=QS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??"",t}};function HS(){return{baseEvent:void 0,stepName:""}}var Ou={encode(e,t=new Se){return e.baseEvent!==void 0&&le.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=HS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.stepName=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ou.fromPartial(e??{})},fromPartial(e){let t=HS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function zS(){return{baseEvent:void 0,stepName:""}}var Pu={encode(e,t=new Se){return e.baseEvent!==void 0&&le.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=zS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.stepName=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Pu.fromPartial(e??{})},fromPartial(e){let t=zS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function WS(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0}}var Nu={encode(e,t=new Se){return e.baseEvent!==void 0&&le.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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=WS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.role=r.string();continue;case 4:if(i!==34)break;o.delta=r.string();continue;case 5:if(i!==42)break;o.name=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Nu.fromPartial(e??{})},fromPartial(e){let t=WS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.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 KS(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var Fu={encode(e,t=new Se){return e.baseEvent!==void 0&&le.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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=KS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.toolCallName=r.string();continue;case 4:if(i!==34)break;o.parentMessageId=r.string();continue;case 5:if(i!==42)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Fu.fromPartial(e??{})},fromPartial(e){let t=KS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.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 YS(){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 XS={encode(e,t=new Se){return e.textMessageStart!==void 0&&yu.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&vu.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&Su.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&bu.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&wu.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&Au.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&xu.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&Cu.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&Eu.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&Ru.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&Iu.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&Tu.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&_u.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&ku.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&Ou.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&Pu.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&Nu.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&Fu.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=YS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.textMessageStart=yu.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.textMessageContent=vu.decode(r,r.uint32());continue;case 3:if(i!==26)break;o.textMessageEnd=Su.decode(r,r.uint32());continue;case 4:if(i!==34)break;o.toolCallStart=bu.decode(r,r.uint32());continue;case 5:if(i!==42)break;o.toolCallArgs=wu.decode(r,r.uint32());continue;case 6:if(i!==50)break;o.toolCallEnd=Au.decode(r,r.uint32());continue;case 7:if(i!==58)break;o.stateSnapshot=xu.decode(r,r.uint32());continue;case 8:if(i!==66)break;o.stateDelta=Cu.decode(r,r.uint32());continue;case 9:if(i!==74)break;o.messagesSnapshot=Eu.decode(r,r.uint32());continue;case 10:if(i!==82)break;o.raw=Ru.decode(r,r.uint32());continue;case 11:if(i!==90)break;o.custom=Iu.decode(r,r.uint32());continue;case 12:if(i!==98)break;o.runStarted=Tu.decode(r,r.uint32());continue;case 13:if(i!==106)break;o.runFinished=_u.decode(r,r.uint32());continue;case 14:if(i!==114)break;o.runError=ku.decode(r,r.uint32());continue;case 15:if(i!==122)break;o.stepStarted=Ou.decode(r,r.uint32());continue;case 16:if(i!==130)break;o.stepFinished=Pu.decode(r,r.uint32());continue;case 17:if(i!==138)break;o.textMessageChunk=Nu.decode(r,r.uint32());continue;case 18:if(i!==146)break;o.toolCallChunk=Fu.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return XS.fromPartial(e??{})},fromPartial(e){let t=YS();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?yu.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?vu.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?Su.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?bu.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?wu.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?Au.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?xu.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?Cu.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?Eu.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?Ru.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?Iu.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?Tu.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?_u.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?ku.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?Ou.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?Pu.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?Nu.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?Fu.fromPartial(e.toolCallChunk):void 0,t}};function tO(e){let t=b.Number(e.toString());if(t>b.Number.MAX_SAFE_INTEGER)throw new b.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(t<b.Number.MIN_SAFE_INTEGER)throw new b.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return t}var nu=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}}},rO=e=>{if(!(!e||typeof e!="object")){if(e.text)return{type:"text",text:e.text.text};if(e.image)return{type:"image",source:nu(e.image.source),metadata:e.image.metadata};if(e.audio)return{type:"audio",source:nu(e.audio.source),metadata:e.audio.metadata};if(e.video)return{type:"video",source:nu(e.video.source),metadata:e.video.metadata};if(e.document)return{type:"document",source:nu(e.document.source),metadata:e.document.metadata}}};function ZS(e){let t=XS.decode(e),r=Object.values(t).find(n=>n!==void 0);if(!r)throw new Error("Invalid event");if(r.type=eO[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 i=o.contentParts.map(a=>rO(a)).filter(a=>a!==void 0);i.length>0&&(o.content=i)}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,i=Array.isArray(n.interrupts)?n.interrupts:[];delete n.interrupts,o==="interrupt"?n.outcome={type:"interrupt",interrupts:i}:o==="success"?n.outcome={type:"success"}:delete n.outcome}if(r.type===M.STATE_DELTA)for(let n of r.delta)n.op=Jk[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]}),wc.parse(r)}var of="application/vnd.ag-ui.event+proto";m();d();f();p();m();d();f();p();m();d();f();p();var oO=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,af=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(oO);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},JS=e=>e==="*"||e==="x"||e==="X",eb=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},iO=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],aO=(e,t)=>{if(JS(e)||JS(t))return 0;let[r,n]=iO(eb(e),eb(t));return r>n?1:r<n?-1:0},sf=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=aO(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var fa=(e,t)=>{let r=af(e),n=af(t),o=r.pop(),i=n.pop(),a=sf(r,n);return a!==0?a:o&&i?sf(o.split("."),i.split(".")):o||i?o?-1:1:0};var Re=e=>{if(typeof structuredClone=="function")return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function ma(){return jr()}function lf(e){if(Object.freeze(e),typeof e=="object"&&e)for(let t of Object.values(e))typeof t=="object"&&t&&!Object.isFrozen(t)&&lf(t);return e}var tb=512*1024;function rb(e,t,r){let n=0,o=[e,t],i=new WeakSet;for(;o.length>0;){let a=o.pop();if(typeof a=="string"){if(n+=a.length,n>r)return!0}else if(typeof a=="object"&&a){if(i.has(a))continue;if(i.add(a),Array.isArray(a))for(let s=0;s<a.length;s++)o.push(a[s]);else{let s=Object.keys(a);for(let c=0;c<s.length;c++){let u=s[c];if(n+=u.length,n>r)return!0;o.push(a[u])}}}}return!1}function Oe(_x88,_x89,_x90,_x91){return _Oe.apply(this,arguments)}function _Oe(){_Oe=_asyncToGenerator(function*(e,t,r,n){let o=typeof process<"u"&&process.env!==void 0,i=o&&!!process.env.VITEST_WORKER_ID,a=o&&!!process.env.VITEST_WORKER_ID,s=a&&!rb(t,r,tb),c=s?Re(t):t,u=s?Re(r):r,g=!1,v=!1,E;for(let y of e)try{s&&(lf(c),lf(u));let h=yield n(y,c,u);if(h===void 0)continue;let S=!1;if(h.messages!==void 0&&h.messages!==c&&(c=Re(h.messages),g=!0,S=!0),h.state!==void 0&&h.state!==u&&(u=Re(h.state),v=!0,S=!0),s&&S&&rb(c,u,tb)&&(s=!1),E=h.stopPropagation,E===!0)break}catch(h){if(a&&h instanceof TypeError){if(i)throw h;console.error("AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.",h)}else i||console.error("Subscriber error:",h);continue}return{...(g?{messages:Object.isFrozen(c)?Re(c):c}:{}),...(v?{state:Object.isFrozen(u)?Re(u):u}:{}),...(E===void 0?{}:{stopPropagation:E})}});return _Oe.apply(this,arguments)}function Du(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 ga(e){if(e instanceof df)return e;if(e===!0)return new df(Du(!0))}var df=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 cf(e){return e.enabled?new df(e):void 0}function sO(e,t,r){if(t){let o=e.find(a=>a.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 i={id:o?r:t,role:"assistant",toolCalls:[]};return e.push(i),i}let n={id:r,role:"assistant",toolCalls:[]};return e.push(n),n}var cb=(e,t,r,n,o)=>{let i=ga(o),a=Re(r.messages),s=Re(e.state),c={},u=v=>{v.messages!==void 0&&(a=v.messages,c.messages=v.messages),v.state!==void 0&&(s=v.state,c.state=v.state)},g=()=>{let v=Re(c);return c={},v.messages!==void 0||v.state!==void 0?Ge(v):jc};return t.pipe(Jc(/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(v){let E=yield Oe(n,a,s,(y,h,S)=>y.onEvent?.({event:v,agent:r,input:e,messages:h,state:S}));if(u(E),E.stopPropagation===!0?i?.event("APPLY","Event dropped:",v,{type:v.type,reason:"stopPropagation by subscriber"}):i?.event("APPLY","Event applied:",v,{type:v.type,subscribers:n.length}),E.stopPropagation===!0)return g();switch(v.type){case M.TEXT_MESSAGE_START:{let y=yield Oe(n,a,s,(h,S,C)=>h.onTextMessageStartEvent?.({event:v,messages:S,state:C,agent:r,input:e}));if(u(y),y.stopPropagation!==!0){let{messageId:h,role:S="assistant",name:C}=v;if(!a.find(R=>R.id===h)){let R={id:h,role:S,content:"",...(C!==void 0&&{name:C})};a.push(R),u({messages:a})}}return g()}case M.TEXT_MESSAGE_CONTENT:{let{messageId:y,delta:h}=v,S=a.find(R=>R.id===y);if(!S)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${y}'`),g();let C=yield Oe(n,a,s,(R,T,I)=>R.onTextMessageContentEvent?.({event:v,messages:T,state:I,agent:r,input:e,textMessageBuffer:typeof S.content=="string"?S.content:""}));return u(C),C.stopPropagation!==!0&&(S.content=`${typeof S.content=="string"?S.content:""}${h}`,u({messages:a})),g()}case M.TEXT_MESSAGE_END:{let{messageId:y}=v,h=a.find(S=>S.id===y);return h?(u(yield Oe(n,a,s,(S,C,R)=>S.onTextMessageEndEvent?.({event:v,messages:C,state:R,agent:r,input:e,textMessageBuffer:typeof h.content=="string"?h.content:""}))),yield Promise.all(n.map(S=>{S.onNewMessage?.({message:h,messages:a,state:s,agent:r,input:e})})),g()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${y}'`),g())}case M.TOOL_CALL_START:{let y=yield Oe(n,a,s,(h,S,C)=>h.onToolCallStartEvent?.({event:v,messages:S,state:C,agent:r,input:e}));if(u(y),y.stopPropagation!==!0){let{toolCallId:h,toolCallName:S,parentMessageId:C}=v,R=sO(a,C,h);R.toolCalls??(R.toolCalls=[]),R.toolCalls.push({id:h,type:"function",function:{name:S,arguments:""}}),u({messages:a})}return g()}case M.TOOL_CALL_ARGS:{let{toolCallId:y,delta:h}=v,S=a.find(T=>T.toolCalls?.some(I=>I.id===y));if(!S)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${y}'`),g();let C=S.toolCalls?.find(T=>T.id===y);if(!C)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${y}'`),g();let R=yield Oe(n,a,s,(T,I,k)=>{let _=C.function.arguments,D=C.function.name,G={};try{G=tu(_)}catch{}return T.onToolCallArgsEvent?.({event:v,messages:I,state:k,agent:r,input:e,toolCallBuffer:_,toolCallName:D,partialToolCallArgs:G})});return u(R),R.stopPropagation!==!0&&(C.function.arguments+=h,u({messages:a})),g()}case M.TOOL_CALL_END:{let{toolCallId:y}=v,h=a.find(C=>C.toolCalls?.some(R=>R.id===y));if(!h)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${y}'`),g();let S=h.toolCalls?.find(C=>C.id===y);return S?(u(yield Oe(n,a,s,(C,R,T)=>{let I=S.function.arguments,k=S.function.name,_={};try{_=JSON.parse(I)}catch{}return C.onToolCallEndEvent?.({event:v,messages:R,state:T,agent:r,input:e,toolCallName:k,toolCallArgs:_})})),yield Promise.all(n.map(C=>{C.onNewToolCall?.({toolCall:S,messages:a,state:s,agent:r,input:e})})),g()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${y}'`),g())}case M.TOOL_CALL_RESULT:{let y=yield Oe(n,a,s,(h,S,C)=>h.onToolCallResultEvent?.({event:v,messages:S,state:C,agent:r,input:e}));if(u(y),y.stopPropagation!==!0){let{messageId:h,toolCallId:S,content:C,role:R}=v,T={id:h,toolCallId:S,role:R||"tool",content:C},I=a.findIndex(k=>k.role==="assistant"&&k.toolCalls?.some(_=>_.id===S));if(I===-1)a.push(T);else{let k=I+1;for(;k<a.length&&a[k].role==="tool";)k++;a.splice(k,0,T)}yield Promise.all(n.map(k=>{k.onNewMessage?.({message:T,messages:a,state:s,agent:r,input:e})})),u({messages:a})}return g()}case M.STATE_SNAPSHOT:{let y=yield Oe(n,a,s,(h,S,C)=>h.onStateSnapshotEvent?.({event:v,messages:S,state:C,agent:r,input:e}));if(u(y),y.stopPropagation!==!0){let{snapshot:h}=v;s=h,u({state:s})}return g()}case M.STATE_DELTA:{let y=yield Oe(n,a,s,(h,S,C)=>h.onStateDeltaEvent?.({event:v,messages:S,state:C,agent:r,input:e}));if(u(y),y.stopPropagation!==!0){let{delta:h}=v;try{s=_c.applyPatch(s,h,!0,!1).newDocument,u({state:s})}catch(S){let C=S instanceof Error?S.message:String(S);console.warn(`Failed to apply state patch:
35
+ `):"",this.name="UnsubscriptionError",this.errors=r}});m();d();f();p();function ca(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Vo=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,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=Sr(a),c=s.next();!c.done;c=s.next()){var u=c.value;u.remove(this)}}catch(S){t={error:S}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var h=this.initialTeardown;if(xe(h))try{h()}catch(S){i=S instanceof Nc?S.errors:[S]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var C=Sr(v),g=C.next();!g.done;g=C.next()){var y=g.value;try{Gv(y)}catch(S){i=i??[],S instanceof Nc?i=Lo(Lo([],jo(i)),jo(S.errors)):i.push(S)}}}catch(S){n={error:S}}finally{try{g&&!g.done&&(o=C.return)&&o.call(C)}finally{if(n)throw n.error}}}if(i)throw new Nc(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Gv(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)&&ca(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&ca(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var jp=Vo.EMPTY;function Fc(e){return e instanceof Vo||e&&"closed"in e&&xe(e.remove)&&xe(e.add)&&xe(e.unsubscribe)}function Gv(e){xe(e)?e():e.unsubscribe()}m();d();f();p();var Vt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};m();d();f();p();m();d();f();p();var Bo={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Bo.delegate;return o?.setTimeout?o.setTimeout.apply(o,Lo([e,t],jo(r))):setTimeout.apply(void 0,Lo([e,t],jo(r)))},clearTimeout:function(e){var t=Bo.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Dc(e){Bo.setTimeout(function(){var t=Vt.onUnhandledError;if(t)t(e);else throw e})}m();d();f();p();function ua(){}m();d();f();p();var $v=function(){return Lp("C",void 0,void 0)}();function Qv(e){return Lp("E",void 0,e)}function Hv(e){return Lp("N",e,void 0)}function Lp(e,t,r){return{kind:e,value:t,error:r}}m();d();f();p();var Nn=null;function Go(e){if(Vt.useDeprecatedSynchronousErrorHandling){var t=!Nn;if(t&&(Nn={errorThrown:!1,error:null}),e(),t){var r=Nn,n=r.errorThrown,o=r.error;if(Nn=null,n)throw o}}else e()}function zv(e){Vt.useDeprecatedSynchronousErrorHandling&&Nn&&(Nn.errorThrown=!0,Nn.error=e)}var la=function(e){tr(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Fc(r)&&r.add(n)):n.destination=Fk,n}return t.create=function(r,n,o){return new qc(r,n,o)},t.prototype.next=function(r){this.isStopped?Vp(Hv(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?Vp(Qv(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?Vp($v,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}(Vo);var Ok=Function.prototype.bind;function Up(e,t){return Ok.call(e,t)}var Pk=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){Mc(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Mc(n)}else Mc(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Mc(r)}},e}(),qc=function(e){tr(t,e);function t(r,n,o){var i=e.call(this)||this,a;if(xe(r)||!r)a={next:r??void 0,error:n??void 0,complete:o??void 0};else{var s;i&&Vt.useDeprecatedNextContext?(s=Object.create(r),s.unsubscribe=function(){return i.unsubscribe()},a={next:r.next&&Up(r.next,s),error:r.error&&Up(r.error,s),complete:r.complete&&Up(r.complete,s)}):a=r}return i.destination=new Pk(a),i}return t}(la);function Mc(e){Vt.useDeprecatedSynchronousErrorHandling?zv(e):Dc(e)}function Nk(e){throw e}function Vp(e,t){var r=Vt.onStoppedNotification;r&&Bo.setTimeout(function(){return r(e,t)})}var Fk={closed:!0,next:ua,error:Nk,complete:ua};m();d();f();p();var $o=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();m();d();f();p();m();d();f();p();function Qo(e){return e}function jc(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Bp(e)}function Bp(e){return e.length===0?Qo:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var Ue=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,i=Mk(t)?t:new qc(t,r,n);return Go(function(){var a=o,s=a.operator,c=a.source;i.add(s?s.call(i,c):c?o._subscribe(i):o._trySubscribe(i))}),i},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=Wv(r),new r(function(o,i){var a=new qc({next:function(s){try{t(s)}catch(c){i(c),a.unsubscribe()}},error:i,complete:o});n.subscribe(a)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[$o]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Bp(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Wv(t),new t(function(n,o){var i;r.subscribe(function(a){return i=a},function(a){return o(a)},function(){return n(i)})})},e.create=function(t){return new e(t)},e}();function Wv(e){var t;return(t=e??Vt.Promise)!==null&&t!==void 0?t:Promise}function Dk(e){return e&&xe(e.next)&&xe(e.error)&&xe(e.complete)}function Mk(e){return e&&e instanceof la||Dk(e)&&Fc(e)}m();d();f();p();function qk(e){return xe(e?.lift)}function ze(e){return function(t){if(qk(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")}}m();d();f();p();function Ye(e,t,r,n,o){return new jk(e,t,r,n,o)}var jk=function(e){tr(t,e);function t(r,n,o,i,a,s){var c=e.call(this,r)||this;return c.onFinalize=a,c.shouldUnsubscribe=s,c._next=n?function(u){try{n(u)}catch(h){r.error(h)}}:e.prototype._next,c._error=i?function(u){try{i(u)}catch(h){r.error(h)}finally{this.unsubscribe()}}:e.prototype._error,c._complete=o?function(){try{o()}catch(u){r.error(u)}finally{this.unsubscribe()}}:e.prototype._complete,c}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}(la);m();d();f();p();m();d();f();p();var Kv=Uo(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var rr=function(e){tr(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 Yv(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Kv},t.prototype.next=function(r){var n=this;Go(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=Sr(n.currentObservers),s=a.next();!s.done;s=a.next()){var c=s.value;c.next(r)}}catch(u){o={error:u}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;Go(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;Go(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,i=o.hasError,a=o.isStopped,s=o.observers;return i||a?jp:(this.currentObservers=null,s.push(r),new Vo(function(){n.currentObservers=null,ca(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,a=n.isStopped;o?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new Ue;return r.source=this,r},t.create=function(r,n){return new Yv(r,n)},t}(Ue);var Yv=function(e){tr(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:jp},t}(rr);m();d();f();p();m();d();f();p();var Gp={now:function(){return(Gp.delegate||Date).now()},delegate:void 0};var Lc=function(e){tr(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=Gp);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(r){var n=this,o=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,s=n._timestampProvider,c=n._windowTime;o||(i.push(r),!a&&i.push(s.now()+c)),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,i=o._infiniteTimeWindow,a=o._buffer,s=a.slice(),c=0;c<s.length&&!r.closed;c+=i?1:2)r.next(s[c]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,i=r._buffer,a=r._infiniteTimeWindow,s=(a?1:2)*n;if(n<1/0&&s<i.length&&i.splice(0,i.length-s),!a){for(var c=o.now(),u=0,h=1;h<i.length&&i[h]<=c;h+=2)u=h;u&&i.splice(0,u+1)}},t}(rr);m();d();f();p();var Uc=new Ue(function(e){return e.complete()});m();d();f();p();m();d();f();p();m();d();f();p();function Xv(e){return e&&xe(e.schedule)}function Lk(e){return e[e.length-1]}function Zv(e){return Xv(Lk(e))?e.pop():void 0}m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var Vc=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};m();d();f();p();function Bc(e){return xe(e?.then)}m();d();f();p();function Gc(e){return xe(e[$o])}m();d();f();p();function $c(e){return Symbol.asyncIterator&&xe(e?.[Symbol.asyncIterator])}m();d();f();p();function Qc(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.")}m();d();f();p();m();d();f();p();function Uk(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Hc=Uk();function zc(e){return xe(e?.[Hc])}m();d();f();p();function Wc(e){return Vv(this,arguments,function(){var r,n,o,i;return Pc(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Pn(r.read())];case 3:return n=a.sent(),o=n.value,i=n.done,i?[4,Pn(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Pn(o)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Kc(e){return xe(e?.getReader)}function Xe(e){if(e instanceof Ue)return e;if(e!=null){if(Gc(e))return Vk(e);if(Vc(e))return Bk(e);if(Bc(e))return Gk(e);if($c(e))return Jv(e);if(zc(e))return $k(e);if(Kc(e))return Qk(e)}throw Qc(e)}function Vk(e){return new Ue(function(t){var r=e[$o]();if(xe(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Bk(e){return new Ue(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function Gk(e){return new Ue(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Dc)})}function $k(e){return new Ue(function(t){var r,n;try{for(var o=Sr(e),i=o.next();!i.done;i=o.next()){var a=i.value;if(t.next(a),t.closed)return}}catch(s){r={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function Jv(e){return new Ue(function(t){Hk(e,t).catch(function(r){return t.error(r)})})}function Qk(e){return Jv(Wc(e))}function Hk(e,t){var r,n,o,i;return Uv(this,void 0,void 0,function(){var a,s;return Pc(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=Bv(e),c.label=1;case 1:return[4,r.next()];case 2:if(n=c.sent(),!!n.done)return[3,4];if(a=n.value,t.next(a),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),o={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(i=r.return)?[4,i.call(r)]:[3,8];case 7:c.sent(),c.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]}})})}m();d();f();p();m();d();f();p();function Ft(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var i=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(i),!o)return i}function Yc(e,t){return t===void 0&&(t=0),ze(function(r,n){r.subscribe(Ye(n,function(o){return Ft(n,e,function(){return n.next(o)},t)},function(){return Ft(n,e,function(){return n.complete()},t)},function(o){return Ft(n,e,function(){return n.error(o)},t)}))})}m();d();f();p();function Xc(e,t){return t===void 0&&(t=0),ze(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function eS(e,t){return Xe(e).pipe(Xc(t),Yc(t))}m();d();f();p();function tS(e,t){return Xe(e).pipe(Xc(t),Yc(t))}m();d();f();p();function rS(e,t){return new Ue(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}m();d();f();p();function nS(e,t){return new Ue(function(r){var n;return Ft(r,t,function(){n=e[Hc](),Ft(r,t,function(){var o,i,a;try{o=n.next(),i=o.value,a=o.done}catch(s){r.error(s);return}a?r.complete():r.next(i)},0,!0)}),function(){return xe(n?.return)&&n.return()}})}m();d();f();p();function Zc(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ue(function(r){Ft(r,t,function(){var n=e[Symbol.asyncIterator]();Ft(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}m();d();f();p();function oS(e,t){return Zc(Wc(e),t)}function iS(e,t){if(e!=null){if(Gc(e))return eS(e,t);if(Vc(e))return rS(e,t);if(Bc(e))return tS(e,t);if($c(e))return Zc(e,t);if(zc(e))return nS(e,t);if(Kc(e))return oS(e,t)}throw Qc(e)}function Fn(e,t){return t?iS(e,t):Xe(e)}function Ge(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Zv(e);return Fn(e,r)}m();d();f();p();function Ve(e,t){var r=xe(e)?e:function(){return e},n=function(o){return o.error(r())};return new Ue(t?function(o){return t.schedule(n,0,o)}:n)}m();d();f();p();m();d();f();p();var aS=Uo(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function Jc(e,t){var r=typeof t=="object";return new Promise(function(n,o){var i=!1,a;e.subscribe({next:function(s){a=s,i=!0},error:o,complete:function(){i?n(a):r?n(t.defaultValue):o(new aS)}})})}m();d();f();p();function Dn(e,t){return ze(function(r,n){var o=0;r.subscribe(Ye(n,function(i){n.next(e.call(t,i,o++))}))})}m();d();f();p();m();d();f();p();m();d();f();p();function sS(e,t,r,n,o,i,a,s){var c=[],u=0,h=0,v=!1,C=function(){v&&!c.length&&!u&&t.complete()},g=function(S){return u<n?y(S):c.push(S)},y=function(S){i&&t.next(S),u++;var E=!1;Xe(r(S,h++)).subscribe(Ye(t,function(R){o?.(R),i?g(R):t.next(R)},function(){E=!0},void 0,function(){if(E)try{u--;for(var R=function(){var k=c.shift();a?Ft(t,a,function(){return y(k)}):y(k)};c.length&&u<n;)R();C()}catch(k){t.error(k)}}))};return e.subscribe(Ye(t,g,function(){v=!0,C()})),function(){s?.()}}function wt(e,t,r){return r===void 0&&(r=1/0),xe(t)?wt(function(n,o){return Dn(function(i,a){return t(n,i,o,a)})(Xe(e(n,o)))},r):(typeof t=="number"&&(r=t),ze(function(n,o){return sS(n,o,e,r)}))}function $p(e){return e===void 0&&(e=1/0),wt(Qo,e)}m();d();f();p();function eu(e){return new Ue(function(t){Xe(e()).subscribe(t)})}m();d();f();p();function da(e){return ze(function(t,r){var n=null,o=!1,i;n=t.subscribe(Ye(r,void 0,void 0,function(a){i=Xe(e(a,da(e)(t))),n?(n.unsubscribe(),n=null,i.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,i.subscribe(r))})}m();d();f();p();function tu(e,t){return xe(t)?wt(e,t,1):wt(e,1)}m();d();f();p();function Qp(e){return ze(function(t,r){var n=!1;t.subscribe(Ye(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}m();d();f();p();function Mn(e){return ze(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}m();d();f();p();function Hp(e,t){return ze(function(r,n){var o=null,i=0,a=!1,s=function(){return a&&!o&&n.complete()};r.subscribe(Ye(n,function(c){o?.unsubscribe();var u=0,h=i++;Xe(e(c,h)).subscribe(o=Ye(n,function(v){return n.next(t?t(c,v,h,u++):v)},function(){o=null,s()}))},function(){a=!0,s()}))})}m();d();f();p();function ru(e){return ze(function(t,r){Xe(e).subscribe(Ye(r,function(){return r.complete()},ua)),!r.closed&&t.subscribe(r)})}m();d();f();p();function zp(e,t,r){var n=xe(e)||t||r?{next:e,error:t,complete:r}:e;return n?ze(function(o,i){var a;(a=n.subscribe)===null||a===void 0||a.call(n);var s=!0;o.subscribe(Ye(i,function(c){var u;(u=n.next)===null||u===void 0||u.call(n,c),i.next(c)},function(){var c;s=!1,(c=n.complete)===null||c===void 0||c.call(n),i.complete()},function(c){var u;s=!1,(u=n.error)===null||u===void 0||u.call(n,c),i.error(c)},function(){var c,u;s&&((c=n.unsubscribe)===null||c===void 0||c.call(n)),(u=n.finalize)===null||u===void 0||u.call(n)}))}):Qo}m();d();f();p();m();d();f();p();function cS(e){return` \r
36
+ `.indexOf(e)>=0}function nu(e){for(var t=["topLevel"],r=0,n,o,i,a=function(k){return t.push(k)},s=function(k){return t[t.length-1]=k},c=function(k){n==null&&(n=r,o=t.length,i=k)},u=function(k){k===i&&(n=void 0,o=void 0,i=void 0)},h=function(){return t.pop()},v=function(){return r--},C=function(k){if("0"<=k&&k<="9"){a("number");return}switch(k){case"\"":a("string");return;case"-":a("numberNeedsDigit");return;case"t":a("true");return;case"f":a("false");return;case"n":a("null");return;case"[":a("arrayNeedsValue");return;case"{":a("objectNeedsKey");return}},g=e.length;r<g;r++){var y=e[r];switch(t[t.length-1]){case"topLevel":C(y);break;case"string":switch(y){case"\"":h();break;case"\\":c("stringEscape"),a("stringEscaped");break}break;case"stringEscaped":y==="u"?a("stringUnicode"):(u("stringEscape"),h());break;case"stringUnicode":r-e.lastIndexOf("u",r)===4&&(u("stringEscape"),h());break;case"number":y==="."?s("numberNeedsDigit"):y==="e"||y==="E"?s("numberNeedsExponent"):(y<"0"||y>"9")&&(v(),h());break;case"numberNeedsDigit":s("number");break;case"numberNeedsExponent":s(y==="+"||y==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(y<"a"||y>"z")&&(v(),h());break;case"arrayNeedsValue":y==="]"?h():cS(y)||(u("collectionItem"),s("arrayNeedsComma"),C(y));break;case"arrayNeedsComma":y==="]"?h():y===","&&(c("collectionItem"),s("arrayNeedsValue"));break;case"objectNeedsKey":y==="}"?h():y==="\""&&(c("collectionItem"),s("objectNeedsColon"),a("string"));break;case"objectNeedsColon":y===":"&&s("objectNeedsValue");break;case"objectNeedsValue":cS(y)||(u("collectionItem"),s("objectNeedsComma"),C(y));break;case"objectNeedsComma":y==="}"?h():y===","&&(c("collectionItem"),s("objectNeedsKey"));break}}o!=null&&(t.length=o);for(var S=[n!=null?e.slice(0,n):e],E=function(k){return S.push(k.slice(e.length-e.lastIndexOf(k[0])))},R=t.length-1;R>=0;R--)switch(t[R]){case"string":S.push("\"");break;case"numberNeedsDigit":case"numberNeedsExponent":S.push("0");break;case"true":E("true");break;case"false":E("false");break;case"null":E("null");break;case"arrayNeedsValue":case"arrayNeedsComma":S.push("]");break;case"objectNeedsKey":case"objectNeedsColon":case"objectNeedsValue":case"objectNeedsComma":S.push("}");break}return S.join("")}m();d();f();p();m();d();f();p();m();d();f();p();function lS(){let e=this.buf,t=this.pos,r=0,n=0;for(let i=0;i<28;i+=7){let a=e[t++];if(r|=(a&127)<<i,(a&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 i=3;i<=31;i+=7){let a=e[t++];if(n|=(a&127)<<i,(a&128)==0){this.pos=t,this.assertBounds(),this.varint64Lo=r,this.varint64Hi=n;return}}throw new Error("invalid varint")}var ou=4294967296;function Wp(e){let t=e[0]==="-";t&&(e=e.slice(1));let r=1e6,n=0,o=0;function i(a,s){let c=Number(e.slice(a,s));o*=r,n=n*r+c,n>=ou&&(o=o+(n/ou|0),n=n%ou)}return i(-24,-18),i(-18,-12),i(-12,-6),i(-6),t?pS(n,o):Yp(n,o)}function dS(e,t){let r=Yp(e,t),n=r.hi&2147483648;n&&(r=pS(r.lo,r.hi));let o=Kp(r.lo,r.hi);return n?"-"+o:o}function Kp(e,t){if({lo:e,hi:t}=zk(e,t),t<=2097151)return String(ou*t+e);let r=e&16777215,n=(e>>>24|t<<8)&16777215,o=t>>16&65535,i=r+n*6777216+o*6710656,a=n+o*8147497,s=o*2,c=1e7;return i>=c&&(a+=Math.floor(i/c),i%=c),a>=c&&(s+=Math.floor(a/c),a%=c),s.toString()+uS(a)+uS(i)}function zk(e,t){return{lo:e>>>0,hi:t>>>0}}function Yp(e,t){return{lo:e|0,hi:t|0}}function pS(e,t){return t=~t,e?e=~e+1:t+=1,Yp(e,t)}var uS=e=>{let t=String(e);return"0000000".slice(t.length)+t};function fS(){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}m();d();f();p();var Bt=Wk();function Wk(){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"&&(!!w.Deno||!!w.Bun||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let r=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),o=BigInt("0"),i=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(a){let s=typeof a=="bigint"?a:BigInt(a);if(s>n||s<r)throw new Error(`invalid int64: ${a}`);return s},uParse(a){let s=typeof a=="bigint"?a:BigInt(a);if(s>i||s<o)throw new Error(`invalid uint64: ${a}`);return s},enc(a){return e.setBigInt64(0,this.parse(a),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(a){return e.setBigInt64(0,this.uParse(a),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(a,s){return e.setInt32(0,a,!0),e.setInt32(4,s,!0),e.getBigInt64(0,!0)},uDec(a,s){return e.setInt32(0,a,!0),e.setInt32(4,s,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),mS(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),gS(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),mS(r),Wp(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),gS(r),Wp(r)},dec(r,n){return dS(r,n)},uDec(r,n){return Kp(r,n)}}}function mS(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function gS(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}m();d();f();p();var Xp=Symbol.for("@bufbuild/protobuf/text-encoding");function Kk(e){var t;w[Xp]=Object.assign(Object.assign({},e),{encodeUtf8Into:(t=e.encodeUtf8Into)!==null&&t!==void 0?t:Jp(e.encodeUtf8.bind(e))})}function Zp(){let e=w;if(!e[Xp]){let t=new e.TextEncoder,r=new e.TextDecoder,n,o={encodeUtf8(a){return t.encode(a)},decodeUtf8(a,s){return s?(n||(n=new e.TextDecoder("utf-8",{fatal:!0})),n.decode(a)):r.decode(a)},checkUtf8(a){try{return encodeURIComponent(a),!0}catch{return!1}}};t.encodeInto&&(o.encodeUtf8Into=t.encodeInto.bind(t));let i=String.prototype.isWellFormed;i&&(o.checkUtf8=a=>i.call(a)),Kk(o)}return e[Xp]}function Jp(e){return(t,r)=>{let n=e(t);return r.set(n),{written:n.byteLength}}}var Gr;(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"})(Gr||(Gr={}));var Yk=34028234663852886e22,Xk=-34028234663852886e22,Zk=4294967295,Jk=2147483647,eO=-2147483648,ve=class{constructor(t){this.stackPos=[],this.encodeUtf8Into=t?Jp(t):Zp().encodeUtf8Into,this.buffer=yS,this.viewCache=rO,this.pos=0}ensureCapacity(t){let r=this.pos+t;if(r>this.buffer.length){let n=this.buffer.length||tO;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(pa),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-pa,n=ef(r);return n>pa&&(this.ensureCapacity(n-pa),this.buffer.copyWithin(t+n,t+pa,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(hS(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(tf(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<=vS){this.ensureCapacity(r+1);let c=this.buffer,u=this.pos;c[u++]=r;let h=0;for(;h<r;h++){let v=t.charCodeAt(h);if(v>127)break;c[u++]=v}if(h==r)return this.pos=u,this}this.ensureCapacity(r*3+5);let n=ef(r),o=this.buffer,i=this.pos,{written:a}=this.encodeUtf8Into(t,o.subarray(i+n)),s=ef(a);return s!=n&&o.copyWithin(i+s,i+n,i+n+a),this.uint32(a),this.pos+=a,this}float(t){return nO(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 hS(t),this.ensureCapacity(4),this.view().setUint32(this.pos,t,!0),this.pos+=4,this}sfixed32(t){return tf(t),this.ensureCapacity(4),this.view().setInt32(this.pos,t,!0),this.pos+=4,this}sint32(t){return tf(t),this.uint32((t<<1^t>>31)>>>0)}sfixed64(t){let r=Bt.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=Bt.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=Bt.enc(t);return this.writeVarint64(r.lo,r.hi)}sint64(t){let r=Bt.enc(t),n=r.hi>>31,o=r.lo<<1^n,i=(r.hi<<1|r.lo>>>31)^n;return this.writeVarint64(o,i)}uint64(t){let r=Bt.uEnc(t);return this.writeVarint64(r.lo,r.hi)}writeVarint64(t,r){this.ensureCapacity(10);let n=this.buffer,o=this.pos;for(let s=0;s<28;s=s+7){let c=t>>>s,u=!(!(c>>>7)&&r==0);if(n[o++]=(u?c|128:c)&255,!u)return this.pos=o,this}let i=t>>>28&15|(r&7)<<4,a=r>>3!=0;if(n[o++]=(a?i|128:i)&255,!a)return this.pos=o,this;for(let s=3;s<31;s=s+7){let c=r>>>s,u=!!(c>>>7);if(n[o++]=(u?c|128:c)&255,!u)return this.pos=o,this}return n[o++]=r>>>31&1,this.pos=o,this}},tO=128,pa=1,yS=new Uint8Array(0),rO=new DataView(yS.buffer),vS=32;function ef(e){return e<128?1:e<16384?2:e<2097152?3:e<268435456?4:5}var J=class{constructor(t,r=Zp().decodeUtf8){this.decodeUtf8=r,this.varint64Lo=0,this.varint64Hi=0,this.varint64=lS,this.uint32=fS,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,i=r&7;if(o<=0||i>5)throw new Error("illegal tag: field no "+o+" wire type "+i);return[o,i]}skip(t,r,n=100){let o=this.pos;switch(t){case Gr.Varint:for(;this.buf[this.pos++]&128;);break;case Gr.Bit64:this.pos+=4;case Gr.Bit32:this.pos+=4;break;case Gr.LengthDelimited:let i=this.uint32();this.pos+=i;break;case Gr.StartGroup:if(n<=0)throw new Error("maximum recursion depth reached");for(;;){let[a,s]=this.tag();if(s===Gr.EndGroup){if(r!==void 0&&a!==r)throw new Error("invalid end group tag");break}this.skip(s,a,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(),Bt.dec(this.varint64Lo,this.varint64Hi)}uint64(){return this.varint64(),Bt.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,Bt.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 Bt.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Bt.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<=vS){let o=new Array(n);for(let i=0;i<n;i++){let a=r[i];if(a>127)return this.decodeUtf8(r,t);o[i]=a}return String.fromCharCode.apply(String,o)}return this.decodeUtf8(r,t)}};function tf(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>Jk||e<eO)throw new Error("invalid int32: "+e)}function hS(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>Zk||e<0)throw new Error("invalid uint32: "+e)}function nO(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>Yk||e<Xk))throw new Error("invalid float32: "+e)}var oO=function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function rf(){return{fields:{}}}var fa={encode(e,t=new ve){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&af.encode({key:r,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=rf();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;let a=af.decode(r,r.uint32());a.value!==void 0&&(o.fields[a.key]=a.value);continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return fa.fromPartial(e??{})},fromPartial(e){let t=rf();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,o])=>(o!==void 0&&(r[n]=o),r),{}),t},wrap(e){let t=rf();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 SS(){return{key:"",value:void 0}}var af={encode(e,t=new ve){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&ce.encode(ce.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=SS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.key=r.string();continue;case 2:if(i!==18)break;o.value=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return af.fromPartial(e??{})},fromPartial(e){let t=SS();return t.key=e.key??"",t.value=e.value??void 0,t}};function nf(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var ce={encode(e,t=new ve){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&&fa.encode(fa.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&ma.encode(ma.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=nf();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.nullValue=r.int32();continue;case 2:if(i!==17)break;o.numberValue=r.double();continue;case 3:if(i!==26)break;o.stringValue=r.string();continue;case 4:if(i!==32)break;o.boolValue=r.bool();continue;case 5:if(i!==42)break;o.structValue=fa.unwrap(fa.decode(r,r.uint32()));continue;case 6:if(i!==50)break;o.listValue=ma.unwrap(ma.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return ce.fromPartial(e??{})},fromPartial(e){let t=nf();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=nf();if(e===null)t.nullValue=oO.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(w.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new w.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 of(){return{values:[]}}var ma={encode(e,t=new ve){for(let r of e.values)ce.encode(ce.wrap(r),t.uint32(10).fork()).join();return t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=of();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.values.push(ce.unwrap(ce.decode(r,r.uint32())));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return ma.fromPartial(e??{})},fromPartial(e){let t=of();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=of();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&w.Array.isArray(e.values)?e.values:e}},iO=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 bS(){return{op:0,path:"",from:void 0,value:void 0}}var au={encode(e,t=new ve){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&&ce.encode(ce.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=bS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.op=r.int32();continue;case 2:if(i!==18)break;o.path=r.string();continue;case 3:if(i!==26)break;o.from=r.string();continue;case 4:if(i!==34)break;o.value=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return au.fromPartial(e??{})},fromPartial(e){let t=bS();return t.op=e.op??0,t.path=e.path??"",t.from=e.from??void 0,t.value=e.value??void 0,t}};function wS(){return{id:"",type:"",function:void 0}}var su={encode(e,t=new ve){return e.id!==""&&t.uint32(10).string(e.id),e.type!==""&&t.uint32(18).string(e.type),e.function!==void 0&&cu.encode(e.function,t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=wS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.id=r.string();continue;case 2:if(i!==18)break;o.type=r.string();continue;case 3:if(i!==26)break;o.function=cu.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return su.fromPartial(e??{})},fromPartial(e){let t=wS();return t.id=e.id??"",t.type=e.type??"",t.function=e.function!==void 0&&e.function!==null?cu.fromPartial(e.function):void 0,t}};function AS(){return{name:"",arguments:""}}var cu={encode(e,t=new ve){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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=AS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.name=r.string();continue;case 2:if(i!==18)break;o.arguments=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return cu.fromPartial(e??{})},fromPartial(e){let t=AS();return t.name=e.name??"",t.arguments=e.arguments??"",t}};function xS(){return{value:"",mimeType:""}}var uu={encode(e,t=new ve){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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=xS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.value=r.string();continue;case 2:if(i!==18)break;o.mimeType=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return uu.fromPartial(e??{})},fromPartial(e){let t=xS();return t.value=e.value??"",t.mimeType=e.mimeType??"",t}};function CS(){return{value:"",mimeType:void 0}}var lu={encode(e,t=new ve){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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=CS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.value=r.string();continue;case 2:if(i!==18)break;o.mimeType=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return lu.fromPartial(e??{})},fromPartial(e){let t=CS();return t.value=e.value??"",t.mimeType=e.mimeType??void 0,t}};function ES(){return{data:void 0,url:void 0}}var Et={encode(e,t=new ve){return e.data!==void 0&&uu.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&lu.encode(e.url,t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=ES();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.data=uu.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.url=lu.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Et.fromPartial(e??{})},fromPartial(e){let t=ES();return t.data=e.data!==void 0&&e.data!==null?uu.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?lu.fromPartial(e.url):void 0,t}};function RS(){return{text:""}}var du={encode(e,t=new ve){return e.text!==""&&t.uint32(10).string(e.text),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=RS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.text=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return du.fromPartial(e??{})},fromPartial(e){let t=RS();return t.text=e.text??"",t}};function IS(){return{source:void 0,metadata:void 0}}var pu={encode(e,t=new ve){return e.source!==void 0&&Et.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&ce.encode(ce.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=IS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.source=Et.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.metadata=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return pu.fromPartial(e??{})},fromPartial(e){let t=IS();return t.source=e.source!==void 0&&e.source!==null?Et.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function TS(){return{source:void 0,metadata:void 0}}var fu={encode(e,t=new ve){return e.source!==void 0&&Et.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&ce.encode(ce.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=TS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.source=Et.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.metadata=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return fu.fromPartial(e??{})},fromPartial(e){let t=TS();return t.source=e.source!==void 0&&e.source!==null?Et.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function _S(){return{source:void 0,metadata:void 0}}var mu={encode(e,t=new ve){return e.source!==void 0&&Et.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&ce.encode(ce.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=_S();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.source=Et.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.metadata=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return mu.fromPartial(e??{})},fromPartial(e){let t=_S();return t.source=e.source!==void 0&&e.source!==null?Et.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function kS(){return{source:void 0,metadata:void 0}}var gu={encode(e,t=new ve){return e.source!==void 0&&Et.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&ce.encode(ce.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=kS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.source=Et.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.metadata=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return gu.fromPartial(e??{})},fromPartial(e){let t=kS();return t.source=e.source!==void 0&&e.source!==null?Et.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function OS(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var hu={encode(e,t=new ve){return e.text!==void 0&&du.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&pu.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&fu.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&mu.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&gu.encode(e.document,t.uint32(42).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=OS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.text=du.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.image=pu.decode(r,r.uint32());continue;case 3:if(i!==26)break;o.audio=fu.decode(r,r.uint32());continue;case 4:if(i!==34)break;o.video=mu.decode(r,r.uint32());continue;case 5:if(i!==42)break;o.document=gu.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return hu.fromPartial(e??{})},fromPartial(e){let t=OS();return t.text=e.text!==void 0&&e.text!==null?du.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?pu.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?fu.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?mu.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?gu.fromPartial(e.document):void 0,t}};function PS(){return{id:"",role:"",content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[]}}var yu={encode(e,t=new ve){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)su.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)hu.encode(r,t.uint32(66).fork()).join();return t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=PS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.id=r.string();continue;case 2:if(i!==18)break;o.role=r.string();continue;case 3:if(i!==26)break;o.content=r.string();continue;case 4:if(i!==34)break;o.name=r.string();continue;case 5:if(i!==42)break;o.toolCalls.push(su.decode(r,r.uint32()));continue;case 6:if(i!==50)break;o.toolCallId=r.string();continue;case 7:if(i!==58)break;o.error=r.string();continue;case 8:if(i!==66)break;o.contentParts.push(hu.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return yu.fromPartial(e??{})},fromPartial(e){let t=PS();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=>su.fromPartial(r))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(r=>hu.fromPartial(r))||[],t}};function NS(){return{id:"",reason:"",message:void 0,toolCallId:void 0,responseSchema:void 0,expiresAt:void 0,metadata:void 0}}var vu={encode(e,t=new ve){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&&ce.encode(ce.wrap(e.responseSchema),t.uint32(42).fork()).join(),e.expiresAt!==void 0&&t.uint32(50).string(e.expiresAt),e.metadata!==void 0&&ce.encode(ce.wrap(e.metadata),t.uint32(58).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=NS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.id=r.string();continue;case 2:if(i!==18)break;o.reason=r.string();continue;case 3:if(i!==26)break;o.message=r.string();continue;case 4:if(i!==34)break;o.toolCallId=r.string();continue;case 5:if(i!==42)break;o.responseSchema=ce.unwrap(ce.decode(r,r.uint32()));continue;case 6:if(i!==50)break;o.expiresAt=r.string();continue;case 7:if(i!==58)break;o.metadata=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return vu.fromPartial(e??{})},fromPartial(e){let t=NS();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}},aO=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 FS(){return{type:0,timestamp:void 0,rawEvent:void 0}}var le={encode(e,t=new ve){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&ce.encode(ce.wrap(e.rawEvent),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=FS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.type=r.int32();continue;case 2:if(i!==16)break;o.timestamp=Ho(r.int64());continue;case 3:if(i!==26)break;o.rawEvent=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return le.fromPartial(e??{})},fromPartial(e){let t=FS();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function DS(){return{baseEvent:void 0,messageId:"",role:void 0,name:void 0}}var Su={encode(e,t=new ve){return e.baseEvent!==void 0&&le.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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=DS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.role=r.string();continue;case 4:if(i!==34)break;o.name=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Su.fromPartial(e??{})},fromPartial(e){let t=DS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.role=e.role??void 0,t.name=e.name??void 0,t}};function MS(){return{baseEvent:void 0,messageId:"",delta:""}}var bu={encode(e,t=new ve){return e.baseEvent!==void 0&&le.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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=MS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return bu.fromPartial(e??{})},fromPartial(e){let t=MS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.delta=e.delta??"",t}};function qS(){return{baseEvent:void 0,messageId:""}}var wu={encode(e,t=new ve){return e.baseEvent!==void 0&&le.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=qS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return wu.fromPartial(e??{})},fromPartial(e){let t=qS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t}};function jS(){return{baseEvent:void 0,toolCallId:"",toolCallName:"",parentMessageId:void 0}}var Au={encode(e,t=new ve){return e.baseEvent!==void 0&&le.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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=jS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.toolCallName=r.string();continue;case 4:if(i!==34)break;o.parentMessageId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Au.fromPartial(e??{})},fromPartial(e){let t=jS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.toolCallName=e.toolCallName??"",t.parentMessageId=e.parentMessageId??void 0,t}};function LS(){return{baseEvent:void 0,toolCallId:"",delta:""}}var xu={encode(e,t=new ve){return e.baseEvent!==void 0&&le.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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=LS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return xu.fromPartial(e??{})},fromPartial(e){let t=LS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.delta=e.delta??"",t}};function US(){return{baseEvent:void 0,toolCallId:""}}var Cu={encode(e,t=new ve){return e.baseEvent!==void 0&&le.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=US();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Cu.fromPartial(e??{})},fromPartial(e){let t=US();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t}};function VS(){return{baseEvent:void 0,snapshot:void 0}}var Eu={encode(e,t=new ve){return e.baseEvent!==void 0&&le.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&ce.encode(ce.wrap(e.snapshot),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=VS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.snapshot=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Eu.fromPartial(e??{})},fromPartial(e){let t=VS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function BS(){return{baseEvent:void 0,delta:[]}}var Ru={encode(e,t=new ve){e.baseEvent!==void 0&&le.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.delta)au.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=BS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.delta.push(au.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ru.fromPartial(e??{})},fromPartial(e){let t=BS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(r=>au.fromPartial(r))||[],t}};function GS(){return{baseEvent:void 0,messages:[]}}var Iu={encode(e,t=new ve){e.baseEvent!==void 0&&le.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.messages)yu.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=GS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messages.push(yu.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Iu.fromPartial(e??{})},fromPartial(e){let t=GS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(r=>yu.fromPartial(r))||[],t}};function $S(){return{baseEvent:void 0,event:void 0,source:void 0}}var Tu={encode(e,t=new ve){return e.baseEvent!==void 0&&le.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&ce.encode(ce.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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=$S();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.event=ce.unwrap(ce.decode(r,r.uint32()));continue;case 3:if(i!==26)break;o.source=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Tu.fromPartial(e??{})},fromPartial(e){let t=$S();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function QS(){return{baseEvent:void 0,name:"",value:void 0}}var _u={encode(e,t=new ve){return e.baseEvent!==void 0&&le.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==""&&t.uint32(18).string(e.name),e.value!==void 0&&ce.encode(ce.wrap(e.value),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=QS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.name=r.string();continue;case 3:if(i!==26)break;o.value=ce.unwrap(ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return _u.fromPartial(e??{})},fromPartial(e){let t=QS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.name=e.name??"",t.value=e.value??void 0,t}};function HS(){return{baseEvent:void 0,threadId:"",runId:""}}var ku={encode(e,t=new ve){return e.baseEvent!==void 0&&le.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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=HS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.threadId=r.string();continue;case 3:if(i!==26)break;o.runId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return ku.fromPartial(e??{})},fromPartial(e){let t=HS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t}};function zS(){return{provider:void 0,model:void 0,inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0}}var qn={encode(e,t=new ve){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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=zS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.provider=r.string();continue;case 2:if(i!==18)break;o.model=r.string();continue;case 3:if(i!==24)break;o.inputTokens=Ho(r.int64());continue;case 4:if(i!==32)break;o.outputTokens=Ho(r.int64());continue;case 5:if(i!==40)break;o.totalTokens=Ho(r.int64());continue;case 6:if(i!==48)break;o.reasoningTokens=Ho(r.int64());continue;case 7:if(i!==56)break;o.cachedInputTokens=Ho(r.int64());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return qn.fromPartial(e??{})},fromPartial(e){let t=zS();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 WS(){return{baseEvent:void 0,threadId:"",runId:"",result:void 0,outcome:"",interrupts:[],usage:[]}}var Ou={encode(e,t=new ve){e.baseEvent!==void 0&&le.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&&ce.encode(ce.wrap(e.result),t.uint32(34).fork()).join(),e.outcome!==""&&t.uint32(42).string(e.outcome);for(let r of e.interrupts)vu.encode(r,t.uint32(50).fork()).join();for(let r of e.usage)qn.encode(r,t.uint32(58).fork()).join();return t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=WS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.threadId=r.string();continue;case 3:if(i!==26)break;o.runId=r.string();continue;case 4:if(i!==34)break;o.result=ce.unwrap(ce.decode(r,r.uint32()));continue;case 5:if(i!==42)break;o.outcome=r.string();continue;case 6:if(i!==50)break;o.interrupts.push(vu.decode(r,r.uint32()));continue;case 7:if(i!==58)break;o.usage.push(qn.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ou.fromPartial(e??{})},fromPartial(e){let t=WS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.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=>vu.fromPartial(r))||[],t.usage=e.usage?.map(r=>qn.fromPartial(r))||[],t}};function KS(){return{baseEvent:void 0,code:void 0,message:"",usage:[]}}var Pu={encode(e,t=new ve){e.baseEvent!==void 0&&le.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)qn.encode(r,t.uint32(34).fork()).join();return t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=KS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.code=r.string();continue;case 3:if(i!==26)break;o.message=r.string();continue;case 4:if(i!==34)break;o.usage.push(qn.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Pu.fromPartial(e??{})},fromPartial(e){let t=KS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??"",t.usage=e.usage?.map(r=>qn.fromPartial(r))||[],t}};function YS(){return{baseEvent:void 0,stepName:""}}var Nu={encode(e,t=new ve){return e.baseEvent!==void 0&&le.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=YS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.stepName=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Nu.fromPartial(e??{})},fromPartial(e){let t=YS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function XS(){return{baseEvent:void 0,stepName:""}}var Fu={encode(e,t=new ve){return e.baseEvent!==void 0&&le.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=XS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.stepName=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Fu.fromPartial(e??{})},fromPartial(e){let t=XS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function ZS(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0}}var Du={encode(e,t=new ve){return e.baseEvent!==void 0&&le.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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=ZS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.role=r.string();continue;case 4:if(i!==34)break;o.delta=r.string();continue;case 5:if(i!==42)break;o.name=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Du.fromPartial(e??{})},fromPartial(e){let t=ZS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.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 JS(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var Mu={encode(e,t=new ve){return e.baseEvent!==void 0&&le.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 J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=JS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=le.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.toolCallName=r.string();continue;case 4:if(i!==34)break;o.parentMessageId=r.string();continue;case 5:if(i!==42)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Mu.fromPartial(e??{})},fromPartial(e){let t=JS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?le.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 eb(){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 tb={encode(e,t=new ve){return e.textMessageStart!==void 0&&Su.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&bu.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&wu.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&Au.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&xu.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&Cu.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&Eu.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&Ru.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&Iu.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&Tu.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&_u.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&ku.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&Ou.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&Pu.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&Nu.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&Fu.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&Du.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&Mu.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t},decode(e,t){let r=e instanceof J?e:new J(e),n=t===void 0?r.len:r.pos+t,o=eb();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.textMessageStart=Su.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.textMessageContent=bu.decode(r,r.uint32());continue;case 3:if(i!==26)break;o.textMessageEnd=wu.decode(r,r.uint32());continue;case 4:if(i!==34)break;o.toolCallStart=Au.decode(r,r.uint32());continue;case 5:if(i!==42)break;o.toolCallArgs=xu.decode(r,r.uint32());continue;case 6:if(i!==50)break;o.toolCallEnd=Cu.decode(r,r.uint32());continue;case 7:if(i!==58)break;o.stateSnapshot=Eu.decode(r,r.uint32());continue;case 8:if(i!==66)break;o.stateDelta=Ru.decode(r,r.uint32());continue;case 9:if(i!==74)break;o.messagesSnapshot=Iu.decode(r,r.uint32());continue;case 10:if(i!==82)break;o.raw=Tu.decode(r,r.uint32());continue;case 11:if(i!==90)break;o.custom=_u.decode(r,r.uint32());continue;case 12:if(i!==98)break;o.runStarted=ku.decode(r,r.uint32());continue;case 13:if(i!==106)break;o.runFinished=Ou.decode(r,r.uint32());continue;case 14:if(i!==114)break;o.runError=Pu.decode(r,r.uint32());continue;case 15:if(i!==122)break;o.stepStarted=Nu.decode(r,r.uint32());continue;case 16:if(i!==130)break;o.stepFinished=Fu.decode(r,r.uint32());continue;case 17:if(i!==138)break;o.textMessageChunk=Du.decode(r,r.uint32());continue;case 18:if(i!==146)break;o.toolCallChunk=Mu.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return tb.fromPartial(e??{})},fromPartial(e){let t=eb();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?Su.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?bu.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?wu.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?Au.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?xu.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?Cu.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?Eu.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?Ru.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?Iu.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?Tu.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?_u.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?ku.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?Ou.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?Pu.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?Nu.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?Fu.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?Du.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?Mu.fromPartial(e.toolCallChunk):void 0,t}};function Ho(e){let t=w.Number(e.toString());if(t>w.Number.MAX_SAFE_INTEGER)throw new w.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(t<w.Number.MIN_SAFE_INTEGER)throw new w.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return t}var rb=e=>e&&typeof e=="object"?e:void 0;var iu=e=>{let t=rb(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}}}},sO=e=>{let t=rb(e);if(t){if(t.text)return{type:"text",text:t.text.text};if(t.image){let r=t.image;return{type:"image",source:iu(r.source),metadata:r.metadata}}if(t.audio){let r=t.audio;return{type:"audio",source:iu(r.source),metadata:r.metadata}}if(t.video){let r=t.video;return{type:"video",source:iu(r.source),metadata:r.metadata}}if(t.document){let r=t.document;return{type:"document",source:iu(r.source),metadata:r.metadata}}}};function nb(e){let t=tb.decode(e),r=Object.values(t).find(n=>n!==void 0);if(!r)throw new Error("Invalid event");if(r.type=aO[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 i=o.contentParts.map(a=>sO(a)).filter(a=>a!==void 0);i.length>0&&(o.content=i)}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,i=Array.isArray(n.interrupts)?n.interrupts:[];delete n.interrupts,o==="interrupt"?n.outcome={type:"interrupt",interrupts:i}: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=iO[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]}),xc.parse(r)}var sf="application/vnd.ag-ui.event+proto";m();d();f();p();m();d();f();p();m();d();f();p();var uO=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,cf=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(uO);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},ob=e=>e==="*"||e==="x"||e==="X",ib=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},lO=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],dO=(e,t)=>{if(ob(e)||ob(t))return 0;let[r,n]=lO(ib(e),ib(t));return r>n?1:r<n?-1:0},uf=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=dO(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var ga=(e,t)=>{let r=cf(e),n=cf(t),o=r.pop(),i=n.pop(),a=uf(r,n);return a!==0?a:o&&i?uf(o.split("."),i.split(".")):o||i?o?-1:1:0};var Re=e=>{if(typeof structuredClone=="function")return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function ha(){return jr()}function pf(e){if(Object.freeze(e),typeof e=="object"&&e)for(let t of Object.values(e))typeof t=="object"&&t&&!Object.isFrozen(t)&&pf(t);return e}var ab=512*1024;function sb(e,t,r){let n=0,o=[e,t],i=new WeakSet;for(;o.length>0;){let a=o.pop();if(typeof a=="string"){if(n+=a.length,n>r)return!0}else if(typeof a=="object"&&a){if(i.has(a))continue;if(i.add(a),Array.isArray(a))for(let s=0;s<a.length;s++)o.push(a[s]);else{let s=Object.keys(a);for(let c=0;c<s.length;c++){let u=s[c];if(n+=u.length,n>r)return!0;o.push(a[u])}}}}return!1}function Oe(_x88,_x89,_x90,_x91){return _Oe.apply(this,arguments)}function _Oe(){_Oe=_asyncToGenerator(function*(e,t,r,n){let o=typeof process<"u"&&process.env!==void 0,i=o&&!!process.env.VITEST_WORKER_ID,a=o&&!!process.env.VITEST_WORKER_ID,s=a&&!sb(t,r,ab),c=s?Re(t):t,u=s?Re(r):r,h=!1,v=!1,C;for(let g of e)try{s&&(pf(c),pf(u));let y=yield n(g,c,u);if(y===void 0)continue;let S=!1;if(y.messages!==void 0&&y.messages!==c&&(c=Re(y.messages),h=!0,S=!0),y.state!==void 0&&y.state!==u&&(u=Re(y.state),v=!0,S=!0),s&&S&&sb(c,u,ab)&&(s=!1),C=y.stopPropagation,C===!0)break}catch(y){if(a&&y instanceof TypeError){if(i)throw y;console.error("AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.",y)}else i||console.error("Subscriber error:",y);continue}return{...(h?{messages:Object.isFrozen(c)?Re(c):c}:{}),...(v?{state:Object.isFrozen(u)?Re(u):u}:{}),...(C===void 0?{}:{stopPropagation:C})}});return _Oe.apply(this,arguments)}function qu(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 ya(e){if(e instanceof ff)return e;if(e===!0)return new ff(qu(!0))}var ff=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 lf(e){return e.enabled?new ff(e):void 0}function pO(e,t,r){if(t){let o=e.find(a=>a.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 i={id:o?r:t,role:"assistant",toolCalls:[]};return e.push(i),i}let n={id:r,role:"assistant",toolCalls:[]};return e.push(n),n}var fb=(e,t,r,n,o)=>{let i=ya(o),a=Re(r.messages),s=Re(e.state),c={},u=v=>{v.messages!==void 0&&(a=v.messages,c.messages=v.messages),v.state!==void 0&&(s=v.state,c.state=v.state)},h=()=>{let v=Re(c);return c={},v.messages!==void 0||v.state!==void 0?Ge(v):Uc};return t.pipe(tu(/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(v){let C=yield Oe(n,a,s,(g,y,S)=>g.onEvent?.({event:v,agent:r,input:e,messages:y,state:S}));if(u(C),C.stopPropagation===!0?i?.event("APPLY","Event dropped:",v,{type:v.type,reason:"stopPropagation by subscriber"}):i?.event("APPLY","Event applied:",v,{type:v.type,subscribers:n.length}),C.stopPropagation===!0)return h();switch(v.type){case M.TEXT_MESSAGE_START:{let g=yield Oe(n,a,s,(y,S,E)=>y.onTextMessageStartEvent?.({event:v,messages:S,state:E,agent:r,input:e}));if(u(g),g.stopPropagation!==!0){let{messageId:y,role:S="assistant",name:E}=v;if(!a.find(R=>R.id===y)){let R={id:y,role:S,content:"",...(E!==void 0&&{name:E})};a.push(R),u({messages:a})}}return h()}case M.TEXT_MESSAGE_CONTENT:{let{messageId:g,delta:y}=v,S=a.find(R=>R.id===g);if(!S)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${g}'`),h();let E=yield Oe(n,a,s,(R,k,I)=>R.onTextMessageContentEvent?.({event:v,messages:k,state:I,agent:r,input:e,textMessageBuffer:typeof S.content=="string"?S.content:""}));return u(E),E.stopPropagation!==!0&&(S.content=`${typeof S.content=="string"?S.content:""}${y}`,u({messages:a})),h()}case M.TEXT_MESSAGE_END:{let{messageId:g}=v,y=a.find(S=>S.id===g);return y?(u(yield Oe(n,a,s,(S,E,R)=>S.onTextMessageEndEvent?.({event:v,messages:E,state:R,agent:r,input:e,textMessageBuffer:typeof y.content=="string"?y.content:""}))),yield Promise.all(n.map(S=>{S.onNewMessage?.({message:y,messages:a,state:s,agent:r,input:e})})),h()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${g}'`),h())}case M.TOOL_CALL_START:{let g=yield Oe(n,a,s,(y,S,E)=>y.onToolCallStartEvent?.({event:v,messages:S,state:E,agent:r,input:e}));if(u(g),g.stopPropagation!==!0){let{toolCallId:y,toolCallName:S,parentMessageId:E}=v,R=a.find(I=>I.toolCalls?.some(T=>T.id===y))?.toolCalls?.find(I=>I.id===y);if(R)return R.function.name!==S&&(console.warn(`TOOL_CALL_START: tool call '${y}' already exists with name '${R.function.name}' \u2014 updating it to '${S}'`),R.function.name=S,u({messages:a})),h();let k=pO(a,E,y);k.toolCalls??(k.toolCalls=[]),k.toolCalls.push({id:y,type:"function",function:{name:S,arguments:""}}),u({messages:a})}return h()}case M.TOOL_CALL_ARGS:{let{toolCallId:g,delta:y}=v,S=a.find(k=>k.toolCalls?.some(I=>I.id===g));if(!S)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${g}'`),h();let E=S.toolCalls?.find(k=>k.id===g);if(!E)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${g}'`),h();let R=yield Oe(n,a,s,(k,I,T)=>{let _=E.function.arguments,D=E.function.name,G={};try{G=nu(_)}catch{}return k.onToolCallArgsEvent?.({event:v,messages:I,state:T,agent:r,input:e,toolCallBuffer:_,toolCallName:D,partialToolCallArgs:G})});return u(R),R.stopPropagation!==!0&&(E.function.arguments+=y,u({messages:a})),h()}case M.TOOL_CALL_END:{let{toolCallId:g}=v,y=a.find(E=>E.toolCalls?.some(R=>R.id===g));if(!y)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${g}'`),h();let S=y.toolCalls?.find(E=>E.id===g);return S?(u(yield Oe(n,a,s,(E,R,k)=>{let I=S.function.arguments,T=S.function.name,_={};try{_=JSON.parse(I)}catch{}return E.onToolCallEndEvent?.({event:v,messages:R,state:k,agent:r,input:e,toolCallName:T,toolCallArgs:_})})),yield Promise.all(n.map(E=>{E.onNewToolCall?.({toolCall:S,messages:a,state:s,agent:r,input:e})})),h()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${g}'`),h())}case M.TOOL_CALL_RESULT:{let g=yield Oe(n,a,s,(y,S,E)=>y.onToolCallResultEvent?.({event:v,messages:S,state:E,agent:r,input:e}));if(u(g),g.stopPropagation!==!0){let{messageId:y,toolCallId:S,content:E,role:R}=v,k={id:y,toolCallId:S,role:R||"tool",content:E},I=a.findIndex(T=>T.role==="assistant"&&T.toolCalls?.some(_=>_.id===S));if(I===-1)a.push(k);else{let T=I+1;for(;T<a.length&&a[T].role==="tool";)T++;a.splice(T,0,k)}yield Promise.all(n.map(T=>{T.onNewMessage?.({message:k,messages:a,state:s,agent:r,input:e})})),u({messages:a})}return h()}case M.STATE_SNAPSHOT:{let g=yield Oe(n,a,s,(y,S,E)=>y.onStateSnapshotEvent?.({event:v,messages:S,state:E,agent:r,input:e}));if(u(g),g.stopPropagation!==!0){let{snapshot:y}=v;s=y,u({state:s})}return h()}case M.STATE_DELTA:{let g=yield Oe(n,a,s,(y,S,E)=>y.onStateDeltaEvent?.({event:v,messages:S,state:E,agent:r,input:e}));if(u(g),g.stopPropagation!==!0){let{delta:y}=v;try{s=Oc.applyPatch(s,y,!0,!1).newDocument,u({state:s})}catch(S){let E=S instanceof Error?S.message:String(S);console.warn(`Failed to apply state patch:
37
37
  Current state: ${JSON.stringify(s,null,2)}
38
- Patch operations: ${JSON.stringify(h,null,2)}
39
- Error: ${C}`)}}return g()}case M.MESSAGES_SNAPSHOT:{let y=yield Oe(n,a,s,(h,S,C)=>h.onMessagesSnapshotEvent?.({event:v,messages:S,state:C,agent:r,input:e}));if(u(y),y.stopPropagation!==!0){let{messages:h}=v,S=new Map(h.map(I=>[I.id,I])),C=h.some(I=>I.role==="reasoning"),R=I=>I.role==="activity"||I.role==="reasoning"&&!C;a=a.filter(I=>R(I)||S.has(I.id)).map(I=>R(I)?I:S.get(I.id));let T=new Set(a.map(I=>I.id));for(let I of h)T.has(I.id)||a.push(I);u({messages:a})}return g()}case M.ACTIVITY_SNAPSHOT:{let y=v,h=a.findIndex(I=>I.id===y.messageId),S=h>=0?a[h]:void 0,C=S?.role==="activity"?S:void 0,R=y.replace??!0,T=yield Oe(n,a,s,(I,k,_)=>I.onActivitySnapshotEvent?.({event:y,messages:k,state:_,agent:r,input:e,activityMessage:C,existingMessage:S}));if(u(T),T.stopPropagation!==!0){let I={id:y.messageId,role:"activity",activityType:y.activityType,content:Re(y.content)},k;h===-1?(a.push(I),k=I):C?R&&(a[h]={...C,activityType:y.activityType,content:Re(y.content)}):R&&(a[h]=I,k=I),u({messages:a}),k&&(yield Promise.all(n.map(_=>_.onNewMessage?.({message:k,messages:a,state:s,agent:r,input:e}))))}return g()}case M.ACTIVITY_DELTA:{let y=v,h=a.findIndex(T=>T.id===y.messageId);if(h===-1)return g();let S=a[h];if(S.role!=="activity")return console.warn(`ACTIVITY_DELTA: Message '${y.messageId}' is not an activity message`),g();let C=S,R=yield Oe(n,a,s,(T,I,k)=>T.onActivityDeltaEvent?.({event:y,messages:I,state:k,agent:r,input:e,activityMessage:C}));if(u(R),R.stopPropagation!==!0)try{let T=Re(C.content??{}),I=_c.applyPatch(T,y.patch??[],!0,!1).newDocument;a[h]={...C,content:Re(I),activityType:y.activityType},u({messages:a})}catch(T){let I=T instanceof Error?T.message:String(T);console.warn(`Failed to apply activity patch for '${y.messageId}': ${I}`)}return g()}case M.RAW:return u(yield Oe(n,a,s,(y,h,S)=>y.onRawEvent?.({event:v,messages:h,state:S,agent:r,input:e}))),g();case M.CUSTOM:return u(yield Oe(n,a,s,(y,h,S)=>y.onCustomEvent?.({event:v,messages:h,state:S,agent:r,input:e}))),g();case M.RUN_STARTED:{let y=yield Oe(n,a,s,(h,S,C)=>h.onRunStartedEvent?.({event:v,messages:S,state:C,agent:r,input:e}));if(u(y),y.stopPropagation!==!0){let h=v;if(h.input?.messages){for(let S of h.input.messages)a.find(C=>C.id===S.id)||a.push(S);u({messages:a})}}return g()}case M.RUN_FINISHED:{let y=v,h=y.outcome?.type==="interrupt"?{event:y,outcome:"interrupt",interrupts:y.outcome.interrupts}:{event:y,outcome:"success",result:y.result},S=yield Oe(n,a,s,(C,R,T)=>C.onRunFinishedEvent?.({...h,messages:R,state:T,agent:r,input:e}));return u(S),S.stopPropagation!==!0&&(r.pendingInterrupts=h.outcome==="interrupt"?[...h.interrupts]:[]),g()}case M.RUN_ERROR:return u(yield Oe(n,a,s,(y,h,S)=>y.onRunErrorEvent?.({event:v,messages:h,state:S,agent:r,input:e}))),g();case M.STEP_STARTED:return u(yield Oe(n,a,s,(y,h,S)=>y.onStepStartedEvent?.({event:v,messages:h,state:S,agent:r,input:e}))),g();case M.STEP_FINISHED:return u(yield Oe(n,a,s,(y,h,S)=>y.onStepFinishedEvent?.({event:v,messages:h,state:S,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 u(yield Oe(n,a,s,(y,h,S)=>y.onReasoningStartEvent?.({event:v,messages:h,state:S,agent:r,input:e}))),g();case M.REASONING_MESSAGE_START:{let y=yield Oe(n,a,s,(h,S,C)=>h.onReasoningMessageStartEvent?.({event:v,messages:S,state:C,agent:r,input:e}));if(u(y),y.stopPropagation!==!0){let{messageId:h}=v;if(!a.find(S=>S.id===h)){let S={id:h,role:"reasoning",content:""};a.push(S),u({messages:a})}}return g()}case M.REASONING_MESSAGE_CONTENT:{let{messageId:y,delta:h}=v,S=a.find(R=>R.id===y);if(!S)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${y}'`),g();let C=yield Oe(n,a,s,(R,T,I)=>R.onReasoningMessageContentEvent?.({event:v,messages:T,state:I,agent:r,input:e,reasoningMessageBuffer:typeof S.content=="string"?S.content:""}));return u(C),C.stopPropagation!==!0&&(S.content=`${typeof S.content=="string"?S.content:""}${h}`,u({messages:a})),g()}case M.REASONING_MESSAGE_END:{let{messageId:y}=v,h=a.find(S=>S.id===y);return h?(u(yield Oe(n,a,s,(S,C,R)=>S.onReasoningMessageEndEvent?.({event:v,messages:C,state:R,agent:r,input:e,reasoningMessageBuffer:typeof h.content=="string"?h.content:""}))),yield Promise.all(n.map(S=>{S.onNewMessage?.({message:h,messages:a,state:s,agent:r,input:e})})),g()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${y}'`),g())}case M.REASONING_MESSAGE_CHUNK:throw Error("REASONING_MESSAGE_CHUNK must be transformed before being applied");case M.REASONING_END:return u(yield Oe(n,a,s,(y,h,S)=>y.onReasoningEndEvent?.({event:v,messages:h,state:S,agent:r,input:e}))),g();case M.REASONING_ENCRYPTED_VALUE:{let{subtype:y,entityId:h,encryptedValue:S}=v,C=yield Oe(n,a,s,(R,T,I)=>R.onReasoningEncryptedValueEvent?.({event:v,messages:T,state:I,agent:r,input:e}));if(u(C),C.stopPropagation!==!0){let R=!1;if(y==="tool-call"){for(let T of a)if(T.role==="assistant"&&T.toolCalls){let I=T.toolCalls.find(k=>k.id===h);if(I){I.encryptedValue=S,R=!0;break}}}else{let T=a.find(I=>I.id===h);T?.role!=="activity"&&T&&(T.encryptedValue=S,R=!0)}R&&(c.messages=a)}return g()}}return v.type,g()});return function(_x92){return _ref43.apply(this,arguments)}}()),Bp(),n.length>0?Gp({}):v=>v)},uf=e=>t=>{let r=ga(e),n=new Map,o=new Map,i=!1,a=!1,s=!1,c=new Map,u=!1,g=!1,v=!1,E=()=>{n.clear(),o.clear(),c.clear(),u=!1,g=!1,i=!1,a=!1,v=!0};return t.pipe(wt(y=>{let h=y.type;if(r?.event("VERIFY","Event:",y,{type:y.type}),a)return Ve(()=>new Le(`Cannot send event type '${h}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(i&&h!==M.RUN_ERROR&&h!==M.RUN_STARTED)return Ve(()=>new Le(`Cannot send event type '${h}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(s){if(h===M.RUN_STARTED){if(v&&!i)return Ve(()=>new Le("Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run."));i&&E()}}else if(s=!0,h!==M.RUN_STARTED&&h!==M.RUN_ERROR)return Ve(()=>new Le("First event must be 'RUN_STARTED'"));switch(h){case M.TEXT_MESSAGE_START:{let S=y.messageId;return n.has(S)?Ve(()=>new Le(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${S}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(n.set(S,!0),Ge(y))}case M.TEXT_MESSAGE_CONTENT:{let S=y.messageId;return n.has(S)?Ge(y):Ve(()=>new Le(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${S}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case M.TEXT_MESSAGE_END:{let S=y.messageId;return n.has(S)?(n.delete(S),Ge(y)):Ve(()=>new Le(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${S}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case M.TOOL_CALL_START:{let S=y.toolCallId;return o.has(S)?Ve(()=>new Le(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${S}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(o.set(S,!0),Ge(y))}case M.TOOL_CALL_ARGS:{let S=y.toolCallId;return o.has(S)?Ge(y):Ve(()=>new Le(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${S}'. Start a tool call with 'TOOL_CALL_START' first.`))}case M.TOOL_CALL_END:{let S=y.toolCallId;return o.has(S)?(o.delete(S),Ge(y)):Ve(()=>new Le(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${S}'. A 'TOOL_CALL_START' event must be sent first.`))}case M.STEP_STARTED:{let S=y.stepName;return c.has(S)?Ve(()=>new Le(`Step "${S}" is already active for 'STEP_STARTED'`)):(c.set(S,!0),Ge(y))}case M.STEP_FINISHED:{let S=y.stepName;return c.has(S)?(c.delete(S),Ge(y)):Ve(()=>new Le(`Cannot send 'STEP_FINISHED' for step "${S}" that was not started`))}case M.RUN_STARTED:return v=!0,Ge(y);case M.RUN_FINISHED:if(c.size>0){let S=Array.from(c.keys()).join(", ");return Ve(()=>new Le(`Cannot send 'RUN_FINISHED' while steps are still active: ${S}`))}if(n.size>0){let S=Array.from(n.keys()).join(", ");return Ve(()=>new Le(`Cannot send 'RUN_FINISHED' while text messages are still active: ${S}`))}if(o.size>0){let S=Array.from(o.keys()).join(", ");return Ve(()=>new Le(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${S}`))}return i=!0,Ge(y);case M.RUN_ERROR:return a=!0,Ge(y);case M.CUSTOM:return Ge(y);case M.THINKING_TEXT_MESSAGE_START:return u?g?Ve(()=>new Le("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.")):(g=!0,Ge(y)):Ve(()=>new Le("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?Ge(y):Ve(()=>new Le("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,Ge(y)):Ve(()=>new Le("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 u?Ve(()=>new Le("Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.")):(u=!0,Ge(y));case M.THINKING_END:return u?(u=!1,Ge(y)):Ve(()=>new Le("Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."));default:return Ge(y)}}))},qn=function(e){return e.HEADERS="headers",e.DATA="data",e}({}),cO=e=>Zc(()=>Fn(e())).pipe($p(t=>{if(!t.ok){let o=t.headers.get("content-type")||"";return Fn(t.text()).pipe(wt(i=>{let a=i;if(o.includes("application/json"))try{a=JSON.parse(i)}catch{}let s=Error(`HTTP ${t.status}: ${typeof a=="string"?a:JSON.stringify(a)}`);return s.status=t.status,s.payload=a,Ve(()=>s)}))}let r={type:qn.HEADERS,status:t.status,headers:t.headers},n=t.body?.getReader();return n?new Ue(o=>(o.next(r),_asyncToGenerator(function*(){try{for(;;){let{done:i,value:a}=yield n.read();if(i)break;let s={type:qn.DATA,data:a};o.next(s)}o.complete()}catch(i){o.error(i)}})(),()=>{n.cancel().catch(i=>{if(i?.name!=="AbortError")throw i})})):Ve(()=>Error("Failed to getReader() from response"))})),uO=(e,t)=>{let r=ga(t),n=new rr,o=new TextDecoder("utf-8",{fatal:!1}),i="";e.subscribe({next:s=>{if(s.type!==qn.HEADERS&&s.type===qn.DATA&&s.data){let c=o.decode(s.data,{stream:!0});i+=c;let u=i.split(/\n\n/);i=u.pop()||"";for(let g of u)a(g)}},error:s=>n.error(s),complete:()=>{i&&(i+=o.decode(),a(i)),n.complete()}});function a(s){let c=s.split(`
40
- `),u=[];for(let g of c)g.startsWith("data:")&&u.push(g.slice(5).replace(/^ /,""));if(u.length>0)try{let g=u.join(`
41
- `),v=JSON.parse(g);r?.event("SSE","Event received:",v,{type:v.type}),n.next(v)}catch(g){n.error(g)}}return n.asObservable()},lO=e=>{let t=new rr,r=new Uint8Array;e.subscribe({next:o=>{if(o.type!==qn.HEADERS&&o.type===qn.DATA&&o.data){let i=new Uint8Array(r.length+o.data.length);i.set(r,0),i.set(o.data,r.length),r=i,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 i=r.slice(4,o),a=ZS(i);t.next(a),r=r.slice(o)}catch(i){let a=i instanceof Error?i.message:String(i);t.error(Error(`Failed to decode protocol buffer message: ${a}`));return}}}return t.asObservable()},dO=(e,t)=>{let r=ga(t),n=new rr,o=new qc,i=!1;return e.subscribe({next:a=>{if(o.next(a),a.type===qn.HEADERS&&!i){i=!0;let s=a.headers.get("content-type");r?.lifecycle("HTTP","Stream format detected:",{contentType:s,parser:s===of?"protobuf":"sse"}),s===of?lO(o).subscribe({next:c=>n.next(c),error:c=>n.error(c),complete:()=>n.complete()}):uO(o,r).subscribe({next:c=>{try{let u=wc.parse(c);r?.event("HTTP","Event validated:",u,{type:u.type,valid:!0}),n.next(u)}catch(u){r?.event("HTTP","Event invalid:",{json:c,error:String(u)}),n.error(u)}},error:c=>{if(c?.name==="AbortError"){n.next({type:M.RUN_ERROR,message:c.message||"Request aborted",code:"abort",rawEvent:c}),n.complete();return}return n.error(c)},complete:()=>n.complete()})}else i||n.error(Error("No headers event received before data events"))},error:a=>{o.error(a),n.error(a)},complete:()=>{o.complete()}}),n.asObservable()},qe=w.enum(["TextMessageStart","TextMessageContent","TextMessageEnd","ActionExecutionStart","ActionExecutionArgs","ActionExecutionEnd","ActionExecutionResult","AgentStateMessage","MetaEvent","RunStarted","RunFinished","RunError","NodeStarted","NodeFinished"]),pO=w.enum(["LangGraphInterruptEvent","PredictState","Exit"]),fO=w.object({type:w.literal(qe.enum.TextMessageStart),messageId:w.string(),parentMessageId:w.string().optional(),role:w.string().optional()}),mO=w.object({type:w.literal(qe.enum.TextMessageContent),messageId:w.string(),content:w.string()}),gO=w.object({type:w.literal(qe.enum.TextMessageEnd),messageId:w.string()}),hO=w.object({type:w.literal(qe.enum.ActionExecutionStart),actionExecutionId:w.string(),actionName:w.string(),parentMessageId:w.string().optional()}),yO=w.object({type:w.literal(qe.enum.ActionExecutionArgs),actionExecutionId:w.string(),args:w.string()}),vO=w.object({type:w.literal(qe.enum.ActionExecutionEnd),actionExecutionId:w.string()}),SO=w.object({type:w.literal(qe.enum.ActionExecutionResult),actionName:w.string(),actionExecutionId:w.string(),result:w.string()}),bO=w.object({type:w.literal(qe.enum.AgentStateMessage),threadId:w.string(),agentName:w.string(),nodeName:w.string(),runId:w.string(),active:w.boolean(),role:w.string(),state:w.string(),running:w.boolean()}),wO=w.object({type:w.literal(qe.enum.MetaEvent),name:pO,value:w.any()}),AO=w.object({type:w.literal(qe.enum.RunError),message:w.string(),code:w.string().optional()});w.discriminatedUnion("type",[fO,mO,gO,hO,yO,vO,SO,bO,wO,AO]),w.object({id:w.string(),role:w.string(),content:w.string(),parentMessageId:w.string().optional()}),w.object({id:w.string(),name:w.string(),arguments:w.any(),parentMessageId:w.string().optional()}),w.object({id:w.string(),result:w.any(),actionExecutionId:w.string(),actionName:w.string()});var xO=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
- `)},CO=(e,t,r)=>n=>{let o={},i=!0,a=!0,s="",c=null,u=null,g=[],v={},E=y=>{typeof y=="object"&&y&&("messages"in y&&delete y.messages,o=y)};return n.pipe(wt(y=>{switch(y.type){case M.TEXT_MESSAGE_START:{let h=y;return[{type:qe.enum.TextMessageStart,messageId:h.messageId,role:h.role}]}case M.TEXT_MESSAGE_CONTENT:{let h=y;return[{type:qe.enum.TextMessageContent,messageId:h.messageId,content:h.delta}]}case M.TEXT_MESSAGE_END:{let h=y;return[{type:qe.enum.TextMessageEnd,messageId:h.messageId}]}case M.TOOL_CALL_START:{let h=y;return g.push({id:h.toolCallId,type:"function",function:{name:h.toolCallName,arguments:""}}),a=!0,v[h.toolCallId]=h.toolCallName,[{type:qe.enum.ActionExecutionStart,actionExecutionId:h.toolCallId,actionName:h.toolCallName,parentMessageId:h.parentMessageId}]}case M.TOOL_CALL_ARGS:{let h=y,S=g.find(R=>R.id===h.toolCallId);if(!S)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${h.toolCallId}'`),[];S.function.arguments+=h.delta;let C=!1;if(u){let R=u.find(T=>T.tool==S.function.name);if(R)try{let T=JSON.parse(tu(S.function.arguments));R.tool_argument&&R.tool_argument in T?(E({...o,[R.state_key]:T[R.tool_argument]}),C=!0):R.tool_argument||(E({...o,[R.state_key]:T}),C=!0)}catch{}}return[{type:qe.enum.ActionExecutionArgs,actionExecutionId:h.toolCallId,args:h.delta},...(C?[{type:qe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}]:[])]}case M.TOOL_CALL_END:{let h=y;return[{type:qe.enum.ActionExecutionEnd,actionExecutionId:h.toolCallId}]}case M.TOOL_CALL_RESULT:{let h=y;return[{type:qe.enum.ActionExecutionResult,actionExecutionId:h.toolCallId,result:h.content,actionName:v[h.toolCallId]||"unknown"}]}case M.RAW:return[];case M.CUSTOM:{let h=y;switch(h.name){case"Exit":i=!1;break;case"PredictState":u=h.value;break}return[{type:qe.enum.MetaEvent,name:h.name,value:h.value}]}case M.STATE_SNAPSHOT:return E(y.snapshot),[{type:qe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}];case M.STATE_DELTA:{let h=y,S=_c.applyPatch(o,h.delta,!0,!1);return S?(E(S.newDocument),[{type:qe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}]):[]}case M.MESSAGES_SNAPSHOT:return c=y.messages,[{type:qe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify({...o,...(c?{messages:c}:{})}),active:!0}];case M.RUN_STARTED:return[];case M.RUN_FINISHED:return c&&(o.messages=c),Object.keys(o).length===0?[]:[{type:qe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify({...o,...(c?{messages:EO(c)}:{})}),active:!1}];case M.RUN_ERROR:{let h=y;return[{type:qe.enum.RunError,message:h.message,code:h.code}]}case M.STEP_STARTED:return s=y.stepName,g=[],u=null,[{type:qe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:!0}];case M.STEP_FINISHED:return g=[],u=null,[{type:qe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:!1}];default:return[]}}))};function EO(e){let t=[];for(let r of e)if(r.role==="assistant"||r.role==="user"||r.role==="system"){let n=xO(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 i={id:o.id,name:o.function.name,arguments:JSON.parse(o.function.arguments),parentMessageId:r.id};t.push(i)}}else if(r.role==="tool"){let n="unknown";for(let i of e)if(i.role==="assistant"&&i.toolCalls?.length){for(let a of i.toolCalls)if(a.id===r.toolCallId){n=a.function.name;break}}let o={id:r.id,result:r.content,actionExecutionId:r.toolCallId,actionName:n};t.push(o)}return t}var Mu=e=>t=>{let r=ga(e),n,o,i,a,s=()=>{if(!n||a!=="text")throw Error("No text message to close");let v={type:M.TEXT_MESSAGE_END,messageId:n.messageId};return a=void 0,n=void 0,r?.event("TRANSFORM","TEXT_MESSAGE_END",v,{messageId:v.messageId}),v},c=()=>{if(!o||a!=="tool")throw Error("No tool call to close");let v={type:M.TOOL_CALL_END,toolCallId:o.toolCallId};return a=void 0,o=void 0,r?.event("TRANSFORM","TOOL_CALL_END",v,{toolCallId:v.toolCallId}),v},u=()=>{if(!i||a!=="reasoning")throw Error("No reasoning message to close");let v={type:M.REASONING_MESSAGE_END,messageId:i.messageId};return a=void 0,i=void 0,r?.event("TRANSFORM","REASONING_MESSAGE_END",v,{messageId:v.messageId}),v},g=()=>a==="text"?[s()]:a==="tool"?[c()]:a==="reasoning"?[u()]:[];return t.pipe(wt(v=>{switch(v.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(),v];case M.RAW:case M.ACTIVITY_SNAPSHOT:case M.ACTIVITY_DELTA:case M.REASONING_ENCRYPTED_VALUE:return[v];case M.TEXT_MESSAGE_CHUNK:let E=v,y=[];if((a!=="text"||E.messageId!==void 0&&E.messageId!==n?.messageId)&&y.push(...g()),a!=="text"){if(E.messageId===void 0)throw Error("First TEXT_MESSAGE_CHUNK must have a messageId");n={messageId:E.messageId,name:E.name},a="text";let T={type:M.TEXT_MESSAGE_START,messageId:E.messageId,role:E.role||"assistant",...(E.name!==void 0&&{name:E.name})};y.push(T),r?.event("TRANSFORM","TEXT_MESSAGE_START",T,{messageId:E.messageId})}if(E.delta!==void 0){let T={type:M.TEXT_MESSAGE_CONTENT,messageId:n.messageId,delta:E.delta};y.push(T),r?.event("TRANSFORM","TEXT_MESSAGE_CONTENT",T,{messageId:n.messageId})}return y;case M.TOOL_CALL_CHUNK:let h=v,S=[];if((a!=="tool"||h.toolCallId!==void 0&&h.toolCallId!==o?.toolCallId)&&S.push(...g()),a!=="tool"){if(h.toolCallId===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallId");if(h.toolCallName===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallName");o={toolCallId:h.toolCallId,toolCallName:h.toolCallName,parentMessageId:h.parentMessageId},a="tool";let T={type:M.TOOL_CALL_START,toolCallId:h.toolCallId,toolCallName:h.toolCallName,parentMessageId:h.parentMessageId};S.push(T),r?.event("TRANSFORM","TOOL_CALL_START",T,{toolCallId:h.toolCallId,toolCallName:h.toolCallName})}if(h.delta!==void 0){let T={type:M.TOOL_CALL_ARGS,toolCallId:o.toolCallId,delta:h.delta};S.push(T),r?.event("TRANSFORM","TOOL_CALL_ARGS",T,{toolCallId:o.toolCallId})}return S;case M.REASONING_MESSAGE_CHUNK:let C=v,R=[];if((a!=="reasoning"||C.messageId&&C.messageId!==i?.messageId)&&R.push(...g()),a!=="reasoning"){if(C.messageId===void 0)throw Error("First REASONING_MESSAGE_CHUNK must have a messageId");i={messageId:C.messageId},a="reasoning";let T={type:M.REASONING_MESSAGE_START,messageId:C.messageId};R.push(T),r?.event("TRANSFORM","REASONING_MESSAGE_START",T,{messageId:C.messageId})}if(C.delta!==void 0){let T={type:M.REASONING_MESSAGE_CONTENT,messageId:i.messageId,delta:C.delta};R.push(T),r?.event("TRANSFORM","REASONING_MESSAGE_CONTENT",T,{messageId:i.messageId})}return R}return v.type,[]}),Mn(()=>{g()}))};function RO(e,t=new Date){return e.expiresAt===void 0?!1:new Date(e.expiresAt)<=t}var qu=class{runNext(e,t){return t.run(e).pipe(Mu(!1))}runNextWithState(e,t){let r=Re(e.messages||[]),n=Re(e.state||{}),o=new qc;return cb(e,o,t,[]).subscribe(i=>{i.messages!==void 0&&(r=i.messages),i.state!==void 0&&(n=i.state)}),this.runNext(e,t).pipe(Jc(/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(i){return o.next(i),yield new Promise(a=>setTimeout(a,0)),{event:i,messages:Re(r),state:Re(n)}});return function(_x93){return _ref45.apply(this,arguments)}}()))}},IO=class extends qu{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function TO(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 _O=class extends qu{run(e,t){let{parentRunId:r,...n}=e,o={...n,messages:n.messages.map(TO)};return this.runNext(o,t)}},nb="THINKING_START",ob="THINKING_END",ib="THINKING_TEXT_MESSAGE_START",ab="THINKING_TEXT_MESSAGE_CONTENT",sb="THINKING_TEXT_MESSAGE_END",kO=class extends qu{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(Dn(r=>this.transformEvent(r)))}transformEvent(e){switch(e.type){case nb:{this.currentReasoningId=ma();let{title:t,...r}=e;return this.warnAboutTransformation(nb,M.REASONING_START),{...r,type:M.REASONING_START,messageId:this.currentReasoningId}}case ib:return this.currentMessageId=ma(),this.warnAboutTransformation(ib,M.REASONING_MESSAGE_START),{...e,type:M.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case ab:{let{delta:t,...r}=e;return this.warnAboutTransformation(ab,M.REASONING_MESSAGE_CONTENT),{...r,type:M.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??ma(),delta:t}}case sb:{let t=this.currentMessageId??ma();return this.warnAboutTransformation(sb,M.REASONING_MESSAGE_END),{...e,type:M.REASONING_MESSAGE_END,messageId:t}}case ob:{let t=this.currentReasoningId??ma();return this.warnAboutTransformation(ob,M.REASONING_END),{...e,type:M.REASONING_END,messageId:t}}default:return e}}};function OO(e){return e.startsWith("image/")?"image":e.startsWith("audio/")?"audio":e.startsWith("video/")?"video":"document"}function PO(e){return typeof e=="object"&&!!e&&"type"in e&&e.type==="binary"&&"mimeType"in e&&typeof e.mimeType=="string"}function NO(e){let t=OO(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 FO(e){let t=e.content;if(!Array.isArray(t))return e;let r=t.map(n=>PO(n)?NO(n):n);return{...e,content:r}}var DO=class extends qu{run(e,t){let r={...e,messages:e.messages.map(FO)};return this.runNext(r,t)}},MO="0.0.57",qO=class{get maxVersion(){return MO}get debug(){return this._debug}set debug(e){this._debug=Du(e),this._debugLogger=cf(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){typeof e=="boolean"?this._debugLogger=e?cf(Du(!0)):void 0:this._debugLogger=e}constructor({agentId:e,description:t,threadId:r,initialMessages:n,initialState:o,debug:i}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.agentId=e,this.description=t??"",this.threadId=r??jr(),this.messages=Re(n??[]),this.state=Re(o??{}),this._debug=Du(i),this._debugLogger=cf(this._debug),fa(this.maxVersion,"0.0.39")<=0&&this.middlewares.unshift(new _O),fa(this.maxVersion,"0.0.45")<=0&&this.middlewares.unshift(new kO),fa(this.maxVersion,"0.0.47")<=0&&this.middlewares.unshift(new DO)}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 IO(r):r);return this.middlewares.push(...t),this}runAgent(e,t){var _this14=this;return _asyncToGenerator(function*(){try{_this14.isRunning=!0,_this14.agentId=_this14.agentId??jr();let r=_this14.prepareRunAgentInput(e);_this14.debugLogger?.lifecycle("LIFECYCLE","Run started:",{agentId:_this14.agentId,threadId:_this14.threadId});let n,o=new Set(_this14.messages.map(c=>c.id)),i=[{onRunFinishedEvent:c=>{c.outcome==="success"&&(n=c.result)}},..._this14.subscribers,t??{}];yield _this14.onInitialize(r,i),_this14.activeRunDetach$=new rr;let a;_this14.activeRunCompletionPromise=new Promise(c=>{a=c}),yield Xc(Mc(()=>_this14.middlewares.length===0?_this14.run(r):_this14.middlewares.reduceRight((c,u)=>({run:g=>u.run(g,c),get messages(){return c.messages},get state(){return c.state}}),_this14).run(r),Mu(_this14.debugLogger),uf(_this14.debugLogger),c=>c.pipe(eu(_this14.activeRunDetach$)),c=>_this14.apply(r,c,i),c=>_this14.processApplyEvents(r,c,i),ua(c=>(_this14.debugLogger?.lifecycle("LIFECYCLE","Run errored:",{agentId:_this14.agentId,error:c instanceof Error?c.message:String(c)}),_this14.isRunning=!1,_this14.onError(r,c,i))),Mn(()=>{_this14.debugLogger?.lifecycle("LIFECYCLE","Run finished:",{agentId:_this14.agentId,threadId:_this14.threadId}),_this14.isRunning=!1,_this14.onFinalize(r,i),a?.(),a=void 0,_this14.activeRunCompletionPromise=void 0,_this14.activeRunDetach$=void 0}))(Ge(null)));let s=Re(_this14.messages).filter(c=>!o.has(c.id));return{result:n,newMessages:s}}finally{_this14.isRunning=!1}})()}connect(e){throw new _p}connectAgent(e,t){var _this15=this;return _asyncToGenerator(function*(){try{_this15.isRunning=!0,_this15.agentId=_this15.agentId??jr();let r=_this15.prepareRunAgentInput(e),n,o=new Set(_this15.messages.map(c=>c.id)),i=[{onRunFinishedEvent:c=>{c.outcome==="success"&&(n=c.result)}},..._this15.subscribers,t??{}];yield _this15.onInitialize(r,i),_this15.activeRunDetach$=new rr;let a;_this15.activeRunCompletionPromise=new Promise(c=>{a=c}),yield Xc(Mc(()=>Zc(()=>_this15.connect(r)),Mu(_this15.debugLogger),uf(_this15.debugLogger),c=>c.pipe(eu(_this15.activeRunDetach$)),c=>_this15.apply(r,c,i),c=>_this15.processApplyEvents(r,c,i),ua(c=>(_this15.isRunning=!1,c instanceof _p?jc:_this15.onError(r,c,i))),Mn(()=>{_this15.isRunning=!1,_this15.onFinalize(r,i),a?.(),a=void 0,_this15.activeRunCompletionPromise=void 0,_this15.activeRunDetach$=void 0}))(Ge(null)),{defaultValue:void 0});let s=Re(_this15.messages).filter(c=>!o.has(c.id));return{result:n,newMessages:s}}finally{_this15.isRunning=!1}})()}abortRun(){}detachActiveRun(){var _this16=this;return _asyncToGenerator(function*(){if(!_this16.activeRunDetach$)return;let e=_this16.activeRunCompletionPromise??Promise.resolve();_this16.activeRunDetach$.next(),_this16.activeRunDetach$?.complete(),yield e})()}apply(e,t,r){return cb(e,t,this,r,this.debugLogger)}processApplyEvents(e,t,r){return t.pipe(Qp(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=Re(this.messages).filter(r=>r.role!=="activity");return{threadId:this.threadId,runId:e?.runId||jr(),tools:Re(e?.tools??[]),context:Re(e?.context??[]),forwardedProps:Re(e?.forwardedProps??{}),state:Re(this.state),messages:t,...(e?.resume===void 0?{}:{resume:Re(e.resume)})}}onInitialize(e,t){var _this17=this;return _asyncToGenerator(function*(){if(_this17.pendingInterrupts.length>0){let n=new Set((e.resume??[]).map(i=>i.interruptId)),o=_this17.pendingInterrupts.map(i=>i.id).filter(i=>!n.has(i));if(o.length>0)throw new Le(`Thread has ${o.length} pending interrupt(s) not addressed by resume: ${o.join(", ")}`);for(let i of _this17.pendingInterrupts)if(RO(i))throw new Le(`Interrupt ${i.id} expired at ${i.expiresAt}`)}let r=yield Oe(t,_this17.messages,_this17.state,(n,o,i)=>n.onRunInitialized?.({messages:o,state:i,agent:_this17,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages&&(_this17.messages=r.messages,e.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this17.messages,state:_this17.state,agent:_this17,input:e})})),r.state&&(_this17.state=r.state,e.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this17.state,messages:_this17.messages,agent:_this17,input:e})})))})()}onError(e,t,r){return Fn(Oe(r,this.messages,this.state,(n,o,i)=>n.onRunFailed?.({error:t,messages:o,state:i,agent:this,input:e}))).pipe(Dn(n=>{let o=n;if((o.messages!==void 0||o.state!==void 0)&&(o.messages!==void 0&&(this.messages=o.messages,r.forEach(i=>{i.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),o.state!==void 0&&(this.state=o.state,r.forEach(i=>{i.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),o.stopPropagation!==!0){let i=String(t);if(!(t.name==="AbortError"||t.message==="Fetch is aborted"||t.message==="signal is aborted without reason"||t.message==="component unmounted"||i==="component unmounted"))throw console.error("Agent execution failed:",t),t}return{}}))}onFinalize(e,t){var _this18=this;return _asyncToGenerator(function*(){let r=yield Oe(t,_this18.messages,_this18.state,(n,o,i)=>n.onRunFinalized?.({messages:o,state:i,agent:_this18,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages!==void 0&&(_this18.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this18.messages,state:_this18.state,agent:_this18,input:e})})),r.state!==void 0&&(_this18.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this18.state,messages:_this18.messages,agent:_this18,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=Re(this.messages),e.state=Re(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=Re(this.pendingInterrupts),e}addMessage(e){var _this19=this;this.messages.push(e),_asyncToGenerator(function*(){for(let t of _this19.subscribers)yield t.onNewMessage?.({message:e,messages:_this19.messages,state:_this19.state,agent:_this19});if(e.role==="assistant"&&e.toolCalls)for(let t of e.toolCalls)for(let r of _this19.subscribers)yield r.onNewToolCall?.({toolCall:t,messages:_this19.messages,state:_this19.state,agent:_this19});for(let t of _this19.subscribers)yield t.onMessagesChanged?.({messages:_this19.messages,state:_this19.state,agent:_this19})})()}addMessages(e){var _this20=this;this.messages.push(...e),_asyncToGenerator(function*(){for(let t of e){for(let r of _this20.subscribers)yield r.onNewMessage?.({message:t,messages:_this20.messages,state:_this20.state,agent:_this20});if(t.role==="assistant"&&t.toolCalls)for(let r of t.toolCalls)for(let n of _this20.subscribers)yield n.onNewToolCall?.({toolCall:r,messages:_this20.messages,state:_this20.state,agent:_this20})}for(let t of _this20.subscribers)yield t.onMessagesChanged?.({messages:_this20.messages,state:_this20.state,agent:_this20})})()}setMessages(e){var _this21=this;this.messages=Re(e),_asyncToGenerator(function*(){for(let t of _this21.subscribers)yield t.onMessagesChanged?.({messages:_this21.messages,state:_this21.state,agent:_this21})})()}setState(e){var _this22=this;this.state=Re(e),_asyncToGenerator(function*(){for(let t of _this22.subscribers)yield t.onStateChanged?.({messages:_this22.messages,state:_this22.state,agent:_this22})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??jr();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(Mu(this.debugLogger),uf(this.debugLogger),CO(this.threadId,t.runId,this.agentId),r=>r.pipe(Dn(n=>(this.debugLogger?.event("LEGACY","Event:",n,{type:n.type}),n))))}},ub=class extends qO{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 l.AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new l.AbortController,this.url=e.url,this.headers=Re(e.headers??{}),this.fetch=e.fetch??((t,r)=>A(t,r))}run(e){return dO(cO(()=>this.fetch(this.url,this.requestInit(e))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=Re(this.headers??{}),e.fetch=this.fetch;let t=new l.AbortController,r=this.abortController.signal;return r.aborted&&t.abort(r.reason),e.abortController=t,e}};m();d();f();p();var lb=(e,t,r)=>{let n=It(t,r),o=e?.trim();if(!n||!t||!o)throw new Error("Missing required parameters for answer endpoint");let i=`/api/v1/organizations/${t}/agents`;return`${n}${i}/${o}`};var pf=class extends ub{requestInit(t){let{params:r,accessToken:n,recordDebugSession:o}=t.forwardedProps||{},i={...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(i),signal:this.abortController.signal}}},db=(e,t,r)=>new pf({url:`${lb(e,t,r)}/answer`});m();d();f();p();m();d();f();p();var jO=new z({required:!0}),pb=new z({required:!0,constrainTo:ic}),fb=e=>({...e,name:ac(e.name)}),mb=O("followUpAnswers/setIsEnabled",e=>B(e,new fe({required:!0}))),gb=O("followUpAnswers/setFollowUpAnswersConversationId",e=>B(e,Y)),hb=O("followUpAnswers/setFollowUpAnswersConversationToken",e=>B(e,Y)),yb=O("followUpAnswers/clearFollowUpAnswersConversationToken"),Are=O("followUpAnswers/createFollowUpAnswer",e=>B(e,{question:Y})),xre=O("followUpAnswers/setActiveFollowUpAnswerId",e=>B(e,Y)),Cre=O("followUpAnswers/setFollowUpAnswerContentFormat",e=>B(e,{contentFormat:cc,answerId:Y})),Ere=O("followUpAnswers/setFollowUpIsLoading",e=>B(e,{isLoading:new fe({required:!0}),answerId:Y})),Rre=O("followUpAnswers/setFollowUpIsStreaming",e=>B(e,{isStreaming:new fe({required:!0}),answerId:Y})),Ire=O("followUpAnswers/followUpMessageChunkReceived",e=>B(e,{textDelta:jO,answerId:Y})),Tre=O("followUpAnswers/followUpCitationsReceived",e=>B(e,{citations:new ve({required:!0,each:new ne({values:gp})}),answerId:Y})),_re=O("followUpAnswers/followUpCompleted",e=>B(e,{answerId:Y,cannotAnswer:new fe({required:!1})})),kre=O("followUpAnswers/followUpFailed",e=>B(e,{message:new z,code:new oe({min:0}),answerId:Y})),Ore=O("followUpAnswers/activeFollowUpStartFailed",e=>B(e,{message:new z})),Pre=O("followUpAnswers/likeFollowUp",e=>B(e,{answerId:Y})),Nre=O("followUpAnswers/dislikeFollowUp",e=>B(e,{answerId:Y})),Fre=O("followUpAnswers/submitFollowUpFeedback",e=>B(e,{answerId:Y})),vb=O("followUpAnswers/resetFollowUpAnswers"),Dre=O("followUpAnswers/stepStarted",e=>B(fb(e),{answerId:Y,name:pb,startedAt:new oe({min:0,required:!0})})),Mre=O("followUpAnswers/stepFinished",e=>B(fb(e),{answerId:Y,name:pb,finishedAt:new oe({min:0,required:!0})})),qre=O("followUpAnswers/startToolCall",e=>B(e,{answerId:Y,toolCallName:Y,startedAt:new oe({min:0,required:!0}),toolCallId:Y})),jre=O("followUpAnswers/finishToolCall",e=>B(e,{answerId:Y,finishedAt:new oe({min:0,required:!0}),toolCallId:Y})),Lre=O("followUpAnswers/toolCallArgs",e=>B(e,{answerId:Y,toolCallId:Y,args:new ne({options:{required:!0}}),type:new z({required:!0,constrainTo:sc})}));m();d();f();p();var LO={"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 Sb(e){return e?LO[e]??1004:1004}var bb=e=>{let t="",r=!1;return{onRunStartedEvent:({event:n})=>{t=n.runId,r=!1,e(uc(n.runId)),e(qr(!1)),e(Wi(!0)),e(gb(n.threadId)),e(yb())},onStepStartedEvent:({event:n,agent:o})=>{o.isRunning!==!1&&e(Hy({name:n.stepName,startedAt:n.timestamp??Date.now()}))},onStepFinishedEvent:({event:n,agent:o})=>{o.isRunning!==!1&&e(zy({name:n.stepName,finishedAt:n.timestamp??Date.now()}))},onToolCallStartEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{toolCallName:i,toolCallId:a,timestamp:s}=n;e(Wy({toolCallId:a,toolCallName:i,startedAt:s??Date.now()}))},onToolCallEndEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{toolCallId:i,timestamp:a}=n;e(Ky({toolCallId:i,finishedAt:a??Date.now()}))},onToolCallArgsEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{toolCallId:i,delta:a}=n;try{let s=JSON.parse(a);typeof s?.q=="string"?e(dc({toolCallId:i,args:s,type:"search"})):e(dc({toolCallId:i,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({toolCallId:i,args:{raw:a},type:"generic"}))}},onTextMessageContentEvent:({event:n,agent:o})=>{o.isRunning!==!1&&(n.delta.length>0&&(r=!0),e(Ki({textDelta:n.delta})))},onCustomEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{name:i,value:a}=n;switch(i){case"header":{a?.contentFormat&&e(Zi(a.contentFormat)),typeof a?.followUpEnabled=="boolean"&&e(mb(a.followUpEnabled)),a?.conversationToken&&e(hb(a.conversationToken));return}case"citations":{e(Yi({citations:a.citations}));return}}},onRunErrorEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let i=Sb(n.code);e(Xi({message:n.message,code:i}))},onRunFinishedEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let i=n.result?.completionReason==="ANSWERED",a=i?!r:void 0;e(hp(i)),e(Ji(!i)),e(Wi(!1)),e(Yd(i,t,a)),e(xo())}}};var wb=()=>{let e,t=()=>{e&&(e.isRunning=!1,e.abortRun()),e=void 0};return{run:function(){var _ref50=_asyncToGenerator(function*(n,o,i){t();let a=js(n),s=eh(n),c=th(n),u=Jg(n),g=rh(n),v=db(a,s,c);e=v;let E=bb(o),y=Ly(n,i());try{o(qr(!0)),yield v.runAgent({forwardedProps:{params:y,accessToken:u,recordDebugSession:g}},E)}catch(h){o(qr(!1)),o(Xi({message:"An error occurred while starting the answer generation."})),console.error("Error running the answer agent:",h)}});return function run(_x94,_x95,_x96){return _ref50.apply(this,arguments)}}(),abortRun:t}};m();d();f();p();m();d();f();p();var ju=O("breadcrumb/deselectAll"),Ab=O("breadcrumb/deselectAllNonBreadcrumbs");m();d();f();p();var xb=O("facet/updateFacetAutoSelection",e=>B(e,{allow:new fe({required:!0})}));m();d();f();p();m();d();f();p();var Lu=class extends kr{constructor(r){super(r);ae(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??Ct().q}get responseTime(){return this.activeInstantResultCache?.duration??Qt().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??Qt().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var Cb=()=>Pe("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new Lu(e)),Eb=()=>({actionCause:"searchboxAsYouType"});m();d();f();p();var ff={id:Y},UO={...ff,q:nt},Kne=O("instantResults/register",e=>B(e,ff)),Uu=O("instantResults/updateQuery",e=>B(e,UO)),Yne=O("instantResults/clearExpired",e=>B(e,ff));m();d();f();p();var Vu=new oe({required:!0,min:0}),Bu=O("pagination/registerNumberOfResults",e=>B(e,Vu)),Gu=O("pagination/updateNumberOfResults",e=>B(e,Vu)),$u=O("pagination/registerPage",e=>B(e,Vu)),Qo=O("pagination/updatePage",e=>B(e,Vu)),Qu=O("pagination/nextPage"),Hu=O("pagination/previousPage");m();d();f();p();var Ho=O("query/updateQuery",e=>B(e,{q:new z,enableQuerySyntax:new fe}));m();d();f();p();m();d();f();p();m();d();f();p();var $r=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var mf=()=>Pe("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),Qr=e=>Pe("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||Ct().q,aq:r.advancedSearchQueries?.aq||$r().aq,cq:r.advancedSearchQueries?.cq||$r().cq,dq:r.advancedSearchQueries?.dq||$r().dq,errorType:e.type,errorMessage:e.message}));m();d();f();p();m();d();f();p();var Foe=O("didYouMean/enable"),Doe=O("didYouMean/disable"),Moe=O("didYouMean/automaticCorrections/disable"),qoe=O("didYouMean/automaticCorrections/enable"),zu=O("didYouMean/correction",e=>B(e,Y)),joe=O("didYouMean/automaticCorrections/mode",e=>B(e,new z({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));m();d();f();p();var gf=()=>Pe("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());var Rb=()=>({actionCause:"didYouMeanAutomatic"});m();d();f();p();m();d();f();p();function Wu(){return{contextValues:{}}}m();d();f();p();function Ku(){return{contextValues:{}}}m();d();f();p();function Ib(){return{freezeFacetOrder:!1,facets:{}}}m();d();f();p();function Tb(){return[]}m();d();f();p();function ha(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}m();d();f();p();function _b(){return{}}m();d();f();p();function kb(){return{}}m();d();f();p();function Ob(){return{}}function nr(e){return{context:e.context||Wu(),dictionaryFieldContext:e.dictionaryFieldContext||Ku(),facetSet:e.facetSet||qs(),numericFacetSet:e.numericFacetSet||Ms(),dateFacetSet:e.dateFacetSet||Ds(),categoryFacetSet:e.categoryFacetSet||Fs(),automaticFacetSet:e.automaticFacetSet??Ns(),pagination:e.pagination||ha(),query:e.query||Ct(),tabSet:e.tabSet||Ob(),advancedSearchQueries:e.advancedSearchQueries||$r(),staticFilterSet:e.staticFilterSet||kb(),querySet:e.querySet||_b(),sortCriteria:e.sortCriteria||Ls(),pipeline:e.pipeline||Ir(),searchHub:e.searchHub||go(),facetOptions:e.facetOptions||Ib(),facetOrder:e.facetOrder??Tb(),debug:e.debug??ps()}}m();d();f();p();var lae=new ne({values:{undoneQuery:nt},options:{required:!0}}),Pb=()=>Pe("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);m();d();f();p();var Yu=O("trigger/query/ignore",e=>B(e,new z({emptyAllowed:!0,required:!0}))),Xu=O("trigger/query/modification",e=>B(e,new ne({values:{originalQuery:rt,modification:rt}})));m();d();f();p();var Hr=/*#__PURE__*/function(){var _ref51=_asyncToGenerator(function*(e,t){let r=GO(e),n=nc(e),o=VO(e),i=yield Dr(e,t),a=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Nr({...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"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:a(),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 Hr(_x97,_x98){return _ref51.apply(this,arguments)}}();function VO(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(BO).filter(r=>r.currentValues.length>0):void 0}function BO(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function GO(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=$O(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}function $O(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o})}var zr=class{constructor(t,r=n=>{this.dispatch(Ho({q:n}))}){ae(this,"config",t);ae(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x99,_x100){var _this23=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=rc(yield _this23.extra.apiClient.search(r,n),t),a=Date.now()-o,s=_this23.getState().query?.q||"";return{response:i,duration:a,queryExecuted:s,requestExecuted:r}}).apply(this,arguments)}process(t){var _this24=this;return _asyncToGenerator(function*(){return _this24.processQueryErrorOrContinue(t)??(yield _this24.processQueryCorrectionsOrContinue(t))??(yield _this24.processQueryTriggersOrContinue(t))??_this24.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return yt(t.response)?(this.dispatch(Qr(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this25=this;return _asyncToGenerator(function*(){let r=_this25.getState(),n=_this25.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:s,queryCorrection:c}=n;if(!o||!i)return null;let u=a.length===0&&s&&s.length!==0,g=!se(c)&&!se(c.correctedQuery);if(!u&&!g)return null;let E=u?yield _this25.processLegacyDidYouMeanAutoCorrection(t):_this25.processModernDidYouMeanAutoCorrection(t);return _this25.dispatch(Kt(nr(_this25.getState()))),E})()}processLegacyDidYouMeanAutoCorrection(t){var _this26=this;return _asyncToGenerator(function*(){let r=_this26.getCurrentQuery(),n=_this26.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this26.automaticallyRetryQueryWithCorrection(o);return yt(i.response)?(_this26.dispatch(Qr(i.response.error)),_this26.rejectWithValue(i.response.error)):(_this26.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this26.dispatch(Kt(nr(_this26.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:gf()})})()}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:gf()}}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 _this27=this;return _asyncToGenerator(function*(){let r=_this27.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(s=>s.type==="query")?.content||"";if(!n)return null;if(_this27.getState().triggers?.queryModification.queryToIgnore===n)return _this27.dispatch(Yu("")),null;_this27.analyticsAction&&(yield _this27.dispatch(_this27.analyticsAction));let i=_this27.getCurrentQuery(),a=yield _this27.automaticallyRetryQueryWithTriggerModification(n);return yt(a.response)?(_this27.dispatch(Qr(a.response.error)),_this27.rejectWithValue(a.response.error)):(_this27.dispatch(Kt(nr(_this27.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i,analyticsAction:Pb()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??Ct().enableQuerySyntax},search:{...Qt(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(Kt(nr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return Ma(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this28=this;return _asyncToGenerator(function*(){_this28.onUpdateQueryForCorrection(t);let r=yield _this28.fetchFromAPI(yield Hr(_this28.getState()),{origin:"mainSearch"});return _this28.dispatch(zu(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this29=this;return _asyncToGenerator(function*(){return _this29.dispatch(Xu({newQuery:t,originalQuery:_this29.getCurrentQuery()})),_this29.onUpdateQueryForCorrection(t),yield _this29.fetchFromAPI(yield Hr(_this29.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 lse=Ie("search/executeSearch",/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Zu(r,t,e)});return function(_x101,_x102){return _ref52.apply(this,arguments)}}()),dse=Ie("search/fetchPage",/*#__PURE__*/function(){var _ref53=_asyncToGenerator(function*(e,t){let r=t.getState();return yield yf(r,t,e)});return function(_x103,_x104){return _ref53.apply(this,arguments)}}()),pse=Ie("search/fetchMoreResults",/*#__PURE__*/function(){var _ref54=_asyncToGenerator(function*(e,t){let r=t.getState();return yield vf(t,r)});return function(_x105,_x106){return _ref54.apply(this,arguments)}}()),fse=Ie("search/fetchFacetValues",/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(e,t){let r=t.getState();return yield WO(t,e,r)});return function(_x107,_x108){return _ref55.apply(this,arguments)}}()),mse=Ie("search/fetchInstantResults",/*#__PURE__*/function(){var _ref56=_asyncToGenerator(function*(e,t){return hf(e,t)});return function(_x109,_x110){return _ref56.apply(this,arguments)}}()),QO=/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(e,t){let r=yield Hr(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function QO(_x111,_x112){return _ref57.apply(this,arguments)}}(),HO=/*#__PURE__*/function(){var _ref58=_asyncToGenerator(function*(e,t,r){let n=yield Dr(e);return Nr({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function HO(_x113,_x114,_x115){return _ref58.apply(this,arguments)}}(),zO=/*#__PURE__*/function(){var _ref59=_asyncToGenerator(function*(e,t){let r=yield Hr(e,t);return r.request.numberOfResults=0,r});return function zO(_x116,_x117){return _ref59.apply(this,arguments)}}(),Nb=e=>{e.configuration.analytics.enabled&&gt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function hf(_x118,_x119){return _hf.apply(this,arguments)}function _hf(){_hf=_asyncToGenerator(function*(e,t){B(e,{id:Y,q:Y,maxResultsPerQuery:new oe({required:!0,min:1}),cacheTimeout:new oe});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),i=new zr({...t,analyticsAction:Cb()},u=>{t.dispatch(Uu({q:u,id:e.id}))}),a=yield HO(o,r,n),s=yield i.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),c=yield i.process(s);return"response"in c?{results:c.response.results,searchUid:c.response.searchUid,analyticsAction:c.analyticsAction,totalCountFiltered:c.response.totalCountFiltered,duration:c.duration}:c});return _hf.apply(this,arguments)}function yf(_x120,_x121,_x122){return _yf.apply(this,arguments)}function _yf(){_yf=_asyncToGenerator(function*(e,t,r){Nb(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),s=new zr({...t,analyticsAction:r}),c=yield Hr(e,a),u=yield s.fetchFromAPI(c,{origin:"mainSearch"});return yield s.process(u)});return _yf.apply(this,arguments)}function vf(_x123,_x124){return _vf.apply(this,arguments)}function _vf(){_vf=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:i}=yield mf().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),a=new zr({...e,analyticsAction:mf()}),s=yield QO(t,i),c=yield a.fetchFromAPI(s,{origin:"mainSearch"});return yield a.process(c)});return _vf.apply(this,arguments)}function WO(_x125,_x126,_x127){return _WO.apply(this,arguments)}function _WO(){_WO=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=e.extra,{description:a}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),s=new zr({...e,analyticsAction:t}),c=yield zO(r,a),u=yield s.fetchFromAPI(c,{origin:"facetValues"});return yield s.process(u)});return _WO.apply(this,arguments)}function Zu(_x128,_x129,_x130){return _Zu.apply(this,arguments)}function _Zu(){_Zu=_asyncToGenerator(function*(e,t,r){Nb(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),s=yield Hr(e,a),c=new zr({...t,analyticsAction:r}),u=yield c.fetchFromAPI(s,{origin:"mainSearch"});return yield c.process(u)});return _Zu.apply(this,arguments)}m();d();f();p();var Wr=class{constructor(t,r=n=>{this.dispatch(Ho({q:n}))}){ae(this,"config",t);ae(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x131,_x132){var _this30=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=rc(yield _this30.extra.apiClient.search(r,n),t),a=Date.now()-o,s=_this30.getState().query?.q||"";return{response:i,duration:a,queryExecuted:s,requestExecuted:r}}).apply(this,arguments)}process(t){var _this31=this;return _asyncToGenerator(function*(){return _this31.processQueryErrorOrContinue(t)??(yield _this31.processQueryCorrectionsOrContinue(t))??(yield _this31.processQueryTriggersOrContinue(t))??_this31.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return yt(t.response)?(this.dispatch(Qr(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this32=this;return _asyncToGenerator(function*(){let r=_this32.getState(),n=_this32.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:s,queryCorrection:c}=n;if(!o)return null;if(!i)return!se(c)&&!se(c.correctedQuery)?_this32.processModernDidYouMeanAutoCorrection(t):null;let u=a.length===0&&s&&s.length!==0,g=!se(c)&&!se(c.correctedQuery);if(!u&&!g)return null;let E=u?yield _this32.processLegacyDidYouMeanAutoCorrection(t):_this32.processModernDidYouMeanAutoCorrection(t);return _this32.dispatch(Kt(nr(_this32.getState()))),E})()}processLegacyDidYouMeanAutoCorrection(t){var _this33=this;return _asyncToGenerator(function*(){let r=_this33.getCurrentQuery(),n=_this33.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this33.automaticallyRetryQueryWithCorrection(o);return yt(i.response)?(_this33.dispatch(Qr(i.response.error)),_this33.rejectWithValue(i.response.error)):(_this33.dispatch(Kt(nr(_this33.getState()))),{...i,response:{...i.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 _this34=this;return _asyncToGenerator(function*(){let r=_this34.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(s=>s.type==="query")?.content||"";if(!n)return null;if(_this34.getState().triggers?.queryModification.queryToIgnore===n)return _this34.dispatch(Yu("")),null;let i=_this34.getCurrentQuery(),a=yield _this34.automaticallyRetryQueryWithTriggerModification(n);return yt(a.response)?(_this34.dispatch(Qr(a.response.error)),_this34.rejectWithValue(a.response.error)):(_this34.dispatch(Kt(nr(_this34.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i})})()}processSuccessResponse(t){return this.dispatch(Kt(nr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return Ma(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this35=this;return _asyncToGenerator(function*(){_this35.onUpdateQueryForCorrection(t);let r=_this35.getState(),{actionCause:n}=Rb(),o=yield _this35.fetchFromAPI(yield Mr(r,_this35.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this35.dispatch(zu(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this36=this;return _asyncToGenerator(function*(){return _this36.dispatch(Xu({newQuery:t,originalQuery:_this36.getCurrentQuery()})),_this36.onUpdateQueryForCorrection(t),yield _this36.fetchFromAPI(yield Mr(_this36.getState(),_this36.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 ece=Ie("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;B(e,{q:new z,enableQuerySyntax:new fe,clearFilters:new fe}),e.clearFilters&&(r(ju()),r(Ab())),r(xb({allow:!0})),r(Ho({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Qo(1))}),tce=O("search/updateSearchAction"),Ju=Ie("search/executeSearch",/*#__PURE__*/function(){var _ref60=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Zu(r,t,e.legacy);Db(r);let n=e.next?Mb(e.next):void 0,o=yield Mr(r,t.extra.navigatorContext,n),i=new Wr({...t,analyticsAction:n??{}}),a=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(a)});return function(_x133,_x134){return _ref60.apply(this,arguments)}}()),Fb=Ie("search/fetchPage",/*#__PURE__*/function(){var _ref61=_asyncToGenerator(function*(e,t){let r=t.getState();if(Db(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return yf(r,t,e.legacy);let n=new Wr({...t,analyticsAction:e.next}),o=yield Mr(r,t.extra.navigatorContext,e.next),i=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(i)});return function(_x135,_x136){return _ref61.apply(this,arguments)}}()),rce=Ie("search/fetchMoreResults",/*#__PURE__*/function(){var _ref62=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return vf(t,r);let n=Ah("browseResults",t.getState),o=new Wr({...t,analyticsAction:n}),i=yield KO(r,t.extra.navigatorContext,n),a=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(a)});return function(_x137,_x138){return _ref62.apply(this,arguments)}}()),nce=Ie("search/fetchFacetValues",/*#__PURE__*/function(){var _ref63=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Zu(r,t,e.legacy);let n=new Wr({...t,analyticsAction:{}}),o=yield XO(r,t.extra.navigatorContext),i=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(i)});return function(_x139,_x140){return _ref63.apply(this,arguments)}}()),oce=Ie("search/fetchInstantResults",/*#__PURE__*/function(){var _ref64=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return hf(e,t);B(e,{id:Y,q:Y,maxResultsPerQuery:new oe({required:!0,min:1}),cacheTimeout:new oe});let{q:n,maxResultsPerQuery:o}=e,i=Mb(Eb()),a=yield YO(r,t.extra.navigatorContext,n,o,i),s=new Wr({...t,analyticsAction:i},g=>{t.dispatch(Uu({q:g,id:e.id}))}),c=yield s.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),u=yield s.process(c);return"response"in u?{results:u.response.results,searchUid:u.response.searchUid,totalCountFiltered:u.response.totalCountFiltered,duration:u.duration}:u});return function(_x141,_x142){return _ref64.apply(this,arguments)}}()),KO=/*#__PURE__*/function(){var _ref65=_asyncToGenerator(function*(e,t,r){let n=yield Mr(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function KO(_x143,_x144,_x145){return _ref65.apply(this,arguments)}}(),YO=/*#__PURE__*/function(){var _ref66=_asyncToGenerator(function*(e,t,r,n,o){let i=Eo(e,t,o);return Nr({...i,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function YO(_x146,_x147,_x148,_x149,_x150){return _ref66.apply(this,arguments)}}(),XO=/*#__PURE__*/function(){var _ref67=_asyncToGenerator(function*(e,t,r){let n=yield Mr(e,t,r);return n.request.numberOfResults=0,n});return function XO(_x151,_x152,_x153){return _ref67.apply(this,arguments)}}(),Db=e=>{e.configuration.analytics.enabled&&gt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},Mb=e=>({actionCause:e.actionCause,type:e.actionCause});var qb=e=>{let t=lg({extra:e}),r=wb();return t.startListening({actionCreator:Ju.pending,effect:function(){var _ref68=_asyncToGenerator(function*(n,o){let i=o.getState();if(!Id(i)||(r.abortRun(),o.dispatch(lc()),o.dispatch(vb()),i.generatedAnswer.isEnabled===!1))return;let a=fn(i)?.q;!a||a.trim()===""||r.run(i,o.dispatch,e.getNavigatorContext)});return function effect(_x154,_x155){return _ref68.apply(this,arguments)}}()}),t};m();d();f();p();var jb=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)},Lb=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));m();d();f();p();var Sf=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:i}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:i}};m();d();f();p();function Ub(e,t){let r={...e},n,o=i=>(a,s)=>{let c=i(a,s);return n?n(c,s):c};return{get combinedReducer(){let i=Zf(Object.entries(t).filter(([a])=>!(a in r)).map(([a,s])=>[a,()=>s]));return o(Kn({...i,...r}))},containsAll(i){return Object.keys(i).every(s=>s in r)},add(i){Object.keys(i).filter(a=>!(a in r)).forEach(a=>{r[a]=i[a]})},addCrossReducer(i){n=i}}}m();d();f();p();m();d();f();p();function ZO(e){if(!e||!JO(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function Vb(e,t=60){if(!e)return!1;let r=ZO(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function JO(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function Gb(e,t){let r=0,n=null,o=_a(()=>{r=0},500),i=/*#__PURE__*/function(){var _ref69=_asyncToGenerator(function*(c,u=!1){let g=!n;g&&t&&(n=_asyncToGenerator(function*(){try{return yield t()}catch(E){if(!u)throw E;return null}})().finally(()=>{n=null}));let v=yield n;return g&&v&&c.dispatch(Er({accessToken:v})),v});return function i(_x156){return _ref69.apply(this,arguments)}}(),a=/*#__PURE__*/function(){var _ref71=_asyncToGenerator(function*(c){let u=c.getState(),g=tP(u);if(!(!g||!Vb(g))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield i(c))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(v){e.warn(v,"Access token renewal failed. A retry will occur if necessary.")}}});return function a(_x157){return _ref71.apply(this,arguments)}}(),s=/*#__PURE__*/function(){var _ref72=_asyncToGenerator(function*(c,u,g){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),Bb(c,u.error),u;!n&&(r++,o());try{yield i(c,!0)}catch(E){e.debug(E,"Token renewal failed in reactive path (piggybacked on a proactive renewal). The action will be re-dispatched.")}c.dispatch(g)});return function s(_x158,_x159,_x160){return _ref72.apply(this,arguments)}}();return c=>u=>(/*#__PURE__*/function(){var _ref73=_asyncToGenerator(function*(g){let v=typeof g=="function",E=typeof t=="function";if(!v)return u(g);E&&(yield a(c));let y=yield u(g);return eP(y)?E?yield s(c,y,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."),Bb(c,y.error),y):y});return function(_x161){return _ref73.apply(this,arguments)}}())}function eP(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new zn().name}function Bb(e,t){e.dispatch(ms({status:401,statusCode:401,message:t.message,type:t.name}))}function tP(e){return e.configuration.accessToken}m();d();f();p();function $b({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return Ym({reducer:e,preloadedState:t,devTools:{stateSanitizer:i=>i.history?{...i,history:"<<OMIT>>"}:i,name:o,shouldHotReload:!1},middleware:i=>i({thunk:{extraArgument:n}}).prepend(...r).concat(Lb(n.logger))})}function rP(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,disableBrowserPrivacySignals:o,...i}=r??{},a={...i,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})},s=a.analyticsMode!=="next",c=a.analyticsMode==="legacy"&&o===!0;return s&&Rl()&&!c?(t.info("Analytics disabled since doNotTrack is active."),{...a,enabled:!1}):(s&&Rl()&&c&&a.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."),a)}function Qb(e,t){let r={...e.reducers,configuration:Lt,version:iv},n=nP({...e,reducers:r},t,Lt),{accessToken:o,environment:i,organizationId:a}=e.configuration;n.dispatch(Er({accessToken:o,environment:i,organizationId:a}));let s=rP(e.configuration,n.logger);return s&&n.dispatch(ro(s)),n}function nP(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,i=Ub({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&i.addCrossReducer(e.crossReducer);let a=t.logger,s={...t,get relay(){return Mi(u.state,o)},get navigatorContext(){return Sf(this.relay,o)}},c=oP(e,s,i),u={addReducers(g){i.containsAll(g)||(i.add(g),c.replaceReducer(i.combinedReducer))},dispatch:c.dispatch,subscribe:c.subscribe,enableAnalytics(){c.dispatch(oo())},disableAnalytics(){c.dispatch(no())},get state(){return c.getState()},get relay(){return Mi(this.state,o)},get navigatorContext(){return Sf(this.relay,o)},logger:a,store:c};return u}function oP(e,t,r){let{preloadedState:n,configuration:o}=e,i=o.name||"coveo-headless",a=iP(e,t.logger,()=>t.navigatorContext);return $b({preloadedState:n,reducer:r.combinedReducer,middlewares:a,thunkExtraArguments:t,name:i})}function iP(e,t,r){let{renewAccessToken:n}=e.configuration,o=Gb(t,n),i=qb({getNavigatorContext:r});return[hv,o,jb(t),sv].concat(vp.middleware,i.middleware,e.middlewares||[])}m();d();f();p();var tw=qt(ew(),1);function rw(e){return(0,tw.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}m();d();f();p();function nw(e,t){let r=xP(e),n=Tt,o=CP(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t,disableBrowserPrivacySignals:e.analytics?.disableBrowserPrivacySignals}}function xP(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function CP(e){return e.preprocessRequest||Pa}m();d();f();p();m();d();f();p();var ow={organizationId:Y,accessToken:Y,name:new z({required:!1,emptyAllowed:!1}),analytics:new ne({options:{required:!1},values:{enabled:new fe({required:!1}),originContext:new z({required:!1}),originLevel2:new z({required:!1}),originLevel3:new z({required:!1}),analyticsMode:new z({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new z({required:!1,url:!0}),trackingId:new z({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),disableBrowserPrivacySignals:new fe({required:!1})}}),environment:new z({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function iw(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var aw=new ht({...ow,pipeline:new z({required:!1,emptyAllowed:!0}),searchHub:rt,locale:rt,timezone:rt});function Ef(){return{...iw(),searchHub:"default"}}var EP={debug:fs,pipeline:ao,searchHub:bo,recommendation:vo};function sw(e){let t=rw(e.loggerOptions);RP(e.configuration,t);let r=IP(e.configuration,t),n={...nw(e.configuration,t),apiClient:r},o={...e,reducers:EP},i=Qb(o,n),{pipeline:a,searchHub:s,timezone:c,locale:u,proxyBaseUrl:g}=e.configuration;return i.dispatch(Wt({timezone:c,locale:u,proxyBaseUrl:g})),se(a)||i.dispatch(io(a)),se(s)||i.dispatch(So(s)),{...i,get state(){return i.state}}}function RP(e,t){try{aw.validate(e)}catch(r){throw t.error(r,"Recommendation engine configuration error"),r}}function IP(e,t){return new Da({logger:t,preprocessRequest:e.preprocessRequest||Pa,postprocessSearchResponseMiddleware:e.preprocessSearchResponseMiddleware||gm,postprocessFacetSearchResponseMiddleware:hm,postprocessQuerySuggestResponseMiddleware:ym})}m();d();f();p();m();d();f();p();m();d();f();p();var TP=new ve({each:Y,required:!0}),cw=(e,t)=>(B(e,Y),Ia(t)?B(t,Y):B(t,TP),{payload:{contextKey:e,contextValue:t}}),Ln=O("context/set",e=>{for(let[t,r]of Object.entries(e))cw(t,r);return{payload:e}}),Un=O("context/add",e=>cw(e.contextKey,e.contextValue)),Vn=O("context/remove",e=>B(e,Y));m();d();f();p();var rl=Be(Wu(),e=>{e.addCase(Ln,(t,r)=>{t.contextValues=r.payload}).addCase(Un,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(Vn,(t,r)=>{delete t.contextValues[r.payload]}).addCase(vt.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});m();d();f();p();function Yr(e){let t,r=new Map,n=()=>r.size===0,o=i=>{try{let a=JSON.stringify(i),s=t!==a;return t=a,s}catch(a){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",a),!0}};return{subscribe(i){i();let a=Symbol(),s;return n()&&(t=JSON.stringify(this.state),s=e.subscribe(()=>{o(this.state)&&r.forEach(c=>c())})),r.set(a,i),()=>{r.delete(a),n()&&s?.()}},get state(){return{}}}}m();d();f();p();var _P=["caseId","caseNumber"],kP={caseId:"caseContext",caseNumber:"caseContext"},va=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${kP[t]} to set this value.}`)}};function Rf(e){return _P.includes(e)}var OP=new ht({values:new ne({options:{required:!1}})});function uw(e,t={}){if(!FP(e))throw $t;let r=Yr(e),{dispatch:n}=e,o=()=>e.state,i=fg(e,OP,t.initialState,"buildContext");return i.values&&n(Ln(i.values)),{...r,get state(){return{values:o().context.contextValues}},set(a){n(Ln(a))},...(o().configuration.analytics.analyticsMode==="legacy"?PP(n):NP(n))}}var PP=e=>({add(t,r){e(Un({contextKey:t,contextValue:r}))},remove(t){e(Vn(t))}}),NP=e=>({add(t,r){if(Rf(t))throw new va(t);e(Un({contextKey:t,contextValue:r}))},remove(t){if(Rf(t))throw new va(t);e(Vn(t))}});function FP(e){return e.addReducers({context:rl}),!0}function lw(e,t){return uw(e,t)}m();d();f();p();m();d();f();p();var Wo=O("dictionaryFieldContext/set",e=>{let t=new ne({options:{required:!0}}),r=B(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new ve({each:nt}),i=B(n,o).error;return i?{payload:e,error:i}:{payload:e}}),Ko=O("dictionaryFieldContext/add",e=>{let t=new ne({options:{required:!0},values:{field:nt,key:nt}});return B(e,t)}),Yo=O("dictionaryFieldContext/remove",e=>B(e,nt));m();d();f();p();var nl=Be(Ku(),e=>{e.addCase(Wo,(t,r)=>{t.contextValues=r.payload}).addCase(Ko,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(Yo,(t,r)=>{delete t.contextValues[r.payload]}).addCase(vt.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function dw(e){if(!DP(e))throw $t;let t=Yr(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(Wo(o))},add(o,i){r(Ko({field:o,key:i}))},remove(o){r(Yo(o))}}}function DP(e){return e.addReducers({dictionaryFieldContext:nl}),!0}m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var Sa={value:Y,numberOfResults:new oe({min:0}),state:Y};m();d();f();p();var _e=Y;var LP=new oe({min:1,default:8,required:!1}),UP=new oe({min:1,max:20,default:5,required:!1}),VP={desiredCount:UP,numberOfValues:LP},dpe=O("automaticFacet/setOptions",e=>B(e,VP)),ppe=O("automaticFacet/deselectAll",e=>B(e,_e)),BP=Y,pw=O("automaticFacet/toggleSelectValue",e=>B(e,{field:BP,selection:new ne({values:Sa})}));m();d();f();p();m();d();f();p();var GP={state:new De({required:!0}),numberOfResults:new oe({required:!0,min:0}),value:new z({required:!0,emptyAllowed:!0}),path:new ve({required:!0,each:Y}),moreValuesAvailable:new fe({required:!1})};function If(e){e.children.forEach(t=>{If(t)}),Tt({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},GP)}var Xo={facetId:_e,field:Y,tabs:new ne({options:{required:!1},values:{included:new ve({each:new z}),excluded:new ve({each:new z})}}),activeTab:new z({required:!1}),delimitingCharacter:new z({required:!1,emptyAllowed:!0}),filterFacetCount:new fe({required:!1}),injectionDepth:new oe({required:!1,min:0}),numberOfValues:new oe({required:!1,min:1}),sortCriteria:new De({required:!1}),basePath:new ve({required:!1,each:Y}),filterByBasePath:new fe({required:!1})};var kpe=O("categoryFacet/register",e=>B(e,Xo)),fw=O("categoryFacet/toggleSelectValue",e=>{try{return Tt(e.facetId,Y),If(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:ur(t)}}}),mw=O("categoryFacet/deselectAll",e=>B(e,Xo.facetId)),Ope=O("categoryFacet/updateNumberOfValues",e=>B(e,{facetId:Xo.facetId,numberOfValues:Xo.numberOfValues})),Ppe=O("categoryFacet/updateSortCriterion",e=>B(e,{facetId:Xo.facetId,criterion:new De})),Npe=O("categoryFacet/updateBasePath",e=>B(e,{facetId:Xo.facetId,basePath:new ve({each:Y})}));m();d();f();p();m();d();f();p();var ba={facetId:_e,captions:new ne({options:{required:!1}}),numberOfValues:new oe({required:!1,min:1}),query:new z({required:!1,emptyAllowed:!0})};var $P={path:new ve({required:!0,each:Y}),displayValue:nt,rawValue:nt,count:new oe({required:!0,min:0})},gw=O("categoryFacet/selectSearchResult",e=>B(e,{facetId:_e,value:new ne({values:$P})})),Xpe=O("categoryFacetSearch/register",e=>B(e,ba));m();d();f();p();var hw={facetId:_e,value:new ne({values:{displayValue:nt,rawValue:nt,count:new oe({required:!0,min:0})}})},cfe=O("facetSearch/register",e=>B(e,ba)),ufe=O("facetSearch/update",e=>B(e,ba)),yw=O("facetSearch/toggleSelectValue",e=>B(e,hw)),vw=O("facetSearch/toggleExcludeValue",e=>B(e,hw));m();d();f();p();m();d();f();p();var hfe=new z({regex:/^[a-zA-Z0-9-_]+$/}),yfe=new z({required:!0}),vfe=new ve({each:new z}),Sfe=new z,bfe=new fe,wfe=new fe,Afe=new oe({min:0}),QP=new oe({min:1}),xfe=new fe({required:!0}),HP=new ne,zP=new z,WP={captions:HP,numberOfValues:QP,query:zP},Cfe=new ne({values:WP}),Sw=new ne({options:{required:!1},values:{type:new z({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new ve({required:!0,max:25,each:new z({emptyAllowed:!1,required:!0})})}}),Efe=new fe,bw=new ve({min:1,max:25,required:!1,each:new z({emptyAllowed:!1,required:!0})});var KP={facetId:_e,field:new z({required:!0,emptyAllowed:!0}),tabs:new ne({options:{required:!1},values:{included:new ve({each:new z}),excluded:new ve({each:new z})}}),activeTab:new z({required:!1}),filterFacetCount:new fe({required:!1}),injectionDepth:new oe({required:!1,min:0}),numberOfValues:new oe({required:!1,min:1}),sortCriteria:new De({required:!1}),resultsMustMatch:new De({required:!1}),allowedValues:Sw,customSort:bw},qfe=O("facet/register",e=>B(e,KP)),ww=O("facet/toggleSelectValue",e=>B(e,{facetId:_e,selection:new ne({values:Sa})})),Aw=O("facet/toggleExcludeValue",e=>B(e,{facetId:_e,selection:new ne({values:Sa})})),ol=O("facet/deselectAll",e=>B(e,_e)),jfe=O("facet/updateSortCriterion",e=>B(e,{facetId:_e,criterion:new De({required:!0})})),Lfe=O("facet/updateNumberOfValues",e=>B(e,{facetId:_e,numberOfValues:new oe({required:!0,min:1})})),Ufe=O("facet/updateIsFieldExpanded",e=>B(e,{facetId:_e,isFieldExpanded:new fe({required:!0})})),Vfe=O("facet/updateFreezeCurrentValues",e=>B(e,{facetId:_e,freezeCurrentValues:new fe({required:!0})}));m();d();f();p();m();d();f();p();function Cw(e){let t=xw(e.start,e),r=xw(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function xw(e,t){let{dateFormat:r}=t;return Ay(e)?(ap(e),Sy(e)):typeof e=="string"&&Pr(e)?(ap(e),e):(gy(e,r),tc(Co(e,r)))}m();d();f();p();var Ew=O("rangeFacet/updateSortCriterion",e=>B(e,{facetId:_e,criterion:new De({required:!0})}));m();d();f();p();var il={state:Y,start:new oe({required:!0}),end:new oe({required:!0}),endInclusive:new fe({required:!0}),numberOfResults:new oe({required:!0,min:0})},al={start:Y,end:Y,endInclusive:new fe({required:!0}),state:Y,numberOfResults:new oe({required:!0,min:0})};var YP={start:Y,end:Y,endInclusive:new fe({required:!0}),state:Y},XP={facetId:_e,field:Y,tabs:new ne({options:{required:!1},values:{included:new ve({each:new z}),excluded:new ve({each:new z})}}),activeTab:new z({required:!1}),currentValues:new ve({required:!1,each:new ne({values:YP})}),generateAutomaticRanges:new fe({required:!0}),filterFacetCount:new fe({required:!1}),injectionDepth:new oe({required:!1,min:0}),numberOfValues:new oe({required:!1,min:1}),sortCriteria:new De({required:!1}),rangeAlgorithm:new De({required:!1})};function Rw(e){return Pr(e)?Hi(e):e}function Iw(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=Cw(t);if(Co(Rw(r)).isAfter(Co(Rw(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var Ime=O("dateFacet/register",e=>{try{return Tt(e,XP),Iw(e),{payload:e,error:null}}catch(t){return{payload:e,error:ur(t)}}}),Tw=O("dateFacet/toggleSelectValue",e=>B(e,{facetId:_e,selection:new ne({values:al})})),_w=O("dateFacet/toggleExcludeValue",e=>B(e,{facetId:_e,selection:new ne({values:al})})),kw=O("dateFacet/updateFacetValues",e=>{try{return Tt(e,{facetId:_e,values:new ve({each:new ne({values:al})})}),Iw({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:ur(t)}}});m();d();f();p();var ZP={state:Y,start:new oe({required:!0}),end:new oe({required:!0}),endInclusive:new fe({required:!0})},JP={facetId:_e,field:Y,tabs:new ne({options:{required:!1},values:{included:new ve({each:new z}),excluded:new ve({each:new z})}}),activeTab:new z({required:!1}),currentValues:new ve({required:!1,each:new ne({values:ZP})}),generateAutomaticRanges:new fe({required:!0}),filterFacetCount:new fe({required:!1}),injectionDepth:new oe({required:!1,min:0}),numberOfValues:new oe({required:!1,min:1}),sortCriteria:new De({required:!1}),rangeAlgorithm:new De({required:!1})};function Ow(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 Ume=O("numericFacet/register",e=>{try{return B(e,JP),Ow(e),{payload:e,error:null}}catch(t){return{payload:e,error:ur(t)}}}),Pw=O("numericFacet/toggleSelectValue",e=>B(e,{facetId:_e,selection:new ne({values:il})})),Nw=O("numericFacet/toggleExcludeValue",e=>B(e,{facetId:_e,selection:new ne({values:il})})),Fw=O("numericFacet/updateFacetValues",e=>{try{return Tt(e,{facetId:_e,values:new ve({each:new ne({values:il})})}),Ow({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:ur(t)}}});var Dw=Be(ha(),e=>{e.addCase(Bu,(t,r)=>{let n=Tf(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=wa(n,o)}).addCase(Gu,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(pc,t=>{t.firstResult=0}).addCase($u,(t,r)=>{let n=r.payload;t.firstResult=wa(n,t.numberOfResults)}).addCase(Qo,(t,r)=>{let n=r.payload;t.firstResult=wa(n,t.numberOfResults)}).addCase(Hu,t=>{let r=Tf(t),n=Math.max(r-1,1);t.firstResult=wa(n,t.numberOfResults)}).addCase(Qu,t=>{let r=Tf(t),n=tN(t),o=Math.min(r+1,n);t.firstResult=wa(o,t.numberOfResults)}).addCase(vt.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(Rr,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(Ju.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(Fb.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(ol,t=>{pt(t)}).addCase(_w,t=>{pt(t)}).addCase(Aw,t=>{pt(t)}).addCase(Nw,t=>{pt(t)}).addCase(vw,t=>{pt(t)}).addCase(ww,t=>{pt(t)}).addCase(mw,t=>{pt(t)}).addCase(fw,t=>{pt(t)}).addCase(gw,t=>{pt(t)}).addCase(Tw,t=>{pt(t)}).addCase(Pw,t=>{pt(t)}).addCase(ju,t=>{pt(t)}).addCase(kw,t=>{pt(t)}).addCase(Fw,t=>{pt(t)}).addCase(yw,t=>{pt(t)}).addCase(pw,t=>{pt(t)})});function pt(e){e.firstResult=ha().firstResult}function Tf(e){let{firstResult:t,numberOfResults:r}=e;return rN(t,r)}function tN(e){let{totalCountFiltered:t,numberOfResults:r}=e;return nN(t,r)}function wa(e,t){return(e-1)*t}function rN(e,t){return Math.round(e/t)+1}function nN(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function _f(e){return e.addReducers({pagination:Dw}),{nextPage:Qu,previousPage:Hu,registerNumberOfResults:Bu,registerPage:$u,updateNumberOfResults:Gu,updatePage:Qo}}var oN=new ht({id:new z({emptyAllowed:!0,required:!1,default:""}),numberOfRecommendations:new oe({min:0})});function Mw(e,t={}){if(!iN(e))throw $t;let r=Yr(e),{dispatch:n}=e,o=()=>e.state,i=mg(e,oN,t.options,"buildRecommendationList");return i.id!==""&&n(yo({id:i.id})),i.numberOfRecommendations&&n(_f(e).updateNumberOfResults(i.numberOfRecommendations)),{...r,refresh(){n(Or())},get state(){let a=o();return{recommendations:a.recommendation.recommendations,error:a.recommendation.error,isLoading:a.recommendation.isLoading,searchResponseId:a.recommendation.searchUid}}}}function iN(e){return e.addReducers({recommendation:vo,configuration:Lt}),!0}m();d();f();p();m();d();f();p();function qw(e,t,r){if(!aN(e))throw $t;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},i;return{select:_a(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){i=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){i&&clearTimeout(i)}}}function aN(e){return e.addReducers({configuration:Lt}),!0}function jw(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(Gs(t.options.result)))};return qw(e,t,()=>{n()})}m();d();f();p();m();d();f();p();m();d();f();p();var Xr=()=>new z({required:!1,emptyAllowed:!0}),sl=O("advancedSearchQueries/update",e=>B(e,{aq:Xr(),cq:Xr(),lq:Xr(),dq:Xr()})),cl=O("advancedSearchQueries/register",e=>B(e,{aq:Xr(),cq:Xr(),lq:Xr(),dq:Xr()}));var Lw=Be($r(),e=>{e.addCase(sl,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;Je(n)||(t.aq=n,t.aqWasSet=!0),Je(o)||(t.cq=o,t.cqWasSet=!0),Je(i)||(t.lq=i,t.lqWasSet=!0),Je(a)||(t.dq=a,t.dqWasSet=!0)}).addCase(cl,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;Je(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),Je(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),Je(i)||(t.defaultFilters.lq=i,t.lqWasSet||(t.lq=i)),Je(a)||(t.defaultFilters.dq=a,t.dqWasSet||(t.dq=a))}).addCase(vt.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(Rr,(t,r)=>{let{aq:n,cq:o}=r.payload;Je(n)||(t.aq=n,t.aqWasSet=!0),Je(o)||(t.cq=o,t.cqWasSet=!0)})});function sN(e){return e.addReducers({advancedSearchQueries:Lw}),{updateAdvancedSearchQueries:sl,registerAdvancedSearchQueries:cl}}m();d();f();p();function cN(e){return e.addReducers({configuration:Lt}),{disableAnalytics:no,enableAnalytics:oo,setOriginLevel2:cs,setOriginLevel3:us,updateAnalyticsConfiguration:ro,updateBasicConfiguration:Er}}m();d();f();p();function uN(e){return e.addReducers({configuration:Lt,pipeline:ao,searchHub:bo}),{updateSearchConfiguration:Wt}}m();d();f();p();function lN(e){return e.addReducers({context:rl}),{addContext:Un,removeContext:Vn,setContext:Ln}}m();d();f();p();function dN(e){return e.addReducers({debug:fs}),{disableDebug:ds,enableDebug:ls}}m();d();f();p();function pN(e){return e.addReducers({dictionaryFieldContext:nl}),{addContext:Ko,removeContext:Yo,setContext:Wo}}m();d();f();p();m();d();f();p();m();d();f();p();var fN={collectionField:new z({emptyAllowed:!1,required:!1}),parentField:new z({emptyAllowed:!1,required:!1}),childField:new z({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new oe({min:0,required:!1})},Uw=O("folding/register",e=>B(e,fN)),uye=Ie("folding/loadCollection",/*#__PURE__*/function(){var _ref74=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let i=t(),a=i.configuration.analytics.analyticsMode==="legacy"?yield Dr(i):Eo(i,o),s=yield n.search({...a,q:mN(i),enableQuerySyntax:!0,cq:`@${i.folding.fields.collection}="${e}"`,filterField:i.folding.fields.collection,childField:i.folding.fields.parent,parentField:i.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return yt(s)?r(s.error):{collectionId:e,results:s.success.results,searchUid:s.success.searchUid,rootResult:i.folding.collections[e].result}});return function(_x162,_x163){return _ref74.apply(this,arguments)}}());function mN(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}m();d();f();p();var Vw=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});m();d();f();p();var Zo=O("fields/registerFieldsToInclude",e=>B(e,ss)),ul=O("fields/fetchall/enable"),ll=O("fields/fetchall/disable"),dl=Ie("fields/fetchDescription",/*#__PURE__*/function(){var _ref75=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:i,environment:a,organizationId:s}=o.configuration,{apiBaseUrl:c}=o.configuration.search,u=yield t.apiClient.fieldDescriptions({accessToken:i,organizationId:s,url:c??wr(s,a)});return yt(u)?n(u.error):u.success.fields});return function(_x164,_x165){return _ref75.apply(this,arguments)}}());m();d();f();p();var pl=["author","language","urihash","objecttype","collection","source","permanentid"],kf=[...pl,"date","filetype","parents"],Bw=[...kf,"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"],Gw=()=>({fieldsToInclude:pl,fetchAllFields:!1,fieldsDescription:[]});var fl=Be(Gw(),e=>e.addCase(Zo,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(ul,t=>{t.fetchAllFields=!0}).addCase(ll,t=>{t.fetchAllFields=!1}).addCase(dl.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(Uw,(t,{payload:r})=>{let n=Vw().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));function gN(e){return e.addReducers({fields:fl}),{registerFieldsToInclude:Zo,enableFetchAllFields:ul,disableFetchAllFields:ll,fetchFieldsDescription:dl}}m();d();f();p();function hN(e){return e.addReducers({pipeline:ao}),{setPipeline:io}}m();d();f();p();function yN(e){return e.addReducers({recommendation:vo}),{getRecommendations:Or,setRecommendationId:yo}}m();d();f();p();function vN(e){return e.addReducers({}),{logRecommendationOpen:Gs}}m();d();f();p();m();d();f();p();var SN=new ht({content:new De({required:!0}),conditions:new De({required:!0}),priority:new oe({required:!1,default:0,min:0}),fields:new ve({required:!1,each:Y})});function $w(){let e=[],t=r=>{let n=SN.validate(r);if(!r.conditions.every(i=>i instanceof Function))throw new ii("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(i=>i(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.linkContent:null}}}function Qw(e){if(!bN(e))throw $t;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=$w();return{registerTemplates:(...o)=>{t(...o);let i=[];o.forEach(a=>{a.fields&&i.push(...a.fields)}),e.dispatch(Zo(i))},selectTemplate:r,selectLinkTemplate:n}}function bN(e){return e.addReducers({fields:fl}),!0}m();d();f();p();function wN(e){return e.addReducers({searchHub:bo}),{setSearchHub:So}}/**
38
+ Patch operations: ${JSON.stringify(y,null,2)}
39
+ Error: ${E}`)}}return h()}case M.MESSAGES_SNAPSHOT:{let g=yield Oe(n,a,s,(y,S,E)=>y.onMessagesSnapshotEvent?.({event:v,messages:S,state:E,agent:r,input:e}));if(u(g),g.stopPropagation!==!0){let{messages:y}=v,S=new Map(y.map(T=>[T.id,T])),E=y.some(T=>T.role==="activity"),R=y.some(T=>T.role==="reasoning"),k=T=>T.role==="activity"&&!E||T.role==="reasoning"&&!R;a=a.filter(T=>k(T)||S.has(T.id)).map(T=>k(T)?T:S.get(T.id));let I=new Set(a.map(T=>T.id));for(let T of y)I.has(T.id)||a.push(T);u({messages:a})}return h()}case M.ACTIVITY_SNAPSHOT:{let g=v,y=a.findIndex(I=>I.id===g.messageId),S=y>=0?a[y]:void 0,E=S?.role==="activity"?S:void 0,R=g.replace??!0,k=yield Oe(n,a,s,(I,T,_)=>I.onActivitySnapshotEvent?.({event:g,messages:T,state:_,agent:r,input:e,activityMessage:E,existingMessage:S}));if(u(k),k.stopPropagation!==!0){let I={id:g.messageId,role:"activity",activityType:g.activityType,content:Re(g.content)},T;y===-1?(a.push(I),T=I):E?R&&(a[y]={...E,activityType:g.activityType,content:Re(g.content)}):R&&(a[y]=I,T=I),u({messages:a}),T&&(yield Promise.all(n.map(_=>_.onNewMessage?.({message:T,messages:a,state:s,agent:r,input:e}))))}return h()}case M.ACTIVITY_DELTA:{let g=v,y=a.findIndex(k=>k.id===g.messageId);if(y===-1)return h();let S=a[y];if(S.role!=="activity")return console.warn(`ACTIVITY_DELTA: Message '${g.messageId}' is not an activity message`),h();let E=S,R=yield Oe(n,a,s,(k,I,T)=>k.onActivityDeltaEvent?.({event:g,messages:I,state:T,agent:r,input:e,activityMessage:E}));if(u(R),R.stopPropagation!==!0)try{let k=Re(E.content??{}),I=Oc.applyPatch(k,g.patch??[],!0,!1).newDocument;a[y]={...E,content:Re(I),activityType:g.activityType},u({messages:a})}catch(k){let I=k instanceof Error?k.message:String(k);console.warn(`Failed to apply activity patch for '${g.messageId}': ${I}`)}return h()}case M.RAW:return u(yield Oe(n,a,s,(g,y,S)=>g.onRawEvent?.({event:v,messages:y,state:S,agent:r,input:e}))),h();case M.CUSTOM:return u(yield Oe(n,a,s,(g,y,S)=>g.onCustomEvent?.({event:v,messages:y,state:S,agent:r,input:e}))),h();case M.RUN_STARTED:{let g=yield Oe(n,a,s,(y,S,E)=>y.onRunStartedEvent?.({event:v,messages:S,state:E,agent:r,input:e}));if(u(g),g.stopPropagation!==!0){let y=v;if(y.input?.messages){for(let S of y.input.messages)a.find(E=>E.id===S.id)||a.push(S);u({messages:a})}}return h()}case M.RUN_FINISHED:{let g=v,y=g.outcome?.type==="interrupt"?{event:g,outcome:"interrupt",interrupts:g.outcome.interrupts}:{event:g,outcome:"success",result:g.result},S=yield Oe(n,a,s,(E,R,k)=>E.onRunFinishedEvent?.({...y,messages:R,state:k,agent:r,input:e}));return u(S),S.stopPropagation!==!0&&(r.pendingInterrupts=y.outcome==="interrupt"?[...y.interrupts]:[]),h()}case M.RUN_ERROR:return u(yield Oe(n,a,s,(g,y,S)=>g.onRunErrorEvent?.({event:v,messages:y,state:S,agent:r,input:e}))),h();case M.STEP_STARTED:return u(yield Oe(n,a,s,(g,y,S)=>g.onStepStartedEvent?.({event:v,messages:y,state:S,agent:r,input:e}))),h();case M.STEP_FINISHED:return u(yield Oe(n,a,s,(g,y,S)=>g.onStepFinishedEvent?.({event:v,messages:y,state:S,agent:r,input:e}))),h();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 h();case M.THINKING_END:return h();case M.THINKING_TEXT_MESSAGE_START:return h();case M.THINKING_TEXT_MESSAGE_CONTENT:return h();case M.THINKING_TEXT_MESSAGE_END:return h();case M.REASONING_START:return u(yield Oe(n,a,s,(g,y,S)=>g.onReasoningStartEvent?.({event:v,messages:y,state:S,agent:r,input:e}))),h();case M.REASONING_MESSAGE_START:{let g=yield Oe(n,a,s,(y,S,E)=>y.onReasoningMessageStartEvent?.({event:v,messages:S,state:E,agent:r,input:e}));if(u(g),g.stopPropagation!==!0){let{messageId:y}=v;if(!a.find(S=>S.id===y)){let S={id:y,role:"reasoning",content:""};a.push(S),u({messages:a})}}return h()}case M.REASONING_MESSAGE_CONTENT:{let{messageId:g,delta:y}=v,S=a.find(R=>R.id===g);if(!S)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${g}'`),h();let E=yield Oe(n,a,s,(R,k,I)=>R.onReasoningMessageContentEvent?.({event:v,messages:k,state:I,agent:r,input:e,reasoningMessageBuffer:typeof S.content=="string"?S.content:""}));return u(E),E.stopPropagation!==!0&&(S.content=`${typeof S.content=="string"?S.content:""}${y}`,u({messages:a})),h()}case M.REASONING_MESSAGE_END:{let{messageId:g}=v,y=a.find(S=>S.id===g);return y?(u(yield Oe(n,a,s,(S,E,R)=>S.onReasoningMessageEndEvent?.({event:v,messages:E,state:R,agent:r,input:e,reasoningMessageBuffer:typeof y.content=="string"?y.content:""}))),yield Promise.all(n.map(S=>{S.onNewMessage?.({message:y,messages:a,state:s,agent:r,input:e})})),h()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${g}'`),h())}case M.REASONING_MESSAGE_CHUNK:throw Error("REASONING_MESSAGE_CHUNK must be transformed before being applied");case M.REASONING_END:return u(yield Oe(n,a,s,(g,y,S)=>g.onReasoningEndEvent?.({event:v,messages:y,state:S,agent:r,input:e}))),h();case M.REASONING_ENCRYPTED_VALUE:{let{subtype:g,entityId:y,encryptedValue:S}=v,E=yield Oe(n,a,s,(R,k,I)=>R.onReasoningEncryptedValueEvent?.({event:v,messages:k,state:I,agent:r,input:e}));if(u(E),E.stopPropagation!==!0){let R=!1;if(g==="tool-call"){for(let k of a)if(k.role==="assistant"&&k.toolCalls){let I=k.toolCalls.find(T=>T.id===y);if(I){I.encryptedValue=S,R=!0;break}}}else{let k=a.find(I=>I.id===y);k?.role!=="activity"&&k&&(k.encryptedValue=S,R=!0)}R&&(c.messages=a)}return h()}}return v.type,h()});return function(_x92){return _ref43.apply(this,arguments)}}()),$p(),n.length>0?Qp({}):v=>v)},df=e=>t=>{let r=ya(e),n=new Map,o=new Map,i=!1,a=!1,s=!1,c=new Map,u=!1,h=!1,v=!1,C=()=>{n.clear(),o.clear(),c.clear(),u=!1,h=!1,i=!1,a=!1,v=!0};return t.pipe(wt(g=>{let y=g.type;if(r?.event("VERIFY","Event:",g,{type:g.type}),a)return Ve(()=>new Le(`Cannot send event type '${y}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(i&&y!==M.RUN_ERROR&&y!==M.RUN_STARTED)return Ve(()=>new Le(`Cannot send event type '${y}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(s){if(y===M.RUN_STARTED){if(v&&!i)return Ve(()=>new Le("Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run."));i&&C()}}else if(s=!0,y!==M.RUN_STARTED&&y!==M.RUN_ERROR)return Ve(()=>new Le("First event must be 'RUN_STARTED'"));switch(y){case M.TEXT_MESSAGE_START:{let S=g.messageId;return n.has(S)?Ve(()=>new Le(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${S}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(n.set(S,!0),Ge(g))}case M.TEXT_MESSAGE_CONTENT:{let S=g.messageId;return n.has(S)?Ge(g):Ve(()=>new Le(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${S}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case M.TEXT_MESSAGE_END:{let S=g.messageId;return n.has(S)?(n.delete(S),Ge(g)):Ve(()=>new Le(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${S}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case M.TOOL_CALL_START:{let S=g.toolCallId;return o.has(S)?Ve(()=>new Le(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${S}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(o.set(S,!0),Ge(g))}case M.TOOL_CALL_ARGS:{let S=g.toolCallId;return o.has(S)?Ge(g):Ve(()=>new Le(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${S}'. Start a tool call with 'TOOL_CALL_START' first.`))}case M.TOOL_CALL_END:{let S=g.toolCallId;return o.has(S)?(o.delete(S),Ge(g)):Ve(()=>new Le(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${S}'. A 'TOOL_CALL_START' event must be sent first.`))}case M.STEP_STARTED:{let S=g.stepName;return c.has(S)?Ve(()=>new Le(`Step "${S}" is already active for 'STEP_STARTED'`)):(c.set(S,!0),Ge(g))}case M.STEP_FINISHED:{let S=g.stepName;return c.has(S)?(c.delete(S),Ge(g)):Ve(()=>new Le(`Cannot send 'STEP_FINISHED' for step "${S}" that was not started`))}case M.RUN_STARTED:return v=!0,Ge(g);case M.RUN_FINISHED:if(c.size>0){let S=Array.from(c.keys()).join(", ");return Ve(()=>new Le(`Cannot send 'RUN_FINISHED' while steps are still active: ${S}`))}if(n.size>0){let S=Array.from(n.keys()).join(", ");return Ve(()=>new Le(`Cannot send 'RUN_FINISHED' while text messages are still active: ${S}`))}if(o.size>0){let S=Array.from(o.keys()).join(", ");return Ve(()=>new Le(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${S}`))}return i=!0,Ge(g);case M.RUN_ERROR:return a=!0,Ge(g);case M.CUSTOM:return Ge(g);case M.THINKING_TEXT_MESSAGE_START:return u?h?Ve(()=>new Le("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.")):(h=!0,Ge(g)):Ve(()=>new Le("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 h?Ge(g):Ve(()=>new Le("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 h?(h=!1,Ge(g)):Ve(()=>new Le("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 u?Ve(()=>new Le("Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.")):(u=!0,Ge(g));case M.THINKING_END:return u?(u=!1,Ge(g)):Ve(()=>new Le("Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."));default:return Ge(g)}}))},jn=function(e){return e.HEADERS="headers",e.DATA="data",e}({}),fO=e=>eu(()=>Fn(e())).pipe(Hp(t=>{if(!t.ok){let o=t.headers.get("content-type")||"";return Fn(t.text()).pipe(wt(i=>{let a=i;if(o.includes("application/json"))try{a=JSON.parse(i)}catch{}let s=Error(`HTTP ${t.status}: ${typeof a=="string"?a:JSON.stringify(a)}`);return s.status=t.status,s.payload=a,Ve(()=>s)}))}let r={type:jn.HEADERS,status:t.status,headers:t.headers},n=t.body?.getReader();return n?new Ue(o=>(o.next(r),_asyncToGenerator(function*(){try{for(;;){let{done:i,value:a}=yield n.read();if(i)break;let s={type:jn.DATA,data:a};o.next(s)}o.complete()}catch(i){o.error(i)}})(),()=>{n.cancel().catch(i=>{if(i?.name!=="AbortError")throw i})})):Ve(()=>Error("Failed to getReader() from response"))})),mO=(e,t)=>{let r=ya(t),n=new rr,o=new TextDecoder("utf-8",{fatal:!1}),i="";e.subscribe({next:s=>{if(s.type!==jn.HEADERS&&s.type===jn.DATA&&s.data){let c=o.decode(s.data,{stream:!0});i+=c;let u=i.split(/\n\n/);i=u.pop()||"";for(let h of u)a(h)}},error:s=>n.error(s),complete:()=>{i&&(i+=o.decode(),a(i)),n.complete()}});function a(s){let c=s.split(`
40
+ `),u=[];for(let h of c)h.startsWith("data:")&&u.push(h.slice(5).replace(/^ /,""));if(u.length>0)try{let h=u.join(`
41
+ `),v=JSON.parse(h);r?.event("SSE","Event received:",v,{type:v.type}),n.next(v)}catch(h){n.error(h)}}return n.asObservable()},gO=e=>{let t=new rr,r=new Uint8Array;e.subscribe({next:o=>{if(o.type!==jn.HEADERS&&o.type===jn.DATA&&o.data){let i=new Uint8Array(r.length+o.data.length);i.set(r,0),i.set(o.data,r.length),r=i,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 i=r.slice(4,o),a=nb(i);t.next(a),r=r.slice(o)}catch(i){let a=i instanceof Error?i.message:String(i);t.error(Error(`Failed to decode protocol buffer message: ${a}`));return}}}return t.asObservable()},hO=(e,t)=>{let r=ya(t),n=new rr,o=new Lc,i=!1;return e.subscribe({next:a=>{if(o.next(a),a.type===jn.HEADERS&&!i){i=!0;let s=a.headers.get("content-type");r?.lifecycle("HTTP","Stream format detected:",{contentType:s,parser:s===sf?"protobuf":"sse"}),s===sf?gO(o).subscribe({next:c=>n.next(c),error:c=>n.error(c),complete:()=>n.complete()}):mO(o,r).subscribe({next:c=>{try{let u=xc.parse(c);r?.event("HTTP","Event validated:",u,{type:u.type,valid:!0}),n.next(u)}catch(u){r?.event("HTTP","Event invalid:",{json:c,error:String(u)}),n.error(u)}},error:c=>{if(c?.name==="AbortError"){n.next({type:M.RUN_ERROR,message:c.message||"Request aborted",code:"abort",rawEvent:c}),n.complete();return}return n.error(c)},complete:()=>n.complete()})}else i||n.error(Error("No headers event received before data events"))},error:a=>{o.error(a),n.error(a)},complete:()=>{o.complete()}}),n.asObservable()},qe=b.enum(["TextMessageStart","TextMessageContent","TextMessageEnd","ActionExecutionStart","ActionExecutionArgs","ActionExecutionEnd","ActionExecutionResult","AgentStateMessage","MetaEvent","RunStarted","RunFinished","RunError","NodeStarted","NodeFinished"]),yO=b.enum(["LangGraphInterruptEvent","PredictState","Exit"]),vO=b.object({type:b.literal(qe.enum.TextMessageStart),messageId:b.string(),parentMessageId:b.string().optional(),role:b.string().optional()}),SO=b.object({type:b.literal(qe.enum.TextMessageContent),messageId:b.string(),content:b.string()}),bO=b.object({type:b.literal(qe.enum.TextMessageEnd),messageId:b.string()}),wO=b.object({type:b.literal(qe.enum.ActionExecutionStart),actionExecutionId:b.string(),actionName:b.string(),parentMessageId:b.string().optional()}),AO=b.object({type:b.literal(qe.enum.ActionExecutionArgs),actionExecutionId:b.string(),args:b.string()}),xO=b.object({type:b.literal(qe.enum.ActionExecutionEnd),actionExecutionId:b.string()}),CO=b.object({type:b.literal(qe.enum.ActionExecutionResult),actionName:b.string(),actionExecutionId:b.string(),result:b.string()}),EO=b.object({type:b.literal(qe.enum.AgentStateMessage),threadId:b.string(),agentName:b.string(),nodeName:b.string(),runId:b.string(),active:b.boolean(),role:b.string(),state:b.string(),running:b.boolean()}),RO=b.object({type:b.literal(qe.enum.MetaEvent),name:yO,value:b.any()}),IO=b.object({type:b.literal(qe.enum.RunError),message:b.string(),code:b.string().optional()});b.discriminatedUnion("type",[vO,SO,bO,wO,AO,xO,CO,EO,RO,IO]),b.object({id:b.string(),role:b.string(),content:b.string(),parentMessageId:b.string().optional()}),b.object({id:b.string(),name:b.string(),arguments:b.any(),parentMessageId:b.string().optional()}),b.object({id:b.string(),result:b.any(),actionExecutionId:b.string(),actionName:b.string()});var TO=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
+ `)},_O=(e,t,r)=>n=>{let o={},i=!0,a=!0,s="",c=null,u=null,h=[],v={},C=g=>{typeof g=="object"&&g&&("messages"in g&&delete g.messages,o=g)};return n.pipe(wt(g=>{switch(g.type){case M.TEXT_MESSAGE_START:{let y=g;return[{type:qe.enum.TextMessageStart,messageId:y.messageId,role:y.role}]}case M.TEXT_MESSAGE_CONTENT:{let y=g;return[{type:qe.enum.TextMessageContent,messageId:y.messageId,content:y.delta}]}case M.TEXT_MESSAGE_END:{let y=g;return[{type:qe.enum.TextMessageEnd,messageId:y.messageId}]}case M.TOOL_CALL_START:{let y=g;return h.push({id:y.toolCallId,type:"function",function:{name:y.toolCallName,arguments:""}}),a=!0,v[y.toolCallId]=y.toolCallName,[{type:qe.enum.ActionExecutionStart,actionExecutionId:y.toolCallId,actionName:y.toolCallName,parentMessageId:y.parentMessageId}]}case M.TOOL_CALL_ARGS:{let y=g,S=h.find(R=>R.id===y.toolCallId);if(!S)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${y.toolCallId}'`),[];S.function.arguments+=y.delta;let E=!1;if(u){let R=u.find(k=>k.tool==S.function.name);if(R)try{let k=JSON.parse(nu(S.function.arguments));R.tool_argument&&R.tool_argument in k?(C({...o,[R.state_key]:k[R.tool_argument]}),E=!0):R.tool_argument||(C({...o,[R.state_key]:k}),E=!0)}catch{}}return[{type:qe.enum.ActionExecutionArgs,actionExecutionId:y.toolCallId,args:y.delta},...(E?[{type:qe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}]:[])]}case M.TOOL_CALL_END:{let y=g;return[{type:qe.enum.ActionExecutionEnd,actionExecutionId:y.toolCallId}]}case M.TOOL_CALL_RESULT:{let y=g;return[{type:qe.enum.ActionExecutionResult,actionExecutionId:y.toolCallId,result:y.content,actionName:v[y.toolCallId]||"unknown"}]}case M.RAW:return[];case M.CUSTOM:{let y=g;switch(y.name){case"Exit":i=!1;break;case"PredictState":u=y.value;break}return[{type:qe.enum.MetaEvent,name:y.name,value:y.value}]}case M.STATE_SNAPSHOT:return C(g.snapshot),[{type:qe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}];case M.STATE_DELTA:{let y=g,S=Oc.applyPatch(o,y.delta,!0,!1);return S?(C(S.newDocument),[{type:qe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}]):[]}case M.MESSAGES_SNAPSHOT:return c=g.messages,[{type:qe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify({...o,...(c?{messages:c}:{})}),active:!0}];case M.RUN_STARTED:return[];case M.RUN_FINISHED:return c&&(o.messages=c),Object.keys(o).length===0?[]:[{type:qe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify({...o,...(c?{messages:kO(c)}:{})}),active:!1}];case M.RUN_ERROR:{let y=g;return[{type:qe.enum.RunError,message:y.message,code:y.code}]}case M.STEP_STARTED:return s=g.stepName,h=[],u=null,[{type:qe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:!0}];case M.STEP_FINISHED:return h=[],u=null,[{type:qe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:!1}];default:return[]}}))};function kO(e){let t=[];for(let r of e)if(r.role==="assistant"||r.role==="user"||r.role==="system"){let n=TO(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 i={id:o.id,name:o.function.name,arguments:JSON.parse(o.function.arguments),parentMessageId:r.id};t.push(i)}}else if(r.role==="tool"){let n="unknown";for(let i of e)if(i.role==="assistant"&&i.toolCalls?.length){for(let a of i.toolCalls)if(a.id===r.toolCallId){n=a.function.name;break}}let o={id:r.id,result:r.content,actionExecutionId:r.toolCallId,actionName:n};t.push(o)}return t}var ju=e=>t=>{let r=ya(e),n,o,i,a,s=()=>{if(!n||a!=="text")throw Error("No text message to close");let v={type:M.TEXT_MESSAGE_END,messageId:n.messageId};return a=void 0,n=void 0,r?.event("TRANSFORM","TEXT_MESSAGE_END",v,{messageId:v.messageId}),v},c=()=>{if(!o||a!=="tool")throw Error("No tool call to close");let v={type:M.TOOL_CALL_END,toolCallId:o.toolCallId};return a=void 0,o=void 0,r?.event("TRANSFORM","TOOL_CALL_END",v,{toolCallId:v.toolCallId}),v},u=()=>{if(!i||a!=="reasoning")throw Error("No reasoning message to close");let v={type:M.REASONING_MESSAGE_END,messageId:i.messageId};return a=void 0,i=void 0,r?.event("TRANSFORM","REASONING_MESSAGE_END",v,{messageId:v.messageId}),v},h=()=>a==="text"?[s()]:a==="tool"?[c()]:a==="reasoning"?[u()]:[];return t.pipe(wt(v=>{switch(v.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[...h(),v];case M.RAW:case M.ACTIVITY_SNAPSHOT:case M.ACTIVITY_DELTA:case M.REASONING_ENCRYPTED_VALUE:return[v];case M.TEXT_MESSAGE_CHUNK:{let C=v,g=[];if((a!=="text"||C.messageId!==void 0&&C.messageId!==n?.messageId)&&g.push(...h()),a!=="text"){if(C.messageId===void 0)throw Error("First TEXT_MESSAGE_CHUNK must have a messageId");n={messageId:C.messageId,name:C.name},a="text";let y={type:M.TEXT_MESSAGE_START,messageId:C.messageId,role:C.role||"assistant",...(C.name!==void 0&&{name:C.name})};g.push(y),r?.event("TRANSFORM","TEXT_MESSAGE_START",y,{messageId:C.messageId})}if(C.delta!==void 0){let y={type:M.TEXT_MESSAGE_CONTENT,messageId:n.messageId,delta:C.delta};g.push(y),r?.event("TRANSFORM","TEXT_MESSAGE_CONTENT",y,{messageId:n.messageId})}return g}case M.TOOL_CALL_CHUNK:{let C=v,g=[];if((a!=="tool"||C.toolCallId!==void 0&&C.toolCallId!==o?.toolCallId)&&g.push(...h()),a!=="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},a="tool";let y={type:M.TOOL_CALL_START,toolCallId:C.toolCallId,toolCallName:C.toolCallName,parentMessageId:C.parentMessageId};g.push(y),r?.event("TRANSFORM","TOOL_CALL_START",y,{toolCallId:C.toolCallId,toolCallName:C.toolCallName})}if(C.delta!==void 0){let y={type:M.TOOL_CALL_ARGS,toolCallId:o.toolCallId,delta:C.delta};g.push(y),r?.event("TRANSFORM","TOOL_CALL_ARGS",y,{toolCallId:o.toolCallId})}return g}case M.REASONING_MESSAGE_CHUNK:{let C=v,g=[];if((a!=="reasoning"||C.messageId&&C.messageId!==i?.messageId)&&g.push(...h()),a!=="reasoning"){if(C.messageId===void 0)throw Error("First REASONING_MESSAGE_CHUNK must have a messageId");i={messageId:C.messageId},a="reasoning";let y={type:M.REASONING_MESSAGE_START,messageId:C.messageId};g.push(y),r?.event("TRANSFORM","REASONING_MESSAGE_START",y,{messageId:C.messageId})}if(C.delta!==void 0){let y={type:M.REASONING_MESSAGE_CONTENT,messageId:i.messageId,delta:C.delta};g.push(y),r?.event("TRANSFORM","REASONING_MESSAGE_CONTENT",y,{messageId:i.messageId})}return g}}return v.type,[]}),Mn(()=>{h()}))};function OO(e,t=new Date){return e.expiresAt===void 0?!1:new Date(e.expiresAt)<=t}var Lu=class{runNext(e,t){return t.run(e).pipe(ju(!1))}runNextWithState(e,t){let r=Re(e.messages||[]),n=Re(e.state||{}),o=new Lc;return fb(e,o,t,[]).subscribe(i=>{i.messages!==void 0&&(r=i.messages),i.state!==void 0&&(n=i.state)}),this.runNext(e,t).pipe(tu(/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(i){return o.next(i),yield new Promise(a=>setTimeout(a,0)),{event:i,messages:Re(r),state:Re(n)}});return function(_x93){return _ref45.apply(this,arguments)}}()))}},PO=class extends Lu{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function NO(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 FO=class extends Lu{run(e,t){let{parentRunId:r,...n}=e,o={...n,messages:n.messages.map(NO)};return this.runNext(o,t)}},cb="THINKING_START",ub="THINKING_END",lb="THINKING_TEXT_MESSAGE_START",db="THINKING_TEXT_MESSAGE_CONTENT",pb="THINKING_TEXT_MESSAGE_END",DO=class extends Lu{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(Dn(r=>this.transformEvent(r)))}transformEvent(e){switch(e.type){case cb:{this.currentReasoningId=ha();let{title:t,...r}=e;return this.warnAboutTransformation(cb,M.REASONING_START),{...r,type:M.REASONING_START,messageId:this.currentReasoningId}}case lb:return this.currentMessageId=ha(),this.warnAboutTransformation(lb,M.REASONING_MESSAGE_START),{...e,type:M.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case db:{let{delta:t,...r}=e;return this.warnAboutTransformation(db,M.REASONING_MESSAGE_CONTENT),{...r,type:M.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??ha(),delta:t}}case pb:{let t=this.currentMessageId??ha();return this.warnAboutTransformation(pb,M.REASONING_MESSAGE_END),{...e,type:M.REASONING_MESSAGE_END,messageId:t}}case ub:{let t=this.currentReasoningId??ha();return this.warnAboutTransformation(ub,M.REASONING_END),{...e,type:M.REASONING_END,messageId:t}}default:return e}}};function MO(e){return e.startsWith("image/")?"image":e.startsWith("audio/")?"audio":e.startsWith("video/")?"video":"document"}function qO(e){return typeof e=="object"&&!!e&&"type"in e&&e.type==="binary"&&"mimeType"in e&&typeof e.mimeType=="string"}function jO(e){let t=MO(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 LO(e){let t=e.content;if(!Array.isArray(t))return e;let r=t.map(n=>qO(n)?jO(n):n);return{...e,content:r}}var UO=class extends Lu{run(e,t){let r={...e,messages:e.messages.map(LO)};return this.runNext(r,t)}},VO="0.0.58",BO=class{get maxVersion(){return VO}get debug(){return this._debug}set debug(e){this._debug=qu(e),this._debugLogger=lf(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){typeof e=="boolean"?this._debugLogger=e?lf(qu(!0)):void 0:this._debugLogger=e}constructor({agentId:e,description:t,threadId:r,initialMessages:n,initialState:o,debug:i}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.agentId=e,this.description=t??"",this.threadId=r??jr(),this.messages=Re(n??[]),this.state=Re(o??{}),this._debug=qu(i),this._debugLogger=lf(this._debug),ga(this.maxVersion,"0.0.39")<=0&&this.middlewares.unshift(new FO),ga(this.maxVersion,"0.0.45")<=0&&this.middlewares.unshift(new DO),ga(this.maxVersion,"0.0.47")<=0&&this.middlewares.unshift(new UO)}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 PO(r):r);return this.middlewares.push(...t),this}runAgent(e,t){var _this14=this;return _asyncToGenerator(function*(){try{_this14.isRunning=!0,_this14.agentId=_this14.agentId??jr();let r=_this14.prepareRunAgentInput(e);_this14.debugLogger?.lifecycle("LIFECYCLE","Run started:",{agentId:_this14.agentId,threadId:_this14.threadId});let n,o=new Set(_this14.messages.map(c=>c.id)),i=[{onRunFinishedEvent:c=>{c.outcome==="success"&&(n=c.result)}},..._this14.subscribers,t??{}];yield _this14.onInitialize(r,i),_this14.activeRunDetach$=new rr;let a;_this14.activeRunCompletionPromise=new Promise(c=>{a=c}),yield Jc(jc(()=>_this14.middlewares.length===0?_this14.run(r):_this14.middlewares.reduceRight((c,u)=>({run:h=>u.run(h,c),get messages(){return c.messages},get state(){return c.state}}),_this14).run(r),ju(_this14.debugLogger),df(_this14.debugLogger),c=>c.pipe(ru(_this14.activeRunDetach$)),c=>_this14.apply(r,c,i),c=>_this14.processApplyEvents(r,c,i),da(c=>(_this14.debugLogger?.lifecycle("LIFECYCLE","Run errored:",{agentId:_this14.agentId,error:c instanceof Error?c.message:String(c)}),_this14.isRunning=!1,_this14.onError(r,c,i))),Mn(()=>{_this14.debugLogger?.lifecycle("LIFECYCLE","Run finished:",{agentId:_this14.agentId,threadId:_this14.threadId}),_this14.isRunning=!1,_this14.onFinalize(r,i),a?.(),a=void 0,_this14.activeRunCompletionPromise=void 0,_this14.activeRunDetach$=void 0}))(Ge(null)));let s=Re(_this14.messages).filter(c=>!o.has(c.id));return{result:n,newMessages:s}}finally{_this14.isRunning=!1}})()}connect(e){throw new Op}connectAgent(e,t){var _this15=this;return _asyncToGenerator(function*(){try{_this15.isRunning=!0,_this15.agentId=_this15.agentId??jr();let r=_this15.prepareRunAgentInput(e),n,o=new Set(_this15.messages.map(c=>c.id)),i=[{onRunFinishedEvent:c=>{c.outcome==="success"&&(n=c.result)}},..._this15.subscribers,t??{}];yield _this15.onInitialize(r,i),_this15.activeRunDetach$=new rr;let a;_this15.activeRunCompletionPromise=new Promise(c=>{a=c}),yield Jc(jc(()=>eu(()=>_this15.connect(r)),ju(_this15.debugLogger),df(_this15.debugLogger),c=>c.pipe(ru(_this15.activeRunDetach$)),c=>_this15.apply(r,c,i),c=>_this15.processApplyEvents(r,c,i),da(c=>(_this15.isRunning=!1,c instanceof Op?Uc:_this15.onError(r,c,i))),Mn(()=>{_this15.isRunning=!1,_this15.onFinalize(r,i),a?.(),a=void 0,_this15.activeRunCompletionPromise=void 0,_this15.activeRunDetach$=void 0}))(Ge(null)),{defaultValue:void 0});let s=Re(_this15.messages).filter(c=>!o.has(c.id));return{result:n,newMessages:s}}finally{_this15.isRunning=!1}})()}abortRun(){}detachActiveRun(){var _this16=this;return _asyncToGenerator(function*(){if(!_this16.activeRunDetach$)return;let e=_this16.activeRunCompletionPromise??Promise.resolve();_this16.activeRunDetach$.next(),_this16.activeRunDetach$?.complete(),yield e})()}apply(e,t,r){return fb(e,t,this,r,this.debugLogger)}processApplyEvents(e,t,r){return t.pipe(zp(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=Re(this.messages).filter(r=>r.role!=="activity");return{threadId:this.threadId,runId:e?.runId||jr(),tools:Re(e?.tools??[]),context:Re(e?.context??[]),forwardedProps:Re(e?.forwardedProps??{}),state:Re(this.state),messages:t,...(e?.resume===void 0?{}:{resume:Re(e.resume)})}}onInitialize(e,t){var _this17=this;return _asyncToGenerator(function*(){if(_this17.pendingInterrupts.length>0){let n=new Set((e.resume??[]).map(i=>i.interruptId)),o=_this17.pendingInterrupts.map(i=>i.id).filter(i=>!n.has(i));if(o.length>0)throw new Le(`Thread has ${o.length} pending interrupt(s) not addressed by resume: ${o.join(", ")}`);for(let i of _this17.pendingInterrupts)if(OO(i))throw new Le(`Interrupt ${i.id} expired at ${i.expiresAt}`)}let r=yield Oe(t,_this17.messages,_this17.state,(n,o,i)=>n.onRunInitialized?.({messages:o,state:i,agent:_this17,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages&&(_this17.messages=r.messages,e.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this17.messages,state:_this17.state,agent:_this17,input:e})})),r.state&&(_this17.state=r.state,e.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this17.state,messages:_this17.messages,agent:_this17,input:e})})))})()}onError(e,t,r){return Fn(Oe(r,this.messages,this.state,(n,o,i)=>n.onRunFailed?.({error:t,messages:o,state:i,agent:this,input:e}))).pipe(Dn(n=>{let o=n;if((o.messages!==void 0||o.state!==void 0)&&(o.messages!==void 0&&(this.messages=o.messages,r.forEach(i=>{i.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),o.state!==void 0&&(this.state=o.state,r.forEach(i=>{i.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),o.stopPropagation!==!0){let i=String(t);if(!(t.name==="AbortError"||t.message==="Fetch is aborted"||t.message==="signal is aborted without reason"||t.message==="component unmounted"||i==="component unmounted"))throw console.error("Agent execution failed:",t),t}return{}}))}onFinalize(e,t){var _this18=this;return _asyncToGenerator(function*(){let r=yield Oe(t,_this18.messages,_this18.state,(n,o,i)=>n.onRunFinalized?.({messages:o,state:i,agent:_this18,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages!==void 0&&(_this18.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this18.messages,state:_this18.state,agent:_this18,input:e})})),r.state!==void 0&&(_this18.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this18.state,messages:_this18.messages,agent:_this18,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=Re(this.messages),e.state=Re(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=Re(this.pendingInterrupts),e}addMessage(e){var _this19=this;this.messages.push(e),_asyncToGenerator(function*(){for(let t of _this19.subscribers)yield t.onNewMessage?.({message:e,messages:_this19.messages,state:_this19.state,agent:_this19});if(e.role==="assistant"&&e.toolCalls)for(let t of e.toolCalls)for(let r of _this19.subscribers)yield r.onNewToolCall?.({toolCall:t,messages:_this19.messages,state:_this19.state,agent:_this19});for(let t of _this19.subscribers)yield t.onMessagesChanged?.({messages:_this19.messages,state:_this19.state,agent:_this19})})()}addMessages(e){var _this20=this;this.messages.push(...e),_asyncToGenerator(function*(){for(let t of e){for(let r of _this20.subscribers)yield r.onNewMessage?.({message:t,messages:_this20.messages,state:_this20.state,agent:_this20});if(t.role==="assistant"&&t.toolCalls)for(let r of t.toolCalls)for(let n of _this20.subscribers)yield n.onNewToolCall?.({toolCall:r,messages:_this20.messages,state:_this20.state,agent:_this20})}for(let t of _this20.subscribers)yield t.onMessagesChanged?.({messages:_this20.messages,state:_this20.state,agent:_this20})})()}setMessages(e){var _this21=this;this.messages=Re(e),_asyncToGenerator(function*(){for(let t of _this21.subscribers)yield t.onMessagesChanged?.({messages:_this21.messages,state:_this21.state,agent:_this21})})()}setState(e){var _this22=this;this.state=Re(e),_asyncToGenerator(function*(){for(let t of _this22.subscribers)yield t.onStateChanged?.({messages:_this22.messages,state:_this22.state,agent:_this22})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??jr();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(ju(this.debugLogger),df(this.debugLogger),_O(this.threadId,t.runId,this.agentId),r=>r.pipe(Dn(n=>(this.debugLogger?.event("LEGACY","Event:",n,{type:n.type}),n))))}},mb=class extends BO{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 l.AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new l.AbortController,this.url=e.url,this.headers=Re(e.headers??{}),this.fetch=e.fetch??((t,r)=>A(t,r))}run(e){return hO(fO(()=>this.fetch(this.url,this.requestInit(e))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=Re(this.headers??{}),e.fetch=this.fetch;let t=new l.AbortController,r=this.abortController.signal;return r.aborted&&t.abort(r.reason),e.abortController=t,e}};m();d();f();p();var gb=(e,t,r)=>{let n=It(t,r),o=e?.trim();if(!n||!t||!o)throw new Error("Missing required parameters for answer endpoint");let i=`/api/v1/organizations/${t}/agents`;return`${n}${i}/${o}`};var mf=class extends mb{requestInit(t){let{params:r,accessToken:n,recordDebugSession:o}=t.forwardedProps||{},i={...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(i),signal:this.abortController.signal}}},hb=(e,t,r)=>new mf({url:`${gb(e,t,r)}/answer`});m();d();f();p();m();d();f();p();var GO=new z({required:!0}),yb=new z({required:!0,constrainTo:sc}),vb=e=>({...e,name:cc(e.name)}),Sb=O("followUpAnswers/setIsEnabled",e=>B(e,new fe({required:!0}))),bb=O("followUpAnswers/setFollowUpAnswersConversationId",e=>B(e,Y)),wb=O("followUpAnswers/setFollowUpAnswersConversationToken",e=>B(e,Y)),Ab=O("followUpAnswers/clearFollowUpAnswersConversationToken"),_re=O("followUpAnswers/createFollowUpAnswer",e=>B(e,{question:Y})),kre=O("followUpAnswers/setActiveFollowUpAnswerId",e=>B(e,Y)),Ore=O("followUpAnswers/setFollowUpAnswerContentFormat",e=>B(e,{contentFormat:lc,answerId:Y})),Pre=O("followUpAnswers/setFollowUpIsLoading",e=>B(e,{isLoading:new fe({required:!0}),answerId:Y})),Nre=O("followUpAnswers/setFollowUpIsStreaming",e=>B(e,{isStreaming:new fe({required:!0}),answerId:Y})),Fre=O("followUpAnswers/followUpMessageChunkReceived",e=>B(e,{textDelta:GO,answerId:Y})),Dre=O("followUpAnswers/followUpCitationsReceived",e=>B(e,{citations:new Se({required:!0,each:new ne({values:yp})}),answerId:Y})),Mre=O("followUpAnswers/followUpCompleted",e=>B(e,{answerId:Y,cannotAnswer:new fe({required:!1})})),qre=O("followUpAnswers/followUpFailed",e=>B(e,{message:new z,code:new oe({min:0}),answerId:Y})),jre=O("followUpAnswers/activeFollowUpStartFailed",e=>B(e,{message:new z})),Lre=O("followUpAnswers/likeFollowUp",e=>B(e,{answerId:Y})),Ure=O("followUpAnswers/dislikeFollowUp",e=>B(e,{answerId:Y})),Vre=O("followUpAnswers/submitFollowUpFeedback",e=>B(e,{answerId:Y})),xb=O("followUpAnswers/resetFollowUpAnswers"),Bre=O("followUpAnswers/stepStarted",e=>B(vb(e),{answerId:Y,name:yb,startedAt:new oe({min:0,required:!0})})),Gre=O("followUpAnswers/stepFinished",e=>B(vb(e),{answerId:Y,name:yb,finishedAt:new oe({min:0,required:!0})})),$re=O("followUpAnswers/startToolCall",e=>B(e,{answerId:Y,toolCallName:Y,startedAt:new oe({min:0,required:!0}),toolCallId:Y})),Qre=O("followUpAnswers/finishToolCall",e=>B(e,{answerId:Y,finishedAt:new oe({min:0,required:!0}),toolCallId:Y})),Hre=O("followUpAnswers/toolCallArgs",e=>B(e,{answerId:Y,toolCallId:Y,args:new ne({options:{required:!0}}),type:new z({required:!0,constrainTo:uc})}));m();d();f();p();var $O={"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 Cb(e){return e?$O[e]??1004:1004}var Eb=e=>{let t="",r=!1;return{onRunStartedEvent:({event:n})=>{t=n.runId,r=!1,e(dc(n.runId)),e(qr(!1)),e(Yi(!0)),e(bb(n.threadId)),e(Ab())},onStepStartedEvent:({event:n,agent:o})=>{o.isRunning!==!1&&e(Wy({name:n.stepName,startedAt:n.timestamp??Date.now()}))},onStepFinishedEvent:({event:n,agent:o})=>{o.isRunning!==!1&&e(Ky({name:n.stepName,finishedAt:n.timestamp??Date.now()}))},onToolCallStartEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{toolCallName:i,toolCallId:a,timestamp:s}=n;e(Yy({toolCallId:a,toolCallName:i,startedAt:s??Date.now()}))},onToolCallEndEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{toolCallId:i,timestamp:a}=n;e(Xy({toolCallId:i,finishedAt:a??Date.now()}))},onToolCallArgsEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{toolCallId:i,delta:a}=n;try{let s=JSON.parse(a);typeof s?.q=="string"?e(fc({toolCallId:i,args:s,type:"search"})):e(fc({toolCallId:i,args:{raw:a},type:"generic"}))}catch{console.warn(`Failed to parse tool call args delta as JSON. Using raw string instead. Delta: ${a}`),e(fc({toolCallId:i,args:{raw:a},type:"generic"}))}},onTextMessageContentEvent:({event:n,agent:o})=>{o.isRunning!==!1&&(n.delta.length>0&&(r=!0),e(Xi({textDelta:n.delta})))},onCustomEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let{name:i,value:a}=n;switch(i){case"header":{a?.contentFormat&&e(ea(a.contentFormat)),typeof a?.followUpEnabled=="boolean"&&e(Sb(a.followUpEnabled)),a?.conversationToken&&e(wb(a.conversationToken));return}case"citations":{e(Zi({citations:a.citations}));return}}},onRunErrorEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let i=Cb(n.code);e(Ji({message:n.message,code:i}))},onRunFinishedEvent:({event:n,agent:o})=>{if(o.isRunning===!1)return;let i=n.result?.completionReason==="ANSWERED",a=i?!r:void 0;e(vp(i)),e(ta(!i)),e(Yi(!1)),e(Zd(i,t,a)),e(Co())}}};var Rb=()=>{let e,t=()=>{e&&(e.isRunning=!1,e.abortRun()),e=void 0};return{run:function(){var _ref50=_asyncToGenerator(function*(n,o,i){t();let a=Us(n),s=rh(n),c=nh(n),u=th(n),h=oh(n),v=hb(a,s,c);e=v;let C=Eb(o),g=Vy(n,i());try{o(qr(!0)),yield v.runAgent({forwardedProps:{params:g,accessToken:u,recordDebugSession:h}},C)}catch(y){o(qr(!1)),o(Ji({message:"An error occurred while starting the answer generation."})),console.error("Error running the answer agent:",y)}});return function run(_x94,_x95,_x96){return _ref50.apply(this,arguments)}}(),abortRun:t}};m();d();f();p();m();d();f();p();var Uu=O("breadcrumb/deselectAll"),Ib=O("breadcrumb/deselectAllNonBreadcrumbs");m();d();f();p();var Tb=O("facet/updateFacetAutoSelection",e=>B(e,{allow:new fe({required:!0})}));m();d();f();p();m();d();f();p();var Vu=class extends kr{constructor(r){super(r);ae(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??Ct().q}get responseTime(){return this.activeInstantResultCache?.duration??Qt().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??Qt().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var _b=()=>Pe("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new Vu(e)),kb=()=>({actionCause:"searchboxAsYouType"});m();d();f();p();var gf={id:Y},QO={...gf,q:nt},roe=O("instantResults/register",e=>B(e,gf)),Bu=O("instantResults/updateQuery",e=>B(e,QO)),noe=O("instantResults/clearExpired",e=>B(e,gf));m();d();f();p();var Gu=new oe({required:!0,min:0}),$u=O("pagination/registerNumberOfResults",e=>B(e,Gu)),Qu=O("pagination/updateNumberOfResults",e=>B(e,Gu)),Hu=O("pagination/registerPage",e=>B(e,Gu)),zo=O("pagination/updatePage",e=>B(e,Gu)),zu=O("pagination/nextPage"),Wu=O("pagination/previousPage");m();d();f();p();var Wo=O("query/updateQuery",e=>B(e,{q:new z,enableQuerySyntax:new fe}));m();d();f();p();m();d();f();p();m();d();f();p();var $r=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var hf=()=>Pe("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),Qr=e=>Pe("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||Ct().q,aq:r.advancedSearchQueries?.aq||$r().aq,cq:r.advancedSearchQueries?.cq||$r().cq,dq:r.advancedSearchQueries?.dq||$r().dq,errorType:e.type,errorMessage:e.message}));m();d();f();p();m();d();f();p();var Voe=O("didYouMean/enable"),Boe=O("didYouMean/disable"),Goe=O("didYouMean/automaticCorrections/disable"),$oe=O("didYouMean/automaticCorrections/enable"),Ku=O("didYouMean/correction",e=>B(e,Y)),Qoe=O("didYouMean/automaticCorrections/mode",e=>B(e,new z({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));m();d();f();p();var yf=()=>Pe("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());var Ob=()=>({actionCause:"didYouMeanAutomatic"});m();d();f();p();m();d();f();p();function Yu(){return{contextValues:{}}}m();d();f();p();function Xu(){return{contextValues:{}}}m();d();f();p();function Pb(){return{freezeFacetOrder:!1,facets:{}}}m();d();f();p();function Nb(){return[]}m();d();f();p();function va(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}m();d();f();p();function Fb(){return{}}m();d();f();p();function Db(){return{}}m();d();f();p();function Mb(){return{}}function nr(e){return{context:e.context||Yu(),dictionaryFieldContext:e.dictionaryFieldContext||Xu(),facetSet:e.facetSet||Ls(),numericFacetSet:e.numericFacetSet||js(),dateFacetSet:e.dateFacetSet||qs(),categoryFacetSet:e.categoryFacetSet||Ms(),automaticFacetSet:e.automaticFacetSet??Ds(),pagination:e.pagination||va(),query:e.query||Ct(),tabSet:e.tabSet||Mb(),advancedSearchQueries:e.advancedSearchQueries||$r(),staticFilterSet:e.staticFilterSet||Db(),querySet:e.querySet||Fb(),sortCriteria:e.sortCriteria||Vs(),pipeline:e.pipeline||Ir(),searchHub:e.searchHub||ho(),facetOptions:e.facetOptions||Pb(),facetOrder:e.facetOrder??Nb(),debug:e.debug??ms()}}m();d();f();p();var yae=new ne({values:{undoneQuery:nt},options:{required:!0}}),qb=()=>Pe("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);m();d();f();p();var Zu=O("trigger/query/ignore",e=>B(e,new z({emptyAllowed:!0,required:!0}))),Ju=O("trigger/query/modification",e=>B(e,new ne({values:{originalQuery:rt,modification:rt}})));m();d();f();p();var Hr=/*#__PURE__*/function(){var _ref51=_asyncToGenerator(function*(e,t){let r=WO(e),n=ic(e),o=HO(e),i=yield Dr(e,t),a=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Nr({...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"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:a(),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 Hr(_x97,_x98){return _ref51.apply(this,arguments)}}();function HO(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(zO).filter(r=>r.currentValues.length>0):void 0}function zO(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function WO(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=KO(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}function KO(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o})}var zr=class{constructor(t,r=n=>{this.dispatch(Wo({q:n}))}){ae(this,"config",t);ae(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x99,_x100){var _this23=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=oc(yield _this23.extra.apiClient.search(r,n),t),a=Date.now()-o,s=_this23.getState().query?.q||"";return{response:i,duration:a,queryExecuted:s,requestExecuted:r}}).apply(this,arguments)}process(t){var _this24=this;return _asyncToGenerator(function*(){return _this24.processQueryErrorOrContinue(t)??(yield _this24.processQueryCorrectionsOrContinue(t))??(yield _this24.processQueryTriggersOrContinue(t))??_this24.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return yt(t.response)?(this.dispatch(Qr(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this25=this;return _asyncToGenerator(function*(){let r=_this25.getState(),n=_this25.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:s,queryCorrection:c}=n;if(!o||!i)return null;let u=a.length===0&&s&&s.length!==0,h=!se(c)&&!se(c.correctedQuery);if(!u&&!h)return null;let C=u?yield _this25.processLegacyDidYouMeanAutoCorrection(t):_this25.processModernDidYouMeanAutoCorrection(t);return _this25.dispatch(Kt(nr(_this25.getState()))),C})()}processLegacyDidYouMeanAutoCorrection(t){var _this26=this;return _asyncToGenerator(function*(){let r=_this26.getCurrentQuery(),n=_this26.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this26.automaticallyRetryQueryWithCorrection(o);return yt(i.response)?(_this26.dispatch(Qr(i.response.error)),_this26.rejectWithValue(i.response.error)):(_this26.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this26.dispatch(Kt(nr(_this26.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:yf()})})()}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:yf()}}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 _this27=this;return _asyncToGenerator(function*(){let r=_this27.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(s=>s.type==="query")?.content||"";if(!n)return null;if(_this27.getState().triggers?.queryModification.queryToIgnore===n)return _this27.dispatch(Zu("")),null;_this27.analyticsAction&&(yield _this27.dispatch(_this27.analyticsAction));let i=_this27.getCurrentQuery(),a=yield _this27.automaticallyRetryQueryWithTriggerModification(n);return yt(a.response)?(_this27.dispatch(Qr(a.response.error)),_this27.rejectWithValue(a.response.error)):(_this27.dispatch(Kt(nr(_this27.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i,analyticsAction:qb()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??Ct().enableQuerySyntax},search:{...Qt(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(Kt(nr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return ja(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this28=this;return _asyncToGenerator(function*(){_this28.onUpdateQueryForCorrection(t);let r=yield _this28.fetchFromAPI(yield Hr(_this28.getState()),{origin:"mainSearch"});return _this28.dispatch(Ku(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this29=this;return _asyncToGenerator(function*(){return _this29.dispatch(Ju({newQuery:t,originalQuery:_this29.getCurrentQuery()})),_this29.onUpdateQueryForCorrection(t),yield _this29.fetchFromAPI(yield Hr(_this29.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 yse=Ie("search/executeSearch",/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(e,t){let r=t.getState();return yield el(r,t,e)});return function(_x101,_x102){return _ref52.apply(this,arguments)}}()),vse=Ie("search/fetchPage",/*#__PURE__*/function(){var _ref53=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Sf(r,t,e)});return function(_x103,_x104){return _ref53.apply(this,arguments)}}()),Sse=Ie("search/fetchMoreResults",/*#__PURE__*/function(){var _ref54=_asyncToGenerator(function*(e,t){let r=t.getState();return yield bf(t,r)});return function(_x105,_x106){return _ref54.apply(this,arguments)}}()),bse=Ie("search/fetchFacetValues",/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(e,t){let r=t.getState();return yield JO(t,e,r)});return function(_x107,_x108){return _ref55.apply(this,arguments)}}()),wse=Ie("search/fetchInstantResults",/*#__PURE__*/function(){var _ref56=_asyncToGenerator(function*(e,t){return vf(e,t)});return function(_x109,_x110){return _ref56.apply(this,arguments)}}()),YO=/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(e,t){let r=yield Hr(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function YO(_x111,_x112){return _ref57.apply(this,arguments)}}(),XO=/*#__PURE__*/function(){var _ref58=_asyncToGenerator(function*(e,t,r){let n=yield Dr(e);return Nr({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function XO(_x113,_x114,_x115){return _ref58.apply(this,arguments)}}(),ZO=/*#__PURE__*/function(){var _ref59=_asyncToGenerator(function*(e,t){let r=yield Hr(e,t);return r.request.numberOfResults=0,r});return function ZO(_x116,_x117){return _ref59.apply(this,arguments)}}(),jb=e=>{e.configuration.analytics.enabled&&gt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function vf(_x118,_x119){return _vf.apply(this,arguments)}function _vf(){_vf=_asyncToGenerator(function*(e,t){B(e,{id:Y,q:Y,maxResultsPerQuery:new oe({required:!0,min:1}),cacheTimeout:new oe});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),i=new zr({...t,analyticsAction:_b()},u=>{t.dispatch(Bu({q:u,id:e.id}))}),a=yield XO(o,r,n),s=yield i.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),c=yield i.process(s);return"response"in c?{results:c.response.results,searchUid:c.response.searchUid,analyticsAction:c.analyticsAction,totalCountFiltered:c.response.totalCountFiltered,duration:c.duration}:c});return _vf.apply(this,arguments)}function Sf(_x120,_x121,_x122){return _Sf.apply(this,arguments)}function _Sf(){_Sf=_asyncToGenerator(function*(e,t,r){jb(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),s=new zr({...t,analyticsAction:r}),c=yield Hr(e,a),u=yield s.fetchFromAPI(c,{origin:"mainSearch"});return yield s.process(u)});return _Sf.apply(this,arguments)}function bf(_x123,_x124){return _bf.apply(this,arguments)}function _bf(){_bf=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:i}=yield hf().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),a=new zr({...e,analyticsAction:hf()}),s=yield YO(t,i),c=yield a.fetchFromAPI(s,{origin:"mainSearch"});return yield a.process(c)});return _bf.apply(this,arguments)}function JO(_x125,_x126,_x127){return _JO.apply(this,arguments)}function _JO(){_JO=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=e.extra,{description:a}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),s=new zr({...e,analyticsAction:t}),c=yield ZO(r,a),u=yield s.fetchFromAPI(c,{origin:"facetValues"});return yield s.process(u)});return _JO.apply(this,arguments)}function el(_x128,_x129,_x130){return _el.apply(this,arguments)}function _el(){_el=_asyncToGenerator(function*(e,t,r){jb(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),s=yield Hr(e,a),c=new zr({...t,analyticsAction:r}),u=yield c.fetchFromAPI(s,{origin:"mainSearch"});return yield c.process(u)});return _el.apply(this,arguments)}m();d();f();p();var Wr=class{constructor(t,r=n=>{this.dispatch(Wo({q:n}))}){ae(this,"config",t);ae(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x131,_x132){var _this30=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=oc(yield _this30.extra.apiClient.search(r,n),t),a=Date.now()-o,s=_this30.getState().query?.q||"";return{response:i,duration:a,queryExecuted:s,requestExecuted:r}}).apply(this,arguments)}process(t){var _this31=this;return _asyncToGenerator(function*(){return _this31.processQueryErrorOrContinue(t)??(yield _this31.processQueryCorrectionsOrContinue(t))??(yield _this31.processQueryTriggersOrContinue(t))??_this31.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return yt(t.response)?(this.dispatch(Qr(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this32=this;return _asyncToGenerator(function*(){let r=_this32.getState(),n=_this32.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:s,queryCorrection:c}=n;if(!o)return null;if(!i)return!se(c)&&!se(c.correctedQuery)?_this32.processModernDidYouMeanAutoCorrection(t):null;let u=a.length===0&&s&&s.length!==0,h=!se(c)&&!se(c.correctedQuery);if(!u&&!h)return null;let C=u?yield _this32.processLegacyDidYouMeanAutoCorrection(t):_this32.processModernDidYouMeanAutoCorrection(t);return _this32.dispatch(Kt(nr(_this32.getState()))),C})()}processLegacyDidYouMeanAutoCorrection(t){var _this33=this;return _asyncToGenerator(function*(){let r=_this33.getCurrentQuery(),n=_this33.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this33.automaticallyRetryQueryWithCorrection(o);return yt(i.response)?(_this33.dispatch(Qr(i.response.error)),_this33.rejectWithValue(i.response.error)):(_this33.dispatch(Kt(nr(_this33.getState()))),{...i,response:{...i.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 _this34=this;return _asyncToGenerator(function*(){let r=_this34.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(s=>s.type==="query")?.content||"";if(!n)return null;if(_this34.getState().triggers?.queryModification.queryToIgnore===n)return _this34.dispatch(Zu("")),null;let i=_this34.getCurrentQuery(),a=yield _this34.automaticallyRetryQueryWithTriggerModification(n);return yt(a.response)?(_this34.dispatch(Qr(a.response.error)),_this34.rejectWithValue(a.response.error)):(_this34.dispatch(Kt(nr(_this34.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i})})()}processSuccessResponse(t){return this.dispatch(Kt(nr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return ja(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this35=this;return _asyncToGenerator(function*(){_this35.onUpdateQueryForCorrection(t);let r=_this35.getState(),{actionCause:n}=Ob(),o=yield _this35.fetchFromAPI(yield Mr(r,_this35.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this35.dispatch(Ku(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this36=this;return _asyncToGenerator(function*(){return _this36.dispatch(Ju({newQuery:t,originalQuery:_this36.getCurrentQuery()})),_this36.onUpdateQueryForCorrection(t),yield _this36.fetchFromAPI(yield Mr(_this36.getState(),_this36.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 sce=Ie("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;B(e,{q:new z,enableQuerySyntax:new fe,clearFilters:new fe}),e.clearFilters&&(r(Uu()),r(Ib())),r(Tb({allow:!0})),r(Wo({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(zo(1))}),cce=O("search/updateSearchAction"),tl=Ie("search/executeSearch",/*#__PURE__*/function(){var _ref60=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return el(r,t,e.legacy);Ub(r);let n=e.next?Vb(e.next):void 0,o=yield Mr(r,t.extra.navigatorContext,n),i=new Wr({...t,analyticsAction:n??{}}),a=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(a)});return function(_x133,_x134){return _ref60.apply(this,arguments)}}()),Lb=Ie("search/fetchPage",/*#__PURE__*/function(){var _ref61=_asyncToGenerator(function*(e,t){let r=t.getState();if(Ub(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return Sf(r,t,e.legacy);let n=new Wr({...t,analyticsAction:e.next}),o=yield Mr(r,t.extra.navigatorContext,e.next),i=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(i)});return function(_x135,_x136){return _ref61.apply(this,arguments)}}()),uce=Ie("search/fetchMoreResults",/*#__PURE__*/function(){var _ref62=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return bf(t,r);let n=Ch("browseResults",t.getState),o=new Wr({...t,analyticsAction:n}),i=yield eP(r,t.extra.navigatorContext,n),a=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(a)});return function(_x137,_x138){return _ref62.apply(this,arguments)}}()),lce=Ie("search/fetchFacetValues",/*#__PURE__*/function(){var _ref63=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return el(r,t,e.legacy);let n=new Wr({...t,analyticsAction:{}}),o=yield rP(r,t.extra.navigatorContext),i=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(i)});return function(_x139,_x140){return _ref63.apply(this,arguments)}}()),dce=Ie("search/fetchInstantResults",/*#__PURE__*/function(){var _ref64=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return vf(e,t);B(e,{id:Y,q:Y,maxResultsPerQuery:new oe({required:!0,min:1}),cacheTimeout:new oe});let{q:n,maxResultsPerQuery:o}=e,i=Vb(kb()),a=yield tP(r,t.extra.navigatorContext,n,o,i),s=new Wr({...t,analyticsAction:i},h=>{t.dispatch(Bu({q:h,id:e.id}))}),c=yield s.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),u=yield s.process(c);return"response"in u?{results:u.response.results,searchUid:u.response.searchUid,totalCountFiltered:u.response.totalCountFiltered,duration:u.duration}:u});return function(_x141,_x142){return _ref64.apply(this,arguments)}}()),eP=/*#__PURE__*/function(){var _ref65=_asyncToGenerator(function*(e,t,r){let n=yield Mr(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function eP(_x143,_x144,_x145){return _ref65.apply(this,arguments)}}(),tP=/*#__PURE__*/function(){var _ref66=_asyncToGenerator(function*(e,t,r,n,o){let i=Ro(e,t,o);return Nr({...i,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function tP(_x146,_x147,_x148,_x149,_x150){return _ref66.apply(this,arguments)}}(),rP=/*#__PURE__*/function(){var _ref67=_asyncToGenerator(function*(e,t,r){let n=yield Mr(e,t,r);return n.request.numberOfResults=0,n});return function rP(_x151,_x152,_x153){return _ref67.apply(this,arguments)}}(),Ub=e=>{e.configuration.analytics.enabled&&gt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},Vb=e=>({actionCause:e.actionCause,type:e.actionCause});var Bb=e=>{let t=pg({extra:e}),r=Rb();return t.startListening({actionCreator:tl.pending,effect:function(){var _ref68=_asyncToGenerator(function*(n,o){let i=o.getState();if(!_d(i)||(r.abortRun(),o.dispatch(pc()),o.dispatch(xb()),i.generatedAnswer.isEnabled===!1))return;let a=fn(i)?.q;!a||a.trim()===""||r.run(i,o.dispatch,e.getNavigatorContext)});return function effect(_x154,_x155){return _ref68.apply(this,arguments)}}()}),t};m();d();f();p();var Gb=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)},$b=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));m();d();f();p();var wf=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:i}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:i}};m();d();f();p();function Qb(e,t){let r={...e},n,o=i=>(a,s)=>{let c=i(a,s);return n?n(c,s):c};return{get combinedReducer(){let i=em(Object.entries(t).filter(([a])=>!(a in r)).map(([a,s])=>[a,()=>s]));return o(Yn({...i,...r}))},containsAll(i){return Object.keys(i).every(s=>s in r)},add(i){Object.keys(i).filter(a=>!(a in r)).forEach(a=>{r[a]=i[a]})},addCrossReducer(i){n=i}}}m();d();f();p();m();d();f();p();function nP(e){if(!e||!oP(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function Hb(e,t=60){if(!e)return!1;let r=nP(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function oP(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function Wb(e,t){let r=0,n=null,o=Oa(()=>{r=0},500),i=/*#__PURE__*/function(){var _ref69=_asyncToGenerator(function*(v,C=!1){let g=!n;g&&t&&(n=_asyncToGenerator(function*(){try{return yield t()}catch(S){if(!C)throw S;return null}})().finally(()=>{n=null}));let y=yield n;return g&&y&&v.dispatch(Er({accessToken:y})),y});return function i(_x156){return _ref69.apply(this,arguments)}}(),a=v=>{let C=sP(v.getState());return!!C&&Hb(C)},s=/*#__PURE__*/function(){var _ref71=_asyncToGenerator(function*(v){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield i(v))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(C){e.warn(C,"Access token renewal failed. A retry will occur if necessary.")}});return function s(_x157){return _ref71.apply(this,arguments)}}(),c=/*#__PURE__*/function(){var _ref72=_asyncToGenerator(function*(v,C,g){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),zb(v,C.error),C;!n&&(r++,o());try{yield i(v,!0)}catch(S){e.debug(S,"Token renewal failed in reactive path (piggybacked on a proactive renewal). The action will be re-dispatched.")}v.dispatch(g)});return function c(_x158,_x159,_x160){return _ref72.apply(this,arguments)}}(),u=(v,C,g)=>aP(g)?t?c(v,g,C):(e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),zb(v,g.error),g):g,h=(v,C,g)=>iP(g)?Promise.resolve(g).then(y=>u(v,C,y)):u(v,C,g);return v=>C=>g=>{if(!(typeof g=="function"))return C(g);let S=()=>h(v,g,C(g));return typeof t=="function"&&a(v)?s(v).then(S):S()}}function iP(e){return(typeof e=="object"||typeof e=="function")&&e!==null&&"then"in e&&typeof e.then=="function"}function aP(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new Wn().name}function zb(e,t){e.dispatch(hs({status:401,statusCode:401,message:t.message,type:t.name}))}function sP(e){return e.configuration.accessToken}m();d();f();p();function Kb({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return Zm({reducer:e,preloadedState:t,devTools:{stateSanitizer:i=>i.history?{...i,history:"<<OMIT>>"}:i,name:o,shouldHotReload:!1},middleware:i=>i({thunk:{extraArgument:n}}).prepend(...r).concat($b(n.logger))})}function cP(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,disableBrowserPrivacySignals:o,...i}=r??{},a={...i,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})},s=a.analyticsMode!=="next",c=a.analyticsMode==="legacy"&&o===!0;return s&&Tl()&&!c?(t.info("Analytics disabled since doNotTrack is active."),{...a,enabled:!1}):(s&&Tl()&&c&&a.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."),a)}function Yb(e,t){let r={...e.reducers,configuration:Lt,version:sv},n=uP({...e,reducers:r},t,Lt),{accessToken:o,environment:i,organizationId:a}=e.configuration;n.dispatch(Er({accessToken:o,environment:i,organizationId:a}));let s=cP(e.configuration,n.logger);return s&&n.dispatch(no(s)),n}function uP(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,i=Qb({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&i.addCrossReducer(e.crossReducer);let a=t.logger,s={...t,get relay(){return ji(u.state,o)},get navigatorContext(){return wf(this.relay,o)}},c=lP(e,s,i),u={addReducers(h){i.containsAll(h)||(i.add(h),c.replaceReducer(i.combinedReducer))},dispatch:c.dispatch,subscribe:c.subscribe,enableAnalytics(){c.dispatch(io())},disableAnalytics(){c.dispatch(oo())},get state(){return c.getState()},get relay(){return ji(this.state,o)},get navigatorContext(){return wf(this.relay,o)},logger:a,store:c};return u}function lP(e,t,r){let{preloadedState:n,configuration:o}=e,i=o.name||"coveo-headless",a=dP(e,t.logger,()=>t.navigatorContext);return Kb({preloadedState:n,reducer:r.combinedReducer,middlewares:a,thunkExtraArguments:t,name:i})}function dP(e,t,r){let{renewAccessToken:n}=e.configuration,o=Wb(t,n),i=Bb({getNavigatorContext:r});return[vv,o,Gb(t),uv].concat(bp.middleware,i.middleware,e.middlewares||[])}m();d();f();p();var aw=qt(iw(),1);function sw(e){return(0,aw.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}m();d();f();p();function cw(e,t){let r=_P(e),n=Tt,o=kP(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t,disableBrowserPrivacySignals:e.analytics?.disableBrowserPrivacySignals}}function _P(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function kP(e){return e.preprocessRequest||Fa}m();d();f();p();m();d();f();p();var uw={organizationId:Y,accessToken:Y,name:new z({required:!1,emptyAllowed:!1}),analytics:new ne({options:{required:!1},values:{enabled:new fe({required:!1}),originContext:new z({required:!1}),originLevel2:new z({required:!1}),originLevel3:new z({required:!1}),analyticsMode:new z({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new z({required:!1,url:!0}),trackingId:new z({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),disableBrowserPrivacySignals:new fe({required:!1})}}),environment:new z({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function lw(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var dw=new ht({...uw,pipeline:new z({required:!1,emptyAllowed:!0}),searchHub:rt,locale:rt,timezone:rt});function If(){return{...lw(),searchHub:"default"}}var OP={debug:gs,pipeline:so,searchHub:wo,recommendation:So};function pw(e){let t=sw(e.loggerOptions);PP(e.configuration,t);let r=NP(e.configuration,t),n={...cw(e.configuration,t),apiClient:r},o={...e,reducers:OP},i=Yb(o,n),{pipeline:a,searchHub:s,timezone:c,locale:u,proxyBaseUrl:h}=e.configuration;return i.dispatch(Wt({timezone:c,locale:u,proxyBaseUrl:h})),se(a)||i.dispatch(ao(a)),se(s)||i.dispatch(bo(s)),{...i,get state(){return i.state}}}function PP(e,t){try{dw.validate(e)}catch(r){throw t.error(r,"Recommendation engine configuration error"),r}}function NP(e,t){return new qa({logger:t,preprocessRequest:e.preprocessRequest||Fa,postprocessSearchResponseMiddleware:e.preprocessSearchResponseMiddleware||ym,postprocessFacetSearchResponseMiddleware:vm,postprocessQuerySuggestResponseMiddleware:Sm})}m();d();f();p();m();d();f();p();m();d();f();p();var FP=new Se({each:Y,required:!0}),fw=(e,t)=>(B(e,Y),_a(t)?B(t,Y):B(t,FP),{payload:{contextKey:e,contextValue:t}}),Un=O("context/set",e=>{for(let[t,r]of Object.entries(e))fw(t,r);return{payload:e}}),Vn=O("context/add",e=>fw(e.contextKey,e.contextValue)),Bn=O("context/remove",e=>B(e,Y));m();d();f();p();var ol=Be(Yu(),e=>{e.addCase(Un,(t,r)=>{t.contextValues=r.payload}).addCase(Vn,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(Bn,(t,r)=>{delete t.contextValues[r.payload]}).addCase(vt.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});m();d();f();p();function Yr(e){let t,r=new Map,n=()=>r.size===0,o=i=>{try{let a=JSON.stringify(i),s=t!==a;return t=a,s}catch(a){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",a),!0}};return{subscribe(i){i();let a=Symbol(),s;return n()&&(t=JSON.stringify(this.state),s=e.subscribe(()=>{o(this.state)&&r.forEach(c=>c())})),r.set(a,i),()=>{r.delete(a),n()&&s?.()}},get state(){return{}}}}m();d();f();p();var DP=["caseId","caseNumber"],MP={caseId:"caseContext",caseNumber:"caseContext"},ba=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${MP[t]} to set this value.}`)}};function Tf(e){return DP.includes(e)}var qP=new ht({values:new ne({options:{required:!1}})});function mw(e,t={}){if(!UP(e))throw $t;let r=Yr(e),{dispatch:n}=e,o=()=>e.state,i=gg(e,qP,t.initialState,"buildContext");return i.values&&n(Un(i.values)),{...r,get state(){return{values:o().context.contextValues}},set(a){n(Un(a))},...(o().configuration.analytics.analyticsMode==="legacy"?jP(n):LP(n))}}var jP=e=>({add(t,r){e(Vn({contextKey:t,contextValue:r}))},remove(t){e(Bn(t))}}),LP=e=>({add(t,r){if(Tf(t))throw new ba(t);e(Vn({contextKey:t,contextValue:r}))},remove(t){if(Tf(t))throw new ba(t);e(Bn(t))}});function UP(e){return e.addReducers({context:ol}),!0}function gw(e,t){return mw(e,t)}m();d();f();p();m();d();f();p();var Yo=O("dictionaryFieldContext/set",e=>{let t=new ne({options:{required:!0}}),r=B(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new Se({each:nt}),i=B(n,o).error;return i?{payload:e,error:i}:{payload:e}}),Xo=O("dictionaryFieldContext/add",e=>{let t=new ne({options:{required:!0},values:{field:nt,key:nt}});return B(e,t)}),Zo=O("dictionaryFieldContext/remove",e=>B(e,nt));m();d();f();p();var il=Be(Xu(),e=>{e.addCase(Yo,(t,r)=>{t.contextValues=r.payload}).addCase(Xo,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(Zo,(t,r)=>{delete t.contextValues[r.payload]}).addCase(vt.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function hw(e){if(!VP(e))throw $t;let t=Yr(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(Yo(o))},add(o,i){r(Xo({field:o,key:i}))},remove(o){r(Zo(o))}}}function VP(e){return e.addReducers({dictionaryFieldContext:il}),!0}m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();m();d();f();p();var wa={value:Y,numberOfResults:new oe({min:0}),state:Y};m();d();f();p();var _e=Y;var QP=new oe({min:1,default:8,required:!1}),HP=new oe({min:1,max:20,default:5,required:!1}),zP={desiredCount:HP,numberOfValues:QP},vpe=O("automaticFacet/setOptions",e=>B(e,zP)),Spe=O("automaticFacet/deselectAll",e=>B(e,_e)),WP=Y,yw=O("automaticFacet/toggleSelectValue",e=>B(e,{field:WP,selection:new ne({values:wa})}));m();d();f();p();m();d();f();p();var KP={state:new De({required:!0}),numberOfResults:new oe({required:!0,min:0}),value:new z({required:!0,emptyAllowed:!0}),path:new Se({required:!0,each:Y}),moreValuesAvailable:new fe({required:!1})};function _f(e){e.children.forEach(t=>{_f(t)}),Tt({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},KP)}var Jo={facetId:_e,field:Y,tabs:new ne({options:{required:!1},values:{included:new Se({each:new z}),excluded:new Se({each:new z})}}),activeTab:new z({required:!1}),delimitingCharacter:new z({required:!1,emptyAllowed:!0}),filterFacetCount:new fe({required:!1}),injectionDepth:new oe({required:!1,min:0}),numberOfValues:new oe({required:!1,min:1}),sortCriteria:new De({required:!1}),basePath:new Se({required:!1,each:Y}),filterByBasePath:new fe({required:!1})};var qpe=O("categoryFacet/register",e=>B(e,Jo)),vw=O("categoryFacet/toggleSelectValue",e=>{try{return Tt(e.facetId,Y),_f(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:ur(t)}}}),Sw=O("categoryFacet/deselectAll",e=>B(e,Jo.facetId)),jpe=O("categoryFacet/updateNumberOfValues",e=>B(e,{facetId:Jo.facetId,numberOfValues:Jo.numberOfValues})),Lpe=O("categoryFacet/updateSortCriterion",e=>B(e,{facetId:Jo.facetId,criterion:new De})),Upe=O("categoryFacet/updateBasePath",e=>B(e,{facetId:Jo.facetId,basePath:new Se({each:Y})}));m();d();f();p();m();d();f();p();var Aa={facetId:_e,captions:new ne({options:{required:!1}}),numberOfValues:new oe({required:!1,min:1}),query:new z({required:!1,emptyAllowed:!0})};var YP={path:new Se({required:!0,each:Y}),displayValue:nt,rawValue:nt,count:new oe({required:!0,min:0})},bw=O("categoryFacet/selectSearchResult",e=>B(e,{facetId:_e,value:new ne({values:YP})})),ofe=O("categoryFacetSearch/register",e=>B(e,Aa));m();d();f();p();var ww={facetId:_e,value:new ne({values:{displayValue:nt,rawValue:nt,count:new oe({required:!0,min:0})}})},gfe=O("facetSearch/register",e=>B(e,Aa)),hfe=O("facetSearch/update",e=>B(e,Aa)),Aw=O("facetSearch/toggleSelectValue",e=>B(e,ww)),xw=O("facetSearch/toggleExcludeValue",e=>B(e,ww));m();d();f();p();m();d();f();p();var xfe=new z({regex:/^[a-zA-Z0-9-_]+$/}),Cfe=new z({required:!0}),Efe=new Se({each:new z}),Rfe=new z,Ife=new fe,Tfe=new fe,_fe=new oe({min:0}),XP=new oe({min:1}),kfe=new fe({required:!0}),ZP=new ne,JP=new z,eN={captions:ZP,numberOfValues:XP,query:JP},Ofe=new ne({values:eN}),Cw=new ne({options:{required:!1},values:{type:new z({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new Se({required:!0,max:25,each:new z({emptyAllowed:!1,required:!0})})}}),Pfe=new fe,Ew=new Se({min:1,max:25,required:!1,each:new z({emptyAllowed:!1,required:!0})});var tN={facetId:_e,field:new z({required:!0,emptyAllowed:!0}),tabs:new ne({options:{required:!1},values:{included:new Se({each:new z}),excluded:new Se({each:new z})}}),activeTab:new z({required:!1}),filterFacetCount:new fe({required:!1}),injectionDepth:new oe({required:!1,min:0}),numberOfValues:new oe({required:!1,min:1}),sortCriteria:new De({required:!1}),resultsMustMatch:new De({required:!1}),allowedValues:Cw,customSort:Ew},$fe=O("facet/register",e=>B(e,tN)),Rw=O("facet/toggleSelectValue",e=>B(e,{facetId:_e,selection:new ne({values:wa})})),Iw=O("facet/toggleExcludeValue",e=>B(e,{facetId:_e,selection:new ne({values:wa})})),al=O("facet/deselectAll",e=>B(e,_e)),Qfe=O("facet/updateSortCriterion",e=>B(e,{facetId:_e,criterion:new De({required:!0})})),Hfe=O("facet/updateNumberOfValues",e=>B(e,{facetId:_e,numberOfValues:new oe({required:!0,min:1})})),zfe=O("facet/updateIsFieldExpanded",e=>B(e,{facetId:_e,isFieldExpanded:new fe({required:!0})})),Wfe=O("facet/updateFreezeCurrentValues",e=>B(e,{facetId:_e,freezeCurrentValues:new fe({required:!0})}));m();d();f();p();m();d();f();p();function _w(e){let t=Tw(e.start,e),r=Tw(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function Tw(e,t){let{dateFormat:r}=t;return Cy(e)?(cp(e),wy(e)):typeof e=="string"&&Pr(e)?(cp(e),e):(yy(e,r),nc(Eo(e,r)))}m();d();f();p();var kw=O("rangeFacet/updateSortCriterion",e=>B(e,{facetId:_e,criterion:new De({required:!0})}));m();d();f();p();var sl={state:Y,start:new oe({required:!0}),end:new oe({required:!0}),endInclusive:new fe({required:!0}),numberOfResults:new oe({required:!0,min:0})},cl={start:Y,end:Y,endInclusive:new fe({required:!0}),state:Y,numberOfResults:new oe({required:!0,min:0})};var rN={start:Y,end:Y,endInclusive:new fe({required:!0}),state:Y},nN={facetId:_e,field:Y,tabs:new ne({options:{required:!1},values:{included:new Se({each:new z}),excluded:new Se({each:new z})}}),activeTab:new z({required:!1}),currentValues:new Se({required:!1,each:new ne({values:rN})}),generateAutomaticRanges:new fe({required:!0}),filterFacetCount:new fe({required:!1}),injectionDepth:new oe({required:!1,min:0}),numberOfValues:new oe({required:!1,min:1}),sortCriteria:new De({required:!1}),rangeAlgorithm:new De({required:!1})};function Ow(e){return Pr(e)?Wi(e):e}function Pw(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=_w(t);if(Eo(Ow(r)).isAfter(Eo(Ow(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var Fme=O("dateFacet/register",e=>{try{return Tt(e,nN),Pw(e),{payload:e,error:null}}catch(t){return{payload:e,error:ur(t)}}}),Nw=O("dateFacet/toggleSelectValue",e=>B(e,{facetId:_e,selection:new ne({values:cl})})),Fw=O("dateFacet/toggleExcludeValue",e=>B(e,{facetId:_e,selection:new ne({values:cl})})),Dw=O("dateFacet/updateFacetValues",e=>{try{return Tt(e,{facetId:_e,values:new Se({each:new ne({values:cl})})}),Pw({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:ur(t)}}});m();d();f();p();var oN={state:Y,start:new oe({required:!0}),end:new oe({required:!0}),endInclusive:new fe({required:!0})},iN={facetId:_e,field:Y,tabs:new ne({options:{required:!1},values:{included:new Se({each:new z}),excluded:new Se({each:new z})}}),activeTab:new z({required:!1}),currentValues:new Se({required:!1,each:new ne({values:oN})}),generateAutomaticRanges:new fe({required:!0}),filterFacetCount:new fe({required:!1}),injectionDepth:new oe({required:!1,min:0}),numberOfValues:new oe({required:!1,min:1}),sortCriteria:new De({required:!1}),rangeAlgorithm:new De({required:!1})};function Mw(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 zme=O("numericFacet/register",e=>{try{return B(e,iN),Mw(e),{payload:e,error:null}}catch(t){return{payload:e,error:ur(t)}}}),qw=O("numericFacet/toggleSelectValue",e=>B(e,{facetId:_e,selection:new ne({values:sl})})),jw=O("numericFacet/toggleExcludeValue",e=>B(e,{facetId:_e,selection:new ne({values:sl})})),Lw=O("numericFacet/updateFacetValues",e=>{try{return Tt(e,{facetId:_e,values:new Se({each:new ne({values:sl})})}),Mw({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:ur(t)}}});var Uw=Be(va(),e=>{e.addCase($u,(t,r)=>{let n=kf(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=xa(n,o)}).addCase(Qu,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(mc,t=>{t.firstResult=0}).addCase(Hu,(t,r)=>{let n=r.payload;t.firstResult=xa(n,t.numberOfResults)}).addCase(zo,(t,r)=>{let n=r.payload;t.firstResult=xa(n,t.numberOfResults)}).addCase(Wu,t=>{let r=kf(t),n=Math.max(r-1,1);t.firstResult=xa(n,t.numberOfResults)}).addCase(zu,t=>{let r=kf(t),n=sN(t),o=Math.min(r+1,n);t.firstResult=xa(o,t.numberOfResults)}).addCase(vt.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(Rr,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(tl.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(Lb.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(al,t=>{pt(t)}).addCase(Fw,t=>{pt(t)}).addCase(Iw,t=>{pt(t)}).addCase(jw,t=>{pt(t)}).addCase(xw,t=>{pt(t)}).addCase(Rw,t=>{pt(t)}).addCase(Sw,t=>{pt(t)}).addCase(vw,t=>{pt(t)}).addCase(bw,t=>{pt(t)}).addCase(Nw,t=>{pt(t)}).addCase(qw,t=>{pt(t)}).addCase(Uu,t=>{pt(t)}).addCase(Dw,t=>{pt(t)}).addCase(Lw,t=>{pt(t)}).addCase(Aw,t=>{pt(t)}).addCase(yw,t=>{pt(t)})});function pt(e){e.firstResult=va().firstResult}function kf(e){let{firstResult:t,numberOfResults:r}=e;return cN(t,r)}function sN(e){let{totalCountFiltered:t,numberOfResults:r}=e;return uN(t,r)}function xa(e,t){return(e-1)*t}function cN(e,t){return Math.round(e/t)+1}function uN(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function Of(e){return e.addReducers({pagination:Uw}),{nextPage:zu,previousPage:Wu,registerNumberOfResults:$u,registerPage:Hu,updateNumberOfResults:Qu,updatePage:zo}}var lN=new ht({id:new z({emptyAllowed:!0,required:!1,default:""}),numberOfRecommendations:new oe({min:0})});function Vw(e,t={}){if(!dN(e))throw $t;let r=Yr(e),{dispatch:n}=e,o=()=>e.state,i=hg(e,lN,t.options,"buildRecommendationList");return i.id!==""&&n(vo({id:i.id})),i.numberOfRecommendations&&n(Of(e).updateNumberOfResults(i.numberOfRecommendations)),{...r,refresh(){n(Or())},get state(){let a=o();return{recommendations:a.recommendation.recommendations,error:a.recommendation.error,isLoading:a.recommendation.isLoading,searchResponseId:a.recommendation.searchUid}}}}function dN(e){return e.addReducers({recommendation:So,configuration:Lt}),!0}m();d();f();p();m();d();f();p();function Bw(e,t,r){if(!pN(e))throw $t;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},i;return{select:Oa(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){i=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){i&&clearTimeout(i)}}}function pN(e){return e.addReducers({configuration:Lt}),!0}function Gw(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(Qs(t.options.result)))};return Bw(e,t,()=>{n()})}m();d();f();p();m();d();f();p();m();d();f();p();var Xr=()=>new z({required:!1,emptyAllowed:!0}),ul=O("advancedSearchQueries/update",e=>B(e,{aq:Xr(),cq:Xr(),lq:Xr(),dq:Xr()})),ll=O("advancedSearchQueries/register",e=>B(e,{aq:Xr(),cq:Xr(),lq:Xr(),dq:Xr()}));var $w=Be($r(),e=>{e.addCase(ul,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;Je(n)||(t.aq=n,t.aqWasSet=!0),Je(o)||(t.cq=o,t.cqWasSet=!0),Je(i)||(t.lq=i,t.lqWasSet=!0),Je(a)||(t.dq=a,t.dqWasSet=!0)}).addCase(ll,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;Je(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),Je(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),Je(i)||(t.defaultFilters.lq=i,t.lqWasSet||(t.lq=i)),Je(a)||(t.defaultFilters.dq=a,t.dqWasSet||(t.dq=a))}).addCase(vt.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(Rr,(t,r)=>{let{aq:n,cq:o}=r.payload;Je(n)||(t.aq=n,t.aqWasSet=!0),Je(o)||(t.cq=o,t.cqWasSet=!0)})});function fN(e){return e.addReducers({advancedSearchQueries:$w}),{updateAdvancedSearchQueries:ul,registerAdvancedSearchQueries:ll}}m();d();f();p();function mN(e){return e.addReducers({configuration:Lt}),{disableAnalytics:oo,enableAnalytics:io,setOriginLevel2:ls,setOriginLevel3:ds,updateAnalyticsConfiguration:no,updateBasicConfiguration:Er}}m();d();f();p();function gN(e){return e.addReducers({configuration:Lt,pipeline:so,searchHub:wo}),{updateSearchConfiguration:Wt}}m();d();f();p();function hN(e){return e.addReducers({context:ol}),{addContext:Vn,removeContext:Bn,setContext:Un}}m();d();f();p();function yN(e){return e.addReducers({debug:gs}),{disableDebug:fs,enableDebug:ps}}m();d();f();p();function vN(e){return e.addReducers({dictionaryFieldContext:il}),{addContext:Xo,removeContext:Zo,setContext:Yo}}m();d();f();p();m();d();f();p();m();d();f();p();var SN={collectionField:new z({emptyAllowed:!1,required:!1}),parentField:new z({emptyAllowed:!1,required:!1}),childField:new z({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new oe({min:0,required:!1})},Qw=O("folding/register",e=>B(e,SN)),hye=Ie("folding/loadCollection",/*#__PURE__*/function(){var _ref73=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let i=t(),a=i.configuration.analytics.analyticsMode==="legacy"?yield Dr(i):Ro(i,o),s=yield n.search({...a,q:bN(i),enableQuerySyntax:!0,cq:`@${i.folding.fields.collection}="${e}"`,filterField:i.folding.fields.collection,childField:i.folding.fields.parent,parentField:i.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return yt(s)?r(s.error):{collectionId:e,results:s.success.results,searchUid:s.success.searchUid,rootResult:i.folding.collections[e].result}});return function(_x161,_x162){return _ref73.apply(this,arguments)}}());function bN(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}m();d();f();p();var Hw=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});m();d();f();p();var ei=O("fields/registerFieldsToInclude",e=>B(e,us)),dl=O("fields/fetchall/enable"),pl=O("fields/fetchall/disable"),fl=Ie("fields/fetchDescription",/*#__PURE__*/function(){var _ref74=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:i,environment:a,organizationId:s}=o.configuration,{apiBaseUrl:c}=o.configuration.search,u=yield t.apiClient.fieldDescriptions({accessToken:i,organizationId:s,url:c??wr(s,a)});return yt(u)?n(u.error):u.success.fields});return function(_x163,_x164){return _ref74.apply(this,arguments)}}());m();d();f();p();var ml=["author","language","urihash","objecttype","collection","source","permanentid"],Pf=[...ml,"date","filetype","parents"],zw=[...Pf,"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"],Ww=()=>({fieldsToInclude:ml,fetchAllFields:!1,fieldsDescription:[]});var gl=Be(Ww(),e=>e.addCase(ei,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(dl,t=>{t.fetchAllFields=!0}).addCase(pl,t=>{t.fetchAllFields=!1}).addCase(fl.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(Qw,(t,{payload:r})=>{let n=Hw().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));function wN(e){return e.addReducers({fields:gl}),{registerFieldsToInclude:ei,enableFetchAllFields:dl,disableFetchAllFields:pl,fetchFieldsDescription:fl}}m();d();f();p();function AN(e){return e.addReducers({pipeline:so}),{setPipeline:ao}}m();d();f();p();function xN(e){return e.addReducers({recommendation:So}),{getRecommendations:Or,setRecommendationId:vo}}m();d();f();p();function CN(e){return e.addReducers({}),{logRecommendationOpen:Qs}}m();d();f();p();m();d();f();p();var EN=new ht({content:new De({required:!0}),conditions:new De({required:!0}),priority:new oe({required:!1,default:0,min:0}),fields:new Se({required:!1,each:Y})});function Kw(){let e=[],t=r=>{let n=EN.validate(r);if(!r.conditions.every(i=>i instanceof Function))throw new si("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(i=>i(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.linkContent:null}}}function Yw(e){if(!RN(e))throw $t;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=Kw();return{registerTemplates:(...o)=>{t(...o);let i=[];o.forEach(a=>{a.fields&&i.push(...a.fields)}),e.dispatch(ei(i))},selectTemplate:r,selectLinkTemplate:n}}function RN(e){return e.addReducers({fields:gl}),!0}m();d();f();p();function IN(e){return e.addReducers({searchHub:wo}),{setSearchHub:bo}}/**
43
43
  * @license
44
44
  *
45
45
  * Copyright 2026 Coveo Solutions Inc.
@@ -72,4 +72,4 @@ fast-json-patch/module/duplex.mjs:
72
72
  *)
73
73
  */if(__exports!=exports)module.exports=exports;return module.exports});
74
74
 
75
- window.coveoQuanticVersion = '3.44.1';
75
+ window.coveoQuanticVersion = '3.44.2';