@coveo/quantic 3.36.8 → 3.36.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +14 -14
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/search-engine/search-engine.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/commerce.index.d.ts +35 -36
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/breadcrumb-manager/headless-breadcrumb-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/facets/headless-core-commerce-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/sort/headless-core-commerce-sort.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/url-manager/headless-core-url-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/recent-queries-list/headless-recent-queries-list.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/search/did-you-mean/headless-did-you-mean.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/search-box/headless-search-box.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/context/headless-context.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/category-facet/headless-core-category-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/numeric-facet/headless-core-numeric-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/search-box/headless-core-search-box.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/did-you-mean/headless-did-you-mean.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facet-manager/headless-facet-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/category-facet/headless-category-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/facet/headless-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/range-facet/date-facet/headless-date-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/range-facet/date-facet/headless-date-filter.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/range-facet/numeric-facet/headless-numeric-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/range-facet/numeric-facet/headless-numeric-filter.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/folded-result-list/headless-folded-result-list.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/generated-answer/headless-generated-answer.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/generated-answer/headless-interactive-citation.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/breadcrumb-manager/headless-insight-breadcrumb-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/did-you-mean/headless-insight-did-you-mean.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facet-conditions-manager/headless-facet-conditions-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facet-manager/headless-insight-facet-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/category-facet/headless-insight-category-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/facet/headless-insight-facet-options.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/facet/headless-insight-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/range-facet/date-facet/headless-insight-date-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/range-facet/date-facet/headless-insight-date-filter.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/range-facet/numeric-facet/headless-insight-numeric-facet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facets/range-facet/numeric-facet/headless-insight-numeric-filter.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/folded-result-list/headless-insight-folded-result-list.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/generated-answer/headless-insight-generated-answer.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/generated-answer/headless-insight-interactive-citation.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/pager/headless-insight-pager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/recent-queries-list/headless-insight-recent-queries-list.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/result-list/headless-insight-interactive-result.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/result-list/headless-insight-result-list.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/results-per-page/headless-insight-results-per-page.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/search-box/headless-insight-search-box.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/search-parameter-manager/headless-insight-search-parameter-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/sort/headless-insight-sort.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/tab/headless-insight-tab.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/pager/headless-pager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/quickview/headless-quickview.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recent-queries-list/headless-recent-queries-list.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recommendation/result-list/headless-recommendation-interactive-result.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/relevance-inspector/headless-relevance-inspector.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/result-list/headless-result-list.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/results-per-page/headless-results-per-page.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/search-box/headless-search-box.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/search-parameter-manager/headless-search-parameter-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/search-status/headless-search-status.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/smart-snippet/headless-smart-snippet.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/sort/headless-sort.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/standalone-search-box/headless-standalone-search-box.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/static-filter/headless-static-filter.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/tab/headless-tab.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/analytics/generic-analytics-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/analytics/insight-analytics-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/analytics/search-analytics-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/facets/date-facet/date-facet-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/facets/numeric-facet/numeric-facet-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/pagination/pagination-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/product-enrichment/product-enrichment-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/recommendations/recommendations-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/search/search-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/sort/sort.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/triggers/triggers-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/configuration/configuration-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facet-options/facet-options-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/category-facet-set/category-facet-set-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/facet-set/facet-set-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/folding/insight-folding-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/follow-up-answers/follow-up-answers-actions.d.ts +10 -6
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-actions.d.ts +10 -6
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-state.d.ts +7 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/sse-generated-answer-errors.d.ts +22 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/instant-results/instant-results-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search-parameters/search-parameter-actions.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/standalone-search-box-set/standalone-search-box-set-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/index.d.ts +25 -25
- package/force-app/main/default/staticresources/coveoheadless/definitions/insight.index.d.ts +5 -5
- package/force-app/main/default/staticresources/coveoheadless/definitions/recommendation.index.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/filter-suggestions/headless-filter-suggestions-generator.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/generator/headless-commerce-facet-generator.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/instant-products/headless-instant-products.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/pagination/headless-core-commerce-pagination.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/parameter-manager/headless-core-parameter-manager.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/product-enrichment/headless-product-enrichment.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/product-list/headless-product-list.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/recent-queries-list/headless-recent-queries-list.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/search-box/headless-search-box.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/summary/headless-core-summary.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/types/controller-definitions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/types/engine.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/filter-suggestions/headless-filter-suggestions-generator.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/generator/headless-commerce-facet-generator.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/instant-products/headless-instant-products.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/pagination/headless-core-commerce-pagination.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/parameter-manager/headless-core-parameter-manager.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/product-enrichment/headless-product-enrichment.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/product-list/headless-product-list.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/recent-queries-list/headless-recent-queries-list.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/search-box/headless-search-box.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/summary/headless-core-summary.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/controller-inference.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/engine.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/search/types/controller-definition.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/utils/query-expression/query-expression.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/headless.js +17 -17
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +16 -16
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +13 -13
- package/force-app/main/default/staticresources/dompurify/purify.min.js +2 -2
- package/package.json +18 -19
|
@@ -14,38 +14,38 @@ function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){
|
|
|
14
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
|
-
*/(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadless",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadless"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var
|
|
18
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,i=!0,p=!1;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return i=f.done,f},e:function(f){p=!0,a=f},f:function(){try{i||r.return==null||r.return()}finally{if(p)throw a}}}}function wh(){return wh=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=Yk(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},wh.apply(null,arguments)}function hi(e){return hi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hi(e)}function Wk(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&&Fh(e,t)}function Dx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Dx=function(){return!!e})()}function Kk(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 Hk(e)}function Fh(e,t){return Fh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Fh(e,t)}function Yk(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=hi(e))!==null;);return e}function Jk(e,t,r,n){var o=wh(hi(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(a){return o.apply(r,a)}:o}function Xk(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 Zk(e){var t=Xk(e,"string");return typeof t=="symbol"?t:t+""}function eO(e,t){if(e){if(typeof e=="string")return kx(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)?kx(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function tO(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 rO(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 _x=function(){function e(){Eh(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return Ih(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],a=0,i=o.length;a<i;a++)if(o[a].callback===n){o.splice(a,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],a=o.slice(),i=function(){var g=a[p];try{g.callback.call(n,r)}catch(S){Promise.resolve().then(function(){throw S})}g.options&&g.options.once&&n.removeEventListener(r.type,g.callback)},p=0,f=a.length;p<f;p++)i();return!r.defaultPrevented}}}])}(),Th=function(e){function t(){var r;return Eh(this,t),r=zk(this,t),r.listeners||_x.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 Wk(t,e),Ih(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)),Jk(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,a=o===void 0?"Aborted":o;if(n)throw a}}],[{key:"timeout",value:function(n){var o=new jl;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 jl;function a(){o.abort(this.reason),i()}function i(){var g=Nx(n),S;try{for(g.s();!(S=g.n()).done;){var A=S.value;A.removeEventListener("abort",a)}}catch(h){g.e(h)}finally{g.f()}}var p=Nx(n),f;try{for(p.s();!(f=p.n()).done;){var m=f.value;if(m.aborted){o.abort(m.reason);break}else m.addEventListener("abort",a)}}catch(g){p.e(g)}finally{p.f()}return o.signal}}])}(_x),jl=function(){function e(){Eh(this,e),Object.defineProperty(this,"signal",{value:new Th,writable:!0,configurable:!0})}return Ih(e,[{key:"abort",value:function(r){var n=rO(r),o=tO(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(jl.prototype[Symbol.toStringTag]="AbortController",Th.prototype[Symbol.toStringTag]="AbortSignal");function nO(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 oO(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,a=t.AbortController,i=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,p=i===void 0?!1:i;if(!nO({fetch:r,Request:o,AbortController:a,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:p}))return{fetch:r,Request:f};var f=o;(f&&!f.prototype.hasOwnProperty("signal")||p)&&(f=function(A,h){var C;h&&h.signal&&(C=h.signal,delete h.signal);var w=new o(A,h);return C&&Object.defineProperty(w,"signal",{writable:!1,enumerable:!1,configurable:!0,value:C}),w},f.prototype=o.prototype);var m=r,g=function(A,h){var C=f&&f.prototype.isPrototypeOf(A)?A.signal:h?h.signal:void 0;if(C){var w;try{w=new DOMException("Aborted","AbortError")}catch{w=new Error("Aborted"),w.name="AbortError"}if(C.aborted)return Promise.reject(w);var R=new Promise(function(b,F){C.addEventListener("abort",function(){return F(w)},{once:!0})});return h&&h.signal&&delete h.signal,Promise.race([R,m(A,h)])}return m(A,h)};return{fetch:g,Request:f}}fu.AbortController=jl;fu.AbortSignal=Th;fu.abortableFetch=oO});var qx,s,v,l=du(()=>{"use strict";qx=kr(Ph(),1),s=kr(Ph(),1),{fetch:v}=(0,qx.abortableFetch)({fetch})});function mu(e){if(mO.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function kh(e){return e.replace(gO,"")}function gu(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||!hO(r))return!1}return!0}function hO(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function Vx(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 aO,Bx,iO,Gx,sO,cO,uO,lO,dO,pO,fO,mO,Mx,gO,yi,Oh,jx,Lx,Ux,Qx,x,Hx=du(()=>{"use strict";d();c();l();u();aO=Object.create,Bx=Object.defineProperty,iO=Object.getOwnPropertyDescriptor,Gx=Object.getOwnPropertyNames,sO=Object.getPrototypeOf,cO=Object.prototype.hasOwnProperty,uO=(e,t)=>function(){return t||(0,e[Gx(e)[0]])((t={exports:{}}).exports,t),t.exports},lO=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Gx(t))!cO.call(e,o)&&o!==r&&Bx(e,o,{get:()=>t[o],enumerable:!(n=iO(t,o))||n.enumerable});return e},dO=(e,t,r)=>(r=e!=null?aO(sO(e)):{},lO(t||!e||!e.__esModule?Bx(r,"default",{value:e,enumerable:!0}):r,e)),pO=uO({"node_modules/set-cookie-parser/lib/set-cookie.js"(e,t){"use strict";var r={decodeValues:!0,map:!1,silent:!1};function n(f){return typeof f=="string"&&!!f.trim()}function o(f,m){var g=f.split(";").filter(n),S=g.shift(),A=a(S),h=A.name,C=A.value;m=m?Object.assign({},r,m):r;try{C=m.decodeValues?decodeURIComponent(C):C}catch(R){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+C+"'. Set options.decodeValues to false to disable this feature.",R)}var w={name:h,value:C};return g.forEach(function(R){var b=R.split("="),F=b.shift().trimLeft().toLowerCase(),E=b.join("=");F==="expires"?w.expires=new Date(E):F==="max-age"?w.maxAge=parseInt(E,10):F==="secure"?w.secure=!0:F==="httponly"?w.httpOnly=!0:F==="samesite"?w.sameSite=E:w[F]=E}),w}function a(f){var m="",g="",S=f.split("=");return S.length>1?(m=S.shift(),g=S.join("=")):g=f,{name:m,value:g}}function i(f,m){if(m=m?Object.assign({},r,m):r,!f)return m.map?{}:[];if(f.headers)if(typeof f.headers.getSetCookie=="function")f=f.headers.getSetCookie();else if(f.headers["set-cookie"])f=f.headers["set-cookie"];else{var g=f.headers[Object.keys(f.headers).find(function(A){return A.toLowerCase()==="set-cookie"})];!g&&f.headers.cookie&&!m.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."),f=g}if(Array.isArray(f)||(f=[f]),m=m?Object.assign({},r,m):r,m.map){var S={};return f.filter(n).reduce(function(A,h){var C=o(h,m);return A[C.name]=C,A},S)}else return f.filter(n).map(function(A){return o(A,m)})}function p(f){if(Array.isArray(f))return f;if(typeof f!="string")return[];var m=[],g=0,S,A,h,C,w;function R(){for(;g<f.length&&/\s/.test(f.charAt(g));)g+=1;return g<f.length}function b(){return A=f.charAt(g),A!=="="&&A!==";"&&A!==","}for(;g<f.length;){for(S=g,w=!1;R();)if(A=f.charAt(g),A===","){for(h=g,g+=1,R(),C=g;g<f.length&&b();)g+=1;g<f.length&&f.charAt(g)==="="?(w=!0,g=C,m.push(f.substring(S,h)),S=g):g=h+1}else g+=1;(!w||g>=f.length)&&m.push(f.substring(S,f.length))}return m}t.exports=i,t.exports.parse=i,t.exports.parseString=o,t.exports.splitCookiesString=p}}),fO=dO(pO()),mO=/[^a-z0-9\-#$%&'*+.^_`|~]/i;Mx=[`
|
|
19
|
-
`,"\r","\t"," "],gO=new RegExp(`(^[${Mx.join("")}]|$[${Mx.join("")}])`,"g");yi=Symbol("normalizedHeaders"),Oh=Symbol("rawHeaderNames"),jx=", ",x=class $x{constructor(t){this[Lx]={},this[Ux]=new Map,this[Qx]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor.name)||t instanceof $x||typeof y.Headers<"u"&&t instanceof y.Headers?t.forEach((n,o)=>{this.append(o,n)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(jx):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(jx):n)})}[(Lx=yi,Ux=Oh,Qx=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[yi]).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(!gu(t))throw new TypeError(`Invalid header name "${t}"`);return this[yi].hasOwnProperty(mu(t))}get(t){if(!gu(t))throw TypeError(`Invalid header name "${t}"`);return this[yi][mu(t)]??null}set(t,r){if(!gu(t)||!Vx(r))return;let n=mu(t),o=kh(r);this[yi][n]=kh(o),this[Oh].set(n,t)}append(t,r){if(!gu(t)||!Vx(r))return;let n=mu(t),o=kh(r),a=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,a)}delete(t){if(!gu(t)||!this.has(t))return;let r=mu(t);delete this[yi][r],this[Oh].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===""?[""]:(0,fO.splitCookiesString)(t)}}});var d=du(()=>{"use strict";Hx()});var iA=Rt(xu=>{"use strict";d();c();l();u();var zl=xu&&xu.__assign||function(){return zl=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},zl.apply(this,arguments)};Object.defineProperty(xu,"__esModule",{value:!0});var OO={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function NO(e){var t=zl(zl({},OO),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}xu.getSanitizedOptions=NO});var sA=Rt(Lh=>{"use strict";d();c();l();u();Object.defineProperty(Lh,"__esModule",{value:!0});function _O(e){var t=Math.random()*e;return Math.round(t)}Lh.fullJitter=_O});var cA=Rt(Uh=>{"use strict";d();c();l();u();Object.defineProperty(Uh,"__esModule",{value:!0});function DO(e){return e}Uh.noJitter=DO});var uA=Rt(Qh=>{"use strict";d();c();l();u();Object.defineProperty(Qh,"__esModule",{value:!0});var qO=sA(),MO=cA();function VO(e){switch(e.jitter){case"full":return qO.fullJitter;case"none":default:return MO.noJitter}}Qh.JitterFactory=VO});var Gh=Rt(Bh=>{"use strict";d();c();l();u();Object.defineProperty(Bh,"__esModule",{value:!0});var jO=uA(),LO=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=jO.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}();Bh.Delay=LO});var lA=Rt(On=>{"use strict";d();c();l();u();var UO=On&&On.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),QO=On&&On.__awaiter||function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(S){i(S)}}function f(g){try{m(n.throw(g))}catch(S){i(S)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},BO=On&&On.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(g){return f([m,g])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=m[0]&2?o.return:m[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,m[1])).done)return a;switch(o=0,a&&(m=[m[0]&2,a.value]),m[0]){case 0:case 1:a=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!a||m[1]>a[0]&&m[1]<a[3])){r.label=m[1];break}if(m[0]===6&&r.label<a[1]){r.label=a[1],a=m;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(m);break}a[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(g){m=[6,g],o=0}finally{n=a=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(On,"__esModule",{value:!0});var GO=Gh(),$O=function(e){UO(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return QO(this,void 0,void 0,function(){return BO(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}(GO.Delay);On.SkipFirstDelay=$O});var dA=Rt(Au=>{"use strict";d();c();l();u();var HO=Au&&Au.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Au,"__esModule",{value:!0});var zO=Gh(),WO=function(e){HO(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(zO.Delay);Au.AlwaysDelay=WO});var pA=Rt($h=>{"use strict";d();c();l();u();Object.defineProperty($h,"__esModule",{value:!0});var KO=lA(),YO=dA();function JO(e,t){var r=XO(e);return r.setAttemptNumber(t),r}$h.DelayFactory=JO;function XO(e){return e.delayFirstAttempt?new YO.AlwaysDelay(e):new KO.SkipFirstDelay(e)}});var fA=Rt(Zo=>{"use strict";d();c();l();u();var Hh=Zo&&Zo.__awaiter||function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(S){i(S)}}function f(g){try{m(n.throw(g))}catch(S){i(S)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},zh=Zo&&Zo.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(g){return f([m,g])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=m[0]&2?o.return:m[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,m[1])).done)return a;switch(o=0,a&&(m=[m[0]&2,a.value]),m[0]){case 0:case 1:a=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!a||m[1]>a[0]&&m[1]<a[3])){r.label=m[1];break}if(m[0]===6&&r.label<a[1]){r.label=a[1],a=m;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(m);break}a[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(g){m=[6,g],o=0}finally{n=a=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(Zo,"__esModule",{value:!0});var ZO=iA(),eN=pA();function tN(e,t){return t===void 0&&(t={}),Hh(this,void 0,void 0,function(){var r,n;return zh(this,function(o){switch(o.label){case 0:return r=ZO.getSanitizedOptions(t),n=new rN(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}Zo.backOff=tN;var rN=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Hh(this,void 0,void 0,function(){var t,r;return zh(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 Hh(this,void 0,void 0,function(){var t;return zh(this,function(r){switch(r.label){case 0:return t=eN.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var Xd=Rt((aS,iS)=>{"use strict";d();c();l();u();(function(e,t){typeof aS=="object"&&typeof iS<"u"?iS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs=t()})(aS,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",a="minute",i="hour",p="day",f="week",m="month",g="quarter",S="year",A="date",h="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,R={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(H){var B=["th","st","nd","rd"],Q=H%100;return"["+H+(B[(Q-20)%10]||B[Q]||B[0])+"]"}},b=function(H,B,Q){var K=String(H);return!K||K.length>=B?H:""+Array(B+1-K.length).join(Q)+H},F={s:b,z:function(H){var B=-H.utcOffset(),Q=Math.abs(B),K=Math.floor(Q/60),$=Q%60;return(B<=0?"+":"-")+b(K,2,"0")+":"+b($,2,"0")},m:function H(B,Q){if(B.date()<Q.date())return-H(Q,B);var K=12*(Q.year()-B.year())+(Q.month()-B.month()),$=B.clone().add(K,m),te=Q-$<0,re=B.clone().add(K+(te?-1:1),m);return+(-(K+(Q-$)/(te?$-re:re-$))||0)},a:function(H){return H<0?Math.ceil(H)||0:Math.floor(H)},p:function(H){return{M:m,y:S,w:f,d:p,D:A,h:i,m:a,s:o,ms:n,Q:g}[H]||String(H||"").toLowerCase().replace(/s$/,"")},u:function(H){return H===void 0}},E="en",P={};P[E]=R;var j="$isDayjsObject",_=function(H){return H instanceof U||!(!H||!H[j])},k=function H(B,Q,K){var $;if(!B)return E;if(typeof B=="string"){var te=B.toLowerCase();P[te]&&($=te),Q&&(P[te]=Q,$=te);var re=B.split("-");if(!$&&re.length>1)return H(re[0])}else{var pe=B.name;P[pe]=B,$=pe}return!K&&$&&(E=$),$||!K&&E},N=function(H,B){if(_(H))return H.clone();var Q=typeof B=="object"?B:{};return Q.date=H,Q.args=arguments,new U(Q)},q=F;q.l=k,q.i=_,q.w=function(H,B){return N(H,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var U=function(){function H(Q){this.$L=k(Q.locale,null,!0),this.parse(Q),this.$x=this.$x||Q.x||{},this[j]=!0}var B=H.prototype;return B.parse=function(Q){this.$d=function(K){var $=K.date,te=K.utc;if($===null)return new Date(NaN);if(q.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var re=$.match(C);if(re){var pe=re[2]-1||0,Re=(re[7]||"0").substring(0,3);return te?new Date(Date.UTC(re[1],pe,re[3]||1,re[4]||0,re[5]||0,re[6]||0,Re)):new Date(re[1],pe,re[3]||1,re[4]||0,re[5]||0,re[6]||0,Re)}}return new Date($)}(Q),this.init()},B.init=function(){var Q=this.$d;this.$y=Q.getFullYear(),this.$M=Q.getMonth(),this.$D=Q.getDate(),this.$W=Q.getDay(),this.$H=Q.getHours(),this.$m=Q.getMinutes(),this.$s=Q.getSeconds(),this.$ms=Q.getMilliseconds()},B.$utils=function(){return q},B.isValid=function(){return this.$d.toString()!==h},B.isSame=function(Q,K){var $=N(Q);return this.startOf(K)<=$&&$<=this.endOf(K)},B.isAfter=function(Q,K){return N(Q)<this.startOf(K)},B.isBefore=function(Q,K){return this.endOf(K)<N(Q)},B.$g=function(Q,K,$){return q.u(Q)?this[K]:this.set($,Q)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(Q,K){var $=this,te=!!q.u(K)||K,re=q.p(Q),pe=function(Me,Ze){var at=q.w($.$u?Date.UTC($.$y,Ze,Me):new Date($.$y,Ze,Me),$);return te?at:at.endOf(p)},Re=function(Me,Ze){return q.w($.toDate()[Me].apply($.toDate("s"),(te?[0,0,0,0]:[23,59,59,999]).slice(Ze)),$)},ke=this.$W,Ce=this.$M,we=this.$D,Ae="set"+(this.$u?"UTC":"");switch(re){case S:return te?pe(1,0):pe(31,11);case m:return te?pe(1,Ce):pe(0,Ce+1);case f:var Ee=this.$locale().weekStart||0,rt=(ke<Ee?ke+7:ke)-Ee;return pe(te?we-rt:we+(6-rt),Ce);case p:case A:return Re(Ae+"Hours",0);case i:return Re(Ae+"Minutes",1);case a:return Re(Ae+"Seconds",2);case o:return Re(Ae+"Milliseconds",3);default:return this.clone()}},B.endOf=function(Q){return this.startOf(Q,!1)},B.$set=function(Q,K){var $,te=q.p(Q),re="set"+(this.$u?"UTC":""),pe=($={},$[p]=re+"Date",$[A]=re+"Date",$[m]=re+"Month",$[S]=re+"FullYear",$[i]=re+"Hours",$[a]=re+"Minutes",$[o]=re+"Seconds",$[n]=re+"Milliseconds",$)[te],Re=te===p?this.$D+(K-this.$W):K;if(te===m||te===S){var ke=this.clone().set(A,1);ke.$d[pe](Re),ke.init(),this.$d=ke.set(A,Math.min(this.$D,ke.daysInMonth())).$d}else pe&&this.$d[pe](Re);return this.init(),this},B.set=function(Q,K){return this.clone().$set(Q,K)},B.get=function(Q){return this[q.p(Q)]()},B.add=function(Q,K){var $,te=this;Q=Number(Q);var re=q.p(K),pe=function(Ce){var we=N(te);return q.w(we.date(we.date()+Math.round(Ce*Q)),te)};if(re===m)return this.set(m,this.$M+Q);if(re===S)return this.set(S,this.$y+Q);if(re===p)return pe(1);if(re===f)return pe(7);var Re=($={},$[a]=t,$[i]=r,$[o]=e,$)[re]||1,ke=this.$d.getTime()+Q*Re;return q.w(ke,this)},B.subtract=function(Q,K){return this.add(-1*Q,K)},B.format=function(Q){var K=this,$=this.$locale();if(!this.isValid())return $.invalidDate||h;var te=Q||"YYYY-MM-DDTHH:mm:ssZ",re=q.z(this),pe=this.$H,Re=this.$m,ke=this.$M,Ce=$.weekdays,we=$.months,Ae=$.meridiem,Ee=function(Ze,at,$t,ur){return Ze&&(Ze[at]||Ze(K,te))||$t[at].slice(0,ur)},rt=function(Ze){return q.s(pe%12||12,Ze,"0")},Me=Ae||function(Ze,at,$t){var ur=Ze<12?"AM":"PM";return $t?ur.toLowerCase():ur};return te.replace(w,function(Ze,at){return at||function($t){switch($t){case"YY":return String(K.$y).slice(-2);case"YYYY":return q.s(K.$y,4,"0");case"M":return ke+1;case"MM":return q.s(ke+1,2,"0");case"MMM":return Ee($.monthsShort,ke,we,3);case"MMMM":return Ee(we,ke);case"D":return K.$D;case"DD":return q.s(K.$D,2,"0");case"d":return String(K.$W);case"dd":return Ee($.weekdaysMin,K.$W,Ce,2);case"ddd":return Ee($.weekdaysShort,K.$W,Ce,3);case"dddd":return Ce[K.$W];case"H":return String(pe);case"HH":return q.s(pe,2,"0");case"h":return rt(1);case"hh":return rt(2);case"a":return Me(pe,Re,!0);case"A":return Me(pe,Re,!1);case"m":return String(Re);case"mm":return q.s(Re,2,"0");case"s":return String(K.$s);case"ss":return q.s(K.$s,2,"0");case"SSS":return q.s(K.$ms,3,"0");case"Z":return re}return null}(Ze)||re.replace(":","")})},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(Q,K,$){var te,re=this,pe=q.p(K),Re=N(Q),ke=(Re.utcOffset()-this.utcOffset())*t,Ce=this-Re,we=function(){return q.m(re,Re)};switch(pe){case S:te=we()/12;break;case m:te=we();break;case g:te=we()/3;break;case f:te=(Ce-ke)/6048e5;break;case p:te=(Ce-ke)/864e5;break;case i:te=Ce/r;break;case a:te=Ce/t;break;case o:te=Ce/e;break;default:te=Ce}return $?te:q.a(te)},B.daysInMonth=function(){return this.endOf(m).$D},B.$locale=function(){return P[this.$L]},B.locale=function(Q,K){if(!Q)return this.$L;var $=this.clone(),te=k(Q,K,!0);return te&&($.$L=te),$},B.clone=function(){return q.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},H}(),X=U.prototype;return N.prototype=X,[["$ms",n],["$s",o],["$m",a],["$H",i],["$W",p],["$M",m],["$y",S],["$D",A]].forEach(function(H){X[H[1]]=function(B){return this.$g(B,H[0],H[1])}}),N.extend=function(H,B){return H.$i||(H(B,U,N),H.$i=!0),N},N.locale=k,N.isDayjs=_,N.unix=function(H){return N(1e3*H)},N.en=P[E],N.Ls=P,N.p={},N})});var jb=Rt((sS,cS)=>{"use strict";d();c();l();u();(function(e,t){typeof sS=="object"&&typeof cS<"u"?cS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_quarterOfYear=t()})(sS,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(p){return this.$utils().u(p)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(p-1))};var a=o.add;o.add=function(p,f){return p=Number(p),this.$utils().p(f)===t?this.add(3*p,e):a.bind(this)(p,f)};var i=o.startOf;o.startOf=function(p,f){var m=this.$utils(),g=!!m.u(f)||f;if(m.p(p)===t){var S=this.quarter()-1;return g?this.month(3*S).startOf(e).startOf("day"):this.month(3*S+2).endOf(e).endOf("day")}return i.bind(this)(p,f)}}})});var Lb=Rt((uS,lS)=>{"use strict";d();c();l();u();(function(e,t){typeof uS=="object"&&typeof lS<"u"?lS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_customParseFormat=t()})(uS,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,o=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,i={},p=function(C){return(C=+C)+(C>68?1900:2e3)},f=function(C){return function(w){this[C]=+w}},m=[/[+-]\d\d:?(\d\d)?|Z/,function(C){(this.zone||(this.zone={})).offset=function(w){if(!w||w==="Z")return 0;var R=w.match(/([+-]|\d\d)/g),b=60*R[1]+(+R[2]||0);return b===0?0:R[0]==="+"?-b:b}(C)}],g=function(C){var w=i[C];return w&&(w.indexOf?w:w.s.concat(w.f))},S=function(C,w){var R,b=i.meridiem;if(b){for(var F=1;F<=24;F+=1)if(C.indexOf(b(F,0,w))>-1){R=F>12;break}}else R=C===(w?"pm":"PM");return R},A={A:[a,function(C){this.afternoon=S(C,!1)}],a:[a,function(C){this.afternoon=S(C,!0)}],Q:[r,function(C){this.month=3*(C-1)+1}],S:[r,function(C){this.milliseconds=100*+C}],SS:[n,function(C){this.milliseconds=10*+C}],SSS:[/\d{3}/,function(C){this.milliseconds=+C}],s:[o,f("seconds")],ss:[o,f("seconds")],m:[o,f("minutes")],mm:[o,f("minutes")],H:[o,f("hours")],h:[o,f("hours")],HH:[o,f("hours")],hh:[o,f("hours")],D:[o,f("day")],DD:[n,f("day")],Do:[a,function(C){var w=i.ordinal,R=C.match(/\d+/);if(this.day=R[0],w)for(var b=1;b<=31;b+=1)w(b).replace(/\[|\]/g,"")===C&&(this.day=b)}],w:[o,f("week")],ww:[n,f("week")],M:[o,f("month")],MM:[n,f("month")],MMM:[a,function(C){var w=g("months"),R=(g("monthsShort")||w.map(function(b){return b.slice(0,3)})).indexOf(C)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[a,function(C){var w=g("months").indexOf(C)+1;if(w<1)throw new Error;this.month=w%12||w}],Y:[/[+-]?\d+/,f("year")],YY:[n,function(C){this.year=p(C)}],YYYY:[/\d{4}/,f("year")],Z:m,ZZ:m};function h(C){var w,R;w=C,R=i&&i.formats;for(var b=(C=w.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(N,q,U){var X=U&&U.toUpperCase();return q||R[U]||e[U]||R[X].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(H,B,Q){return B||Q.slice(1)})})).match(t),F=b.length,E=0;E<F;E+=1){var P=b[E],j=A[P],_=j&&j[0],k=j&&j[1];b[E]=k?{regex:_,parser:k}:P.replace(/^\[|\]$/g,"")}return function(N){for(var q={},U=0,X=0;U<F;U+=1){var H=b[U];if(typeof H=="string")X+=H.length;else{var B=H.regex,Q=H.parser,K=N.slice(X),$=B.exec(K)[0];Q.call(q,$),N=N.replace($,"")}}return function(te){var re=te.afternoon;if(re!==void 0){var pe=te.hours;re?pe<12&&(te.hours+=12):pe===12&&(te.hours=0),delete te.afternoon}}(q),q}}return function(C,w,R){R.p.customParseFormat=!0,C&&C.parseTwoDigitYear&&(p=C.parseTwoDigitYear);var b=w.prototype,F=b.parse;b.parse=function(E){var P=E.date,j=E.utc,_=E.args;this.$u=j;var k=_[1];if(typeof k=="string"){var N=_[2]===!0,q=_[3]===!0,U=N||q,X=_[2];q&&(X=_[2]),i=this.$locale(),!N&&X&&(i=R.Ls[X]),this.$d=function(K,$,te,re){try{if(["x","X"].indexOf($)>-1)return new Date(($==="X"?1e3:1)*K);var pe=h($)(K),Re=pe.year,ke=pe.month,Ce=pe.day,we=pe.hours,Ae=pe.minutes,Ee=pe.seconds,rt=pe.milliseconds,Me=pe.zone,Ze=pe.week,at=new Date,$t=Ce||(Re||ke?1:at.getDate()),ur=Re||at.getFullYear(),no=0;Re&&!ke||(no=ke>0?ke-1:at.getMonth());var mi,gi=we||0,uu=Ae||0,bh=Ee||0,Rh=rt||0;return Me?new Date(Date.UTC(ur,no,$t,gi,uu,bh,Rh+60*Me.offset*1e3)):te?new Date(Date.UTC(ur,no,$t,gi,uu,bh,Rh)):(mi=new Date(ur,no,$t,gi,uu,bh,Rh),Ze&&(mi=re(mi).week(Ze).toDate()),mi)}catch{return new Date("")}}(P,k,j,R),this.init(),X&&X!==!0&&(this.$L=this.locale(X).$L),U&&P!=this.format(k)&&(this.$d=new Date("")),i={}}else if(k instanceof Array)for(var H=k.length,B=1;B<=H;B+=1){_[1]=k[B-1];var Q=R.apply(this,_);if(Q.isValid()){this.$d=Q.$d,this.$L=Q.$L,this.init();break}B===H&&(this.$d=new Date(""))}else F.call(this,E)}}})});var iw=Rt((LS,US)=>{"use strict";d();c();l();u();(function(e,t){typeof LS=="object"&&typeof US<"u"?US.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_timezone=t()})(LS,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var a,i=function(g,S,A){A===void 0&&(A={});var h=new Date(g),C=function(w,R){R===void 0&&(R={});var b=R.timeZoneName||"short",F=w+"|"+b,E=t[F];return E||(E=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:w,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:b}),t[F]=E),E}(S,A);return C.formatToParts(h)},p=function(g,S){for(var A=i(g,S),h=[],C=0;C<A.length;C+=1){var w=A[C],R=w.type,b=w.value,F=e[R];F>=0&&(h[F]=parseInt(b,10))}var E=h[3],P=E===24?0:E,j=h[0]+"-"+h[1]+"-"+h[2]+" "+P+":"+h[4]+":"+h[5]+":000",_=+g;return(o.utc(j).valueOf()-(_-=_%1e3))/6e4},f=n.prototype;f.tz=function(g,S){g===void 0&&(g=a);var A,h=this.utcOffset(),C=this.toDate(),w=C.toLocaleString("en-US",{timeZone:g}),R=Math.round((C-new Date(w))/1e3/60),b=15*-Math.round(C.getTimezoneOffset()/15)-R;if(!Number(b))A=this.utcOffset(0,S);else if(A=o(w,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(b,!0),S){var F=A.utcOffset();A=A.add(h-F,"minute")}return A.$x.$timezone=g,A},f.offsetName=function(g){var S=this.$x.$timezone||o.tz.guess(),A=i(this.valueOf(),S,{timeZoneName:g}).find(function(h){return h.type.toLowerCase()==="timezonename"});return A&&A.value};var m=f.startOf;f.startOf=function(g,S){if(!this.$x||!this.$x.$timezone)return m.call(this,g,S);var A=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return m.call(A,g,S).tz(this.$x.$timezone,!0)},o.tz=function(g,S,A){var h=A&&S,C=A||S||a,w=p(+o(),C);if(typeof g!="string")return o(g).tz(C);var R=function(P,j,_){var k=P-60*j*1e3,N=p(k,_);if(j===N)return[k,j];var q=p(k-=60*(N-j)*1e3,_);return N===q?[k,N]:[P-60*Math.min(N,q)*1e3,Math.max(N,q)]}(o.utc(g,h).valueOf(),w,C),b=R[0],F=R[1],E=o(b).utcOffset(F);return E.$x.$timezone=C,E},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(g){a=g}}})});var sw=Rt((QS,BS)=>{"use strict";d();c();l();u();(function(e,t){typeof QS=="object"&&typeof BS<"u"?BS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_utc=t()})(QS,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,a){var i=o.prototype;a.utc=function(h){var C={date:h,utc:!0,args:arguments};return new o(C)},i.utc=function(h){var C=a(this.toDate(),{locale:this.$L,utc:!0});return h?C.add(this.utcOffset(),e):C},i.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var p=i.parse;i.parse=function(h){h.utc&&(this.$u=!0),this.$utils().u(h.$offset)||(this.$offset=h.$offset),p.call(this,h)};var f=i.init;i.init=function(){if(this.$u){var h=this.$d;this.$y=h.getUTCFullYear(),this.$M=h.getUTCMonth(),this.$D=h.getUTCDate(),this.$W=h.getUTCDay(),this.$H=h.getUTCHours(),this.$m=h.getUTCMinutes(),this.$s=h.getUTCSeconds(),this.$ms=h.getUTCMilliseconds()}else f.call(this)};var m=i.utcOffset;i.utcOffset=function(h,C){var w=this.$utils().u;if(w(h))return this.$u?0:w(this.$offset)?m.call(this):this.$offset;if(typeof h=="string"&&(h=function(E){E===void 0&&(E="");var P=E.match(t);if(!P)return null;var j=(""+P[0]).match(r)||["-",0,0],_=j[0],k=60*+j[1]+ +j[2];return k===0?0:_==="+"?k:-k}(h),h===null))return this;var R=Math.abs(h)<=16?60*h:h,b=this;if(C)return b.$offset=R,b.$u=h===0,b;if(h!==0){var F=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(b=this.local().add(R+F,e)).$offset=R,b.$x.$localOffset=F}else b=this.utc();return b};var g=i.format;i.format=function(h){var C=h||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return g.call(this,C)},i.valueOf=function(){var h=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*h},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var S=i.toDate;i.toDate=function(h){return h==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():S.call(this)};var A=i.diff;i.diff=function(h,C,w){if(h&&this.$u===h.$u)return A.call(this,h,C,w);var R=this.local(),b=a(h).local();return A.call(R,b,C,w)}}})});var rE=Rt((BAe,tE)=>{"use strict";d();c();l();u();function lU(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}tE.exports=dU;function dU(e,t,r){var n=r&&r.stringify||lU,o=1;if(typeof e=="object"&&e!==null){var a=t.length+o;if(a===1)return e;var i=new Array(a);i[0]=n(e);for(var p=1;p<a;p++)i[p]=n(t[p]);return i.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var m="",g=1-o,S=-1,A=e&&e.length||0,h=0;h<A;){if(e.charCodeAt(h)===37&&h+1<A){switch(S=S>-1?S:0,e.charCodeAt(h+1)){case 100:case 102:if(g>=f||t[g]==null)break;S<h&&(m+=e.slice(S,h)),m+=Number(t[g]),S=h+2,h++;break;case 105:if(g>=f||t[g]==null)break;S<h&&(m+=e.slice(S,h)),m+=Math.floor(Number(t[g])),S=h+2,h++;break;case 79:case 111:case 106:if(g>=f||t[g]===void 0)break;S<h&&(m+=e.slice(S,h));var C=typeof t[g];if(C==="string"){m+="'"+t[g]+"'",S=h+2,h++;break}if(C==="function"){m+=t[g].name||"<anonymous>",S=h+2,h++;break}m+=n(t[g]),S=h+2,h++;break;case 115:if(g>=f)break;S<h&&(m+=e.slice(S,h)),m+=String(t[g]),S=h+2,h++;break;case 37:S<h&&(m+=e.slice(S,h)),m+="%",S=h+2,h++,g--;break}++g}++h}return S===-1?e:(S<A&&(m+=e.slice(S)),m)}});var cE=Rt((WAe,Am)=>{"use strict";d();c();l();u();var nE=rE();Am.exports=zn;var hl=FU().console||{},pU={mapHttpRequest:xm,mapHttpResponse:xm,wrapRequestSerializer:Nv,wrapResponseSerializer:Nv,wrapErrorSerializer:Nv,req:xm,res:xm,err:aE,errWithCause:aE};function qo(e,t){return e==="silent"?1/0:t.levels.values[e]}var qv=Symbol("pino.logFuncs"),_v=Symbol("pino.hierarchy"),fU={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function oE(e,t){let r={logger:t,parent:e[_v]};t[_v]=r}function mU(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:hl[o]||hl[fU[o]||"log"]||Js}),e[qv]=n}function gU(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function zn(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||hl;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=gU(e.browser.serialize,n),a=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(a=!1);let i=Object.keys(e.customLevels||{}),p=["error","fatal","warn","info","debug","trace"].concat(i);typeof r=="function"&&p.forEach(function(w){r[w]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let f=e.level||"info",m=Object.create(r);m.log||(m.log=Js),mU(m,p,r),oE({},m),Object.defineProperty(m,"levelVal",{get:S}),Object.defineProperty(m,"level",{get:A,set:h});let g={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:p,timestamp:bU(e),messageKey:e.messageKey||"msg",onChild:e.onChild||Js};m.levels=hU(e),m.level=f,m.isLevelEnabled=function(w){return this.levels.values[w]?this.levels.values[w]>=this.levels.values[this.level]:!1},m.setMaxListeners=m.getMaxListeners=m.emit=m.addListener=m.on=m.prependListener=m.once=m.prependOnceListener=m.removeListener=m.removeAllListeners=m.listeners=m.listenerCount=m.eventNames=m.write=m.flush=Js,m.serializers=n,m._serialize=o,m._stdErrSerialize=a,m.child=function(...w){return C.call(this,g,...w)},t&&(m._logEvent=Dv());function S(){return qo(this.level,this)}function A(){return this._level}function h(w){if(w!=="silent"&&!this.levels.values[w])throw Error("unknown level "+w);this._level=w,Wa(this,g,m,"error"),Wa(this,g,m,"fatal"),Wa(this,g,m,"warn"),Wa(this,g,m,"info"),Wa(this,g,m,"debug"),Wa(this,g,m,"trace"),i.forEach(R=>{Wa(this,g,m,R)})}function C(w,R,b){if(!R)throw new Error("missing bindings for child Pino");b=b||{},o&&R.serializers&&(b.serializers=R.serializers);let F=b.serializers;if(o&&F){var E=Object.assign({},n,F),P=e.browser.serialize===!0?Object.keys(E):o;delete R.serializers,Mv([R],P,E,this._stdErrSerialize)}function j(k){this._childLevel=(k._childLevel|0)+1,this.bindings=R,E&&(this.serializers=E,this._serialize=P),t&&(this._logEvent=Dv([].concat(k._logEvent.bindings,R)))}j.prototype=this;let _=new j(this);return oE(this,_),_.child=function(...k){return C.call(this,w,...k)},_.level=b.level||this.level,w.onChild(_),_}return m}function hU(e){let t=e.customLevels||{},r=Object.assign({},zn.levels.values,t),n=Object.assign({},zn.levels.labels,yU(t));return{values:r,labels:n}}function yU(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}zn.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"}};zn.stdSerializers=pU;zn.stdTimeFunctions=Object.assign({},{nullTime:iE,epochTime:sE,unixTime:RU,isoTime:wU});function SU(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[_v];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function Wa(e,t,r,n){if(Object.defineProperty(e,n,{value:qo(e.level,r)>qo(n,r)?Js:r[qv][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===Js){if(!t.transmit)return;let a=t.transmit.level||e.level,i=qo(a,r);if(qo(n,r)<i)return}e[n]=xU(e,t,r,n);let o=SU(e);o.length!==0&&(e[n]=vU(o,e[n]))}function vU(e,t){return function(){return t.apply(this,[...e,...arguments])}}function xU(e,t,r,n){return function(o){return function(){let i=t.timestamp(),p=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===hl?hl:this;for(var m=0;m<p.length;m++)p[m]=arguments[m];var g=!1;if(t.serialize&&(Mv(p,this._serialize,this.serializers,this._stdErrSerialize),g=!0),t.asObject||t.formatters?o.call(f,...AU(this,n,p,i,t)):o.apply(f,p),t.transmit){let S=t.transmit.level||e._level,A=qo(S,r),h=qo(n,r);if(h<A)return;CU(this,{ts:i,methodLevel:n,methodValue:h,transmitLevel:S,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:qo(e._level,r)},p,g)}}}(e[qv][n])}function AU(e,t,r,n,o){let{level:a,log:i=S=>S}=o.formatters||{},p=r.slice(),f=p[0],m={},g=(e._childLevel|0)+1;if(g<1&&(g=1),n&&(m.time=n),a){let S=a(t,e.levels.values[t]);Object.assign(m,S)}else m.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(f!==null&&typeof f=="object")for(;g--&&typeof p[0]=="object";)Object.assign(m,p.shift());return[i(m),...p]}else{if(f!==null&&typeof f=="object"){for(;g--&&typeof p[0]=="object";)Object.assign(m,p.shift());f=p.length?nE(p.shift(),p):void 0}else typeof f=="string"&&(f=nE(p.shift(),p));return f!==void 0&&(m[o.messageKey]=f),[i(m)]}}function Mv(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=zn.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let a in e[o])t.indexOf(a)>-1&&a in r&&(e[o][a]=r[a](e[o][a]))}function CU(e,t,r,n=!1){let o=t.send,a=t.ts,i=t.methodLevel,p=t.methodValue,f=t.val,m=e._logEvent.bindings;n||Mv(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=a,e._logEvent.messages=r.filter(function(g){return m.indexOf(g)===-1}),e._logEvent.level.label=i,e._logEvent.level.value=p,o(i,e._logEvent,f),e._logEvent=Dv(m)}function Dv(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function aE(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 bU(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?iE:sE}function xm(){return{}}function Nv(e){return e}function Js(){}function iE(){return!1}function sE(){return Date.now()}function RU(){return Math.round(Date.now()/1e3)}function wU(){return new Date(Date.now()).toISOString()}function FU(){function e(t){return typeof t<"u"&&t}try{return typeof y<"u"?y:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),y)}catch{return e(self)||e(window)||e(this)||{}}}Am.exports.default=zn;Am.exports.pino=zn});var h$={};pu(h$,{API_DATE_FORMAT:()=>fs,DefaultFieldsToInclude:()=>Yv,EcommerceDefaultFieldsToInclude:()=>XI,HighlightUtils:()=>Dh,MinimumFieldsToInclude:()=>qg,ResultTemplatesHelpers:()=>hR,SortBy:()=>la,SortOrder:()=>Qu,VERSION:()=>uo,baseFacetResponseSelector:()=>Nr,buildAutomaticFacetGenerator:()=>dI,buildBreadcrumbManager:()=>$E,buildCategoryFacet:()=>CI,buildCategoryFieldSuggestions:()=>$I,buildContext:()=>WE,buildController:()=>ne,buildCriterionExpression:()=>Hr,buildDateFacet:()=>qI,buildDateFilter:()=>VI,buildDateRange:()=>jo,buildDateSortCriterion:()=>qd,buildDictionaryFieldContext:()=>JE,buildDidYouMean:()=>nI,buildExecuteTrigger:()=>ik,buildFacet:()=>PI,buildFacetConditionsManager:()=>YE,buildFacetManager:()=>aI,buildFieldSortCriterion:()=>Md,buildFieldSuggestions:()=>HI,buildFoldedResultList:()=>tT,buildGeneratedAnswer:()=>dT,buildHistoryManager:()=>ET,buildInstantResults:()=>MT,buildInteractiveCitation:()=>fT,buildInteractiveInstantResult:()=>IT,buildInteractiveRecentResult:()=>rP,buildInteractiveResult:()=>lP,buildNoSortCriterion:()=>jd,buildNotifyTrigger:()=>ck,buildNumericFacet:()=>QI,buildNumericFilter:()=>GI,buildNumericRange:()=>bc,buildPager:()=>LT,buildQueryError:()=>QT,buildQueryExpression:()=>m$,buildQueryRankingExpressionSortCriterion:()=>Vd,buildQuerySummary:()=>GT,buildQueryTrigger:()=>uk,buildQuickview:()=>WT,buildRecentQueriesList:()=>ZT,buildRecentResultsList:()=>oP,buildRedirectionTrigger:()=>lk,buildRelevanceInspector:()=>uP,buildRelevanceSortCriterion:()=>Hi,buildResultList:()=>dP,buildResultTemplatesManager:()=>Ck,buildResultsPerPage:()=>fP,buildSearchBox:()=>nh,buildSearchEngine:()=>AE,buildSearchParameterManager:()=>ch,buildSearchParameterSerializer:()=>ql,buildSearchStatus:()=>DP,buildSmartSnippet:()=>jP,buildSmartSnippetQuestionsList:()=>QP,buildSort:()=>HP,buildStandaloneSearchBox:()=>YP,buildStaticFilter:()=>JP,buildStaticFilterValue:()=>Ex,buildTab:()=>ZP,buildTabManager:()=>ek,buildUrlManager:()=>hk,currentPageSelector:()=>ro,currentPagesSelector:()=>Hg,deserializeRelativeDate:()=>Yb,facetRequestSelector:()=>kd,facetResponseSelectedValuesSelector:()=>rb,facetResponseSelector:()=>ji,getAnalyticsNextApiBaseUrl:()=>Wl,getOrganizationEndpoint:()=>Ft,getSampleSearchEngineConfiguration:()=>Lv,getSearchApiBaseUrl:()=>ct,loadAdvancedSearchQueryActions:()=>b2,loadAutomaticFacetSetActions:()=>q2,loadBreadcrumbActions:()=>E2,loadCategoryFacetSetActions:()=>M2,loadClickAnalyticsActions:()=>R2,loadConfigurationActions:()=>I2,loadContextActions:()=>P2,loadDateFacetSetActions:()=>j2,loadDebugActions:()=>k2,loadDictionaryFieldContextActions:()=>O2,loadDidYouMeanActions:()=>N2,loadExcerptLengthActions:()=>_2,loadFacetOptionsActions:()=>D2,loadFacetSetActions:()=>V2,loadFieldActions:()=>U2,loadFoldingActions:()=>Q2,loadGeneratedAnswerActions:()=>B2,loadGenericAnalyticsActions:()=>w2,loadHistoryActions:()=>G2,loadIPXActionsHistoryActions:()=>C2,loadInstantResultsActions:()=>$2,loadNumericFacetSetActions:()=>L2,loadPaginationActions:()=>H2,loadPipelineActions:()=>z2,loadQueryActions:()=>W2,loadQuerySetActions:()=>K2,loadQuerySuggestActions:()=>Y2,loadQuestionAnsweringActions:()=>J2,loadRecentQueriesActions:()=>X2,loadRecentResultsActions:()=>Z2,loadResultPreviewActions:()=>e$,loadSearchActions:()=>n$,loadSearchAnalyticsActions:()=>F2,loadSearchConfigurationActions:()=>T2,loadSearchHubActions:()=>o$,loadSearchParameterActions:()=>a$,loadSortCriteriaActions:()=>i$,loadStandaloneSearchBoxSetActions:()=>s$,loadStaticFilterSetActions:()=>c$,loadTabSetActions:()=>u$,maxPageSelector:()=>kl,parseCriterionExpression:()=>bk,validateRelativeDate:()=>xo});module.exports=Uk(h$);d();c();l();u();var Dh={};pu(Dh,{escapeHtml:()=>Ai,getHighlightedSuggestion:()=>_h,highlightString:()=>RO});d();c();l();u();d();c();l();u();function yO(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("CoveoHeadless",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadless"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var $k=Object.create;var pu=Object.defineProperty;var Hk=Object.getOwnPropertyDescriptor;var zk=Object.getOwnPropertyNames;var Wk=Object.getPrototypeOf,Kk=Object.prototype.hasOwnProperty;var Yk=(e,t,r)=>t in e?pu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var yi=(e,t)=>()=>(e&&(t=e(e=0)),t);var Rt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),fu=(e,t)=>{for(var r in t)pu(e,r,{get:t[r],enumerable:!0})},Lx=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of zk(t))!Kk.call(e,o)&&o!==r&&pu(e,o,{get:()=>t[o],enumerable:!(n=Hk(t,o))||n.enumerable});return e};var kr=(e,t,r)=>(r=e!=null?$k(Wk(e)):{},Lx(t||!e||!e.__esModule?pu(r,"default",{value:e,enumerable:!0}):r,e)),Jk=e=>Lx(pu({},"__esModule",{value:!0}),e);var Ne=(e,t,r)=>Yk(e,typeof t!="symbol"?t+"":t,r);var y,c=yi(()=>{"use strict";y=typeof globalThis<"u"?globalThis:window});function Vl(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Vl=function(t){return typeof t}:Vl=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vl(e)}function eO(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=tO.bind(this))}function tO(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","*/*"),Xk(t)?(o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),o.responseType="text"):Zk(t)&&t.type&&o.setRequestHeader("Content-Type",t.type);try{o.send(t)}catch{return!1}return!0}var Xk,Zk,u=yi(()=>{"use strict";Xk=function(t){return typeof t=="string"},Zk=function(t){return t instanceof Blob};eO.call((typeof window>"u"?"undefined":Vl(window))==="object"?window:{})});var qh=Rt(mu=>{"use strict";d();c();l();u();Object.defineProperty(mu,"__esModule",{value:!0});function Ux(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 rO(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nO(e,t,r){return t=Si(t),aO(e,$x()?Reflect.construct(t,r||[],Si(e).constructor):t.apply(e,r))}function Nh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qx(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,uO(n.key),n)}}function _h(e,t,r){return t&&Qx(e.prototype,t),r&&Qx(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bx(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=lO(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
18
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,i=!0,p=!1;return{s:function(){r=r.call(e)},n:function(){var f=r.next();return i=f.done,f},e:function(f){p=!0,a=f},f:function(){try{i||r.return==null||r.return()}finally{if(p)throw a}}}}function kh(){return kh=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=iO(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},kh.apply(null,arguments)}function Si(e){return Si=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Si(e)}function oO(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&&Oh(e,t)}function $x(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($x=function(){return!!e})()}function aO(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 rO(e)}function Oh(e,t){return Oh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Oh(e,t)}function iO(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Si(e))!==null;);return e}function sO(e,t,r,n){var o=kh(Si(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(a){return o.apply(r,a)}:o}function cO(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 uO(e){var t=cO(e,"string");return typeof t=="symbol"?t:t+""}function lO(e,t){if(e){if(typeof e=="string")return Ux(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)?Ux(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function dO(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 pO(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 Gx=function(){function e(){Nh(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return _h(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],a=0,i=o.length;a<i;a++)if(o[a].callback===n){o.splice(a,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],a=o.slice(),i=function(){var h=a[p];try{h.callback.call(n,r)}catch(S){Promise.resolve().then(function(){throw S})}h.options&&h.options.once&&n.removeEventListener(r.type,h.callback)},p=0,f=a.length;p<f;p++)i();return!r.defaultPrevented}}}])}(),Dh=function(e){function t(){var r;return Nh(this,t),r=nO(this,t),r.listeners||Gx.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 oO(t,e),_h(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)),sO(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,a=o===void 0?"Aborted":o;if(n)throw a}}],[{key:"timeout",value:function(n){var o=new Ll;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 Ll;function a(){o.abort(this.reason),i()}function i(){var h=Bx(n),S;try{for(h.s();!(S=h.n()).done;){var v=S.value;v.removeEventListener("abort",a)}}catch(g){h.e(g)}finally{h.f()}}var p=Bx(n),f;try{for(p.s();!(f=p.n()).done;){var m=f.value;if(m.aborted){o.abort(m.reason);break}else m.addEventListener("abort",a)}}catch(h){p.e(h)}finally{p.f()}return o.signal}}])}(Gx),Ll=function(){function e(){Nh(this,e),Object.defineProperty(this,"signal",{value:new Dh,writable:!0,configurable:!0})}return _h(e,[{key:"abort",value:function(r){var n=pO(r),o=dO(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(Ll.prototype[Symbol.toStringTag]="AbortController",Dh.prototype[Symbol.toStringTag]="AbortSignal");function fO(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 mO(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,a=t.AbortController,i=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,p=i===void 0?!1:i;if(!fO({fetch:r,Request:o,AbortController:a,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:p}))return{fetch:r,Request:f};var f=o;(f&&!f.prototype.hasOwnProperty("signal")||p)&&(f=function(v,g){var C;g&&g.signal&&(C=g.signal,delete g.signal);var w=new o(v,g);return C&&Object.defineProperty(w,"signal",{writable:!1,enumerable:!1,configurable:!0,value:C}),w},f.prototype=o.prototype);var m=r,h=function(v,g){var C=f&&f.prototype.isPrototypeOf(v)?v.signal:g?g.signal:void 0;if(C){var w;try{w=new DOMException("Aborted","AbortError")}catch{w=new Error("Aborted"),w.name="AbortError"}if(C.aborted)return Promise.reject(w);var R=new Promise(function(b,F){C.addEventListener("abort",function(){return F(w)},{once:!0})});return g&&g.signal&&delete g.signal,Promise.race([R,m(v,g)])}return m(v,g)};return{fetch:h,Request:f}}mu.AbortController=Ll;mu.AbortSignal=Dh;mu.abortableFetch=mO});var Hx,s,x,l=yi(()=>{"use strict";Hx=kr(qh(),1),s=kr(qh(),1),{fetch:x}=(0,Hx.abortableFetch)({fetch})});function Mh(e){return typeof e!="string"||e in{}}function jh(){return Object.create(null)}function zx(e){return typeof e=="string"&&!!e.trim()}function Vh(e,t){var r=e.split(";").filter(zx),n=r.shift(),o=gO(n),a=o.name,i=o.value;if(t=t?Object.assign({},Ul,t):Ul,Mh(a))return null;try{i=t.decodeValues?decodeURIComponent(i):i}catch(f){console.error("set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",f)}var p=jh();return p.name=a,p.value=i,r.forEach(function(f){var m=f.split("="),h=m.shift().trimLeft().toLowerCase();if(!Mh(h)){var S=m.join("=");if(h==="expires")p.expires=new Date(S);else if(h==="max-age"){var v=parseInt(S,10);Number.isNaN(v)||(p.maxAge=v)}else h==="secure"?p.secure=!0:h==="httponly"?p.httpOnly=!0:h==="samesite"?p.sameSite=S:h==="partitioned"?p.partitioned=!0:h&&(p[h]=S)}}),p}function gO(e){var t="",r="",n=e.split("=");return n.length>1?(t=n.shift(),r=n.join("=")):r=e,{name:t,value:r}}function vi(e,t){if(t=t?Object.assign({},Ul,t):Ul,!e)return t.map?jh():[];if(e.headers)if(typeof e.headers.getSetCookie=="function")e=e.headers.getSetCookie();else if(e.headers["set-cookie"])e=e.headers["set-cookie"];else{var r=e.headers[Object.keys(e.headers).find(function(i){return i.toLowerCase()==="set-cookie"})];!r&&e.headers.cookie&&!t.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),e=r}var n=t.split,o=Array.isArray(e);if(n==="auto"&&(n=!o),o||(e=[e]),e=e.filter(zx),n&&(e=e.map(Ql).flat()),t.map){var a=jh();return e.reduce(function(i,p){var f=Vh(p,t);return f&&!Mh(f.name)&&(i[f.name]=f),i},a)}else return e.map(function(i){return Vh(i,t)}).filter(Boolean)}function Ql(e){if(Array.isArray(e))return e;if(typeof e!="string")return[];var t=[],r=0,n,o,a,i,p;function f(){for(;r<e.length&&/\s/.test(e.charAt(r));)r+=1;return r<e.length}function m(){return o=e.charAt(r),o!=="="&&o!==";"&&o!==","}for(;r<e.length;){for(n=r,p=!1;f();)if(o=e.charAt(r),o===","){for(a=r,r+=1,f(),i=r;r<e.length&&m();)r+=1;r<e.length&&e.charAt(r)==="="?(p=!0,r=i,t.push(e.substring(n,a)),n=r):r=a+1}else r+=1;(!p||r>=e.length)&&t.push(e.substring(n,e.length))}return t}var Ul,Wx=yi(()=>{"use strict";d();c();l();u();Ul={decodeValues:!0,map:!1,silent:!1,split:"auto"};vi.parseSetCookie=vi;vi.parse=vi;vi.parseString=Vh;vi.splitCookiesString=Ql});function gu(e){if(hO.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function Lh(e){return e.replace(yO,"")}function hu(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||!SO(r))return!1}return!0}function SO(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function Yx(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 hO,Kx,yO,Jx,xi,Uh,Xx,A,eA=yi(()=>{"use strict";d();c();l();u();Wx();hO=/[^a-z0-9\-#$%&'*+.^_`|~]/i;Kx=[`
|
|
19
|
+
`,"\r","\t"," "],yO=new RegExp(`(^[${Kx.join("")}]|$[${Kx.join("")}])`,"g");xi=Symbol("normalizedHeaders"),Uh=Symbol("rawHeaderNames"),Xx=", ",A=class Zx{constructor(t){this[xi]={},this[Uh]=new Map,this[Jx]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor?.name)||t instanceof Zx||typeof y.Headers<"u"&&t instanceof y.Headers?t.forEach((r,n)=>{this.append(n,r)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(Xx):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(Xx):n)})}[(Jx=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[xi]).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(!hu(t))throw new TypeError(`Invalid header name "${t}"`);return this[xi].hasOwnProperty(gu(t))}get(t){if(!hu(t))throw TypeError(`Invalid header name "${t}"`);return this[xi][gu(t)]??null}set(t,r){if(!hu(t)||!Yx(r))return;let n=gu(t),o=Lh(r);this[xi][n]=Lh(o),this[Uh].set(n,t)}append(t,r){if(!hu(t)||!Yx(r))return;let n=gu(t),o=Lh(r),a=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,a)}delete(t){if(!hu(t)||!this.has(t))return;let r=gu(t);delete this[xi][r],this[Uh].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===""?[""]:Ql(t)}}});var d=yi(()=>{"use strict";eA()});var mA=Rt(Au=>{"use strict";d();c();l();u();var Yl=Au&&Au.__assign||function(){return Yl=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},Yl.apply(this,arguments)};Object.defineProperty(Au,"__esModule",{value:!0});var _O={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function DO(e){var t=Yl(Yl({},_O),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}Au.getSanitizedOptions=DO});var gA=Rt(Kh=>{"use strict";d();c();l();u();Object.defineProperty(Kh,"__esModule",{value:!0});function qO(e){var t=Math.random()*e;return Math.round(t)}Kh.fullJitter=qO});var hA=Rt(Yh=>{"use strict";d();c();l();u();Object.defineProperty(Yh,"__esModule",{value:!0});function MO(e){return e}Yh.noJitter=MO});var yA=Rt(Jh=>{"use strict";d();c();l();u();Object.defineProperty(Jh,"__esModule",{value:!0});var jO=gA(),VO=hA();function LO(e){return e.jitter==="full"?jO.fullJitter:VO.noJitter}Jh.JitterFactory=LO});var Zh=Rt(Xh=>{"use strict";d();c();l();u();Object.defineProperty(Xh,"__esModule",{value:!0});var UO=yA(),QO=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=UO.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}();Xh.Delay=QO});var SA=Rt(On=>{"use strict";d();c();l();u();var BO=On&&On.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),GO=On&&On.__awaiter||function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(h){try{m(n.next(h))}catch(S){i(S)}}function f(h){try{m(n.throw(h))}catch(S){i(S)}}function m(h){h.done?a(h.value):o(h.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},$O=On&&On.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(h){return f([m,h])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=m[0]&2?o.return:m[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,m[1])).done)return a;switch(o=0,a&&(m=[m[0]&2,a.value]),m[0]){case 0:case 1:a=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!a||m[1]>a[0]&&m[1]<a[3])){r.label=m[1];break}if(m[0]===6&&r.label<a[1]){r.label=a[1],a=m;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(m);break}a[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(h){m=[6,h],o=0}finally{n=a=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(On,"__esModule",{value:!0});var HO=Zh(),zO=function(e){BO(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return GO(this,void 0,void 0,function(){return $O(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}(HO.Delay);On.SkipFirstDelay=zO});var vA=Rt(Cu=>{"use strict";d();c();l();u();var WO=Cu&&Cu.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Cu,"__esModule",{value:!0});var KO=Zh(),YO=function(e){WO(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(KO.Delay);Cu.AlwaysDelay=YO});var xA=Rt(ey=>{"use strict";d();c();l();u();Object.defineProperty(ey,"__esModule",{value:!0});var JO=SA(),XO=vA();function ZO(e,t){var r=eN(e);return r.setAttemptNumber(t),r}ey.DelayFactory=ZO;function eN(e){return e.delayFirstAttempt?new XO.AlwaysDelay(e):new JO.SkipFirstDelay(e)}});var AA=Rt(Zo=>{"use strict";d();c();l();u();var ty=Zo&&Zo.__awaiter||function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(h){try{m(n.next(h))}catch(S){i(S)}}function f(h){try{m(n.throw(h))}catch(S){i(S)}}function m(h){h.done?a(h.value):o(h.value).then(p,f)}m((n=n.apply(e,t||[])).next())})},ry=Zo&&Zo.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(h){return f([m,h])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=m[0]&2?o.return:m[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,m[1])).done)return a;switch(o=0,a&&(m=[m[0]&2,a.value]),m[0]){case 0:case 1:a=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!a||m[1]>a[0]&&m[1]<a[3])){r.label=m[1];break}if(m[0]===6&&r.label<a[1]){r.label=a[1],a=m;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(m);break}a[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(h){m=[6,h],o=0}finally{n=a=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(Zo,"__esModule",{value:!0});var tN=mA(),rN=xA();function nN(e,t){return t===void 0&&(t={}),ty(this,void 0,void 0,function(){var r,n;return ry(this,function(o){switch(o.label){case 0:return r=tN.getSanitizedOptions(t),n=new oN(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}Zo.backOff=nN;var oN=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return ty(this,void 0,void 0,function(){var t,r;return ry(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 ty(this,void 0,void 0,function(){var t;return ry(this,function(r){switch(r.label){case 0:return t=rN.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var tp=Rt((mS,gS)=>{"use strict";d();c();l();u();(function(e,t){typeof mS=="object"&&typeof gS<"u"?gS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs=t()})(mS,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",a="minute",i="hour",p="day",f="week",m="month",h="quarter",S="year",v="date",g="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,R={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(H){var B=["th","st","nd","rd"],Q=H%100;return"["+H+(B[(Q-20)%10]||B[Q]||B[0])+"]"}},b=function(H,B,Q){var K=String(H);return!K||K.length>=B?H:""+Array(B+1-K.length).join(Q)+H},F={s:b,z:function(H){var B=-H.utcOffset(),Q=Math.abs(B),K=Math.floor(Q/60),$=Q%60;return(B<=0?"+":"-")+b(K,2,"0")+":"+b($,2,"0")},m:function H(B,Q){if(B.date()<Q.date())return-H(Q,B);var K=12*(Q.year()-B.year())+(Q.month()-B.month()),$=B.clone().add(K,m),te=Q-$<0,re=B.clone().add(K+(te?-1:1),m);return+(-(K+(Q-$)/(te?$-re:re-$))||0)},a:function(H){return H<0?Math.ceil(H)||0:Math.floor(H)},p:function(H){return{M:m,y:S,w:f,d:p,D:v,h:i,m:a,s:o,ms:n,Q:h}[H]||String(H||"").toLowerCase().replace(/s$/,"")},u:function(H){return H===void 0}},I="en",P={};P[I]=R;var V="$isDayjsObject",_=function(H){return H instanceof U||!(!H||!H[V])},k=function H(B,Q,K){var $;if(!B)return I;if(typeof B=="string"){var te=B.toLowerCase();P[te]&&($=te),Q&&(P[te]=Q,$=te);var re=B.split("-");if(!$&&re.length>1)return H(re[0])}else{var pe=B.name;P[pe]=B,$=pe}return!K&&$&&(I=$),$||!K&&I},N=function(H,B){if(_(H))return H.clone();var Q=typeof B=="object"?B:{};return Q.date=H,Q.args=arguments,new U(Q)},q=F;q.l=k,q.i=_,q.w=function(H,B){return N(H,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var U=function(){function H(Q){this.$L=k(Q.locale,null,!0),this.parse(Q),this.$x=this.$x||Q.x||{},this[V]=!0}var B=H.prototype;return B.parse=function(Q){this.$d=function(K){var $=K.date,te=K.utc;if($===null)return new Date(NaN);if(q.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var re=$.match(C);if(re){var pe=re[2]-1||0,Re=(re[7]||"0").substring(0,3);return te?new Date(Date.UTC(re[1],pe,re[3]||1,re[4]||0,re[5]||0,re[6]||0,Re)):new Date(re[1],pe,re[3]||1,re[4]||0,re[5]||0,re[6]||0,Re)}}return new Date($)}(Q),this.init()},B.init=function(){var Q=this.$d;this.$y=Q.getFullYear(),this.$M=Q.getMonth(),this.$D=Q.getDate(),this.$W=Q.getDay(),this.$H=Q.getHours(),this.$m=Q.getMinutes(),this.$s=Q.getSeconds(),this.$ms=Q.getMilliseconds()},B.$utils=function(){return q},B.isValid=function(){return this.$d.toString()!==g},B.isSame=function(Q,K){var $=N(Q);return this.startOf(K)<=$&&$<=this.endOf(K)},B.isAfter=function(Q,K){return N(Q)<this.startOf(K)},B.isBefore=function(Q,K){return this.endOf(K)<N(Q)},B.$g=function(Q,K,$){return q.u(Q)?this[K]:this.set($,Q)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(Q,K){var $=this,te=!!q.u(K)||K,re=q.p(Q),pe=function(Me,Ze){var at=q.w($.$u?Date.UTC($.$y,Ze,Me):new Date($.$y,Ze,Me),$);return te?at:at.endOf(p)},Re=function(Me,Ze){return q.w($.toDate()[Me].apply($.toDate("s"),(te?[0,0,0,0]:[23,59,59,999]).slice(Ze)),$)},ke=this.$W,Ce=this.$M,we=this.$D,Ae="set"+(this.$u?"UTC":"");switch(re){case S:return te?pe(1,0):pe(31,11);case m:return te?pe(1,Ce):pe(0,Ce+1);case f:var Ee=this.$locale().weekStart||0,rt=(ke<Ee?ke+7:ke)-Ee;return pe(te?we-rt:we+(6-rt),Ce);case p:case v:return Re(Ae+"Hours",0);case i:return Re(Ae+"Minutes",1);case a:return Re(Ae+"Seconds",2);case o:return Re(Ae+"Milliseconds",3);default:return this.clone()}},B.endOf=function(Q){return this.startOf(Q,!1)},B.$set=function(Q,K){var $,te=q.p(Q),re="set"+(this.$u?"UTC":""),pe=($={},$[p]=re+"Date",$[v]=re+"Date",$[m]=re+"Month",$[S]=re+"FullYear",$[i]=re+"Hours",$[a]=re+"Minutes",$[o]=re+"Seconds",$[n]=re+"Milliseconds",$)[te],Re=te===p?this.$D+(K-this.$W):K;if(te===m||te===S){var ke=this.clone().set(v,1);ke.$d[pe](Re),ke.init(),this.$d=ke.set(v,Math.min(this.$D,ke.daysInMonth())).$d}else pe&&this.$d[pe](Re);return this.init(),this},B.set=function(Q,K){return this.clone().$set(Q,K)},B.get=function(Q){return this[q.p(Q)]()},B.add=function(Q,K){var $,te=this;Q=Number(Q);var re=q.p(K),pe=function(Ce){var we=N(te);return q.w(we.date(we.date()+Math.round(Ce*Q)),te)};if(re===m)return this.set(m,this.$M+Q);if(re===S)return this.set(S,this.$y+Q);if(re===p)return pe(1);if(re===f)return pe(7);var Re=($={},$[a]=t,$[i]=r,$[o]=e,$)[re]||1,ke=this.$d.getTime()+Q*Re;return q.w(ke,this)},B.subtract=function(Q,K){return this.add(-1*Q,K)},B.format=function(Q){var K=this,$=this.$locale();if(!this.isValid())return $.invalidDate||g;var te=Q||"YYYY-MM-DDTHH:mm:ssZ",re=q.z(this),pe=this.$H,Re=this.$m,ke=this.$M,Ce=$.weekdays,we=$.months,Ae=$.meridiem,Ee=function(Ze,at,$t,ur){return Ze&&(Ze[at]||Ze(K,te))||$t[at].slice(0,ur)},rt=function(Ze){return q.s(pe%12||12,Ze,"0")},Me=Ae||function(Ze,at,$t){var ur=Ze<12?"AM":"PM";return $t?ur.toLowerCase():ur};return te.replace(w,function(Ze,at){return at||function($t){switch($t){case"YY":return String(K.$y).slice(-2);case"YYYY":return q.s(K.$y,4,"0");case"M":return ke+1;case"MM":return q.s(ke+1,2,"0");case"MMM":return Ee($.monthsShort,ke,we,3);case"MMMM":return Ee(we,ke);case"D":return K.$D;case"DD":return q.s(K.$D,2,"0");case"d":return String(K.$W);case"dd":return Ee($.weekdaysMin,K.$W,Ce,2);case"ddd":return Ee($.weekdaysShort,K.$W,Ce,3);case"dddd":return Ce[K.$W];case"H":return String(pe);case"HH":return q.s(pe,2,"0");case"h":return rt(1);case"hh":return rt(2);case"a":return Me(pe,Re,!0);case"A":return Me(pe,Re,!1);case"m":return String(Re);case"mm":return q.s(Re,2,"0");case"s":return String(K.$s);case"ss":return q.s(K.$s,2,"0");case"SSS":return q.s(K.$ms,3,"0");case"Z":return re}return null}(Ze)||re.replace(":","")})},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(Q,K,$){var te,re=this,pe=q.p(K),Re=N(Q),ke=(Re.utcOffset()-this.utcOffset())*t,Ce=this-Re,we=function(){return q.m(re,Re)};switch(pe){case S:te=we()/12;break;case m:te=we();break;case h:te=we()/3;break;case f:te=(Ce-ke)/6048e5;break;case p:te=(Ce-ke)/864e5;break;case i:te=Ce/r;break;case a:te=Ce/t;break;case o:te=Ce/e;break;default:te=Ce}return $?te:q.a(te)},B.daysInMonth=function(){return this.endOf(m).$D},B.$locale=function(){return P[this.$L]},B.locale=function(Q,K){if(!Q)return this.$L;var $=this.clone(),te=k(Q,K,!0);return te&&($.$L=te),$},B.clone=function(){return q.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},H}(),X=U.prototype;return N.prototype=X,[["$ms",n],["$s",o],["$m",a],["$H",i],["$W",p],["$M",m],["$y",S],["$D",v]].forEach(function(H){X[H[1]]=function(B){return this.$g(B,H[0],H[1])}}),N.extend=function(H,B){return H.$i||(H(B,U,N),H.$i=!0),N},N.locale=k,N.isDayjs=_,N.unix=function(H){return N(1e3*H)},N.en=P[I],N.Ls=P,N.p={},N})});var zb=Rt((hS,yS)=>{"use strict";d();c();l();u();(function(e,t){typeof hS=="object"&&typeof yS<"u"?yS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_quarterOfYear=t()})(hS,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(p){return this.$utils().u(p)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(p-1))};var a=o.add;o.add=function(p,f){return p=Number(p),this.$utils().p(f)===t?this.add(3*p,e):a.bind(this)(p,f)};var i=o.startOf;o.startOf=function(p,f){var m=this.$utils(),h=!!m.u(f)||f;if(m.p(p)===t){var S=this.quarter()-1;return h?this.month(3*S).startOf(e).startOf("day"):this.month(3*S+2).endOf(e).endOf("day")}return i.bind(this)(p,f)}}})});var Wb=Rt((SS,vS)=>{"use strict";d();c();l();u();(function(e,t){typeof SS=="object"&&typeof vS<"u"?vS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_customParseFormat=t()})(SS,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,o=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,i={},p=function(C){return(C=+C)+(C>68?1900:2e3)},f=function(C){return function(w){this[C]=+w}},m=[/[+-]\d\d:?(\d\d)?|Z/,function(C){(this.zone||(this.zone={})).offset=function(w){if(!w||w==="Z")return 0;var R=w.match(/([+-]|\d\d)/g),b=60*R[1]+(+R[2]||0);return b===0?0:R[0]==="+"?-b:b}(C)}],h=function(C){var w=i[C];return w&&(w.indexOf?w:w.s.concat(w.f))},S=function(C,w){var R,b=i.meridiem;if(b){for(var F=1;F<=24;F+=1)if(C.indexOf(b(F,0,w))>-1){R=F>12;break}}else R=C===(w?"pm":"PM");return R},v={A:[a,function(C){this.afternoon=S(C,!1)}],a:[a,function(C){this.afternoon=S(C,!0)}],Q:[r,function(C){this.month=3*(C-1)+1}],S:[r,function(C){this.milliseconds=100*+C}],SS:[n,function(C){this.milliseconds=10*+C}],SSS:[/\d{3}/,function(C){this.milliseconds=+C}],s:[o,f("seconds")],ss:[o,f("seconds")],m:[o,f("minutes")],mm:[o,f("minutes")],H:[o,f("hours")],h:[o,f("hours")],HH:[o,f("hours")],hh:[o,f("hours")],D:[o,f("day")],DD:[n,f("day")],Do:[a,function(C){var w=i.ordinal,R=C.match(/\d+/);if(this.day=R[0],w)for(var b=1;b<=31;b+=1)w(b).replace(/\[|\]/g,"")===C&&(this.day=b)}],w:[o,f("week")],ww:[n,f("week")],M:[o,f("month")],MM:[n,f("month")],MMM:[a,function(C){var w=h("months"),R=(h("monthsShort")||w.map(function(b){return b.slice(0,3)})).indexOf(C)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[a,function(C){var w=h("months").indexOf(C)+1;if(w<1)throw new Error;this.month=w%12||w}],Y:[/[+-]?\d+/,f("year")],YY:[n,function(C){this.year=p(C)}],YYYY:[/\d{4}/,f("year")],Z:m,ZZ:m};function g(C){var w,R;w=C,R=i&&i.formats;for(var b=(C=w.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(N,q,U){var X=U&&U.toUpperCase();return q||R[U]||e[U]||R[X].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(H,B,Q){return B||Q.slice(1)})})).match(t),F=b.length,I=0;I<F;I+=1){var P=b[I],V=v[P],_=V&&V[0],k=V&&V[1];b[I]=k?{regex:_,parser:k}:P.replace(/^\[|\]$/g,"")}return function(N){for(var q={},U=0,X=0;U<F;U+=1){var H=b[U];if(typeof H=="string")X+=H.length;else{var B=H.regex,Q=H.parser,K=N.slice(X),$=B.exec(K)[0];Q.call(q,$),N=N.replace($,"")}}return function(te){var re=te.afternoon;if(re!==void 0){var pe=te.hours;re?pe<12&&(te.hours+=12):pe===12&&(te.hours=0),delete te.afternoon}}(q),q}}return function(C,w,R){R.p.customParseFormat=!0,C&&C.parseTwoDigitYear&&(p=C.parseTwoDigitYear);var b=w.prototype,F=b.parse;b.parse=function(I){var P=I.date,V=I.utc,_=I.args;this.$u=V;var k=_[1];if(typeof k=="string"){var N=_[2]===!0,q=_[3]===!0,U=N||q,X=_[2];q&&(X=_[2]),i=this.$locale(),!N&&X&&(i=R.Ls[X]),this.$d=function(K,$,te,re){try{if(["x","X"].indexOf($)>-1)return new Date(($==="X"?1e3:1)*K);var pe=g($)(K),Re=pe.year,ke=pe.month,Ce=pe.day,we=pe.hours,Ae=pe.minutes,Ee=pe.seconds,rt=pe.milliseconds,Me=pe.zone,Ze=pe.week,at=new Date,$t=Ce||(Re||ke?1:at.getDate()),ur=Re||at.getFullYear(),no=0;Re&&!ke||(no=ke>0?ke-1:at.getMonth());var gi,hi=we||0,du=Ae||0,Th=Ee||0,Ph=rt||0;return Me?new Date(Date.UTC(ur,no,$t,hi,du,Th,Ph+60*Me.offset*1e3)):te?new Date(Date.UTC(ur,no,$t,hi,du,Th,Ph)):(gi=new Date(ur,no,$t,hi,du,Th,Ph),Ze&&(gi=re(gi).week(Ze).toDate()),gi)}catch{return new Date("")}}(P,k,V,R),this.init(),X&&X!==!0&&(this.$L=this.locale(X).$L),U&&P!=this.format(k)&&(this.$d=new Date("")),i={}}else if(k instanceof Array)for(var H=k.length,B=1;B<=H;B+=1){_[1]=k[B-1];var Q=R.apply(this,_);if(Q.isValid()){this.$d=Q.$d,this.$L=Q.$L,this.init();break}B===H&&(this.$d=new Date(""))}else F.call(this,I)}}})});var hw=Rt((KS,YS)=>{"use strict";d();c();l();u();(function(e,t){typeof KS=="object"&&typeof YS<"u"?YS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_timezone=t()})(KS,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var a,i=function(h,S,v){v===void 0&&(v={});var g=new Date(h),C=function(w,R){R===void 0&&(R={});var b=R.timeZoneName||"short",F=w+"|"+b,I=t[F];return I||(I=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:w,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:b}),t[F]=I),I}(S,v);return C.formatToParts(g)},p=function(h,S){for(var v=i(h,S),g=[],C=0;C<v.length;C+=1){var w=v[C],R=w.type,b=w.value,F=e[R];F>=0&&(g[F]=parseInt(b,10))}var I=g[3],P=I===24?0:I,V=g[0]+"-"+g[1]+"-"+g[2]+" "+P+":"+g[4]+":"+g[5]+":000",_=+h;return(o.utc(V).valueOf()-(_-=_%1e3))/6e4},f=n.prototype;f.tz=function(h,S){h===void 0&&(h=a);var v,g=this.utcOffset(),C=this.toDate(),w=C.toLocaleString("en-US",{timeZone:h}),R=Math.round((C-new Date(w))/1e3/60),b=15*-Math.round(C.getTimezoneOffset()/15)-R;if(!Number(b))v=this.utcOffset(0,S);else if(v=o(w,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(b,!0),S){var F=v.utcOffset();v=v.add(g-F,"minute")}return v.$x.$timezone=h,v},f.offsetName=function(h){var S=this.$x.$timezone||o.tz.guess(),v=i(this.valueOf(),S,{timeZoneName:h}).find(function(g){return g.type.toLowerCase()==="timezonename"});return v&&v.value};var m=f.startOf;f.startOf=function(h,S){if(!this.$x||!this.$x.$timezone)return m.call(this,h,S);var v=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return m.call(v,h,S).tz(this.$x.$timezone,!0)},o.tz=function(h,S,v){var g=v&&S,C=v||S||a,w=p(+o(),C);if(typeof h!="string")return o(h).tz(C);var R=function(P,V,_){var k=P-60*V*1e3,N=p(k,_);if(V===N)return[k,V];var q=p(k-=60*(N-V)*1e3,_);return N===q?[k,N]:[P-60*Math.min(N,q)*1e3,Math.max(N,q)]}(o.utc(h,g).valueOf(),w,C),b=R[0],F=R[1],I=o(b).utcOffset(F);return I.$x.$timezone=C,I},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(h){a=h}}})});var yw=Rt((JS,XS)=>{"use strict";d();c();l();u();(function(e,t){typeof JS=="object"&&typeof XS<"u"?XS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof y<"u"?y:e||self).dayjs_plugin_utc=t()})(JS,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,a){var i=o.prototype;a.utc=function(g){var C={date:g,utc:!0,args:arguments};return new o(C)},i.utc=function(g){var C=a(this.toDate(),{locale:this.$L,utc:!0});return g?C.add(this.utcOffset(),e):C},i.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var p=i.parse;i.parse=function(g){g.utc&&(this.$u=!0),this.$utils().u(g.$offset)||(this.$offset=g.$offset),p.call(this,g)};var f=i.init;i.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 f.call(this)};var m=i.utcOffset;i.utcOffset=function(g,C){var w=this.$utils().u;if(w(g))return this.$u?0:w(this.$offset)?m.call(this):this.$offset;if(typeof g=="string"&&(g=function(I){I===void 0&&(I="");var P=I.match(t);if(!P)return null;var V=(""+P[0]).match(r)||["-",0,0],_=V[0],k=60*+V[1]+ +V[2];return k===0?0:_==="+"?k:-k}(g),g===null))return this;var R=Math.abs(g)<=16?60*g:g;if(R===0)return this.utc(C);var b=this.clone();if(C)return b.$offset=R,b.$u=!1,b;var F=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(b=this.local().add(R+F,e)).$offset=R,b.$x.$localOffset=F,b};var h=i.format;i.format=function(g){var C=g||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,C)},i.valueOf=function(){var g=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*g},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var S=i.toDate;i.toDate=function(g){return g==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():S.call(this)};var v=i.diff;i.diff=function(g,C,w){if(g&&this.$u===g.$u)return v.call(this,g,C,w);var R=this.local(),b=a(g).local();return v.call(R,b,C,w)}}})});var mE=Rt((MAe,fE)=>{"use strict";d();c();l();u();function dU(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}fE.exports=pU;function pU(e,t,r){var n=r&&r.stringify||dU,o=1;if(typeof e=="object"&&e!==null){var a=t.length+o;if(a===1)return e;var i=new Array(a);i[0]=n(e);for(var p=1;p<a;p++)i[p]=n(t[p]);return i.join(" ")}if(typeof e!="string")return e;var f=t.length;if(f===0)return e;for(var m="",h=1-o,S=-1,v=e&&e.length||0,g=0;g<v;){if(e.charCodeAt(g)===37&&g+1<v){switch(S=S>-1?S:0,e.charCodeAt(g+1)){case 100:case 102:if(h>=f||t[h]==null)break;S<g&&(m+=e.slice(S,g)),m+=Number(t[h]),S=g+2,g++;break;case 105:if(h>=f||t[h]==null)break;S<g&&(m+=e.slice(S,g)),m+=Math.floor(Number(t[h])),S=g+2,g++;break;case 79:case 111:case 106:if(h>=f||t[h]===void 0)break;S<g&&(m+=e.slice(S,g));var C=typeof t[h];if(C==="string"){m+="'"+t[h]+"'",S=g+2,g++;break}if(C==="function"){m+=t[h].name||"<anonymous>",S=g+2,g++;break}m+=n(t[h]),S=g+2,g++;break;case 115:if(h>=f)break;S<g&&(m+=e.slice(S,g)),m+=String(t[h]),S=g+2,g++;break;case 37:S<g&&(m+=e.slice(S,g)),m+="%",S=g+2,g++,h--;break}++h}++g}return S===-1?e:(S<v&&(m+=e.slice(S)),m)}});var xE=Rt((QAe,Fm)=>{"use strict";d();c();l();u();var gE=mE();Fm.exports=zn;var yl=EU().console||{},fU={mapHttpRequest:wm,mapHttpResponse:wm,wrapRequestSerializer:Qv,wrapResponseSerializer:Qv,wrapErrorSerializer:Qv,req:wm,res:wm,err:yE,errWithCause:yE};function qo(e,t){return e==="silent"?1/0:t.levels.values[e]}var $v=Symbol("pino.logFuncs"),Bv=Symbol("pino.hierarchy"),mU={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function hE(e,t){let r={logger:t,parent:e[Bv]};t[Bv]=r}function gU(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:yl[o]||yl[mU[o]||"log"]||Zs}),e[$v]=n}function hU(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function zn(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||yl;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=hU(e.browser.serialize,n),a=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(a=!1);let i=Object.keys(e.customLevels||{}),p=["error","fatal","warn","info","debug","trace"].concat(i);typeof r=="function"&&p.forEach(function(w){r[w]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let f=e.level||"info",m=Object.create(r);m.log||(m.log=Zs),gU(m,p,r),hE({},m),Object.defineProperty(m,"levelVal",{get:S}),Object.defineProperty(m,"level",{get:v,set:g});let h={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:p,timestamp:RU(e),messageKey:e.messageKey||"msg",onChild:e.onChild||Zs};m.levels=yU(e),m.level=f,m.isLevelEnabled=function(w){return this.levels.values[w]?this.levels.values[w]>=this.levels.values[this.level]:!1},m.setMaxListeners=m.getMaxListeners=m.emit=m.addListener=m.on=m.prependListener=m.once=m.prependOnceListener=m.removeListener=m.removeAllListeners=m.listeners=m.listenerCount=m.eventNames=m.write=m.flush=Zs,m.serializers=n,m._serialize=o,m._stdErrSerialize=a,m.child=function(...w){return C.call(this,h,...w)},t&&(m._logEvent=Gv());function S(){return qo(this.level,this)}function v(){return this._level}function g(w){if(w!=="silent"&&!this.levels.values[w])throw Error("unknown level "+w);this._level=w,Ka(this,h,m,"error"),Ka(this,h,m,"fatal"),Ka(this,h,m,"warn"),Ka(this,h,m,"info"),Ka(this,h,m,"debug"),Ka(this,h,m,"trace"),i.forEach(R=>{Ka(this,h,m,R)})}function C(w,R,b){if(!R)throw new Error("missing bindings for child Pino");b=b||{},o&&R.serializers&&(b.serializers=R.serializers);let F=b.serializers;if(o&&F){var I=Object.assign({},n,F),P=e.browser.serialize===!0?Object.keys(I):o;delete R.serializers,Hv([R],P,I,this._stdErrSerialize)}function V(k){this._childLevel=(k._childLevel|0)+1,this.bindings=R,I&&(this.serializers=I,this._serialize=P),t&&(this._logEvent=Gv([].concat(k._logEvent.bindings,R)))}V.prototype=this;let _=new V(this);return hE(this,_),_.child=function(...k){return C.call(this,w,...k)},_.level=b.level||this.level,w.onChild(_),_}return m}function yU(e){let t=e.customLevels||{},r=Object.assign({},zn.levels.values,t),n=Object.assign({},zn.levels.labels,SU(t));return{values:r,labels:n}}function SU(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}zn.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"}};zn.stdSerializers=fU;zn.stdTimeFunctions=Object.assign({},{nullTime:SE,epochTime:vE,unixTime:wU,isoTime:FU});function vU(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[Bv];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function Ka(e,t,r,n){if(Object.defineProperty(e,n,{value:qo(e.level,r)>qo(n,r)?Zs:r[$v][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===Zs){if(!t.transmit)return;let a=t.transmit.level||e.level,i=qo(a,r);if(qo(n,r)<i)return}e[n]=AU(e,t,r,n);let o=vU(e);o.length!==0&&(e[n]=xU(o,e[n]))}function xU(e,t){return function(){return t.apply(this,[...e,...arguments])}}function AU(e,t,r,n){return function(o){return function(){let i=t.timestamp(),p=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===yl?yl:this;for(var m=0;m<p.length;m++)p[m]=arguments[m];var h=!1;if(t.serialize&&(Hv(p,this._serialize,this.serializers,this._stdErrSerialize),h=!0),t.asObject||t.formatters?o.call(f,...CU(this,n,p,i,t)):o.apply(f,p),t.transmit){let S=t.transmit.level||e._level,v=qo(S,r),g=qo(n,r);if(g<v)return;bU(this,{ts:i,methodLevel:n,methodValue:g,transmitLevel:S,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:qo(e._level,r)},p,h)}}}(e[$v][n])}function CU(e,t,r,n,o){let{level:a,log:i=S=>S}=o.formatters||{},p=r.slice(),f=p[0],m={},h=(e._childLevel|0)+1;if(h<1&&(h=1),n&&(m.time=n),a){let S=a(t,e.levels.values[t]);Object.assign(m,S)}else m.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(f!==null&&typeof f=="object")for(;h--&&typeof p[0]=="object";)Object.assign(m,p.shift());return[i(m),...p]}else{if(f!==null&&typeof f=="object"){for(;h--&&typeof p[0]=="object";)Object.assign(m,p.shift());f=p.length?gE(p.shift(),p):void 0}else typeof f=="string"&&(f=gE(p.shift(),p));return f!==void 0&&(m[o.messageKey]=f),[i(m)]}}function Hv(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=zn.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let a in e[o])t.indexOf(a)>-1&&a in r&&(e[o][a]=r[a](e[o][a]))}function bU(e,t,r,n=!1){let o=t.send,a=t.ts,i=t.methodLevel,p=t.methodValue,f=t.val,m=e._logEvent.bindings;n||Hv(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=a,e._logEvent.messages=r.filter(function(h){return m.indexOf(h)===-1}),e._logEvent.level.label=i,e._logEvent.level.value=p,o(i,e._logEvent,f),e._logEvent=Gv(m)}function Gv(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function yE(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 RU(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?SE:vE}function wm(){return{}}function Qv(e){return e}function Zs(){}function SE(){return!1}function vE(){return Date.now()}function wU(){return Math.round(Date.now()/1e3)}function FU(){return new Date(Date.now()).toISOString()}function EU(){function e(t){return typeof t<"u"&&t}try{return typeof y<"u"?y:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),y)}catch{return e(self)||e(window)||e(this)||{}}}Fm.exports.default=zn;Fm.exports.pino=zn});var i$={};fu(i$,{API_DATE_FORMAT:()=>hs,DefaultFieldsToInclude:()=>ax,EcommerceDefaultFieldsToInclude:()=>lT,HighlightUtils:()=>Gh,MinimumFieldsToInclude:()=>Ug,ResultTemplatesHelpers:()=>RR,SortBy:()=>la,SortOrder:()=>Bu,VERSION:()=>uo,baseFacetResponseSelector:()=>Nr,buildAutomaticFacetGenerator:()=>bI,buildBreadcrumbManager:()=>nI,buildCategoryFacet:()=>_I,buildCategoryFieldSuggestions:()=>nT,buildContext:()=>iI,buildController:()=>ne,buildCriterionExpression:()=>Hr,buildDateFacet:()=>WI,buildDateFilter:()=>YI,buildDateRange:()=>Vo,buildDateSortCriterion:()=>Vd,buildDictionaryFieldContext:()=>uI,buildDidYouMean:()=>gI,buildExecuteTrigger:()=>hk,buildFacet:()=>QI,buildFacetConditionsManager:()=>cI,buildFacetManager:()=>yI,buildFieldSortCriterion:()=>Ld,buildFieldSuggestions:()=>oT,buildFoldedResultList:()=>fT,buildGeneratedAnswer:()=>bT,buildHistoryManager:()=>qT,buildInstantResults:()=>HT,buildInteractiveCitation:()=>wT,buildInteractiveInstantResult:()=>MT,buildInteractiveRecentResult:()=>dP,buildInteractiveResult:()=>vP,buildNoSortCriterion:()=>Qd,buildNotifyTrigger:()=>Sk,buildNumericFacet:()=>eT,buildNumericFilter:()=>rT,buildNumericRange:()=>wc,buildPager:()=>KT,buildQueryError:()=>JT,buildQueryExpression:()=>o$,buildQueryRankingExpressionSortCriterion:()=>Ud,buildQuerySummary:()=>ZT,buildQueryTrigger:()=>vk,buildQuickview:()=>nP,buildRecentQueriesList:()=>cP,buildRecentResultsList:()=>fP,buildRedirectionTrigger:()=>xk,buildRelevanceInspector:()=>SP,buildRelevanceSortCriterion:()=>Ki,buildResultList:()=>xP,buildResultTemplatesManager:()=>Ok,buildResultsPerPage:()=>CP,buildSearchBox:()=>uh,buildSearchEngine:()=>NE,buildSearchParameterManager:()=>mh,buildSearchParameterSerializer:()=>Ml,buildSearchStatus:()=>$P,buildSmartSnippet:()=>KP,buildSmartSnippetQuestionsList:()=>XP,buildSort:()=>rk,buildStandaloneSearchBox:()=>ik,buildStaticFilter:()=>sk,buildStaticFilterValue:()=>Mx,buildTab:()=>uk,buildTabManager:()=>lk,buildUrlManager:()=>Fk,currentPageSelector:()=>ro,currentPagesSelector:()=>Xg,deserializeRelativeDate:()=>oR,facetRequestSelector:()=>_d,facetResponseSelectedValuesSelector:()=>lb,facetResponseSelector:()=>Qi,getAnalyticsNextApiBaseUrl:()=>Jl,getOrganizationEndpoint:()=>Ft,getSampleSearchEngineConfiguration:()=>Kv,getSearchApiBaseUrl:()=>ct,loadAdvancedSearchQueryActions:()=>f2,loadAutomaticFacetSetActions:()=>F2,loadBreadcrumbActions:()=>y2,loadCategoryFacetSetActions:()=>E2,loadClickAnalyticsActions:()=>m2,loadConfigurationActions:()=>S2,loadContextActions:()=>x2,loadDateFacetSetActions:()=>T2,loadDebugActions:()=>A2,loadDictionaryFieldContextActions:()=>C2,loadDidYouMeanActions:()=>b2,loadExcerptLengthActions:()=>R2,loadFacetOptionsActions:()=>w2,loadFacetSetActions:()=>I2,loadFieldActions:()=>k2,loadFoldingActions:()=>O2,loadGeneratedAnswerActions:()=>N2,loadGenericAnalyticsActions:()=>g2,loadHistoryActions:()=>_2,loadIPXActionsHistoryActions:()=>p2,loadInstantResultsActions:()=>D2,loadNumericFacetSetActions:()=>P2,loadPaginationActions:()=>q2,loadPipelineActions:()=>M2,loadQueryActions:()=>j2,loadQuerySetActions:()=>V2,loadQuerySuggestActions:()=>L2,loadQuestionAnsweringActions:()=>U2,loadRecentQueriesActions:()=>Q2,loadRecentResultsActions:()=>B2,loadResultPreviewActions:()=>G2,loadSearchActions:()=>z2,loadSearchAnalyticsActions:()=>h2,loadSearchConfigurationActions:()=>v2,loadSearchHubActions:()=>W2,loadSearchParameterActions:()=>K2,loadSortCriteriaActions:()=>X2,loadStandaloneSearchBoxSetActions:()=>Z2,loadStaticFilterSetActions:()=>e$,loadTabSetActions:()=>t$,maxPageSelector:()=>Ol,parseCriterionExpression:()=>Nk,validateRelativeDate:()=>xo});module.exports=Jk(i$);d();c();l();u();var Gh={};fu(Gh,{escapeHtml:()=>Ri,getHighlightedSuggestion:()=>Bh,highlightString:()=>FO});d();c();l();u();d();c();l();u();function vO(e,t){let r=`
|
|
20
20
|
The following properties are invalid:
|
|
21
21
|
|
|
22
22
|
${e.join(`
|
|
23
23
|
`)}
|
|
24
24
|
|
|
25
25
|
${t}
|
|
26
|
-
`;return new
|
|
27
|
-
${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":wO(g,n,t);break}}}}function wO(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function FO(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Zx(){return{data:"",event:"",id:"",retry:void 0}}var qh="text/event-stream",EO=1e3,nA="last-event-id";function oA(){return typeof window<"u"}function $l(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:i,openWhenHidden:p,fetch:f,...m}){return new Promise((g,S)=>{let A={...r};A.accept||(A.accept=qh);let h;function C(){h?.abort(),document.hidden||P()}!p&&oA()&&document.addEventListener("visibilitychange",C);let w=EO,R;function b(){oA()&&document.removeEventListener("visibilitychange",C),clearTimeout(R),h?.abort()}t?.addEventListener("abort",()=>{b(),g()});let F=f??v,E=n??IO;function P(){return _P2.apply(this,arguments)}function _P2(){_P2=_asyncToGenerator(function*(){h=s.AbortController?new s.AbortController:null;try{let j=yield F(e,{...m,headers:A,signal:h?.signal});yield E(j),yield eA(j.body,tA(rA(_=>{_?A[nA]=_:delete A[nA]},_=>{w=_},o))),a?.(),b(),g()}catch(j){if(!h?.signal?.aborted)try{let _=i?.(j)??w;clearTimeout(R),R=setTimeout(P,_)}catch(_){b(),S(_)}}});return _P2.apply(this,arguments)}P()})}function IO(e){let t=e.headers.get("content-type");if(!t?.startsWith(qh))throw new Error(`Expected content-type to be ${qh}, Actual: ${t}`)}d();c();l();u();var ao=class{constructor(t){Ne(this,"_basePath");Ne(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};var TO=(e,t,r)=>new ao(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,aA=3,PO=5e3,kO="text/event-stream",jh=1,Mh=class extends Error{},vu=class extends Error{constructor(r){super(r.message);this.payload=r}},Vh=class{constructor(){Ne(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},Hl=class{constructor(t){Ne(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:i}=t,{write:p,abort:f,close:m,resetAnswer:g}=r,S=new Vh;if(!a){this.logger.error("No stream ID found");return}let A=0,h,C=()=>{h&&!S.isActive(h)&&(R?.abort(),g(),b())},w=()=>{S.remove(h),h=Xx(C,h,PO),S.add(h)},R=new s.AbortController,b=()=>$l(TO(n,o,a),{method:"GET",fetch:v,headers:{Authorization:`Bearer ${i}`,accept:"*/*"},openWhenHidden:!0,signal:R?.signal,onopen(F){return _asyncToGenerator(function*(){if(F.ok&&F.headers.get("content-type")===kO)return;throw F.status>=400&&F.status<500&&F.status!==429?new vu({message:"Error opening stream",code:F.status}):new Mh})()},onmessage:F=>{if(R?.signal.aborted)return;let E=JSON.parse(F.data);if(E.finishReason==="ERROR"){S.remove(h),R?.abort(),f({message:E.errorMessage,code:E.statusCode});return}p(E),A=0,E.finishReason==="COMPLETED"?(S.remove(h),m()):w()},onerror:F=>{if(!R?.signal.aborted){if(S.remove(h),F instanceof vu)throw R?.abort(),f(F),F;if(++A>aA){this.logger.info("Maximum retry exceeded.");let E={message:"Failed to complete stream.",code:jh};throw R?.abort(),f(E),new vu(E)}this.logger.info(`Retrying...(${A}/${aA})`),g()}}});return b(),R}};d();c();l();u();var yA=kr(fA(),1);d();c();l();u();var W=new Error("Failed to load reducers."),Ci=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."}},ea=class extends Error{constructor(r,n){super();Ne(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function mA(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function gA(e){return typeof e!="object"||!e?!1:Object.values(e).every(nN)}function nN(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function hA(e){return e===429}var Or=class e{static call(t){return _asyncToGenerator(function*(){let r=oN(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...i}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield v(a,i);if(hA(f.status))throw f;return f});return function p(){return _ref.apply(this,arguments)}}();try{let f=yield(0,yA.backOff)(p,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(m){let g=m&&hA(m.status);return g&&(n.info("Platform retrying request"),yield new Promise(S=>setTimeout(S,1e3))),g});return function retry(_x4){return _ref2.apply(this,arguments)}}()});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new Ci;case 404:throw new ea(a,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new ea(a):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:i}=r,{signal:p,...f}=t,m=Su(f);try{let g=yield o(t,n,i);return{...t,...g}}catch(g){a.error(g,"Platform request preprocessing failed. Returning default request options.")}return m})()}};function Ft(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function ct(e,t="prod"){return`${Ft(e,t)}/rest/search/v2`}function Wl(e,t="prod"){return`${Ft(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function oN(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,p=e.method==="POST"||e.method==="PUT",f=aN(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...(p&&{body:f}),signal:i}}function aN(e,t){return t==="application/x-www-form-urlencoded"?gA(e)?mA(e):"":JSON.stringify(e)}d();c();l();u();var Kl=e=>e;d();c();l();u();d();c();l();u();function bi(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function rr(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:bi(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:bi(),extendedResults:{},searchAction:void 0}}d();c();l();u();function io(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var so=e=>{let{response:t}=e;return t.body?iN(e):sN(t)},iN=e=>uN(e)?lN(e):cN(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},sN=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function cN(e){return e.body.statusCode!==void 0}function uN(e){return e.body.exception!==void 0}var lN=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var co=class{constructor(){Ne(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new s.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};d();c();l();u();d();c();l();u();function SA(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var Nn=(e,t,r,n)=>{let o=new ao(`${e.url}${n}`);return o.addParam("organizationId",e.organizationId),e.authentication&&o.addParam("authentication",e.authentication),{accessToken:e.accessToken,method:t,contentType:r,url:o.href,origin:"searchApiFetch"}};var vA=(e,t)=>{let r=new ao(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},xA=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield Or.call({...Nn(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:io(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=SA(r),o=yield r.arrayBuffer(),i=new TextDecoder(n).decode(o);return dN(i)?{success:i}:{error:so({response:r,body:i})}});return function xA(_x5,_x6){return _ref3.apply(this,arguments)}}();function dN(e){return typeof e=="string"}d();c();l();u();function pN(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function fN(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Yl(e,t){if(t&&e.name==="AbortError")return{error:fN(e)};if(e instanceof ea)return{error:pN(e)};throw e}var Jl=class{constructor(t){this.options=t;Ne(this,"apiCallsQueues",{unknown:new co,mainSearch:new co,facetValues:new co,foldingCollection:new co,instantResults:new co})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield Or.call({...Nn(t,"POST","application/json","/plan"),requestParams:io(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Yl(r);let n=yield r.json();return gN(n)?{success:n}:{error:so({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Or.call({...Nn(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:io(t),..._this3.options});if(r instanceof Error)return Yl(r);let n=yield r.json(),o={response:r,body:n};return mN(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:so(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(p=>Or.call({...Nn(t,"POST","application/json",""),requestParams:io(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:p??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Yl(o,r?.disableAbortWarning);let a=yield o.json(),i={response:o,body:a};return AA(a)?(i.body=CA(a),{success:(yield _this4.options.postprocessSearchResponseMiddleware(i)).body}):{error:so(i)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield Or.call({...Nn(t,"POST","application/json","/facet"),requestParams:io(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 Or.call({...Nn(t,"POST","application/json",""),requestParams:io(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(AA(n)){let o={response:r,body:n};return o.body=CA(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:so({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return xA(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield Or.call({...Nn(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return hN(n)?{success:n}:{error:so({response:r,body:n})}})()}},Xl=e=>e.success!==void 0,ht=e=>e.error!==void 0;function AA(e){return e.results!==void 0}function CA(e){let t=bi();return le(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function mN(e){return e.completions!==void 0}function gN(e){return e.preprocessingOutput!==void 0}function hN(e){return e.fields!==void 0}d();c();l();u();var bA=e=>e,RA=e=>e,wA=e=>e;d();c();l();u();d();c();l();u();var z=new M({required:!0,emptyAllowed:!1}),it=new M({required:!1,emptyAllowed:!1}),Ue=new M({required:!0,emptyAllowed:!0}),tW=new M({required:!1,emptyAllowed:!0}),Zl=new ae({each:z,required:!0}),FA=new M({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),EA=new M({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),rW=new M({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),_n=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),lr=(e,t)=>{if("required"in t)return{payload:new ge({value:t}).validate({value:e}).value};let o=new J({options:{required:!0},values:t}).validate(e);if(o)throw new hu(o);return{payload:e}},O=(e,t)=>{try{return lr(e,t)}catch(r){return{payload:e,error:_n(r)}}},ut=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return IA(e,t,r,o,"Controller initialization error")},Be=(e,t,r,n)=>{let o=`Check the options of ${n}`;return IA(e,t,r,o,"Controller initialization error")},IA=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};d();c();l();u();d();c();l();u();d();c();l();u();function Et(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var yN=typeof Symbol=="function"&&Symbol.observable||"@@observable",TA=yN,Wh=()=>Math.random().toString(36).substring(7).split("").join("."),SN={INIT:`@@redux/INIT${Wh()}`,REPLACE:`@@redux/REPLACE${Wh()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Wh()}`},ed=SN;function Qr(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 Kh(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(Kh)(e,t)}let n=e,o=t,a=new Map,i=a,p=0,f=!1;function m(){i===a&&(i=new Map,a.forEach((R,b)=>{i.set(b,R)}))}function g(){if(f)throw new Error(Et(3));return o}function S(R){if(typeof R!="function")throw new Error(Et(4));if(f)throw new Error(Et(5));let b=!0;m();let F=p++;return i.set(F,R),function(){if(b){if(f)throw new Error(Et(6));b=!1,m(),i.delete(F),a=null}}}function A(R){if(!Qr(R))throw new Error(Et(7));if(typeof R.type>"u")throw new Error(Et(8));if(typeof R.type!="string")throw new Error(Et(17));if(f)throw new Error(Et(9));try{f=!0,o=n(o,R)}finally{f=!1}return(a=i).forEach(F=>{F()}),R}function h(R){if(typeof R!="function")throw new Error(Et(10));n=R,A({type:ed.REPLACE})}function C(){let R=S;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(Et(11));function F(){let P=b;P.next&&P.next(g())}return F(),{unsubscribe:R(F)}},[TA](){return this}}}return A({type:ed.INIT}),{dispatch:A,subscribe:S,getState:g,replaceReducer:h,[TA]:C}}function vN(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:ed.INIT})>"u")throw new Error(Et(12));if(typeof r(void 0,{type:ed.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Et(13))})}function Ri(e){let t=Object.keys(e),r={};for(let i=0;i<t.length;i++){let p=t[i];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{vN(r)}catch(i){a=i}return function(p={},f){if(a)throw a;let m=!1,g={};for(let S=0;S<n.length;S++){let A=n[S],h=r[A],C=p[A],w=h(C,f);if(typeof w>"u"){let R=f&&f.type;throw new Error(Et(14))}g[A]=w,m=m||w!==C}return m=m||n.length!==Object.keys(p).length,m?g:p}}function wi(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function PA(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Et(15))},i={getState:o.getState,dispatch:(f,...m)=>a(f,...m)},p=e.map(f=>f(i));return a=wi(...p)(o.dispatch),{...o,dispatch:a}}}function Fi(e){return Qr(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var ay=Symbol.for("immer-nothing"),Cu=Symbol.for("immer-draftable"),Ht=Symbol.for("immer-state");function It(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ei=Object.getPrototypeOf;function nr(e){return!!e&&!!e[Ht]}function zt(e){return e?qA(e)||Array.isArray(e)||!!e[Cu]||!!e.constructor?.[Cu]||Ii(e)||Iu(e):!1}var xN=Object.prototype.constructor.toString(),kA=new WeakMap;function qA(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=kA.get(r);return n===void 0&&(n=Function.toString.call(r),kA.set(r,n)),n===xN}function iy(e){return nr(e)||It(15,e),e[Ht].base_}function bu(e,t,r=!0){ra(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function ra(e){let t=e[Ht];return t?t.type_:Array.isArray(e)?1:Ii(e)?2:Iu(e)?3:0}function Ru(e,t){return ra(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Yh(e,t){return ra(e)===2?e.get(t):e[t]}function MA(e,t,r){let n=ra(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function AN(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ii(e){return e instanceof Map}function Iu(e){return e instanceof Set}function ta(e){return e.copy_||e.base_}function Zh(e,t){if(Ii(e))return new Map(e);if(Iu(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=qA(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Ht];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],p=n[i];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(n[i]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[i]})}return Object.create(Ei(e),n)}else{let n=Ei(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function od(e,t=!1){return ad(e)||nr(e)||!zt(e)||(ra(e)>1&&Object.defineProperties(e,{set:td,add:td,clear:td,delete:td}),Object.freeze(e),t&&Object.values(e).forEach(r=>od(r,!0))),e}function CN(){It(2)}var td={value:CN};function ad(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var ey={};function na(e){let t=ey[e];return t||It(0,e),t}function bN(e,t){ey[e]||(ey[e]=t)}var wu;function VA(){return wu}function RN(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function OA(e,t){t&&(na("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ty(e){ry(e),e.drafts_.forEach(wN),e.drafts_=null}function ry(e){e===wu&&(wu=e.parent_)}function NA(e){return wu=RN(wu,e)}function wN(e){let t=e[Ht];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function _A(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Ht].modified_&&(ty(t),It(4)),zt(e)&&(e=rd(t,e),t.parent_||nd(t,e)),t.patches_&&na("Patches").generateReplacementPatches_(r[Ht].base_,e,t.patches_,t.inversePatches_)):e=rd(t,r,[]),ty(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ay?e:void 0}function rd(e,t,r){if(ad(t))return t;let n=e.immer_.shouldUseStrictIteration(),o=t[Ht];if(!o)return bu(t,(a,i)=>DA(e,o,t,a,i,r),n),t;if(o.scope_!==e)return t;if(!o.modified_)return nd(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;let a=o.copy_,i=a,p=!1;o.type_===3&&(i=new Set(a),a.clear(),p=!0),bu(i,(f,m)=>DA(e,o,a,f,m,r,p),n),nd(e,a,!1),r&&e.patches_&&na("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function DA(e,t,r,n,o,a,i){if(o==null||typeof o!="object"&&!i)return;let p=ad(o);if(!(p&&!i)){if(nr(o)){let f=a&&t&&t.type_!==3&&!Ru(t.assigned_,n)?a.concat(n):void 0,m=rd(e,o,f);if(MA(r,n,m),nr(m))e.canAutoFreeze_=!1;else return}else i&&r.add(o);if(zt(o)&&!p){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===o&&p)return;rd(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Ii(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&nd(e,o)}}}function nd(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&od(t,r)}function FN(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:VA(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,a=sy;r&&(o=[n],a=Fu);let{revoke:i,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=i,p}var sy={get(e,t){if(t===Ht)return e;let r=ta(e);if(!Ru(r,t))return EN(e,r,t);let n=r[t];return e.finalized_||!zt(n)?n:n===Jh(e.base_,t)?(Xh(e),e.copy_[t]=oy(n,e)):n},has(e,t){return t in ta(e)},ownKeys(e){return Reflect.ownKeys(ta(e))},set(e,t,r){let n=jA(ta(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Jh(ta(e),t),a=o?.[Ht];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(AN(r,o)&&(r!==void 0||Ru(e.base_,t)))return!0;Xh(e),ny(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Jh(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Xh(e),ny(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=ta(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){It(11)},getPrototypeOf(e){return Ei(e.base_)},setPrototypeOf(){It(12)}},Fu={};bu(sy,(e,t)=>{Fu[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Fu.deleteProperty=function(e,t){return Fu.set.call(this,e,t,void 0)};Fu.set=function(e,t,r){return sy.set.call(this,e[0],t,r,e[0])};function Jh(e,t){let r=e[Ht];return(r?ta(r):e)[t]}function EN(e,t,r){let n=jA(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function jA(e,t){if(!(t in e))return;let r=Ei(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Ei(r)}}function ny(e){e.modified_||(e.modified_=!0,e.parent_&&ny(e.parent_))}function Xh(e){e.copy_||(e.copy_=Zh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var IN=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let a=r;r=t;let i=this;return function(f=a,...m){return i.produce(f,g=>r.call(this,g,...m))}}typeof r!="function"&&It(6),n!==void 0&&typeof n!="function"&&It(7);let o;if(zt(t)){let a=NA(this),i=oy(t,void 0),p=!0;try{o=r(i),p=!1}finally{p?ty(a):ry(a)}return OA(a,n),_A(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===ay&&(o=void 0),this.autoFreeze_&&od(o,!0),n){let a=[],i=[];na("Patches").generateReplacementPatches_(t,o,a,i),n(a,i)}return o}else It(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(i,...p)=>this.produceWithPatches(i,f=>t(f,...p));let n,o;return[this.produce(t,r,(i,p)=>{n=i,o=p}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){zt(e)||It(8),nr(e)&&(e=LA(e));let t=NA(this),r=oy(e,void 0);return r[Ht].isManual_=!0,ry(t),r}finishDraft(e,t){let r=e&&e[Ht];(!r||!r.isManual_)&&It(9);let{scope_:n}=r;return OA(n,t),_A(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=na("Patches").applyPatches_;return nr(e)?n(e,t):this.produce(e,o=>n(o,t))}};function oy(e,t){let r=Ii(e)?na("MapSet").proxyMap_(e,t):Iu(e)?na("MapSet").proxySet_(e,t):FN(e,t);return(t?t.scope_:VA()).drafts_.push(r),r}function LA(e){return nr(e)||It(10,e),UA(e)}function UA(e){if(!zt(e)||ad(e))return e;let t=e[Ht],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Zh(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Zh(e,!0);return bu(r,(o,a)=>{MA(r,o,UA(a))},n),t&&(t.finalized_=!1),r}function QA(){let t="replace",r="add",n="remove";function o(A,h,C,w){switch(A.type_){case 0:case 2:return i(A,h,C,w);case 1:return a(A,h,C,w);case 3:return p(A,h,C,w)}}function a(A,h,C,w){let{base_:R,assigned_:b}=A,F=A.copy_;F.length<R.length&&([R,F]=[F,R],[C,w]=[w,C]);for(let E=0;E<R.length;E++)if(b[E]&&F[E]!==R[E]){let P=h.concat([E]);C.push({op:t,path:P,value:S(F[E])}),w.push({op:t,path:P,value:S(R[E])})}for(let E=R.length;E<F.length;E++){let P=h.concat([E]);C.push({op:r,path:P,value:S(F[E])})}for(let E=F.length-1;R.length<=E;--E){let P=h.concat([E]);w.push({op:n,path:P})}}function i(A,h,C,w){let{base_:R,copy_:b}=A;bu(A.assigned_,(F,E)=>{let P=Yh(R,F),j=Yh(b,F),_=E?Ru(R,F)?t:r:n;if(P===j&&_===t)return;let k=h.concat(F);C.push(_===n?{op:_,path:k}:{op:_,path:k,value:j}),w.push(_===r?{op:n,path:k}:_===n?{op:r,path:k,value:S(P)}:{op:t,path:k,value:S(P)})})}function p(A,h,C,w){let{base_:R,copy_:b}=A,F=0;R.forEach(E=>{if(!b.has(E)){let P=h.concat([F]);C.push({op:n,path:P,value:E}),w.unshift({op:r,path:P,value:E})}F++}),F=0,b.forEach(E=>{if(!R.has(E)){let P=h.concat([F]);C.push({op:r,path:P,value:E}),w.unshift({op:n,path:P,value:E})}F++})}function f(A,h,C,w){C.push({op:t,path:[],value:h===ay?void 0:h}),w.push({op:t,path:[],value:A})}function m(A,h){return h.forEach(C=>{let{path:w,op:R}=C,b=A;for(let j=0;j<w.length-1;j++){let _=ra(b),k=w[j];typeof k!="string"&&typeof k!="number"&&(k=""+k),(_===0||_===1)&&(k==="__proto__"||k==="constructor")&&It(19),typeof b=="function"&&k==="prototype"&&It(19),b=Yh(b,k),typeof b!="object"&&It(18,w.join("/"))}let F=ra(b),E=g(C.value),P=w[w.length-1];switch(R){case t:switch(F){case 2:return b.set(P,E);case 3:It(16);default:return b[P]=E}case r:switch(F){case 1:return P==="-"?b.push(E):b.splice(P,0,E);case 2:return b.set(P,E);case 3:return b.add(E);default:return b[P]=E}case n:switch(F){case 1:return b.splice(P,1);case 2:return b.delete(P);case 3:return b.delete(C.value);default:return delete b[P]}default:It(17,R)}}),A}function g(A){if(!zt(A))return A;if(Array.isArray(A))return A.map(g);if(Ii(A))return new Map(Array.from(A.entries()).map(([C,w])=>[C,g(w)]));if(Iu(A))return new Set(Array.from(A).map(g));let h=Object.create(Ei(A));for(let C in A)h[C]=g(A[C]);return Ru(A,Cu)&&(h[Cu]=A[Cu]),h}function S(A){return nr(A)?g(A):A}bN("Patches",{applyPatches_:m,generatePatches_:o,generateReplacementPatches_:f})}var Eu=new IN,Dn=Eu.produce,id=Eu.produceWithPatches.bind(Eu);var cy=Eu.applyPatches.bind(Eu);d();c();l();u();function TN(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function PN(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function kN(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 BA=e=>Array.isArray(e)?e:[e];function ON(e){let t=Array.isArray(e[0])?e[0]:e;return kN(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function NN(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var vW=Symbol();var xW=Object.getPrototypeOf({});var _N=class{constructor(e){this.value=e}deref(){return this.value}},DN=typeof WeakRef<"u"?WeakRef:_N,qN=0,GA=1;function sd(){return{s:qN,v:void 0,o:null,p:null}}function Ti(e,t={}){let r=sd(),{resultEqualityCheck:n}=t,o,a=0;function i(){let p=r,{length:f}=arguments;for(let S=0,A=f;S<A;S++){let h=arguments[S];if(typeof h=="function"||typeof h=="object"&&h!==null){let C=p.o;C===null&&(p.o=C=new WeakMap);let w=C.get(h);w===void 0?(p=sd(),C.set(h,p)):p=w}else{let C=p.p;C===null&&(p.p=C=new Map);let w=C.get(h);w===void 0?(p=sd(),C.set(h,p)):p=w}}let m=p,g;if(p.s===GA)g=p.v;else if(g=e.apply(null,arguments),a++,n){let S=o?.deref?.()??o;S!=null&&n(S,g)&&(g=S,a!==0&&a--),o=typeof g=="object"&&g!==null||typeof g=="function"?new DN(g):g}return m.s=GA,m.v=g,g}return i.clearCache=()=>{r=sd(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function $A(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,i=0,p,f={},m=o.pop();typeof m=="object"&&(f=m,m=o.pop()),TN(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let g={...r,...f},{memoize:S,memoizeOptions:A=[],argsMemoize:h=Ti,argsMemoizeOptions:C=[],devModeChecks:w={}}=g,R=BA(A),b=BA(C),F=ON(o),E=S(function(){return a++,m.apply(null,arguments)},...R),P=!0,j=h(function(){i++;let k=NN(F,arguments);return p=E.apply(null,k),p},...b);return Object.assign(j,{resultFunc:m,memoizedResultFunc:E,dependencies:F,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:S,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var Ye=$A(Ti),MN=Object.assign((e,t=Ye)=>{PN(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((i,p,f)=>(i[r[f]]=p,i),{}))},{withTypes:()=>MN});d();c();l();u();function HA(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var zA=HA(),WA=HA;var VN=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?wi:wi.apply(null,arguments)},VW=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},jN=e=>e&&typeof e.match=="function";function T(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Bt(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 rC=class Tu extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Tu.prototype)}static get[Symbol.species](){return Tu}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Tu(...t[0].concat(this)):new Tu(...t.concat(this))}};function KA(e){return zt(e)?Dn(e,()=>{}):e}function YA(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function LN(e){return typeof e=="boolean"}var UN=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new rC;return r&&(LN(r)?i.push(zA):i.push(WA(r.extraArgument))),i},Pu="RTK_autoBatch",Oi=()=>e=>({payload:e,meta:{[Pu]:!0}}),JA=e=>t=>{setTimeout(t,e)},QN=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,i=!1,p=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:JA(10):e.type==="callback"?e.queueNotification:JA(e.timeout),m=()=>{i=!1,a&&(a=!1,p.forEach(g=>g()))};return Object.assign({},n,{subscribe(g){let S=()=>o&&g(),A=n.subscribe(S);return p.add(g),()=>{A(),p.delete(g)}},dispatch(g){try{return o=!g?.meta?.[Pu],a=!o,a&&(i||(i=!0,f(m))),n.dispatch(g)}finally{o=!0}}})},BN=e=>function(r){let{autoBatch:n=!0}=r??{},o=new rC(e);return n&&o.push(QN(typeof n=="object"?n:void 0)),o};function nC(e){let t=UN(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:a=void 0,enhancers:i=void 0}=e||{},p;if(typeof r=="function")p=r;else if(Qr(r))p=Ri(r);else throw new Error(Bt(1));let f;typeof n=="function"?f=n(t):f=t();let m=wi;o&&(m=VN({trace:!1,...(typeof o=="object"&&o)}));let g=PA(...f),S=BN(g),A=typeof i=="function"?i(S):S(),h=m(...A);return Kh(p,a,h)}function oC(e){let t={},r=[],n,o={addCase(a,i){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(Bt(28));if(p in t)throw new Error(Bt(29));return t[p]=i,o},addMatcher(a,i){return r.push({matcher:a,reducer:i}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function GN(e){return typeof e=="function"}function oe(e,t){let[r,n,o]=oC(t),a;if(GN(e))a=()=>KA(e());else{let p=KA(e);a=()=>p}function i(p=a(),f){let m=[r[f.type],...n.filter(({matcher:g})=>g(f)).map(({reducer:g})=>g)];return m.filter(g=>!!g).length===0&&(m=[o]),m.reduce((g,S)=>{if(S)if(nr(g)){let h=S(g,f);return h===void 0?g:h}else{if(zt(g))return Dn(g,A=>S(A,f));{let A=S(g,f);if(A===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return A}}return g},p)}return i.getInitialState=a,i}var aC=(e,t)=>jN(e)?e.match(t):e(t);function Br(...e){return t=>e.some(r=>aC(r,t))}function ki(...e){return t=>e.every(r=>aC(r,t))}function dd(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 ku(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function pd(...e){return e.length===0?t=>dd(t,["pending"]):ku(e)?Br(...e.map(t=>t.pending)):pd()(e[0])}function ia(...e){return e.length===0?t=>dd(t,["rejected"]):ku(e)?Br(...e.map(t=>t.rejected)):ia()(e[0])}function Ou(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?ki(ia(...e),t):ku(e)?ki(ia(...e),t):Ou()(e[0])}function qn(...e){return e.length===0?t=>dd(t,["fulfilled"]):ku(e)?Br(...e.map(t=>t.fulfilled)):qn()(e[0])}function fd(...e){return e.length===0?t=>dd(t,["pending","fulfilled","rejected"]):ku(e)?Br(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):fd()(e[0])}var $N="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Nu=(e=21)=>{let t="",r=e;for(;r--;)t+=$N[Math.random()*64|0];return t},HN=["name","message","stack","code"],uy=class{constructor(e,t){Ne(this,"_type");this.payload=e,this.meta=t}},XA=class{constructor(e,t){Ne(this,"_type");this.payload=e,this.meta=t}},zN=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of HN)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},Se=(()=>{function e(t,r,n){let o=T(t+"/fulfilled",(f,m,g,S)=>({payload:f,meta:{...(S||{}),arg:g,requestId:m,requestStatus:"fulfilled"}})),a=T(t+"/pending",(f,m,g)=>({payload:void 0,meta:{...(g||{}),arg:m,requestId:f,requestStatus:"pending"}})),i=T(t+"/rejected",(f,m,g,S,A)=>({payload:S,error:(n&&n.serializeError||zN)(f||"Rejected"),meta:{...(A||{}),arg:g,requestId:m,rejectedWithValue:!!S,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f){return(m,g,S)=>{let A=n?.idGenerator?n.idGenerator(f):Nu(),h=new s.AbortController,C,w;function R(F){w=F,h.abort()}let b=_asyncToGenerator(function*(){let F;try{let P=n?.condition?.(f,{getState:g,extra:S});if(KN(P)&&(P=yield P),P===!1||h.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let j=new Promise((_,k)=>{C=()=>{k({name:"AbortError",message:w||"Aborted"})},h.signal.addEventListener("abort",C)});m(a(A,f,n?.getPendingMeta?.({requestId:A,arg:f},{getState:g,extra:S}))),F=yield Promise.race([j,Promise.resolve(r(f,{dispatch:m,getState:g,extra:S,requestId:A,signal:h.signal,abort:R,rejectWithValue:(_,k)=>new uy(_,k),fulfillWithValue:(_,k)=>new XA(_,k)})).then(_=>{if(_ instanceof uy)throw _;return _ instanceof XA?o(_.payload,A,f,_.meta):o(_,A,f)})])}catch(P){F=P instanceof uy?i(null,A,f,P.payload,P.meta):i(P,A,f)}finally{C&&h.signal.removeEventListener("abort",C)}return n&&!n.dispatchConditionRejection&&i.match(F)&&F.meta.condition||m(F),F})();return Object.assign(b,{abort:R,requestId:A,arg:f,unwrap(){return b.then(WN)}})}}return Object.assign(p,{pending:a,rejected:i,fulfilled:o,settled:Br(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function WN(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function KN(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var iC=Symbol.for("rtk-slice-createasyncthunk"),BW={[iC]:Se};function YN(e,t){return`${e}/${t}`}function JN({creators:e}={}){let t=e?.asyncThunk?.[iC];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Bt(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(ZN()):n.reducers)||{},p=Object.keys(i),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(F,E){let P=typeof F=="string"?F:F.type;if(!P)throw new Error(Bt(12));if(P in f.sliceCaseReducersByType)throw new Error(Bt(13));return f.sliceCaseReducersByType[P]=E,m},addMatcher(F,E){return f.sliceMatchers.push({matcher:F,reducer:E}),m},exposeAction(F,E){return f.actionCreators[F]=E,m},exposeCaseReducer(F,E){return f.sliceCaseReducersByName[F]=E,m}};p.forEach(F=>{let E=i[F],P={reducerName:F,type:YN(o,F),createNotation:typeof n.reducers=="function"};t_(E)?n_(P,E,m,t):e_(P,E,m)});function g(){let[F={},E=[],P=void 0]=typeof n.extraReducers=="function"?oC(n.extraReducers):[n.extraReducers],j={...F,...f.sliceCaseReducersByType};return oe(n.initialState,_=>{for(let k in j)_.addCase(k,j[k]);for(let k of f.sliceMatchers)_.addMatcher(k.matcher,k.reducer);for(let k of E)_.addMatcher(k.matcher,k.reducer);P&&_.addDefaultCase(P)})}let S=F=>F,A=new Map,h;function C(F,E){return h||(h=g()),h(F,E)}function w(){return h||(h=g()),h.getInitialState()}function R(F,E=!1){function P(_){let k=_[F];return typeof k>"u"&&E&&(k=w()),k}function j(_=S){let k=YA(A,E,()=>new WeakMap);return YA(k,_,()=>{let N={};for(let[q,U]of Object.entries(n.selectors??{}))N[q]=XN(U,_,w,E);return N})}return{reducerPath:F,getSelectors:j,get selectors(){return j(P)},selectSlice:P}}let b={name:o,reducer:C,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:w,...R(a),injectInto(F,{reducerPath:E,...P}={}){let j=E??a;return F.inject({reducerPath:j,reducer:C},P),{...b,...R(j,!0)}}};return b}}function XN(e,t,r,n){function o(a,...i){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...i)}return o.unwrapped=e,o}var sa=JN();function ZN(){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 e_({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!r_(n))throw new Error(Bt(17));a=n.reducer,i=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?T(e,i):T(e))}function t_(e){return e._reducerDefinitionType==="asyncThunk"}function r_(e){return e._reducerDefinitionType==="reducerWithPrepare"}function n_({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Bt(18));let{payloadCreator:a,fulfilled:i,pending:p,rejected:f,settled:m,options:g}=r,S=o(e,a,g);n.exposeAction(t,S),i&&n.addCase(S.fulfilled,i),p&&n.addCase(S.pending,p),f&&n.addCase(S.rejected,f),m&&n.addMatcher(S.settled,m),n.exposeCaseReducer(t,{fulfilled:i||cd,pending:p||cd,rejected:f||cd,settled:m||cd})}function cd(){}var o_="task",sC="listener",cC="completed",py="cancelled",a_=`task-${py}`,i_=`task-${cC}`,ly=`${sC}-${py}`,s_=`${sC}-${cC}`,md=class{constructor(e){Ne(this,"name","TaskAbortError");Ne(this,"message");this.code=e,this.message=`${o_} ${py} (reason: ${e})`}},fy=(e,t)=>{if(typeof e!="function")throw new TypeError(Bt(32))},ud=()=>{},uC=(e,t=ud)=>(e.catch(t),e),lC=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),oa=(e,t)=>{let r=e.signal;r.aborted||("reason"in r||Object.defineProperty(r,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},aa=e=>{if(e.aborted){let{reason:t}=e;throw new md(t)}};function dC(e,t){let r=ud;return new Promise((n,o)=>{let a=()=>o(new md(e.reason));if(e.aborted){a();return}r=lC(e,a),t.finally(()=>r()).then(n,o)}).finally(()=>{r=ud})}var c_=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof md?"cancelled":"rejected",error:r}}finally{t?.()}});return function c_(_x7,_x8){return _ref5.apply(this,arguments)}}(),ld=e=>t=>uC(dC(e,t).then(r=>(aa(e),r))),pC=e=>{let t=ld(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Pi}=Object,ZA={},gd="listenerMiddleware",u_=(e,t)=>{let r=n=>lC(e,()=>oa(n,e.reason));return(n,o)=>{fy(n,"taskExecutor");let a=new s.AbortController;r(a);let i=c_(/*#__PURE__*/_asyncToGenerator(function*(){aa(e),aa(a.signal);let p=yield n({pause:ld(a.signal),delay:pC(a.signal),signal:a.signal});return aa(a.signal),p}),()=>oa(a,i_));return o?.autoJoin&&t.push(i.catch(ud)),{result:ld(e)(i),cancel(){oa(a,a_)}}}},l_=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){aa(t);let a=()=>{},p=[new Promise((f,m)=>{let g=e({predicate:n,effect:(S,A)=>{A.unsubscribe(),f([S,A.getState(),A.getOriginalState()])}});a=()=>{g(),m()}})];o!=null&&p.push(new Promise(f=>setTimeout(f,o,null)));try{let f=yield dC(t,Promise.race(p));return aa(t),f}finally{a()}});return function r(_x9,_x0){return _ref7.apply(this,arguments)}}();return(n,o)=>uC(r(n,o))},fC=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:a}=e;if(t)o=T(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(Bt(21));return fy(a,"options.listener"),{predicate:o,type:t,effect:a}},mC=Pi(e=>{let{type:t,predicate:r,effect:n}=fC(e);return{id:Nu(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Bt(22))}}},{withTypes:()=>mC}),eC=(e,t)=>{let{type:r,effect:n,predicate:o}=fC(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===o)&&a.effect===n)},dy=e=>{e.pending.forEach(t=>{oa(t,ly)})},d_=e=>()=>{e.forEach(dy),e.clear()},tC=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},gC=Pi(T(`${gd}/add`),{withTypes:()=>gC}),p_=T(`${gd}/removeAll`),hC=Pi(T(`${gd}/remove`),{withTypes:()=>hC}),f_=(...e)=>{console.error(`${gd}/error`,...e)},yC=(e={})=>{let t=new Map,{extra:r,onError:n=f_}=e;fy(n,"onError");let o=g=>(g.unsubscribe=()=>t.delete(g.id),t.set(g.id,g),S=>{g.unsubscribe(),S?.cancelActive&&dy(g)}),a=g=>{let S=eC(t,g)??mC(g);return o(S)};Pi(a,{withTypes:()=>a});let i=g=>{let S=eC(t,g);return S&&(S.unsubscribe(),g.cancelActive&&dy(S)),!!S};Pi(i,{withTypes:()=>i});let p=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(g,S,A,h){let C=new s.AbortController,w=l_(a,C.signal),R=[];try{g.pending.add(C),yield Promise.resolve(g.effect(S,Pi({},A,{getOriginalState:h,condition:(b,F)=>w(b,F).then(Boolean),take:w,delay:pC(C.signal),pause:ld(C.signal),extra:r,signal:C.signal,fork:u_(C.signal,R),unsubscribe:g.unsubscribe,subscribe:()=>{t.set(g.id,g)},cancelActiveListeners:()=>{g.pending.forEach((b,F,E)=>{b!==C&&(oa(b,ly),E.delete(b))})},cancel:()=>{oa(C,ly),g.pending.delete(C)},throwIfCancelled:()=>{aa(C.signal)}})))}catch(b){b instanceof md||tC(n,b,{raisedBy:"effect"})}finally{yield Promise.all(R),oa(C,s_),g.pending.delete(C)}});return function p(_x1,_x10,_x11,_x12){return _ref8.apply(this,arguments)}}(),f=d_(t);return{middleware:g=>S=>A=>{if(!Fi(A))return S(A);if(gC.match(A))return a(A.payload);if(p_.match(A)){f();return}if(hC.match(A))return i(A.payload);let h=g.getState(),C=()=>{if(h===ZA)throw new Error(Bt(23));return h},w;try{if(w=S(A),t.size>0){let R=g.getState(),b=Array.from(t.values());for(let F of b){let E=!1;try{E=F.predicate(A,R,h)}catch(P){E=!1,tC(n,P,{raisedBy:"predicate"})}E&&p(F,A,g,C)}}}finally{h=ZA}return w},startListening:a,stopListening:i,clearListeners:f}};var $W=Symbol.for("rtk-state-proxy-original");function Bt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var SC=/^(?:[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 m_(e){return typeof e=="string"&&SC.test(e)}var my=m_;d();c();l();u();var Tt=[];for(let e=0;e<256;++e)Tt.push((e+256).toString(16).slice(1));function vC(e,t=0){return(Tt[e[t+0]]+Tt[e[t+1]]+Tt[e[t+2]]+Tt[e[t+3]]+"-"+Tt[e[t+4]]+Tt[e[t+5]]+"-"+Tt[e[t+6]]+Tt[e[t+7]]+"-"+Tt[e[t+8]]+Tt[e[t+9]]+"-"+Tt[e[t+10]]+Tt[e[t+11]]+Tt[e[t+12]]+Tt[e[t+13]]+Tt[e[t+14]]+Tt[e[t+15]]).toLowerCase()}d();c();l();u();var gy,g_=new Uint8Array(16);function hy(){if(!gy){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");gy=crypto.getRandomValues.bind(crypto)}return gy(g_)}d();c();l();u();d();c();l();u();var h_=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),yy={randomUUID:h_};function y_(e,t,r){e=e||{};let n=e.random??e.rng?.()??hy();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 vC(n)}function S_(e,t,r){return yy.randomUUID&&!t&&!e?yy.randomUUID():y_(e,t,r)}var Sy=S_;d();c();l();u();function xC(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}function v_({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:i}=e;i!=="disabled"&&(n.call(r),t.send(o,a,r))}var AC="visitorId";function x_(e){return{getClientId:()=>{let t=e.get(),r=t.storage,n=r.getItem(AC),o=n&&my(n)?n:t.generateUUID();return r.setItem(AC,o),o}}}var FC="1.2.15",vy=128,EC=192,CC=224,bC=240,A_=248;function C_(e){return(e&A_)===bC?4:(e&bC)===CC?3:(e&CC)===EC?2:1}function b_(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&vy)!=vy)break;if(r-=3,(n&EC)!=vy){t-r>=C_(n)*3&&(r=t);break}}return e.substring(0,r)}function R_(e){let{trackingId:t}=e;return{trackingId:t}}function w_(e){return(e.source||[]).concat([`relay@${FC}`])}function IC(e,t,r,n){let{getReferrer:o,getLocation:a,getUserAgent:i}=r,p=R_(t),f=n.getClientId();return Object.freeze({type:e,config:p,ts:Date.now(),source:w_(t),clientId:f,userAgent:i(),referrer:RC(o()),location:RC(a())})}function RC(e){return e!==null?b_(e,1024):null}function F_(e,t,r,n,o){return{...t,meta:IC(e,r,n,o)}}var E_="*";function I_(){let e=[];function t({type:f,callback:m}){return e.findIndex(g=>g.type===f&&g.callback===m)}function r(f,m){return f.type==="*"||m===f.type}function n(f){return t(f)<0&&e.push(f),()=>p(f.type,f.callback)}function o(f){e.forEach(m=>{if(r(m,f.meta.type))try{m.callback(f)}catch(g){console.error(g)}})}function a(f){if(f===E_)e.length=0;else for(let m=e.length-1;m>=0;m--)e[m].type===f&&e.splice(m,1)}function i(f){let m=t(f);m>=0&&e.splice(m,1)}function p(f,m){m?i({type:f,callback:m}):a(f)}return{add:n,call:o,remove:p}}function wC({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 T_(e){let t=wC(e);return{get:()=>t,update:r=>{t=wC({...t,...r})}}}var xy=P_();function P_(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let i=a.replace(/^\s+/,"");if(i.lastIndexOf(n,0)===0)return i.substring(n.length,i.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),i=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${i}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function k_(){return{getItem(e){return xy.getItem(e)||localStorage.getItem(e)},removeItem(e){xy.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),xy.setItem(e,t,31556952e3)}}}function O_(){let e=document.referrer;return e===""?null:e}function Ay(){return{runtime:"browser",send:(e,t,r)=>{let n=navigator.sendBeacon(`${e}?access_token=${t}`,new Blob([JSON.stringify([r])],{type:"application/json"}));if(xC().sendMessage({kind:"EVENT_PROTOCOL",event:r,url:e,token:t}),!n)throw new Error("Failed to send the event(s) because the payload size exceeded the maximum allowed size (32 KB). Please contact support if the problem persists.")},getReferrer:()=>O_(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,generateUUID:()=>Sy(),storage:k_()}}function N_(){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 __(){return{getItem(){return null},removeItem(){},setItem(){}}}function D_(){return{runtime:"null",send:()=>{},getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,generateUUID:()=>"",storage:__()}}function q_(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=D_();return t&&r?{storage:n.storage,...r,runtime:"custom"}:t&&M_()&&N_()?Ay():n}function M_(){try{return typeof window=="object"}catch{return!1}}function V_(e){return{get:()=>Object.freeze(q_(e))}}function TC(e){let t=T_(e),r=I_(),n=V_(t),o=x_(n);return{emit:(a,i)=>{let p=t.get(),f=n.get(),m=F_(a,i,p,f,o);return v_({config:p,environment:f,event:m,listenerManager:r})},getMeta:a=>IC(a,t.get(),n.get(),o),on:(a,i)=>r.add({type:a,callback:i}),off:(a,i)=>r.remove(a,i),updateConfig:a=>t.update(a),version:FC}}d();c();l();u();function PC(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var uo="3.47.0",kC=["@coveo/atomic","@coveo/quantic"];var Ni=Ye(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${uo}`));var _u=Ye(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>Ni(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i,p)=>{let f=L_(p);return TC({mode:a?"emit":"disabled",url:o??Wl(e,t),token:r,trackingId:n??null,source:i,environment:f})}),j_={generateUUID:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:()=>{},storage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{}}},L_=e=>{if(!e)return;let t=e();return{...(PC()?Ay():j_),generateUUID:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();d();c();l();u();function Mn(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function V(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(S){i(S)}}function f(g){try{m(n.throw(g))}catch(S){i(S)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}var Te;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Te||(Te={}));function Ry(){return typeof window<"u"}function My(){return typeof navigator<"u"}function _i(){return typeof document<"u"}function wy(){try{return typeof localStorage<"u"}catch{return!1}}function U_(){try{return typeof sessionStorage<"u"}catch{return!1}}function $C(){return My()&&navigator.cookieEnabled}var Q_=[Te.click,Te.custom,Te.search,Te.view],B_=(e,t)=>Q_.indexOf(e)!==-1?Object.assign({language:_i()?document.documentElement.lang:"unknown",userAgent:My()?navigator.userAgent:"unknown"},t):t,qu=class e{static set(t,r,n){var o,a,i,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?OC(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],OC(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function OC(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function G_(){return wy()?localStorage:$C()?new Mu:U_()?sessionStorage:new qi}var Mu=class e{getItem(t){return qu.get(`${e.prefix}${t}`)}removeItem(t){qu.erase(`${e.prefix}${t}`)}setItem(t,r,n){qu.set(`${e.prefix}${t}`,r,n)}};Mu.prefix="coveo_";var Fy=class{constructor(){this.cookieStorage=new Mu}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)}},qi=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},hd="__coveo.analytics.history",$_=20,H_=1e3*60,z_=75,vd=class{constructor(t){this.store=t||G_()}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){return V(this,void 0,void 0,function*(){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=yield this.getHistoryWithInternalTimeAsync();r!=null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])})}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){return V(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(hd);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return V(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(hd);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(hd,JSON.stringify(t.slice(0,$_)))}catch{}}clear(){try{this.store.removeItem(hd)}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,z_)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>H_:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var W_=(e,t)=>V(void 0,void 0,void 0,function*(){return e===Te.view?(yield K_(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),K_=e=>V(void 0,void 0,void 0,function*(){let t=new vd,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),yd,Y_=new Uint8Array(16);function J_(){if(!yd&&(yd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yd(Y_)}var X_=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function xd(e){return typeof e=="string"&&X_.test(e)}var Pt=[];for(let e=0;e<256;++e)Pt.push((e+256).toString(16).slice(1));function HC(e,t=0){return Pt[e[t+0]]+Pt[e[t+1]]+Pt[e[t+2]]+Pt[e[t+3]]+"-"+Pt[e[t+4]]+Pt[e[t+5]]+"-"+Pt[e[t+6]]+Pt[e[t+7]]+"-"+Pt[e[t+8]]+Pt[e[t+9]]+"-"+Pt[e[t+10]]+Pt[e[t+11]]+Pt[e[t+12]]+Pt[e[t+13]]+Pt[e[t+14]]+Pt[e[t+15]]}function Z_(e){if(!xd(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}function e0(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var t0="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r0="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function n0(e,t,r){function n(o,a,i,p){var f;if(typeof o=="string"&&(o=e0(o)),typeof a=="string"&&(a=Z_(a)),((f=a)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let m=new Uint8Array(16+o.length);if(m.set(a),m.set(o,a.length),m=r(m),m[6]=m[6]&15|t,m[8]=m[8]&63|128,i){p=p||0;for(let g=0;g<16;++g)i[p+g]=m[g];return i}return HC(m)}try{n.name=e}catch{}return n.DNS=t0,n.URL=r0,n}var o0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),NC={randomUUID:o0};function ca(e,t,r){if(NC.randomUUID&&!t&&!e)return NC.randomUUID();e=e||{};let n=e.random||(e.rng||J_)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return HC(n)}function a0(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 Cy(e,t){return e<<t|e>>>32-t}function i0(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let i=unescape(encodeURIComponent(e));e=[];for(let p=0;p<i.length;++p)e.push(i.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let i=0;i<o;++i){let p=new Uint32Array(16);for(let f=0;f<16;++f)p[f]=e[i*64+f*4]<<24|e[i*64+f*4+1]<<16|e[i*64+f*4+2]<<8|e[i*64+f*4+3];a[i]=p}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let i=0;i<o;++i){let p=new Uint32Array(80);for(let h=0;h<16;++h)p[h]=a[i][h];for(let h=16;h<80;++h)p[h]=Cy(p[h-3]^p[h-8]^p[h-14]^p[h-16],1);let f=r[0],m=r[1],g=r[2],S=r[3],A=r[4];for(let h=0;h<80;++h){let C=Math.floor(h/20),w=Cy(f,5)+a0(C,m,g,S)+A+t[C]+p[h]>>>0;A=S,S=g,g=Cy(m,30)>>>0,m=f,f=w}r[0]=r[0]+f>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+S>>>0,r[4]=r[4]+A>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var s0=n0("v5",80,i0),_C=s0,zC="2.30.52",DC=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Du={pageview:"pageview",event:"event"},Ad=class{constructor({client:t,uuidGenerator:r=ca}){this.client=t,this.uuidGenerator=r}},Ey=class extends Ad{constructor({client:t,uuidGenerator:r=ca}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=DC(window.location),this.lastReferrer=_i()?document.referrer:"",this.addHooks()}getApi(t){switch(t){case"setAction":return this.setAction;default:return null}}setAction(t,r){this.action=t,this.actionData=r}clearData(){this.clearPluginData(),this.action=void 0,this.actionData={}}getLocationInformation(t,r){return Object.assign({hitType:t},this.getNextValues(t,r))}updateLocationInformation(t,r){this.updateLocationForNextPageView(t,r)}getDefaultContextInformation(t){let r={title:_i()?document.title:"",encoding:_i()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===Du.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Du.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Du.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Du.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 DC(window.location)}},lo=class e{constructor(t,r){if(!xd(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return xd(a)?new e(a,Number.parseInt(o)*1e3):null}};lo.cvo_cid="cvo_cid";lo.expirationTime=120;var Iy=class extends Ad{constructor({client:t,uuidGenerator:r=ca}){super({client:t,uuidGenerator:r})}getApi(t){switch(t){case"decorate":return this.decorate;case"acceptFrom":return this.acceptFrom;default:return null}}decorate(t){return V(this,void 0,void 0,function*(){if(!this.client.getCurrentVisitorId)throw new Error("Could not retrieve current clientId");try{let r=new URL(t),n=yield this.client.getCurrentVisitorId();return r.searchParams.set(lo.cvo_cid,new lo(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Iy.Id="link";var pr=Object.keys;function Sd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var by=128,WC=192,qC=224,MC=240;function c0(e){return(e&248)===MC?4:(e&MC)===qC?3:(e&qC)===WC?2:1}function u0(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&by)!=by)break;if(r-=3,(n&WC)!=by){t-r>=c0(n)*3&&(r=t);break}}return e.substring(0,r)}var Ty={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"},l0=pr(Ty).map(e=>Ty[e]),d0=[...l0].join("|"),p0=new RegExp(`^(${d0}$)`),f0={svcAction:"svc_action",svcActionData:"svc_action_data"},m0=e=>pr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=Ty[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),g0=e=>p0.test(e),h0=[g0],VC={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},jC={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},_t={action:"pa",list:"pal",listSource:"pls"},Cd={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},y0=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Py={id:"quoteId",affiliation:"quoteAffiliation"},ky={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},S0={add:_t,bookmark_add:_t,bookmark_remove:_t,click:_t,checkout:_t,checkout_option:_t,detail:_t,impression:_t,remove:_t,refund:Object.assign(Object.assign({},_t),Cd),purchase:Object.assign(Object.assign({},_t),Cd),quickview:_t,quote:Object.assign(Object.assign({},_t),Py),review:Object.assign(Object.assign({},_t),ky)},v0=pr(VC).map(e=>VC[e]),x0=pr(jC).map(e=>jC[e]),A0=pr(_t).map(e=>_t[e]),C0=pr(Cd).map(e=>Cd[e]),b0=pr(ky).map(e=>ky[e]),R0=pr(Py).map(e=>Py[e]),w0=[...v0,"custom"].join("|"),F0=[...x0,"custom"].join("|"),KC="(pr[0-9]+)",YC="(il[0-9]+pi[0-9]+)",E0=new RegExp(`^${KC}(${w0})$`),I0=new RegExp(`^(${YC}(${F0}))|(il[0-9]+nm)$`),T0=new RegExp(`^(${A0.join("|")})$`),P0=new RegExp(`^(${C0.join("|")})$`),k0=new RegExp(`^${KC}custom$`),O0=new RegExp(`^${YC}custom$`),N0=new RegExp(`^(${[...y0,...b0,...R0].join("|")})$`),_0=e=>E0.test(e),D0=e=>I0.test(e),q0=e=>T0.test(e),M0=e=>P0.test(e),V0=e=>N0.test(e),j0=[D0,_0,q0,M0,V0],L0=[k0,O0],U0={anonymizeIp:"aip"},Q0={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},B0={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},G0=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],$0=Object.assign(Object.assign(Object.assign(Object.assign({},U0),Q0),B0),G0.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Oy=Object.assign(Object.assign({},$0),f0),H0=e=>{let t=!!e.action&&S0[e.action]||{};return pr(e).reduce((r,n)=>{let o=t[n]||Oy[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},z0=pr(Oy).map(e=>Oy[e]),W0=e=>z0.indexOf(e)!==-1,K0=e=>e==="custom",Y0=e=>[...j0,...h0,W0,K0].some(t=>t(e)),J0=e=>pr(e).reduce((t,r)=>{let n=X0(r);return n?Object.assign(Object.assign({},t),Z0(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),X0=e=>{let t;return[...L0].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},Z0=(e,t)=>pr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Ny=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:i,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),f=this.encodeForEventType(t,p),m=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(i,m)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return V(this,void 0,void 0,function*(){let o=t,a=r;if(n){let i=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:f}=i;o=p||t;try{a=JSON.parse(f)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return V(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[Te.click,Te.custom,Te.search,Te.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}},_y=class{sendEvent(t,r){return V(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){return Promise.resolve()})}},LC=y.fetch,bd=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,i=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${i}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:m}=f,g=Mn(f,["url"]),S;try{S=yield LC(m,g)}catch(A){console.error("An error has occured when sending the event.",A);return}if(S.ok){let A=yield S.json();return A.visitorId&&o.setCurrentVisitorId(A.visitorId),A}else{try{S.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,S,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return V(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield LC(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Te.click,Te.custom,Te.search,Te.view].indexOf(t)!==-1}getVisitorIdParam(){return V(this,void 0,void 0,function*(){let{visitorIdProvider:t}=this.opts,r=yield t.getCurrentVisitorId();return r?`?visitor=${r}`:""})}getHeaders(){let{token:t}=this.opts;return Object.assign(Object.assign({},t?{Authorization:`Bearer ${t}`}:{}),{"Content-Type":"application/json"})}},Dy=class{constructor(t,r){wy()&&$C()?this.storage=new Fy:wy()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new qi),this.client=new bd(t),this.beaconClient=new Ny(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},qy=class{constructor(t,r){this.storage=r||new qi,this.client=new bd(t)}getClientDependingOnEventType(t){return this.client}},Rd=class{constructor(){this.storage=new qi,this.client=new _y}getClientDependingOnEventType(t){return this.client}},eD="xx",tD=e=>e?.startsWith(eD)||!1,rD=`
|
|
26
|
+
`;return new yu(r)}var yu=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},ge=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let a=this.definition[o].validate(r[o]);a&&n.push(`${o}: ${a}`)}if(n.length)throw vO(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}},Le=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&ue(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 wt(e){return e===void 0}function xO(e){return e===null}function ue(e){return wt(e)||xO(e)}var ce=class{constructor(e={}){Ne(this,"value");this.value=new Le(e)}validate(e){let t=this.value.validate(e);return t||(AO(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function AO(e){return wt(e)||Bl(e)}function Bl(e){return typeof e=="boolean"}var ee=class{constructor(e={}){Ne(this,"value");this.config=e,this.value=new Le(e)}validate(e){let t=this.value.validate(e);return t||(CO(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 CO(e){return wt(e)||tA(e)}function tA(e){return typeof e=="number"&&!Number.isNaN(e)}var bO=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,M=class{constructor(e={}){Ne(this,"value");Ne(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Le(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:a}=this.config,i=this.value.validate(e);if(i)return i;if(wt(e))return null;if(!Ai(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:a&&!(bO.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 Ai(e){return Object.prototype.toString.call(e)==="[object String]"}var J=class{constructor(e={}){Ne(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(wt(e))return this.config.options.required?"value is required and is currently undefined":null;if(!rA(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&ue(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],a=n.validate(o);a!==null&&(t+=` ${a}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function rA(e){return e!==void 0&&typeof e=="object"}var ae=class{constructor(e={}){Ne(this,"value");this.config=e,this.value=new Le(this.config)}validate(e){if(!ue(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(ue(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&&ue(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 Bl(e)||Ai(e)||tA(e)||rA(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Ci(e){return Array.isArray(e)}var Su=class{constructor(e){Ne(this,"value");this.config=e,this.value=new Le(e)}validate(e){let t=this.value.validate(e);return t!==null?t:wt(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};d();c();l();u();var oo=(e,t=5)=>e+Math.random().toString(36).substring(2,2+t);function Gl(e){return Array.isArray(e)}function $l(e){return e.trim()===""}function nA(e,t){return[...e.reduce((r,n)=>{let o=t(n);return r.has(o)||r.set(o,n),r},new Map).values()]}function RO(e){return btoa(encodeURI(e))}function Hl(e,t){let{[e]:r,...n}=t;return n}function bi(e){return RO(JSON.stringify(e))}var wO=new Set(["1",1,"yes",!0]);function oA(){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=>wO.has(r))}function aA(e){let t={};for(let[r,n]of e)t[r]=n;return t}function iA(e,t,r){return clearTimeout(t),setTimeout(e,r)}function vu(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function zl(e,t,r={}){let n;return(...o)=>{let a=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),a)return e.apply(void 0,o)}}function FO(e){if($l(e.openingDelimiter)||$l(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(ue(e.content)||$l(e.content))return e.content;if(e.highlights.length===0)return Ri(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let a=e.highlights[o],i=a.offset,p=i+a.length;if(p>t)break;r+=Ri(e.content.slice(n,i)),r+=e.openingDelimiter,r+=Ri(e.content.slice(i,p)),r+=e.closingDelimiter,n=p}return n!==t&&(r+=Ri(e.content.slice(n))),r}function Bh(e,t){return e=Ri(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,a)=>n?Qh(n,t.notMatchDelimiters):o?Qh(o,t.exactMatchDelimiters):a?Qh(a,t.correctionDelimiters):r)}function Qh(e,t){return t?t.open+e+t.close:e}function Ri(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,a=>t[a]):e}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function cA(_x2,_x3){return _cA.apply(this,arguments)}function _cA(){_cA=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _cA.apply(this,arguments)}function uA(e){let t,r,n,o=!1;return function(i){t===void 0?(t=i,r=0,n=-1):t=IO(t,i);let p=t.length,f=0;for(;r<p;){o&&(t[r]===10&&(f=++r),o=!1);let m=-1;for(;r<p&&m===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-f);break;case 13:o=!0,m=r;break;case 10:m=r;break}if(m===-1)break;e(t.subarray(f,m),n),f=r,n=-1}f===p?t=void 0:f!==0&&(t=t.subarray(f),r-=f)}}function lA(e,t,r){let n=sA(),o=new TextDecoder;return function(i,p){if(i.length===0)r?.(n),n=sA();else if(p>0){let f=o.decode(i.subarray(0,p)),m=p+(i[p+1]===32?2:1),h=o.decode(i.subarray(m));switch(f){case"data":n.data=n.data?`${n.data}
|
|
27
|
+
${h}`:h;break;case"event":n.event=h;break;case"id":e(n.id=h);break;case"retry":EO(h,n,t);break}}}}function EO(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function IO(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function sA(){return{data:"",event:"",id:"",retry:void 0}}var $h="text/event-stream",TO=1e3,dA="last-event-id";function pA(){return typeof window<"u"}function Wl(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:a,onerror:i,openWhenHidden:p,fetch:f,...m}){return new Promise((h,S)=>{let v={...r};v.accept||(v.accept=$h);let g;function C(){g?.abort(),document.hidden||P()}!p&&pA()&&document.addEventListener("visibilitychange",C);let w=TO,R;function b(){pA()&&document.removeEventListener("visibilitychange",C),clearTimeout(R),g?.abort()}t?.addEventListener("abort",()=>{b(),h()});let F=f??x,I=n??PO;function P(){return _P2.apply(this,arguments)}function _P2(){_P2=_asyncToGenerator(function*(){g=s.AbortController?new s.AbortController:null;try{let V=yield F(e,{...m,headers:v,signal:g?.signal});yield I(V),yield cA(V.body,uA(lA(_=>{_?v[dA]=_:delete v[dA]},_=>{w=_},o))),a?.(),b(),h()}catch(V){if(!g?.signal?.aborted)try{let _=i?.(V)??w;clearTimeout(R),R=setTimeout(P,_)}catch(_){b(),S(_)}}});return _P2.apply(this,arguments)}P()})}function PO(e){let t=e.headers.get("content-type");if(!t?.startsWith($h))throw new Error(`Expected content-type to be ${$h}, Actual: ${t}`)}d();c();l();u();var ao=class{constructor(t){Ne(this,"_basePath");Ne(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};var kO=(e,t,r)=>new ao(`${e}/rest/organizations/${t}/machinelearning/streaming/${r}`).href,fA=3,OO=5e3,NO="text/event-stream",Wh=1,Hh=class extends Error{},xu=class extends Error{constructor(r){super(r.message);this.payload=r}},zh=class{constructor(){Ne(this,"timeouts",new Set)}add(t){this.timeouts.add(t)}remove(t){clearTimeout(t),this.timeouts.delete(t)}isActive(t){return this.timeouts.has(t)}},Kl=class{constructor(t){Ne(this,"logger");this.logger=t.logger}streamGeneratedAnswer(t,r){let{url:n,organizationId:o,streamId:a,accessToken:i}=t,{write:p,abort:f,close:m,resetAnswer:h}=r,S=new zh;if(!a){this.logger.error("No stream ID found");return}let v=0,g,C=()=>{g&&!S.isActive(g)&&(R?.abort(),h(),b())},w=()=>{S.remove(g),g=iA(C,g,OO),S.add(g)},R=new s.AbortController,b=()=>Wl(kO(n,o,a),{method:"GET",fetch:x,headers:{Authorization:`Bearer ${i}`,accept:"*/*"},openWhenHidden:!0,signal:R?.signal,onopen(F){return _asyncToGenerator(function*(){if(F.ok&&F.headers.get("content-type")===NO)return;throw F.status>=400&&F.status<500&&F.status!==429?new xu({message:"Error opening stream",code:F.status}):new Hh})()},onmessage:F=>{if(R?.signal.aborted)return;let I=JSON.parse(F.data);if(I.finishReason==="ERROR"){S.remove(g),R?.abort(),f({message:I.errorMessage,code:I.statusCode});return}p(I),v=0,I.finishReason==="COMPLETED"?(S.remove(g),m()):w()},onerror:F=>{if(!R?.signal.aborted){if(S.remove(g),F instanceof xu)throw R?.abort(),f(F),F;if(++v>fA){this.logger.info("Maximum retry exceeded.");let I={message:"Failed to complete stream.",code:Wh};throw R?.abort(),f(I),new xu(I)}this.logger.info(`Retrying...(${v}/${fA})`),h()}}});return b(),R}};d();c();l();u();var wA=kr(AA(),1);d();c();l();u();var W=new Error("Failed to load reducers."),wi=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."}},ea=class extends Error{constructor(r,n){super();Ne(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};d();c();l();u();function CA(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function bA(e){return typeof e!="object"||!e?!1:Object.values(e).every(aN)}function aN(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function RA(e){return e===429}var Or=class e{static call(t){return _asyncToGenerator(function*(){let r=iN(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:a,...i}=o,p=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let f=yield x(a,i);if(RA(f.status))throw f;return f});return function p(){return _ref.apply(this,arguments)}}();try{let f=yield(0,wA.backOff)(p,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(m){let h=m&&RA(m.status);return h&&(n.info("Platform retrying request"),yield new Promise(S=>setTimeout(S,1e3))),h});return function retry(_x4){return _ref2.apply(this,arguments)}}()});switch(f.status){case 419:case 401:throw n.info("Platform renewing token"),new wi;case 404:throw new ea(a,f.status);default:return n.info({response:f,requestInfo:o},"Platform response"),f}}catch(f){return f.message==="Failed to fetch"?new ea(a):f}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:a,requestMetadata:i}=r,{signal:p,...f}=t,m=vu(f);try{let h=yield o(t,n,i);return{...t,...h}}catch(h){a.error(h,"Platform request preprocessing failed. Returning default request options.")}return m})()}};function Ft(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function ct(e,t="prod"){return`${Ft(e,t)}/rest/search/v2`}function Jl(e,t="prod"){return`${Ft(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function iN(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:a,signal:i}=e,p=e.method==="POST"||e.method==="PUT",f=sN(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${a}`,...e.headers},...(p&&{body:f}),signal:i}}function sN(e,t){return t==="application/x-www-form-urlencoded"?bA(e)?CA(e):"":JSON.stringify(e)}d();c();l();u();var Xl=e=>e;d();c();l();u();d();c();l();u();function Fi(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function rr(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:Fi(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:Fi(),extendedResults:{},searchAction:void 0}}d();c();l();u();function io(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...a}=e;return a}var so=e=>{let{response:t}=e;return t.body?cN(e):uN(t)},cN=e=>dN(e)?pN(e):lN(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},uN=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function lN(e){return e.body.statusCode!==void 0}function dN(e){return e.body.exception!==void 0}var pN=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});d();c();l();u();var co=class{constructor(){Ne(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new s.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};d();c();l();u();d();c();l();u();function FA(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}d();c();l();u();var Nn=(e,t,r,n)=>{let o=new ao(`${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 EA=(e,t)=>{let r=new ao(`${e.url}${t}`);return r.addParam("access_token",e.accessToken),r.addParam("organizationId",e.organizationId),r.addParam("uniqueId",e.uniqueId),e.authentication&&r.addParam("authentication",e.authentication),e.q!==void 0&&r.addParam("q",e.q),e.enableNavigation!==void 0&&r.addParam("enableNavigation",`${e.enableNavigation}`),e.requestedOutputSize!==void 0&&r.addParam("requestedOutputSize",`${e.requestedOutputSize}`),r.href},IA=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield Or.call({...Nn(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:io(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=FA(r),o=yield r.arrayBuffer(),i=new TextDecoder(n).decode(o);return fN(i)?{success:i}:{error:so({response:r,body:i})}});return function IA(_x5,_x6){return _ref3.apply(this,arguments)}}();function fN(e){return typeof e=="string"}d();c();l();u();function mN(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function gN(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function Zl(e,t){if(t&&e.name==="AbortError")return{error:gN(e)};if(e instanceof ea)return{error:mN(e)};throw e}var ed=class{constructor(t){this.options=t;Ne(this,"apiCallsQueues",{unknown:new co,mainSearch:new co,facetValues:new co,foldingCollection:new co,instantResults:new co})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield Or.call({...Nn(t,"POST","application/json","/plan"),requestParams:io(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return Zl(r);let n=yield r.json();return yN(n)?{success:n}:{error:so({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Or.call({...Nn(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:io(t),..._this3.options});if(r instanceof Error)return Zl(r);let n=yield r.json(),o={response:r,body:n};return hN(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:so(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(p=>Or.call({...Nn(t,"POST","application/json",""),requestParams:io(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:p??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return Zl(o,r?.disableAbortWarning);let a=yield o.json(),i={response:o,body:a};return TA(a)?(i.body=PA(a),{success:(yield _this4.options.postprocessSearchResponseMiddleware(i)).body}):{error:so(i)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield Or.call({...Nn(t,"POST","application/json","/facet"),requestParams:io(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 Or.call({...Nn(t,"POST","application/json",""),requestParams:io(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(TA(n)){let o={response:r,body:n};return o.body=PA(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:so({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return IA(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield Or.call({...Nn(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return SN(n)?{success:n}:{error:so({response:r,body:n})}})()}},td=e=>e.success!==void 0,ht=e=>e.error!==void 0;function TA(e){return e.results!==void 0}function PA(e){let t=Fi();return ue(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function hN(e){return e.completions!==void 0}function yN(e){return e.preprocessingOutput!==void 0}function SN(e){return e.fields!==void 0}d();c();l();u();var kA=e=>e,OA=e=>e,NA=e=>e;d();c();l();u();d();c();l();u();var z=new M({required:!0,emptyAllowed:!1}),it=new M({required:!1,emptyAllowed:!1}),Ue=new M({required:!0,emptyAllowed:!0}),Jz=new M({required:!1,emptyAllowed:!0}),rd=new ae({each:z,required:!0}),_A=new M({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),DA=new M({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Xz=new M({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),_n=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),lr=(e,t)=>{if("required"in t)return{payload:new ge({value:t}).validate({value:e}).value};let o=new J({options:{required:!0},values:t}).validate(e);if(o)throw new yu(o);return{payload:e}},O=(e,t)=>{try{return lr(e,t)}catch(r){return{payload:e,error:_n(r)}}},ut=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return qA(e,t,r,o,"Controller initialization error")},Be=(e,t,r,n)=>{let o=`Check the options of ${n}`;return qA(e,t,r,o,"Controller initialization error")},qA=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(a){throw e.logger.error(a,o),a}};d();c();l();u();d();c();l();u();d();c();l();u();function Et(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var vN=typeof Symbol=="function"&&Symbol.observable||"@@observable",MA=vN,ny=()=>Math.random().toString(36).substring(7).split("").join("."),xN={INIT:`@@redux/INIT${ny()}`,REPLACE:`@@redux/REPLACE${ny()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ny()}`},nd=xN;function Qr(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 oy(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(oy)(e,t)}let n=e,o=t,a=new Map,i=a,p=0,f=!1;function m(){i===a&&(i=new Map,a.forEach((R,b)=>{i.set(b,R)}))}function h(){if(f)throw new Error(Et(3));return o}function S(R){if(typeof R!="function")throw new Error(Et(4));if(f)throw new Error(Et(5));let b=!0;m();let F=p++;return i.set(F,R),function(){if(b){if(f)throw new Error(Et(6));b=!1,m(),i.delete(F),a=null}}}function v(R){if(!Qr(R))throw new Error(Et(7));if(typeof R.type>"u")throw new Error(Et(8));if(typeof R.type!="string")throw new Error(Et(17));if(f)throw new Error(Et(9));try{f=!0,o=n(o,R)}finally{f=!1}return(a=i).forEach(F=>{F()}),R}function g(R){if(typeof R!="function")throw new Error(Et(10));n=R,v({type:nd.REPLACE})}function C(){let R=S;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(Et(11));function F(){let P=b;P.next&&P.next(h())}return F(),{unsubscribe:R(F)}},[MA](){return this}}}return v({type:nd.INIT}),{dispatch:v,subscribe:S,getState:h,replaceReducer:g,[MA]:C}}function AN(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:nd.INIT})>"u")throw new Error(Et(12));if(typeof r(void 0,{type:nd.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Et(13))})}function Ei(e){let t=Object.keys(e),r={};for(let i=0;i<t.length;i++){let p=t[i];typeof e[p]=="function"&&(r[p]=e[p])}let n=Object.keys(r),o,a;try{AN(r)}catch(i){a=i}return function(p={},f){if(a)throw a;let m=!1,h={};for(let S=0;S<n.length;S++){let v=n[S],g=r[v],C=p[v],w=g(C,f);if(typeof w>"u"){let R=f&&f.type;throw new Error(Et(14))}h[v]=w,m=m||w!==C}return m=m||n.length!==Object.keys(p).length,m?h:p}}function Ii(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function jA(...e){return t=>(r,n)=>{let o=t(r,n),a=()=>{throw new Error(Et(15))},i={getState:o.getState,dispatch:(f,...m)=>a(f,...m)},p=e.map(f=>f(i));return a=Ii(...p)(o.dispatch),{...o,dispatch:a}}}function Ti(e){return Qr(e)&&"type"in e&&typeof e.type=="string"}d();c();l();u();var my=Symbol.for("immer-nothing"),bu=Symbol.for("immer-draftable"),Ht=Symbol.for("immer-state");function It(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Pi=Object.getPrototypeOf;function nr(e){return!!e&&!!e[Ht]}function zt(e){return e?GA(e)||Array.isArray(e)||!!e[bu]||!!e.constructor?.[bu]||ki(e)||Tu(e):!1}var CN=Object.prototype.constructor.toString(),VA=new WeakMap;function GA(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=VA.get(r);return n===void 0&&(n=Function.toString.call(r),VA.set(r,n)),n===CN}function gy(e){return nr(e)||It(15,e),e[Ht].base_}function Ru(e,t,r=!0){ra(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function ra(e){let t=e[Ht];return t?t.type_:Array.isArray(e)?1:ki(e)?2:Tu(e)?3:0}function wu(e,t){return ra(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ay(e,t){return ra(e)===2?e.get(t):e[t]}function $A(e,t,r){let n=ra(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function bN(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ki(e){return e instanceof Map}function Tu(e){return e instanceof Set}function ta(e){return e.copy_||e.base_}function cy(e,t){if(ki(e))return new Map(e);if(Tu(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=GA(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[Ht];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){let i=o[a],p=n[i];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(n[i]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[i]})}return Object.create(Pi(e),n)}else{let n=Pi(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function sd(e,t=!1){return cd(e)||nr(e)||!zt(e)||(ra(e)>1&&Object.defineProperties(e,{set:od,add:od,clear:od,delete:od}),Object.freeze(e),t&&Object.values(e).forEach(r=>sd(r,!0))),e}function RN(){It(2)}var od={value:RN};function cd(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var uy={};function na(e){let t=uy[e];return t||It(0,e),t}function wN(e,t){uy[e]||(uy[e]=t)}var Fu;function HA(){return Fu}function FN(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function LA(e,t){t&&(na("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ly(e){dy(e),e.drafts_.forEach(EN),e.drafts_=null}function dy(e){e===Fu&&(Fu=e.parent_)}function UA(e){return Fu=FN(Fu,e)}function EN(e){let t=e[Ht];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function QA(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[Ht].modified_&&(ly(t),It(4)),zt(e)&&(e=ad(t,e),t.parent_||id(t,e)),t.patches_&&na("Patches").generateReplacementPatches_(r[Ht].base_,e,t.patches_,t.inversePatches_)):e=ad(t,r,[]),ly(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==my?e:void 0}function ad(e,t,r){if(cd(t))return t;let n=e.immer_.shouldUseStrictIteration(),o=t[Ht];if(!o)return Ru(t,(a,i)=>BA(e,o,t,a,i,r),n),t;if(o.scope_!==e)return t;if(!o.modified_)return id(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;let a=o.copy_,i=a,p=!1;o.type_===3&&(i=new Set(a),a.clear(),p=!0),Ru(i,(f,m)=>BA(e,o,a,f,m,r,p),n),id(e,a,!1),r&&e.patches_&&na("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function BA(e,t,r,n,o,a,i){if(o==null||typeof o!="object"&&!i)return;let p=cd(o);if(!(p&&!i)){if(nr(o)){let f=a&&t&&t.type_!==3&&!wu(t.assigned_,n)?a.concat(n):void 0,m=ad(e,o,f);if($A(r,n,m),nr(m))e.canAutoFreeze_=!1;else return}else i&&r.add(o);if(zt(o)&&!p){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===o&&p)return;ad(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(ki(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&id(e,o)}}}function id(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&sd(t,r)}function IN(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:HA(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,a=hy;r&&(o=[n],a=Eu);let{revoke:i,proxy:p}=Proxy.revocable(o,a);return n.draft_=p,n.revoke_=i,p}var hy={get(e,t){if(t===Ht)return e;let r=ta(e);if(!wu(r,t))return TN(e,r,t);let n=r[t];return e.finalized_||!zt(n)?n:n===iy(e.base_,t)?(sy(e),e.copy_[t]=fy(n,e)):n},has(e,t){return t in ta(e)},ownKeys(e){return Reflect.ownKeys(ta(e))},set(e,t,r){let n=zA(ta(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=iy(ta(e),t),a=o?.[Ht];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(bN(r,o)&&(r!==void 0||wu(e.base_,t)))return!0;sy(e),py(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return iy(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,sy(e),py(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=ta(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){It(11)},getPrototypeOf(e){return Pi(e.base_)},setPrototypeOf(){It(12)}},Eu={};Ru(hy,(e,t)=>{Eu[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Eu.deleteProperty=function(e,t){return Eu.set.call(this,e,t,void 0)};Eu.set=function(e,t,r){return hy.set.call(this,e[0],t,r,e[0])};function iy(e,t){let r=e[Ht];return(r?ta(r):e)[t]}function TN(e,t,r){let n=zA(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function zA(e,t){if(!(t in e))return;let r=Pi(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Pi(r)}}function py(e){e.modified_||(e.modified_=!0,e.parent_&&py(e.parent_))}function sy(e){e.copy_||(e.copy_=cy(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var PN=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){let a=r;r=t;let i=this;return function(f=a,...m){return i.produce(f,h=>r.call(this,h,...m))}}typeof r!="function"&&It(6),n!==void 0&&typeof n!="function"&&It(7);let o;if(zt(t)){let a=UA(this),i=fy(t,void 0),p=!0;try{o=r(i),p=!1}finally{p?ly(a):dy(a)}return LA(a,n),QA(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===my&&(o=void 0),this.autoFreeze_&&sd(o,!0),n){let a=[],i=[];na("Patches").generateReplacementPatches_(t,o,a,i),n(a,i)}return o}else It(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(i,...p)=>this.produceWithPatches(i,f=>t(f,...p));let n,o;return[this.produce(t,r,(i,p)=>{n=i,o=p}),n,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){zt(e)||It(8),nr(e)&&(e=WA(e));let t=UA(this),r=fy(e,void 0);return r[Ht].isManual_=!0,dy(t),r}finishDraft(e,t){let r=e&&e[Ht];(!r||!r.isManual_)&&It(9);let{scope_:n}=r;return LA(n,t),QA(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=na("Patches").applyPatches_;return nr(e)?n(e,t):this.produce(e,o=>n(o,t))}};function fy(e,t){let r=ki(e)?na("MapSet").proxyMap_(e,t):Tu(e)?na("MapSet").proxySet_(e,t):IN(e,t);return(t?t.scope_:HA()).drafts_.push(r),r}function WA(e){return nr(e)||It(10,e),KA(e)}function KA(e){if(!zt(e)||cd(e))return e;let t=e[Ht],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=cy(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=cy(e,!0);return Ru(r,(o,a)=>{$A(r,o,KA(a))},n),t&&(t.finalized_=!1),r}function YA(){let t="replace",r="add",n="remove";function o(v,g,C,w){switch(v.type_){case 0:case 2:return i(v,g,C,w);case 1:return a(v,g,C,w);case 3:return p(v,g,C,w)}}function a(v,g,C,w){let{base_:R,assigned_:b}=v,F=v.copy_;F.length<R.length&&([R,F]=[F,R],[C,w]=[w,C]);for(let I=0;I<R.length;I++)if(b[I]&&F[I]!==R[I]){let P=g.concat([I]);C.push({op:t,path:P,value:S(F[I])}),w.push({op:t,path:P,value:S(R[I])})}for(let I=R.length;I<F.length;I++){let P=g.concat([I]);C.push({op:r,path:P,value:S(F[I])})}for(let I=F.length-1;R.length<=I;--I){let P=g.concat([I]);w.push({op:n,path:P})}}function i(v,g,C,w){let{base_:R,copy_:b}=v;Ru(v.assigned_,(F,I)=>{let P=ay(R,F),V=ay(b,F),_=I?wu(R,F)?t:r:n;if(P===V&&_===t)return;let k=g.concat(F);C.push(_===n?{op:_,path:k}:{op:_,path:k,value:V}),w.push(_===r?{op:n,path:k}:_===n?{op:r,path:k,value:S(P)}:{op:t,path:k,value:S(P)})})}function p(v,g,C,w){let{base_:R,copy_:b}=v,F=0;R.forEach(I=>{if(!b.has(I)){let P=g.concat([F]);C.push({op:n,path:P,value:I}),w.unshift({op:r,path:P,value:I})}F++}),F=0,b.forEach(I=>{if(!R.has(I)){let P=g.concat([F]);C.push({op:r,path:P,value:I}),w.unshift({op:n,path:P,value:I})}F++})}function f(v,g,C,w){C.push({op:t,path:[],value:g===my?void 0:g}),w.push({op:t,path:[],value:v})}function m(v,g){return g.forEach(C=>{let{path:w,op:R}=C,b=v;for(let V=0;V<w.length-1;V++){let _=ra(b),k=w[V];typeof k!="string"&&typeof k!="number"&&(k=""+k),(_===0||_===1)&&(k==="__proto__"||k==="constructor")&&It(19),typeof b=="function"&&k==="prototype"&&It(19),b=ay(b,k),typeof b!="object"&&It(18,w.join("/"))}let F=ra(b),I=h(C.value),P=w[w.length-1];switch(R){case t:switch(F){case 2:return b.set(P,I);case 3:It(16);default:return b[P]=I}case r:switch(F){case 1:return P==="-"?b.push(I):b.splice(P,0,I);case 2:return b.set(P,I);case 3:return b.add(I);default:return b[P]=I}case n:switch(F){case 1:return b.splice(P,1);case 2:return b.delete(P);case 3:return b.delete(C.value);default:return delete b[P]}default:It(17,R)}}),v}function h(v){if(!zt(v))return v;if(Array.isArray(v))return v.map(h);if(ki(v))return new Map(Array.from(v.entries()).map(([C,w])=>[C,h(w)]));if(Tu(v))return new Set(Array.from(v).map(h));let g=Object.create(Pi(v));for(let C in v)g[C]=h(v[C]);return wu(v,bu)&&(g[bu]=v[bu]),g}function S(v){return nr(v)?h(v):v}wN("Patches",{applyPatches_:m,generatePatches_:o,generateReplacementPatches_:f})}var Iu=new PN,Dn=Iu.produce,ud=Iu.produceWithPatches.bind(Iu);var yy=Iu.applyPatches.bind(Iu);d();c();l();u();function kN(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ON(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function NN(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 JA=e=>Array.isArray(e)?e:[e];function _N(e){let t=Array.isArray(e[0])?e[0]:e;return NN(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function DN(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var gW=Object.getPrototypeOf({});var qN=class{constructor(e){this.value=e}deref(){return this.value}},MN=typeof WeakRef<"u"?WeakRef:qN,jN=0,XA=1;function ld(){return{s:jN,v:void 0,o:null,p:null}}function Oi(e,t={}){let r=ld(),{resultEqualityCheck:n}=t,o,a=0;function i(){let p=r,{length:f}=arguments;for(let S=0,v=f;S<v;S++){let g=arguments[S];if(typeof g=="function"||typeof g=="object"&&g!==null){let C=p.o;C===null&&(p.o=C=new WeakMap);let w=C.get(g);w===void 0?(p=ld(),C.set(g,p)):p=w}else{let C=p.p;C===null&&(p.p=C=new Map);let w=C.get(g);w===void 0?(p=ld(),C.set(g,p)):p=w}}let m=p,h;if(p.s===XA)h=p.v;else if(h=e.apply(null,arguments),a++,n){let S=o?.deref?.()??o;S!=null&&n(S,h)&&(h=S,a!==0&&a--),o=typeof h=="object"&&h!==null||typeof h=="function"?new MN(h):h}return m.s=XA,m.v=h,h}return i.clearCache=()=>{r=ld(),i.resetResultsCount()},i.resultsCount=()=>a,i.resetResultsCount=()=>{a=0},i}function ZA(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let a=0,i=0,p,f={},m=o.pop();typeof m=="object"&&(f=m,m=o.pop()),kN(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);let h={...r,...f},{memoize:S,memoizeOptions:v=[],argsMemoize:g=Oi,argsMemoizeOptions:C=[],devModeChecks:w={}}=h,R=JA(v),b=JA(C),F=_N(o),I=S(function(){return a++,m.apply(null,arguments)},...R),P=!0,V=g(function(){i++;let k=DN(F,arguments);return p=I.apply(null,k),p},...b);return Object.assign(V,{resultFunc:m,memoizedResultFunc:I,dependencies:F,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>p,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:S,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var Ye=ZA(Oi),VN=Object.assign((e,t=Ye)=>{ON(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((i,p,f)=>(i[r[f]]=p,i),{}))},{withTypes:()=>VN});d();c();l();u();function eC(e){return({dispatch:r,getState:n})=>o=>a=>typeof a=="function"?a(r,n,e):o(a)}var tC=eC(),rC=eC;var LN=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ii:Ii.apply(null,arguments)},NW=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},UN=e=>e&&typeof e.match=="function";function T(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Bt(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=>Ti(n)&&n.type===e,r}var lC=class Pu extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Pu.prototype)}static get[Symbol.species](){return Pu}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Pu(...t[0].concat(this)):new Pu(...t.concat(this))}};function nC(e){return zt(e)?Dn(e,()=>{}):e}function oC(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function QN(e){return typeof e=="boolean"}var BN=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:a=!0}=t??{},i=new lC;return r&&(QN(r)?i.push(tC):i.push(rC(r.extraArgument))),i},ku="RTK_autoBatch",Di=()=>e=>({payload:e,meta:{[ku]:!0}}),aC=e=>t=>{setTimeout(t,e)},GN=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,a=!1,i=!1,p=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:aC(10):e.type==="callback"?e.queueNotification:aC(e.timeout),m=()=>{i=!1,a&&(a=!1,p.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let S=()=>o&&h(),v=n.subscribe(S);return p.add(h),()=>{v(),p.delete(h)}},dispatch(h){try{return o=!h?.meta?.[ku],a=!o,a&&(i||(i=!0,f(m))),n.dispatch(h)}finally{o=!0}}})},$N=e=>function(r){let{autoBatch:n=!0}=r??{},o=new lC(e);return n&&o.push(GN(typeof n=="object"?n:void 0)),o};function dC(e){let t=BN(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:a=void 0,enhancers:i=void 0}=e||{},p;if(typeof r=="function")p=r;else if(Qr(r))p=Ei(r);else throw new Error(Bt(1));let f;typeof n=="function"?f=n(t):f=t();let m=Ii;o&&(m=LN({trace:!1,...(typeof o=="object"&&o)}));let h=jA(...f),S=$N(h),v=typeof i=="function"?i(S):S(),g=m(...v);return oy(p,a,g)}function pC(e){let t={},r=[],n,o={addCase(a,i){let p=typeof a=="string"?a:a.type;if(!p)throw new Error(Bt(28));if(p in t)throw new Error(Bt(29));return t[p]=i,o},addMatcher(a,i){return r.push({matcher:a,reducer:i}),o},addDefaultCase(a){return n=a,o}};return e(o),[t,r,n]}function HN(e){return typeof e=="function"}function oe(e,t){let[r,n,o]=pC(t),a;if(HN(e))a=()=>nC(e());else{let p=nC(e);a=()=>p}function i(p=a(),f){let m=[r[f.type],...n.filter(({matcher:h})=>h(f)).map(({reducer:h})=>h)];return m.filter(h=>!!h).length===0&&(m=[o]),m.reduce((h,S)=>{if(S)if(nr(h)){let g=S(h,f);return g===void 0?h:g}else{if(zt(h))return Dn(h,v=>S(v,f));{let v=S(h,f);if(v===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return h},p)}return i.getInitialState=a,i}var fC=(e,t)=>UN(e)?e.match(t):e(t);function Br(...e){return t=>e.some(r=>fC(r,t))}function _i(...e){return t=>e.every(r=>fC(r,t))}function md(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 Ou(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function gd(...e){return e.length===0?t=>md(t,["pending"]):Ou(e)?Br(...e.map(t=>t.pending)):gd()(e[0])}function ia(...e){return e.length===0?t=>md(t,["rejected"]):Ou(e)?Br(...e.map(t=>t.rejected)):ia()(e[0])}function Nu(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?_i(ia(...e),t):Ou(e)?_i(ia(...e),t):Nu()(e[0])}function qn(...e){return e.length===0?t=>md(t,["fulfilled"]):Ou(e)?Br(...e.map(t=>t.fulfilled)):qn()(e[0])}function hd(...e){return e.length===0?t=>md(t,["pending","fulfilled","rejected"]):Ou(e)?Br(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):hd()(e[0])}var zN="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",_u=(e=21)=>{let t="",r=e;for(;r--;)t+=zN[Math.random()*64|0];return t},WN=["name","message","stack","code"],Sy=class{constructor(e,t){Ne(this,"_type");this.payload=e,this.meta=t}},iC=class{constructor(e,t){Ne(this,"_type");this.payload=e,this.meta=t}},KN=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of WN)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},Se=(()=>{function e(t,r,n){let o=T(t+"/fulfilled",(f,m,h,S)=>({payload:f,meta:{...(S||{}),arg:h,requestId:m,requestStatus:"fulfilled"}})),a=T(t+"/pending",(f,m,h)=>({payload:void 0,meta:{...(h||{}),arg:m,requestId:f,requestStatus:"pending"}})),i=T(t+"/rejected",(f,m,h,S,v)=>({payload:S,error:(n&&n.serializeError||KN)(f||"Rejected"),meta:{...(v||{}),arg:h,requestId:m,rejectedWithValue:!!S,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function p(f){return(m,h,S)=>{let v=n?.idGenerator?n.idGenerator(f):_u(),g=new s.AbortController,C,w;function R(F){w=F,g.abort()}let b=_asyncToGenerator(function*(){let F;try{let P=n?.condition?.(f,{getState:h,extra:S});if(JN(P)&&(P=yield P),P===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let V=new Promise((_,k)=>{C=()=>{k({name:"AbortError",message:w||"Aborted"})},g.signal.addEventListener("abort",C)});m(a(v,f,n?.getPendingMeta?.({requestId:v,arg:f},{getState:h,extra:S}))),F=yield Promise.race([V,Promise.resolve(r(f,{dispatch:m,getState:h,extra:S,requestId:v,signal:g.signal,abort:R,rejectWithValue:(_,k)=>new Sy(_,k),fulfillWithValue:(_,k)=>new iC(_,k)})).then(_=>{if(_ instanceof Sy)throw _;return _ instanceof iC?o(_.payload,v,f,_.meta):o(_,v,f)})])}catch(P){F=P instanceof Sy?i(null,v,f,P.payload,P.meta):i(P,v,f)}finally{C&&g.signal.removeEventListener("abort",C)}return n&&!n.dispatchConditionRejection&&i.match(F)&&F.meta.condition||m(F),F})();return Object.assign(b,{abort:R,requestId:v,arg:f,unwrap(){return b.then(YN)}})}}return Object.assign(p,{pending:a,rejected:i,fulfilled:o,settled:Br(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function YN(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function JN(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var mC=Symbol.for("rtk-slice-createasyncthunk"),jW={[mC]:Se};function XN(e,t){return`${e}/${t}`}function ZN({creators:e}={}){let t=e?.asyncThunk?.[mC];return function(n){let{name:o,reducerPath:a=o}=n;if(!o)throw new Error(Bt(11));typeof process<"u";let i=(typeof n.reducers=="function"?n.reducers(t_()):n.reducers)||{},p=Object.keys(i),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(F,I){let P=typeof F=="string"?F:F.type;if(!P)throw new Error(Bt(12));if(P in f.sliceCaseReducersByType)throw new Error(Bt(13));return f.sliceCaseReducersByType[P]=I,m},addMatcher(F,I){return f.sliceMatchers.push({matcher:F,reducer:I}),m},exposeAction(F,I){return f.actionCreators[F]=I,m},exposeCaseReducer(F,I){return f.sliceCaseReducersByName[F]=I,m}};p.forEach(F=>{let I=i[F],P={reducerName:F,type:XN(o,F),createNotation:typeof n.reducers=="function"};n_(I)?a_(P,I,m,t):r_(P,I,m)});function h(){let[F={},I=[],P=void 0]=typeof n.extraReducers=="function"?pC(n.extraReducers):[n.extraReducers],V={...F,...f.sliceCaseReducersByType};return oe(n.initialState,_=>{for(let k in V)_.addCase(k,V[k]);for(let k of f.sliceMatchers)_.addMatcher(k.matcher,k.reducer);for(let k of I)_.addMatcher(k.matcher,k.reducer);P&&_.addDefaultCase(P)})}let S=F=>F,v=new Map,g;function C(F,I){return g||(g=h()),g(F,I)}function w(){return g||(g=h()),g.getInitialState()}function R(F,I=!1){function P(_){let k=_[F];return typeof k>"u"&&I&&(k=w()),k}function V(_=S){let k=oC(v,I,()=>new WeakMap);return oC(k,_,()=>{let N={};for(let[q,U]of Object.entries(n.selectors??{}))N[q]=e_(U,_,w,I);return N})}return{reducerPath:F,getSelectors:V,get selectors(){return V(P)},selectSlice:P}}let b={name:o,reducer:C,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:w,...R(a),injectInto(F,{reducerPath:I,...P}={}){let V=I??a;return F.inject({reducerPath:V,reducer:C},P),{...b,...R(V,!0)}}};return b}}function e_(e,t,r,n){function o(a,...i){let p=t(a);return typeof p>"u"&&n&&(p=r()),e(p,...i)}return o.unwrapped=e,o}var sa=ZN();function t_(){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 r_({type:e,reducerName:t,createNotation:r},n,o){let a,i;if("reducer"in n){if(r&&!o_(n))throw new Error(Bt(17));a=n.reducer,i=n.prepare}else a=n;o.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,i?T(e,i):T(e))}function n_(e){return e._reducerDefinitionType==="asyncThunk"}function o_(e){return e._reducerDefinitionType==="reducerWithPrepare"}function a_({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Bt(18));let{payloadCreator:a,fulfilled:i,pending:p,rejected:f,settled:m,options:h}=r,S=o(e,a,h);n.exposeAction(t,S),i&&n.addCase(S.fulfilled,i),p&&n.addCase(S.pending,p),f&&n.addCase(S.rejected,f),m&&n.addMatcher(S.settled,m),n.exposeCaseReducer(t,{fulfilled:i||dd,pending:p||dd,rejected:f||dd,settled:m||dd})}function dd(){}var i_="task",gC="listener",hC="completed",Ay="cancelled",s_=`task-${Ay}`,c_=`task-${hC}`,vy=`${gC}-${Ay}`,u_=`${gC}-${hC}`,yd=class{constructor(e){Ne(this,"name","TaskAbortError");Ne(this,"message");this.code=e,this.message=`${i_} ${Ay} (reason: ${e})`}},Cy=(e,t)=>{if(typeof e!="function")throw new TypeError(Bt(32))},pd=()=>{},yC=(e,t=pd)=>(e.catch(t),e),SC=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),oa=(e,t)=>{let r=e.signal;r.aborted||("reason"in r||Object.defineProperty(r,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},aa=e=>{if(e.aborted){let{reason:t}=e;throw new yd(t)}};function vC(e,t){let r=pd;return new Promise((n,o)=>{let a=()=>o(new yd(e.reason));if(e.aborted){a();return}r=SC(e,a),t.finally(()=>r()).then(n,o)}).finally(()=>{r=pd})}var l_=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof yd?"cancelled":"rejected",error:r}}finally{t?.()}});return function l_(_x7,_x8){return _ref5.apply(this,arguments)}}(),fd=e=>t=>yC(vC(e,t).then(r=>(aa(e),r))),xC=e=>{let t=fd(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Ni}=Object,sC={},Sd="listenerMiddleware",d_=(e,t)=>{let r=n=>SC(e,()=>oa(n,e.reason));return(n,o)=>{Cy(n,"taskExecutor");let a=new s.AbortController;r(a);let i=l_(/*#__PURE__*/_asyncToGenerator(function*(){aa(e),aa(a.signal);let p=yield n({pause:fd(a.signal),delay:xC(a.signal),signal:a.signal});return aa(a.signal),p}),()=>oa(a,c_));return o?.autoJoin&&t.push(i.catch(pd)),{result:fd(e)(i),cancel(){oa(a,s_)}}}},p_=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){aa(t);let a=()=>{},p=[new Promise((f,m)=>{let h=e({predicate:n,effect:(S,v)=>{v.unsubscribe(),f([S,v.getState(),v.getOriginalState()])}});a=()=>{h(),m()}})];o!=null&&p.push(new Promise(f=>setTimeout(f,o,null)));try{let f=yield vC(t,Promise.race(p));return aa(t),f}finally{a()}});return function r(_x9,_x0){return _ref7.apply(this,arguments)}}();return(n,o)=>yC(r(n,o))},AC=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:a}=e;if(t)o=T(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(Bt(21));return Cy(a,"options.listener"),{predicate:o,type:t,effect:a}},CC=Ni(e=>{let{type:t,predicate:r,effect:n}=AC(e);return{id:_u(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Bt(22))}}},{withTypes:()=>CC}),cC=(e,t)=>{let{type:r,effect:n,predicate:o}=AC(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===o)&&a.effect===n)},xy=e=>{e.pending.forEach(t=>{oa(t,vy)})},f_=e=>()=>{e.forEach(xy),e.clear()},uC=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},bC=Ni(T(`${Sd}/add`),{withTypes:()=>bC}),m_=T(`${Sd}/removeAll`),RC=Ni(T(`${Sd}/remove`),{withTypes:()=>RC}),g_=(...e)=>{console.error(`${Sd}/error`,...e)},wC=(e={})=>{let t=new Map,{extra:r,onError:n=g_}=e;Cy(n,"onError");let o=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),S=>{h.unsubscribe(),S?.cancelActive&&xy(h)}),a=h=>{let S=cC(t,h)??CC(h);return o(S)};Ni(a,{withTypes:()=>a});let i=h=>{let S=cC(t,h);return S&&(S.unsubscribe(),h.cancelActive&&xy(S)),!!S};Ni(i,{withTypes:()=>i});let p=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(h,S,v,g){let C=new s.AbortController,w=p_(a,C.signal),R=[];try{h.pending.add(C),yield Promise.resolve(h.effect(S,Ni({},v,{getOriginalState:g,condition:(b,F)=>w(b,F).then(Boolean),take:w,delay:xC(C.signal),pause:fd(C.signal),extra:r,signal:C.signal,fork:d_(C.signal,R),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((b,F,I)=>{b!==C&&(oa(b,vy),I.delete(b))})},cancel:()=>{oa(C,vy),h.pending.delete(C)},throwIfCancelled:()=>{aa(C.signal)}})))}catch(b){b instanceof yd||uC(n,b,{raisedBy:"effect"})}finally{yield Promise.all(R),oa(C,u_),h.pending.delete(C)}});return function p(_x1,_x10,_x11,_x12){return _ref8.apply(this,arguments)}}(),f=f_(t);return{middleware:h=>S=>v=>{if(!Ti(v))return S(v);if(bC.match(v))return a(v.payload);if(m_.match(v)){f();return}if(RC.match(v))return i(v.payload);let g=h.getState(),C=()=>{if(g===sC)throw new Error(Bt(23));return g},w;try{if(w=S(v),t.size>0){let R=h.getState(),b=Array.from(t.values());for(let F of b){let I=!1;try{I=F.predicate(v,R,g)}catch(P){I=!1,uC(n,P,{raisedBy:"predicate"})}I&&p(F,v,h,C)}}}finally{g=sC}return w},startListening:a,stopListening:i,clearListeners:f}};function Bt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}d();c();l();u();d();c();l();u();d();c();l();u();function FC(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}d();c();l();u();d();c();l();u();d();c();l();u();var EC=/^(?:[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 h_(e){return typeof e=="string"&&EC.test(e)}var by=h_;d();c();l();u();var Tt=[];for(let e=0;e<256;++e)Tt.push((e+256).toString(16).slice(1));function IC(e,t=0){return(Tt[e[t+0]]+Tt[e[t+1]]+Tt[e[t+2]]+Tt[e[t+3]]+"-"+Tt[e[t+4]]+Tt[e[t+5]]+"-"+Tt[e[t+6]]+Tt[e[t+7]]+"-"+Tt[e[t+8]]+Tt[e[t+9]]+"-"+Tt[e[t+10]]+Tt[e[t+11]]+Tt[e[t+12]]+Tt[e[t+13]]+Tt[e[t+14]]+Tt[e[t+15]]).toLowerCase()}d();c();l();u();var Ry,y_=new Uint8Array(16);function wy(){if(!Ry){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ry=crypto.getRandomValues.bind(crypto)}return Ry(y_)}d();c();l();u();d();c();l();u();var S_=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Fy={randomUUID:S_};function v_(e,t,r){e=e||{};let n=e.random??e.rng?.()??wy();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 IC(n)}function x_(e,t,r){return Fy.randomUUID&&!t&&!e?Fy.randomUUID():v_(e,t,r)}var Ey=x_;function A_(_x13){return _A_.apply(this,arguments)}function _A_(){_A_=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:a,mode:i}=e;if(i!=="disabled")return n.call(r),t.send(o,a,r)});return _A_.apply(this,arguments)}var _C="2.0.4",Iy=128,DC=192,TC=224,PC=240,C_=248;function b_(e){return(e&C_)===PC?4:(e&PC)===TC?3:(e&TC)===DC?2:1}function R_(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&Iy)!=Iy)break;if(r-=3,(n&DC)!=Iy){t-r>=b_(n)*3&&(r=t);break}}return e.substring(0,r)}function w_(e){let{trackingId:t}=e;return{trackingId:t}}function F_(e){return(e.source||[]).concat([`relay@${_C}`])}function qC(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:a}=r,i=w_(t),p=r.getClientId();return Object.freeze({type:e,config:i,ts:Date.now(),source:F_(t),clientId:p,userAgent:a(),referrer:kC(n()),location:kC(o())})}function kC(e){return e!==null?R_(e,1024):null}function E_(e,t,r,n){return{...t,meta:qC(e,r,n)}}var I_="*";function T_(){let e=[];function t({type:f,callback:m}){return e.findIndex(h=>h.type===f&&h.callback===m)}function r(f,m){return f.type==="*"||m===f.type}function n(f){return t(f)<0&&e.push(f),()=>p(f.type,f.callback)}function o(f){e.forEach(m=>{if(r(m,f.meta.type))try{m.callback(f)}catch(h){console.error(h)}})}function a(f){if(f===I_)e.length=0;else for(let m=e.length-1;m>=0;m--)e[m].type===f&&e.splice(m,1)}function i(f){let m=t(f);m>=0&&e.splice(m,1)}function p(f,m){m?i({type:f,callback:m}):a(f)}return{add:n,call:o,remove:p}}function OC({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 P_(e){let t=OC(e);return{get:()=>t,update:r=>{t=OC({...t,...r})}}}var Ty=k_();function k_(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let a of o){let i=a.replace(/^\s+/,"");if(i.lastIndexOf(n,0)===0)return i.substring(n.length,i.length)}return null},setItem(r,n,o){let a=t(window.location.hostname),i=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,p=a?`;domain=${a}`:"";document.cookie=`${e}${r}=${n}${i}${p};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function O_(){return{getItem(e){return Ty.getItem(e)||localStorage.getItem(e)},removeItem(e){Ty.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Ty.setItem(e,t,31556952e3)}}}var NC="visitorId";function N_(){let e=document.referrer;return e===""?null:e}function Py(){let e=O_();return{runtime:"browser",send:function(){var _ref9=_asyncToGenerator(function*(t,r,n){let o=x(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});FC().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let i=yield o;if(i?.ok){let p;try{p=yield i.json()}catch{return}for(let f of p.events)if(!f.accepted)throw new Error(`Received event was rejected for processing: ${f.errorMessage}`)}else throw new Error(`Error ${i.status}: Failed to send the event(s).`)});return function send(_x14,_x15,_x16){return _ref9.apply(this,arguments)}}(),getReferrer:()=>N_(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(NC);if(t&&by(t))return t;let r=Ey();return e.setItem(NC,r),r}}}function __(){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 D_(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function q_(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=D_();return t&&r?{...r,runtime:"custom"}:t&&M_()&&__()?Py():n}function M_(){try{return typeof window=="object"}catch{return!1}}function j_(e){return{get:()=>Object.freeze(q_(e))}}function MC(e){let t=P_(e),r=T_(),n=j_(t);return{emit:function(){var _ref0=_asyncToGenerator(function*(o,a){let i=t.get(),p=n.get(),f=E_(o,a,i,p);return A_({config:i,environment:p,event:f,listenerManager:r})});return function emit(_x17,_x18){return _ref0.apply(this,arguments)}}(),getMeta:o=>qC(o,t.get(),n.get()),on:(o,a)=>r.add({type:o,callback:a}),off:(o,a)=>r.remove(o,a),updateConfig:o=>t.update(o),version:_C}}d();c();l();u();function jC(){return typeof window<"u"&&typeof document<"u"}d();c();l();u();d();c();l();u();var uo="3.47.2",VC=["@coveo/atomic","@coveo/quantic"];var qi=Ye(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${uo}`));var Du=Ye(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>qi(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:a},i,p)=>{let f=L_(p);return MC({mode:a?"emit":"disabled",url:o??Jl(e,t),token:r,trackingId:n??null,source:i,environment:f})}),V_={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref1=_asyncToGenerator(function*(){});return function send(){return _ref1.apply(this,arguments)}}()},L_=e=>{if(!e)return;let t=e();return{...(jC()?Py():V_),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};d();c();l();u();d();c();l();u();function Mn(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 j(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(h){try{m(n.next(h))}catch(S){i(S)}}function f(h){try{m(n.throw(h))}catch(S){i(S)}}function m(h){h.done?a(h.value):o(h.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}var Te;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(Te||(Te={}));function Ny(){return typeof window<"u"}function Hy(){return typeof navigator<"u"}function Mi(){return typeof document<"u"}function _y(){try{return typeof localStorage<"u"}catch{return!1}}function U_(){try{return typeof sessionStorage<"u"}catch{return!1}}function ZC(){return Hy()&&navigator.cookieEnabled}var Q_=[Te.click,Te.custom,Te.search,Te.view],B_=(e,t)=>Q_.indexOf(e)!==-1?Object.assign({language:Mi()?document.documentElement.lang:"unknown",userAgent:Hy()?navigator.userAgent:"unknown"},t):t,Mu=class e{static set(t,r,n){var o,a,i,p;n&&(a=new Date,a.setTime(a.getTime()+n)),p=window.location.hostname,p.indexOf(".")===-1?LC(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],LC(t,r,a,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function LC(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function G_(){return _y()?localStorage:ZC()?new ju:U_()?sessionStorage:new Vi}var ju=class e{getItem(t){return Mu.get(`${e.prefix}${t}`)}removeItem(t){Mu.erase(`${e.prefix}${t}`)}setItem(t,r,n){Mu.set(`${e.prefix}${t}`,r,n)}};ju.prefix="coveo_";var Dy=class{constructor(){this.cookieStorage=new ju}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)}},Vi=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},vd="__coveo.analytics.history",$_=20,H_=1e3*60,z_=75,Cd=class{constructor(t){this.store=t||G_()}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 j(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 j(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(vd);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return j(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(vd);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(vd,JSON.stringify(t.slice(0,$_)))}catch{}}clear(){try{this.store.removeItem(vd)}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,z_)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>H_:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var W_=(e,t)=>j(void 0,void 0,void 0,function*(){return e===Te.view?(yield K_(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),K_=e=>j(void 0,void 0,void 0,function*(){let t=new Cd,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),xd,Y_=new Uint8Array(16);function J_(){if(!xd&&(xd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!xd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xd(Y_)}var X_=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function bd(e){return typeof e=="string"&&X_.test(e)}var Pt=[];for(let e=0;e<256;++e)Pt.push((e+256).toString(16).slice(1));function eb(e,t=0){return Pt[e[t+0]]+Pt[e[t+1]]+Pt[e[t+2]]+Pt[e[t+3]]+"-"+Pt[e[t+4]]+Pt[e[t+5]]+"-"+Pt[e[t+6]]+Pt[e[t+7]]+"-"+Pt[e[t+8]]+Pt[e[t+9]]+"-"+Pt[e[t+10]]+Pt[e[t+11]]+Pt[e[t+12]]+Pt[e[t+13]]+Pt[e[t+14]]+Pt[e[t+15]]}function Z_(e){if(!bd(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}function e0(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var t0="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r0="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function n0(e,t,r){function n(o,a,i,p){var f;if(typeof o=="string"&&(o=e0(o)),typeof a=="string"&&(a=Z_(a)),((f=a)===null||f===void 0?void 0:f.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let m=new Uint8Array(16+o.length);if(m.set(a),m.set(o,a.length),m=r(m),m[6]=m[6]&15|t,m[8]=m[8]&63|128,i){p=p||0;for(let h=0;h<16;++h)i[p+h]=m[h];return i}return eb(m)}try{n.name=e}catch{}return n.DNS=t0,n.URL=r0,n}var o0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),UC={randomUUID:o0};function ca(e,t,r){if(UC.randomUUID&&!t&&!e)return UC.randomUUID();e=e||{};let n=e.random||(e.rng||J_)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return eb(n)}function a0(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 ky(e,t){return e<<t|e>>>32-t}function i0(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let i=unescape(encodeURIComponent(e));e=[];for(let p=0;p<i.length;++p)e.push(i.charCodeAt(p))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let i=0;i<o;++i){let p=new Uint32Array(16);for(let f=0;f<16;++f)p[f]=e[i*64+f*4]<<24|e[i*64+f*4+1]<<16|e[i*64+f*4+2]<<8|e[i*64+f*4+3];a[i]=p}a[o-1][14]=(e.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(e.length-1)*8&4294967295;for(let i=0;i<o;++i){let p=new Uint32Array(80);for(let g=0;g<16;++g)p[g]=a[i][g];for(let g=16;g<80;++g)p[g]=ky(p[g-3]^p[g-8]^p[g-14]^p[g-16],1);let f=r[0],m=r[1],h=r[2],S=r[3],v=r[4];for(let g=0;g<80;++g){let C=Math.floor(g/20),w=ky(f,5)+a0(C,m,h,S)+v+t[C]+p[g]>>>0;v=S,S=h,h=ky(m,30)>>>0,m=f,f=w}r[0]=r[0]+f>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+h>>>0,r[3]=r[3]+S>>>0,r[4]=r[4]+v>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var s0=n0("v5",80,i0),QC=s0,tb="2.30.52",BC=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,qu={pageview:"pageview",event:"event"},Rd=class{constructor({client:t,uuidGenerator:r=ca}){this.client=t,this.uuidGenerator=r}},qy=class extends Rd{constructor({client:t,uuidGenerator:r=ca}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=BC(window.location),this.lastReferrer=Mi()?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:Mi()?document.title:"",encoding:Mi()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},a={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},a),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:a}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=a,t===qu.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===qu.pageview?this.nextPageViewId:this.pageViewId,referrer:t===qu.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===qu.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 BC(window.location)}},lo=class e{constructor(t,r){if(!bd(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let a=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return bd(a)?new e(a,Number.parseInt(o)*1e3):null}};lo.cvo_cid="cvo_cid";lo.expirationTime=120;var My=class extends Rd{constructor({client:t,uuidGenerator:r=ca}){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 j(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(lo.cvo_cid,new lo(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};My.Id="link";var pr=Object.keys;function Ad(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var Oy=128,rb=192,GC=224,$C=240;function c0(e){return(e&248)===$C?4:(e&$C)===GC?3:(e&GC)===rb?2:1}function u0(e,t){if(t<0||e.length<=t)return e;let r=e.indexOf("%",t-2);for(r<0||r>t?r=t:t=r;r>2&&e.charAt(r-3)=="%";){let n=Number.parseInt(e.substring(r-2,r),16);if((n&Oy)!=Oy)break;if(r-=3,(n&rb)!=Oy){t-r>=c0(n)*3&&(r=t);break}}return e.substring(0,r)}var jy={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"},l0=pr(jy).map(e=>jy[e]),d0=[...l0].join("|"),p0=new RegExp(`^(${d0}$)`),f0={svcAction:"svc_action",svcActionData:"svc_action_data"},m0=e=>pr(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=jy[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),g0=e=>p0.test(e),h0=[g0],HC={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},zC={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},_t={action:"pa",list:"pal",listSource:"pls"},wd={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},y0=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Vy={id:"quoteId",affiliation:"quoteAffiliation"},Ly={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},S0={add:_t,bookmark_add:_t,bookmark_remove:_t,click:_t,checkout:_t,checkout_option:_t,detail:_t,impression:_t,remove:_t,refund:Object.assign(Object.assign({},_t),wd),purchase:Object.assign(Object.assign({},_t),wd),quickview:_t,quote:Object.assign(Object.assign({},_t),Vy),review:Object.assign(Object.assign({},_t),Ly)},v0=pr(HC).map(e=>HC[e]),x0=pr(zC).map(e=>zC[e]),A0=pr(_t).map(e=>_t[e]),C0=pr(wd).map(e=>wd[e]),b0=pr(Ly).map(e=>Ly[e]),R0=pr(Vy).map(e=>Vy[e]),w0=[...v0,"custom"].join("|"),F0=[...x0,"custom"].join("|"),nb="(pr[0-9]+)",ob="(il[0-9]+pi[0-9]+)",E0=new RegExp(`^${nb}(${w0})$`),I0=new RegExp(`^(${ob}(${F0}))|(il[0-9]+nm)$`),T0=new RegExp(`^(${A0.join("|")})$`),P0=new RegExp(`^(${C0.join("|")})$`),k0=new RegExp(`^${nb}custom$`),O0=new RegExp(`^${ob}custom$`),N0=new RegExp(`^(${[...y0,...b0,...R0].join("|")})$`),_0=e=>E0.test(e),D0=e=>I0.test(e),q0=e=>T0.test(e),M0=e=>P0.test(e),j0=e=>N0.test(e),V0=[D0,_0,q0,M0,j0],L0=[k0,O0],U0={anonymizeIp:"aip"},Q0={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},B0={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},G0=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],$0=Object.assign(Object.assign(Object.assign(Object.assign({},U0),Q0),B0),G0.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Uy=Object.assign(Object.assign({},$0),f0),H0=e=>{let t=!!e.action&&S0[e.action]||{};return pr(e).reduce((r,n)=>{let o=t[n]||Uy[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},z0=pr(Uy).map(e=>Uy[e]),W0=e=>z0.indexOf(e)!==-1,K0=e=>e==="custom",Y0=e=>[...V0,...h0,W0,K0].some(t=>t(e)),J0=e=>pr(e).reduce((t,r)=>{let n=X0(r);return n?Object.assign(Object.assign({},t),Z0(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),X0=e=>{let t;return[...L0].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},Z0=(e,t)=>pr(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),Qy=class{constructor(t){this.opts=t}sendEvent(t,r){return j(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,a=yield this.getQueryParamsForEventType(t),{url:i,payload:p}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${a}`,r,o),f=this.encodeForEventType(t,p),m=new Blob([f],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(i,m)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return j(this,void 0,void 0,function*(){let o=t,a=r;if(n){let i=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:p,body:f}=i;o=p||t;try{a=JSON.parse(f)}catch(m){console.error("Unable to process the request body as a JSON string",m)}}return{payload:a,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return j(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(a=>!!a).join("&")})}isEventTypeLegacy(t){return[Te.click,Te.custom,Te.search,Te.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}},By=class{sendEvent(t,r){return j(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return j(this,void 0,void 0,function*(){return Promise.resolve()})}},WC=y.fetch,Fd=class{constructor(t){this.opts=t}sendEvent(t,r){return j(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:a}=this.opts,i=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",p={url:`${n}/analytics/${t}${i}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},f=Object.assign(Object.assign({},p),a?yield a(p,"analyticsFetch"):{}),{url:m}=f,h=Mn(f,["url"]),S;try{S=yield WC(m,h)}catch(v){console.error("An error has occured when sending the event.",v);return}if(S.ok){let v=yield S.json();return v.visitorId&&o.setCurrentVisitorId(v.visitorId),v}else{try{S.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,S,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return j(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield WC(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[Te.click,Te.custom,Te.search,Te.view].indexOf(t)!==-1}getVisitorIdParam(){return j(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"})}},Gy=class{constructor(t,r){_y()&&ZC()?this.storage=new Dy:_y()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new Vi),this.client=new Fd(t),this.beaconClient=new Qy(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:a}of n)this.beaconClient.sendEvent(o,a)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},$y=class{constructor(t,r){this.storage=r||new Vi,this.client=new Fd(t)}getClientDependingOnEventType(t){return this.client}},Ed=class{constructor(){this.storage=new Vi,this.client=new By}getClientDependingOnEventType(t){return this.client}},eD="xx",tD=e=>e?.startsWith(eD)||!1,rD=`
|
|
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 nD(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var oD=["1",1,"yes",!0];function wd(){let e=[];return Ry()&&e.push(window.doNotTrack),My()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>oD.indexOf(t)!==-1)}var JC="v15",XC={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function aD(e=XC.default,t=JC,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 iD="38824e1f-37f5-42d3-8372-a4b8fa9df946",Gr=class{get defaultOptions(){return{endpoint:XC.default,isCustomEndpoint:!1,token:"",version:JC,beforeSendHooks:[],afterSendHooks:[]}}get version(){return zC}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=[W_,B_].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};wd()?this.runtime=new Rd:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(Te.view,{newEventType:Te.view,addClientIdParameter:!0}),this.addEventTypeMapping(Te.click,{newEventType:Te.click,addClientIdParameter:!0}),this.addEventTypeMapping(Te.custom,{newEventType:Te.custom,addClientIdParameter:!0}),this.addEventTypeMapping(Te.search,{newEventType:Te.search,addClientIdParameter:!0})}initRuntime(t){return Ry()&&_i()?new Dy(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(nD()&&console.warn(rD),new qy(t))}get storage(){return this.runtime.storage}determineVisitorId(){return V(this,void 0,void 0,function*(){try{return Ry()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||ca()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),ca()}})}getCurrentVisitorId(){return V(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return V(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return V(this,void 0,void 0,function*(){if(xd(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(_C(t,_C(r,iD)))}})}getParameters(t,...r){return V(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return V(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(ca()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(wd())return null;try{let r=new URL(t).searchParams.get(lo.cvo_cid);if(r==null)return null;let n=lo.fromString(r);return!n||!_i()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return V(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:a=!1,addClientIdParameter:i=!1}=this.eventTypeMapping[t]||{};return yield[h=>n.length>0?this.parseVariableArgumentsPayload(n,h):h[0],h=>V(this,void 0,void 0,function*(){return Object.assign(Object.assign({},h),{visitorId:o?yield this.getCurrentVisitorId():""})}),h=>V(this,void 0,void 0,function*(){return i?Object.assign(Object.assign({},h),{clientId:yield this.getCurrentVisitorId()}):h}),h=>a?this.ensureAnonymousUserWhenUsingApiKey(h):h,h=>this.beforeSendHooks.reduce((C,w)=>V(this,void 0,void 0,function*(){let R=yield C;return yield w(t,R)}),h)].reduce((h,C)=>V(this,void 0,void 0,function*(){let w=yield h;return yield C(w)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return V(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[S=>this.setTrackingIdIfTrackingIdNotPresent(S),S=>this.removeEmptyPayloadValues(S,t),S=>this.validateParams(S,t),S=>n?H0(S):S,S=>n?this.removeUnknownParameters(S):S,S=>n?this.processCustomParameters(S):this.mapCustomParametersToCustomData(S)].reduce((S,A)=>V(this,void 0,void 0,function*(){let h=yield S;return yield A(h)}),Promise.resolve(r))})}makeEvent(t,...r){return V(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),a=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:a,log:i=>V(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},a),i)}),yield Promise.all(this.afterSendHooks.map(p=>p(t,Object.assign(Object.assign({},o),i)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return V(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return V(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 vd().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return V(this,void 0,void 0,function*(){return this.makeEvent(Te.search,t)})}sendSearchEvent(t){return V(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Mn(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return V(this,void 0,void 0,function*(){return this.makeEvent(Te.click,t)})}sendClickEvent(t){return V(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Mn(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return V(this,void 0,void 0,function*(){return this.makeEvent(Te.custom,t)})}sendCustomEvent(t){return V(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=Mn(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return V(this,void 0,void 0,function*(){return this.makeEvent(Te.view,t)})}sendViewEvent(t){return V(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return V(this,void 0,void 0,function*(){let r=yield(yield v(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return V(this,void 0,void 0,function*(){return yield(yield v(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,a=r.length;o<a;o++){let i=r[o];if(typeof i=="string")n[t[o]]=i;else if(typeof i=="object")return Object.assign(Object.assign({},n),i)}return n}isKeyAllowedEmpty(t,r){return({[Te.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,a)=>Object.assign(Object.assign({},o),{[a]:t[a]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(Y0(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=Mn(t,["custom"]),o={};r&&Sd(r)&&(o=this.lowercaseKeys(r));let a=J0(n);return Object.assign(Object.assign({},o),a)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=Mn(t,["custom"]);if(r&&Sd(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=Mn(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==Te.view||r==Te.click||r==Te.search||r==Te.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==Te.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=Mn(t,["userId"]);return tD(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=Mn(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Sd(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Sd(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"?u0(t,r):t}get baseUrl(){return aD(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},Vn;(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"})(Vn||(Vn={}));var L;(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.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.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach"})(L||(L={}));var UC={[L.triggerNotify]:"queryPipelineTriggers",[L.triggerExecute]:"queryPipelineTriggers",[L.triggerQuery]:"queryPipelineTriggers",[L.triggerRedirect]:"queryPipelineTriggers",[L.queryErrorBack]:"errors",[L.queryErrorClear]:"errors",[L.queryErrorRetry]:"errors",[L.pagerNext]:"getMoreResults",[L.pagerPrevious]:"getMoreResults",[L.pagerNumber]:"getMoreResults",[L.pagerResize]:"getMoreResults",[L.pagerScrolling]:"getMoreResults",[L.facetSearch]:"facet",[L.facetShowLess]:"facet",[L.facetShowMore]:"facet",[L.recommendation]:"recommendation",[L.likeSmartSnippet]:"smartSnippet",[L.dislikeSmartSnippet]:"smartSnippet",[L.expandSmartSnippet]:"smartSnippet",[L.collapseSmartSnippet]:"smartSnippet",[L.openSmartSnippetFeedbackModal]:"smartSnippet",[L.closeSmartSnippetFeedbackModal]:"smartSnippet",[L.sendSmartSnippetReason]:"smartSnippet",[L.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.clearRecentQueries]:"recentQueries",[L.recentResultClick]:"recentlyClickedDocuments",[L.clearRecentResults]:"recentlyClickedDocuments",[L.showLessFoldedResults]:"folding",[L.caseDetach]:"case",[L.likeGeneratedAnswer]:"generatedAnswer",[L.dislikeGeneratedAnswer]:"generatedAnswer",[L.openGeneratedAnswerSource]:"generatedAnswer",[L.generatedAnswerStreamEnd]:"generatedAnswer",[L.generatedAnswerSourceHover]:"generatedAnswer",[L.generatedAnswerCopyToClipboard]:"generatedAnswer",[L.generatedAnswerHideAnswers]:"generatedAnswer",[L.generatedAnswerShowAnswers]:"generatedAnswer",[L.generatedAnswerExpand]:"generatedAnswer",[L.generatedAnswerCollapse]:"generatedAnswer",[L.generatedAnswerFeedbackSubmit]:"generatedAnswer",[L.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[Vn.expandToFullUI]:"interface",[Vn.openUserActions]:"User Actions",[Vn.showPrecedingSessions]:"User Actions",[Vn.showFollowingSessions]:"User Actions",[Vn.clickViewedDocument]:"User Actions",[Vn.clickPageView]:"User Actions",[Vn.createArticle]:"createArticle"},Mi=class{constructor(){this.runtime=new Rd,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(Te.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(Te.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(Te.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(Te.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return zC}};function sD(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function cD(e){return e.map(t=>t.replace(/;/g,""))}function ZC(e){let r=e.join(";");return r.length<=256?r:ZC(e.slice(1))}var QC=e=>{let t=cD(e),r=sD(t);return ZC(r)};function BC(e){let t=typeof e.partialQueries=="string"?e.partialQueries:QC(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:QC(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var Fd=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||wd();this.coveoAnalyticsClient=n?new Mi:new Gr(t)}disable(){this.coveoAnalyticsClient=new Mi}enable(){this.coveoAnalyticsClient=new Gr(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(L.interfaceLoad)}logInterfaceLoad(){return V(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(L.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return V(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(L.recommendation)}logRecommendation(){return V(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(L.recommendationOpen,t,r)}logRecommendationOpen(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(L.staticFilterClearAll,t)}logStaticFilterClearAll(t){return V(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(L.staticFilterSelect,t)}logStaticFilterSelect(t){return V(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(L.staticFilterDeselect,t)}logStaticFilterDeselect(t){return V(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(L.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return V(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(L.interfaceChange,t)}logInterfaceChange(t){return V(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(L.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return V(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(L.didyoumeanClick)}logDidYouMeanClick(){return V(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(L.resultsSort,t)}logResultsSort(t){return V(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(L.searchboxSubmit)}logSearchboxSubmit(){return V(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(L.searchboxClear)}logSearchboxClear(){return V(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(L.searchboxAsYouType)}logSearchboxAsYouType(){return V(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(L.breadcrumbFacet,t)}logBreadcrumbFacet(t){return V(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(L.breadcrumbResetAll)}logBreadcrumbResetAll(){return V(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(L.documentQuickview,t,r)}logDocumentQuickview(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(L.documentOpen,t,r)}logDocumentOpen(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(L.omniboxAnalytics,BC(t))}logOmniboxAnalytics(t){return V(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(L.omniboxFromLink,BC(t))}logOmniboxFromLink(t){return V(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(L.searchFromLink)}logSearchFromLink(){return V(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(L.triggerNotify,t)}logTriggerNotify(t){return V(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(L.triggerExecute,t)}logTriggerExecute(t){return V(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(L.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return V(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(L.undoTriggerQuery,t)}logUndoTriggerQuery(t){return V(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(L.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return V(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(L.pagerResize,t)}logPagerResize(t){return V(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(L.pagerNumber,t)}logPagerNumber(t){return V(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(L.pagerNext,t)}logPagerNext(t){return V(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(L.pagerPrevious,t)}logPagerPrevious(t){return V(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(L.pagerScrolling)}logPagerScrolling(){return V(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(L.facetClearAll,t)}logFacetClearAll(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(L.facetSearch,t)}logFacetSearch(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(L.facetSelect,t)}logFacetSelect(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(L.facetDeselect,t)}logFacetDeselect(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(L.facetExclude,t)}logFacetExclude(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(L.facetUnexclude,t)}logFacetUnexclude(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(L.facetSelectAll,t)}logFacetSelectAll(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(L.facetUpdateSort,t)}logFacetUpdateSort(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(L.facetShowMore,t)}logFacetShowMore(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(L.facetShowLess,t)}logFacetShowLess(t){return V(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(L.queryError,t)}logQueryError(t){return V(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return V(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(L.queryErrorBack);return{description:t.description,log:()=>V(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(L.queryErrorBack)})}})}logQueryErrorBack(){return V(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return V(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(L.queryErrorRetry);return{description:t.description,log:()=>V(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(L.queryErrorRetry)})}})}logQueryErrorRetry(){return V(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return V(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(L.queryErrorClear);return{description:t.description,log:()=>V(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(L.queryErrorClear)})}})}logQueryErrorClear(){return V(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(L.likeSmartSnippet)}logLikeSmartSnippet(){return V(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(L.dislikeSmartSnippet)}logDislikeSmartSnippet(){return V(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(L.expandSmartSnippet)}logExpandSmartSnippet(){return V(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(L.collapseSmartSnippet)}logCollapseSmartSnippet(){return V(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(L.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return V(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(L.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return V(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(L.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(L.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return V(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(L.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return V(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(L.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return V(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(L.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return V(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(L.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(L.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(L.copyToClipboard,t,r)}logCopyToClipboard(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(L.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(L.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(L.recentQueryClick)}logRecentQueryClick(){return V(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(L.clearRecentQueries)}logClearRecentQueries(){return V(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(L.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(L.clearRecentResults)}logClearRecentResults(){return V(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(L.noResultsBack)}logNoResultsBack(){return V(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(L.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(L.showLessFoldedResults)}logShowLessFoldedResults(){return V(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 V(this,arguments,void 0,function*(n,o,a=UC[n]){this.coveoAnalyticsClient.getParameters;let i=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),p=Object.assign(Object.assign({},yield this.getBaseEventRequest(i)),{eventType:a,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(p);return{description:this.makeEventDescription(f,n),log:({searchUID:m})=>f.log({lastSearchQueryUid:m})}})}logCustomEvent(t,r){return V(this,arguments,void 0,function*(n,o,a=UC[n]){return(yield this.makeCustomEvent(n,o,a)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return V(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),a=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),i=yield this.coveoAnalyticsClient.makeCustomEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({lastSearchQueryUid:p})}})}logCustomEventWithType(t,r,n){return V(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return V(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:a})=>o.log({searchQueryUid:a})}})}makeClickEvent(t,r,n,o){return V(this,void 0,void 0,function*(){let a=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),i=yield this.coveoAnalyticsClient.makeClickEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({searchQueryUid:p})}})}logClickEvent(t,r,n,o){return V(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return V(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 V(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 Gr?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(L.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return V(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(L.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return V(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(L.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return V(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(L.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(L.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(L.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(L.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(L.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(L.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(L.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(L.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(L.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(L.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return V(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(L.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return V(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(L.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Ed=Object.assign({},Du),GC=Object.keys(Ed).map(e=>Ed[e]),Di=class extends Ey{constructor({client:t,uuidGenerator:r=ca}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);if(r!==null)return r;switch(t){case"setTicket":return this.setTicket;default:return null}}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>GC.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(GC.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Ed.pageview,{newEventType:Te.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Ed.event,{newEventType:Te.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),a=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},a),o),r)}getTicketPayload(){return m0(this.ticket)}};Di.Id="svc";var Id;(function(e){e.click="click",e.flowStart="flowStart"})(Id||(Id={}));var dr;(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"})(dr||(dr={}));var Td;(function(e){e.quit="Quit",e.solved="Solved"})(Td||(Td={}));var Pd=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!wd();this.coveoAnalyticsClient=o?new Gr(t):new Mi,this.svc=new Di({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Mi,this.svc=new Di({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Gr(this.options),this.svc=new Di({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(dr.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(dr.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(dr.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(dr.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(dr.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(dr.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(dr.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(dr.caseCancelled,{reason:Td.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(dr.caseSolved,{reason:Td.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(dr.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Id.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Id.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return V(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 Gr?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,a;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(a=this.provider)===null||a===void 0?void 0:a.getOriginLevel3()}}logClickEvent(t,r,n,o){return V(this,void 0,void 0,function*(){var a,i;let p=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(i=(a=this.provider)===null||a===void 0?void 0:a.getSearchUID())!==null&&i!==void 0?i:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(p)})}};d();c();l();u();d();c();l();u();var po=()=>"default";var uD=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},ua=class{constructor(t){this.getState=t;Ne(this,"state");this.state=t()}getLanguage(){return uD(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[a,i]of Object.entries(n)){let p=`context_${a}`;o[p]=i}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=uo),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||po()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};d();c();l();u();var eb=e=>new Gr(e).getCurrentVisitorId(),Vu=(e,t)=>typeof t=="function"?(...r)=>{let n=Su(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,ju=(e,t)=>(...r)=>{let n=Su(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};var Lu=class extends ua{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},tb=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o=new Lu(t)})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??Ft(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new Pd({enableAnalytics:m,token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:Vu(e,n),beforeSendHooks:[ju(e,r),(S,A)=>(e.info({...A,type:S,endpoint:p,token:i},"Analytics request"),A)]},o);return m||g.disable(),g};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Vi(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();function lD(e,t){return!!t&&t.facetId in e.facetSet}var Nr=(e,t)=>e.search?.response.facets.find(r=>r.facetId===t),kd=(e,t)=>e.facetSet[t]?.request,ji=(e,t)=>{let r=Nr(e,t);return lD(e,r)?r:void 0},rb=(e,t)=>ji(e,t)?.values.filter(r=>r.state==="selected")||[],nb=(e,t)=>ji(e,t)?.values.filter(r=>r.state!=="idle")||[],$r=e=>e.search.isLoading;d();c();l();u();function ob(e){if(!e)return{parents:[],values:[]};let t=[],r=e;for(;r.length&&r[0].children.length;)t=[...t,...r],r=r[0].children;let n=r.find(o=>o.state==="selected");return n&&(t=[...t,n],r=[]),{parents:t,values:r}}function or(e){let{activeValue:t,ancestryMap:r}=dD(e);return t?pD(t,r):[]}function dD(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 pD(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}function fD(e,t){return!!t&&t.facetId in e.categoryFacetSet}var Ly=(e,t)=>{let r=Nr(e,t);if(fD(e,r))return r},Uy=(e,t)=>e.categoryFacetSet[t]?.request,ab=(e,t)=>{let r=Ly(e,t);return or(r?.values??[])},Qy=(e,t)=>{let r=Uy(e,t);return or(r?.currentValues??[])};d();c();l();u();function Li(){return{}}d();c();l();u();function ib(e,t){return{request:e,tabs:t}}function Ui(){return{}}d();c();l();u();function sb(e,t){return{request:e,tabs:t}}function Qi(){return{}}d();c();l();u();function cb(e,t){return{request:e,hasBreadcrumbs:!0,tabs:t}}function Bi(){return{}}var Gi=(e,t)=>{let r=pb(t,e),n=r?r.field:"",o=Gy(n,e);return{facetId:e,facetField:n,facetTitle:o}};function $i(e,t){let{facetId:r,facetValue:n}=e,o=Gi(r,t),a=fb(t,r);return{...o,facetValue:a==="hierarchical"?db(t,r):n}}function ar(e){return{facetSet:e.facetSet??Bi(),categoryFacetSet:e.categoryFacetSet??Li(),dateFacetSet:e.dateFacetSet??Ui(),numericFacetSet:e.numericFacetSet??Qi(),automaticFacetSet:e.automaticFacetSet??Vi()}}var By=e=>{let t=[];return hD(e).forEach((r,n)=>{let o=fb(e,r.facetId),a=AD(r,n+1);if(gD(r)){if(!!!Qy(e,r.facetId).length)return;t.push({...a,...vD(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((i,p)=>{if(i.state==="idle")return;let f=ub(i,p+1,o),m=mD(r)?lb(i):SD(i);t.push({...a,...f,...m})})}),yD(e).forEach((r,n)=>{let o=xD(r,n+1);r.values.forEach((a,i)=>{if(a.state==="idle")return;let p=ub(a,i+1,"specific"),f=lb(a);t.push({...o,...p,...f})})}),t},mD=e=>e.type==="specific",gD=e=>e.type==="hierarchical",hD=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),yD=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),ub=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),SD=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),lb=e=>({displayValue:e.value,value:e.value}),db=(e,t)=>Qy(e,t).map(n=>n.value).join(";"),vD=(e,t)=>{let n=db(e,t);return{value:n,valuePosition:1,displayValue:n}},xD=(e,t)=>({title:Gy(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),AD=(e,t)=>({title:Gy(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),Gy=(e,t)=>`${e}_${t}`,pb=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,fb=(e,t)=>{let r=pb(e,t);return r?r.type:"specific"};d();c();l();u();d();c();l();u();var $y=e=>e.configuration.search.locale,mb=e=>e.configuration.search.timezone,Od=e=>e.configuration.accessToken,Nd=e=>e.configuration.organizationId,_d=e=>e.configuration.environment,Dd=e=>e.configuration?.knowledge?.agentId;var $e=e=>{if(CD(e)||Hy(e))return e.generatedAnswer?.answerId;if(bD(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},CD=e=>"answer"in e&&"generatedAnswer"in e&&!le(e.generatedAnswer?.answerConfigurationId),Hy=e=>{let t=Dd(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},bD=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",zy=e=>e.generatedAnswer?.fieldsToIncludeInCitations,Uu=Ye(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));d();c();l();u();var lt=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();d();c();l();u();var Qu=(r=>(r.Ascending="ascending",r.Descending="descending",r))(Qu||{}),la=(a=>(a.Relevancy="relevancy",a.QRE="qre",a.Date="date",a.Field="field",a.NoSort="nosort",a))(la||{}),Hr=e=>{if(vi(e))return e.map(t=>Hr(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},Hi=()=>({by:"relevancy"}),qd=e=>({by:"date",order:e}),Md=(e,t)=>({by:"field",order:t,field:e}),Vd=()=>({by:"qre"}),jd=()=>({by:"nosort"}),gb=new J({values:{by:new yu({enum:la,required:!0}),order:new yu({enum:Qu}),field:new M}});function fr(){return Hr(Hi())}d();c();l();u();d();c();l();u();d();c();l();u();var zi=class e{static set(t,r,n){let o,a,i;n&&(a=new Date,a.setTime(a.getTime()+n));let p=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,m=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(p)||m.test(p)||p.indexOf(".")===-1?Wy(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],Wy(t,r,a,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function Wy(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}d();c();l();u();function RD(){return typeof navigator<"u"}function hb(){try{return typeof localStorage<"u"}catch{return!1}}function yb(){try{return typeof sessionStorage<"u"}catch{return!1}}function Sb(){return!!(RD()&&navigator.cookieEnabled)}var vb=null;function xb(){return vb||(hb()?localStorage:Sb()?new Ky:yb()?sessionStorage:new Yy)}var Wi=class Wi{getItem(t){return zi.get(`${Wi.prefix}${t}`)}removeItem(t){zi.erase(`${Wi.prefix}${t}`)}setItem(t,r,n){zi.set(`${Wi.prefix}${t}`,r,n)}};Ne(Wi,"prefix","coveo_");var Ky=Wi;var Yy=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var Ld="__coveo.analytics.history",wD=20,FD=1e3*60,ED=75,da=class da{constructor(t){Ne(this,"store");this.store=t||xb()}static getInstance(t){return da.instance||(da.instance=new da(t)),da.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _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(Ld);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(Ld);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(Ld,JSON.stringify(t.slice(0,wD)))}catch{}}clear(){try{this.store.removeItem(Ld)}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,ED)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>FD:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};Ne(da,"instance",null);var Jy=da,Wt=Jy;var Bu=class Bu extends ua{constructor(){super(...arguments);Ne(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 By(ar(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||Bu.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||rr().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||Bu.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=$e(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetValue:n,facetTitle:`${a}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,criteria:n,facetTitle:`${a}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${a}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??fr()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:a,categoryFacetPath:n,categoryFacetTitle:`${a}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],a=o.completions.map(m=>m.expression),i=o.partialQueries.length-1,p=o.partialQueries[i]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:a.indexOf(n),partialQuery:p,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:a.length>0?a:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||lt().q}get responseTime(){return this.state.search?.duration||rr().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||rr().response.totalCountFiltered}};Ne(Bu,"fallbackPipelineName","default");var fo=Bu,Ab=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??Ft(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new Fd({token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:Vu(e,n),beforeSendHooks:[ju(e,r),(S,A)=>(e.info({...A,type:S,endpoint:p,token:i},"Analytics request"),A)]},o);return m||g.disable(),g},Xy=()=>{let t=Wt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};d();c();l();u();function Ud(e){let t=Cb(e),r=[e,...t].filter(o=>o.parentResult).map(o=>o.parentResult);return Kx([e,...t,...r],o=>o.uniqueId)}function Cb(e){return e.childResults?e.childResults.flatMap(t=>[t,...Cb(t)]):[]}d();c();l();u();var jn=()=>"";function bb(e,t){return{...new fo(t).getBaseMetadata(),actionCause:e,type:e}}function ID(e){return Object.assign(e,{instantlyCallable:!0})}function TD(e,t){let r=a=>ID(Se(e,a)),n=r(/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(a,{getState:i,extra:p}){let{analyticsClientMiddleware:f,preprocessRequest:m,logger:g}=p;return yield(yield t({getState:i,analyticsClientMiddleware:f,preprocessRequest:m,logger:g})).log({state:i(),extra:p})});return function(_x13,_x14){return _ref9.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref0=_asyncToGenerator(function*({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f}){let{description:m,log:g}=yield t({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f});return{description:m,action:r(/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(S,{getState:A,extra:h}){return yield g({state:A(),extra:h})});return function(_x16,_x17){return _ref1.apply(this,arguments)}}())}});return function prepare(_x15){return _ref0.apply(this,arguments)}}()}),n}var Rb=(e,t,r)=>{function n(...o){let a=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return OD(a)}return n},PD=e=>e.configuration.analytics.analyticsMode==="legacy",kD=e=>e.configuration.analytics.analyticsMode==="next",OD=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:a,providerClass:i})=>(r??(r=p=>new i(p)),TD(e,/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*({getState:p,analyticsClientMiddleware:f,preprocessRequest:m,logger:g}){let S=[],A={log:function(){var _ref11=_asyncToGenerator(function*({state:b}){for(let F of S)yield F(b)});return function log(_x19){return _ref11.apply(this,arguments)}}()},h=p(),C=a({getState:p,logger:g,analyticsClientMiddleware:f,preprocessRequest:m,provider:r(p)}),w=yield t(C,p());A.description=w?.description,S.push(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(b){PD(b)&&(yield ND(w,r,b,g,C.coveoAnalyticsClient))});return function(_x20){return _ref12.apply(this,arguments)}}());let{emit:R}=_u(h);return S.push(/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*(b){if(kD(b)&&o&&n){let F=n(b);yield QD(R,o,F)}});return function(_x21){return _ref13.apply(this,arguments)}}()),A});return function(_x18){return _ref10.apply(this,arguments)}}()));function ND(_x22,_x23,_x24,_x25,_x26){return _ND.apply(this,arguments)}function _ND(){_ND=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let a=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:a},"Analytics response")});return _ND.apply(this,arguments)}var _D=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref14=_asyncToGenerator(function*(a){r(n,o)});return function log(_x27){return _ref14.apply(this,arguments)}}()}),Y=Rb(e=>Ab({...e,provider:e.provider||new fo(e.getState)}),e=>e,fo),p9=Rb(tb,_D("caseAssist"),Lu);var dt=(e,t)=>{let r=a=>a+(t.pagination?.firstResult??0),n=-1,o=t.search?.results;return n=Ib(e,o),n<0&&(n=UD(e,o)),n<0&&(n=0),qD(e,r(n),t)};var wb=(e,t)=>({sourceName:DD(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||jn()});function DD(e){let t=e.source;return le(t)?"unknown":t}var Fb=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function qD(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:jD(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:LD(e),queryPipeline:r.pipeline||jn()}}var He=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||""}),Eb={urihash:new M,sourcetype:new M,permanentid:new M},Qd={uniqueId:z,raw:new J({values:Eb}),title:z,uri:z,clickUri:z,rankingModifier:new M({required:!1,emptyAllowed:!0})};function MD(e){return Object.assign({},...Object.keys(Eb).map(t=>({[t]:e[t]})))}function VD(e){return Object.assign({},...Object.keys(Qd).map(t=>({[t]:e[t]})),{raw:MD(e.raw)})}function jD(e){let t=e.raw.author;return le(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function LD(e){let t=e.raw.source;return le(t)?"unknown":t}var Kt=e=>new ge(Qd).validate(VD(e));function UD(e,t){for(let[r,n]of t.entries()){let o=Ud(n);if(Ib(e,o)!==-1)return r}return-1}function Ib(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function QD(_x28,_x29,_x30){return _QD.apply(this,arguments)}function _QD(){_QD=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _QD.apply(this,arguments)}d();c();l();u();var Zy=e=>O(e,{evt:z,type:it}),Tb=e=>Y("analytics/generic/search",t=>{Zy(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),Pb=e=>Y("analytics/generic/click",(t,r)=>(Kt(e.result),Zy(e),t.makeClickEvent(e.evt,dt(e.result,r),He(e.result),e.meta))),kb=e=>Y("analytics/generic/custom",t=>(Zy(e),t.makeCustomEventWithType(e.evt,e.type,e.meta))),Bd=()=>Y("analytics/interface/load",e=>e.makeInterfaceLoad()),mo=()=>Y("analytics/interface/change",(e,t)=>e.makeInterfaceChange({interfaceChangeTo:t.configuration.analytics.originLevel2})),Gd=()=>Y("analytics/interface/searchFromLink",e=>e.makeSearchFromLink()),$d=e=>Y("analytics/interface/omniboxFromLink",t=>t.makeOmniboxFromLink(e)),Ob=()=>({actionCause:"interfaceLoad"}),Ki=()=>({actionCause:"interfaceChange"}),Nb=()=>({actionCause:"searchFromLink"}),_b=()=>({actionCause:"omniboxFromLink"});d();c();l();u();var eS=()=>it,Db=()=>z,zr=T("configuration/updateBasicConfiguration",e=>O(e,{accessToken:it,environment:new M({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:it})),mr=T("configuration/updateSearchConfiguration",e=>O(e,{proxyBaseUrl:new M({required:!1,url:!0}),pipeline:new M({required:!1,emptyAllowed:!0}),searchHub:it,timezone:it,locale:it,authenticationProviders:new ae({required:!1,each:z})})),BD={enabled:new ce({default:!0}),originContext:eS(),originLevel2:eS(),originLevel3:eS(),proxyBaseUrl:new M({required:!1,url:!0}),runtimeEnvironment:new Le,anonymous:new ce({default:!1}),deviceId:it,userDisplayName:it,documentLocation:it,trackingId:EA,analyticsMode:new M({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new J({options:{required:!1},values:kC.reduce((e,t)=>(e[t]=FA,e),{})})},go=T("configuration/updateAnalyticsConfiguration",e=>O(e,BD)),Yi=T("configuration/analytics/disable"),Ji=T("configuration/analytics/enable"),Hd=T("configuration/analytics/originlevel2",e=>O(e,{originLevel2:Db()})),zd=T("configuration/analytics/originlevel3",e=>O(e,{originLevel3:Db()})),Wd=T("knowledge/setAgentId",e=>O(e,new M({required:!0})));d();c();l();u();d();c();l();u();d();c();l();u();var Kd={q:new M,enableQuerySyntax:new ce,aq:new M,cq:new M,firstResult:new ee({min:0}),numberOfResults:new ee({min:0}),sortCriteria:new M,f:new J,fExcluded:new J,cf:new J,nf:new J,mnf:new J,df:new J,debug:new ce,sf:new J,tab:new M,af:new J};var De=T("searchParameters/restore",e=>O(e,Kd)),Xi=T("searchParameters/restoreTab",e=>O(e,z));d();c();l();u();var ho=T("debug/enable"),Zi=T("debug/disable");d();c();l();u();var yo=()=>!1;var es=oe(yo(),e=>{e.addCase(ho,()=>!0).addCase(Zi,()=>!1).addCase(De,(t,r)=>r.payload.debug??t)});d();c();l();u();d();c();l();u();var tS=T("history/undo"),rS=T("history/redo"),ir=T("history/snapshot"),Gu=Se("history/back",/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(e,{dispatch:t}){t(tS()),yield t(_e())});return function(_x31,_x32){return _ref15.apply(this,arguments)}}()),Yd=Se("history/forward",/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(e,{dispatch:t}){t(rS()),yield t(_e())});return function(_x33,_x34){return _ref16.apply(this,arguments)}}()),_e=Se("history/change",/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x35,_x36){return _ref17.apply(this,arguments)}}());d();c();l();u();var ts=T("pipeline/set",e=>O(e,new M({required:!0,emptyAllowed:!0})));var rs=oe(jn(),e=>{e.addCase(ts,(t,r)=>r.payload).addCase(_e.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(mr,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var pt=T("breadcrumb/deselectAll"),ns=T("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var Wr=T("facet/updateFacetAutoSelection",e=>O(e,{allow:new ce({required:!0})}));d();c();l();u();d();c();l();u();var $u=class extends fo{constructor(r){super(r);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??lt().q}get responseTime(){return this.activeInstantResultCache?.duration??rr().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??rr().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var qb=e=>Y({prefix:"analytics/instantResult/open",__legacy__getBuilder:(t,r)=>(Kt(e),t.makeDocumentOpen(dt(e,r),He(e))),__legacy__provider:t=>new $u(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=dt(e,t),n=He(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}}),Mb=()=>Y("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new $u(e)),Vb=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var nS={id:z},GD={...nS,q:Ue},os=T("instantResults/register",e=>O(e,nS)),Kr=T("instantResults/updateQuery",e=>O(e,GD)),as=T("instantResults/clearExpired",e=>O(e,nS));d();c();l();u();var Jd=new ee({required:!0,min:0}),is=T("pagination/registerNumberOfResults",e=>O(e,Jd)),ss=T("pagination/updateNumberOfResults",e=>O(e,Jd)),cs=T("pagination/registerPage",e=>O(e,Jd)),Yr=T("pagination/updatePage",e=>O(e,Jd)),us=T("pagination/nextPage"),ls=T("pagination/previousPage");d();c();l();u();var Dt=T("query/updateQuery",e=>O(e,{q:new M,enableQuerySyntax:new ce}));d();c();l();u();d();c();l();u();var Ln=(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:Ni(e)}});var ds=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ct(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&&Ln(e.configuration.analytics,t,r)),...(e.excerptLength&&!le(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();l();u();d();c();l();u();d();c();l();u();var ps=/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield eb(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(Xy()&&{pageId:Xy()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:Ni(e)})}}});return function ps(_x37,_x38){return _ref18.apply(this,arguments)}}();var So=/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ct(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:Wt.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 ps(e.configuration.analytics,t))),...(e.excerptLength&&!le(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function So(_x39,_x40){return _ref19.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var _r=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var oS=()=>Y("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),vo=e=>Y("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||lt().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}));d();c();l();u();d();c();l();u();var zu=kr(Xd(),1),Bb=kr(jb(),1);d();c();l();u();var Zd=kr(Xd(),1),Ub=kr(Lb(),1);Zd.default.extend(Ub.default);var fs="YYYY/MM/DD@HH:mm:ss",$D="1401-01-01";function pa(e,t){let r=(0,Zd.default)(e,t);return!r.isValid()&&!t?(0,Zd.default)(e,fs):r}function Hu(e){return e.format(fs)}function Qb(e){return Hu(pa(e))===e}function ep(e,t){let r=pa(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}`)}dS(r)}function dS(e){if(e.isBefore($D))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}zu.default.extend(Bb.default);var Gb=["past","now","next"],$b=["minute","hour","day","week","month","quarter","year"],HD=e=>{let t=e==="now";return{amount:new ee({required:!t,min:1}),unit:new M({required:!t,constrainTo:$b}),period:new M({required:!0,constrainTo:Gb})}};function xo(e){if(typeof e=="string"&&!Jr(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?pS(e):e;new ge(HD(t.period)).validate(t);let r=zb(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);dS(r)}function Hb(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function zb(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,zu.default)().subtract(r,n);case"next":return(0,zu.default)().add(r,n);case"now":return(0,zu.default)()}}function Wu(e){return Hu(zb(pS(e)))}function Wb(e){return e.toLocaleLowerCase().split("-")}function Jr(e){let[t,r,n]=Wb(e);if(t==="now")return!0;if(!Gb.includes(t)||!$b.includes(n))return!1;let o=parseInt(r);return!(Number.isNaN(o)||o<=0)}function Kb(e){return!!e&&typeof e=="object"&&"period"in e}function pS(e){let[t,r,n]=Wb(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r):void 0,unit:n||void 0}}function Yb(e){return xo(e),pS(e)}d();c();l();u();function Jb(e){return e.type==="dateRange"}function Xb(e){return`start${e}`}function Zb(e){return`end${e}`}var fS=()=>({dateFacetValueMap:{}});function zD(e,t,r){let n=e.start,o=e.end;return Jr(n)&&(n=Wu(n),r.dateFacetValueMap[t][Xb(n)]=e.start),Jr(o)&&(o=Wu(o),r.dateFacetValueMap[t][Zb(o)]=e.end),{...e,start:n,end:o}}function mS(e,t){if(Jb(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>zD(o,r,t))}}return e}function Ao(e){let t=fS();return{request:{...e,facets:e.facets?.map(n=>mS(n,t))},mappings:t}}function WD(e,t,r){return{...e,start:r.dateFacetValueMap[t][Xb(e.start)]||e.start,end:r.dateFacetValueMap[t][Zb(e.end)]||e.end}}function KD(e,t){return e.facetId in t.dateFacetValueMap}function YD(e,t){return KD(e,t)?{...e,values:e.values.map(r=>WD(r,e.facetId,t))}:e}function tp(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>YD(n,t))}}:e}d();c();l();u();d();c();l();u();var ms=T("didYouMean/enable"),rp=T("didYouMean/disable"),gs=T("didYouMean/automaticCorrections/disable"),np=T("didYouMean/automaticCorrections/enable"),gr=T("didYouMean/correction",e=>O(e,z)),fa=T("didYouMean/automaticCorrections/mode",e=>O(e,new M({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var op=()=>Y("analytics/didyoumean/click",e=>e.makeDidYouMeanClick()),gS=()=>Y("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic()),eR=()=>({actionCause:"didYouMeanClick"}),tR=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function ap(){return{contextValues:{}}}d();c();l();u();function ip(){return{contextValues:{}}}d();c();l();u();function hS(){return{enabled:!0,tabs:{}}}function sp(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function cp(){return[]}d();c();l();u();function hr(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function up(){return{}}d();c();l();u();function lp(){return{}}d();c();l();u();function dp(){return{}}function rR(){return Dr({})}function Dr(e){return{context:e.context||ap(),dictionaryFieldContext:e.dictionaryFieldContext||ip(),facetSet:e.facetSet||Bi(),numericFacetSet:e.numericFacetSet||Qi(),dateFacetSet:e.dateFacetSet||Ui(),categoryFacetSet:e.categoryFacetSet||Li(),automaticFacetSet:e.automaticFacetSet??Vi(),pagination:e.pagination||hr(),query:e.query||lt(),tabSet:e.tabSet||dp(),advancedSearchQueries:e.advancedSearchQueries||_r(),staticFilterSet:e.staticFilterSet||lp(),querySet:e.querySet||up(),sortCriteria:e.sortCriteria||fr(),pipeline:e.pipeline||jn(),searchHub:e.searchHub||po(),facetOptions:e.facetOptions||sp(),facetOrder:e.facetOrder??cp(),debug:e.debug??yo()}}d();c();l();u();var JD=new J({values:{undoneQuery:Ue},options:{required:!0}}),pp=()=>Y("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null),fp=e=>Y("analytics/trigger/query/undo",t=>(O(e,JD),t.makeUndoTriggerQuery(e))),mp=()=>Y("analytics/trigger/notify",(e,t)=>t.triggers?.notifications.length?e.makeTriggerNotify({notifications:t.triggers.notifications}):null),gp=()=>Y("analytics/trigger/redirect",(e,t)=>t.triggers?.redirectTo?e.makeTriggerRedirect({redirectedTo:t.triggers.redirectTo}):null),hp=()=>Y("analytics/trigger/execute",(e,t)=>t.triggers?.executions.length?e.makeTriggerExecute({executions:t.triggers.executions}):null);d();c();l();u();var Co=T("trigger/query/ignore",e=>O(e,new M({emptyAllowed:!0,required:!0}))),hs=T("trigger/query/modification",e=>O(e,new J({values:{originalQuery:it,modification:it}})));d();c();l();u();d();c();l();u();d();c();l();u();function bo(e){return Object.values(e).map(t=>t.request)}function Ku(e,t){let r={};e.forEach(a=>{r[a.facetId]=a});let n=[];t.forEach(a=>{a in r&&(n.push(r[a]),delete r[a])});let o=Object.values(r);return[...n,...o]}function nR(e){return bo(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var yS={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function XD(e){return bo(e).map(t=>{let r=yS[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function ZD(e){return[...XD(e.facetSet??{}),...nR(e.numericFacetSet??{}),...nR(e.dateFacetSet??{}),...bo(e.categoryFacetSet??{})]}function eq(e){return ZD(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function yp(e){return Ku(eq(e),e.facetOrder??[])}d();c();l();u();var Ro=/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e,t){let r=nq(e),n=yp(e),o=tq(e),a=yield So(e,t),i=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Ao({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:i(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Ro(_x41,_x42){return _ref20.apply(this,arguments)}}();function tq(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(rq).filter(r=>r.currentValues.length>0):void 0}function rq(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function nq(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=oq(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}function oq(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o})}var wo=class{constructor(t,r=n=>{this.dispatch(Dt({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x43,_x44){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=tp(yield _this10.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this10.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return ht(t.response)?(this.dispatch(vo(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o||!a)return null;let m=i.length===0&&p&&p.length!==0,g=!le(f)&&!le(f.correctedQuery);if(!m&&!g)return null;let A=m?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(ir(Dr(_this12.getState()))),A})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this13.automaticallyRetryQueryWithCorrection(o);return ht(a.response)?(_this13.dispatch(vo(a.response.error)),_this13.rejectWithValue(a.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(ir(Dr(_this13.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:gS()})})()}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:gS()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(Co("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let a=_this14.getCurrentQuery(),i=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return ht(i.response)?(_this14.dispatch(vo(i.response.error)),_this14.rejectWithValue(i.response.error)):(_this14.dispatch(ir(Dr(_this14.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a,analyticsAction:pp()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??lt().enableQuerySyntax},search:{...rr(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(ir(Dr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return Xl(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield Ro(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(gr(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(hs({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield Ro(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var oR=Se("search/executeSearch",/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Sp(r,t,e)});return function(_x45,_x46){return _ref21.apply(this,arguments)}}()),aR=Se("search/fetchPage",/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){let r=t.getState();return yield vS(r,t,e)});return function(_x47,_x48){return _ref22.apply(this,arguments)}}()),iR=Se("search/fetchMoreResults",/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t){let r=t.getState();return yield xS(t,r)});return function(_x49,_x50){return _ref23.apply(this,arguments)}}()),sR=Se("search/fetchFacetValues",/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=t.getState();return yield cq(t,e,r)});return function(_x51,_x52){return _ref24.apply(this,arguments)}}()),cR=Se("search/fetchInstantResults",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){return SS(e,t)});return function(_x53,_x54){return _ref25.apply(this,arguments)}}()),aq=/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=yield Ro(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function aq(_x55,_x56){return _ref26.apply(this,arguments)}}(),iq=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t,r){let n=yield So(e);return Ao({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function iq(_x57,_x58,_x59){return _ref27.apply(this,arguments)}}(),sq=/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){let r=yield Ro(e,t);return r.request.numberOfResults=0,r});return function sq(_x60,_x61){return _ref28.apply(this,arguments)}}(),uR=e=>{e.configuration.analytics.enabled&&Wt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function SS(_x62,_x63){return _SS.apply(this,arguments)}function _SS(){_SS=_asyncToGenerator(function*(e,t){O(e,{id:z,q:z,maxResultsPerQuery:new ee({required:!0,min:1}),cacheTimeout:new ee});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),a=new wo({...t,analyticsAction:Mb()},m=>{t.dispatch(Kr({q:m,id:e.id}))}),i=yield iq(o,r,n),p=yield a.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),f=yield a.process(p);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _SS.apply(this,arguments)}function vS(_x64,_x65,_x66){return _vS.apply(this,arguments)}function _vS(){_vS=_asyncToGenerator(function*(e,t,r){uR(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new wo({...t,analyticsAction:r}),f=yield Ro(e,i),m=yield p.fetchFromAPI(f,{origin:"mainSearch"});return yield p.process(m)});return _vS.apply(this,arguments)}function xS(_x67,_x68){return _xS.apply(this,arguments)}function _xS(){_xS=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:a}=yield oS().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),i=new wo({...e,analyticsAction:oS()}),p=yield aq(t,a),f=yield i.fetchFromAPI(p,{origin:"mainSearch"});return yield i.process(f)});return _xS.apply(this,arguments)}function cq(_x69,_x70,_x71){return _cq.apply(this,arguments)}function _cq(){_cq=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=e.extra,{description:i}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new wo({...e,analyticsAction:t}),f=yield sq(r,i),m=yield p.fetchFromAPI(f,{origin:"facetValues"});return yield p.process(m)});return _cq.apply(this,arguments)}function Sp(_x72,_x73,_x74){return _Sp.apply(this,arguments)}function _Sp(){_Sp=_asyncToGenerator(function*(e,t,r){uR(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=yield Ro(e,i),f=new wo({...t,analyticsAction:r}),m=yield f.fetchFromAPI(p,{origin:"mainSearch"});return yield f.process(m)});return _Sp.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var lR=Ye(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o}));var yr=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t,r){let n=CS(e),o=uq(e),a=lq(e),i=e.configuration.analytics.analyticsMode==="legacy"?yield So(e,r):ds(e,t,r);return Ao({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:AS(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:a}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function yr(_x75,_x76,_x77){return _ref29.apply(this,arguments)}}();function AS(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function uq(e){return Ku(pq(e),e.facetOrder??[])}function lq(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(dq).filter(r=>r.currentValues.length>0):void 0}function dq(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function pq(e){return fq(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function fq(e){return[...mq(e.facetSet??{}),...dR(e.numericFacetSet??{}),...dR(e.dateFacetSet??{}),...bo(e.categoryFacetSet??{})]}function mq(e){return bo(e).map(t=>{let r=yS[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function dR(e){return bo(e).map(t=>{let r=t.currentValues,n=r.some(({state:a})=>a!=="idle"),o=r.some(a=>a.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function CS(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=lR(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}var Fo=class{constructor(t,r=n=>{this.dispatch(Dt({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x78,_x79){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=tp(yield _this17.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this17.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return ht(t.response)?(this.dispatch(vo(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o||!a)return null;let m=i.length===0&&p&&p.length!==0,g=!le(f)&&!le(f.correctedQuery);if(!m&&!g)return null;let A=m?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(ir(Dr(_this19.getState()))),A})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this20.automaticallyRetryQueryWithCorrection(o);return ht(a.response)?(_this20.dispatch(vo(a.response.error)),_this20.rejectWithValue(a.response.error)):(_this20.dispatch(ir(Dr(_this20.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(Co("")),null;let a=_this21.getCurrentQuery(),i=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return ht(i.response)?(_this21.dispatch(vo(i.response.error)),_this21.rejectWithValue(i.response.error)):(_this21.dispatch(ir(Dr(_this21.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a})})()}processSuccessResponse(t){return this.dispatch(ir(Dr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return Xl(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=tR(),o=yield _this22.fetchFromAPI(yield yr(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(gr(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(hs({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield yr(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var ys=Se("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;O(e,{q:new M,enableQuerySyntax:new ce,clearFilters:new ce}),e.clearFilters&&(r(pt()),r(ns())),r(Wr({allow:!0})),r(Dt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Yr(1))}),pR=T("search/updateSearchAction"),G=Se("search/executeSearch",/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Sp(r,t,e.legacy);fR(r);let n=e.next?mR(e.next):void 0,o=yield yr(r,t.extra.navigatorContext,n),a=new Fo({...t,analyticsAction:n??{}}),i=yield a.fetchFromAPI(o,{origin:"mainSearch"});return yield a.process(i)});return function(_x80,_x81){return _ref30.apply(this,arguments)}}()),qt=Se("search/fetchPage",/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=t.getState();if(fR(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return vS(r,t,e.legacy);let n=new Fo({...t,analyticsAction:e.next}),o=yield yr(r,t.extra.navigatorContext,e.next),a=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(a)});return function(_x82,_x83){return _ref31.apply(this,arguments)}}()),Sr=Se("search/fetchMoreResults",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return xS(t,r);let n=bb("browseResults",t.getState),o=new Fo({...t,analyticsAction:n}),a=yield gq(r,t.extra.navigatorContext,n),i=yield o.fetchFromAPI(a,{origin:"mainSearch"});return yield o.process(i)});return function(_x84,_x85){return _ref32.apply(this,arguments)}}()),vr=Se("search/fetchFacetValues",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Sp(r,t,e.legacy);let n=new Fo({...t,analyticsAction:{}}),o=yield yq(r,t.extra.navigatorContext),a=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(a)});return function(_x86,_x87){return _ref33.apply(this,arguments)}}()),Ss=Se("search/fetchInstantResults",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return SS(e,t);O(e,{id:z,q:z,maxResultsPerQuery:new ee({required:!0,min:1}),cacheTimeout:new ee});let{q:n,maxResultsPerQuery:o}=e,a=mR(Vb()),i=yield hq(r,t.extra.navigatorContext,n,o,a),p=new Fo({...t,analyticsAction:a},g=>{t.dispatch(Kr({q:g,id:e.id}))}),f=yield p.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),m=yield p.process(f);return"response"in m?{results:m.response.results,searchUid:m.response.searchUid,totalCountFiltered:m.response.totalCountFiltered,duration:m.duration}:m});return function(_x88,_x89){return _ref34.apply(this,arguments)}}()),gq=/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t,r){let n=yield yr(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function gq(_x90,_x91,_x92){return _ref35.apply(this,arguments)}}(),hq=/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t,r,n,o){let a=ds(e,t,o);return Ao({...a,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function hq(_x93,_x94,_x95,_x96,_x97){return _ref36.apply(this,arguments)}}(),yq=/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t,r){let n=yield yr(e,t,r);return n.request.numberOfResults=0,n});return function yq(_x98,_x99,_x100){return _ref37.apply(this,arguments)}}(),fR=e=>{e.configuration.analytics.enabled&&Wt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},mR=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();var Eo=(e,t)=>{let r=e;return le(r[t])?le(e.raw[t])?null:e.raw[t]:r[t]},Sq=e=>t=>e.every(r=>!le(Eo(t,r))),vq=e=>t=>e.every(r=>le(Eo(t,r))),xq=(e,t)=>r=>{let n=gR(e,r);return t.some(o=>n.some(a=>`${a}`.toLowerCase()===o.toLowerCase()))},Aq=(e,t)=>r=>{let n=gR(e,r);return t.every(o=>n.every(a=>`${a}`.toLowerCase()!==o.toLowerCase()))},gR=(e,t)=>{let r=Eo(t,e);return Ul(r)?r:[r]},hR={getResultProperty:Eo,fieldsMustBeDefined:Sq,fieldsMustNotBeDefined:vq,fieldMustMatch:xq,fieldMustNotMatch:Aq};function Yu(e){return e.search.response.searchUid!==""}function yR(e,t,r){return e.search.results.find(n=>Eo(n,t)===r)}var bS=Ye(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();d();c();l();u();var vs=T("app/setError");function RS(e,t){let r=t.payload??null;r&&(e.response=rr().response,e.results=[],e.questionAnswer=bi()),e.error=r,e.isLoading=!1}function wS(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function Cq(e,t){wS(e,t),e.results=t.payload.response.results.map(r=>({...r,searchUid:t.payload.response.searchUid})),e.searchResponseId=t.payload.response.searchUid,e.questionAnswer=t.payload.response.questionAnswer,e.extendedResults=t.payload.response.extendedResults}function SR(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function bq(e,t){e.isLoading=!0,e.searchAction={actionCause:"browseResults"},e.requestId=t.meta.requestId}var fe=oe(rr(),e=>{e.addCase(G.rejected,(t,r)=>RS(t,r)),e.addCase(Sr.rejected,(t,r)=>RS(t,r)),e.addCase(qt.rejected,(t,r)=>RS(t,r)),e.addCase(G.fulfilled,(t,r)=>{Cq(t,r)}),e.addCase(Sr.fulfilled,(t,r)=>{wS(t,r),t.results=[...t.results,...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(qt.fulfilled,(t,r)=>{wS(t,r),t.results=[...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(vr.fulfilled,(t,r)=>{t.response.facets=r.payload.response.facets,t.response.searchUid=r.payload.response.searchUid}),e.addCase(G.pending,SR),e.addCase(Sr.pending,bq),e.addCase(qt.pending,SR),e.addCase(pR,(t,r)=>{t.searchAction=r.payload}),e.addCase(vs,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();d();c();l();u();var xs=T("searchHub/set",e=>O(e,new M({required:!0,emptyAllowed:!0})));var As=oe(po(),e=>{e.addCase(xs,(t,r)=>r.payload).addCase(_e.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(mr,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();function vR(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var xR=Qr;function OR(e,t){if(e===t||!(xR(e)&&xR(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,a=Array.isArray(t)?[]:{};for(let i of r)a[i]=OR(e[i],t[i]),o&&(o=e[i]===a[i]);return o?e:a}function Cs(e){let t=0;for(let r in e)t++;return t}var AR=e=>[].concat(...e);function Rq(e){return new RegExp("(^|:)//").test(e)}function wq(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Ap(e){return e!=null}function Fq(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var Eq=e=>e.replace(/\/$/,""),Iq=e=>e.replace(/^\//,"");function Tq(e,t){if(!e)return t;if(!t)return e;if(Rq(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=Eq(e),t=Iq(t),`${e}${r}${t}`}function Pq(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var CR=(...e)=>v(...e),kq=e=>e.status>=200&&e.status<=299,Oq=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function bR(e){if(!Qr(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function NR({baseUrl:e,prepareHeaders:t=S=>S,fetchFn:r=CR,paramsSerializer:n,isJsonContentType:o=Oq,jsonContentType:a="application/json",jsonReplacer:i,timeout:p,responseHandler:f,validateStatus:m,...g}={}){return typeof v>"u"&&r===CR&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(A,h,C){let{getState:w,extra:R,endpoint:b,forced:F,type:E}=h,P,{url:j,headers:_=new x(g.headers),params:k=void 0,responseHandler:N=f??"json",validateStatus:q=m??kq,timeout:U=p,...X}=typeof A=="string"?{url:A}:A,H,B=h.signal;U&&(H=new s.AbortController,h.signal.addEventListener("abort",H.abort),B=H.signal);let Q={...g,signal:B,...X};_=new x(bR(_)),Q.headers=(yield t(_,{getState:w,arg:A,extra:R,endpoint:b,forced:F,type:E,extraOptions:C}))||_;let K=Ae=>typeof Ae=="object"&&(Qr(Ae)||Array.isArray(Ae)||typeof Ae.toJSON=="function");if(!Q.headers.has("content-type")&&K(Q.body)&&Q.headers.set("content-type",a),K(Q.body)&&o(Q.headers)&&(Q.body=JSON.stringify(Q.body,i)),k){let Ae=~j.indexOf("?")?"&":"?",Ee=n?n(k):new URLSearchParams(bR(k));j+=Ae+Ee}j=Tq(e,j);let $=new Request(j,Q);P={request:new Request(j,Q)};let re,pe=!1,Re=H&&setTimeout(()=>{pe=!0,H.abort()},U);try{re=yield r($)}catch(Ae){return{error:{status:pe?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Ae)},meta:P}}finally{Re&&clearTimeout(Re),H?.signal.removeEventListener("abort",H.abort)}let ke=re.clone();P.response=ke;let Ce,we="";try{let Ae;if(yield Promise.all([S(re,N).then(Ee=>Ce=Ee,Ee=>Ae=Ee),ke.text().then(Ee=>we=Ee,()=>{})]),Ae)throw Ae}catch(Ae){return{error:{status:"PARSING_ERROR",originalStatus:re.status,data:we,error:String(Ae)},meta:P}}return q(re,Ce)?{data:Ce,meta:P}:{error:{status:re.status,data:Ce},meta:P}});return function(_x101,_x102,_x103){return _ref38.apply(this,arguments)}}());function S(_x104,_x105){return _S2.apply(this,arguments)}function _S2(){_S2=_asyncToGenerator(function*(A,h){if(typeof h=="function")return h(A);if(h==="content-type"&&(h=o(A.headers)?"json":"text"),h==="json"){let C=yield A.text();return C.length?JSON.parse(C):null}return A.text()});return _S2.apply(this,arguments)}}var bs=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function Nq(){return _Nq.apply(this,arguments)}function _Nq(){_Nq=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(o=>setTimeout(a=>o(a),n))});return _Nq.apply(this,arguments)}function _q(e,t){throw Object.assign(new bs({error:e,meta:t}),{throwImmediately:!0})}var RR={},Dq=(e,t)=>(/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(r,n,o){let a=[5,(t||RR).maxRetries,(o||RR).maxRetries].filter(g=>g!==void 0),[i]=a.slice(-1),f={maxRetries:i,backoff:Nq,retryCondition:(g,S,{attempt:A})=>A<=i,...t,...o},m=0;for(;;)try{let g=yield e(r,n,o);if(g.error)throw new bs(g);return g}catch(g){if(m++,g.throwImmediately){if(g instanceof bs)return g.value;throw g}if(g instanceof bs&&!f.retryCondition(g.value.error,r,{attempt:m,baseQueryApi:n,extraOptions:o}))return g.value;yield f.backoff(m,f.maxRetries)}});return function(_x106,_x107,_x108){return _ref39.apply(this,arguments)}}()),_R=Object.assign(Dq,{fail:_q}),TS=T("__rtkq/focused"),DR=T("__rtkq/unfocused"),PS=T("__rtkq/online"),qR=T("__rtkq/offline");function kS(e){return e.type==="query"}function qq(e){return e.type==="mutation"}function OS(e){return e.type==="infinitequery"}function NS(e,t,r,n,o,a){return Mq(e)?e(t,r,n,o).filter(Ap).map(FS).map(a):Array.isArray(e)?e.map(FS).map(a):[]}function Mq(e){return typeof e=="function"}function FS(e){return typeof e=="string"?{type:e}:e}function Vq(e,t){return e.catch(t)}var Xu=Symbol("forceQueryFn"),ES=e=>typeof e[Xu]=="function";function jq({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:a}){let i=new Map,p=new Map,{unsubscribeQueryResult:f,removeMutationResult:m,updateSubscriptionOptions:g}=o.internalActions;return{buildInitiateQuery:b,buildInitiateInfiniteQuery:F,buildInitiateMutation:E,getRunningQueryThunk:S,getRunningMutationThunk:A,getRunningQueriesThunk:h,getRunningMutationsThunk:C};function S(P,j){return _=>{let k=a.endpointDefinitions[P],N=e({queryArgs:j,endpointDefinition:k,endpointName:P});return i.get(_)?.[N]}}function A(P,j){return _=>p.get(_)?.[j]}function h(){return P=>Object.values(i.get(P)||{}).filter(Ap)}function C(){return P=>Object.values(p.get(P)||{}).filter(Ap)}function w(P){}function R(P,j){let _=(k,{subscribe:N=!0,forceRefetch:q,subscriptionOptions:U,[Xu]:X,...H}={})=>(B,Q)=>{let K=e({queryArgs:k,endpointDefinition:j,endpointName:P}),$,te={...H,type:"query",subscribe:N,forceRefetch:q,subscriptionOptions:U,endpointName:P,originalArgs:k,queryCacheKey:K,[Xu]:X};if(kS(j))$=t(te);else{let{direction:Me,initialPageParam:Ze}=H;$=r({...te,direction:Me,initialPageParam:Ze})}let re=o.endpoints[P].select(k),pe=B($),Re=re(Q());let{requestId:ke,abort:Ce}=pe,we=Re.requestId!==ke,Ae=i.get(B)?.[K],Ee=()=>re(Q()),rt=Object.assign(X?pe.then(Ee):we&&!Ae?Promise.resolve(Re):Promise.all([Ae,pe]).then(Ee),{arg:k,requestId:ke,subscriptionOptions:U,queryCacheKey:K,abort:Ce,unwrap(){return _asyncToGenerator(function*(){let Me=yield rt;if(Me.isError)throw Me.error;return Me.data})()},refetch:()=>B(_(k,{subscribe:!1,forceRefetch:!0})),unsubscribe(){N&&B(f({queryCacheKey:K,requestId:ke}))},updateSubscriptionOptions(Me){rt.subscriptionOptions=Me,B(g({endpointName:P,requestId:ke,queryCacheKey:K,options:Me}))}});if(!Ae&&!we&&!X){let Me=Pq(i,B,{});Me[K]=rt,rt.then(()=>{delete Me[K],Cs(Me)||i.delete(B)})}return rt};return _}function b(P,j){return R(P,j)}function F(P,j){return R(P,j)}function E(P){return(j,{track:_=!0,fixedCacheKey:k}={})=>(N,q)=>{let U=n({type:"mutation",endpointName:P,originalArgs:j,track:_,fixedCacheKey:k}),X=N(U);let{requestId:H,abort:B,unwrap:Q}=X,K=Vq(X.unwrap().then(pe=>({data:pe})),pe=>({error:pe})),$=()=>{N(m({requestId:H,fixedCacheKey:k}))},te=Object.assign(K,{arg:X.arg,requestId:H,abort:B,unwrap:Q,reset:$}),re=p.get(N)||{};return p.set(N,re),re[H]=te,te.then(()=>{delete re[H],Cs(re)||p.delete(N)}),k&&(re[k]=te,te.then(()=>{re[k]===te&&(delete re[k],Cs(re)||p.delete(N))})),te}}}function Lq(e){return e}var vp=(e={})=>({...e,[Pu]:!0});function Uq({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:a,selectors:i}){let p=(N,q,U,X)=>(H,B)=>{let Q=r[N],K=n({queryArgs:q,endpointDefinition:Q,endpointName:N});if(H(o.internalActions.queryResultPatched({queryCacheKey:K,patches:U})),!X)return;let $=o.endpoints[N].select(q)(B()),te=NS(Q.providesTags,$.data,void 0,q,{},a);H(o.internalActions.updateProvidedBy({queryCacheKey:K,providedTags:te}))};function f(N,q,U=0){let X=[q,...N];return U&&X.length>U?X.slice(0,-1):X}function m(N,q,U=0){let X=[...N,q];return U&&X.length>U?X.slice(1):X}let g=(N,q,U,X=!0)=>(H,B)=>{let K=o.endpoints[N].select(q)(B()),$={patches:[],inversePatches:[],undo:()=>H(o.util.patchQueryData(N,q,$.inversePatches,X))};if(K.status==="uninitialized")return $;let te;if("data"in K)if(zt(K.data)){let[re,pe,Re]=id(K.data,U);$.patches.push(...pe),$.inversePatches.push(...Re),te=re}else te=U(K.data),$.patches.push({op:"replace",path:[],value:te}),$.inversePatches.push({op:"replace",path:[],value:K.data});return $.patches.length===0||H(o.util.patchQueryData(N,q,$.patches,X)),$},S=(N,q,U)=>X=>X(o.endpoints[N].initiate(q,{subscribe:!1,forceRefetch:!0,[Xu]:()=>({data:U})})),A=(N,q)=>N.query&&N[q]?N[q]:Lq,h=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(N,{signal:q,abort:U,rejectWithValue:X,fulfillWithValue:H,dispatch:B,getState:Q,extra:K}){let $=r[N.endpointName];try{let te=A($,"transformResponse"),re={signal:q,abort:U,dispatch:B,getState:Q,extra:K,endpoint:N.endpointName,type:N.type,forced:N.type==="query"?C(N,Q()):void 0,queryCacheKey:N.type==="query"?N.queryCacheKey:void 0},pe=N.type==="query"?N[Xu]:void 0,Re,ke=/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(we,Ae,Ee,rt){if(Ae==null&&we.pages.length)return Promise.resolve({data:we});let Me={queryArg:N.originalArgs,pageParam:Ae},Ze=yield Ce(Me),at=rt?f:m;return{data:{pages:at(we.pages,Ze.data,Ee),pageParams:at(we.pageParams,Ae,Ee)}}});return function ke(_x111,_x112,_x113,_x114){return _ref41.apply(this,arguments)}}();function Ce(_x115){return _Ce.apply(this,arguments)}function _Ce(){_Ce=_asyncToGenerator(function*(we){let Ae,{extraOptions:Ee}=$;if(pe?Ae=pe():$.query?Ae=yield t($.query(we),re,Ee):Ae=yield $.queryFn(we,re,Ee,Me=>t(Me,re,Ee)),typeof process<"u",Ae.error)throw new bs(Ae.error,Ae.meta);let rt=yield te(Ae.data,Ae.meta,we);return{...Ae,data:rt}});return _Ce.apply(this,arguments)}if(N.type==="query"&&"infiniteQueryOptions"in $){let{infiniteQueryOptions:we}=$,{maxPages:Ae=1/0}=we,Ee,rt={pages:[],pageParams:[]},Me=i.selectQueryEntry(Q(),N.queryCacheKey)?.data,at=C(N,Q())&&!N.direction||!Me?rt:Me;if("direction"in N&&N.direction&&at.pages.length){let $t=N.direction==="backward",no=($t?MR:IS)(we,at);Ee=yield ke(at,no,Ae,$t)}else{let{initialPageParam:$t=we.initialPageParam}=N,ur=Me?.pageParams??[],no=ur[0]??$t,mi=ur.length;Ee=yield ke(at,no,Ae),pe&&(Ee={data:Ee.data.pages[0]});for(let gi=1;gi<mi;gi++){let uu=IS(we,Ee.data);Ee=yield ke(Ee.data,uu,Ae)}}Re=Ee}else Re=yield Ce(N.originalArgs);return H(Re.data,vp({fulfilledTimeStamp:Date.now(),baseQueryMeta:Re.meta}))}catch(te){let re=te;if(re instanceof bs){let pe=A($,"transformErrorResponse");try{return X(yield pe(re.value,re.meta,N.originalArgs),vp({baseQueryMeta:re.meta}))}catch(Re){re=Re}}throw typeof process<"u",console.error(re),re}});return function h(_x109,_x110){return _ref40.apply(this,arguments)}}();function C(N,q){let U=i.selectQueryEntry(q,N.queryCacheKey),X=i.selectConfig(q).refetchOnMountOrArgChange,H=U?.fulfilledTimeStamp,B=N.forceRefetch??(N.subscribe&&X);return B?B===!0||(Number(new Date)-Number(H))/1e3>=B:!1}let w=()=>Se(`${e}/executeQuery`,h,{getPendingMeta({arg:q}){let U=r[q.endpointName];return vp({startedTimeStamp:Date.now(),...(OS(U)?{direction:q.direction}:{})})},condition(q,{getState:U}){let X=U(),H=i.selectQueryEntry(X,q.queryCacheKey),B=H?.fulfilledTimeStamp,Q=q.originalArgs,K=H?.originalArgs,$=r[q.endpointName],te=q.direction;return ES(q)?!0:H?.status==="pending"?!1:C(q,X)||kS($)&&$?.forceRefetch?.({currentArg:Q,previousArg:K,endpointState:H,state:X})?!0:!(B&&!te)},dispatchConditionRejection:!0}),R=w(),b=w(),F=Se(`${e}/executeMutation`,h,{getPendingMeta(){return vp({startedTimeStamp:Date.now()})}}),E=N=>"force"in N,P=N=>"ifOlderThan"in N,j=(N,q,U)=>(X,H)=>{let B=E(U)&&U.force,Q=P(U)&&U.ifOlderThan,K=(te=!0)=>{let re={forceRefetch:te,isPrefetch:!0};return o.endpoints[N].initiate(q,re)},$=o.endpoints[N].select(q)(H());if(B)X(K());else if(Q){let te=$?.fulfilledTimeStamp;if(!te){X(K());return}(Number(new Date)-Number(new Date(te)))/1e3>=Q&&X(K())}else X(K(!1))};function _(N){return q=>q?.meta?.arg?.endpointName===N}function k(N,q){return{matchPending:ki(pd(N),_(q)),matchFulfilled:ki(qn(N),_(q)),matchRejected:ki(ia(N),_(q))}}return{queryThunk:R,mutationThunk:F,infiniteQueryThunk:b,prefetch:j,updateQueryData:g,upsertQueryData:S,patchQueryData:p,buildMatchThunkActions:k}}function IS(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function MR(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function VR(e,t,r,n){return NS(r[e.meta.arg.endpointName][t],qn(e)?e.payload:void 0,Ou(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function xp(e,t,r){let n=e[t];n&&r(n)}function Zu(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function wR(e,t,r){let n=e[Zu(t)];n&&r(n)}var Ju={};function Qq({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:a,extractRehydrationInfo:i,hasRehydrationInfo:p},assertTagType:f,config:m}){let g=T(`${e}/resetApiState`);function S(_,k,N,q){var U;_[U=k.queryCacheKey]??(_[U]={status:"uninitialized",endpointName:k.endpointName}),xp(_,k.queryCacheKey,X=>{X.status="pending",X.requestId=N&&X.requestId?X.requestId:q.requestId,k.originalArgs!==void 0&&(X.originalArgs=k.originalArgs),X.startedTimeStamp=q.startedTimeStamp;let H=o[q.arg.endpointName];OS(H)&&"direction"in k&&(X.direction=k.direction)})}function A(_,k,N,q){xp(_,k.arg.queryCacheKey,U=>{if(U.requestId!==k.requestId&&!q)return;let{merge:X}=o[k.arg.endpointName];if(U.status="fulfilled",X){if(U.data!==void 0){let{fulfilledTimeStamp:H,arg:B,baseQueryMeta:Q,requestId:K}=k,$=Dn(U.data,te=>X(te,N,{arg:B.originalArgs,baseQueryMeta:Q,fulfilledTimeStamp:H,requestId:K}));U.data=$}else U.data=N;}else U.data=o[k.arg.endpointName].structuralSharing??!0?OR(nr(U.data)?iy(U.data):U.data,N):N;delete U.error,U.fulfilledTimeStamp=k.fulfilledTimeStamp})}let h=sa({name:`${e}/queries`,initialState:Ju,reducers:{removeQueryResult:{reducer(_,{payload:{queryCacheKey:k}}){delete _[k]},prepare:Oi()},cacheEntriesUpserted:{reducer(_,k){for(let N of k.payload){let{queryDescription:q,value:U}=N;S(_,q,!0,{arg:q,requestId:k.meta.requestId,startedTimeStamp:k.meta.timestamp}),A(_,{arg:q,requestId:k.meta.requestId,fulfilledTimeStamp:k.meta.timestamp,baseQueryMeta:{}},U,!0)}},prepare:_=>({payload:_.map(q=>{let{endpointName:U,arg:X,value:H}=q,B=o[U];return{queryDescription:{type:"query",endpointName:U,originalArgs:q.arg,queryCacheKey:n({queryArgs:X,endpointDefinition:B,endpointName:U})},value:H}}),meta:{[Pu]:!0,requestId:Nu(),timestamp:Date.now()}})},queryResultPatched:{reducer(_,{payload:{queryCacheKey:k,patches:N}}){xp(_,k,q=>{q.data=cy(q.data,N.concat())})},prepare:Oi()}},extraReducers(_){_.addCase(t.pending,(k,{meta:N,meta:{arg:q}})=>{let U=ES(q);S(k,q,U,N)}).addCase(t.fulfilled,(k,{meta:N,payload:q})=>{let U=ES(N.arg);A(k,N,q,U)}).addCase(t.rejected,(k,{meta:{condition:N,arg:q,requestId:U},error:X,payload:H})=>{xp(k,q.queryCacheKey,B=>{if(!N){if(B.requestId!==U)return;B.status="rejected",B.error=H??X}})}).addMatcher(p,(k,N)=>{let{queries:q}=i(N);for(let[U,X]of Object.entries(q))(X?.status==="fulfilled"||X?.status==="rejected")&&(k[U]=X)})}}),C=sa({name:`${e}/mutations`,initialState:Ju,reducers:{removeMutationResult:{reducer(_,{payload:k}){let N=Zu(k);N in _&&delete _[N]},prepare:Oi()}},extraReducers(_){_.addCase(r.pending,(k,{meta:N,meta:{requestId:q,arg:U,startedTimeStamp:X}})=>{U.track&&(k[Zu(N)]={requestId:q,status:"pending",endpointName:U.endpointName,startedTimeStamp:X})}).addCase(r.fulfilled,(k,{payload:N,meta:q})=>{q.arg.track&&wR(k,q,U=>{U.requestId===q.requestId&&(U.status="fulfilled",U.data=N,U.fulfilledTimeStamp=q.fulfilledTimeStamp)})}).addCase(r.rejected,(k,{payload:N,error:q,meta:U})=>{U.arg.track&&wR(k,U,X=>{X.requestId===U.requestId&&(X.status="rejected",X.error=N??q)})}).addMatcher(p,(k,N)=>{let{mutations:q}=i(N);for(let[U,X]of Object.entries(q))(X?.status==="fulfilled"||X?.status==="rejected")&&U!==X?.requestId&&(k[U]=X)})}}),w=sa({name:`${e}/invalidation`,initialState:Ju,reducers:{updateProvidedBy:{reducer(_,k){var U,X;let{queryCacheKey:N,providedTags:q}=k.payload;for(let H of Object.values(_))for(let B of Object.values(H)){let Q=B.indexOf(N);Q!==-1&&B.splice(Q,1)}for(let{type:H,id:B}of q){let Q=(U=_[H]??(_[H]={}))[X=B||"__internal_without_id"]??(U[X]=[]);Q.includes(N)||Q.push(N)}},prepare:Oi()}},extraReducers(_){_.addCase(h.actions.removeQueryResult,(k,{payload:{queryCacheKey:N}})=>{for(let q of Object.values(k))for(let U of Object.values(q)){let X=U.indexOf(N);X!==-1&&U.splice(X,1)}}).addMatcher(p,(k,N)=>{var U,X;let{provided:q}=i(N);for(let[H,B]of Object.entries(q))for(let[Q,K]of Object.entries(B)){let $=(U=k[H]??(k[H]={}))[X=Q||"__internal_without_id"]??(U[X]=[]);for(let te of K)$.includes(te)||$.push(te)}}).addMatcher(Br(qn(t),Ou(t)),(k,N)=>{let q=VR(N,"providesTags",o,f),{queryCacheKey:U}=N.meta.arg;w.caseReducers.updateProvidedBy(k,w.actions.updateProvidedBy({queryCacheKey:U,providedTags:q}))})}}),R=sa({name:`${e}/subscriptions`,initialState:Ju,reducers:{updateSubscriptionOptions(_,k){},unsubscribeQueryResult(_,k){},internal_getRTKQSubscriptions(){}}}),b=sa({name:`${e}/internalSubscriptions`,initialState:Ju,reducers:{subscriptionsUpdated:{reducer(_,k){return cy(_,k.payload)},prepare:Oi()}}}),F=sa({name:`${e}/config`,initialState:{online:Fq(),focused:wq(),middlewareRegistered:!1,...m},reducers:{middlewareRegistered(_,{payload:k}){_.middlewareRegistered=_.middlewareRegistered==="conflict"||a!==k?"conflict":!0}},extraReducers:_=>{_.addCase(PS,k=>{k.online=!0}).addCase(qR,k=>{k.online=!1}).addCase(TS,k=>{k.focused=!0}).addCase(DR,k=>{k.focused=!1}).addMatcher(p,k=>({...k}))}}),E=Ri({queries:h.reducer,mutations:C.reducer,provided:w.reducer,subscriptions:b.reducer,config:F.reducer}),P=(_,k)=>E(g.match(k)?void 0:_,k),j={...F.actions,...h.actions,...R.actions,...b.actions,...C.actions,...w.actions,resetApiState:g};return{reducer:P,actions:j}}var ga=Symbol.for("RTKQ/skipToken"),jR={status:"uninitialized"},FR=Dn(jR,()=>{}),ER=Dn(jR,()=>{});function Bq({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=E=>FR,o=E=>ER;return{buildQuerySelector:A,buildInfiniteQuerySelector:h,buildMutationSelector:C,selectInvalidatedBy:w,selectCachedArgsForQuery:R,selectApiState:i,selectQueries:p,selectMutations:m,selectQueryEntry:f,selectConfig:g};function a(E){return{...E,...vR(E.status)}}function i(E){return E[t]}function p(E){return i(E)?.queries}function f(E,P){return p(E)?.[P]}function m(E){return i(E)?.mutations}function g(E){return i(E)?.config}function S(E,P,j){return _=>{if(_===ga)return r(n,j);let k=e({queryArgs:_,endpointDefinition:P,endpointName:E});return r(q=>f(q,k)??FR,j)}}function A(E,P){return S(E,P,a)}function h(E,P){let{infiniteQueryOptions:j}=P;function _(k){let N={...k,...vR(k.status)},{isLoading:q,isError:U,direction:X}=N,H=X==="forward",B=X==="backward";return{...N,hasNextPage:b(j,N.data),hasPreviousPage:F(j,N.data),isFetchingNextPage:q&&H,isFetchingPreviousPage:q&&B,isFetchNextPageError:U&&H,isFetchPreviousPageError:U&&B}}return S(E,P,_)}function C(){return E=>{let P;return typeof E=="object"?P=Zu(E)??ga:P=E,r(P===ga?o:k=>i(k)?.mutations?.[P]??ER,a)}}function w(E,P){let j=E[t],_=new Set;for(let k of P.filter(Ap).map(FS)){let N=j.provided[k.type];if(!N)continue;let q=(k.id!==void 0?N[k.id]:AR(Object.values(N)))??[];for(let U of q)_.add(U)}return AR(Array.from(_.values()).map(k=>{let N=j.queries[k];return N?[{queryCacheKey:k,endpointName:N.endpointName,originalArgs:N.originalArgs}]:[]}))}function R(E,P){return Object.values(p(E)).filter(j=>j?.endpointName===P&&j.status!=="uninitialized").map(j=>j.originalArgs)}function b(E,P){return P?IS(E,P)!=null:!1}function F(E,P){return!P||!E.getPreviousPageParam?!1:MR(E,P)!=null}}var IR=WeakMap?new WeakMap:void 0,TR=({endpointName:e,queryArgs:t})=>{let r="",n=IR?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(a,i)=>(i=typeof i=="bigint"?{$bigint:i.toString()}:i,i=Qr(i)?Object.keys(i).sort().reduce((p,f)=>(p[f]=i[f],p),{}):i,i));Qr(t)&&IR?.set(t,o),r=o}return`${e}(${r})`};function Gq(...e){return function(r){let n=Ti(m=>r.extractRehydrationInfo?.(m,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(m){let g=TR;if("serializeQueryArgs"in m.endpointDefinition){let S=m.endpointDefinition.serializeQueryArgs;g=A=>{let h=S(A);return typeof h=="string"?h:TR({...A,queryArgs:h})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(m)},tagTypes:[...(r.tagTypes||[])]},a={endpointDefinitions:{},batch(m){m()},apiUid:Nu(),extractRehydrationInfo:n,hasRehydrationInfo:Ti(m=>n(m)!=null)},i={injectEndpoints:f,enhanceEndpoints({addTagTypes:m,endpoints:g}){if(m)for(let S of m)o.tagTypes.includes(S)||o.tagTypes.push(S);if(g)for(let[S,A]of Object.entries(g))typeof A=="function"?A(a.endpointDefinitions[S]):Object.assign(a.endpointDefinitions[S]||{},A);return i}},p=e.map(m=>m.init(i,o,a));function f(m){let g=m.endpoints({query:S=>({...S,type:"query"}),mutation:S=>({...S,type:"mutation"}),infiniteQuery:S=>({...S,type:"infinitequery"})});for(let[S,A]of Object.entries(g)){if(m.overrideExisting!==!0&&S in a.endpointDefinitions){if(m.overrideExisting==="throw")throw new Error(Bt(39));typeof process<"u";continue}typeof process<"u",a.endpointDefinitions[S]=A;for(let h of p)h.injectEndpoint(S,A)}return i}return i.injectEndpoints({endpoints:r.endpoints})}}function Un(e,...t){return Object.assign(e,...t)}var $q=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,o=null,a=null,{updateSubscriptionOptions:i,unsubscribeQueryResult:p}=e.internalActions,f=(h,C)=>{var R,b;if(i.match(C)){let{queryCacheKey:F,requestId:E,options:P}=C.payload;return h?.[F]?.[E]&&(h[F][E]=P),!0}if(p.match(C)){let{queryCacheKey:F,requestId:E}=C.payload;return h[F]&&delete h[F][E],!0}if(e.internalActions.removeQueryResult.match(C))return delete h[C.payload.queryCacheKey],!0;if(t.pending.match(C)){let{meta:{arg:F,requestId:E}}=C,P=h[R=F.queryCacheKey]??(h[R]={});return P[`${E}_running`]={},F.subscribe&&(P[E]=F.subscriptionOptions??P[E]??{}),!0}let w=!1;if(t.fulfilled.match(C)||t.rejected.match(C)){let F=h[C.meta.arg.queryCacheKey]||{},E=`${C.meta.requestId}_running`;w||(w=!!F[E]),delete F[E]}if(t.rejected.match(C)){let{meta:{condition:F,arg:E,requestId:P}}=C;if(F&&E.subscribe){let j=h[b=E.queryCacheKey]??(h[b]={});j[P]=E.subscriptionOptions??j[P]??{},w=!0}}return w},m=()=>r.currentSubscriptions,A={getSubscriptions:m,getSubscriptionCount:h=>{let w=m()[h]??{};return Cs(w)},isRequestSubscribed:(h,C)=>!!m()?.[h]?.[C]};return(h,C)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(h))return o=r.currentSubscriptions={},a=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(h))return[!1,A];let w=f(r.currentSubscriptions,h),R=!0;if(w){a||(a=setTimeout(()=>{let E=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,P]=id(o,()=>E);C.next(e.internalActions.subscriptionsUpdated(P)),o=E,a=null},500));let b=typeof h.type=="string"&&!!h.type.startsWith(n),F=t.rejected.match(h)&&h.meta.condition&&!!h.meta.arg.subscribe;R=!b&&!F}return[R,!1]}};function Hq(e){for(let t in e)return!1;return!0}var zq=2147483647/1e3-1,Wq=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:a,selectConfig:i}})=>{let{removeQueryResult:p,unsubscribeQueryResult:f,cacheEntriesUpserted:m}=t.internalActions,g=Br(f.match,r.fulfilled,r.rejected,m.match);function S(R){let b=o.currentSubscriptions[R];return!!b&&!Hq(b)}let A={},h=(R,b,F)=>{let E=b.getState(),P=i(E);if(g(R)){let j;if(m.match(R))j=R.payload.map(_=>_.queryDescription.queryCacheKey);else{let{queryCacheKey:_}=f.match(R)?R.payload:R.meta.arg;j=[_]}C(j,b,P)}if(t.util.resetApiState.match(R))for(let[j,_]of Object.entries(A))_&&clearTimeout(_),delete A[j];if(n.hasRehydrationInfo(R)){let{queries:j}=n.extractRehydrationInfo(R);C(Object.keys(j),b,P)}};function C(R,b,F){let E=b.getState();for(let P of R){let j=a(E,P);w(P,j?.endpointName,b,F)}}function w(R,b,F,E){let j=n.endpointDefinitions[b]?.keepUnusedDataFor??E.keepUnusedDataFor;if(j===1/0)return;let _=Math.max(0,Math.min(j,zq));if(!S(R)){let k=A[R];k&&clearTimeout(k),A[R]=setTimeout(()=>{S(R)||F.dispatch(p({queryCacheKey:R})),delete A[R]},_*1e3)}}return h},PR=new Error("Promise never resolved before cacheEntryRemoved."),Kq=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:a,selectors:{selectQueryEntry:i,selectApiState:p}})=>{let f=fd(n),m=fd(o),g=qn(n,o),S={};function A(b,F,E){let P=S[b];P?.valueResolved&&(P.valueResolved({data:F,meta:E}),delete P.valueResolved)}function h(b){let F=S[b];F&&(delete S[b],F.cacheEntryRemoved())}let C=(b,F,E)=>{let P=w(b);function j(_,k,N,q){let U=i(E,k),X=i(F.getState(),k);!U&&X&&R(_,q,k,F,N)}if(n.pending.match(b))j(b.meta.arg.endpointName,P,b.meta.requestId,b.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(b))for(let{queryDescription:_,value:k}of b.payload){let{endpointName:N,originalArgs:q,queryCacheKey:U}=_;j(N,U,b.meta.requestId,q),A(U,k,{})}else if(o.pending.match(b))F.getState()[t].mutations[P]&&R(b.meta.arg.endpointName,b.meta.arg.originalArgs,P,F,b.meta.requestId);else if(g(b))A(P,b.payload,b.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(b)||e.internalActions.removeMutationResult.match(b))h(P);else if(e.util.resetApiState.match(b))for(let _ of Object.keys(S))h(_)};function w(b){return f(b)?b.meta.arg.queryCacheKey:m(b)?b.meta.arg.fixedCacheKey??b.meta.requestId:e.internalActions.removeQueryResult.match(b)?b.payload.queryCacheKey:e.internalActions.removeMutationResult.match(b)?Zu(b.payload):""}function R(b,F,E,P,j){let _=r.endpointDefinitions[b],k=_?.onCacheEntryAdded;if(!k)return;let N={},q=new Promise(K=>{N.cacheEntryRemoved=K}),U=Promise.race([new Promise(K=>{N.valueResolved=K}),q.then(()=>{throw PR})]);U.catch(()=>{}),S[E]=N;let X=e.endpoints[b].select(_.type==="query"?F:E),H=P.dispatch((K,$,te)=>te),B={...P,getCacheEntry:()=>X(P.getState()),requestId:j,extra:H,updateCachedData:_.type==="query"?K=>P.dispatch(e.util.updateQueryData(b,F,K)):void 0,cacheDataLoaded:U,cacheEntryRemoved:q},Q=k(F,B);Promise.resolve(Q).catch(K=>{if(K!==PR)throw K})}return C},Yq=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},Jq=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:a,assertTagType:i,refetchQuery:p,internalState:f})=>{let{removeQueryResult:m}=a.internalActions,g=Br(qn(n),Ou(n)),S=Br(qn(n,o),ia(n,o)),A=[],h=(R,b)=>{g(R)?w(VR(R,"invalidatesTags",r,i),b):S(R)?w([],b):a.util.invalidateTags.match(R)&&w(NS(R.payload,void 0,void 0,void 0,void 0,i),b)};function C(R){let{queries:b,mutations:F}=R;for(let E of[b,F])for(let P in E)if(E[P]?.status==="pending")return!0;return!1}function w(R,b){let F=b.getState(),E=F[e];if(A.push(...R),E.config.invalidationBehavior==="delayed"&&C(E))return;let P=A;if(A=[],P.length===0)return;let j=a.util.selectInvalidatedBy(F,P);t.batch(()=>{let _=Array.from(j.values());for(let{queryCacheKey:k}of _){let N=E.queries[k],q=f.currentSubscriptions[k]??{};N&&(Cs(q)===0?b.dispatch(m({queryCacheKey:k})):N.status!=="uninitialized"&&b.dispatch(p(N)))}})}return h},Xq=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let a={},i=(h,C)=>{(r.internalActions.updateSubscriptionOptions.match(h)||r.internalActions.unsubscribeQueryResult.match(h))&&m(h.payload,C),(t.pending.match(h)||t.rejected.match(h)&&h.meta.condition)&&m(h.meta.arg,C),(t.fulfilled.match(h)||t.rejected.match(h)&&!h.meta.condition)&&f(h.meta.arg,C),r.util.resetApiState.match(h)&&S()};function p(h,C){let R=C.getState()[e].queries[h],b=o.currentSubscriptions[h];if(!(!R||R.status==="uninitialized"))return b}function f({queryCacheKey:h},C){let w=C.getState()[e],R=w.queries[h],b=o.currentSubscriptions[h];if(!R||R.status==="uninitialized")return;let{lowestPollingInterval:F,skipPollingIfUnfocused:E}=A(b);if(!Number.isFinite(F))return;let P=a[h];P?.timeout&&(clearTimeout(P.timeout),P.timeout=void 0);let j=Date.now()+F;a[h]={nextPollTimestamp:j,pollingInterval:F,timeout:setTimeout(()=>{(w.config.focused||!E)&&C.dispatch(n(R)),f({queryCacheKey:h},C)},F)}}function m({queryCacheKey:h},C){let R=C.getState()[e].queries[h],b=o.currentSubscriptions[h];if(!R||R.status==="uninitialized")return;let{lowestPollingInterval:F}=A(b);if(!Number.isFinite(F)){g(h);return}let E=a[h],P=Date.now()+F;(!E||P<E.nextPollTimestamp)&&f({queryCacheKey:h},C)}function g(h){let C=a[h];C?.timeout&&clearTimeout(C.timeout),delete a[h]}function S(){for(let h of Object.keys(a))g(h)}function A(h={}){let C=!1,w=Number.POSITIVE_INFINITY;for(let R in h)h[R].pollingInterval&&(w=Math.min(h[R].pollingInterval,w),C=h[R].skipPollingIfUnfocused||C);return{lowestPollingInterval:w,skipPollingIfUnfocused:C}}return i},Zq=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=pd(r,n),a=ia(r,n),i=qn(r,n),p={};return(m,g)=>{if(o(m)){let{requestId:S,arg:{endpointName:A,originalArgs:h}}=m.meta,C=t.endpointDefinitions[A],w=C?.onQueryStarted;if(w){let R={},b=new Promise((j,_)=>{R.resolve=j,R.reject=_});b.catch(()=>{}),p[S]=R;let F=e.endpoints[A].select(C.type==="query"?h:S),E=g.dispatch((j,_,k)=>k),P={...g,getCacheEntry:()=>F(g.getState()),requestId:S,extra:E,updateCachedData:C.type==="query"?j=>g.dispatch(e.util.updateQueryData(A,h,j)):void 0,queryFulfilled:b};w(h,P)}}else if(i(m)){let{requestId:S,baseQueryMeta:A}=m.meta;p[S]?.resolve({data:m.payload,meta:A}),delete p[S]}else if(a(m)){let{requestId:S,rejectedWithValue:A,baseQueryMeta:h}=m.meta;p[S]?.reject({error:m.payload??m.error,isUnhandledError:!A,meta:h}),delete p[S]}}},eM=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:a}=r.internalActions,i=(f,m)=>{TS.match(f)&&p(m,"refetchOnFocus"),PS.match(f)&&p(m,"refetchOnReconnect")};function p(f,m){let g=f.getState()[e],S=g.queries,A=o.currentSubscriptions;t.batch(()=>{for(let h of Object.keys(A)){let C=S[h],w=A[h];if(!w||!C)continue;(Object.values(w).some(b=>b[m]===!0)||Object.values(w).every(b=>b[m]===void 0)&&g.config[m])&&(Cs(w)===0?f.dispatch(a({queryCacheKey:h})):C.status!=="uninitialized"&&f.dispatch(n(C)))}})}return i};function tM(e){let{reducerPath:t,queryThunk:r,api:n,context:o}=e,{apiUid:a}=o,i={invalidateTags:T(`${t}/invalidateTags`)},p=S=>S.type.startsWith(`${t}/`),f=[Yq,Wq,Jq,Xq,Kq,Zq];return{middleware:S=>{let A=!1,C={...e,internalState:{currentSubscriptions:{}},refetchQuery:g,isThisApiSliceAction:p},w=f.map(F=>F(C)),R=$q(C),b=eM(C);return F=>E=>{if(!Fi(E))return F(E);A||(A=!0,S.dispatch(n.internalActions.middlewareRegistered(a)));let P={...S,next:F},j=S.getState(),[_,k]=R(E,P,j),N;if(_?N=F(E):N=k,S.getState()[t]&&(b(E,P,j),p(E)||o.hasRehydrationInfo(E)))for(let q of w)q(E,P,j);return N}},actions:i};function g(S){return e.api.endpoints[S.endpointName].initiate(S.originalArgs,{subscribe:!1,forceRefetch:!0})}}var kR=Symbol(),rM=({createSelector:e=Ye}={})=>({name:kR,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:a,keepUnusedDataFor:i,refetchOnMountOrArgChange:p,refetchOnFocus:f,refetchOnReconnect:m,invalidationBehavior:g},S){QA();let A=Ce=>(typeof process<"u",Ce);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:PS,onOffline:qR,onFocus:TS,onFocusLost:DR},util:{}});let h=Bq({serializeQueryArgs:a,reducerPath:o,createSelector:e}),{selectInvalidatedBy:C,selectCachedArgsForQuery:w,buildQuerySelector:R,buildInfiniteQuerySelector:b,buildMutationSelector:F}=h;Un(t.util,{selectInvalidatedBy:C,selectCachedArgsForQuery:w});let{queryThunk:E,infiniteQueryThunk:P,mutationThunk:j,patchQueryData:_,updateQueryData:k,upsertQueryData:N,prefetch:q,buildMatchThunkActions:U}=Uq({baseQuery:r,reducerPath:o,context:S,api:t,serializeQueryArgs:a,assertTagType:A,selectors:h}),{reducer:X,actions:H}=Qq({context:S,queryThunk:E,infiniteQueryThunk:P,mutationThunk:j,serializeQueryArgs:a,reducerPath:o,assertTagType:A,config:{refetchOnFocus:f,refetchOnReconnect:m,refetchOnMountOrArgChange:p,keepUnusedDataFor:i,reducerPath:o,invalidationBehavior:g}});Un(t.util,{patchQueryData:_,updateQueryData:k,upsertQueryData:N,prefetch:q,resetApiState:H.resetApiState,upsertQueryEntries:H.cacheEntriesUpserted}),Un(t.internalActions,H);let{middleware:B,actions:Q}=tM({reducerPath:o,context:S,queryThunk:E,mutationThunk:j,infiniteQueryThunk:P,api:t,assertTagType:A,selectors:h});Un(t.util,Q),Un(t,{reducer:X,middleware:B});let{buildInitiateQuery:K,buildInitiateInfiniteQuery:$,buildInitiateMutation:te,getRunningMutationThunk:re,getRunningMutationsThunk:pe,getRunningQueriesThunk:Re,getRunningQueryThunk:ke}=jq({queryThunk:E,mutationThunk:j,infiniteQueryThunk:P,api:t,serializeQueryArgs:a,context:S});return Un(t.util,{getRunningMutationThunk:re,getRunningMutationsThunk:pe,getRunningQueryThunk:ke,getRunningQueriesThunk:Re}),{name:kR,injectEndpoint(Ce,we){var rt;let Ee=(rt=t.endpoints)[Ce]??(rt[Ce]={});kS(we)&&Un(Ee,{name:Ce,select:R(Ce,we),initiate:K(Ce,we)},U(E,Ce)),qq(we)&&Un(Ee,{name:Ce,select:F(),initiate:te(Ce)},U(j,Ce)),OS(we)&&Un(Ee,{name:Ce,select:b(Ce,we),initiate:$(Ce,we)},U(E,Ce))}}}}),LR=Gq(rM());d();c();l();u();d();c();l();u();var ha=e=>e.query,UR=e=>e.query?.enableQuerySyntax;var QR=Ye(e=>ha(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})),Cp=Ye(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();l();u();d();c();l();u();var bp=e=>{if(e==="yes")return!0;if(e==="no")return!1},nM=()=>Y("analytics/generatedAnswer/retry",e=>e.makeRetryGeneratedAnswer());function oM(e,t){return Y({prefix:"analytics/generatedAnswer/openAnswerSource",__legacy__getBuilder:(r,n)=>{let o=t??$e(n),a=Uu(n,e);return!o||!a?null:r.makeGeneratedAnswerCitationClick(wb(a,n),{generativeQuestionAnsweringId:o,citationId:a.id,documentId:Fb(a)})},analyticsType:"Rga.CitationClick",analyticsPayloadBuilder:r=>{let n=Uu(r,e);return{answerId:t??$e(r)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:n?.permanentid??"",title:n?.title,url:n?.clickUri}}}})}function aM(e,t,r){return Y({prefix:"analytics/generatedAnswer/hoverCitation",__legacy__getBuilder:(n,o)=>{let a=r??$e(o),i=Uu(o,e);return!a||!i?null:n.makeGeneratedAnswerSourceHover({generativeQuestionAnsweringId:a,permanentId:i.permanentid,citationId:i.id,citationHoverTimeMs:t})},analyticsType:"Rga.CitationHover",analyticsPayloadBuilder:n=>{let o=Uu(n,e);return{answerId:r??$e(n)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:o?.permanentid??"",title:o?.title,url:o?.clickUri},citationHoverTimeInMs:t}}})}function iM(e){return Y({prefix:"analytics/generatedAnswer/like",__legacy__getBuilder:(t,r)=>{let n=e??$e(r);return n?t.makeLikeGeneratedAnswer({generativeQuestionAnsweringId:n}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??$e(t)??"",action:"like"})})}function sM(e){return Y({prefix:"analytics/generatedAnswer/dislike",__legacy__getBuilder:(t,r)=>{let n=e??$e(r);return n?t.makeDislikeGeneratedAnswer({generativeQuestionAnsweringId:n}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??$e(t)??"",action:"dislike"})})}var cM=e=>Y({prefix:"analytics/generatedAnswer/sendFeedback",__legacy__getBuilder:(t,r)=>{let n=$e(r);return n?t.makeGeneratedAnswerFeedbackSubmitV2({generativeQuestionAnsweringId:n,...e}):null},analyticsType:"Rga.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=$e(t),{helpful:n,readable:o,documented:a,hallucinationFree:i,correctTopic:p,documentUrl:f,details:m}=e;return{answerId:r??"",helpful:n,details:{readable:bp(o),documented:bp(a),correctTopic:bp(p),hallucinationFree:bp(i)},additionalNotes:m,correctAnswerUrl:f}}}),ya=e=>Y({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=$e(r),o=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:o}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:$e(t)??"",answerGenerated:e??!1})}),Rs=()=>Y({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",responseId:e.search?.searchResponseId||e.search?.response.searchUid||""})}),uM=()=>Y({prefix:"analytics/generatedAnswer/show",__legacy__getBuilder:(e,t)=>{let r=$e(t);return r?e.makeGeneratedAnswerShowAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",action:"show"})}),lM=()=>Y({prefix:"analytics/generatedAnswer/hide",__legacy__getBuilder:(e,t)=>{let r=$e(t);return r?e.makeGeneratedAnswerHideAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",action:"hide"})}),dM=()=>Y({prefix:"analytics/generatedAnswer/expand",__legacy__getBuilder:(e,t)=>{let r=$e(t);return r?e.makeGeneratedAnswerExpand({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",action:"expand"})}),pM=()=>Y({prefix:"analytics/generatedAnswer/collapse",__legacy__getBuilder:(e,t)=>{let r=$e(t);return r?e.makeGeneratedAnswerCollapse({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",action:"collapse"})});function fM(e){return Y({prefix:"analytics/generatedAnswer/copy",__legacy__getBuilder:(t,r)=>{let n=e??$e(r);return n?t.makeGeneratedAnswerCopyToClipboard({generativeQuestionAnsweringId:n}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??$e(t)??"",action:"copyToClipboard"})})}var ws={logCopyGeneratedAnswer:fM,logGeneratedAnswerHideAnswers:lM,logGeneratedAnswerShowAnswers:uM,logGeneratedAnswerStreamEnd:ya,logGeneratedAnswerFeedback:cM,logDislikeGeneratedAnswer:sM,logLikeGeneratedAnswer:iM,logHoverCitation:aM,logOpenGeneratedAnswerSource:oM,logRetryGeneratedAnswer:nM,logGeneratedAnswerExpand:dM,logGeneratedAnswerCollapse:pM};d();c();l();u();d();c();l();u();var BR=Ye(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});d();c();l();u();var GR=e=>e.context;d();c();l();u();var _S=e=>e.pipeline;d();c();l();u();var DS=e=>e.searchHub;d();c();l();u();var Gt=Ye(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),coe=Ye(e=>e,e=>{let t=Gt(e);return t&&e?e[t].expression:""});d();c();l();u();var $R=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var HR=e=>e.excerptLength?.length;d();c();l();u();var Xr=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,zR=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var WR=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};d();c();l();u();var KR=e=>e.sortCriteria;var YR=/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Ft(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function YR(_x116){return _ref42.apply(this,arguments)}}(),JR=(e,t)=>{let r=ha(e)?.q,{aq:n,cq:o,dq:a,lq:i}=gM(e),p=GR(e),f=Ln(e.configuration.analytics,t,{actionCause:bS(e)}),m=DS(e),g=_S(e),S=zy(e)??[],A=ZR(e),h=Gt(e.tabSet)||"default",C=$y(e),w=mb(e),R=t.referrer||"",b=zR(e),F=KR(e),E=mM(e),P=HR(e),j=WR(e),_=$R(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(a&&{dq:a}),...(i&&{lq:i}),...(e.query&&{enableQuerySyntax:UR(e)}),...(p?.contextValues&&{context:p.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:S}},...(m?.length&&{searchHub:m}),...(g?.length&&{pipeline:g}),...(A.length&&{facets:A}),...(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:AS(e),firstResult:e.pagination.firstResult}),tab:h,locale:C,timezone:w,...(e.debug!==void 0&&{debug:e.debug}),referrer:R,...E,...(j??{}),...(P&&{excerptLength:P}),...(_&&{dictionaryFieldContext:_}),sortCriteria:F,...(b&&{facetOptions:b}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},XR=(e,t)=>{let r=ha(e)?.q,n=ZR(e),o=Ln(e.configuration.analytics,t,{actionCause:bS(e)}),a=$y(e),i=DS(e),p=_S(e),f=zy(e)??[];return{q:r||"",...(n.length&&{facets:n}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:f}},...(i?.length&&{searchHub:i}),...(p?.length&&{pipeline:p}),...o,locale:a}},ZR=e=>yp(e)?.map(t=>mS(t,fS())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),mM=e=>({actionsHistory:e.configuration.analytics.enabled?Wt.getInstance().getHistory():[]}),gM=e=>{let t=BR(e),r=CS(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var Fs=["searching","thinking","answering"];function qS(){return{id:"",isVisible:!0,isEnabled:!0,isLoading:!1,isStreaming:!1,citations:[],liked:!1,disliked:!1,responseFormat:{contentFormat:["text/plain"]},feedbackModalOpen:!1,feedbackSubmitted:!1,fieldsToIncludeInCitations:[],isAnswerGenerated:!1,expanded:!1,cannotAnswer:!1,answerApiQueryParams:void 0,answerId:void 0,answerGenerationMode:"automatic",generationSteps:[]}}d();c();l();u();var ew=["text/plain","text/markdown"];var Es=new M({required:!0}),tw=new M,Is=new ce({required:!0}),MS={id:Es,title:Es,uri:Es,permanentid:Es,clickUri:tw},Rp=new M({required:!0,constrainTo:ew}),Ts=T("generatedAnswer/setIsVisible",e=>O(e,Is)),Ps=T("generatedAnswer/setAnswerId",e=>O(e,z)),wp=T("generatedAnswer/setAnswerGenerationMode",e=>O(e,new M({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),el=T("generatedAnswer/setIsEnabled",e=>O(e,Is)),va=T("generatedAnswer/updateMessage",e=>O(e,{textDelta:Es})),xa=T("generatedAnswer/updateCitations",e=>O(e,{citations:new ae({required:!0,each:new J({values:MS})})})),Aa=T("generatedAnswer/updateError",e=>O(e,{message:tw,code:new ee({min:0})})),sr=T("generatedAnswer/resetAnswer"),Fp=T("generatedAnswer/like"),Ep=T("generatedAnswer/dislike"),Ip=T("generatedAnswer/feedbackModal/open"),tl=T("generatedAnswer/expand"),Tp=T("generatedAnswer/collapse"),Pp=T("generatedAnswer/setId",e=>O(e,{id:new M({required:!0})})),kp=T("generatedAnswer/feedbackModal/close"),ks=T("generatedAnswer/sendFeedback"),Zr=T("generatedAnswer/setIsLoading",e=>O(e,Is)),Sa=T("generatedAnswer/setIsStreaming",e=>O(e,Is)),Ca=T("generatedAnswer/setAnswerContentFormat",e=>O(e,Rp)),Op=T("generatedAnswer/updateResponseFormat",e=>O(e,{contentFormat:new ae({each:Rp,default:["text/plain"]})})),Np=T("knowledge/updateAnswerConfigurationId",e=>O(e,Es)),_p=T("generatedAnswer/registerFieldsToIncludeInCitations",e=>O(e,Zl)),rl=T("generatedAnswer/setIsAnswerGenerated",e=>O(e,Is)),ba=T("generatedAnswer/setCannotAnswer",e=>O(e,Is)),VS=T("generatedAnswer/setAnswerApiQueryParams",e=>O(e,new J({}))),Dp=T("generatedAnswer/startStep",e=>O(e,{name:new M({required:!0,constrainTo:Fs}),startedAt:new ee({min:0,required:!0})})),qp=T("generatedAnswer/finishStep",e=>O(e,{name:new M({required:!0,constrainTo:Fs}),finishedAt:new ee({min:0,required:!0})})),rw=Se("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:a}=t,{search:i}=a(),{queryExecuted:p}=i,{setAbortControllerRef:f}=e,m=yield YR(r),g=(h,C)=>{switch(h){case"genqa.headerMessageType":{let w=JSON.parse(C);n(Ca(w.contentFormat));break}case"genqa.messageType":n(va(JSON.parse(C)));break;case"genqa.citationsType":n(xa(JSON.parse(C)));break;case"genqa.endOfStreamType":{let w=JSON.parse(C).answerGenerated,R=p.length!==0&&!w;n(ba(R)),n(Sa(!1)),n(rl(w)),n(ya(w)),n(Rs());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${h}"`)}};n(Zr(!0));let S=h=>h.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,A=o.streamingClient?.streamGeneratedAnswer(m,{write:h=>{S(m)&&(n(Zr(!1)),h.payload&&h.payloadType&&g(h.payloadType,h.payload))},abort:h=>{S(m)&&n(Aa(h))},close:()=>{S(m)&&n(Sa(!1))},resetAnswer:()=>{S(m)&&n(sr())}});A?f(A):n(Zr(!1))});return function(_x117,_x118){return _ref43.apply(this,arguments)}}()),Mp=Se("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(sr());let a=t();if(a.generatedAnswer.answerConfigurationId){let i=JR(a,n);r(VS(i)),yield r(Vp(i))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x119,_x120){return _ref44.apply(this,arguments)}}());d();c();l();u();var hM=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:a,organizationId:i}=n.configuration,p=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let m=Ft(i,a);return{data:NR({baseUrl:`${m}/rest/organizations/${i}/answer/v1/configs/${p}`,fetchFn:function(){var _ref46=_asyncToGenerator(function*(S){if(S instanceof String)throw new Error("The provided 'request' must be a Request object.");let A=S.url,h={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(C=>{h[C]=S[C]}),h.duplex="half",h.body=yield S.text(),v(A,h)});return function fetchFn(_x124){return _ref46.apply(this,arguments)}}()})(f,{...t,signal:null},r)}}catch(m){return{error:m}}});return function hM(_x121,_x122,_x123){return _ref45.apply(this,arguments)}}(),jp=LR({reducerPath:"answer",baseQuery:_R(hM,{maxRetries:3}),endpoints:()=>({})});var yM=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},SM=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},vM=(e,t)=>{e.citations=t.citations},xM=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},AM=(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})`)},CM=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&AM(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(yM(t,o),r(Ca(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(SM(t,o),r(va({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(vM(t,o),r(xa({citations:o.citations})));break;case"genqa.endOfStreamType":xM(t,o),r(ya(o.answerGenerated??!1)),r(Rs());break}},bM=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,a=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${a}/${r}/generate`},Ra=jp.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(_x125,_x126){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:a}){yield n;let{configuration:i,generatedAnswer:p,insightConfiguration:f}=r(),{organizationId:m,environment:g,accessToken:S}=i,A=Ft(m,g),h=bM(A,m,p.answerConfigurationId,f?.insightId);yield $l(h,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${S}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:v,onopen:function(){var _ref47=_asyncToGenerator(function*(C){let w=C.headers.get("x-answer-id");w&&o(R=>{R.answerId=w,a(Ps(w))})});return function onopen(_x127){return _ref47.apply(this,arguments)}}(),onmessage:C=>{o(w=>{CM(C,w,a)})},onerror:C=>{throw C},onclose:()=>{o(C=>{a(ba(!C.generated))})}})}).apply(this,arguments)}})})}),Vp=e=>Ra.endpoints.getAnswer.initiate(e),jS=e=>{let t=Cp(e);return Ra.endpoints.getAnswer.select(t??ga)(e)};d();c();l();u();var nw=oe(uo,e=>e);d();c();l();u();function RM(e){let t=e.payload?.analyticsAction;return ow(e)&&!le(t)}function ow(e){return"type"in e}var aw=e=>t=>r=>{let n;RM(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return ow(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();var Os=T("tab/register",e=>{let t=new J({values:{id:z,expression:Ue}});return O(e,t)}),gt=T("tab/updateActiveTab",e=>O(e,z));d();c();l();u();var Lp=kr(Xd(),1),cw=kr(iw(),1),uw=kr(sw(),1);Lp.default.extend(uw.default);Lp.default.extend(cw.default);var Ns=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Lp.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"});d();c();l();u();var wM=/(^|; )Coveo-Pendragon=([^;]*)/;function GS(){return typeof window>"u"?!1:wM.exec(document.cookie)?.pop()||null}var Up=oe(Ns(),e=>e.addCase(zr,(t,r)=>{FM(t,r.payload)}).addCase(mr,(t,r)=>{EM(t,r.payload)}).addCase(go,(t,r)=>{IM(t,r.payload)}).addCase(Yi,t=>{t.analytics.enabled=!1}).addCase(Ji,t=>{t.analytics.enabled=!0}).addCase(Hd,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(zd,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(gt,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Xi,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(De,(t,r)=>{le(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(Wd,(t,{payload:r})=>{t.knowledge.agentId=r}));function FM(e,t){le(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",le(t.organizationId)||(e.organizationId=t.organizationId)}function EM(e,t){le(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),le(t.locale)||(e.search.locale=t.locale),le(t.timezone)||(e.search.timezone=t.timezone),le(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function IM(e,t){le(t.enabled)||(e.analytics.enabled=t.enabled),le(t.originContext)||(e.analytics.originContext=t.originContext),le(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),le(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),le(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),le(t.trackingId)||(e.analytics.trackingId=t.trackingId),le(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),le(t.source)||(e.analytics.source=t.source);try{let r=GS();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}le(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),le(t.anonymous)||(e.analytics.anonymous=t.anonymous),le(t.deviceId)||(e.analytics.deviceId=t.deviceId),le(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),le(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var ue=Up;d();c();l();u();function TM(e){return e.instantlyCallable}var lw=()=>e=>t=>e(TM(t)?t():t);d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var kt=[];for(let e=0;e<256;++e)kt.push((e+256).toString(16).slice(1));function dw(e,t=0){return(kt[e[t+0]]+kt[e[t+1]]+kt[e[t+2]]+kt[e[t+3]]+"-"+kt[e[t+4]]+kt[e[t+5]]+"-"+kt[e[t+6]]+kt[e[t+7]]+"-"+kt[e[t+8]]+kt[e[t+9]]+"-"+kt[e[t+10]]+kt[e[t+11]]+kt[e[t+12]]+kt[e[t+13]]+kt[e[t+14]]+kt[e[t+15]]).toLowerCase()}d();c();l();u();var $S,PM=new Uint8Array(16);function HS(){if(!$S){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");$S=crypto.getRandomValues.bind(crypto)}return $S(PM)}d();c();l();u();d();c();l();u();var kM=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),zS={randomUUID:kM};function OM(e,t,r){if(zS.randomUUID&&!t&&!e)return zS.randomUUID();e=e||{};let n=e.random??e.rng?.()??HS();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return dw(n)}var Io=OM;d();c();l();u();d();c();l();u();var I={};pu(I,{BRAND:()=>oV,DIRTY:()=>wa,EMPTY_PATH:()=>qM,INVALID:()=>ve,NEVER:()=>QV,OK:()=>Mt,ParseStatus:()=>Ot,Schema:()=>Ie,ZodAny:()=>ko,ZodArray:()=>$n,ZodBigInt:()=>Ea,ZodBoolean:()=>Ia,ZodBranded:()=>ol,ZodCatch:()=>ja,ZodDate:()=>Ta,ZodDefault:()=>Va,ZodDiscriminatedUnion:()=>Gp,ZodEffects:()=>Cr,ZodEnum:()=>qa,ZodError:()=>Jt,ZodFirstPartyTypeKind:()=>xe,ZodFunction:()=>Hp,ZodIntersection:()=>Na,ZodIssueCode:()=>Z,ZodLazy:()=>_a,ZodLiteral:()=>Da,ZodMap:()=>js,ZodNaN:()=>Us,ZodNativeEnum:()=>Ma,ZodNever:()=>qr,ZodNull:()=>ka,ZodNullable:()=>rn,ZodNumber:()=>Fa,ZodObject:()=>Xt,ZodOptional:()=>xr,ZodParsedType:()=>se,ZodPipeline:()=>al,ZodPromise:()=>Oo,ZodReadonly:()=>La,ZodRecord:()=>$p,ZodSchema:()=>Ie,ZodSet:()=>Ls,ZodString:()=>Po,ZodSymbol:()=>Ms,ZodTransformer:()=>Cr,ZodTuple:()=>tn,ZodType:()=>Ie,ZodUndefined:()=>Pa,ZodUnion:()=>Oa,ZodUnknown:()=>Gn,ZodVoid:()=>Vs,addIssueToContext:()=>ie,any:()=>fV,array:()=>yV,bigint:()=>cV,boolean:()=>Cw,coerce:()=>UV,custom:()=>vw,date:()=>uV,datetimeRegex:()=>yw,defaultErrorMap:()=>Qn,discriminatedUnion:()=>AV,effect:()=>NV,enum:()=>PV,function:()=>EV,getErrorMap:()=>_s,getParsedType:()=>en,instanceof:()=>iV,intersection:()=>CV,isAborted:()=>Qp,isAsync:()=>Ds,isDirty:()=>Bp,isValid:()=>To,late:()=>aV,lazy:()=>IV,literal:()=>TV,makeIssue:()=>nl,map:()=>wV,nan:()=>sV,nativeEnum:()=>kV,never:()=>gV,null:()=>pV,nullable:()=>DV,number:()=>Aw,object:()=>SV,objectUtil:()=>WS,oboolean:()=>LV,onumber:()=>jV,optional:()=>_V,ostring:()=>VV,pipeline:()=>MV,preprocess:()=>qV,promise:()=>OV,quotelessJson:()=>NM,record:()=>RV,set:()=>FV,setErrorMap:()=>DM,strictObject:()=>vV,string:()=>xw,symbol:()=>lV,transformer:()=>NV,tuple:()=>bV,undefined:()=>dV,union:()=>xV,unknown:()=>mV,util:()=>Oe,void:()=>hV});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Oe;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let a={};for(let i of o)a[i]=i;return a},e.getValidEnumValues=o=>{let a=e.objectKeys(o).filter(p=>typeof o[o[p]]!="number"),i={};for(let p of a)i[p]=o[p];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(a){return o[a]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let a=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&a.push(i);return a},e.find=(o,a)=>{for(let i of o)if(a(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,a=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(o,a)=>typeof a=="bigint"?a.toString():a})(Oe||(Oe={}));var WS;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(WS||(WS={}));var se=Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),en=e=>{switch(typeof e){case"undefined":return se.undefined;case"string":return se.string;case"number":return Number.isNaN(e)?se.nan:se.number;case"boolean":return se.boolean;case"function":return se.function;case"bigint":return se.bigint;case"symbol":return se.symbol;case"object":return Array.isArray(e)?se.array:e===null?se.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?se.promise:typeof Map<"u"&&e instanceof Map?se.map:typeof Set<"u"&&e instanceof Set?se.set:typeof Date<"u"&&e instanceof Date?se.date:se.object;default:return se.unknown}};var Z=Oe.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"]),NM=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Jt=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(a){return a.message},n={_errors:[]},o=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let p=n,f=0;for(;f<i.path.length;){let m=i.path[f];f===i.path.length-1?(p[m]=p[m]||{_errors:[]},p[m]._errors.push(r(i))):p[m]=p[m]||{_errors:[]},p=p[m],f++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let a=o.path[0];r[a]=r[a]||[],r[a].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Jt.create=e=>new Jt(e);var _M=(e,t)=>{let r;switch(e.code){case Z.invalid_type:e.received===se.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Z.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Oe.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:r=`Unrecognized key(s) in object: ${Oe.joinValues(e.keys,", ")}`;break;case Z.invalid_union:r="Invalid input";break;case Z.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Oe.joinValues(e.options)}`;break;case Z.invalid_enum_value:r=`Invalid enum value. Expected ${Oe.joinValues(e.options)}, received '${e.received}'`;break;case Z.invalid_arguments:r="Invalid function arguments";break;case Z.invalid_return_type:r="Invalid function return type";break;case Z.invalid_date:r="Invalid date";break;case Z.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}"`:Oe.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Z.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 Z.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 Z.custom:r="Invalid input";break;case Z.invalid_intersection_types:r="Intersection results could not be merged";break;case Z.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Z.not_finite:r="Number must be finite";break;default:r=t.defaultError,Oe.assertNever(e)}return{message:r}},Qn=_M;var pw=Qn;function DM(e){pw=e}function _s(){return pw}d();c();l();u();var nl=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...(o.path||[])],i={...o,path:a};if(o.message!==void 0)return{...o,path:a,message:o.message};let p="",f=n.filter(m=>!!m).slice().reverse();for(let m of f)p=m(i,{data:t,defaultError:p}).message;return{...o,path:a,message:p}},qM=[];function ie(e,t){let r=_s(),n=nl({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Qn?void 0:Qn].filter(o=>!!o)});e.common.issues.push(n)}var Ot=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 ve;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static mergeObjectAsync(t,r){return _asyncToGenerator(function*(){let n=[];for(let o of r){let a=yield o.key,i=yield o.value;n.push({key:a,value:i})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:a,value:i}=o;if(a.status==="aborted"||i.status==="aborted")return ve;a.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[a.value]=i.value)}return{status:t.value,value:n}}},ve=Object.freeze({status:"aborted"}),wa=e=>({status:"dirty",value:e}),Mt=e=>({status:"valid",value:e}),Qp=e=>e.status==="aborted",Bp=e=>e.status==="dirty",To=e=>e.status==="valid",Ds=e=>typeof Promise<"u"&&e instanceof Promise;d();c();l();u();d();c();l();u();var de;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(de||(de={}));var Ar=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}},fw=(e,t)=>{if(To(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 Jt(e.common.issues);return this._error=r,this._error}}};function Fe(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,p)=>{let{message:f}=e;return i.code==="invalid_enum_value"?{message:f??p.defaultError}:typeof p.data>"u"?{message:f??n??p.defaultError}:i.code!=="invalid_type"?{message:p.defaultError}:{message:f??r??p.defaultError}},description:o}}var Ie=class{get description(){return this._def.description}_getType(t){return en(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:en(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ot,ctx:{common:t.parent.common,data:t.data,parsedType:en(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Ds(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:en(t)},o=this._parseSync({data:t,path:n.path,parent:n});return fw(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:en(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return To(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=>To(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this24=this;return _asyncToGenerator(function*(){let n=yield _this24.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this25=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this25._def.errorMap,parent:null,data:t,parsedType:en(t)},o=_this25._parse({data:t,path:n.path,parent:n}),a=yield Ds(o)?o:Promise.resolve(o);return fw(n,a)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,a)=>{let i=t(o),p=()=>a.addIssue({code:Z.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(p(),!1)):i?!0:(p(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new Cr({schema:this,typeName:xe.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 xr.create(this,this._def)}nullable(){return rn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $n.create(this)}promise(){return Oo.create(this,this._def)}or(t){return Oa.create([this,t],this._def)}and(t){return Na.create(this,t,this._def)}transform(t){return new Cr({...Fe(this._def),schema:this,typeName:xe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Va({...Fe(this._def),innerType:this,defaultValue:r,typeName:xe.ZodDefault})}brand(){return new ol({typeName:xe.ZodBranded,type:this,...Fe(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new ja({...Fe(this._def),innerType:this,catchValue:r,typeName:xe.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return al.create(this,t)}readonly(){return La.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},MM=/^c[^\s-]{8,}$/i,VM=/^[0-9a-z]+$/,jM=/^[0-9A-HJKMNP-TV-Z]{26}$/i,LM=/^[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,UM=/^[a-z0-9_-]{21}$/i,QM=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,BM=/^[-+]?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)?)??$/,GM=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$M="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",KS,HM=/^(?:(?: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])$/,zM=/^(?:(?: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])$/,WM=/^(([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]))$/,KM=/^(([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])$/,YM=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,JM=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,gw="((\\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])))",XM=new RegExp(`^${gw}$`);function hw(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 ZM(e){return new RegExp(`^${hw(e)}$`)}function yw(e){let t=`${gw}T${hw(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 eV(e,t){return!!((t==="v4"||!t)&&HM.test(e)||(t==="v6"||!t)&&WM.test(e))}function tV(e,t){if(!QM.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 rV(e,t){return!!((t==="v4"||!t)&&zM.test(e)||(t==="v6"||!t)&&KM.test(e))}var Po=class e extends Ie{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==se.string){let a=this._getOrReturnCtx(t);return ie(a,{code:Z.invalid_type,expected:se.string,received:a.parsedType}),ve}let n=new Ot,o;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let i=t.data.length>a.value,p=t.data.length<a.value;(i||p)&&(o=this._getOrReturnCtx(t,o),i?ie(o,{code:Z.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):p&&ie(o,{code:Z.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")GM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"email",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")KS||(KS=new RegExp($M,"u")),KS.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"emoji",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")LM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"uuid",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")UM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"nanoid",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")MM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"cuid",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")VM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"cuid2",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")jM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"ulid",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ie(o,{validation:"url",code:Z.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"regex",code:Z.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?yw(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?XM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?ZM(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?BM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"duration",code:Z.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?eV(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"ip",code:Z.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?tV(t.data,a.alg)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"jwt",code:Z.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?rV(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"cidr",code:Z.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?YM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"base64",code:Z.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?JM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"base64url",code:Z.invalid_string,message:a.message}),n.dirty()):Oe.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:Z.invalid_string,...de.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...de.errToObj(t)})}url(t){return this._addCheck({kind:"url",...de.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...de.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...de.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...de.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...de.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...de.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...de.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...de.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...de.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...de.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...de.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...de.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,...de.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,...de.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...de.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...de.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...de.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...de.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...de.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...de.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...de.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...de.errToObj(r)})}nonempty(t){return this.min(1,de.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}};Po.create=e=>new Po({checks:[],typeName:xe.ZodString,coerce:e?.coerce??!1,...Fe(e)});function nV(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,a=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return a%i/10**o}var Fa=class e extends Ie{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)!==se.number){let a=this._getOrReturnCtx(t);return ie(a,{code:Z.invalid_type,expected:se.number,received:a.parsedType}),ve}let n,o=new Ot;for(let a of this._def.checks)a.kind==="int"?Oe.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?nV(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.not_finite,message:a.message}),o.dirty()):Oe.assertNever(a);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,de.toString(r))}gt(t,r){return this.setLimit("min",t,!1,de.toString(r))}lte(t,r){return this.setLimit("max",t,!0,de.toString(r))}lt(t,r){return this.setLimit("max",t,!1,de.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:de.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:de.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:de.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.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"&&Oe.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)}};Fa.create=e=>new Fa({checks:[],typeName:xe.ZodNumber,coerce:e?.coerce||!1,...Fe(e)});var Ea=class e extends Ie{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)!==se.bigint)return this._getInvalidInput(t);let n,o=new Ot;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):Oe.assertNever(a);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return ie(r,{code:Z.invalid_type,expected:se.bigint,received:r.parsedType}),ve}gte(t,r){return this.setLimit("min",t,!0,de.toString(r))}gt(t,r){return this.setLimit("min",t,!1,de.toString(r))}lte(t,r){return this.setLimit("max",t,!0,de.toString(r))}lt(t,r){return this.setLimit("max",t,!1,de.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:de.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:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:de.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}};Ea.create=e=>new Ea({checks:[],typeName:xe.ZodBigInt,coerce:e?.coerce??!1,...Fe(e)});var Ia=class extends Ie{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==se.boolean){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.boolean,received:n.parsedType}),ve}return Mt(t.data)}};Ia.create=e=>new Ia({typeName:xe.ZodBoolean,coerce:e?.coerce||!1,...Fe(e)});var Ta=class e extends Ie{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==se.date){let a=this._getOrReturnCtx(t);return ie(a,{code:Z.invalid_type,expected:se.date,received:a.parsedType}),ve}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return ie(a,{code:Z.invalid_date}),ve}let n=new Ot,o;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Oe.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:de.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:de.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}};Ta.create=e=>new Ta({checks:[],coerce:e?.coerce||!1,typeName:xe.ZodDate,...Fe(e)});var Ms=class extends Ie{_parse(t){if(this._getType(t)!==se.symbol){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.symbol,received:n.parsedType}),ve}return Mt(t.data)}};Ms.create=e=>new Ms({typeName:xe.ZodSymbol,...Fe(e)});var Pa=class extends Ie{_parse(t){if(this._getType(t)!==se.undefined){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.undefined,received:n.parsedType}),ve}return Mt(t.data)}};Pa.create=e=>new Pa({typeName:xe.ZodUndefined,...Fe(e)});var ka=class extends Ie{_parse(t){if(this._getType(t)!==se.null){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.null,received:n.parsedType}),ve}return Mt(t.data)}};ka.create=e=>new ka({typeName:xe.ZodNull,...Fe(e)});var ko=class extends Ie{constructor(){super(...arguments),this._any=!0}_parse(t){return Mt(t.data)}};ko.create=e=>new ko({typeName:xe.ZodAny,...Fe(e)});var Gn=class extends Ie{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Mt(t.data)}};Gn.create=e=>new Gn({typeName:xe.ZodUnknown,...Fe(e)});var qr=class extends Ie{_parse(t){let r=this._getOrReturnCtx(t);return ie(r,{code:Z.invalid_type,expected:se.never,received:r.parsedType}),ve}};qr.create=e=>new qr({typeName:xe.ZodNever,...Fe(e)});var Vs=class extends Ie{_parse(t){if(this._getType(t)!==se.undefined){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.void,received:n.parsedType}),ve}return Mt(t.data)}};Vs.create=e=>new Vs({typeName:xe.ZodVoid,...Fe(e)});var $n=class e extends Ie{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==se.array)return ie(r,{code:Z.invalid_type,expected:se.array,received:r.parsedType}),ve;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,p=r.data.length<o.exactLength.value;(i||p)&&(ie(r,{code:i?Z.too_big:Z.too_small,minimum:p?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(ie(r,{code:Z.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&&(ie(r,{code:Z.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,p)=>o.type._parseAsync(new Ar(r,i,r.path,p)))).then(i=>Ot.mergeArray(n,i));let a=[...r.data].map((i,p)=>o.type._parseSync(new Ar(r,i,r.path,p)));return Ot.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:de.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:de.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:de.toString(r)}})}nonempty(t){return this.min(1,t)}};$n.create=(e,t)=>new $n({type:e,minLength:null,maxLength:null,exactLength:null,typeName:xe.ZodArray,...Fe(t)});function qs(e){if(e instanceof Xt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=xr.create(qs(n))}return new Xt({...e._def,shape:()=>t})}else return e instanceof $n?new $n({...e._def,type:qs(e.element)}):e instanceof xr?xr.create(qs(e.unwrap())):e instanceof rn?rn.create(qs(e.unwrap())):e instanceof tn?tn.create(e.items.map(t=>qs(t))):e}var Xt=class e extends Ie{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=Oe.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==se.object){let m=this._getOrReturnCtx(t);return ie(m,{code:Z.invalid_type,expected:se.object,received:m.parsedType}),ve}let{status:n,ctx:o}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),p=[];if(!(this._def.catchall instanceof qr&&this._def.unknownKeys==="strip"))for(let m in o.data)i.includes(m)||p.push(m);let f=[];for(let m of i){let g=a[m],S=o.data[m];f.push({key:{status:"valid",value:m},value:g._parse(new Ar(o,S,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof qr){let m=this._def.unknownKeys;if(m==="passthrough")for(let g of p)f.push({key:{status:"valid",value:g},value:{status:"valid",value:o.data[g]}});else if(m==="strict")p.length>0&&(ie(o,{code:Z.unrecognized_keys,keys:p}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let g of p){let S=o.data[g];f.push({key:{status:"valid",value:g},value:m._parse(new Ar(o,S,o.path,g)),alwaysSet:g in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let m=[];for(let g of f){let S=yield g.key,A=yield g.value;m.push({key:S,value:A,alwaysSet:g.alwaysSet})}return m})).then(m=>Ot.mergeObjectSync(n,m)):Ot.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return de.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:de.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:xe.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 Oe.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 Oe.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return qs(this)}partial(t){let r={};for(let n of Oe.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 Oe.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof xr;)a=a._def.innerType;r[n]=a}return new e({...this._def,shape:()=>r})}keyof(){return Sw(Oe.objectKeys(this.shape))}};Xt.create=(e,t)=>new Xt({shape:()=>e,unknownKeys:"strip",catchall:qr.create(),typeName:xe.ZodObject,...Fe(t)});Xt.strictCreate=(e,t)=>new Xt({shape:()=>e,unknownKeys:"strict",catchall:qr.create(),typeName:xe.ZodObject,...Fe(t)});Xt.lazycreate=(e,t)=>new Xt({shape:e,unknownKeys:"strip",catchall:qr.create(),typeName:xe.ZodObject,...Fe(t)});var Oa=class extends Ie{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(a){for(let p of a)if(p.result.status==="valid")return p.result;for(let p of a)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let i=a.map(p=>new Jt(p.ctx.common.issues));return ie(r,{code:Z.invalid_union,unionErrors:i}),ve}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref49=_asyncToGenerator(function*(a){let i={...r,common:{...r.common,issues:[]},parent:null};return{result:yield a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}});return function(_x128){return _ref49.apply(this,arguments)}}())).then(o);{let a,i=[];for(let f of n){let m={...r,common:{...r.common,issues:[]},parent:null},g=f._parseSync({data:r.data,path:r.path,parent:m});if(g.status==="valid")return g;g.status==="dirty"&&!a&&(a={result:g,ctx:m}),m.common.issues.length&&i.push(m.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let p=i.map(f=>new Jt(f));return ie(r,{code:Z.invalid_union,unionErrors:p}),ve}}get options(){return this._def.options}};Oa.create=(e,t)=>new Oa({options:e,typeName:xe.ZodUnion,...Fe(t)});var Bn=e=>e instanceof _a?Bn(e.schema):e instanceof Cr?Bn(e.innerType()):e instanceof Da?[e.value]:e instanceof qa?e.options:e instanceof Ma?Oe.objectValues(e.enum):e instanceof Va?Bn(e._def.innerType):e instanceof Pa?[void 0]:e instanceof ka?[null]:e instanceof xr?[void 0,...Bn(e.unwrap())]:e instanceof rn?[null,...Bn(e.unwrap())]:e instanceof ol||e instanceof La?Bn(e.unwrap()):e instanceof ja?Bn(e._def.innerType):[],Gp=class e extends Ie{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==se.object)return ie(r,{code:Z.invalid_type,expected:se.object,received:r.parsedType}),ve;let n=this.discriminator,o=r.data[n],a=this.optionsMap.get(o);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(ie(r,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ve)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let a of r){let i=Bn(a.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let p of i){if(o.has(p))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(p)}`);o.set(p,a)}}return new e({typeName:xe.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...Fe(n)})}};function YS(e,t){let r=en(e),n=en(t);if(e===t)return{valid:!0,data:e};if(r===se.object&&n===se.object){let o=Oe.objectKeys(t),a=Oe.objectKeys(e).filter(p=>o.indexOf(p)!==-1),i={...e,...t};for(let p of a){let f=YS(e[p],t[p]);if(!f.valid)return{valid:!1};i[p]=f.data}return{valid:!0,data:i}}else if(r===se.array&&n===se.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let a=0;a<e.length;a++){let i=e[a],p=t[a],f=YS(i,p);if(!f.valid)return{valid:!1};o.push(f.data)}return{valid:!0,data:o}}else return r===se.date&&n===se.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Na=class extends Ie{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(a,i)=>{if(Qp(a)||Qp(i))return ve;let p=YS(a.value,i.value);return p.valid?((Bp(a)||Bp(i))&&r.dirty(),{status:r.value,value:p.data}):(ie(n,{code:Z.invalid_intersection_types}),ve)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>o(a,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Na.create=(e,t,r)=>new Na({left:e,right:t,typeName:xe.ZodIntersection,...Fe(r)});var tn=class e extends Ie{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==se.array)return ie(n,{code:Z.invalid_type,expected:se.array,received:n.parsedType}),ve;if(n.data.length<this._def.items.length)return ie(n,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ve;!this._def.rest&&n.data.length>this._def.items.length&&(ie(n,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((i,p)=>{let f=this._def.items[p]||this._def.rest;return f?f._parse(new Ar(n,i,n.path,p)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>Ot.mergeArray(r,i)):Ot.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};tn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new tn({items:e,typeName:xe.ZodTuple,rest:null,...Fe(t)})};var $p=class e extends Ie{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!==se.object)return ie(n,{code:Z.invalid_type,expected:se.object,received:n.parsedType}),ve;let o=[],a=this._def.keyType,i=this._def.valueType;for(let p in n.data)o.push({key:a._parse(new Ar(n,p,n.path,p)),value:i._parse(new Ar(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?Ot.mergeObjectAsync(r,o):Ot.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Ie?new e({keyType:t,valueType:r,typeName:xe.ZodRecord,...Fe(n)}):new e({keyType:Po.create(),valueType:t,typeName:xe.ZodRecord,...Fe(r)})}},js=class extends Ie{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!==se.map)return ie(n,{code:Z.invalid_type,expected:se.map,received:n.parsedType}),ve;let o=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([p,f],m)=>({key:o._parse(new Ar(n,p,n.path,[m,"key"])),value:a._parse(new Ar(n,f,n.path,[m,"value"]))}));if(n.common.async){let p=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let f of i){let m=yield f.key,g=yield f.value;if(m.status==="aborted"||g.status==="aborted")return ve;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}))}else{let p=new Map;for(let f of i){let m=f.key,g=f.value;if(m.status==="aborted"||g.status==="aborted")return ve;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}}};js.create=(e,t,r)=>new js({valueType:t,keyType:e,typeName:xe.ZodMap,...Fe(r)});var Ls=class e extends Ie{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==se.set)return ie(n,{code:Z.invalid_type,expected:se.set,received:n.parsedType}),ve;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(ie(n,{code:Z.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&&(ie(n,{code:Z.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let a=this._def.valueType;function i(f){let m=new Set;for(let g of f){if(g.status==="aborted")return ve;g.status==="dirty"&&r.dirty(),m.add(g.value)}return{status:r.value,value:m}}let p=[...n.data.values()].map((f,m)=>a._parse(new Ar(n,f,n.path,m)));return n.common.async?Promise.all(p).then(f=>i(f)):i(p)}min(t,r){return new e({...this._def,minSize:{value:t,message:de.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:de.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Ls.create=(e,t)=>new Ls({valueType:e,minSize:null,maxSize:null,typeName:xe.ZodSet,...Fe(t)});var Hp=class e extends Ie{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==se.function)return ie(r,{code:Z.invalid_type,expected:se.function,received:r.parsedType}),ve;function n(p,f){return nl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_s(),Qn].filter(m=>!!m),issueData:{code:Z.invalid_arguments,argumentsError:f}})}function o(p,f){return nl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_s(),Qn].filter(m=>!!m),issueData:{code:Z.invalid_return_type,returnTypeError:f}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Oo){let p=this;return Mt(/*#__PURE__*/_asyncToGenerator(function*(...f){let m=new Jt([]),g=yield p._def.args.parseAsync(f,a).catch(h=>{throw m.addIssue(n(f,h)),m}),S=yield Reflect.apply(i,this,g);return yield p._def.returns._def.type.parseAsync(S,a).catch(h=>{throw m.addIssue(o(S,h)),m})}))}else{let p=this;return Mt(function(...f){let m=p._def.args.safeParse(f,a);if(!m.success)throw new Jt([n(f,m.error)]);let g=Reflect.apply(i,this,m.data),S=p._def.returns.safeParse(g,a);if(!S.success)throw new Jt([o(g,S.error)]);return S.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:tn.create(t).rest(Gn.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||tn.create([]).rest(Gn.create()),returns:r||Gn.create(),typeName:xe.ZodFunction,...Fe(n)})}},_a=class extends Ie{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})}};_a.create=(e,t)=>new _a({getter:e,typeName:xe.ZodLazy,...Fe(t)});var Da=class extends Ie{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return ie(r,{received:r.data,code:Z.invalid_literal,expected:this._def.value}),ve}return{status:"valid",value:t.data}}get value(){return this._def.value}};Da.create=(e,t)=>new Da({value:e,typeName:xe.ZodLiteral,...Fe(t)});function Sw(e,t){return new qa({values:e,typeName:xe.ZodEnum,...Fe(t)})}var qa=class e extends Ie{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return ie(r,{expected:Oe.joinValues(n),received:r.parsedType,code:Z.invalid_type}),ve}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 ie(r,{received:r.data,code:Z.invalid_enum_value,options:n}),ve}return Mt(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})}};qa.create=Sw;var Ma=class extends Ie{_parse(t){let r=Oe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==se.string&&n.parsedType!==se.number){let o=Oe.objectValues(r);return ie(n,{expected:Oe.joinValues(o),received:n.parsedType,code:Z.invalid_type}),ve}if(this._cache||(this._cache=new Set(Oe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=Oe.objectValues(r);return ie(n,{received:n.data,code:Z.invalid_enum_value,options:o}),ve}return Mt(t.data)}get enum(){return this._def.values}};Ma.create=(e,t)=>new Ma({values:e,typeName:xe.ZodNativeEnum,...Fe(t)});var Oo=class extends Ie{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==se.promise&&r.common.async===!1)return ie(r,{code:Z.invalid_type,expected:se.promise,received:r.parsedType}),ve;let n=r.parsedType===se.promise?r.data:Promise.resolve(r.data);return Mt(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Oo.create=(e,t)=>new Oo({type:e,typeName:xe.ZodPromise,...Fe(t)});var Cr=class extends Ie{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this26=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,a={addIssue:i=>{ie(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){let i=o.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(p){if(r.value==="aborted")return ve;let f=yield _this26._def.schema._parseAsync({data:p,path:n.path,parent:n});return f.status==="aborted"?ve:f.status==="dirty"?wa(f.value):r.value==="dirty"?wa(f.value):f});return function(_x129){return _ref52.apply(this,arguments)}}());{if(r.value==="aborted")return ve;let p=this._def.schema._parseSync({data:i,path:n.path,parent:n});return p.status==="aborted"?ve:p.status==="dirty"?wa(p.value):r.value==="dirty"?wa(p.value):p}}if(o.type==="refinement"){let i=p=>{let f=o.refinement(p,a);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(n.common.async===!1){let p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return p.status==="aborted"?ve:(p.status==="dirty"&&r.dirty(),i(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>p.status==="aborted"?ve:(p.status==="dirty"&&r.dirty(),i(p.value).then(()=>({status:r.value,value:p.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!To(i))return ve;let p=o.transform(i.value,a);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>To(i)?Promise.resolve(o.transform(i.value,a)).then(p=>({status:r.value,value:p})):ve);Oe.assertNever(o)}};Cr.create=(e,t,r)=>new Cr({schema:e,typeName:xe.ZodEffects,effect:t,...Fe(r)});Cr.createWithPreprocess=(e,t,r)=>new Cr({schema:t,effect:{type:"preprocess",transform:e},typeName:xe.ZodEffects,...Fe(r)});var xr=class extends Ie{_parse(t){return this._getType(t)===se.undefined?Mt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};xr.create=(e,t)=>new xr({innerType:e,typeName:xe.ZodOptional,...Fe(t)});var rn=class extends Ie{_parse(t){return this._getType(t)===se.null?Mt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};rn.create=(e,t)=>new rn({innerType:e,typeName:xe.ZodNullable,...Fe(t)});var Va=class extends Ie{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===se.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Va.create=(e,t)=>new Va({innerType:e,typeName:xe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Fe(t)});var ja=class extends Ie{_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 Ds(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Jt(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Jt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};ja.create=(e,t)=>new ja({innerType:e,typeName:xe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Fe(t)});var Us=class extends Ie{_parse(t){if(this._getType(t)!==se.nan){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.nan,received:n.parsedType}),ve}return{status:"valid",value:t.data}}};Us.create=e=>new Us({typeName:xe.ZodNaN,...Fe(e)});var oV=Symbol("zod_brand"),ol=class extends Ie{_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}},al=class e extends Ie{_parse(t){var _this27=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let a=yield _this27._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?ve:a.status==="dirty"?(r.dirty(),wa(a.value)):_this27._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?ve: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:xe.ZodPipeline})}},La=class extends Ie{_parse(t){let r=this._def.innerType._parse(t),n=o=>(To(o)&&(o.value=Object.freeze(o.value)),o);return Ds(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};La.create=(e,t)=>new La({innerType:e,typeName:xe.ZodReadonly,...Fe(t)});function mw(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function vw(e,t={},r){return e?ko.create().superRefine((n,o)=>{let a=e(n);if(a instanceof Promise)return a.then(i=>{if(!i){let p=mw(t,n),f=p.fatal??r??!0;o.addIssue({code:"custom",...p,fatal:f})}});if(!a){let i=mw(t,n),p=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:p})}}):ko.create()}var aV={object:Xt.lazycreate},xe;(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"})(xe||(xe={}));var iV=(e,t={message:`Input not instance of ${e.name}`})=>vw(r=>r instanceof e,t),xw=Po.create,Aw=Fa.create,sV=Us.create,cV=Ea.create,Cw=Ia.create,uV=Ta.create,lV=Ms.create,dV=Pa.create,pV=ka.create,fV=ko.create,mV=Gn.create,gV=qr.create,hV=Vs.create,yV=$n.create,SV=Xt.create,vV=Xt.strictCreate,xV=Oa.create,AV=Gp.create,CV=Na.create,bV=tn.create,RV=$p.create,wV=js.create,FV=Ls.create,EV=Hp.create,IV=_a.create,TV=Da.create,PV=qa.create,kV=Ma.create,OV=Oo.create,NV=Cr.create,_V=xr.create,DV=rn.create,qV=Cr.createWithPreprocess,MV=al.create,VV=()=>xw().optional(),jV=()=>Aw().optional(),LV=()=>Cw().optional(),UV={string:e=>Po.create({...e,coerce:!0}),number:e=>Fa.create({...e,coerce:!0}),boolean:e=>Ia.create({...e,coerce:!0}),bigint:e=>Ea.create({...e,coerce:!0}),date:e=>Ta.create({...e,coerce:!0})};var QV=ve;var BV=I.object({name:I.string(),arguments:I.string()}),GV=I.object({id:I.string(),type:I.literal("function"),function:BV,encryptedValue:I.string().optional()}),zp=I.object({id:I.string(),role:I.string(),content:I.string().optional(),name:I.string().optional(),encryptedValue:I.string().optional()}),$V=I.object({type:I.literal("text"),text:I.string()}),bw=I.object({type:I.literal("binary"),mimeType:I.string(),id:I.string().optional(),url:I.string().optional(),data:I.string().optional(),filename:I.string().optional()}),Rw=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:I.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},Gce=bw.superRefine((e,t)=>{Rw(e,t)}),HV=I.discriminatedUnion("type",[$V,bw]),zV=HV.superRefine((e,t)=>{e.type==="binary"&&Rw(e,t)}),WV=zp.extend({role:I.literal("developer"),content:I.string()}),KV=zp.extend({role:I.literal("system"),content:I.string()}),YV=zp.extend({role:I.literal("assistant"),content:I.string().optional(),toolCalls:I.array(GV).optional()}),JV=zp.extend({role:I.literal("user"),content:I.union([I.string(),I.array(zV)])}),XV=I.object({id:I.string(),content:I.string(),role:I.literal("tool"),toolCallId:I.string(),error:I.string().optional(),encryptedValue:I.string().optional()}),ZV=I.object({id:I.string(),role:I.literal("activity"),activityType:I.string(),content:I.record(I.any())}),ej=I.object({id:I.string(),role:I.literal("reasoning"),content:I.string(),encryptedValue:I.string().optional()}),ww=I.discriminatedUnion("role",[WV,KV,YV,JV,XV,ZV,ej]),$ce=I.union([I.literal("developer"),I.literal("system"),I.literal("assistant"),I.literal("user"),I.literal("tool"),I.literal("activity"),I.literal("reasoning")]),tj=I.object({description:I.string(),value:I.string()}),rj=I.object({name:I.string(),description:I.string(),parameters:I.any()}),nj=I.object({threadId:I.string(),runId:I.string(),parentRunId:I.string().optional(),state:I.any(),messages:I.array(ww),tools:I.array(rj),context:I.array(tj),forwardedProps:I.any()}),oj=I.any(),et=class extends Error{constructor(e){super(e)}},JS=class extends et{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},Fw=I.union([I.literal("developer"),I.literal("system"),I.literal("assistant"),I.literal("user")]),D=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}({}),Ve=I.object({type:I.nativeEnum(D),timestamp:I.number().optional(),rawEvent:I.any().optional()}).passthrough(),aj=Ve.extend({type:I.literal(D.TEXT_MESSAGE_START),messageId:I.string(),role:Fw.default("assistant")}),Ew=Ve.extend({type:I.literal(D.TEXT_MESSAGE_CONTENT),messageId:I.string(),delta:I.string().refine(e=>e.length>0,"Delta must not be an empty string")}),ij=Ve.extend({type:I.literal(D.TEXT_MESSAGE_END),messageId:I.string()}),sj=Ve.extend({type:I.literal(D.TEXT_MESSAGE_CHUNK),messageId:I.string().optional(),role:Fw.optional(),delta:I.string().optional()}),cj=Ve.extend({type:I.literal(D.THINKING_TEXT_MESSAGE_START)}),uj=Ew.omit({messageId:!0,type:!0}).extend({type:I.literal(D.THINKING_TEXT_MESSAGE_CONTENT)}),lj=Ve.extend({type:I.literal(D.THINKING_TEXT_MESSAGE_END)}),dj=Ve.extend({type:I.literal(D.TOOL_CALL_START),toolCallId:I.string(),toolCallName:I.string(),parentMessageId:I.string().optional()}),pj=Ve.extend({type:I.literal(D.TOOL_CALL_ARGS),toolCallId:I.string(),delta:I.string()}),fj=Ve.extend({type:I.literal(D.TOOL_CALL_END),toolCallId:I.string()}),mj=Ve.extend({messageId:I.string(),type:I.literal(D.TOOL_CALL_RESULT),toolCallId:I.string(),content:I.string(),role:I.literal("tool").optional()}),gj=Ve.extend({type:I.literal(D.TOOL_CALL_CHUNK),toolCallId:I.string().optional(),toolCallName:I.string().optional(),parentMessageId:I.string().optional(),delta:I.string().optional()}),hj=Ve.extend({type:I.literal(D.THINKING_START),title:I.string().optional()}),yj=Ve.extend({type:I.literal(D.THINKING_END)}),Sj=Ve.extend({type:I.literal(D.STATE_SNAPSHOT),snapshot:oj}),vj=Ve.extend({type:I.literal(D.STATE_DELTA),delta:I.array(I.any())}),xj=Ve.extend({type:I.literal(D.MESSAGES_SNAPSHOT),messages:I.array(ww)}),Aj=Ve.extend({type:I.literal(D.ACTIVITY_SNAPSHOT),messageId:I.string(),activityType:I.string(),content:I.record(I.any()),replace:I.boolean().optional().default(!0)}),Cj=Ve.extend({type:I.literal(D.ACTIVITY_DELTA),messageId:I.string(),activityType:I.string(),patch:I.array(I.any())}),bj=Ve.extend({type:I.literal(D.RAW),event:I.any(),source:I.string().optional()}),Rj=Ve.extend({type:I.literal(D.CUSTOM),name:I.string(),value:I.any()}),wj=Ve.extend({type:I.literal(D.RUN_STARTED),threadId:I.string(),runId:I.string(),parentRunId:I.string().optional(),input:nj.optional()}),Fj=Ve.extend({type:I.literal(D.RUN_FINISHED),threadId:I.string(),runId:I.string(),result:I.any().optional()}),Ej=Ve.extend({type:I.literal(D.RUN_ERROR),message:I.string(),code:I.string().optional()}),Ij=Ve.extend({type:I.literal(D.STEP_STARTED),stepName:I.string()}),Tj=Ve.extend({type:I.literal(D.STEP_FINISHED),stepName:I.string()}),Pj=I.union([I.literal("tool-call"),I.literal("message")]),kj=Ve.extend({type:I.literal(D.REASONING_START),messageId:I.string()}),Oj=Ve.extend({type:I.literal(D.REASONING_MESSAGE_START),messageId:I.string(),role:I.literal("reasoning")}),Nj=Ve.extend({type:I.literal(D.REASONING_MESSAGE_CONTENT),messageId:I.string(),delta:I.string().refine(e=>e.length>0,"Delta must not be an empty string")}),_j=Ve.extend({type:I.literal(D.REASONING_MESSAGE_END),messageId:I.string()}),Dj=Ve.extend({type:I.literal(D.REASONING_MESSAGE_CHUNK),messageId:I.string().optional(),delta:I.string().optional()}),qj=Ve.extend({type:I.literal(D.REASONING_END),messageId:I.string()}),Mj=Ve.extend({type:I.literal(D.REASONING_ENCRYPTED_VALUE),subtype:Pj,entityId:I.string(),encryptedValue:I.string()}),Wp=I.discriminatedUnion("type",[aj,Ew,ij,sj,hj,yj,cj,uj,lj,dj,pj,fj,gj,mj,Sj,vj,xj,Aj,Cj,bj,Rj,wj,Fj,Ej,Ij,Tj,kj,Oj,Nj,_j,Dj,qj,Mj]);d();c();l();u();var XS={};pu(XS,{JsonPatchError:()=>nt,_areEquals:()=>cl,applyOperation:()=>Ua,applyPatch:()=>No,applyReducer:()=>Qj,deepClone:()=>Lj,getValueByPointer:()=>Zp,validate:()=>Tw,validator:()=>ef});d();c();l();u();d();c();l();u();var Vj=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),jj=Object.prototype.hasOwnProperty;function Yp(e,t){return jj.call(e,t)}function Jp(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)Yp(e,o)&&n.push(o);return n}function Nt(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Xp(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 nn(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function il(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Kp(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Kp(e[t]))return!0}else if(typeof e=="object"){for(var n=Jp(e),o=n.length,a=0;a<o;a++)if(Kp(e[n[a]]))return!0}}return!1}function Iw(e,t){var r=[e];for(var n in t){var o=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof o<"u"&&r.push(n+": "+o)}return r.join(`
|
|
32
|
-
`)}var sl=function(e){Vj(t,e);function t(r,n,o,a,i){var p=this.constructor,f=e.call(this,Iw(r,{name:n,index:o,operation:a,tree:i}))||this;return f.name=n,f.index=o,f.operation=a,f.tree=i,Object.setPrototypeOf(f,p.prototype),f.message=Iw(r,{name:n,index:o,operation:a,tree:i}),f}return t}(Error);var nt=sl,Lj=Nt,Qs={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=Zp(r,this.path);n&&(n=Nt(n));var o=Ua(r,{op:"remove",path:this.from}).removed;return Ua(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=Zp(r,this.from);return Ua(r,{op:"add",path:this.path,value:Nt(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:cl(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},Uj={add:function(e,t,r){return Xp(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:Qs.move,copy:Qs.copy,test:Qs.test,_get:Qs._get};function Zp(e,t){if(t=="")return e;var r={op:"_get",path:t};return Ua(e,r),r.value}function Ua(e,t,r,n,o,a){if(r===void 0&&(r=!1),n===void 0&&(n=!0),o===void 0&&(o=!0),a===void 0&&(a=0),r&&(typeof r=="function"?r(t,0,e,t.path):ef(t,0)),t.path===""){var i={newDocument:e};if(t.op==="add")return i.newDocument=t.value,i;if(t.op==="replace")return i.newDocument=t.value,i.removed=e,i;if(t.op==="move"||t.op==="copy")return i.newDocument=Zp(e,t.from),t.op==="move"&&(i.removed=e),i;if(t.op==="test"){if(i.test=cl(e,t.value),i.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i.newDocument=e,i}else{if(t.op==="remove")return i.removed=e,i.newDocument=null,i;if(t.op==="_get")return t.value=e,i;if(r)throw new nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,t,e);return i}}else{n||(e=Nt(e));var p=t.path||"",f=p.split("/"),m=e,g=1,S=f.length,A=void 0,h=void 0,C=void 0;for(typeof r=="function"?C=r:C=ef;;){if(h=f[g],h&&h.indexOf("~")!=-1&&(h=il(h)),o&&(h=="__proto__"||h=="prototype"&&g>0&&f[g-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&A===void 0&&(m[h]===void 0?A=f.slice(0,g).join("/"):g==S-1&&(A=t.path),A!==void 0&&C(t,0,e,A)),g++,Array.isArray(m)){if(h==="-")h=m.length;else{if(r&&!Xp(h))throw new nt("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",a,t,e);Xp(h)&&(h=~~h)}if(g>=S){if(r&&t.op==="add"&&h>m.length)throw new nt("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,t,e);var i=Uj[t.op].call(t,m,h,e);if(i.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}}else if(g>=S){var i=Qs[t.op].call(t,m,h,e);if(i.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}if(m=m[h],r&&g<S&&(!m||typeof m!="object"))throw new nt("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",a,t,e)}}}function No(e,t,r,n,o){if(n===void 0&&(n=!0),o===void 0&&(o=!0),r&&!Array.isArray(t))throw new nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=Nt(e));for(var a=new Array(t.length),i=0,p=t.length;i<p;i++)a[i]=Ua(e,t[i],r,!0,o,i),e=a[i].newDocument;return a.newDocument=e,a}function Qj(e,t,r){var n=Ua(e,t);if(n.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function ef(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new nt("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(Qs[e.op]){if(typeof e.path!="string")throw new nt("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new nt("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 nt("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 nt("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")&&Kp(e.value))throw new nt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var o=e.path.split("/").length,a=n.split("/").length;if(o!==a+1&&o!==a)throw new nt("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 nt("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var i={op:"_get",path:e.from,value:void 0},p=Tw([i],r);if(p&&p.name==="OPERATION_PATH_UNRESOLVABLE")throw new nt("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function Tw(e,t,r){try{if(!Array.isArray(e))throw new nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)No(Nt(t),Nt(e),r||!0);else{r=r||ef;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(o){if(o instanceof nt)return o;throw o}}function cl(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),o,a,i;if(r&&n){if(a=e.length,a!=t.length)return!1;for(o=a;o--!==0;)if(!cl(e[o],t[o]))return!1;return!0}if(r!=n)return!1;var p=Object.keys(e);if(a=p.length,a!==Object.keys(t).length)return!1;for(o=a;o--!==0;)if(!t.hasOwnProperty(p[o]))return!1;for(o=a;o--!==0;)if(i=p[o],!cl(e[i],t[i]))return!1;return!0}return e!==e&&t!==t}var rv={};pu(rv,{compare:()=>Yj,generate:()=>ZS,observe:()=>Kj,unobserve:()=>Wj});d();c();l();u();var ev=new WeakMap,Bj=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),Gj=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function $j(e){return ev.get(e)}function Hj(e,t){return e.observers.get(t)}function zj(e,t){e.observers.delete(t.callback)}function Wj(e,t){t.unobserve()}function Kj(e,t){var r=[],n,o=$j(e);if(!o)o=new Bj(e),ev.set(e,o);else{var a=Hj(o,t);n=a&&a.observer}if(n)return n;if(n={},o.value=Nt(e),t){n.callback=t,n.next=null;var i=function(){ZS(n)},p=function(){clearTimeout(n.next),n.next=setTimeout(i)};typeof window<"u"&&(window.addEventListener("mouseup",p),window.addEventListener("keyup",p),window.addEventListener("mousedown",p),window.addEventListener("keydown",p),window.addEventListener("change",p))}return n.patches=r,n.object=e,n.unobserve=function(){ZS(n),clearTimeout(n.next),zj(o,n),typeof window<"u"&&(window.removeEventListener("mouseup",p),window.removeEventListener("keyup",p),window.removeEventListener("mousedown",p),window.removeEventListener("keydown",p),window.removeEventListener("change",p))},o.observers.set(t,new Gj(t,n)),n}function ZS(e,t){t===void 0&&(t=!1);var r=ev.get(e.object);tv(r.value,e.object,e.patches,"",t),e.patches.length&&No(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function tv(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var a=Jp(t),i=Jp(e),p=!1,f=!1,m=i.length-1;m>=0;m--){var g=i[m],S=e[g];if(Yp(t,g)&&!(t[g]===void 0&&S!==void 0&&Array.isArray(t)===!1)){var A=t[g];typeof S=="object"&&S!=null&&typeof A=="object"&&A!=null&&Array.isArray(S)===Array.isArray(A)?tv(S,A,r,n+"/"+nn(g),o):S!==A&&(p=!0,o&&r.push({op:"test",path:n+"/"+nn(g),value:Nt(S)}),r.push({op:"replace",path:n+"/"+nn(g),value:Nt(A)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+nn(g),value:Nt(S)}),r.push({op:"remove",path:n+"/"+nn(g)}),f=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),p=!0)}if(!(!f&&a.length==i.length))for(var m=0;m<a.length;m++){var g=a[m];!Yp(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+nn(g),value:Nt(t[g])})}}}function Yj(e,t,r){r===void 0&&(r=!1);var n=[];return tv(e,t,n,"",r),n}var hue=Object.assign({},XS,rv,{JsonPatchError:sl,deepClone:Nt,escapePathComponent:nn,unescapePathComponent:il});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var nv=function(e,t){return nv=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])},nv(e,t)};function on(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");nv(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Pw(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(S){i(S)}}function f(g){try{m(n.throw(g))}catch(S){i(S)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}function tf(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=p(0),i.throw=p(1),i.return=p(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(g){return f([m,g])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,m[0]&&(r=0)),r;)try{if(n=1,o&&(a=m[0]&2?o.return:m[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,m[1])).done)return a;switch(o=0,a&&(m=[m[0]&2,a.value]),m[0]){case 0:case 1:a=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!a||m[1]>a[0]&&m[1]<a[3])){r.label=m[1];break}if(m[0]===6&&r.label<a[1]){r.label=a[1],a=m;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(m);break}a[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(g){m=[6,g],o=0}finally{n=a=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}}function Hn(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 Bs(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-->0)&&!(o=n.next()).done;)a.push(o.value)}catch(p){i={error:p}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a}function Gs(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function Qa(e){return this instanceof Qa?(this.v=e,this):new Qa(e)}function kw(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,a=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),p("next"),p("throw"),p("return",i),o[Symbol.asyncIterator]=function(){return this},o;function i(h){return function(C){return Promise.resolve(C).then(h,S)}}function p(h,C){n[h]&&(o[h]=function(w){return new Promise(function(R,b){a.push([h,w,R,b])>1||f(h,w)})},C&&(o[h]=C(o[h])))}function f(h,C){try{m(n[h](C))}catch(w){A(a[0][3],w)}}function m(h){h.value instanceof Qa?Promise.resolve(h.value.v).then(g,S):A(a[0][2],h)}function g(h){f("next",h)}function S(h){f("throw",h)}function A(h,C){h(C),a.shift(),a.length&&f(a[0][0],a[0][1])}}function Ow(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 Hn=="function"?Hn(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=e[a]&&function(i){return new Promise(function(p,f){i=e[a](i),o(p,f,i.done,i.value)})}}function o(a,i,p,f){Promise.resolve(f).then(function(m){a({value:m,done:p})},i)}}d();c();l();u();function Pe(e){return typeof e=="function"}d();c();l();u();d();c();l();u();d();c();l();u();function $s(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 rf=$s(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
31
|
+
`;function nD(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var oD=["1",1,"yes",!0];function Id(){let e=[];return Ny()&&e.push(window.doNotTrack),Hy()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>oD.indexOf(t)!==-1)}var ab="v15",ib={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function aD(e=ib.default,t=ab,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 iD="38824e1f-37f5-42d3-8372-a4b8fa9df946",Gr=class{get defaultOptions(){return{endpoint:ib.default,isCustomEndpoint:!1,token:"",version:ab,beforeSendHooks:[],afterSendHooks:[]}}get version(){return tb}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=[W_,B_].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};Id()?this.runtime=new Ed:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(Te.view,{newEventType:Te.view,addClientIdParameter:!0}),this.addEventTypeMapping(Te.click,{newEventType:Te.click,addClientIdParameter:!0}),this.addEventTypeMapping(Te.custom,{newEventType:Te.custom,addClientIdParameter:!0}),this.addEventTypeMapping(Te.search,{newEventType:Te.search,addClientIdParameter:!0})}initRuntime(t){return Ny()&&Mi()?new Gy(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(nD()&&console.warn(rD),new $y(t))}get storage(){return this.runtime.storage}determineVisitorId(){return j(this,void 0,void 0,function*(){try{return Ny()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||ca()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),ca()}})}getCurrentVisitorId(){return j(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return j(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return j(this,void 0,void 0,function*(){if(bd(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(QC(t,QC(r,iD)))}})}getParameters(t,...r){return j(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return j(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(ca()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Id())return null;try{let r=new URL(t).searchParams.get(lo.cvo_cid);if(r==null)return null;let n=lo.fromString(r);return!n||!Mi()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return j(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:a=!1,addClientIdParameter:i=!1}=this.eventTypeMapping[t]||{};return yield[g=>n.length>0?this.parseVariableArgumentsPayload(n,g):g[0],g=>j(this,void 0,void 0,function*(){return Object.assign(Object.assign({},g),{visitorId:o?yield this.getCurrentVisitorId():""})}),g=>j(this,void 0,void 0,function*(){return i?Object.assign(Object.assign({},g),{clientId:yield this.getCurrentVisitorId()}):g}),g=>a?this.ensureAnonymousUserWhenUsingApiKey(g):g,g=>this.beforeSendHooks.reduce((C,w)=>j(this,void 0,void 0,function*(){let R=yield C;return yield w(t,R)}),g)].reduce((g,C)=>j(this,void 0,void 0,function*(){let w=yield g;return yield C(w)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return j(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[S=>this.setTrackingIdIfTrackingIdNotPresent(S),S=>this.removeEmptyPayloadValues(S,t),S=>this.validateParams(S,t),S=>n?H0(S):S,S=>n?this.removeUnknownParameters(S):S,S=>n?this.processCustomParameters(S):this.mapCustomParametersToCustomData(S)].reduce((S,v)=>j(this,void 0,void 0,function*(){let g=yield S;return yield v(g)}),Promise.resolve(r))})}makeEvent(t,...r){return j(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),a=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:a,log:i=>j(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},a),i)}),yield Promise.all(this.afterSendHooks.map(p=>p(t,Object.assign(Object.assign({},o),i)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return j(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return j(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 Cd().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return j(this,void 0,void 0,function*(){return this.makeEvent(Te.search,t)})}sendSearchEvent(t){return j(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Mn(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return j(this,void 0,void 0,function*(){return this.makeEvent(Te.click,t)})}sendClickEvent(t){return j(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Mn(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return j(this,void 0,void 0,function*(){return this.makeEvent(Te.custom,t)})}sendCustomEvent(t){return j(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=Mn(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return j(this,void 0,void 0,function*(){return this.makeEvent(Te.view,t)})}sendViewEvent(t){return j(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return j(this,void 0,void 0,function*(){let r=yield(yield x(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return j(this,void 0,void 0,function*(){return yield(yield x(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,a=r.length;o<a;o++){let i=r[o];if(typeof i=="string")n[t[o]]=i;else if(typeof i=="object")return Object.assign(Object.assign({},n),i)}return n}isKeyAllowedEmpty(t,r){return({[Te.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,a)=>Object.assign(Object.assign({},o),{[a]:t[a]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(Y0(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=Mn(t,["custom"]),o={};r&&Ad(r)&&(o=this.lowercaseKeys(r));let a=J0(n);return Object.assign(Object.assign({},o),a)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=Mn(t,["custom"]);if(r&&Ad(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=Mn(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==Te.view||r==Te.click||r==Te.search||r==Te.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==Te.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=Mn(t,["userId"]);return tD(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=Mn(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Ad(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Ad(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"?u0(t,r):t}get baseUrl(){return aD(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},jn;(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"})(jn||(jn={}));var L;(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.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.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach"})(L||(L={}));var KC={[L.triggerNotify]:"queryPipelineTriggers",[L.triggerExecute]:"queryPipelineTriggers",[L.triggerQuery]:"queryPipelineTriggers",[L.triggerRedirect]:"queryPipelineTriggers",[L.queryErrorBack]:"errors",[L.queryErrorClear]:"errors",[L.queryErrorRetry]:"errors",[L.pagerNext]:"getMoreResults",[L.pagerPrevious]:"getMoreResults",[L.pagerNumber]:"getMoreResults",[L.pagerResize]:"getMoreResults",[L.pagerScrolling]:"getMoreResults",[L.facetSearch]:"facet",[L.facetShowLess]:"facet",[L.facetShowMore]:"facet",[L.recommendation]:"recommendation",[L.likeSmartSnippet]:"smartSnippet",[L.dislikeSmartSnippet]:"smartSnippet",[L.expandSmartSnippet]:"smartSnippet",[L.collapseSmartSnippet]:"smartSnippet",[L.openSmartSnippetFeedbackModal]:"smartSnippet",[L.closeSmartSnippetFeedbackModal]:"smartSnippet",[L.sendSmartSnippetReason]:"smartSnippet",[L.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[L.clearRecentQueries]:"recentQueries",[L.recentResultClick]:"recentlyClickedDocuments",[L.clearRecentResults]:"recentlyClickedDocuments",[L.showLessFoldedResults]:"folding",[L.caseDetach]:"case",[L.likeGeneratedAnswer]:"generatedAnswer",[L.dislikeGeneratedAnswer]:"generatedAnswer",[L.openGeneratedAnswerSource]:"generatedAnswer",[L.generatedAnswerStreamEnd]:"generatedAnswer",[L.generatedAnswerSourceHover]:"generatedAnswer",[L.generatedAnswerCopyToClipboard]:"generatedAnswer",[L.generatedAnswerHideAnswers]:"generatedAnswer",[L.generatedAnswerShowAnswers]:"generatedAnswer",[L.generatedAnswerExpand]:"generatedAnswer",[L.generatedAnswerCollapse]:"generatedAnswer",[L.generatedAnswerFeedbackSubmit]:"generatedAnswer",[L.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[jn.expandToFullUI]:"interface",[jn.openUserActions]:"User Actions",[jn.showPrecedingSessions]:"User Actions",[jn.showFollowingSessions]:"User Actions",[jn.clickViewedDocument]:"User Actions",[jn.clickPageView]:"User Actions",[jn.createArticle]:"createArticle"},Li=class{constructor(){this.runtime=new Ed,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(Te.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(Te.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(Te.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(Te.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return tb}};function sD(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function cD(e){return e.map(t=>t.replace(/;/g,""))}function sb(e){let r=e.join(";");return r.length<=256?r:sb(e.slice(1))}var YC=e=>{let t=cD(e),r=sD(t);return sb(r)};function JC(e){let t=typeof e.partialQueries=="string"?e.partialQueries:YC(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:YC(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var Td=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Id();this.coveoAnalyticsClient=n?new Li:new Gr(t)}disable(){this.coveoAnalyticsClient=new Li}enable(){this.coveoAnalyticsClient=new Gr(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(L.interfaceLoad)}logInterfaceLoad(){return j(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(L.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return j(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(L.recommendation)}logRecommendation(){return j(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent(L.recommendationOpen,t,r)}logRecommendationOpen(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent(L.staticFilterClearAll,t)}logStaticFilterClearAll(t){return j(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent(L.staticFilterSelect,t)}logStaticFilterSelect(t){return j(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent(L.staticFilterDeselect,t)}logStaticFilterDeselect(t){return j(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent(L.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return j(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent(L.interfaceChange,t)}logInterfaceChange(t){return j(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(L.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return j(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(L.didyoumeanClick)}logDidYouMeanClick(){return j(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(L.resultsSort,t)}logResultsSort(t){return j(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(L.searchboxSubmit)}logSearchboxSubmit(){return j(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(L.searchboxClear)}logSearchboxClear(){return j(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(L.searchboxAsYouType)}logSearchboxAsYouType(){return j(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(L.breadcrumbFacet,t)}logBreadcrumbFacet(t){return j(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(L.breadcrumbResetAll)}logBreadcrumbResetAll(){return j(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent(L.documentQuickview,t,r)}logDocumentQuickview(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent(L.documentOpen,t,r)}logDocumentOpen(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(L.omniboxAnalytics,JC(t))}logOmniboxAnalytics(t){return j(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(L.omniboxFromLink,JC(t))}logOmniboxFromLink(t){return j(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(L.searchFromLink)}logSearchFromLink(){return j(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(L.triggerNotify,t)}logTriggerNotify(t){return j(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent(L.triggerExecute,t)}logTriggerExecute(t){return j(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent(L.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return j(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent(L.undoTriggerQuery,t)}logUndoTriggerQuery(t){return j(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent(L.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return j(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent(L.pagerResize,t)}logPagerResize(t){return j(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent(L.pagerNumber,t)}logPagerNumber(t){return j(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent(L.pagerNext,t)}logPagerNext(t){return j(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent(L.pagerPrevious,t)}logPagerPrevious(t){return j(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(L.pagerScrolling)}logPagerScrolling(){return j(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(L.facetClearAll,t)}logFacetClearAll(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent(L.facetSearch,t)}logFacetSearch(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent(L.facetSelect,t)}logFacetSelect(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent(L.facetDeselect,t)}logFacetDeselect(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent(L.facetExclude,t)}logFacetExclude(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent(L.facetUnexclude,t)}logFacetUnexclude(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent(L.facetSelectAll,t)}logFacetSelectAll(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent(L.facetUpdateSort,t)}logFacetUpdateSort(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent(L.facetShowMore,t)}logFacetShowMore(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent(L.facetShowLess,t)}logFacetShowLess(t){return j(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent(L.queryError,t)}logQueryError(t){return j(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return j(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(L.queryErrorBack);return{description:t.description,log:()=>j(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(L.queryErrorBack)})}})}logQueryErrorBack(){return j(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return j(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(L.queryErrorRetry);return{description:t.description,log:()=>j(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(L.queryErrorRetry)})}})}logQueryErrorRetry(){return j(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return j(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(L.queryErrorClear);return{description:t.description,log:()=>j(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(L.queryErrorClear)})}})}logQueryErrorClear(){return j(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(L.likeSmartSnippet)}logLikeSmartSnippet(){return j(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(L.dislikeSmartSnippet)}logDislikeSmartSnippet(){return j(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(L.expandSmartSnippet)}logExpandSmartSnippet(){return j(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(L.collapseSmartSnippet)}logCollapseSmartSnippet(){return j(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(L.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return j(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(L.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return j(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent(L.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent(L.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return j(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent(L.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return j(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent(L.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return j(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent(L.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return j(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent(L.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent(L.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(L.copyToClipboard,t,r)}logCopyToClipboard(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent(L.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent(L.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent(L.recentQueryClick)}logRecentQueryClick(){return j(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(L.clearRecentQueries)}logClearRecentQueries(){return j(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent(L.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent(L.clearRecentResults)}logClearRecentResults(){return j(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(L.noResultsBack)}logNoResultsBack(){return j(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent(L.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent(L.showLessFoldedResults)}logShowLessFoldedResults(){return j(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 j(this,arguments,void 0,function*(n,o,a=KC[n]){this.coveoAnalyticsClient.getParameters;let i=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),p=Object.assign(Object.assign({},yield this.getBaseEventRequest(i)),{eventType:a,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(p);return{description:this.makeEventDescription(f,n),log:({searchUID:m})=>f.log({lastSearchQueryUid:m})}})}logCustomEvent(t,r){return j(this,arguments,void 0,function*(n,o,a=KC[n]){return(yield this.makeCustomEvent(n,o,a)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return j(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),a=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),i=yield this.coveoAnalyticsClient.makeCustomEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({lastSearchQueryUid:p})}})}logCustomEventWithType(t,r,n){return j(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return j(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:a})=>o.log({searchQueryUid:a})}})}makeClickEvent(t,r,n,o){return j(this,void 0,void 0,function*(){let a=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),i=yield this.coveoAnalyticsClient.makeClickEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({searchQueryUid:p})}})}logClickEvent(t,r,n,o){return j(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return j(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 j(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 Gr?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(L.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return j(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent(L.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return j(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent(L.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return j(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent(L.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent(L.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent(L.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent(L.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent(L.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent(L.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent(L.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent(L.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent(L.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent(L.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return j(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(L.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return j(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(L.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return j(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Pd=Object.assign({},qu),XC=Object.keys(Pd).map(e=>Pd[e]),ji=class extends qy{constructor({client:t,uuidGenerator:r=ca}){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])=>XC.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(XC.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Pd.pageview,{newEventType:Te.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Pd.event,{newEventType:Te.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),a=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},a),o),r)}getTicketPayload(){return m0(this.ticket)}};ji.Id="svc";var kd;(function(e){e.click="click",e.flowStart="flowStart"})(kd||(kd={}));var dr;(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"})(dr||(dr={}));var Od;(function(e){e.quit="Quit",e.solved="Solved"})(Od||(Od={}));var Nd=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Id();this.coveoAnalyticsClient=o?new Gr(t):new Li,this.svc=new ji({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Li,this.svc=new ji({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Gr(this.options),this.svc=new ji({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(dr.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(dr.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(dr.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(dr.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(dr.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(dr.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(dr.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(dr.caseCancelled,{reason:Od.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(dr.caseSolved,{reason:Od.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(dr.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",kd.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",kd.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return j(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 Gr?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,a;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(a=this.provider)===null||a===void 0?void 0:a.getOriginLevel3()}}logClickEvent(t,r,n,o){return j(this,void 0,void 0,function*(){var a,i;let p=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(i=(a=this.provider)===null||a===void 0?void 0:a.getSearchUID())!==null&&i!==void 0?i:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(p)})}};d();c();l();u();d();c();l();u();var po=()=>"default";var uD=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},ua=class{constructor(t){this.getState=t;Ne(this,"state");this.state=t()}getLanguage(){return uD(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[a,i]of Object.entries(n)){let p=`context_${a}`;o[p]=i}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=uo),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||po()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};d();c();l();u();var cb=e=>new Gr(e).getCurrentVisitorId(),Vu=(e,t)=>typeof t=="function"?(...r)=>{let n=vu(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,Lu=(e,t)=>(...r)=>{let n=vu(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};var Uu=class extends ua{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},ub=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o=new Uu(t)})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??Ft(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,h=new Nd({enableAnalytics:m,token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:Vu(e,n),beforeSendHooks:[Lu(e,r),(S,v)=>(e.info({...v,type:S,endpoint:p,token:i},"Analytics request"),v)]},o);return m||h.disable(),h};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Ui(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();function lD(e,t){return!!t&&t.facetId in e.facetSet}var Nr=(e,t)=>e.search?.response.facets.find(r=>r.facetId===t),_d=(e,t)=>e.facetSet[t]?.request,Qi=(e,t)=>{let r=Nr(e,t);return lD(e,r)?r:void 0},lb=(e,t)=>Qi(e,t)?.values.filter(r=>r.state==="selected")||[],db=(e,t)=>Qi(e,t)?.values.filter(r=>r.state!=="idle")||[],$r=e=>e.search.isLoading;d();c();l();u();function pb(e){if(!e)return{parents:[],values:[]};let t=[],r=e;for(;r.length&&r[0].children.length;)t=[...t,...r],r=r[0].children;let n=r.find(o=>o.state==="selected");return n&&(t=[...t,n],r=[]),{parents:t,values:r}}function or(e){let{activeValue:t,ancestryMap:r}=dD(e);return t?pD(t,r):[]}function dD(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 pD(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}function fD(e,t){return!!t&&t.facetId in e.categoryFacetSet}var Ky=(e,t)=>{let r=Nr(e,t);if(fD(e,r))return r},Yy=(e,t)=>e.categoryFacetSet[t]?.request,fb=(e,t)=>{let r=Ky(e,t);return or(r?.values??[])},Jy=(e,t)=>{let r=Yy(e,t);return or(r?.currentValues??[])};d();c();l();u();function Bi(){return{}}d();c();l();u();function mb(e,t){return{request:e,tabs:t}}function Gi(){return{}}d();c();l();u();function gb(e,t){return{request:e,tabs:t}}function $i(){return{}}d();c();l();u();function hb(e,t){return{request:e,hasBreadcrumbs:!0,tabs:t}}function Hi(){return{}}var zi=(e,t)=>{let r=xb(t,e),n=r?r.field:"",o=Zy(n,e);return{facetId:e,facetField:n,facetTitle:o}};function Wi(e,t){let{facetId:r,facetValue:n}=e,o=zi(r,t),a=Ab(t,r);return{...o,facetValue:a==="hierarchical"?vb(t,r):n}}function ar(e){return{facetSet:e.facetSet??Hi(),categoryFacetSet:e.categoryFacetSet??Bi(),dateFacetSet:e.dateFacetSet??Gi(),numericFacetSet:e.numericFacetSet??$i(),automaticFacetSet:e.automaticFacetSet??Ui()}}var Xy=e=>{let t=[];return hD(e).forEach((r,n)=>{let o=Ab(e,r.facetId),a=AD(r,n+1);if(gD(r)){if(!!!Jy(e,r.facetId).length)return;t.push({...a,...vD(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((i,p)=>{if(i.state==="idle")return;let f=yb(i,p+1,o),m=mD(r)?Sb(i):SD(i);t.push({...a,...f,...m})})}),yD(e).forEach((r,n)=>{let o=xD(r,n+1);r.values.forEach((a,i)=>{if(a.state==="idle")return;let p=yb(a,i+1,"specific"),f=Sb(a);t.push({...o,...p,...f})})}),t},mD=e=>e.type==="specific",gD=e=>e.type==="hierarchical",hD=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),yD=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),yb=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),SD=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),Sb=e=>({displayValue:e.value,value:e.value}),vb=(e,t)=>Jy(e,t).map(n=>n.value).join(";"),vD=(e,t)=>{let n=vb(e,t);return{value:n,valuePosition:1,displayValue:n}},xD=(e,t)=>({title:Zy(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),AD=(e,t)=>({title:Zy(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),Zy=(e,t)=>`${e}_${t}`,xb=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,Ab=(e,t)=>{let r=xb(e,t);return r?r.type:"specific"};d();c();l();u();d();c();l();u();var eS=e=>e.configuration.search.locale,Cb=e=>e.configuration.search.timezone,Dd=e=>e.configuration.accessToken,qd=e=>e.configuration.organizationId,Md=e=>e.configuration.environment,jd=e=>e.configuration?.knowledge?.agentId;var $e=e=>{if(CD(e)||tS(e))return e.generatedAnswer?.answerId;if(bD(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},CD=e=>"answer"in e&&"generatedAnswer"in e&&!ue(e.generatedAnswer?.answerConfigurationId),tS=e=>{let t=jd(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},bD=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",rS=e=>e.generatedAnswer?.fieldsToIncludeInCitations,Qu=Ye(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));d();c();l();u();var lt=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();d();c();l();u();var Bu=(r=>(r.Ascending="ascending",r.Descending="descending",r))(Bu||{}),la=(a=>(a.Relevancy="relevancy",a.QRE="qre",a.Date="date",a.Field="field",a.NoSort="nosort",a))(la||{}),Hr=e=>{if(Ci(e))return e.map(t=>Hr(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},Ki=()=>({by:"relevancy"}),Vd=e=>({by:"date",order:e}),Ld=(e,t)=>({by:"field",order:t,field:e}),Ud=()=>({by:"qre"}),Qd=()=>({by:"nosort"}),bb=new J({values:{by:new Su({enum:la,required:!0}),order:new Su({enum:Bu}),field:new M}});function fr(){return Hr(Ki())}d();c();l();u();d();c();l();u();d();c();l();u();var Yi=class e{static set(t,r,n){let o,a,i;n&&(a=new Date,a.setTime(a.getTime()+n));let p=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,m=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(p)||m.test(p)||p.indexOf(".")===-1?nS(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],nS(t,r,a,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function nS(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}d();c();l();u();function RD(){return typeof navigator<"u"}function Rb(){try{return typeof localStorage<"u"}catch{return!1}}function wb(){try{return typeof sessionStorage<"u"}catch{return!1}}function Fb(){return!!(RD()&&navigator.cookieEnabled)}var Eb=null;function Ib(){return Eb||(Rb()?localStorage:Fb()?new oS:wb()?sessionStorage:new aS)}var Ji=class Ji{getItem(t){return Yi.get(`${Ji.prefix}${t}`)}removeItem(t){Yi.erase(`${Ji.prefix}${t}`)}setItem(t,r,n){Yi.set(`${Ji.prefix}${t}`,r,n)}};Ne(Ji,"prefix","coveo_");var oS=Ji;var aS=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var Bd="__coveo.analytics.history",wD=20,FD=1e3*60,ED=75,da=class da{constructor(t){Ne(this,"store");this.store=t||Ib()}static getInstance(t){return da.instance||(da.instance=new da(t)),da.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _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(Bd);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(Bd);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(Bd,JSON.stringify(t.slice(0,wD)))}catch{}}clear(){try{this.store.removeItem(Bd)}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,ED)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>FD:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};Ne(da,"instance",null);var iS=da,Wt=iS;var Gu=class Gu extends ua{constructor(){super(...arguments);Ne(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 Xy(ar(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||Gu.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||rr().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||Gu.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=$e(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetValue:n,facetTitle:`${a}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,criteria:n,facetTitle:`${a}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${a}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??fr()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:a,categoryFacetPath:n,categoryFacetTitle:`${a}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],a=o.completions.map(m=>m.expression),i=o.partialQueries.length-1,p=o.partialQueries[i]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:a.indexOf(n),partialQuery:p,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:a.length>0?a:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||lt().q}get responseTime(){return this.state.search?.duration||rr().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||rr().response.totalCountFiltered}};Ne(Gu,"fallbackPipelineName","default");var fo=Gu,Tb=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??Ft(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,h=new Td({token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:Vu(e,n),beforeSendHooks:[Lu(e,r),(S,v)=>(e.info({...v,type:S,endpoint:p,token:i},"Analytics request"),v)]},o);return m||h.disable(),h},sS=()=>{let t=Wt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};d();c();l();u();function Gd(e){let t=Pb(e),r=[e,...t].filter(o=>o.parentResult).map(o=>o.parentResult);return nA([e,...t,...r],o=>o.uniqueId)}function Pb(e){return e.childResults?e.childResults.flatMap(t=>[t,...Pb(t)]):[]}d();c();l();u();var Vn=()=>"";function kb(e,t){return{...new fo(t).getBaseMetadata(),actionCause:e,type:e}}function ID(e){return Object.assign(e,{instantlyCallable:!0})}function TD(e,t){let r=a=>ID(Se(e,a)),n=r(/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(a,{getState:i,extra:p}){let{analyticsClientMiddleware:f,preprocessRequest:m,logger:h}=p;return yield(yield t({getState:i,analyticsClientMiddleware:f,preprocessRequest:m,logger:h})).log({state:i(),extra:p})});return function(_x19,_x20){return _ref10.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref11=_asyncToGenerator(function*({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f}){let{description:m,log:h}=yield t({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f});return{description:m,action:r(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(S,{getState:v,extra:g}){return yield h({state:v(),extra:g})});return function(_x22,_x23){return _ref12.apply(this,arguments)}}())}});return function prepare(_x21){return _ref11.apply(this,arguments)}}()}),n}var Ob=(e,t,r)=>{function n(...o){let a=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return OD(a)}return n},PD=e=>e.configuration.analytics.analyticsMode==="legacy",kD=e=>e.configuration.analytics.analyticsMode==="next",OD=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:a,providerClass:i})=>(r??(r=p=>new i(p)),TD(e,/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*({getState:p,analyticsClientMiddleware:f,preprocessRequest:m,logger:h}){let S=[],v={log:function(){var _ref14=_asyncToGenerator(function*({state:b}){for(let F of S)yield F(b)});return function log(_x25){return _ref14.apply(this,arguments)}}()},g=p(),C=a({getState:p,logger:h,analyticsClientMiddleware:f,preprocessRequest:m,provider:r(p)}),w=yield t(C,p());v.description=w?.description,S.push(/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(b){PD(b)&&(yield ND(w,r,b,h,C.coveoAnalyticsClient))});return function(_x26){return _ref15.apply(this,arguments)}}());let{emit:R}=Du(g);return S.push(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(b){if(kD(b)&&o&&n){let F=n(b);yield QD(R,o,F)}});return function(_x27){return _ref16.apply(this,arguments)}}()),v});return function(_x24){return _ref13.apply(this,arguments)}}()));function ND(_x28,_x29,_x30,_x31,_x32){return _ND.apply(this,arguments)}function _ND(){_ND=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let a=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:a},"Analytics response")});return _ND.apply(this,arguments)}var _D=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref17=_asyncToGenerator(function*(a){r(n,o)});return function log(_x33){return _ref17.apply(this,arguments)}}()}),Y=Ob(e=>Tb({...e,provider:e.provider||new fo(e.getState)}),e=>e,fo),i9=Ob(ub,_D("caseAssist"),Uu);var dt=(e,t)=>{let r=a=>a+(t.pagination?.firstResult??0),n=-1,o=t.search?.results;return n=qb(e,o),n<0&&(n=UD(e,o)),n<0&&(n=0),qD(e,r(n),t)};var Nb=(e,t)=>({sourceName:DD(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||Vn()});function DD(e){let t=e.source;return ue(t)?"unknown":t}var _b=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function qD(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:VD(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:LD(e),queryPipeline:r.pipeline||Vn()}}var He=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||""}),Db={urihash:new M,sourcetype:new M,permanentid:new M},$d={uniqueId:z,raw:new J({values:Db}),title:z,uri:z,clickUri:z,rankingModifier:new M({required:!1,emptyAllowed:!0})};function MD(e){return Object.assign({},...Object.keys(Db).map(t=>({[t]:e[t]})))}function jD(e){return Object.assign({},...Object.keys($d).map(t=>({[t]:e[t]})),{raw:MD(e.raw)})}function VD(e){let t=e.raw.author;return ue(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function LD(e){let t=e.raw.source;return ue(t)?"unknown":t}var Kt=e=>new ge($d).validate(jD(e));function UD(e,t){for(let[r,n]of t.entries()){let o=Gd(n);if(qb(e,o)!==-1)return r}return-1}function qb(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function QD(_x34,_x35,_x36){return _QD.apply(this,arguments)}function _QD(){_QD=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _QD.apply(this,arguments)}d();c();l();u();var cS=e=>O(e,{evt:z,type:it}),Mb=e=>Y("analytics/generic/search",t=>{cS(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),jb=e=>Y("analytics/generic/click",(t,r)=>(Kt(e.result),cS(e),t.makeClickEvent(e.evt,dt(e.result,r),He(e.result),e.meta))),Vb=e=>Y("analytics/generic/custom",t=>(cS(e),t.makeCustomEventWithType(e.evt,e.type,e.meta))),Hd=()=>Y("analytics/interface/load",e=>e.makeInterfaceLoad()),mo=()=>Y("analytics/interface/change",(e,t)=>e.makeInterfaceChange({interfaceChangeTo:t.configuration.analytics.originLevel2})),zd=()=>Y("analytics/interface/searchFromLink",e=>e.makeSearchFromLink()),Wd=e=>Y("analytics/interface/omniboxFromLink",t=>t.makeOmniboxFromLink(e)),Lb=()=>({actionCause:"interfaceLoad"}),Xi=()=>({actionCause:"interfaceChange"}),Ub=()=>({actionCause:"searchFromLink"}),Qb=()=>({actionCause:"omniboxFromLink"});d();c();l();u();var uS=()=>it,Bb=()=>z,zr=T("configuration/updateBasicConfiguration",e=>O(e,{accessToken:it,environment:new M({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:it})),mr=T("configuration/updateSearchConfiguration",e=>O(e,{proxyBaseUrl:new M({required:!1,url:!0}),pipeline:new M({required:!1,emptyAllowed:!0}),searchHub:it,timezone:it,locale:it,authenticationProviders:new ae({required:!1,each:z})})),BD={enabled:new ce({default:!0}),originContext:uS(),originLevel2:uS(),originLevel3:uS(),proxyBaseUrl:new M({required:!1,url:!0}),runtimeEnvironment:new Le,anonymous:new ce({default:!1}),deviceId:it,userDisplayName:it,documentLocation:it,trackingId:DA,analyticsMode:new M({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new J({options:{required:!1},values:VC.reduce((e,t)=>(e[t]=_A,e),{})})},go=T("configuration/updateAnalyticsConfiguration",e=>O(e,BD)),Zi=T("configuration/analytics/disable"),es=T("configuration/analytics/enable"),Kd=T("configuration/analytics/originlevel2",e=>O(e,{originLevel2:Bb()})),Yd=T("configuration/analytics/originlevel3",e=>O(e,{originLevel3:Bb()})),Jd=T("knowledge/setAgentId",e=>O(e,new M({required:!0})));d();c();l();u();d();c();l();u();d();c();l();u();var Xd={q:new M,enableQuerySyntax:new ce,aq:new M,cq:new M,firstResult:new ee({min:0}),numberOfResults:new ee({min:0}),sortCriteria:new M,f:new J,fExcluded:new J,cf:new J,nf:new J,mnf:new J,df:new J,debug:new ce,sf:new J,tab:new M,af:new J};var De=T("searchParameters/restore",e=>O(e,Xd)),ts=T("searchParameters/restoreTab",e=>O(e,z));d();c();l();u();var ho=T("debug/enable"),rs=T("debug/disable");d();c();l();u();var yo=()=>!1;var ns=oe(yo(),e=>{e.addCase(ho,()=>!0).addCase(rs,()=>!1).addCase(De,(t,r)=>r.payload.debug??t)});d();c();l();u();d();c();l();u();var lS=T("history/undo"),dS=T("history/redo"),ir=T("history/snapshot"),$u=Se("history/back",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,{dispatch:t}){t(lS()),yield t(_e())});return function(_x37,_x38){return _ref18.apply(this,arguments)}}()),Zd=Se("history/forward",/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,{dispatch:t}){t(dS()),yield t(_e())});return function(_x39,_x40){return _ref19.apply(this,arguments)}}()),_e=Se("history/change",/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x41,_x42){return _ref20.apply(this,arguments)}}());d();c();l();u();var os=T("pipeline/set",e=>O(e,new M({required:!0,emptyAllowed:!0})));var as=oe(Vn(),e=>{e.addCase(os,(t,r)=>r.payload).addCase(_e.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(mr,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var pt=T("breadcrumb/deselectAll"),is=T("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var Wr=T("facet/updateFacetAutoSelection",e=>O(e,{allow:new ce({required:!0})}));d();c();l();u();d();c();l();u();var Hu=class extends fo{constructor(r){super(r);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??lt().q}get responseTime(){return this.activeInstantResultCache?.duration??rr().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??rr().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var Gb=e=>Y({prefix:"analytics/instantResult/open",__legacy__getBuilder:(t,r)=>(Kt(e),t.makeDocumentOpen(dt(e,r),He(e))),__legacy__provider:t=>new Hu(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=dt(e,t),n=He(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}}),$b=()=>Y("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new Hu(e)),Hb=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var pS={id:z},GD={...pS,q:Ue},ss=T("instantResults/register",e=>O(e,pS)),Kr=T("instantResults/updateQuery",e=>O(e,GD)),cs=T("instantResults/clearExpired",e=>O(e,pS));d();c();l();u();var ep=new ee({required:!0,min:0}),us=T("pagination/registerNumberOfResults",e=>O(e,ep)),ls=T("pagination/updateNumberOfResults",e=>O(e,ep)),ds=T("pagination/registerPage",e=>O(e,ep)),Yr=T("pagination/updatePage",e=>O(e,ep)),ps=T("pagination/nextPage"),fs=T("pagination/previousPage");d();c();l();u();var Dt=T("query/updateQuery",e=>O(e,{q:new M,enableQuerySyntax:new ce}));d();c();l();u();d();c();l();u();var Ln=(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:qi(e)}});var ms=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ct(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&&Ln(e.configuration.analytics,t,r)),...(e.excerptLength&&!ue(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();l();u();d();c();l();u();d();c();l();u();var gs=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield cb(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}),...(sS()&&{pageId:sS()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:qi(e)})}}});return function gs(_x43,_x44){return _ref21.apply(this,arguments)}}();var So=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ct(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:Wt.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 gs(e.configuration.analytics,t))),...(e.excerptLength&&!ue(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function So(_x45,_x46){return _ref22.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var _r=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var fS=()=>Y("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),vo=e=>Y("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||lt().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}));d();c();l();u();d();c();l();u();var Wu=kr(tp(),1),Jb=kr(zb(),1);d();c();l();u();var rp=kr(tp(),1),Kb=kr(Wb(),1);rp.default.extend(Kb.default);var hs="YYYY/MM/DD@HH:mm:ss",$D="1401-01-01";function pa(e,t){let r=(0,rp.default)(e,t);return!r.isValid()&&!t?(0,rp.default)(e,hs):r}function zu(e){return e.format(hs)}function Yb(e){return zu(pa(e))===e}function np(e,t){let r=pa(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}`)}xS(r)}function xS(e){if(e.isBefore($D))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}Wu.default.extend(Jb.default);var Xb=["past","now","next"],Zb=["minute","hour","day","week","month","quarter","year"],HD=e=>{let t=e==="now";return{amount:new ee({required:!t,min:1}),unit:new M({required:!t,constrainTo:Zb}),period:new M({required:!0,constrainTo:Xb})}};function xo(e){if(typeof e=="string"&&!Jr(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?AS(e):e;new ge(HD(t.period)).validate(t);let r=tR(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);xS(r)}function eR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function tR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,Wu.default)().subtract(r,n);case"next":return(0,Wu.default)().add(r,n);case"now":return(0,Wu.default)()}}function Ku(e){return zu(tR(AS(e)))}function rR(e){return e.toLocaleLowerCase().split("-")}function Jr(e){let[t,r,n]=rR(e);if(t==="now")return!0;if(!Xb.includes(t)||!Zb.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function nR(e){return!!e&&typeof e=="object"&&"period"in e}function AS(e){let[t,r,n]=rR(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}function oR(e){return xo(e),AS(e)}d();c();l();u();function aR(e){return e.type==="dateRange"}function iR(e){return`start${e}`}function sR(e){return`end${e}`}var CS=()=>({dateFacetValueMap:{}});function zD(e,t,r){let n=e.start,o=e.end;return Jr(n)&&(n=Ku(n),r.dateFacetValueMap[t][iR(n)]=e.start),Jr(o)&&(o=Ku(o),r.dateFacetValueMap[t][sR(o)]=e.end),{...e,start:n,end:o}}function bS(e,t){if(aR(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>zD(o,r,t))}}return e}function Ao(e){let t=CS();return{request:{...e,facets:e.facets?.map(n=>bS(n,t))},mappings:t}}function WD(e,t,r){return{...e,start:r.dateFacetValueMap[t][iR(e.start)]||e.start,end:r.dateFacetValueMap[t][sR(e.end)]||e.end}}function KD(e,t){return e.facetId in t.dateFacetValueMap}function YD(e,t){return KD(e,t)?{...e,values:e.values.map(r=>WD(r,e.facetId,t))}:e}function op(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>YD(n,t))}}:e}d();c();l();u();d();c();l();u();var ys=T("didYouMean/enable"),ap=T("didYouMean/disable"),Ss=T("didYouMean/automaticCorrections/disable"),ip=T("didYouMean/automaticCorrections/enable"),gr=T("didYouMean/correction",e=>O(e,z)),fa=T("didYouMean/automaticCorrections/mode",e=>O(e,new M({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var sp=()=>Y("analytics/didyoumean/click",e=>e.makeDidYouMeanClick()),RS=()=>Y("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic()),cR=()=>({actionCause:"didYouMeanClick"}),uR=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function cp(){return{contextValues:{}}}d();c();l();u();function up(){return{contextValues:{}}}d();c();l();u();function wS(){return{enabled:!0,tabs:{}}}function lp(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function dp(){return[]}d();c();l();u();function hr(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function pp(){return{}}d();c();l();u();function fp(){return{}}d();c();l();u();function mp(){return{}}function lR(){return Dr({})}function Dr(e){return{context:e.context||cp(),dictionaryFieldContext:e.dictionaryFieldContext||up(),facetSet:e.facetSet||Hi(),numericFacetSet:e.numericFacetSet||$i(),dateFacetSet:e.dateFacetSet||Gi(),categoryFacetSet:e.categoryFacetSet||Bi(),automaticFacetSet:e.automaticFacetSet??Ui(),pagination:e.pagination||hr(),query:e.query||lt(),tabSet:e.tabSet||mp(),advancedSearchQueries:e.advancedSearchQueries||_r(),staticFilterSet:e.staticFilterSet||fp(),querySet:e.querySet||pp(),sortCriteria:e.sortCriteria||fr(),pipeline:e.pipeline||Vn(),searchHub:e.searchHub||po(),facetOptions:e.facetOptions||lp(),facetOrder:e.facetOrder??dp(),debug:e.debug??yo()}}d();c();l();u();var JD=new J({values:{undoneQuery:Ue},options:{required:!0}}),gp=()=>Y("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null),hp=e=>Y("analytics/trigger/query/undo",t=>(O(e,JD),t.makeUndoTriggerQuery(e))),yp=()=>Y("analytics/trigger/notify",(e,t)=>t.triggers?.notifications.length?e.makeTriggerNotify({notifications:t.triggers.notifications}):null),Sp=()=>Y("analytics/trigger/redirect",(e,t)=>t.triggers?.redirectTo?e.makeTriggerRedirect({redirectedTo:t.triggers.redirectTo}):null),vp=()=>Y("analytics/trigger/execute",(e,t)=>t.triggers?.executions.length?e.makeTriggerExecute({executions:t.triggers.executions}):null);d();c();l();u();var Co=T("trigger/query/ignore",e=>O(e,new M({emptyAllowed:!0,required:!0}))),vs=T("trigger/query/modification",e=>O(e,new J({values:{originalQuery:it,modification:it}})));d();c();l();u();d();c();l();u();d();c();l();u();function bo(e){return Object.values(e).map(t=>t.request)}function Yu(e,t){let r={};e.forEach(a=>{r[a.facetId]=a});let n=[];t.forEach(a=>{a in r&&(n.push(r[a]),delete r[a])});let o=Object.values(r);return[...n,...o]}function dR(e){return bo(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var FS={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function XD(e){return bo(e).map(t=>{let r=FS[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function ZD(e){return[...XD(e.facetSet??{}),...dR(e.numericFacetSet??{}),...dR(e.dateFacetSet??{}),...bo(e.categoryFacetSet??{})]}function eq(e){return ZD(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function xp(e){return Yu(eq(e),e.facetOrder??[])}d();c();l();u();var Ro=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t){let r=nq(e),n=xp(e),o=tq(e),a=yield So(e,t),i=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Ao({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:i(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Ro(_x47,_x48){return _ref23.apply(this,arguments)}}();function tq(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(rq).filter(r=>r.currentValues.length>0):void 0}function rq(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function nq(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=oq(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}function oq(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o})}var wo=class{constructor(t,r=n=>{this.dispatch(Dt({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x49,_x50){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=op(yield _this10.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this10.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return ht(t.response)?(this.dispatch(vo(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o||!a)return null;let m=i.length===0&&p&&p.length!==0,h=!ue(f)&&!ue(f.correctedQuery);if(!m&&!h)return null;let v=m?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(ir(Dr(_this12.getState()))),v})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this13.automaticallyRetryQueryWithCorrection(o);return ht(a.response)?(_this13.dispatch(vo(a.response.error)),_this13.rejectWithValue(a.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(ir(Dr(_this13.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:RS()})})()}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:RS()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(Co("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let a=_this14.getCurrentQuery(),i=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return ht(i.response)?(_this14.dispatch(vo(i.response.error)),_this14.rejectWithValue(i.response.error)):(_this14.dispatch(ir(Dr(_this14.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a,analyticsAction:gp()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??lt().enableQuerySyntax},search:{...rr(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(ir(Dr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return td(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield Ro(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(gr(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(vs({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield Ro(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var pR=Se("search/executeSearch",/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Ap(r,t,e)});return function(_x51,_x52){return _ref24.apply(this,arguments)}}()),fR=Se("search/fetchPage",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=t.getState();return yield IS(r,t,e)});return function(_x53,_x54){return _ref25.apply(this,arguments)}}()),mR=Se("search/fetchMoreResults",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=t.getState();return yield TS(t,r)});return function(_x55,_x56){return _ref26.apply(this,arguments)}}()),gR=Se("search/fetchFacetValues",/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){let r=t.getState();return yield cq(t,e,r)});return function(_x57,_x58){return _ref27.apply(this,arguments)}}()),hR=Se("search/fetchInstantResults",/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){return ES(e,t)});return function(_x59,_x60){return _ref28.apply(this,arguments)}}()),aq=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=yield Ro(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function aq(_x61,_x62){return _ref29.apply(this,arguments)}}(),iq=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t,r){let n=yield So(e);return Ao({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function iq(_x63,_x64,_x65){return _ref30.apply(this,arguments)}}(),sq=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=yield Ro(e,t);return r.request.numberOfResults=0,r});return function sq(_x66,_x67){return _ref31.apply(this,arguments)}}(),yR=e=>{e.configuration.analytics.enabled&&Wt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function ES(_x68,_x69){return _ES.apply(this,arguments)}function _ES(){_ES=_asyncToGenerator(function*(e,t){O(e,{id:z,q:z,maxResultsPerQuery:new ee({required:!0,min:1}),cacheTimeout:new ee});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),a=new wo({...t,analyticsAction:$b()},m=>{t.dispatch(Kr({q:m,id:e.id}))}),i=yield iq(o,r,n),p=yield a.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),f=yield a.process(p);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _ES.apply(this,arguments)}function IS(_x70,_x71,_x72){return _IS.apply(this,arguments)}function _IS(){_IS=_asyncToGenerator(function*(e,t,r){yR(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new wo({...t,analyticsAction:r}),f=yield Ro(e,i),m=yield p.fetchFromAPI(f,{origin:"mainSearch"});return yield p.process(m)});return _IS.apply(this,arguments)}function TS(_x73,_x74){return _TS.apply(this,arguments)}function _TS(){_TS=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:a}=yield fS().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),i=new wo({...e,analyticsAction:fS()}),p=yield aq(t,a),f=yield i.fetchFromAPI(p,{origin:"mainSearch"});return yield i.process(f)});return _TS.apply(this,arguments)}function cq(_x75,_x76,_x77){return _cq.apply(this,arguments)}function _cq(){_cq=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=e.extra,{description:i}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new wo({...e,analyticsAction:t}),f=yield sq(r,i),m=yield p.fetchFromAPI(f,{origin:"facetValues"});return yield p.process(m)});return _cq.apply(this,arguments)}function Ap(_x78,_x79,_x80){return _Ap.apply(this,arguments)}function _Ap(){_Ap=_asyncToGenerator(function*(e,t,r){yR(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=yield Ro(e,i),f=new wo({...t,analyticsAction:r}),m=yield f.fetchFromAPI(p,{origin:"mainSearch"});return yield f.process(m)});return _Ap.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var SR=Ye(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o}));var yr=/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t,r){let n=kS(e),o=uq(e),a=lq(e),i=e.configuration.analytics.analyticsMode==="legacy"?yield So(e,r):ms(e,t,r);return Ao({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:PS(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:a}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function yr(_x81,_x82,_x83){return _ref32.apply(this,arguments)}}();function PS(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function uq(e){return Yu(pq(e),e.facetOrder??[])}function lq(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(dq).filter(r=>r.currentValues.length>0):void 0}function dq(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function pq(e){return fq(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function fq(e){return[...mq(e.facetSet??{}),...vR(e.numericFacetSet??{}),...vR(e.dateFacetSet??{}),...bo(e.categoryFacetSet??{})]}function mq(e){return bo(e).map(t=>{let r=FS[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function vR(e){return bo(e).map(t=>{let r=t.currentValues,n=r.some(({state:a})=>a!=="idle"),o=r.some(a=>a.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function kS(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=SR(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}var Fo=class{constructor(t,r=n=>{this.dispatch(Dt({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x84,_x85){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=op(yield _this17.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this17.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return ht(t.response)?(this.dispatch(vo(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o||!a)return null;let m=i.length===0&&p&&p.length!==0,h=!ue(f)&&!ue(f.correctedQuery);if(!m&&!h)return null;let v=m?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(ir(Dr(_this19.getState()))),v})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this20.automaticallyRetryQueryWithCorrection(o);return ht(a.response)?(_this20.dispatch(vo(a.response.error)),_this20.rejectWithValue(a.response.error)):(_this20.dispatch(ir(Dr(_this20.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(Co("")),null;let a=_this21.getCurrentQuery(),i=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return ht(i.response)?(_this21.dispatch(vo(i.response.error)),_this21.rejectWithValue(i.response.error)):(_this21.dispatch(ir(Dr(_this21.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a})})()}processSuccessResponse(t){return this.dispatch(ir(Dr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return td(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=uR(),o=yield _this22.fetchFromAPI(yield yr(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(gr(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(vs({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield yr(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var xs=Se("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;O(e,{q:new M,enableQuerySyntax:new ce,clearFilters:new ce}),e.clearFilters&&(r(pt()),r(is())),r(Wr({allow:!0})),r(Dt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(Yr(1))}),xR=T("search/updateSearchAction"),G=Se("search/executeSearch",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ap(r,t,e.legacy);AR(r);let n=e.next?CR(e.next):void 0,o=yield yr(r,t.extra.navigatorContext,n),a=new Fo({...t,analyticsAction:n??{}}),i=yield a.fetchFromAPI(o,{origin:"mainSearch"});return yield a.process(i)});return function(_x86,_x87){return _ref33.apply(this,arguments)}}()),qt=Se("search/fetchPage",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(AR(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return IS(r,t,e.legacy);let n=new Fo({...t,analyticsAction:e.next}),o=yield yr(r,t.extra.navigatorContext,e.next),a=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(a)});return function(_x88,_x89){return _ref34.apply(this,arguments)}}()),Sr=Se("search/fetchMoreResults",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return TS(t,r);let n=kb("browseResults",t.getState),o=new Fo({...t,analyticsAction:n}),a=yield gq(r,t.extra.navigatorContext,n),i=yield o.fetchFromAPI(a,{origin:"mainSearch"});return yield o.process(i)});return function(_x90,_x91){return _ref35.apply(this,arguments)}}()),vr=Se("search/fetchFacetValues",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Ap(r,t,e.legacy);let n=new Fo({...t,analyticsAction:{}}),o=yield yq(r,t.extra.navigatorContext),a=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(a)});return function(_x92,_x93){return _ref36.apply(this,arguments)}}()),As=Se("search/fetchInstantResults",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return ES(e,t);O(e,{id:z,q:z,maxResultsPerQuery:new ee({required:!0,min:1}),cacheTimeout:new ee});let{q:n,maxResultsPerQuery:o}=e,a=CR(Hb()),i=yield hq(r,t.extra.navigatorContext,n,o,a),p=new Fo({...t,analyticsAction:a},h=>{t.dispatch(Kr({q:h,id:e.id}))}),f=yield p.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),m=yield p.process(f);return"response"in m?{results:m.response.results,searchUid:m.response.searchUid,totalCountFiltered:m.response.totalCountFiltered,duration:m.duration}:m});return function(_x94,_x95){return _ref37.apply(this,arguments)}}()),gq=/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t,r){let n=yield yr(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function gq(_x96,_x97,_x98){return _ref38.apply(this,arguments)}}(),hq=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t,r,n,o){let a=ms(e,t,o);return Ao({...a,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function hq(_x99,_x100,_x101,_x102,_x103){return _ref39.apply(this,arguments)}}(),yq=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t,r){let n=yield yr(e,t,r);return n.request.numberOfResults=0,n});return function yq(_x104,_x105,_x106){return _ref40.apply(this,arguments)}}(),AR=e=>{e.configuration.analytics.enabled&&Wt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},CR=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();var Eo=(e,t)=>{let r=e;return ue(r[t])?ue(e.raw[t])?null:e.raw[t]:r[t]},Sq=e=>t=>e.every(r=>!ue(Eo(t,r))),vq=e=>t=>e.every(r=>ue(Eo(t,r))),xq=(e,t)=>r=>{let n=bR(e,r);return t.some(o=>n.some(a=>`${a}`.toLowerCase()===o.toLowerCase()))},Aq=(e,t)=>r=>{let n=bR(e,r);return t.every(o=>n.every(a=>`${a}`.toLowerCase()!==o.toLowerCase()))},bR=(e,t)=>{let r=Eo(t,e);return Gl(r)?r:[r]},RR={getResultProperty:Eo,fieldsMustBeDefined:Sq,fieldsMustNotBeDefined:vq,fieldMustMatch:xq,fieldMustNotMatch:Aq};function Ju(e){return e.search.response.searchUid!==""}function wR(e,t,r){return e.search.results.find(n=>Eo(n,t)===r)}var OS=Ye(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();d();c();l();u();var Cs=T("app/setError");function NS(e,t){let r=t.payload??null;r&&(e.response=rr().response,e.results=[],e.questionAnswer=Fi()),e.error=r,e.isLoading=!1}function _S(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function Cq(e,t){_S(e,t),e.results=t.payload.response.results.map(r=>({...r,searchUid:t.payload.response.searchUid})),e.searchResponseId=t.payload.response.searchUid,e.questionAnswer=t.payload.response.questionAnswer,e.extendedResults=t.payload.response.extendedResults}function FR(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function bq(e,t){e.isLoading=!0,e.searchAction={actionCause:"browseResults"},e.requestId=t.meta.requestId}var fe=oe(rr(),e=>{e.addCase(G.rejected,(t,r)=>NS(t,r)),e.addCase(Sr.rejected,(t,r)=>NS(t,r)),e.addCase(qt.rejected,(t,r)=>NS(t,r)),e.addCase(G.fulfilled,(t,r)=>{Cq(t,r)}),e.addCase(Sr.fulfilled,(t,r)=>{_S(t,r),t.results=[...t.results,...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(qt.fulfilled,(t,r)=>{_S(t,r),t.results=[...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(vr.fulfilled,(t,r)=>{t.response.facets=r.payload.response.facets,t.response.searchUid=r.payload.response.searchUid}),e.addCase(G.pending,FR),e.addCase(Sr.pending,bq),e.addCase(qt.pending,FR),e.addCase(xR,(t,r)=>{t.searchAction=r.payload}),e.addCase(Cs,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();d();c();l();u();var bs=T("searchHub/set",e=>O(e,new M({required:!0,emptyAllowed:!0})));var Rs=oe(po(),e=>{e.addCase(bs,(t,r)=>r.payload).addCase(_e.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(mr,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();function ER(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var IR=Qr;function LR(e,t){if(e===t||!(IR(e)&&IR(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,a=Array.isArray(t)?[]:{};for(let i of r)a[i]=LR(e[i],t[i]),o&&(o=e[i]===a[i]);return o?e:a}function ws(e){let t=0;for(let r in e)t++;return t}var TR=e=>[].concat(...e);function Rq(e){return new RegExp("(^|:)//").test(e)}function wq(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Rp(e){return e!=null}function Fq(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var Eq=e=>e.replace(/\/$/,""),Iq=e=>e.replace(/^\//,"");function Tq(e,t){if(!e)return t;if(!t)return e;if(Rq(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=Eq(e),t=Iq(t),`${e}${r}${t}`}function Pq(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var PR=(...e)=>x(...e),kq=e=>e.status>=200&&e.status<=299,Oq=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function kR(e){if(!Qr(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function UR({baseUrl:e,prepareHeaders:t=S=>S,fetchFn:r=PR,paramsSerializer:n,isJsonContentType:o=Oq,jsonContentType:a="application/json",jsonReplacer:i,timeout:p,responseHandler:f,validateStatus:m,...h}={}){return typeof x>"u"&&r===PR&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(v,g,C){let{getState:w,extra:R,endpoint:b,forced:F,type:I}=g,P,{url:V,headers:_=new A(h.headers),params:k=void 0,responseHandler:N=f??"json",validateStatus:q=m??kq,timeout:U=p,...X}=typeof v=="string"?{url:v}:v,H,B=g.signal;U&&(H=new s.AbortController,g.signal.addEventListener("abort",H.abort),B=H.signal);let Q={...h,signal:B,...X};_=new A(kR(_)),Q.headers=(yield t(_,{getState:w,arg:v,extra:R,endpoint:b,forced:F,type:I,extraOptions:C}))||_;let K=Ae=>typeof Ae=="object"&&(Qr(Ae)||Array.isArray(Ae)||typeof Ae.toJSON=="function");if(!Q.headers.has("content-type")&&K(Q.body)&&Q.headers.set("content-type",a),K(Q.body)&&o(Q.headers)&&(Q.body=JSON.stringify(Q.body,i)),k){let Ae=~V.indexOf("?")?"&":"?",Ee=n?n(k):new URLSearchParams(kR(k));V+=Ae+Ee}V=Tq(e,V);let $=new Request(V,Q);P={request:new Request(V,Q)};let re,pe=!1,Re=H&&setTimeout(()=>{pe=!0,H.abort()},U);try{re=yield r($)}catch(Ae){return{error:{status:pe?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Ae)},meta:P}}finally{Re&&clearTimeout(Re),H?.signal.removeEventListener("abort",H.abort)}let ke=re.clone();P.response=ke;let Ce,we="";try{let Ae;if(yield Promise.all([S(re,N).then(Ee=>Ce=Ee,Ee=>Ae=Ee),ke.text().then(Ee=>we=Ee,()=>{})]),Ae)throw Ae}catch(Ae){return{error:{status:"PARSING_ERROR",originalStatus:re.status,data:we,error:String(Ae)},meta:P}}return q(re,Ce)?{data:Ce,meta:P}:{error:{status:re.status,data:Ce},meta:P}});return function(_x107,_x108,_x109){return _ref41.apply(this,arguments)}}());function S(_x110,_x111){return _S2.apply(this,arguments)}function _S2(){_S2=_asyncToGenerator(function*(v,g){if(typeof g=="function")return g(v);if(g==="content-type"&&(g=o(v.headers)?"json":"text"),g==="json"){let C=yield v.text();return C.length?JSON.parse(C):null}return v.text()});return _S2.apply(this,arguments)}}var Fs=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function Nq(){return _Nq.apply(this,arguments)}function _Nq(){_Nq=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(o=>setTimeout(a=>o(a),n))});return _Nq.apply(this,arguments)}function _q(e,t){throw Object.assign(new Fs({error:e,meta:t}),{throwImmediately:!0})}var OR={},Dq=(e,t)=>(/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(r,n,o){let a=[5,(t||OR).maxRetries,(o||OR).maxRetries].filter(h=>h!==void 0),[i]=a.slice(-1),f={maxRetries:i,backoff:Nq,retryCondition:(h,S,{attempt:v})=>v<=i,...t,...o},m=0;for(;;)try{let h=yield e(r,n,o);if(h.error)throw new Fs(h);return h}catch(h){if(m++,h.throwImmediately){if(h instanceof Fs)return h.value;throw h}if(h instanceof Fs&&!f.retryCondition(h.value.error,r,{attempt:m,baseQueryApi:n,extraOptions:o}))return h.value;yield f.backoff(m,f.maxRetries)}});return function(_x112,_x113,_x114){return _ref42.apply(this,arguments)}}()),QR=Object.assign(Dq,{fail:_q}),jS=T("__rtkq/focused"),BR=T("__rtkq/unfocused"),VS=T("__rtkq/online"),GR=T("__rtkq/offline");function LS(e){return e.type==="query"}function qq(e){return e.type==="mutation"}function US(e){return e.type==="infinitequery"}function QS(e,t,r,n,o,a){return Mq(e)?e(t,r,n,o).filter(Rp).map(DS).map(a):Array.isArray(e)?e.map(DS).map(a):[]}function Mq(e){return typeof e=="function"}function DS(e){return typeof e=="string"?{type:e}:e}function jq(e,t){return e.catch(t)}var Zu=Symbol("forceQueryFn"),qS=e=>typeof e[Zu]=="function";function Vq({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:a}){let i=new Map,p=new Map,{unsubscribeQueryResult:f,removeMutationResult:m,updateSubscriptionOptions:h}=o.internalActions;return{buildInitiateQuery:b,buildInitiateInfiniteQuery:F,buildInitiateMutation:I,getRunningQueryThunk:S,getRunningMutationThunk:v,getRunningQueriesThunk:g,getRunningMutationsThunk:C};function S(P,V){return _=>{let k=a.endpointDefinitions[P],N=e({queryArgs:V,endpointDefinition:k,endpointName:P});return i.get(_)?.[N]}}function v(P,V){return _=>p.get(_)?.[V]}function g(){return P=>Object.values(i.get(P)||{}).filter(Rp)}function C(){return P=>Object.values(p.get(P)||{}).filter(Rp)}function w(P){}function R(P,V){let _=(k,{subscribe:N=!0,forceRefetch:q,subscriptionOptions:U,[Zu]:X,...H}={})=>(B,Q)=>{let K=e({queryArgs:k,endpointDefinition:V,endpointName:P}),$,te={...H,type:"query",subscribe:N,forceRefetch:q,subscriptionOptions:U,endpointName:P,originalArgs:k,queryCacheKey:K,[Zu]:X};if(LS(V))$=t(te);else{let{direction:Me,initialPageParam:Ze}=H;$=r({...te,direction:Me,initialPageParam:Ze})}let re=o.endpoints[P].select(k),pe=B($),Re=re(Q());let{requestId:ke,abort:Ce}=pe,we=Re.requestId!==ke,Ae=i.get(B)?.[K],Ee=()=>re(Q()),rt=Object.assign(X?pe.then(Ee):we&&!Ae?Promise.resolve(Re):Promise.all([Ae,pe]).then(Ee),{arg:k,requestId:ke,subscriptionOptions:U,queryCacheKey:K,abort:Ce,unwrap(){return _asyncToGenerator(function*(){let Me=yield rt;if(Me.isError)throw Me.error;return Me.data})()},refetch:()=>B(_(k,{subscribe:!1,forceRefetch:!0})),unsubscribe(){N&&B(f({queryCacheKey:K,requestId:ke}))},updateSubscriptionOptions(Me){rt.subscriptionOptions=Me,B(h({endpointName:P,requestId:ke,queryCacheKey:K,options:Me}))}});if(!Ae&&!we&&!X){let Me=Pq(i,B,{});Me[K]=rt,rt.then(()=>{delete Me[K],ws(Me)||i.delete(B)})}return rt};return _}function b(P,V){return R(P,V)}function F(P,V){return R(P,V)}function I(P){return(V,{track:_=!0,fixedCacheKey:k}={})=>(N,q)=>{let U=n({type:"mutation",endpointName:P,originalArgs:V,track:_,fixedCacheKey:k}),X=N(U);let{requestId:H,abort:B,unwrap:Q}=X,K=jq(X.unwrap().then(pe=>({data:pe})),pe=>({error:pe})),$=()=>{N(m({requestId:H,fixedCacheKey:k}))},te=Object.assign(K,{arg:X.arg,requestId:H,abort:B,unwrap:Q,reset:$}),re=p.get(N)||{};return p.set(N,re),re[H]=te,te.then(()=>{delete re[H],ws(re)||p.delete(N)}),k&&(re[k]=te,te.then(()=>{re[k]===te&&(delete re[k],ws(re)||p.delete(N))})),te}}}function Lq(e){return e}var Cp=(e={})=>({...e,[ku]:!0});function Uq({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:a,selectors:i}){let p=(N,q,U,X)=>(H,B)=>{let Q=r[N],K=n({queryArgs:q,endpointDefinition:Q,endpointName:N});if(H(o.internalActions.queryResultPatched({queryCacheKey:K,patches:U})),!X)return;let $=o.endpoints[N].select(q)(B()),te=QS(Q.providesTags,$.data,void 0,q,{},a);H(o.internalActions.updateProvidedBy({queryCacheKey:K,providedTags:te}))};function f(N,q,U=0){let X=[q,...N];return U&&X.length>U?X.slice(0,-1):X}function m(N,q,U=0){let X=[...N,q];return U&&X.length>U?X.slice(1):X}let h=(N,q,U,X=!0)=>(H,B)=>{let K=o.endpoints[N].select(q)(B()),$={patches:[],inversePatches:[],undo:()=>H(o.util.patchQueryData(N,q,$.inversePatches,X))};if(K.status==="uninitialized")return $;let te;if("data"in K)if(zt(K.data)){let[re,pe,Re]=ud(K.data,U);$.patches.push(...pe),$.inversePatches.push(...Re),te=re}else te=U(K.data),$.patches.push({op:"replace",path:[],value:te}),$.inversePatches.push({op:"replace",path:[],value:K.data});return $.patches.length===0||H(o.util.patchQueryData(N,q,$.patches,X)),$},S=(N,q,U)=>X=>X(o.endpoints[N].initiate(q,{subscribe:!1,forceRefetch:!0,[Zu]:()=>({data:U})})),v=(N,q)=>N.query&&N[q]?N[q]:Lq,g=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(N,{signal:q,abort:U,rejectWithValue:X,fulfillWithValue:H,dispatch:B,getState:Q,extra:K}){let $=r[N.endpointName];try{let te=v($,"transformResponse"),re={signal:q,abort:U,dispatch:B,getState:Q,extra:K,endpoint:N.endpointName,type:N.type,forced:N.type==="query"?C(N,Q()):void 0,queryCacheKey:N.type==="query"?N.queryCacheKey:void 0},pe=N.type==="query"?N[Zu]:void 0,Re,ke=/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(we,Ae,Ee,rt){if(Ae==null&&we.pages.length)return Promise.resolve({data:we});let Me={queryArg:N.originalArgs,pageParam:Ae},Ze=yield Ce(Me),at=rt?f:m;return{data:{pages:at(we.pages,Ze.data,Ee),pageParams:at(we.pageParams,Ae,Ee)}}});return function ke(_x117,_x118,_x119,_x120){return _ref44.apply(this,arguments)}}();function Ce(_x121){return _Ce.apply(this,arguments)}function _Ce(){_Ce=_asyncToGenerator(function*(we){let Ae,{extraOptions:Ee}=$;if(pe?Ae=pe():$.query?Ae=yield t($.query(we),re,Ee):Ae=yield $.queryFn(we,re,Ee,Me=>t(Me,re,Ee)),typeof process<"u",Ae.error)throw new Fs(Ae.error,Ae.meta);let rt=yield te(Ae.data,Ae.meta,we);return{...Ae,data:rt}});return _Ce.apply(this,arguments)}if(N.type==="query"&&"infiniteQueryOptions"in $){let{infiniteQueryOptions:we}=$,{maxPages:Ae=1/0}=we,Ee,rt={pages:[],pageParams:[]},Me=i.selectQueryEntry(Q(),N.queryCacheKey)?.data,at=C(N,Q())&&!N.direction||!Me?rt:Me;if("direction"in N&&N.direction&&at.pages.length){let $t=N.direction==="backward",no=($t?$R:MS)(we,at);Ee=yield ke(at,no,Ae,$t)}else{let{initialPageParam:$t=we.initialPageParam}=N,ur=Me?.pageParams??[],no=ur[0]??$t,gi=ur.length;Ee=yield ke(at,no,Ae),pe&&(Ee={data:Ee.data.pages[0]});for(let hi=1;hi<gi;hi++){let du=MS(we,Ee.data);Ee=yield ke(Ee.data,du,Ae)}}Re=Ee}else Re=yield Ce(N.originalArgs);return H(Re.data,Cp({fulfilledTimeStamp:Date.now(),baseQueryMeta:Re.meta}))}catch(te){let re=te;if(re instanceof Fs){let pe=v($,"transformErrorResponse");try{return X(yield pe(re.value,re.meta,N.originalArgs),Cp({baseQueryMeta:re.meta}))}catch(Re){re=Re}}throw typeof process<"u",console.error(re),re}});return function g(_x115,_x116){return _ref43.apply(this,arguments)}}();function C(N,q){let U=i.selectQueryEntry(q,N.queryCacheKey),X=i.selectConfig(q).refetchOnMountOrArgChange,H=U?.fulfilledTimeStamp,B=N.forceRefetch??(N.subscribe&&X);return B?B===!0||(Number(new Date)-Number(H))/1e3>=B:!1}let w=()=>Se(`${e}/executeQuery`,g,{getPendingMeta({arg:q}){let U=r[q.endpointName];return Cp({startedTimeStamp:Date.now(),...(US(U)?{direction:q.direction}:{})})},condition(q,{getState:U}){let X=U(),H=i.selectQueryEntry(X,q.queryCacheKey),B=H?.fulfilledTimeStamp,Q=q.originalArgs,K=H?.originalArgs,$=r[q.endpointName],te=q.direction;return qS(q)?!0:H?.status==="pending"?!1:C(q,X)||LS($)&&$?.forceRefetch?.({currentArg:Q,previousArg:K,endpointState:H,state:X})?!0:!(B&&!te)},dispatchConditionRejection:!0}),R=w(),b=w(),F=Se(`${e}/executeMutation`,g,{getPendingMeta(){return Cp({startedTimeStamp:Date.now()})}}),I=N=>"force"in N,P=N=>"ifOlderThan"in N,V=(N,q,U)=>(X,H)=>{let B=I(U)&&U.force,Q=P(U)&&U.ifOlderThan,K=(te=!0)=>{let re={forceRefetch:te,isPrefetch:!0};return o.endpoints[N].initiate(q,re)},$=o.endpoints[N].select(q)(H());if(B)X(K());else if(Q){let te=$?.fulfilledTimeStamp;if(!te){X(K());return}(Number(new Date)-Number(new Date(te)))/1e3>=Q&&X(K())}else X(K(!1))};function _(N){return q=>q?.meta?.arg?.endpointName===N}function k(N,q){return{matchPending:_i(gd(N),_(q)),matchFulfilled:_i(qn(N),_(q)),matchRejected:_i(ia(N),_(q))}}return{queryThunk:R,mutationThunk:F,infiniteQueryThunk:b,prefetch:V,updateQueryData:h,upsertQueryData:S,patchQueryData:p,buildMatchThunkActions:k}}function MS(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function $R(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function HR(e,t,r,n){return QS(r[e.meta.arg.endpointName][t],qn(e)?e.payload:void 0,Nu(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function bp(e,t,r){let n=e[t];n&&r(n)}function el(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function NR(e,t,r){let n=e[el(t)];n&&r(n)}var Xu={};function Qq({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:a,extractRehydrationInfo:i,hasRehydrationInfo:p},assertTagType:f,config:m}){let h=T(`${e}/resetApiState`);function S(_,k,N,q){var U;_[U=k.queryCacheKey]??(_[U]={status:"uninitialized",endpointName:k.endpointName}),bp(_,k.queryCacheKey,X=>{X.status="pending",X.requestId=N&&X.requestId?X.requestId:q.requestId,k.originalArgs!==void 0&&(X.originalArgs=k.originalArgs),X.startedTimeStamp=q.startedTimeStamp;let H=o[q.arg.endpointName];US(H)&&"direction"in k&&(X.direction=k.direction)})}function v(_,k,N,q){bp(_,k.arg.queryCacheKey,U=>{if(U.requestId!==k.requestId&&!q)return;let{merge:X}=o[k.arg.endpointName];if(U.status="fulfilled",X){if(U.data!==void 0){let{fulfilledTimeStamp:H,arg:B,baseQueryMeta:Q,requestId:K}=k,$=Dn(U.data,te=>X(te,N,{arg:B.originalArgs,baseQueryMeta:Q,fulfilledTimeStamp:H,requestId:K}));U.data=$}else U.data=N;}else U.data=o[k.arg.endpointName].structuralSharing??!0?LR(nr(U.data)?gy(U.data):U.data,N):N;delete U.error,U.fulfilledTimeStamp=k.fulfilledTimeStamp})}let g=sa({name:`${e}/queries`,initialState:Xu,reducers:{removeQueryResult:{reducer(_,{payload:{queryCacheKey:k}}){delete _[k]},prepare:Di()},cacheEntriesUpserted:{reducer(_,k){for(let N of k.payload){let{queryDescription:q,value:U}=N;S(_,q,!0,{arg:q,requestId:k.meta.requestId,startedTimeStamp:k.meta.timestamp}),v(_,{arg:q,requestId:k.meta.requestId,fulfilledTimeStamp:k.meta.timestamp,baseQueryMeta:{}},U,!0)}},prepare:_=>({payload:_.map(q=>{let{endpointName:U,arg:X,value:H}=q,B=o[U];return{queryDescription:{type:"query",endpointName:U,originalArgs:q.arg,queryCacheKey:n({queryArgs:X,endpointDefinition:B,endpointName:U})},value:H}}),meta:{[ku]:!0,requestId:_u(),timestamp:Date.now()}})},queryResultPatched:{reducer(_,{payload:{queryCacheKey:k,patches:N}}){bp(_,k,q=>{q.data=yy(q.data,N.concat())})},prepare:Di()}},extraReducers(_){_.addCase(t.pending,(k,{meta:N,meta:{arg:q}})=>{let U=qS(q);S(k,q,U,N)}).addCase(t.fulfilled,(k,{meta:N,payload:q})=>{let U=qS(N.arg);v(k,N,q,U)}).addCase(t.rejected,(k,{meta:{condition:N,arg:q,requestId:U},error:X,payload:H})=>{bp(k,q.queryCacheKey,B=>{if(!N){if(B.requestId!==U)return;B.status="rejected",B.error=H??X}})}).addMatcher(p,(k,N)=>{let{queries:q}=i(N);for(let[U,X]of Object.entries(q))(X?.status==="fulfilled"||X?.status==="rejected")&&(k[U]=X)})}}),C=sa({name:`${e}/mutations`,initialState:Xu,reducers:{removeMutationResult:{reducer(_,{payload:k}){let N=el(k);N in _&&delete _[N]},prepare:Di()}},extraReducers(_){_.addCase(r.pending,(k,{meta:N,meta:{requestId:q,arg:U,startedTimeStamp:X}})=>{U.track&&(k[el(N)]={requestId:q,status:"pending",endpointName:U.endpointName,startedTimeStamp:X})}).addCase(r.fulfilled,(k,{payload:N,meta:q})=>{q.arg.track&&NR(k,q,U=>{U.requestId===q.requestId&&(U.status="fulfilled",U.data=N,U.fulfilledTimeStamp=q.fulfilledTimeStamp)})}).addCase(r.rejected,(k,{payload:N,error:q,meta:U})=>{U.arg.track&&NR(k,U,X=>{X.requestId===U.requestId&&(X.status="rejected",X.error=N??q)})}).addMatcher(p,(k,N)=>{let{mutations:q}=i(N);for(let[U,X]of Object.entries(q))(X?.status==="fulfilled"||X?.status==="rejected")&&U!==X?.requestId&&(k[U]=X)})}}),w=sa({name:`${e}/invalidation`,initialState:Xu,reducers:{updateProvidedBy:{reducer(_,k){var U,X;let{queryCacheKey:N,providedTags:q}=k.payload;for(let H of Object.values(_))for(let B of Object.values(H)){let Q=B.indexOf(N);Q!==-1&&B.splice(Q,1)}for(let{type:H,id:B}of q){let Q=(U=_[H]??(_[H]={}))[X=B||"__internal_without_id"]??(U[X]=[]);Q.includes(N)||Q.push(N)}},prepare:Di()}},extraReducers(_){_.addCase(g.actions.removeQueryResult,(k,{payload:{queryCacheKey:N}})=>{for(let q of Object.values(k))for(let U of Object.values(q)){let X=U.indexOf(N);X!==-1&&U.splice(X,1)}}).addMatcher(p,(k,N)=>{var U,X;let{provided:q}=i(N);for(let[H,B]of Object.entries(q))for(let[Q,K]of Object.entries(B)){let $=(U=k[H]??(k[H]={}))[X=Q||"__internal_without_id"]??(U[X]=[]);for(let te of K)$.includes(te)||$.push(te)}}).addMatcher(Br(qn(t),Nu(t)),(k,N)=>{let q=HR(N,"providesTags",o,f),{queryCacheKey:U}=N.meta.arg;w.caseReducers.updateProvidedBy(k,w.actions.updateProvidedBy({queryCacheKey:U,providedTags:q}))})}}),R=sa({name:`${e}/subscriptions`,initialState:Xu,reducers:{updateSubscriptionOptions(_,k){},unsubscribeQueryResult(_,k){},internal_getRTKQSubscriptions(){}}}),b=sa({name:`${e}/internalSubscriptions`,initialState:Xu,reducers:{subscriptionsUpdated:{reducer(_,k){return yy(_,k.payload)},prepare:Di()}}}),F=sa({name:`${e}/config`,initialState:{online:Fq(),focused:wq(),middlewareRegistered:!1,...m},reducers:{middlewareRegistered(_,{payload:k}){_.middlewareRegistered=_.middlewareRegistered==="conflict"||a!==k?"conflict":!0}},extraReducers:_=>{_.addCase(VS,k=>{k.online=!0}).addCase(GR,k=>{k.online=!1}).addCase(jS,k=>{k.focused=!0}).addCase(BR,k=>{k.focused=!1}).addMatcher(p,k=>({...k}))}}),I=Ei({queries:g.reducer,mutations:C.reducer,provided:w.reducer,subscriptions:b.reducer,config:F.reducer}),P=(_,k)=>I(h.match(k)?void 0:_,k),V={...F.actions,...g.actions,...R.actions,...b.actions,...C.actions,...w.actions,resetApiState:h};return{reducer:P,actions:V}}var ga=Symbol.for("RTKQ/skipToken"),zR={status:"uninitialized"},_R=Dn(zR,()=>{}),DR=Dn(zR,()=>{});function Bq({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=I=>_R,o=I=>DR;return{buildQuerySelector:v,buildInfiniteQuerySelector:g,buildMutationSelector:C,selectInvalidatedBy:w,selectCachedArgsForQuery:R,selectApiState:i,selectQueries:p,selectMutations:m,selectQueryEntry:f,selectConfig:h};function a(I){return{...I,...ER(I.status)}}function i(I){return I[t]}function p(I){return i(I)?.queries}function f(I,P){return p(I)?.[P]}function m(I){return i(I)?.mutations}function h(I){return i(I)?.config}function S(I,P,V){return _=>{if(_===ga)return r(n,V);let k=e({queryArgs:_,endpointDefinition:P,endpointName:I});return r(q=>f(q,k)??_R,V)}}function v(I,P){return S(I,P,a)}function g(I,P){let{infiniteQueryOptions:V}=P;function _(k){let N={...k,...ER(k.status)},{isLoading:q,isError:U,direction:X}=N,H=X==="forward",B=X==="backward";return{...N,hasNextPage:b(V,N.data),hasPreviousPage:F(V,N.data),isFetchingNextPage:q&&H,isFetchingPreviousPage:q&&B,isFetchNextPageError:U&&H,isFetchPreviousPageError:U&&B}}return S(I,P,_)}function C(){return I=>{let P;return typeof I=="object"?P=el(I)??ga:P=I,r(P===ga?o:k=>i(k)?.mutations?.[P]??DR,a)}}function w(I,P){let V=I[t],_=new Set;for(let k of P.filter(Rp).map(DS)){let N=V.provided[k.type];if(!N)continue;let q=(k.id!==void 0?N[k.id]:TR(Object.values(N)))??[];for(let U of q)_.add(U)}return TR(Array.from(_.values()).map(k=>{let N=V.queries[k];return N?[{queryCacheKey:k,endpointName:N.endpointName,originalArgs:N.originalArgs}]:[]}))}function R(I,P){return Object.values(p(I)).filter(V=>V?.endpointName===P&&V.status!=="uninitialized").map(V=>V.originalArgs)}function b(I,P){return P?MS(I,P)!=null:!1}function F(I,P){return!P||!I.getPreviousPageParam?!1:$R(I,P)!=null}}var qR=WeakMap?new WeakMap:void 0,MR=({endpointName:e,queryArgs:t})=>{let r="",n=qR?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(a,i)=>(i=typeof i=="bigint"?{$bigint:i.toString()}:i,i=Qr(i)?Object.keys(i).sort().reduce((p,f)=>(p[f]=i[f],p),{}):i,i));Qr(t)&&qR?.set(t,o),r=o}return`${e}(${r})`};function Gq(...e){return function(r){let n=Oi(m=>r.extractRehydrationInfo?.(m,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(m){let h=MR;if("serializeQueryArgs"in m.endpointDefinition){let S=m.endpointDefinition.serializeQueryArgs;h=v=>{let g=S(v);return typeof g=="string"?g:MR({...v,queryArgs:g})}}else r.serializeQueryArgs&&(h=r.serializeQueryArgs);return h(m)},tagTypes:[...(r.tagTypes||[])]},a={endpointDefinitions:{},batch(m){m()},apiUid:_u(),extractRehydrationInfo:n,hasRehydrationInfo:Oi(m=>n(m)!=null)},i={injectEndpoints:f,enhanceEndpoints({addTagTypes:m,endpoints:h}){if(m)for(let S of m)o.tagTypes.includes(S)||o.tagTypes.push(S);if(h)for(let[S,v]of Object.entries(h))typeof v=="function"?v(a.endpointDefinitions[S]):Object.assign(a.endpointDefinitions[S]||{},v);return i}},p=e.map(m=>m.init(i,o,a));function f(m){let h=m.endpoints({query:S=>({...S,type:"query"}),mutation:S=>({...S,type:"mutation"}),infiniteQuery:S=>({...S,type:"infinitequery"})});for(let[S,v]of Object.entries(h)){if(m.overrideExisting!==!0&&S in a.endpointDefinitions){if(m.overrideExisting==="throw")throw new Error(Bt(39));typeof process<"u";continue}typeof process<"u",a.endpointDefinitions[S]=v;for(let g of p)g.injectEndpoint(S,v)}return i}return i.injectEndpoints({endpoints:r.endpoints})}}function Un(e,...t){return Object.assign(e,...t)}var $q=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,o=null,a=null,{updateSubscriptionOptions:i,unsubscribeQueryResult:p}=e.internalActions,f=(g,C)=>{var R,b;if(i.match(C)){let{queryCacheKey:F,requestId:I,options:P}=C.payload;return g?.[F]?.[I]&&(g[F][I]=P),!0}if(p.match(C)){let{queryCacheKey:F,requestId:I}=C.payload;return g[F]&&delete g[F][I],!0}if(e.internalActions.removeQueryResult.match(C))return delete g[C.payload.queryCacheKey],!0;if(t.pending.match(C)){let{meta:{arg:F,requestId:I}}=C,P=g[R=F.queryCacheKey]??(g[R]={});return P[`${I}_running`]={},F.subscribe&&(P[I]=F.subscriptionOptions??P[I]??{}),!0}let w=!1;if(t.fulfilled.match(C)||t.rejected.match(C)){let F=g[C.meta.arg.queryCacheKey]||{},I=`${C.meta.requestId}_running`;w||(w=!!F[I]),delete F[I]}if(t.rejected.match(C)){let{meta:{condition:F,arg:I,requestId:P}}=C;if(F&&I.subscribe){let V=g[b=I.queryCacheKey]??(g[b]={});V[P]=I.subscriptionOptions??V[P]??{},w=!0}}return w},m=()=>r.currentSubscriptions,v={getSubscriptions:m,getSubscriptionCount:g=>{let w=m()[g]??{};return ws(w)},isRequestSubscribed:(g,C)=>!!m()?.[g]?.[C]};return(g,C)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(g))return o=r.currentSubscriptions={},a=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(g))return[!1,v];let w=f(r.currentSubscriptions,g),R=!0;if(w){a||(a=setTimeout(()=>{let I=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,P]=ud(o,()=>I);C.next(e.internalActions.subscriptionsUpdated(P)),o=I,a=null},500));let b=typeof g.type=="string"&&!!g.type.startsWith(n),F=t.rejected.match(g)&&g.meta.condition&&!!g.meta.arg.subscribe;R=!b&&!F}return[R,!1]}};function Hq(e){for(let t in e)return!1;return!0}var zq=2147483647/1e3-1,Wq=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:a,selectConfig:i}})=>{let{removeQueryResult:p,unsubscribeQueryResult:f,cacheEntriesUpserted:m}=t.internalActions,h=Br(f.match,r.fulfilled,r.rejected,m.match);function S(R){let b=o.currentSubscriptions[R];return!!b&&!Hq(b)}let v={},g=(R,b,F)=>{let I=b.getState(),P=i(I);if(h(R)){let V;if(m.match(R))V=R.payload.map(_=>_.queryDescription.queryCacheKey);else{let{queryCacheKey:_}=f.match(R)?R.payload:R.meta.arg;V=[_]}C(V,b,P)}if(t.util.resetApiState.match(R))for(let[V,_]of Object.entries(v))_&&clearTimeout(_),delete v[V];if(n.hasRehydrationInfo(R)){let{queries:V}=n.extractRehydrationInfo(R);C(Object.keys(V),b,P)}};function C(R,b,F){let I=b.getState();for(let P of R){let V=a(I,P);w(P,V?.endpointName,b,F)}}function w(R,b,F,I){let V=n.endpointDefinitions[b]?.keepUnusedDataFor??I.keepUnusedDataFor;if(V===1/0)return;let _=Math.max(0,Math.min(V,zq));if(!S(R)){let k=v[R];k&&clearTimeout(k),v[R]=setTimeout(()=>{S(R)||F.dispatch(p({queryCacheKey:R})),delete v[R]},_*1e3)}}return g},jR=new Error("Promise never resolved before cacheEntryRemoved."),Kq=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:a,selectors:{selectQueryEntry:i,selectApiState:p}})=>{let f=hd(n),m=hd(o),h=qn(n,o),S={};function v(b,F,I){let P=S[b];P?.valueResolved&&(P.valueResolved({data:F,meta:I}),delete P.valueResolved)}function g(b){let F=S[b];F&&(delete S[b],F.cacheEntryRemoved())}let C=(b,F,I)=>{let P=w(b);function V(_,k,N,q){let U=i(I,k),X=i(F.getState(),k);!U&&X&&R(_,q,k,F,N)}if(n.pending.match(b))V(b.meta.arg.endpointName,P,b.meta.requestId,b.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(b))for(let{queryDescription:_,value:k}of b.payload){let{endpointName:N,originalArgs:q,queryCacheKey:U}=_;V(N,U,b.meta.requestId,q),v(U,k,{})}else if(o.pending.match(b))F.getState()[t].mutations[P]&&R(b.meta.arg.endpointName,b.meta.arg.originalArgs,P,F,b.meta.requestId);else if(h(b))v(P,b.payload,b.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(b)||e.internalActions.removeMutationResult.match(b))g(P);else if(e.util.resetApiState.match(b))for(let _ of Object.keys(S))g(_)};function w(b){return f(b)?b.meta.arg.queryCacheKey:m(b)?b.meta.arg.fixedCacheKey??b.meta.requestId:e.internalActions.removeQueryResult.match(b)?b.payload.queryCacheKey:e.internalActions.removeMutationResult.match(b)?el(b.payload):""}function R(b,F,I,P,V){let _=r.endpointDefinitions[b],k=_?.onCacheEntryAdded;if(!k)return;let N={},q=new Promise(K=>{N.cacheEntryRemoved=K}),U=Promise.race([new Promise(K=>{N.valueResolved=K}),q.then(()=>{throw jR})]);U.catch(()=>{}),S[I]=N;let X=e.endpoints[b].select(_.type==="query"?F:I),H=P.dispatch((K,$,te)=>te),B={...P,getCacheEntry:()=>X(P.getState()),requestId:V,extra:H,updateCachedData:_.type==="query"?K=>P.dispatch(e.util.updateQueryData(b,F,K)):void 0,cacheDataLoaded:U,cacheEntryRemoved:q},Q=k(F,B);Promise.resolve(Q).catch(K=>{if(K!==jR)throw K})}return C},Yq=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},Jq=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:a,assertTagType:i,refetchQuery:p,internalState:f})=>{let{removeQueryResult:m}=a.internalActions,h=Br(qn(n),Nu(n)),S=Br(qn(n,o),ia(n,o)),v=[],g=(R,b)=>{h(R)?w(HR(R,"invalidatesTags",r,i),b):S(R)?w([],b):a.util.invalidateTags.match(R)&&w(QS(R.payload,void 0,void 0,void 0,void 0,i),b)};function C(R){let{queries:b,mutations:F}=R;for(let I of[b,F])for(let P in I)if(I[P]?.status==="pending")return!0;return!1}function w(R,b){let F=b.getState(),I=F[e];if(v.push(...R),I.config.invalidationBehavior==="delayed"&&C(I))return;let P=v;if(v=[],P.length===0)return;let V=a.util.selectInvalidatedBy(F,P);t.batch(()=>{let _=Array.from(V.values());for(let{queryCacheKey:k}of _){let N=I.queries[k],q=f.currentSubscriptions[k]??{};N&&(ws(q)===0?b.dispatch(m({queryCacheKey:k})):N.status!=="uninitialized"&&b.dispatch(p(N)))}})}return g},Xq=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let a={},i=(g,C)=>{(r.internalActions.updateSubscriptionOptions.match(g)||r.internalActions.unsubscribeQueryResult.match(g))&&m(g.payload,C),(t.pending.match(g)||t.rejected.match(g)&&g.meta.condition)&&m(g.meta.arg,C),(t.fulfilled.match(g)||t.rejected.match(g)&&!g.meta.condition)&&f(g.meta.arg,C),r.util.resetApiState.match(g)&&S()};function p(g,C){let R=C.getState()[e].queries[g],b=o.currentSubscriptions[g];if(!(!R||R.status==="uninitialized"))return b}function f({queryCacheKey:g},C){let w=C.getState()[e],R=w.queries[g],b=o.currentSubscriptions[g];if(!R||R.status==="uninitialized")return;let{lowestPollingInterval:F,skipPollingIfUnfocused:I}=v(b);if(!Number.isFinite(F))return;let P=a[g];P?.timeout&&(clearTimeout(P.timeout),P.timeout=void 0);let V=Date.now()+F;a[g]={nextPollTimestamp:V,pollingInterval:F,timeout:setTimeout(()=>{(w.config.focused||!I)&&C.dispatch(n(R)),f({queryCacheKey:g},C)},F)}}function m({queryCacheKey:g},C){let R=C.getState()[e].queries[g],b=o.currentSubscriptions[g];if(!R||R.status==="uninitialized")return;let{lowestPollingInterval:F}=v(b);if(!Number.isFinite(F)){h(g);return}let I=a[g],P=Date.now()+F;(!I||P<I.nextPollTimestamp)&&f({queryCacheKey:g},C)}function h(g){let C=a[g];C?.timeout&&clearTimeout(C.timeout),delete a[g]}function S(){for(let g of Object.keys(a))h(g)}function v(g={}){let C=!1,w=Number.POSITIVE_INFINITY;for(let R in g)g[R].pollingInterval&&(w=Math.min(g[R].pollingInterval,w),C=g[R].skipPollingIfUnfocused||C);return{lowestPollingInterval:w,skipPollingIfUnfocused:C}}return i},Zq=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=gd(r,n),a=ia(r,n),i=qn(r,n),p={};return(m,h)=>{if(o(m)){let{requestId:S,arg:{endpointName:v,originalArgs:g}}=m.meta,C=t.endpointDefinitions[v],w=C?.onQueryStarted;if(w){let R={},b=new Promise((V,_)=>{R.resolve=V,R.reject=_});b.catch(()=>{}),p[S]=R;let F=e.endpoints[v].select(C.type==="query"?g:S),I=h.dispatch((V,_,k)=>k),P={...h,getCacheEntry:()=>F(h.getState()),requestId:S,extra:I,updateCachedData:C.type==="query"?V=>h.dispatch(e.util.updateQueryData(v,g,V)):void 0,queryFulfilled:b};w(g,P)}}else if(i(m)){let{requestId:S,baseQueryMeta:v}=m.meta;p[S]?.resolve({data:m.payload,meta:v}),delete p[S]}else if(a(m)){let{requestId:S,rejectedWithValue:v,baseQueryMeta:g}=m.meta;p[S]?.reject({error:m.payload??m.error,isUnhandledError:!v,meta:g}),delete p[S]}}},eM=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:a}=r.internalActions,i=(f,m)=>{jS.match(f)&&p(m,"refetchOnFocus"),VS.match(f)&&p(m,"refetchOnReconnect")};function p(f,m){let h=f.getState()[e],S=h.queries,v=o.currentSubscriptions;t.batch(()=>{for(let g of Object.keys(v)){let C=S[g],w=v[g];if(!w||!C)continue;(Object.values(w).some(b=>b[m]===!0)||Object.values(w).every(b=>b[m]===void 0)&&h.config[m])&&(ws(w)===0?f.dispatch(a({queryCacheKey:g})):C.status!=="uninitialized"&&f.dispatch(n(C)))}})}return i};function tM(e){let{reducerPath:t,queryThunk:r,api:n,context:o}=e,{apiUid:a}=o,i={invalidateTags:T(`${t}/invalidateTags`)},p=S=>S.type.startsWith(`${t}/`),f=[Yq,Wq,Jq,Xq,Kq,Zq];return{middleware:S=>{let v=!1,C={...e,internalState:{currentSubscriptions:{}},refetchQuery:h,isThisApiSliceAction:p},w=f.map(F=>F(C)),R=$q(C),b=eM(C);return F=>I=>{if(!Ti(I))return F(I);v||(v=!0,S.dispatch(n.internalActions.middlewareRegistered(a)));let P={...S,next:F},V=S.getState(),[_,k]=R(I,P,V),N;if(_?N=F(I):N=k,S.getState()[t]&&(b(I,P,V),p(I)||o.hasRehydrationInfo(I)))for(let q of w)q(I,P,V);return N}},actions:i};function h(S){return e.api.endpoints[S.endpointName].initiate(S.originalArgs,{subscribe:!1,forceRefetch:!0})}}var VR=Symbol(),rM=({createSelector:e=Ye}={})=>({name:VR,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:a,keepUnusedDataFor:i,refetchOnMountOrArgChange:p,refetchOnFocus:f,refetchOnReconnect:m,invalidationBehavior:h},S){YA();let v=Ce=>(typeof process<"u",Ce);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:VS,onOffline:GR,onFocus:jS,onFocusLost:BR},util:{}});let g=Bq({serializeQueryArgs:a,reducerPath:o,createSelector:e}),{selectInvalidatedBy:C,selectCachedArgsForQuery:w,buildQuerySelector:R,buildInfiniteQuerySelector:b,buildMutationSelector:F}=g;Un(t.util,{selectInvalidatedBy:C,selectCachedArgsForQuery:w});let{queryThunk:I,infiniteQueryThunk:P,mutationThunk:V,patchQueryData:_,updateQueryData:k,upsertQueryData:N,prefetch:q,buildMatchThunkActions:U}=Uq({baseQuery:r,reducerPath:o,context:S,api:t,serializeQueryArgs:a,assertTagType:v,selectors:g}),{reducer:X,actions:H}=Qq({context:S,queryThunk:I,infiniteQueryThunk:P,mutationThunk:V,serializeQueryArgs:a,reducerPath:o,assertTagType:v,config:{refetchOnFocus:f,refetchOnReconnect:m,refetchOnMountOrArgChange:p,keepUnusedDataFor:i,reducerPath:o,invalidationBehavior:h}});Un(t.util,{patchQueryData:_,updateQueryData:k,upsertQueryData:N,prefetch:q,resetApiState:H.resetApiState,upsertQueryEntries:H.cacheEntriesUpserted}),Un(t.internalActions,H);let{middleware:B,actions:Q}=tM({reducerPath:o,context:S,queryThunk:I,mutationThunk:V,infiniteQueryThunk:P,api:t,assertTagType:v,selectors:g});Un(t.util,Q),Un(t,{reducer:X,middleware:B});let{buildInitiateQuery:K,buildInitiateInfiniteQuery:$,buildInitiateMutation:te,getRunningMutationThunk:re,getRunningMutationsThunk:pe,getRunningQueriesThunk:Re,getRunningQueryThunk:ke}=Vq({queryThunk:I,mutationThunk:V,infiniteQueryThunk:P,api:t,serializeQueryArgs:a,context:S});return Un(t.util,{getRunningMutationThunk:re,getRunningMutationsThunk:pe,getRunningQueryThunk:ke,getRunningQueriesThunk:Re}),{name:VR,injectEndpoint(Ce,we){var rt;let Ee=(rt=t.endpoints)[Ce]??(rt[Ce]={});LS(we)&&Un(Ee,{name:Ce,select:R(Ce,we),initiate:K(Ce,we)},U(I,Ce)),qq(we)&&Un(Ee,{name:Ce,select:F(),initiate:te(Ce)},U(V,Ce)),US(we)&&Un(Ee,{name:Ce,select:b(Ce,we),initiate:$(Ce,we)},U(I,Ce))}}}}),WR=Gq(rM());d();c();l();u();d();c();l();u();var ha=e=>e.query,KR=e=>e.query?.enableQuerySyntax;var YR=Ye(e=>ha(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})),wp=Ye(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();l();u();d();c();l();u();var Fp=e=>{if(e==="yes")return!0;if(e==="no")return!1},nM=()=>Y("analytics/generatedAnswer/retry",e=>e.makeRetryGeneratedAnswer());function oM(e,t){return Y({prefix:"analytics/generatedAnswer/openAnswerSource",__legacy__getBuilder:(r,n)=>{let o=t??$e(n),a=Qu(n,e);return!o||!a?null:r.makeGeneratedAnswerCitationClick(Nb(a,n),{generativeQuestionAnsweringId:o,citationId:a.id,documentId:_b(a)})},analyticsType:"Rga.CitationClick",analyticsPayloadBuilder:r=>{let n=Qu(r,e);return{answerId:t??$e(r)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:n?.permanentid??"",title:n?.title,url:n?.clickUri}}}})}function aM(e,t,r){return Y({prefix:"analytics/generatedAnswer/hoverCitation",__legacy__getBuilder:(n,o)=>{let a=r??$e(o),i=Qu(o,e);return!a||!i?null:n.makeGeneratedAnswerSourceHover({generativeQuestionAnsweringId:a,permanentId:i.permanentid,citationId:i.id,citationHoverTimeMs:t})},analyticsType:"Rga.CitationHover",analyticsPayloadBuilder:n=>{let o=Qu(n,e);return{answerId:r??$e(n)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:o?.permanentid??"",title:o?.title,url:o?.clickUri},citationHoverTimeInMs:t}}})}function iM(e){return Y({prefix:"analytics/generatedAnswer/like",__legacy__getBuilder:(t,r)=>{let n=e??$e(r);return n?t.makeLikeGeneratedAnswer({generativeQuestionAnsweringId:n}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??$e(t)??"",action:"like"})})}function sM(e){return Y({prefix:"analytics/generatedAnswer/dislike",__legacy__getBuilder:(t,r)=>{let n=e??$e(r);return n?t.makeDislikeGeneratedAnswer({generativeQuestionAnsweringId:n}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??$e(t)??"",action:"dislike"})})}var cM=e=>Y({prefix:"analytics/generatedAnswer/sendFeedback",__legacy__getBuilder:(t,r)=>{let n=$e(r);return n?t.makeGeneratedAnswerFeedbackSubmitV2({generativeQuestionAnsweringId:n,...e}):null},analyticsType:"Rga.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=$e(t),{helpful:n,readable:o,documented:a,hallucinationFree:i,correctTopic:p,documentUrl:f,details:m}=e;return{answerId:r??"",helpful:n,details:{readable:Fp(o),documented:Fp(a),correctTopic:Fp(p),hallucinationFree:Fp(i)},additionalNotes:m,correctAnswerUrl:f}}}),ya=e=>Y({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=$e(r),o=e?!r.generatedAnswer?.answer||!r.generatedAnswer?.answer.length:void 0;return n?t.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:n,answerGenerated:e,answerTextIsEmpty:o}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:t=>({answerId:$e(t)??"",answerGenerated:e??!1})}),Es=()=>Y({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",responseId:e.search?.searchResponseId||e.search?.response.searchUid||""})}),uM=()=>Y({prefix:"analytics/generatedAnswer/show",__legacy__getBuilder:(e,t)=>{let r=$e(t);return r?e.makeGeneratedAnswerShowAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",action:"show"})}),lM=()=>Y({prefix:"analytics/generatedAnswer/hide",__legacy__getBuilder:(e,t)=>{let r=$e(t);return r?e.makeGeneratedAnswerHideAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",action:"hide"})}),dM=()=>Y({prefix:"analytics/generatedAnswer/expand",__legacy__getBuilder:(e,t)=>{let r=$e(t);return r?e.makeGeneratedAnswerExpand({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",action:"expand"})}),pM=()=>Y({prefix:"analytics/generatedAnswer/collapse",__legacy__getBuilder:(e,t)=>{let r=$e(t);return r?e.makeGeneratedAnswerCollapse({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:$e(e)??"",action:"collapse"})});function fM(e){return Y({prefix:"analytics/generatedAnswer/copy",__legacy__getBuilder:(t,r)=>{let n=e??$e(r);return n?t.makeGeneratedAnswerCopyToClipboard({generativeQuestionAnsweringId:n}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??$e(t)??"",action:"copyToClipboard"})})}var Is={logCopyGeneratedAnswer:fM,logGeneratedAnswerHideAnswers:lM,logGeneratedAnswerShowAnswers:uM,logGeneratedAnswerStreamEnd:ya,logGeneratedAnswerFeedback:cM,logDislikeGeneratedAnswer:sM,logLikeGeneratedAnswer:iM,logHoverCitation:aM,logOpenGeneratedAnswerSource:oM,logRetryGeneratedAnswer:nM,logGeneratedAnswerExpand:dM,logGeneratedAnswerCollapse:pM};d();c();l();u();d();c();l();u();var JR=Ye(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});d();c();l();u();var XR=e=>e.context;d();c();l();u();var BS=e=>e.pipeline;d();c();l();u();var GS=e=>e.searchHub;d();c();l();u();var Gt=Ye(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),roe=Ye(e=>e,e=>{let t=Gt(e);return t&&e?e[t].expression:""});d();c();l();u();var ZR=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var ew=e=>e.excerptLength?.length;d();c();l();u();var Xr=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,tw=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var rw=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};d();c();l();u();var nw=e=>e.sortCriteria;var ow=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Ft(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function ow(_x122){return _ref45.apply(this,arguments)}}(),aw=(e,t)=>{let r=ha(e)?.q,{aq:n,cq:o,dq:a,lq:i}=gM(e),p=XR(e),f=Ln(e.configuration.analytics,t,{actionCause:OS(e)}),m=GS(e),h=BS(e),S=rS(e)??[],v=sw(e),g=Gt(e.tabSet)||"default",C=eS(e),w=Cb(e),R=t.referrer||"",b=tw(e),F=nw(e),I=mM(e),P=ew(e),V=rw(e),_=ZR(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(a&&{dq:a}),...(i&&{lq:i}),...(e.query&&{enableQuerySyntax:KR(e)}),...(p?.contextValues&&{context:p.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:S}},...(m?.length&&{searchHub:m}),...(h?.length&&{pipeline:h}),...(v.length&&{facets:v}),...(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:PS(e),firstResult:e.pagination.firstResult}),tab:g,locale:C,timezone:w,...(e.debug!==void 0&&{debug:e.debug}),referrer:R,...I,...(V??{}),...(P&&{excerptLength:P}),...(_&&{dictionaryFieldContext:_}),sortCriteria:F,...(b&&{facetOptions:b}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},iw=(e,t)=>{let r=ha(e)?.q,n=sw(e),o=Ln(e.configuration.analytics,t,{actionCause:OS(e)}),a=eS(e),i=GS(e),p=BS(e),f=rS(e)??[];return{q:r||"",...(n.length&&{facets:n}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:f}},...(i?.length&&{searchHub:i}),...(p?.length&&{pipeline:p}),...o,locale:a}},sw=e=>xp(e)?.map(t=>bS(t,CS())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),mM=e=>({actionsHistory:e.configuration.analytics.enabled?Wt.getInstance().getHistory():[]}),gM=e=>{let t=JR(e),r=kS(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var Ep=["searching","thinking","answering"];function Ip(e){return e.toLowerCase()}function $S(){return{id:"",isVisible:!0,isEnabled:!0,isLoading:!1,isStreaming:!1,citations:[],liked:!1,disliked:!1,responseFormat:{contentFormat:["text/plain"]},feedbackModalOpen:!1,feedbackSubmitted:!1,fieldsToIncludeInCitations:[],isAnswerGenerated:!1,expanded:!1,cannotAnswer:!1,answerApiQueryParams:void 0,answerId:void 0,answerGenerationMode:"automatic",generationSteps:[]}}d();c();l();u();var cw=["text/plain","text/markdown"];var Ts=new M({required:!0}),uw=new M,Ps=new ce({required:!0}),HS={id:Ts,title:Ts,uri:Ts,permanentid:Ts,clickUri:uw},Tp=new M({required:!0,constrainTo:cw}),lw=new M({required:!0,constrainTo:Ep}),dw=e=>({...e,name:Ip(e.name)}),ks=T("generatedAnswer/setIsVisible",e=>O(e,Ps)),Os=T("generatedAnswer/setAnswerId",e=>O(e,z)),Pp=T("generatedAnswer/setAnswerGenerationMode",e=>O(e,new M({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),tl=T("generatedAnswer/setIsEnabled",e=>O(e,Ps)),va=T("generatedAnswer/updateMessage",e=>O(e,{textDelta:Ts})),xa=T("generatedAnswer/updateCitations",e=>O(e,{citations:new ae({required:!0,each:new J({values:HS})})})),Aa=T("generatedAnswer/updateError",e=>O(e,{message:uw,code:new ee({min:0})})),sr=T("generatedAnswer/resetAnswer"),kp=T("generatedAnswer/like"),Op=T("generatedAnswer/dislike"),Np=T("generatedAnswer/feedbackModal/open"),rl=T("generatedAnswer/expand"),_p=T("generatedAnswer/collapse"),Dp=T("generatedAnswer/setId",e=>O(e,{id:new M({required:!0})})),qp=T("generatedAnswer/feedbackModal/close"),Ns=T("generatedAnswer/sendFeedback"),Zr=T("generatedAnswer/setIsLoading",e=>O(e,Ps)),Sa=T("generatedAnswer/setIsStreaming",e=>O(e,Ps)),Ca=T("generatedAnswer/setAnswerContentFormat",e=>O(e,Tp)),Mp=T("generatedAnswer/updateResponseFormat",e=>O(e,{contentFormat:new ae({each:Tp,default:["text/plain"]})})),jp=T("knowledge/updateAnswerConfigurationId",e=>O(e,Ts)),Vp=T("generatedAnswer/registerFieldsToIncludeInCitations",e=>O(e,rd)),nl=T("generatedAnswer/setIsAnswerGenerated",e=>O(e,Ps)),ba=T("generatedAnswer/setCannotAnswer",e=>O(e,Ps)),zS=T("generatedAnswer/setAnswerApiQueryParams",e=>O(e,new J({}))),Lp=T("generatedAnswer/startStep",e=>O(dw(e),{name:lw,startedAt:new ee({min:0,required:!0})})),Up=T("generatedAnswer/finishStep",e=>O(dw(e),{name:lw,finishedAt:new ee({min:0,required:!0})})),pw=Se("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:a}=t,{search:i}=a(),{queryExecuted:p}=i,{setAbortControllerRef:f}=e,m=yield ow(r),h=(g,C)=>{switch(g){case"genqa.headerMessageType":{let w=JSON.parse(C);n(Ca(w.contentFormat));break}case"genqa.messageType":n(va(JSON.parse(C)));break;case"genqa.citationsType":n(xa(JSON.parse(C)));break;case"genqa.endOfStreamType":{let w=JSON.parse(C).answerGenerated,R=p.length!==0&&!w;n(ba(R)),n(Sa(!1)),n(nl(w)),n(ya(w)),n(Es());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${g}"`)}};n(Zr(!0));let S=g=>g.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,v=o.streamingClient?.streamGeneratedAnswer(m,{write:g=>{S(m)&&(n(Zr(!1)),g.payload&&g.payloadType&&h(g.payloadType,g.payload))},abort:g=>{S(m)&&n(Aa(g))},close:()=>{S(m)&&n(Sa(!1))},resetAnswer:()=>{S(m)&&n(sr())}});v?f(v):n(Zr(!1))});return function(_x123,_x124){return _ref46.apply(this,arguments)}}()),Qp=Se("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(sr());let a=t();if(a.generatedAnswer.answerConfigurationId){let i=aw(a,n);r(zS(i)),yield r(Bp(i))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x125,_x126){return _ref47.apply(this,arguments)}}());d();c();l();u();var hM=/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:a,organizationId:i}=n.configuration,p=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let m=Ft(i,a);return{data:UR({baseUrl:`${m}/rest/organizations/${i}/answer/v1/configs/${p}`,fetchFn:function(){var _ref49=_asyncToGenerator(function*(S){if(S instanceof String)throw new Error("The provided 'request' must be a Request object.");let v=S.url,g={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(C=>{g[C]=S[C]}),g.duplex="half",g.body=yield S.text(),x(v,g)});return function fetchFn(_x130){return _ref49.apply(this,arguments)}}()})(f,{...t,signal:null},r)}}catch(m){return{error:m}}});return function hM(_x127,_x128,_x129){return _ref48.apply(this,arguments)}}(),Gp=WR({reducerPath:"answer",baseQuery:QR(hM,{maxRetries:3}),endpoints:()=>({})});var yM=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},SM=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},vM=(e,t)=>{e.citations=t.citations},xM=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},AM=(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})`)},CM=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&AM(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(yM(t,o),r(Ca(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(SM(t,o),r(va({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(vM(t,o),r(xa({citations:o.citations})));break;case"genqa.endOfStreamType":xM(t,o),r(ya(o.answerGenerated??!1)),r(Es());break}},bM=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,a=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${a}/${r}/generate`},Ra=Gp.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(_x131,_x132){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:a}){yield n;let{configuration:i,generatedAnswer:p,insightConfiguration:f}=r(),{organizationId:m,environment:h,accessToken:S}=i,v=Ft(m,h),g=bM(v,m,p.answerConfigurationId,f?.insightId);yield Wl(g,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${S}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:x,onopen:function(){var _ref50=_asyncToGenerator(function*(C){let w=C.headers.get("x-answer-id");w&&o(R=>{R.answerId=w,a(Os(w))})});return function onopen(_x133){return _ref50.apply(this,arguments)}}(),onmessage:C=>{o(w=>{CM(C,w,a)})},onerror:C=>{throw C},onclose:()=>{o(C=>{a(ba(!C.generated))})}})}).apply(this,arguments)}})})}),Bp=e=>Ra.endpoints.getAnswer.initiate(e),WS=e=>{let t=wp(e);return Ra.endpoints.getAnswer.select(t??ga)(e)};d();c();l();u();var fw=oe(uo,e=>e);d();c();l();u();function RM(e){let t=e.payload?.analyticsAction;return mw(e)&&!ue(t)}function mw(e){return"type"in e}var gw=e=>t=>r=>{let n;RM(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return mw(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();var _s=T("tab/register",e=>{let t=new J({values:{id:z,expression:Ue}});return O(e,t)}),gt=T("tab/updateActiveTab",e=>O(e,z));d();c();l();u();var $p=kr(tp(),1),Sw=kr(hw(),1),vw=kr(yw(),1);$p.default.extend(vw.default);$p.default.extend(Sw.default);var Ds=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:$p.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"});d();c();l();u();var wM=/(^|; )Coveo-Pendragon=([^;]*)/;function ZS(){return typeof window>"u"?!1:wM.exec(document.cookie)?.pop()||null}var Hp=oe(Ds(),e=>e.addCase(zr,(t,r)=>{FM(t,r.payload)}).addCase(mr,(t,r)=>{EM(t,r.payload)}).addCase(go,(t,r)=>{IM(t,r.payload)}).addCase(Zi,t=>{t.analytics.enabled=!1}).addCase(es,t=>{t.analytics.enabled=!0}).addCase(Kd,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(Yd,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(gt,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(ts,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(De,(t,r)=>{ue(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(Jd,(t,{payload:r})=>{t.knowledge.agentId=r}));function FM(e,t){ue(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",ue(t.organizationId)||(e.organizationId=t.organizationId)}function EM(e,t){ue(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),ue(t.locale)||(e.search.locale=t.locale),ue(t.timezone)||(e.search.timezone=t.timezone),ue(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function IM(e,t){ue(t.enabled)||(e.analytics.enabled=t.enabled),ue(t.originContext)||(e.analytics.originContext=t.originContext),ue(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),ue(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),ue(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),ue(t.trackingId)||(e.analytics.trackingId=t.trackingId),ue(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),ue(t.source)||(e.analytics.source=t.source);try{let r=ZS();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}ue(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),ue(t.anonymous)||(e.analytics.anonymous=t.anonymous),ue(t.deviceId)||(e.analytics.deviceId=t.deviceId),ue(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),ue(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var le=Hp;d();c();l();u();function TM(e){return e.instantlyCallable}var xw=()=>e=>t=>e(TM(t)?t():t);d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var kt=[];for(let e=0;e<256;++e)kt.push((e+256).toString(16).slice(1));function Aw(e,t=0){return(kt[e[t+0]]+kt[e[t+1]]+kt[e[t+2]]+kt[e[t+3]]+"-"+kt[e[t+4]]+kt[e[t+5]]+"-"+kt[e[t+6]]+kt[e[t+7]]+"-"+kt[e[t+8]]+kt[e[t+9]]+"-"+kt[e[t+10]]+kt[e[t+11]]+kt[e[t+12]]+kt[e[t+13]]+kt[e[t+14]]+kt[e[t+15]]).toLowerCase()}d();c();l();u();var ev,PM=new Uint8Array(16);function tv(){if(!ev){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ev=crypto.getRandomValues.bind(crypto)}return ev(PM)}d();c();l();u();d();c();l();u();var kM=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),rv={randomUUID:kM};function OM(e,t,r){if(rv.randomUUID&&!t&&!e)return rv.randomUUID();e=e||{};let n=e.random??e.rng?.()??tv();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 Aw(n)}var Io=OM;d();c();l();u();d();c();l();u();var E={};fu(E,{BRAND:()=>oj,DIRTY:()=>wa,EMPTY_PATH:()=>qM,INVALID:()=>ve,NEVER:()=>Qj,OK:()=>Mt,ParseStatus:()=>Ot,Schema:()=>Ie,ZodAny:()=>ko,ZodArray:()=>$n,ZodBigInt:()=>Ea,ZodBoolean:()=>Ia,ZodBranded:()=>al,ZodCatch:()=>Va,ZodDate:()=>Ta,ZodDefault:()=>ja,ZodDiscriminatedUnion:()=>Kp,ZodEffects:()=>Cr,ZodEnum:()=>qa,ZodError:()=>Jt,ZodFirstPartyTypeKind:()=>xe,ZodFunction:()=>Jp,ZodIntersection:()=>Na,ZodIssueCode:()=>Z,ZodLazy:()=>_a,ZodLiteral:()=>Da,ZodMap:()=>Us,ZodNaN:()=>Bs,ZodNativeEnum:()=>Ma,ZodNever:()=>qr,ZodNull:()=>ka,ZodNullable:()=>rn,ZodNumber:()=>Fa,ZodObject:()=>Xt,ZodOptional:()=>xr,ZodParsedType:()=>se,ZodPipeline:()=>il,ZodPromise:()=>Oo,ZodReadonly:()=>La,ZodRecord:()=>Yp,ZodSchema:()=>Ie,ZodSet:()=>Qs,ZodString:()=>Po,ZodSymbol:()=>Vs,ZodTransformer:()=>Cr,ZodTuple:()=>tn,ZodType:()=>Ie,ZodUndefined:()=>Pa,ZodUnion:()=>Oa,ZodUnknown:()=>Gn,ZodVoid:()=>Ls,addIssueToContext:()=>ie,any:()=>fj,array:()=>yj,bigint:()=>cj,boolean:()=>Ow,coerce:()=>Uj,custom:()=>Tw,date:()=>uj,datetimeRegex:()=>Ew,defaultErrorMap:()=>Qn,discriminatedUnion:()=>Aj,effect:()=>Nj,enum:()=>Pj,function:()=>Ej,getErrorMap:()=>qs,getParsedType:()=>en,instanceof:()=>ij,intersection:()=>Cj,isAborted:()=>zp,isAsync:()=>Ms,isDirty:()=>Wp,isValid:()=>To,late:()=>aj,lazy:()=>Ij,literal:()=>Tj,makeIssue:()=>ol,map:()=>wj,nan:()=>sj,nativeEnum:()=>kj,never:()=>gj,null:()=>pj,nullable:()=>Dj,number:()=>kw,object:()=>Sj,objectUtil:()=>nv,oboolean:()=>Lj,onumber:()=>Vj,optional:()=>_j,ostring:()=>jj,pipeline:()=>Mj,preprocess:()=>qj,promise:()=>Oj,quotelessJson:()=>NM,record:()=>Rj,set:()=>Fj,setErrorMap:()=>DM,strictObject:()=>vj,string:()=>Pw,symbol:()=>lj,transformer:()=>Nj,tuple:()=>bj,undefined:()=>dj,union:()=>xj,unknown:()=>mj,util:()=>Oe,void:()=>hj});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Oe;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let a={};for(let i of o)a[i]=i;return a},e.getValidEnumValues=o=>{let a=e.objectKeys(o).filter(p=>typeof o[o[p]]!="number"),i={};for(let p of a)i[p]=o[p];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(a){return o[a]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let a=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&a.push(i);return a},e.find=(o,a)=>{for(let i of o)if(a(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,a=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(o,a)=>typeof a=="bigint"?a.toString():a})(Oe||(Oe={}));var nv;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(nv||(nv={}));var se=Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),en=e=>{switch(typeof e){case"undefined":return se.undefined;case"string":return se.string;case"number":return Number.isNaN(e)?se.nan:se.number;case"boolean":return se.boolean;case"function":return se.function;case"bigint":return se.bigint;case"symbol":return se.symbol;case"object":return Array.isArray(e)?se.array:e===null?se.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?se.promise:typeof Map<"u"&&e instanceof Map?se.map:typeof Set<"u"&&e instanceof Set?se.set:typeof Date<"u"&&e instanceof Date?se.date:se.object;default:return se.unknown}};var Z=Oe.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"]),NM=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Jt=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(a){return a.message},n={_errors:[]},o=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let p=n,f=0;for(;f<i.path.length;){let m=i.path[f];f===i.path.length-1?(p[m]=p[m]||{_errors:[]},p[m]._errors.push(r(i))):p[m]=p[m]||{_errors:[]},p=p[m],f++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let a=o.path[0];r[a]=r[a]||[],r[a].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Jt.create=e=>new Jt(e);var _M=(e,t)=>{let r;switch(e.code){case Z.invalid_type:e.received===se.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Z.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Oe.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:r=`Unrecognized key(s) in object: ${Oe.joinValues(e.keys,", ")}`;break;case Z.invalid_union:r="Invalid input";break;case Z.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Oe.joinValues(e.options)}`;break;case Z.invalid_enum_value:r=`Invalid enum value. Expected ${Oe.joinValues(e.options)}, received '${e.received}'`;break;case Z.invalid_arguments:r="Invalid function arguments";break;case Z.invalid_return_type:r="Invalid function return type";break;case Z.invalid_date:r="Invalid date";break;case Z.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}"`:Oe.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Z.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 Z.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 Z.custom:r="Invalid input";break;case Z.invalid_intersection_types:r="Intersection results could not be merged";break;case Z.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Z.not_finite:r="Number must be finite";break;default:r=t.defaultError,Oe.assertNever(e)}return{message:r}},Qn=_M;var Cw=Qn;function DM(e){Cw=e}function qs(){return Cw}d();c();l();u();var ol=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...(o.path||[])],i={...o,path:a};if(o.message!==void 0)return{...o,path:a,message:o.message};let p="",f=n.filter(m=>!!m).slice().reverse();for(let m of f)p=m(i,{data:t,defaultError:p}).message;return{...o,path:a,message:p}},qM=[];function ie(e,t){let r=qs(),n=ol({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Qn?void 0:Qn].filter(o=>!!o)});e.common.issues.push(n)}var Ot=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 ve;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static mergeObjectAsync(t,r){return _asyncToGenerator(function*(){let n=[];for(let o of r){let a=yield o.key,i=yield o.value;n.push({key:a,value:i})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:a,value:i}=o;if(a.status==="aborted"||i.status==="aborted")return ve;a.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[a.value]=i.value)}return{status:t.value,value:n}}},ve=Object.freeze({status:"aborted"}),wa=e=>({status:"dirty",value:e}),Mt=e=>({status:"valid",value:e}),zp=e=>e.status==="aborted",Wp=e=>e.status==="dirty",To=e=>e.status==="valid",Ms=e=>typeof Promise<"u"&&e instanceof Promise;d();c();l();u();d();c();l();u();var de;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(de||(de={}));var Ar=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}},bw=(e,t)=>{if(To(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 Jt(e.common.issues);return this._error=r,this._error}}};function Fe(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,p)=>{let{message:f}=e;return i.code==="invalid_enum_value"?{message:f??p.defaultError}:typeof p.data>"u"?{message:f??n??p.defaultError}:i.code!=="invalid_type"?{message:p.defaultError}:{message:f??r??p.defaultError}},description:o}}var Ie=class{get description(){return this._def.description}_getType(t){return en(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:en(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ot,ctx:{common:t.parent.common,data:t.data,parsedType:en(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Ms(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:en(t)},o=this._parseSync({data:t,path:n.path,parent:n});return bw(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:en(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return To(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=>To(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this24=this;return _asyncToGenerator(function*(){let n=yield _this24.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this25=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this25._def.errorMap,parent:null,data:t,parsedType:en(t)},o=_this25._parse({data:t,path:n.path,parent:n}),a=yield Ms(o)?o:Promise.resolve(o);return bw(n,a)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,a)=>{let i=t(o),p=()=>a.addIssue({code:Z.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(p(),!1)):i?!0:(p(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new Cr({schema:this,typeName:xe.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 xr.create(this,this._def)}nullable(){return rn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $n.create(this)}promise(){return Oo.create(this,this._def)}or(t){return Oa.create([this,t],this._def)}and(t){return Na.create(this,t,this._def)}transform(t){return new Cr({...Fe(this._def),schema:this,typeName:xe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new ja({...Fe(this._def),innerType:this,defaultValue:r,typeName:xe.ZodDefault})}brand(){return new al({typeName:xe.ZodBranded,type:this,...Fe(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Va({...Fe(this._def),innerType:this,catchValue:r,typeName:xe.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return il.create(this,t)}readonly(){return La.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},MM=/^c[^\s-]{8,}$/i,jM=/^[0-9a-z]+$/,VM=/^[0-9A-HJKMNP-TV-Z]{26}$/i,LM=/^[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,UM=/^[a-z0-9_-]{21}$/i,QM=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,BM=/^[-+]?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)?)??$/,GM=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$M="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ov,HM=/^(?:(?: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])$/,zM=/^(?:(?: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])$/,WM=/^(([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]))$/,KM=/^(([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])$/,YM=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,JM=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ww="((\\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])))",XM=new RegExp(`^${ww}$`);function Fw(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 ZM(e){return new RegExp(`^${Fw(e)}$`)}function Ew(e){let t=`${ww}T${Fw(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 ej(e,t){return!!((t==="v4"||!t)&&HM.test(e)||(t==="v6"||!t)&&WM.test(e))}function tj(e,t){if(!QM.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 rj(e,t){return!!((t==="v4"||!t)&&zM.test(e)||(t==="v6"||!t)&&KM.test(e))}var Po=class e extends Ie{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==se.string){let a=this._getOrReturnCtx(t);return ie(a,{code:Z.invalid_type,expected:se.string,received:a.parsedType}),ve}let n=new Ot,o;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let i=t.data.length>a.value,p=t.data.length<a.value;(i||p)&&(o=this._getOrReturnCtx(t,o),i?ie(o,{code:Z.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):p&&ie(o,{code:Z.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")GM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"email",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")ov||(ov=new RegExp($M,"u")),ov.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"emoji",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")LM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"uuid",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")UM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"nanoid",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")MM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"cuid",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")jM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"cuid2",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")VM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"ulid",code:Z.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ie(o,{validation:"url",code:Z.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"regex",code:Z.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Ew(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?XM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?ZM(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?BM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"duration",code:Z.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?ej(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"ip",code:Z.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?tj(t.data,a.alg)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"jwt",code:Z.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?rj(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"cidr",code:Z.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?YM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"base64",code:Z.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?JM.test(t.data)||(o=this._getOrReturnCtx(t,o),ie(o,{validation:"base64url",code:Z.invalid_string,message:a.message}),n.dirty()):Oe.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:Z.invalid_string,...de.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...de.errToObj(t)})}url(t){return this._addCheck({kind:"url",...de.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...de.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...de.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...de.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...de.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...de.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...de.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...de.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...de.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...de.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...de.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...de.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,...de.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,...de.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...de.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...de.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...de.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...de.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...de.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...de.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...de.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...de.errToObj(r)})}nonempty(t){return this.min(1,de.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}};Po.create=e=>new Po({checks:[],typeName:xe.ZodString,coerce:e?.coerce??!1,...Fe(e)});function nj(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,a=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return a%i/10**o}var Fa=class e extends Ie{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)!==se.number){let a=this._getOrReturnCtx(t);return ie(a,{code:Z.invalid_type,expected:se.number,received:a.parsedType}),ve}let n,o=new Ot;for(let a of this._def.checks)a.kind==="int"?Oe.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?nj(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.not_finite,message:a.message}),o.dirty()):Oe.assertNever(a);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,de.toString(r))}gt(t,r){return this.setLimit("min",t,!1,de.toString(r))}lte(t,r){return this.setLimit("max",t,!0,de.toString(r))}lt(t,r){return this.setLimit("max",t,!1,de.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:de.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:de.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:de.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.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"&&Oe.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)}};Fa.create=e=>new Fa({checks:[],typeName:xe.ZodNumber,coerce:e?.coerce||!1,...Fe(e)});var Ea=class e extends Ie{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)!==se.bigint)return this._getInvalidInput(t);let n,o=new Ot;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Z.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):Oe.assertNever(a);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return ie(r,{code:Z.invalid_type,expected:se.bigint,received:r.parsedType}),ve}gte(t,r){return this.setLimit("min",t,!0,de.toString(r))}gt(t,r){return this.setLimit("min",t,!1,de.toString(r))}lte(t,r){return this.setLimit("max",t,!0,de.toString(r))}lt(t,r){return this.setLimit("max",t,!1,de.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:de.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:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:de.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}};Ea.create=e=>new Ea({checks:[],typeName:xe.ZodBigInt,coerce:e?.coerce??!1,...Fe(e)});var Ia=class extends Ie{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==se.boolean){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.boolean,received:n.parsedType}),ve}return Mt(t.data)}};Ia.create=e=>new Ia({typeName:xe.ZodBoolean,coerce:e?.coerce||!1,...Fe(e)});var Ta=class e extends Ie{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==se.date){let a=this._getOrReturnCtx(t);return ie(a,{code:Z.invalid_type,expected:se.date,received:a.parsedType}),ve}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return ie(a,{code:Z.invalid_date}),ve}let n=new Ot,o;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(o=this._getOrReturnCtx(t,o),ie(o,{code:Z.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Oe.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:de.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:de.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}};Ta.create=e=>new Ta({checks:[],coerce:e?.coerce||!1,typeName:xe.ZodDate,...Fe(e)});var Vs=class extends Ie{_parse(t){if(this._getType(t)!==se.symbol){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.symbol,received:n.parsedType}),ve}return Mt(t.data)}};Vs.create=e=>new Vs({typeName:xe.ZodSymbol,...Fe(e)});var Pa=class extends Ie{_parse(t){if(this._getType(t)!==se.undefined){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.undefined,received:n.parsedType}),ve}return Mt(t.data)}};Pa.create=e=>new Pa({typeName:xe.ZodUndefined,...Fe(e)});var ka=class extends Ie{_parse(t){if(this._getType(t)!==se.null){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.null,received:n.parsedType}),ve}return Mt(t.data)}};ka.create=e=>new ka({typeName:xe.ZodNull,...Fe(e)});var ko=class extends Ie{constructor(){super(...arguments),this._any=!0}_parse(t){return Mt(t.data)}};ko.create=e=>new ko({typeName:xe.ZodAny,...Fe(e)});var Gn=class extends Ie{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Mt(t.data)}};Gn.create=e=>new Gn({typeName:xe.ZodUnknown,...Fe(e)});var qr=class extends Ie{_parse(t){let r=this._getOrReturnCtx(t);return ie(r,{code:Z.invalid_type,expected:se.never,received:r.parsedType}),ve}};qr.create=e=>new qr({typeName:xe.ZodNever,...Fe(e)});var Ls=class extends Ie{_parse(t){if(this._getType(t)!==se.undefined){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.void,received:n.parsedType}),ve}return Mt(t.data)}};Ls.create=e=>new Ls({typeName:xe.ZodVoid,...Fe(e)});var $n=class e extends Ie{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==se.array)return ie(r,{code:Z.invalid_type,expected:se.array,received:r.parsedType}),ve;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,p=r.data.length<o.exactLength.value;(i||p)&&(ie(r,{code:i?Z.too_big:Z.too_small,minimum:p?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(ie(r,{code:Z.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&&(ie(r,{code:Z.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,p)=>o.type._parseAsync(new Ar(r,i,r.path,p)))).then(i=>Ot.mergeArray(n,i));let a=[...r.data].map((i,p)=>o.type._parseSync(new Ar(r,i,r.path,p)));return Ot.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:de.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:de.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:de.toString(r)}})}nonempty(t){return this.min(1,t)}};$n.create=(e,t)=>new $n({type:e,minLength:null,maxLength:null,exactLength:null,typeName:xe.ZodArray,...Fe(t)});function js(e){if(e instanceof Xt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=xr.create(js(n))}return new Xt({...e._def,shape:()=>t})}else return e instanceof $n?new $n({...e._def,type:js(e.element)}):e instanceof xr?xr.create(js(e.unwrap())):e instanceof rn?rn.create(js(e.unwrap())):e instanceof tn?tn.create(e.items.map(t=>js(t))):e}var Xt=class e extends Ie{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=Oe.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==se.object){let m=this._getOrReturnCtx(t);return ie(m,{code:Z.invalid_type,expected:se.object,received:m.parsedType}),ve}let{status:n,ctx:o}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),p=[];if(!(this._def.catchall instanceof qr&&this._def.unknownKeys==="strip"))for(let m in o.data)i.includes(m)||p.push(m);let f=[];for(let m of i){let h=a[m],S=o.data[m];f.push({key:{status:"valid",value:m},value:h._parse(new Ar(o,S,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof qr){let m=this._def.unknownKeys;if(m==="passthrough")for(let h of p)f.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(m==="strict")p.length>0&&(ie(o,{code:Z.unrecognized_keys,keys:p}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let h of p){let S=o.data[h];f.push({key:{status:"valid",value:h},value:m._parse(new Ar(o,S,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let m=[];for(let h of f){let S=yield h.key,v=yield h.value;m.push({key:S,value:v,alwaysSet:h.alwaysSet})}return m})).then(m=>Ot.mergeObjectSync(n,m)):Ot.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return de.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:de.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:xe.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 Oe.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 Oe.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return js(this)}partial(t){let r={};for(let n of Oe.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 Oe.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof xr;)a=a._def.innerType;r[n]=a}return new e({...this._def,shape:()=>r})}keyof(){return Iw(Oe.objectKeys(this.shape))}};Xt.create=(e,t)=>new Xt({shape:()=>e,unknownKeys:"strip",catchall:qr.create(),typeName:xe.ZodObject,...Fe(t)});Xt.strictCreate=(e,t)=>new Xt({shape:()=>e,unknownKeys:"strict",catchall:qr.create(),typeName:xe.ZodObject,...Fe(t)});Xt.lazycreate=(e,t)=>new Xt({shape:e,unknownKeys:"strip",catchall:qr.create(),typeName:xe.ZodObject,...Fe(t)});var Oa=class extends Ie{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(a){for(let p of a)if(p.result.status==="valid")return p.result;for(let p of a)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let i=a.map(p=>new Jt(p.ctx.common.issues));return ie(r,{code:Z.invalid_union,unionErrors:i}),ve}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(a){let i={...r,common:{...r.common,issues:[]},parent:null};return{result:yield a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}});return function(_x134){return _ref52.apply(this,arguments)}}())).then(o);{let a,i=[];for(let f of n){let m={...r,common:{...r.common,issues:[]},parent:null},h=f._parseSync({data:r.data,path:r.path,parent:m});if(h.status==="valid")return h;h.status==="dirty"&&!a&&(a={result:h,ctx:m}),m.common.issues.length&&i.push(m.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let p=i.map(f=>new Jt(f));return ie(r,{code:Z.invalid_union,unionErrors:p}),ve}}get options(){return this._def.options}};Oa.create=(e,t)=>new Oa({options:e,typeName:xe.ZodUnion,...Fe(t)});var Bn=e=>e instanceof _a?Bn(e.schema):e instanceof Cr?Bn(e.innerType()):e instanceof Da?[e.value]:e instanceof qa?e.options:e instanceof Ma?Oe.objectValues(e.enum):e instanceof ja?Bn(e._def.innerType):e instanceof Pa?[void 0]:e instanceof ka?[null]:e instanceof xr?[void 0,...Bn(e.unwrap())]:e instanceof rn?[null,...Bn(e.unwrap())]:e instanceof al||e instanceof La?Bn(e.unwrap()):e instanceof Va?Bn(e._def.innerType):[],Kp=class e extends Ie{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==se.object)return ie(r,{code:Z.invalid_type,expected:se.object,received:r.parsedType}),ve;let n=this.discriminator,o=r.data[n],a=this.optionsMap.get(o);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(ie(r,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ve)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let a of r){let i=Bn(a.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let p of i){if(o.has(p))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(p)}`);o.set(p,a)}}return new e({typeName:xe.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...Fe(n)})}};function av(e,t){let r=en(e),n=en(t);if(e===t)return{valid:!0,data:e};if(r===se.object&&n===se.object){let o=Oe.objectKeys(t),a=Oe.objectKeys(e).filter(p=>o.indexOf(p)!==-1),i={...e,...t};for(let p of a){let f=av(e[p],t[p]);if(!f.valid)return{valid:!1};i[p]=f.data}return{valid:!0,data:i}}else if(r===se.array&&n===se.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let a=0;a<e.length;a++){let i=e[a],p=t[a],f=av(i,p);if(!f.valid)return{valid:!1};o.push(f.data)}return{valid:!0,data:o}}else return r===se.date&&n===se.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Na=class extends Ie{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(a,i)=>{if(zp(a)||zp(i))return ve;let p=av(a.value,i.value);return p.valid?((Wp(a)||Wp(i))&&r.dirty(),{status:r.value,value:p.data}):(ie(n,{code:Z.invalid_intersection_types}),ve)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>o(a,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Na.create=(e,t,r)=>new Na({left:e,right:t,typeName:xe.ZodIntersection,...Fe(r)});var tn=class e extends Ie{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==se.array)return ie(n,{code:Z.invalid_type,expected:se.array,received:n.parsedType}),ve;if(n.data.length<this._def.items.length)return ie(n,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ve;!this._def.rest&&n.data.length>this._def.items.length&&(ie(n,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((i,p)=>{let f=this._def.items[p]||this._def.rest;return f?f._parse(new Ar(n,i,n.path,p)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>Ot.mergeArray(r,i)):Ot.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};tn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new tn({items:e,typeName:xe.ZodTuple,rest:null,...Fe(t)})};var Yp=class e extends Ie{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!==se.object)return ie(n,{code:Z.invalid_type,expected:se.object,received:n.parsedType}),ve;let o=[],a=this._def.keyType,i=this._def.valueType;for(let p in n.data)o.push({key:a._parse(new Ar(n,p,n.path,p)),value:i._parse(new Ar(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?Ot.mergeObjectAsync(r,o):Ot.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Ie?new e({keyType:t,valueType:r,typeName:xe.ZodRecord,...Fe(n)}):new e({keyType:Po.create(),valueType:t,typeName:xe.ZodRecord,...Fe(r)})}},Us=class extends Ie{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!==se.map)return ie(n,{code:Z.invalid_type,expected:se.map,received:n.parsedType}),ve;let o=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([p,f],m)=>({key:o._parse(new Ar(n,p,n.path,[m,"key"])),value:a._parse(new Ar(n,f,n.path,[m,"value"]))}));if(n.common.async){let p=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let f of i){let m=yield f.key,h=yield f.value;if(m.status==="aborted"||h.status==="aborted")return ve;(m.status==="dirty"||h.status==="dirty")&&r.dirty(),p.set(m.value,h.value)}return{status:r.value,value:p}}))}else{let p=new Map;for(let f of i){let m=f.key,h=f.value;if(m.status==="aborted"||h.status==="aborted")return ve;(m.status==="dirty"||h.status==="dirty")&&r.dirty(),p.set(m.value,h.value)}return{status:r.value,value:p}}}};Us.create=(e,t,r)=>new Us({valueType:t,keyType:e,typeName:xe.ZodMap,...Fe(r)});var Qs=class e extends Ie{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==se.set)return ie(n,{code:Z.invalid_type,expected:se.set,received:n.parsedType}),ve;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(ie(n,{code:Z.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&&(ie(n,{code:Z.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let a=this._def.valueType;function i(f){let m=new Set;for(let h of f){if(h.status==="aborted")return ve;h.status==="dirty"&&r.dirty(),m.add(h.value)}return{status:r.value,value:m}}let p=[...n.data.values()].map((f,m)=>a._parse(new Ar(n,f,n.path,m)));return n.common.async?Promise.all(p).then(f=>i(f)):i(p)}min(t,r){return new e({...this._def,minSize:{value:t,message:de.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:de.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Qs.create=(e,t)=>new Qs({valueType:e,minSize:null,maxSize:null,typeName:xe.ZodSet,...Fe(t)});var Jp=class e extends Ie{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==se.function)return ie(r,{code:Z.invalid_type,expected:se.function,received:r.parsedType}),ve;function n(p,f){return ol({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,qs(),Qn].filter(m=>!!m),issueData:{code:Z.invalid_arguments,argumentsError:f}})}function o(p,f){return ol({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,qs(),Qn].filter(m=>!!m),issueData:{code:Z.invalid_return_type,returnTypeError:f}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Oo){let p=this;return Mt(/*#__PURE__*/_asyncToGenerator(function*(...f){let m=new Jt([]),h=yield p._def.args.parseAsync(f,a).catch(g=>{throw m.addIssue(n(f,g)),m}),S=yield Reflect.apply(i,this,h);return yield p._def.returns._def.type.parseAsync(S,a).catch(g=>{throw m.addIssue(o(S,g)),m})}))}else{let p=this;return Mt(function(...f){let m=p._def.args.safeParse(f,a);if(!m.success)throw new Jt([n(f,m.error)]);let h=Reflect.apply(i,this,m.data),S=p._def.returns.safeParse(h,a);if(!S.success)throw new Jt([o(h,S.error)]);return S.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:tn.create(t).rest(Gn.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||tn.create([]).rest(Gn.create()),returns:r||Gn.create(),typeName:xe.ZodFunction,...Fe(n)})}},_a=class extends Ie{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})}};_a.create=(e,t)=>new _a({getter:e,typeName:xe.ZodLazy,...Fe(t)});var Da=class extends Ie{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return ie(r,{received:r.data,code:Z.invalid_literal,expected:this._def.value}),ve}return{status:"valid",value:t.data}}get value(){return this._def.value}};Da.create=(e,t)=>new Da({value:e,typeName:xe.ZodLiteral,...Fe(t)});function Iw(e,t){return new qa({values:e,typeName:xe.ZodEnum,...Fe(t)})}var qa=class e extends Ie{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return ie(r,{expected:Oe.joinValues(n),received:r.parsedType,code:Z.invalid_type}),ve}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 ie(r,{received:r.data,code:Z.invalid_enum_value,options:n}),ve}return Mt(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})}};qa.create=Iw;var Ma=class extends Ie{_parse(t){let r=Oe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==se.string&&n.parsedType!==se.number){let o=Oe.objectValues(r);return ie(n,{expected:Oe.joinValues(o),received:n.parsedType,code:Z.invalid_type}),ve}if(this._cache||(this._cache=new Set(Oe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=Oe.objectValues(r);return ie(n,{received:n.data,code:Z.invalid_enum_value,options:o}),ve}return Mt(t.data)}get enum(){return this._def.values}};Ma.create=(e,t)=>new Ma({values:e,typeName:xe.ZodNativeEnum,...Fe(t)});var Oo=class extends Ie{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==se.promise&&r.common.async===!1)return ie(r,{code:Z.invalid_type,expected:se.promise,received:r.parsedType}),ve;let n=r.parsedType===se.promise?r.data:Promise.resolve(r.data);return Mt(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Oo.create=(e,t)=>new Oo({type:e,typeName:xe.ZodPromise,...Fe(t)});var Cr=class extends Ie{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this26=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,a={addIssue:i=>{ie(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){let i=o.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(p){if(r.value==="aborted")return ve;let f=yield _this26._def.schema._parseAsync({data:p,path:n.path,parent:n});return f.status==="aborted"?ve:f.status==="dirty"?wa(f.value):r.value==="dirty"?wa(f.value):f});return function(_x135){return _ref55.apply(this,arguments)}}());{if(r.value==="aborted")return ve;let p=this._def.schema._parseSync({data:i,path:n.path,parent:n});return p.status==="aborted"?ve:p.status==="dirty"?wa(p.value):r.value==="dirty"?wa(p.value):p}}if(o.type==="refinement"){let i=p=>{let f=o.refinement(p,a);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(n.common.async===!1){let p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return p.status==="aborted"?ve:(p.status==="dirty"&&r.dirty(),i(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>p.status==="aborted"?ve:(p.status==="dirty"&&r.dirty(),i(p.value).then(()=>({status:r.value,value:p.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!To(i))return ve;let p=o.transform(i.value,a);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>To(i)?Promise.resolve(o.transform(i.value,a)).then(p=>({status:r.value,value:p})):ve);Oe.assertNever(o)}};Cr.create=(e,t,r)=>new Cr({schema:e,typeName:xe.ZodEffects,effect:t,...Fe(r)});Cr.createWithPreprocess=(e,t,r)=>new Cr({schema:t,effect:{type:"preprocess",transform:e},typeName:xe.ZodEffects,...Fe(r)});var xr=class extends Ie{_parse(t){return this._getType(t)===se.undefined?Mt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};xr.create=(e,t)=>new xr({innerType:e,typeName:xe.ZodOptional,...Fe(t)});var rn=class extends Ie{_parse(t){return this._getType(t)===se.null?Mt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};rn.create=(e,t)=>new rn({innerType:e,typeName:xe.ZodNullable,...Fe(t)});var ja=class extends Ie{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===se.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};ja.create=(e,t)=>new ja({innerType:e,typeName:xe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Fe(t)});var Va=class extends Ie{_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 Ms(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Jt(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Jt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Va.create=(e,t)=>new Va({innerType:e,typeName:xe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Fe(t)});var Bs=class extends Ie{_parse(t){if(this._getType(t)!==se.nan){let n=this._getOrReturnCtx(t);return ie(n,{code:Z.invalid_type,expected:se.nan,received:n.parsedType}),ve}return{status:"valid",value:t.data}}};Bs.create=e=>new Bs({typeName:xe.ZodNaN,...Fe(e)});var oj=Symbol("zod_brand"),al=class extends Ie{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},il=class e extends Ie{_parse(t){var _this27=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let a=yield _this27._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?ve:a.status==="dirty"?(r.dirty(),wa(a.value)):_this27._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?ve: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:xe.ZodPipeline})}},La=class extends Ie{_parse(t){let r=this._def.innerType._parse(t),n=o=>(To(o)&&(o.value=Object.freeze(o.value)),o);return Ms(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};La.create=(e,t)=>new La({innerType:e,typeName:xe.ZodReadonly,...Fe(t)});function Rw(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Tw(e,t={},r){return e?ko.create().superRefine((n,o)=>{let a=e(n);if(a instanceof Promise)return a.then(i=>{if(!i){let p=Rw(t,n),f=p.fatal??r??!0;o.addIssue({code:"custom",...p,fatal:f})}});if(!a){let i=Rw(t,n),p=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:p})}}):ko.create()}var aj={object:Xt.lazycreate},xe;(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"})(xe||(xe={}));var ij=(e,t={message:`Input not instance of ${e.name}`})=>Tw(r=>r instanceof e,t),Pw=Po.create,kw=Fa.create,sj=Bs.create,cj=Ea.create,Ow=Ia.create,uj=Ta.create,lj=Vs.create,dj=Pa.create,pj=ka.create,fj=ko.create,mj=Gn.create,gj=qr.create,hj=Ls.create,yj=$n.create,Sj=Xt.create,vj=Xt.strictCreate,xj=Oa.create,Aj=Kp.create,Cj=Na.create,bj=tn.create,Rj=Yp.create,wj=Us.create,Fj=Qs.create,Ej=Jp.create,Ij=_a.create,Tj=Da.create,Pj=qa.create,kj=Ma.create,Oj=Oo.create,Nj=Cr.create,_j=xr.create,Dj=rn.create,qj=Cr.createWithPreprocess,Mj=il.create,jj=()=>Pw().optional(),Vj=()=>kw().optional(),Lj=()=>Ow().optional(),Uj={string:e=>Po.create({...e,coerce:!0}),number:e=>Fa.create({...e,coerce:!0}),boolean:e=>Ia.create({...e,coerce:!0}),bigint:e=>Ea.create({...e,coerce:!0}),date:e=>Ta.create({...e,coerce:!0})};var Qj=ve;var Bj=E.object({name:E.string(),arguments:E.string()}),Gj=E.object({id:E.string(),type:E.literal("function"),function:Bj,encryptedValue:E.string().optional()}),Xp=E.object({id:E.string(),role:E.string(),content:E.string().optional(),name:E.string().optional(),encryptedValue:E.string().optional()}),$j=E.object({type:E.literal("text"),text:E.string()}),Nw=E.object({type:E.literal("binary"),mimeType:E.string(),id:E.string().optional(),url:E.string().optional(),data:E.string().optional(),filename:E.string().optional()}),_w=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:E.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},jce=Nw.superRefine((e,t)=>{_w(e,t)}),Hj=E.discriminatedUnion("type",[$j,Nw]),zj=Hj.superRefine((e,t)=>{e.type==="binary"&&_w(e,t)}),Wj=Xp.extend({role:E.literal("developer"),content:E.string()}),Kj=Xp.extend({role:E.literal("system"),content:E.string()}),Yj=Xp.extend({role:E.literal("assistant"),content:E.string().optional(),toolCalls:E.array(Gj).optional()}),Jj=Xp.extend({role:E.literal("user"),content:E.union([E.string(),E.array(zj)])}),Xj=E.object({id:E.string(),content:E.string(),role:E.literal("tool"),toolCallId:E.string(),error:E.string().optional(),encryptedValue:E.string().optional()}),Zj=E.object({id:E.string(),role:E.literal("activity"),activityType:E.string(),content:E.record(E.any())}),eV=E.object({id:E.string(),role:E.literal("reasoning"),content:E.string(),encryptedValue:E.string().optional()}),Dw=E.discriminatedUnion("role",[Wj,Kj,Yj,Jj,Xj,Zj,eV]),Vce=E.union([E.literal("developer"),E.literal("system"),E.literal("assistant"),E.literal("user"),E.literal("tool"),E.literal("activity"),E.literal("reasoning")]),tV=E.object({description:E.string(),value:E.string()}),rV=E.object({name:E.string(),description:E.string(),parameters:E.any()}),nV=E.object({threadId:E.string(),runId:E.string(),parentRunId:E.string().optional(),state:E.any(),messages:E.array(Dw),tools:E.array(rV),context:E.array(tV),forwardedProps:E.any()}),oV=E.any(),et=class extends Error{constructor(e){super(e)}},iv=class extends et{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},qw=E.union([E.literal("developer"),E.literal("system"),E.literal("assistant"),E.literal("user")]),D=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}({}),je=E.object({type:E.nativeEnum(D),timestamp:E.number().optional(),rawEvent:E.any().optional()}).passthrough(),aV=je.extend({type:E.literal(D.TEXT_MESSAGE_START),messageId:E.string(),role:qw.default("assistant")}),Mw=je.extend({type:E.literal(D.TEXT_MESSAGE_CONTENT),messageId:E.string(),delta:E.string().refine(e=>e.length>0,"Delta must not be an empty string")}),iV=je.extend({type:E.literal(D.TEXT_MESSAGE_END),messageId:E.string()}),sV=je.extend({type:E.literal(D.TEXT_MESSAGE_CHUNK),messageId:E.string().optional(),role:qw.optional(),delta:E.string().optional()}),cV=je.extend({type:E.literal(D.THINKING_TEXT_MESSAGE_START)}),uV=Mw.omit({messageId:!0,type:!0}).extend({type:E.literal(D.THINKING_TEXT_MESSAGE_CONTENT)}),lV=je.extend({type:E.literal(D.THINKING_TEXT_MESSAGE_END)}),dV=je.extend({type:E.literal(D.TOOL_CALL_START),toolCallId:E.string(),toolCallName:E.string(),parentMessageId:E.string().optional()}),pV=je.extend({type:E.literal(D.TOOL_CALL_ARGS),toolCallId:E.string(),delta:E.string()}),fV=je.extend({type:E.literal(D.TOOL_CALL_END),toolCallId:E.string()}),mV=je.extend({messageId:E.string(),type:E.literal(D.TOOL_CALL_RESULT),toolCallId:E.string(),content:E.string(),role:E.literal("tool").optional()}),gV=je.extend({type:E.literal(D.TOOL_CALL_CHUNK),toolCallId:E.string().optional(),toolCallName:E.string().optional(),parentMessageId:E.string().optional(),delta:E.string().optional()}),hV=je.extend({type:E.literal(D.THINKING_START),title:E.string().optional()}),yV=je.extend({type:E.literal(D.THINKING_END)}),SV=je.extend({type:E.literal(D.STATE_SNAPSHOT),snapshot:oV}),vV=je.extend({type:E.literal(D.STATE_DELTA),delta:E.array(E.any())}),xV=je.extend({type:E.literal(D.MESSAGES_SNAPSHOT),messages:E.array(Dw)}),AV=je.extend({type:E.literal(D.ACTIVITY_SNAPSHOT),messageId:E.string(),activityType:E.string(),content:E.record(E.any()),replace:E.boolean().optional().default(!0)}),CV=je.extend({type:E.literal(D.ACTIVITY_DELTA),messageId:E.string(),activityType:E.string(),patch:E.array(E.any())}),bV=je.extend({type:E.literal(D.RAW),event:E.any(),source:E.string().optional()}),RV=je.extend({type:E.literal(D.CUSTOM),name:E.string(),value:E.any()}),wV=je.extend({type:E.literal(D.RUN_STARTED),threadId:E.string(),runId:E.string(),parentRunId:E.string().optional(),input:nV.optional()}),FV=je.extend({type:E.literal(D.RUN_FINISHED),threadId:E.string(),runId:E.string(),result:E.any().optional()}),EV=je.extend({type:E.literal(D.RUN_ERROR),message:E.string(),code:E.string().optional()}),IV=je.extend({type:E.literal(D.STEP_STARTED),stepName:E.string()}),TV=je.extend({type:E.literal(D.STEP_FINISHED),stepName:E.string()}),PV=E.union([E.literal("tool-call"),E.literal("message")]),kV=je.extend({type:E.literal(D.REASONING_START),messageId:E.string()}),OV=je.extend({type:E.literal(D.REASONING_MESSAGE_START),messageId:E.string(),role:E.literal("reasoning")}),NV=je.extend({type:E.literal(D.REASONING_MESSAGE_CONTENT),messageId:E.string(),delta:E.string().refine(e=>e.length>0,"Delta must not be an empty string")}),_V=je.extend({type:E.literal(D.REASONING_MESSAGE_END),messageId:E.string()}),DV=je.extend({type:E.literal(D.REASONING_MESSAGE_CHUNK),messageId:E.string().optional(),delta:E.string().optional()}),qV=je.extend({type:E.literal(D.REASONING_END),messageId:E.string()}),MV=je.extend({type:E.literal(D.REASONING_ENCRYPTED_VALUE),subtype:PV,entityId:E.string(),encryptedValue:E.string()}),Zp=E.discriminatedUnion("type",[aV,Mw,iV,sV,hV,yV,cV,uV,lV,dV,pV,fV,gV,mV,SV,vV,xV,AV,CV,bV,RV,wV,FV,EV,IV,TV,kV,OV,NV,_V,DV,qV,MV]);d();c();l();u();var sv={};fu(sv,{JsonPatchError:()=>nt,_areEquals:()=>ul,applyOperation:()=>Ua,applyPatch:()=>No,applyReducer:()=>QV,deepClone:()=>LV,getValueByPointer:()=>of,validate:()=>Vw,validator:()=>af});d();c();l();u();d();c();l();u();var jV=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),VV=Object.prototype.hasOwnProperty;function tf(e,t){return VV.call(e,t)}function rf(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)tf(e,o)&&n.push(o);return n}function Nt(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function nf(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 nn(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function sl(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function ef(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(ef(e[t]))return!0}else if(typeof e=="object"){for(var n=rf(e),o=n.length,a=0;a<o;a++)if(ef(e[n[a]]))return!0}}return!1}function jw(e,t){var r=[e];for(var n in t){var o=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof o<"u"&&r.push(n+": "+o)}return r.join(`
|
|
32
|
+
`)}var cl=function(e){jV(t,e);function t(r,n,o,a,i){var p=this.constructor,f=e.call(this,jw(r,{name:n,index:o,operation:a,tree:i}))||this;return f.name=n,f.index=o,f.operation=a,f.tree=i,Object.setPrototypeOf(f,p.prototype),f.message=jw(r,{name:n,index:o,operation:a,tree:i}),f}return t}(Error);var nt=cl,LV=Nt,Gs={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=of(r,this.path);n&&(n=Nt(n));var o=Ua(r,{op:"remove",path:this.from}).removed;return Ua(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=of(r,this.from);return Ua(r,{op:"add",path:this.path,value:Nt(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:ul(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},UV={add:function(e,t,r){return nf(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:Gs.move,copy:Gs.copy,test:Gs.test,_get:Gs._get};function of(e,t){if(t=="")return e;var r={op:"_get",path:t};return Ua(e,r),r.value}function Ua(e,t,r,n,o,a){if(r===void 0&&(r=!1),n===void 0&&(n=!0),o===void 0&&(o=!0),a===void 0&&(a=0),r&&(typeof r=="function"?r(t,0,e,t.path):af(t,0)),t.path===""){var i={newDocument:e};if(t.op==="add")return i.newDocument=t.value,i;if(t.op==="replace")return i.newDocument=t.value,i.removed=e,i;if(t.op==="move"||t.op==="copy")return i.newDocument=of(e,t.from),t.op==="move"&&(i.removed=e),i;if(t.op==="test"){if(i.test=ul(e,t.value),i.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i.newDocument=e,i}else{if(t.op==="remove")return i.removed=e,i.newDocument=null,i;if(t.op==="_get")return t.value=e,i;if(r)throw new nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,t,e);return i}}else{n||(e=Nt(e));var p=t.path||"",f=p.split("/"),m=e,h=1,S=f.length,v=void 0,g=void 0,C=void 0;for(typeof r=="function"?C=r:C=af;;){if(g=f[h],g&&g.indexOf("~")!=-1&&(g=sl(g)),o&&(g=="__proto__"||g=="prototype"&&h>0&&f[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&&v===void 0&&(m[g]===void 0?v=f.slice(0,h).join("/"):h==S-1&&(v=t.path),v!==void 0&&C(t,0,e,v)),h++,Array.isArray(m)){if(g==="-")g=m.length;else{if(r&&!nf(g))throw new nt("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",a,t,e);nf(g)&&(g=~~g)}if(h>=S){if(r&&t.op==="add"&&g>m.length)throw new nt("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,t,e);var i=UV[t.op].call(t,m,g,e);if(i.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}}else if(h>=S){var i=Gs[t.op].call(t,m,g,e);if(i.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}if(m=m[g],r&&h<S&&(!m||typeof m!="object"))throw new nt("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",a,t,e)}}}function No(e,t,r,n,o){if(n===void 0&&(n=!0),o===void 0&&(o=!0),r&&!Array.isArray(t))throw new nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=Nt(e));for(var a=new Array(t.length),i=0,p=t.length;i<p;i++)a[i]=Ua(e,t[i],r,!0,o,i),e=a[i].newDocument;return a.newDocument=e,a}function QV(e,t,r){var n=Ua(e,t);if(n.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function af(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new nt("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(Gs[e.op]){if(typeof e.path!="string")throw new nt("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new nt("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 nt("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 nt("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")&&ef(e.value))throw new nt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var o=e.path.split("/").length,a=n.split("/").length;if(o!==a+1&&o!==a)throw new nt("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 nt("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var i={op:"_get",path:e.from,value:void 0},p=Vw([i],r);if(p&&p.name==="OPERATION_PATH_UNRESOLVABLE")throw new nt("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function Vw(e,t,r){try{if(!Array.isArray(e))throw new nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)No(Nt(t),Nt(e),r||!0);else{r=r||af;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(o){if(o instanceof nt)return o;throw o}}function ul(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),o,a,i;if(r&&n){if(a=e.length,a!=t.length)return!1;for(o=a;o--!==0;)if(!ul(e[o],t[o]))return!1;return!0}if(r!=n)return!1;var p=Object.keys(e);if(a=p.length,a!==Object.keys(t).length)return!1;for(o=a;o--!==0;)if(!t.hasOwnProperty(p[o]))return!1;for(o=a;o--!==0;)if(i=p[o],!ul(e[i],t[i]))return!1;return!0}return e!==e&&t!==t}var dv={};fu(dv,{compare:()=>YV,generate:()=>cv,observe:()=>KV,unobserve:()=>WV});d();c();l();u();var uv=new WeakMap,BV=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),GV=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function $V(e){return uv.get(e)}function HV(e,t){return e.observers.get(t)}function zV(e,t){e.observers.delete(t.callback)}function WV(e,t){t.unobserve()}function KV(e,t){var r=[],n,o=$V(e);if(!o)o=new BV(e),uv.set(e,o);else{var a=HV(o,t);n=a&&a.observer}if(n)return n;if(n={},o.value=Nt(e),t){n.callback=t,n.next=null;var i=function(){cv(n)},p=function(){clearTimeout(n.next),n.next=setTimeout(i)};typeof window<"u"&&(window.addEventListener("mouseup",p),window.addEventListener("keyup",p),window.addEventListener("mousedown",p),window.addEventListener("keydown",p),window.addEventListener("change",p))}return n.patches=r,n.object=e,n.unobserve=function(){cv(n),clearTimeout(n.next),zV(o,n),typeof window<"u"&&(window.removeEventListener("mouseup",p),window.removeEventListener("keyup",p),window.removeEventListener("mousedown",p),window.removeEventListener("keydown",p),window.removeEventListener("change",p))},o.observers.set(t,new GV(t,n)),n}function cv(e,t){t===void 0&&(t=!1);var r=uv.get(e.object);lv(r.value,e.object,e.patches,"",t),e.patches.length&&No(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function lv(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var a=rf(t),i=rf(e),p=!1,f=!1,m=i.length-1;m>=0;m--){var h=i[m],S=e[h];if(tf(t,h)&&!(t[h]===void 0&&S!==void 0&&Array.isArray(t)===!1)){var v=t[h];typeof S=="object"&&S!=null&&typeof v=="object"&&v!=null&&Array.isArray(S)===Array.isArray(v)?lv(S,v,r,n+"/"+nn(h),o):S!==v&&(p=!0,o&&r.push({op:"test",path:n+"/"+nn(h),value:Nt(S)}),r.push({op:"replace",path:n+"/"+nn(h),value:Nt(v)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+nn(h),value:Nt(S)}),r.push({op:"remove",path:n+"/"+nn(h)}),f=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),p=!0)}if(!(!f&&a.length==i.length))for(var m=0;m<a.length;m++){var h=a[m];!tf(e,h)&&t[h]!==void 0&&r.push({op:"add",path:n+"/"+nn(h),value:Nt(t[h])})}}}function YV(e,t,r){r===void 0&&(r=!1);var n=[];return lv(e,t,n,"",r),n}var lue=Object.assign({},sv,dv,{JsonPatchError:cl,deepClone:Nt,escapePathComponent:nn,unescapePathComponent:sl});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var pv=function(e,t){return pv=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])},pv(e,t)};function on(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");pv(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Lw(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(h){try{m(n.next(h))}catch(S){i(S)}}function f(h){try{m(n.throw(h))}catch(S){i(S)}}function m(h){h.done?a(h.value):o(h.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}function sf(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=p(0),i.throw=p(1),i.return=p(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(h){return f([m,h])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,m[0]&&(r=0)),r;)try{if(n=1,o&&(a=m[0]&2?o.return:m[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,m[1])).done)return a;switch(o=0,a&&(m=[m[0]&2,a.value]),m[0]){case 0:case 1:a=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!a||m[1]>a[0]&&m[1]<a[3])){r.label=m[1];break}if(m[0]===6&&r.label<a[1]){r.label=a[1],a=m;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(m);break}a[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(h){m=[6,h],o=0}finally{n=a=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}}function Hn(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 $s(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-->0)&&!(o=n.next()).done;)a.push(o.value)}catch(p){i={error:p}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a}function Hs(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function Qa(e){return this instanceof Qa?(this.v=e,this):new Qa(e)}function Uw(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,a=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),p("next"),p("throw"),p("return",i),o[Symbol.asyncIterator]=function(){return this},o;function i(g){return function(C){return Promise.resolve(C).then(g,S)}}function p(g,C){n[g]&&(o[g]=function(w){return new Promise(function(R,b){a.push([g,w,R,b])>1||f(g,w)})},C&&(o[g]=C(o[g])))}function f(g,C){try{m(n[g](C))}catch(w){v(a[0][3],w)}}function m(g){g.value instanceof Qa?Promise.resolve(g.value.v).then(h,S):v(a[0][2],g)}function h(g){f("next",g)}function S(g){f("throw",g)}function v(g,C){g(C),a.shift(),a.length&&f(a[0][0],a[0][1])}}function Qw(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 Hn=="function"?Hn(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=e[a]&&function(i){return new Promise(function(p,f){i=e[a](i),o(p,f,i.done,i.value)})}}function o(a,i,p,f){Promise.resolve(f).then(function(m){a({value:m,done:p})},i)}}d();c();l();u();function Pe(e){return typeof e=="function"}d();c();l();u();d();c();l();u();d();c();l();u();function zs(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 cf=zs(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
33
33
|
`+r.map(function(n,o){return o+1+") "+n.toString()}).join(`
|
|
34
|
-
`):"",this.name="UnsubscriptionError",this.errors=r}});d();c();l();u();function ul(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Hs=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,a;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var p=Hn(i),f=p.next();!f.done;f=p.next()){var m=f.value;m.remove(this)}}catch(w){t={error:w}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}else i.remove(this);var g=this.initialTeardown;if(Pe(g))try{g()}catch(w){a=w instanceof rf?w.errors:[w]}var S=this._finalizers;if(S){this._finalizers=null;try{for(var A=Hn(S),h=A.next();!h.done;h=A.next()){var C=h.value;try{Nw(C)}catch(w){a=a??[],w instanceof rf?a=Gs(Gs([],Bs(a)),Bs(w.errors)):a.push(w)}}}catch(w){n={error:w}}finally{try{h&&!h.done&&(o=A.return)&&o.call(A)}finally{if(n)throw n.error}}}if(a)throw new rf(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Nw(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)&&ul(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&ul(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var ov=Hs.EMPTY;function nf(e){return e instanceof Hs||e&&"closed"in e&&Pe(e.remove)&&Pe(e.add)&&Pe(e.unsubscribe)}function Nw(e){Pe(e)?e():e.unsubscribe()}d();c();l();u();var Mr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};d();c();l();u();d();c();l();u();var zs={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=zs.delegate;return o?.setTimeout?o.setTimeout.apply(o,Gs([e,t],Bs(r))):setTimeout.apply(void 0,Gs([e,t],Bs(r)))},clearTimeout:function(e){var t=zs.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function of(e){zs.setTimeout(function(){var t=Mr.onUnhandledError;if(t)t(e);else throw e})}d();c();l();u();function ll(){}d();c();l();u();var _w=function(){return av("C",void 0,void 0)}();function Dw(e){return av("E",void 0,e)}function qw(e){return av("N",e,void 0)}function av(e,t,r){return{kind:e,value:t,error:r}}d();c();l();u();var Ba=null;function Ws(e){if(Mr.useDeprecatedSynchronousErrorHandling){var t=!Ba;if(t&&(Ba={errorThrown:!1,error:null}),e(),t){var r=Ba,n=r.errorThrown,o=r.error;if(Ba=null,n)throw o}}else e()}function Mw(e){Mr.useDeprecatedSynchronousErrorHandling&&Ba&&(Ba.errorThrown=!0,Ba.error=e)}var dl=function(e){on(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,nf(r)&&r.add(n)):n.destination=tL,n}return t.create=function(r,n,o){return new sf(r,n,o)},t.prototype.next=function(r){this.isStopped?sv(qw(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?sv(Dw(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?sv(_w,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}(Hs);var Xj=Function.prototype.bind;function iv(e,t){return Xj.call(e,t)}var Zj=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){af(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){af(n)}else af(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){af(r)}},e}(),sf=function(e){on(t,e);function t(r,n,o){var a=e.call(this)||this,i;if(Pe(r)||!r)i={next:r??void 0,error:n??void 0,complete:o??void 0};else{var p;a&&Mr.useDeprecatedNextContext?(p=Object.create(r),p.unsubscribe=function(){return a.unsubscribe()},i={next:r.next&&iv(r.next,p),error:r.error&&iv(r.error,p),complete:r.complete&&iv(r.complete,p)}):i=r}return a.destination=new Zj(i),a}return t}(dl);function af(e){Mr.useDeprecatedSynchronousErrorHandling?Mw(e):of(e)}function eL(e){throw e}function sv(e,t){var r=Mr.onStoppedNotification;r&&zs.setTimeout(function(){return r(e,t)})}var tL={closed:!0,next:ll,error:eL,complete:ll};d();c();l();u();var Ks=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();d();c();l();u();d();c();l();u();function Ys(e){return e}function cf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return cv(e)}function cv(e){return e.length===0?Ys:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var We=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,a=nL(t)?t:new sf(t,r,n);return Ws(function(){var i=o,p=i.operator,f=i.source;a.add(p?p.call(a,f):f?o._subscribe(a):o._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=Vw(r),new r(function(o,a){var i=new sf({next:function(p){try{t(p)}catch(f){a(f),i.unsubscribe()}},error:a,complete:o});n.subscribe(i)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[Ks]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return cv(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Vw(t),new t(function(n,o){var a;r.subscribe(function(i){return a=i},function(i){return o(i)},function(){return n(a)})})},e.create=function(t){return new e(t)},e}();function Vw(e){var t;return(t=e??Mr.Promise)!==null&&t!==void 0?t:Promise}function rL(e){return e&&Pe(e.next)&&Pe(e.error)&&Pe(e.complete)}function nL(e){return e&&e instanceof dl||rL(e)&&nf(e)}d();c();l();u();function oL(e){return Pe(e?.lift)}function ft(e){return function(t){if(oL(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}d();c();l();u();function yt(e,t,r,n,o){return new aL(e,t,r,n,o)}var aL=function(e){on(t,e);function t(r,n,o,a,i,p){var f=e.call(this,r)||this;return f.onFinalize=i,f.shouldUnsubscribe=p,f._next=n?function(m){try{n(m)}catch(g){r.error(g)}}:e.prototype._next,f._error=a?function(m){try{a(m)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,f._complete=o?function(){try{o()}catch(m){r.error(m)}finally{this.unsubscribe()}}:e.prototype._complete,f}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t}(dl);d();c();l();u();d();c();l();u();var jw=$s(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var an=function(e){on(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 Lw(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new jw},t.prototype.next=function(r){var n=this;Ws(function(){var o,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var i=Hn(n.currentObservers),p=i.next();!p.done;p=i.next()){var f=p.value;f.next(r)}}catch(m){o={error:m}}finally{try{p&&!p.done&&(a=i.return)&&a.call(i)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;Ws(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;Ws(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,a=o.hasError,i=o.isStopped,p=o.observers;return a||i?ov:(this.currentObservers=null,p.push(r),new Hs(function(){n.currentObservers=null,ul(p,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,a=n.thrownError,i=n.isStopped;o?r.error(a):i&&r.complete()},t.prototype.asObservable=function(){var r=new We;return r.source=this,r},t.create=function(r,n){return new Lw(r,n)},t}(We);var Lw=function(e){on(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:ov},t}(an);d();c();l();u();d();c();l();u();var uv={now:function(){return(uv.delegate||Date).now()},delegate:void 0};var uf=function(e){on(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=uv);var a=e.call(this)||this;return a._bufferSize=r,a._windowTime=n,a._timestampProvider=o,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=n===1/0,a._bufferSize=Math.max(1,r),a._windowTime=Math.max(1,n),a}return t.prototype.next=function(r){var n=this,o=n.isStopped,a=n._buffer,i=n._infiniteTimeWindow,p=n._timestampProvider,f=n._windowTime;o||(a.push(r),!i&&a.push(p.now()+f)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,a=o._infiniteTimeWindow,i=o._buffer,p=i.slice(),f=0;f<p.length&&!r.closed;f+=a?1:2)r.next(p[f]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,a=r._buffer,i=r._infiniteTimeWindow,p=(i?1:2)*n;if(n<1/0&&p<a.length&&a.splice(0,a.length-p),!i){for(var f=o.now(),m=0,g=1;g<a.length&&a[g]<=f;g+=2)m=g;m&&a.splice(0,m+1)}},t}(an);d();c();l();u();var lf=new We(function(e){return e.complete()});d();c();l();u();d();c();l();u();d();c();l();u();function Uw(e){return e&&Pe(e.schedule)}function iL(e){return e[e.length-1]}function Qw(e){return Uw(iL(e))?e.pop():void 0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var df=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};d();c();l();u();function pf(e){return Pe(e?.then)}d();c();l();u();function ff(e){return Pe(e[Ks])}d();c();l();u();function mf(e){return Symbol.asyncIterator&&Pe(e?.[Symbol.asyncIterator])}d();c();l();u();function gf(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}d();c();l();u();d();c();l();u();function sL(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var hf=sL();function yf(e){return Pe(e?.[hf])}d();c();l();u();function Sf(e){return kw(this,arguments,function(){var r,n,o,a;return tf(this,function(i){switch(i.label){case 0:r=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,Qa(r.read())];case 3:return n=i.sent(),o=n.value,a=n.done,a?[4,Qa(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,Qa(o)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function vf(e){return Pe(e?.getReader)}function St(e){if(e instanceof We)return e;if(e!=null){if(ff(e))return cL(e);if(df(e))return uL(e);if(pf(e))return lL(e);if(mf(e))return Bw(e);if(yf(e))return dL(e);if(vf(e))return pL(e)}throw gf(e)}function cL(e){return new We(function(t){var r=e[Ks]();if(Pe(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function uL(e){return new We(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function lL(e){return new We(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,of)})}function dL(e){return new We(function(t){var r,n;try{for(var o=Hn(e),a=o.next();!a.done;a=o.next()){var i=a.value;if(t.next(i),t.closed)return}}catch(p){r={error:p}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function Bw(e){return new We(function(t){fL(e,t).catch(function(r){return t.error(r)})})}function pL(e){return Bw(Sf(e))}function fL(e,t){var r,n,o,a;return Pw(this,void 0,void 0,function(){var i,p;return tf(this,function(f){switch(f.label){case 0:f.trys.push([0,5,6,11]),r=Ow(e),f.label=1;case 1:return[4,r.next()];case 2:if(n=f.sent(),!!n.done)return[3,4];if(i=n.value,t.next(i),t.closed)return[2];f.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return p=f.sent(),o={error:p},[3,11];case 6:return f.trys.push([6,,9,10]),n&&!n.done&&(a=r.return)?[4,a.call(r)]:[3,8];case 7:f.sent(),f.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}d();c();l();u();d();c();l();u();function br(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var a=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(a),!o)return a}function xf(e,t){return t===void 0&&(t=0),ft(function(r,n){r.subscribe(yt(n,function(o){return br(n,e,function(){return n.next(o)},t)},function(){return br(n,e,function(){return n.complete()},t)},function(o){return br(n,e,function(){return n.error(o)},t)}))})}d();c();l();u();function Af(e,t){return t===void 0&&(t=0),ft(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function Gw(e,t){return St(e).pipe(Af(t),xf(t))}d();c();l();u();function $w(e,t){return St(e).pipe(Af(t),xf(t))}d();c();l();u();function Hw(e,t){return new We(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}d();c();l();u();function zw(e,t){return new We(function(r){var n;return br(r,t,function(){n=e[hf](),br(r,t,function(){var o,a,i;try{o=n.next(),a=o.value,i=o.done}catch(p){r.error(p);return}i?r.complete():r.next(a)},0,!0)}),function(){return Pe(n?.return)&&n.return()}})}d();c();l();u();function Cf(e,t){if(!e)throw new Error("Iterable cannot be null");return new We(function(r){br(r,t,function(){var n=e[Symbol.asyncIterator]();br(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}d();c();l();u();function Ww(e,t){return Cf(Sf(e),t)}function Kw(e,t){if(e!=null){if(ff(e))return Gw(e,t);if(df(e))return Hw(e,t);if(pf(e))return $w(e,t);if(mf(e))return Cf(e,t);if(yf(e))return zw(e,t);if(vf(e))return Ww(e,t)}throw gf(e)}function Ga(e,t){return t?Kw(e,t):St(e)}function tt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Qw(e);return Ga(e,r)}d();c();l();u();function Ke(e,t){var r=Pe(e)?e:function(){return e},n=function(o){return o.error(r())};return new We(t?function(o){return t.schedule(n,0,o)}:n)}d();c();l();u();d();c();l();u();var Yw=$s(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function bf(e,t){var r=typeof t=="object";return new Promise(function(n,o){var a=!1,i;e.subscribe({next:function(p){i=p,a=!0},error:o,complete:function(){a?n(i):r?n(t.defaultValue):o(new Yw)}})})}d();c();l();u();function $a(e,t){return ft(function(r,n){var o=0;r.subscribe(yt(n,function(a){n.next(e.call(t,a,o++))}))})}d();c();l();u();d();c();l();u();d();c();l();u();function Jw(e,t,r,n,o,a,i,p){var f=[],m=0,g=0,S=!1,A=function(){S&&!f.length&&!m&&t.complete()},h=function(w){return m<n?C(w):f.push(w)},C=function(w){a&&t.next(w),m++;var R=!1;St(r(w,g++)).subscribe(yt(t,function(b){o?.(b),a?h(b):t.next(b)},function(){R=!0},void 0,function(){if(R)try{m--;for(var b=function(){var F=f.shift();i?br(t,i,function(){return C(F)}):C(F)};f.length&&m<n;)b();A()}catch(F){t.error(F)}}))};return e.subscribe(yt(t,h,function(){S=!0,A()})),function(){p?.()}}function Zt(e,t,r){return r===void 0&&(r=1/0),Pe(t)?Zt(function(n,o){return $a(function(a,i){return t(n,a,o,i)})(St(e(n,o)))},r):(typeof t=="number"&&(r=t),ft(function(n,o){return Jw(n,o,e,r)}))}function lv(e){return e===void 0&&(e=1/0),Zt(Ys,e)}d();c();l();u();function dv(e){return new We(function(t){St(e()).subscribe(t)})}d();c();l();u();function pl(e){return ft(function(t,r){var n=null,o=!1,a;n=t.subscribe(yt(r,void 0,void 0,function(i){a=St(e(i,pl(e)(t))),n?(n.unsubscribe(),n=null,a.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,a.subscribe(r))})}d();c();l();u();function Rf(e,t){return Pe(t)?Zt(e,t,1):Zt(e,1)}d();c();l();u();function pv(e){return ft(function(t,r){var n=!1;t.subscribe(yt(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}d();c();l();u();function Ha(e){return ft(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}d();c();l();u();function fv(e,t){return ft(function(r,n){var o=null,a=0,i=!1,p=function(){return i&&!o&&n.complete()};r.subscribe(yt(n,function(f){o?.unsubscribe();var m=0,g=a++;St(e(f,g)).subscribe(o=yt(n,function(S){return n.next(t?t(f,S,g,m++):S)},function(){o=null,p()}))},function(){i=!0,p()}))})}d();c();l();u();function wf(e){return ft(function(t,r){St(e).subscribe(yt(r,function(){return r.complete()},ll)),!r.closed&&t.subscribe(r)})}d();c();l();u();function mv(e,t,r){var n=Pe(e)||t||r?{next:e,error:t,complete:r}:e;return n?ft(function(o,a){var i;(i=n.subscribe)===null||i===void 0||i.call(n);var p=!0;o.subscribe(yt(a,function(f){var m;(m=n.next)===null||m===void 0||m.call(n,f),a.next(f)},function(){var f;p=!1,(f=n.complete)===null||f===void 0||f.call(n),a.complete()},function(f){var m;p=!1,(m=n.error)===null||m===void 0||m.call(n,f),a.error(f)},function(){var f,m;p&&((f=n.unsubscribe)===null||f===void 0||f.call(n)),(m=n.finalize)===null||m===void 0||m.call(n)}))}):Ys}d();c();l();u();d();c();l();u();function Xw(e){return` \r
|
|
35
|
-
`.indexOf(e)>=0}function Ff(e){for(var t=["topLevel"],r=0,n,o,a,i=function(F){return t.push(F)},p=function(F){return t[t.length-1]=F},f=function(F){n==null&&(n=r,o=t.length,a=F)},m=function(F){F===a&&(n=void 0,o=void 0,a=void 0)},g=function(){return t.pop()},S=function(){return r--},A=function(F){if("0"<=F&&F<="9"){i("number");return}switch(F){case"\"":i("string");return;case"-":i("numberNeedsDigit");return;case"t":i("true");return;case"f":i("false");return;case"n":i("null");return;case"[":i("arrayNeedsValue");return;case"{":i("objectNeedsKey");return}},h=e.length;r<h;r++){var C=e[r];switch(t[t.length-1]){case"topLevel":A(C);break;case"string":switch(C){case"\"":g();break;case"\\":f("stringEscape"),i("stringEscaped");break}break;case"stringEscaped":C==="u"?i("stringUnicode"):(m("stringEscape"),g());break;case"stringUnicode":r-e.lastIndexOf("u",r)===4&&(m("stringEscape"),g());break;case"number":C==="."?p("numberNeedsDigit"):C==="e"||C==="E"?p("numberNeedsExponent"):(C<"0"||C>"9")&&(S(),g());break;case"numberNeedsDigit":p("number");break;case"numberNeedsExponent":p(C==="+"||C==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(C<"a"||C>"z")&&(S(),g());break;case"arrayNeedsValue":C==="]"?g():Xw(C)||(m("collectionItem"),p("arrayNeedsComma"),A(C));break;case"arrayNeedsComma":C==="]"?g():C===","&&(f("collectionItem"),p("arrayNeedsValue"));break;case"objectNeedsKey":C==="}"?g():C==="\""&&(f("collectionItem"),p("objectNeedsColon"),i("string"));break;case"objectNeedsColon":C===":"&&p("objectNeedsValue");break;case"objectNeedsValue":Xw(C)||(m("collectionItem"),p("objectNeedsComma"),A(C));break;case"objectNeedsComma":C==="}"?g():C===","&&(f("collectionItem"),p("objectNeedsKey"));break}}o!=null&&(t.length=o);for(var w=[n!=null?e.slice(0,n):e],R=function(F){return w.push(F.slice(e.length-e.lastIndexOf(F[0])))},b=t.length-1;b>=0;b--)switch(t[b]){case"string":w.push("\"");break;case"numberNeedsDigit":case"numberNeedsExponent":w.push("0");break;case"true":R("true");break;case"false":R("false");break;case"null":R("null");break;case"arrayNeedsValue":case"arrayNeedsComma":w.push("]");break;case"objectNeedsKey":case"objectNeedsColon":case"objectNeedsValue":case"objectNeedsComma":w.push("}");break}return w.join("")}d();c();l();u();d();c();l();u();d();c();l();u();function eF(){let e=0,t=0;for(let n=0;n<28;n+=7){let o=this.buf[this.pos++];if(e|=(o&127)<<n,(o&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let o=this.buf[this.pos++];if(t|=(o&127)<<n,(o&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function If(e,t,r){for(let a=0;a<28;a=a+7){let i=e>>>a,p=!(!(i>>>7)&&t==0),f=(p?i|128:i)&255;if(r.push(f),!p)return}let n=e>>>28&15|(t&7)<<4,o=t>>3!=0;if(r.push((o?n|128:n)&255),!!o){for(let a=3;a<31;a=a+7){let i=t>>>a,p=!!(i>>>7),f=(p?i|128:i)&255;if(r.push(f),!p)return}r.push(t>>>31&1)}}var Ef=4294967296;function gv(e){let t=e[0]==="-";t&&(e=e.slice(1));let r=1e6,n=0,o=0;function a(i,p){let f=Number(e.slice(i,p));o*=r,n=n*r+f,n>=Ef&&(o=o+(n/Ef|0),n=n%Ef)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?rF(n,o):yv(n,o)}function tF(e,t){let r=yv(e,t),n=r.hi&2147483648;n&&(r=rF(r.lo,r.hi));let o=hv(r.lo,r.hi);return n?"-"+o:o}function hv(e,t){if({lo:e,hi:t}=mL(e,t),t<=2097151)return String(Ef*t+e);let r=e&16777215,n=(e>>>24|t<<8)&16777215,o=t>>16&65535,a=r+n*6777216+o*6710656,i=n+o*8147497,p=o*2,f=1e7;return a>=f&&(i+=Math.floor(a/f),a%=f),i>=f&&(p+=Math.floor(i/f),i%=f),p.toString()+Zw(i)+Zw(a)}function mL(e,t){return{lo:e>>>0,hi:t>>>0}}function yv(e,t){return{lo:e|0,hi:t|0}}function rF(e,t){return t=~t,e?e=~e+1:t+=1,yv(e,t)}var Zw=e=>{let t=String(e);return"0000000".slice(t.length)+t};function Sv(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function nF(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}d();c();l();u();var Vr=gL();function gL(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!y.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let r=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),o=BigInt("0"),a=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(i){let p=typeof i=="bigint"?i:BigInt(i);if(p>n||p<r)throw new Error(`invalid int64: ${i}`);return p},uParse(i){let p=typeof i=="bigint"?i:BigInt(i);if(p>a||p<o)throw new Error(`invalid uint64: ${i}`);return p},enc(i){return e.setBigInt64(0,this.parse(i),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(i){return e.setBigInt64(0,this.uParse(i),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(i,p){return e.setInt32(0,i,!0),e.setInt32(4,p,!0),e.getBigInt64(0,!0)},uDec(i,p){return e.setInt32(0,i,!0),e.setInt32(4,p,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),oF(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),aF(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),oF(r),gv(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),aF(r),gv(r)},dec(r,n){return tF(r,n)},uDec(r,n){return hv(r,n)}}}function oF(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function aF(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}d();c();l();u();var vv=Symbol.for("@bufbuild/protobuf/text-encoding");function xv(){if(y[vv]==null){let e=new y.TextEncoder,t=new y.TextDecoder;y[vv]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return y[vv]}var _o;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(_o||(_o={}));var hL=34028234663852886e22,yL=-34028234663852886e22,SL=4294967295,vL=2147483647,xL=-2147483648,je=class{constructor(t=xv().encodeUtf8){this.encodeUtf8=t,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let t=0;for(let o=0;o<this.chunks.length;o++)t+=this.chunks[o].length;let r=new Uint8Array(t),n=0;for(let o=0;o<this.chunks.length;o++)r.set(this.chunks[o],n),n+=this.chunks[o].length;return this.chunks=[],r}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),r=this.stack.pop();if(!r)throw new Error("invalid state, fork stack empty");return this.chunks=r.chunks,this.buf=r.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,r){return this.uint32((t<<3|r)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(iF(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return Av(t),Sv(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let r=this.encodeUtf8(t);return this.uint32(r.byteLength),this.raw(r)}float(t){AL(t);let r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,t,!0),this.raw(r)}double(t){let r=new Uint8Array(8);return new DataView(r.buffer).setFloat64(0,t,!0),this.raw(r)}fixed32(t){iF(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){Av(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return Av(t),t=(t<<1^t>>31)>>>0,Sv(t,this.buf),this}sfixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),o=Vr.enc(t);return n.setInt32(0,o.lo,!0),n.setInt32(4,o.hi,!0),this.raw(r)}fixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),o=Vr.uEnc(t);return n.setInt32(0,o.lo,!0),n.setInt32(4,o.hi,!0),this.raw(r)}int64(t){let r=Vr.enc(t);return If(r.lo,r.hi,this.buf),this}sint64(t){let r=Vr.enc(t),n=r.hi>>31,o=r.lo<<1^n,a=(r.hi<<1|r.lo>>>31)^n;return If(o,a,this.buf),this}uint64(t){let r=Vr.uEnc(t);return If(r.lo,r.hi,this.buf),this}},me=class{constructor(t,r=xv().decodeUtf8){this.decodeUtf8=r,this.varint64=eF,this.uint32=nF,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,n=t&7;if(r<=0||n<0||n>5)throw new Error("illegal tag: field no "+r+" wire type "+n);return[r,n]}skip(t,r){let n=this.pos;switch(t){case _o.Varint:for(;this.buf[this.pos++]&128;);break;case _o.Bit64:this.pos+=4;case _o.Bit32:this.pos+=4;break;case _o.LengthDelimited:let o=this.uint32();this.pos+=o;break;case _o.StartGroup:for(;;){let[a,i]=this.tag();if(i===_o.EndGroup){if(r!==void 0&&a!==r)throw new Error("invalid end group tag");break}this.skip(i,a)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,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 Vr.dec(...this.varint64())}uint64(){return Vr.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),n=-(t&1);return t=(t>>>1|(r&1)<<31)^n,r=r>>>1^n,Vr.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Vr.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Vr.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(){return this.decodeUtf8(this.bytes())}};function Av(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>vL||e<xL)throw new Error("invalid int32: "+e)}function iF(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>SL||e<0)throw new Error("invalid uint32: "+e)}function AL(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>hL||e<yL))throw new Error("invalid float32: "+e)}var CL=function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function Cv(){return{fields:{}}}var fl={encode(e,t=new je){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&wv.encode({key:r,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=Cv();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:{if(a!==10)break;let i=wv.decode(r,r.uint32());i.value!==void 0&&(o.fields[i.key]=i.value);continue}}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return fl.fromPartial(e??{})},fromPartial(e){let t=Cv();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,o])=>(o!==void 0&&(r[n]=o),r),{}),t},wrap(e){let t=Cv();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 sF(){return{key:"",value:void 0}}var wv={encode(e,t=new je){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&qe.encode(qe.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=sF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.key=r.string();continue;case 2:if(a!==18)break;o.value=qe.unwrap(qe.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return wv.fromPartial(e??{})},fromPartial(e){let t=sF();return t.key=e.key??"",t.value=e.value??void 0,t}};function bv(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var qe={encode(e,t=new je){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&&fl.encode(fl.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&ml.encode(ml.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=bv();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.nullValue=r.int32();continue;case 2:if(a!==17)break;o.numberValue=r.double();continue;case 3:if(a!==26)break;o.stringValue=r.string();continue;case 4:if(a!==32)break;o.boolValue=r.bool();continue;case 5:if(a!==42)break;o.structValue=fl.unwrap(fl.decode(r,r.uint32()));continue;case 6:if(a!==50)break;o.listValue=ml.unwrap(ml.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return qe.fromPartial(e??{})},fromPartial(e){let t=bv();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=bv();if(e===null)t.nullValue=CL.NULL_VALUE;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(y.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new y.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function Rv(){return{values:[]}}var ml={encode(e,t=new je){for(let r of e.values)qe.encode(qe.wrap(r),t.uint32(10).fork()).join();return t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=Rv();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.values.push(qe.unwrap(qe.decode(r,r.uint32())));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return ml.fromPartial(e??{})},fromPartial(e){let t=Rv();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=Rv();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&y.Array.isArray(e.values)?e.values:e}},bL=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 cF(){return{op:0,path:"",from:void 0,value:void 0}}var Tf={encode(e,t=new je){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&&qe.encode(qe.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=cF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.op=r.int32();continue;case 2:if(a!==18)break;o.path=r.string();continue;case 3:if(a!==26)break;o.from=r.string();continue;case 4:if(a!==34)break;o.value=qe.unwrap(qe.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Tf.fromPartial(e??{})},fromPartial(e){let t=cF();return t.op=e.op??0,t.path=e.path??"",t.from=e.from??void 0,t.value=e.value??void 0,t}};function uF(){return{id:"",type:"",function:void 0}}var Pf={encode(e,t=new je){return e.id!==""&&t.uint32(10).string(e.id),e.type!==""&&t.uint32(18).string(e.type),e.function!==void 0&&kf.encode(e.function,t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=uF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.id=r.string();continue;case 2:if(a!==18)break;o.type=r.string();continue;case 3:if(a!==26)break;o.function=kf.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Pf.fromPartial(e??{})},fromPartial(e){let t=uF();return t.id=e.id??"",t.type=e.type??"",t.function=e.function!==void 0&&e.function!==null?kf.fromPartial(e.function):void 0,t}};function lF(){return{name:"",arguments:""}}var kf={encode(e,t=new je){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 me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=lF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.name=r.string();continue;case 2:if(a!==18)break;o.arguments=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return kf.fromPartial(e??{})},fromPartial(e){let t=lF();return t.name=e.name??"",t.arguments=e.arguments??"",t}};function dF(){return{id:"",role:"",content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0}}var Of={encode(e,t=new je){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)Pf.encode(r,t.uint32(42).fork()).join();return e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=dF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.id=r.string();continue;case 2:if(a!==18)break;o.role=r.string();continue;case 3:if(a!==26)break;o.content=r.string();continue;case 4:if(a!==34)break;o.name=r.string();continue;case 5:if(a!==42)break;o.toolCalls.push(Pf.decode(r,r.uint32()));continue;case 6:if(a!==50)break;o.toolCallId=r.string();continue;case 7:if(a!==58)break;o.error=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Of.fromPartial(e??{})},fromPartial(e){let t=dF();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=>Pf.fromPartial(r))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t}},RL=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 pF(){return{type:0,timestamp:void 0,rawEvent:void 0}}var ye={encode(e,t=new je){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&qe.encode(qe.wrap(e.rawEvent),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=pF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.type=r.int32();continue;case 2:if(a!==16)break;o.timestamp=wL(r.int64());continue;case 3:if(a!==26)break;o.rawEvent=qe.unwrap(qe.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return ye.fromPartial(e??{})},fromPartial(e){let t=pF();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function fF(){return{baseEvent:void 0,messageId:"",role:void 0}}var Nf={encode(e,t=new je){return e.baseEvent!==void 0&&ye.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),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=fF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.role=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Nf.fromPartial(e??{})},fromPartial(e){let t=fF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.role=e.role??void 0,t}};function mF(){return{baseEvent:void 0,messageId:"",delta:""}}var _f={encode(e,t=new je){return e.baseEvent!==void 0&&ye.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 me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=mF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return _f.fromPartial(e??{})},fromPartial(e){let t=mF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.delta=e.delta??"",t}};function gF(){return{baseEvent:void 0,messageId:""}}var Df={encode(e,t=new je){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=gF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Df.fromPartial(e??{})},fromPartial(e){let t=gF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t}};function hF(){return{baseEvent:void 0,toolCallId:"",toolCallName:"",parentMessageId:void 0}}var qf={encode(e,t=new je){return e.baseEvent!==void 0&&ye.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 me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=hF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.toolCallName=r.string();continue;case 4:if(a!==34)break;o.parentMessageId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return qf.fromPartial(e??{})},fromPartial(e){let t=hF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.toolCallName=e.toolCallName??"",t.parentMessageId=e.parentMessageId??void 0,t}};function yF(){return{baseEvent:void 0,toolCallId:"",delta:""}}var Mf={encode(e,t=new je){return e.baseEvent!==void 0&&ye.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 me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=yF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Mf.fromPartial(e??{})},fromPartial(e){let t=yF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.delta=e.delta??"",t}};function SF(){return{baseEvent:void 0,toolCallId:""}}var Vf={encode(e,t=new je){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=SF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Vf.fromPartial(e??{})},fromPartial(e){let t=SF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t}};function vF(){return{baseEvent:void 0,snapshot:void 0}}var jf={encode(e,t=new je){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&qe.encode(qe.wrap(e.snapshot),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=vF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.snapshot=qe.unwrap(qe.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return jf.fromPartial(e??{})},fromPartial(e){let t=vF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function xF(){return{baseEvent:void 0,delta:[]}}var Lf={encode(e,t=new je){e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.delta)Tf.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=xF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.delta.push(Tf.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Lf.fromPartial(e??{})},fromPartial(e){let t=xF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(r=>Tf.fromPartial(r))||[],t}};function AF(){return{baseEvent:void 0,messages:[]}}var Uf={encode(e,t=new je){e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.messages)Of.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=AF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messages.push(Of.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Uf.fromPartial(e??{})},fromPartial(e){let t=AF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(r=>Of.fromPartial(r))||[],t}};function CF(){return{baseEvent:void 0,event:void 0,source:void 0}}var Qf={encode(e,t=new je){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&qe.encode(qe.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 me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=CF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.event=qe.unwrap(qe.decode(r,r.uint32()));continue;case 3:if(a!==26)break;o.source=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Qf.fromPartial(e??{})},fromPartial(e){let t=CF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function bF(){return{baseEvent:void 0,name:"",value:void 0}}var Bf={encode(e,t=new je){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==""&&t.uint32(18).string(e.name),e.value!==void 0&&qe.encode(qe.wrap(e.value),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=bF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.name=r.string();continue;case 3:if(a!==26)break;o.value=qe.unwrap(qe.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Bf.fromPartial(e??{})},fromPartial(e){let t=bF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.name=e.name??"",t.value=e.value??void 0,t}};function RF(){return{baseEvent:void 0,threadId:"",runId:""}}var Gf={encode(e,t=new je){return e.baseEvent!==void 0&&ye.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 me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=RF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.threadId=r.string();continue;case 3:if(a!==26)break;o.runId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Gf.fromPartial(e??{})},fromPartial(e){let t=RF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t}};function wF(){return{baseEvent:void 0,threadId:"",runId:"",result:void 0}}var $f={encode(e,t=new je){return e.baseEvent!==void 0&&ye.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&&qe.encode(qe.wrap(e.result),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=wF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.threadId=r.string();continue;case 3:if(a!==26)break;o.runId=r.string();continue;case 4:if(a!==34)break;o.result=qe.unwrap(qe.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return $f.fromPartial(e??{})},fromPartial(e){let t=wF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t.result=e.result??void 0,t}};function FF(){return{baseEvent:void 0,code:void 0,message:""}}var Hf={encode(e,t=new je){return e.baseEvent!==void 0&&ye.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 me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=FF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.code=r.string();continue;case 3:if(a!==26)break;o.message=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Hf.fromPartial(e??{})},fromPartial(e){let t=FF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??"",t}};function EF(){return{baseEvent:void 0,stepName:""}}var zf={encode(e,t=new je){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=EF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.stepName=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return zf.fromPartial(e??{})},fromPartial(e){let t=EF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function IF(){return{baseEvent:void 0,stepName:""}}var Wf={encode(e,t=new je){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=IF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.stepName=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Wf.fromPartial(e??{})},fromPartial(e){let t=IF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function TF(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0}}var Kf={encode(e,t=new je){return e.baseEvent!==void 0&&ye.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),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=TF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.role=r.string();continue;case 4:if(a!==34)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Kf.fromPartial(e??{})},fromPartial(e){let t=TF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t}};function PF(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var Yf={encode(e,t=new je){return e.baseEvent!==void 0&&ye.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 me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=PF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.toolCallName=r.string();continue;case 4:if(a!==34)break;o.parentMessageId=r.string();continue;case 5:if(a!==42)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Yf.fromPartial(e??{})},fromPartial(e){let t=PF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.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 kF(){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 OF={encode(e,t=new je){return e.textMessageStart!==void 0&&Nf.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&_f.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&Df.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&qf.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&Mf.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&Vf.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&jf.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&Lf.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&Uf.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&Qf.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&Bf.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&Gf.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&$f.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&Hf.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&zf.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&Wf.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&Kf.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&Yf.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=kF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.textMessageStart=Nf.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.textMessageContent=_f.decode(r,r.uint32());continue;case 3:if(a!==26)break;o.textMessageEnd=Df.decode(r,r.uint32());continue;case 4:if(a!==34)break;o.toolCallStart=qf.decode(r,r.uint32());continue;case 5:if(a!==42)break;o.toolCallArgs=Mf.decode(r,r.uint32());continue;case 6:if(a!==50)break;o.toolCallEnd=Vf.decode(r,r.uint32());continue;case 7:if(a!==58)break;o.stateSnapshot=jf.decode(r,r.uint32());continue;case 8:if(a!==66)break;o.stateDelta=Lf.decode(r,r.uint32());continue;case 9:if(a!==74)break;o.messagesSnapshot=Uf.decode(r,r.uint32());continue;case 10:if(a!==82)break;o.raw=Qf.decode(r,r.uint32());continue;case 11:if(a!==90)break;o.custom=Bf.decode(r,r.uint32());continue;case 12:if(a!==98)break;o.runStarted=Gf.decode(r,r.uint32());continue;case 13:if(a!==106)break;o.runFinished=$f.decode(r,r.uint32());continue;case 14:if(a!==114)break;o.runError=Hf.decode(r,r.uint32());continue;case 15:if(a!==122)break;o.stepStarted=zf.decode(r,r.uint32());continue;case 16:if(a!==130)break;o.stepFinished=Wf.decode(r,r.uint32());continue;case 17:if(a!==138)break;o.textMessageChunk=Kf.decode(r,r.uint32());continue;case 18:if(a!==146)break;o.toolCallChunk=Yf.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return OF.fromPartial(e??{})},fromPartial(e){let t=kF();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?Nf.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?_f.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?Df.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?qf.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?Mf.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?Vf.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?jf.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?Lf.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?Uf.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?Qf.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?Bf.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?Gf.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?$f.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?Hf.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?zf.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?Wf.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?Kf.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?Yf.fromPartial(e.toolCallChunk):void 0,t}};function wL(e){let t=y.Number(e.toString());if(t>y.Number.MAX_SAFE_INTEGER)throw new y.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(t<y.Number.MIN_SAFE_INTEGER)throw new y.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return t}function NF(e){let t=OF.decode(e),r=Object.values(t).find(n=>n!==void 0);if(!r)throw new Error("Invalid event");if(r.type=RL[r.baseEvent.type],r.timestamp=r.baseEvent.timestamp,r.rawEvent=r.baseEvent.rawEvent,r.type===D.MESSAGES_SNAPSHOT)for(let n of r.messages){let o=n;o.toolCalls?.length===0&&(o.toolCalls=void 0)}if(r.type===D.STATE_DELTA)for(let n of r.delta)n.op=bL[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]}),Wp.parse(r)}var _F="application/vnd.ag-ui.event+proto";d();c();l();u();d();c();l();u();d();c();l();u();var EL=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Fv=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(EL);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},DF=e=>e==="*"||e==="x"||e==="X",qF=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},IL=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],TL=(e,t)=>{if(DF(e)||DF(t))return 0;let[r,n]=IL(qF(e),qF(t));return r>n?1:r<n?-1:0},Ev=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=TL(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var Jf=(e,t)=>{let r=Fv(e),n=Fv(t),o=r.pop(),a=n.pop(),i=Ev(r,n);return i!==0?i:o&&a?Ev(o.split("."),a.split(".")):o||a?o?-1:1:0};var Ge=e=>{if(typeof structuredClone=="function")return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return{...e}}};function gl(){return Io()}function Qe(_x130,_x131,_x132,_x133){return _Qe.apply(this,arguments)}function _Qe(){_Qe=_asyncToGenerator(function*(e,t,r,n){let o=t,a=r,i;for(let p of e)try{let f=yield n(p,Ge(o),Ge(a));if(f===void 0)continue;if(f.messages!==void 0&&(o=f.messages),f.state!==void 0&&(a=f.state),i=f.stopPropagation,i===!0)break}catch(f){process.env.VITEST_WORKER_ID!==void 0||console.error("Subscriber error:",f);continue}return{...(JSON.stringify(o)===JSON.stringify(t)?{}:{messages:o}),...(JSON.stringify(a)===JSON.stringify(r)?{}:{state:a}),...(i===void 0?{}:{stopPropagation:i})}});return _Qe.apply(this,arguments)}var QF=(e,t,r,n)=>{let o=Ge(r.messages),a=Ge(e.state),i={},p=m=>{m.messages!==void 0&&(o=m.messages,i.messages=m.messages),m.state!==void 0&&(a=m.state,i.state=m.state)},f=()=>{let m=Ge(i);return i={},m.messages!==void 0||m.state!==void 0?tt(m):lf};return t.pipe(Rf(/*#__PURE__*/function(){var _ref54=_asyncToGenerator(function*(m){let g=yield Qe(n,o,a,(S,A,h)=>S.onEvent?.({event:m,agent:r,input:e,messages:A,state:h}));if(p(g),g.stopPropagation===!0)return f();switch(m.type){case D.TEXT_MESSAGE_START:{let S=yield Qe(n,o,a,(A,h,C)=>A.onTextMessageStartEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{messageId:A,role:h="assistant"}=m;if(!o.find(C=>C.id===A)){let C={id:A,role:h,content:""};o.push(C),p({messages:o})}}return f()}case D.TEXT_MESSAGE_CONTENT:{let{messageId:S,delta:A}=m,h=o.find(w=>w.id===S);if(!h)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${S}'`),f();let C=yield Qe(n,o,a,(w,R,b)=>w.onTextMessageContentEvent?.({event:m,messages:R,state:b,agent:r,input:e,textMessageBuffer:typeof h.content=="string"?h.content:""}));return p(C),C.stopPropagation!==!0&&(h.content=`${typeof h.content=="string"?h.content:""}${A}`,p({messages:o})),f()}case D.TEXT_MESSAGE_END:{let{messageId:S}=m,A=o.find(h=>h.id===S);return A?(p(yield Qe(n,o,a,(h,C,w)=>h.onTextMessageEndEvent?.({event:m,messages:C,state:w,agent:r,input:e,textMessageBuffer:typeof A.content=="string"?A.content:""}))),yield Promise.all(n.map(h=>{h.onNewMessage?.({message:A,messages:o,state:a,agent:r,input:e})})),f()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${S}'`),f())}case D.TOOL_CALL_START:{let S=yield Qe(n,o,a,(A,h,C)=>A.onToolCallStartEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{toolCallId:A,toolCallName:h,parentMessageId:C}=m,w;C&&o.length>0&&o[o.length-1].id===C?w=o[o.length-1]:(w={id:C||A,role:"assistant",toolCalls:[]},o.push(w)),w.toolCalls??(w.toolCalls=[]),w.toolCalls.push({id:A,type:"function",function:{name:h,arguments:""}}),p({messages:o})}return f()}case D.TOOL_CALL_ARGS:{let{toolCallId:S,delta:A}=m,h=o.find(R=>R.toolCalls?.some(b=>b.id===S));if(!h)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${S}'`),f();let C=h.toolCalls?.find(R=>R.id===S);if(!C)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${S}'`),f();let w=yield Qe(n,o,a,(R,b,F)=>{let E=C.function.arguments,P=C.function.name,j={};try{j=Ff(E)}catch{}return R.onToolCallArgsEvent?.({event:m,messages:b,state:F,agent:r,input:e,toolCallBuffer:E,toolCallName:P,partialToolCallArgs:j})});return p(w),w.stopPropagation!==!0&&(C.function.arguments+=A,p({messages:o})),f()}case D.TOOL_CALL_END:{let{toolCallId:S}=m,A=o.find(C=>C.toolCalls?.some(w=>w.id===S));if(!A)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${S}'`),f();let h=A.toolCalls?.find(C=>C.id===S);return h?(p(yield Qe(n,o,a,(C,w,R)=>{let b=h.function.arguments,F=h.function.name,E={};try{E=JSON.parse(b)}catch{}return C.onToolCallEndEvent?.({event:m,messages:w,state:R,agent:r,input:e,toolCallName:F,toolCallArgs:E})})),yield Promise.all(n.map(C=>{C.onNewToolCall?.({toolCall:h,messages:o,state:a,agent:r,input:e})})),f()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${S}'`),f())}case D.TOOL_CALL_RESULT:{let S=yield Qe(n,o,a,(A,h,C)=>A.onToolCallResultEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{messageId:A,toolCallId:h,content:C,role:w}=m,R={id:A,toolCallId:h,role:w||"tool",content:C};o.push(R),yield Promise.all(n.map(b=>{b.onNewMessage?.({message:R,messages:o,state:a,agent:r,input:e})})),p({messages:o})}return f()}case D.STATE_SNAPSHOT:{let S=yield Qe(n,o,a,(A,h,C)=>A.onStateSnapshotEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{snapshot:A}=m;a=A,p({state:a})}return f()}case D.STATE_DELTA:{let S=yield Qe(n,o,a,(A,h,C)=>A.onStateDeltaEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{delta:A}=m;try{a=No(a,A,!0,!1).newDocument,p({state:a})}catch(h){let C=h instanceof Error?h.message:String(h);console.warn(`Failed to apply state patch:
|
|
34
|
+
`):"",this.name="UnsubscriptionError",this.errors=r}});d();c();l();u();function ll(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ws=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,a;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var p=Hn(i),f=p.next();!f.done;f=p.next()){var m=f.value;m.remove(this)}}catch(w){t={error:w}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}else i.remove(this);var h=this.initialTeardown;if(Pe(h))try{h()}catch(w){a=w instanceof cf?w.errors:[w]}var S=this._finalizers;if(S){this._finalizers=null;try{for(var v=Hn(S),g=v.next();!g.done;g=v.next()){var C=g.value;try{Bw(C)}catch(w){a=a??[],w instanceof cf?a=Hs(Hs([],$s(a)),$s(w.errors)):a.push(w)}}}catch(w){n={error:w}}finally{try{g&&!g.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}if(a)throw new cf(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Bw(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)&&ll(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&ll(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var fv=Ws.EMPTY;function uf(e){return e instanceof Ws||e&&"closed"in e&&Pe(e.remove)&&Pe(e.add)&&Pe(e.unsubscribe)}function Bw(e){Pe(e)?e():e.unsubscribe()}d();c();l();u();var Mr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};d();c();l();u();d();c();l();u();var Ks={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Ks.delegate;return o?.setTimeout?o.setTimeout.apply(o,Hs([e,t],$s(r))):setTimeout.apply(void 0,Hs([e,t],$s(r)))},clearTimeout:function(e){var t=Ks.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function lf(e){Ks.setTimeout(function(){var t=Mr.onUnhandledError;if(t)t(e);else throw e})}d();c();l();u();function dl(){}d();c();l();u();var Gw=function(){return mv("C",void 0,void 0)}();function $w(e){return mv("E",void 0,e)}function Hw(e){return mv("N",e,void 0)}function mv(e,t,r){return{kind:e,value:t,error:r}}d();c();l();u();var Ba=null;function Ys(e){if(Mr.useDeprecatedSynchronousErrorHandling){var t=!Ba;if(t&&(Ba={errorThrown:!1,error:null}),e(),t){var r=Ba,n=r.errorThrown,o=r.error;if(Ba=null,n)throw o}}else e()}function zw(e){Mr.useDeprecatedSynchronousErrorHandling&&Ba&&(Ba.errorThrown=!0,Ba.error=e)}var pl=function(e){on(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,uf(r)&&r.add(n)):n.destination=tL,n}return t.create=function(r,n,o){return new pf(r,n,o)},t.prototype.next=function(r){this.isStopped?hv(Hw(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?hv($w(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?hv(Gw,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}(Ws);var XV=Function.prototype.bind;function gv(e,t){return XV.call(e,t)}var ZV=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){df(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){df(n)}else df(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){df(r)}},e}(),pf=function(e){on(t,e);function t(r,n,o){var a=e.call(this)||this,i;if(Pe(r)||!r)i={next:r??void 0,error:n??void 0,complete:o??void 0};else{var p;a&&Mr.useDeprecatedNextContext?(p=Object.create(r),p.unsubscribe=function(){return a.unsubscribe()},i={next:r.next&&gv(r.next,p),error:r.error&&gv(r.error,p),complete:r.complete&&gv(r.complete,p)}):i=r}return a.destination=new ZV(i),a}return t}(pl);function df(e){Mr.useDeprecatedSynchronousErrorHandling?zw(e):lf(e)}function eL(e){throw e}function hv(e,t){var r=Mr.onStoppedNotification;r&&Ks.setTimeout(function(){return r(e,t)})}var tL={closed:!0,next:dl,error:eL,complete:dl};d();c();l();u();var Js=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();d();c();l();u();d();c();l();u();function Xs(e){return e}function ff(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return yv(e)}function yv(e){return e.length===0?Xs:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var We=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,a=nL(t)?t:new pf(t,r,n);return Ys(function(){var i=o,p=i.operator,f=i.source;a.add(p?p.call(a,f):f?o._subscribe(a):o._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=Ww(r),new r(function(o,a){var i=new pf({next:function(p){try{t(p)}catch(f){a(f),i.unsubscribe()}},error:a,complete:o});n.subscribe(i)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[Js]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return yv(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Ww(t),new t(function(n,o){var a;r.subscribe(function(i){return a=i},function(i){return o(i)},function(){return n(a)})})},e.create=function(t){return new e(t)},e}();function Ww(e){var t;return(t=e??Mr.Promise)!==null&&t!==void 0?t:Promise}function rL(e){return e&&Pe(e.next)&&Pe(e.error)&&Pe(e.complete)}function nL(e){return e&&e instanceof pl||rL(e)&&uf(e)}d();c();l();u();function oL(e){return Pe(e?.lift)}function ft(e){return function(t){if(oL(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}d();c();l();u();function yt(e,t,r,n,o){return new aL(e,t,r,n,o)}var aL=function(e){on(t,e);function t(r,n,o,a,i,p){var f=e.call(this,r)||this;return f.onFinalize=i,f.shouldUnsubscribe=p,f._next=n?function(m){try{n(m)}catch(h){r.error(h)}}:e.prototype._next,f._error=a?function(m){try{a(m)}catch(h){r.error(h)}finally{this.unsubscribe()}}:e.prototype._error,f._complete=o?function(){try{o()}catch(m){r.error(m)}finally{this.unsubscribe()}}:e.prototype._complete,f}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t}(pl);d();c();l();u();d();c();l();u();var Kw=zs(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var an=function(e){on(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 Yw(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Kw},t.prototype.next=function(r){var n=this;Ys(function(){var o,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var i=Hn(n.currentObservers),p=i.next();!p.done;p=i.next()){var f=p.value;f.next(r)}}catch(m){o={error:m}}finally{try{p&&!p.done&&(a=i.return)&&a.call(i)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;Ys(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;Ys(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,a=o.hasError,i=o.isStopped,p=o.observers;return a||i?fv:(this.currentObservers=null,p.push(r),new Ws(function(){n.currentObservers=null,ll(p,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,a=n.thrownError,i=n.isStopped;o?r.error(a):i&&r.complete()},t.prototype.asObservable=function(){var r=new We;return r.source=this,r},t.create=function(r,n){return new Yw(r,n)},t}(We);var Yw=function(e){on(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:fv},t}(an);d();c();l();u();d();c();l();u();var Sv={now:function(){return(Sv.delegate||Date).now()},delegate:void 0};var mf=function(e){on(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=Sv);var a=e.call(this)||this;return a._bufferSize=r,a._windowTime=n,a._timestampProvider=o,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=n===1/0,a._bufferSize=Math.max(1,r),a._windowTime=Math.max(1,n),a}return t.prototype.next=function(r){var n=this,o=n.isStopped,a=n._buffer,i=n._infiniteTimeWindow,p=n._timestampProvider,f=n._windowTime;o||(a.push(r),!i&&a.push(p.now()+f)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,a=o._infiniteTimeWindow,i=o._buffer,p=i.slice(),f=0;f<p.length&&!r.closed;f+=a?1:2)r.next(p[f]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,a=r._buffer,i=r._infiniteTimeWindow,p=(i?1:2)*n;if(n<1/0&&p<a.length&&a.splice(0,a.length-p),!i){for(var f=o.now(),m=0,h=1;h<a.length&&a[h]<=f;h+=2)m=h;m&&a.splice(0,m+1)}},t}(an);d();c();l();u();var gf=new We(function(e){return e.complete()});d();c();l();u();d();c();l();u();d();c();l();u();function Jw(e){return e&&Pe(e.schedule)}function iL(e){return e[e.length-1]}function Xw(e){return Jw(iL(e))?e.pop():void 0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var hf=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};d();c();l();u();function yf(e){return Pe(e?.then)}d();c();l();u();function Sf(e){return Pe(e[Js])}d();c();l();u();function vf(e){return Symbol.asyncIterator&&Pe(e?.[Symbol.asyncIterator])}d();c();l();u();function xf(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}d();c();l();u();d();c();l();u();function sL(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Af=sL();function Cf(e){return Pe(e?.[Af])}d();c();l();u();function bf(e){return Uw(this,arguments,function(){var r,n,o,a;return sf(this,function(i){switch(i.label){case 0:r=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,Qa(r.read())];case 3:return n=i.sent(),o=n.value,a=n.done,a?[4,Qa(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,Qa(o)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Rf(e){return Pe(e?.getReader)}function St(e){if(e instanceof We)return e;if(e!=null){if(Sf(e))return cL(e);if(hf(e))return uL(e);if(yf(e))return lL(e);if(vf(e))return Zw(e);if(Cf(e))return dL(e);if(Rf(e))return pL(e)}throw xf(e)}function cL(e){return new We(function(t){var r=e[Js]();if(Pe(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function uL(e){return new We(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function lL(e){return new We(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,lf)})}function dL(e){return new We(function(t){var r,n;try{for(var o=Hn(e),a=o.next();!a.done;a=o.next()){var i=a.value;if(t.next(i),t.closed)return}}catch(p){r={error:p}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function Zw(e){return new We(function(t){fL(e,t).catch(function(r){return t.error(r)})})}function pL(e){return Zw(bf(e))}function fL(e,t){var r,n,o,a;return Lw(this,void 0,void 0,function(){var i,p;return sf(this,function(f){switch(f.label){case 0:f.trys.push([0,5,6,11]),r=Qw(e),f.label=1;case 1:return[4,r.next()];case 2:if(n=f.sent(),!!n.done)return[3,4];if(i=n.value,t.next(i),t.closed)return[2];f.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return p=f.sent(),o={error:p},[3,11];case 6:return f.trys.push([6,,9,10]),n&&!n.done&&(a=r.return)?[4,a.call(r)]:[3,8];case 7:f.sent(),f.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}d();c();l();u();d();c();l();u();function br(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var a=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(a),!o)return a}function wf(e,t){return t===void 0&&(t=0),ft(function(r,n){r.subscribe(yt(n,function(o){return br(n,e,function(){return n.next(o)},t)},function(){return br(n,e,function(){return n.complete()},t)},function(o){return br(n,e,function(){return n.error(o)},t)}))})}d();c();l();u();function Ff(e,t){return t===void 0&&(t=0),ft(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function eF(e,t){return St(e).pipe(Ff(t),wf(t))}d();c();l();u();function tF(e,t){return St(e).pipe(Ff(t),wf(t))}d();c();l();u();function rF(e,t){return new We(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}d();c();l();u();function nF(e,t){return new We(function(r){var n;return br(r,t,function(){n=e[Af](),br(r,t,function(){var o,a,i;try{o=n.next(),a=o.value,i=o.done}catch(p){r.error(p);return}i?r.complete():r.next(a)},0,!0)}),function(){return Pe(n?.return)&&n.return()}})}d();c();l();u();function Ef(e,t){if(!e)throw new Error("Iterable cannot be null");return new We(function(r){br(r,t,function(){var n=e[Symbol.asyncIterator]();br(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}d();c();l();u();function oF(e,t){return Ef(bf(e),t)}function aF(e,t){if(e!=null){if(Sf(e))return eF(e,t);if(hf(e))return rF(e,t);if(yf(e))return tF(e,t);if(vf(e))return Ef(e,t);if(Cf(e))return nF(e,t);if(Rf(e))return oF(e,t)}throw xf(e)}function Ga(e,t){return t?aF(e,t):St(e)}function tt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Xw(e);return Ga(e,r)}d();c();l();u();function Ke(e,t){var r=Pe(e)?e:function(){return e},n=function(o){return o.error(r())};return new We(t?function(o){return t.schedule(n,0,o)}:n)}d();c();l();u();d();c();l();u();var iF=zs(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function If(e,t){var r=typeof t=="object";return new Promise(function(n,o){var a=!1,i;e.subscribe({next:function(p){i=p,a=!0},error:o,complete:function(){a?n(i):r?n(t.defaultValue):o(new iF)}})})}d();c();l();u();function $a(e,t){return ft(function(r,n){var o=0;r.subscribe(yt(n,function(a){n.next(e.call(t,a,o++))}))})}d();c();l();u();d();c();l();u();d();c();l();u();function sF(e,t,r,n,o,a,i,p){var f=[],m=0,h=0,S=!1,v=function(){S&&!f.length&&!m&&t.complete()},g=function(w){return m<n?C(w):f.push(w)},C=function(w){a&&t.next(w),m++;var R=!1;St(r(w,h++)).subscribe(yt(t,function(b){o?.(b),a?g(b):t.next(b)},function(){R=!0},void 0,function(){if(R)try{m--;for(var b=function(){var F=f.shift();i?br(t,i,function(){return C(F)}):C(F)};f.length&&m<n;)b();v()}catch(F){t.error(F)}}))};return e.subscribe(yt(t,g,function(){S=!0,v()})),function(){p?.()}}function Zt(e,t,r){return r===void 0&&(r=1/0),Pe(t)?Zt(function(n,o){return $a(function(a,i){return t(n,a,o,i)})(St(e(n,o)))},r):(typeof t=="number"&&(r=t),ft(function(n,o){return sF(n,o,e,r)}))}function vv(e){return e===void 0&&(e=1/0),Zt(Xs,e)}d();c();l();u();function xv(e){return new We(function(t){St(e()).subscribe(t)})}d();c();l();u();function fl(e){return ft(function(t,r){var n=null,o=!1,a;n=t.subscribe(yt(r,void 0,void 0,function(i){a=St(e(i,fl(e)(t))),n?(n.unsubscribe(),n=null,a.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,a.subscribe(r))})}d();c();l();u();function Tf(e,t){return Pe(t)?Zt(e,t,1):Zt(e,1)}d();c();l();u();function Av(e){return ft(function(t,r){var n=!1;t.subscribe(yt(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}d();c();l();u();function Ha(e){return ft(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}d();c();l();u();function Cv(e,t){return ft(function(r,n){var o=null,a=0,i=!1,p=function(){return i&&!o&&n.complete()};r.subscribe(yt(n,function(f){o?.unsubscribe();var m=0,h=a++;St(e(f,h)).subscribe(o=yt(n,function(S){return n.next(t?t(f,S,h,m++):S)},function(){o=null,p()}))},function(){i=!0,p()}))})}d();c();l();u();function Pf(e){return ft(function(t,r){St(e).subscribe(yt(r,function(){return r.complete()},dl)),!r.closed&&t.subscribe(r)})}d();c();l();u();function bv(e,t,r){var n=Pe(e)||t||r?{next:e,error:t,complete:r}:e;return n?ft(function(o,a){var i;(i=n.subscribe)===null||i===void 0||i.call(n);var p=!0;o.subscribe(yt(a,function(f){var m;(m=n.next)===null||m===void 0||m.call(n,f),a.next(f)},function(){var f;p=!1,(f=n.complete)===null||f===void 0||f.call(n),a.complete()},function(f){var m;p=!1,(m=n.error)===null||m===void 0||m.call(n,f),a.error(f)},function(){var f,m;p&&((f=n.unsubscribe)===null||f===void 0||f.call(n)),(m=n.finalize)===null||m===void 0||m.call(n)}))}):Xs}d();c();l();u();d();c();l();u();function cF(e){return` \r
|
|
35
|
+
`.indexOf(e)>=0}function kf(e){for(var t=["topLevel"],r=0,n,o,a,i=function(F){return t.push(F)},p=function(F){return t[t.length-1]=F},f=function(F){n==null&&(n=r,o=t.length,a=F)},m=function(F){F===a&&(n=void 0,o=void 0,a=void 0)},h=function(){return t.pop()},S=function(){return r--},v=function(F){if("0"<=F&&F<="9"){i("number");return}switch(F){case"\"":i("string");return;case"-":i("numberNeedsDigit");return;case"t":i("true");return;case"f":i("false");return;case"n":i("null");return;case"[":i("arrayNeedsValue");return;case"{":i("objectNeedsKey");return}},g=e.length;r<g;r++){var C=e[r];switch(t[t.length-1]){case"topLevel":v(C);break;case"string":switch(C){case"\"":h();break;case"\\":f("stringEscape"),i("stringEscaped");break}break;case"stringEscaped":C==="u"?i("stringUnicode"):(m("stringEscape"),h());break;case"stringUnicode":r-e.lastIndexOf("u",r)===4&&(m("stringEscape"),h());break;case"number":C==="."?p("numberNeedsDigit"):C==="e"||C==="E"?p("numberNeedsExponent"):(C<"0"||C>"9")&&(S(),h());break;case"numberNeedsDigit":p("number");break;case"numberNeedsExponent":p(C==="+"||C==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(C<"a"||C>"z")&&(S(),h());break;case"arrayNeedsValue":C==="]"?h():cF(C)||(m("collectionItem"),p("arrayNeedsComma"),v(C));break;case"arrayNeedsComma":C==="]"?h():C===","&&(f("collectionItem"),p("arrayNeedsValue"));break;case"objectNeedsKey":C==="}"?h():C==="\""&&(f("collectionItem"),p("objectNeedsColon"),i("string"));break;case"objectNeedsColon":C===":"&&p("objectNeedsValue");break;case"objectNeedsValue":cF(C)||(m("collectionItem"),p("objectNeedsComma"),v(C));break;case"objectNeedsComma":C==="}"?h():C===","&&(f("collectionItem"),p("objectNeedsKey"));break}}o!=null&&(t.length=o);for(var w=[n!=null?e.slice(0,n):e],R=function(F){return w.push(F.slice(e.length-e.lastIndexOf(F[0])))},b=t.length-1;b>=0;b--)switch(t[b]){case"string":w.push("\"");break;case"numberNeedsDigit":case"numberNeedsExponent":w.push("0");break;case"true":R("true");break;case"false":R("false");break;case"null":R("null");break;case"arrayNeedsValue":case"arrayNeedsComma":w.push("]");break;case"objectNeedsKey":case"objectNeedsColon":case"objectNeedsValue":case"objectNeedsComma":w.push("}");break}return w.join("")}d();c();l();u();d();c();l();u();d();c();l();u();function lF(){let e=0,t=0;for(let n=0;n<28;n+=7){let o=this.buf[this.pos++];if(e|=(o&127)<<n,(o&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let o=this.buf[this.pos++];if(t|=(o&127)<<n,(o&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function Nf(e,t,r){for(let a=0;a<28;a=a+7){let i=e>>>a,p=!(!(i>>>7)&&t==0),f=(p?i|128:i)&255;if(r.push(f),!p)return}let n=e>>>28&15|(t&7)<<4,o=t>>3!=0;if(r.push((o?n|128:n)&255),!!o){for(let a=3;a<31;a=a+7){let i=t>>>a,p=!!(i>>>7),f=(p?i|128:i)&255;if(r.push(f),!p)return}r.push(t>>>31&1)}}var Of=4294967296;function Rv(e){let t=e[0]==="-";t&&(e=e.slice(1));let r=1e6,n=0,o=0;function a(i,p){let f=Number(e.slice(i,p));o*=r,n=n*r+f,n>=Of&&(o=o+(n/Of|0),n=n%Of)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?pF(n,o):Fv(n,o)}function dF(e,t){let r=Fv(e,t),n=r.hi&2147483648;n&&(r=pF(r.lo,r.hi));let o=wv(r.lo,r.hi);return n?"-"+o:o}function wv(e,t){if({lo:e,hi:t}=mL(e,t),t<=2097151)return String(Of*t+e);let r=e&16777215,n=(e>>>24|t<<8)&16777215,o=t>>16&65535,a=r+n*6777216+o*6710656,i=n+o*8147497,p=o*2,f=1e7;return a>=f&&(i+=Math.floor(a/f),a%=f),i>=f&&(p+=Math.floor(i/f),i%=f),p.toString()+uF(i)+uF(a)}function mL(e,t){return{lo:e>>>0,hi:t>>>0}}function Fv(e,t){return{lo:e|0,hi:t|0}}function pF(e,t){return t=~t,e?e=~e+1:t+=1,Fv(e,t)}var uF=e=>{let t=String(e);return"0000000".slice(t.length)+t};function Ev(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function fF(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}d();c();l();u();var jr=gL();function gL(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!y.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let r=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),o=BigInt("0"),a=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(i){let p=typeof i=="bigint"?i:BigInt(i);if(p>n||p<r)throw new Error(`invalid int64: ${i}`);return p},uParse(i){let p=typeof i=="bigint"?i:BigInt(i);if(p>a||p<o)throw new Error(`invalid uint64: ${i}`);return p},enc(i){return e.setBigInt64(0,this.parse(i),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(i){return e.setBigInt64(0,this.uParse(i),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(i,p){return e.setInt32(0,i,!0),e.setInt32(4,p,!0),e.getBigInt64(0,!0)},uDec(i,p){return e.setInt32(0,i,!0),e.setInt32(4,p,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),mF(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),gF(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),mF(r),Rv(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),gF(r),Rv(r)},dec(r,n){return dF(r,n)},uDec(r,n){return wv(r,n)}}}function mF(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function gF(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}d();c();l();u();var Iv=Symbol.for("@bufbuild/protobuf/text-encoding");function Tv(){if(y[Iv]==null){let e=new y.TextEncoder,t=new y.TextDecoder;y[Iv]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return y[Iv]}var _o;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(_o||(_o={}));var hL=34028234663852886e22,yL=-34028234663852886e22,SL=4294967295,vL=2147483647,xL=-2147483648,Ve=class{constructor(t=Tv().encodeUtf8){this.encodeUtf8=t,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let t=0;for(let o=0;o<this.chunks.length;o++)t+=this.chunks[o].length;let r=new Uint8Array(t),n=0;for(let o=0;o<this.chunks.length;o++)r.set(this.chunks[o],n),n+=this.chunks[o].length;return this.chunks=[],r}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),r=this.stack.pop();if(!r)throw new Error("invalid state, fork stack empty");return this.chunks=r.chunks,this.buf=r.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,r){return this.uint32((t<<3|r)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(hF(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return Pv(t),Ev(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let r=this.encodeUtf8(t);return this.uint32(r.byteLength),this.raw(r)}float(t){AL(t);let r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,t,!0),this.raw(r)}double(t){let r=new Uint8Array(8);return new DataView(r.buffer).setFloat64(0,t,!0),this.raw(r)}fixed32(t){hF(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){Pv(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return Pv(t),t=(t<<1^t>>31)>>>0,Ev(t,this.buf),this}sfixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),o=jr.enc(t);return n.setInt32(0,o.lo,!0),n.setInt32(4,o.hi,!0),this.raw(r)}fixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),o=jr.uEnc(t);return n.setInt32(0,o.lo,!0),n.setInt32(4,o.hi,!0),this.raw(r)}int64(t){let r=jr.enc(t);return Nf(r.lo,r.hi,this.buf),this}sint64(t){let r=jr.enc(t),n=r.hi>>31,o=r.lo<<1^n,a=(r.hi<<1|r.lo>>>31)^n;return Nf(o,a,this.buf),this}uint64(t){let r=jr.uEnc(t);return Nf(r.lo,r.hi,this.buf),this}},me=class{constructor(t,r=Tv().decodeUtf8){this.decodeUtf8=r,this.varint64=lF,this.uint32=fF,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,n=t&7;if(r<=0||n<0||n>5)throw new Error("illegal tag: field no "+r+" wire type "+n);return[r,n]}skip(t,r){let n=this.pos;switch(t){case _o.Varint:for(;this.buf[this.pos++]&128;);break;case _o.Bit64:this.pos+=4;case _o.Bit32:this.pos+=4;break;case _o.LengthDelimited:let o=this.uint32();this.pos+=o;break;case _o.StartGroup:for(;;){let[a,i]=this.tag();if(i===_o.EndGroup){if(r!==void 0&&a!==r)throw new Error("invalid end group tag");break}this.skip(i,a)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,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 jr.dec(...this.varint64())}uint64(){return jr.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),n=-(t&1);return t=(t>>>1|(r&1)<<31)^n,r=r>>>1^n,jr.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return jr.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return jr.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(){return this.decodeUtf8(this.bytes())}};function Pv(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>vL||e<xL)throw new Error("invalid int32: "+e)}function hF(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>SL||e<0)throw new Error("invalid uint32: "+e)}function AL(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>hL||e<yL))throw new Error("invalid float32: "+e)}var CL=function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function kv(){return{fields:{}}}var ml={encode(e,t=new Ve){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&_v.encode({key:r,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=kv();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:{if(a!==10)break;let i=_v.decode(r,r.uint32());i.value!==void 0&&(o.fields[i.key]=i.value);continue}}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return ml.fromPartial(e??{})},fromPartial(e){let t=kv();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,o])=>(o!==void 0&&(r[n]=o),r),{}),t},wrap(e){let t=kv();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 yF(){return{key:"",value:void 0}}var _v={encode(e,t=new Ve){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&qe.encode(qe.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=yF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.key=r.string();continue;case 2:if(a!==18)break;o.value=qe.unwrap(qe.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return _v.fromPartial(e??{})},fromPartial(e){let t=yF();return t.key=e.key??"",t.value=e.value??void 0,t}};function Ov(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var qe={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&&ml.encode(ml.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&gl.encode(gl.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=Ov();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.nullValue=r.int32();continue;case 2:if(a!==17)break;o.numberValue=r.double();continue;case 3:if(a!==26)break;o.stringValue=r.string();continue;case 4:if(a!==32)break;o.boolValue=r.bool();continue;case 5:if(a!==42)break;o.structValue=ml.unwrap(ml.decode(r,r.uint32()));continue;case 6:if(a!==50)break;o.listValue=gl.unwrap(gl.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return qe.fromPartial(e??{})},fromPartial(e){let t=Ov();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=Ov();if(e===null)t.nullValue=CL.NULL_VALUE;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(y.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new y.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function Nv(){return{values:[]}}var gl={encode(e,t=new Ve){for(let r of e.values)qe.encode(qe.wrap(r),t.uint32(10).fork()).join();return t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=Nv();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.values.push(qe.unwrap(qe.decode(r,r.uint32())));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return gl.fromPartial(e??{})},fromPartial(e){let t=Nv();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=Nv();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&y.Array.isArray(e.values)?e.values:e}},bL=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 SF(){return{op:0,path:"",from:void 0,value:void 0}}var _f={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&&qe.encode(qe.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=SF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.op=r.int32();continue;case 2:if(a!==18)break;o.path=r.string();continue;case 3:if(a!==26)break;o.from=r.string();continue;case 4:if(a!==34)break;o.value=qe.unwrap(qe.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return _f.fromPartial(e??{})},fromPartial(e){let t=SF();return t.op=e.op??0,t.path=e.path??"",t.from=e.from??void 0,t.value=e.value??void 0,t}};function vF(){return{id:"",type:"",function:void 0}}var Df={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&&qf.encode(e.function,t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=vF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.id=r.string();continue;case 2:if(a!==18)break;o.type=r.string();continue;case 3:if(a!==26)break;o.function=qf.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Df.fromPartial(e??{})},fromPartial(e){let t=vF();return t.id=e.id??"",t.type=e.type??"",t.function=e.function!==void 0&&e.function!==null?qf.fromPartial(e.function):void 0,t}};function xF(){return{name:"",arguments:""}}var qf={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 me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=xF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.name=r.string();continue;case 2:if(a!==18)break;o.arguments=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return qf.fromPartial(e??{})},fromPartial(e){let t=xF();return t.name=e.name??"",t.arguments=e.arguments??"",t}};function AF(){return{id:"",role:"",content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0}}var Mf={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)Df.encode(r,t.uint32(42).fork()).join();return e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=AF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.id=r.string();continue;case 2:if(a!==18)break;o.role=r.string();continue;case 3:if(a!==26)break;o.content=r.string();continue;case 4:if(a!==34)break;o.name=r.string();continue;case 5:if(a!==42)break;o.toolCalls.push(Df.decode(r,r.uint32()));continue;case 6:if(a!==50)break;o.toolCallId=r.string();continue;case 7:if(a!==58)break;o.error=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Mf.fromPartial(e??{})},fromPartial(e){let t=AF();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=>Df.fromPartial(r))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t}},RL=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 CF(){return{type:0,timestamp:void 0,rawEvent:void 0}}var ye={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&&qe.encode(qe.wrap(e.rawEvent),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=CF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==8)break;o.type=r.int32();continue;case 2:if(a!==16)break;o.timestamp=wL(r.int64());continue;case 3:if(a!==26)break;o.rawEvent=qe.unwrap(qe.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return ye.fromPartial(e??{})},fromPartial(e){let t=CF();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function bF(){return{baseEvent:void 0,messageId:"",role:void 0}}var jf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.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),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=bF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.role=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return jf.fromPartial(e??{})},fromPartial(e){let t=bF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.role=e.role??void 0,t}};function RF(){return{baseEvent:void 0,messageId:"",delta:""}}var Vf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.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 me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=RF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Vf.fromPartial(e??{})},fromPartial(e){let t=RF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.delta=e.delta??"",t}};function wF(){return{baseEvent:void 0,messageId:""}}var Lf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=wF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Lf.fromPartial(e??{})},fromPartial(e){let t=wF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t}};function FF(){return{baseEvent:void 0,toolCallId:"",toolCallName:"",parentMessageId:void 0}}var Uf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.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 me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=FF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.toolCallName=r.string();continue;case 4:if(a!==34)break;o.parentMessageId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Uf.fromPartial(e??{})},fromPartial(e){let t=FF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.toolCallName=e.toolCallName??"",t.parentMessageId=e.parentMessageId??void 0,t}};function EF(){return{baseEvent:void 0,toolCallId:"",delta:""}}var Qf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.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 me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=EF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Qf.fromPartial(e??{})},fromPartial(e){let t=EF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.delta=e.delta??"",t}};function IF(){return{baseEvent:void 0,toolCallId:""}}var Bf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=IF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Bf.fromPartial(e??{})},fromPartial(e){let t=IF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t}};function TF(){return{baseEvent:void 0,snapshot:void 0}}var Gf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&qe.encode(qe.wrap(e.snapshot),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=TF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.snapshot=qe.unwrap(qe.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Gf.fromPartial(e??{})},fromPartial(e){let t=TF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function PF(){return{baseEvent:void 0,delta:[]}}var $f={encode(e,t=new Ve){e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.delta)_f.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=PF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.delta.push(_f.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return $f.fromPartial(e??{})},fromPartial(e){let t=PF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(r=>_f.fromPartial(r))||[],t}};function kF(){return{baseEvent:void 0,messages:[]}}var Hf={encode(e,t=new Ve){e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.messages)Mf.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=kF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messages.push(Mf.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Hf.fromPartial(e??{})},fromPartial(e){let t=kF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(r=>Mf.fromPartial(r))||[],t}};function OF(){return{baseEvent:void 0,event:void 0,source:void 0}}var zf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&qe.encode(qe.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 me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=OF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.event=qe.unwrap(qe.decode(r,r.uint32()));continue;case 3:if(a!==26)break;o.source=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return zf.fromPartial(e??{})},fromPartial(e){let t=OF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function NF(){return{baseEvent:void 0,name:"",value:void 0}}var Wf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==""&&t.uint32(18).string(e.name),e.value!==void 0&&qe.encode(qe.wrap(e.value),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=NF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.name=r.string();continue;case 3:if(a!==26)break;o.value=qe.unwrap(qe.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Wf.fromPartial(e??{})},fromPartial(e){let t=NF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.name=e.name??"",t.value=e.value??void 0,t}};function _F(){return{baseEvent:void 0,threadId:"",runId:""}}var Kf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.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 me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=_F();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.threadId=r.string();continue;case 3:if(a!==26)break;o.runId=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Kf.fromPartial(e??{})},fromPartial(e){let t=_F();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t}};function DF(){return{baseEvent:void 0,threadId:"",runId:"",result:void 0}}var Yf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.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&&qe.encode(qe.wrap(e.result),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=DF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.threadId=r.string();continue;case 3:if(a!==26)break;o.runId=r.string();continue;case 4:if(a!==34)break;o.result=qe.unwrap(qe.decode(r,r.uint32()));continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Yf.fromPartial(e??{})},fromPartial(e){let t=DF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t.result=e.result??void 0,t}};function qF(){return{baseEvent:void 0,code:void 0,message:""}}var Jf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.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 me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=qF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.code=r.string();continue;case 3:if(a!==26)break;o.message=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Jf.fromPartial(e??{})},fromPartial(e){let t=qF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??"",t}};function MF(){return{baseEvent:void 0,stepName:""}}var Xf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=MF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.stepName=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Xf.fromPartial(e??{})},fromPartial(e){let t=MF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function jF(){return{baseEvent:void 0,stepName:""}}var Zf={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=jF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.stepName=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return Zf.fromPartial(e??{})},fromPartial(e){let t=jF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function VF(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0}}var em={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.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),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=VF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.messageId=r.string();continue;case 3:if(a!==26)break;o.role=r.string();continue;case 4:if(a!==34)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return em.fromPartial(e??{})},fromPartial(e){let t=VF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t}};function LF(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var tm={encode(e,t=new Ve){return e.baseEvent!==void 0&&ye.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 me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=LF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.baseEvent=ye.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.toolCallId=r.string();continue;case 3:if(a!==26)break;o.toolCallName=r.string();continue;case 4:if(a!==34)break;o.parentMessageId=r.string();continue;case 5:if(a!==42)break;o.delta=r.string();continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return tm.fromPartial(e??{})},fromPartial(e){let t=LF();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ye.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 UF(){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 QF={encode(e,t=new Ve){return e.textMessageStart!==void 0&&jf.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&Vf.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&Lf.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&Uf.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&Qf.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&Bf.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&Gf.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&$f.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&Hf.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&zf.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&Wf.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&Kf.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&Yf.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&Jf.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&Xf.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&Zf.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&em.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&tm.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t},decode(e,t){let r=e instanceof me?e:new me(e),n=t===void 0?r.len:r.pos+t,o=UF();for(;r.pos<n;){let a=r.uint32();switch(a>>>3){case 1:if(a!==10)break;o.textMessageStart=jf.decode(r,r.uint32());continue;case 2:if(a!==18)break;o.textMessageContent=Vf.decode(r,r.uint32());continue;case 3:if(a!==26)break;o.textMessageEnd=Lf.decode(r,r.uint32());continue;case 4:if(a!==34)break;o.toolCallStart=Uf.decode(r,r.uint32());continue;case 5:if(a!==42)break;o.toolCallArgs=Qf.decode(r,r.uint32());continue;case 6:if(a!==50)break;o.toolCallEnd=Bf.decode(r,r.uint32());continue;case 7:if(a!==58)break;o.stateSnapshot=Gf.decode(r,r.uint32());continue;case 8:if(a!==66)break;o.stateDelta=$f.decode(r,r.uint32());continue;case 9:if(a!==74)break;o.messagesSnapshot=Hf.decode(r,r.uint32());continue;case 10:if(a!==82)break;o.raw=zf.decode(r,r.uint32());continue;case 11:if(a!==90)break;o.custom=Wf.decode(r,r.uint32());continue;case 12:if(a!==98)break;o.runStarted=Kf.decode(r,r.uint32());continue;case 13:if(a!==106)break;o.runFinished=Yf.decode(r,r.uint32());continue;case 14:if(a!==114)break;o.runError=Jf.decode(r,r.uint32());continue;case 15:if(a!==122)break;o.stepStarted=Xf.decode(r,r.uint32());continue;case 16:if(a!==130)break;o.stepFinished=Zf.decode(r,r.uint32());continue;case 17:if(a!==138)break;o.textMessageChunk=em.decode(r,r.uint32());continue;case 18:if(a!==146)break;o.toolCallChunk=tm.decode(r,r.uint32());continue}if((a&7)===4||a===0)break;r.skip(a&7)}return o},create(e){return QF.fromPartial(e??{})},fromPartial(e){let t=UF();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?jf.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?Vf.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?Lf.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?Uf.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?Qf.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?Bf.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?Gf.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?$f.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?Hf.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?zf.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?Wf.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?Kf.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?Yf.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?Jf.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?Xf.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?Zf.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?em.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?tm.fromPartial(e.toolCallChunk):void 0,t}};function wL(e){let t=y.Number(e.toString());if(t>y.Number.MAX_SAFE_INTEGER)throw new y.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(t<y.Number.MIN_SAFE_INTEGER)throw new y.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return t}function BF(e){let t=QF.decode(e),r=Object.values(t).find(n=>n!==void 0);if(!r)throw new Error("Invalid event");if(r.type=RL[r.baseEvent.type],r.timestamp=r.baseEvent.timestamp,r.rawEvent=r.baseEvent.rawEvent,r.type===D.MESSAGES_SNAPSHOT)for(let n of r.messages){let o=n;o.toolCalls?.length===0&&(o.toolCalls=void 0)}if(r.type===D.STATE_DELTA)for(let n of r.delta)n.op=bL[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]}),Zp.parse(r)}var GF="application/vnd.ag-ui.event+proto";d();c();l();u();d();c();l();u();d();c();l();u();var EL=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Dv=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(EL);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},$F=e=>e==="*"||e==="x"||e==="X",HF=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},IL=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],TL=(e,t)=>{if($F(e)||$F(t))return 0;let[r,n]=IL(HF(e),HF(t));return r>n?1:r<n?-1:0},qv=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=TL(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var rm=(e,t)=>{let r=Dv(e),n=Dv(t),o=r.pop(),a=n.pop(),i=qv(r,n);return i!==0?i:o&&a?qv(o.split("."),a.split(".")):o||a?o?-1:1:0};var Ge=e=>{if(typeof structuredClone=="function")return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return{...e}}};function hl(){return Io()}function Qe(_x136,_x137,_x138,_x139){return _Qe.apply(this,arguments)}function _Qe(){_Qe=_asyncToGenerator(function*(e,t,r,n){let o=t,a=r,i;for(let p of e)try{let f=yield n(p,Ge(o),Ge(a));if(f===void 0)continue;if(f.messages!==void 0&&(o=f.messages),f.state!==void 0&&(a=f.state),i=f.stopPropagation,i===!0)break}catch(f){process.env.VITEST_WORKER_ID!==void 0||console.error("Subscriber error:",f);continue}return{...(JSON.stringify(o)===JSON.stringify(t)?{}:{messages:o}),...(JSON.stringify(a)===JSON.stringify(r)?{}:{state:a}),...(i===void 0?{}:{stopPropagation:i})}});return _Qe.apply(this,arguments)}var XF=(e,t,r,n)=>{let o=Ge(r.messages),a=Ge(e.state),i={},p=m=>{m.messages!==void 0&&(o=m.messages,i.messages=m.messages),m.state!==void 0&&(a=m.state,i.state=m.state)},f=()=>{let m=Ge(i);return i={},m.messages!==void 0||m.state!==void 0?tt(m):gf};return t.pipe(Tf(/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(m){let h=yield Qe(n,o,a,(S,v,g)=>S.onEvent?.({event:m,agent:r,input:e,messages:v,state:g}));if(p(h),h.stopPropagation===!0)return f();switch(m.type){case D.TEXT_MESSAGE_START:{let S=yield Qe(n,o,a,(v,g,C)=>v.onTextMessageStartEvent?.({event:m,messages:g,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{messageId:v,role:g="assistant"}=m;if(!o.find(C=>C.id===v)){let C={id:v,role:g,content:""};o.push(C),p({messages:o})}}return f()}case D.TEXT_MESSAGE_CONTENT:{let{messageId:S,delta:v}=m,g=o.find(w=>w.id===S);if(!g)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${S}'`),f();let C=yield Qe(n,o,a,(w,R,b)=>w.onTextMessageContentEvent?.({event:m,messages:R,state:b,agent:r,input:e,textMessageBuffer:typeof g.content=="string"?g.content:""}));return p(C),C.stopPropagation!==!0&&(g.content=`${typeof g.content=="string"?g.content:""}${v}`,p({messages:o})),f()}case D.TEXT_MESSAGE_END:{let{messageId:S}=m,v=o.find(g=>g.id===S);return v?(p(yield Qe(n,o,a,(g,C,w)=>g.onTextMessageEndEvent?.({event:m,messages:C,state:w,agent:r,input:e,textMessageBuffer:typeof v.content=="string"?v.content:""}))),yield Promise.all(n.map(g=>{g.onNewMessage?.({message:v,messages:o,state:a,agent:r,input:e})})),f()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${S}'`),f())}case D.TOOL_CALL_START:{let S=yield Qe(n,o,a,(v,g,C)=>v.onToolCallStartEvent?.({event:m,messages:g,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{toolCallId:v,toolCallName:g,parentMessageId:C}=m,w;C&&o.length>0&&o[o.length-1].id===C?w=o[o.length-1]:(w={id:C||v,role:"assistant",toolCalls:[]},o.push(w)),w.toolCalls??(w.toolCalls=[]),w.toolCalls.push({id:v,type:"function",function:{name:g,arguments:""}}),p({messages:o})}return f()}case D.TOOL_CALL_ARGS:{let{toolCallId:S,delta:v}=m,g=o.find(R=>R.toolCalls?.some(b=>b.id===S));if(!g)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${S}'`),f();let C=g.toolCalls?.find(R=>R.id===S);if(!C)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${S}'`),f();let w=yield Qe(n,o,a,(R,b,F)=>{let I=C.function.arguments,P=C.function.name,V={};try{V=kf(I)}catch{}return R.onToolCallArgsEvent?.({event:m,messages:b,state:F,agent:r,input:e,toolCallBuffer:I,toolCallName:P,partialToolCallArgs:V})});return p(w),w.stopPropagation!==!0&&(C.function.arguments+=v,p({messages:o})),f()}case D.TOOL_CALL_END:{let{toolCallId:S}=m,v=o.find(C=>C.toolCalls?.some(w=>w.id===S));if(!v)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${S}'`),f();let g=v.toolCalls?.find(C=>C.id===S);return g?(p(yield Qe(n,o,a,(C,w,R)=>{let b=g.function.arguments,F=g.function.name,I={};try{I=JSON.parse(b)}catch{}return C.onToolCallEndEvent?.({event:m,messages:w,state:R,agent:r,input:e,toolCallName:F,toolCallArgs:I})})),yield Promise.all(n.map(C=>{C.onNewToolCall?.({toolCall:g,messages:o,state:a,agent:r,input:e})})),f()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${S}'`),f())}case D.TOOL_CALL_RESULT:{let S=yield Qe(n,o,a,(v,g,C)=>v.onToolCallResultEvent?.({event:m,messages:g,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{messageId:v,toolCallId:g,content:C,role:w}=m,R={id:v,toolCallId:g,role:w||"tool",content:C};o.push(R),yield Promise.all(n.map(b=>{b.onNewMessage?.({message:R,messages:o,state:a,agent:r,input:e})})),p({messages:o})}return f()}case D.STATE_SNAPSHOT:{let S=yield Qe(n,o,a,(v,g,C)=>v.onStateSnapshotEvent?.({event:m,messages:g,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{snapshot:v}=m;a=v,p({state:a})}return f()}case D.STATE_DELTA:{let S=yield Qe(n,o,a,(v,g,C)=>v.onStateDeltaEvent?.({event:m,messages:g,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{delta:v}=m;try{a=No(a,v,!0,!1).newDocument,p({state:a})}catch(g){let C=g instanceof Error?g.message:String(g);console.warn(`Failed to apply state patch:
|
|
36
36
|
Current state: ${JSON.stringify(a,null,2)}
|
|
37
|
-
Patch operations: ${JSON.stringify(
|
|
38
|
-
Error: ${C}`)}}return f()}case D.MESSAGES_SNAPSHOT:{let S=yield Qe(n,o,a,(A,h,C)=>A.onMessagesSnapshotEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{messages:A}=m;o=A,p({messages:o})}return f()}case D.ACTIVITY_SNAPSHOT:{let S=m,A=o.findIndex(b=>b.id===S.messageId),h=A>=0?o[A]:void 0,C=h?.role==="activity"?h:void 0,w=S.replace??!0,R=yield Qe(n,o,a,(b,F,E)=>b.onActivitySnapshotEvent?.({event:S,messages:F,state:E,agent:r,input:e,activityMessage:C,existingMessage:h}));if(p(R),R.stopPropagation!==!0){let b={id:S.messageId,role:"activity",activityType:S.activityType,content:Ge(S.content)},F;A===-1?(o.push(b),F=b):C?w&&(o[A]={...C,activityType:S.activityType,content:Ge(S.content)}):w&&(o[A]=b,F=b),p({messages:o}),F&&(yield Promise.all(n.map(E=>E.onNewMessage?.({message:F,messages:o,state:a,agent:r,input:e}))))}return f()}case D.ACTIVITY_DELTA:{let S=m,A=o.findIndex(R=>R.id===S.messageId);if(A===-1)return console.warn(`ACTIVITY_DELTA: No message found with ID '${S.messageId}' to apply patch`),f();let h=o[A];if(h.role!=="activity")return console.warn(`ACTIVITY_DELTA: Message '${S.messageId}' is not an activity message`),f();let C=h,w=yield Qe(n,o,a,(R,b,F)=>R.onActivityDeltaEvent?.({event:S,messages:b,state:F,agent:r,input:e,activityMessage:C}));if(p(w),w.stopPropagation!==!0)try{let R=Ge(C.content??{}),b=No(R,S.patch??[],!0,!1).newDocument;o[A]={...C,content:Ge(b),activityType:S.activityType},p({messages:o})}catch(R){let b=R instanceof Error?R.message:String(R);console.warn(`Failed to apply activity patch for '${S.messageId}': ${b}`)}return f()}case D.RAW:return p(yield Qe(n,o,a,(S,A,h)=>S.onRawEvent?.({event:m,messages:A,state:h,agent:r,input:e}))),f();case D.CUSTOM:return p(yield Qe(n,o,a,(S,A,h)=>S.onCustomEvent?.({event:m,messages:A,state:h,agent:r,input:e}))),f();case D.RUN_STARTED:{let S=yield Qe(n,o,a,(A,h,C)=>A.onRunStartedEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let A=m;if(A.input?.messages){for(let h of A.input.messages)o.find(C=>C.id===h.id)||o.push(h);p({messages:o})}}return f()}case D.RUN_FINISHED:return p(yield Qe(n,o,a,(S,A,h)=>S.onRunFinishedEvent?.({event:m,messages:A,state:h,agent:r,input:e,result:m.result}))),f();case D.RUN_ERROR:return p(yield Qe(n,o,a,(S,A,h)=>S.onRunErrorEvent?.({event:m,messages:A,state:h,agent:r,input:e}))),f();case D.STEP_STARTED:return p(yield Qe(n,o,a,(S,A,h)=>S.onStepStartedEvent?.({event:m,messages:A,state:h,agent:r,input:e}))),f();case D.STEP_FINISHED:return p(yield Qe(n,o,a,(S,A,h)=>S.onStepFinishedEvent?.({event:m,messages:A,state:h,agent:r,input:e}))),f();case D.TEXT_MESSAGE_CHUNK:throw Error("TEXT_MESSAGE_CHUNK must be tranformed before being applied");case D.TOOL_CALL_CHUNK:throw Error("TOOL_CALL_CHUNK must be tranformed before being applied");case D.THINKING_START:return f();case D.THINKING_END:return f();case D.THINKING_TEXT_MESSAGE_START:return f();case D.THINKING_TEXT_MESSAGE_CONTENT:return f();case D.THINKING_TEXT_MESSAGE_END:return f();case D.REASONING_START:return p(yield Qe(n,o,a,(S,A,h)=>S.onReasoningStartEvent?.({event:m,messages:A,state:h,agent:r,input:e}))),f();case D.REASONING_MESSAGE_START:{let S=yield Qe(n,o,a,(A,h,C)=>A.onReasoningMessageStartEvent?.({event:m,messages:h,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{messageId:A}=m;if(!o.find(h=>h.id===A)){let h={id:A,role:"reasoning",content:""};o.push(h),p({messages:o})}}return f()}case D.REASONING_MESSAGE_CONTENT:{let{messageId:S,delta:A}=m,h=o.find(w=>w.id===S);if(!h)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${S}'`),f();let C=yield Qe(n,o,a,(w,R,b)=>w.onReasoningMessageContentEvent?.({event:m,messages:R,state:b,agent:r,input:e,reasoningMessageBuffer:typeof h.content=="string"?h.content:""}));return p(C),C.stopPropagation!==!0&&(h.content=`${typeof h.content=="string"?h.content:""}${A}`,p({messages:o})),f()}case D.REASONING_MESSAGE_END:{let{messageId:S}=m,A=o.find(h=>h.id===S);return A?(p(yield Qe(n,o,a,(h,C,w)=>h.onReasoningMessageEndEvent?.({event:m,messages:C,state:w,agent:r,input:e,reasoningMessageBuffer:typeof A.content=="string"?A.content:""}))),yield Promise.all(n.map(h=>{h.onNewMessage?.({message:A,messages:o,state:a,agent:r,input:e})})),f()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${S}'`),f())}case D.REASONING_MESSAGE_CHUNK:throw Error("REASONING_MESSAGE_CHUNK must be transformed before being applied");case D.REASONING_END:return p(yield Qe(n,o,a,(S,A,h)=>S.onReasoningEndEvent?.({event:m,messages:A,state:h,agent:r,input:e}))),f();case D.REASONING_ENCRYPTED_VALUE:{let{subtype:S,entityId:A,encryptedValue:h}=m,C=yield Qe(n,o,a,(w,R,b)=>w.onReasoningEncryptedValueEvent?.({event:m,messages:R,state:b,agent:r,input:e}));if(p(C),C.stopPropagation!==!0){let w=!1;if(S==="tool-call"){for(let R of o)if(R.role==="assistant"&&R.toolCalls){let b=R.toolCalls.find(F=>F.id===A);if(b){b.encryptedValue=h,w=!0;break}}}else{let R=o.find(b=>b.id===A);R?.role!=="activity"&&R&&(R.encryptedValue=h,w=!0)}w&&(i.messages=o)}return f()}}return m.type,f()});return function(_x134){return _ref54.apply(this,arguments)}}()),lv(),n.length>0?pv({}):m=>m)},Iv=e=>t=>{let r=new Map,n=new Map,o=!1,a=!1,i=!1,p=new Map,f=!1,m=!1,g=!1,S=()=>{r.clear(),n.clear(),p.clear(),f=!1,m=!1,o=!1,a=!1,g=!0};return t.pipe(Zt(A=>{let h=A.type;if(e&&console.debug("[VERIFY]:",JSON.stringify(A)),a)return Ke(()=>new et(`Cannot send event type '${h}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(o&&h!==D.RUN_ERROR&&h!==D.RUN_STARTED)return Ke(()=>new et(`Cannot send event type '${h}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(i){if(h===D.RUN_STARTED){if(g&&!o)return Ke(()=>new et("Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run."));o&&S()}}else if(i=!0,h!==D.RUN_STARTED&&h!==D.RUN_ERROR)return Ke(()=>new et("First event must be 'RUN_STARTED'"));switch(h){case D.TEXT_MESSAGE_START:{let C=A.messageId;return r.has(C)?Ke(()=>new et(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${C}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(r.set(C,!0),tt(A))}case D.TEXT_MESSAGE_CONTENT:{let C=A.messageId;return r.has(C)?tt(A):Ke(()=>new et(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${C}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case D.TEXT_MESSAGE_END:{let C=A.messageId;return r.has(C)?(r.delete(C),tt(A)):Ke(()=>new et(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${C}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case D.TOOL_CALL_START:{let C=A.toolCallId;return n.has(C)?Ke(()=>new et(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${C}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(n.set(C,!0),tt(A))}case D.TOOL_CALL_ARGS:{let C=A.toolCallId;return n.has(C)?tt(A):Ke(()=>new et(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${C}'. Start a tool call with 'TOOL_CALL_START' first.`))}case D.TOOL_CALL_END:{let C=A.toolCallId;return n.has(C)?(n.delete(C),tt(A)):Ke(()=>new et(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${C}'. A 'TOOL_CALL_START' event must be sent first.`))}case D.STEP_STARTED:{let C=A.stepName;return p.has(C)?Ke(()=>new et(`Step "${C}" is already active for 'STEP_STARTED'`)):(p.set(C,!0),tt(A))}case D.STEP_FINISHED:{let C=A.stepName;return p.has(C)?(p.delete(C),tt(A)):Ke(()=>new et(`Cannot send 'STEP_FINISHED' for step "${C}" that was not started`))}case D.RUN_STARTED:return g=!0,tt(A);case D.RUN_FINISHED:if(p.size>0){let C=Array.from(p.keys()).join(", ");return Ke(()=>new et(`Cannot send 'RUN_FINISHED' while steps are still active: ${C}`))}if(r.size>0){let C=Array.from(r.keys()).join(", ");return Ke(()=>new et(`Cannot send 'RUN_FINISHED' while text messages are still active: ${C}`))}if(n.size>0){let C=Array.from(n.keys()).join(", ");return Ke(()=>new et(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${C}`))}return o=!0,tt(A);case D.RUN_ERROR:return a=!0,tt(A);case D.CUSTOM:return tt(A);case D.THINKING_TEXT_MESSAGE_START:return f?m?Ke(()=>new et("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.")):(m=!0,tt(A)):Ke(()=>new et("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first."));case D.THINKING_TEXT_MESSAGE_CONTENT:return m?tt(A):Ke(()=>new et("Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first."));case D.THINKING_TEXT_MESSAGE_END:return m?(m=!1,tt(A)):Ke(()=>new et("Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first."));case D.THINKING_START:return f?Ke(()=>new et("Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.")):(f=!0,tt(A));case D.THINKING_END:return f?(f=!1,tt(A)):Ke(()=>new et("Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."));default:return tt(A)}}))},za=function(e){return e.HEADERS="headers",e.DATA="data",e}({}),PL=(e,t)=>dv(()=>Ga(v(e,t))).pipe(fv(r=>{if(!r.ok){let a=r.headers.get("content-type")||"";return Ga(r.text()).pipe(Zt(i=>{let p=i;if(a.includes("application/json"))try{p=JSON.parse(i)}catch{}let f=Error(`HTTP ${r.status}: ${typeof p=="string"?p:JSON.stringify(p)}`);return f.status=r.status,f.payload=p,Ke(()=>f)}))}let n={type:za.HEADERS,status:r.status,headers:r.headers},o=r.body?.getReader();return o?new We(a=>(a.next(n),_asyncToGenerator(function*(){try{for(;;){let{done:i,value:p}=yield o.read();if(i)break;let f={type:za.DATA,data:p};a.next(f)}a.complete()}catch(i){a.error(i)}})(),()=>{o.cancel().catch(i=>{if(i?.name!=="AbortError")throw i})})):Ke(()=>Error("Failed to getReader() from response"))})),kL=e=>{let t=new an,r=new TextDecoder("utf-8",{fatal:!1}),n="";e.subscribe({next:a=>{if(a.type!==za.HEADERS&&a.type===za.DATA&&a.data){let i=r.decode(a.data,{stream:!0});n+=i;let p=n.split(/\n\n/);n=p.pop()||"";for(let f of p)o(f)}},error:a=>t.error(a),complete:()=>{n&&(n+=r.decode(),o(n)),t.complete()}});function o(a){let i=a.split(`
|
|
37
|
+
Patch operations: ${JSON.stringify(v,null,2)}
|
|
38
|
+
Error: ${C}`)}}return f()}case D.MESSAGES_SNAPSHOT:{let S=yield Qe(n,o,a,(v,g,C)=>v.onMessagesSnapshotEvent?.({event:m,messages:g,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{messages:v}=m;o=v,p({messages:o})}return f()}case D.ACTIVITY_SNAPSHOT:{let S=m,v=o.findIndex(b=>b.id===S.messageId),g=v>=0?o[v]:void 0,C=g?.role==="activity"?g:void 0,w=S.replace??!0,R=yield Qe(n,o,a,(b,F,I)=>b.onActivitySnapshotEvent?.({event:S,messages:F,state:I,agent:r,input:e,activityMessage:C,existingMessage:g}));if(p(R),R.stopPropagation!==!0){let b={id:S.messageId,role:"activity",activityType:S.activityType,content:Ge(S.content)},F;v===-1?(o.push(b),F=b):C?w&&(o[v]={...C,activityType:S.activityType,content:Ge(S.content)}):w&&(o[v]=b,F=b),p({messages:o}),F&&(yield Promise.all(n.map(I=>I.onNewMessage?.({message:F,messages:o,state:a,agent:r,input:e}))))}return f()}case D.ACTIVITY_DELTA:{let S=m,v=o.findIndex(R=>R.id===S.messageId);if(v===-1)return console.warn(`ACTIVITY_DELTA: No message found with ID '${S.messageId}' to apply patch`),f();let g=o[v];if(g.role!=="activity")return console.warn(`ACTIVITY_DELTA: Message '${S.messageId}' is not an activity message`),f();let C=g,w=yield Qe(n,o,a,(R,b,F)=>R.onActivityDeltaEvent?.({event:S,messages:b,state:F,agent:r,input:e,activityMessage:C}));if(p(w),w.stopPropagation!==!0)try{let R=Ge(C.content??{}),b=No(R,S.patch??[],!0,!1).newDocument;o[v]={...C,content:Ge(b),activityType:S.activityType},p({messages:o})}catch(R){let b=R instanceof Error?R.message:String(R);console.warn(`Failed to apply activity patch for '${S.messageId}': ${b}`)}return f()}case D.RAW:return p(yield Qe(n,o,a,(S,v,g)=>S.onRawEvent?.({event:m,messages:v,state:g,agent:r,input:e}))),f();case D.CUSTOM:return p(yield Qe(n,o,a,(S,v,g)=>S.onCustomEvent?.({event:m,messages:v,state:g,agent:r,input:e}))),f();case D.RUN_STARTED:{let S=yield Qe(n,o,a,(v,g,C)=>v.onRunStartedEvent?.({event:m,messages:g,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let v=m;if(v.input?.messages){for(let g of v.input.messages)o.find(C=>C.id===g.id)||o.push(g);p({messages:o})}}return f()}case D.RUN_FINISHED:return p(yield Qe(n,o,a,(S,v,g)=>S.onRunFinishedEvent?.({event:m,messages:v,state:g,agent:r,input:e,result:m.result}))),f();case D.RUN_ERROR:return p(yield Qe(n,o,a,(S,v,g)=>S.onRunErrorEvent?.({event:m,messages:v,state:g,agent:r,input:e}))),f();case D.STEP_STARTED:return p(yield Qe(n,o,a,(S,v,g)=>S.onStepStartedEvent?.({event:m,messages:v,state:g,agent:r,input:e}))),f();case D.STEP_FINISHED:return p(yield Qe(n,o,a,(S,v,g)=>S.onStepFinishedEvent?.({event:m,messages:v,state:g,agent:r,input:e}))),f();case D.TEXT_MESSAGE_CHUNK:throw Error("TEXT_MESSAGE_CHUNK must be tranformed before being applied");case D.TOOL_CALL_CHUNK:throw Error("TOOL_CALL_CHUNK must be tranformed before being applied");case D.THINKING_START:return f();case D.THINKING_END:return f();case D.THINKING_TEXT_MESSAGE_START:return f();case D.THINKING_TEXT_MESSAGE_CONTENT:return f();case D.THINKING_TEXT_MESSAGE_END:return f();case D.REASONING_START:return p(yield Qe(n,o,a,(S,v,g)=>S.onReasoningStartEvent?.({event:m,messages:v,state:g,agent:r,input:e}))),f();case D.REASONING_MESSAGE_START:{let S=yield Qe(n,o,a,(v,g,C)=>v.onReasoningMessageStartEvent?.({event:m,messages:g,state:C,agent:r,input:e}));if(p(S),S.stopPropagation!==!0){let{messageId:v}=m;if(!o.find(g=>g.id===v)){let g={id:v,role:"reasoning",content:""};o.push(g),p({messages:o})}}return f()}case D.REASONING_MESSAGE_CONTENT:{let{messageId:S,delta:v}=m,g=o.find(w=>w.id===S);if(!g)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${S}'`),f();let C=yield Qe(n,o,a,(w,R,b)=>w.onReasoningMessageContentEvent?.({event:m,messages:R,state:b,agent:r,input:e,reasoningMessageBuffer:typeof g.content=="string"?g.content:""}));return p(C),C.stopPropagation!==!0&&(g.content=`${typeof g.content=="string"?g.content:""}${v}`,p({messages:o})),f()}case D.REASONING_MESSAGE_END:{let{messageId:S}=m,v=o.find(g=>g.id===S);return v?(p(yield Qe(n,o,a,(g,C,w)=>g.onReasoningMessageEndEvent?.({event:m,messages:C,state:w,agent:r,input:e,reasoningMessageBuffer:typeof v.content=="string"?v.content:""}))),yield Promise.all(n.map(g=>{g.onNewMessage?.({message:v,messages:o,state:a,agent:r,input:e})})),f()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${S}'`),f())}case D.REASONING_MESSAGE_CHUNK:throw Error("REASONING_MESSAGE_CHUNK must be transformed before being applied");case D.REASONING_END:return p(yield Qe(n,o,a,(S,v,g)=>S.onReasoningEndEvent?.({event:m,messages:v,state:g,agent:r,input:e}))),f();case D.REASONING_ENCRYPTED_VALUE:{let{subtype:S,entityId:v,encryptedValue:g}=m,C=yield Qe(n,o,a,(w,R,b)=>w.onReasoningEncryptedValueEvent?.({event:m,messages:R,state:b,agent:r,input:e}));if(p(C),C.stopPropagation!==!0){let w=!1;if(S==="tool-call"){for(let R of o)if(R.role==="assistant"&&R.toolCalls){let b=R.toolCalls.find(F=>F.id===v);if(b){b.encryptedValue=g,w=!0;break}}}else{let R=o.find(b=>b.id===v);R?.role!=="activity"&&R&&(R.encryptedValue=g,w=!0)}w&&(i.messages=o)}return f()}}return m.type,f()});return function(_x140){return _ref57.apply(this,arguments)}}()),vv(),n.length>0?Av({}):m=>m)},Mv=e=>t=>{let r=new Map,n=new Map,o=!1,a=!1,i=!1,p=new Map,f=!1,m=!1,h=!1,S=()=>{r.clear(),n.clear(),p.clear(),f=!1,m=!1,o=!1,a=!1,h=!0};return t.pipe(Zt(v=>{let g=v.type;if(e&&console.debug("[VERIFY]:",JSON.stringify(v)),a)return Ke(()=>new et(`Cannot send event type '${g}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(o&&g!==D.RUN_ERROR&&g!==D.RUN_STARTED)return Ke(()=>new et(`Cannot send event type '${g}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(i){if(g===D.RUN_STARTED){if(h&&!o)return Ke(()=>new et("Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run."));o&&S()}}else if(i=!0,g!==D.RUN_STARTED&&g!==D.RUN_ERROR)return Ke(()=>new et("First event must be 'RUN_STARTED'"));switch(g){case D.TEXT_MESSAGE_START:{let C=v.messageId;return r.has(C)?Ke(()=>new et(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${C}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(r.set(C,!0),tt(v))}case D.TEXT_MESSAGE_CONTENT:{let C=v.messageId;return r.has(C)?tt(v):Ke(()=>new et(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${C}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case D.TEXT_MESSAGE_END:{let C=v.messageId;return r.has(C)?(r.delete(C),tt(v)):Ke(()=>new et(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${C}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case D.TOOL_CALL_START:{let C=v.toolCallId;return n.has(C)?Ke(()=>new et(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${C}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(n.set(C,!0),tt(v))}case D.TOOL_CALL_ARGS:{let C=v.toolCallId;return n.has(C)?tt(v):Ke(()=>new et(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${C}'. Start a tool call with 'TOOL_CALL_START' first.`))}case D.TOOL_CALL_END:{let C=v.toolCallId;return n.has(C)?(n.delete(C),tt(v)):Ke(()=>new et(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${C}'. A 'TOOL_CALL_START' event must be sent first.`))}case D.STEP_STARTED:{let C=v.stepName;return p.has(C)?Ke(()=>new et(`Step "${C}" is already active for 'STEP_STARTED'`)):(p.set(C,!0),tt(v))}case D.STEP_FINISHED:{let C=v.stepName;return p.has(C)?(p.delete(C),tt(v)):Ke(()=>new et(`Cannot send 'STEP_FINISHED' for step "${C}" that was not started`))}case D.RUN_STARTED:return h=!0,tt(v);case D.RUN_FINISHED:if(p.size>0){let C=Array.from(p.keys()).join(", ");return Ke(()=>new et(`Cannot send 'RUN_FINISHED' while steps are still active: ${C}`))}if(r.size>0){let C=Array.from(r.keys()).join(", ");return Ke(()=>new et(`Cannot send 'RUN_FINISHED' while text messages are still active: ${C}`))}if(n.size>0){let C=Array.from(n.keys()).join(", ");return Ke(()=>new et(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${C}`))}return o=!0,tt(v);case D.RUN_ERROR:return a=!0,tt(v);case D.CUSTOM:return tt(v);case D.THINKING_TEXT_MESSAGE_START:return f?m?Ke(()=>new et("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.")):(m=!0,tt(v)):Ke(()=>new et("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first."));case D.THINKING_TEXT_MESSAGE_CONTENT:return m?tt(v):Ke(()=>new et("Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first."));case D.THINKING_TEXT_MESSAGE_END:return m?(m=!1,tt(v)):Ke(()=>new et("Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first."));case D.THINKING_START:return f?Ke(()=>new et("Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.")):(f=!0,tt(v));case D.THINKING_END:return f?(f=!1,tt(v)):Ke(()=>new et("Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."));default:return tt(v)}}))},za=function(e){return e.HEADERS="headers",e.DATA="data",e}({}),PL=(e,t)=>xv(()=>Ga(x(e,t))).pipe(Cv(r=>{if(!r.ok){let a=r.headers.get("content-type")||"";return Ga(r.text()).pipe(Zt(i=>{let p=i;if(a.includes("application/json"))try{p=JSON.parse(i)}catch{}let f=Error(`HTTP ${r.status}: ${typeof p=="string"?p:JSON.stringify(p)}`);return f.status=r.status,f.payload=p,Ke(()=>f)}))}let n={type:za.HEADERS,status:r.status,headers:r.headers},o=r.body?.getReader();return o?new We(a=>(a.next(n),_asyncToGenerator(function*(){try{for(;;){let{done:i,value:p}=yield o.read();if(i)break;let f={type:za.DATA,data:p};a.next(f)}a.complete()}catch(i){a.error(i)}})(),()=>{o.cancel().catch(i=>{if(i?.name!=="AbortError")throw i})})):Ke(()=>Error("Failed to getReader() from response"))})),kL=e=>{let t=new an,r=new TextDecoder("utf-8",{fatal:!1}),n="";e.subscribe({next:a=>{if(a.type!==za.HEADERS&&a.type===za.DATA&&a.data){let i=r.decode(a.data,{stream:!0});n+=i;let p=n.split(/\n\n/);n=p.pop()||"";for(let f of p)o(f)}},error:a=>t.error(a),complete:()=>{n&&(n+=r.decode(),o(n)),t.complete()}});function o(a){let i=a.split(`
|
|
39
39
|
`),p=[];for(let f of i)f.startsWith("data:")&&p.push(f.slice(5).replace(/^ /,""));if(p.length>0)try{let f=p.join(`
|
|
40
|
-
`),m=JSON.parse(f);t.next(m)}catch(f){t.error(f)}}return t.asObservable()},OL=e=>{let t=new an,r=new Uint8Array;e.subscribe({next:o=>{if(o.type!==za.HEADERS&&o.type===za.DATA&&o.data){let a=new Uint8Array(r.length+o.data.length);a.set(r,0),a.set(o.data,r.length),r=a,n()}},error:o=>t.error(o),complete:()=>{if(r.length>0)try{n()}catch{console.warn("Incomplete or invalid protocol buffer data at stream end")}t.complete()}});function n(){for(;r.length>=4;){let o=4+new DataView(r.buffer,r.byteOffset,4).getUint32(0,!1);if(r.length<o)break;try{let a=r.slice(4,o),i=
|
|
41
|
-
`)},HL=(e,t,r)=>n=>{let o={},a=!0,i=!0,p="",f=null,m=null,g=[],S={},A=h=>{typeof h=="object"&&h&&("messages"in h&&delete h.messages,o=h)};return n.pipe(Zt(h=>{switch(h.type){case D.TEXT_MESSAGE_START:{let C=h;return[{type:ze.enum.TextMessageStart,messageId:C.messageId,role:C.role}]}case D.TEXT_MESSAGE_CONTENT:{let C=h;return[{type:ze.enum.TextMessageContent,messageId:C.messageId,content:C.delta}]}case D.TEXT_MESSAGE_END:{let C=h;return[{type:ze.enum.TextMessageEnd,messageId:C.messageId}]}case D.TOOL_CALL_START:{let C=h;return g.push({id:C.toolCallId,type:"function",function:{name:C.toolCallName,arguments:""}}),i=!0,S[C.toolCallId]=C.toolCallName,[{type:ze.enum.ActionExecutionStart,actionExecutionId:C.toolCallId,actionName:C.toolCallName,parentMessageId:C.parentMessageId}]}case D.TOOL_CALL_ARGS:{let C=h,w=g.find(b=>b.id===C.toolCallId);if(!w)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${C.toolCallId}'`),[];w.function.arguments+=C.delta;let R=!1;if(m){let b=m.find(F=>F.tool==w.function.name);if(b)try{let F=JSON.parse(Ff(w.function.arguments));b.tool_argument&&b.tool_argument in F?(A({...o,[b.state_key]:F[b.tool_argument]}),R=!0):b.tool_argument||(A({...o,[b.state_key]:F}),R=!0)}catch{}}return[{type:ze.enum.ActionExecutionArgs,actionExecutionId:C.toolCallId,args:C.delta},...(R?[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}]:[])]}case D.TOOL_CALL_END:{let C=h;return[{type:ze.enum.ActionExecutionEnd,actionExecutionId:C.toolCallId}]}case D.TOOL_CALL_RESULT:{let C=h;return[{type:ze.enum.ActionExecutionResult,actionExecutionId:C.toolCallId,result:C.content,actionName:S[C.toolCallId]||"unknown"}]}case D.RAW:return[];case D.CUSTOM:{let C=h;switch(C.name){case"Exit":a=!1;break;case"PredictState":m=C.value;break}return[{type:ze.enum.MetaEvent,name:C.name,value:C.value}]}case D.STATE_SNAPSHOT:return A(h.snapshot),[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}];case D.STATE_DELTA:{let C=h,w=No(o,C.delta,!0,!1);return w?(A(w.newDocument),[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}]):[]}case D.MESSAGES_SNAPSHOT:return f=h.messages,[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify({...o,...(f?{messages:f}:{})}),active:!0}];case D.RUN_STARTED:return[];case D.RUN_FINISHED:return f&&(o.messages=f),Object.keys(o).length===0?[]:[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify({...o,...(f?{messages:zL(f)}:{})}),active:!1}];case D.RUN_ERROR:{let C=h;return[{type:ze.enum.RunError,message:C.message,code:C.code}]}case D.STEP_STARTED:return p=h.stepName,g=[],m=null,[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:!0}];case D.STEP_FINISHED:return g=[],m=null,[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:!1}];default:return[]}}))};function zL(e){let t=[];for(let r of e)if(r.role==="assistant"||r.role==="user"||r.role==="system"){let n=$L(r.content);if(n){let o={id:r.id,role:r.role,content:n};t.push(o)}if(r.role==="assistant"&&r.toolCalls&&r.toolCalls.length>0)for(let o of r.toolCalls){let a={id:o.id,name:o.function.name,arguments:JSON.parse(o.function.arguments),parentMessageId:r.id};t.push(a)}}else if(r.role==="tool"){let n="unknown";for(let a of e)if(a.role==="assistant"&&a.toolCalls?.length){for(let i of a.toolCalls)if(i.id===r.toolCallId){n=i.function.name;break}}let o={id:r.id,result:r.content,actionExecutionId:r.toolCallId,actionName:n};t.push(o)}return t}var Xf=e=>t=>{let r,n,o,a,i=()=>{if(!r||a!=="text")throw Error("No text message to close");let g={type:D.TEXT_MESSAGE_END,messageId:r.messageId};return a=void 0,r=void 0,e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_END",JSON.stringify(g)),g},p=()=>{if(!n||a!=="tool")throw Error("No tool call to close");let g={type:D.TOOL_CALL_END,toolCallId:n.toolCallId};return a=void 0,n=void 0,e&&console.debug("[TRANSFORM]: TOOL_CALL_END",JSON.stringify(g)),g},f=()=>{if(!o||a!=="reasoning")throw Error("No reasoning message to close");let g={type:D.REASONING_MESSAGE_END,messageId:o.messageId};return a=void 0,o=void 0,e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_END",JSON.stringify(g)),g},m=()=>a==="text"?[i()]:a==="tool"?[p()]:a==="reasoning"?[f()]:[];return t.pipe(Zt(g=>{switch(g.type){case D.TEXT_MESSAGE_START:case D.TEXT_MESSAGE_CONTENT:case D.TEXT_MESSAGE_END:case D.TOOL_CALL_START:case D.TOOL_CALL_ARGS:case D.TOOL_CALL_END:case D.TOOL_CALL_RESULT:case D.STATE_SNAPSHOT:case D.STATE_DELTA:case D.MESSAGES_SNAPSHOT:case D.CUSTOM:case D.RUN_STARTED:case D.RUN_FINISHED:case D.RUN_ERROR:case D.STEP_STARTED:case D.STEP_FINISHED:case D.THINKING_START:case D.THINKING_END:case D.THINKING_TEXT_MESSAGE_START:case D.THINKING_TEXT_MESSAGE_CONTENT:case D.THINKING_TEXT_MESSAGE_END:case D.REASONING_START:case D.REASONING_MESSAGE_START:case D.REASONING_MESSAGE_CONTENT:case D.REASONING_MESSAGE_END:case D.REASONING_END:return[...m(),g];case D.RAW:case D.ACTIVITY_SNAPSHOT:case D.ACTIVITY_DELTA:case D.REASONING_ENCRYPTED_VALUE:return[g];case D.TEXT_MESSAGE_CHUNK:let S=g,A=[];if((a!=="text"||S.messageId!==void 0&&S.messageId!==r?.messageId)&&A.push(...m()),a!=="text"){if(S.messageId===void 0)throw Error("First TEXT_MESSAGE_CHUNK must have a messageId");r={messageId:S.messageId},a="text";let b={type:D.TEXT_MESSAGE_START,messageId:S.messageId,role:S.role||"assistant"};A.push(b),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_START",JSON.stringify(b))}if(S.delta!==void 0){let b={type:D.TEXT_MESSAGE_CONTENT,messageId:r.messageId,delta:S.delta};A.push(b),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_CONTENT",JSON.stringify(b))}return A;case D.TOOL_CALL_CHUNK:let h=g,C=[];if((a!=="tool"||h.toolCallId!==void 0&&h.toolCallId!==n?.toolCallId)&&C.push(...m()),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");n={toolCallId:h.toolCallId,toolCallName:h.toolCallName,parentMessageId:h.parentMessageId},a="tool";let b={type:D.TOOL_CALL_START,toolCallId:h.toolCallId,toolCallName:h.toolCallName,parentMessageId:h.parentMessageId};C.push(b),e&&console.debug("[TRANSFORM]: TOOL_CALL_START",JSON.stringify(b))}if(h.delta!==void 0){let b={type:D.TOOL_CALL_ARGS,toolCallId:n.toolCallId,delta:h.delta};C.push(b),e&&console.debug("[TRANSFORM]: TOOL_CALL_ARGS",JSON.stringify(b))}return C;case D.REASONING_MESSAGE_CHUNK:let w=g,R=[];if((a!=="reasoning"||w.messageId&&w.messageId!==o?.messageId)&&R.push(...m()),a!=="reasoning"){if(w.messageId===void 0)throw Error("First REASONING_MESSAGE_CHUNK must have a messageId");o={messageId:w.messageId},a="reasoning";let b={type:D.REASONING_MESSAGE_START,messageId:w.messageId};R.push(b),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_START",JSON.stringify(b))}if(w.delta!==void 0){let b={type:D.REASONING_MESSAGE_CONTENT,messageId:o.messageId,delta:w.delta};R.push(b),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_CONTENT",JSON.stringify(b))}return R}return g.type,[]}),Ha(()=>{m()}))},Tv=class{runNext(e,t){return t.run(e).pipe(Xf(!1))}runNextWithState(e,t){let r=Ge(e.messages||[]),n=Ge(e.state||{}),o=new uf;return QF(e,o,t,[]).subscribe(a=>{a.messages!==void 0&&(r=a.messages),a.state!==void 0&&(n=a.state)}),this.runNext(e,t).pipe(Rf(/*#__PURE__*/function(){var _ref56=_asyncToGenerator(function*(a){return o.next(a),yield new Promise(i=>setTimeout(i,0)),{event:a,messages:Ge(r),state:Ge(n)}});return function(_x135){return _ref56.apply(this,arguments)}}()))}},WL=class extends Tv{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function KL(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 YL=class extends Tv{run(e,t){let{parentRunId:r,...n}=e,o={...n,messages:n.messages.map(KL)};return this.runNext(o,t)}},MF="THINKING_START",VF="THINKING_END",jF="THINKING_TEXT_MESSAGE_START",LF="THINKING_TEXT_MESSAGE_CONTENT",UF="THINKING_TEXT_MESSAGE_END",JL=class extends Tv{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){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($a(r=>this.transformEvent(r)))}transformEvent(e){switch(e.type){case MF:{this.currentReasoningId=gl();let{title:t,...r}=e;return this.warnAboutTransformation(MF,D.REASONING_START),{...r,type:D.REASONING_START,messageId:this.currentReasoningId}}case jF:return this.currentMessageId=gl(),this.warnAboutTransformation(jF,D.REASONING_MESSAGE_START),{...e,type:D.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case LF:{let{delta:t,...r}=e;return this.warnAboutTransformation(LF,D.REASONING_MESSAGE_CONTENT),{...r,type:D.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??gl(),delta:t}}case UF:{let t=this.currentMessageId??gl();return this.warnAboutTransformation(UF,D.REASONING_MESSAGE_END),{...e,type:D.REASONING_MESSAGE_END,messageId:t}}case VF:{let t=this.currentReasoningId??gl();return this.warnAboutTransformation(VF,D.REASONING_END),{...e,type:D.REASONING_END,messageId:t}}default:return e}}},XL="0.0.45",ZL=class{get maxVersion(){return XL}constructor({agentId:e,description:t,threadId:r,initialMessages:n,initialState:o,debug:a}={}){this.debug=!1,this.subscribers=[],this.isRunning=!1,this.middlewares=[],this.agentId=e,this.description=t??"",this.threadId=r??Io(),this.messages=Ge(n??[]),this.state=Ge(o??{}),this.debug=a??!1,Jf(this.maxVersion,"0.0.39")<=0&&this.middlewares.unshift(new YL),Jf(this.maxVersion,"0.0.45")<=0&&this.middlewares.unshift(new JL)}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 WL(r):r);return this.middlewares.push(...t),this}runAgent(e,t){var _this28=this;return _asyncToGenerator(function*(){try{_this28.isRunning=!0,_this28.agentId=_this28.agentId??Io();let r=_this28.prepareRunAgentInput(e),n,o=new Set(_this28.messages.map(f=>f.id)),a=[{onRunFinishedEvent:f=>{n=f.result}},..._this28.subscribers,t??{}];yield _this28.onInitialize(r,a),_this28.activeRunDetach$=new an;let i;_this28.activeRunCompletionPromise=new Promise(f=>{i=f}),yield bf(cf(()=>_this28.middlewares.length===0?_this28.run(r):_this28.middlewares.reduceRight((f,m)=>({run:g=>m.run(g,f)}),_this28).run(r),Xf(_this28.debug),Iv(_this28.debug),f=>f.pipe(wf(_this28.activeRunDetach$)),f=>_this28.apply(r,f,a),f=>_this28.processApplyEvents(r,f,a),pl(f=>(_this28.isRunning=!1,_this28.onError(r,f,a))),Ha(()=>{_this28.isRunning=!1,_this28.onFinalize(r,a),i?.(),i=void 0,_this28.activeRunCompletionPromise=void 0,_this28.activeRunDetach$=void 0}))(tt(null)));let p=Ge(_this28.messages).filter(f=>!o.has(f.id));return{result:n,newMessages:p}}finally{_this28.isRunning=!1}})()}connect(e){throw new JS}connectAgent(e,t){var _this29=this;return _asyncToGenerator(function*(){try{_this29.isRunning=!0,_this29.agentId=_this29.agentId??Io();let r=_this29.prepareRunAgentInput(e),n,o=new Set(_this29.messages.map(f=>f.id)),a=[{onRunFinishedEvent:f=>{n=f.result}},..._this29.subscribers,t??{}];yield _this29.onInitialize(r,a),_this29.activeRunDetach$=new an;let i;_this29.activeRunCompletionPromise=new Promise(f=>{i=f}),yield bf(cf(()=>_this29.connect(r),Xf(_this29.debug),Iv(_this29.debug),f=>f.pipe(wf(_this29.activeRunDetach$)),f=>_this29.apply(r,f,a),f=>_this29.processApplyEvents(r,f,a),pl(f=>(_this29.isRunning=!1,f instanceof JS?lf:_this29.onError(r,f,a))),Ha(()=>{_this29.isRunning=!1,_this29.onFinalize(r,a),i?.(),i=void 0,_this29.activeRunCompletionPromise=void 0,_this29.activeRunDetach$=void 0}))(tt(null)));let p=Ge(_this29.messages).filter(f=>!o.has(f.id));return{result:n,newMessages:p}}finally{_this29.isRunning=!1}})()}abortRun(){}detachActiveRun(){var _this30=this;return _asyncToGenerator(function*(){if(!_this30.activeRunDetach$)return;let e=_this30.activeRunCompletionPromise??Promise.resolve();_this30.activeRunDetach$.next(),_this30.activeRunDetach$?.complete(),yield e})()}apply(e,t,r){return QF(e,t,this,r)}processApplyEvents(e,t,r){return t.pipe(mv(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=Ge(this.messages).filter(r=>r.role!=="activity");return{threadId:this.threadId,runId:e?.runId||Io(),tools:Ge(e?.tools??[]),context:Ge(e?.context??[]),forwardedProps:Ge(e?.forwardedProps??{}),state:Ge(this.state),messages:t}}onInitialize(e,t){var _this31=this;return _asyncToGenerator(function*(){let r=yield Qe(t,_this31.messages,_this31.state,(n,o,a)=>n.onRunInitialized?.({messages:o,state:a,agent:_this31,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages&&(_this31.messages=r.messages,e.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this31.messages,state:_this31.state,agent:_this31,input:e})})),r.state&&(_this31.state=r.state,e.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this31.state,messages:_this31.messages,agent:_this31,input:e})})))})()}onError(e,t,r){return Ga(Qe(r,this.messages,this.state,(n,o,a)=>n.onRunFailed?.({error:t,messages:o,state:a,agent:this,input:e}))).pipe($a(n=>{let o=n;if((o.messages!==void 0||o.state!==void 0)&&(o.messages!==void 0&&(this.messages=o.messages,r.forEach(a=>{a.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),o.state!==void 0&&(this.state=o.state,r.forEach(a=>{a.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),o.stopPropagation!==!0)throw console.error("Agent execution failed:",t),t;return{}}))}onFinalize(e,t){var _this32=this;return _asyncToGenerator(function*(){let r=yield Qe(t,_this32.messages,_this32.state,(n,o,a)=>n.onRunFinalized?.({messages:o,state:a,agent:_this32,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages!==void 0&&(_this32.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this32.messages,state:_this32.state,agent:_this32,input:e})})),r.state!==void 0&&(_this32.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this32.state,messages:_this32.messages,agent:_this32,input:e})})))})()}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=Ge(this.messages),e.state=Ge(this.state),e.debug=this.debug,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e}addMessage(e){var _this33=this;this.messages.push(e),_asyncToGenerator(function*(){for(let t of _this33.subscribers)yield t.onNewMessage?.({message:e,messages:_this33.messages,state:_this33.state,agent:_this33});if(e.role==="assistant"&&e.toolCalls)for(let t of e.toolCalls)for(let r of _this33.subscribers)yield r.onNewToolCall?.({toolCall:t,messages:_this33.messages,state:_this33.state,agent:_this33});for(let t of _this33.subscribers)yield t.onMessagesChanged?.({messages:_this33.messages,state:_this33.state,agent:_this33})})()}addMessages(e){var _this34=this;this.messages.push(...e),_asyncToGenerator(function*(){for(let t of e){for(let r of _this34.subscribers)yield r.onNewMessage?.({message:t,messages:_this34.messages,state:_this34.state,agent:_this34});if(t.role==="assistant"&&t.toolCalls)for(let r of t.toolCalls)for(let n of _this34.subscribers)yield n.onNewToolCall?.({toolCall:r,messages:_this34.messages,state:_this34.state,agent:_this34})}for(let t of _this34.subscribers)yield t.onMessagesChanged?.({messages:_this34.messages,state:_this34.state,agent:_this34})})()}setMessages(e){var _this35=this;this.messages=Ge(e),_asyncToGenerator(function*(){for(let t of _this35.subscribers)yield t.onMessagesChanged?.({messages:_this35.messages,state:_this35.state,agent:_this35})})()}setState(e){var _this36=this;this.state=Ge(e),_asyncToGenerator(function*(){for(let t of _this36.subscribers)yield t.onStateChanged?.({messages:_this36.messages,state:_this36.state,agent:_this36})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??Io();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((r,n)=>({run:o=>n.run(o,r)}),this).run(t)).pipe(Xf(this.debug),Iv(this.debug),HL(this.threadId,t.runId,this.agentId),r=>r.pipe($a(n=>(this.debug&&console.debug("[LEGACY]:",JSON.stringify(n)),n))))}},Zf=class extends ZL{requestInit(e){return{method:"POST",headers:{...this.headers,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(e),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new s.AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new s.AbortController,this.url=e.url,this.headers=Ge(e.headers??{})}run(e){return NL(PL(this.url,this.requestInit(e)))}clone(){let e=super.clone();e.url=this.url,e.headers=Ge(this.headers??{});let t=new s.AbortController,r=this.abortController.signal;return r.aborted&&t.abort(r.reason),e.abortController=t,e}};d();c();l();u();var em=(e,t,r)=>{let n=Ft(t,r),o=e?.trim();if(!n||!t||!o)throw new Error("Missing required parameters for answer endpoint");let a=`/api/preview/organizations/${t}/agents`;return`${n}${a}/${o}`};var Pv=class extends Zf{requestInit(t){let{params:r,accessToken:n}=t.forwardedProps||{};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${n}`,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(r),signal:this.abortController.signal}}},BF=(e,t,r)=>new Pv({url:`${em(e,t,r)}/answer`});d();c();l();u();d();c();l();u();var eU=new M({required:!0}),tm=T("followUpAnswers/setIsEnabled",e=>O(e,new ce({required:!0}))),rm=T("followUpAnswers/setFollowUpAnswersConversationId",e=>O(e,z)),nm=T("followUpAnswers/createFollowUpAnswer",e=>O(e,{question:z})),om=T("followUpAnswers/setActiveFollowUpAnswerId",e=>O(e,z)),am=T("followUpAnswers/setFollowUpAnswerContentFormat",e=>O(e,{contentFormat:Rp,answerId:z})),im=T("followUpAnswers/setFollowUpIsLoading",e=>O(e,{isLoading:new ce({required:!0}),answerId:z})),sm=T("followUpAnswers/setFollowUpIsStreaming",e=>O(e,{isStreaming:new ce({required:!0}),answerId:z})),cm=T("followUpAnswers/followUpMessageChunkReceived",e=>O(e,{textDelta:eU,answerId:z})),um=T("followUpAnswers/followUpCitationsReceived",e=>O(e,{citations:new ae({required:!0,each:new J({values:MS})}),answerId:z})),lm=T("followUpAnswers/followUpCompleted",e=>O(e,{answerId:z,cannotAnswer:new ce({required:!1})})),dm=T("followUpAnswers/followUpFailed",e=>O(e,{message:new M,code:new ee({min:0}),answerId:z})),pm=T("followUpAnswers/activeFollowUpStartFailed",e=>O(e,{message:new M})),fm=T("followUpAnswers/likeFollowUp",e=>O(e,{answerId:z})),mm=T("followUpAnswers/dislikeFollowUp",e=>O(e,{answerId:z})),GF=T("followUpAnswers/submitFollowUpFeedback",e=>O(e,{answerId:z})),gm=T("followUpAnswers/resetFollowUpAnswers"),hm=T("followUpAnswers/stepStarted",e=>O(e,{answerId:z,name:new M({required:!0,constrainTo:Fs}),startedAt:new ee({min:0,required:!0})})),ym=T("followUpAnswers/stepFinished",e=>O(e,{answerId:z,name:new M({required:!0,constrainTo:Fs}),finishedAt:new ee({min:0,required:!0})}));d();c();l();u();var tU={"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};function Sm(e){return e?tU[e]??1004:1004}var $F=e=>({onRunStartedEvent:({event:t})=>{e(Ps(t.runId)),e(Zr(!1)),e(Sa(!0)),e(rm(t.threadId))},onStepStartedEvent:({event:t})=>{e(Dp({name:t.stepName,startedAt:t.timestamp??Date.now()}))},onStepFinishedEvent:({event:t})=>{e(qp({name:t.stepName,finishedAt:t.timestamp??Date.now()}))},onTextMessageContentEvent:({event:t})=>{e(va({textDelta:t.delta}))},onCustomEvent:({event:t})=>{let{name:r,value:n}=t;switch(r){case"header":{n?.contentFormat&&e(Ca(n.contentFormat)),n?.followUpEnabled&&e(tm(n.followUpEnabled));return}case"citations":{e(xa({citations:n.citations}));return}}},onRunErrorEvent:({event:t})=>{let r=Sm(t.code);e(Aa({message:t.message,code:r}))},onRunFinishedEvent:({event:t})=>{let r=t.result?.answerGenerated??!1;e(rl(r)),e(ba(!r)),e(Sa(!1)),e(ya(r)),e(Rs())}});var vm=()=>{let e,t=()=>{e?.abortRun(),e=void 0};return{run:function(){var _ref61=_asyncToGenerator(function*(n,o,a){t();let i=Dd(n),p=Nd(n),f=_d(n),m=Od(n),g=BF(i,p,f);e=g;let S=$F(o),A=XR(n,a());try{o(Zr(!0)),yield g.runAgent({forwardedProps:{params:A,accessToken:m}},S)}catch(h){o(Zr(!1)),o(Aa({message:"An error occurred while starting the answer generation."})),console.error("Error running the answer agent:",h)}});return function run(_x136,_x137,_x138){return _ref61.apply(this,arguments)}}(),abortRun:t}};var HF=e=>{let t=yC({extra:e}),r=vm();return t.startListening({actionCreator:G.pending,effect:function(){var _ref62=_asyncToGenerator(function*(n,o){let a=o.getState();if(!Hy(a))return;r.abortRun(),o.dispatch(sr()),o.dispatch(gm());let i=ha(a)?.q;!i||i.trim()===""||r.run(a,o.dispatch,e.getNavigatorContext)});return function effect(_x139,_x140){return _ref62.apply(this,arguments)}}()}),t};d();c();l();u();var zF=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)},WF=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();l();u();var kv=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:a}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:a}};d();c();l();u();function KF(e,t){let r={...e},n,o=a=>(i,p)=>{let f=a(i,p);return n?n(f,p):f};return{get combinedReducer(){let a=Jx(Object.entries(t).filter(([i])=>!(i in r)).map(([i,p])=>[i,()=>p]));return o(Ri({...a,...r}))},containsAll(a){return Object.keys(a).every(p=>p in r)},add(a){Object.keys(a).filter(i=>!(i in r)).forEach(i=>{r[i]=a[i]})},addCrossReducer(a){n=a}}}d();c();l();u();d();c();l();u();function Ov(e){if(!e||!rU(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(a=>`%${`00${a.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function YF(e,t=60){if(!e)return!1;let r=Ov(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function rU(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function XF(e,t){let r=0,n=null,o=Gl(()=>{r=0},500),a=/*#__PURE__*/function(){var _ref63=_asyncToGenerator(function*(f,m=!1){let g=!n;g&&t&&(n=_asyncToGenerator(function*(){try{return yield t()}catch(A){if(!m)throw A;return null}})().finally(()=>{n=null}));let S=yield n;return g&&S&&f.dispatch(zr({accessToken:S})),S});return function a(_x141){return _ref63.apply(this,arguments)}}(),i=/*#__PURE__*/function(){var _ref65=_asyncToGenerator(function*(f){let m=f.getState(),g=oU(m);if(!(!g||!YF(g))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield a(f))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(S){e.warn(S,"Access token renewal failed. A retry will occur if necessary.")}}});return function i(_x142){return _ref65.apply(this,arguments)}}(),p=/*#__PURE__*/function(){var _ref66=_asyncToGenerator(function*(f,m,g){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),JF(f,m.error),m;r++,o(),yield a(f,!0),f.dispatch(g)});return function p(_x143,_x144,_x145){return _ref66.apply(this,arguments)}}();return f=>m=>(/*#__PURE__*/function(){var _ref67=_asyncToGenerator(function*(g){let S=typeof g=="function",A=typeof t=="function";if(!S)return m(g);A&&(yield i(f));let h=yield m(g);return nU(h)?A?yield p(f,h,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."),JF(f,h.error),h):h});return function(_x146){return _ref67.apply(this,arguments)}}())}function nU(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new Ci().name}function JF(e,t){e.dispatch(vs({status:401,statusCode:401,message:t.message,type:t.name}))}function oU(e){return e.configuration.accessToken}d();c();l();u();function ZF({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return nC({reducer:e,preloadedState:t,devTools:{stateSanitizer:a=>a.history?{...a,history:"<<OMIT>>"}:a,name:o,shouldHotReload:!1},middleware:a=>a({thunk:{extraArgument:n}}).prepend(...r).concat(WF(n.logger))})}function aU(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},a={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return a.analyticsMode!=="next"&&Yx()?(t.info("Analytics disabled since doNotTrack is active."),{...a,enabled:!1}):a}function eE(e,t){let r={...e.reducers,configuration:ue,version:nw},n=iU({...e,reducers:r},t,ue),{accessToken:o,environment:a,organizationId:i}=e.configuration;n.dispatch(zr({accessToken:o,environment:a,organizationId:i}));let p=aU(e.configuration,n.logger);return p&&n.dispatch(go(p)),n}function iU(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,a=KF({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&a.addCrossReducer(e.crossReducer);let i=t.logger,p={...t,get relay(){return _u(m.state,o)},get navigatorContext(){return kv(this.relay,o)}},f=sU(e,p,a),m={addReducers(g){a.containsAll(g)||(a.add(g),f.replaceReducer(a.combinedReducer))},dispatch:f.dispatch,subscribe:f.subscribe,enableAnalytics(){f.dispatch(Ji())},disableAnalytics(){f.dispatch(Yi())},get state(){return f.getState()},get relay(){return _u(this.state,o)},get navigatorContext(){return kv(this.relay,o)},logger:i,store:f};return m}function sU(e,t,r){let{preloadedState:n,configuration:o}=e,a=o.name||"coveo-headless",i=cU(e,t.logger,()=>t.navigatorContext);return ZF({preloadedState:n,reducer:r.combinedReducer,middlewares:i,thunkExtraArguments:t,name:a})}function cU(e,t,r){let{renewAccessToken:n}=e.configuration,o=XF(t,n),a=HF({getNavigatorContext:r});return[lw,o,zF(t),aw].concat(Ra.middleware,a.middleware,e.middlewares||[])}var uU=`[Warning] A component from the Coveo Headless library has been instantiated with the Analytics Mode: "Next".
|
|
40
|
+
`),m=JSON.parse(f);t.next(m)}catch(f){t.error(f)}}return t.asObservable()},OL=e=>{let t=new an,r=new Uint8Array;e.subscribe({next:o=>{if(o.type!==za.HEADERS&&o.type===za.DATA&&o.data){let a=new Uint8Array(r.length+o.data.length);a.set(r,0),a.set(o.data,r.length),r=a,n()}},error:o=>t.error(o),complete:()=>{if(r.length>0)try{n()}catch{console.warn("Incomplete or invalid protocol buffer data at stream end")}t.complete()}});function n(){for(;r.length>=4;){let o=4+new DataView(r.buffer,r.byteOffset,4).getUint32(0,!1);if(r.length<o)break;try{let a=r.slice(4,o),i=BF(a);t.next(i),r=r.slice(o)}catch(a){let i=a instanceof Error?a.message:String(a);t.error(Error(`Failed to decode protocol buffer message: ${i}`));return}}}return t.asObservable()},NL=e=>{let t=new an,r=new mf,n=!1;return e.subscribe({next:o=>{r.next(o),o.type===za.HEADERS&&!n?(n=!0,o.headers.get("content-type")===GF?OL(r).subscribe({next:a=>t.next(a),error:a=>t.error(a),complete:()=>t.complete()}):kL(r).subscribe({next:a=>{try{let i=Zp.parse(a);t.next(i)}catch(i){t.error(i)}},error:a=>{if(a?.name==="AbortError"){t.next({type:D.RUN_ERROR,message:a.message||"Request aborted",code:"abort",rawEvent:a}),t.complete();return}return t.error(a)},complete:()=>t.complete()})):n||t.error(Error("No headers event received before data events"))},error:o=>{r.error(o),t.error(o)},complete:()=>{r.complete()}}),t.asObservable()},ze=E.enum(["TextMessageStart","TextMessageContent","TextMessageEnd","ActionExecutionStart","ActionExecutionArgs","ActionExecutionEnd","ActionExecutionResult","AgentStateMessage","MetaEvent","RunStarted","RunFinished","RunError","NodeStarted","NodeFinished"]),_L=E.enum(["LangGraphInterruptEvent","PredictState","Exit"]),DL=E.object({type:E.literal(ze.enum.TextMessageStart),messageId:E.string(),parentMessageId:E.string().optional(),role:E.string().optional()}),qL=E.object({type:E.literal(ze.enum.TextMessageContent),messageId:E.string(),content:E.string()}),ML=E.object({type:E.literal(ze.enum.TextMessageEnd),messageId:E.string()}),jL=E.object({type:E.literal(ze.enum.ActionExecutionStart),actionExecutionId:E.string(),actionName:E.string(),parentMessageId:E.string().optional()}),VL=E.object({type:E.literal(ze.enum.ActionExecutionArgs),actionExecutionId:E.string(),args:E.string()}),LL=E.object({type:E.literal(ze.enum.ActionExecutionEnd),actionExecutionId:E.string()}),UL=E.object({type:E.literal(ze.enum.ActionExecutionResult),actionName:E.string(),actionExecutionId:E.string(),result:E.string()}),QL=E.object({type:E.literal(ze.enum.AgentStateMessage),threadId:E.string(),agentName:E.string(),nodeName:E.string(),runId:E.string(),active:E.boolean(),role:E.string(),state:E.string(),running:E.boolean()}),BL=E.object({type:E.literal(ze.enum.MetaEvent),name:_L,value:E.any()}),GL=E.object({type:E.literal(ze.enum.RunError),message:E.string(),code:E.string().optional()});E.discriminatedUnion("type",[DL,qL,ML,jL,VL,LL,UL,QL,BL,GL]),E.object({id:E.string(),role:E.string(),content:E.string(),parentMessageId:E.string().optional()}),E.object({id:E.string(),name:E.string(),arguments:E.any(),parentMessageId:E.string().optional()}),E.object({id:E.string(),result:E.any(),actionExecutionId:E.string(),actionName:E.string()});var $L=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(`
|
|
41
|
+
`)},HL=(e,t,r)=>n=>{let o={},a=!0,i=!0,p="",f=null,m=null,h=[],S={},v=g=>{typeof g=="object"&&g&&("messages"in g&&delete g.messages,o=g)};return n.pipe(Zt(g=>{switch(g.type){case D.TEXT_MESSAGE_START:{let C=g;return[{type:ze.enum.TextMessageStart,messageId:C.messageId,role:C.role}]}case D.TEXT_MESSAGE_CONTENT:{let C=g;return[{type:ze.enum.TextMessageContent,messageId:C.messageId,content:C.delta}]}case D.TEXT_MESSAGE_END:{let C=g;return[{type:ze.enum.TextMessageEnd,messageId:C.messageId}]}case D.TOOL_CALL_START:{let C=g;return h.push({id:C.toolCallId,type:"function",function:{name:C.toolCallName,arguments:""}}),i=!0,S[C.toolCallId]=C.toolCallName,[{type:ze.enum.ActionExecutionStart,actionExecutionId:C.toolCallId,actionName:C.toolCallName,parentMessageId:C.parentMessageId}]}case D.TOOL_CALL_ARGS:{let C=g,w=h.find(b=>b.id===C.toolCallId);if(!w)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${C.toolCallId}'`),[];w.function.arguments+=C.delta;let R=!1;if(m){let b=m.find(F=>F.tool==w.function.name);if(b)try{let F=JSON.parse(kf(w.function.arguments));b.tool_argument&&b.tool_argument in F?(v({...o,[b.state_key]:F[b.tool_argument]}),R=!0):b.tool_argument||(v({...o,[b.state_key]:F}),R=!0)}catch{}}return[{type:ze.enum.ActionExecutionArgs,actionExecutionId:C.toolCallId,args:C.delta},...(R?[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}]:[])]}case D.TOOL_CALL_END:{let C=g;return[{type:ze.enum.ActionExecutionEnd,actionExecutionId:C.toolCallId}]}case D.TOOL_CALL_RESULT:{let C=g;return[{type:ze.enum.ActionExecutionResult,actionExecutionId:C.toolCallId,result:C.content,actionName:S[C.toolCallId]||"unknown"}]}case D.RAW:return[];case D.CUSTOM:{let C=g;switch(C.name){case"Exit":a=!1;break;case"PredictState":m=C.value;break}return[{type:ze.enum.MetaEvent,name:C.name,value:C.value}]}case D.STATE_SNAPSHOT:return v(g.snapshot),[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}];case D.STATE_DELTA:{let C=g,w=No(o,C.delta,!0,!1);return w?(v(w.newDocument),[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:i}]):[]}case D.MESSAGES_SNAPSHOT:return f=g.messages,[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify({...o,...(f?{messages:f}:{})}),active:!0}];case D.RUN_STARTED:return[];case D.RUN_FINISHED:return f&&(o.messages=f),Object.keys(o).length===0?[]:[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify({...o,...(f?{messages:zL(f)}:{})}),active:!1}];case D.RUN_ERROR:{let C=g;return[{type:ze.enum.RunError,message:C.message,code:C.code}]}case D.STEP_STARTED:return p=g.stepName,h=[],m=null,[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:!0}];case D.STEP_FINISHED:return h=[],m=null,[{type:ze.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:p,runId:t,running:a,role:"assistant",state:JSON.stringify(o),active:!1}];default:return[]}}))};function zL(e){let t=[];for(let r of e)if(r.role==="assistant"||r.role==="user"||r.role==="system"){let n=$L(r.content);if(n){let o={id:r.id,role:r.role,content:n};t.push(o)}if(r.role==="assistant"&&r.toolCalls&&r.toolCalls.length>0)for(let o of r.toolCalls){let a={id:o.id,name:o.function.name,arguments:JSON.parse(o.function.arguments),parentMessageId:r.id};t.push(a)}}else if(r.role==="tool"){let n="unknown";for(let a of e)if(a.role==="assistant"&&a.toolCalls?.length){for(let i of a.toolCalls)if(i.id===r.toolCallId){n=i.function.name;break}}let o={id:r.id,result:r.content,actionExecutionId:r.toolCallId,actionName:n};t.push(o)}return t}var nm=e=>t=>{let r,n,o,a,i=()=>{if(!r||a!=="text")throw Error("No text message to close");let h={type:D.TEXT_MESSAGE_END,messageId:r.messageId};return a=void 0,r=void 0,e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_END",JSON.stringify(h)),h},p=()=>{if(!n||a!=="tool")throw Error("No tool call to close");let h={type:D.TOOL_CALL_END,toolCallId:n.toolCallId};return a=void 0,n=void 0,e&&console.debug("[TRANSFORM]: TOOL_CALL_END",JSON.stringify(h)),h},f=()=>{if(!o||a!=="reasoning")throw Error("No reasoning message to close");let h={type:D.REASONING_MESSAGE_END,messageId:o.messageId};return a=void 0,o=void 0,e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_END",JSON.stringify(h)),h},m=()=>a==="text"?[i()]:a==="tool"?[p()]:a==="reasoning"?[f()]:[];return t.pipe(Zt(h=>{switch(h.type){case D.TEXT_MESSAGE_START:case D.TEXT_MESSAGE_CONTENT:case D.TEXT_MESSAGE_END:case D.TOOL_CALL_START:case D.TOOL_CALL_ARGS:case D.TOOL_CALL_END:case D.TOOL_CALL_RESULT:case D.STATE_SNAPSHOT:case D.STATE_DELTA:case D.MESSAGES_SNAPSHOT:case D.CUSTOM:case D.RUN_STARTED:case D.RUN_FINISHED:case D.RUN_ERROR:case D.STEP_STARTED:case D.STEP_FINISHED:case D.THINKING_START:case D.THINKING_END:case D.THINKING_TEXT_MESSAGE_START:case D.THINKING_TEXT_MESSAGE_CONTENT:case D.THINKING_TEXT_MESSAGE_END:case D.REASONING_START:case D.REASONING_MESSAGE_START:case D.REASONING_MESSAGE_CONTENT:case D.REASONING_MESSAGE_END:case D.REASONING_END:return[...m(),h];case D.RAW:case D.ACTIVITY_SNAPSHOT:case D.ACTIVITY_DELTA:case D.REASONING_ENCRYPTED_VALUE:return[h];case D.TEXT_MESSAGE_CHUNK:let S=h,v=[];if((a!=="text"||S.messageId!==void 0&&S.messageId!==r?.messageId)&&v.push(...m()),a!=="text"){if(S.messageId===void 0)throw Error("First TEXT_MESSAGE_CHUNK must have a messageId");r={messageId:S.messageId},a="text";let b={type:D.TEXT_MESSAGE_START,messageId:S.messageId,role:S.role||"assistant"};v.push(b),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_START",JSON.stringify(b))}if(S.delta!==void 0){let b={type:D.TEXT_MESSAGE_CONTENT,messageId:r.messageId,delta:S.delta};v.push(b),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_CONTENT",JSON.stringify(b))}return v;case D.TOOL_CALL_CHUNK:let g=h,C=[];if((a!=="tool"||g.toolCallId!==void 0&&g.toolCallId!==n?.toolCallId)&&C.push(...m()),a!=="tool"){if(g.toolCallId===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallId");if(g.toolCallName===void 0)throw Error("First TOOL_CALL_CHUNK must have a toolCallName");n={toolCallId:g.toolCallId,toolCallName:g.toolCallName,parentMessageId:g.parentMessageId},a="tool";let b={type:D.TOOL_CALL_START,toolCallId:g.toolCallId,toolCallName:g.toolCallName,parentMessageId:g.parentMessageId};C.push(b),e&&console.debug("[TRANSFORM]: TOOL_CALL_START",JSON.stringify(b))}if(g.delta!==void 0){let b={type:D.TOOL_CALL_ARGS,toolCallId:n.toolCallId,delta:g.delta};C.push(b),e&&console.debug("[TRANSFORM]: TOOL_CALL_ARGS",JSON.stringify(b))}return C;case D.REASONING_MESSAGE_CHUNK:let w=h,R=[];if((a!=="reasoning"||w.messageId&&w.messageId!==o?.messageId)&&R.push(...m()),a!=="reasoning"){if(w.messageId===void 0)throw Error("First REASONING_MESSAGE_CHUNK must have a messageId");o={messageId:w.messageId},a="reasoning";let b={type:D.REASONING_MESSAGE_START,messageId:w.messageId};R.push(b),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_START",JSON.stringify(b))}if(w.delta!==void 0){let b={type:D.REASONING_MESSAGE_CONTENT,messageId:o.messageId,delta:w.delta};R.push(b),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_CONTENT",JSON.stringify(b))}return R}return h.type,[]}),Ha(()=>{m()}))},jv=class{runNext(e,t){return t.run(e).pipe(nm(!1))}runNextWithState(e,t){let r=Ge(e.messages||[]),n=Ge(e.state||{}),o=new mf;return XF(e,o,t,[]).subscribe(a=>{a.messages!==void 0&&(r=a.messages),a.state!==void 0&&(n=a.state)}),this.runNext(e,t).pipe(Tf(/*#__PURE__*/function(){var _ref59=_asyncToGenerator(function*(a){return o.next(a),yield new Promise(i=>setTimeout(i,0)),{event:a,messages:Ge(r),state:Ge(n)}});return function(_x141){return _ref59.apply(this,arguments)}}()))}},WL=class extends jv{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function KL(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 YL=class extends jv{run(e,t){let{parentRunId:r,...n}=e,o={...n,messages:n.messages.map(KL)};return this.runNext(o,t)}},zF="THINKING_START",WF="THINKING_END",KF="THINKING_TEXT_MESSAGE_START",YF="THINKING_TEXT_MESSAGE_CONTENT",JF="THINKING_TEXT_MESSAGE_END",JL=class extends jv{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){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($a(r=>this.transformEvent(r)))}transformEvent(e){switch(e.type){case zF:{this.currentReasoningId=hl();let{title:t,...r}=e;return this.warnAboutTransformation(zF,D.REASONING_START),{...r,type:D.REASONING_START,messageId:this.currentReasoningId}}case KF:return this.currentMessageId=hl(),this.warnAboutTransformation(KF,D.REASONING_MESSAGE_START),{...e,type:D.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case YF:{let{delta:t,...r}=e;return this.warnAboutTransformation(YF,D.REASONING_MESSAGE_CONTENT),{...r,type:D.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??hl(),delta:t}}case JF:{let t=this.currentMessageId??hl();return this.warnAboutTransformation(JF,D.REASONING_MESSAGE_END),{...e,type:D.REASONING_MESSAGE_END,messageId:t}}case WF:{let t=this.currentReasoningId??hl();return this.warnAboutTransformation(WF,D.REASONING_END),{...e,type:D.REASONING_END,messageId:t}}default:return e}}},XL="0.0.45",ZL=class{get maxVersion(){return XL}constructor({agentId:e,description:t,threadId:r,initialMessages:n,initialState:o,debug:a}={}){this.debug=!1,this.subscribers=[],this.isRunning=!1,this.middlewares=[],this.agentId=e,this.description=t??"",this.threadId=r??Io(),this.messages=Ge(n??[]),this.state=Ge(o??{}),this.debug=a??!1,rm(this.maxVersion,"0.0.39")<=0&&this.middlewares.unshift(new YL),rm(this.maxVersion,"0.0.45")<=0&&this.middlewares.unshift(new JL)}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 WL(r):r);return this.middlewares.push(...t),this}runAgent(e,t){var _this28=this;return _asyncToGenerator(function*(){try{_this28.isRunning=!0,_this28.agentId=_this28.agentId??Io();let r=_this28.prepareRunAgentInput(e),n,o=new Set(_this28.messages.map(f=>f.id)),a=[{onRunFinishedEvent:f=>{n=f.result}},..._this28.subscribers,t??{}];yield _this28.onInitialize(r,a),_this28.activeRunDetach$=new an;let i;_this28.activeRunCompletionPromise=new Promise(f=>{i=f}),yield If(ff(()=>_this28.middlewares.length===0?_this28.run(r):_this28.middlewares.reduceRight((f,m)=>({run:h=>m.run(h,f)}),_this28).run(r),nm(_this28.debug),Mv(_this28.debug),f=>f.pipe(Pf(_this28.activeRunDetach$)),f=>_this28.apply(r,f,a),f=>_this28.processApplyEvents(r,f,a),fl(f=>(_this28.isRunning=!1,_this28.onError(r,f,a))),Ha(()=>{_this28.isRunning=!1,_this28.onFinalize(r,a),i?.(),i=void 0,_this28.activeRunCompletionPromise=void 0,_this28.activeRunDetach$=void 0}))(tt(null)));let p=Ge(_this28.messages).filter(f=>!o.has(f.id));return{result:n,newMessages:p}}finally{_this28.isRunning=!1}})()}connect(e){throw new iv}connectAgent(e,t){var _this29=this;return _asyncToGenerator(function*(){try{_this29.isRunning=!0,_this29.agentId=_this29.agentId??Io();let r=_this29.prepareRunAgentInput(e),n,o=new Set(_this29.messages.map(f=>f.id)),a=[{onRunFinishedEvent:f=>{n=f.result}},..._this29.subscribers,t??{}];yield _this29.onInitialize(r,a),_this29.activeRunDetach$=new an;let i;_this29.activeRunCompletionPromise=new Promise(f=>{i=f}),yield If(ff(()=>_this29.connect(r),nm(_this29.debug),Mv(_this29.debug),f=>f.pipe(Pf(_this29.activeRunDetach$)),f=>_this29.apply(r,f,a),f=>_this29.processApplyEvents(r,f,a),fl(f=>(_this29.isRunning=!1,f instanceof iv?gf:_this29.onError(r,f,a))),Ha(()=>{_this29.isRunning=!1,_this29.onFinalize(r,a),i?.(),i=void 0,_this29.activeRunCompletionPromise=void 0,_this29.activeRunDetach$=void 0}))(tt(null)));let p=Ge(_this29.messages).filter(f=>!o.has(f.id));return{result:n,newMessages:p}}finally{_this29.isRunning=!1}})()}abortRun(){}detachActiveRun(){var _this30=this;return _asyncToGenerator(function*(){if(!_this30.activeRunDetach$)return;let e=_this30.activeRunCompletionPromise??Promise.resolve();_this30.activeRunDetach$.next(),_this30.activeRunDetach$?.complete(),yield e})()}apply(e,t,r){return XF(e,t,this,r)}processApplyEvents(e,t,r){return t.pipe(bv(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=Ge(this.messages).filter(r=>r.role!=="activity");return{threadId:this.threadId,runId:e?.runId||Io(),tools:Ge(e?.tools??[]),context:Ge(e?.context??[]),forwardedProps:Ge(e?.forwardedProps??{}),state:Ge(this.state),messages:t}}onInitialize(e,t){var _this31=this;return _asyncToGenerator(function*(){let r=yield Qe(t,_this31.messages,_this31.state,(n,o,a)=>n.onRunInitialized?.({messages:o,state:a,agent:_this31,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages&&(_this31.messages=r.messages,e.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this31.messages,state:_this31.state,agent:_this31,input:e})})),r.state&&(_this31.state=r.state,e.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this31.state,messages:_this31.messages,agent:_this31,input:e})})))})()}onError(e,t,r){return Ga(Qe(r,this.messages,this.state,(n,o,a)=>n.onRunFailed?.({error:t,messages:o,state:a,agent:this,input:e}))).pipe($a(n=>{let o=n;if((o.messages!==void 0||o.state!==void 0)&&(o.messages!==void 0&&(this.messages=o.messages,r.forEach(a=>{a.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),o.state!==void 0&&(this.state=o.state,r.forEach(a=>{a.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),o.stopPropagation!==!0)throw console.error("Agent execution failed:",t),t;return{}}))}onFinalize(e,t){var _this32=this;return _asyncToGenerator(function*(){let r=yield Qe(t,_this32.messages,_this32.state,(n,o,a)=>n.onRunFinalized?.({messages:o,state:a,agent:_this32,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages!==void 0&&(_this32.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this32.messages,state:_this32.state,agent:_this32,input:e})})),r.state!==void 0&&(_this32.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this32.state,messages:_this32.messages,agent:_this32,input:e})})))})()}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=Ge(this.messages),e.state=Ge(this.state),e.debug=this.debug,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e}addMessage(e){var _this33=this;this.messages.push(e),_asyncToGenerator(function*(){for(let t of _this33.subscribers)yield t.onNewMessage?.({message:e,messages:_this33.messages,state:_this33.state,agent:_this33});if(e.role==="assistant"&&e.toolCalls)for(let t of e.toolCalls)for(let r of _this33.subscribers)yield r.onNewToolCall?.({toolCall:t,messages:_this33.messages,state:_this33.state,agent:_this33});for(let t of _this33.subscribers)yield t.onMessagesChanged?.({messages:_this33.messages,state:_this33.state,agent:_this33})})()}addMessages(e){var _this34=this;this.messages.push(...e),_asyncToGenerator(function*(){for(let t of e){for(let r of _this34.subscribers)yield r.onNewMessage?.({message:t,messages:_this34.messages,state:_this34.state,agent:_this34});if(t.role==="assistant"&&t.toolCalls)for(let r of t.toolCalls)for(let n of _this34.subscribers)yield n.onNewToolCall?.({toolCall:r,messages:_this34.messages,state:_this34.state,agent:_this34})}for(let t of _this34.subscribers)yield t.onMessagesChanged?.({messages:_this34.messages,state:_this34.state,agent:_this34})})()}setMessages(e){var _this35=this;this.messages=Ge(e),_asyncToGenerator(function*(){for(let t of _this35.subscribers)yield t.onMessagesChanged?.({messages:_this35.messages,state:_this35.state,agent:_this35})})()}setState(e){var _this36=this;this.state=Ge(e),_asyncToGenerator(function*(){for(let t of _this36.subscribers)yield t.onStateChanged?.({messages:_this36.messages,state:_this36.state,agent:_this36})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??Io();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((r,n)=>({run:o=>n.run(o,r)}),this).run(t)).pipe(nm(this.debug),Mv(this.debug),HL(this.threadId,t.runId,this.agentId),r=>r.pipe($a(n=>(this.debug&&console.debug("[LEGACY]:",JSON.stringify(n)),n))))}},om=class extends ZL{requestInit(e){return{method:"POST",headers:{...this.headers,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(e),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new s.AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new s.AbortController,this.url=e.url,this.headers=Ge(e.headers??{})}run(e){return NL(PL(this.url,this.requestInit(e)))}clone(){let e=super.clone();e.url=this.url,e.headers=Ge(this.headers??{});let t=new s.AbortController,r=this.abortController.signal;return r.aborted&&t.abort(r.reason),e.abortController=t,e}};d();c();l();u();var am=(e,t,r)=>{let n=Ft(t,r),o=e?.trim();if(!n||!t||!o)throw new Error("Missing required parameters for answer endpoint");let a=`/api/preview/organizations/${t}/agents`;return`${n}${a}/${o}`};var Vv=class extends om{requestInit(t){let{params:r,accessToken:n}=t.forwardedProps||{};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${n}`,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(r),signal:this.abortController.signal}}},ZF=(e,t,r)=>new Vv({url:`${am(e,t,r)}/answer`});d();c();l();u();d();c();l();u();var eU=new M({required:!0}),eE=new M({required:!0,constrainTo:Ep}),tE=e=>({...e,name:Ip(e.name)}),im=T("followUpAnswers/setIsEnabled",e=>O(e,new ce({required:!0}))),sm=T("followUpAnswers/setFollowUpAnswersConversationId",e=>O(e,z)),cm=T("followUpAnswers/createFollowUpAnswer",e=>O(e,{question:z})),um=T("followUpAnswers/setActiveFollowUpAnswerId",e=>O(e,z)),lm=T("followUpAnswers/setFollowUpAnswerContentFormat",e=>O(e,{contentFormat:Tp,answerId:z})),dm=T("followUpAnswers/setFollowUpIsLoading",e=>O(e,{isLoading:new ce({required:!0}),answerId:z})),pm=T("followUpAnswers/setFollowUpIsStreaming",e=>O(e,{isStreaming:new ce({required:!0}),answerId:z})),fm=T("followUpAnswers/followUpMessageChunkReceived",e=>O(e,{textDelta:eU,answerId:z})),mm=T("followUpAnswers/followUpCitationsReceived",e=>O(e,{citations:new ae({required:!0,each:new J({values:HS})}),answerId:z})),gm=T("followUpAnswers/followUpCompleted",e=>O(e,{answerId:z,cannotAnswer:new ce({required:!1})})),hm=T("followUpAnswers/followUpFailed",e=>O(e,{message:new M,code:new ee({min:0}),answerId:z})),ym=T("followUpAnswers/activeFollowUpStartFailed",e=>O(e,{message:new M})),Sm=T("followUpAnswers/likeFollowUp",e=>O(e,{answerId:z})),vm=T("followUpAnswers/dislikeFollowUp",e=>O(e,{answerId:z})),rE=T("followUpAnswers/submitFollowUpFeedback",e=>O(e,{answerId:z})),xm=T("followUpAnswers/resetFollowUpAnswers"),Am=T("followUpAnswers/stepStarted",e=>O(tE(e),{answerId:z,name:eE,startedAt:new ee({min:0,required:!0})})),Cm=T("followUpAnswers/stepFinished",e=>O(tE(e),{answerId:z,name:eE,finishedAt:new ee({min:0,required:!0})}));d();c();l();u();var tU={"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:TURN_LIMIT_REACHED":1005};function bm(e){return e?tU[e]??1004:1004}function rU(e){let t=r=>e.code===r;return Object.defineProperties(e,{isMaxDurationExceededError:{value:()=>t(1e3),enumerable:!1},isFollowupNotSupportedError:{value:()=>t(1001),enumerable:!1},isConversationNotFoundError:{value:()=>t(1002),enumerable:!1},isSseModelNotAvailableError:{value:()=>t(1003),enumerable:!1},isSseInternalError:{value:()=>t(1004),enumerable:!1},isSseTurnLimitReachedError:{value:()=>t(1005),enumerable:!1}}),e}function Wa(e){if(e)return rU({...e})}var nE=e=>({onRunStartedEvent:({event:t})=>{e(Os(t.runId)),e(Zr(!1)),e(Sa(!0)),e(sm(t.threadId))},onStepStartedEvent:({event:t})=>{e(Lp({name:t.stepName,startedAt:t.timestamp??Date.now()}))},onStepFinishedEvent:({event:t})=>{e(Up({name:t.stepName,finishedAt:t.timestamp??Date.now()}))},onTextMessageContentEvent:({event:t})=>{e(va({textDelta:t.delta}))},onCustomEvent:({event:t})=>{let{name:r,value:n}=t;switch(r){case"header":{n?.contentFormat&&e(Ca(n.contentFormat)),n?.followUpEnabled&&e(im(n.followUpEnabled));return}case"citations":{e(xa({citations:n.citations}));return}}},onRunErrorEvent:({event:t})=>{let r=bm(t.code);e(Aa({message:t.message,code:r}))},onRunFinishedEvent:({event:t})=>{let r=t.result?.completionReason==="ANSWERED";e(nl(r)),e(ba(!r)),e(Sa(!1)),e(ya(r)),e(Es())}});var Rm=()=>{let e,t=()=>{e?.abortRun(),e=void 0};return{run:function(){var _ref64=_asyncToGenerator(function*(n,o,a){t();let i=jd(n),p=qd(n),f=Md(n),m=Dd(n),h=ZF(i,p,f);e=h;let S=nE(o),v=iw(n,a());try{o(Zr(!0)),yield h.runAgent({forwardedProps:{params:v,accessToken:m}},S)}catch(g){o(Zr(!1)),o(Aa({message:"An error occurred while starting the answer generation."})),console.error("Error running the answer agent:",g)}});return function run(_x142,_x143,_x144){return _ref64.apply(this,arguments)}}(),abortRun:t}};var oE=e=>{let t=wC({extra:e}),r=Rm();return t.startListening({actionCreator:G.pending,effect:function(){var _ref65=_asyncToGenerator(function*(n,o){let a=o.getState();if(!tS(a))return;r.abortRun(),o.dispatch(sr()),o.dispatch(xm());let i=ha(a)?.q;!i||i.trim()===""||r.run(a,o.dispatch,e.getNavigatorContext)});return function effect(_x145,_x146){return _ref65.apply(this,arguments)}}()}),t};d();c();l();u();var aE=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)},iE=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));d();c();l();u();var Lv=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:a}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:a}};d();c();l();u();function sE(e,t){let r={...e},n,o=a=>(i,p)=>{let f=a(i,p);return n?n(f,p):f};return{get combinedReducer(){let a=aA(Object.entries(t).filter(([i])=>!(i in r)).map(([i,p])=>[i,()=>p]));return o(Ei({...a,...r}))},containsAll(a){return Object.keys(a).every(p=>p in r)},add(a){Object.keys(a).filter(i=>!(i in r)).forEach(i=>{r[i]=a[i]})},addCrossReducer(a){n=a}}}d();c();l();u();d();c();l();u();function Uv(e){if(!e||!nU(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(a=>`%${`00${a.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function cE(e,t=60){if(!e)return!1;let r=Uv(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function nU(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function lE(e,t){let r=0,n=null,o=zl(()=>{r=0},500),a=/*#__PURE__*/function(){var _ref66=_asyncToGenerator(function*(f,m=!1){let h=!n;h&&t&&(n=_asyncToGenerator(function*(){try{return yield t()}catch(v){if(!m)throw v;return null}})().finally(()=>{n=null}));let S=yield n;return h&&S&&f.dispatch(zr({accessToken:S})),S});return function a(_x147){return _ref66.apply(this,arguments)}}(),i=/*#__PURE__*/function(){var _ref68=_asyncToGenerator(function*(f){let m=f.getState(),h=aU(m);if(!(!h||!cE(h))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield a(f))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(S){e.warn(S,"Access token renewal failed. A retry will occur if necessary.")}}});return function i(_x148){return _ref68.apply(this,arguments)}}(),p=/*#__PURE__*/function(){var _ref69=_asyncToGenerator(function*(f,m,h){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),uE(f,m.error),m;r++,o(),yield a(f,!0),f.dispatch(h)});return function p(_x149,_x150,_x151){return _ref69.apply(this,arguments)}}();return f=>m=>(/*#__PURE__*/function(){var _ref70=_asyncToGenerator(function*(h){let S=typeof h=="function",v=typeof t=="function";if(!S)return m(h);v&&(yield i(f));let g=yield m(h);return oU(g)?v?yield p(f,g,h):(e.warn("Unable to renew the expired token because a renew function was not provided. Please specify the #renewAccessToken option when initializing the engine."),uE(f,g.error),g):g});return function(_x152){return _ref70.apply(this,arguments)}}())}function oU(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new wi().name}function uE(e,t){e.dispatch(Cs({status:401,statusCode:401,message:t.message,type:t.name}))}function aU(e){return e.configuration.accessToken}d();c();l();u();function dE({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return dC({reducer:e,preloadedState:t,devTools:{stateSanitizer:a=>a.history?{...a,history:"<<OMIT>>"}:a,name:o,shouldHotReload:!1},middleware:a=>a({thunk:{extraArgument:n}}).prepend(...r).concat(iE(n.logger))})}function iU(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},a={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return a.analyticsMode!=="next"&&oA()?(t.info("Analytics disabled since doNotTrack is active."),{...a,enabled:!1}):a}function pE(e,t){let r={...e.reducers,configuration:le,version:fw},n=sU({...e,reducers:r},t,le),{accessToken:o,environment:a,organizationId:i}=e.configuration;n.dispatch(zr({accessToken:o,environment:a,organizationId:i}));let p=iU(e.configuration,n.logger);return p&&n.dispatch(go(p)),n}function sU(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,a=sE({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&a.addCrossReducer(e.crossReducer);let i=t.logger,p={...t,get relay(){return Du(m.state,o)},get navigatorContext(){return Lv(this.relay,o)}},f=cU(e,p,a),m={addReducers(h){a.containsAll(h)||(a.add(h),f.replaceReducer(a.combinedReducer))},dispatch:f.dispatch,subscribe:f.subscribe,enableAnalytics(){f.dispatch(es())},disableAnalytics(){f.dispatch(Zi())},get state(){return f.getState()},get relay(){return Du(this.state,o)},get navigatorContext(){return Lv(this.relay,o)},logger:i,store:f};return m}function cU(e,t,r){let{preloadedState:n,configuration:o}=e,a=o.name||"coveo-headless",i=uU(e,t.logger,()=>t.navigatorContext);return dE({preloadedState:n,reducer:r.combinedReducer,middlewares:i,thunkExtraArguments:t,name:a})}function uU(e,t,r){let{renewAccessToken:n}=e.configuration,o=lE(t,n),a=oE({getNavigatorContext:r});return[xw,o,aE(t),gw].concat(Ra.middleware,a.middleware,e.middlewares||[])}var lU=`[Warning] A component from the Coveo Headless library has been instantiated with the Analytics Mode: "Next".
|
|
42
42
|
However, this mode is not available for Coveo for Service features, and this configuration may not work as expected.
|
|
43
43
|
Please switch back to the "legacy" analytics mode to ensure proper functionality.
|
|
44
|
-
For more information, refer to the documentation: https://docs.coveo.com/en/o3r90189/build-a-search-ui/event-protocol`;function Do(e){e==="next"&&console.warn(uU)}d();c();l();u();var uE=kr(cE(),1);function lE(e){return(0,uE.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();l();u();function dE(e,t){let r=EU(e),n=lr,o=IU(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function EU(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function IU(e){return e.preprocessRequest||Kl}d();c();l();u();var Vv=(e,t,r,n,o,a)=>{let i=e[t];le(i)||le(o)||o!==i&&o!==n&&(a.warn(`Mismatch on access token (JWT Token) ${t} and engine configuration.`),a.warn(`To remove this warning, make sure that access token value [${i}] matches engine configuration value [${r}]`))},jv=(e,t)=>!(le(e)||t===e),yl=e=>{let t=Ov(e);return t||!1},mE=(e,t)=>(jv(e.searchHub,t.searchHub)&&(t.searchHub=e.searchHub),t),pE=(e,t,r,n)=>(Vv(e,"searchHub",t.searchHub,po(),r,n),mE(e,t)),gE=(e,t)=>(jv(e.pipeline,t.pipeline)&&(t.pipeline=e.pipeline),t),fE=(e,t,r,n)=>(Vv(e,"pipeline",t.pipeline,jn(),r,n),gE(e,t)),hE=(e,t)=>(jv(e.userDisplayName,t.configuration.analytics.userDisplayName)&&(t.configuration.analytics.userDisplayName=e.userDisplayName),t),TU=(e,t,r,n)=>(Vv(e,"userDisplayName",t.configuration.analytics.userDisplayName,Ns().analytics.userDisplayName,r,n),hE(e,t)),yE=e=>oe({},t=>{t.addCase(xs,(r,n)=>{let o=yl(r.configuration.accessToken);return o?pE(o,r,n.payload,e):r}).addCase(ts,(r,n)=>{let o=yl(r.configuration.accessToken);return o?fE(o,r,n.payload,e):r}).addCase(zr,(r,n)=>{if(r.configuration.accessToken!==n.payload.accessToken)return r;let{accessToken:o}=n.payload;if(!o)return r;let a=yl(o);return a?[gE,mE,hE].reduce((i,p)=>p(a,i),r):r}).addCase(mr,(r,n)=>{let o=yl(r.configuration.accessToken);if(!o)return r;let a=pE(o,r,n.payload.searchHub,e);return fE(o,a,n.payload?.pipeline,e)}).addCase(go,(r,n)=>{let o=yl(r.configuration.accessToken);return o?TU(o,r,n.payload.userDisplayName,e):r})});d();c();l();u();d();c();l();u();var SE={organizationId:z,accessToken:z,name:new M({required:!1,emptyAllowed:!1}),analytics:new J({options:{required:!1},values:{enabled:new ce({required:!1}),originContext:new M({required:!1}),originLevel2:new M({required:!1}),originLevel3:new M({required:!1}),analyticsMode:new M({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new M({required:!1,url:!0}),trackingId:new M({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new M({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function vE(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var xE=new ge({...SE,search:new J({options:{required:!1},values:{pipeline:new M({required:!1,emptyAllowed:!0}),searchHub:it,locale:it,timezone:it,authenticationProviders:new ae({required:!1,each:z}),proxyBaseUrl:new M({required:!1,url:!0})}})});function Lv(){return{...vE(),search:{searchHub:"default"}}}var PU={debug:es,pipeline:rs,searchHub:As,search:fe};function kU(e){let{search:t,organizationId:r,environment:n}=e,o=t?.proxyBaseUrl?t.proxyBaseUrl:ct(r,n);return{...t,apiBaseUrl:o}}function AE(e){let t=lE(e.loggerOptions),{configuration:r}=e;OU(r,t);let n=NU(r,t),o=_U(t),a={...dE(r,t),apiClient:n,streamingClient:o},i={...e,reducers:PU,crossReducer:yE(t)},p=eE(i,a),f=kU(r);return f&&p.dispatch(mr(f)),{...p,get state(){return p.state},executeFirstSearch(m=Bd()){if(Yu(p.state))return;let g=G({legacy:m,next:Ob()});p.dispatch(g)},executeFirstSearchAfterStandaloneSearchBoxRedirect(m){let{cause:g,metadata:S}=m;if(Yu(p.state))return;let A=S&&g==="omniboxFromLink",h=G({legacy:A?$d(S):Gd(),next:A?_b():Nb()});p.dispatch(h)}}}function OU(e,t){try{xE.validate(e)}catch(r){throw t.error(r,"Search engine configuration error"),r}}function NU(e,t){let{search:r}=e;return new Jl({logger:t,preprocessRequest:e.preprocessRequest||Kl,postprocessSearchResponseMiddleware:r?.preprocessSearchResponseMiddleware||bA,postprocessFacetSearchResponseMiddleware:r?.preprocessFacetSearchResponseMiddleware||RA,postprocessQuerySuggestResponseMiddleware:r?.preprocessQuerySuggestResponseMiddleware||wA})}function _U(e){return new Hl({logger:e})}d();c();l();u();d();c();l();u();d();c();l();u();var Ka={value:z,numberOfResults:new ee({min:0}),state:z};d();c();l();u();var he=z;var VU=new ee({min:1,default:8,required:!1}),jU=new ee({min:1,max:20,default:5,required:!1}),LU={desiredCount:jU,numberOfValues:VU},Xs=T("automaticFacet/setOptions",e=>O(e,LU)),Zs=T("automaticFacet/deselectAll",e=>O(e,he)),UU=z,sn=T("automaticFacet/toggleSelectValue",e=>O(e,{field:UU,selection:new J({values:Ka})}));d();c();l();u();d();c();l();u();var QU={state:new Le({required:!0}),numberOfResults:new ee({required:!0,min:0}),value:new M({required:!0,emptyAllowed:!0}),path:new ae({required:!0,each:z}),moreValuesAvailable:new ce({required:!1})};function Uv(e){e.children.forEach(t=>{Uv(t)}),lr({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},QU)}var ec={facetId:he,field:z,tabs:new J({options:{required:!1},values:{included:new ae({each:new M}),excluded:new ae({each:new M})}}),activeTab:new M({required:!1}),delimitingCharacter:new M({required:!1,emptyAllowed:!0}),filterFacetCount:new ce({required:!1}),injectionDepth:new ee({required:!1,min:0}),numberOfValues:new ee({required:!1,min:1}),sortCriteria:new Le({required:!1}),basePath:new ae({required:!1,each:z}),filterByBasePath:new ce({required:!1})};var cn=T("categoryFacet/register",e=>O(e,ec)),Mo=T("categoryFacet/toggleSelectValue",e=>{try{return lr(e.facetId,z),Uv(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:_n(t)}}}),un=T("categoryFacet/deselectAll",e=>O(e,ec.facetId)),Ya=T("categoryFacet/updateNumberOfValues",e=>O(e,{facetId:ec.facetId,numberOfValues:ec.numberOfValues})),tc=T("categoryFacet/updateSortCriterion",e=>O(e,{facetId:ec.facetId,criterion:new Le})),Cm=T("categoryFacet/updateBasePath",e=>O(e,{facetId:ec.facetId,basePath:new ae({each:z})}));d();c();l();u();var BU={categoryFacetId:he,categoryFacetPath:new ae({required:!0,each:z})},GU=(e,{categoryFacetId:t,categoryFacetPath:r})=>{let o=e.categoryFacetSet[t]?.request.field,a=`${o}_${t}`;return{categoryFacetId:t,categoryFacetPath:r,categoryFacetField:o,categoryFacetTitle:a}},bm=e=>Y("analytics/categoryFacet/breadcrumb",(t,r)=>(O(e,BU),t.makeBreadcrumbFacet(GU(r,e)))),CE=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();d();c();l();u();var be=T("facetOptions/update",(e={freezeFacetOrder:!0})=>O(e,{freezeFacetOrder:new ce({required:!1})})),Vt=T("facetOptions/facet/enable",e=>O(e,he)),Je=T("facetOptions/facet/disable",e=>O(e,he));d();c();l();u();var er=(e,t)=>typeof e=="object"&&Object.keys({...e}).length===0||!t||!e?!0:e.excluded?.includes(t)?!1:!!(e.included&&(e.included.length===0||e.included.includes(t))||e.excluded&&!e.included);d();c();l();u();d();c();l();u();var Sl={facetId:he,captions:new J({options:{required:!1}}),numberOfValues:new ee({required:!1,min:1}),query:new M({required:!1,emptyAllowed:!0})};var $U={path:new ae({required:!0,each:z}),displayValue:Ue,rawValue:Ue,count:new ee({required:!0,min:0})},rc=T("categoryFacet/selectSearchResult",e=>O(e,{facetId:he,value:new J({values:$U})})),nc=T("categoryFacetSearch/register",e=>O(e,Sl));d();c();l();u();function oc(e,t){let{facetId:r,criterion:n}=t,o=e[r]?.request;o&&(o.sortCriteria=n)}function ac(e){e&&(e.currentValues=e.currentValues.map(t=>({...t,previousState:t.state!=="idle"?t.state:void 0,state:"idle"})),e.preventAutoSelect=!0)}function Rm(e,t){e&&(e.numberOfValues=t)}d();c();l();u();function vl(e,t){let r=e[t];r&&(r.request.numberOfValues=r.initialNumberOfValues,r.request.currentValues=[],r.request.preventAutoSelect=!0)}function wm(e,t,r){e.currentValues=HU(t,r),e.numberOfValues=t.length?1:r,e.preventAutoSelect=!0}function HU(e,t){if(!e.length)return[];let r=bE(e[0],t),n=r;for(let o of e.splice(1)){let a=bE(o,t);n.children.push(a),n=a}return n.state="selected",n.retrieveChildren=!0,[r]}function bE(e,t){return{value:e,retrieveCount:t,children:[],state:"idle",retrieveChildren:!1}}var ln=oe(Li(),e=>{e.addCase(cn,(t,r)=>{let n=r.payload,{facetId:o,tabs:a}=n;if(o in t)return;let i=WU(n),p=i.numberOfValues;t[o]={request:i,initialNumberOfValues:p,tabs:a}}).addCase(_e.fulfilled,(t,r)=>r.payload?.categoryFacetSet??t).addCase(De,(t,r)=>{let n=r.payload.cf||{},o=r.payload.tab;Object.keys(t).forEach(a=>{let i=t[a],p=i.request;if((i.tabs?.included?.length||i.tabs?.excluded?.length)&&!er(i.tabs,o)){p.currentValues.length&&wm(p,[],i.initialNumberOfValues);return}let m=n[a]||[];(m.length||p.currentValues.length)&&wm(p,m,i.initialNumberOfValues)})}).addCase(tc,(t,r)=>{let{facetId:n,criterion:o}=r.payload,a=t[n]?.request;a&&(a.sortCriteria=o)}).addCase(Cm,(t,r)=>{let{facetId:n,basePath:o}=r.payload,a=t[n]?.request;a&&(a.basePath=[...o])}).addCase(Mo,(t,r)=>{let{facetId:n,selection:o,retrieveCount:a}=r.payload,i=t[n]?.request;if(!i)return;let{path:p}=o,f=p.slice(0,p.length-1),m=zU(i,f,a);if(m.length){let S=m[0];S.retrieveChildren=!0,S.state="selected",S.previousState="idle",S.children=[];return}let g=wE(o.value,a);g.state="selected",g.previousState="idle",m.push(g),i.numberOfValues=1}).addCase(un,(t,r)=>{let n=r.payload;vl(t,n)}).addCase(pt,t=>{Object.keys(t).forEach(r=>vl(t,r))}).addCase(Wr,(t,r)=>Object.keys(t).forEach(n=>{t[n].request.preventAutoSelect=!r.payload.allow})).addCase(Ya,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload,a=t[n]?.request;if(a){if(!a.currentValues.length)return Rm(a,o);KU(t,r.payload)}}).addCase(rc,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n];if(!a)return;let i=[...o.path,o.rawValue];wm(a.request,i,a.initialNumberOfValues)}).addCase(vr.fulfilled,(t,r)=>{RE(t,r.payload.response.facets)}).addCase(G.fulfilled,(t,r)=>{RE(t,r.payload.response.facets)}).addCase(Je,(t,r)=>{vl(t,r.payload)}).addCase(gt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!er(a.tabs,n)&&vl(t,o)})})}),xl={delimitingCharacter:";",filterFacetCount:!0,injectionDepth:1e3,numberOfValues:5,sortCriteria:"occurrences",basePath:[],filterByBasePath:!0,resultsMustMatch:"atLeastOneValue"};function zU(e,t,r){let n=e.currentValues;for(let o of t){let a=n[0];(!a||o!==a.value)&&(a=wE(o,r),n.length=0,n.push(a)),a.retrieveChildren=!1,a.previousState=void 0,a.state="idle",n=a.children}return n}function WU(e){return{...xl,currentValues:[],preventAutoSelect:!1,type:"hierarchical",...e}}function wE(e,t){return{value:e,state:"idle",children:[],retrieveChildren:!0,retrieveCount:t}}function RE(e,t){t.forEach(r=>{if(!YU(e,r))return;let n=r.facetId,o=e[n]?.request;if(!o)return;let a=JU(o,r);o.currentValues=a?[]:o.currentValues,o.preventAutoSelect=!1})}function KU(e,t){let{facetId:r,numberOfValues:n}=t,o=e[r]?.request.currentValues[0];if(o){for(;o.children.length&&o?.state!=="selected";)o=o.children[0];o.retrieveCount=n}}function YU(e,t){return t.facetId in e}function JU(e,t){let r=or(e.currentValues),n=or(t.values);return r.length!==n.length}d();c();l();u();d();c();l();u();var dn=new M({regex:/^[a-zA-Z0-9-_]+$/}),pn=new M({required:!0}),FE=new ae({each:new M}),EE=new M,IE=new ce,fn=new ce,mn=new ee({min:0}),jr=new ee({min:1}),Fm=new ce({required:!0}),XU=new J,ZU=new M,eQ={captions:XU,numberOfValues:jr,query:ZU},ic=new J({values:eQ}),Em=new J({options:{required:!1},values:{type:new M({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new ae({required:!0,max:25,each:new M({emptyAllowed:!1,required:!0})})}}),TE=new ce,Im=new ae({min:1,max:25,required:!1,each:new M({emptyAllowed:!1,required:!0})});var tQ={facetId:he,field:new M({required:!0,emptyAllowed:!0}),tabs:new J({options:{required:!1},values:{included:new ae({each:new M}),excluded:new ae({each:new M})}}),activeTab:new M({required:!1}),filterFacetCount:new ce({required:!1}),injectionDepth:new ee({required:!1,min:0}),numberOfValues:new ee({required:!1,min:1}),sortCriteria:new Le({required:!1}),resultsMustMatch:new Le({required:!1}),allowedValues:Em,customSort:Im},gn=T("facet/register",e=>O(e,tQ)),hn=T("facet/toggleSelectValue",e=>O(e,{facetId:he,selection:new J({values:Ka})})),yn=T("facet/toggleExcludeValue",e=>O(e,{facetId:he,selection:new J({values:Ka})})),Xe=T("facet/deselectAll",e=>O(e,he)),sc=T("facet/updateSortCriterion",e=>O(e,{facetId:he,criterion:new Le({required:!0})})),Ja=T("facet/updateNumberOfValues",e=>O(e,{facetId:he,numberOfValues:new ee({required:!0,min:1})})),Xa=T("facet/updateIsFieldExpanded",e=>O(e,{facetId:he,isFieldExpanded:new ce({required:!0})})),Wn=T("facet/updateFreezeCurrentValues",e=>O(e,{facetId:he,freezeCurrentValues:new ce({required:!0})}));d();c();l();u();var cc=e=>Y("analytics/facet/showMore",(t,r)=>{O(e,he);let n=Gi(e,ar(r));return t.makeFacetShowMore(n)}),uc=e=>Y("analytics/facet/showLess",(t,r)=>{O(e,he);let n=Gi(e,ar(r));return t.makeFacetShowLess(n)}),Sn=e=>Y("analytics/facet/sortChange",(t,r)=>{O(e,{facetId:he,criterion:new Le({required:!0})});let{facetId:n,criterion:o}=e,a=ar(r),p={...Gi(n,a),criteria:o};return t.makeFacetUpdateSort(p)}),vt=e=>Y("analytics/facet/reset",(t,r)=>{O(e,he);let n=ar(r),o=Gi(e,n);return t.makeFacetClearAll(o)}),ot=e=>Y("analytics/facet/select",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=ar(r),o=$i(e,n);return t.makeFacetSelect(o)}),cr=e=>Y("analytics/facet/exclude",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=ar(r),o=$i(e,n);return t.makeFacetExclude(o)}),Lr=e=>Y("analytics/facet/deselect",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=ar(r),o=$i(e,n);return t.makeFacetDeselect(o)}),Kn=e=>Y("analytics/facet/unexclude",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=ar(r),o=$i(e,n);return t.makeFacetUnexclude(o)}),lc=e=>Y("analytics/facet/breadcrumb",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=$i(e,ar(r));return t.makeBreadcrumbFacet(n)}),jt=()=>({actionCause:"facetClearAll"}),mt=()=>({actionCause:"facetSelect"}),Yn=()=>({actionCause:"facetExclude"}),Jn=()=>({actionCause:"facetDeselect"}),PE=()=>({actionCause:"facetUnexclude"}),Tm=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();d();c();l();u();var kE={facetId:he,value:new J({values:{displayValue:Ue,rawValue:Ue,count:new ee({required:!0,min:0})}})},Pm=T("facetSearch/register",e=>O(e,Sl)),Vo=T("facetSearch/update",e=>O(e,Sl)),Za=T("facetSearch/toggleSelectValue",e=>O(e,kE)),ei=T("facetSearch/toggleExcludeValue",e=>O(e,kE));var Rr=oe(Bi(),e=>{e.addCase(gn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;n in t||(t[n]=cb(rQ(r.payload),o))}).addCase(_e.fulfilled,(t,r)=>{if(r.payload&&Object.keys(r.payload.facetSet).length!==0)return r.payload.facetSet}).addCase(De,(t,r)=>{let n=r.payload.f||{},o=r.payload.fExcluded||{};Object.keys(t).forEach(i=>{let{request:p}=t[i],f=n[i]||[],m=o[i]||[],g=f.length+m.length,S=p.currentValues.filter(A=>!f.includes(A.value)&&!m.includes(A.value));p.currentValues=[...f.map(NE),...m.map(_E),...S.map(oQ)],p.preventAutoSelect=g>0,p.numberOfValues=Math.max(g,p.numberOfValues)})}).addCase(hn,(t,r)=>{let{facetId:n,selection:o}=r.payload,a=t[n]?.request;if(!a)return;a.preventAutoSelect=!0;let i=a.currentValues.find(f=>f.value===o.value);if(!i){km(a,o);return}let p=i.state==="selected";i.previousState=i.state,i.state=p?"idle":"selected",a.freezeCurrentValues=!0}).addCase(yn,(t,r)=>{let{facetId:n,selection:o}=r.payload,a=t[n]?.request;if(!a)return;a.preventAutoSelect=!0;let i=a.currentValues.find(f=>f.value===o.value);if(!i){km(a,o);return}let p=i.state==="excluded";i.previousState=i.state,i.state=p?"idle":"excluded",a.freezeCurrentValues=!0}).addCase(Wn,(t,r)=>{let{facetId:n,freezeCurrentValues:o}=r.payload,a=t[n]?.request;a&&(a.freezeCurrentValues=o)}).addCase(Xe,(t,r)=>{ac(t[r.payload]?.request)}).addCase(pt,t=>{Object.values(t).filter(r=>r.hasBreadcrumbs).forEach(({request:r})=>ac(r))}).addCase(ns,t=>{Object.values(t).filter(r=>!r.hasBreadcrumbs).forEach(({request:r})=>ac(r))}).addCase(Wr,(t,r)=>Object.values(t).forEach(n=>{n.request.preventAutoSelect=!r.payload.allow})).addCase(sc,(t,r)=>{oc(t,r.payload)}).addCase(Ja,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload;Rm(t[n]?.request,o)}).addCase(Xa,(t,r)=>{let{facetId:n,isFieldExpanded:o}=r.payload,a=t[n]?.request;a&&(a.isFieldExpanded=o)}).addCase(G.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>OE(t[o.facetId]?.request,o))}).addCase(vr.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>OE(t[o.facetId]?.request,o))}).addCase(Za,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n]?.request;if(!a)return;let{rawValue:i}=o,{currentValues:p}=a,f=p.find(g=>g.value===i);if(f){f.state="selected";return}let m=NE(i);km(a,m),a.freezeCurrentValues=!0,a.preventAutoSelect=!0}).addCase(ei,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n]?.request;if(!a)return;let{rawValue:i}=o,{currentValues:p}=a,f=p.find(g=>g.value===i);if(f){f.state="excluded";return}let m=_E(i);km(a,m),a.freezeCurrentValues=!0,a.preventAutoSelect=!0}).addCase(Je,(t,r)=>{if(!(r.payload in t))return;let{request:n}=t[r.payload];ac(n)}).addCase(gt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!er(a.tabs,n)&&ac(a.request)})})});function km(e,t){let{currentValues:r}=e,n=r.findIndex(a=>a.state==="idle"),o=n===-1?r.length:n;e.currentValues.splice(o,0,t),n>-1&&e.currentValues.pop(),e.numberOfValues=e.currentValues.length}function OE(e,t){e&&(e.currentValues=t.values.map(nQ),e.freezeCurrentValues=!1,e.preventAutoSelect=!1)}var Al={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"automatic",resultsMustMatch:"atLeastOneValue"};function rQ(e){return{...Al,type:"specific",currentValues:[],freezeCurrentValues:!1,isFieldExpanded:!1,preventAutoSelect:!1,...e}}function nQ(e){let{value:t,state:r}=e;return{value:t,state:r}}function NE(e){return{value:e,state:"selected"}}function _E(e){return{value:e,state:"excluded"}}function oQ(e){return{...e,state:"idle"}}d();c();l();u();var Om=()=>Y("analytics/facet/deselectAllBreadcrumbs",e=>e.makeBreadcrumbResetAll());d();c();l();u();d();c();l();u();function jo(e){let t=DE(e.start,e),r=DE(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function DE(e,t){let{dateFormat:r}=t;return Kb(e)?(xo(e),Hb(e)):typeof e=="string"&&Jr(e)?(xo(e),e):(ep(e,r),Hu(pa(e,r)))}d();c();l();u();var dc=T("rangeFacet/updateSortCriterion",e=>O(e,{facetId:he,criterion:new Le({required:!0})}));d();c();l();u();var ti={state:z,start:new ee({required:!0}),end:new ee({required:!0}),endInclusive:new ce({required:!0}),numberOfResults:new ee({required:!0,min:0})},ri={start:z,end:z,endInclusive:new ce({required:!0}),state:z,numberOfResults:new ee({required:!0,min:0})},ni=e=>({facetId:he,selection:typeof e.start=="string"?new J({values:ri}):new J({values:ti})});var aQ={start:z,end:z,endInclusive:new ce({required:!0}),state:z},iQ={facetId:he,field:z,tabs:new J({options:{required:!1},values:{included:new ae({each:new M}),excluded:new ae({each:new M})}}),activeTab:new M({required:!1}),currentValues:new ae({required:!1,each:new J({values:aQ})}),generateAutomaticRanges:new ce({required:!0}),filterFacetCount:new ce({required:!1}),injectionDepth:new ee({required:!1,min:0}),numberOfValues:new ee({required:!1,min:1}),sortCriteria:new Le({required:!1}),rangeAlgorithm:new Le({required:!1})};function qE(e){return Jr(e)?Wu(e):e}function Nm(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=jo(t);if(pa(qE(r)).isAfter(pa(qE(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var vn=T("dateFacet/register",e=>{try{return lr(e,iQ),Nm(e),{payload:e,error:null}}catch(t){return{payload:e,error:_n(t)}}}),xn=T("dateFacet/toggleSelectValue",e=>O(e,{facetId:he,selection:new J({values:ri})})),An=T("dateFacet/toggleExcludeValue",e=>O(e,{facetId:he,selection:new J({values:ri})})),Xn=T("dateFacet/updateFacetValues",e=>{try{return lr(e,{facetId:he,values:new ae({each:new J({values:ri})})}),Nm({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:_n(t)}}}),_m=dc,Dm=Xe;d();c();l();u();d();c();l();u();var qm=(e,{facetId:t,selection:r})=>{let o=(e.dateFacetSet[t]||e.numericFacetSet[t]).request.field,a=`${o}_${t}`;return{facetId:t,facetField:o,facetTitle:a,facetRangeEndInclusive:r.endInclusive,facetRangeEnd:`${r.end}`,facetRangeStart:`${r.start}`}},Mm=()=>({actionCause:"breadcrumbFacet"});var Cl=e=>Y("analytics/dateFacet/breadcrumb",(t,r)=>{O(e,ni(e.selection));let n=qm(r,e);return t.makeBreadcrumbFacet(n)}),Qv=Mm;d();c();l();u();function sQ(e,t){return!!t&&t.facetId in e.dateFacetSet}var ME=(e,t)=>{let r=Nr(e,t);if(sQ(e,r))return r},VE=(e,t)=>(ME(e,t)||{values:[]}).values.filter(n=>n.state==="selected"),jE=(e,t)=>(ME(e,t)||{values:[]}).values.filter(n=>n.state!=="idle");d();c();l();u();d();c();l();u();var jm={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"ascending",rangeAlgorithm:"even",resultsMustMatch:"atLeastOneValue"};function Lm(e,t){let{request:r}=t,{facetId:n}=r;if(n in e)return;let o=LE(r);r.numberOfValues=o,e[n]=t}function Um(e,t,r){let n=e[t]?.request;n&&(n.currentValues=r,n.numberOfValues=LE(n))}function Qm(e,t,r){let n=e[t]?.request;if(!n)return;let o=Vm(n.currentValues,r);if(!o)return;let a=o.state==="selected";o.previousState=o.state,o.state=a?"idle":"selected",n.preventAutoSelect=!0}function Bm(e,t,r){let n=e[t]?.request;if(!n)return;let o=Vm(n.currentValues,r);if(!o)return;let a=o.state==="excluded";o.previousState=o.state,o.state=a?"idle":"excluded",n.preventAutoSelect=!0}function Cn(e,t){let r=e[t]?.request;r&&r.currentValues.forEach(n=>{n.state!=="idle"&&(n.previousState=n.state),n.state="idle"})}function Gm(e,t){Object.entries(e).forEach(([r,{request:n}])=>{let o=t[r]||[];n.currentValues.forEach(p=>(!!Vm(o,p)&&(p.state="selected"),p));let a=o.filter(p=>!Vm(n.currentValues,p)),i=n.currentValues;i.push(...a),n.numberOfValues=Math.max(n.numberOfValues,i.length)})}function $m(e,t,r){t.forEach(n=>{let o=n.facetId,a=e[o]?.request;if(!a)return;let i=r(n.values);a.currentValues=i,a.preventAutoSelect=!1})}function Vm(e,t){let{start:r,end:n}=t;return e.find(o=>o.start===r&&o.end===n)}function LE(e){let{generateAutomaticRanges:t,currentValues:r,numberOfValues:n}=e;return t?Math.max(n,r.length):r.length}var bn=oe(Ui(),e=>{e.addCase(vn,(t,r)=>{let{payload:n}=r,{tabs:o}=n,a=cQ(n);Lm(t,ib(a,o))}).addCase(_e.fulfilled,(t,r)=>r.payload?.dateFacetSet??t).addCase(De,(t,r)=>{let n=r.payload.df||{};Gm(t,n)}).addCase(xn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Qm(t,n,o)}).addCase(An,(t,r)=>{let{facetId:n,selection:o}=r.payload;Bm(t,n,o)}).addCase(Xn,(t,r)=>{let{facetId:n,values:o}=r.payload;Um(t,n,o)}).addCase(Dm,(t,r)=>{Cn(t,r.payload)}).addCase(pt,t=>{Object.keys(t).forEach(r=>{Cn(t,r)})}).addCase(_m,(t,r)=>{oc(t,r.payload)}).addCase(G.fulfilled,(t,r)=>{let n=r.payload.response.facets;$m(t,n,uQ)}).addCase(Je,(t,r)=>{Cn(t,r.payload)}).addCase(gt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!er(a.tabs,n)&&Cn(t,o)})})});function cQ(e){return{...jm,currentValues:[],preventAutoSelect:!1,type:"dateRange",...e}}function uQ(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();var lQ={state:z,start:new ee({required:!0}),end:new ee({required:!0}),endInclusive:new ce({required:!0})},dQ={facetId:he,field:z,tabs:new J({options:{required:!1},values:{included:new ae({each:new M}),excluded:new ae({each:new M})}}),activeTab:new M({required:!1}),currentValues:new ae({required:!1,each:new J({values:lQ})}),generateAutomaticRanges:new ce({required:!0}),filterFacetCount:new ce({required:!1}),injectionDepth:new ee({required:!1,min:0}),numberOfValues:new ee({required:!1,min:1}),sortCriteria:new Le({required:!1}),rangeAlgorithm:new Le({required:!1})};function Hm(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 Rn=T("numericFacet/register",e=>{try{return O(e,dQ),Hm(e),{payload:e,error:null}}catch(t){return{payload:e,error:_n(t)}}}),wn=T("numericFacet/toggleSelectValue",e=>O(e,{facetId:he,selection:new J({values:ti})})),Fn=T("numericFacet/toggleExcludeValue",e=>O(e,{facetId:he,selection:new J({values:ti})})),Zn=T("numericFacet/updateFacetValues",e=>{try{return lr(e,{facetId:he,values:new ae({each:new J({values:ti})})}),Hm({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:_n(t)}}}),zm=dc,Wm=Xe;d();c();l();u();var bl=e=>Y("analytics/numericFacet/breadcrumb",(t,r)=>{O(e,ni(e.selection));let n=qm(r,e);return t.makeBreadcrumbFacet(n)}),Bv=Mm;d();c();l();u();function pQ(e,t){return!!t&&t.facetId in e.numericFacetSet}var UE=(e,t)=>{let r=Nr(e,t);if(pQ(e,r))return r},QE=(e,t)=>(UE(e,t)||{values:[]}).values.filter(n=>n.state!=="idle"),BE=(e,t)=>(UE(e,t)||{values:[]}).values.filter(n=>n.state==="selected");d();c();l();u();var wr=oe(Qi(),e=>{e.addCase(Rn,(t,r)=>{let{payload:n}=r,{tabs:o}=n,a=fQ(n);Lm(t,sb(a,o))}).addCase(_e.fulfilled,(t,r)=>r.payload?.numericFacetSet??t).addCase(De,(t,r)=>{let n=r.payload.nf||{};Gm(t,n)}).addCase(wn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Qm(t,n,o)}).addCase(Fn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Bm(t,n,o)}).addCase(Zn,(t,r)=>{let{facetId:n,values:o}=r.payload;Um(t,n,o)}).addCase(Wm,(t,r)=>{Cn(t,r.payload)}).addCase(pt,t=>{Object.keys(t).forEach(r=>{Cn(t,r)})}).addCase(zm,(t,r)=>{oc(t,r.payload)}).addCase(G.fulfilled,(t,r)=>{let n=r.payload.response.facets;$m(t,n,mQ)}).addCase(Je,(t,r)=>{Cn(t,r.payload)}).addCase(gt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!er(a.tabs,n)&&Cn(t,o)})})});function fQ(e){return{...jm,currentValues:[],preventAutoSelect:!1,type:"numericalRange",...e}}function mQ(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();d();c();l();u();var oi=z,Km=new J({options:{required:!0},values:{caption:Ue,expression:Ue,state:new M({constrainTo:["idle","selected","excluded"]})}}),Ym=new ae({required:!0,each:Km});var pc=T("staticFilter/register",e=>O(e,{id:oi,values:Ym})),eo=T("staticFilter/toggleSelect",e=>O(e,{id:oi,value:Km})),to=T("staticFilter/toggleExclude",e=>O(e,{id:oi,value:Km})),Lo=T("staticFilter/deselectAllFilterValues",e=>O(e,oi)),Jm=e=>Y("analytics/staticFilter/select",t=>t.makeStaticFilterSelect(e)),fc=e=>Y("analytics/staticFilter/deselect",t=>t.makeStaticFilterDeselect(e)),Xm=e=>Y("analytics/staticFilter/clearAll",t=>t.makeStaticFilterClearAll(e));d();c();l();u();d();c();l();u();function ne(e){let t,r=new Map,n=()=>r.size===0,o=a=>{try{let i=JSON.stringify(a),p=t!==i;return t=i,p}catch(i){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",i),!0}};return{subscribe(a){a();let i=Symbol(),p;return n()&&(t=JSON.stringify(this.state),p=e.subscribe(()=>{o(this.state)&&r.forEach(f=>f())})),r.set(i,a),()=>{r.delete(i),n()&&p?.()}},get state(){return{}}}}var Zm=e=>Object.keys(e.facetSet).map(t=>{let r=e.facetValuesSelector(e.engine.state,t).map(n=>({value:n,deselect:()=>{n.state==="selected"?e.executeToggleSelect({facetId:t,selection:n}):n.state==="excluded"&&e.executeToggleExclude({facetId:t,selection:n})}}));return{facetId:t,field:e.facetSet[t].request.field,values:r}}).filter(t=>t.values.length);function GE(e){let t=ne(e),{dispatch:r}=e;return{...t,get state(){return{facetBreadcrumbs:[],categoryFacetBreadcrumbs:[],numericFacetBreadcrumbs:[],dateFacetBreadcrumbs:[],staticFilterBreadcrumbs:[],hasBreadcrumbs:!1}},deselectAll:()=>{r(pt())},deselectBreadcrumb(n){n.deselect()}}}function $E(e){if(!gQ(e))throw W;let t=GE(e),{dispatch:r}=e,n=()=>e.state,o=()=>{let R={engine:e,facetSet:n().facetSet,executeToggleSelect:({facetId:b,selection:F})=>{r(hn({facetId:b,selection:F})),r(Wn({facetId:b,freezeCurrentValues:!1})),r(G({legacy:lc({facetId:b,facetValue:F.value}),next:Tm()}))},executeToggleExclude:({facetId:b,selection:F})=>{r(yn({facetId:b,selection:F})),r(Wn({facetId:b,freezeCurrentValues:!1})),r(G({legacy:lc({facetId:b,facetValue:F.value}),next:Tm()}))},facetValuesSelector:nb};return Zm(R)},a=()=>{let R={engine:e,facetSet:n().numericFacetSet,executeToggleSelect:b=>{r(wn(b)),r(G({legacy:bl(b),next:Bv()}))},executeToggleExclude:b=>{r(Fn(b)),r(G({legacy:bl(b),next:Bv()}))},facetValuesSelector:QE};return Zm(R)},i=()=>{let R={engine:e,facetSet:n().dateFacetSet,executeToggleSelect:b=>{r(xn(b)),r(G({legacy:Cl(b),next:Qv()}))},executeToggleExclude:b=>{r(An(b)),r(G({legacy:Cl(b),next:Qv()}))},facetValuesSelector:jE};return Zm(R)},p=()=>Object.keys(n().categoryFacetSet).map(f).filter(R=>R.path.length),f=R=>{let b=ab(n(),R);return{facetId:R,field:n().categoryFacetSet[R].request.field,path:b,deselect:()=>{r(un(R)),r(G({legacy:bm({categoryFacetPath:b.map(F=>F.value),categoryFacetId:R}),next:CE()}))}}},m=()=>{let R=n().staticFilterSet??{};return Object.values(R).map(g)},g=R=>{let{id:b,values:F}=R,E=F.filter(P=>P.state!=="idle").map(P=>S(b,P));return{id:b,values:E}},S=(R,b)=>({value:b,deselect:()=>{let{caption:F,expression:E}=b;b.state==="selected"?r(eo({id:R,value:b})):b.state==="excluded"&&r(to({id:R,value:b})),r(G({legacy:fc({staticFilterId:R,staticFilterValue:{caption:F,expression:E}})}))}}),A=()=>{let R=n().automaticFacetSet?.set??{};return Object.values(R).map(b=>h(b.response)).filter(b=>b.values.length>0)},h=R=>{let{field:b,label:F}=R,E=R.values.filter(P=>P.state!=="idle").map(P=>C(b,P));return{facetId:b,field:b,label:F,values:E}},C=(R,b)=>({value:b,deselect:()=>{r(sn({field:R,selection:b})),r(G({legacy:lc({facetId:R,facetValue:b.value}),next:Tm()}))}});function w(){return!![...o(),...a(),...i(),...p(),...m(),...A()].length}return{...t,get state(){return{facetBreadcrumbs:o(),categoryFacetBreadcrumbs:p(),numericFacetBreadcrumbs:a(),dateFacetBreadcrumbs:i(),staticFilterBreadcrumbs:m(),automaticFacetBreadcrumbs:A(),hasBreadcrumbs:w()}},deselectAll:()=>{t.deselectAll(),r(G({legacy:Om(),next:{actionCause:"breadcrumbResetAll"}}))}}}function gQ(e){return e.addReducers({configuration:ue,search:fe,facetSet:Rr,numericFacetSet:wr,dateFacetSet:bn,categoryFacetSet:ln}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var hQ=new ae({each:z,required:!0}),HE=(e,t)=>(O(e,z),Si(t)?O(t,z):O(t,hQ),{payload:{contextKey:e,contextValue:t}}),ai=T("context/set",e=>{for(let[t,r]of Object.entries(e))HE(t,r);return{payload:e}}),ii=T("context/add",e=>HE(e.contextKey,e.contextValue)),si=T("context/remove",e=>O(e,z));d();c();l();u();var eg=oe(ap(),e=>{e.addCase(ai,(t,r)=>{t.contextValues=r.payload}).addCase(ii,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(si,(t,r)=>{delete t.contextValues[r.payload]}).addCase(_e.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});d();c();l();u();var yQ=["caseId","caseNumber"],SQ={caseId:"caseContext",caseNumber:"caseContext"},Rl=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${SQ[t]} to set this value.}`)}};function Gv(e){return yQ.includes(e)}var vQ=new ge({values:new J({options:{required:!1}})});function zE(e,t={}){if(!CQ(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a=ut(e,vQ,t.initialState,"buildContext");return a.values&&n(ai(a.values)),{...r,get state(){return{values:o().context.contextValues}},set(i){n(ai(i))},...(o().configuration.analytics.analyticsMode==="legacy"?xQ(n):AQ(n))}}var xQ=e=>({add(t,r){e(ii({contextKey:t,contextValue:r}))},remove(t){e(si(t))}}),AQ=e=>({add(t,r){if(Gv(t))throw new Rl(t);e(ii({contextKey:t,contextValue:r}))},remove(t){if(Gv(t))throw new Rl(t);e(si(t))}});function CQ(e){return e.addReducers({context:eg}),!0}function WE(e,t){return zE(e,t)}d();c();l();u();d();c();l();u();var xt=oe(sp(),e=>{e.addCase(be,(t,r)=>({...t,...r.payload})).addCase(G.fulfilled,t=>{t.freezeFacetOrder=!1}).addCase(G.rejected,t=>{t.freezeFacetOrder=!1}).addCase(_e.fulfilled,(t,r)=>r.payload?.facetOptions??t).addCase(cn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;tg(o,t,n)}).addCase(gn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;tg(o,t,n)}).addCase(vn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;tg(o,t,n)}).addCase(Rn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;tg(o,t,n)}).addCase(Vt,(t,r)=>{t.facets[r.payload].enabled=!0}).addCase(Je,(t,r)=>{t.facets[r.payload].enabled=!1}).addCase(De,(t,r)=>{[...Object.keys(r.payload.f??{}),...Object.keys(r.payload.fExcluded??{}),...Object.keys(r.payload.cf??{}),...Object.keys(r.payload.nf??{}),...Object.keys(r.payload.df??{})].forEach(n=>{n in t||(t.facets[n]=hS()),t.facets[n].enabled=!0})})});function tg(e,t,r){let n={...hS(),tabs:e??{}};t.facets[r]=n}d();c();l();u();d();c();l();u();var mc=oe(dp(),e=>{e.addCase(Os,(t,r)=>{let n=r.payload,{id:o}=n;o in t||(t[o]={...n,isActive:!1})}).addCase(gt,(t,r)=>{let n=r.payload;KE(t,n)}).addCase(Xi,(t,r)=>{let n=r.payload;KE(t,n)}).addCase(_e.fulfilled,(t,r)=>r.payload?.tabSet??t).addCase(De,(t,r)=>{let n=r.payload.tab;le(n)||Object.keys(t).forEach(o=>{t[o].isActive=o===n})})});function KE(e,t){t in e&&Object.keys(e).forEach(n=>{e[n].isActive=n===t})}function rg(e){if(!bQ(e))throw W;let t=ne(e),r=Ye(n=>n.tabSet,n=>Object.values(n).find(a=>a.isActive)?.id??"");return{...t,get state(){return{activeTab:r(e.state)}}}}function bQ(e){return e.addReducers({tabSet:mc}),!0}function YE(e,t){if(!RQ(e))throw W;let r=rg(e),n=C=>e.state.facetOptions.facets[C]?.enabled??!1,o=C=>e.state.facetSet?.[C]?.request?.currentValues??e.state.categoryFacetSet?.[C]?.request?.currentValues??e.state.numericFacetSet?.[C]?.request?.currentValues??e.state.dateFacetSet?.[C]?.request?.currentValues??null,a=C=>C in e.state.facetOptions.facets,i=C=>e.state.facetOptions.facets[C]?.tabs,p=()=>xi({isFacetRegistered:a(t.facetId),parentFacets:t.conditions.map(({parentFacetId:C})=>a(C)?{enabled:n(C),values:o(C)}:null),isTabEnabled:er(i(t.facetId),r.state.activeTab)}),f=()=>{let C=p();return C===A?!1:(A=C,!0)},m=()=>t.conditions.length>0?t.conditions.some(C=>{if(!n(C.parentFacetId))return!1;let w=o(C.parentFacetId);return w===null?!1:C.condition(w)}):!0,g=()=>{e.state.facetSet&&Object.entries(e.state.facetSet).forEach(([C,w])=>w.request.freezeCurrentValues&&e.dispatch(Wn({facetId:C,freezeCurrentValues:!1})))},S=()=>{if(!a(t.facetId))return;let C=n(t.facetId),w=m(),R=er(i(t.facetId),r.state.activeTab),b=w&&R;C!==b&&(e.dispatch(b?Vt(t.facetId):Je(t.facetId)),g())},A=p(),h=e.subscribe(()=>{f()&&S()});return S(),{stopWatching(){h()}}}function RQ(e){return e.addReducers({facetOptions:xt}),!0}d();c();l();u();d();c();l();u();var gc=T("dictionaryFieldContext/set",e=>{let t=new J({options:{required:!0}}),r=O(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new ae({each:Ue}),a=O(n,o).error;return a?{payload:e,error:a}:{payload:e}}),hc=T("dictionaryFieldContext/add",e=>{let t=new J({options:{required:!0},values:{field:Ue,key:Ue}});return O(e,t)}),yc=T("dictionaryFieldContext/remove",e=>O(e,Ue));d();c();l();u();var ng=oe(ip(),e=>{e.addCase(gc,(t,r)=>{t.contextValues=r.payload}).addCase(hc,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(yc,(t,r)=>{delete t.contextValues[r.payload]}).addCase(_e.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function JE(e){if(!wQ(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(gc(o))},add(o,a){r(hc({field:o,key:a}))},remove(o){r(yc(o))}}}function wQ(e){return e.addReducers({dictionaryFieldContext:ng}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var XE=e=>e.queryCorrection.correctedQuery!==""||e.wasCorrectedTo!=="";d();c();l();u();d();c();l();u();d();c();l();u();var og=()=>({correctedQuery:"",wordCorrections:[],originalQuery:""}),ZE=()=>({correctedQuery:"",corrections:[],originalQuery:""});function eI(){return{enableDidYouMean:!1,wasCorrectedTo:"",wasAutomaticallyCorrected:!1,queryCorrection:og(),originalQuery:"",automaticallyCorrectQuery:!0,queryCorrectionMode:"legacy"}}var tI=(e,t)=>{let r={...ZE(),...t,correctedQuery:t?.correctedQuery||t?.corrections[0]?.correctedQuery||""};e.queryCorrection=r,e.wasCorrectedTo=r.correctedQuery};var ag=oe(eI(),e=>{e.addCase(ms,t=>{t.enableDidYouMean=!0}).addCase(rp,t=>{t.enableDidYouMean=!1}).addCase(np,t=>{t.automaticallyCorrectQuery=!0}).addCase(gs,t=>{t.automaticallyCorrectQuery=!1}).addCase(G.pending,t=>{t.queryCorrection=og(),t.wasAutomaticallyCorrected=!1,t.wasCorrectedTo=""}).addCase(G.fulfilled,(t,r)=>{let{queryCorrection:n,queryCorrections:o}=r.payload.response;if(t.queryCorrectionMode==="legacy"){let a=o?.[0]?o[0]:og();t.queryCorrection=a}t.queryCorrectionMode==="next"&&tI(t,n),t.wasAutomaticallyCorrected=r.payload.automaticallyCorrected,t.originalQuery=r.payload.originalQuery}).addCase(gr,(t,r)=>{t.wasCorrectedTo=r.payload}).addCase(fa,(t,r)=>{t.queryCorrectionMode=r.payload})});function rI(e,t={}){if(!FQ(e))throw W;let r=ne(e),{dispatch:n}=e;n(ms()),t.options?.automaticallyCorrectQuery===!1&&n(gs()),n(fa(t.options?.queryCorrectionMode||"next"));let o=()=>e.state,a=()=>XE(o().didYouMean);return{...r,get state(){let i=o();return{originalQuery:i.didYouMean.originalQuery,wasCorrectedTo:i.didYouMean.wasCorrectedTo,wasAutomaticallyCorrected:i.didYouMean.wasAutomaticallyCorrected,queryCorrection:i.didYouMean.queryCorrection,hasQueryCorrection:a()}},applyCorrection(){n(gr(this.state.queryCorrection.correctedQuery))},updateQueryCorrectionMode(i){n(fa(i))}}}function FQ(e){return e.addReducers({configuration:ue,didYouMean:ag}),!0}function nI(e,t={}){let r=rI(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},applyCorrection(){r.applyCorrection(),n(G({legacy:op(),next:eR()}))}}}d();c();l();u();d();c();l();u();function oI(e){if(!EQ(e))throw W;let t=ne(e),r=()=>e.state;return{...t,sort(n){return Ku(n,this.state.facetIds)},get state(){return{facetIds:r().search.response.facets.map(a=>a.facetId)}}}}function EQ(e){return e.addReducers({search:fe,facetOptions:xt}),!0}function aI(e){return oI(e)}d();c();l();u();d();c();l();u();var ig=oe(Vi(),e=>{e.addCase(G.fulfilled,(t,r)=>{t.set={},r.payload.response.generateAutomaticFacets?.facets?.forEach(o=>{t.set[o.field]={response:o}})}).addCase(Xs,(t,r)=>{r.payload.desiredCount&&(t.desiredCount=r.payload.desiredCount),r.payload.numberOfValues&&(t.numberOfValues=r.payload.numberOfValues)}).addCase(sn,(t,r)=>{let{field:n,selection:o}=r.payload,a=t.set[n]?.response;if(!a)return;let i=a.values.find(f=>f.value===o.value);if(!i)return;let p=i.state==="selected";i.state=p?"idle":"selected"}).addCase(Zs,(t,r)=>{let n=r.payload,o=t.set[n]?.response;if(o)for(let a of o.values)a.state="idle"}).addCase(De,(t,r)=>{let n=r.payload.af??{},o=Object.keys(t.set);for(let a in n)if(!t.set[a]){let i=IQ(a),p=n[a].map(f=>iI(f));i.values.push(...p),t.set[a]={response:i}}for(let a of o)if(!(a in n)){let i=t.set[a]?.response;for(let p of i.values)p.state="idle"}for(let a in n){let i=t.set[a]?.response;if(i){let p=i.values,f=new Set(n[a]);for(let m of p)f.has(m.value)?(m.state="selected",f.delete(m.value)):m.state="idle";for(let m of f)i.values.push(iI(m))}}}).addCase(_e.fulfilled,(t,r)=>{if(r.payload&&Object.keys(r.payload.automaticFacetSet.set).length!==0)return r.payload.automaticFacetSet}).addCase(pt,t=>{Object.values(t.set).forEach(({response:r})=>{r.values.forEach(n=>{n.state="idle"})})})});function IQ(e){return{field:e,values:[],moreValuesAvailable:!1,label:"",indexScore:0}}function iI(e){return{value:e,state:"selected",numberOfResults:0}}d();c();l();u();d();c();l();u();var sg=e=>e.state==="selected",cg=e=>e.state==="excluded",ug=(e,t)=>{let r={facetId:e,facetValue:t.value};return sg(t)?Lr(r):ot(r)},lg=e=>sg(e)?Jn():mt(),sI=(e,t)=>{let r={facetId:e,facetValue:t.value};return cg(t)?Kn(r):cr(r)},cI=e=>cg(e)?PE():Yn();function uI(e,t){let{dispatch:r}=e,n=ne(e),{field:o}=t;return{...n,toggleSelect(a){r(sn({field:o,selection:a})),r(G({legacy:ug(o,a),next:lg(a)}))},deselectAll(){r(Zs(o)),r(G({legacy:vt(o),next:jt()}))},get state(){let a=e.state.automaticFacetSet?.set[o]?.response;return a?{field:a.field,label:a.label,values:a.values}:{field:"",values:[],label:""}}}}d();c();l();u();function lI(e){return{desiredCount:e.desiredCount,numberOfValues:e.numberOfValues}}function dI(e,t){if(!TQ(e))throw W;let{dispatch:r}=e,n=lI(t.options);return r(Xs(n)),{...ne(e),get state(){return{automaticFacets:e.state.search.response.generateAutomaticFacets?.facets.map(i=>uI(e,{field:i.field}))??[]}}}}function TQ(e){return e.addReducers({automaticFacetSet:ig,configuration:ue,search:fe}),!0}d();c();l();u();d();c();l();u();d();c();l();u();function dg(e,t,r){let{facetId:n}=t;if(e[n])return;let o=!1,a={...En,...t},i=r();e[n]={options:a,isLoading:o,response:i,initialNumberOfValues:a.numberOfValues,requestId:""}}function pg(e,t){let{facetId:r,...n}=t,o=e[r];o&&(o.options={...o.options,...n})}function fg(e,t,r){let n=e[t];n&&(n.requestId=r,n.isLoading=!0)}function mg(e,t){let r=e[t];r&&(r.isLoading=!1)}function gg(e,t,r){let{facetId:n,response:o}=t,a=e[n];a&&a.requestId===r&&(a.isLoading=!1,a.response=o)}function wl(e,t,r){let{facetId:n}=t,o=e[n];o&&(o.requestId="",o.isLoading=!1,o.response=r(),o.options.numberOfValues=o.initialNumberOfValues,o.options.query=En.query)}function hg(e,t){Object.keys(e).forEach(r=>wl(e,{facetId:r},t))}var En={captions:{},numberOfValues:10,query:""};d();c();l();u();d();c();l();u();var pI=/*#__PURE__*/function(){var _ref68=_asyncToGenerator(function*(e,t,r,n){let o=t.categoryFacetSearchSet[e].options,a=t.categoryFacetSet[e].request,{captions:i,query:p,numberOfValues:f}=o,{field:m,delimitingCharacter:g,basePath:S,filterFacetCount:A}=a,h=PQ(a),C=h.length?[h]:[],w=`*${p}*`;return{url:t.configuration.search.apiBaseUrl??ct(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")}),basePath:S,captions:i,numberOfValues:f,query:w,field:m,delimitingCharacter:g,ignorePaths:C,filterFacetCount:A,type:"hierarchical",...(n?{}:{searchContext:(yield yr(t,r)).request})}});return function pI(_x147,_x148,_x149,_x150){return _ref68.apply(this,arguments)}}(),PQ=e=>{let t=[],r=e.currentValues[0];for(;r;)t.push(r.value),r=r.children[0];return t};d();c();l();u();var fI=/*#__PURE__*/function(){var _ref69=_asyncToGenerator(function*(e,t,r,n){let{captions:o,query:a,numberOfValues:i}=t.facetSearchSet[e].options,{field:p,currentValues:f,filterFacetCount:m}=t.facetSet[e].request,g=f.filter(A=>A.state!=="idle").map(A=>A.value),S=`*${a}*`;return{url:t.configuration.search.apiBaseUrl??ct(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders&&{authentication:t.configuration.search.authenticationProviders.join(",")}),captions:o,numberOfValues:i,query:S,field:p,ignoreValues:g,filterFacetCount:m,type:"specific",...(n?{}:{searchContext:(yield yr(t,r)).request})}});return function fI(_x151,_x152,_x153,_x154){return _ref69.apply(this,arguments)}}();var mI=e=>(/*#__PURE__*/function(){var _ref70=_asyncToGenerator(function*(t,{getState:r,extra:{apiClient:n,validatePayload:o,navigatorContext:a}}){let i=r(),p;o(t,z),kQ(i,t)?p=yield fI(t,i,a,e):p=yield pI(t,i,a,e);let f=yield n.facetSearch(p);return{facetId:t,response:f}});return function(_x155,_x156){return _ref70.apply(this,arguments)}}()),At=Se("facetSearch/executeSearch",mI(!1)),In=Se("facetSearch/executeSearch",mI(!0)),Sc=T("facetSearch/clearResults",e=>O(e,{facetId:he})),kQ=(e,t)=>e.facetSearchSet!==void 0&&e.facetSet!==void 0&&e.facetSet[t]!==void 0;d();c();l();u();function gI(){return{}}var vc=oe(gI(),e=>{e.addCase(nc,(t,r)=>{let n=r.payload;dg(t,n,$v)}).addCase(Vo,(t,r)=>{pg(t,r.payload)}).addCase(At.pending,(t,r)=>{let n=r.meta.arg;fg(t,n,r.meta.requestId)}).addCase(At.rejected,(t,r)=>{let n=r.meta.arg;mg(t,n)}).addCase(At.fulfilled,(t,r)=>{gg(t,r.payload,r.meta.requestId)}).addCase(Sc,(t,{payload:{facetId:r}})=>{wl(t,{facetId:r},$v)}).addCase(G.fulfilled,t=>{hg(t,$v)})});function $v(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();d();c();l();u();function hI(e,t){let{field:r,state:n}=e;if(!OQ(e))return r;let o=`${r}_`,a=NQ(o,n);return DQ(r,t),`${o}${a}`}function OQ(e){let{field:t,state:r}=e;return yI(r).some(o=>o&&t in o)}function NQ(e,t){let n=yI(t).map(o=>Object.keys(o||{})).reduce((o,a)=>o.concat(a),[]);return _Q(n,e)+1}function yI(e){let{facetSet:t,numericFacetSet:r,dateFacetSet:n,categoryFacetSet:o}=e;return[t,r,n,o]}function _Q(e,t){return e.map(a=>{let i=a.split(t)[1],p=parseInt(i,10);return Number.isNaN(p)?0:p}).sort().pop()??0}function DQ(e,t){let r=`A facet with field "${e}" already exists.
|
|
45
|
-
To avoid unexpected behaviour, configure the #id option on the facet controller.`;t.warn(r)}function Lt(e,t){let{state:r,logger:n}=e,{field:o,facetId:a}=t;return a||hI({field:o,state:r},n)}d();c();l();u();d();c();l();u();var SI=["alphanumeric","occurrences"];var vI=new ge({field:pn,tabs:new J({options:{required:!1},values:{included:new ae({each:new M}),excluded:new ae({each:new M})}}),basePath:FE,delimitingCharacter:EE,facetId:dn,facetSearch:ic,filterByBasePath:IE,filterFacetCount:fn,injectionDepth:mn,numberOfValues:jr,sortCriteria:new M({constrainTo:SI})});function xI(e,t){if(!qQ(e))throw W;let r=ne(e),{dispatch:n}=e,o=Lt(e,t.options),a=t.options.tabs??{},i=Gt(e.state.tabSet),p={...xl,...Bl("facetSearch",t.options),field:t.options.field,facetId:o,tabs:a,activeTab:i},f={facetSearch:{...En,...t.options.facetSearch},...p};Be(e,vI,f,"buildCategoryFacet");let m=()=>Uy(e.state,o),g=()=>Ly(e.state,o),S=()=>$r(e.state),A=()=>Xr(e.state,o);return n(cn(p)),{...r,toggleSelect(h){let C=f.numberOfValues;n(Mo({facetId:o,selection:h,retrieveCount:C})),n(be())},deselectAll(){n(un(o)),n(be())},sortBy(h){n(tc({facetId:o,criterion:h})),n(be())},isSortedBy(h){return m().sortCriteria===h},showMoreValues(){let{numberOfValues:h}=f,{activeValue:C,valuesAsTrees:w}=this.state,R=(C?.children.length??w.length)+h;n(Ya({facetId:o,numberOfValues:R})),n(be())},showLessValues(){let{numberOfValues:h}=f;n(Ya({facetId:o,numberOfValues:h})),n(be())},enable(){n(Vt(o))},disable(){n(Je(o))},get state(){let h=m(),C=g(),w=S(),R=A(),b=C?.values??[],F=b.some(U=>U.children.length>0)??!1,{parents:E,values:P}=ob(C?.values),j=or(b),_=j.length?j[j.length-1]:void 0,k=!!_,N=_?.moreValuesAvailable??C?.moreValuesAvailable??!1,q=_?_.children.length>f.numberOfValues:b.length>f.numberOfValues;return{facetId:o,parents:E,selectedValueAncestry:j,values:P,isHierarchical:F,valuesAsTrees:b,activeValue:_,isLoading:w,hasActiveValues:k,canShowMoreValues:N,canShowLessValues:q,sortCriteria:h.sortCriteria,enabled:R}}}}function qQ(e){return e.addReducers({categoryFacetSet:ln,categoryFacetSearchSet:vc,facetOptions:xt,configuration:ue,search:fe}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var MQ="coveo-headless-internal-state",yg=Symbol.for(MQ);d();c();l();u();function xc(e,t){let r=e.dispatch,{options:n,getFacetSearch:o,executeFacetSearchActionCreator:a,executeFieldSuggestActionCreator:i}=t,{facetId:p}=n;return{updateText(f){r(Vo({facetId:p,query:f,numberOfValues:o().initialNumberOfValues}))},showMoreResults(){let{initialNumberOfValues:f,options:m}=o();r(Vo({facetId:p,numberOfValues:m.numberOfValues+f})),r(t.isForFieldSuggestions?i(p):a(p))},search(){r(t.isForFieldSuggestions?i(p):a(p))},clear(){r(Sc({facetId:p}))},updateCaptions(f){r(Vo({facetId:p,captions:f}))},get state(){let{response:f,isLoading:m,options:g}=o(),{query:S}=g,A=f.values;return{...f,values:A,isLoading:m,query:S}}}}function AI(e,t){let{dispatch:r}=e,n={...En,...t.options},{facetId:o}=n,a=()=>"state"in e?e.state.categoryFacetSearchSet[o]:e[yg].categoryFacetSearchSet[o];r(nc(n));let i=xc(e,{options:n,getFacetSearch:a,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:t.executeFacetSearchActionCreator,executeFieldSuggestActionCreator:t.executeFieldSuggestActionCreator});return{...i,select(p){r(rc({facetId:o,value:p})),t.select(p)},get state(){return i.state}}}function Sg(e,t){let{executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:o,isForFieldSuggestions:a}=t,{dispatch:i}=e,p={...En,...t.options},{facetId:f}=p,m=()=>e.state.categoryFacetSearchSet[f],g=AI(e,{options:{...p},executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:o,isForFieldSuggestions:a});i(nc(p));let S=xc(e,{options:p,getFacetSearch:m,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:At,executeFieldSuggestActionCreator:In});return{...S,...g,get state(){return{...S.state,...g.state}}}}function CI(e,t){if(!VQ(e))throw W;let r=xI(e,t),{dispatch:n}=e,o=()=>r.state.facetId,a=Sg(e,{options:{facetId:o(),...t.options.facetSearch},executeFacetSearchActionCreator:At,executeFieldSuggestActionCreator:In,select:f=>{n(be()),n(G({legacy:ot({facetId:o(),facetValue:f.rawValue}),next:mt()}))},isForFieldSuggestions:!1}),{state:i,...p}=a;return{...r,facetSearch:p,toggleSelect(f){r.toggleSelect(f),n(G({legacy:jQ(o(),f),next:LQ(f)}))},deselectAll(){r.deselectAll(),n(G({legacy:vt(o()),next:jt()}))},sortBy(f){r.sortBy(f),n(G({legacy:Sn({facetId:o(),criterion:f})}))},showMoreValues(){r.showMoreValues(),n(vr({legacy:cc(o())}))},showLessValues(){r.showLessValues(),n(vr({legacy:uc(o())}))},get state(){return{...r.state,facetSearch:a.state}}}}function VQ(e){return e.addReducers({categoryFacetSet:ln,categoryFacetSearchSet:vc,configuration:ue,search:fe}),!0}function jQ(e,t){let r={facetId:e,facetValue:t.value};return t.state==="selected"?Lr(r):ot(r)}function LQ(e){return e.state==="selected"?Jn():mt()}d();c();l();u();d();c();l();u();d();c();l();u();function bI(){return{}}var Ac=oe(bI(),e=>{e.addCase(Pm,(t,r)=>{let n=r.payload;dg(t,n,Hv)}).addCase(Vo,(t,r)=>{pg(t,r.payload)}).addCase(At.pending,(t,r)=>{let n=r.meta.arg;fg(t,n,r.meta.requestId)}).addCase(At.rejected,(t,r)=>{let n=r.meta.arg;mg(t,n)}).addCase(At.fulfilled,(t,r)=>{gg(t,r.payload,r.meta.requestId)}).addCase(Sc,(t,{payload:r})=>{wl(t,r,Hv)}).addCase(G.fulfilled,t=>{hg(t,Hv)})});function Hv(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();var RI={facetId:he,selection:new J({values:Ka})},wI=Se("facet/executeToggleSelect",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},RI),n(hn({facetId:e,selection:t})),n(be())}),FI=Se("facet/executeToggleExclude",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},RI),n(yn({facetId:e,selection:t})),n(be())});d();c();l();u();d();c();l();u();var Cc=["allValues","atLeastOneValue"];d();c();l();u();var vg=["score","alphanumeric","alphanumericDescending","occurrences","automatic","alphanumericNatural","alphanumericNaturalDescending"];var EI=new ge({facetId:dn,tabs:new J({options:{required:!1},values:{included:new ae({each:new M}),excluded:new ae({each:new M})}}),field:pn,filterFacetCount:fn,injectionDepth:mn,numberOfValues:jr,sortCriteria:new M({constrainTo:vg}),resultsMustMatch:new M({constrainTo:Cc}),facetSearch:ic});function II(e,t,r=EI){if(!UQ(e))throw W;let{dispatch:n}=e,o=ne(e),a=Lt(e,t.options),i=t.options.tabs??{},p=Gt(e.state.tabSet),f={...Al,...Bl("facetSearch",t.options),field:t.options.field,facetId:a,tabs:i,activeTab:p},m={facetSearch:{...En,...t.options.facetSearch},...f};Be(e,r,m,"buildFacet");let g=()=>kd(e.state,a),S=()=>ji(e.state,a),A=()=>$r(e.state),h=()=>Xr(e.state,a),C=()=>{let{currentValues:R}=g();return R.filter(b=>b.state!=="idle").length},w=()=>{let{currentValues:R}=g(),b=m.numberOfValues,F=!!R.find(E=>E.state==="idle");return b<R.length&&F};return n(gn(f)),{...o,toggleSelect:R=>n(wI({facetId:m.facetId,selection:R})),toggleExclude:R=>n(FI({facetId:m.facetId,selection:R})),toggleSingleSelect:function(R){R.state==="idle"&&n(Xe(a)),this.toggleSelect(R)},toggleSingleExclude:function(R){R.state==="idle"&&n(Xe(a)),this.toggleExclude(R)},isValueSelected:sg,isValueExcluded:cg,deselectAll(){n(Xe(a)),n(be())},sortBy(R){n(sc({facetId:a,criterion:R})),n(be())},isSortedBy(R){return this.state.sortCriterion===R},showMoreValues(){let R=g().numberOfValues,b=m.numberOfValues,F=b-R%b,E=R+F;n(Ja({facetId:a,numberOfValues:E})),n(Xa({facetId:a,isFieldExpanded:!0})),n(be())},showLessValues(){let R=m.numberOfValues,b=Math.max(R,C());n(Ja({facetId:a,numberOfValues:b})),n(Xa({facetId:a,isFieldExpanded:!1})),n(be())},enable(){n(Vt(a))},disable(){n(Je(a))},get state(){let R=g(),b=S(),F=A(),E=h(),P;typeof R.sortCriteria=="object"?P=R.sortCriteria.order==="descending"?"alphanumericDescending":"alphanumeric":P=R.sortCriteria;let j=b?b.values:[],_=j.some(q=>q.state!=="idle"),k=b?b.moreValuesAvailable:!1,N=R.resultsMustMatch;return{label:b?.label,facetId:a,tabs:i,values:j,sortCriterion:P,resultsMustMatch:N,isLoading:F,hasActiveValues:_,canShowMoreValues:k,canShowLessValues:w(),enabled:E}}}}function UQ(e){return e.addReducers({facetSet:Rr,facetOptions:xt,configuration:ue,facetSearchSet:Ac}),!0}d();c();l();u();function xg(e,t){let{dispatch:r}=e,{options:n,select:o,exclude:a,isForFieldSuggestions:i,executeFacetSearchActionCreator:p,executeFieldSuggestActionCreator:f}=t,{facetId:m}=n,g=()=>"state"in e?e.state.facetSearchSet[m]:e[yg].facetSearchSet[m];r(Pm(n));let S=xc(e,{options:n,getFacetSearch:g,isForFieldSuggestions:i,executeFacetSearchActionCreator:p,executeFieldSuggestActionCreator:f});return{...S,select(A){r(Za({facetId:m,value:A})),o(A)},exclude(A){r(ei({facetId:m,value:A})),a(A)},singleSelect(A){r(Xe(m)),r(Za({facetId:m,value:A})),o(A)},singleExclude(A){r(Xe(m)),r(ei({facetId:m,value:A})),a(A)},get state(){let{values:A}=S.state;return{...S.state,values:A.map(({count:h,displayValue:C,rawValue:w})=>({count:h,displayValue:C,rawValue:w}))}}}}d();c();l();u();var TI=new ge({facetId:dn,field:pn,tabs:new J({options:{required:!1},values:{included:new ae({each:new M}),excluded:new ae({each:new M})}}),filterFacetCount:fn,injectionDepth:mn,numberOfValues:jr,sortCriteria:new M({constrainTo:vg}),resultsMustMatch:new M({constrainTo:Cc}),facetSearch:ic,allowedValues:Em,hasBreadcrumbs:TE,customSort:Im});function PI(e,t){if(!QQ(e))throw W;let{dispatch:r}=e,n=II(e,{...t,options:{...t.options,...(t.options.allowedValues&&{allowedValues:{type:"simple",values:t.options.allowedValues}})}},TI),o=()=>n.state.facetId,i=(()=>{let{facetSearch:m}=t.options;return xg(e,{options:{facetId:o(),...m},select:g=>{r(be()),r(G({legacy:ot({facetId:o(),facetValue:g.rawValue}),next:mt()}))},exclude:g=>{r(be()),r(G({legacy:cr({facetId:o(),facetValue:g.rawValue}),next:Yn()}))},isForFieldSuggestions:!1,executeFacetSearchActionCreator:At,executeFieldSuggestActionCreator:In})})(),{state:p,...f}=i;return{...n,facetSearch:f,toggleSelect(m){n.toggleSelect(m),r(G({legacy:ug(o(),m),next:lg(m)}))},toggleExclude(m){n.toggleExclude(m),r(G({legacy:sI(o(),m),next:cI(m)}))},deselectAll(){n.deselectAll(),r(G({legacy:vt(o()),next:jt()}))},sortBy(m){n.sortBy(m),r(G({legacy:Sn({facetId:o(),criterion:m})}))},isSortedBy(m){return this.state.sortCriterion===m},showMoreValues(){n.showMoreValues(),r(vr({legacy:cc(o())}))},showLessValues(){n.showLessValues(),r(vr({legacy:uc(o())}))},get state(){return{...n.state,facetSearch:i.state}}}}function QQ(e){return e.addReducers({facetSet:Rr,configuration:ue,facetSearchSet:Ac,search:fe}),!0}d();c();l();u();d();c();l();u();var Ag=e=>e.state==="selected",zv=e=>e.state==="excluded",Cg=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return Ag(t)?Lr(n):ot(n)},bg=e=>Ag(e)?Jn():mt(),kI=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return zv(t)?Kn(n):cr(n)};d();c();l();u();d();c();l();u();d();c();l();u();var Rg=T("rangeFacet/executeToggleSelect",e=>O(e,ni(e.selection))),wg=T("rangeFacet/executeToggleExclude",e=>O(e,ni(e.selection)));var OI={facetId:he,selection:new J({values:ri})},NI=Se("dateFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,OI),t(xn(e)),t(Rg(e)),t(be())}),_I=Se("dateFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,OI),t(An(e)),t(wg(e)),t(be())});d();c();l();u();function Fg(e,t){if(!e.generateAutomaticRanges&&e.currentValues===void 0){let r=`currentValues should be specified for ${t} when generateAutomaticRanges is false.`;throw new Error(r)}}d();c();l();u();function Eg(e,t){let{facetId:r,getRequest:n}=t,o=ne(e),a=e.dispatch,i=()=>Xr(e.state,r);return{...o,isValueSelected:Ag,isValueExcluded:zv,deselectAll(){a(Xe(r)),a(be())},sortBy(p){a(dc({facetId:r,criterion:p})),a(be())},isSortedBy(p){return this.state.sortCriterion===p},enable(){a(Vt(r))},disable(){a(Je(r))},get state(){let p=n(),f=Nr(e.state,r),m=p.sortCriteria,g=p.resultsMustMatch,S=f?f.values:[],A=$r(e.state),h=i(),C=S.some(R=>R.state!=="idle"),w=f?.domain;return{facetId:r,values:S,sortCriterion:m,resultsMustMatch:g,hasActiveValues:C,isLoading:A,enabled:h,domain:w}}}}d();c();l();u();d();c();l();u();var Ig=["idle","selected","excluded"];d();c();l();u();var Tg=["ascending","descending"],Pg=["even","equiprobable"];var BQ={start:new M,end:new M,endInclusive:new ce,state:new M({constrainTo:Ig})},GQ=new ge({facetId:dn,field:pn,tabs:new J({options:{required:!1},values:{included:new ae({each:new M}),excluded:new ae({each:new M})}}),generateAutomaticRanges:Fm,filterFacetCount:fn,injectionDepth:mn,numberOfValues:jr,currentValues:new ae({each:new J({values:BQ})}),sortCriteria:new M({constrainTo:Tg}),rangeAlgorithm:new M({constrainTo:Pg})});function kg(e,t){Be(e,GQ,t,"buildDateFacet"),Nm(t)}function DI(e,t){if(!$Q(e))throw W;Fg(t.options,"buildDateFacet");let r=e.dispatch,n=Lt(e,t.options),o=t.options.tabs??{},a=Gt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:a};kg(e,i),r(vn(i));let p=Eg(e,{facetId:n,getRequest:()=>e.state.dateFacetSet[n].request});return{...p,toggleSelect:f=>r(NI({facetId:n,selection:f})),toggleSingleSelect:function(f){f.state==="idle"&&r(Xe(n)),this.toggleSelect(f)},toggleExclude:f=>r(_I({facetId:n,selection:f})),toggleSingleExclude:function(f){f.state==="idle"&&r(Xe(n)),this.toggleExclude(f)},get state(){return p.state}}}function $Q(e){return e.addReducers({configuration:ue,search:fe,dateFacetSet:bn,facetOptions:xt}),!0}function qI(e,t){let r=DI(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(G({legacy:vt(o()),next:jt()}))},sortBy(a){r.sortBy(a),n(G({legacy:Sn({facetId:o(),criterion:a})}))},toggleSelect:a=>{r.toggleSelect(a),n(G({legacy:Cg(o(),a),next:bg(a)}))},toggleExclude:a=>{r.toggleExclude(a),n(G({legacy:kI(o(),a)}))},get state(){return r.state}}}d();c();l();u();d();c();l();u();function MI(e,t){if(!HQ(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a=Lt(e,t.options),i=t.options.tabs??{},p=Gt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:a,tabs:i,activeTab:p};kg(e,f),n(vn(f));let m=()=>Xr(e.state,a);return{...r,clear:()=>{n(Xn({facetId:a,values:[]})),n(be())},setRange:g=>{let S={...g,state:"selected",numberOfResults:0,endInclusive:!0},A=Xn({facetId:a,values:[S]});return A.error?!1:(n(A),n(be()),!0)},enable(){n(Vt(a))},disable(){n(Je(a))},get state(){let g=$r(o()),S=m(),A=VE(o(),a),h=A.length?A[0]:void 0;return{facetId:a,isLoading:g,range:h,enabled:S}}}}function HQ(e){return e.addReducers({dateFacetSet:bn,facetOptions:xt,configuration:ue,search:fe}),!0}function VI(e,t){if(!zQ(e))throw W;let r=MI(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(G({legacy:vt(o()),next:jt()}))},setRange:a=>{let i=r.setRange(a);return i&&n(G({legacy:ot({facetId:o(),facetValue:`${a.start}..${a.end}`}),next:mt()})),i},get state(){return{...r.state}}}}function zQ(e){return e.addReducers({dateFacetSet:bn,configuration:ue,search:fe}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var jI={facetId:he,selection:new J({values:ti})},LI=Se("numericFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,jI),t(wn(e)),t(Rg(e)),t(be())}),$je=Se("numericFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,jI),t(Fn(e)),t(wg(e)),t(be())});d();c();l();u();var WQ={start:new ee,end:new ee,endInclusive:new ce,state:new M({constrainTo:Ig})},KQ=new ge({facetId:dn,tabs:new J({options:{required:!1},values:{included:new ae({each:new M}),excluded:new ae({each:new M})}}),field:pn,generateAutomaticRanges:Fm,filterFacetCount:fn,injectionDepth:mn,numberOfValues:jr,currentValues:new ae({each:new J({values:WQ})}),sortCriteria:new M({constrainTo:Tg}),resultsMustMatch:new M({constrainTo:Cc}),rangeAlgorithm:new M({constrainTo:Pg})});function Og(e,t){Be(e,KQ,t,"buildNumericFacet"),Hm(t)}d();c();l();u();function bc(e){return{endInclusive:!1,state:"idle",...e}}function UI(e,t){if(!YQ(e))throw W;Fg(t.options,"buildNumericFacet");let r=e.dispatch,n=Lt(e,t.options),o=t.options.tabs??{},a=Gt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:a};Og(e,i),r(Rn(i));let p=Eg(e,{facetId:n,getRequest:()=>e.state.numericFacetSet[n].request});return{...p,toggleSelect:f=>r(LI({facetId:n,selection:f})),toggleSingleSelect(f){f.state==="idle"&&r(Xe(n)),this.toggleSelect(f)},get state(){return p.state}}}function YQ(e){return e.addReducers({numericFacetSet:wr,facetOptions:xt,configuration:ue,search:fe}),!0}function QI(e,t){if(!JQ(e))throw W;let r=UI(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(G({legacy:vt(o()),next:jt()}))},sortBy(a){r.sortBy(a),n(G({legacy:Sn({facetId:o(),criterion:a})}))},toggleSelect:a=>{r.toggleSelect(a),n(G({legacy:Cg(o(),a),next:bg(a)}))},get state(){return{...r.state}}}}function JQ(e){return e.addReducers({numericFacetSet:wr,configuration:ue,search:fe}),!0}d();c();l();u();d();c();l();u();function BI(e,t){if(!XQ(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a=Lt(e,t.options),i=t.options.tabs??{},p=Gt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:a,tabs:i,activeTab:p};Og(e,f),n(Rn(f));let m=()=>Xr(e.state,a);return{...r,clear:()=>{n(Zn({facetId:a,values:[]})),n(be())},setRange:g=>{let S={...g,state:"selected",numberOfResults:0,endInclusive:!0},A=Zn({facetId:a,values:[S]});return A.error?!1:(n(A),n(be()),!0)},enable(){n(Vt(a))},disable(){n(Je(a))},get state(){let g=$r(o()),S=m(),A=BE(o(),a),h=A.length?A[0]:void 0;return{facetId:a,isLoading:g,range:h,enabled:S}}}}function XQ(e){return e.addReducers({numericFacetSet:wr,facetOptions:xt,configuration:ue,search:fe}),!0}function GI(e,t){if(!ZQ(e))throw W;let r=BI(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(G({legacy:vt(o()),next:jt()}))},setRange:a=>{let i=r.setRange(a);return i&&n(G({legacy:ot({facetId:o(),facetValue:`${a.start}..${a.end}`}),next:mt()})),i},get state(){return{...r.state}}}}function ZQ(e){return e.addReducers({numericFacetSet:wr,configuration:ue,search:fe}),!0}d();c();l();u();function $I(e,t){if(!eB(e))throw W;let{facetSearch:r,...n}=t.options.facet,o=Lt(e,n);e.dispatch(cn({...xl,...n,facetId:o}));let a=Sg(e,{options:{...r,facetId:o},executeFacetSearchActionCreator:At,executeFieldSuggestActionCreator:In,select:p=>{e.dispatch(be()),e.dispatch(G({legacy:ot({facetId:o,facetValue:p.rawValue}),next:mt()}))},isForFieldSuggestions:!0});return{...ne(e),...a,updateText:p=>{a.updateText(p),a.search()},get state(){return a.state}}}function eB(e){return e.addReducers({categoryFacetSet:ln,configuration:ue,categoryFacetSearchSet:vc,search:fe}),!0}d();c();l();u();function HI(e,t){if(!tB(e))throw W;let{facetSearch:r,allowedValues:n,...o}=t.options.facet,a=Lt(e,o);e.dispatch(gn({...Al,...o,facetId:a,...(n&&{allowedValues:{type:"simple",values:n}})}));let i=xg(e,{options:{...r,facetId:a},select:f=>{e.dispatch(be()),e.dispatch(G({legacy:ot({facetId:a,facetValue:f.rawValue}),next:mt()}))},exclude:f=>{e.dispatch(be()),e.dispatch(G({legacy:cr({facetId:a,facetValue:f.rawValue}),next:Yn()}))},isForFieldSuggestions:!0,executeFacetSearchActionCreator:At,executeFieldSuggestActionCreator:In});return{...ne(e),...i,updateText:f=>{i.updateText(f),i.search()},get state(){return i.state}}}function tB(e){return e.addReducers({facetSet:Rr,configuration:ue,facetSearchSet:Ac,search:fe}),!0}d();c();l();u();d();c();l();u();var Wv={collectionField:new M({emptyAllowed:!1,required:!1}),parentField:new M({emptyAllowed:!1,required:!1}),childField:new M({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new ee({min:0,required:!1})},Uo=T("folding/register",e=>O(e,Wv)),Qo=Se("folding/loadCollection",/*#__PURE__*/function(){var _ref71=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let a=t(),i=a.configuration.analytics.analyticsMode==="legacy"?yield So(a):ds(a,o),p=yield n.search({...i,q:rB(a),enableQuerySyntax:!0,cq:`@${a.folding.fields.collection}="${e}"`,filterField:a.folding.fields.collection,childField:a.folding.fields.parent,parentField:a.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return ht(p)?r(p.error):{collectionId:e,results:p.success.results,searchUid:p.success.searchUid,rootResult:a.folding.collections[e].result}});return function(_x157,_x158){return _ref71.apply(this,arguments)}}());function rB(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}d();c();l();u();var nB=e=>Y("analytics/folding/showMore",(t,r)=>(Kt(e),t.makeShowMoreFoldedResults(dt(e,r),He(e)))),oB=()=>Y("analytics/folding/showLess",e=>e.makeShowLessFoldedResults()),zI={logShowMoreFoldedResults:nB,logShowLessFoldedResults:oB};d();c();l();u();d();c();l();u();d();c();l();u();var Ng=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});function aB(e,t){return e.raw[t.collection]}function Kv(e,t){return e.raw[t.parent]}function Fl(e,t){let r=e.raw[t.child];return Ul(r)?r[0]:r}function iB(e,t){return(e||t)!==void 0&&e===t}function KI(e,t,r,n=[]){let o=Fl(e,r);return o?n.indexOf(o)!==-1?[]:t.filter(a=>{let i=Fl(a,r)===Fl(e,r);return Kv(a,r)===o&&!i}).map(a=>{let i={...a,searchUid:e.searchUid};return{result:i,children:KI(i,t,r,[...n,o])}}):[]}function sB(e,t){return e.find(r=>{let n=Kv(r,t)===void 0,o=iB(Kv(r,t),Fl(r,t));return n||o})}function YI(e){return e.parentResult?YI(e.parentResult):e}function cB(e,t,r,n){let o=Ud(e),i={...(n??sB(o,t)??YI(e)),searchUid:r},p=KI(i,o,t);return{result:i,children:p,moreResultsAvailable:e.totalNumberOfChildResults>p.length+1,isLoadingMoreResults:!1}}function _g(e,t,r,n){let o={};return e.forEach(a=>{let i=aB(a,t);i&&(!Fl(a,t)&&!a.parentResult||(o[i]=cB(a,t,r,n)))}),o}function WI(e,t){if(!e.collections[t])throw new Error(`Missing collection ${t} from ${Object.keys(e.collections)}: Folding most probably in an invalid state...`);return e.collections[t]}var Dg=oe(Ng(),e=>e.addCase(G.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?_g(r.response.results,t.fields,r.response.searchUid):{}}).addCase(qt.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?_g(r.response.results,t.fields,r.response.searchUid):{}}).addCase(Sr.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?{...t.collections,..._g(r.response.results,t.fields,r.response.searchUid)}:{}}).addCase(Uo,(t,{payload:r})=>t.enabled?t:{enabled:!0,collections:{},fields:{collection:r.collectionField??t.fields.collection,parent:r.parentField??t.fields.parent,child:r.childField??t.fields.child},filterFieldRange:r.numberOfFoldedResults??t.filterFieldRange}).addCase(Qo.pending,(t,{meta:r})=>{let n=r.arg;WI(t,n).isLoadingMoreResults=!0}).addCase(Qo.rejected,(t,{meta:r})=>{let n=r.arg;WI(t,n).isLoadingMoreResults=!1}).addCase(Qo.fulfilled,(t,{payload:{collectionId:r,results:n,rootResult:o,searchUid:a}})=>{let i=_g(n,t.fields,a,o);if(!i||!i[r])throw new Error(`Unable to create collection ${r} from received results: ${JSON.stringify(n)}. Folding most probably in an invalid state... `);t.collections[r]=i[r],t.collections[r].moreResultsAvailable=!1}));d();c();l();u();d();c();l();u();var El={id:z},Rc=T("querySuggest/register",e=>O(e,{...El,count:new ee({min:0})})),JI=T("querySuggest/unregister",e=>O(e,El)),Tn=T("querySuggest/selectSuggestion",e=>O(e,{...El,expression:Ue})),Bo=T("querySuggest/clear",e=>O(e,El)),Go=Se("querySuggest/fetch",/*#__PURE__*/function(){var _ref72=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,validatePayload:o,navigatorContext:a}}){o(e,El);let i=e.id,p=yield uB(i,t(),a),f=yield n.querySuggest(p);return ht(f)?r(f.error):{id:i,q:p.q,...f.success}});return function(_x159,_x160){return _ref72.apply(this,arguments)}}()),uB=/*#__PURE__*/function(){var _ref73=_asyncToGenerator(function*(e,t,r){return{accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,url:t.configuration.search.apiBaseUrl??ct(t.configuration.organizationId,t.configuration.environment),count:t.querySuggest[e].count,q:t.querySet[e],locale:t.configuration.search.locale,timezone:t.configuration.search.timezone,actionsHistory:t.configuration.analytics.enabled?Wt.getInstance().getHistory():[],...(t.context&&{context:t.context.contextValues}),...(t.pipeline&&{pipeline:t.pipeline}),...(t.searchHub&&{searchHub:t.searchHub}),tab:t.configuration.analytics.originLevel2,...(t.configuration.analytics.enabled&&{...(t.configuration.analytics.enabled&&t.configuration.analytics.analyticsMode==="legacy"?yield ps(t.configuration.analytics):Ln(t.configuration.analytics,r))}),...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")})}});return function uB(_x161,_x162,_x163){return _ref73.apply(this,arguments)}}();var Ct=oe(lt(),e=>e.addCase(Dt,(t,r)=>({...t,...r.payload})).addCase(gr,(t,r)=>{t.q=r.payload}).addCase(Tn,(t,r)=>{t.q=r.payload.expression}).addCase(_e.fulfilled,(t,r)=>r.payload?.query??t).addCase(De,(t,r)=>{t.q=r.payload.q??t.q,t.enableQuerySyntax=r.payload.enableQuerySyntax??t.enableQuerySyntax}));d();c();l();u();d();c();l();u();var $o=T("fields/registerFieldsToInclude",e=>O(e,Zl)),wc=T("fields/fetchall/enable"),ci=T("fields/fetchall/disable"),Fc=Se("fields/fetchDescription",/*#__PURE__*/function(){var _ref74=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:a,environment:i,organizationId:p}=o.configuration,{apiBaseUrl:f}=o.configuration.search,m=yield t.apiClient.fieldDescriptions({accessToken:a,organizationId:p,url:f??ct(p,i)});return ht(m)?n(m.error):m.success.fields});return function(_x164,_x165){return _ref74.apply(this,arguments)}}());d();c();l();u();d();c();l();u();var qg=["author","language","urihash","objecttype","collection","source","permanentid"],Yv=[...qg,"date","filetype","parents"],XI=[...Yv,"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"],ZI=()=>({fieldsToInclude:qg,fetchAllFields:!1,fieldsDescription:[]});var Ho=oe(ZI(),e=>e.addCase($o,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(wc,t=>{t.fetchAllFields=!0}).addCase(ci,t=>{t.fetchAllFields=!1}).addCase(Fc.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(Uo,(t,{payload:r})=>{let n=Ng().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));d();c();l();u();function Ec(e){if(!lB(e))throw W;let t=ne(e),r=()=>e.state;return{...t,get state(){let n=r();return{hasError:n.search.error!==null,isLoading:n.search.isLoading,hasResults:!!n.search.results.length,firstSearchExecuted:Yu(n)}}}}function lB(e){return e.addReducers({search:fe}),!0}var dB=new ge({fieldsToInclude:new ae({required:!1,each:new M({required:!0,emptyAllowed:!1})})});function Mg(e,t){if(!pB(e))throw W;let r=ne(e),n=Ec(e),{dispatch:o}=e,a=()=>e.state,i=Be(e,dB,t?.options,"buildCoreResultList");i.fieldsToInclude&&o($o(i.fieldsToInclude));let p=()=>e.state.search.results.length<e.state.search.response.totalCountFiltered,f=0,m=0,g=5,S=200,A=!1;return{...r,get state(){let C=a();return{...n.state,results:C.search.results,moreResultsAvailable:p(),searchResponseId:C.search.searchResponseId}},fetchMoreResults:function(){var _ref75=_asyncToGenerator(function*(){if(e.state.search.isLoading)return;if(!p()){e.logger.info("No more results are available for the result list to fetch.");return}if(Date.now()-f<S){if(m++,m>=g){f=Date.now(),!A&&e.logger.error(`The result list method "fetchMoreResults" execution prevented because it has been triggered consecutively ${g} times, with little delay. Please verify the conditions under which the function is called.`),A=!0;return}}else m=0;A=!1,t?.fetchMoreResultsActionCreator&&(yield o(t?.fetchMoreResultsActionCreator()),f=Date.now())});return function fetchMoreResults(){return _ref75.apply(this,arguments)}}()}}function pB(e){return e.addReducers({search:fe,configuration:ue,fields:Ho}),!0}var fB=new ge(Wv);function eT(e,t,r){if(!mB(e))throw W;let n=Mg(e,t),{dispatch:o}=e,a=()=>e.state,i=t.options?.folding?Be(e,fB,t.options.folding,"buildFoldedResultList"):{};return o(Uo({...i})),{...n,loadCollection:p=>{o(t.loadCollectionActionCreator(p.result.raw[e.state.folding.fields.collection])),o(r.logShowMoreFoldedResults(p.result))},logShowMoreFoldedResults:p=>{o(r.logShowMoreFoldedResults(p))},logShowLessFoldedResults:()=>{o(r.logShowLessFoldedResults())},findResultById(p){return Jv(this.state.results,f=>f.result.uniqueId===p.result.uniqueId)},findResultByCollection(p){return Jv(this.state.results,f=>f.result.raw.foldingcollection===p.result.raw.foldingcollection)},get state(){let p=a();return{...n.state,results:n.state.results.map(f=>{let m=f.raw[p.folding.fields.collection];return!m||!p.folding.collections[m]?{result:f,moreResultsAvailable:!1,isLoadingMoreResults:!1,children:[]}:p.folding.collections[m]})}}}}function mB(e){return e.addReducers({search:fe,configuration:Up,folding:Dg,query:Ct}),!0}function Jv(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(t(n))return n;if(n.children.length){let o=Jv(n.children,t);if(o)return o}}return null}function tT(e,t={}){let r=eT(e,{...t,loadCollectionActionCreator:Qo,fetchMoreResultsActionCreator:Sr},zI);return{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Ic(e){let t=new Set;return e.filter(r=>{let n=!t.has(r.uri);return n&&t.add(r.uri),n})}var Tc=oe(qS(),e=>e.addCase(Ts,(t,{payload:r})=>{t.isVisible=r}).addCase(el,(t,{payload:r})=>{t.isEnabled=r}).addCase(Pp,(t,{payload:r})=>{t.id=r.id}).addCase(va,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.answer||(t.answer=""),t.answer+=r.textDelta,delete t.error}).addCase(xa,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.citations=Ic([...t.citations,...r.citations]),delete t.error}).addCase(Aa,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!1,t.error={...r,isRetryable:r.code===jh},t.citations=[],delete t.answer}).addCase(Fp,t=>{t.liked=!0,t.disliked=!1}).addCase(Ep,t=>{t.liked=!1,t.disliked=!0}).addCase(Ip,t=>{t.feedbackModalOpen=!0}).addCase(kp,t=>{t.feedbackModalOpen=!1}).addCase(ks,t=>{t.feedbackSubmitted=!0}).addCase(sr,t=>({...qS(),...(t.answerConfigurationId?{answerConfigurationId:t.answerConfigurationId}:{}),responseFormat:t.responseFormat,fieldsToIncludeInCitations:t.fieldsToIncludeInCitations,isVisible:t.isVisible,id:t.id})).addCase(Zr,(t,{payload:r})=>{t.isLoading=r}).addCase(Sa,(t,{payload:r})=>{t.isStreaming=r}).addCase(Ca,(t,{payload:r})=>{t.answerContentFormat=r}).addCase(Op,(t,{payload:r})=>{t.responseFormat=r}).addCase(_p,(t,r)=>{t.fieldsToIncludeInCitations=[...new Set(t.fieldsToIncludeInCitations.concat(r.payload))]}).addCase(rl,(t,{payload:r})=>{t.isAnswerGenerated=r}).addCase(tl,t=>{t.expanded=!0}).addCase(Tp,t=>{t.expanded=!1}).addCase(Np,(t,{payload:r})=>{t.answerConfigurationId=r}).addCase(ba,(t,{payload:r})=>{t.cannotAnswer=r}).addCase(VS,(t,{payload:r})=>{t.answerApiQueryParams=r}).addCase(Ps,(t,{payload:r})=>{t.answerId=r}).addCase(wp,(t,{payload:r})=>{t.answerGenerationMode=r}).addCase(Dp,(t,{payload:r})=>{t.generationSteps.push({name:r.name,status:"active",startedAt:r.startedAt})}).addCase(qp,(t,{payload:r})=>{let n=t.generationSteps.findLast(o=>o.name===r.name&&o.status==="active");n&&(n.status="completed",n.finishedAt=r.finishedAt)}));d();c();l();u();function Pc(e,t,r={}){if(!gB(e))throw W;let{dispatch:n}=e,o=ne(e),a=()=>e.state,i=r.initialState?.isVisible;i!==void 0&&n(Ts(i));let p=r.initialState?.responseFormat;p&&n(Op(p));let f=r.fieldsToIncludeInCitations;return f&&n(_p(f)),r.initialState?.expanded&&n(tl()),{...o,get state(){return a().generatedAnswer},like(g){this.state.liked||(n(Fp()),n(t.logLikeGeneratedAnswer(g)))},dislike(g){this.state.disliked||(n(Ep()),n(t.logDislikeGeneratedAnswer(g)))},openFeedbackModal(){n(Ip())},closeFeedbackModal(){n(kp())},sendFeedback(g){n(t.logGeneratedAnswerFeedback(g)),n(ks())},logCitationClick(g,S){n(t.logOpenGeneratedAnswerSource(g,S))},logCitationHover(g,S,A){n(t.logHoverCitation(g,S,A))},show(){this.state.isVisible||(n(Ts(!0)),n(t.logGeneratedAnswerShowAnswers()))},hide(){this.state.isVisible&&(n(Ts(!1)),n(t.logGeneratedAnswerHideAnswers()))},expand(){this.state.expanded||(n(tl()),n(t.logGeneratedAnswerExpand()))},collapse(){this.state.expanded&&(n(Tp()),n(t.logGeneratedAnswerCollapse()))},enable(){this.state.isEnabled||n(el(!0))},disable(){this.state.isEnabled&&n(el(!1))},logCopyToClipboard(g){n(t.logCopyGeneratedAnswer(g))},retry(){}}}function gB(e){return e.addReducers({generatedAnswer:Tc}),!0}var Ut={engines:{},setAbortControllerRef:(e,t)=>{Ut.engines[t].abortController=e},getIsStreamInProgress:e=>!Ut.engines[e].abortController||Ut.engines[e].abortController?.signal.aborted?(Ut.engines[e].abortController=void 0,!1):!0,subscribeToSearchRequests:e=>{let t=()=>{let r=e.state,n=r.search.requestId,o=r.search.extendedResults.generativeQuestionAnsweringId,a=r.generatedAnswer.id;if(Ut.engines[a].lastRequestId!==n){if(Ut.engines[a].lastRequestId=n,Ut.engines[a].abortController?.abort(),r.generatedAnswer.isEnabled===!1)return;e.dispatch(sr())}if(!Ut.getIsStreamInProgress(a)&&o&&o!==Ut.engines[a].lastStreamId){if(Ut.engines[a].lastStreamId=o,r.generatedAnswer.isEnabled===!1)return;e.dispatch(rw({setAbortControllerRef:p=>Ut.setAbortControllerRef(p,a)}))}};return e.subscribe(t)}};function rT(e,t,r={}){if(!hB(e))throw W;let n=Pc(e,t,r),o=()=>e.state;if(e.state.generatedAnswer.id&&!Ut.engines[e.state.generatedAnswer.id]&&(Ut.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:e.state.search.requestId,lastStreamId:e.state.search.extendedResults.generativeQuestionAnsweringId??""}),!e.state.generatedAnswer.id){let i=oo("genQA-",12);e.dispatch(Pp({id:i}))}Ut.engines[e.state.generatedAnswer.id]||(Ut.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:"",lastStreamId:""}),Ut.subscribeToSearchRequests(e);let a=i=>"executeFirstSearchAfterStandaloneSearchBoxRedirect"in i;return{...n,get state(){return o().generatedAnswer},retry(){a(e)&&e.dispatch(G({legacy:t.logRetryGeneratedAnswer()}))}}}function hB(e){return e.addReducers({generatedAnswer:Tc}),!0}d();c();l();u();d();c();l();u();var nT=jp.injectEndpoints({endpoints:e=>({post:e.query({query:t=>({url:"/evaluations",method:"POST",body:t})})})});var Vg=e=>e==="yes"?!0:e==="no"?!1:null,yB=({answerApiState:e,feedback:t,query:r})=>({additionalNotes:t.details??null,answer:{text:e.answer,responseId:e.answerId,format:e.contentFormat??"text/plain"},correctAnswerUrl:t.documentUrl??null,details:{correctTopic:Vg(t.correctTopic),documented:Vg(t.documented),hallucinationFree:Vg(t.hallucinationFree),readable:Vg(t.readable)},helpful:t.helpful,question:r}),SB=e=>{let t="",r=()=>{let n=e.state,o=QR(n),a=o.requestId;a!==t&&(t=a,e.dispatch(sr()),o.q?.length>0&&e.dispatch(Mp()))};e.subscribe(r)};function oT(e,t,r={}){if(!vB(e))throw W;Do(e.state.configuration.analytics.analyticsMode);let{...n}=Pc(e,t,r),o=()=>e.state;return e.dispatch(Np(r.answerConfigurationId)),SB(e),{...n,get state(){let a=jS(e.state).data,i=o().generatedAnswer;return{...i,answer:a?.answer,citations:Ic(a?.citations??[]),error:{message:a?.error?.message,statusCode:a?.error?.code},isLoading:a?.isLoading??!1,isStreaming:a?.isStreaming??!1,answerContentFormat:a?.contentFormat??"text/plain",isAnswerGenerated:a?.generated??!1,cannotAnswer:i.cannotAnswer||a?.generated===!1&&!a?.isLoading&&!a?.isStreaming}},retry(){let a=Cp(o());e.dispatch(Vp(a??ga))},reset(){e.dispatch(sr())},sendFeedback(a){return _asyncToGenerator(function*(){e.dispatch(t.logGeneratedAnswerFeedback(a));let i=yB({query:o().query.q,feedback:a,answerApiState:jS(e.state).data});e.dispatch(nT.endpoints.post.initiate(i)),e.dispatch(ks())})()}}}function vB(e){return e.addReducers({[Ra.reducerPath]:Ra.reducer,query:Ct}),!0}d();c();l();u();d();c();l();u();var Xv=class extends Zf{requestInit(t){let{q:r,conversationId:n,accessToken:o}=t.forwardedProps||{};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${o}`,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({q:r,conversationId:n}),signal:this.abortController.signal}}},aT=(e,t,r)=>new Xv({url:`${em(e,t,r)}/follow-up`});d();c();l();u();var iT=e=>{let t="";return{onRunStartedEvent:({event:r})=>{t=r.runId,e(om(t)),e(im({answerId:t,isLoading:!1})),e(sm({answerId:t,isStreaming:!0}))},onStepStartedEvent:({event:r})=>{e(hm({name:r.stepName,startedAt:r.timestamp??Date.now(),answerId:t}))},onStepFinishedEvent:({event:r})=>{e(ym({name:r.stepName,finishedAt:r.timestamp??Date.now(),answerId:t}))},onTextMessageContentEvent:({event:r})=>{e(cm({textDelta:r.delta,answerId:t}))},onCustomEvent:({event:r})=>{let{name:n,value:o}=r;switch(n){case"header":{o?.contentFormat&&e(am({contentFormat:o.contentFormat,answerId:t}));return}case"citations":{e(um({citations:o.citations,answerId:t}));return}}},onRunErrorEvent:({event:r})=>{let n=Sm(r.code);e(dm({message:r.message,code:n,answerId:t})),t=""},onRunFinishedEvent:({event:r})=>{let n=r.result?.answerGenerated??!1;e(lm({cannotAnswer:!n,answerId:t})),t=""}}};d();c();l();u();d();c();l();u();function sT(){return{conversationId:"",isEnabled:!1,followUpAnswers:[]}}var cT=e=>({question:e,isLoading:!0,isStreaming:!1,citations:[],liked:!1,disliked:!1,feedbackSubmitted:!1,cannotAnswer:!1,isActive:!0,generationSteps:[]});function Zv(e){return e.followUpAnswers.find(t=>t.isActive)}function Fr(e,t){return e.followUpAnswers.find(r=>r.answerId===t)}var uT=oe(sT(),e=>e.addCase(tm,(t,{payload:r})=>{t.isEnabled=r}).addCase(rm,(t,{payload:r})=>{t.conversationId=r}).addCase(nm,(t,{payload:r})=>{let n=Zv(t);n&&(n.isActive=!1),t.followUpAnswers.push(cT(r.question))}).addCase(om,(t,{payload:r})=>{let n=Zv(t);!n||n.answerId||(n.answerId=r)}).addCase(am,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.answerContentFormat=r.contentFormat)}).addCase(im,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.isLoading=r.isLoading)}).addCase(sm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.isStreaming=r.isStreaming)}).addCase(cm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.answer||(n.answer=""),n.answer+=r.textDelta,delete n.error)}).addCase(um,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.citations=Ic([...n.citations,...r.citations]),delete n.error)}).addCase(lm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.isActive=!1,n.cannotAnswer=!!r.cannotAnswer)}).addCase(dm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message,code:r.code},n.citations=[],delete n.answer)}).addCase(pm,(t,{payload:r})=>{let n=Zv(t);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message},n.citations=[],delete n.answer)}).addCase(fm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.liked=!0,n.disliked=!1)}).addCase(mm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.liked=!1,n.disliked=!0)}).addCase(GF,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.feedbackSubmitted=!0)}).addCase(hm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.generationSteps=[...n.generationSteps,{name:r.name,status:"active",startedAt:r.startedAt}])}).addCase(ym,(t,{payload:r})=>{let n=Fr(t,r.answerId);if(!n)return;let o=n.generationSteps.findLast(a=>a.name===r.name&&a.status==="active");o&&(o.status="completed",o.finishedAt=r.finishedAt)}).addCase(gm,t=>{t.followUpAnswers=[],t.conversationId="",t.isEnabled=!1}));function lT(e,t,r){if(!r.agentId||r.agentId.trim()==="")throw new Error("agentId is required for GeneratedAnswerWithFollowUps");if(!xB(e))throw W;let{...n}=Pc(e,t,r),o=()=>e.state;e.dispatch(Wd(r.agentId));let a=Nd(o()),i=Od(o()),p=_d(o()),f=aT(r.agentId,a,p),m=iT(e.dispatch),g=vm();return{...n,get state(){let S=o().followUpAnswers;return{...o().generatedAnswer,followUpAnswers:S}},retry(){g.run(e.state,e.dispatch,()=>e.navigatorContext)},like(S){if(!S||this.state.answerId===S){n.like();return}this.state.liked||(e.dispatch(fm({answerId:S})),e.dispatch(t.logLikeGeneratedAnswer(S)))},dislike(S){if(!S||this.state.answerId===S){n.dislike();return}this.state.disliked||(e.dispatch(mm({answerId:S})),e.dispatch(t.logDislikeGeneratedAnswer(S)))},logCopyToClipboard(S){if(!S||this.state.answerId===S){n.logCopyToClipboard();return}e.dispatch(t.logCopyGeneratedAnswer(S))},logCitationClick(S,A){if(!A||this.state.answerId===A){n.logCitationClick(S);return}e.dispatch(t.logOpenGeneratedAnswerSource(S,A))},logCitationHover(S,A,h){if(!h||this.state.answerId===h){n.logCitationHover(S,A);return}e.dispatch(t.logHoverCitation(S,A,h))},askFollowUp(S){var _this37=this;return _asyncToGenerator(function*(){if(!S||S.trim()==="")return;let A=_this37.state.followUpAnswers.conversationId;if(!A){console.warn("Missing conversationId when generating a follow-up answer. The generateFollowUpAnswer action requires an existing conversation.");return}f.abortRun(),e.dispatch(nm({question:S}));try{yield f.runAgent({forwardedProps:{q:S,conversationId:A,accessToken:i}},m)}catch(h){e.dispatch(pm({message:"An error occurred while starting the follow-up answer generation."})),console.error("Error running the follow-up agent:",h)}})()}}}function xB(e){return e.addReducers({followUpAnswers:uT}),!0}function dT(e,t={}){Do(e.state.configuration.analytics.analyticsMode);let r;return t.agentId&&t.agentId.trim()!==""?r=lT(e,ws,{...t,agentId:t.agentId}):t.answerConfigurationId&&t.answerConfigurationId.trim()!==""?r=oT(e,ws,t):r=rT(e,ws,t),{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();function tr(e,t,r){if(!AB(e))throw W;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},a;return{select:Gl(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){a=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){a&&clearTimeout(a)}}}function AB(e){return e.addReducers({configuration:ue}),!0}function pT(e,t,r){let n=!1,o=()=>{n||(n=!0,e.dispatch(t.logOpenGeneratedAnswerSource(r.options.citation.id,r.options.answerId)))};return tr(e,r,()=>{o()})}function fT(e,t){return pT(e,ws,t)}d();c();l();u();d();c();l();u();var kc=oe(cp(),e=>{e.addCase(G.fulfilled,CB).addCase(_e.fulfilled,(t,r)=>r.payload?.facetOrder??t)});function CB(e,t){return t.payload.response.facets.map(r=>r.facetId)}d();c();l();u();var jg=()=>Y("history/analytics/forward",e=>e.makeSearchEvent("historyForward")),Lg=()=>Y("history/analytics/backward",e=>e.makeSearchEvent("historyBackward")),Ug=()=>Y("history/analytics/noresultsback",e=>e.makeNoResultsBack());d();c();l();u();d();c();l();u();var mT=e=>({past:[],present:e,future:[]}),bB=e=>{let{past:t,present:r,future:n}=e;if(!r||t.length===0)return e;let o=t[t.length-1];return{past:t.slice(0,t.length-1),present:o,future:[r,...n]}},RB=e=>{let{past:t,present:r,future:n}=e;if(!r||n.length===0)return e;let o=n[0],a=n.slice(1);return{past:[...t,r],present:o,future:a}},wB=e=>{let{action:t,state:r,reducer:n}=e,{past:o,present:a}=r,i=n(a,t);return a?a===i?r:{past:[...o,a].slice(-10),present:i,future:[]}:mT(i)},gT=e=>{let{actionTypes:t,reducer:r}=e,n=mT();return(o=n,a)=>{switch(a.type){case t.undo:return bB(o);case t.redo:return RB(o);case t.snapshot:return wB({state:o,reducer:r,action:a});default:return o}}};d();c();l();u();d();c();l();u();var FB=Object.getOwnPropertyNames,EB=Object.getOwnPropertySymbols,IB=Object.prototype.hasOwnProperty;function hT(e,t){return function(n,o,a){return e(n,o,a)&&t(n,o,a)}}function Qg(e){return function(r,n,o){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,o);var a=o.cache,i=a.get(r),p=a.get(n);if(i&&p)return i===n&&p===r;a.set(r,n),a.set(n,r);var f=e(r,n,o);return a.delete(r),a.delete(n),f}}function yT(e){return FB(e).concat(EB(e))}var TB=Object.hasOwn||function(e,t){return IB.call(e,t)};function ui(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var PB="__v",kB="__o",OB="_owner",ST=Object.getOwnPropertyDescriptor,vT=Object.keys;function NB(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-->0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function _B(e,t){return ui(e.getTime(),t.getTime())}function DB(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function qB(e,t){return e===t}function xT(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var o=new Array(n),a=e.entries(),i,p,f=0;(i=a.next())&&!i.done;){for(var m=t.entries(),g=!1,S=0;(p=m.next())&&!p.done;){if(o[S]){S++;continue}var A=i.value,h=p.value;if(r.equals(A[0],h[0],f,S,e,t,r)&&r.equals(A[1],h[1],A[0],h[0],e,t,r)){g=o[S]=!0;break}S++}if(!g)return!1;f++}return!0}var MB=ui;function VB(e,t,r){var n=vT(e),o=n.length;if(vT(t).length!==o)return!1;for(;o-->0;)if(!RT(e,t,r,n[o]))return!1;return!0}function Il(e,t,r){var n=yT(e),o=n.length;if(yT(t).length!==o)return!1;for(var a,i,p;o-->0;)if(a=n[o],!RT(e,t,r,a)||(i=ST(e,a),p=ST(t,a),(i||p)&&(!i||!p||i.configurable!==p.configurable||i.enumerable!==p.enumerable||i.writable!==p.writable)))return!1;return!0}function jB(e,t){return ui(e.valueOf(),t.valueOf())}function LB(e,t){return e.source===t.source&&e.flags===t.flags}function AT(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var o=new Array(n),a=e.values(),i,p;(i=a.next())&&!i.done;){for(var f=t.values(),m=!1,g=0;(p=f.next())&&!p.done;){if(!o[g]&&r.equals(i.value,p.value,i.value,p.value,e,t,r)){m=o[g]=!0;break}g++}if(!m)return!1}return!0}function UB(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-->0;)if(e[r]!==t[r])return!1;return!0}function QB(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function RT(e,t,r,n){return(n===OB||n===kB||n===PB)&&(e.$$typeof||t.$$typeof)?!0:TB(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var BB="[object Arguments]",GB="[object Boolean]",$B="[object Date]",HB="[object Error]",zB="[object Map]",WB="[object Number]",KB="[object Object]",YB="[object RegExp]",JB="[object Set]",XB="[object String]",ZB="[object URL]",e1=Array.isArray,CT=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,bT=Object.assign,t1=Object.prototype.toString.call.bind(Object.prototype.toString);function r1(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,o=e.areFunctionsEqual,a=e.areMapsEqual,i=e.areNumbersEqual,p=e.areObjectsEqual,f=e.arePrimitiveWrappersEqual,m=e.areRegExpsEqual,g=e.areSetsEqual,S=e.areTypedArraysEqual,A=e.areUrlsEqual;return function(C,w,R){if(C===w)return!0;if(C==null||w==null)return!1;var b=typeof C;if(b!==typeof w)return!1;if(b!=="object")return b==="number"?i(C,w,R):b==="function"?o(C,w,R):!1;var F=C.constructor;if(F!==w.constructor)return!1;if(F===Object)return p(C,w,R);if(e1(C))return t(C,w,R);if(CT!=null&&CT(C))return S(C,w,R);if(F===Date)return r(C,w,R);if(F===RegExp)return m(C,w,R);if(F===Map)return a(C,w,R);if(F===Set)return g(C,w,R);var E=t1(C);return E===$B?r(C,w,R):E===YB?m(C,w,R):E===zB?a(C,w,R):E===JB?g(C,w,R):E===KB?typeof C.then!="function"&&typeof w.then!="function"&&p(C,w,R):E===ZB?A(C,w,R):E===HB?n(C,w,R):E===BB?p(C,w,R):E===GB||E===WB||E===XB?f(C,w,R):!1}}function n1(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,o={areArraysEqual:n?Il:NB,areDatesEqual:_B,areErrorsEqual:DB,areFunctionsEqual:qB,areMapsEqual:n?hT(xT,Il):xT,areNumbersEqual:MB,areObjectsEqual:n?Il:VB,arePrimitiveWrappersEqual:jB,areRegExpsEqual:LB,areSetsEqual:n?hT(AT,Il):AT,areTypedArraysEqual:n?Il:UB,areUrlsEqual:QB};if(r&&(o=bT({},o,r(o))),t){var a=Qg(o.areArraysEqual),i=Qg(o.areMapsEqual),p=Qg(o.areObjectsEqual),f=Qg(o.areSetsEqual);o=bT({},o,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:p,areSetsEqual:f})}return o}function o1(e){return function(t,r,n,o,a,i,p){return e(t,r,p)}}function a1(e){var t=e.circular,r=e.comparator,n=e.createState,o=e.equals,a=e.strict;if(n)return function(f,m){var g=n(),S=g.cache,A=S===void 0?t?new WeakMap:void 0:S,h=g.meta;return r(f,m,{cache:A,equals:o,meta:h,strict:a})};if(t)return function(f,m){return r(f,m,{cache:new WeakMap,equals:o,meta:void 0,strict:a})};var i={cache:void 0,equals:o,meta:void 0,strict:a};return function(f,m){return r(f,m,i)}}var p$e=Pn(),f$e=Pn({strict:!0}),m$e=Pn({circular:!0}),g$e=Pn({circular:!0,strict:!0}),h$e=Pn({createInternalComparator:function(){return ui}}),y$e=Pn({strict:!0,createInternalComparator:function(){return ui}}),S$e=Pn({circular:!0,createInternalComparator:function(){return ui}}),v$e=Pn({circular:!0,createInternalComparator:function(){return ui},strict:!0});function Pn(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,o=e.createState,a=e.strict,i=a===void 0?!1:a,p=n1(e),f=r1(p),m=n?n(f):o1(f);return a1({circular:r,comparator:f,createState:o,equals:m,strict:i})}function li(e,t,r=(n,o)=>n===o){return e.length===t.length&&e.findIndex((n,o)=>!r(t[o],n))===-1}function i1(e,t){return e.length!==t.length?!1:e.every(r=>t.findIndex(n=>Tl(r,n))!==-1)}var Tl=Pn({createCustomConfig:e=>({...e,areArraysEqual:i1})});var s1=oe(rR(),e=>{e.addCase(ir,(t,r)=>c1(t,r.payload)?void 0:r.payload)}),c1=(e,t)=>u1(e.context,t.context)&&l1(e.dictionaryFieldContext,t.dictionaryFieldContext)&&y1(e.advancedSearchQueries,t.advancedSearchQueries)&&d1(e.tabSet,t.tabSet)&&p1(e.staticFilterSet,t.staticFilterSet)&&ex(e.facetSet,t.facetSet)&&ex(e.dateFacetSet,t.dateFacetSet)&&ex(e.numericFacetSet,t.numericFacetSet)&&m1(e.automaticFacetSet,t.automaticFacetSet)&&f1(e.categoryFacetSet,t.categoryFacetSet)&&g1(e.pagination,t.pagination)&&h1(e.query,t.query)&&S1(e,t)&&v1(e.pipeline,t.pipeline)&&x1(e.searchHub,t.searchHub)&&A1(e.facetOrder,t.facetOrder)&&C1(e.debug,t.debug),u1=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),l1=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),d1=(e,t)=>{let r=wT(e),n=wT(t);return r?.id===n?.id},wT=e=>Object.values(e).find(t=>t.isActive),p1=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=FT(e[r]),a=FT(n);if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},FT=e=>e.values.filter(t=>t.state!=="idle"),ex=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=e[r].request.currentValues.filter(i=>i.state!=="idle"),a=n.request.currentValues.filter(i=>i.state!=="idle");if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},f1=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=or(e[r]?.request.currentValues).map(({value:i})=>i),a=or(n?.request.currentValues).map(({value:i})=>i);if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},m1=(e,t)=>{for(let[r,n]of Object.entries(t.set)){if(!e.set[r])return!1;let o=e.set[r].response.values.filter(i=>i.state!=="idle"),a=n.response.values.filter(i=>i.state!=="idle");if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},g1=(e,t)=>e.firstResult===t.firstResult&&e.numberOfResults===t.numberOfResults,h1=(e,t)=>JSON.stringify(e)===JSON.stringify(t),y1=(e,t)=>JSON.stringify(e)===JSON.stringify(t),S1=(e,t)=>e.sortCriteria===t.sortCriteria,v1=(e,t)=>e===t,x1=(e,t)=>e===t,A1=(e,t)=>li(e,t),C1=(e,t)=>e===t,Bg=gT({actionTypes:{redo:rS.type,undo:tS.type,snapshot:ir.type},reducer:s1});function ET(e){if(!b1(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state,o=a=>a.past.length>0&&!le(a.present);return{...t,subscribe(a){a();let i=JSON.stringify(n().history.present),p=()=>{let f=JSON.stringify(n().history.present);i!==f&&(i=f,a())};return e.subscribe(()=>p())},get state(){return n().history},back(){var _this38=this;return _asyncToGenerator(function*(){o(_this38.state)&&(yield r(Gu()),r(G({legacy:Lg()})))})()},forward(){var _this39=this;return _asyncToGenerator(function*(){!_this39.state.future.length||!_this39.state.present||(yield r(Yd()),r(G({legacy:jg()})))})()},backOnNoResults(){var _this40=this;return _asyncToGenerator(function*(){o(_this40.state)&&(yield r(Gu()),r(G({legacy:Ug()})))})()}}}function b1(e){return e.addReducers({history:Bg,configuration:ue,facetOrder:kc}),!0}d();c();l();u();d();c();l();u();var R1={results:new ae({required:!0,each:new J({values:Qd})}),maxLength:new ee({required:!0,min:1,default:10})},Oc=T("recentResults/registerRecentResults",e=>O(e,R1)),Er=T("recentResults/pushRecentResult",e=>(Kt(e),{payload:e})),Nc=T("recentResults/clearRecentResults");function IT(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(qb(t.options.result)))};return tr(e,t,()=>{n(),e.dispatch(Er(t.options.result))})}d();c();l();u();d();c();l();u();function Gg(e){return e?e.expiresAt&&Date.now()>=e.expiresAt:!1}d();c();l();u();d();c();l();u();var TT=(e,t)=>{let{id:r}=e;if(!t[r])return t[r]={q:"",cache:{}},t},PT=(e,t)=>{let{q:r,id:n}=e;r&&(t[n].q=r)},kT=(e,t)=>{let{id:r}=e;Object.entries(t[r].cache).forEach(([n,o])=>{Gg(o)&&delete t[r].cache[n]})},OT=(e,t,r)=>{for(let o in t)for(let a in t[o].cache)t[o].cache[a].isActive=!1;if(!tx(e,t)){w1(e,t,r);return}let n=tx(e,t);n.isLoading=!0,n.isActive=!0,n.error=null},NT=(e,t,r)=>{let{id:n,q:o,searchUid:a,cacheTimeout:i,totalCountFiltered:p,duration:f}=e;t[n].cache[o]={...tx(e,t),...r,isActive:!0,searchUid:a,isLoading:!1,error:null,expiresAt:i?i+Date.now():0,totalCountFiltered:p,duration:f}},_T=(e,t)=>{let{id:r,q:n,error:o}=e;t[r].cache[n].error=o||null,t[r].cache[n].isLoading=!1,t[r].cache[n].isActive=!1},tx=(e,t)=>{let{q:r,id:n}=e;return t[n].cache[r]||null},w1=(e,t,r)=>{let{q:n,id:o}=e;t[o].cache[n]={isLoading:!0,error:null,expiresAt:0,isActive:!0,searchUid:"",totalCountFiltered:0,duration:0,...r}};d();c();l();u();function DT(){return{}}var $g=oe(DT(),e=>{e.addCase(os,(t,r)=>{TT(r.payload,t)}),e.addCase(Kr,(t,r)=>{PT(r.payload,t)}),e.addCase(as,(t,r)=>{kT(r.payload,t)}),e.addCase(Ss.pending,(t,r)=>{OT(r.meta.arg,t,{results:[]})}),e.addCase(Ss.fulfilled,(t,r)=>{let n=r.payload.results.map(o=>({...o,searchUid:r.payload.searchUid}));NT({...r.payload,...r.meta.arg},t,{results:n})}),e.addCase(Ss.rejected,(t,r)=>{_T(r.meta.arg,t)})});d();c();l();u();var F1={searchBoxId:it,maxResultsPerQuery:new ee({required:!0,min:1}),cacheTimeout:new ee},qT=new ge(F1);function MT(e,t){if(!E1(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a={searchBoxId:t.options.searchBoxId||oo("instant-results-"),cacheTimeout:t.options.cacheTimeout||6e4,maxResultsPerQuery:t.options.maxResultsPerQuery};Be(e,qT,a,"buildInstantResults");let i=a.searchBoxId;n(os({id:i}));let p=()=>o().instantResults[i],f=S=>p().cache[S],m=()=>p().q,g=()=>{let S=f(m());return S?S.isLoading?[]:S.results:[]};return{...r,updateQuery(S){if(!S)return;let A=f(S);(!A||!A.isLoading&&(A.error||Gg(A)))&&n(Ss({id:i,q:S,maxResultsPerQuery:a.maxResultsPerQuery,cacheTimeout:a.cacheTimeout})),n(Kr({id:i,q:S}))},clearExpired(){n(as({id:i}))},get state(){let S=m(),A=f(S);return{q:S,isLoading:A?.isLoading||!1,error:A?.error||null,results:g()}}}}function E1(e){return e.addReducers({instantResults:$g}),!0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Ir=oe(hr(),e=>{e.addCase(is,(t,r)=>{let n=rx(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=Pl(n,o)}).addCase(ss,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(gt,t=>{t.firstResult=0}).addCase(cs,(t,r)=>{let n=r.payload;t.firstResult=Pl(n,t.numberOfResults)}).addCase(Yr,(t,r)=>{let n=r.payload;t.firstResult=Pl(n,t.numberOfResults)}).addCase(ls,t=>{let r=rx(t),n=Math.max(r-1,1);t.firstResult=Pl(n,t.numberOfResults)}).addCase(us,t=>{let r=rx(t),n=I1(t),o=Math.min(r+1,n);t.firstResult=Pl(o,t.numberOfResults)}).addCase(_e.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(De,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(G.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(qt.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(Xe,t=>{Qt(t)}).addCase(An,t=>{Qt(t)}).addCase(yn,t=>{Qt(t)}).addCase(Fn,t=>{Qt(t)}).addCase(ei,t=>{Qt(t)}).addCase(hn,t=>{Qt(t)}).addCase(un,t=>{Qt(t)}).addCase(Mo,t=>{Qt(t)}).addCase(rc,t=>{Qt(t)}).addCase(xn,t=>{Qt(t)}).addCase(wn,t=>{Qt(t)}).addCase(pt,t=>{Qt(t)}).addCase(Xn,t=>{Qt(t)}).addCase(Zn,t=>{Qt(t)}).addCase(Za,t=>{Qt(t)}).addCase(sn,t=>{Qt(t)})});function Qt(e){e.firstResult=hr().firstResult}function rx(e){let{firstResult:t,numberOfResults:r}=e;return nx(t,r)}function I1(e){let{totalCountFiltered:t,numberOfResults:r}=e;return ox(t,r)}function Pl(e,t){return(e-1)*t}function nx(e,t){return Math.round(e/t)+1}function ox(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function T1(e){return e.pagination.firstResult}function VT(e){return e.pagination.numberOfResults}function P1(e){return e.pagination.totalCountFiltered}var ro=e=>{let t=T1(e),r=VT(e);return nx(t,r)},kl=e=>{let t=P1(e),r=VT(e);return ox(t,r)},Hg=(e,t)=>{let r=ro(e),n=kl(e),o=k1(r,t);return o=O1(o),o=N1(o,n),_1(o)};function k1(e,t){let r=t%2===0,n=Math.floor(t/2),o=r?n-1:n,a=e-n,i=e+o;return{start:a,end:i}}function O1(e){let t=Math.max(1-e.start,0),r=e.start+t,n=e.end+t;return{start:r,end:n}}function N1(e,t){let r=Math.max(e.end-t,0),n=Math.max(e.start-r,1),o=e.end-r;return{start:n,end:o}}function _1(e){let t=[];for(let r=e.start;r<=e.end;++r)t.push(r);return t}var Dc=()=>Y("analytics/pager/resize",(e,t)=>e.makePagerResize({currentResultsPerPage:t.pagination?.numberOfResults||hr().numberOfResults})),qc=()=>Y("analytics/pager/number",(e,t)=>e.makePagerNumber({pagerNumber:ro(t)})),zg=()=>Y("analytics/pager/next",(e,t)=>e.makePagerNext({pagerNumber:ro(t)})),Wg=()=>Y("analytics/pager/previous",(e,t)=>e.makePagerPrevious({pagerNumber:ro(t)})),Mc=()=>({actionCause:"browseResults"});d();c();l();u();var D1=new ge({numberOfPages:new ee({default:5,min:0})}),q1=new ge({page:new ee({min:1})});function jT(e,t={}){if(!M1(e))throw W;let r=ne(e),{dispatch:n}=e,o=Be(e,D1,t.options,"buildPager"),i=ut(e,q1,t.initialState,"buildPager").page;i&&n(cs(i));let p=()=>ro(e.state),f=()=>{let{numberOfPages:g}=o;return Hg(e.state,g)},m=()=>kl(e.state);return{...r,get state(){let g=p(),S=m(),A=g>1&&S>0,h=g<S;return{currentPage:g,currentPages:f(),maxPage:S,hasPreviousPage:A,hasNextPage:h}},selectPage(g){n(Yr(g))},nextPage(){n(us())},previousPage(){n(ls())},isCurrentPage(g){return g===this.state.currentPage}}}function M1(e){return e.addReducers({configuration:ue,pagination:Ir}),!0}function LT(e,t={}){let{dispatch:r}=e,n=jT(e,t);return{...n,get state(){return n.state},selectPage(o){n.selectPage(o),r(qt({legacy:qc(),next:Mc()}))},nextPage(){n.nextPage(),r(qt({legacy:zg(),next:Mc()}))},previousPage(){n.previousPage(),r(qt({legacy:Wg(),next:Mc()}))}}}d();c();l();u();d();c();l();u();function UT(e){if(!V1(e))throw W;let t=ne(e),r=()=>e.state;return{...t,get state(){return{hasError:r().search.error!==null,error:r().search.error}}}}function V1(e){return e.addReducers({search:fe}),!0}function QT(e){return UT(e)}d();c();l();u();d();c();l();u();function BT(e){if(!j1(e))throw W;let t=ne(e),r=Ec(e),n=()=>e.state,o=()=>{let a=n().search.duration/1e3;return Math.round((a+Number.EPSILON)*100)/100};return{...t,get state(){return{...r.state,durationInMilliseconds:n().search.duration,durationInSeconds:o(),firstResult:n().pagination.firstResult+1,hasDuration:n().search.duration!==0,hasQuery:n().search.queryExecuted!=="",lastResult:n().pagination.firstResult+n().search.results.length,query:n().search.queryExecuted,total:n().pagination.totalCountFiltered}}}}function j1(e){return e.addReducers({search:fe,pagination:Ir}),!0}function GT(e){return BT(e)}d();c();l();u();d();c();l();u();d();c();l();u();function Kg(_x166,_x167){return _Kg.apply(this,arguments)}function _Kg(){_Kg=_asyncToGenerator(function*(e,t){let{search:r,accessToken:n,organizationId:o}=e.configuration,a=e.query?.q||"";return{url:r.apiBaseUrl??ct(e.configuration.organizationId,e.configuration.environment),accessToken:n,organizationId:o,enableNavigation:!1,q:a,...t,requestedOutputSize:t.requestedOutputSize||0,...(r.authenticationProviders.length&&{authentication:r.authenticationProviders.join(",")})}});return _Kg.apply(this,arguments)}var di=Se("resultPreview/fetchResultContent",/*#__PURE__*/function(){var _ref76=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),a=yield Kg(o,e),i=yield t.apiClient.html(a);return ht(i)?n(i.error):{content:i.success,uniqueId:e.uniqueId}});return function(_x168,_x169){return _ref76.apply(this,arguments)}}()),Vc=T("resultPreview/next"),jc=T("resultPreview/previous"),Lc=T("resultPreview/prepare",e=>O(e,{results:new ae({required:!0})})),$T=2048,Uc=Se("resultPreview/updateContentURL",/*#__PURE__*/function(){var _ref77=_asyncToGenerator(function*(e,{getState:t,extra:r}){let n=t(),o=vA(yield e.buildResultPreviewRequest(n,{uniqueId:e.uniqueId,requestedOutputSize:e.requestedOutputSize}),e.path);return o?.length>$T&&r.logger.error(`The content URL was truncated as it exceeds the maximum allowed length of ${$T} characters.`),{contentURL:o}});return function(_x170,_x171){return _ref77.apply(this,arguments)}}());d();c();l();u();var HT=e=>Y({prefix:"analytics/resultPreview/open",__legacy__getBuilder:(t,r)=>{Kt(e);let n=dt(e,r),o=He(e);return t.makeDocumentQuickview(n,o)},analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=dt(e,t),n=He(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});d();c();l();u();d();c();l();u();d();c();l();u();function ax(){return{uniqueId:"",content:"",isLoading:!1,position:-1,resultsWithPreview:[]}}var ix=e=>{let{content:t,isLoading:r,uniqueId:n,contentURL:o}=ax();e.content=t,e.isLoading=r,e.uniqueId=n,e.contentURL=o},sx=e=>e.filter(t=>t.hasHtmlVersion).map(t=>t.uniqueId),Yg=oe(ax(),e=>{e.addCase(di.pending,t=>{t.isLoading=!0}).addCase(di.fulfilled,(t,r)=>{let{content:n,uniqueId:o}=r.payload;t.position=t.resultsWithPreview.indexOf(o),t.content=n,t.uniqueId=o,t.isLoading=!1}).addCase(G.fulfilled,(t,r)=>{ix(t),t.resultsWithPreview=sx(r.payload.response.results)}).addCase(Sr.fulfilled,(t,r)=>{ix(t),t.resultsWithPreview=t.resultsWithPreview.concat(sx(r.payload.response.results))}).addCase(qt.fulfilled,ix).addCase(Lc,(t,r)=>{t.resultsWithPreview=sx(r.payload.results)}).addCase(Vc,t=>{if(t.isLoading)return;let r=t.position+1;r>t.resultsWithPreview.length-1&&(r=0),t.position=r}).addCase(jc,t=>{if(t.isLoading)return;let r=t.position-1;r<0&&(r=t.resultsWithPreview.length-1),t.position=r}).addCase(Uc.fulfilled,(t,r)=>{t.contentURL=r.payload.contentURL})});function zT(e,t,r,n,o){if(!L1(e))throw W;let{dispatch:a}=e,i=()=>e.state,p=ne(e),{result:f,maximumPreviewSize:m}=t.options,g=()=>{let{resultsWithPreview:A,position:h}=i().resultPreview;return A[h]},S=A=>{a(Uc({uniqueId:A,requestedOutputSize:m,buildResultPreviewRequest:r,path:n})),t.options.onlyContentURL||a(di({uniqueId:A,requestedOutputSize:m})),o&&o()};return{...p,fetchResultContent(){S(f.uniqueId)},next(){a(Vc()),S(g())},previous(){a(jc()),S(g())},get state(){let A=i(),h=f.hasHtmlVersion,C=A.resultPreview,w=f.uniqueId===C.uniqueId?C.content:"",R=C.isLoading,b=C.contentURL,F=g();return{content:w,resultHasPreview:h,isLoading:R,contentURL:b,currentResultUniqueId:F}}}}function L1(e){return e.addReducers({configuration:ue,resultPreview:Yg}),!0}function WT(e,t){if(!U1(e))throw W;let{dispatch:r}=e,n=()=>e.state,o=()=>n().search.results,p=zT(e,t,Kg,"/html",()=>{e.dispatch(HT(t.options.result))});return r(Lc({results:o()})),{...p,get state(){return{...p.state,currentResult:o().findIndex(f=>f.uniqueId===p.state.currentResultUniqueId)+1,totalResults:o().length}}}}function U1(e){return e.addReducers({search:fe}),!0}d();c();l();u();d();c();l();u();var KT=()=>Y("analytics/recentQueries/clear",e=>e.makeClearRecentQueries()),YT=()=>Y("analytics/recentQueries/click",e=>e.makeRecentQueryClick());d();c();l();u();d();c();l();u();var Q1={queries:new ae({required:!0,each:new M({emptyAllowed:!1})}),maxLength:new ee({required:!0,min:1,default:10})},pi=T("recentQueries/registerRecentQueries",e=>O(e,Q1)),Qc=T("recentQueries/clearRecentQueries");d();c();l();u();d();c();l();u();function JT(){return{queries:[],maxLength:10}}var Jg=oe(JT(),e=>{e.addCase(pi,B1).addCase(Qc,G1).addCase(G.fulfilled,(t,r)=>{let n=r.payload.queryExecuted,o=r.payload.response.results;!n.length||!o.length||$1(n,t)})});function B1(e,t){e.queries=Array.from(new Set(t.payload.queries.map(r=>r.trim().toLowerCase()))).slice(0,t.payload.maxLength),e.maxLength=t.payload.maxLength}function G1(e){e.queries=[]}function $1(e,t){let r=e.trim().toLowerCase();if(r==="")return;let n=Array.from(new Set(t.queries.filter(o=>o.trim().toLowerCase()!==r))).slice(0,t.maxLength-1);t.queries=[r,...n]}var H1={queries:[]},z1={maxLength:10,clearFilters:!0},W1=new ge({queries:new ae({required:!0})}),K1=new ge({maxLength:new ee({required:!0,min:1}),clearFilters:new ce});function Y1(e,t){Be(e,K1,t?.options,"buildRecentQueriesList"),ut(e,W1,t?.initialState,"buildRecentQueriesList")}function XT(e,t){if(!J1(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a={...z1,...t?.options},i={...H1,...t?.initialState};Y1(e,{options:a,initialState:i});let p={queries:i.queries,maxLength:a.maxLength};return n(pi(p)),{...r,get state(){let f=o();return{...f.recentQueries,analyticsEnabled:f.configuration.analytics.enabled}},clear(){n(Qc())},updateRecentQueries(f){let m=new ae({required:!0,each:new M({required:!0}),min:1}).validate(f);if(m)throw new Error(m);n(pi({queries:f,maxLength:a.maxLength}))},executeRecentQuery(f){let m=new ee({required:!0,min:0,max:this.state.queries.length}).validate(f);if(m)throw new Error(m);let g={q:this.state.queries[f],clearFilters:a.clearFilters};Ll(e.state.query?.enableQuerySyntax)&&(g.enableQuerySyntax=e.state.query.enableQuerySyntax),n(ys(g))}}}function J1(e){return e.addReducers({search:fe,recentQueries:Jg,query:Ct}),!0}function ZT(e,t){let r=XT(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},clear(){n(KT()),r.clear()},executeRecentQuery(o){r.executeRecentQuery(o),n(G({legacy:YT(),next:{actionCause:"recentQueriesClick"}}))}}}d();c();l();u();d();c();l();u();var eP=e=>Y("analytics/recentResults/click",(t,r)=>(Kt(e),t.makeRecentResultClick(dt(e,r),He(e)))),tP=()=>Y("analytics/recentResults/clear",e=>e.makeClearRecentResults());function rP(e,t){return tr(e,t,()=>e.dispatch(eP(t.options.result)))}d();c();l();u();d();c();l();u();d();c();l();u();function nP(){return{results:[],maxLength:10}}var Xg=oe(nP(),e=>{e.addCase(Oc,(t,r)=>{t.results=r.payload.results.slice(0,r.payload.maxLength),t.maxLength=r.payload.maxLength}).addCase(Nc,t=>{t.results=[]}).addCase(Er,(t,r)=>{let n=r.payload;t.results=t.results.filter(a=>a.uniqueId!==n.uniqueId);let o=t.results.slice(0,t.maxLength-1);t.results=[n,...o]})});var X1={initialState:{results:[]},options:{maxLength:10}},Z1=new ge({results:new ae({required:!0})}),eG=new ge({maxLength:new ee({required:!0,min:1})});function tG(e,t){Be(e,eG,t?.options,"buildRecentResultsList"),ut(e,Z1,t?.initialState,"buildRecentResultsList")}function oP(e,t){if(!rG(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a={...X1,...t};tG(e,a);let i={results:a.initialState.results,maxLength:a.options.maxLength};return n(Oc(i)),{...r,get state(){return o().recentResults},clear(){n(tP()),n(Nc())}}}function rG(e){return e.addReducers({recentResults:Xg}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var iP=e=>{let t=/Document weights:\n((?:.)*?)\n+/g,r=/Terms weights:\n((?:.|\n)*)\n+/g,n=/Total weight: ([0-9]+)/g;if(!e)return null;let o=t.exec(e),a=r.exec(e),i=n.exec(e),p=oG(e),f=sP(o?o[1]:null),m=nG(a),g=i?Number(i[1]):null;return{documentWeights:f,termsWeight:m,totalWeight:g,qreWeights:p}},sP=e=>{let t=/(\w+(?:\s\w+)*): ([-0-9]+)/g,r=/^(\w+(?:\s\w+)*): ([-0-9]+)$/;if(!e)return null;let n=e.match(t);if(!n)return null;let o={};for(let a of n){let i=a.match(r);if(i){let p=i[1],f=i[2];o[p]=Number(f)}}return o},aP=(e,t)=>{let r=[],n;for(;n=t.exec(e),n!==null;)r.push(n);return r},nG=e=>{let t=/((?:[^:]+: [0-9]+, [0-9]+; )+)\n((?:\w+: [0-9]+; )+)/g,r=/([^:]+): ([0-9]+), ([0-9]+); /g;if(!e||!e[1])return null;let n=aP(e[1],t);if(!n)return null;let o={};for(let a of n){let i=aP(a[1],r),p={};for(let m of i)p[m[1]]={Correlation:Number(m[2]),"TF-IDF":Number(m[3])};let f=sP(a[2]);o[Object.keys(p).join(", ")]={terms:p,Weights:f}}return o},oG=e=>{let t=/(Expression:\s".*")\sScore:\s(?!0)([-0-9]+)\n+/g,r=t.exec(e),n=[];for(;r;)n.push({expression:r[1],score:parseInt(r[2],10)}),r=t.exec(e);return n};function cP(e){return e.search.response.results.map(r=>{let n=iP(r.rankingInfo);return{result:r,ranking:n}})}var aG=new ge({enabled:new ce({default:!1})});function uP(e,t={}){if(!iG(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state;ut(e,aG,t.initialState,"buildRelevanceInspector").enabled&&n(ho());let i=p=>{e.logger.warn(`Flag [ ${p} ] is now activated. This should *not* be used in any production environment as it negatively impact performance.`)};return{...r,get state(){let p=o(),f=p.debug;if(!p.debug)return{isEnabled:f};let{executionReport:m,basicExpression:g,advancedExpression:S,constantExpression:A,userIdentities:h,rankingExpressions:C}=p.search.response,{fieldsDescription:w,fetchAllFields:R}=p.fields;return{isEnabled:f,rankingInformation:cP(p),executionReport:m,expressions:{basicExpression:g,advancedExpression:S,constantExpression:A},userIdentities:h,rankingExpressions:C,fieldsDescription:w,fetchAllFields:R}},enable(){n(ho()),i("debug")},disable(){n(Zi()),n(ci())},enableFetchAllFields(){n(wc()),i("fetchAllFields")},disableFetchAllFields(){n(ci())},fetchFieldsDescription(){!this.state.isEnabled&&n(ho()),n(Fc()),i("fieldsDescription"),e.logger.warn(`For production environment, please specify the necessary fields either when instantiating a ResultList controller, or by dispatching a registerFieldsToInclude action.
|
|
44
|
+
For more information, refer to the documentation: https://docs.coveo.com/en/o3r90189/build-a-search-ui/event-protocol`;function Do(e){e==="next"&&console.warn(lU)}d();c();l();u();var AE=kr(xE(),1);function CE(e){return(0,AE.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}d();c();l();u();function bE(e,t){let r=IU(e),n=lr,o=TU(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function IU(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function TU(e){return e.preprocessRequest||Xl}d();c();l();u();var zv=(e,t,r,n,o,a)=>{let i=e[t];ue(i)||ue(o)||o!==i&&o!==n&&(a.warn(`Mismatch on access token (JWT Token) ${t} and engine configuration.`),a.warn(`To remove this warning, make sure that access token value [${i}] matches engine configuration value [${r}]`))},Wv=(e,t)=>!(ue(e)||t===e),Sl=e=>{let t=Uv(e);return t||!1},FE=(e,t)=>(Wv(e.searchHub,t.searchHub)&&(t.searchHub=e.searchHub),t),RE=(e,t,r,n)=>(zv(e,"searchHub",t.searchHub,po(),r,n),FE(e,t)),EE=(e,t)=>(Wv(e.pipeline,t.pipeline)&&(t.pipeline=e.pipeline),t),wE=(e,t,r,n)=>(zv(e,"pipeline",t.pipeline,Vn(),r,n),EE(e,t)),IE=(e,t)=>(Wv(e.userDisplayName,t.configuration.analytics.userDisplayName)&&(t.configuration.analytics.userDisplayName=e.userDisplayName),t),PU=(e,t,r,n)=>(zv(e,"userDisplayName",t.configuration.analytics.userDisplayName,Ds().analytics.userDisplayName,r,n),IE(e,t)),TE=e=>oe({},t=>{t.addCase(bs,(r,n)=>{let o=Sl(r.configuration.accessToken);return o?RE(o,r,n.payload,e):r}).addCase(os,(r,n)=>{let o=Sl(r.configuration.accessToken);return o?wE(o,r,n.payload,e):r}).addCase(zr,(r,n)=>{if(r.configuration.accessToken!==n.payload.accessToken)return r;let{accessToken:o}=n.payload;if(!o)return r;let a=Sl(o);return a?[EE,FE,IE].reduce((i,p)=>p(a,i),r):r}).addCase(mr,(r,n)=>{let o=Sl(r.configuration.accessToken);if(!o)return r;let a=RE(o,r,n.payload.searchHub,e);return wE(o,a,n.payload?.pipeline,e)}).addCase(go,(r,n)=>{let o=Sl(r.configuration.accessToken);return o?PU(o,r,n.payload.userDisplayName,e):r})});d();c();l();u();d();c();l();u();var PE={organizationId:z,accessToken:z,name:new M({required:!1,emptyAllowed:!1}),analytics:new J({options:{required:!1},values:{enabled:new ce({required:!1}),originContext:new M({required:!1}),originLevel2:new M({required:!1}),originLevel3:new M({required:!1}),analyticsMode:new M({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new M({required:!1,url:!0}),trackingId:new M({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new M({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function kE(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var OE=new ge({...PE,search:new J({options:{required:!1},values:{pipeline:new M({required:!1,emptyAllowed:!0}),searchHub:it,locale:it,timezone:it,authenticationProviders:new ae({required:!1,each:z}),proxyBaseUrl:new M({required:!1,url:!0})}})});function Kv(){return{...kE(),search:{searchHub:"default"}}}var kU={debug:ns,pipeline:as,searchHub:Rs,search:fe};function OU(e){let{search:t,organizationId:r,environment:n}=e,o=t?.proxyBaseUrl?t.proxyBaseUrl:ct(r,n);return{...t,apiBaseUrl:o}}function NE(e){let t=CE(e.loggerOptions),{configuration:r}=e;NU(r,t);let n=_U(r,t),o=DU(t),a={...bE(r,t),apiClient:n,streamingClient:o},i={...e,reducers:kU,crossReducer:TE(t)},p=pE(i,a),f=OU(r);return f&&p.dispatch(mr(f)),{...p,get state(){return p.state},executeFirstSearch(m=Hd()){if(Ju(p.state))return;let h=G({legacy:m,next:Lb()});p.dispatch(h)},executeFirstSearchAfterStandaloneSearchBoxRedirect(m){let{cause:h,metadata:S}=m;if(Ju(p.state))return;let v=S&&h==="omniboxFromLink",g=G({legacy:v?Wd(S):zd(),next:v?Qb():Ub()});p.dispatch(g)}}}function NU(e,t){try{OE.validate(e)}catch(r){throw t.error(r,"Search engine configuration error"),r}}function _U(e,t){let{search:r}=e;return new ed({logger:t,preprocessRequest:e.preprocessRequest||Xl,postprocessSearchResponseMiddleware:r?.preprocessSearchResponseMiddleware||kA,postprocessFacetSearchResponseMiddleware:r?.preprocessFacetSearchResponseMiddleware||OA,postprocessQuerySuggestResponseMiddleware:r?.preprocessQuerySuggestResponseMiddleware||NA})}function DU(e){return new Kl({logger:e})}d();c();l();u();d();c();l();u();d();c();l();u();var Ya={value:z,numberOfResults:new ee({min:0}),state:z};d();c();l();u();var he=z;var VU=new ee({min:1,default:8,required:!1}),LU=new ee({min:1,max:20,default:5,required:!1}),UU={desiredCount:LU,numberOfValues:VU},ec=T("automaticFacet/setOptions",e=>O(e,UU)),tc=T("automaticFacet/deselectAll",e=>O(e,he)),QU=z,sn=T("automaticFacet/toggleSelectValue",e=>O(e,{field:QU,selection:new J({values:Ya})}));d();c();l();u();d();c();l();u();var BU={state:new Le({required:!0}),numberOfResults:new ee({required:!0,min:0}),value:new M({required:!0,emptyAllowed:!0}),path:new ae({required:!0,each:z}),moreValuesAvailable:new ce({required:!1})};function Yv(e){e.children.forEach(t=>{Yv(t)}),lr({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},BU)}var rc={facetId:he,field:z,tabs:new J({options:{required:!1},values:{included:new ae({each:new M}),excluded:new ae({each:new M})}}),activeTab:new M({required:!1}),delimitingCharacter:new M({required:!1,emptyAllowed:!0}),filterFacetCount:new ce({required:!1}),injectionDepth:new ee({required:!1,min:0}),numberOfValues:new ee({required:!1,min:1}),sortCriteria:new Le({required:!1}),basePath:new ae({required:!1,each:z}),filterByBasePath:new ce({required:!1})};var cn=T("categoryFacet/register",e=>O(e,rc)),Mo=T("categoryFacet/toggleSelectValue",e=>{try{return lr(e.facetId,z),Yv(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:_n(t)}}}),un=T("categoryFacet/deselectAll",e=>O(e,rc.facetId)),Ja=T("categoryFacet/updateNumberOfValues",e=>O(e,{facetId:rc.facetId,numberOfValues:rc.numberOfValues})),nc=T("categoryFacet/updateSortCriterion",e=>O(e,{facetId:rc.facetId,criterion:new Le})),Em=T("categoryFacet/updateBasePath",e=>O(e,{facetId:rc.facetId,basePath:new ae({each:z})}));d();c();l();u();var GU={categoryFacetId:he,categoryFacetPath:new ae({required:!0,each:z})},$U=(e,{categoryFacetId:t,categoryFacetPath:r})=>{let o=e.categoryFacetSet[t]?.request.field,a=`${o}_${t}`;return{categoryFacetId:t,categoryFacetPath:r,categoryFacetField:o,categoryFacetTitle:a}},Im=e=>Y("analytics/categoryFacet/breadcrumb",(t,r)=>(O(e,GU),t.makeBreadcrumbFacet($U(r,e)))),_E=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();d();c();l();u();var be=T("facetOptions/update",(e={freezeFacetOrder:!0})=>O(e,{freezeFacetOrder:new ce({required:!1})})),jt=T("facetOptions/facet/enable",e=>O(e,he)),Je=T("facetOptions/facet/disable",e=>O(e,he));d();c();l();u();var er=(e,t)=>typeof e=="object"&&Object.keys({...e}).length===0||!t||!e?!0:e.excluded?.includes(t)?!1:!!(e.included&&(e.included.length===0||e.included.includes(t))||e.excluded&&!e.included);d();c();l();u();d();c();l();u();var vl={facetId:he,captions:new J({options:{required:!1}}),numberOfValues:new ee({required:!1,min:1}),query:new M({required:!1,emptyAllowed:!0})};var HU={path:new ae({required:!0,each:z}),displayValue:Ue,rawValue:Ue,count:new ee({required:!0,min:0})},oc=T("categoryFacet/selectSearchResult",e=>O(e,{facetId:he,value:new J({values:HU})})),ac=T("categoryFacetSearch/register",e=>O(e,vl));d();c();l();u();function ic(e,t){let{facetId:r,criterion:n}=t,o=e[r]?.request;o&&(o.sortCriteria=n)}function sc(e){e&&(e.currentValues=e.currentValues.map(t=>({...t,previousState:t.state!=="idle"?t.state:void 0,state:"idle"})),e.preventAutoSelect=!0)}function Tm(e,t){e&&(e.numberOfValues=t)}d();c();l();u();function xl(e,t){let r=e[t];r&&(r.request.numberOfValues=r.initialNumberOfValues,r.request.currentValues=[],r.request.preventAutoSelect=!0)}function Pm(e,t,r){e.currentValues=zU(t,r),e.numberOfValues=t.length?1:r,e.preventAutoSelect=!0}function zU(e,t){if(!e.length)return[];let r=DE(e[0],t),n=r;for(let o of e.splice(1)){let a=DE(o,t);n.children.push(a),n=a}return n.state="selected",n.retrieveChildren=!0,[r]}function DE(e,t){return{value:e,retrieveCount:t,children:[],state:"idle",retrieveChildren:!1}}var ln=oe(Bi(),e=>{e.addCase(cn,(t,r)=>{let n=r.payload,{facetId:o,tabs:a}=n;if(o in t)return;let i=KU(n),p=i.numberOfValues;t[o]={request:i,initialNumberOfValues:p,tabs:a}}).addCase(_e.fulfilled,(t,r)=>r.payload?.categoryFacetSet??t).addCase(De,(t,r)=>{let n=r.payload.cf||{},o=r.payload.tab;Object.keys(t).forEach(a=>{let i=t[a],p=i.request;if((i.tabs?.included?.length||i.tabs?.excluded?.length)&&!er(i.tabs,o)){p.currentValues.length&&Pm(p,[],i.initialNumberOfValues);return}let m=n[a]||[];(m.length||p.currentValues.length)&&Pm(p,m,i.initialNumberOfValues)})}).addCase(nc,(t,r)=>{let{facetId:n,criterion:o}=r.payload,a=t[n]?.request;a&&(a.sortCriteria=o)}).addCase(Em,(t,r)=>{let{facetId:n,basePath:o}=r.payload,a=t[n]?.request;a&&(a.basePath=[...o])}).addCase(Mo,(t,r)=>{let{facetId:n,selection:o,retrieveCount:a}=r.payload,i=t[n]?.request;if(!i)return;let{path:p}=o,f=p.slice(0,p.length-1),m=WU(i,f,a);if(m.length){let S=m[0];S.retrieveChildren=!0,S.state="selected",S.previousState="idle",S.children=[];return}let h=ME(o.value,a);h.state="selected",h.previousState="idle",m.push(h),i.numberOfValues=1}).addCase(un,(t,r)=>{let n=r.payload;xl(t,n)}).addCase(pt,t=>{Object.keys(t).forEach(r=>xl(t,r))}).addCase(Wr,(t,r)=>Object.keys(t).forEach(n=>{t[n].request.preventAutoSelect=!r.payload.allow})).addCase(Ja,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload,a=t[n]?.request;if(a){if(!a.currentValues.length)return Tm(a,o);YU(t,r.payload)}}).addCase(oc,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n];if(!a)return;let i=[...o.path,o.rawValue];Pm(a.request,i,a.initialNumberOfValues)}).addCase(vr.fulfilled,(t,r)=>{qE(t,r.payload.response.facets)}).addCase(G.fulfilled,(t,r)=>{qE(t,r.payload.response.facets)}).addCase(Je,(t,r)=>{xl(t,r.payload)}).addCase(gt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!er(a.tabs,n)&&xl(t,o)})})}),Al={delimitingCharacter:";",filterFacetCount:!0,injectionDepth:1e3,numberOfValues:5,sortCriteria:"occurrences",basePath:[],filterByBasePath:!0,resultsMustMatch:"atLeastOneValue"};function WU(e,t,r){let n=e.currentValues;for(let o of t){let a=n[0];(!a||o!==a.value)&&(a=ME(o,r),n.length=0,n.push(a)),a.retrieveChildren=!1,a.previousState=void 0,a.state="idle",n=a.children}return n}function KU(e){return{...Al,currentValues:[],preventAutoSelect:!1,type:"hierarchical",...e}}function ME(e,t){return{value:e,state:"idle",children:[],retrieveChildren:!0,retrieveCount:t}}function qE(e,t){t.forEach(r=>{if(!JU(e,r))return;let n=r.facetId,o=e[n]?.request;if(!o)return;let a=XU(o,r);o.currentValues=a?[]:o.currentValues,o.preventAutoSelect=!1})}function YU(e,t){let{facetId:r,numberOfValues:n}=t,o=e[r]?.request.currentValues[0];if(o){for(;o.children.length&&o?.state!=="selected";)o=o.children[0];o.retrieveCount=n}}function JU(e,t){return t.facetId in e}function XU(e,t){let r=or(e.currentValues),n=or(t.values);return r.length!==n.length}d();c();l();u();d();c();l();u();var dn=new M({regex:/^[a-zA-Z0-9-_]+$/}),pn=new M({required:!0}),jE=new ae({each:new M}),VE=new M,LE=new ce,fn=new ce,mn=new ee({min:0}),Vr=new ee({min:1}),km=new ce({required:!0}),ZU=new J,eQ=new M,tQ={captions:ZU,numberOfValues:Vr,query:eQ},cc=new J({values:tQ}),Om=new J({options:{required:!1},values:{type:new M({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new ae({required:!0,max:25,each:new M({emptyAllowed:!1,required:!0})})}}),UE=new ce,Nm=new ae({min:1,max:25,required:!1,each:new M({emptyAllowed:!1,required:!0})});var rQ={facetId:he,field:new M({required:!0,emptyAllowed:!0}),tabs:new J({options:{required:!1},values:{included:new ae({each:new M}),excluded:new ae({each:new M})}}),activeTab:new M({required:!1}),filterFacetCount:new ce({required:!1}),injectionDepth:new ee({required:!1,min:0}),numberOfValues:new ee({required:!1,min:1}),sortCriteria:new Le({required:!1}),resultsMustMatch:new Le({required:!1}),allowedValues:Om,customSort:Nm},gn=T("facet/register",e=>O(e,rQ)),hn=T("facet/toggleSelectValue",e=>O(e,{facetId:he,selection:new J({values:Ya})})),yn=T("facet/toggleExcludeValue",e=>O(e,{facetId:he,selection:new J({values:Ya})})),Xe=T("facet/deselectAll",e=>O(e,he)),uc=T("facet/updateSortCriterion",e=>O(e,{facetId:he,criterion:new Le({required:!0})})),Xa=T("facet/updateNumberOfValues",e=>O(e,{facetId:he,numberOfValues:new ee({required:!0,min:1})})),Za=T("facet/updateIsFieldExpanded",e=>O(e,{facetId:he,isFieldExpanded:new ce({required:!0})})),Wn=T("facet/updateFreezeCurrentValues",e=>O(e,{facetId:he,freezeCurrentValues:new ce({required:!0})}));d();c();l();u();var lc=e=>Y("analytics/facet/showMore",(t,r)=>{O(e,he);let n=zi(e,ar(r));return t.makeFacetShowMore(n)}),dc=e=>Y("analytics/facet/showLess",(t,r)=>{O(e,he);let n=zi(e,ar(r));return t.makeFacetShowLess(n)}),Sn=e=>Y("analytics/facet/sortChange",(t,r)=>{O(e,{facetId:he,criterion:new Le({required:!0})});let{facetId:n,criterion:o}=e,a=ar(r),p={...zi(n,a),criteria:o};return t.makeFacetUpdateSort(p)}),vt=e=>Y("analytics/facet/reset",(t,r)=>{O(e,he);let n=ar(r),o=zi(e,n);return t.makeFacetClearAll(o)}),ot=e=>Y("analytics/facet/select",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=ar(r),o=Wi(e,n);return t.makeFacetSelect(o)}),cr=e=>Y("analytics/facet/exclude",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=ar(r),o=Wi(e,n);return t.makeFacetExclude(o)}),Lr=e=>Y("analytics/facet/deselect",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=ar(r),o=Wi(e,n);return t.makeFacetDeselect(o)}),Kn=e=>Y("analytics/facet/unexclude",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=ar(r),o=Wi(e,n);return t.makeFacetUnexclude(o)}),pc=e=>Y("analytics/facet/breadcrumb",(t,r)=>{O(e,{facetId:he,facetValue:z});let n=Wi(e,ar(r));return t.makeBreadcrumbFacet(n)}),Vt=()=>({actionCause:"facetClearAll"}),mt=()=>({actionCause:"facetSelect"}),Yn=()=>({actionCause:"facetExclude"}),Jn=()=>({actionCause:"facetDeselect"}),QE=()=>({actionCause:"facetUnexclude"}),_m=()=>({actionCause:"breadcrumbFacet"});d();c();l();u();d();c();l();u();var BE={facetId:he,value:new J({values:{displayValue:Ue,rawValue:Ue,count:new ee({required:!0,min:0})}})},Dm=T("facetSearch/register",e=>O(e,vl)),jo=T("facetSearch/update",e=>O(e,vl)),ei=T("facetSearch/toggleSelectValue",e=>O(e,BE)),ti=T("facetSearch/toggleExcludeValue",e=>O(e,BE));var Rr=oe(Hi(),e=>{e.addCase(gn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;n in t||(t[n]=hb(nQ(r.payload),o))}).addCase(_e.fulfilled,(t,r)=>{if(r.payload&&Object.keys(r.payload.facetSet).length!==0)return r.payload.facetSet}).addCase(De,(t,r)=>{let n=r.payload.f||{},o=r.payload.fExcluded||{};Object.keys(t).forEach(i=>{let{request:p}=t[i],f=n[i]||[],m=o[i]||[],h=f.length+m.length,S=p.currentValues.filter(v=>!f.includes(v.value)&&!m.includes(v.value));p.currentValues=[...f.map($E),...m.map(HE),...S.map(aQ)],p.preventAutoSelect=h>0,p.numberOfValues=Math.max(h,p.numberOfValues)})}).addCase(hn,(t,r)=>{let{facetId:n,selection:o}=r.payload,a=t[n]?.request;if(!a)return;a.preventAutoSelect=!0;let i=a.currentValues.find(f=>f.value===o.value);if(!i){qm(a,o);return}let p=i.state==="selected";i.previousState=i.state,i.state=p?"idle":"selected",a.freezeCurrentValues=!0}).addCase(yn,(t,r)=>{let{facetId:n,selection:o}=r.payload,a=t[n]?.request;if(!a)return;a.preventAutoSelect=!0;let i=a.currentValues.find(f=>f.value===o.value);if(!i){qm(a,o);return}let p=i.state==="excluded";i.previousState=i.state,i.state=p?"idle":"excluded",a.freezeCurrentValues=!0}).addCase(Wn,(t,r)=>{let{facetId:n,freezeCurrentValues:o}=r.payload,a=t[n]?.request;a&&(a.freezeCurrentValues=o)}).addCase(Xe,(t,r)=>{sc(t[r.payload]?.request)}).addCase(pt,t=>{Object.values(t).filter(r=>r.hasBreadcrumbs).forEach(({request:r})=>sc(r))}).addCase(is,t=>{Object.values(t).filter(r=>!r.hasBreadcrumbs).forEach(({request:r})=>sc(r))}).addCase(Wr,(t,r)=>Object.values(t).forEach(n=>{n.request.preventAutoSelect=!r.payload.allow})).addCase(uc,(t,r)=>{ic(t,r.payload)}).addCase(Xa,(t,r)=>{let{facetId:n,numberOfValues:o}=r.payload;Tm(t[n]?.request,o)}).addCase(Za,(t,r)=>{let{facetId:n,isFieldExpanded:o}=r.payload,a=t[n]?.request;a&&(a.isFieldExpanded=o)}).addCase(G.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>GE(t[o.facetId]?.request,o))}).addCase(vr.fulfilled,(t,r)=>{r.payload.response.facets.forEach(o=>GE(t[o.facetId]?.request,o))}).addCase(ei,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n]?.request;if(!a)return;let{rawValue:i}=o,{currentValues:p}=a,f=p.find(h=>h.value===i);if(f){f.state="selected";return}let m=$E(i);qm(a,m),a.freezeCurrentValues=!0,a.preventAutoSelect=!0}).addCase(ti,(t,r)=>{let{facetId:n,value:o}=r.payload,a=t[n]?.request;if(!a)return;let{rawValue:i}=o,{currentValues:p}=a,f=p.find(h=>h.value===i);if(f){f.state="excluded";return}let m=HE(i);qm(a,m),a.freezeCurrentValues=!0,a.preventAutoSelect=!0}).addCase(Je,(t,r)=>{if(!(r.payload in t))return;let{request:n}=t[r.payload];sc(n)}).addCase(gt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!er(a.tabs,n)&&sc(a.request)})})});function qm(e,t){let{currentValues:r}=e,n=r.findIndex(a=>a.state==="idle"),o=n===-1?r.length:n;e.currentValues.splice(o,0,t),n>-1&&e.currentValues.pop(),e.numberOfValues=e.currentValues.length}function GE(e,t){e&&(e.currentValues=t.values.map(oQ),e.freezeCurrentValues=!1,e.preventAutoSelect=!1)}var Cl={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"automatic",resultsMustMatch:"atLeastOneValue"};function nQ(e){return{...Cl,type:"specific",currentValues:[],freezeCurrentValues:!1,isFieldExpanded:!1,preventAutoSelect:!1,...e}}function oQ(e){let{value:t,state:r}=e;return{value:t,state:r}}function $E(e){return{value:e,state:"selected"}}function HE(e){return{value:e,state:"excluded"}}function aQ(e){return{...e,state:"idle"}}d();c();l();u();var Mm=()=>Y("analytics/facet/deselectAllBreadcrumbs",e=>e.makeBreadcrumbResetAll());d();c();l();u();d();c();l();u();function Vo(e){let t=zE(e.start,e),r=zE(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function zE(e,t){let{dateFormat:r}=t;return nR(e)?(xo(e),eR(e)):typeof e=="string"&&Jr(e)?(xo(e),e):(np(e,r),zu(pa(e,r)))}d();c();l();u();var fc=T("rangeFacet/updateSortCriterion",e=>O(e,{facetId:he,criterion:new Le({required:!0})}));d();c();l();u();var ri={state:z,start:new ee({required:!0}),end:new ee({required:!0}),endInclusive:new ce({required:!0}),numberOfResults:new ee({required:!0,min:0})},ni={start:z,end:z,endInclusive:new ce({required:!0}),state:z,numberOfResults:new ee({required:!0,min:0})},oi=e=>({facetId:he,selection:typeof e.start=="string"?new J({values:ni}):new J({values:ri})});var iQ={start:z,end:z,endInclusive:new ce({required:!0}),state:z},sQ={facetId:he,field:z,tabs:new J({options:{required:!1},values:{included:new ae({each:new M}),excluded:new ae({each:new M})}}),activeTab:new M({required:!1}),currentValues:new ae({required:!1,each:new J({values:iQ})}),generateAutomaticRanges:new ce({required:!0}),filterFacetCount:new ce({required:!1}),injectionDepth:new ee({required:!1,min:0}),numberOfValues:new ee({required:!1,min:1}),sortCriteria:new Le({required:!1}),rangeAlgorithm:new Le({required:!1})};function WE(e){return Jr(e)?Ku(e):e}function jm(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=Vo(t);if(pa(WE(r)).isAfter(pa(WE(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var vn=T("dateFacet/register",e=>{try{return lr(e,sQ),jm(e),{payload:e,error:null}}catch(t){return{payload:e,error:_n(t)}}}),xn=T("dateFacet/toggleSelectValue",e=>O(e,{facetId:he,selection:new J({values:ni})})),An=T("dateFacet/toggleExcludeValue",e=>O(e,{facetId:he,selection:new J({values:ni})})),Xn=T("dateFacet/updateFacetValues",e=>{try{return lr(e,{facetId:he,values:new ae({each:new J({values:ni})})}),jm({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:_n(t)}}}),Vm=fc,Lm=Xe;d();c();l();u();d();c();l();u();var Um=(e,{facetId:t,selection:r})=>{let o=(e.dateFacetSet[t]||e.numericFacetSet[t]).request.field,a=`${o}_${t}`;return{facetId:t,facetField:o,facetTitle:a,facetRangeEndInclusive:r.endInclusive,facetRangeEnd:`${r.end}`,facetRangeStart:`${r.start}`}},Qm=()=>({actionCause:"breadcrumbFacet"});var bl=e=>Y("analytics/dateFacet/breadcrumb",(t,r)=>{O(e,oi(e.selection));let n=Um(r,e);return t.makeBreadcrumbFacet(n)}),Jv=Qm;d();c();l();u();function cQ(e,t){return!!t&&t.facetId in e.dateFacetSet}var KE=(e,t)=>{let r=Nr(e,t);if(cQ(e,r))return r},YE=(e,t)=>(KE(e,t)||{values:[]}).values.filter(n=>n.state==="selected"),JE=(e,t)=>(KE(e,t)||{values:[]}).values.filter(n=>n.state!=="idle");d();c();l();u();d();c();l();u();var Gm={filterFacetCount:!0,injectionDepth:1e3,numberOfValues:8,sortCriteria:"ascending",rangeAlgorithm:"even",resultsMustMatch:"atLeastOneValue"};function $m(e,t){let{request:r}=t,{facetId:n}=r;if(n in e)return;let o=XE(r);r.numberOfValues=o,e[n]=t}function Hm(e,t,r){let n=e[t]?.request;n&&(n.currentValues=r,n.numberOfValues=XE(n))}function zm(e,t,r){let n=e[t]?.request;if(!n)return;let o=Bm(n.currentValues,r);if(!o)return;let a=o.state==="selected";o.previousState=o.state,o.state=a?"idle":"selected",n.preventAutoSelect=!0}function Wm(e,t,r){let n=e[t]?.request;if(!n)return;let o=Bm(n.currentValues,r);if(!o)return;let a=o.state==="excluded";o.previousState=o.state,o.state=a?"idle":"excluded",n.preventAutoSelect=!0}function Cn(e,t){let r=e[t]?.request;r&&r.currentValues.forEach(n=>{n.state!=="idle"&&(n.previousState=n.state),n.state="idle"})}function Km(e,t){Object.entries(e).forEach(([r,{request:n}])=>{let o=t[r]||[];n.currentValues.forEach(p=>(Bm(o,p)&&(p.state="selected"),p));let a=o.filter(p=>!Bm(n.currentValues,p)),i=n.currentValues;i.push(...a),n.numberOfValues=Math.max(n.numberOfValues,i.length)})}function Ym(e,t,r){t.forEach(n=>{let o=n.facetId,a=e[o]?.request;if(!a)return;let i=r(n.values);a.currentValues=i,a.preventAutoSelect=!1})}function Bm(e,t){let{start:r,end:n}=t;return e.find(o=>o.start===r&&o.end===n)}function XE(e){let{generateAutomaticRanges:t,currentValues:r,numberOfValues:n}=e;return t?Math.max(n,r.length):r.length}var bn=oe(Gi(),e=>{e.addCase(vn,(t,r)=>{let{payload:n}=r,{tabs:o}=n,a=uQ(n);$m(t,mb(a,o))}).addCase(_e.fulfilled,(t,r)=>r.payload?.dateFacetSet??t).addCase(De,(t,r)=>{let n=r.payload.df||{};Km(t,n)}).addCase(xn,(t,r)=>{let{facetId:n,selection:o}=r.payload;zm(t,n,o)}).addCase(An,(t,r)=>{let{facetId:n,selection:o}=r.payload;Wm(t,n,o)}).addCase(Xn,(t,r)=>{let{facetId:n,values:o}=r.payload;Hm(t,n,o)}).addCase(Lm,(t,r)=>{Cn(t,r.payload)}).addCase(pt,t=>{Object.keys(t).forEach(r=>{Cn(t,r)})}).addCase(Vm,(t,r)=>{ic(t,r.payload)}).addCase(G.fulfilled,(t,r)=>{let n=r.payload.response.facets;Ym(t,n,lQ)}).addCase(Je,(t,r)=>{Cn(t,r.payload)}).addCase(gt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!er(a.tabs,n)&&Cn(t,o)})})});function uQ(e){return{...Gm,currentValues:[],preventAutoSelect:!1,type:"dateRange",...e}}function lQ(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();var dQ={state:z,start:new ee({required:!0}),end:new ee({required:!0}),endInclusive:new ce({required:!0})},pQ={facetId:he,field:z,tabs:new J({options:{required:!1},values:{included:new ae({each:new M}),excluded:new ae({each:new M})}}),activeTab:new M({required:!1}),currentValues:new ae({required:!1,each:new J({values:dQ})}),generateAutomaticRanges:new ce({required:!0}),filterFacetCount:new ce({required:!1}),injectionDepth:new ee({required:!1,min:0}),numberOfValues:new ee({required:!1,min:1}),sortCriteria:new Le({required:!1}),rangeAlgorithm:new Le({required:!1})};function Jm(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 Rn=T("numericFacet/register",e=>{try{return O(e,pQ),Jm(e),{payload:e,error:null}}catch(t){return{payload:e,error:_n(t)}}}),wn=T("numericFacet/toggleSelectValue",e=>O(e,{facetId:he,selection:new J({values:ri})})),Fn=T("numericFacet/toggleExcludeValue",e=>O(e,{facetId:he,selection:new J({values:ri})})),Zn=T("numericFacet/updateFacetValues",e=>{try{return lr(e,{facetId:he,values:new ae({each:new J({values:ri})})}),Jm({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:_n(t)}}}),Xm=fc,Zm=Xe;d();c();l();u();var Rl=e=>Y("analytics/numericFacet/breadcrumb",(t,r)=>{O(e,oi(e.selection));let n=Um(r,e);return t.makeBreadcrumbFacet(n)}),Xv=Qm;d();c();l();u();function fQ(e,t){return!!t&&t.facetId in e.numericFacetSet}var ZE=(e,t)=>{let r=Nr(e,t);if(fQ(e,r))return r},eI=(e,t)=>(ZE(e,t)||{values:[]}).values.filter(n=>n.state!=="idle"),tI=(e,t)=>(ZE(e,t)||{values:[]}).values.filter(n=>n.state==="selected");d();c();l();u();var wr=oe($i(),e=>{e.addCase(Rn,(t,r)=>{let{payload:n}=r,{tabs:o}=n,a=mQ(n);$m(t,gb(a,o))}).addCase(_e.fulfilled,(t,r)=>r.payload?.numericFacetSet??t).addCase(De,(t,r)=>{let n=r.payload.nf||{};Km(t,n)}).addCase(wn,(t,r)=>{let{facetId:n,selection:o}=r.payload;zm(t,n,o)}).addCase(Fn,(t,r)=>{let{facetId:n,selection:o}=r.payload;Wm(t,n,o)}).addCase(Zn,(t,r)=>{let{facetId:n,values:o}=r.payload;Hm(t,n,o)}).addCase(Zm,(t,r)=>{Cn(t,r.payload)}).addCase(pt,t=>{Object.keys(t).forEach(r=>{Cn(t,r)})}).addCase(Xm,(t,r)=>{ic(t,r.payload)}).addCase(G.fulfilled,(t,r)=>{let n=r.payload.response.facets;Ym(t,n,gQ)}).addCase(Je,(t,r)=>{Cn(t,r.payload)}).addCase(gt,(t,r)=>{let n=r.payload;Object.keys(t).forEach(o=>{let a=t[o];(a.tabs?.included?.length||a.tabs?.excluded?.length)&&!er(a.tabs,n)&&Cn(t,o)})})});function mQ(e){return{...Gm,currentValues:[],preventAutoSelect:!1,type:"numericalRange",...e}}function gQ(e){return e.map(t=>{let{numberOfResults:r,...n}=t;return n})}d();c();l();u();d();c();l();u();var ai=z,eg=new J({options:{required:!0},values:{caption:Ue,expression:Ue,state:new M({constrainTo:["idle","selected","excluded"]})}}),tg=new ae({required:!0,each:eg});var mc=T("staticFilter/register",e=>O(e,{id:ai,values:tg})),eo=T("staticFilter/toggleSelect",e=>O(e,{id:ai,value:eg})),to=T("staticFilter/toggleExclude",e=>O(e,{id:ai,value:eg})),Lo=T("staticFilter/deselectAllFilterValues",e=>O(e,ai)),rg=e=>Y("analytics/staticFilter/select",t=>t.makeStaticFilterSelect(e)),gc=e=>Y("analytics/staticFilter/deselect",t=>t.makeStaticFilterDeselect(e)),ng=e=>Y("analytics/staticFilter/clearAll",t=>t.makeStaticFilterClearAll(e));d();c();l();u();d();c();l();u();function ne(e){let t,r=new Map,n=()=>r.size===0,o=a=>{try{let i=JSON.stringify(a),p=t!==i;return t=i,p}catch(i){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",i),!0}};return{subscribe(a){a();let i=Symbol(),p;return n()&&(t=JSON.stringify(this.state),p=e.subscribe(()=>{o(this.state)&&r.forEach(f=>f())})),r.set(i,a),()=>{r.delete(i),n()&&p?.()}},get state(){return{}}}}var og=e=>Object.keys(e.facetSet).map(t=>{let r=e.facetValuesSelector(e.engine.state,t).map(n=>({value:n,deselect:()=>{n.state==="selected"?e.executeToggleSelect({facetId:t,selection:n}):n.state==="excluded"&&e.executeToggleExclude({facetId:t,selection:n})}}));return{facetId:t,field:e.facetSet[t].request.field,values:r}}).filter(t=>t.values.length);function rI(e){let t=ne(e),{dispatch:r}=e;return{...t,get state(){return{facetBreadcrumbs:[],categoryFacetBreadcrumbs:[],numericFacetBreadcrumbs:[],dateFacetBreadcrumbs:[],staticFilterBreadcrumbs:[],hasBreadcrumbs:!1}},deselectAll:()=>{r(pt())},deselectBreadcrumb(n){n.deselect()}}}function nI(e){if(!hQ(e))throw W;let t=rI(e),{dispatch:r}=e,n=()=>e.state,o=()=>{let R={engine:e,facetSet:n().facetSet,executeToggleSelect:({facetId:b,selection:F})=>{r(hn({facetId:b,selection:F})),r(Wn({facetId:b,freezeCurrentValues:!1})),r(G({legacy:pc({facetId:b,facetValue:F.value}),next:_m()}))},executeToggleExclude:({facetId:b,selection:F})=>{r(yn({facetId:b,selection:F})),r(Wn({facetId:b,freezeCurrentValues:!1})),r(G({legacy:pc({facetId:b,facetValue:F.value}),next:_m()}))},facetValuesSelector:db};return og(R)},a=()=>{let R={engine:e,facetSet:n().numericFacetSet,executeToggleSelect:b=>{r(wn(b)),r(G({legacy:Rl(b),next:Xv()}))},executeToggleExclude:b=>{r(Fn(b)),r(G({legacy:Rl(b),next:Xv()}))},facetValuesSelector:eI};return og(R)},i=()=>{let R={engine:e,facetSet:n().dateFacetSet,executeToggleSelect:b=>{r(xn(b)),r(G({legacy:bl(b),next:Jv()}))},executeToggleExclude:b=>{r(An(b)),r(G({legacy:bl(b),next:Jv()}))},facetValuesSelector:JE};return og(R)},p=()=>Object.keys(n().categoryFacetSet).map(f).filter(R=>R.path.length),f=R=>{let b=fb(n(),R);return{facetId:R,field:n().categoryFacetSet[R].request.field,path:b,deselect:()=>{r(un(R)),r(G({legacy:Im({categoryFacetPath:b.map(F=>F.value),categoryFacetId:R}),next:_E()}))}}},m=()=>{let R=n().staticFilterSet??{};return Object.values(R).map(h)},h=R=>{let{id:b,values:F}=R,I=F.filter(P=>P.state!=="idle").map(P=>S(b,P));return{id:b,values:I}},S=(R,b)=>({value:b,deselect:()=>{let{caption:F,expression:I}=b;b.state==="selected"?r(eo({id:R,value:b})):b.state==="excluded"&&r(to({id:R,value:b})),r(G({legacy:gc({staticFilterId:R,staticFilterValue:{caption:F,expression:I}})}))}}),v=()=>{let R=n().automaticFacetSet?.set??{};return Object.values(R).map(b=>g(b.response)).filter(b=>b.values.length>0)},g=R=>{let{field:b,label:F}=R,I=R.values.filter(P=>P.state!=="idle").map(P=>C(b,P));return{facetId:b,field:b,label:F,values:I}},C=(R,b)=>({value:b,deselect:()=>{r(sn({field:R,selection:b})),r(G({legacy:pc({facetId:R,facetValue:b.value}),next:_m()}))}});function w(){return!![...o(),...a(),...i(),...p(),...m(),...v()].length}return{...t,get state(){return{facetBreadcrumbs:o(),categoryFacetBreadcrumbs:p(),numericFacetBreadcrumbs:a(),dateFacetBreadcrumbs:i(),staticFilterBreadcrumbs:m(),automaticFacetBreadcrumbs:v(),hasBreadcrumbs:w()}},deselectAll:()=>{t.deselectAll(),r(G({legacy:Mm(),next:{actionCause:"breadcrumbResetAll"}}))}}}function hQ(e){return e.addReducers({configuration:le,search:fe,facetSet:Rr,numericFacetSet:wr,dateFacetSet:bn,categoryFacetSet:ln}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var yQ=new ae({each:z,required:!0}),oI=(e,t)=>(O(e,z),Ai(t)?O(t,z):O(t,yQ),{payload:{contextKey:e,contextValue:t}}),ii=T("context/set",e=>{for(let[t,r]of Object.entries(e))oI(t,r);return{payload:e}}),si=T("context/add",e=>oI(e.contextKey,e.contextValue)),ci=T("context/remove",e=>O(e,z));d();c();l();u();var ag=oe(cp(),e=>{e.addCase(ii,(t,r)=>{t.contextValues=r.payload}).addCase(si,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(ci,(t,r)=>{delete t.contextValues[r.payload]}).addCase(_e.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});d();c();l();u();var SQ=["caseId","caseNumber"],vQ={caseId:"caseContext",caseNumber:"caseContext"},wl=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${vQ[t]} to set this value.}`)}};function Zv(e){return SQ.includes(e)}var xQ=new ge({values:new J({options:{required:!1}})});function aI(e,t={}){if(!bQ(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a=ut(e,xQ,t.initialState,"buildContext");return a.values&&n(ii(a.values)),{...r,get state(){return{values:o().context.contextValues}},set(i){n(ii(i))},...(o().configuration.analytics.analyticsMode==="legacy"?AQ(n):CQ(n))}}var AQ=e=>({add(t,r){e(si({contextKey:t,contextValue:r}))},remove(t){e(ci(t))}}),CQ=e=>({add(t,r){if(Zv(t))throw new wl(t);e(si({contextKey:t,contextValue:r}))},remove(t){if(Zv(t))throw new wl(t);e(ci(t))}});function bQ(e){return e.addReducers({context:ag}),!0}function iI(e,t){return aI(e,t)}d();c();l();u();d();c();l();u();var xt=oe(lp(),e=>{e.addCase(be,(t,r)=>({...t,...r.payload})).addCase(G.fulfilled,t=>{t.freezeFacetOrder=!1}).addCase(G.rejected,t=>{t.freezeFacetOrder=!1}).addCase(_e.fulfilled,(t,r)=>r.payload?.facetOptions??t).addCase(cn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;ig(o,t,n)}).addCase(gn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;ig(o,t,n)}).addCase(vn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;ig(o,t,n)}).addCase(Rn,(t,r)=>{let{facetId:n,tabs:o}=r.payload;ig(o,t,n)}).addCase(jt,(t,r)=>{t.facets[r.payload].enabled=!0}).addCase(Je,(t,r)=>{t.facets[r.payload].enabled=!1}).addCase(De,(t,r)=>{[...Object.keys(r.payload.f??{}),...Object.keys(r.payload.fExcluded??{}),...Object.keys(r.payload.cf??{}),...Object.keys(r.payload.nf??{}),...Object.keys(r.payload.df??{})].forEach(n=>{n in t||(t.facets[n]=wS()),t.facets[n].enabled=!0})})});function ig(e,t,r){let n={...wS(),tabs:e??{}};t.facets[r]=n}d();c();l();u();d();c();l();u();var hc=oe(mp(),e=>{e.addCase(_s,(t,r)=>{let n=r.payload,{id:o}=n;o in t||(t[o]={...n,isActive:!1})}).addCase(gt,(t,r)=>{let n=r.payload;sI(t,n)}).addCase(ts,(t,r)=>{let n=r.payload;sI(t,n)}).addCase(_e.fulfilled,(t,r)=>r.payload?.tabSet??t).addCase(De,(t,r)=>{let n=r.payload.tab;ue(n)||Object.keys(t).forEach(o=>{t[o].isActive=o===n})})});function sI(e,t){t in e&&Object.keys(e).forEach(n=>{e[n].isActive=n===t})}function sg(e){if(!RQ(e))throw W;let t=ne(e),r=Ye(n=>n.tabSet,n=>Object.values(n).find(a=>a.isActive)?.id??"");return{...t,get state(){return{activeTab:r(e.state)}}}}function RQ(e){return e.addReducers({tabSet:hc}),!0}function cI(e,t){if(!wQ(e))throw W;let r=sg(e),n=C=>e.state.facetOptions.facets[C]?.enabled??!1,o=C=>e.state.facetSet?.[C]?.request?.currentValues??e.state.categoryFacetSet?.[C]?.request?.currentValues??e.state.numericFacetSet?.[C]?.request?.currentValues??e.state.dateFacetSet?.[C]?.request?.currentValues??null,a=C=>C in e.state.facetOptions.facets,i=C=>e.state.facetOptions.facets[C]?.tabs,p=()=>bi({isFacetRegistered:a(t.facetId),parentFacets:t.conditions.map(({parentFacetId:C})=>a(C)?{enabled:n(C),values:o(C)}:null),isTabEnabled:er(i(t.facetId),r.state.activeTab)}),f=()=>{let C=p();return C===v?!1:(v=C,!0)},m=()=>t.conditions.length>0?t.conditions.some(C=>{if(!n(C.parentFacetId))return!1;let w=o(C.parentFacetId);return w===null?!1:C.condition(w)}):!0,h=()=>{e.state.facetSet&&Object.entries(e.state.facetSet).forEach(([C,w])=>w.request.freezeCurrentValues&&e.dispatch(Wn({facetId:C,freezeCurrentValues:!1})))},S=()=>{if(!a(t.facetId))return;let C=n(t.facetId),w=m(),R=er(i(t.facetId),r.state.activeTab),b=w&&R;C!==b&&(e.dispatch(b?jt(t.facetId):Je(t.facetId)),h())},v=p(),g=e.subscribe(()=>{f()&&S()});return S(),{stopWatching(){g()}}}function wQ(e){return e.addReducers({facetOptions:xt}),!0}d();c();l();u();d();c();l();u();var yc=T("dictionaryFieldContext/set",e=>{let t=new J({options:{required:!0}}),r=O(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new ae({each:Ue}),a=O(n,o).error;return a?{payload:e,error:a}:{payload:e}}),Sc=T("dictionaryFieldContext/add",e=>{let t=new J({options:{required:!0},values:{field:Ue,key:Ue}});return O(e,t)}),vc=T("dictionaryFieldContext/remove",e=>O(e,Ue));d();c();l();u();var cg=oe(up(),e=>{e.addCase(yc,(t,r)=>{t.contextValues=r.payload}).addCase(Sc,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(vc,(t,r)=>{delete t.contextValues[r.payload]}).addCase(_e.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function uI(e){if(!FQ(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(yc(o))},add(o,a){r(Sc({field:o,key:a}))},remove(o){r(vc(o))}}}function FQ(e){return e.addReducers({dictionaryFieldContext:cg}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var lI=e=>e.queryCorrection.correctedQuery!==""||e.wasCorrectedTo!=="";d();c();l();u();d();c();l();u();d();c();l();u();var ug=()=>({correctedQuery:"",wordCorrections:[],originalQuery:""}),dI=()=>({correctedQuery:"",corrections:[],originalQuery:""});function pI(){return{enableDidYouMean:!1,wasCorrectedTo:"",wasAutomaticallyCorrected:!1,queryCorrection:ug(),originalQuery:"",automaticallyCorrectQuery:!0,queryCorrectionMode:"legacy"}}var fI=(e,t)=>{let r={...dI(),...t,correctedQuery:t?.correctedQuery||t?.corrections[0]?.correctedQuery||""};e.queryCorrection=r,e.wasCorrectedTo=r.correctedQuery};var lg=oe(pI(),e=>{e.addCase(ys,t=>{t.enableDidYouMean=!0}).addCase(ap,t=>{t.enableDidYouMean=!1}).addCase(ip,t=>{t.automaticallyCorrectQuery=!0}).addCase(Ss,t=>{t.automaticallyCorrectQuery=!1}).addCase(G.pending,t=>{t.queryCorrection=ug(),t.wasAutomaticallyCorrected=!1,t.wasCorrectedTo=""}).addCase(G.fulfilled,(t,r)=>{let{queryCorrection:n,queryCorrections:o}=r.payload.response;if(t.queryCorrectionMode==="legacy"){let a=o?.[0]?o[0]:ug();t.queryCorrection=a}t.queryCorrectionMode==="next"&&fI(t,n),t.wasAutomaticallyCorrected=r.payload.automaticallyCorrected,t.originalQuery=r.payload.originalQuery}).addCase(gr,(t,r)=>{t.wasCorrectedTo=r.payload}).addCase(fa,(t,r)=>{t.queryCorrectionMode=r.payload})});function mI(e,t={}){if(!EQ(e))throw W;let r=ne(e),{dispatch:n}=e;n(ys()),t.options?.automaticallyCorrectQuery===!1&&n(Ss()),n(fa(t.options?.queryCorrectionMode||"next"));let o=()=>e.state,a=()=>lI(o().didYouMean);return{...r,get state(){let i=o();return{originalQuery:i.didYouMean.originalQuery,wasCorrectedTo:i.didYouMean.wasCorrectedTo,wasAutomaticallyCorrected:i.didYouMean.wasAutomaticallyCorrected,queryCorrection:i.didYouMean.queryCorrection,hasQueryCorrection:a()}},applyCorrection(){n(gr(this.state.queryCorrection.correctedQuery))},updateQueryCorrectionMode(i){n(fa(i))}}}function EQ(e){return e.addReducers({configuration:le,didYouMean:lg}),!0}function gI(e,t={}){let r=mI(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},applyCorrection(){r.applyCorrection(),n(G({legacy:sp(),next:cR()}))}}}d();c();l();u();d();c();l();u();function hI(e){if(!IQ(e))throw W;let t=ne(e),r=()=>e.state;return{...t,sort(n){return Yu(n,this.state.facetIds)},get state(){return{facetIds:r().search.response.facets.map(a=>a.facetId)}}}}function IQ(e){return e.addReducers({search:fe,facetOptions:xt}),!0}function yI(e){return hI(e)}d();c();l();u();d();c();l();u();var dg=oe(Ui(),e=>{e.addCase(G.fulfilled,(t,r)=>{t.set={},r.payload.response.generateAutomaticFacets?.facets?.forEach(o=>{t.set[o.field]={response:o}})}).addCase(ec,(t,r)=>{r.payload.desiredCount&&(t.desiredCount=r.payload.desiredCount),r.payload.numberOfValues&&(t.numberOfValues=r.payload.numberOfValues)}).addCase(sn,(t,r)=>{let{field:n,selection:o}=r.payload,a=t.set[n]?.response;if(!a)return;let i=a.values.find(f=>f.value===o.value);if(!i)return;let p=i.state==="selected";i.state=p?"idle":"selected"}).addCase(tc,(t,r)=>{let n=r.payload,o=t.set[n]?.response;if(o)for(let a of o.values)a.state="idle"}).addCase(De,(t,r)=>{let n=r.payload.af??{},o=Object.keys(t.set);for(let a in n)if(!t.set[a]){let i=TQ(a),p=n[a].map(f=>SI(f));i.values.push(...p),t.set[a]={response:i}}for(let a of o)if(!(a in n)){let i=t.set[a]?.response;for(let p of i.values)p.state="idle"}for(let a in n){let i=t.set[a]?.response;if(i){let p=i.values,f=new Set(n[a]);for(let m of p)f.has(m.value)?(m.state="selected",f.delete(m.value)):m.state="idle";for(let m of f)i.values.push(SI(m))}}}).addCase(_e.fulfilled,(t,r)=>{if(r.payload&&Object.keys(r.payload.automaticFacetSet.set).length!==0)return r.payload.automaticFacetSet}).addCase(pt,t=>{Object.values(t.set).forEach(({response:r})=>{r.values.forEach(n=>{n.state="idle"})})})});function TQ(e){return{field:e,values:[],moreValuesAvailable:!1,label:"",indexScore:0}}function SI(e){return{value:e,state:"selected",numberOfResults:0}}d();c();l();u();d();c();l();u();var pg=e=>e.state==="selected",fg=e=>e.state==="excluded",mg=(e,t)=>{let r={facetId:e,facetValue:t.value};return pg(t)?Lr(r):ot(r)},gg=e=>pg(e)?Jn():mt(),vI=(e,t)=>{let r={facetId:e,facetValue:t.value};return fg(t)?Kn(r):cr(r)},xI=e=>fg(e)?QE():Yn();function AI(e,t){let{dispatch:r}=e,n=ne(e),{field:o}=t;return{...n,toggleSelect(a){r(sn({field:o,selection:a})),r(G({legacy:mg(o,a),next:gg(a)}))},deselectAll(){r(tc(o)),r(G({legacy:vt(o),next:Vt()}))},get state(){let a=e.state.automaticFacetSet?.set[o]?.response;return a?{field:a.field,label:a.label,values:a.values}:{field:"",values:[],label:""}}}}d();c();l();u();function CI(e){return{desiredCount:e.desiredCount,numberOfValues:e.numberOfValues}}function bI(e,t){if(!PQ(e))throw W;let{dispatch:r}=e,n=CI(t.options);return r(ec(n)),{...ne(e),get state(){return{automaticFacets:e.state.search.response.generateAutomaticFacets?.facets.map(i=>AI(e,{field:i.field}))??[]}}}}function PQ(e){return e.addReducers({automaticFacetSet:dg,configuration:le,search:fe}),!0}d();c();l();u();d();c();l();u();d();c();l();u();function hg(e,t,r){let{facetId:n}=t;if(e[n])return;let o=!1,a={...En,...t},i=r();e[n]={options:a,isLoading:o,response:i,initialNumberOfValues:a.numberOfValues,requestId:""}}function yg(e,t){let{facetId:r,...n}=t,o=e[r];o&&(o.options={...o.options,...n})}function Sg(e,t,r){let n=e[t];n&&(n.requestId=r,n.isLoading=!0)}function vg(e,t){let r=e[t];r&&(r.isLoading=!1)}function xg(e,t,r){let{facetId:n,response:o}=t,a=e[n];a&&a.requestId===r&&(a.isLoading=!1,a.response=o)}function Fl(e,t,r){let{facetId:n}=t,o=e[n];o&&(o.requestId="",o.isLoading=!1,o.response=r(),o.options.numberOfValues=o.initialNumberOfValues,o.options.query=En.query)}function Ag(e,t){Object.keys(e).forEach(r=>Fl(e,{facetId:r},t))}var En={captions:{},numberOfValues:10,query:""};d();c();l();u();d();c();l();u();var RI=/*#__PURE__*/function(){var _ref71=_asyncToGenerator(function*(e,t,r,n){let o=t.categoryFacetSearchSet[e].options,a=t.categoryFacetSet[e].request,{captions:i,query:p,numberOfValues:f}=o,{field:m,delimitingCharacter:h,basePath:S,filterFacetCount:v}=a,g=kQ(a),C=g.length?[g]:[],w=`*${p}*`;return{url:t.configuration.search.apiBaseUrl??ct(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")}),basePath:S,captions:i,numberOfValues:f,query:w,field:m,delimitingCharacter:h,ignorePaths:C,filterFacetCount:v,type:"hierarchical",...(n?{}:{searchContext:(yield yr(t,r)).request})}});return function RI(_x153,_x154,_x155,_x156){return _ref71.apply(this,arguments)}}(),kQ=e=>{let t=[],r=e.currentValues[0];for(;r;)t.push(r.value),r=r.children[0];return t};d();c();l();u();var wI=/*#__PURE__*/function(){var _ref72=_asyncToGenerator(function*(e,t,r,n){let{captions:o,query:a,numberOfValues:i}=t.facetSearchSet[e].options,{field:p,currentValues:f,filterFacetCount:m}=t.facetSet[e].request,h=f.filter(v=>v.state!=="idle").map(v=>v.value),S=`*${a}*`;return{url:t.configuration.search.apiBaseUrl??ct(t.configuration.organizationId,t.configuration.environment),accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,...(t.configuration.search.authenticationProviders&&{authentication:t.configuration.search.authenticationProviders.join(",")}),captions:o,numberOfValues:i,query:S,field:p,ignoreValues:h,filterFacetCount:m,type:"specific",...(n?{}:{searchContext:(yield yr(t,r)).request})}});return function wI(_x157,_x158,_x159,_x160){return _ref72.apply(this,arguments)}}();var FI=e=>(/*#__PURE__*/function(){var _ref73=_asyncToGenerator(function*(t,{getState:r,extra:{apiClient:n,validatePayload:o,navigatorContext:a}}){let i=r(),p;o(t,z),OQ(i,t)?p=yield wI(t,i,a,e):p=yield RI(t,i,a,e);let f=yield n.facetSearch(p);return{facetId:t,response:f}});return function(_x161,_x162){return _ref73.apply(this,arguments)}}()),At=Se("facetSearch/executeSearch",FI(!1)),In=Se("facetSearch/executeSearch",FI(!0)),xc=T("facetSearch/clearResults",e=>O(e,{facetId:he})),OQ=(e,t)=>e.facetSearchSet!==void 0&&e.facetSet!==void 0&&e.facetSet[t]!==void 0;d();c();l();u();function EI(){return{}}var Ac=oe(EI(),e=>{e.addCase(ac,(t,r)=>{let n=r.payload;hg(t,n,ex)}).addCase(jo,(t,r)=>{yg(t,r.payload)}).addCase(At.pending,(t,r)=>{let n=r.meta.arg;Sg(t,n,r.meta.requestId)}).addCase(At.rejected,(t,r)=>{let n=r.meta.arg;vg(t,n)}).addCase(At.fulfilled,(t,r)=>{xg(t,r.payload,r.meta.requestId)}).addCase(xc,(t,{payload:{facetId:r}})=>{Fl(t,{facetId:r},ex)}).addCase(G.fulfilled,t=>{Ag(t,ex)})});function ex(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();d();c();l();u();function II(e,t){let{field:r,state:n}=e;if(!NQ(e))return r;let o=`${r}_`,a=_Q(o,n);return qQ(r,t),`${o}${a}`}function NQ(e){let{field:t,state:r}=e;return TI(r).some(o=>o&&t in o)}function _Q(e,t){let n=TI(t).map(o=>Object.keys(o||{})).reduce((o,a)=>o.concat(a),[]);return DQ(n,e)+1}function TI(e){let{facetSet:t,numericFacetSet:r,dateFacetSet:n,categoryFacetSet:o}=e;return[t,r,n,o]}function DQ(e,t){return e.map(a=>{let i=a.split(t)[1],p=parseInt(i,10);return Number.isNaN(p)?0:p}).sort().pop()??0}function qQ(e,t){let r=`A facet with field "${e}" already exists.
|
|
45
|
+
To avoid unexpected behaviour, configure the #id option on the facet controller.`;t.warn(r)}function Lt(e,t){let{state:r,logger:n}=e,{field:o,facetId:a}=t;return a||II({field:o,state:r},n)}d();c();l();u();d();c();l();u();var PI=["alphanumeric","occurrences"];var kI=new ge({field:pn,tabs:new J({options:{required:!1},values:{included:new ae({each:new M}),excluded:new ae({each:new M})}}),basePath:jE,delimitingCharacter:VE,facetId:dn,facetSearch:cc,filterByBasePath:LE,filterFacetCount:fn,injectionDepth:mn,numberOfValues:Vr,sortCriteria:new M({constrainTo:PI})});function OI(e,t){if(!MQ(e))throw W;let r=ne(e),{dispatch:n}=e,o=Lt(e,t.options),a=t.options.tabs??{},i=Gt(e.state.tabSet),p={...Al,...Hl("facetSearch",t.options),field:t.options.field,facetId:o,tabs:a,activeTab:i},f={facetSearch:{...En,...t.options.facetSearch},...p};Be(e,kI,f,"buildCategoryFacet");let m=()=>Yy(e.state,o),h=()=>Ky(e.state,o),S=()=>$r(e.state),v=()=>Xr(e.state,o);return n(cn(p)),{...r,toggleSelect(g){let C=f.numberOfValues;n(Mo({facetId:o,selection:g,retrieveCount:C})),n(be())},deselectAll(){n(un(o)),n(be())},sortBy(g){n(nc({facetId:o,criterion:g})),n(be())},isSortedBy(g){return m().sortCriteria===g},showMoreValues(){let{numberOfValues:g}=f,{activeValue:C,valuesAsTrees:w}=this.state,R=(C?.children.length??w.length)+g;n(Ja({facetId:o,numberOfValues:R})),n(be())},showLessValues(){let{numberOfValues:g}=f;n(Ja({facetId:o,numberOfValues:g})),n(be())},enable(){n(jt(o))},disable(){n(Je(o))},get state(){let g=m(),C=h(),w=S(),R=v(),b=C?.values??[],F=b.some(U=>U.children.length>0)??!1,{parents:I,values:P}=pb(C?.values),V=or(b),_=V.length?V[V.length-1]:void 0,k=!!_,N=_?.moreValuesAvailable??C?.moreValuesAvailable??!1,q=_?_.children.length>f.numberOfValues:b.length>f.numberOfValues;return{facetId:o,parents:I,selectedValueAncestry:V,values:P,isHierarchical:F,valuesAsTrees:b,activeValue:_,isLoading:w,hasActiveValues:k,canShowMoreValues:N,canShowLessValues:q,sortCriteria:g.sortCriteria,enabled:R}}}}function MQ(e){return e.addReducers({categoryFacetSet:ln,categoryFacetSearchSet:Ac,facetOptions:xt,configuration:le,search:fe}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var jQ="coveo-headless-internal-state",Cg=Symbol.for(jQ);d();c();l();u();function Cc(e,t){let r=e.dispatch,{options:n,getFacetSearch:o,executeFacetSearchActionCreator:a,executeFieldSuggestActionCreator:i}=t,{facetId:p}=n;return{updateText(f){r(jo({facetId:p,query:f,numberOfValues:o().initialNumberOfValues}))},showMoreResults(){let{initialNumberOfValues:f,options:m}=o();r(jo({facetId:p,numberOfValues:m.numberOfValues+f})),r(t.isForFieldSuggestions?i(p):a(p))},search(){r(t.isForFieldSuggestions?i(p):a(p))},clear(){r(xc({facetId:p}))},updateCaptions(f){r(jo({facetId:p,captions:f}))},get state(){let{response:f,isLoading:m,options:h}=o(),{query:S}=h,v=f.values;return{...f,values:v,isLoading:m,query:S}}}}function NI(e,t){let{dispatch:r}=e,n={...En,...t.options},{facetId:o}=n,a=()=>"state"in e?e.state.categoryFacetSearchSet[o]:e[Cg].categoryFacetSearchSet[o];r(ac(n));let i=Cc(e,{options:n,getFacetSearch:a,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:t.executeFacetSearchActionCreator,executeFieldSuggestActionCreator:t.executeFieldSuggestActionCreator});return{...i,select(p){r(oc({facetId:o,value:p})),t.select(p)},get state(){return i.state}}}function bg(e,t){let{executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:o,isForFieldSuggestions:a}=t,{dispatch:i}=e,p={...En,...t.options},{facetId:f}=p,m=()=>e.state.categoryFacetSearchSet[f],h=NI(e,{options:{...p},executeFacetSearchActionCreator:r,executeFieldSuggestActionCreator:n,select:o,isForFieldSuggestions:a});i(ac(p));let S=Cc(e,{options:p,getFacetSearch:m,isForFieldSuggestions:t.isForFieldSuggestions,executeFacetSearchActionCreator:At,executeFieldSuggestActionCreator:In});return{...S,...h,get state(){return{...S.state,...h.state}}}}function _I(e,t){if(!VQ(e))throw W;let r=OI(e,t),{dispatch:n}=e,o=()=>r.state.facetId,a=bg(e,{options:{facetId:o(),...t.options.facetSearch},executeFacetSearchActionCreator:At,executeFieldSuggestActionCreator:In,select:f=>{n(be()),n(G({legacy:ot({facetId:o(),facetValue:f.rawValue}),next:mt()}))},isForFieldSuggestions:!1}),{state:i,...p}=a;return{...r,facetSearch:p,toggleSelect(f){r.toggleSelect(f),n(G({legacy:LQ(o(),f),next:UQ(f)}))},deselectAll(){r.deselectAll(),n(G({legacy:vt(o()),next:Vt()}))},sortBy(f){r.sortBy(f),n(G({legacy:Sn({facetId:o(),criterion:f})}))},showMoreValues(){r.showMoreValues(),n(vr({legacy:lc(o())}))},showLessValues(){r.showLessValues(),n(vr({legacy:dc(o())}))},get state(){return{...r.state,facetSearch:a.state}}}}function VQ(e){return e.addReducers({categoryFacetSet:ln,categoryFacetSearchSet:Ac,configuration:le,search:fe}),!0}function LQ(e,t){let r={facetId:e,facetValue:t.value};return t.state==="selected"?Lr(r):ot(r)}function UQ(e){return e.state==="selected"?Jn():mt()}d();c();l();u();d();c();l();u();d();c();l();u();function DI(){return{}}var bc=oe(DI(),e=>{e.addCase(Dm,(t,r)=>{let n=r.payload;hg(t,n,tx)}).addCase(jo,(t,r)=>{yg(t,r.payload)}).addCase(At.pending,(t,r)=>{let n=r.meta.arg;Sg(t,n,r.meta.requestId)}).addCase(At.rejected,(t,r)=>{let n=r.meta.arg;vg(t,n)}).addCase(At.fulfilled,(t,r)=>{xg(t,r.payload,r.meta.requestId)}).addCase(xc,(t,{payload:r})=>{Fl(t,r,tx)}).addCase(G.fulfilled,t=>{Ag(t,tx)})});function tx(){return{moreValuesAvailable:!1,values:[]}}d();c();l();u();d();c();l();u();var qI={facetId:he,selection:new J({values:Ya})},MI=Se("facet/executeToggleSelect",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},qI),n(hn({facetId:e,selection:t})),n(be())}),jI=Se("facet/executeToggleExclude",({facetId:e,selection:t},r)=>{let{dispatch:n,extra:{validatePayload:o}}=r;o({facetId:e,selection:t},qI),n(yn({facetId:e,selection:t})),n(be())});d();c();l();u();d();c();l();u();var Rc=["allValues","atLeastOneValue"];d();c();l();u();var Rg=["score","alphanumeric","alphanumericDescending","occurrences","automatic","alphanumericNatural","alphanumericNaturalDescending"];var VI=new ge({facetId:dn,tabs:new J({options:{required:!1},values:{included:new ae({each:new M}),excluded:new ae({each:new M})}}),field:pn,filterFacetCount:fn,injectionDepth:mn,numberOfValues:Vr,sortCriteria:new M({constrainTo:Rg}),resultsMustMatch:new M({constrainTo:Rc}),facetSearch:cc});function LI(e,t,r=VI){if(!QQ(e))throw W;let{dispatch:n}=e,o=ne(e),a=Lt(e,t.options),i=t.options.tabs??{},p=Gt(e.state.tabSet),f={...Cl,...Hl("facetSearch",t.options),field:t.options.field,facetId:a,tabs:i,activeTab:p},m={facetSearch:{...En,...t.options.facetSearch},...f};Be(e,r,m,"buildFacet");let h=()=>_d(e.state,a),S=()=>Qi(e.state,a),v=()=>$r(e.state),g=()=>Xr(e.state,a),C=()=>{let{currentValues:R}=h();return R.filter(b=>b.state!=="idle").length},w=()=>{let{currentValues:R}=h(),b=m.numberOfValues,F=!!R.find(I=>I.state==="idle");return b<R.length&&F};return n(gn(f)),{...o,toggleSelect:R=>n(MI({facetId:m.facetId,selection:R})),toggleExclude:R=>n(jI({facetId:m.facetId,selection:R})),toggleSingleSelect:function(R){R.state==="idle"&&n(Xe(a)),this.toggleSelect(R)},toggleSingleExclude:function(R){R.state==="idle"&&n(Xe(a)),this.toggleExclude(R)},isValueSelected:pg,isValueExcluded:fg,deselectAll(){n(Xe(a)),n(be())},sortBy(R){n(uc({facetId:a,criterion:R})),n(be())},isSortedBy(R){return this.state.sortCriterion===R},showMoreValues(){let R=h().numberOfValues,b=m.numberOfValues,F=b-R%b,I=R+F;n(Xa({facetId:a,numberOfValues:I})),n(Za({facetId:a,isFieldExpanded:!0})),n(be())},showLessValues(){let R=m.numberOfValues,b=Math.max(R,C());n(Xa({facetId:a,numberOfValues:b})),n(Za({facetId:a,isFieldExpanded:!1})),n(be())},enable(){n(jt(a))},disable(){n(Je(a))},get state(){let R=h(),b=S(),F=v(),I=g(),P;typeof R.sortCriteria=="object"?P=R.sortCriteria.order==="descending"?"alphanumericDescending":"alphanumeric":P=R.sortCriteria;let V=b?b.values:[],_=V.some(q=>q.state!=="idle"),k=b?b.moreValuesAvailable:!1,N=R.resultsMustMatch;return{label:b?.label,facetId:a,tabs:i,values:V,sortCriterion:P,resultsMustMatch:N,isLoading:F,hasActiveValues:_,canShowMoreValues:k,canShowLessValues:w(),enabled:I}}}}function QQ(e){return e.addReducers({facetSet:Rr,facetOptions:xt,configuration:le,facetSearchSet:bc}),!0}d();c();l();u();function wg(e,t){let{dispatch:r}=e,{options:n,select:o,exclude:a,isForFieldSuggestions:i,executeFacetSearchActionCreator:p,executeFieldSuggestActionCreator:f}=t,{facetId:m}=n,h=()=>"state"in e?e.state.facetSearchSet[m]:e[Cg].facetSearchSet[m];r(Dm(n));let S=Cc(e,{options:n,getFacetSearch:h,isForFieldSuggestions:i,executeFacetSearchActionCreator:p,executeFieldSuggestActionCreator:f});return{...S,select(v){r(ei({facetId:m,value:v})),o(v)},exclude(v){r(ti({facetId:m,value:v})),a(v)},singleSelect(v){r(Xe(m)),r(ei({facetId:m,value:v})),o(v)},singleExclude(v){r(Xe(m)),r(ti({facetId:m,value:v})),a(v)},get state(){let{values:v}=S.state;return{...S.state,values:v.map(({count:g,displayValue:C,rawValue:w})=>({count:g,displayValue:C,rawValue:w}))}}}}d();c();l();u();var UI=new ge({facetId:dn,field:pn,tabs:new J({options:{required:!1},values:{included:new ae({each:new M}),excluded:new ae({each:new M})}}),filterFacetCount:fn,injectionDepth:mn,numberOfValues:Vr,sortCriteria:new M({constrainTo:Rg}),resultsMustMatch:new M({constrainTo:Rc}),facetSearch:cc,allowedValues:Om,hasBreadcrumbs:UE,customSort:Nm});function QI(e,t){if(!BQ(e))throw W;let{dispatch:r}=e,n=LI(e,{...t,options:{...t.options,...(t.options.allowedValues&&{allowedValues:{type:"simple",values:t.options.allowedValues}})}},UI),o=()=>n.state.facetId,i=(()=>{let{facetSearch:m}=t.options;return wg(e,{options:{facetId:o(),...m},select:h=>{r(be()),r(G({legacy:ot({facetId:o(),facetValue:h.rawValue}),next:mt()}))},exclude:h=>{r(be()),r(G({legacy:cr({facetId:o(),facetValue:h.rawValue}),next:Yn()}))},isForFieldSuggestions:!1,executeFacetSearchActionCreator:At,executeFieldSuggestActionCreator:In})})(),{state:p,...f}=i;return{...n,facetSearch:f,toggleSelect(m){n.toggleSelect(m),r(G({legacy:mg(o(),m),next:gg(m)}))},toggleExclude(m){n.toggleExclude(m),r(G({legacy:vI(o(),m),next:xI(m)}))},deselectAll(){n.deselectAll(),r(G({legacy:vt(o()),next:Vt()}))},sortBy(m){n.sortBy(m),r(G({legacy:Sn({facetId:o(),criterion:m})}))},isSortedBy(m){return this.state.sortCriterion===m},showMoreValues(){n.showMoreValues(),r(vr({legacy:lc(o())}))},showLessValues(){n.showLessValues(),r(vr({legacy:dc(o())}))},get state(){return{...n.state,facetSearch:i.state}}}}function BQ(e){return e.addReducers({facetSet:Rr,configuration:le,facetSearchSet:bc,search:fe}),!0}d();c();l();u();d();c();l();u();var Fg=e=>e.state==="selected",rx=e=>e.state==="excluded",Eg=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return Fg(t)?Lr(n):ot(n)},Ig=e=>Fg(e)?Jn():mt(),BI=(e,t)=>{let r=`${t.start}..${t.end}`,n={facetId:e,facetValue:r};return rx(t)?Kn(n):cr(n)};d();c();l();u();d();c();l();u();d();c();l();u();var Tg=T("rangeFacet/executeToggleSelect",e=>O(e,oi(e.selection))),Pg=T("rangeFacet/executeToggleExclude",e=>O(e,oi(e.selection)));var GI={facetId:he,selection:new J({values:ni})},$I=Se("dateFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,GI),t(xn(e)),t(Tg(e)),t(be())}),HI=Se("dateFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,GI),t(An(e)),t(Pg(e)),t(be())});d();c();l();u();function kg(e,t){if(!e.generateAutomaticRanges&&e.currentValues===void 0){let r=`currentValues should be specified for ${t} when generateAutomaticRanges is false.`;throw new Error(r)}}d();c();l();u();function Og(e,t){let{facetId:r,getRequest:n}=t,o=ne(e),a=e.dispatch,i=()=>Xr(e.state,r);return{...o,isValueSelected:Fg,isValueExcluded:rx,deselectAll(){a(Xe(r)),a(be())},sortBy(p){a(fc({facetId:r,criterion:p})),a(be())},isSortedBy(p){return this.state.sortCriterion===p},enable(){a(jt(r))},disable(){a(Je(r))},get state(){let p=n(),f=Nr(e.state,r),m=p.sortCriteria,h=p.resultsMustMatch,S=f?f.values:[],v=$r(e.state),g=i(),C=S.some(R=>R.state!=="idle"),w=f?.domain;return{facetId:r,values:S,sortCriterion:m,resultsMustMatch:h,hasActiveValues:C,isLoading:v,enabled:g,domain:w}}}}d();c();l();u();d();c();l();u();var Ng=["idle","selected","excluded"];d();c();l();u();var _g=["ascending","descending"],Dg=["even","equiprobable"];var GQ={start:new M,end:new M,endInclusive:new ce,state:new M({constrainTo:Ng})},$Q=new ge({facetId:dn,field:pn,tabs:new J({options:{required:!1},values:{included:new ae({each:new M}),excluded:new ae({each:new M})}}),generateAutomaticRanges:km,filterFacetCount:fn,injectionDepth:mn,numberOfValues:Vr,currentValues:new ae({each:new J({values:GQ})}),sortCriteria:new M({constrainTo:_g}),rangeAlgorithm:new M({constrainTo:Dg})});function qg(e,t){Be(e,$Q,t,"buildDateFacet"),jm(t)}function zI(e,t){if(!HQ(e))throw W;kg(t.options,"buildDateFacet");let r=e.dispatch,n=Lt(e,t.options),o=t.options.tabs??{},a=Gt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:a};qg(e,i),r(vn(i));let p=Og(e,{facetId:n,getRequest:()=>e.state.dateFacetSet[n].request});return{...p,toggleSelect:f=>r($I({facetId:n,selection:f})),toggleSingleSelect:function(f){f.state==="idle"&&r(Xe(n)),this.toggleSelect(f)},toggleExclude:f=>r(HI({facetId:n,selection:f})),toggleSingleExclude:function(f){f.state==="idle"&&r(Xe(n)),this.toggleExclude(f)},get state(){return p.state}}}function HQ(e){return e.addReducers({configuration:le,search:fe,dateFacetSet:bn,facetOptions:xt}),!0}function WI(e,t){let r=zI(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(G({legacy:vt(o()),next:Vt()}))},sortBy(a){r.sortBy(a),n(G({legacy:Sn({facetId:o(),criterion:a})}))},toggleSelect:a=>{r.toggleSelect(a),n(G({legacy:Eg(o(),a),next:Ig(a)}))},toggleExclude:a=>{r.toggleExclude(a),n(G({legacy:BI(o(),a)}))},get state(){return r.state}}}d();c();l();u();d();c();l();u();function KI(e,t){if(!zQ(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a=Lt(e,t.options),i=t.options.tabs??{},p=Gt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:a,tabs:i,activeTab:p};qg(e,f),n(vn(f));let m=()=>Xr(e.state,a);return{...r,clear:()=>{n(Xn({facetId:a,values:[]})),n(be())},setRange:h=>{let S={...h,state:"selected",numberOfResults:0,endInclusive:!0},v=Xn({facetId:a,values:[S]});return v.error?!1:(n(v),n(be()),!0)},enable(){n(jt(a))},disable(){n(Je(a))},get state(){let h=$r(o()),S=m(),v=YE(o(),a),g=v.length?v[0]:void 0;return{facetId:a,isLoading:h,range:g,enabled:S}}}}function zQ(e){return e.addReducers({dateFacetSet:bn,facetOptions:xt,configuration:le,search:fe}),!0}function YI(e,t){if(!WQ(e))throw W;let r=KI(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(G({legacy:vt(o()),next:Vt()}))},setRange:a=>{let i=r.setRange(a);return i&&n(G({legacy:ot({facetId:o(),facetValue:`${a.start}..${a.end}`}),next:mt()})),i},get state(){return{...r.state}}}}function WQ(e){return e.addReducers({dateFacetSet:bn,configuration:le,search:fe}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var JI={facetId:he,selection:new J({values:ri})},XI=Se("numericFacet/executeToggleSelect",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,JI),t(wn(e)),t(Tg(e)),t(be())}),VVe=Se("numericFacet/executeToggleExclude",(e,{dispatch:t,extra:{validatePayload:r}})=>{r(e,JI),t(Fn(e)),t(Pg(e)),t(be())});d();c();l();u();var KQ={start:new ee,end:new ee,endInclusive:new ce,state:new M({constrainTo:Ng})},YQ=new ge({facetId:dn,tabs:new J({options:{required:!1},values:{included:new ae({each:new M}),excluded:new ae({each:new M})}}),field:pn,generateAutomaticRanges:km,filterFacetCount:fn,injectionDepth:mn,numberOfValues:Vr,currentValues:new ae({each:new J({values:KQ})}),sortCriteria:new M({constrainTo:_g}),resultsMustMatch:new M({constrainTo:Rc}),rangeAlgorithm:new M({constrainTo:Dg})});function Mg(e,t){Be(e,YQ,t,"buildNumericFacet"),Jm(t)}d();c();l();u();function wc(e){return{endInclusive:!1,state:"idle",...e}}function ZI(e,t){if(!JQ(e))throw W;kg(t.options,"buildNumericFacet");let r=e.dispatch,n=Lt(e,t.options),o=t.options.tabs??{},a=Gt(e.state.tabSet),i={currentValues:[],...t.options,facetId:n,tabs:o,activeTab:a};Mg(e,i),r(Rn(i));let p=Og(e,{facetId:n,getRequest:()=>e.state.numericFacetSet[n].request});return{...p,toggleSelect:f=>r(XI({facetId:n,selection:f})),toggleSingleSelect(f){f.state==="idle"&&r(Xe(n)),this.toggleSelect(f)},get state(){return p.state}}}function JQ(e){return e.addReducers({numericFacetSet:wr,facetOptions:xt,configuration:le,search:fe}),!0}function eT(e,t){if(!XQ(e))throw W;let r=ZI(e,t),n=e.dispatch,o=()=>r.state.facetId;return{...r,deselectAll(){r.deselectAll(),n(G({legacy:vt(o()),next:Vt()}))},sortBy(a){r.sortBy(a),n(G({legacy:Sn({facetId:o(),criterion:a})}))},toggleSelect:a=>{r.toggleSelect(a),n(G({legacy:Eg(o(),a),next:Ig(a)}))},get state(){return{...r.state}}}}function XQ(e){return e.addReducers({numericFacetSet:wr,configuration:le,search:fe}),!0}d();c();l();u();d();c();l();u();function tT(e,t){if(!ZQ(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a=Lt(e,t.options),i=t.options.tabs??{},p=Gt(e.state.tabSet),f={...t.options,currentValues:t.initialState?.range?[{...t.initialState.range,endInclusive:!0,state:"selected"}]:[],generateAutomaticRanges:!1,facetId:a,tabs:i,activeTab:p};Mg(e,f),n(Rn(f));let m=()=>Xr(e.state,a);return{...r,clear:()=>{n(Zn({facetId:a,values:[]})),n(be())},setRange:h=>{let S={...h,state:"selected",numberOfResults:0,endInclusive:!0},v=Zn({facetId:a,values:[S]});return v.error?!1:(n(v),n(be()),!0)},enable(){n(jt(a))},disable(){n(Je(a))},get state(){let h=$r(o()),S=m(),v=tI(o(),a),g=v.length?v[0]:void 0;return{facetId:a,isLoading:h,range:g,enabled:S}}}}function ZQ(e){return e.addReducers({numericFacetSet:wr,facetOptions:xt,configuration:le,search:fe}),!0}function rT(e,t){if(!eB(e))throw W;let r=tT(e,t),{dispatch:n}=e,o=()=>r.state.facetId;return{...r,clear:()=>{r.clear(),n(G({legacy:vt(o()),next:Vt()}))},setRange:a=>{let i=r.setRange(a);return i&&n(G({legacy:ot({facetId:o(),facetValue:`${a.start}..${a.end}`}),next:mt()})),i},get state(){return{...r.state}}}}function eB(e){return e.addReducers({numericFacetSet:wr,configuration:le,search:fe}),!0}d();c();l();u();function nT(e,t){if(!tB(e))throw W;let{facetSearch:r,...n}=t.options.facet,o=Lt(e,n);e.dispatch(cn({...Al,...n,facetId:o}));let a=bg(e,{options:{...r,facetId:o},executeFacetSearchActionCreator:At,executeFieldSuggestActionCreator:In,select:p=>{e.dispatch(be()),e.dispatch(G({legacy:ot({facetId:o,facetValue:p.rawValue}),next:mt()}))},isForFieldSuggestions:!0});return{...ne(e),...a,updateText:p=>{a.updateText(p),a.search()},get state(){return a.state}}}function tB(e){return e.addReducers({categoryFacetSet:ln,configuration:le,categoryFacetSearchSet:Ac,search:fe}),!0}d();c();l();u();function oT(e,t){if(!rB(e))throw W;let{facetSearch:r,allowedValues:n,...o}=t.options.facet,a=Lt(e,o);e.dispatch(gn({...Cl,...o,facetId:a,...(n&&{allowedValues:{type:"simple",values:n}})}));let i=wg(e,{options:{...r,facetId:a},select:f=>{e.dispatch(be()),e.dispatch(G({legacy:ot({facetId:a,facetValue:f.rawValue}),next:mt()}))},exclude:f=>{e.dispatch(be()),e.dispatch(G({legacy:cr({facetId:a,facetValue:f.rawValue}),next:Yn()}))},isForFieldSuggestions:!0,executeFacetSearchActionCreator:At,executeFieldSuggestActionCreator:In});return{...ne(e),...i,updateText:f=>{i.updateText(f),i.search()},get state(){return i.state}}}function rB(e){return e.addReducers({facetSet:Rr,configuration:le,facetSearchSet:bc,search:fe}),!0}d();c();l();u();d();c();l();u();var nx={collectionField:new M({emptyAllowed:!1,required:!1}),parentField:new M({emptyAllowed:!1,required:!1}),childField:new M({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new ee({min:0,required:!1})},Uo=T("folding/register",e=>O(e,nx)),Qo=Se("folding/loadCollection",/*#__PURE__*/function(){var _ref74=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let a=t(),i=a.configuration.analytics.analyticsMode==="legacy"?yield So(a):ms(a,o),p=yield n.search({...i,q:nB(a),enableQuerySyntax:!0,cq:`@${a.folding.fields.collection}="${e}"`,filterField:a.folding.fields.collection,childField:a.folding.fields.parent,parentField:a.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return ht(p)?r(p.error):{collectionId:e,results:p.success.results,searchUid:p.success.searchUid,rootResult:a.folding.collections[e].result}});return function(_x163,_x164){return _ref74.apply(this,arguments)}}());function nB(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}d();c();l();u();var oB=e=>Y("analytics/folding/showMore",(t,r)=>(Kt(e),t.makeShowMoreFoldedResults(dt(e,r),He(e)))),aB=()=>Y("analytics/folding/showLess",e=>e.makeShowLessFoldedResults()),aT={logShowMoreFoldedResults:oB,logShowLessFoldedResults:aB};d();c();l();u();d();c();l();u();d();c();l();u();var jg=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});function iB(e,t){return e.raw[t.collection]}function ox(e,t){return e.raw[t.parent]}function El(e,t){let r=e.raw[t.child];return Gl(r)?r[0]:r}function sB(e,t){return(e||t)!==void 0&&e===t}function sT(e,t,r,n=[]){let o=El(e,r);return o?n.indexOf(o)!==-1?[]:t.filter(a=>{let i=El(a,r)===El(e,r);return ox(a,r)===o&&!i}).map(a=>{let i={...a,searchUid:e.searchUid};return{result:i,children:sT(i,t,r,[...n,o])}}):[]}function cB(e,t){return e.find(r=>{let n=ox(r,t)===void 0,o=sB(ox(r,t),El(r,t));return n||o})}function cT(e){return e.parentResult?cT(e.parentResult):e}function uB(e,t,r,n){let o=Gd(e),i={...(n??cB(o,t)??cT(e)),searchUid:r},p=sT(i,o,t);return{result:i,children:p,moreResultsAvailable:e.totalNumberOfChildResults>p.length+1,isLoadingMoreResults:!1}}function Vg(e,t,r,n){let o={};return e.forEach(a=>{let i=iB(a,t);i&&(!El(a,t)&&!a.parentResult||(o[i]=uB(a,t,r,n)))}),o}function iT(e,t){if(!e.collections[t])throw new Error(`Missing collection ${t} from ${Object.keys(e.collections)}: Folding most probably in an invalid state...`);return e.collections[t]}var Lg=oe(jg(),e=>e.addCase(G.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?Vg(r.response.results,t.fields,r.response.searchUid):{}}).addCase(qt.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?Vg(r.response.results,t.fields,r.response.searchUid):{}}).addCase(Sr.fulfilled,(t,{payload:r})=>{t.collections=t.enabled?{...t.collections,...Vg(r.response.results,t.fields,r.response.searchUid)}:{}}).addCase(Uo,(t,{payload:r})=>t.enabled?t:{enabled:!0,collections:{},fields:{collection:r.collectionField??t.fields.collection,parent:r.parentField??t.fields.parent,child:r.childField??t.fields.child},filterFieldRange:r.numberOfFoldedResults??t.filterFieldRange}).addCase(Qo.pending,(t,{meta:r})=>{let n=r.arg;iT(t,n).isLoadingMoreResults=!0}).addCase(Qo.rejected,(t,{meta:r})=>{let n=r.arg;iT(t,n).isLoadingMoreResults=!1}).addCase(Qo.fulfilled,(t,{payload:{collectionId:r,results:n,rootResult:o,searchUid:a}})=>{let i=Vg(n,t.fields,a,o);if(!i||!i[r])throw new Error(`Unable to create collection ${r} from received results: ${JSON.stringify(n)}. Folding most probably in an invalid state... `);t.collections[r]=i[r],t.collections[r].moreResultsAvailable=!1}));d();c();l();u();d();c();l();u();var Il={id:z},Fc=T("querySuggest/register",e=>O(e,{...Il,count:new ee({min:0})})),uT=T("querySuggest/unregister",e=>O(e,Il)),Tn=T("querySuggest/selectSuggestion",e=>O(e,{...Il,expression:Ue})),Bo=T("querySuggest/clear",e=>O(e,Il)),Go=Se("querySuggest/fetch",/*#__PURE__*/function(){var _ref75=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,validatePayload:o,navigatorContext:a}}){o(e,Il);let i=e.id,p=yield lB(i,t(),a),f=yield n.querySuggest(p);return ht(f)?r(f.error):{id:i,q:p.q,...f.success}});return function(_x165,_x166){return _ref75.apply(this,arguments)}}()),lB=/*#__PURE__*/function(){var _ref76=_asyncToGenerator(function*(e,t,r){return{accessToken:t.configuration.accessToken,organizationId:t.configuration.organizationId,url:t.configuration.search.apiBaseUrl??ct(t.configuration.organizationId,t.configuration.environment),count:t.querySuggest[e].count,q:t.querySet[e],locale:t.configuration.search.locale,timezone:t.configuration.search.timezone,actionsHistory:t.configuration.analytics.enabled?Wt.getInstance().getHistory():[],...(t.context&&{context:t.context.contextValues}),...(t.pipeline&&{pipeline:t.pipeline}),...(t.searchHub&&{searchHub:t.searchHub}),tab:t.configuration.analytics.originLevel2,...(t.configuration.analytics.enabled&&{...(t.configuration.analytics.enabled&&t.configuration.analytics.analyticsMode==="legacy"?yield gs(t.configuration.analytics):Ln(t.configuration.analytics,r))}),...(t.configuration.search.authenticationProviders.length&&{authentication:t.configuration.search.authenticationProviders.join(",")})}});return function lB(_x167,_x168,_x169){return _ref76.apply(this,arguments)}}();var Ct=oe(lt(),e=>e.addCase(Dt,(t,r)=>({...t,...r.payload})).addCase(gr,(t,r)=>{t.q=r.payload}).addCase(Tn,(t,r)=>{t.q=r.payload.expression}).addCase(_e.fulfilled,(t,r)=>r.payload?.query??t).addCase(De,(t,r)=>{t.q=r.payload.q??t.q,t.enableQuerySyntax=r.payload.enableQuerySyntax??t.enableQuerySyntax}));d();c();l();u();d();c();l();u();var $o=T("fields/registerFieldsToInclude",e=>O(e,rd)),Ec=T("fields/fetchall/enable"),ui=T("fields/fetchall/disable"),Ic=Se("fields/fetchDescription",/*#__PURE__*/function(){var _ref77=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:a,environment:i,organizationId:p}=o.configuration,{apiBaseUrl:f}=o.configuration.search,m=yield t.apiClient.fieldDescriptions({accessToken:a,organizationId:p,url:f??ct(p,i)});return ht(m)?n(m.error):m.success.fields});return function(_x170,_x171){return _ref77.apply(this,arguments)}}());d();c();l();u();d();c();l();u();var Ug=["author","language","urihash","objecttype","collection","source","permanentid"],ax=[...Ug,"date","filetype","parents"],lT=[...ax,"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"],dT=()=>({fieldsToInclude:Ug,fetchAllFields:!1,fieldsDescription:[]});var Ho=oe(dT(),e=>e.addCase($o,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(Ec,t=>{t.fetchAllFields=!0}).addCase(ui,t=>{t.fetchAllFields=!1}).addCase(Ic.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(Uo,(t,{payload:r})=>{let n=jg().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));d();c();l();u();function Tc(e){if(!dB(e))throw W;let t=ne(e),r=()=>e.state;return{...t,get state(){let n=r();return{hasError:n.search.error!==null,isLoading:n.search.isLoading,hasResults:!!n.search.results.length,firstSearchExecuted:Ju(n)}}}}function dB(e){return e.addReducers({search:fe}),!0}var pB=new ge({fieldsToInclude:new ae({required:!1,each:new M({required:!0,emptyAllowed:!1})})});function Qg(e,t){if(!fB(e))throw W;let r=ne(e),n=Tc(e),{dispatch:o}=e,a=()=>e.state,i=Be(e,pB,t?.options,"buildCoreResultList");i.fieldsToInclude&&o($o(i.fieldsToInclude));let p=()=>e.state.search.results.length<e.state.search.response.totalCountFiltered,f=0,m=0,h=5,S=200,v=!1;return{...r,get state(){let C=a();return{...n.state,results:C.search.results,moreResultsAvailable:p(),searchResponseId:C.search.searchResponseId}},fetchMoreResults:function(){var _ref78=_asyncToGenerator(function*(){if(e.state.search.isLoading)return;if(!p()){e.logger.info("No more results are available for the result list to fetch.");return}if(Date.now()-f<S){if(m++,m>=h){f=Date.now(),!v&&e.logger.error(`The result list method "fetchMoreResults" execution prevented because it has been triggered consecutively ${h} times, with little delay. Please verify the conditions under which the function is called.`),v=!0;return}}else m=0;v=!1,t?.fetchMoreResultsActionCreator&&(yield o(t?.fetchMoreResultsActionCreator()),f=Date.now())});return function fetchMoreResults(){return _ref78.apply(this,arguments)}}()}}function fB(e){return e.addReducers({search:fe,configuration:le,fields:Ho}),!0}var mB=new ge(nx);function pT(e,t,r){if(!gB(e))throw W;let n=Qg(e,t),{dispatch:o}=e,a=()=>e.state,i=t.options?.folding?Be(e,mB,t.options.folding,"buildFoldedResultList"):{};return o(Uo({...i})),{...n,loadCollection:p=>{o(t.loadCollectionActionCreator(p.result.raw[e.state.folding.fields.collection])),o(r.logShowMoreFoldedResults(p.result))},logShowMoreFoldedResults:p=>{o(r.logShowMoreFoldedResults(p))},logShowLessFoldedResults:()=>{o(r.logShowLessFoldedResults())},findResultById(p){return ix(this.state.results,f=>f.result.uniqueId===p.result.uniqueId)},findResultByCollection(p){return ix(this.state.results,f=>f.result.raw.foldingcollection===p.result.raw.foldingcollection)},get state(){let p=a();return{...n.state,results:n.state.results.map(f=>{let m=f.raw[p.folding.fields.collection];return!m||!p.folding.collections[m]?{result:f,moreResultsAvailable:!1,isLoadingMoreResults:!1,children:[]}:p.folding.collections[m]})}}}}function gB(e){return e.addReducers({search:fe,configuration:Hp,folding:Lg,query:Ct}),!0}function ix(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(t(n))return n;if(n.children.length){let o=ix(n.children,t);if(o)return o}}return null}function fT(e,t={}){let r=pT(e,{...t,loadCollectionActionCreator:Qo,fetchMoreResultsActionCreator:Sr},aT);return{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Pc(e){let t=new Set;return e.filter(r=>{let n=!t.has(r.uri);return n&&t.add(r.uri),n})}var kc=oe($S(),e=>e.addCase(ks,(t,{payload:r})=>{t.isVisible=r}).addCase(tl,(t,{payload:r})=>{t.isEnabled=r}).addCase(Dp,(t,{payload:r})=>{t.id=r.id}).addCase(va,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.answer||(t.answer=""),t.answer+=r.textDelta,delete t.error}).addCase(xa,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!0,t.citations=Pc([...t.citations,...r.citations]),delete t.error}).addCase(Aa,(t,{payload:r})=>{t.isLoading=!1,t.isStreaming=!1,t.error={...r,isRetryable:r.code===Wh},t.citations=[],delete t.answer}).addCase(kp,t=>{t.liked=!0,t.disliked=!1}).addCase(Op,t=>{t.liked=!1,t.disliked=!0}).addCase(Np,t=>{t.feedbackModalOpen=!0}).addCase(qp,t=>{t.feedbackModalOpen=!1}).addCase(Ns,t=>{t.feedbackSubmitted=!0}).addCase(sr,t=>({...$S(),...(t.answerConfigurationId?{answerConfigurationId:t.answerConfigurationId}:{}),responseFormat:t.responseFormat,fieldsToIncludeInCitations:t.fieldsToIncludeInCitations,isVisible:t.isVisible,id:t.id})).addCase(Zr,(t,{payload:r})=>{t.isLoading=r}).addCase(Sa,(t,{payload:r})=>{t.isStreaming=r}).addCase(Ca,(t,{payload:r})=>{t.answerContentFormat=r}).addCase(Mp,(t,{payload:r})=>{t.responseFormat=r}).addCase(Vp,(t,r)=>{t.fieldsToIncludeInCitations=[...new Set(t.fieldsToIncludeInCitations.concat(r.payload))]}).addCase(nl,(t,{payload:r})=>{t.isAnswerGenerated=r}).addCase(rl,t=>{t.expanded=!0}).addCase(_p,t=>{t.expanded=!1}).addCase(jp,(t,{payload:r})=>{t.answerConfigurationId=r}).addCase(ba,(t,{payload:r})=>{t.cannotAnswer=r}).addCase(zS,(t,{payload:r})=>{t.answerApiQueryParams=r}).addCase(Os,(t,{payload:r})=>{t.answerId=r}).addCase(Pp,(t,{payload:r})=>{t.answerGenerationMode=r}).addCase(Lp,(t,{payload:r})=>{t.generationSteps.push({name:r.name,status:"active",startedAt:r.startedAt})}).addCase(Up,(t,{payload:r})=>{let n=t.generationSteps.findLast(o=>o.name===r.name&&o.status==="active");n&&(n.status="completed",n.finishedAt=r.finishedAt)}));d();c();l();u();function Oc(e,t,r={}){if(!hB(e))throw W;let{dispatch:n}=e,o=ne(e),a=()=>e.state,i=r.initialState?.isVisible;i!==void 0&&n(ks(i));let p=r.initialState?.responseFormat;p&&n(Mp(p));let f=r.fieldsToIncludeInCitations;return f&&n(Vp(f)),r.initialState?.expanded&&n(rl()),{...o,get state(){let h=a().generatedAnswer;return{...h,error:Wa(h.error)}},like(h){this.state.liked||(n(kp()),n(t.logLikeGeneratedAnswer(h)))},dislike(h){this.state.disliked||(n(Op()),n(t.logDislikeGeneratedAnswer(h)))},openFeedbackModal(){n(Np())},closeFeedbackModal(){n(qp())},sendFeedback(h){n(t.logGeneratedAnswerFeedback(h)),n(Ns())},logCitationClick(h,S){n(t.logOpenGeneratedAnswerSource(h,S))},logCitationHover(h,S,v){n(t.logHoverCitation(h,S,v))},show(){this.state.isVisible||(n(ks(!0)),n(t.logGeneratedAnswerShowAnswers()))},hide(){this.state.isVisible&&(n(ks(!1)),n(t.logGeneratedAnswerHideAnswers()))},expand(){this.state.expanded||(n(rl()),n(t.logGeneratedAnswerExpand()))},collapse(){this.state.expanded&&(n(_p()),n(t.logGeneratedAnswerCollapse()))},enable(){this.state.isEnabled||n(tl(!0))},disable(){this.state.isEnabled&&n(tl(!1))},logCopyToClipboard(h){n(t.logCopyGeneratedAnswer(h))},retry(){}}}function hB(e){return e.addReducers({generatedAnswer:kc}),!0}var Ut={engines:{},setAbortControllerRef:(e,t)=>{Ut.engines[t].abortController=e},getIsStreamInProgress:e=>!Ut.engines[e].abortController||Ut.engines[e].abortController?.signal.aborted?(Ut.engines[e].abortController=void 0,!1):!0,subscribeToSearchRequests:e=>{let t=()=>{let r=e.state,n=r.search.requestId,o=r.search.extendedResults.generativeQuestionAnsweringId,a=r.generatedAnswer.id;if(Ut.engines[a].lastRequestId!==n){if(Ut.engines[a].lastRequestId=n,Ut.engines[a].abortController?.abort(),r.generatedAnswer.isEnabled===!1)return;e.dispatch(sr())}if(!Ut.getIsStreamInProgress(a)&&o&&o!==Ut.engines[a].lastStreamId){if(Ut.engines[a].lastStreamId=o,r.generatedAnswer.isEnabled===!1)return;e.dispatch(pw({setAbortControllerRef:p=>Ut.setAbortControllerRef(p,a)}))}};return e.subscribe(t)}};function mT(e,t,r={}){if(!yB(e))throw W;let n=Oc(e,t,r),o=()=>e.state;if(e.state.generatedAnswer.id&&!Ut.engines[e.state.generatedAnswer.id]&&(Ut.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:e.state.search.requestId,lastStreamId:e.state.search.extendedResults.generativeQuestionAnsweringId??""}),!e.state.generatedAnswer.id){let i=oo("genQA-",12);e.dispatch(Dp({id:i}))}Ut.engines[e.state.generatedAnswer.id]||(Ut.engines[e.state.generatedAnswer.id]={abortController:void 0,lastRequestId:"",lastStreamId:""}),Ut.subscribeToSearchRequests(e);let a=i=>"executeFirstSearchAfterStandaloneSearchBoxRedirect"in i;return{...n,get state(){return o().generatedAnswer},retry(){a(e)&&e.dispatch(G({legacy:t.logRetryGeneratedAnswer()}))}}}function yB(e){return e.addReducers({generatedAnswer:kc}),!0}d();c();l();u();d();c();l();u();var gT=Gp.injectEndpoints({endpoints:e=>({post:e.query({query:t=>({url:"/evaluations",method:"POST",body:t})})})});var Bg=e=>e==="yes"?!0:e==="no"?!1:null,SB=({answerApiState:e,feedback:t,query:r})=>({additionalNotes:t.details??null,answer:{text:e.answer,responseId:e.answerId,format:e.contentFormat??"text/plain"},correctAnswerUrl:t.documentUrl??null,details:{correctTopic:Bg(t.correctTopic),documented:Bg(t.documented),hallucinationFree:Bg(t.hallucinationFree),readable:Bg(t.readable)},helpful:t.helpful,question:r}),vB=e=>{let t="",r=()=>{let n=e.state,o=YR(n),a=o.requestId;a!==t&&(t=a,e.dispatch(sr()),o.q?.length>0&&e.dispatch(Qp()))};e.subscribe(r)};function hT(e,t,r={}){if(!xB(e))throw W;Do(e.state.configuration.analytics.analyticsMode);let{...n}=Oc(e,t,r),o=()=>e.state;return e.dispatch(jp(r.answerConfigurationId)),vB(e),{...n,get state(){let a=WS(e.state).data,i=o().generatedAnswer;return{...i,answer:a?.answer,citations:Pc(a?.citations??[]),error:Wa({message:a?.error?.message,code:a?.error?.code}),isLoading:a?.isLoading??!1,isStreaming:a?.isStreaming??!1,answerContentFormat:a?.contentFormat??"text/plain",isAnswerGenerated:a?.generated??!1,cannotAnswer:i.cannotAnswer||a?.generated===!1&&!a?.isLoading&&!a?.isStreaming}},retry(){let a=wp(o());e.dispatch(Bp(a??ga))},reset(){e.dispatch(sr())},sendFeedback(a){return _asyncToGenerator(function*(){e.dispatch(t.logGeneratedAnswerFeedback(a));let i=SB({query:o().query.q,feedback:a,answerApiState:WS(e.state).data});e.dispatch(gT.endpoints.post.initiate(i)),e.dispatch(Ns())})()}}}function xB(e){return e.addReducers({[Ra.reducerPath]:Ra.reducer,query:Ct}),!0}d();c();l();u();d();c();l();u();var sx=class extends om{requestInit(t){let{q:r,conversationId:n,accessToken:o}=t.forwardedProps||{};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${o}`,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({q:r,conversationId:n}),signal:this.abortController.signal}}},yT=(e,t,r)=>new sx({url:`${am(e,t,r)}/follow-up`});d();c();l();u();var ST=e=>{let t="";return{onRunStartedEvent:({event:r})=>{t=r.runId,e(um(t)),e(dm({answerId:t,isLoading:!1})),e(pm({answerId:t,isStreaming:!0}))},onStepStartedEvent:({event:r})=>{e(Am({name:r.stepName,startedAt:r.timestamp??Date.now(),answerId:t}))},onStepFinishedEvent:({event:r})=>{e(Cm({name:r.stepName,finishedAt:r.timestamp??Date.now(),answerId:t}))},onTextMessageContentEvent:({event:r})=>{e(fm({textDelta:r.delta,answerId:t}))},onCustomEvent:({event:r})=>{let{name:n,value:o}=r;switch(n){case"header":{o?.contentFormat&&e(lm({contentFormat:o.contentFormat,answerId:t}));return}case"citations":{e(mm({citations:o.citations,answerId:t}));return}}},onRunErrorEvent:({event:r})=>{let n=bm(r.code);e(hm({message:r.message,code:n,answerId:t})),t=""},onRunFinishedEvent:({event:r})=>{let n=r.result?.completionReason==="ANSWERED";e(gm({cannotAnswer:!n,answerId:t})),t=""}}};d();c();l();u();d();c();l();u();function vT(){return{conversationId:"",isEnabled:!1,followUpAnswers:[]}}var xT=e=>({question:e,isLoading:!0,isStreaming:!1,citations:[],liked:!1,disliked:!1,feedbackSubmitted:!1,cannotAnswer:!1,isActive:!0,generationSteps:[]});function cx(e){return e.followUpAnswers.find(t=>t.isActive)}function Fr(e,t){return e.followUpAnswers.find(r=>r.answerId===t)}var AT=oe(vT(),e=>e.addCase(im,(t,{payload:r})=>{t.isEnabled=r}).addCase(sm,(t,{payload:r})=>{t.conversationId=r}).addCase(cm,(t,{payload:r})=>{let n=cx(t);n&&(n.isActive=!1),t.followUpAnswers.push(xT(r.question))}).addCase(um,(t,{payload:r})=>{let n=cx(t);!n||n.answerId||(n.answerId=r)}).addCase(lm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.answerContentFormat=r.contentFormat)}).addCase(dm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.isLoading=r.isLoading)}).addCase(pm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.isStreaming=r.isStreaming)}).addCase(fm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.answer||(n.answer=""),n.answer+=r.textDelta,delete n.error)}).addCase(mm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.citations=Pc([...n.citations,...r.citations]),delete n.error)}).addCase(gm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.isActive=!1,n.cannotAnswer=!!r.cannotAnswer)}).addCase(hm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message,code:r.code},n.citations=[],delete n.answer)}).addCase(ym,(t,{payload:r})=>{let n=cx(t);n&&(n.isLoading=!1,n.isStreaming=!1,n.error={message:r.message},n.citations=[],delete n.answer)}).addCase(Sm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.liked=!0,n.disliked=!1)}).addCase(vm,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.liked=!1,n.disliked=!0)}).addCase(rE,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.feedbackSubmitted=!0)}).addCase(Am,(t,{payload:r})=>{let n=Fr(t,r.answerId);n&&(n.generationSteps=[...n.generationSteps,{name:r.name,status:"active",startedAt:r.startedAt}])}).addCase(Cm,(t,{payload:r})=>{let n=Fr(t,r.answerId);if(!n)return;let o=n.generationSteps.findLast(a=>a.name===r.name&&a.status==="active");o&&(o.status="completed",o.finishedAt=r.finishedAt)}).addCase(xm,t=>{t.followUpAnswers=[],t.conversationId="",t.isEnabled=!1}));function CT(e,t,r){if(!r.agentId||r.agentId.trim()==="")throw new Error("agentId is required for GeneratedAnswerWithFollowUps");if(!AB(e))throw W;let{...n}=Oc(e,t,r),o=()=>e.state;e.dispatch(Jd(r.agentId));let a=qd(o()),i=Dd(o()),p=Md(o()),f=yT(r.agentId,a,p),m=ST(e.dispatch),h=Rm();return{...n,get state(){let S=o().followUpAnswers,v=o().generatedAnswer;return{...v,error:Wa(v.error),followUpAnswers:{...S,followUpAnswers:S.followUpAnswers.map(g=>({...g,error:Wa(g.error)}))}}},retry(){h.run(e.state,e.dispatch,()=>e.navigatorContext)},like(S){if(!S||this.state.answerId===S){n.like();return}this.state.liked||(e.dispatch(Sm({answerId:S})),e.dispatch(t.logLikeGeneratedAnswer(S)))},dislike(S){if(!S||this.state.answerId===S){n.dislike();return}this.state.disliked||(e.dispatch(vm({answerId:S})),e.dispatch(t.logDislikeGeneratedAnswer(S)))},logCopyToClipboard(S){if(!S||this.state.answerId===S){n.logCopyToClipboard();return}e.dispatch(t.logCopyGeneratedAnswer(S))},logCitationClick(S,v){if(!v||this.state.answerId===v){n.logCitationClick(S);return}e.dispatch(t.logOpenGeneratedAnswerSource(S,v))},logCitationHover(S,v,g){if(!g||this.state.answerId===g){n.logCitationHover(S,v);return}e.dispatch(t.logHoverCitation(S,v,g))},askFollowUp(S){var _this37=this;return _asyncToGenerator(function*(){if(!S||S.trim()==="")return;let v=_this37.state.followUpAnswers.conversationId;if(!v){console.warn("Missing conversationId when generating a follow-up answer. The generateFollowUpAnswer action requires an existing conversation.");return}f.abortRun(),e.dispatch(cm({question:S}));try{yield f.runAgent({forwardedProps:{q:S,conversationId:v,accessToken:i}},m)}catch(g){e.dispatch(ym({message:"An error occurred while starting the follow-up answer generation."})),console.error("Error running the follow-up agent:",g)}})()}}}function AB(e){return e.addReducers({followUpAnswers:AT}),!0}function bT(e,t={}){Do(e.state.configuration.analytics.analyticsMode);let r;return t.agentId&&t.agentId.trim()!==""?r=CT(e,Is,{...t,agentId:t.agentId}):t.answerConfigurationId&&t.answerConfigurationId.trim()!==""?r=hT(e,Is,t):r=mT(e,Is,t),{...r,get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();function tr(e,t,r){if(!CB(e))throw W;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},a;return{select:zl(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){a=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){a&&clearTimeout(a)}}}function CB(e){return e.addReducers({configuration:le}),!0}function RT(e,t,r){let n=!1,o=()=>{n||(n=!0,e.dispatch(t.logOpenGeneratedAnswerSource(r.options.citation.id,r.options.answerId)))};return tr(e,r,()=>{o()})}function wT(e,t){return RT(e,Is,t)}d();c();l();u();d();c();l();u();var Nc=oe(dp(),e=>{e.addCase(G.fulfilled,bB).addCase(_e.fulfilled,(t,r)=>r.payload?.facetOrder??t)});function bB(e,t){return t.payload.response.facets.map(r=>r.facetId)}d();c();l();u();var Gg=()=>Y("history/analytics/forward",e=>e.makeSearchEvent("historyForward")),$g=()=>Y("history/analytics/backward",e=>e.makeSearchEvent("historyBackward")),Hg=()=>Y("history/analytics/noresultsback",e=>e.makeNoResultsBack());d();c();l();u();d();c();l();u();var FT=e=>({past:[],present:e,future:[]}),RB=e=>{let{past:t,present:r,future:n}=e;if(!r||t.length===0)return e;let o=t[t.length-1];return{past:t.slice(0,t.length-1),present:o,future:[r,...n]}},wB=e=>{let{past:t,present:r,future:n}=e;if(!r||n.length===0)return e;let o=n[0],a=n.slice(1);return{past:[...t,r],present:o,future:a}},FB=e=>{let{action:t,state:r,reducer:n}=e,{past:o,present:a}=r,i=n(a,t);return a?a===i?r:{past:[...o,a].slice(-10),present:i,future:[]}:FT(i)},ET=e=>{let{actionTypes:t,reducer:r}=e,n=FT();return(o=n,a)=>{switch(a.type){case t.undo:return RB(o);case t.redo:return wB(o);case t.snapshot:return FB({state:o,reducer:r,action:a});default:return o}}};d();c();l();u();d();c();l();u();var{getOwnPropertyNames:EB,getOwnPropertySymbols:IB}=Object,{hasOwnProperty:TB}=Object.prototype;function ux(e,t){return function(n,o,a){return e(n,o,a)&&t(n,o,a)}}function zg(e){return function(r,n,o){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,o);let{cache:a}=o,i=a.get(r),p=a.get(n);if(i&&p)return i===n&&p===r;a.set(r,n),a.set(n,r);let f=e(r,n,o);return a.delete(r),a.delete(n),f}}function IT(e){return EB(e).concat(IB(e))}var PB=Object.hasOwn||((e,t)=>TB.call(e,t)),kB="__v",OB="__o",NB="_owner",{getOwnPropertyDescriptor:TT,keys:PT}=Object,li=Object.is||function(t,r){return t===r?t!==0||1/t===1/r:t!==t&&r!==r};function _B(e,t){return e===t}function DB(e,t){return e.byteLength===t.byteLength&&Wg(new Uint8Array(e),new Uint8Array(t))}function qB(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-->0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function MB(e,t){return e.byteLength===t.byteLength&&Wg(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function jB(e,t){return li(e.getTime(),t.getTime())}function VB(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function kT(e,t,r){let n=e.size;if(n!==t.size)return!1;if(!n)return!0;let o=new Array(n),a=e.entries(),i,p,f=0;for(;(i=a.next())&&!i.done;){let m=t.entries(),h=!1,S=0;for(;(p=m.next())&&!p.done;){if(o[S]){S++;continue}let v=i.value,g=p.value;if(r.equals(v[0],g[0],f,S,e,t,r)&&r.equals(v[1],g[1],v[0],g[0],e,t,r)){h=o[S]=!0;break}S++}if(!h)return!1;f++}return!0}function LB(e,t,r){let n=PT(e),o=n.length;if(PT(t).length!==o)return!1;for(;o-->0;)if(!NT(e,t,r,n[o]))return!1;return!0}function Tl(e,t,r){let n=IT(e),o=n.length;if(IT(t).length!==o)return!1;let a,i,p;for(;o-->0;)if(a=n[o],!NT(e,t,r,a)||(i=TT(e,a),p=TT(t,a),(i||p)&&(!i||!p||i.configurable!==p.configurable||i.enumerable!==p.enumerable||i.writable!==p.writable)))return!1;return!0}function UB(e,t){return li(e.valueOf(),t.valueOf())}function QB(e,t){return e.source===t.source&&e.flags===t.flags}function OT(e,t,r){let n=e.size;if(n!==t.size)return!1;if(!n)return!0;let o=new Array(n),a=e.values(),i,p;for(;(i=a.next())&&!i.done;){let f=t.values(),m=!1,h=0;for(;(p=f.next())&&!p.done;){if(!o[h]&&r.equals(i.value,p.value,i.value,p.value,e,t,r)){m=o[h]=!0;break}h++}if(!m)return!1}return!0}function Wg(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-->0;)if(e[r]!==t[r])return!1;return!0}function BB(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function NT(e,t,r,n){return(n===NB||n===OB||n===kB)&&(e.$$typeof||t.$$typeof)?!0:PB(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var GB=Object.prototype.toString;function $B(e){let t=KB(e),{areArraysEqual:r,areDatesEqual:n,areFunctionsEqual:o,areMapsEqual:a,areNumbersEqual:i,areObjectsEqual:p,areRegExpsEqual:f,areSetsEqual:m,getUnsupportedCustomComparator:h}=e;return function(v,g,C){if(v===g)return!0;if(v==null||g==null)return!1;let w=typeof v;if(w!==typeof g)return!1;if(w!=="object")return w==="number"||w==="bigint"?i(v,g,C):w==="function"?o(v,g,C):!1;let R=v.constructor;if(R!==g.constructor)return!1;if(R===Object)return p(v,g,C);if(R===Array)return r(v,g,C);if(R===Date)return n(v,g,C);if(R===RegExp)return f(v,g,C);if(R===Map)return a(v,g,C);if(R===Set)return m(v,g,C);if(R===Promise)return!1;if(Array.isArray(v))return r(v,g,C);let b=GB.call(v),F=t[b];if(F)return F(v,g,C);let I=h&&h(v,g,C,b);return I?I(v,g,C):!1}}function HB({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:DB,areArraysEqual:r?Tl:qB,areDataViewsEqual:MB,areDatesEqual:jB,areErrorsEqual:VB,areFunctionsEqual:_B,areMapsEqual:r?ux(kT,Tl):kT,areNumbersEqual:li,areObjectsEqual:r?Tl:LB,arePrimitiveWrappersEqual:UB,areRegExpsEqual:QB,areSetsEqual:r?ux(OT,Tl):OT,areTypedArraysEqual:r?ux(Wg,Tl):Wg,areUrlsEqual:BB,getUnsupportedCustomComparator:void 0};if(t&&(n=Object.assign({},n,t(n))),e){let o=zg(n.areArraysEqual),a=zg(n.areMapsEqual),i=zg(n.areObjectsEqual),p=zg(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:i,areSetsEqual:p})}return n}function zB(e){return function(t,r,n,o,a,i,p){return e(t,r,p)}}function WB({circular:e,comparator:t,createState:r,equals:n,strict:o}){if(r)return function(p,f){let{cache:m=e?new WeakMap:void 0,meta:h}=r();return t(p,f,{cache:m,equals:n,meta:h,strict:o})};if(e)return function(p,f){return t(p,f,{cache:new WeakMap,equals:n,meta:void 0,strict:o})};let a={cache:void 0,equals:n,meta:void 0,strict:o};return function(p,f){return t(p,f,a)}}function KB({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:o,areFunctionsEqual:a,areMapsEqual:i,areNumbersEqual:p,areObjectsEqual:f,arePrimitiveWrappersEqual:m,areRegExpsEqual:h,areSetsEqual:S,areTypedArraysEqual:v,areUrlsEqual:g}){return{"[object Arguments]":f,"[object Array]":t,"[object ArrayBuffer]":e,"[object AsyncGeneratorFunction]":a,"[object BigInt]":p,"[object BigInt64Array]":v,"[object BigUint64Array]":v,"[object Boolean]":m,"[object DataView]":r,"[object Date]":n,"[object Error]":o,"[object Float16Array]":v,"[object Float32Array]":v,"[object Float64Array]":v,"[object Function]":a,"[object GeneratorFunction]":a,"[object Int8Array]":v,"[object Int16Array]":v,"[object Int32Array]":v,"[object Map]":i,"[object Number]":m,"[object Object]":(C,w,R)=>typeof C.then!="function"&&typeof w.then!="function"&&f(C,w,R),"[object RegExp]":h,"[object Set]":S,"[object String]":m,"[object URL]":g,"[object Uint8Array]":v,"[object Uint8ClampedArray]":v,"[object Uint16Array]":v,"[object Uint32Array]":v}}var u$e=Pn(),l$e=Pn({strict:!0}),d$e=Pn({circular:!0}),p$e=Pn({circular:!0,strict:!0}),f$e=Pn({createInternalComparator:()=>li}),m$e=Pn({strict:!0,createInternalComparator:()=>li}),g$e=Pn({circular:!0,createInternalComparator:()=>li}),h$e=Pn({circular:!0,createInternalComparator:()=>li,strict:!0});function Pn(e={}){let{circular:t=!1,createInternalComparator:r,createState:n,strict:o=!1}=e,a=HB(e),i=$B(a),p=r?r(i):zB(i);return WB({circular:t,comparator:i,createState:n,equals:p,strict:o})}function di(e,t,r=(n,o)=>n===o){return e.length===t.length&&e.findIndex((n,o)=>!r(t[o],n))===-1}function YB(e,t){return e.length!==t.length?!1:e.every(r=>t.findIndex(n=>Pl(r,n))!==-1)}var Pl=Pn({createCustomConfig:e=>({...e,areArraysEqual:YB})});var JB=oe(lR(),e=>{e.addCase(ir,(t,r)=>XB(t,r.payload)?void 0:r.payload)}),XB=(e,t)=>ZB(e.context,t.context)&&e1(e.dictionaryFieldContext,t.dictionaryFieldContext)&&s1(e.advancedSearchQueries,t.advancedSearchQueries)&&t1(e.tabSet,t.tabSet)&&r1(e.staticFilterSet,t.staticFilterSet)&&lx(e.facetSet,t.facetSet)&&lx(e.dateFacetSet,t.dateFacetSet)&&lx(e.numericFacetSet,t.numericFacetSet)&&o1(e.automaticFacetSet,t.automaticFacetSet)&&n1(e.categoryFacetSet,t.categoryFacetSet)&&a1(e.pagination,t.pagination)&&i1(e.query,t.query)&&c1(e,t)&&u1(e.pipeline,t.pipeline)&&l1(e.searchHub,t.searchHub)&&d1(e.facetOrder,t.facetOrder)&&p1(e.debug,t.debug),ZB=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),e1=(e,t)=>JSON.stringify(e.contextValues)===JSON.stringify(t.contextValues),t1=(e,t)=>{let r=_T(e),n=_T(t);return r?.id===n?.id},_T=e=>Object.values(e).find(t=>t.isActive),r1=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=DT(e[r]),a=DT(n);if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},DT=e=>e.values.filter(t=>t.state!=="idle"),lx=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=e[r].request.currentValues.filter(i=>i.state!=="idle"),a=n.request.currentValues.filter(i=>i.state!=="idle");if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},n1=(e,t)=>{for(let[r,n]of Object.entries(t)){if(!e[r])return!1;let o=or(e[r]?.request.currentValues).map(({value:i})=>i),a=or(n?.request.currentValues).map(({value:i})=>i);if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},o1=(e,t)=>{for(let[r,n]of Object.entries(t.set)){if(!e.set[r])return!1;let o=e.set[r].response.values.filter(i=>i.state!=="idle"),a=n.response.values.filter(i=>i.state!=="idle");if(JSON.stringify(o)!==JSON.stringify(a))return!1}return!0},a1=(e,t)=>e.firstResult===t.firstResult&&e.numberOfResults===t.numberOfResults,i1=(e,t)=>JSON.stringify(e)===JSON.stringify(t),s1=(e,t)=>JSON.stringify(e)===JSON.stringify(t),c1=(e,t)=>e.sortCriteria===t.sortCriteria,u1=(e,t)=>e===t,l1=(e,t)=>e===t,d1=(e,t)=>di(e,t),p1=(e,t)=>e===t,Kg=ET({actionTypes:{redo:dS.type,undo:lS.type,snapshot:ir.type},reducer:JB});function qT(e){if(!f1(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state,o=a=>a.past.length>0&&!ue(a.present);return{...t,subscribe(a){a();let i=JSON.stringify(n().history.present),p=()=>{let f=JSON.stringify(n().history.present);i!==f&&(i=f,a())};return e.subscribe(()=>p())},get state(){return n().history},back(){var _this38=this;return _asyncToGenerator(function*(){o(_this38.state)&&(yield r($u()),r(G({legacy:$g()})))})()},forward(){var _this39=this;return _asyncToGenerator(function*(){!_this39.state.future.length||!_this39.state.present||(yield r(Zd()),r(G({legacy:Gg()})))})()},backOnNoResults(){var _this40=this;return _asyncToGenerator(function*(){o(_this40.state)&&(yield r($u()),r(G({legacy:Hg()})))})()}}}function f1(e){return e.addReducers({history:Kg,configuration:le,facetOrder:Nc}),!0}d();c();l();u();d();c();l();u();var m1={results:new ae({required:!0,each:new J({values:$d})}),maxLength:new ee({required:!0,min:1,default:10})},_c=T("recentResults/registerRecentResults",e=>O(e,m1)),Er=T("recentResults/pushRecentResult",e=>(Kt(e),{payload:e})),Dc=T("recentResults/clearRecentResults");function MT(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(Gb(t.options.result)))};return tr(e,t,()=>{n(),e.dispatch(Er(t.options.result))})}d();c();l();u();d();c();l();u();function Yg(e){return e?e.expiresAt&&Date.now()>=e.expiresAt:!1}d();c();l();u();d();c();l();u();var jT=(e,t)=>{let{id:r}=e;if(!t[r])return t[r]={q:"",cache:{}},t},VT=(e,t)=>{let{q:r,id:n}=e;r&&(t[n].q=r)},LT=(e,t)=>{let{id:r}=e;Object.entries(t[r].cache).forEach(([n,o])=>{Yg(o)&&delete t[r].cache[n]})},UT=(e,t,r)=>{for(let o in t)for(let a in t[o].cache)t[o].cache[a].isActive=!1;if(!dx(e,t)){g1(e,t,r);return}let n=dx(e,t);n.isLoading=!0,n.isActive=!0,n.error=null},QT=(e,t,r)=>{let{id:n,q:o,searchUid:a,cacheTimeout:i,totalCountFiltered:p,duration:f}=e;t[n].cache[o]={...dx(e,t),...r,isActive:!0,searchUid:a,isLoading:!1,error:null,expiresAt:i?i+Date.now():0,totalCountFiltered:p,duration:f}},BT=(e,t)=>{let{id:r,q:n,error:o}=e;t[r].cache[n].error=o||null,t[r].cache[n].isLoading=!1,t[r].cache[n].isActive=!1},dx=(e,t)=>{let{q:r,id:n}=e;return t[n].cache[r]||null},g1=(e,t,r)=>{let{q:n,id:o}=e;t[o].cache[n]={isLoading:!0,error:null,expiresAt:0,isActive:!0,searchUid:"",totalCountFiltered:0,duration:0,...r}};d();c();l();u();function GT(){return{}}var Jg=oe(GT(),e=>{e.addCase(ss,(t,r)=>{jT(r.payload,t)}),e.addCase(Kr,(t,r)=>{VT(r.payload,t)}),e.addCase(cs,(t,r)=>{LT(r.payload,t)}),e.addCase(As.pending,(t,r)=>{UT(r.meta.arg,t,{results:[]})}),e.addCase(As.fulfilled,(t,r)=>{let n=r.payload.results.map(o=>({...o,searchUid:r.payload.searchUid}));QT({...r.payload,...r.meta.arg},t,{results:n})}),e.addCase(As.rejected,(t,r)=>{BT(r.meta.arg,t)})});d();c();l();u();var h1={searchBoxId:it,maxResultsPerQuery:new ee({required:!0,min:1}),cacheTimeout:new ee},$T=new ge(h1);function HT(e,t){if(!y1(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a={searchBoxId:t.options.searchBoxId||oo("instant-results-"),cacheTimeout:t.options.cacheTimeout||6e4,maxResultsPerQuery:t.options.maxResultsPerQuery};Be(e,$T,a,"buildInstantResults");let i=a.searchBoxId;n(ss({id:i}));let p=()=>o().instantResults[i],f=S=>p().cache[S],m=()=>p().q,h=()=>{let S=f(m());return S?S.isLoading?[]:S.results:[]};return{...r,updateQuery(S){if(!S)return;let v=f(S);(!v||!v.isLoading&&(v.error||Yg(v)))&&n(As({id:i,q:S,maxResultsPerQuery:a.maxResultsPerQuery,cacheTimeout:a.cacheTimeout})),n(Kr({id:i,q:S}))},clearExpired(){n(cs({id:i}))},get state(){let S=m(),v=f(S);return{q:S,isLoading:v?.isLoading||!1,error:v?.error||null,results:h()}}}}function y1(e){return e.addReducers({instantResults:Jg}),!0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Ir=oe(hr(),e=>{e.addCase(us,(t,r)=>{let n=px(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=kl(n,o)}).addCase(ls,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(gt,t=>{t.firstResult=0}).addCase(ds,(t,r)=>{let n=r.payload;t.firstResult=kl(n,t.numberOfResults)}).addCase(Yr,(t,r)=>{let n=r.payload;t.firstResult=kl(n,t.numberOfResults)}).addCase(fs,t=>{let r=px(t),n=Math.max(r-1,1);t.firstResult=kl(n,t.numberOfResults)}).addCase(ps,t=>{let r=px(t),n=S1(t),o=Math.min(r+1,n);t.firstResult=kl(o,t.numberOfResults)}).addCase(_e.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(De,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(G.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(qt.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(Xe,t=>{Qt(t)}).addCase(An,t=>{Qt(t)}).addCase(yn,t=>{Qt(t)}).addCase(Fn,t=>{Qt(t)}).addCase(ti,t=>{Qt(t)}).addCase(hn,t=>{Qt(t)}).addCase(un,t=>{Qt(t)}).addCase(Mo,t=>{Qt(t)}).addCase(oc,t=>{Qt(t)}).addCase(xn,t=>{Qt(t)}).addCase(wn,t=>{Qt(t)}).addCase(pt,t=>{Qt(t)}).addCase(Xn,t=>{Qt(t)}).addCase(Zn,t=>{Qt(t)}).addCase(ei,t=>{Qt(t)}).addCase(sn,t=>{Qt(t)})});function Qt(e){e.firstResult=hr().firstResult}function px(e){let{firstResult:t,numberOfResults:r}=e;return fx(t,r)}function S1(e){let{totalCountFiltered:t,numberOfResults:r}=e;return mx(t,r)}function kl(e,t){return(e-1)*t}function fx(e,t){return Math.round(e/t)+1}function mx(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function v1(e){return e.pagination.firstResult}function zT(e){return e.pagination.numberOfResults}function x1(e){return e.pagination.totalCountFiltered}var ro=e=>{let t=v1(e),r=zT(e);return fx(t,r)},Ol=e=>{let t=x1(e),r=zT(e);return mx(t,r)},Xg=(e,t)=>{let r=ro(e),n=Ol(e),o=A1(r,t);return o=C1(o),o=b1(o,n),R1(o)};function A1(e,t){let r=t%2===0,n=Math.floor(t/2),o=r?n-1:n,a=e-n,i=e+o;return{start:a,end:i}}function C1(e){let t=Math.max(1-e.start,0),r=e.start+t,n=e.end+t;return{start:r,end:n}}function b1(e,t){let r=Math.max(e.end-t,0),n=Math.max(e.start-r,1),o=e.end-r;return{start:n,end:o}}function R1(e){let t=[];for(let r=e.start;r<=e.end;++r)t.push(r);return t}var Mc=()=>Y("analytics/pager/resize",(e,t)=>e.makePagerResize({currentResultsPerPage:t.pagination?.numberOfResults||hr().numberOfResults})),jc=()=>Y("analytics/pager/number",(e,t)=>e.makePagerNumber({pagerNumber:ro(t)})),Zg=()=>Y("analytics/pager/next",(e,t)=>e.makePagerNext({pagerNumber:ro(t)})),eh=()=>Y("analytics/pager/previous",(e,t)=>e.makePagerPrevious({pagerNumber:ro(t)})),Vc=()=>({actionCause:"browseResults"});d();c();l();u();var w1=new ge({numberOfPages:new ee({default:5,min:0})}),F1=new ge({page:new ee({min:1})});function WT(e,t={}){if(!E1(e))throw W;let r=ne(e),{dispatch:n}=e,o=Be(e,w1,t.options,"buildPager"),i=ut(e,F1,t.initialState,"buildPager").page;i&&n(ds(i));let p=()=>ro(e.state),f=()=>{let{numberOfPages:h}=o;return Xg(e.state,h)},m=()=>Ol(e.state);return{...r,get state(){let h=p(),S=m(),v=h>1&&S>0,g=h<S;return{currentPage:h,currentPages:f(),maxPage:S,hasPreviousPage:v,hasNextPage:g}},selectPage(h){n(Yr(h))},nextPage(){n(ps())},previousPage(){n(fs())},isCurrentPage(h){return h===this.state.currentPage}}}function E1(e){return e.addReducers({configuration:le,pagination:Ir}),!0}function KT(e,t={}){let{dispatch:r}=e,n=WT(e,t);return{...n,get state(){return n.state},selectPage(o){n.selectPage(o),r(qt({legacy:jc(),next:Vc()}))},nextPage(){n.nextPage(),r(qt({legacy:Zg(),next:Vc()}))},previousPage(){n.previousPage(),r(qt({legacy:eh(),next:Vc()}))}}}d();c();l();u();d();c();l();u();function YT(e){if(!I1(e))throw W;let t=ne(e),r=()=>e.state;return{...t,get state(){return{hasError:r().search.error!==null,error:r().search.error}}}}function I1(e){return e.addReducers({search:fe}),!0}function JT(e){return YT(e)}d();c();l();u();d();c();l();u();function XT(e){if(!T1(e))throw W;let t=ne(e),r=Tc(e),n=()=>e.state,o=()=>{let a=n().search.duration/1e3;return Math.round((a+Number.EPSILON)*100)/100};return{...t,get state(){return{...r.state,durationInMilliseconds:n().search.duration,durationInSeconds:o(),firstResult:n().pagination.firstResult+1,hasDuration:n().search.duration!==0,hasQuery:n().search.queryExecuted!=="",lastResult:n().pagination.firstResult+n().search.results.length,query:n().search.queryExecuted,total:n().pagination.totalCountFiltered}}}}function T1(e){return e.addReducers({search:fe,pagination:Ir}),!0}function ZT(e){return XT(e)}d();c();l();u();d();c();l();u();d();c();l();u();function th(_x172,_x173){return _th.apply(this,arguments)}function _th(){_th=_asyncToGenerator(function*(e,t){let{search:r,accessToken:n,organizationId:o}=e.configuration,a=e.query?.q||"";return{url:r.apiBaseUrl??ct(e.configuration.organizationId,e.configuration.environment),accessToken:n,organizationId:o,enableNavigation:!1,q:a,...t,requestedOutputSize:t.requestedOutputSize||0,...(r.authenticationProviders.length&&{authentication:r.authenticationProviders.join(",")})}});return _th.apply(this,arguments)}var pi=Se("resultPreview/fetchResultContent",/*#__PURE__*/function(){var _ref79=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),a=yield th(o,e),i=yield t.apiClient.html(a);return ht(i)?n(i.error):{content:i.success,uniqueId:e.uniqueId}});return function(_x174,_x175){return _ref79.apply(this,arguments)}}()),Lc=T("resultPreview/next"),Uc=T("resultPreview/previous"),Qc=T("resultPreview/prepare",e=>O(e,{results:new ae({required:!0})})),eP=2048,Bc=Se("resultPreview/updateContentURL",/*#__PURE__*/function(){var _ref80=_asyncToGenerator(function*(e,{getState:t,extra:r}){let n=t(),o=EA(yield e.buildResultPreviewRequest(n,{uniqueId:e.uniqueId,requestedOutputSize:e.requestedOutputSize}),e.path);return o?.length>eP&&r.logger.error(`The content URL was truncated as it exceeds the maximum allowed length of ${eP} characters.`),{contentURL:o}});return function(_x176,_x177){return _ref80.apply(this,arguments)}}());d();c();l();u();var tP=e=>Y({prefix:"analytics/resultPreview/open",__legacy__getBuilder:(t,r)=>{Kt(e);let n=dt(e,r),o=He(e);return t.makeDocumentQuickview(n,o)},analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=dt(e,t),n=He(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});d();c();l();u();d();c();l();u();d();c();l();u();function gx(){return{uniqueId:"",content:"",isLoading:!1,position:-1,resultsWithPreview:[]}}var hx=e=>{let{content:t,isLoading:r,uniqueId:n,contentURL:o}=gx();e.content=t,e.isLoading=r,e.uniqueId=n,e.contentURL=o},yx=e=>e.filter(t=>t.hasHtmlVersion).map(t=>t.uniqueId),rh=oe(gx(),e=>{e.addCase(pi.pending,t=>{t.isLoading=!0}).addCase(pi.fulfilled,(t,r)=>{let{content:n,uniqueId:o}=r.payload;t.position=t.resultsWithPreview.indexOf(o),t.content=n,t.uniqueId=o,t.isLoading=!1}).addCase(G.fulfilled,(t,r)=>{hx(t),t.resultsWithPreview=yx(r.payload.response.results)}).addCase(Sr.fulfilled,(t,r)=>{hx(t),t.resultsWithPreview=t.resultsWithPreview.concat(yx(r.payload.response.results))}).addCase(qt.fulfilled,hx).addCase(Qc,(t,r)=>{t.resultsWithPreview=yx(r.payload.results)}).addCase(Lc,t=>{if(t.isLoading)return;let r=t.position+1;r>t.resultsWithPreview.length-1&&(r=0),t.position=r}).addCase(Uc,t=>{if(t.isLoading)return;let r=t.position-1;r<0&&(r=t.resultsWithPreview.length-1),t.position=r}).addCase(Bc.fulfilled,(t,r)=>{t.contentURL=r.payload.contentURL})});function rP(e,t,r,n,o){if(!P1(e))throw W;let{dispatch:a}=e,i=()=>e.state,p=ne(e),{result:f,maximumPreviewSize:m}=t.options,h=()=>{let{resultsWithPreview:v,position:g}=i().resultPreview;return v[g]},S=v=>{a(Bc({uniqueId:v,requestedOutputSize:m,buildResultPreviewRequest:r,path:n})),t.options.onlyContentURL||a(pi({uniqueId:v,requestedOutputSize:m})),o&&o()};return{...p,fetchResultContent(){S(f.uniqueId)},next(){a(Lc()),S(h())},previous(){a(Uc()),S(h())},get state(){let v=i(),g=f.hasHtmlVersion,C=v.resultPreview,w=f.uniqueId===C.uniqueId?C.content:"",R=C.isLoading,b=C.contentURL,F=h();return{content:w,resultHasPreview:g,isLoading:R,contentURL:b,currentResultUniqueId:F}}}}function P1(e){return e.addReducers({configuration:le,resultPreview:rh}),!0}function nP(e,t){if(!k1(e))throw W;let{dispatch:r}=e,n=()=>e.state,o=()=>n().search.results,p=rP(e,t,th,"/html",()=>{e.dispatch(tP(t.options.result))});return r(Qc({results:o()})),{...p,get state(){return{...p.state,currentResult:o().findIndex(f=>f.uniqueId===p.state.currentResultUniqueId)+1,totalResults:o().length}}}}function k1(e){return e.addReducers({search:fe}),!0}d();c();l();u();d();c();l();u();var oP=()=>Y("analytics/recentQueries/clear",e=>e.makeClearRecentQueries()),aP=()=>Y("analytics/recentQueries/click",e=>e.makeRecentQueryClick());d();c();l();u();d();c();l();u();var O1={queries:new ae({required:!0,each:new M({emptyAllowed:!1})}),maxLength:new ee({required:!0,min:1,default:10})},fi=T("recentQueries/registerRecentQueries",e=>O(e,O1)),Gc=T("recentQueries/clearRecentQueries");d();c();l();u();d();c();l();u();function iP(){return{queries:[],maxLength:10}}var nh=oe(iP(),e=>{e.addCase(fi,N1).addCase(Gc,_1).addCase(G.fulfilled,(t,r)=>{let n=r.payload.queryExecuted,o=r.payload.response.results;!n.length||!o.length||D1(n,t)})});function N1(e,t){e.queries=Array.from(new Set(t.payload.queries.map(r=>r.trim().toLowerCase()))).slice(0,t.payload.maxLength),e.maxLength=t.payload.maxLength}function _1(e){e.queries=[]}function D1(e,t){let r=e.trim().toLowerCase();if(r==="")return;let n=Array.from(new Set(t.queries.filter(o=>o.trim().toLowerCase()!==r))).slice(0,t.maxLength-1);t.queries=[r,...n]}var q1={queries:[]},M1={maxLength:10,clearFilters:!0},j1=new ge({queries:new ae({required:!0})}),V1=new ge({maxLength:new ee({required:!0,min:1}),clearFilters:new ce});function L1(e,t){Be(e,V1,t?.options,"buildRecentQueriesList"),ut(e,j1,t?.initialState,"buildRecentQueriesList")}function sP(e,t){if(!U1(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a={...M1,...t?.options},i={...q1,...t?.initialState};L1(e,{options:a,initialState:i});let p={queries:i.queries,maxLength:a.maxLength};return n(fi(p)),{...r,get state(){let f=o();return{...f.recentQueries,analyticsEnabled:f.configuration.analytics.enabled}},clear(){n(Gc())},updateRecentQueries(f){let m=new ae({required:!0,each:new M({required:!0}),min:1}).validate(f);if(m)throw new Error(m);n(fi({queries:f,maxLength:a.maxLength}))},executeRecentQuery(f){let m=new ee({required:!0,min:0,max:this.state.queries.length}).validate(f);if(m)throw new Error(m);let h={q:this.state.queries[f],clearFilters:a.clearFilters};Bl(e.state.query?.enableQuerySyntax)&&(h.enableQuerySyntax=e.state.query.enableQuerySyntax),n(xs(h))}}}function U1(e){return e.addReducers({search:fe,recentQueries:nh,query:Ct}),!0}function cP(e,t){let r=sP(e,t),{dispatch:n}=e;return{...r,get state(){return r.state},clear(){n(oP()),r.clear()},executeRecentQuery(o){r.executeRecentQuery(o),n(G({legacy:aP(),next:{actionCause:"recentQueriesClick"}}))}}}d();c();l();u();d();c();l();u();var uP=e=>Y("analytics/recentResults/click",(t,r)=>(Kt(e),t.makeRecentResultClick(dt(e,r),He(e)))),lP=()=>Y("analytics/recentResults/clear",e=>e.makeClearRecentResults());function dP(e,t){return tr(e,t,()=>e.dispatch(uP(t.options.result)))}d();c();l();u();d();c();l();u();d();c();l();u();function pP(){return{results:[],maxLength:10}}var oh=oe(pP(),e=>{e.addCase(_c,(t,r)=>{t.results=r.payload.results.slice(0,r.payload.maxLength),t.maxLength=r.payload.maxLength}).addCase(Dc,t=>{t.results=[]}).addCase(Er,(t,r)=>{let n=r.payload;t.results=t.results.filter(a=>a.uniqueId!==n.uniqueId);let o=t.results.slice(0,t.maxLength-1);t.results=[n,...o]})});var Q1={initialState:{results:[]},options:{maxLength:10}},B1=new ge({results:new ae({required:!0})}),G1=new ge({maxLength:new ee({required:!0,min:1})});function $1(e,t){Be(e,G1,t?.options,"buildRecentResultsList"),ut(e,B1,t?.initialState,"buildRecentResultsList")}function fP(e,t){if(!H1(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a={...Q1,...t};$1(e,a);let i={results:a.initialState.results,maxLength:a.options.maxLength};return n(_c(i)),{...r,get state(){return o().recentResults},clear(){n(lP()),n(Dc())}}}function H1(e){return e.addReducers({recentResults:oh}),!0}d();c();l();u();d();c();l();u();d();c();l();u();var gP=e=>{let t=/Document weights:\n((?:.)*?)\n+/g,r=/Terms weights:\n((?:.|\n)*)\n+/g,n=/Total weight: ([0-9]+)/g;if(!e)return null;let o=t.exec(e),a=r.exec(e),i=n.exec(e),p=W1(e),f=hP(o?o[1]:null),m=z1(a),h=i?Number(i[1]):null;return{documentWeights:f,termsWeight:m,totalWeight:h,qreWeights:p}},hP=e=>{let t=/(\w+(?:\s\w+)*): ([-0-9]+)/g,r=/^(\w+(?:\s\w+)*): ([-0-9]+)$/;if(!e)return null;let n=e.match(t);if(!n)return null;let o={};for(let a of n){let i=a.match(r);if(i){let p=i[1],f=i[2];o[p]=Number(f)}}return o},mP=(e,t)=>{let r=[],n;for(;n=t.exec(e),n!==null;)r.push(n);return r},z1=e=>{let t=/((?:[^:]+: [0-9]+, [0-9]+; )+)\n((?:\w+: [0-9]+; )+)/g,r=/([^:]+): ([0-9]+), ([0-9]+); /g;if(!e||!e[1])return null;let n=mP(e[1],t);if(!n)return null;let o={};for(let a of n){let i=mP(a[1],r),p={};for(let m of i)p[m[1]]={Correlation:Number(m[2]),"TF-IDF":Number(m[3])};let f=hP(a[2]);o[Object.keys(p).join(", ")]={terms:p,Weights:f}}return o},W1=e=>{let t=/(Expression:\s".*")\sScore:\s(?!0)([-0-9]+)\n+/g,r=t.exec(e),n=[];for(;r;)n.push({expression:r[1],score:parseInt(r[2],10)}),r=t.exec(e);return n};function yP(e){return e.search.response.results.map(r=>{let n=gP(r.rankingInfo);return{result:r,ranking:n}})}var K1=new ge({enabled:new ce({default:!1})});function SP(e,t={}){if(!Y1(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state;ut(e,K1,t.initialState,"buildRelevanceInspector").enabled&&n(ho());let i=p=>{e.logger.warn(`Flag [ ${p} ] is now activated. This should *not* be used in any production environment as it negatively impact performance.`)};return{...r,get state(){let p=o(),f=p.debug;if(!p.debug)return{isEnabled:f};let{executionReport:m,basicExpression:h,advancedExpression:S,constantExpression:v,userIdentities:g,rankingExpressions:C}=p.search.response,{fieldsDescription:w,fetchAllFields:R}=p.fields;return{isEnabled:f,rankingInformation:yP(p),executionReport:m,expressions:{basicExpression:h,advancedExpression:S,constantExpression:v},userIdentities:g,rankingExpressions:C,fieldsDescription:w,fetchAllFields:R}},enable(){n(ho()),i("debug")},disable(){n(rs()),n(ui())},enableFetchAllFields(){n(Ec()),i("fetchAllFields")},disableFetchAllFields(){n(ui())},fetchFieldsDescription(){!this.state.isEnabled&&n(ho()),n(Ic()),i("fieldsDescription"),e.logger.warn(`For production environment, please specify the necessary fields either when instantiating a ResultList controller, or by dispatching a registerFieldsToInclude action.
|
|
46
46
|
|
|
47
47
|
https://docs.coveo.com/en/headless/latest/reference/interfaces/Search.ResultListOptions.html
|
|
48
|
-
https://docs.coveo.com/en/headless/latest/reference/interfaces/Search.FieldActionCreators.html#registerfieldstoinclude`)}}}function iG(e){return e.addReducers({debug:es,search:fe,configuration:ue,fields:Ho}),!0}d();c();l();u();d();c();l();u();var Zg=e=>Y({prefix:"analytics/result/open",__legacy__getBuilder:(t,r)=>(Kt(e),t.makeDocumentOpen(dt(e,r),He(e))),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=dt(e,t),n=He(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});function lP(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(Zg(t.options.result)))};return tr(e,t,()=>{n(),e.dispatch(Er(t.options.result))})}d();c();l();u();function dP(e,t){return Mg(e,{...t,fetchMoreResultsActionCreator:Sr})}d();c();l();u();d();c();l();u();var sG=new ge({numberOfResults:new ee({min:0})});function pP(e,t={}){if(!cG(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,i=ut(e,sG,t.initialState,"buildResultsPerPage").numberOfResults;return i!==void 0&&n(is(i)),{...r,get state(){return{numberOfResults:o().pagination.numberOfResults}},set(p){n(ss(p))},isSetTo(p){return p===this.state.numberOfResults}}}function cG(e){return e.addReducers({pagination:Ir,configuration:ue}),!0}function fP(e,t={}){if(!uG(e))throw W;let r=pP(e,t),{dispatch:n}=e;return{...r,get state(){return{...r.state}},set(o){r.set(o),n(qt({legacy:Dc(),next:Mc()}))}}}function uG(e){return e.addReducers({pagination:Ir,configuration:ue}),!0}d();c();l();u();d();c();l();u();var zo=()=>Y("analytics/searchbox/submit",e=>e.makeSearchboxSubmit()),eh=()=>({actionCause:"searchboxSubmit"});d();c();l();u();d();c();l();u();var mP={id:z,query:Ue},Bc=T("querySet/register",e=>O(e,mP)),fi=T("querySet/update",e=>O(e,mP));d();c();l();u();var Wo=oe(up(),e=>{e.addCase(Bc,(t,r)=>dG(t,r.payload)).addCase(fi,(t,r)=>{let{id:n,query:o}=r.payload;cx(t,n,o)}).addCase(Tn,(t,r)=>{let{id:n,expression:o}=r.payload;cx(t,n,o)}).addCase(G.fulfilled,(t,r)=>{let{queryExecuted:n}=r.payload;gP(t,n)}).addCase(De,lG).addCase(_e.fulfilled,(t,r)=>{if(r.payload)for(let[n,o]of Object.entries(r.payload.querySet))cx(t,n,o)})});function lG(e,t){le(t.payload.q)||gP(e,t.payload.q)}function gP(e,t){Object.keys(e).forEach(r=>{e[r]=t})}var cx=(e,t,r)=>{t in e&&(e[t]=r)},dG=(e,t)=>{let{id:r,query:n}=t;r in e||(e[r]=n)};d();c();l();u();var th=e=>Y("analytics/querySuggest",(t,r)=>{let n=ux(r,e);return t.makeOmniboxAnalytics(n)}),hP=()=>({actionCause:"omniboxAnalytics"});function ux(e,t){let{id:r,suggestion:n}=t,o=e.querySuggest?.[r];if(!o)throw new Error(`Unable to determine the query suggest analytics metadata to send because no query suggest with id "${r}" was found. Please check the sent #id.`);let a=o.completions.map(m=>m.expression),i=o.partialQueries.length-1,p=o.partialQueries[i]||"",f=o.responseId;return{suggestionRanking:a.indexOf(n),partialQuery:p,partialQueries:o.partialQueries,suggestions:a,querySuggestResponseId:f}}d();c();l();u();d();c();l();u();function yP(e,t){let r=t.id;r in e||(e[r]=pG(t))}function SP(e,t){let r=e[t.meta.arg.id];r&&(r.currentRequestId=t.meta.requestId,r.isLoading=!0)}function vP(e,t){let r=e[t.meta.arg.id];r&&(r.error=t.payload||null,r.isLoading=!1)}function xP(e,t){let r=e[t.id];r&&(r.responseId="",r.completions=[],r.partialQueries=[])}function pG(e){return{id:"",completions:[],responseId:"",count:5,currentRequestId:"",error:null,partialQueries:[],isLoading:!1,...e}}d();c();l();u();var AP=()=>({});var Gc=oe(AP(),e=>e.addCase(Rc,(t,r)=>{yP(t,r.payload)}).addCase(JI,(t,r)=>{delete t[r.payload.id]}).addCase(Go.pending,SP).addCase(Go.fulfilled,(t,r)=>{let n=t[r.meta.arg.id];if(!n||r.meta.requestId!==n.currentRequestId)return;let{q:o}=r.payload;o&&n.partialQueries.push(o.replace(/;/,encodeURIComponent(";"))),n.responseId=r.payload.responseId,n.completions=r.payload.completions,n.isLoading=!1,n.error=null}).addCase(Go.rejected,vP).addCase(Bo,(t,r)=>{xP(t,r.payload)}).addCase(vs,(t,r)=>{Object.keys(t).forEach(n=>{let o=t[n];o&&(o.error=r.payload,o.isLoading=!1)})}));d();c();l();u();var rh={enableQuerySyntax:!1,numberOfSuggestions:5,clearFilters:!0},lx={open:new M,close:new M},dx={id:z,numberOfSuggestions:new ee({min:0}),enableQuerySyntax:new ce,highlightOptions:new J({values:{notMatchDelimiters:new J({values:lx}),exactMatchDelimiters:new J({values:lx}),correctionDelimiters:new J({values:lx})}}),clearFilters:new ce},CP=new ge(dx);function bP(e,t){if(!mG(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a=t.options?.id||oo("search_box"),i={id:a,highlightOptions:{...t.options?.highlightOptions},...rh,...t.options};Be(e,CP,i,"buildSearchBox"),n(Bc({id:a,query:e.state.query.q})),i.numberOfSuggestions&&n(Rc({id:a,count:i.numberOfSuggestions})),i.enableQuerySyntax&&n(Dt({enableQuerySyntax:i.enableQuerySyntax}));let p=()=>e.state.querySet[i.id],f=/*#__PURE__*/function(){var _ref78=_asyncToGenerator(function*(m){let{enableQuerySyntax:g,clearFilters:S}=i;n(ys({q:p(),enableQuerySyntax:g,clearFilters:S})),t.isNextAnalyticsReady?n(t.executeSearchActionCreator(m)):n(t.executeSearchActionCreator(m.legacy))});return function f(_x172){return _ref78.apply(this,arguments)}}();return{...r,updateText(m){n(fi({id:a,query:m})),this.showSuggestions()},clear(){n(fi({id:a,query:""})),n(Bo({id:a}))},showSuggestions(){i.numberOfSuggestions&&n(t.fetchQuerySuggestionsActionCreator({id:a}))},selectSuggestion(m){n(Tn({id:a,expression:m})),f({legacy:th({id:a,suggestion:m}),next:hP()}).then(()=>{n(Bo({id:a}))})},submit(m=zo(),g){f({legacy:m,next:g}),n(Bo({id:a}))},get state(){let m=o(),g=m.querySuggest[i.id],S=fG(g,i.highlightOptions),A=g?g.isLoading:!1;return{searchBoxId:a,value:p(),suggestions:S,isLoading:m.search.isLoading,isLoadingSuggestions:A}}}}function fG(e,t){return e?e.completions.map(r=>({highlightedValue:_h(r.highlighted,t),rawValue:r.expression})):[]}function mG(e){return e.addReducers({query:Ct,querySuggest:Gc,configuration:ue,querySet:Wo,search:fe}),!0}function nh(e,t={}){let r=bP(e,{...t,executeSearchActionCreator:G,fetchQuerySuggestionsActionCreator:Go,isNextAnalyticsReady:!0});return{...r,submit(){r.submit(zo(),eh())},get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();var $c=()=>Y("analytics/sort/results",(e,t)=>e.makeResultsSort({resultsSortBy:t.sortCriteria||fr()})),oh=()=>({actionCause:"resultsSort"});function wP(e,t){return e.q!==t.q?zo():e.sortCriteria!==t.sortCriteria?$c():e.firstResult!==t.firstResult?qc():e.numberOfResults!==t.numberOfResults?Dc():Tr(e.f,t.f)?Ol(e.f,t.f):Tr(e.fExcluded,t.fExcluded)?Ol(e.fExcluded,t.fExcluded,!0):Tr(e.cf,t.cf)?Ol(e.cf,t.cf):Tr(e.af,t.af)?Ol(e.af,t.af):Tr(e.nf,t.nf)?RP(e.nf,t.nf):Tr(e.df,t.df)?RP(e.df,t.df):mo()}function Ol(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),a=n.filter(A=>!o.includes(A));if(a.length){let A=a[0];switch(!0){case e[A].length>1:return vt(A);case r:return Kn({facetId:A,facetValue:e[A][0]});default:return Lr({facetId:A,facetValue:e[A][0]})}}let i=o.filter(A=>!n.includes(A));if(i.length){let A=i[0];return r?cr({facetId:A,facetValue:t[A][0]}):ot({facetId:A,facetValue:t[A][0]})}let p=o.find(A=>t[A].filter(h=>e[A].includes(h)));if(!p)return mo();let f=e[p],m=t[p],g=m.filter(A=>!f.includes(A));if(g.length)return r?cr({facetId:p,facetValue:g[0]}):ot({facetId:p,facetValue:g[0]});let S=f.filter(A=>!m.includes(A));return S.length?r?Kn({facetId:p,facetValue:S[0]}):Lr({facetId:p,facetValue:S[0]}):mo()}function RP(e={},t={}){return Ol(zc(e),zc(t))}function FP(e,t){return e.q!==t.q?eh():e.sortCriteria!==t.sortCriteria?oh():Tr(e.f,t.f)?Hc(e.f,t.f):Tr(e.fExcluded,t.fExcluded)?Hc(e.fExcluded,t.fExcluded,!0):Tr(e.cf,t.cf)?Hc(e.cf,t.cf):Tr(e.af,t.af)?Hc(e.af,t.af):Tr(e.nf,t.nf)?Hc(zc(e.nf),zc(t.nf)):Tr(e.df,t.df)?Hc(zc(e.df),zc(t.df)):Ki()}function Tr(e={},t={}){return JSON.stringify(e)!==JSON.stringify(t)}function Hc(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),a=n.filter(A=>!o.includes(A));if(a.length){let A=a[0];return e[A].length>1?jt():Jn()}if(o.filter(A=>!n.includes(A)).length)return r?Yn():mt();let p=o.find(A=>t[A].filter(h=>e[A].includes(h)));if(!p)return Ki();let f=e[p],m=t[p];return m.filter(A=>!f.includes(A)).length?r?Yn():mt():f.filter(A=>!m.includes(A)).length?Jn():Ki()}function zc(e={}){let t={};return Object.keys(e).forEach(r=>{t[r]=e[r].map(n=>`${n.start}..${n.end}`)}),t}d();c();l();u();d();c();l();u();function EP(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{q:n}:{}}function IP(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{sortCriteria:n}:{}}function ah(e,t,r,n){if(e===void 0)return{};let o=Object.entries(e).filter(([a])=>t(a)).map(([a,{request:i}])=>{let p=r(i);return p.length?{[a]:p}:{}}).reduce((a,i)=>({...a,...i}),{});return Object.keys(o).length?{[n]:o}:{}}function TP(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{tab:n}:{}}d();c();l();u();function PP(e){return{q:lt().q,enableQuerySyntax:lt().enableQuerySyntax,aq:e.advancedSearchQueries?.defaultFilters.aq??_r().defaultFilters.aq,cq:e.advancedSearchQueries?.defaultFilters.cq??_r().defaultFilters.cq,firstResult:hr().firstResult,numberOfResults:e.pagination?.defaultNumberOfResults??hr().defaultNumberOfResults,sortCriteria:fr(),f:{},fExcluded:{},cf:{},nf:{},df:{},debug:yo(),sf:{},tab:"",af:{},mnf:{}}}var gG=new ge({parameters:new J({options:{required:!0},values:Kd})});function OP(e,t){let{dispatch:r}=e,n=ne(e);ut(e,gG,t.initialState,"buildSearchParameterManager");let o=kP(e.state.tabSet,t.initialState.parameters);return r(De(o)),{...n,synchronize(a){let i=kP(e.state.tabSet,ih(e,a));r(De(i))},get state(){return{parameters:px(e)}}}}function ih(e,t){return{...PP(e.state),...t}}function kP(e,t){if(t.tab&&e){let r=Object.values(e).some(o=>o.id===t.tab),n=Object.values(e).find(o=>o.isActive);if(!r&&n)return{...t,tab:n.id};if(!r)return{...t,tab:""}}return t}function px(e){let t=e.state;return{...EP(t.query,r=>r.q,lt().q),...TP(t.tabSet,r=>{let n=Object.values(r??{}).find(o=>o.isActive);return n?n.id:Object.keys(r??{})[0]},t.tabSet?Object.keys(t.tabSet)[0]:""),...IP(t.sortCriteria,r=>r,fr()),...yG(t),...SG(t),...vG(t),...xG(t),...AG(t)}}function hG(e){let t=e.tabSet;return t?Object.values(t).find(n=>n.isActive)?.id:void 0}function sh(e){let t=hG(e);return r=>{let n=e.facetOptions?.facets[r],o=n?.enabled??!0,a=er(n?.tabs,t);return o&&a}}function NP(e){return e.currentValues.filter(t=>t.state==="selected")}function yG(e){let t=e.facetSet;if(t===void 0)return{};let r=sh(e),n={},o={};for(let[a,{request:i}]of Object.entries(t)){if(!r(a))continue;let p=i.currentValues.filter(m=>m.state==="selected").map(m=>m.value),f=i.currentValues.filter(m=>m.state==="excluded").map(m=>m.value);p.length&&(n[a]=p),f.length&&(o[a]=f)}return{...(Object.keys(n).length?{f:n}:{}),...(Object.keys(o).length?{fExcluded:o}:{})}}function SG(e){return ah(e.categoryFacetSet,sh(e),t=>or(t.currentValues).map(r=>r.value),"cf")}function vG(e){return ah(e.numericFacetSet,sh(e),NP,"nf")}function xG(e){return ah(e.dateFacetSet,sh(e),NP,"df")}function AG(e){let t=e.automaticFacetSet?.set;if(t===void 0)return{};let r=Object.entries(t).map(([n,{response:o}])=>{let a=CG(o);return a.length?{[n]:a}:{}}).reduce((n,o)=>({...n,...o}),{});return Object.keys(r).length?{af:r}:{}}function CG(e){return e.values.filter(t=>t.state==="selected").map(t=>t.value)}function ch(e,t){let{dispatch:r}=e,n=OP(e,t);return{...n,synchronize(o){let a=_P(e),i=ih(e,a),p=ih(e,o);Tl(i,p)||(n.synchronize(o),r(G({legacy:wP(i,p),next:FP(i,p)})))},get state(){return{parameters:_P(e)}}}}function _P(e){let t=e.state;return{...px(e),...bG(t),...RG(t),...wG(t),...FG(t),...EG(t),...PG(t),...IG(t)}}function bG(e){if(e.query===void 0)return{};let t=e.query.enableQuerySyntax;return t!==void 0&&t!==lt().enableQuerySyntax?{enableQuerySyntax:t}:{}}function RG(e){if(e.advancedSearchQueries===void 0)return{};let{aq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.aq?{aq:t}:{}}function wG(e){if(e.advancedSearchQueries===void 0)return{};let{cq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.cq?{cq:t}:{}}function FG(e){if(e.pagination===void 0)return{};let t=e.pagination.firstResult;return t!==hr().firstResult?{firstResult:t}:{}}function EG(e){if(e.pagination===void 0)return{};let{numberOfResults:t,defaultNumberOfResults:r}=e.pagination;return t!==r?{numberOfResults:t}:{}}function IG(e){if(e.staticFilterSet===void 0)return{};let t=Object.entries(e.staticFilterSet).map(([r,n])=>{let o=TG(n.values);return o.length?{[r]:o}:{}}).reduce((r,n)=>({...r,...n}),{});return Object.keys(t).length?{sf:t}:{}}function TG(e){return e.filter(t=>t.state==="selected").map(t=>t.caption)}function PG(e){if(e.debug===void 0)return{};let t=e.debug;return t!==yo()?{debug:t}:{}}d();c();l();u();function DP(e){return Ec(e)}d();c();l();u();d();c();l();u();d();c();l();u();var uh=()=>new J({values:{questionAnswerId:z},options:{required:!0}}),fx=()=>new J({values:{linkText:Ue,linkURL:Ue},options:{required:!0}});function Wc(e){return O(e,uh())}d();c();l();u();function st(e,t){let r=t??e.search?.questionAnswer?.documentId;return r&&e.search&&yR(e,r.contentIdKey,r.contentIdValue)}function Ur(e,t){let r=e.questionAnswering?.relatedQuestions.findIndex(o=>o.questionAnswerId===t)??-1;return r===-1?null:e.search?.questionAnswer?.relatedQuestions?.[r]??null}var mx=()=>Y({prefix:"analytics/smartSnippet/expand",__legacy__getBuilder:e=>e.makeExpandSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=st(e),r=He(t),n=e.search?.response.searchUid;if(n)return{action:"expand",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),gx=()=>Y({prefix:"analytics/smartSnippet/collapse",__legacy__getBuilder:e=>e.makeCollapseSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=st(e),r=He(t),n=e.search?.response.searchUid;if(n)return{action:"collapse",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),hx=()=>Y({prefix:"analytics/smartSnippet/like",__legacy__getBuilder:e=>e.makeLikeSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=st(e),r=He(t),n=e.search?.response.searchUid;if(n)return{action:"like",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),yx=()=>Y({prefix:"analytics/smartSnippet/dislike",__legacy__getBuilder:e=>e.makeDislikeSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=st(e),r=He(t),n=e.search?.response.searchUid;if(n)return{action:"dislike",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),Sx=()=>Y({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(e,t)=>{let r=st(t);return e.makeOpenSmartSnippetSource(dt(r,t),He(r))},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:e=>{let t=st(e),r=He(t),n=e.search?.response.searchUid;if(n)return{snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),Nl=e=>Y({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(t,r)=>{O(e,fx());let n=st(r);return n?t.makeOpenSmartSnippetInlineLink(dt(n,r),{...He(n),...e}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=st(t),n=He(r),o=t.search?.response.searchUid;if(o)return{snippetType:"SmartSnippet",responseId:o,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri}}}}),vx=()=>Y("analytics/smartSnippet/feedbackModal/open",e=>e.makeOpenSmartSnippetFeedbackModal()),xx=()=>Y("analytics/smartSnippet/feedbackModal/close",e=>e.makeCloseSmartSnippetFeedbackModal()),kG={does_not_answer:"doesNotAnswer",partially_answers:"partiallyAnswers",was_not_a_question:"wasNotAQuestion"},Ax=e=>Y({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:t=>t.makeSmartSnippetFeedbackReason(e),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=st(t),n=He(r),o=t.search?.response.searchUid;if(o)return{responseId:o,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:kG[e]}}}),Cx=e=>Y({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:t=>t.makeSmartSnippetFeedbackReason("other",e),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=st(t),n=He(r),o=t.search?.response.searchUid;if(o)return{responseId:o,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:"other",additionalNotes:e}}}),bx=e=>Y({prefix:"analytics/smartSnippetSuggestion/expand",__legacy__getBuilder:(t,r)=>{Wc(e);let n=Ur(r,e.questionAnswerId);return n?t.makeExpandSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Ur(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=st(t,r.documentId);return{action:"expand",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),Rx=e=>Y({prefix:"analytics/smartSnippetSuggestion/collapse",__legacy__getBuilder:(t,r)=>{Wc(e);let n=Ur(r,e.questionAnswerId);return n?t.makeCollapseSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Ur(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=st(t,r.documentId);return{action:"collapse",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),_l=e=>Y({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(t,r)=>{O(e,uh());let n=Ur(r,e.questionAnswerId);if(!n)return null;let o=st(r,n.documentId);return o?t.makeOpenSmartSnippetSuggestionSource(dt(o,r),{question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=Ur(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=st(t,r.documentId);return{responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),lh=(e,t)=>Y({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(r,n)=>{O(e,uh()),O(t,fx());let o=Ur(n,e.questionAnswerId);if(!o)return null;let a=st(n,o.documentId);return a?r.makeOpenSmartSnippetSuggestionInlineLink(dt(a,n),{question:o.question,answerSnippet:o.answerSnippet,documentId:o.documentId,linkText:t.linkText,linkURL:t.linkURL}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:r=>{let n=Ur(r,e.questionAnswerId),o=r.search?.response.searchUid;if(o&&n){let a=st(r,n.documentId);return{responseId:o,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:n.documentId.contentIdKey,uniqueFieldValue:n.documentId.contentIdValue,title:a?.title,url:a?.clickUri}}}}}),dh={logExpandSmartSnippet:mx,logCollapseSmartSnippet:gx,logLikeSmartSnippet:hx,logDislikeSmartSnippet:yx,logOpenSmartSnippetSource:Sx,logOpenSmartSnippetInlineLink:Nl,logOpenSmartSnippetFeedbackModal:vx,logCloseSmartSnippetFeedbackModal:xx,logSmartSnippetFeedback:Ax,logSmartSnippetDetailedFeedback:Cx,logExpandSmartSnippetSuggestion:bx,logCollapseSmartSnippetSuggestion:Rx,logOpenSmartSnippetSuggestionSource:_l};d();c();l();u();d();c();l();u();var Kc=T("smartSnippet/expand"),Yc=T("smartSnippet/collapse"),Jc=T("smartSnippet/like"),Xc=T("smartSnippet/dislike"),Zc=T("smartSnippet/feedbackModal/open"),Ko=T("smartSnippet/feedbackModal/close"),eu=T("smartSnippet/related/expand",e=>Wc(e)),tu=T("smartSnippet/related/collapse",e=>Wc(e));d();c();l();u();d();c();l();u();var wx=()=>({liked:!1,disliked:!1,expanded:!1,feedbackModalOpen:!1,relatedQuestions:[]});var qP=(e,t)=>e.findIndex(r=>r.questionAnswerId===t.questionAnswerId);function MP({question:e,answerSnippet:t,documentId:{contentIdKey:r,contentIdValue:n}}){return xi({question:e,answerSnippet:t,contentIdKey:r,contentIdValue:n})}function OG(e,t){let r=MP(e);return t&&r===t.questionAnswerId?t:{contentIdKey:e.documentId.contentIdKey,contentIdValue:e.documentId.contentIdValue,expanded:!1,questionAnswerId:r}}var kn=oe(wx(),e=>e.addCase(Kc,t=>{t.expanded=!0}).addCase(Yc,t=>{t.expanded=!1}).addCase(Jc,t=>{t.liked=!0,t.disliked=!1,t.feedbackModalOpen=!1}).addCase(Xc,t=>{t.liked=!1,t.disliked=!0}).addCase(Zc,t=>{t.feedbackModalOpen=!0}).addCase(Ko,t=>{t.feedbackModalOpen=!1}).addCase(G.fulfilled,(t,r)=>{let n=r.payload.response.questionAnswer.relatedQuestions.map((a,i)=>OG(a,t.relatedQuestions[i])),o=MP(r.payload.response.questionAnswer);return t.questionAnswerId===o?{...t,relatedQuestions:n}:{...wx(),relatedQuestions:n,questionAnswerId:o}}).addCase(eu,(t,r)=>{let n=qP(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!0)}).addCase(tu,(t,r)=>{let n=qP(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!1)}));function VP(e,t,r){if(!NG(e))throw W;let n=ne(e),o=()=>e.state,a=()=>st(o()),i=null,p=tr(e,{options:{selectionDelay:r?.options?.selectionDelay}},()=>{let f=a();if(!f){i=null;return}let{searchResponseId:m}=o().search;i!==m&&(i=m,e.dispatch(t.logOpenSmartSnippetSource()),e.dispatch(Er(f)))});return{...n,get state(){let f=o();return{question:f.search.questionAnswer.question,answer:f.search.questionAnswer.answerSnippet,documentId:f.search.questionAnswer.documentId,expanded:f.questionAnswering.expanded,answerFound:f.search.questionAnswer.answerSnippet!=="",liked:f.questionAnswering.liked,disliked:f.questionAnswering.disliked,feedbackModalOpen:f.questionAnswering.feedbackModalOpen,source:a()}},expand(){e.dispatch(t.logExpandSmartSnippet()),e.dispatch(Kc())},collapse(){e.dispatch(t.logCollapseSmartSnippet()),e.dispatch(Yc())},like(){e.dispatch(t.logLikeSmartSnippet()),e.dispatch(Jc())},dislike(){e.dispatch(t.logDislikeSmartSnippet()),e.dispatch(Xc())},openFeedbackModal(){e.dispatch(t.logOpenSmartSnippetFeedbackModal()),e.dispatch(Zc())},closeFeedbackModal(){e.dispatch(t.logCloseSmartSnippetFeedbackModal()),e.dispatch(Ko())},sendFeedback(f){e.dispatch(t.logSmartSnippetFeedback(f)),e.dispatch(Ko())},sendDetailedFeedback(f){e.dispatch(t.logSmartSnippetDetailedFeedback(f)),e.dispatch(Ko())},selectSource(){p.select()},beginDelayedSelectSource(){p.beginDelayedSelect()},cancelPendingSelectSource(){p.cancelPendingSelect()}}}function NG(e){return e.addReducers({search:fe,questionAnswering:kn}),!0}d();c();l();u();function ph(e,t){if(!_G(e))throw W;let r=()=>e.state,n=new Set,o=g=>n.has(g)?!0:(n.add(g),!1),a=null,i=g=>{a!==g&&(a=g,f={},n.clear())},p=(g,S,A)=>tr(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{o(S)||e.dispatch(A?lh({questionAnswerId:A},g):Nl(g))}),f={},m=(g,S)=>{let{searchResponseId:A}=r().search;i(A);let h=xi({...g,questionAnswerId:S});return h in f||(f[h]=p(g,h,S)),f[h]};return{selectInlineLink(g,S){m(g,S)?.select()},beginDelayedSelectInlineLink(g,S){m(g,S)?.beginDelayedSelect()},cancelPendingSelectInlineLink(g,S){m(g,S)?.cancelPendingSelect()}}}function _G(e){return e.addReducers({search:fe,questionAnswering:kn}),!0}function jP(e,t){Do(e.state.configuration.analytics.analyticsMode);let r=VP(e,dh,t),n=ph(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectInlineLink(o){n.selectInlineLink(o)},beginDelayedSelectInlineLink(o){n.beginDelayedSelectInlineLink(o)},cancelPendingSelectInlineLink(o){n.cancelPendingSelectInlineLink(o)}}}d();c();l();u();d();c();l();u();function LP(e,t){if(!DG(e))throw W;let r=ne(e),n=()=>e.state,o=a=>{let{contentIdKey:i,contentIdValue:p}=a;return e.state.search.results.find(f=>Eo(f,i)===p)};return{...r,get state(){let a=n();return{questions:a.search.questionAnswer.relatedQuestions.map((i,p)=>({question:i.question,answer:i.answerSnippet,documentId:i.documentId,questionAnswerId:a.questionAnswering.relatedQuestions[p].questionAnswerId,expanded:a.questionAnswering.relatedQuestions[p].expanded,source:o(i.documentId)}))}},expand(a){let i={questionAnswerId:a};e.dispatch(t.logExpandSmartSnippetSuggestion(i)),e.dispatch(eu(i))},collapse(a){let i={questionAnswerId:a};e.dispatch(t.logCollapseSmartSnippetSuggestion(i)),e.dispatch(tu(i))}}}function DG(e){return e.addReducers({search:fe,questionAnswering:kn}),!0}d();c();l();u();function UP(e,t){if(!qG(e))throw W;let r=()=>e.state,n=S=>{let A=r(),h=Ur(A,S);return h?st(A,h.documentId):null},o=new Set,a=S=>o.has(S)?!0:(o.add(S),!1),i=null,p=S=>{i!==S&&(i=S,m={},o.clear())},f=(S,A)=>tr(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{a(A)||(e.dispatch(_l({questionAnswerId:A})),e.dispatch(Er(S)))}),m={},g=S=>{let{searchResponseId:A}=r().search;p(A);let h=n(S);return h?(S in m||(m[S]=f(h,S)),m[S]):null};return{selectSource(S){g(S)?.select()},beginDelayedSelectSource(S){g(S)?.beginDelayedSelect()},cancelPendingSelectSource(S){g(S)?.cancelPendingSelect()}}}function qG(e){return e.addReducers({search:fe,questionAnswering:kn}),!0}function QP(e,t){Do(e.state.configuration.analytics.analyticsMode);let r=LP(e,dh),n=ph(e,{options:{selectionDelay:t?.options?.selectionDelay}}),o=UP(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectSource(a){o.selectSource(a)},beginDelayedSelectSource(a){o.beginDelayedSelectSource(a)},cancelPendingSelectSource(a){o.cancelPendingSelectSource(a)},selectInlineLink(a,i){n.selectInlineLink(i,a)},beginDelayedSelectInlineLink(a,i){n.beginDelayedSelectInlineLink(i,a)},cancelPendingSelectInlineLink(a,i){n.cancelPendingSelectInlineLink(i,a)}}}d();c();l();u();d();c();l();u();d();c();l();u();var BP={by:new yu({enum:la,required:!0})},ru=T("sortCriteria/register",e=>GP(e)),nu=T("sortCriteria/update",e=>GP(e)),GP=e=>vi(e)?(e.forEach(t=>O(t,BP)),{payload:e}):O(e,BP);d();c();l();u();var fh=oe(fr(),e=>{e.addCase(ru,(t,r)=>Hr(r.payload)).addCase(nu,(t,r)=>Hr(r.payload)).addCase(_e.fulfilled,(t,r)=>r.payload?.sortCriteria??t).addCase(De,(t,r)=>r.payload.sortCriteria??t)});function MG(e,t){if(!t)return;let r=new ge({criterion:new ae({each:gb})}),n=VG(t),o={...t,criterion:n};ut(e,r,o,"buildSort")}function VG(e){return e.criterion?vi(e.criterion)?e.criterion:[e.criterion]:[]}function $P(e,t){if(!jG(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state;MG(e,t.initialState);let a=t.initialState?.criterion;return a&&n(ru(a)),{...r,sortBy(i){n(nu(i)),n(Yr(1))},isSortedBy(i){return this.state.sortCriteria===Hr(i)},get state(){return{sortCriteria:o().sortCriteria}}}}function jG(e){return e.addReducers({configuration:ue,sortCriteria:fh}),!0}function HP(e,t={}){let{dispatch:r}=e,n=$P(e,t),o=()=>r(G({legacy:$c(),next:oh()}));return{...n,get state(){return n.state},sortBy(a){n.sortBy(a),o()}}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function zP(e){return e.type==="redirect"}var mh=class{constructor(t){this.response=t}get basicExpression(){return this.response.parsedInput.basicExpression}get largeExpression(){return this.response.parsedInput.largeExpression}get redirectionUrl(){let t=this.response.preprocessingOutput.triggers.filter(zP);return t.length?t[0].content:null}};var ou=T("standaloneSearchBox/register",e=>O(e,{id:z,redirectionUrl:z,overwrite:new ce({required:!1})})),au=T("standaloneSearchBox/updateRedirectionUrl",e=>O(e,{id:z,redirectionUrl:z})),iu=T("standaloneSearchBox/reset",e=>O(e,{id:z})),su=T("standaloneSearchBox/updateAnalyticsToSearchFromLink",e=>O(e,{id:z})),cu=T("standaloneSearchBox/updateAnalyticsToOmniboxFromLink"),Yo=Se("standaloneSearchBox/fetchRedirect",/*#__PURE__*/function(){var _ref79=_asyncToGenerator(function*(e,{dispatch:t,getState:r,rejectWithValue:n,extra:{apiClient:o,validatePayload:a,navigatorContext:i}}){a(e,{id:new M({emptyAllowed:!1})});let p=yield UG(r(),i),f=yield o.plan(p);if(ht(f))return n(f.error);let{redirectionUrl:m}=new mh(f.success);return m&&t(LG(m)),m||""});return function(_x173,_x174){return _ref79.apply(this,arguments)}}()),LG=e=>Y("analytics/standaloneSearchBox/redirect",t=>t.makeTriggerRedirect({redirectedTo:e})),UG=/*#__PURE__*/function(){var _ref80=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ct(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,timezone:e.configuration.search.timezone,q:e.query.q,...(e.context&&{context:e.context.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.configuration.analytics.enabled&&e.configuration.analytics.analyticsMode==="legacy"?yield ps(e.configuration.analytics):Ln(e.configuration.analytics,t)),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function UG(_x175,_x176){return _ref80.apply(this,arguments)}}();d();c();l();u();d();c();l();u();function WP(){return{}}var gh=oe(WP(),e=>e.addCase(ou,(t,r)=>{let{id:n,redirectionUrl:o,overwrite:a}=r.payload;!a&&n in t||(t[n]=Fx(o))}).addCase(iu,(t,r)=>{let{id:n}=r.payload,o=t[n];if(o){t[n]=Fx(o.defaultRedirectionUrl);return}}).addCase(au,(t,r)=>{let{id:n,redirectionUrl:o}=r.payload;n in t&&(t[n]=Fx(o))}).addCase(Yo.pending,(t,r)=>{let n=t[r.meta.arg.id];n&&(n.isLoading=!0)}).addCase(Yo.fulfilled,(t,r)=>{let n=r.payload,o=t[r.meta.arg.id];o&&(o.redirectTo=n||o.defaultRedirectionUrl,o.isLoading=!1)}).addCase(Yo.rejected,(t,r)=>{let n=t[r.meta.arg.id];n&&(n.isLoading=!1)}).addCase(su,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="searchFromLink")}).addCase(cu,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="omniboxFromLink",n.analytics.metadata=r.payload.metadata)}));function Fx(e){return{defaultRedirectionUrl:e,redirectTo:"",isLoading:!1,analytics:{cause:"",metadata:null}}}d();c();l();u();var KP=new ge({...dx,redirectionUrl:new M({required:!0,emptyAllowed:!1}),overwrite:new ce({required:!1})});function YP(e,t){if(!QG(e))throw W;let{dispatch:r}=e,n=()=>e.state,o=t.options.id||oo("standalone_search_box"),a={id:o,highlightOptions:{...t.options.highlightOptions},...rh,overwrite:!1,...t.options};Be(e,KP,a,"buildStandaloneSearchBox");let i=nh(e,{options:a});return r(ou({id:o,redirectionUrl:a.redirectionUrl,overwrite:a.overwrite})),{...i,updateText(p){i.updateText(p),r(su({id:o}))},selectSuggestion(p){let f=ux(n(),{id:o,suggestion:p});r(Tn({id:o,expression:p})),r(cu({id:o,metadata:f})),this.submit()},afterRedirection(){r(iu({id:o}))},updateRedirectUrl(p){r(au({id:o,redirectionUrl:p}))},submit(){r(Dt({q:this.state.value,enableQuerySyntax:a.enableQuerySyntax})),r(Yo({id:o}))},get state(){let f=n().standaloneSearchBoxSet[o];return{...i.state,isLoading:f.isLoading,redirectTo:f.redirectTo,analytics:f.analytics}}}}function QG(e){return e.addReducers({standaloneSearchBoxSet:gh,configuration:ue,query:Ct,querySuggest:Gc}),!0}d();c();l();u();d();c();l();u();var hh=oe(lp(),e=>e.addCase(pc,(t,r)=>{let n=r.payload,{id:o}=n;o in t||(t[o]=n)}).addCase(eo,(t,r)=>{let{id:n,value:o}=r.payload,a=t[n];if(!a)return;let i=a.values.find(f=>f.caption===o.caption);if(!i)return;let p=i.state==="selected";i.state=p?"idle":"selected"}).addCase(to,(t,r)=>{let{id:n,value:o}=r.payload,a=t[n];if(!a)return;let i=a.values.find(f=>f.caption===o.caption);if(!i)return;let p=i.state==="excluded";i.state=p?"idle":"excluded"}).addCase(Lo,(t,r)=>{let n=r.payload,o=t[n];o&&o.values.forEach(a=>{a.state="idle"})}).addCase(pt,t=>{Object.values(t).forEach(r=>{r.values.forEach(n=>{n.state="idle"})})}).addCase(De,(t,r)=>{let n=r.payload.sf||{};Object.entries(t).forEach(([o,a])=>{let i=n[o]||[];a.values.forEach(p=>{p.state=i.includes(p.caption)?"selected":"idle"})})}));d();c();l();u();function Ex(e){return{state:"idle",...e}}var BG=new ge({id:oi,values:Ym});function JP(e,t){if(!GG(e))throw W;Be(e,BG,t.options,"buildStaticFilter");let r=ne(e),{dispatch:n}=e,o=()=>e.state,{id:a}=t.options;return n(pc(t.options)),{...r,toggleSelect(i){n(eo({id:a,value:i})),n(G({legacy:yh(a,i)}))},toggleSingleSelect(i){i.state==="idle"&&n(Lo(a)),n(eo({id:a,value:i})),n(G({legacy:yh(a,i)}))},toggleExclude(i){n(to({id:a,value:i})),n(G({legacy:yh(a,i)}))},toggleSingleExclude(i){i.state==="idle"&&n(Lo(a)),n(to({id:a,value:i})),n(G({legacy:yh(a,i)}))},deselectAll(){n(Lo(a)),n(G({legacy:Xm({staticFilterId:a})}))},isValueSelected(i){return i.state==="selected"},isValueExcluded(i){return i.state==="excluded"},get state(){let i=o().staticFilterSet[a]?.values||[],p=i.some(f=>f.state!=="idle");return{id:a,values:i,hasActiveValues:p}}}}function GG(e){return e.addReducers({staticFilterSet:hh}),!0}function yh(e,t){let{caption:r,expression:n,state:o}=t;return(o==="idle"?Jm:fc)({staticFilterId:e,staticFilterValue:{caption:r,expression:n}})}d();c();l();u();d();c();l();u();var $G=new ge({expression:Ue,id:z,clearFiltersOnTabChange:new ce}),HG=new ge({isActive:new ce});function XP(e,t){if(WG(t.options.id),!zG(e))throw W;let r=ne(e),{dispatch:n}=e;Be(e,$G,t.options,"buildTab");let o=ut(e,HG,t.initialState,"buildTab"),{id:a,expression:i}=t.options;return n(Os({id:a,expression:i})),Object.keys(e.state.tabSet).length===1&&(o.isActive=!0),o.isActive&&n(gt(a)),{...r,select(){t.options.clearFiltersOnTabChange&&n(ys({q:"",clearFilters:!0})),n(gt(a))},get state(){return{isActive:e.state.tabSet[a]?.isActive}}}}function zG(e){return e.addReducers({configuration:ue,tabSet:mc}),!0}function WG(e){let t=Ns().analytics.originLevel2;if(e===t)throw new Error(`The #id option on the Tab controller cannot use the reserved value "${t}". Please specify a different value.`)}function ZP(e,t){let{dispatch:r}=e,n=XP(e,t),o=()=>r(G({legacy:mo(),next:Ki()}));return{...n,get state(){return n.state},select(){n.select(),o()}}}d();c();l();u();function ek(e){let t=rg(e);return{...t,get state(){return t.state}}}d();c();l();u();d();c();l();u();d();c();l();u();function tk(e){return e.query="",e.queryModification={originalQuery:"",newQuery:"",queryToIgnore:e.queryModification.queryToIgnore},e}function rk(e,t){let r=[],n=[],o=[],a=[];return t.forEach(i=>{switch(i.type){case"redirect":r.push(i.content);break;case"query":n.push(i.content);break;case"execute":o.push({functionName:i.content.name,params:i.content.params});break;case"notify":a.push(i.content);break}}),e.redirectTo=r[0]??"",e.query=e.queryModification.newQuery,e.executions=o,e.notifications=a,e}function nk(e,t){return e.queryModification={...t,queryToIgnore:""},e}function ok(e,t){return e.queryModification.queryToIgnore=t,e}d();c();l();u();var ak=()=>({redirectTo:"",query:"",executions:[],notifications:[],queryModification:{originalQuery:"",newQuery:"",queryToIgnore:""}});var Jo=oe(ak(),e=>e.addCase(G.pending,tk).addCase(G.fulfilled,(t,r)=>rk(t,r.payload.response.triggers)).addCase(hs,(t,r)=>nk(t,r.payload)).addCase(Co,(t,r)=>ok(t,r.payload)));function ik(e){if(!KG(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state,o=n().triggers.executions;return{...t,subscribe(a){let i=()=>{let p=!li(this.state.executions,o,(f,m)=>f.functionName===m.functionName&&li(f.params,m.params));o=this.state.executions,p&&this.state.executions.length&&(a(),r(hp()))};return i(),e.subscribe(i)},get state(){return{executions:n().triggers.executions}}}}function KG(e){return e.addReducers({triggers:Jo}),!0}d();c();l();u();d();c();l();u();function sk(e,t){let r=t.options.logNotifyTriggerActionCreator;if(!YG(e))throw W;let n=ne(e),{dispatch:o}=e,a=()=>e.state,i=a().triggers.notifications;return{...n,subscribe(p){let f=()=>{let m=!li(i,this.state.notifications);i=this.state.notifications,m&&(p(),o(r()))};return f(),e.subscribe(f)},get state(){return{notifications:a().triggers.notifications}}}}function YG(e){return e.addReducers({triggers:Jo}),!0}function ck(e){return sk(e,{options:{logNotifyTriggerActionCreator:mp}})}d();c();l();u();function uk(e){if(!JG(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state,o=()=>n().triggers.queryModification.newQuery,a=()=>n().triggers.queryModification.originalQuery;return{...t,get state(){return{newQuery:o(),originalQuery:a(),wasQueryModified:o()!==""}},undo(){r(Co(o())),r(Dt({q:a()})),r(G({legacy:fp({undoneQuery:o()})}))}}}function JG(e){return e.addReducers({triggers:Jo,query:Ct}),!0}d();c();l();u();function lk(e){if(!XG(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state,o=n().triggers.redirectTo;return{...t,subscribe(a){let i=()=>{let p=o!==this.state.redirectTo;o=this.state.redirectTo,p&&this.state.redirectTo&&(a(),r(gp()))};return i(),e.subscribe(i)},get state(){return{redirectTo:n().triggers.redirectTo}}}}function XG(e){return e.addReducers({triggers:Jo}),!0}d();c();l();u();d();c();l();u();var pk="..",Ix="...",ZG=/^(f|fExcluded|cf|nf|df|sf|af|mnf)-(.+)$/,e2={f:!0,fExcluded:!0,cf:!0,sf:!0,af:!0,nf:!0,df:!0,mnf:!0},Sh="&",Dl="=";function ql(){return{serialize:n2(o2),deserialize:l2}}function Ml(e){return e in e2}function t2(e){return e in{q:!0,aq:!0,cq:!0,enableQuerySyntax:!0,firstResult:!0,numberOfResults:!0,sortCriteria:!0,debug:!0,tab:!0}}function r2(e){let r=e in{nf:!0,df:!0,mnf:!0};return Ml(e)&&r}function fk(e){return t2(e)||Ml(e)}var n2=e=>t=>Object.entries(t).map(e).filter(r=>r).join(Sh);function o2(e){let[t,r]=e;return fk(t)?Ml(t)&&!r2(t)?i2(r)?c2(t,r):"":t==="nf"||t==="df"?s2(r)?u2(t,r):"":a2(t,r):""}function a2(e,t){return`${e}${Dl}${encodeURIComponent(t)}`}function i2(e){return Tx(e)?mk(e,r=>typeof r=="string"):!1}function s2(e){return Tx(e)?mk(e,r=>Tx(r)&&"start"in r&&"end"in r):!1}function Tx(e){return!!(e&&typeof e=="object")}function mk(e,t){return Object.entries(e).filter(n=>{let o=n[1];return!Array.isArray(o)||!o.every(t)}).length===0}function c2(e,t){return Object.entries(t).map(([r,n])=>`${e}-${r}${Dl}${n.map(o=>encodeURIComponent(o)).join(",")}`).join(Sh)}function u2(e,t){return Object.entries(t).map(([r,n])=>{let o=n.map(({start:a,end:i,endInclusive:p})=>`${a}${p?Ix:pk}${i}`).join(",");return`${e}-${r}${Dl}${o}`}).join(Sh)}function l2(e){return e.split(Sh).map(n=>d2(n)).map(n=>p2(n)).filter(h2).map(n=>y2(n)).reduce((n,o)=>{let[a,i]=o;if(Ml(a)){let p={...n[a],...i};return{...n,[a]:p}}return{...n,[a]:i}},{})}function d2(e){let[t,...r]=e.split(Dl),n=r.join(Dl);return[t,n]}function p2(e,t=ZG){let[r,n]=e,o=t.exec(r);if(!o)return e;let a=o[1],i=o[2],p=n.split(","),f=f2(a,p),m={[i]:f};return[a,JSON.stringify(m)]}function f2(e,t){return e==="nf"||e==="mnf"?m2(t,"selected"):e==="df"?g2(t,"selected"):t}function m2(e,t){let r=[];for(let n of e){let{startAsString:o,endAsString:a,isEndInclusive:i}=gk(n),p=parseFloat(o),f=parseFloat(a);!Number.isFinite(p)||!Number.isFinite(f)||r.push(bc({start:p,end:f,state:t,endInclusive:i}))}return r}function dk(e){try{return Qb(e)?(ep(e,fs),!0):Jr(e)?(xo(e),!0):!1}catch{return!1}}function g2(e,t){let r=[];for(let n of e){let{isEndInclusive:o,startAsString:a,endAsString:i}=gk(n);!dk(a)||!dk(i)||r.push(jo({start:a,end:i,state:t,endInclusive:o}))}return r}function h2(e){let t=fk(e[0]),r=e.length===2;return t&&r}function y2(e,t=!0){let[r,n]=e;return r==="enableQuerySyntax"?[r,n==="true"]:r==="debug"?[r,n==="true"]:r==="firstResult"?[r,parseInt(n)]:r==="numberOfResults"?[r,parseInt(n)]:Ml(r)?[r,S2(n)]:[r,t?decodeURIComponent(n):n]}function S2(e){let t=JSON.parse(e),r={};return Object.entries(t).forEach(n=>{let[o,a]=n;r[o]=a.map(i=>Si(i)?decodeURIComponent(i):i)}),r}function gk(e){let t=e.indexOf(Ix)!==-1,[r,n]=e.split(t?Ix:pk);return{isEndInclusive:t,startAsString:r,endAsString:n}}var v2=new ge({fragment:new M});function hk(e,t){let r;function n(){r=e.state.search.requestId}function o(){return r!==e.state.search.requestId}if(!A2(e))throw W;ut(e,v2,t.initialState,"buildUrlManager");let a=ne(e),i=t.initialState.fragment;n();let p=ch(e,{initialState:{parameters:vh(i)}});return{...a,subscribe(f){let m=()=>{let g=this.state.fragment;!x2(i,g)&&o()&&(i=g,f()),n()};return m(),e.subscribe(m)},get state(){return{fragment:ql().serialize(p.state.parameters)}},synchronize(f){i=f;let m=vh(f);p.synchronize(m)}}}function x2(e,t){if(e===t)return!0;let r=vh(e),n=vh(t);return Tl(r,n)}function vh(e){return ql().deserialize(e)}function A2(e){return e.addReducers({configuration:ue}),!0}d();c();l();u();d();c();l();u();var yk=Se("analytics/addPageViewEntry",/*#__PURE__*/function(){var _ref81=_asyncToGenerator(function*(e,{getState:t}){t().configuration.analytics.enabled&&Wt.getInstance().addElement({name:"PageView",value:e,time:JSON.stringify(new Date)})});return function(_x177,_x178){return _ref81.apply(this,arguments)}}());function C2(e){return e.addReducers({}),{addPageViewEntryInActionsHistory:yk}}d();c();l();u();d();c();l();u();d();c();l();u();var Xo=()=>new M({required:!1,emptyAllowed:!0}),xh=T("advancedSearchQueries/update",e=>O(e,{aq:Xo(),cq:Xo(),lq:Xo(),dq:Xo()})),Ah=T("advancedSearchQueries/register",e=>O(e,{aq:Xo(),cq:Xo(),lq:Xo(),dq:Xo()}));var Sk=oe(_r(),e=>{e.addCase(xh,(t,r)=>{let{aq:n,cq:o,lq:a,dq:i}=r.payload;wt(n)||(t.aq=n,t.aqWasSet=!0),wt(o)||(t.cq=o,t.cqWasSet=!0),wt(a)||(t.lq=a,t.lqWasSet=!0),wt(i)||(t.dq=i,t.dqWasSet=!0)}).addCase(Ah,(t,r)=>{let{aq:n,cq:o,lq:a,dq:i}=r.payload;wt(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),wt(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),wt(a)||(t.defaultFilters.lq=a,t.lqWasSet||(t.lq=a)),wt(i)||(t.defaultFilters.dq=i,t.dqWasSet||(t.dq=i))}).addCase(_e.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(De,(t,r)=>{let{aq:n,cq:o}=r.payload;wt(n)||(t.aq=n,t.aqWasSet=!0),wt(o)||(t.cq=o,t.cqWasSet=!0)})});function b2(e){return e.addReducers({advancedSearchQueries:Sk}),{updateAdvancedSearchQueries:xh,registerAdvancedSearchQueries:Ah}}d();c();l();u();function R2(e){return e.addReducers({}),{logDocumentOpen:Zg,logOpenSmartSnippetSource:Sx,logOpenSmartSnippetSuggestionSource:_l,logOpenSmartSnippetInlineLink:Nl,logOpenSmartSnippetSuggestionInlineLink:lh}}d();c();l();u();function w2(e){return e.addReducers({}),{logSearchEvent:Tb,logClickEvent:Pb,logCustomEvent:kb}}d();c();l();u();function F2(e){return e.addReducers({}),{logClearBreadcrumbs:Om,logInterfaceLoad:Bd,logSearchFromLink:Gd,logOmniboxFromLink:$d,logInterfaceChange:mo,logDidYouMeanClick:op,logCategoryFacetBreadcrumb:bm,logFacetBreadcrumb:lc,logFacetClearAll:vt,logFacetUnexclude:Kn,logFacetExclude:cr,logFacetDeselect:Lr,logFacetSelect:ot,logFacetShowLess:uc,logFacetShowMore:cc,logFacetUpdateSort:Sn,logDateFacetBreadcrumb:Cl,logNumericFacetBreadcrumb:bl,logNavigateBackward:Lg,logNavigateForward:jg,logPageNext:zg,logPageNumber:qc,logPagePrevious:Wg,logPagerResize:Dc,logSearchboxSubmit:zo,logQuerySuggestionClick:th,logResultsSort:$c,logDislikeSmartSnippet:yx,logLikeSmartSnippet:hx,logOpenSmartSnippetFeedbackModal:vx,logCloseSmartSnippetFeedbackModal:xx,logSmartSnippetFeedback:Ax,logSmartSnippetDetailedFeedback:Cx,logExpandSmartSnippet:mx,logCollapseSmartSnippet:gx,logExpandSmartSnippetSuggestion:bx,logCollapseSmartSnippetSuggestion:Rx,logNoResultsBack:Ug,logStaticFilterSelect:Jm,logStaticFilterDeselect:fc,logStaticFilterClearAll:Xm,logTriggerQuery:pp,logUndoTriggerQuery:fp,logNotifyTrigger:mp,logTriggerRedirect:gp,logTriggerExecute:hp}}d();c();l();u();function E2(e){return e.addReducers({}),{deselectAllBreadcrumbs:pt,deselectAllNonBreadcrumbs:ns}}d();c();l();u();function I2(e){return e.addReducers({configuration:ue}),{disableAnalytics:Yi,enableAnalytics:Ji,setOriginLevel2:Hd,setOriginLevel3:zd,updateAnalyticsConfiguration:go,updateBasicConfiguration:zr}}d();c();l();u();function T2(e){return e.addReducers({configuration:ue,pipeline:rs,searchHub:As}),{updateSearchConfiguration:mr}}d();c();l();u();function P2(e){return e.addReducers({context:eg}),{addContext:ii,removeContext:si,setContext:ai}}d();c();l();u();function k2(e){return e.addReducers({debug:es}),{disableDebug:Zi,enableDebug:ho}}d();c();l();u();function O2(e){return e.addReducers({dictionaryFieldContext:ng}),{addContext:hc,removeContext:yc,setContext:gc}}d();c();l();u();function N2(e){return e.addReducers({didYouMean:ag,query:Ct}),{applyDidYouMeanCorrection:gr,disableDidYouMean:rp,enableDidYouMean:ms,enableAutomaticQueryCorrection:np,disableAutomaticQueryCorrection:gs,setCorrectionMode:fa}}d();c();l();u();d();c();l();u();d();c();l();u();var Ch=T("excerptLength/set",e=>O(e,new ee({min:0,required:!0})));d();c();l();u();function vk(){return{length:void 0}}var xk=oe(vk(),e=>{e.addCase(Ch,(t,r)=>{t.length=r.payload})});function _2(e){return e.addReducers({excerptLength:xk}),{setExcerptLength:Ch}}d();c();l();u();function D2(e){return e.addReducers({facetOptions:xt}),{updateFacetOptions:be,enableFacet:Vt,disableFacet:Je}}d();c();l();u();function q2(e){return e.addReducers({automaticFacetSet:ig}),{setOptions:Xs,deselectAllAutomaticFacetValues:Zs,toggleSelectAutomaticFacetValue:sn}}d();c();l();u();function M2(e){return e.addReducers({categoryFacetSet:ln}),{deselectAllCategoryFacetValues:un,registerCategoryFacet:cn,toggleSelectCategoryFacetValue:Mo,updateCategoryFacetNumberOfValues:Ya,updateCategoryFacetSortCriterion:tc,updateFacetAutoSelection:Wr,updateCategoryFacetBasePath:Cm}}d();c();l();u();function V2(e){return e.addReducers({facetSet:Rr}),{deselectAllFacetValues:Xe,registerFacet:gn,toggleSelectFacetValue:hn,toggleExcludeFacetValue:yn,updateFacetIsFieldExpanded:Xa,updateFacetNumberOfValues:Ja,updateFacetSortCriterion:sc,updateFreezeCurrentValues:Wn,updateFacetAutoSelection:Wr}}d();c();l();u();function j2(e){return e.addReducers({dateFacetSet:bn}),{deselectAllDateFacetValues:Dm,registerDateFacet:vn,toggleSelectDateFacetValue:xn,toggleExcludeDateFacetValue:An,updateDateFacetSortCriterion:_m,updateDateFacetValues:Xn}}d();c();l();u();function L2(e){return e.addReducers({numericFacetSet:wr}),{deselectAllNumericFacetValues:Wm,registerNumericFacet:Rn,toggleSelectNumericFacetValue:wn,toggleExcludeNumericFacetValue:Fn,updateNumericFacetSortCriterion:zm,updateNumericFacetValues:Zn}}d();c();l();u();function U2(e){return e.addReducers({fields:Ho}),{registerFieldsToInclude:$o,enableFetchAllFields:wc,disableFetchAllFields:ci,fetchFieldsDescription:Fc}}d();c();l();u();function Q2(e){return e.addReducers({folding:Dg}),{registerFolding:Uo,loadCollection:Qo}}d();c();l();u();function B2(e){return e.addReducers({generatedAnswer:Tc}),{generateAnswer:Mp,resetAnswer:sr,setAnswerGenerationMode:wp}}d();c();l();u();function G2(e){return e.addReducers({history:Bg,facetOrder:kc}),{back:Gu,forward:Yd}}d();c();l();u();function $2(e){return e.addReducers({instantResults:$g}),{registerInstantResults:os,updateInstantResultsQuery:Kr,clearExpiredResults:as}}d();c();l();u();function H2(e){return e.addReducers({pagination:Ir}),{nextPage:us,previousPage:ls,registerNumberOfResults:is,registerPage:cs,updateNumberOfResults:ss,updatePage:Yr}}d();c();l();u();function z2(e){return e.addReducers({pipeline:rs}),{setPipeline:ts}}d();c();l();u();function W2(e){return e.addReducers({query:Ct}),{updateQuery:Dt}}d();c();l();u();function K2(e){return e.addReducers({querySet:Wo}),{registerQuerySetQuery:Bc,updateQuerySetQuery:fi}}d();c();l();u();function Y2(e){return e.addReducers({querySuggest:Gc,querySet:Wo}),{clearQuerySuggest:Bo,fetchQuerySuggestions:Go,registerQuerySuggest:Rc,selectQuerySuggestion:Tn}}d();c();l();u();function J2(e){return e.addReducers({questionAnswering:kn}),{collapseSmartSnippet:Yc,expandSmartSnippet:Kc,dislikeSmartSnippet:Xc,likeSmartSnippet:Jc,openFeedbackModal:Zc,closeFeedbackModal:Ko,expandSmartSnippetRelatedQuestion:eu,collapseSmartSnippetRelatedQuestion:tu}}d();c();l();u();function X2(e){return e.addReducers({recentQueries:Jg}),{registerRecentQueries:pi,clearRecentQueries:Qc}}d();c();l();u();function Z2(e){return e.addReducers({recentResults:Xg}),{registerRecentResults:Oc,clearRecentResults:Nc,pushRecentResult:Er}}d();c();l();u();function e$(e){return e.addReducers({resultPreview:Yg}),{fetchResultContent:di,updateContentURL:Uc,nextPreview:Vc,previousPreview:jc,preparePreviewPagination:Lc}}d();c();l();u();d();c();l();u();var t$=new ge({content:new Le({required:!0}),conditions:new Le({required:!0}),priority:new ee({required:!1,default:0,min:0}),fields:new ae({required:!1,each:z})});function Ak(){let e=[],t=r=>{let n=t$.validate(r);if(!r.conditions.every(a=>a instanceof Function))throw new hu("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(a=>a(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(a=>a(r)));return n?n.linkContent:null}}}function Ck(e){if(!r$(e))throw W;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=Ak();return{registerTemplates:(...o)=>{t(...o);let a=[];o.forEach(i=>{i.fields&&a.push(...i.fields)}),e.dispatch($o(a))},selectTemplate:r,selectLinkTemplate:n}}function r$(e){return e.addReducers({fields:Ho}),!0}d();c();l();u();function n$(e){return e.addReducers({search:fe}),{executeSearch:oR,fetchMoreResults:iR,fetchFacetValues:sR,fetchPage:aR,fetchInstantResults:cR}}d();c();l();u();function o$(e){return e.addReducers({searchHub:As}),{setSearchHub:xs}}d();c();l();u();function a$(e){return e.addReducers({facetOrder:kc,facetSet:Rr,pagination:Ir,query:Ct,querySet:Wo}),{restoreSearchParameters:De,restoreTab:Xi}}d();c();l();u();function i$(e){return e.addReducers({sortCriteria:fh}),{registerSortCriterion:ru,updateSortCriterion:nu}}d();c();l();u();function s$(e){return e.addReducers({standaloneSearchBoxSet:gh}),{registerStandaloneSearchBox:ou,fetchRedirectUrl:Yo,updateStandaloneSearchBoxRedirectionUrl:au,updateAnalyticsToSearchFromLink:su,updateAnalyticsToOmniboxFromLink:cu,resetStandaloneSearchBox:iu}}d();c();l();u();function c$(e){return e.addReducers({staticFilterSet:hh}),{registerStaticFilter:pc,toggleSelectStaticFilterValue:eo,toggleExcludeStaticFilterValue:to,deselectAllStaticFilterValues:Lo}}d();c();l();u();function u$(e){return e.addReducers({tabSet:mc}),{registerTab:Os,updateActiveTab:gt}}d();c();l();u();function l$(e){let{by:t,order:r}=e;switch(t){case"relevancy":return Hi();case"qre":return Vd();case"nosort":return jd();case"date":if(!r)throw new Error("An order (i.e., ascending or descending) should be specified for a sort criterion sorted by \"date\"");return qd(r);default:if(!r)throw new Error(`An order (i.e., ascending or descending) should be specified for a sort criterion sorted by a field, such as "${t}"`);return Md(t,r)}}function d$(e){return e===void 0||e==="ascending"||e==="descending"}function bk(e){let t=e.split(","),r=new Error(`Wrong criterion expression format for "${e}"`);if(!t.length)throw r;return t.map(n=>{let o=n.trim().split(" "),a=o[0].toLowerCase(),i=o[1]?.toLowerCase();if(o.length>2||a==="")throw r;if(!d$(i))throw new Error(`Wrong criterion sort order "${i}" in expression "${e}". Order should either be "ascending" or "descending"`);return l$({by:a,order:i})})}d();c();l();u();d();c();l();u();d();c();l();u();function bt(e){return e.negate?"NOT ":""}d();c();l();u();function Pr(e){return{contains:"=",differentThan:"<>",fuzzyMatch:"~=",greaterThan:">",greaterThanOrEqual:">=",isExactly:"==",lowerThan:"<",lowerThanOrEqual:"<=",phoneticMatch:"%=",regexMatch:"/=",wildcardMatch:"*="}[e]}function Rk(e){return{toQuerySyntax(){let{field:t,value:r}=e,n=Pr(e.operator);return`${bt(e)}@${t}${n}${r}`}}}d();c();l();u();function wk(e){return{toQuerySyntax(){let t=bt(e),{field:r,from:n,to:o}=e,a=Pr("isExactly");return`${t}@${r}${a}${n}..${o}`}}}d();c();l();u();function Fk(e){return{toQuerySyntax(){let t=bt(e),{expression:r}=e;return`${t}"${r}"`}}}d();c();l();u();function Ek(e){return{toQuerySyntax(){let t=bt(e),{field:r}=e;return`${t}@${r}`}}}d();c();l();u();function Ik(e){return{toQuerySyntax(){let{expression:t,negate:r}=e;return r?`NOT (${t})`:t}}}d();c();l();u();function Tk(e){return{toQuerySyntax(){let t=bt(e),{startTerm:r,otherTerms:n}=e,o=p$(n),a=`${r} ${o}`;return e.negate?`${t}(${a})`:a}}}function p$(e){return e.map(t=>{let{endTerm:r,maxKeywordsBetween:n}=t;return`near:${n} ${r}`}).join(" ")}d();c();l();u();function Pk(e){return{toQuerySyntax(){let{field:t,value:r}=e,n=bt(e),o=Pr(e.operator);return`${n}@${t}${o}${r}`}}}d();c();l();u();function kk(e){return{toQuerySyntax(){let t=bt(e),{field:r,from:n,to:o}=e,a=Pr("isExactly");return`${t}@${r}${a}${n}..${o}`}}}d();c();l();u();function Ok(e){return{toQuerySyntax(){let{name:t,parameters:r}=e,n=f$(r);return`$${t}(${n})`}}}function f$(e){return Object.entries(e).map(t=>{let[r,n]=t,o=typeof n=="string"?n:n.toQuerySyntax();return`${r}: ${o}`}).join(", ")}d();c();l();u();function Nk(e){return{toQuerySyntax(){let t=bt(e),{field:r,operator:n,value:o}=e,a=Pr(n),i=n==="fuzzyMatch"?` $quoteVar(value: ${o})`:`("${o}")`;return`${t}@${r}${a}${i}`}}}d();c();l();u();function _k(e){return{toQuerySyntax(){let{field:t}=e,r=bt(e),n=Pr(e.operator),o=e.values.map(i=>`"${i}"`),a=o.length===1?o[0]:`(${o.join(",")})`;return`${r}@${t}${n}${a}`}}}function m$(){let e=[],t="and";return{addExpression(r){return e.push(r),this},addKeyword(r){return e.push(Ik(r)),this},addNear(r){return e.push(Tk(r)),this},addExactMatch(r){return e.push(Fk(r)),this},addFieldExists(r){return e.push(Ek(r)),this},addStringField(r){return e.push(_k(r)),this},addStringFacetField(r){return e.push(Nk(r)),this},addNumericField(r){return e.push(Pk(r)),this},addNumericRangeField(r){return e.push(kk(r)),this},addDateField(r){return e.push(Rk(r)),this},addDateRangeField(r){return e.push(wk(r)),this},addQueryExtension(r){return e.push(Ok(r)),this},joinUsing(r){return t=r,this},toQuerySyntax(){let r=g$(t),n=e.map(o=>o.toQuerySyntax()).join(`) ${r} (`);return e.length<=1?n:`(${n})`}}}function g$(e){return e==="and"?"AND":"OR"}/**
|
|
48
|
+
https://docs.coveo.com/en/headless/latest/reference/interfaces/Search.FieldActionCreators.html#registerfieldstoinclude`)}}}function Y1(e){return e.addReducers({debug:ns,search:fe,configuration:le,fields:Ho}),!0}d();c();l();u();d();c();l();u();var ah=e=>Y({prefix:"analytics/result/open",__legacy__getBuilder:(t,r)=>(Kt(e),t.makeDocumentOpen(dt(e,r),He(e))),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=dt(e,t),n=He(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});function vP(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(ah(t.options.result)))};return tr(e,t,()=>{n(),e.dispatch(Er(t.options.result))})}d();c();l();u();function xP(e,t){return Qg(e,{...t,fetchMoreResultsActionCreator:Sr})}d();c();l();u();d();c();l();u();var J1=new ge({numberOfResults:new ee({min:0})});function AP(e,t={}){if(!X1(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,i=ut(e,J1,t.initialState,"buildResultsPerPage").numberOfResults;return i!==void 0&&n(us(i)),{...r,get state(){return{numberOfResults:o().pagination.numberOfResults}},set(p){n(ls(p))},isSetTo(p){return p===this.state.numberOfResults}}}function X1(e){return e.addReducers({pagination:Ir,configuration:le}),!0}function CP(e,t={}){if(!Z1(e))throw W;let r=AP(e,t),{dispatch:n}=e;return{...r,get state(){return{...r.state}},set(o){r.set(o),n(qt({legacy:Mc(),next:Vc()}))}}}function Z1(e){return e.addReducers({pagination:Ir,configuration:le}),!0}d();c();l();u();d();c();l();u();var zo=()=>Y("analytics/searchbox/submit",e=>e.makeSearchboxSubmit()),ih=()=>({actionCause:"searchboxSubmit"});d();c();l();u();d();c();l();u();var bP={id:z,query:Ue},$c=T("querySet/register",e=>O(e,bP)),mi=T("querySet/update",e=>O(e,bP));d();c();l();u();var Wo=oe(pp(),e=>{e.addCase($c,(t,r)=>tG(t,r.payload)).addCase(mi,(t,r)=>{let{id:n,query:o}=r.payload;Sx(t,n,o)}).addCase(Tn,(t,r)=>{let{id:n,expression:o}=r.payload;Sx(t,n,o)}).addCase(G.fulfilled,(t,r)=>{let{queryExecuted:n}=r.payload;RP(t,n)}).addCase(De,eG).addCase(_e.fulfilled,(t,r)=>{if(r.payload)for(let[n,o]of Object.entries(r.payload.querySet))Sx(t,n,o)})});function eG(e,t){ue(t.payload.q)||RP(e,t.payload.q)}function RP(e,t){Object.keys(e).forEach(r=>{e[r]=t})}var Sx=(e,t,r)=>{t in e&&(e[t]=r)},tG=(e,t)=>{let{id:r,query:n}=t;r in e||(e[r]=n)};d();c();l();u();var sh=e=>Y("analytics/querySuggest",(t,r)=>{let n=vx(r,e);return t.makeOmniboxAnalytics(n)}),wP=()=>({actionCause:"omniboxAnalytics"});function vx(e,t){let{id:r,suggestion:n}=t,o=e.querySuggest?.[r];if(!o)throw new Error(`Unable to determine the query suggest analytics metadata to send because no query suggest with id "${r}" was found. Please check the sent #id.`);let a=o.completions.map(m=>m.expression),i=o.partialQueries.length-1,p=o.partialQueries[i]||"",f=o.responseId;return{suggestionRanking:a.indexOf(n),partialQuery:p,partialQueries:o.partialQueries,suggestions:a,querySuggestResponseId:f}}d();c();l();u();d();c();l();u();function FP(e,t){let r=t.id;r in e||(e[r]=rG(t))}function EP(e,t){let r=e[t.meta.arg.id];r&&(r.currentRequestId=t.meta.requestId,r.isLoading=!0)}function IP(e,t){let r=e[t.meta.arg.id];r&&(r.error=t.payload||null,r.isLoading=!1)}function TP(e,t){let r=e[t.id];r&&(r.responseId="",r.completions=[],r.partialQueries=[])}function rG(e){return{id:"",completions:[],responseId:"",count:5,currentRequestId:"",error:null,partialQueries:[],isLoading:!1,...e}}d();c();l();u();var PP=()=>({});var Hc=oe(PP(),e=>e.addCase(Fc,(t,r)=>{FP(t,r.payload)}).addCase(uT,(t,r)=>{delete t[r.payload.id]}).addCase(Go.pending,EP).addCase(Go.fulfilled,(t,r)=>{let n=t[r.meta.arg.id];if(!n||r.meta.requestId!==n.currentRequestId)return;let{q:o}=r.payload;o&&n.partialQueries.push(o.replace(/;/,encodeURIComponent(";"))),n.responseId=r.payload.responseId,n.completions=r.payload.completions,n.isLoading=!1,n.error=null}).addCase(Go.rejected,IP).addCase(Bo,(t,r)=>{TP(t,r.payload)}).addCase(Cs,(t,r)=>{Object.keys(t).forEach(n=>{let o=t[n];o&&(o.error=r.payload,o.isLoading=!1)})}));d();c();l();u();var ch={enableQuerySyntax:!1,numberOfSuggestions:5,clearFilters:!0},xx={open:new M,close:new M},Ax={id:z,numberOfSuggestions:new ee({min:0}),enableQuerySyntax:new ce,highlightOptions:new J({values:{notMatchDelimiters:new J({values:xx}),exactMatchDelimiters:new J({values:xx}),correctionDelimiters:new J({values:xx})}}),clearFilters:new ce},kP=new ge(Ax);function OP(e,t){if(!oG(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state,a=t.options?.id||oo("search_box"),i={id:a,highlightOptions:{...t.options?.highlightOptions},...ch,...t.options};Be(e,kP,i,"buildSearchBox"),n($c({id:a,query:e.state.query.q})),i.numberOfSuggestions&&n(Fc({id:a,count:i.numberOfSuggestions})),i.enableQuerySyntax&&n(Dt({enableQuerySyntax:i.enableQuerySyntax}));let p=()=>e.state.querySet[i.id],f=/*#__PURE__*/function(){var _ref81=_asyncToGenerator(function*(m){let{enableQuerySyntax:h,clearFilters:S}=i;n(xs({q:p(),enableQuerySyntax:h,clearFilters:S})),t.isNextAnalyticsReady?n(t.executeSearchActionCreator(m)):n(t.executeSearchActionCreator(m.legacy))});return function f(_x178){return _ref81.apply(this,arguments)}}();return{...r,updateText(m){n(mi({id:a,query:m})),this.showSuggestions()},clear(){n(mi({id:a,query:""})),n(Bo({id:a}))},showSuggestions(){i.numberOfSuggestions&&n(t.fetchQuerySuggestionsActionCreator({id:a}))},selectSuggestion(m){n(Tn({id:a,expression:m})),f({legacy:sh({id:a,suggestion:m}),next:wP()}).then(()=>{n(Bo({id:a}))})},submit(m=zo(),h){f({legacy:m,next:h}),n(Bo({id:a}))},get state(){let m=o(),h=m.querySuggest[i.id],S=nG(h,i.highlightOptions),v=h?h.isLoading:!1;return{searchBoxId:a,value:p(),suggestions:S,isLoading:m.search.isLoading,isLoadingSuggestions:v}}}}function nG(e,t){return e?e.completions.map(r=>({highlightedValue:Bh(r.highlighted,t),rawValue:r.expression})):[]}function oG(e){return e.addReducers({query:Ct,querySuggest:Hc,configuration:le,querySet:Wo,search:fe}),!0}function uh(e,t={}){let r=OP(e,{...t,executeSearchActionCreator:G,fetchQuerySuggestionsActionCreator:Go,isNextAnalyticsReady:!0});return{...r,submit(){r.submit(zo(),ih())},get state(){return r.state}}}d();c();l();u();d();c();l();u();d();c();l();u();var zc=()=>Y("analytics/sort/results",(e,t)=>e.makeResultsSort({resultsSortBy:t.sortCriteria||fr()})),lh=()=>({actionCause:"resultsSort"});function _P(e,t){return e.q!==t.q?zo():e.sortCriteria!==t.sortCriteria?zc():e.firstResult!==t.firstResult?jc():e.numberOfResults!==t.numberOfResults?Mc():Tr(e.f,t.f)?Nl(e.f,t.f):Tr(e.fExcluded,t.fExcluded)?Nl(e.fExcluded,t.fExcluded,!0):Tr(e.cf,t.cf)?Nl(e.cf,t.cf):Tr(e.af,t.af)?Nl(e.af,t.af):Tr(e.nf,t.nf)?NP(e.nf,t.nf):Tr(e.df,t.df)?NP(e.df,t.df):mo()}function Nl(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),a=n.filter(v=>!o.includes(v));if(a.length){let v=a[0];switch(!0){case e[v].length>1:return vt(v);case r:return Kn({facetId:v,facetValue:e[v][0]});default:return Lr({facetId:v,facetValue:e[v][0]})}}let i=o.filter(v=>!n.includes(v));if(i.length){let v=i[0];return r?cr({facetId:v,facetValue:t[v][0]}):ot({facetId:v,facetValue:t[v][0]})}let p=o.find(v=>t[v].filter(g=>e[v].includes(g)));if(!p)return mo();let f=e[p],m=t[p],h=m.filter(v=>!f.includes(v));if(h.length)return r?cr({facetId:p,facetValue:h[0]}):ot({facetId:p,facetValue:h[0]});let S=f.filter(v=>!m.includes(v));return S.length?r?Kn({facetId:p,facetValue:S[0]}):Lr({facetId:p,facetValue:S[0]}):mo()}function NP(e={},t={}){return Nl(Kc(e),Kc(t))}function DP(e,t){return e.q!==t.q?ih():e.sortCriteria!==t.sortCriteria?lh():Tr(e.f,t.f)?Wc(e.f,t.f):Tr(e.fExcluded,t.fExcluded)?Wc(e.fExcluded,t.fExcluded,!0):Tr(e.cf,t.cf)?Wc(e.cf,t.cf):Tr(e.af,t.af)?Wc(e.af,t.af):Tr(e.nf,t.nf)?Wc(Kc(e.nf),Kc(t.nf)):Tr(e.df,t.df)?Wc(Kc(e.df),Kc(t.df)):Xi()}function Tr(e={},t={}){return JSON.stringify(e)!==JSON.stringify(t)}function Wc(e={},t={},r=!1){let n=Object.keys(e),o=Object.keys(t),a=n.filter(v=>!o.includes(v));if(a.length){let v=a[0];return e[v].length>1?Vt():Jn()}if(o.filter(v=>!n.includes(v)).length)return r?Yn():mt();let p=o.find(v=>t[v].filter(g=>e[v].includes(g)));if(!p)return Xi();let f=e[p],m=t[p];return m.filter(v=>!f.includes(v)).length?r?Yn():mt():f.filter(v=>!m.includes(v)).length?Jn():Xi()}function Kc(e={}){let t={};return Object.keys(e).forEach(r=>{t[r]=e[r].map(n=>`${n.start}..${n.end}`)}),t}d();c();l();u();d();c();l();u();function qP(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{q:n}:{}}function MP(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{sortCriteria:n}:{}}function dh(e,t,r,n){if(e===void 0)return{};let o=Object.entries(e).filter(([a])=>t(a)).map(([a,{request:i}])=>{let p=r(i);return p.length?{[a]:p}:{}}).reduce((a,i)=>({...a,...i}),{});return Object.keys(o).length?{[n]:o}:{}}function jP(e,t,r){if(e===void 0)return{};let n=t(e);return n!==r?{tab:n}:{}}d();c();l();u();function VP(e){return{q:lt().q,enableQuerySyntax:lt().enableQuerySyntax,aq:e.advancedSearchQueries?.defaultFilters.aq??_r().defaultFilters.aq,cq:e.advancedSearchQueries?.defaultFilters.cq??_r().defaultFilters.cq,firstResult:hr().firstResult,numberOfResults:e.pagination?.defaultNumberOfResults??hr().defaultNumberOfResults,sortCriteria:fr(),f:{},fExcluded:{},cf:{},nf:{},df:{},debug:yo(),sf:{},tab:"",af:{},mnf:{}}}var aG=new ge({parameters:new J({options:{required:!0},values:Xd})});function QP(e,t){let{dispatch:r}=e,n=ne(e);ut(e,aG,t.initialState,"buildSearchParameterManager");let o=LP(e.state.tabSet,t.initialState.parameters);return r(De(o)),{...n,synchronize(a){let i=LP(e.state.tabSet,ph(e,a));r(De(i))},get state(){return{parameters:Cx(e)}}}}function ph(e,t){return{...VP(e.state),...t}}function LP(e,t){if(ue(t.tab)||!e)return t;if(t.tab==="")return{...t,tab:UP(e)};if(!Object.values(e).some(n=>n.id===t.tab)){let n=Object.values(e).find(o=>o.isActive);return{...t,tab:n?.id??UP(e)}}return t}function UP(e){return Object.keys(e)[0]??""}function Cx(e){let t=e.state;return{...qP(t.query,r=>r.q,lt().q),...jP(t.tabSet,r=>{let n=Object.values(r??{}).find(o=>o.isActive);return n?n.id:Object.keys(r??{})[0]},t.tabSet?Object.keys(t.tabSet)[0]:""),...MP(t.sortCriteria,r=>r,fr()),...sG(t),...cG(t),...uG(t),...lG(t),...dG(t)}}function iG(e){let t=e.tabSet;return t?Object.values(t).find(n=>n.isActive)?.id:void 0}function fh(e){let t=iG(e);return r=>{let n=e.facetOptions?.facets[r],o=n?.enabled??!0,a=er(n?.tabs,t);return o&&a}}function BP(e){return e.currentValues.filter(t=>t.state==="selected")}function sG(e){let t=e.facetSet;if(t===void 0)return{};let r=fh(e),n={},o={};for(let[a,{request:i}]of Object.entries(t)){if(!r(a))continue;let p=i.currentValues.filter(m=>m.state==="selected").map(m=>m.value),f=i.currentValues.filter(m=>m.state==="excluded").map(m=>m.value);p.length&&(n[a]=p),f.length&&(o[a]=f)}return{...(Object.keys(n).length?{f:n}:{}),...(Object.keys(o).length?{fExcluded:o}:{})}}function cG(e){return dh(e.categoryFacetSet,fh(e),t=>or(t.currentValues).map(r=>r.value),"cf")}function uG(e){return dh(e.numericFacetSet,fh(e),BP,"nf")}function lG(e){return dh(e.dateFacetSet,fh(e),BP,"df")}function dG(e){let t=e.automaticFacetSet?.set;if(t===void 0)return{};let r=Object.entries(t).map(([n,{response:o}])=>{let a=pG(o);return a.length?{[n]:a}:{}}).reduce((n,o)=>({...n,...o}),{});return Object.keys(r).length?{af:r}:{}}function pG(e){return e.values.filter(t=>t.state==="selected").map(t=>t.value)}function mh(e,t){let{dispatch:r}=e,n=QP(e,t);return{...n,synchronize(o){let a=GP(e),i=ph(e,a),p=ph(e,o);Pl(i,p)||(n.synchronize(o),r(G({legacy:_P(i,p),next:DP(i,p)})))},get state(){return{parameters:GP(e)}}}}function GP(e){let t=e.state;return{...Cx(e),...fG(t),...mG(t),...gG(t),...hG(t),...yG(t),...xG(t),...SG(t)}}function fG(e){if(e.query===void 0)return{};let t=e.query.enableQuerySyntax;return t!==void 0&&t!==lt().enableQuerySyntax?{enableQuerySyntax:t}:{}}function mG(e){if(e.advancedSearchQueries===void 0)return{};let{aq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.aq?{aq:t}:{}}function gG(e){if(e.advancedSearchQueries===void 0)return{};let{cq:t,defaultFilters:r}=e.advancedSearchQueries;return t!==r.cq?{cq:t}:{}}function hG(e){if(e.pagination===void 0)return{};let t=e.pagination.firstResult;return t!==hr().firstResult?{firstResult:t}:{}}function yG(e){if(e.pagination===void 0)return{};let{numberOfResults:t,defaultNumberOfResults:r}=e.pagination;return t!==r?{numberOfResults:t}:{}}function SG(e){if(e.staticFilterSet===void 0)return{};let t=Object.entries(e.staticFilterSet).map(([r,n])=>{let o=vG(n.values);return o.length?{[r]:o}:{}}).reduce((r,n)=>({...r,...n}),{});return Object.keys(t).length?{sf:t}:{}}function vG(e){return e.filter(t=>t.state==="selected").map(t=>t.caption)}function xG(e){if(e.debug===void 0)return{};let t=e.debug;return t!==yo()?{debug:t}:{}}d();c();l();u();function $P(e){return Tc(e)}d();c();l();u();d();c();l();u();d();c();l();u();var gh=()=>new J({values:{questionAnswerId:z},options:{required:!0}}),bx=()=>new J({values:{linkText:Ue,linkURL:Ue},options:{required:!0}});function Yc(e){return O(e,gh())}d();c();l();u();function st(e,t){let r=t??e.search?.questionAnswer?.documentId;return r&&e.search&&wR(e,r.contentIdKey,r.contentIdValue)}function Ur(e,t){let r=e.questionAnswering?.relatedQuestions.findIndex(o=>o.questionAnswerId===t)??-1;return r===-1?null:e.search?.questionAnswer?.relatedQuestions?.[r]??null}var Rx=()=>Y({prefix:"analytics/smartSnippet/expand",__legacy__getBuilder:e=>e.makeExpandSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=st(e),r=He(t),n=e.search?.response.searchUid;if(n)return{action:"expand",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),wx=()=>Y({prefix:"analytics/smartSnippet/collapse",__legacy__getBuilder:e=>e.makeCollapseSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=st(e),r=He(t),n=e.search?.response.searchUid;if(n)return{action:"collapse",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),Fx=()=>Y({prefix:"analytics/smartSnippet/like",__legacy__getBuilder:e=>e.makeLikeSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=st(e),r=He(t),n=e.search?.response.searchUid;if(n)return{action:"like",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),Ex=()=>Y({prefix:"analytics/smartSnippet/dislike",__legacy__getBuilder:e=>e.makeDislikeSmartSnippet(),analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:e=>{let t=st(e),r=He(t),n=e.search?.response.searchUid;if(n)return{action:"dislike",snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),Ix=()=>Y({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(e,t)=>{let r=st(t);return e.makeOpenSmartSnippetSource(dt(r,t),He(r))},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:e=>{let t=st(e),r=He(t),n=e.search?.response.searchUid;if(n)return{snippetType:"SmartSnippet",responseId:n,itemMetadata:{uniqueFieldName:r.contentIDKey,uniqueFieldValue:r.contentIDValue,title:t.title,url:t.clickUri}}}}),_l=e=>Y({prefix:"analytics/smartSnippet/source/open",__legacy__getBuilder:(t,r)=>{O(e,bx());let n=st(r);return n?t.makeOpenSmartSnippetInlineLink(dt(n,r),{...He(n),...e}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=st(t),n=He(r),o=t.search?.response.searchUid;if(o)return{snippetType:"SmartSnippet",responseId:o,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri}}}}),Tx=()=>Y("analytics/smartSnippet/feedbackModal/open",e=>e.makeOpenSmartSnippetFeedbackModal()),Px=()=>Y("analytics/smartSnippet/feedbackModal/close",e=>e.makeCloseSmartSnippetFeedbackModal()),AG={does_not_answer:"doesNotAnswer",partially_answers:"partiallyAnswers",was_not_a_question:"wasNotAQuestion"},kx=e=>Y({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:t=>t.makeSmartSnippetFeedbackReason(e),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=st(t),n=He(r),o=t.search?.response.searchUid;if(o)return{responseId:o,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:AG[e]}}}),Ox=e=>Y({prefix:"analytics/smartSnippet/sendFeedback",__legacy__getBuilder:t=>t.makeSmartSnippetFeedbackReason("other",e),analyticsType:"SmartSnippets.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=st(t),n=He(r),o=t.search?.response.searchUid;if(o)return{responseId:o,snippetType:"SmartSnippet",itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.title,url:r.clickUri},reason:"other",additionalNotes:e}}}),Nx=e=>Y({prefix:"analytics/smartSnippetSuggestion/expand",__legacy__getBuilder:(t,r)=>{Yc(e);let n=Ur(r,e.questionAnswerId);return n?t.makeExpandSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Ur(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=st(t,r.documentId);return{action:"expand",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),_x=e=>Y({prefix:"analytics/smartSnippetSuggestion/collapse",__legacy__getBuilder:(t,r)=>{Yc(e);let n=Ur(r,e.questionAnswerId);return n?t.makeCollapseSmartSnippetSuggestion({question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.AnswerAction",analyticsPayloadBuilder:t=>{let r=Ur(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=st(t,r.documentId);return{action:"collapse",responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),Dl=e=>Y({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(t,r)=>{O(e,gh());let n=Ur(r,e.questionAnswerId);if(!n)return null;let o=st(r,n.documentId);return o?t.makeOpenSmartSnippetSuggestionSource(dt(o,r),{question:n.question,answerSnippet:n.answerSnippet,documentId:n.documentId}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:t=>{let r=Ur(t,e.questionAnswerId),n=t.search?.response.searchUid;if(n&&r){let o=st(t,r.documentId);return{responseId:n,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:r.documentId.contentIdKey,uniqueFieldValue:r.documentId.contentIdValue,title:o?.title,url:o?.clickUri}}}}}),hh=(e,t)=>Y({prefix:"analytics/smartSnippetSuggestion/source/open",__legacy__getBuilder:(r,n)=>{O(e,gh()),O(t,bx());let o=Ur(n,e.questionAnswerId);if(!o)return null;let a=st(n,o.documentId);return a?r.makeOpenSmartSnippetSuggestionInlineLink(dt(a,n),{question:o.question,answerSnippet:o.answerSnippet,documentId:o.documentId,linkText:t.linkText,linkURL:t.linkURL}):null},analyticsType:"SmartSnippets.SourceClick",analyticsPayloadBuilder:r=>{let n=Ur(r,e.questionAnswerId),o=r.search?.response.searchUid;if(o&&n){let a=st(r,n.documentId);return{responseId:o,snippetType:"SmartSnippetSuggestion",itemMetadata:{uniqueFieldName:n.documentId.contentIdKey,uniqueFieldValue:n.documentId.contentIdValue,title:a?.title,url:a?.clickUri}}}}}),yh={logExpandSmartSnippet:Rx,logCollapseSmartSnippet:wx,logLikeSmartSnippet:Fx,logDislikeSmartSnippet:Ex,logOpenSmartSnippetSource:Ix,logOpenSmartSnippetInlineLink:_l,logOpenSmartSnippetFeedbackModal:Tx,logCloseSmartSnippetFeedbackModal:Px,logSmartSnippetFeedback:kx,logSmartSnippetDetailedFeedback:Ox,logExpandSmartSnippetSuggestion:Nx,logCollapseSmartSnippetSuggestion:_x,logOpenSmartSnippetSuggestionSource:Dl};d();c();l();u();d();c();l();u();var Jc=T("smartSnippet/expand"),Xc=T("smartSnippet/collapse"),Zc=T("smartSnippet/like"),eu=T("smartSnippet/dislike"),tu=T("smartSnippet/feedbackModal/open"),Ko=T("smartSnippet/feedbackModal/close"),ru=T("smartSnippet/related/expand",e=>Yc(e)),nu=T("smartSnippet/related/collapse",e=>Yc(e));d();c();l();u();d();c();l();u();var Dx=()=>({liked:!1,disliked:!1,expanded:!1,feedbackModalOpen:!1,relatedQuestions:[]});var HP=(e,t)=>e.findIndex(r=>r.questionAnswerId===t.questionAnswerId);function zP({question:e,answerSnippet:t,documentId:{contentIdKey:r,contentIdValue:n}}){return bi({question:e,answerSnippet:t,contentIdKey:r,contentIdValue:n})}function CG(e,t){let r=zP(e);return t&&r===t.questionAnswerId?t:{contentIdKey:e.documentId.contentIdKey,contentIdValue:e.documentId.contentIdValue,expanded:!1,questionAnswerId:r}}var kn=oe(Dx(),e=>e.addCase(Jc,t=>{t.expanded=!0}).addCase(Xc,t=>{t.expanded=!1}).addCase(Zc,t=>{t.liked=!0,t.disliked=!1,t.feedbackModalOpen=!1}).addCase(eu,t=>{t.liked=!1,t.disliked=!0}).addCase(tu,t=>{t.feedbackModalOpen=!0}).addCase(Ko,t=>{t.feedbackModalOpen=!1}).addCase(G.fulfilled,(t,r)=>{let n=r.payload.response.questionAnswer.relatedQuestions.map((a,i)=>CG(a,t.relatedQuestions[i])),o=zP(r.payload.response.questionAnswer);return t.questionAnswerId===o?{...t,relatedQuestions:n}:{...Dx(),relatedQuestions:n,questionAnswerId:o}}).addCase(ru,(t,r)=>{let n=HP(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!0)}).addCase(nu,(t,r)=>{let n=HP(t.relatedQuestions,r.payload);n!==-1&&(t.relatedQuestions[n].expanded=!1)}));function WP(e,t,r){if(!bG(e))throw W;let n=ne(e),o=()=>e.state,a=()=>st(o()),i=null,p=tr(e,{options:{selectionDelay:r?.options?.selectionDelay}},()=>{let f=a();if(!f){i=null;return}let{searchResponseId:m}=o().search;i!==m&&(i=m,e.dispatch(t.logOpenSmartSnippetSource()),e.dispatch(Er(f)))});return{...n,get state(){let f=o();return{question:f.search.questionAnswer.question,answer:f.search.questionAnswer.answerSnippet,documentId:f.search.questionAnswer.documentId,expanded:f.questionAnswering.expanded,answerFound:f.search.questionAnswer.answerSnippet!=="",liked:f.questionAnswering.liked,disliked:f.questionAnswering.disliked,feedbackModalOpen:f.questionAnswering.feedbackModalOpen,source:a()}},expand(){e.dispatch(t.logExpandSmartSnippet()),e.dispatch(Jc())},collapse(){e.dispatch(t.logCollapseSmartSnippet()),e.dispatch(Xc())},like(){e.dispatch(t.logLikeSmartSnippet()),e.dispatch(Zc())},dislike(){e.dispatch(t.logDislikeSmartSnippet()),e.dispatch(eu())},openFeedbackModal(){e.dispatch(t.logOpenSmartSnippetFeedbackModal()),e.dispatch(tu())},closeFeedbackModal(){e.dispatch(t.logCloseSmartSnippetFeedbackModal()),e.dispatch(Ko())},sendFeedback(f){e.dispatch(t.logSmartSnippetFeedback(f)),e.dispatch(Ko())},sendDetailedFeedback(f){e.dispatch(t.logSmartSnippetDetailedFeedback(f)),e.dispatch(Ko())},selectSource(){p.select()},beginDelayedSelectSource(){p.beginDelayedSelect()},cancelPendingSelectSource(){p.cancelPendingSelect()}}}function bG(e){return e.addReducers({search:fe,questionAnswering:kn}),!0}d();c();l();u();function Sh(e,t){if(!RG(e))throw W;let r=()=>e.state,n=new Set,o=h=>n.has(h)?!0:(n.add(h),!1),a=null,i=h=>{a!==h&&(a=h,f={},n.clear())},p=(h,S,v)=>tr(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{o(S)||e.dispatch(v?hh({questionAnswerId:v},h):_l(h))}),f={},m=(h,S)=>{let{searchResponseId:v}=r().search;i(v);let g=bi({...h,questionAnswerId:S});return g in f||(f[g]=p(h,g,S)),f[g]};return{selectInlineLink(h,S){m(h,S)?.select()},beginDelayedSelectInlineLink(h,S){m(h,S)?.beginDelayedSelect()},cancelPendingSelectInlineLink(h,S){m(h,S)?.cancelPendingSelect()}}}function RG(e){return e.addReducers({search:fe,questionAnswering:kn}),!0}function KP(e,t){Do(e.state.configuration.analytics.analyticsMode);let r=WP(e,yh,t),n=Sh(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectInlineLink(o){n.selectInlineLink(o)},beginDelayedSelectInlineLink(o){n.beginDelayedSelectInlineLink(o)},cancelPendingSelectInlineLink(o){n.cancelPendingSelectInlineLink(o)}}}d();c();l();u();d();c();l();u();function YP(e,t){if(!wG(e))throw W;let r=ne(e),n=()=>e.state,o=a=>{let{contentIdKey:i,contentIdValue:p}=a;return e.state.search.results.find(f=>Eo(f,i)===p)};return{...r,get state(){let a=n();return{questions:a.search.questionAnswer.relatedQuestions.map((i,p)=>({question:i.question,answer:i.answerSnippet,documentId:i.documentId,questionAnswerId:a.questionAnswering.relatedQuestions[p].questionAnswerId,expanded:a.questionAnswering.relatedQuestions[p].expanded,source:o(i.documentId)}))}},expand(a){let i={questionAnswerId:a};e.dispatch(t.logExpandSmartSnippetSuggestion(i)),e.dispatch(ru(i))},collapse(a){let i={questionAnswerId:a};e.dispatch(t.logCollapseSmartSnippetSuggestion(i)),e.dispatch(nu(i))}}}function wG(e){return e.addReducers({search:fe,questionAnswering:kn}),!0}d();c();l();u();function JP(e,t){if(!FG(e))throw W;let r=()=>e.state,n=S=>{let v=r(),g=Ur(v,S);return g?st(v,g.documentId):null},o=new Set,a=S=>o.has(S)?!0:(o.add(S),!1),i=null,p=S=>{i!==S&&(i=S,m={},o.clear())},f=(S,v)=>tr(e,{options:{selectionDelay:t?.options?.selectionDelay}},()=>{a(v)||(e.dispatch(Dl({questionAnswerId:v})),e.dispatch(Er(S)))}),m={},h=S=>{let{searchResponseId:v}=r().search;p(v);let g=n(S);return g?(S in m||(m[S]=f(g,S)),m[S]):null};return{selectSource(S){h(S)?.select()},beginDelayedSelectSource(S){h(S)?.beginDelayedSelect()},cancelPendingSelectSource(S){h(S)?.cancelPendingSelect()}}}function FG(e){return e.addReducers({search:fe,questionAnswering:kn}),!0}function XP(e,t){Do(e.state.configuration.analytics.analyticsMode);let r=YP(e,yh),n=Sh(e,{options:{selectionDelay:t?.options?.selectionDelay}}),o=JP(e,{options:{selectionDelay:t?.options?.selectionDelay}});return{...r,get state(){return r.state},selectSource(a){o.selectSource(a)},beginDelayedSelectSource(a){o.beginDelayedSelectSource(a)},cancelPendingSelectSource(a){o.cancelPendingSelectSource(a)},selectInlineLink(a,i){n.selectInlineLink(i,a)},beginDelayedSelectInlineLink(a,i){n.beginDelayedSelectInlineLink(i,a)},cancelPendingSelectInlineLink(a,i){n.cancelPendingSelectInlineLink(i,a)}}}d();c();l();u();d();c();l();u();d();c();l();u();var ZP={by:new Su({enum:la,required:!0})},ou=T("sortCriteria/register",e=>ek(e)),au=T("sortCriteria/update",e=>ek(e)),ek=e=>Ci(e)?(e.forEach(t=>O(t,ZP)),{payload:e}):O(e,ZP);d();c();l();u();var vh=oe(fr(),e=>{e.addCase(ou,(t,r)=>Hr(r.payload)).addCase(au,(t,r)=>Hr(r.payload)).addCase(_e.fulfilled,(t,r)=>r.payload?.sortCriteria??t).addCase(De,(t,r)=>r.payload.sortCriteria??t)});function EG(e,t){if(!t)return;let r=new ge({criterion:new ae({each:bb})}),n=IG(t),o={...t,criterion:n};ut(e,r,o,"buildSort")}function IG(e){return e.criterion?Ci(e.criterion)?e.criterion:[e.criterion]:[]}function tk(e,t){if(!TG(e))throw W;let r=ne(e),{dispatch:n}=e,o=()=>e.state;EG(e,t.initialState);let a=t.initialState?.criterion;return a&&n(ou(a)),{...r,sortBy(i){n(au(i)),n(Yr(1))},isSortedBy(i){return this.state.sortCriteria===Hr(i)},get state(){return{sortCriteria:o().sortCriteria}}}}function TG(e){return e.addReducers({configuration:le,sortCriteria:vh}),!0}function rk(e,t={}){let{dispatch:r}=e,n=tk(e,t),o=()=>r(G({legacy:zc(),next:lh()}));return{...n,get state(){return n.state},sortBy(a){n.sortBy(a),o()}}}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function nk(e){return e.type==="redirect"}var xh=class{constructor(t){this.response=t}get basicExpression(){return this.response.parsedInput.basicExpression}get largeExpression(){return this.response.parsedInput.largeExpression}get redirectionUrl(){let t=this.response.preprocessingOutput.triggers.filter(nk);return t.length?t[0].content:null}};var iu=T("standaloneSearchBox/register",e=>O(e,{id:z,redirectionUrl:z,overwrite:new ce({required:!1})})),su=T("standaloneSearchBox/updateRedirectionUrl",e=>O(e,{id:z,redirectionUrl:z})),cu=T("standaloneSearchBox/reset",e=>O(e,{id:z})),uu=T("standaloneSearchBox/updateAnalyticsToSearchFromLink",e=>O(e,{id:z})),lu=T("standaloneSearchBox/updateAnalyticsToOmniboxFromLink"),Yo=Se("standaloneSearchBox/fetchRedirect",/*#__PURE__*/function(){var _ref82=_asyncToGenerator(function*(e,{dispatch:t,getState:r,rejectWithValue:n,extra:{apiClient:o,validatePayload:a,navigatorContext:i}}){a(e,{id:new M({emptyAllowed:!1})});let p=yield kG(r(),i),f=yield o.plan(p);if(ht(f))return n(f.error);let{redirectionUrl:m}=new xh(f.success);return m&&t(PG(m)),m||""});return function(_x179,_x180){return _ref82.apply(this,arguments)}}()),PG=e=>Y("analytics/standaloneSearchBox/redirect",t=>t.makeTriggerRedirect({redirectedTo:e})),kG=/*#__PURE__*/function(){var _ref83=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??ct(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,timezone:e.configuration.search.timezone,q:e.query.q,...(e.context&&{context:e.context.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.configuration.analytics.enabled&&e.configuration.analytics.analyticsMode==="legacy"?yield gs(e.configuration.analytics):Ln(e.configuration.analytics,t)),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function kG(_x181,_x182){return _ref83.apply(this,arguments)}}();d();c();l();u();d();c();l();u();function ok(){return{}}var Ah=oe(ok(),e=>e.addCase(iu,(t,r)=>{let{id:n,redirectionUrl:o,overwrite:a}=r.payload;!a&&n in t||(t[n]=qx(o))}).addCase(cu,(t,r)=>{let{id:n}=r.payload,o=t[n];if(o){t[n]=qx(o.defaultRedirectionUrl);return}}).addCase(su,(t,r)=>{let{id:n,redirectionUrl:o}=r.payload;n in t&&(t[n]=qx(o))}).addCase(Yo.pending,(t,r)=>{let n=t[r.meta.arg.id];n&&(n.isLoading=!0)}).addCase(Yo.fulfilled,(t,r)=>{let n=r.payload,o=t[r.meta.arg.id];o&&(o.redirectTo=n||o.defaultRedirectionUrl,o.isLoading=!1)}).addCase(Yo.rejected,(t,r)=>{let n=t[r.meta.arg.id];n&&(n.isLoading=!1)}).addCase(uu,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="searchFromLink")}).addCase(lu,(t,r)=>{let n=t[r.payload.id];n&&(n.analytics.cause="omniboxFromLink",n.analytics.metadata=r.payload.metadata)}));function qx(e){return{defaultRedirectionUrl:e,redirectTo:"",isLoading:!1,analytics:{cause:"",metadata:null}}}d();c();l();u();var ak=new ge({...Ax,redirectionUrl:new M({required:!0,emptyAllowed:!1}),overwrite:new ce({required:!1})});function ik(e,t){if(!OG(e))throw W;let{dispatch:r}=e,n=()=>e.state,o=t.options.id||oo("standalone_search_box"),a={id:o,highlightOptions:{...t.options.highlightOptions},...ch,overwrite:!1,...t.options};Be(e,ak,a,"buildStandaloneSearchBox");let i=uh(e,{options:a});return r(iu({id:o,redirectionUrl:a.redirectionUrl,overwrite:a.overwrite})),{...i,updateText(p){i.updateText(p),r(uu({id:o}))},selectSuggestion(p){let f=vx(n(),{id:o,suggestion:p});r(Tn({id:o,expression:p})),r(lu({id:o,metadata:f})),this.submit()},afterRedirection(){r(cu({id:o}))},updateRedirectUrl(p){r(su({id:o,redirectionUrl:p}))},submit(){r(Dt({q:this.state.value,enableQuerySyntax:a.enableQuerySyntax})),r(Yo({id:o}))},get state(){let f=n().standaloneSearchBoxSet[o];return{...i.state,isLoading:f.isLoading,redirectTo:f.redirectTo,analytics:f.analytics}}}}function OG(e){return e.addReducers({standaloneSearchBoxSet:Ah,configuration:le,query:Ct,querySuggest:Hc}),!0}d();c();l();u();d();c();l();u();var Ch=oe(fp(),e=>e.addCase(mc,(t,r)=>{let n=r.payload,{id:o}=n;o in t||(t[o]=n)}).addCase(eo,(t,r)=>{let{id:n,value:o}=r.payload,a=t[n];if(!a)return;let i=a.values.find(f=>f.caption===o.caption);if(!i)return;let p=i.state==="selected";i.state=p?"idle":"selected"}).addCase(to,(t,r)=>{let{id:n,value:o}=r.payload,a=t[n];if(!a)return;let i=a.values.find(f=>f.caption===o.caption);if(!i)return;let p=i.state==="excluded";i.state=p?"idle":"excluded"}).addCase(Lo,(t,r)=>{let n=r.payload,o=t[n];o&&o.values.forEach(a=>{a.state="idle"})}).addCase(pt,t=>{Object.values(t).forEach(r=>{r.values.forEach(n=>{n.state="idle"})})}).addCase(De,(t,r)=>{let n=r.payload.sf||{};Object.entries(t).forEach(([o,a])=>{let i=n[o]||[];a.values.forEach(p=>{p.state=i.includes(p.caption)?"selected":"idle"})})}));d();c();l();u();function Mx(e){return{state:"idle",...e}}var NG=new ge({id:ai,values:tg});function sk(e,t){if(!_G(e))throw W;Be(e,NG,t.options,"buildStaticFilter");let r=ne(e),{dispatch:n}=e,o=()=>e.state,{id:a}=t.options;return n(mc(t.options)),{...r,toggleSelect(i){n(eo({id:a,value:i})),n(G({legacy:bh(a,i)}))},toggleSingleSelect(i){i.state==="idle"&&n(Lo(a)),n(eo({id:a,value:i})),n(G({legacy:bh(a,i)}))},toggleExclude(i){n(to({id:a,value:i})),n(G({legacy:bh(a,i)}))},toggleSingleExclude(i){i.state==="idle"&&n(Lo(a)),n(to({id:a,value:i})),n(G({legacy:bh(a,i)}))},deselectAll(){n(Lo(a)),n(G({legacy:ng({staticFilterId:a})}))},isValueSelected(i){return i.state==="selected"},isValueExcluded(i){return i.state==="excluded"},get state(){let i=o().staticFilterSet[a]?.values||[],p=i.some(f=>f.state!=="idle");return{id:a,values:i,hasActiveValues:p}}}}function _G(e){return e.addReducers({staticFilterSet:Ch}),!0}function bh(e,t){let{caption:r,expression:n,state:o}=t;return(o==="idle"?rg:gc)({staticFilterId:e,staticFilterValue:{caption:r,expression:n}})}d();c();l();u();d();c();l();u();var DG=new ge({expression:Ue,id:z,clearFiltersOnTabChange:new ce}),qG=new ge({isActive:new ce});function ck(e,t){if(jG(t.options.id),!MG(e))throw W;let r=ne(e),{dispatch:n}=e;Be(e,DG,t.options,"buildTab");let o=ut(e,qG,t.initialState,"buildTab"),{id:a,expression:i}=t.options;return n(_s({id:a,expression:i})),Object.keys(e.state.tabSet).length===1&&(o.isActive=!0),o.isActive&&n(gt(a)),{...r,select(){t.options.clearFiltersOnTabChange&&n(xs({q:"",clearFilters:!0})),n(gt(a))},get state(){return{isActive:e.state.tabSet[a]?.isActive}}}}function MG(e){return e.addReducers({configuration:le,tabSet:hc}),!0}function jG(e){let t=Ds().analytics.originLevel2;if(e===t)throw new Error(`The #id option on the Tab controller cannot use the reserved value "${t}". Please specify a different value.`)}function uk(e,t){let{dispatch:r}=e,n=ck(e,t),o=()=>r(G({legacy:mo(),next:Xi()}));return{...n,get state(){return n.state},select(){n.select(),o()}}}d();c();l();u();function lk(e){let t=sg(e);return{...t,get state(){return t.state}}}d();c();l();u();d();c();l();u();d();c();l();u();function dk(e){return e.query="",e.queryModification={originalQuery:"",newQuery:"",queryToIgnore:e.queryModification.queryToIgnore},e}function pk(e,t){let r=[],n=[],o=[],a=[];return t.forEach(i=>{switch(i.type){case"redirect":r.push(i.content);break;case"query":n.push(i.content);break;case"execute":o.push({functionName:i.content.name,params:i.content.params});break;case"notify":a.push(i.content);break}}),e.redirectTo=r[0]??"",e.query=e.queryModification.newQuery,e.executions=o,e.notifications=a,e}function fk(e,t){return e.queryModification={...t,queryToIgnore:""},e}function mk(e,t){return e.queryModification.queryToIgnore=t,e}d();c();l();u();var gk=()=>({redirectTo:"",query:"",executions:[],notifications:[],queryModification:{originalQuery:"",newQuery:"",queryToIgnore:""}});var Jo=oe(gk(),e=>e.addCase(G.pending,dk).addCase(G.fulfilled,(t,r)=>pk(t,r.payload.response.triggers)).addCase(vs,(t,r)=>fk(t,r.payload)).addCase(Co,(t,r)=>mk(t,r.payload)));function hk(e){if(!VG(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state,o=n().triggers.executions;return{...t,subscribe(a){let i=()=>{let p=!di(this.state.executions,o,(f,m)=>f.functionName===m.functionName&&di(f.params,m.params));o=this.state.executions,p&&this.state.executions.length&&(a(),r(vp()))};return i(),e.subscribe(i)},get state(){return{executions:n().triggers.executions}}}}function VG(e){return e.addReducers({triggers:Jo}),!0}d();c();l();u();d();c();l();u();function yk(e,t){let r=t.options.logNotifyTriggerActionCreator;if(!LG(e))throw W;let n=ne(e),{dispatch:o}=e,a=()=>e.state,i=a().triggers.notifications;return{...n,subscribe(p){let f=()=>{let m=!di(i,this.state.notifications);i=this.state.notifications,m&&(p(),o(r()))};return f(),e.subscribe(f)},get state(){return{notifications:a().triggers.notifications}}}}function LG(e){return e.addReducers({triggers:Jo}),!0}function Sk(e){return yk(e,{options:{logNotifyTriggerActionCreator:yp}})}d();c();l();u();function vk(e){if(!UG(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state,o=()=>n().triggers.queryModification.newQuery,a=()=>n().triggers.queryModification.originalQuery;return{...t,get state(){return{newQuery:o(),originalQuery:a(),wasQueryModified:o()!==""}},undo(){r(Co(o())),r(Dt({q:a()})),r(G({legacy:hp({undoneQuery:o()})}))}}}function UG(e){return e.addReducers({triggers:Jo,query:Ct}),!0}d();c();l();u();function xk(e){if(!QG(e))throw W;let t=ne(e),{dispatch:r}=e,n=()=>e.state,o=n().triggers.redirectTo;return{...t,subscribe(a){let i=()=>{let p=o!==this.state.redirectTo;o=this.state.redirectTo,p&&this.state.redirectTo&&(a(),r(Sp()))};return i(),e.subscribe(i)},get state(){return{redirectTo:n().triggers.redirectTo}}}}function QG(e){return e.addReducers({triggers:Jo}),!0}d();c();l();u();d();c();l();u();var Ck="..",jx="...",BG=/^(f|fExcluded|cf|nf|df|sf|af|mnf)-(.+)$/,GG={f:!0,fExcluded:!0,cf:!0,sf:!0,af:!0,nf:!0,df:!0,mnf:!0},Rh="&",ql="=";function Ml(){return{serialize:zG(WG),deserialize:e2}}function jl(e){return e in GG}function $G(e){return e in{q:!0,aq:!0,cq:!0,enableQuerySyntax:!0,firstResult:!0,numberOfResults:!0,sortCriteria:!0,debug:!0,tab:!0}}function HG(e){let r=e in{nf:!0,df:!0,mnf:!0};return jl(e)&&r}function bk(e){return $G(e)||jl(e)}var zG=e=>t=>Object.entries(t).map(e).filter(r=>r).join(Rh);function WG(e){let[t,r]=e;return bk(t)?jl(t)&&!HG(t)?YG(r)?XG(t,r):"":t==="nf"||t==="df"?JG(r)?ZG(t,r):"":KG(t,r):""}function KG(e,t){return`${e}${ql}${encodeURIComponent(t)}`}function YG(e){return Vx(e)?Rk(e,r=>typeof r=="string"):!1}function JG(e){return Vx(e)?Rk(e,r=>Vx(r)&&"start"in r&&"end"in r):!1}function Vx(e){return!!(e&&typeof e=="object")}function Rk(e,t){return Object.entries(e).filter(n=>{let o=n[1];return!Array.isArray(o)||!o.every(t)}).length===0}function XG(e,t){return Object.entries(t).map(([r,n])=>`${e}-${r}${ql}${n.map(o=>encodeURIComponent(o)).join(",")}`).join(Rh)}function ZG(e,t){return Object.entries(t).map(([r,n])=>{let o=n.map(({start:a,end:i,endInclusive:p})=>`${a}${p?jx:Ck}${i}`).join(",");return`${e}-${r}${ql}${o}`}).join(Rh)}function e2(e){return e.split(Rh).map(n=>t2(n)).map(n=>r2(n)).filter(i2).map(n=>s2(n)).reduce((n,o)=>{let[a,i]=o;if(jl(a)){let p={...n[a],...i};return{...n,[a]:p}}return{...n,[a]:i}},{})}function t2(e){let[t,...r]=e.split(ql),n=r.join(ql);return[t,n]}function r2(e,t=BG){let[r,n]=e,o=t.exec(r);if(!o)return e;let a=o[1],i=o[2],p=n.split(","),f=n2(a,p),m={[i]:f};return[a,JSON.stringify(m)]}function n2(e,t){return e==="nf"||e==="mnf"?o2(t,"selected"):e==="df"?a2(t,"selected"):t}function o2(e,t){let r=[];for(let n of e){let{startAsString:o,endAsString:a,isEndInclusive:i}=wk(n),p=parseFloat(o),f=parseFloat(a);!Number.isFinite(p)||!Number.isFinite(f)||r.push(wc({start:p,end:f,state:t,endInclusive:i}))}return r}function Ak(e){try{return Yb(e)?(np(e,hs),!0):Jr(e)?(xo(e),!0):!1}catch{return!1}}function a2(e,t){let r=[];for(let n of e){let{isEndInclusive:o,startAsString:a,endAsString:i}=wk(n);!Ak(a)||!Ak(i)||r.push(Vo({start:a,end:i,state:t,endInclusive:o}))}return r}function i2(e){let t=bk(e[0]),r=e.length===2;return t&&r}function s2(e,t=!0){let[r,n]=e;return r==="enableQuerySyntax"?[r,n==="true"]:r==="debug"?[r,n==="true"]:r==="firstResult"?[r,parseInt(n,10)]:r==="numberOfResults"?[r,parseInt(n,10)]:jl(r)?[r,c2(n)]:[r,t?decodeURIComponent(n):n]}function c2(e){let t=JSON.parse(e),r={};return Object.entries(t).forEach(n=>{let[o,a]=n;r[o]=a.map(i=>Ai(i)?decodeURIComponent(i):i)}),r}function wk(e){let t=e.indexOf(jx)!==-1,[r,n]=e.split(t?jx:Ck);return{isEndInclusive:t,startAsString:r,endAsString:n}}var u2=new ge({fragment:new M});function Fk(e,t){let r;function n(){r=e.state.search.requestId}function o(){return r!==e.state.search.requestId}if(!d2(e))throw W;ut(e,u2,t.initialState,"buildUrlManager");let a=ne(e),i=t.initialState.fragment;n();let p=mh(e,{initialState:{parameters:wh(i)}});return{...a,subscribe(f){let m=()=>{let h=this.state.fragment;!l2(i,h)&&o()&&(i=h,f()),n()};return m(),e.subscribe(m)},get state(){return{fragment:Ml().serialize(p.state.parameters)}},synchronize(f){i=f;let m=wh(f);p.synchronize(m)}}}function l2(e,t){if(e===t)return!0;let r=wh(e),n=wh(t);return Pl(r,n)}function wh(e){return Ml().deserialize(e)}function d2(e){return e.addReducers({configuration:le}),!0}d();c();l();u();d();c();l();u();var Ek=Se("analytics/addPageViewEntry",/*#__PURE__*/function(){var _ref84=_asyncToGenerator(function*(e,{getState:t}){t().configuration.analytics.enabled&&Wt.getInstance().addElement({name:"PageView",value:e,time:JSON.stringify(new Date)})});return function(_x183,_x184){return _ref84.apply(this,arguments)}}());function p2(e){return e.addReducers({}),{addPageViewEntryInActionsHistory:Ek}}d();c();l();u();d();c();l();u();d();c();l();u();var Xo=()=>new M({required:!1,emptyAllowed:!0}),Fh=T("advancedSearchQueries/update",e=>O(e,{aq:Xo(),cq:Xo(),lq:Xo(),dq:Xo()})),Eh=T("advancedSearchQueries/register",e=>O(e,{aq:Xo(),cq:Xo(),lq:Xo(),dq:Xo()}));var Ik=oe(_r(),e=>{e.addCase(Fh,(t,r)=>{let{aq:n,cq:o,lq:a,dq:i}=r.payload;wt(n)||(t.aq=n,t.aqWasSet=!0),wt(o)||(t.cq=o,t.cqWasSet=!0),wt(a)||(t.lq=a,t.lqWasSet=!0),wt(i)||(t.dq=i,t.dqWasSet=!0)}).addCase(Eh,(t,r)=>{let{aq:n,cq:o,lq:a,dq:i}=r.payload;wt(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),wt(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),wt(a)||(t.defaultFilters.lq=a,t.lqWasSet||(t.lq=a)),wt(i)||(t.defaultFilters.dq=i,t.dqWasSet||(t.dq=i))}).addCase(_e.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(De,(t,r)=>{let{aq:n,cq:o}=r.payload;wt(n)||(t.aq=n,t.aqWasSet=!0),wt(o)||(t.cq=o,t.cqWasSet=!0)})});function f2(e){return e.addReducers({advancedSearchQueries:Ik}),{updateAdvancedSearchQueries:Fh,registerAdvancedSearchQueries:Eh}}d();c();l();u();function m2(e){return e.addReducers({}),{logDocumentOpen:ah,logOpenSmartSnippetSource:Ix,logOpenSmartSnippetSuggestionSource:Dl,logOpenSmartSnippetInlineLink:_l,logOpenSmartSnippetSuggestionInlineLink:hh}}d();c();l();u();function g2(e){return e.addReducers({}),{logSearchEvent:Mb,logClickEvent:jb,logCustomEvent:Vb}}d();c();l();u();function h2(e){return e.addReducers({}),{logClearBreadcrumbs:Mm,logInterfaceLoad:Hd,logSearchFromLink:zd,logOmniboxFromLink:Wd,logInterfaceChange:mo,logDidYouMeanClick:sp,logCategoryFacetBreadcrumb:Im,logFacetBreadcrumb:pc,logFacetClearAll:vt,logFacetUnexclude:Kn,logFacetExclude:cr,logFacetDeselect:Lr,logFacetSelect:ot,logFacetShowLess:dc,logFacetShowMore:lc,logFacetUpdateSort:Sn,logDateFacetBreadcrumb:bl,logNumericFacetBreadcrumb:Rl,logNavigateBackward:$g,logNavigateForward:Gg,logPageNext:Zg,logPageNumber:jc,logPagePrevious:eh,logPagerResize:Mc,logSearchboxSubmit:zo,logQuerySuggestionClick:sh,logResultsSort:zc,logDislikeSmartSnippet:Ex,logLikeSmartSnippet:Fx,logOpenSmartSnippetFeedbackModal:Tx,logCloseSmartSnippetFeedbackModal:Px,logSmartSnippetFeedback:kx,logSmartSnippetDetailedFeedback:Ox,logExpandSmartSnippet:Rx,logCollapseSmartSnippet:wx,logExpandSmartSnippetSuggestion:Nx,logCollapseSmartSnippetSuggestion:_x,logNoResultsBack:Hg,logStaticFilterSelect:rg,logStaticFilterDeselect:gc,logStaticFilterClearAll:ng,logTriggerQuery:gp,logUndoTriggerQuery:hp,logNotifyTrigger:yp,logTriggerRedirect:Sp,logTriggerExecute:vp}}d();c();l();u();function y2(e){return e.addReducers({}),{deselectAllBreadcrumbs:pt,deselectAllNonBreadcrumbs:is}}d();c();l();u();function S2(e){return e.addReducers({configuration:le}),{disableAnalytics:Zi,enableAnalytics:es,setOriginLevel2:Kd,setOriginLevel3:Yd,updateAnalyticsConfiguration:go,updateBasicConfiguration:zr}}d();c();l();u();function v2(e){return e.addReducers({configuration:le,pipeline:as,searchHub:Rs}),{updateSearchConfiguration:mr}}d();c();l();u();function x2(e){return e.addReducers({context:ag}),{addContext:si,removeContext:ci,setContext:ii}}d();c();l();u();function A2(e){return e.addReducers({debug:ns}),{disableDebug:rs,enableDebug:ho}}d();c();l();u();function C2(e){return e.addReducers({dictionaryFieldContext:cg}),{addContext:Sc,removeContext:vc,setContext:yc}}d();c();l();u();function b2(e){return e.addReducers({didYouMean:lg,query:Ct}),{applyDidYouMeanCorrection:gr,disableDidYouMean:ap,enableDidYouMean:ys,enableAutomaticQueryCorrection:ip,disableAutomaticQueryCorrection:Ss,setCorrectionMode:fa}}d();c();l();u();d();c();l();u();d();c();l();u();var Ih=T("excerptLength/set",e=>O(e,new ee({min:0,required:!0})));d();c();l();u();function Tk(){return{length:void 0}}var Pk=oe(Tk(),e=>{e.addCase(Ih,(t,r)=>{t.length=r.payload})});function R2(e){return e.addReducers({excerptLength:Pk}),{setExcerptLength:Ih}}d();c();l();u();function w2(e){return e.addReducers({facetOptions:xt}),{updateFacetOptions:be,enableFacet:jt,disableFacet:Je}}d();c();l();u();function F2(e){return e.addReducers({automaticFacetSet:dg}),{setOptions:ec,deselectAllAutomaticFacetValues:tc,toggleSelectAutomaticFacetValue:sn}}d();c();l();u();function E2(e){return e.addReducers({categoryFacetSet:ln}),{deselectAllCategoryFacetValues:un,registerCategoryFacet:cn,toggleSelectCategoryFacetValue:Mo,updateCategoryFacetNumberOfValues:Ja,updateCategoryFacetSortCriterion:nc,updateFacetAutoSelection:Wr,updateCategoryFacetBasePath:Em}}d();c();l();u();function I2(e){return e.addReducers({facetSet:Rr}),{deselectAllFacetValues:Xe,registerFacet:gn,toggleSelectFacetValue:hn,toggleExcludeFacetValue:yn,updateFacetIsFieldExpanded:Za,updateFacetNumberOfValues:Xa,updateFacetSortCriterion:uc,updateFreezeCurrentValues:Wn,updateFacetAutoSelection:Wr}}d();c();l();u();function T2(e){return e.addReducers({dateFacetSet:bn}),{deselectAllDateFacetValues:Lm,registerDateFacet:vn,toggleSelectDateFacetValue:xn,toggleExcludeDateFacetValue:An,updateDateFacetSortCriterion:Vm,updateDateFacetValues:Xn}}d();c();l();u();function P2(e){return e.addReducers({numericFacetSet:wr}),{deselectAllNumericFacetValues:Zm,registerNumericFacet:Rn,toggleSelectNumericFacetValue:wn,toggleExcludeNumericFacetValue:Fn,updateNumericFacetSortCriterion:Xm,updateNumericFacetValues:Zn}}d();c();l();u();function k2(e){return e.addReducers({fields:Ho}),{registerFieldsToInclude:$o,enableFetchAllFields:Ec,disableFetchAllFields:ui,fetchFieldsDescription:Ic}}d();c();l();u();function O2(e){return e.addReducers({folding:Lg}),{registerFolding:Uo,loadCollection:Qo}}d();c();l();u();function N2(e){return e.addReducers({generatedAnswer:kc}),{generateAnswer:Qp,resetAnswer:sr,setAnswerGenerationMode:Pp}}d();c();l();u();function _2(e){return e.addReducers({history:Kg,facetOrder:Nc}),{back:$u,forward:Zd}}d();c();l();u();function D2(e){return e.addReducers({instantResults:Jg}),{registerInstantResults:ss,updateInstantResultsQuery:Kr,clearExpiredResults:cs}}d();c();l();u();function q2(e){return e.addReducers({pagination:Ir}),{nextPage:ps,previousPage:fs,registerNumberOfResults:us,registerPage:ds,updateNumberOfResults:ls,updatePage:Yr}}d();c();l();u();function M2(e){return e.addReducers({pipeline:as}),{setPipeline:os}}d();c();l();u();function j2(e){return e.addReducers({query:Ct}),{updateQuery:Dt}}d();c();l();u();function V2(e){return e.addReducers({querySet:Wo}),{registerQuerySetQuery:$c,updateQuerySetQuery:mi}}d();c();l();u();function L2(e){return e.addReducers({querySuggest:Hc,querySet:Wo}),{clearQuerySuggest:Bo,fetchQuerySuggestions:Go,registerQuerySuggest:Fc,selectQuerySuggestion:Tn}}d();c();l();u();function U2(e){return e.addReducers({questionAnswering:kn}),{collapseSmartSnippet:Xc,expandSmartSnippet:Jc,dislikeSmartSnippet:eu,likeSmartSnippet:Zc,openFeedbackModal:tu,closeFeedbackModal:Ko,expandSmartSnippetRelatedQuestion:ru,collapseSmartSnippetRelatedQuestion:nu}}d();c();l();u();function Q2(e){return e.addReducers({recentQueries:nh}),{registerRecentQueries:fi,clearRecentQueries:Gc}}d();c();l();u();function B2(e){return e.addReducers({recentResults:oh}),{registerRecentResults:_c,clearRecentResults:Dc,pushRecentResult:Er}}d();c();l();u();function G2(e){return e.addReducers({resultPreview:rh}),{fetchResultContent:pi,updateContentURL:Bc,nextPreview:Lc,previousPreview:Uc,preparePreviewPagination:Qc}}d();c();l();u();d();c();l();u();var $2=new ge({content:new Le({required:!0}),conditions:new Le({required:!0}),priority:new ee({required:!1,default:0,min:0}),fields:new ae({required:!1,each:z})});function kk(){let e=[],t=r=>{let n=$2.validate(r);if(!r.conditions.every(a=>a instanceof Function))throw new yu("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(a=>a(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(a=>a(r)));return n?n.linkContent:null}}}function Ok(e){if(!H2(e))throw W;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=kk();return{registerTemplates:(...o)=>{t(...o);let a=[];o.forEach(i=>{i.fields&&a.push(...i.fields)}),e.dispatch($o(a))},selectTemplate:r,selectLinkTemplate:n}}function H2(e){return e.addReducers({fields:Ho}),!0}d();c();l();u();function z2(e){return e.addReducers({search:fe}),{executeSearch:pR,fetchMoreResults:mR,fetchFacetValues:gR,fetchPage:fR,fetchInstantResults:hR}}d();c();l();u();function W2(e){return e.addReducers({searchHub:Rs}),{setSearchHub:bs}}d();c();l();u();function K2(e){return e.addReducers({facetOrder:Nc,facetSet:Rr,pagination:Ir,query:Ct,querySet:Wo}),{restoreSearchParameters:De,restoreTab:ts}}d();c();l();u();function Y2(e){let{by:t,order:r}=e;switch(t){case"relevancy":return Ki();case"qre":return Ud();case"nosort":return Qd();case"date":if(!r)throw new Error("An order (i.e., ascending or descending) should be specified for a sort criterion sorted by \"date\"");return Vd(r);default:if(!r)throw new Error(`An order (i.e., ascending or descending) should be specified for a sort criterion sorted by a field, such as "${t}"`);return Ld(t,r)}}function J2(e){return e===void 0||e==="ascending"||e==="descending"}function Nk(e){let t=e.split(","),r=new Error(`Wrong criterion expression format for "${e}"`);if(!t.length)throw r;return t.map(n=>{let o=n.trim().split(" "),a=o[0].toLowerCase(),i=o[1]?.toLowerCase();if(o.length>2||a==="")throw r;if(!J2(i))throw new Error(`Wrong criterion sort order "${i}" in expression "${e}". Order should either be "ascending" or "descending"`);return Y2({by:a,order:i})})}d();c();l();u();function X2(e){return e.addReducers({sortCriteria:vh}),{registerSortCriterion:ou,updateSortCriterion:au}}d();c();l();u();function Z2(e){return e.addReducers({standaloneSearchBoxSet:Ah}),{registerStandaloneSearchBox:iu,fetchRedirectUrl:Yo,updateStandaloneSearchBoxRedirectionUrl:su,updateAnalyticsToSearchFromLink:uu,updateAnalyticsToOmniboxFromLink:lu,resetStandaloneSearchBox:cu}}d();c();l();u();function e$(e){return e.addReducers({staticFilterSet:Ch}),{registerStaticFilter:mc,toggleSelectStaticFilterValue:eo,toggleExcludeStaticFilterValue:to,deselectAllStaticFilterValues:Lo}}d();c();l();u();function t$(e){return e.addReducers({tabSet:hc}),{registerTab:_s,updateActiveTab:gt}}d();c();l();u();d();c();l();u();d();c();l();u();function bt(e){return e.negate?"NOT ":""}d();c();l();u();function Pr(e){return{contains:"=",differentThan:"<>",fuzzyMatch:"~=",greaterThan:">",greaterThanOrEqual:">=",isExactly:"==",lowerThan:"<",lowerThanOrEqual:"<=",phoneticMatch:"%=",regexMatch:"/=",wildcardMatch:"*="}[e]}function _k(e){return{toQuerySyntax(){let{field:t,value:r}=e,n=Pr(e.operator);return`${bt(e)}@${t}${n}${r}`}}}d();c();l();u();function Dk(e){return{toQuerySyntax(){let t=bt(e),{field:r,from:n,to:o}=e,a=Pr("isExactly");return`${t}@${r}${a}${n}..${o}`}}}d();c();l();u();function qk(e){return{toQuerySyntax(){let t=bt(e),{expression:r}=e;return`${t}"${r}"`}}}d();c();l();u();function Mk(e){return{toQuerySyntax(){let t=bt(e),{field:r}=e;return`${t}@${r}`}}}d();c();l();u();function jk(e){return{toQuerySyntax(){let{expression:t,negate:r}=e;return r?`NOT (${t})`:t}}}d();c();l();u();function Vk(e){return{toQuerySyntax(){let t=bt(e),{startTerm:r,otherTerms:n}=e,o=r$(n),a=`${r} ${o}`;return e.negate?`${t}(${a})`:a}}}function r$(e){return e.map(t=>{let{endTerm:r,maxKeywordsBetween:n}=t;return`near:${n} ${r}`}).join(" ")}d();c();l();u();function Lk(e){return{toQuerySyntax(){let{field:t,value:r}=e,n=bt(e),o=Pr(e.operator);return`${n}@${t}${o}${r}`}}}d();c();l();u();function Uk(e){return{toQuerySyntax(){let t=bt(e),{field:r,from:n,to:o}=e,a=Pr("isExactly");return`${t}@${r}${a}${n}..${o}`}}}d();c();l();u();function Qk(e){return{toQuerySyntax(){let{name:t,parameters:r}=e,n=n$(r);return`$${t}(${n})`}}}function n$(e){return Object.entries(e).map(t=>{let[r,n]=t,o=typeof n=="string"?n:n.toQuerySyntax();return`${r}: ${o}`}).join(", ")}d();c();l();u();function Bk(e){return{toQuerySyntax(){let t=bt(e),{field:r,operator:n,value:o}=e,a=Pr(n),i=n==="fuzzyMatch"?` $quoteVar(value: ${o})`:`("${o}")`;return`${t}@${r}${a}${i}`}}}d();c();l();u();function Gk(e){return{toQuerySyntax(){let{field:t}=e,r=bt(e),n=Pr(e.operator),o=e.values.map(i=>`"${i}"`),a=o.length===1?o[0]:`(${o.join(",")})`;return`${r}@${t}${n}${a}`}}}function o$(){let e=[],t="and";return{addExpression(r){return e.push(r),this},addKeyword(r){return e.push(jk(r)),this},addNear(r){return e.push(Vk(r)),this},addExactMatch(r){return e.push(qk(r)),this},addFieldExists(r){return e.push(Mk(r)),this},addStringField(r){return e.push(Gk(r)),this},addStringFacetField(r){return e.push(Bk(r)),this},addNumericField(r){return e.push(Lk(r)),this},addNumericRangeField(r){return e.push(Uk(r)),this},addDateField(r){return e.push(_k(r)),this},addDateRangeField(r){return e.push(Dk(r)),this},addQueryExtension(r){return e.push(Qk(r)),this},joinUsing(r){return t=r,this},toQuerySyntax(){let r=a$(t),n=e.map(o=>o.toQuerySyntax()).join(`) ${r} (`);return e.length<=1?n:`(${n})`}}}function a$(e){return e==="and"?"AND":"OR"}/**
|
|
49
49
|
* @license
|
|
50
50
|
*
|
|
51
51
|
* Copyright 2026 Coveo Solutions Inc.
|
|
@@ -78,4 +78,4 @@ fast-json-patch/module/duplex.mjs:
|
|
|
78
78
|
*)
|
|
79
79
|
*/if(__exports!=exports)module.exports=exports;return module.exports});
|
|
80
80
|
|
|
81
|
-
window.coveoQuanticVersion = '3.36.
|
|
81
|
+
window.coveoQuanticVersion = '3.36.10';
|