@coveo/quantic 3.36.10 → 3.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +14 -14
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/agents/follow-up-agent/follow-up-answer-strategy.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/post-answer-evaluation.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/stream-answer-api.d.ts +3 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/search/search-api-params.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/actions-history/ipx-actions-history-actions.d.ts +1 -10
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/analytics/analytics-utils.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/attached-results/attached-results-analytics-actions.d.ts +8 -8
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/configuration/configuration-selectors.d.ts +3 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/configuration/configuration-state.d.ts +1 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/configuration/magic-cookie.d.ts +2 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/follow-up-answers/follow-up-answers-actions.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/follow-up-answers/follow-up-answers-state.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-analytics-actions.d.ts +3 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-request.d.ts +4 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/history/history-actions.d.ts +3 -30
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/insight-search/insight-search-actions-thunk-processor.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/insight-search/legacy/insight-search-actions-thunk-processor.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/result/result-insight-analytics-actions.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/legacy/search-actions-thunk-processor.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/legacy/search-request.d.ts +8 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/search-actions-thunk-processor.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/search/search-request.d.ts +8 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/test/mock-search-request.d.ts +8 -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 +14 -14
- package/package.json +3 -3
|
@@ -14,31 +14,31 @@ function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){
|
|
|
14
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
|
-
*/(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadlessRecommendation",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadlessRecommendation"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var
|
|
18
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var c=r.next();return a=c.done,c},e:function(c){s=!0,i=c},f:function(){try{a||r.return==null||r.return()}finally{if(s)throw i}}}}function hu(){return hu=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=xb(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},hu.apply(null,arguments)}function Pn(e){return Pn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pn(e)}function Ab(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&&yu(e,t)}function qf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qf=function(){return!!e})()}function wb(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 Sb(e)}function yu(e,t){return yu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},yu(e,t)}function xb(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Pn(e))!==null;);return e}function Cb(e,t,r,n){var o=hu(Pn(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(i){return o.apply(r,i)}:o}function Eb(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 Rb(e){var t=Eb(e,"string");return typeof t=="symbol"?t:t+""}function Ib(e,t){if(e){if(typeof e=="string")return Nf(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Nf(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function Tb(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 _b(e){if(e===void 0)if(typeof document>"u")e=new Error("This operation was aborted"),e.name="AbortError";else try{e=new DOMException("signal is aborted without reason"),Object.defineProperty(e,"name",{value:"AbortError"})}catch{e=new Error("This operation was aborted"),e.name="AbortError"}return e}var Mf=function(){function e(){vu(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return Su(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],i=0,a=o.length;i<a;i++)if(o[i].callback===n){o.splice(i,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],i=o.slice(),a=function(){var h=i[s];try{h.callback.call(n,r)}catch(v){Promise.resolve().then(function(){throw v})}h.options&&h.options.once&&n.removeEventListener(r.type,h.callback)},s=0,c=i.length;s<c;s++)a();return!r.defaultPrevented}}}])}(),bu=function(e){function t(){var r;return vu(this,t),r=bb(this,t),r.listeners||Mf.call(r),Object.defineProperty(r,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(r,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(r,"reason",{value:void 0,writable:!0,configurable:!0}),r}return Ab(t,e),Su(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)),Cb(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,i=o===void 0?"Aborted":o;if(n)throw i}}],[{key:"timeout",value:function(n){var o=new na;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 na;function i(){o.abort(this.reason),a()}function a(){var h=Df(n),v;try{for(h.s();!(v=h.n()).done;){var S=v.value;S.removeEventListener("abort",i)}}catch(g){h.e(g)}finally{h.f()}}var s=Df(n),c;try{for(s.s();!(c=s.n()).done;){var u=c.value;if(u.aborted){o.abort(u.reason);break}else u.addEventListener("abort",i)}}catch(h){s.e(h)}finally{s.f()}return o.signal}}])}(Mf),na=function(){function e(){vu(this,e),Object.defineProperty(this,"signal",{value:new bu,writable:!0,configurable:!0})}return Su(e,[{key:"abort",value:function(r){var n=_b(r),o=Tb(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(na.prototype[Symbol.toStringTag]="AbortController",bu.prototype[Symbol.toStringTag]="AbortSignal");function kb(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 Ob(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,i=t.AbortController,a=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,s=a===void 0?!1:a;if(!kb({fetch:r,Request:o,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:r,Request:c};var c=o;(c&&!c.prototype.hasOwnProperty("signal")||s)&&(c=function(S,g){var y;g&&g.signal&&(y=g.signal,delete g.signal);var C=new o(S,g);return y&&Object.defineProperty(C,"signal",{writable:!1,enumerable:!1,configurable:!0,value:y}),C},c.prototype=o.prototype);var u=r,h=function(S,g){var y=c&&c.prototype.isPrototypeOf(S)?S.signal:g?g.signal:void 0;if(y){var C;try{C=new DOMException("Aborted","AbortError")}catch{C=new Error("Aborted"),C.name="AbortError"}if(y.aborted)return Promise.reject(C);var R=new Promise(function(x,I){y.addEventListener("abort",function(){return I(C)},{once:!0})});return g&&g.signal&&delete g.signal,Promise.race([R,u(S,g)])}return u(S,g)};return{fetch:h,Request:c}}Ko.AbortController=na;Ko.AbortSignal=bu;Ko.abortableFetch=Ob});var jf,l,A,p=On(()=>{"use strict";jf=_t(Au(),1),l=_t(Au(),1),{fetch:A}=(0,jf.abortableFetch)({fetch})});function wu(e){return typeof e!="string"||e in{}}function xu(){return Object.create(null)}function Lf(e){return typeof e=="string"&&!!e.trim()}function Cu(e,t){var r=e.split(";").filter(Lf),n=r.shift(),o=Pb(n),i=o.name,a=o.value;if(t=t?Object.assign({},oa,t):oa,wu(i))return null;try{a=t.decodeValues?decodeURIComponent(a):a}catch(c){console.error("set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",c)}var s=xu();return s.name=i,s.value=a,r.forEach(function(c){var u=c.split("="),h=u.shift().trimLeft().toLowerCase();if(!wu(h)){var v=u.join("=");if(h==="expires")s.expires=new Date(v);else if(h==="max-age"){var S=parseInt(v,10);Number.isNaN(S)||(s.maxAge=S)}else h==="secure"?s.secure=!0:h==="httponly"?s.httpOnly=!0:h==="samesite"?s.sameSite=v:h==="partitioned"?s.partitioned=!0:h&&(s[h]=v)}}),s}function Pb(e){var t="",r="",n=e.split("=");return n.length>1?(t=n.shift(),r=n.join("=")):r=e,{name:t,value:r}}function Nn(e,t){if(t=t?Object.assign({},oa,t):oa,!e)return t.map?xu():[];if(e.headers)if(typeof e.headers.getSetCookie=="function")e=e.headers.getSetCookie();else if(e.headers["set-cookie"])e=e.headers["set-cookie"];else{var r=e.headers[Object.keys(e.headers).find(function(a){return a.toLowerCase()==="set-cookie"})];!r&&e.headers.cookie&&!t.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),e=r}var n=t.split,o=Array.isArray(e);if(n==="auto"&&(n=!o),o||(e=[e]),e=e.filter(Lf),n&&(e=e.map(ia).flat()),t.map){var i=xu();return e.reduce(function(a,s){var c=Cu(s,t);return c&&!wu(c.name)&&(a[c.name]=c),a},i)}else return e.map(function(a){return Cu(a,t)}).filter(Boolean)}function ia(e){if(Array.isArray(e))return e;if(typeof e!="string")return[];var t=[],r=0,n,o,i,a,s;function c(){for(;r<e.length&&/\s/.test(e.charAt(r));)r+=1;return r<e.length}function u(){return o=e.charAt(r),o!=="="&&o!==";"&&o!==","}for(;r<e.length;){for(n=r,s=!1;c();)if(o=e.charAt(r),o===","){for(i=r,r+=1,c(),a=r;r<e.length&&u();)r+=1;r<e.length&&e.charAt(r)==="="?(s=!0,r=a,t.push(e.substring(n,i)),n=r):r=i+1}else r+=1;(!s||r>=e.length)&&t.push(e.substring(n,e.length))}return t}var oa,Vf=On(()=>{"use strict";m();d();p();f();oa={decodeValues:!0,map:!1,silent:!1,split:"auto"};Nn.parseSetCookie=Nn;Nn.parse=Nn;Nn.parseString=Cu;Nn.splitCookiesString=ia});function Yo(e){if(Nb.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function Eu(e){return e.replace(Fb,"")}function Xo(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||!Db(r))return!1}return!0}function Db(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function Bf(e){if(typeof e!="string"||e.trim()!==e)return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r===0||r===10||r===13)return!1}return!0}var Nb,Uf,Fb,$f,Fn,Ru,Gf,w,Hf=On(()=>{"use strict";m();d();p();f();Vf();Nb=/[^a-z0-9\-#$%&'*+.^_`|~]/i;Uf=[`
|
|
19
|
-
`,"\r","\t"," "],Fb=new RegExp(`(^[${Uf.join("")}]|$[${Uf.join("")}])`,"g");Fn=Symbol("normalizedHeaders"),Ru=Symbol("rawHeaderNames"),Gf=", ",w=class Qf{constructor(t){this[Fn]={},this[Ru]=new Map,this[$f]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor?.name)||t instanceof Qf||typeof b.Headers<"u"&&t instanceof b.Headers?t.forEach((r,n)=>{this.append(n,r)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(Gf):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(Gf):n)})}[($f=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[Fn]).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(!Xo(t))throw new TypeError(`Invalid header name "${t}"`);return this[Fn].hasOwnProperty(Yo(t))}get(t){if(!Xo(t))throw TypeError(`Invalid header name "${t}"`);return this[Fn][Yo(t)]??null}set(t,r){if(!Xo(t)||!Bf(r))return;let n=Yo(t),o=Eu(r);this[Fn][n]=Eu(o),this[Ru].set(n,t)}append(t,r){if(!Xo(t)||!Bf(r))return;let n=Yo(t),o=Eu(r),i=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,i)}delete(t){if(!Xo(t)||!this.has(t))return;let r=Yo(t);delete this[Fn][r],this[Ru].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===""?[""]:ia(t)}}});var m=On(()=>{"use strict";Hf()});var ep=He(ei=>{"use strict";m();d();p();f();var ua=ei&&ei.__assign||function(){return ua=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},ua.apply(this,arguments)};Object.defineProperty(ei,"__esModule",{value:!0});var Gb={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function Qb(e){var t=ua(ua({},Gb),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}ei.getSanitizedOptions=Qb});var tp=He(ku=>{"use strict";m();d();p();f();Object.defineProperty(ku,"__esModule",{value:!0});function Hb(e){var t=Math.random()*e;return Math.round(t)}ku.fullJitter=Hb});var rp=He(Ou=>{"use strict";m();d();p();f();Object.defineProperty(Ou,"__esModule",{value:!0});function zb(e){return e}Ou.noJitter=zb});var np=He(Pu=>{"use strict";m();d();p();f();Object.defineProperty(Pu,"__esModule",{value:!0});var Wb=tp(),Kb=rp();function Yb(e){return e.jitter==="full"?Wb.fullJitter:Kb.noJitter}Pu.JitterFactory=Yb});var Fu=He(Nu=>{"use strict";m();d();p();f();Object.defineProperty(Nu,"__esModule",{value:!0});var Xb=np(),Jb=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=Xb.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}();Nu.Delay=Jb});var op=He(Kt=>{"use strict";m();d();p();f();var Zb=Kt&&Kt.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),eA=Kt&&Kt.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(v){a(v)}}function c(h){try{u(n.throw(h))}catch(v){a(v)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},tA=Kt&&Kt.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(h){return c([u,h])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(h){u=[6,h],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Kt,"__esModule",{value:!0});var rA=Fu(),nA=function(e){Zb(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return eA(this,void 0,void 0,function(){return tA(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}(rA.Delay);Kt.SkipFirstDelay=nA});var ip=He(ti=>{"use strict";m();d();p();f();var oA=ti&&ti.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ti,"__esModule",{value:!0});var iA=Fu(),aA=function(e){oA(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(iA.Delay);ti.AlwaysDelay=aA});var ap=He(Du=>{"use strict";m();d();p();f();Object.defineProperty(Du,"__esModule",{value:!0});var sA=op(),cA=ip();function uA(e,t){var r=lA(e);return r.setAttemptNumber(t),r}Du.DelayFactory=uA;function lA(e){return e.delayFirstAttempt?new cA.AlwaysDelay(e):new sA.SkipFirstDelay(e)}});var sp=He(Ur=>{"use strict";m();d();p();f();var Mu=Ur&&Ur.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(v){a(v)}}function c(h){try{u(n.throw(h))}catch(v){a(v)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},qu=Ur&&Ur.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(h){return c([u,h])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(h){u=[6,h],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Ur,"__esModule",{value:!0});var dA=ep(),fA=ap();function pA(e,t){return t===void 0&&(t={}),Mu(this,void 0,void 0,function(){var r,n;return qu(this,function(o){switch(o.label){case 0:return r=dA.getSanitizedOptions(t),n=new mA(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}Ur.backOff=pA;var mA=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return Mu(this,void 0,void 0,function(){var t,r;return qu(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 Mu(this,void 0,void 0,function(){var t;return qu(this,function(r){switch(r.label){case 0:return t=fA.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var hs=He((td,rd)=>{"use strict";m();d();p();f();(function(e,t){typeof td=="object"&&typeof rd<"u"?rd.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs=t()})(td,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",s="day",c="week",u="month",h="quarter",v="year",S="date",g="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|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(G){var B=["th","st","nd","rd"],U=G%100;return"["+G+(B[(U-20)%10]||B[U]||B[0])+"]"}},x=function(G,B,U){var Q=String(G);return!Q||Q.length>=B?G:""+Array(B+1-Q.length).join(U)+G},I={s:x,z:function(G){var B=-G.utcOffset(),U=Math.abs(B),Q=Math.floor(U/60),$=U%60;return(B<=0?"+":"-")+x(Q,2,"0")+":"+x($,2,"0")},m:function G(B,U){if(B.date()<U.date())return-G(U,B);var Q=12*(U.year()-B.year())+(U.month()-B.month()),$=B.clone().add(Q,u),K=U-$<0,Y=B.clone().add(Q+(K?-1:1),u);return+(-(Q+(U-$)/(K?$-Y:Y-$))||0)},a:function(G){return G<0?Math.ceil(G)||0:Math.floor(G)},p:function(G){return{M:u,y:v,w:c,d:s,D:S,h:a,m:i,s:o,ms:n,Q:h}[G]||String(G||"").toLowerCase().replace(/s$/,"")},u:function(G){return G===void 0}},T="en",_={};_[T]=R;var j="$isDayjsObject",N=function(G){return G instanceof V||!(!G||!G[j])},k=function G(B,U,Q){var $;if(!B)return T;if(typeof B=="string"){var K=B.toLowerCase();_[K]&&($=K),U&&(_[K]=U,$=K);var Y=B.split("-");if(!$&&Y.length>1)return G(Y[0])}else{var ne=B.name;_[ne]=B,$=ne}return!Q&&$&&(T=$),$||!Q&&T},O=function(G,B){if(N(G))return G.clone();var U=typeof B=="object"?B:{};return U.date=G,U.args=arguments,new V(U)},D=I;D.l=k,D.i=N,D.w=function(G,B){return O(G,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var V=function(){function G(U){this.$L=k(U.locale,null,!0),this.parse(U),this.$x=this.$x||U.x||{},this[j]=!0}var B=G.prototype;return B.parse=function(U){this.$d=function(Q){var $=Q.date,K=Q.utc;if($===null)return new Date(NaN);if(D.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var Y=$.match(y);if(Y){var ne=Y[2]-1||0,fe=(Y[7]||"0").substring(0,3);return K?new Date(Date.UTC(Y[1],ne,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,fe)):new Date(Y[1],ne,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,fe)}}return new Date($)}(U),this.init()},B.init=function(){var U=this.$d;this.$y=U.getFullYear(),this.$M=U.getMonth(),this.$D=U.getDate(),this.$W=U.getDay(),this.$H=U.getHours(),this.$m=U.getMinutes(),this.$s=U.getSeconds(),this.$ms=U.getMilliseconds()},B.$utils=function(){return D},B.isValid=function(){return this.$d.toString()!==g},B.isSame=function(U,Q){var $=O(U);return this.startOf(Q)<=$&&$<=this.endOf(Q)},B.isAfter=function(U,Q){return O(U)<this.startOf(Q)},B.isBefore=function(U,Q){return this.endOf(Q)<O(U)},B.$g=function(U,Q,$){return D.u(U)?this[Q]:this.set($,U)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(U,Q){var $=this,K=!!D.u(Q)||Q,Y=D.p(U),ne=function(Ce,De){var Be=D.w($.$u?Date.UTC($.$y,De,Ce):new Date($.$y,De,Ce),$);return K?Be:Be.endOf(s)},fe=function(Ce,De){return D.w($.toDate()[Ce].apply($.toDate("s"),(K?[0,0,0,0]:[23,59,59,999]).slice(De)),$)},be=this.$W,de=this.$M,pe=this.$D,le="set"+(this.$u?"UTC":"");switch(Y){case v:return K?ne(1,0):ne(31,11);case u:return K?ne(1,de):ne(0,de+1);case c:var he=this.$locale().weekStart||0,Le=(be<he?be+7:be)-he;return ne(K?pe-Le:pe+(6-Le),de);case s:case S:return fe(le+"Hours",0);case a:return fe(le+"Minutes",1);case i:return fe(le+"Seconds",2);case o:return fe(le+"Milliseconds",3);default:return this.clone()}},B.endOf=function(U){return this.startOf(U,!1)},B.$set=function(U,Q){var $,K=D.p(U),Y="set"+(this.$u?"UTC":""),ne=($={},$[s]=Y+"Date",$[S]=Y+"Date",$[u]=Y+"Month",$[v]=Y+"FullYear",$[a]=Y+"Hours",$[i]=Y+"Minutes",$[o]=Y+"Seconds",$[n]=Y+"Milliseconds",$)[K],fe=K===s?this.$D+(Q-this.$W):Q;if(K===u||K===v){var be=this.clone().set(S,1);be.$d[ne](fe),be.init(),this.$d=be.set(S,Math.min(this.$D,be.daysInMonth())).$d}else ne&&this.$d[ne](fe);return this.init(),this},B.set=function(U,Q){return this.clone().$set(U,Q)},B.get=function(U){return this[D.p(U)]()},B.add=function(U,Q){var $,K=this;U=Number(U);var Y=D.p(Q),ne=function(de){var pe=O(K);return D.w(pe.date(pe.date()+Math.round(de*U)),K)};if(Y===u)return this.set(u,this.$M+U);if(Y===v)return this.set(v,this.$y+U);if(Y===s)return ne(1);if(Y===c)return ne(7);var fe=($={},$[i]=t,$[a]=r,$[o]=e,$)[Y]||1,be=this.$d.getTime()+U*fe;return D.w(be,this)},B.subtract=function(U,Q){return this.add(-1*U,Q)},B.format=function(U){var Q=this,$=this.$locale();if(!this.isValid())return $.invalidDate||g;var K=U||"YYYY-MM-DDTHH:mm:ssZ",Y=D.z(this),ne=this.$H,fe=this.$m,be=this.$M,de=$.weekdays,pe=$.months,le=$.meridiem,he=function(De,Be,ut,bt){return De&&(De[Be]||De(Q,K))||ut[Be].slice(0,bt)},Le=function(De){return D.s(ne%12||12,De,"0")},Ce=le||function(De,Be,ut){var bt=De<12?"AM":"PM";return ut?bt.toLowerCase():bt};return K.replace(C,function(De,Be){return Be||function(ut){switch(ut){case"YY":return String(Q.$y).slice(-2);case"YYYY":return D.s(Q.$y,4,"0");case"M":return be+1;case"MM":return D.s(be+1,2,"0");case"MMM":return he($.monthsShort,be,pe,3);case"MMMM":return he(pe,be);case"D":return Q.$D;case"DD":return D.s(Q.$D,2,"0");case"d":return String(Q.$W);case"dd":return he($.weekdaysMin,Q.$W,de,2);case"ddd":return he($.weekdaysShort,Q.$W,de,3);case"dddd":return de[Q.$W];case"H":return String(ne);case"HH":return D.s(ne,2,"0");case"h":return Le(1);case"hh":return Le(2);case"a":return Ce(ne,fe,!0);case"A":return Ce(ne,fe,!1);case"m":return String(fe);case"mm":return D.s(fe,2,"0");case"s":return String(Q.$s);case"ss":return D.s(Q.$s,2,"0");case"SSS":return D.s(Q.$ms,3,"0");case"Z":return Y}return null}(De)||Y.replace(":","")})},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(U,Q,$){var K,Y=this,ne=D.p(Q),fe=O(U),be=(fe.utcOffset()-this.utcOffset())*t,de=this-fe,pe=function(){return D.m(Y,fe)};switch(ne){case v:K=pe()/12;break;case u:K=pe();break;case h:K=pe()/3;break;case c:K=(de-be)/6048e5;break;case s:K=(de-be)/864e5;break;case a:K=de/r;break;case i:K=de/t;break;case o:K=de/e;break;default:K=de}return $?K:D.a(K)},B.daysInMonth=function(){return this.endOf(u).$D},B.$locale=function(){return _[this.$L]},B.locale=function(U,Q){if(!U)return this.$L;var $=this.clone(),K=k(U,Q,!0);return K&&($.$L=K),$},B.clone=function(){return D.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()},G}(),z=V.prototype;return O.prototype=z,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",s],["$M",u],["$y",v],["$D",S]].forEach(function(G){z[G[1]]=function(B){return this.$g(B,G[0],G[1])}}),O.extend=function(G,B){return G.$i||(G(B,V,O),G.$i=!0),O},O.locale=k,O.isDayjs=N,O.unix=function(G){return O(1e3*G)},O.en=_[T],O.Ls=_,O.p={},O})});var Kg=He((nd,od)=>{"use strict";m();d();p();f();(function(e,t){typeof nd=="object"&&typeof od<"u"?od.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_quarterOfYear=t()})(nd,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(s){return this.$utils().u(s)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(s-1))};var i=o.add;o.add=function(s,c){return s=Number(s),this.$utils().p(c)===t?this.add(3*s,e):i.bind(this)(s,c)};var a=o.startOf;o.startOf=function(s,c){var u=this.$utils(),h=!!u.u(c)||c;if(u.p(s)===t){var v=this.quarter()-1;return h?this.month(3*v).startOf(e).startOf("day"):this.month(3*v+2).endOf(e).endOf("day")}return a.bind(this)(s,c)}}})});var Yg=He((id,ad)=>{"use strict";m();d();p();f();(function(e,t){typeof id=="object"&&typeof ad<"u"?ad.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_customParseFormat=t()})(id,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,o=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,a={},s=function(y){return(y=+y)+(y>68?1900:2e3)},c=function(y){return function(C){this[y]=+C}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=function(C){if(!C||C==="Z")return 0;var R=C.match(/([+-]|\d\d)/g),x=60*R[1]+(+R[2]||0);return x===0?0:R[0]==="+"?-x:x}(y)}],h=function(y){var C=a[y];return C&&(C.indexOf?C:C.s.concat(C.f))},v=function(y,C){var R,x=a.meridiem;if(x){for(var I=1;I<=24;I+=1)if(y.indexOf(x(I,0,C))>-1){R=I>12;break}}else R=y===(C?"pm":"PM");return R},S={A:[i,function(y){this.afternoon=v(y,!1)}],a:[i,function(y){this.afternoon=v(y,!0)}],Q:[r,function(y){this.month=3*(y-1)+1}],S:[r,function(y){this.milliseconds=100*+y}],SS:[n,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[o,c("seconds")],ss:[o,c("seconds")],m:[o,c("minutes")],mm:[o,c("minutes")],H:[o,c("hours")],h:[o,c("hours")],HH:[o,c("hours")],hh:[o,c("hours")],D:[o,c("day")],DD:[n,c("day")],Do:[i,function(y){var C=a.ordinal,R=y.match(/\d+/);if(this.day=R[0],C)for(var x=1;x<=31;x+=1)C(x).replace(/\[|\]/g,"")===y&&(this.day=x)}],w:[o,c("week")],ww:[n,c("week")],M:[o,c("month")],MM:[n,c("month")],MMM:[i,function(y){var C=h("months"),R=(h("monthsShort")||C.map(function(x){return x.slice(0,3)})).indexOf(y)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[i,function(y){var C=h("months").indexOf(y)+1;if(C<1)throw new Error;this.month=C%12||C}],Y:[/[+-]?\d+/,c("year")],YY:[n,function(y){this.year=s(y)}],YYYY:[/\d{4}/,c("year")],Z:u,ZZ:u};function g(y){var C,R;C=y,R=a&&a.formats;for(var x=(y=C.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(O,D,V){var z=V&&V.toUpperCase();return D||R[V]||e[V]||R[z].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(G,B,U){return B||U.slice(1)})})).match(t),I=x.length,T=0;T<I;T+=1){var _=x[T],j=S[_],N=j&&j[0],k=j&&j[1];x[T]=k?{regex:N,parser:k}:_.replace(/^\[|\]$/g,"")}return function(O){for(var D={},V=0,z=0;V<I;V+=1){var G=x[V];if(typeof G=="string")z+=G.length;else{var B=G.regex,U=G.parser,Q=O.slice(z),$=B.exec(Q)[0];U.call(D,$),O=O.replace($,"")}}return function(K){var Y=K.afternoon;if(Y!==void 0){var ne=K.hours;Y?ne<12&&(K.hours+=12):ne===12&&(K.hours=0),delete K.afternoon}}(D),D}}return function(y,C,R){R.p.customParseFormat=!0,y&&y.parseTwoDigitYear&&(s=y.parseTwoDigitYear);var x=C.prototype,I=x.parse;x.parse=function(T){var _=T.date,j=T.utc,N=T.args;this.$u=j;var k=N[1];if(typeof k=="string"){var O=N[2]===!0,D=N[3]===!0,V=O||D,z=N[2];D&&(z=N[2]),a=this.$locale(),!O&&z&&(a=R.Ls[z]),this.$d=function(Q,$,K,Y){try{if(["x","X"].indexOf($)>-1)return new Date(($==="X"?1e3:1)*Q);var ne=g($)(Q),fe=ne.year,be=ne.month,de=ne.day,pe=ne.hours,le=ne.minutes,he=ne.seconds,Le=ne.milliseconds,Ce=ne.zone,De=ne.week,Be=new Date,ut=de||(fe||be?1:Be.getDate()),bt=fe||Be.getFullYear(),lr=0;fe&&!be||(lr=be>0?be-1:Be.getMonth());var _n,kn=pe||0,Ho=le||0,mu=he||0,gu=Le||0;return Ce?new Date(Date.UTC(bt,lr,ut,kn,Ho,mu,gu+60*Ce.offset*1e3)):K?new Date(Date.UTC(bt,lr,ut,kn,Ho,mu,gu)):(_n=new Date(bt,lr,ut,kn,Ho,mu,gu),De&&(_n=Y(_n).week(De).toDate()),_n)}catch{return new Date("")}}(_,k,j,R),this.init(),z&&z!==!0&&(this.$L=this.locale(z).$L),V&&_!=this.format(k)&&(this.$d=new Date("")),a={}}else if(k instanceof Array)for(var G=k.length,B=1;B<=G;B+=1){N[1]=k[B-1];var U=R.apply(this,N);if(U.isValid()){this.$d=U.$d,this.$L=U.$L,this.init();break}B===G&&(this.$d=new Date(""))}else I.call(this,T)}}})});var $h=He((wd,xd)=>{"use strict";m();d();p();f();(function(e,t){typeof wd=="object"&&typeof xd<"u"?xd.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_timezone=t()})(wd,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var i,a=function(h,v,S){S===void 0&&(S={});var g=new Date(h),y=function(C,R){R===void 0&&(R={});var x=R.timeZoneName||"short",I=C+"|"+x,T=t[I];return T||(T=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:C,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:x}),t[I]=T),T}(v,S);return y.formatToParts(g)},s=function(h,v){for(var S=a(h,v),g=[],y=0;y<S.length;y+=1){var C=S[y],R=C.type,x=C.value,I=e[R];I>=0&&(g[I]=parseInt(x,10))}var T=g[3],_=T===24?0:T,j=g[0]+"-"+g[1]+"-"+g[2]+" "+_+":"+g[4]+":"+g[5]+":000",N=+h;return(o.utc(j).valueOf()-(N-=N%1e3))/6e4},c=n.prototype;c.tz=function(h,v){h===void 0&&(h=i);var S,g=this.utcOffset(),y=this.toDate(),C=y.toLocaleString("en-US",{timeZone:h}),R=Math.round((y-new Date(C))/1e3/60),x=15*-Math.round(y.getTimezoneOffset()/15)-R;if(!Number(x))S=this.utcOffset(0,v);else if(S=o(C,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(x,!0),v){var I=S.utcOffset();S=S.add(g-I,"minute")}return S.$x.$timezone=h,S},c.offsetName=function(h){var v=this.$x.$timezone||o.tz.guess(),S=a(this.valueOf(),v,{timeZoneName:h}).find(function(g){return g.type.toLowerCase()==="timezonename"});return S&&S.value};var u=c.startOf;c.startOf=function(h,v){if(!this.$x||!this.$x.$timezone)return u.call(this,h,v);var S=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return u.call(S,h,v).tz(this.$x.$timezone,!0)},o.tz=function(h,v,S){var g=S&&v,y=S||v||i,C=s(+o(),y);if(typeof h!="string")return o(h).tz(y);var R=function(_,j,N){var k=_-60*j*1e3,O=s(k,N);if(j===O)return[k,j];var D=s(k-=60*(O-j)*1e3,N);return O===D?[k,O]:[_-60*Math.min(O,D)*1e3,Math.max(O,D)]}(o.utc(h,g).valueOf(),C,y),x=R[0],I=R[1],T=o(x).utcOffset(I);return T.$x.$timezone=y,T},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(h){i=h}}})});var Gh=He((Cd,Ed)=>{"use strict";m();d();p();f();(function(e,t){typeof Cd=="object"&&typeof Ed<"u"?Ed.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_utc=t()})(Cd,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,i){var a=o.prototype;i.utc=function(g){var y={date:g,utc:!0,args:arguments};return new o(y)},a.utc=function(g){var y=i(this.toDate(),{locale:this.$L,utc:!0});return g?y.add(this.utcOffset(),e):y},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(g){g.utc&&(this.$u=!0),this.$utils().u(g.$offset)||(this.$offset=g.$offset),s.call(this,g)};var c=a.init;a.init=function(){if(this.$u){var g=this.$d;this.$y=g.getUTCFullYear(),this.$M=g.getUTCMonth(),this.$D=g.getUTCDate(),this.$W=g.getUTCDay(),this.$H=g.getUTCHours(),this.$m=g.getUTCMinutes(),this.$s=g.getUTCSeconds(),this.$ms=g.getUTCMilliseconds()}else c.call(this)};var u=a.utcOffset;a.utcOffset=function(g,y){var C=this.$utils().u;if(C(g))return this.$u?0:C(this.$offset)?u.call(this):this.$offset;if(typeof g=="string"&&(g=function(T){T===void 0&&(T="");var _=T.match(t);if(!_)return null;var j=(""+_[0]).match(r)||["-",0,0],N=j[0],k=60*+j[1]+ +j[2];return k===0?0:N==="+"?k:-k}(g),g===null))return this;var R=Math.abs(g)<=16?60*g:g;if(R===0)return this.utc(y);var x=this.clone();if(y)return x.$offset=R,x.$u=!1,x;var I=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(x=this.local().add(R+I,e)).$offset=R,x.$x.$localOffset=I,x};var h=a.format;a.format=function(g){var y=g||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,y)},a.valueOf=function(){var g=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*g},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var v=a.toDate;a.toDate=function(g){return g==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():v.call(this)};var S=a.diff;a.diff=function(g,y,C){if(g&&this.$u===g.$u)return S.call(this,g,y,C);var R=this.local(),x=i(g).local();return S.call(R,x,y,C)}}})});var lS=He((kae,uS)=>{"use strict";m();d();p();f();function y0(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}uS.exports=v0;function v0(e,t,r){var n=r&&r.stringify||y0,o=1;if(typeof e=="object"&&e!==null){var i=t.length+o;if(i===1)return e;var a=new Array(i);a[0]=n(e);for(var s=1;s<i;s++)a[s]=n(t[s]);return a.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var u="",h=1-o,v=-1,S=e&&e.length||0,g=0;g<S;){if(e.charCodeAt(g)===37&&g+1<S){switch(v=v>-1?v:0,e.charCodeAt(g+1)){case 100:case 102:if(h>=c||t[h]==null)break;v<g&&(u+=e.slice(v,g)),u+=Number(t[h]),v=g+2,g++;break;case 105:if(h>=c||t[h]==null)break;v<g&&(u+=e.slice(v,g)),u+=Math.floor(Number(t[h])),v=g+2,g++;break;case 79:case 111:case 106:if(h>=c||t[h]===void 0)break;v<g&&(u+=e.slice(v,g));var y=typeof t[h];if(y==="string"){u+="'"+t[h]+"'",v=g+2,g++;break}if(y==="function"){u+=t[h].name||"<anonymous>",v=g+2,g++;break}u+=n(t[h]),v=g+2,g++;break;case 115:if(h>=c)break;v<g&&(u+=e.slice(v,g)),u+=String(t[h]),v=g+2,g++;break;case 37:v<g&&(u+=e.slice(v,g)),u+="%",v=g+2,g++,h--;break}++h}++g}return v===-1?e:(v<S&&(u+=e.slice(v)),u)}});var hS=He((Dae,tu)=>{"use strict";m();d();p();f();var dS=lS();tu.exports=ur;var Xi=N0().console||{},S0={mapHttpRequest:eu,mapHttpResponse:eu,wrapRequestSerializer:Af,wrapResponseSerializer:Af,wrapErrorSerializer:Af,req:eu,res:eu,err:pS,errWithCause:pS};function jr(e,t){return e==="silent"?1/0:t.levels.values[e]}var Cf=Symbol("pino.logFuncs"),wf=Symbol("pino.hierarchy"),b0={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function fS(e,t){let r={logger:t,parent:e[wf]};t[wf]=r}function A0(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:Xi[o]||Xi[b0[o]||"log"]||Vo}),e[Cf]=n}function w0(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function ur(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||Xi;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=w0(e.browser.serialize,n),i=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(i=!1);let a=Object.keys(e.customLevels||{}),s=["error","fatal","warn","info","debug","trace"].concat(a);typeof r=="function"&&s.forEach(function(C){r[C]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let c=e.level||"info",u=Object.create(r);u.log||(u.log=Vo),A0(u,s,r),fS({},u),Object.defineProperty(u,"levelVal",{get:v}),Object.defineProperty(u,"level",{get:S,set:g});let h={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:s,timestamp:k0(e),messageKey:e.messageKey||"msg",onChild:e.onChild||Vo};u.levels=x0(e),u.level=c,u.isLevelEnabled=function(C){return this.levels.values[C]?this.levels.values[C]>=this.levels.values[this.level]:!1},u.setMaxListeners=u.getMaxListeners=u.emit=u.addListener=u.on=u.prependListener=u.once=u.prependOnceListener=u.removeListener=u.removeAllListeners=u.listeners=u.listenerCount=u.eventNames=u.write=u.flush=Vo,u.serializers=n,u._serialize=o,u._stdErrSerialize=i,u.child=function(...C){return y.call(this,h,...C)},t&&(u._logEvent=xf());function v(){return jr(this.level,this)}function S(){return this._level}function g(C){if(C!=="silent"&&!this.levels.values[C])throw Error("unknown level "+C);this._level=C,En(this,h,u,"error"),En(this,h,u,"fatal"),En(this,h,u,"warn"),En(this,h,u,"info"),En(this,h,u,"debug"),En(this,h,u,"trace"),a.forEach(R=>{En(this,h,u,R)})}function y(C,R,x){if(!R)throw new Error("missing bindings for child Pino");x=x||{},o&&R.serializers&&(x.serializers=R.serializers);let I=x.serializers;if(o&&I){var T=Object.assign({},n,I),_=e.browser.serialize===!0?Object.keys(T):o;delete R.serializers,Ef([R],_,T,this._stdErrSerialize)}function j(k){this._childLevel=(k._childLevel|0)+1,this.bindings=R,T&&(this.serializers=T,this._serialize=_),t&&(this._logEvent=xf([].concat(k._logEvent.bindings,R)))}j.prototype=this;let N=new j(this);return fS(this,N),N.child=function(...k){return y.call(this,C,...k)},N.level=x.level||this.level,C.onChild(N),N}return u}function x0(e){let t=e.customLevels||{},r=Object.assign({},ur.levels.values,t),n=Object.assign({},ur.levels.labels,C0(t));return{values:r,labels:n}}function C0(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}ur.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"}};ur.stdSerializers=S0;ur.stdTimeFunctions=Object.assign({},{nullTime:mS,epochTime:gS,unixTime:O0,isoTime:P0});function E0(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[wf];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function En(e,t,r,n){if(Object.defineProperty(e,n,{value:jr(e.level,r)>jr(n,r)?Vo:r[Cf][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===Vo){if(!t.transmit)return;let i=t.transmit.level||e.level,a=jr(i,r);if(jr(n,r)<a)return}e[n]=I0(e,t,r,n);let o=E0(e);o.length!==0&&(e[n]=R0(o,e[n]))}function R0(e,t){return function(){return t.apply(this,[...e,...arguments])}}function I0(e,t,r,n){return function(o){return function(){let a=t.timestamp(),s=new Array(arguments.length),c=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Xi?Xi:this;for(var u=0;u<s.length;u++)s[u]=arguments[u];var h=!1;if(t.serialize&&(Ef(s,this._serialize,this.serializers,this._stdErrSerialize),h=!0),t.asObject||t.formatters?o.call(c,...T0(this,n,s,a,t)):o.apply(c,s),t.transmit){let v=t.transmit.level||e._level,S=jr(v,r),g=jr(n,r);if(g<S)return;_0(this,{ts:a,methodLevel:n,methodValue:g,transmitLevel:v,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:jr(e._level,r)},s,h)}}}(e[Cf][n])}function T0(e,t,r,n,o){let{level:i,log:a=v=>v}=o.formatters||{},s=r.slice(),c=s[0],u={},h=(e._childLevel|0)+1;if(h<1&&(h=1),n&&(u.time=n),i){let v=i(t,e.levels.values[t]);Object.assign(u,v)}else u.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(c!==null&&typeof c=="object")for(;h--&&typeof s[0]=="object";)Object.assign(u,s.shift());return[a(u),...s]}else{if(c!==null&&typeof c=="object"){for(;h--&&typeof s[0]=="object";)Object.assign(u,s.shift());c=s.length?dS(s.shift(),s):void 0}else typeof c=="string"&&(c=dS(s.shift(),s));return c!==void 0&&(u[o.messageKey]=c),[a(u)]}}function Ef(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=ur.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let i in e[o])t.indexOf(i)>-1&&i in r&&(e[o][i]=r[i](e[o][i]))}function _0(e,t,r,n=!1){let o=t.send,i=t.ts,a=t.methodLevel,s=t.methodValue,c=t.val,u=e._logEvent.bindings;n||Ef(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(h){return u.indexOf(h)===-1}),e._logEvent.level.label=a,e._logEvent.level.value=s,o(a,e._logEvent,c),e._logEvent=xf(u)}function xf(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function pS(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 k0(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?mS:gS}function eu(){return{}}function Af(e){return e}function Vo(){}function mS(){return!1}function gS(){return Date.now()}function O0(){return Math.round(Date.now()/1e3)}function P0(){return new Date(Date.now()).toISOString()}function N0(){function e(t){return typeof t<"u"&&t}try{return typeof b<"u"?b:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),b)}catch{return e(self)||e(window)||e(this)||{}}}tu.exports.default=ur;tu.exports.pino=ur});var Nk={};Wo(Nk,{DefaultFieldsToInclude:()=>Of,EcommerceDefaultFieldsToInclude:()=>ob,HighlightUtils:()=>_u,MinimumFieldsToInclude:()=>fu,ResultTemplatesHelpers:()=>gh,buildContext:()=>RS,buildController:()=>Lr,buildDictionaryFieldContext:()=>IS,buildInteractiveResult:()=>eb,buildRecommendationEngine:()=>xS,buildRecommendationList:()=>JS,buildResultTemplatesManager:()=>sb,getAnalyticsNextApiBaseUrl:()=>la,getOrganizationEndpoint:()=>We,getSampleRecommendationEngineConfiguration:()=>Rf,loadAdvancedSearchQueryActions:()=>vk,loadClickAnalyticsActions:()=>_k,loadConfigurationActions:()=>Sk,loadContextActions:()=>Ak,loadDebugActions:()=>wk,loadDictionaryFieldContextActions:()=>xk,loadFieldActions:()=>Rk,loadPaginationActions:()=>kf,loadPipelineActions:()=>Ik,loadRecommendationActions:()=>Tk,loadSearchConfigurationActions:()=>bk,loadSearchHubActions:()=>Pk});module.exports=mb(Nk);m();d();p();f();var _u={};Wo(_u,{escapeHtml:()=>Dn,getHighlightedSuggestion:()=>$b,highlightString:()=>Bb});m();d();p();f();m();d();p();f();function Mb(e,t){let r=`
|
|
17
|
+
*/(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f(require)}else if("function"==typeof define&&define.amd){define("CoveoHeadlessRecommendation",["crypto"],function(_d_0){var d={"crypto":_d_0},r=function(m){if(m in d)return d[m];if(typeof require=="function")return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else{var gN={"crypto":"crypto"},gReq=function(r){var mod=r in gN?g[gN[r]]:g[r];return mod};g["CoveoHeadlessRecommendation"]=f(gReq)}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:this,function(require){var exports={};var __exports=exports;var module={exports};"use strict";var rw=Object.create;var Jo=Object.defineProperty;var nw=Object.getOwnPropertyDescriptor;var ow=Object.getOwnPropertyNames;var iw=Object.getPrototypeOf,aw=Object.prototype.hasOwnProperty;var sw=(e,t,r)=>t in e?Jo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Vn=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ye=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Zo=(e,t)=>{for(var r in t)Jo(e,r,{get:t[r],enumerable:!0})},sp=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ow(t))!aw.call(e,o)&&o!==r&&Jo(e,o,{get:()=>t[o],enumerable:!(n=nw(t,o))||n.enumerable});return e};var Dt=(e,t,r)=>(r=e!=null?rw(iw(e)):{},sp(t||!e||!e.__esModule?Jo(r,"default",{value:e,enumerable:!0}):r,e)),cw=e=>sp(Jo({},"__esModule",{value:!0}),e);var Ae=(e,t,r)=>sw(e,typeof t!="symbol"?t+"":t,r);var b,d=Vn(()=>{"use strict";b=typeof globalThis<"u"?globalThis:window});function va(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?va=function(t){return typeof t}:va=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},va(e)}function dw(){"navigator"in this||(this.navigator={}),typeof this.navigator.sendBeacon!="function"&&(this.navigator.sendBeacon=fw.bind(this))}function fw(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","*/*"),uw(t)?(o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),o.responseType="text"):lw(t)&&t.type&&o.setRequestHeader("Content-Type",t.type);try{o.send(t)}catch{return!1}return!0}var uw,lw,f=Vn(()=>{"use strict";uw=function(t){return typeof t=="string"},lw=function(t){return t instanceof Blob};dw.call((typeof window>"u"?"undefined":va(window))==="object"?window:{})});var Wu=Ye(ei=>{"use strict";m();d();p();f();Object.defineProperty(ei,"__esModule",{value:!0});function cp(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 pw(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mw(e,t,r){return t=Un(t),hw(e,fp()?Reflect.construct(t,r||[],Un(e).constructor):t.apply(e,r))}function Qu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function up(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,bw(n.key),n)}}function Hu(e,t,r){return t&&up(e.prototype,t),r&&up(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function lp(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=ww(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
18
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var c=r.next();return a=c.done,c},e:function(c){s=!0,i=c},f:function(){try{a||r.return==null||r.return()}finally{if(s)throw i}}}}function $u(){return $u=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=yw(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},$u.apply(null,arguments)}function Un(e){return Un=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Un(e)}function gw(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&&Gu(e,t)}function fp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fp=function(){return!!e})()}function hw(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 pw(e)}function Gu(e,t){return Gu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Gu(e,t)}function yw(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Un(e))!==null;);return e}function Sw(e,t,r,n){var o=$u(Un(1&n?e.prototype:e),t,r);return 2&n&&typeof o=="function"?function(i){return o.apply(r,i)}:o}function vw(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 bw(e){var t=vw(e,"string");return typeof t=="symbol"?t:t+""}function ww(e,t){if(e){if(typeof e=="string")return cp(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)?cp(e,t):void 0}}(function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}})(typeof self<"u"?self:global);function Aw(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 xw(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 dp=function(){function e(){Qu(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return Hu(e,[{key:"addEventListener",value:function(r,n,o){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:n,options:o})}},{key:"removeEventListener",value:function(r,n){if(r in this.listeners){for(var o=this.listeners[r],i=0,a=o.length;i<a;i++)if(o[i].callback===n){o.splice(i,1);return}}}},{key:"dispatchEvent",value:function(r){var n=this;if(r.type in this.listeners){for(var o=this.listeners[r.type],i=o.slice(),a=function(){var h=i[s];try{h.callback.call(n,r)}catch(S){Promise.resolve().then(function(){throw S})}h.options&&h.options.once&&n.removeEventListener(r.type,h.callback)},s=0,c=i.length;s<c;s++)a();return!r.defaultPrevented}}}])}(),zu=function(e){function t(){var r;return Qu(this,t),r=mw(this,t),r.listeners||dp.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 gw(t,e),Hu(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)),Sw(t,"dispatchEvent",this,3)([n])}},{key:"throwIfAborted",value:function(){var n=this.aborted,o=this.reason,i=o===void 0?"Aborted":o;if(n)throw i}}],[{key:"timeout",value:function(n){var o=new ba;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 ba;function i(){o.abort(this.reason),a()}function a(){var h=lp(n),S;try{for(h.s();!(S=h.n()).done;){var v=S.value;v.removeEventListener("abort",i)}}catch(g){h.e(g)}finally{h.f()}}var s=lp(n),c;try{for(s.s();!(c=s.n()).done;){var u=c.value;if(u.aborted){o.abort(u.reason);break}else u.addEventListener("abort",i)}}catch(h){s.e(h)}finally{s.f()}return o.signal}}])}(dp),ba=function(){function e(){Qu(this,e),Object.defineProperty(this,"signal",{value:new zu,writable:!0,configurable:!0})}return Hu(e,[{key:"abort",value:function(r){var n=xw(r),o=Aw(n);this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();typeof Symbol<"u"&&Symbol.toStringTag&&(ba.prototype[Symbol.toStringTag]="AbortController",zu.prototype[Symbol.toStringTag]="AbortSignal");function Cw(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 Ew(e){typeof e=="function"&&(e={fetch:e});var t=e,r=t.fetch,n=t.Request,o=n===void 0?r.Request:n,i=t.AbortController,a=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,s=a===void 0?!1:a;if(!Cw({fetch:r,Request:o,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:r,Request:c};var c=o;(c&&!c.prototype.hasOwnProperty("signal")||s)&&(c=function(v,g){var y;g&&g.signal&&(y=g.signal,delete g.signal);var x=new o(v,g);return y&&Object.defineProperty(x,"signal",{writable:!1,enumerable:!1,configurable:!0,value:y}),x},c.prototype=o.prototype);var u=r,h=function(v,g){var y=c&&c.prototype.isPrototypeOf(v)?v.signal:g?g.signal:void 0;if(y){var x;try{x=new DOMException("Aborted","AbortError")}catch{x=new Error("Aborted"),x.name="AbortError"}if(y.aborted)return Promise.reject(x);var C=new Promise(function(E,_){y.addEventListener("abort",function(){return _(x)},{once:!0})});return g&&g.signal&&delete g.signal,Promise.race([C,u(v,g)])}return u(v,g)};return{fetch:h,Request:c}}ei.AbortController=ba;ei.AbortSignal=zu;ei.abortableFetch=Ew});var pp,l,w,p=Vn(()=>{"use strict";pp=Dt(Wu(),1),l=Dt(Wu(),1),{fetch:w}=(0,pp.abortableFetch)({fetch})});function Ku(e){return typeof e!="string"||e in{}}function Yu(){return Object.create(null)}function mp(e){return typeof e=="string"&&!!e.trim()}function Xu(e,t){var r=e.split(";").filter(mp),n=r.shift(),o=Rw(n),i=o.name,a=o.value;if(t=t?Object.assign({},wa,t):wa,Ku(i))return null;try{a=t.decodeValues?decodeURIComponent(a):a}catch(c){console.error("set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",c)}var s=Yu();return s.name=i,s.value=a,r.forEach(function(c){var u=c.split("="),h=u.shift().trimLeft().toLowerCase();if(!Ku(h)){var S=u.join("=");if(h==="expires")s.expires=new Date(S);else if(h==="max-age"){var v=parseInt(S,10);Number.isNaN(v)||(s.maxAge=v)}else h==="secure"?s.secure=!0:h==="httponly"?s.httpOnly=!0:h==="samesite"?s.sameSite=S:h==="partitioned"?s.partitioned=!0:h&&(s[h]=S)}}),s}function Rw(e){var t="",r="",n=e.split("=");return n.length>1?(t=n.shift(),r=n.join("=")):r=e,{name:t,value:r}}function Bn(e,t){if(t=t?Object.assign({},wa,t):wa,!e)return t.map?Yu():[];if(e.headers)if(typeof e.headers.getSetCookie=="function")e=e.headers.getSetCookie();else if(e.headers["set-cookie"])e=e.headers["set-cookie"];else{var r=e.headers[Object.keys(e.headers).find(function(a){return a.toLowerCase()==="set-cookie"})];!r&&e.headers.cookie&&!t.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),e=r}var n=t.split,o=Array.isArray(e);if(n==="auto"&&(n=!o),o||(e=[e]),e=e.filter(mp),n&&(e=e.map(Aa).flat()),t.map){var i=Yu();return e.reduce(function(a,s){var c=Xu(s,t);return c&&!Ku(c.name)&&(a[c.name]=c),a},i)}else return e.map(function(a){return Xu(a,t)}).filter(Boolean)}function Aa(e){if(Array.isArray(e))return e;if(typeof e!="string")return[];var t=[],r=0,n,o,i,a,s;function c(){for(;r<e.length&&/\s/.test(e.charAt(r));)r+=1;return r<e.length}function u(){return o=e.charAt(r),o!=="="&&o!==";"&&o!==","}for(;r<e.length;){for(n=r,s=!1;c();)if(o=e.charAt(r),o===","){for(i=r,r+=1,c(),a=r;r<e.length&&u();)r+=1;r<e.length&&e.charAt(r)==="="?(s=!0,r=a,t.push(e.substring(n,i)),n=r):r=i+1}else r+=1;(!s||r>=e.length)&&t.push(e.substring(n,e.length))}return t}var wa,gp=Vn(()=>{"use strict";m();d();p();f();wa={decodeValues:!0,map:!1,silent:!1,split:"auto"};Bn.parseSetCookie=Bn;Bn.parse=Bn;Bn.parseString=Xu;Bn.splitCookiesString=Aa});function ti(e){if(Iw.test(e)||e.trim()==="")throw new TypeError("Invalid character in header field name");return e.trim().toLowerCase()}function Ju(e){return e.replace(Tw,"")}function ri(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||!_w(r))return!1}return!0}function _w(e){return![127,32,"(",")","<",">","@",",",";",":","\\","\"","/","[","]","?","=","{","}"].includes(e)}function yp(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 Iw,hp,Tw,Sp,$n,Zu,vp,A,wp=Vn(()=>{"use strict";m();d();p();f();gp();Iw=/[^a-z0-9\-#$%&'*+.^_`|~]/i;hp=[`
|
|
19
|
+
`,"\r","\t"," "],Tw=new RegExp(`(^[${hp.join("")}]|$[${hp.join("")}])`,"g");$n=Symbol("normalizedHeaders"),Zu=Symbol("rawHeaderNames"),vp=", ",A=class bp{constructor(t){this[$n]={},this[Zu]=new Map,this[Sp]="Headers",["Headers","HeadersPolyfill"].includes(t?.constructor?.name)||t instanceof bp||typeof b.Headers<"u"&&t instanceof b.Headers?t.forEach((r,n)=>{this.append(n,r)},this):Array.isArray(t)?t.forEach(([r,n])=>{this.append(r,Array.isArray(n)?n.join(vp):n)}):t&&Object.getOwnPropertyNames(t).forEach(r=>{let n=t[r];this.append(r,Array.isArray(n)?n.join(vp):n)})}[(Sp=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[$n]).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(!ri(t))throw new TypeError(`Invalid header name "${t}"`);return this[$n].hasOwnProperty(ti(t))}get(t){if(!ri(t))throw TypeError(`Invalid header name "${t}"`);return this[$n][ti(t)]??null}set(t,r){if(!ri(t)||!yp(r))return;let n=ti(t),o=Ju(r);this[$n][n]=Ju(o),this[Zu].set(n,t)}append(t,r){if(!ri(t)||!yp(r))return;let n=ti(t),o=Ju(r),i=this.has(n)?`${this.get(n)}, ${o}`:o;this.set(t,i)}delete(t){if(!ri(t)||!this.has(t))return;let r=ti(t);delete this[$n][r],this[Zu].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===""?[""]:Aa(t)}}});var m=Vn(()=>{"use strict";wp()});var _p=Ye(ii=>{"use strict";m();d();p();f();var Ra=ii&&ii.__assign||function(){return Ra=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},Ra.apply(this,arguments)};Object.defineProperty(ii,"__esModule",{value:!0});var jw={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function Lw(e){var t=Ra(Ra({},jw),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}ii.getSanitizedOptions=Lw});var kp=Ye(nl=>{"use strict";m();d();p();f();Object.defineProperty(nl,"__esModule",{value:!0});function Vw(e){var t=Math.random()*e;return Math.round(t)}nl.fullJitter=Vw});var Op=Ye(ol=>{"use strict";m();d();p();f();Object.defineProperty(ol,"__esModule",{value:!0});function Uw(e){return e}ol.noJitter=Uw});var Pp=Ye(il=>{"use strict";m();d();p();f();Object.defineProperty(il,"__esModule",{value:!0});var Bw=kp(),$w=Op();function Gw(e){return e.jitter==="full"?Bw.fullJitter:$w.noJitter}il.JitterFactory=Gw});var sl=Ye(al=>{"use strict";m();d();p();f();Object.defineProperty(al,"__esModule",{value:!0});var Qw=Pp(),Hw=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=Qw.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}();al.Delay=Hw});var Np=Ye(rr=>{"use strict";m();d();p();f();var zw=rr&&rr.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ww=rr&&rr.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(S){a(S)}}function c(h){try{u(n.throw(h))}catch(S){a(S)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},Kw=rr&&rr.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(h){return c([u,h])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(h){u=[6,h],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(rr,"__esModule",{value:!0});var Yw=sl(),Xw=function(e){zw(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.apply=function(){return Ww(this,void 0,void 0,function(){return Kw(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}(Yw.Delay);rr.SkipFirstDelay=Xw});var Fp=Ye(ai=>{"use strict";m();d();p();f();var Jw=ai&&ai.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ai,"__esModule",{value:!0});var Zw=sl(),eA=function(e){Jw(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Zw.Delay);ai.AlwaysDelay=eA});var Dp=Ye(cl=>{"use strict";m();d();p();f();Object.defineProperty(cl,"__esModule",{value:!0});var tA=Np(),rA=Fp();function nA(e,t){var r=oA(e);return r.setAttemptNumber(t),r}cl.DelayFactory=nA;function oA(e){return e.delayFirstAttempt?new rA.AlwaysDelay(e):new tA.SkipFirstDelay(e)}});var Mp=Ye(Kr=>{"use strict";m();d();p();f();var ul=Kr&&Kr.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(S){a(S)}}function c(h){try{u(n.throw(h))}catch(S){a(S)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},ll=Kr&&Kr.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(h){return c([u,h])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(h){u=[6,h],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Kr,"__esModule",{value:!0});var iA=_p(),aA=Dp();function sA(e,t){return t===void 0&&(t={}),ul(this,void 0,void 0,function(){var r,n;return ll(this,function(o){switch(o.label){case 0:return r=iA.getSanitizedOptions(t),n=new cA(e,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}Kr.backOff=sA;var cA=function(){function e(t,r){this.request=t,this.options=r,this.attemptNumber=0}return e.prototype.execute=function(){return ul(this,void 0,void 0,function(){var t,r;return ll(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 ul(this,void 0,void 0,function(){var t;return ll(this,function(r){switch(r.label){case 0:return t=aA.DelayFactory(this.options,this.attemptNumber),[4,t.apply()];case 1:return r.sent(),[2]}})})},e}()});var Qs=Ye((kd,Od)=>{"use strict";m();d();p();f();(function(e,t){typeof kd=="object"&&typeof Od<"u"?Od.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs=t()})(kd,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",s="day",c="week",u="month",h="quarter",S="year",v="date",g="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|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,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(O){var P=["th","st","nd","rd"],F=O%100;return"["+O+(P[(F-20)%10]||P[F]||P[0])+"]"}},E=function(O,P,F){var H=String(O);return!H||H.length>=P?O:""+Array(P+1-H.length).join(F)+O},_={s:E,z:function(O){var P=-O.utcOffset(),F=Math.abs(P),H=Math.floor(F/60),Q=F%60;return(P<=0?"+":"-")+E(H,2,"0")+":"+E(Q,2,"0")},m:function O(P,F){if(P.date()<F.date())return-O(F,P);var H=12*(F.year()-P.year())+(F.month()-P.month()),Q=P.clone().add(H,u),X=F-Q<0,Y=P.clone().add(H+(X?-1:1),u);return+(-(H+(F-Q)/(X?Q-Y:Y-Q))||0)},a:function(O){return O<0?Math.ceil(O)||0:Math.floor(O)},p:function(O){return{M:u,y:S,w:c,d:s,D:v,h:a,m:i,s:o,ms:n,Q:h}[O]||String(O||"").toLowerCase().replace(/s$/,"")},u:function(O){return O===void 0}},I="en",k={};k[I]=C;var T="$isDayjsObject",D=function(O){return O instanceof U||!(!O||!O[T])},B=function O(P,F,H){var Q;if(!P)return I;if(typeof P=="string"){var X=P.toLowerCase();k[X]&&(Q=X),F&&(k[X]=F,Q=X);var Y=P.split("-");if(!Q&&Y.length>1)return O(Y[0])}else{var W=P.name;k[W]=P,Q=W}return!H&&Q&&(I=Q),Q||!H&&I},L=function(O,P){if(D(O))return O.clone();var F=typeof P=="object"?P:{};return F.date=O,F.args=arguments,new U(F)},j=_;j.l=B,j.i=D,j.w=function(O,P){return L(O,{locale:P.$L,utc:P.$u,x:P.$x,$offset:P.$offset})};var U=function(){function O(F){this.$L=B(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[T]=!0}var P=O.prototype;return P.parse=function(F){this.$d=function(H){var Q=H.date,X=H.utc;if(Q===null)return new Date(NaN);if(j.u(Q))return new Date;if(Q instanceof Date)return new Date(Q);if(typeof Q=="string"&&!/Z$/i.test(Q)){var Y=Q.match(y);if(Y){var W=Y[2]-1||0,ee=(Y[7]||"0").substring(0,3);return X?new Date(Date.UTC(Y[1],W,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,ee)):new Date(Y[1],W,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,ee)}}return new Date(Q)}(F),this.init()},P.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},P.$utils=function(){return j},P.isValid=function(){return this.$d.toString()!==g},P.isSame=function(F,H){var Q=L(F);return this.startOf(H)<=Q&&Q<=this.endOf(H)},P.isAfter=function(F,H){return L(F)<this.startOf(H)},P.isBefore=function(F,H){return this.endOf(H)<L(F)},P.$g=function(F,H,Q){return j.u(F)?this[H]:this.set(Q,F)},P.unix=function(){return Math.floor(this.valueOf()/1e3)},P.valueOf=function(){return this.$d.getTime()},P.startOf=function(F,H){var Q=this,X=!!j.u(H)||H,Y=j.p(F),W=function(pe,de){var ye=j.w(Q.$u?Date.UTC(Q.$y,de,pe):new Date(Q.$y,de,pe),Q);return X?ye:ye.endOf(s)},ee=function(pe,de){return j.w(Q.toDate()[pe].apply(Q.toDate("s"),(X?[0,0,0,0]:[23,59,59,999]).slice(de)),Q)},ae=this.$W,xe=this.$M,Me=this.$D,_e="set"+(this.$u?"UTC":"");switch(Y){case S:return X?W(1,0):W(31,11);case u:return X?W(1,xe):W(0,xe+1);case c:var Pe=this.$locale().weekStart||0,Ne=(ae<Pe?ae+7:ae)-Pe;return W(X?Me-Ne:Me+(6-Ne),xe);case s:case v:return ee(_e+"Hours",0);case a:return ee(_e+"Minutes",1);case i:return ee(_e+"Seconds",2);case o:return ee(_e+"Milliseconds",3);default:return this.clone()}},P.endOf=function(F){return this.startOf(F,!1)},P.$set=function(F,H){var Q,X=j.p(F),Y="set"+(this.$u?"UTC":""),W=(Q={},Q[s]=Y+"Date",Q[v]=Y+"Date",Q[u]=Y+"Month",Q[S]=Y+"FullYear",Q[a]=Y+"Hours",Q[i]=Y+"Minutes",Q[o]=Y+"Seconds",Q[n]=Y+"Milliseconds",Q)[X],ee=X===s?this.$D+(H-this.$W):H;if(X===u||X===S){var ae=this.clone().set(v,1);ae.$d[W](ee),ae.init(),this.$d=ae.set(v,Math.min(this.$D,ae.daysInMonth())).$d}else W&&this.$d[W](ee);return this.init(),this},P.set=function(F,H){return this.clone().$set(F,H)},P.get=function(F){return this[j.p(F)]()},P.add=function(F,H){var Q,X=this;F=Number(F);var Y=j.p(H),W=function(xe){var Me=L(X);return j.w(Me.date(Me.date()+Math.round(xe*F)),X)};if(Y===u)return this.set(u,this.$M+F);if(Y===S)return this.set(S,this.$y+F);if(Y===s)return W(1);if(Y===c)return W(7);var ee=(Q={},Q[i]=t,Q[a]=r,Q[o]=e,Q)[Y]||1,ae=this.$d.getTime()+F*ee;return j.w(ae,this)},P.subtract=function(F,H){return this.add(-1*F,H)},P.format=function(F){var H=this,Q=this.$locale();if(!this.isValid())return Q.invalidDate||g;var X=F||"YYYY-MM-DDTHH:mm:ssZ",Y=j.z(this),W=this.$H,ee=this.$m,ae=this.$M,xe=Q.weekdays,Me=Q.months,_e=Q.meridiem,Pe=function(de,ye,me,Ge){return de&&(de[ye]||de(H,X))||me[ye].slice(0,Ge)},Ne=function(de){return j.s(W%12||12,de,"0")},pe=_e||function(de,ye,me){var Ge=de<12?"AM":"PM";return me?Ge.toLowerCase():Ge};return X.replace(x,function(de,ye){return ye||function(me){switch(me){case"YY":return String(H.$y).slice(-2);case"YYYY":return j.s(H.$y,4,"0");case"M":return ae+1;case"MM":return j.s(ae+1,2,"0");case"MMM":return Pe(Q.monthsShort,ae,Me,3);case"MMMM":return Pe(Me,ae);case"D":return H.$D;case"DD":return j.s(H.$D,2,"0");case"d":return String(H.$W);case"dd":return Pe(Q.weekdaysMin,H.$W,xe,2);case"ddd":return Pe(Q.weekdaysShort,H.$W,xe,3);case"dddd":return xe[H.$W];case"H":return String(W);case"HH":return j.s(W,2,"0");case"h":return Ne(1);case"hh":return Ne(2);case"a":return pe(W,ee,!0);case"A":return pe(W,ee,!1);case"m":return String(ee);case"mm":return j.s(ee,2,"0");case"s":return String(H.$s);case"ss":return j.s(H.$s,2,"0");case"SSS":return j.s(H.$ms,3,"0");case"Z":return Y}return null}(de)||Y.replace(":","")})},P.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},P.diff=function(F,H,Q){var X,Y=this,W=j.p(H),ee=L(F),ae=(ee.utcOffset()-this.utcOffset())*t,xe=this-ee,Me=function(){return j.m(Y,ee)};switch(W){case S:X=Me()/12;break;case u:X=Me();break;case h:X=Me()/3;break;case c:X=(xe-ae)/6048e5;break;case s:X=(xe-ae)/864e5;break;case a:X=xe/r;break;case i:X=xe/t;break;case o:X=xe/e;break;default:X=xe}return Q?X:j.a(X)},P.daysInMonth=function(){return this.endOf(u).$D},P.$locale=function(){return k[this.$L]},P.locale=function(F,H){if(!F)return this.$L;var Q=this.clone(),X=B(F,H,!0);return X&&(Q.$L=X),Q},P.clone=function(){return j.w(this.$d,this)},P.toDate=function(){return new Date(this.valueOf())},P.toJSON=function(){return this.isValid()?this.toISOString():null},P.toISOString=function(){return this.$d.toISOString()},P.toString=function(){return this.$d.toUTCString()},O}(),q=U.prototype;return L.prototype=q,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",s],["$M",u],["$y",S],["$D",v]].forEach(function(O){q[O[1]]=function(P){return this.$g(P,O[0],O[1])}}),L.extend=function(O,P){return O.$i||(O(P,U,L),O.$i=!0),L},L.locale=B,L.isDayjs=D,L.unix=function(O){return L(1e3*O)},L.en=k[I],L.Ls=k,L.p={},L})});var qh=Ye((Pd,Nd)=>{"use strict";m();d();p();f();(function(e,t){typeof Pd=="object"&&typeof Nd<"u"?Nd.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_quarterOfYear=t()})(Pd,function(){"use strict";var e="month",t="quarter";return function(r,n){var o=n.prototype;o.quarter=function(s){return this.$utils().u(s)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(s-1))};var i=o.add;o.add=function(s,c){return s=Number(s),this.$utils().p(c)===t?this.add(3*s,e):i.bind(this)(s,c)};var a=o.startOf;o.startOf=function(s,c){var u=this.$utils(),h=!!u.u(c)||c;if(u.p(s)===t){var S=this.quarter()-1;return h?this.month(3*S).startOf(e).startOf("day"):this.month(3*S+2).endOf(e).endOf("day")}return a.bind(this)(s,c)}}})});var jh=Ye((Fd,Dd)=>{"use strict";m();d();p();f();(function(e,t){typeof Fd=="object"&&typeof Dd<"u"?Dd.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_customParseFormat=t()})(Fd,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,o=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,a={},s=function(y){return(y=+y)+(y>68?1900:2e3)},c=function(y){return function(x){this[y]=+x}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=function(x){if(!x||x==="Z")return 0;var C=x.match(/([+-]|\d\d)/g),E=60*C[1]+(+C[2]||0);return E===0?0:C[0]==="+"?-E:E}(y)}],h=function(y){var x=a[y];return x&&(x.indexOf?x:x.s.concat(x.f))},S=function(y,x){var C,E=a.meridiem;if(E){for(var _=1;_<=24;_+=1)if(y.indexOf(E(_,0,x))>-1){C=_>12;break}}else C=y===(x?"pm":"PM");return C},v={A:[i,function(y){this.afternoon=S(y,!1)}],a:[i,function(y){this.afternoon=S(y,!0)}],Q:[r,function(y){this.month=3*(y-1)+1}],S:[r,function(y){this.milliseconds=100*+y}],SS:[n,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[o,c("seconds")],ss:[o,c("seconds")],m:[o,c("minutes")],mm:[o,c("minutes")],H:[o,c("hours")],h:[o,c("hours")],HH:[o,c("hours")],hh:[o,c("hours")],D:[o,c("day")],DD:[n,c("day")],Do:[i,function(y){var x=a.ordinal,C=y.match(/\d+/);if(this.day=C[0],x)for(var E=1;E<=31;E+=1)x(E).replace(/\[|\]/g,"")===y&&(this.day=E)}],w:[o,c("week")],ww:[n,c("week")],M:[o,c("month")],MM:[n,c("month")],MMM:[i,function(y){var x=h("months"),C=(h("monthsShort")||x.map(function(E){return E.slice(0,3)})).indexOf(y)+1;if(C<1)throw new Error;this.month=C%12||C}],MMMM:[i,function(y){var x=h("months").indexOf(y)+1;if(x<1)throw new Error;this.month=x%12||x}],Y:[/[+-]?\d+/,c("year")],YY:[n,function(y){this.year=s(y)}],YYYY:[/\d{4}/,c("year")],Z:u,ZZ:u};function g(y){var x,C;x=y,C=a&&a.formats;for(var E=(y=x.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(L,j,U){var q=U&&U.toUpperCase();return j||C[U]||e[U]||C[q].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(O,P,F){return P||F.slice(1)})})).match(t),_=E.length,I=0;I<_;I+=1){var k=E[I],T=v[k],D=T&&T[0],B=T&&T[1];E[I]=B?{regex:D,parser:B}:k.replace(/^\[|\]$/g,"")}return function(L){for(var j={},U=0,q=0;U<_;U+=1){var O=E[U];if(typeof O=="string")q+=O.length;else{var P=O.regex,F=O.parser,H=L.slice(q),Q=P.exec(H)[0];F.call(j,Q),L=L.replace(Q,"")}}return function(X){var Y=X.afternoon;if(Y!==void 0){var W=X.hours;Y?W<12&&(X.hours+=12):W===12&&(X.hours=0),delete X.afternoon}}(j),j}}return function(y,x,C){C.p.customParseFormat=!0,y&&y.parseTwoDigitYear&&(s=y.parseTwoDigitYear);var E=x.prototype,_=E.parse;E.parse=function(I){var k=I.date,T=I.utc,D=I.args;this.$u=T;var B=D[1];if(typeof B=="string"){var L=D[2]===!0,j=D[3]===!0,U=L||j,q=D[2];j&&(q=D[2]),a=this.$locale(),!L&&q&&(a=C.Ls[q]),this.$d=function(H,Q,X,Y){try{if(["x","X"].indexOf(Q)>-1)return new Date((Q==="X"?1e3:1)*H);var W=g(Q)(H),ee=W.year,ae=W.month,xe=W.day,Me=W.hours,_e=W.minutes,Pe=W.seconds,Ne=W.milliseconds,pe=W.zone,de=W.week,ye=new Date,me=xe||(ee||ae?1:ye.getDate()),Ge=ee||ye.getFullYear(),He=0;ee&&!ae||(He=ae>0?ae-1:ye.getMonth());var Nt,wt=Me||0,Ut=_e||0,Ct=Pe||0,Ft=Ne||0;return pe?new Date(Date.UTC(Ge,He,me,wt,Ut,Ct,Ft+60*pe.offset*1e3)):X?new Date(Date.UTC(Ge,He,me,wt,Ut,Ct,Ft)):(Nt=new Date(Ge,He,me,wt,Ut,Ct,Ft),de&&(Nt=Y(Nt).week(de).toDate()),Nt)}catch{return new Date("")}}(k,B,T,C),this.init(),q&&q!==!0&&(this.$L=this.locale(q).$L),U&&k!=this.format(B)&&(this.$d=new Date("")),a={}}else if(B instanceof Array)for(var O=B.length,P=1;P<=O;P+=1){D[1]=B[P-1];var F=C.apply(this,D);if(F.isValid()){this.$d=F.$d,this.$L=F.$L,this.init();break}P===O&&(this.$d=new Date(""))}else _.call(this,I)}}})});var Oy=Ye((Xd,Jd)=>{"use strict";m();d();p();f();(function(e,t){typeof Xd=="object"&&typeof Jd<"u"?Jd.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_timezone=t()})(Xd,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,o){var i,a=function(h,S,v){v===void 0&&(v={});var g=new Date(h),y=function(x,C){C===void 0&&(C={});var E=C.timeZoneName||"short",_=x+"|"+E,I=t[_];return I||(I=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:x,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:E}),t[_]=I),I}(S,v);return y.formatToParts(g)},s=function(h,S){for(var v=a(h,S),g=[],y=0;y<v.length;y+=1){var x=v[y],C=x.type,E=x.value,_=e[C];_>=0&&(g[_]=parseInt(E,10))}var I=g[3],k=I===24?0:I,T=g[0]+"-"+g[1]+"-"+g[2]+" "+k+":"+g[4]+":"+g[5]+":000",D=+h;return(o.utc(T).valueOf()-(D-=D%1e3))/6e4},c=n.prototype;c.tz=function(h,S){h===void 0&&(h=i);var v,g=this.utcOffset(),y=this.toDate(),x=y.toLocaleString("en-US",{timeZone:h}),C=Math.round((y-new Date(x))/1e3/60),E=15*-Math.round(y.getTimezoneOffset()/15)-C;if(!Number(E))v=this.utcOffset(0,S);else if(v=o(x,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(E,!0),S){var _=v.utcOffset();v=v.add(g-_,"minute")}return v.$x.$timezone=h,v},c.offsetName=function(h){var S=this.$x.$timezone||o.tz.guess(),v=a(this.valueOf(),S,{timeZoneName:h}).find(function(g){return g.type.toLowerCase()==="timezonename"});return v&&v.value};var u=c.startOf;c.startOf=function(h,S){if(!this.$x||!this.$x.$timezone)return u.call(this,h,S);var v=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return u.call(v,h,S).tz(this.$x.$timezone,!0)},o.tz=function(h,S,v){var g=v&&S,y=v||S||i,x=s(+o(),y);if(typeof h!="string")return o(h).tz(y);var C=function(k,T,D){var B=k-60*T*1e3,L=s(B,D);if(T===L)return[B,T];var j=s(B-=60*(L-T)*1e3,D);return L===j?[B,L]:[k-60*Math.min(L,j)*1e3,Math.max(L,j)]}(o.utc(h,g).valueOf(),x,y),E=C[0],_=C[1],I=o(E).utcOffset(_);return I.$x.$timezone=y,I},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(h){i=h}}})});var Py=Ye((Zd,ef)=>{"use strict";m();d();p();f();(function(e,t){typeof Zd=="object"&&typeof ef<"u"?ef.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof b<"u"?b:e||self).dayjs_plugin_utc=t()})(Zd,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,o,i){var a=o.prototype;i.utc=function(g){var y={date:g,utc:!0,args:arguments};return new o(y)},a.utc=function(g){var y=i(this.toDate(),{locale:this.$L,utc:!0});return g?y.add(this.utcOffset(),e):y},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(g){g.utc&&(this.$u=!0),this.$utils().u(g.$offset)||(this.$offset=g.$offset),s.call(this,g)};var c=a.init;a.init=function(){if(this.$u){var g=this.$d;this.$y=g.getUTCFullYear(),this.$M=g.getUTCMonth(),this.$D=g.getUTCDate(),this.$W=g.getUTCDay(),this.$H=g.getUTCHours(),this.$m=g.getUTCMinutes(),this.$s=g.getUTCSeconds(),this.$ms=g.getUTCMilliseconds()}else c.call(this)};var u=a.utcOffset;a.utcOffset=function(g,y){var x=this.$utils().u;if(x(g))return this.$u?0:x(this.$offset)?u.call(this):this.$offset;if(typeof g=="string"&&(g=function(I){I===void 0&&(I="");var k=I.match(t);if(!k)return null;var T=(""+k[0]).match(r)||["-",0,0],D=T[0],B=60*+T[1]+ +T[2];return B===0?0:D==="+"?B:-B}(g),g===null))return this;var C=Math.abs(g)<=16?60*g:g;if(C===0)return this.utc(y);var E=this.clone();if(y)return E.$offset=C,E.$u=!1,E;var _=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(E=this.local().add(C+_,e)).$offset=C,E.$x.$localOffset=_,E};var h=a.format;a.format=function(g){var y=g||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,y)},a.valueOf=function(){var g=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*g},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var S=a.toDate;a.toDate=function(g){return g==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():S.call(this)};var v=a.diff;a.diff=function(g,y,x){if(g&&this.$u===g.$u)return v.call(this,g,y,x);var C=this.local(),E=i(g).local();return v.call(C,E,y,x)}}})});var rb=Ye((Fse,tb)=>{"use strict";m();d();p();f();function wk(e){try{return JSON.stringify(e)}catch{return"\"[Circular]\""}}tb.exports=Ak;function Ak(e,t,r){var n=r&&r.stringify||wk,o=1;if(typeof e=="object"&&e!==null){var i=t.length+o;if(i===1)return e;var a=new Array(i);a[0]=n(e);for(var s=1;s<i;s++)a[s]=n(t[s]);return a.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var u="",h=1-o,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>=c||t[h]==null)break;S<g&&(u+=e.slice(S,g)),u+=Number(t[h]),S=g+2,g++;break;case 105:if(h>=c||t[h]==null)break;S<g&&(u+=e.slice(S,g)),u+=Math.floor(Number(t[h])),S=g+2,g++;break;case 79:case 111:case 106:if(h>=c||t[h]===void 0)break;S<g&&(u+=e.slice(S,g));var y=typeof t[h];if(y==="string"){u+="'"+t[h]+"'",S=g+2,g++;break}if(y==="function"){u+=t[h].name||"<anonymous>",S=g+2,g++;break}u+=n(t[h]),S=g+2,g++;break;case 115:if(h>=c)break;S<g&&(u+=e.slice(S,g)),u+=String(t[h]),S=g+2,g++;break;case 37:S<g&&(u+=e.slice(S,g)),u+="%",S=g+2,g++,h--;break}++h}++g}return S===-1?e:(S<v&&(u+=e.slice(S)),u)}});var cb=Ye((Lse,ku)=>{"use strict";m();d();p();f();var nb=rb();ku.exports=Sr;var pa=qk().console||{},xk={mapHttpRequest:_u,mapHttpResponse:_u,wrapRequestSerializer:Kf,wrapResponseSerializer:Kf,wrapErrorSerializer:Kf,req:_u,res:_u,err:ib,errWithCause:ib};function Hr(e,t){return e==="silent"?1/0:t.levels.values[e]}var Jf=Symbol("pino.logFuncs"),Yf=Symbol("pino.hierarchy"),Ck={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function ob(e,t){let r={logger:t,parent:e[Yf]};t[Yf]=r}function Ek(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:pa[o]||pa[Ck[o]||"log"]||Qo}),e[Jf]=n}function Rk(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function Sr(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||pa;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=Rk(e.browser.serialize,n),i=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(i=!1);let a=Object.keys(e.customLevels||{}),s=["error","fatal","warn","info","debug","trace"].concat(a);typeof r=="function"&&s.forEach(function(x){r[x]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let c=e.level||"info",u=Object.create(r);u.log||(u.log=Qo),Ek(u,s,r),ob({},u),Object.defineProperty(u,"levelVal",{get:S}),Object.defineProperty(u,"level",{get:v,set:g});let h={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:s,timestamp:Fk(e),messageKey:e.messageKey||"msg",onChild:e.onChild||Qo};u.levels=Ik(e),u.level=c,u.isLevelEnabled=function(x){return this.levels.values[x]?this.levels.values[x]>=this.levels.values[this.level]:!1},u.setMaxListeners=u.getMaxListeners=u.emit=u.addListener=u.on=u.prependListener=u.once=u.prependOnceListener=u.removeListener=u.removeAllListeners=u.listeners=u.listenerCount=u.eventNames=u.write=u.flush=Qo,u.serializers=n,u._serialize=o,u._stdErrSerialize=i,u.child=function(...x){return y.call(this,h,...x)},t&&(u._logEvent=Xf());function S(){return Hr(this.level,this)}function v(){return this._level}function g(x){if(x!=="silent"&&!this.levels.values[x])throw Error("unknown level "+x);this._level=x,Mn(this,h,u,"error"),Mn(this,h,u,"fatal"),Mn(this,h,u,"warn"),Mn(this,h,u,"info"),Mn(this,h,u,"debug"),Mn(this,h,u,"trace"),a.forEach(C=>{Mn(this,h,u,C)})}function y(x,C,E){if(!C)throw new Error("missing bindings for child Pino");E=E||{},o&&C.serializers&&(E.serializers=C.serializers);let _=E.serializers;if(o&&_){var I=Object.assign({},n,_),k=e.browser.serialize===!0?Object.keys(I):o;delete C.serializers,Zf([C],k,I,this._stdErrSerialize)}function T(B){this._childLevel=(B._childLevel|0)+1,this.bindings=C,I&&(this.serializers=I,this._serialize=k),t&&(this._logEvent=Xf([].concat(B._logEvent.bindings,C)))}T.prototype=this;let D=new T(this);return ob(this,D),D.child=function(...B){return y.call(this,x,...B)},D.level=E.level||this.level,x.onChild(D),D}return u}function Ik(e){let t=e.customLevels||{},r=Object.assign({},Sr.levels.values,t),n=Object.assign({},Sr.levels.labels,Tk(t));return{values:r,labels:n}}function Tk(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}Sr.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"}};Sr.stdSerializers=xk;Sr.stdTimeFunctions=Object.assign({},{nullTime:ab,epochTime:sb,unixTime:Dk,isoTime:Mk});function _k(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[Yf];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function Mn(e,t,r,n){if(Object.defineProperty(e,n,{value:Hr(e.level,r)>Hr(n,r)?Qo:r[Jf][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===Qo){if(!t.transmit)return;let i=t.transmit.level||e.level,a=Hr(i,r);if(Hr(n,r)<a)return}e[n]=Ok(e,t,r,n);let o=_k(e);o.length!==0&&(e[n]=kk(o,e[n]))}function kk(e,t){return function(){return t.apply(this,[...e,...arguments])}}function Ok(e,t,r,n){return function(o){return function(){let a=t.timestamp(),s=new Array(arguments.length),c=Object.getPrototypeOf&&Object.getPrototypeOf(this)===pa?pa:this;for(var u=0;u<s.length;u++)s[u]=arguments[u];var h=!1;if(t.serialize&&(Zf(s,this._serialize,this.serializers,this._stdErrSerialize),h=!0),t.asObject||t.formatters?o.call(c,...Pk(this,n,s,a,t)):o.apply(c,s),t.transmit){let S=t.transmit.level||e._level,v=Hr(S,r),g=Hr(n,r);if(g<v)return;Nk(this,{ts:a,methodLevel:n,methodValue:g,transmitLevel:S,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:Hr(e._level,r)},s,h)}}}(e[Jf][n])}function Pk(e,t,r,n,o){let{level:i,log:a=S=>S}=o.formatters||{},s=r.slice(),c=s[0],u={},h=(e._childLevel|0)+1;if(h<1&&(h=1),n&&(u.time=n),i){let S=i(t,e.levels.values[t]);Object.assign(u,S)}else u.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(c!==null&&typeof c=="object")for(;h--&&typeof s[0]=="object";)Object.assign(u,s.shift());return[a(u),...s]}else{if(c!==null&&typeof c=="object"){for(;h--&&typeof s[0]=="object";)Object.assign(u,s.shift());c=s.length?nb(s.shift(),s):void 0}else typeof c=="string"&&(c=nb(s.shift(),s));return c!==void 0&&(u[o.messageKey]=c),[a(u)]}}function Zf(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=Sr.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let i in e[o])t.indexOf(i)>-1&&i in r&&(e[o][i]=r[i](e[o][i]))}function Nk(e,t,r,n=!1){let o=t.send,i=t.ts,a=t.methodLevel,s=t.methodValue,c=t.val,u=e._logEvent.bindings;n||Zf(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(h){return u.indexOf(h)===-1}),e._logEvent.level.label=a,e._logEvent.level.value=s,o(a,e._logEvent,c),e._logEvent=Xf(u)}function Xf(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function ib(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 Fk(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?ab:sb}function _u(){return{}}function Kf(e){return e}function Qo(){}function ab(){return!1}function sb(){return Date.now()}function Dk(){return Math.round(Date.now()/1e3)}function Mk(){return new Date(Date.now()).toISOString()}function qk(){function e(t){return typeof t<"u"&&t}try{return typeof b<"u"?b:(Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),b)}catch{return e(self)||e(window)||e(this)||{}}}ku.exports.default=Sr;ku.exports.pino=Sr});var qO={};Zo(qO,{DefaultFieldsToInclude:()=>ip,EcommerceDefaultFieldsToInclude:()=>Yb,HighlightUtils:()=>rl,MinimumFieldsToInclude:()=>Uu,ResultTemplatesHelpers:()=>ny,buildContext:()=>Sb,buildController:()=>zr,buildDictionaryFieldContext:()=>vb,buildInteractiveResult:()=>Hb,buildRecommendationEngine:()=>gb,buildRecommendationList:()=>Gb,buildResultTemplatesManager:()=>Zb,getAnalyticsNextApiBaseUrl:()=>Ia,getOrganizationEndpoint:()=>Je,getSampleRecommendationEngineConfiguration:()=>ep,loadAdvancedSearchQueryActions:()=>AO,loadClickAnalyticsActions:()=>NO,loadConfigurationActions:()=>xO,loadContextActions:()=>EO,loadDebugActions:()=>RO,loadDictionaryFieldContextActions:()=>IO,loadFieldActions:()=>kO,loadPaginationActions:()=>op,loadPipelineActions:()=>OO,loadRecommendationActions:()=>PO,loadSearchConfigurationActions:()=>CO,loadSearchHubActions:()=>MO});module.exports=cw(qO);m();d();p();f();var rl={};Zo(rl,{escapeHtml:()=>Gn,getHighlightedSuggestion:()=>qw,highlightString:()=>Mw});m();d();p();f();m();d();p();f();function kw(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 Jo(r)}var Jo=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},lt=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw Mb(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}},Oe=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&ie(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 ze(e){return e===void 0}function qb(e){return e===null}function ie(e){return ze(e)||qb(e)}var ue=class{constructor(e={}){we(this,"value");this.value=new Oe(e)}validate(e){let t=this.value.validate(e);return t||(jb(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function jb(e){return ze(e)||zf(e)}function zf(e){return typeof e=="boolean"}var te=class{constructor(e={}){we(this,"value");this.config=e,this.value=new Oe(e)}validate(e){let t=this.value.validate(e);return t||(Lb(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 Lb(e){return ze(e)||Wf(e)}function Wf(e){return typeof e=="number"&&!Number.isNaN(e)}var Vb=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,H=class{constructor(e={}){we(this,"value");we(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Oe(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(ze(e))return null;if(!aa(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(Vb.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 aa(e){return Object.prototype.toString.call(e)==="[object String]"}var ee=class{constructor(e={}){we(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(ze(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Kf(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&ie(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Kf(e){return e!==void 0&&typeof e=="object"}var ge=class{constructor(e={}){we(this,"value");this.config=e,this.value=new Oe(this.config)}validate(e){if(!ie(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(ie(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&&ie(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=` ${o}`)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return zf(e)||aa(e)||Wf(e)||Kf(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Yf(e){return Array.isArray(e)}var Iu=class{constructor(e){we(this,"value");this.config=e,this.value=new Oe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:ze(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};m();d();p();f();function Xf(e){return Array.isArray(e)}function sa(e){return e.trim()===""}var Ub=new Set(["1",1,"yes",!0]);function Jf(){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=>Ub.has(r))}function Zf(e){let t={};for(let[r,n]of e)t[r]=n;return t}function Zo(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function ca(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function Bb(e){if(sa(e.openingDelimiter)||sa(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(ie(e.content)||sa(e.content))return e.content;if(e.highlights.length===0)return Dn(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,s=a+i.length;if(s>t)break;r+=Dn(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Dn(e.content.slice(a,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=Dn(e.content.slice(n))),r}function $b(e,t){return e=Dn(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?Tu(n,t.notMatchDelimiters):o?Tu(o,t.exactMatchDelimiters):i?Tu(i,t.correctionDelimiters):r)}function Tu(e,t){return t?t.open+e+t.close:e}function Dn(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}m();d();p();f();var dp=_t(sp(),1);m();d();p();f();var Dt=new Error("Failed to load reducers."),Mn=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."}},Br=class extends Error{constructor(r,n){super();we(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};m();d();p();f();function cp(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function up(e){return typeof e!="object"||!e?!1:Object.values(e).every(gA)}function gA(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function lp(e){return e===429}var kt=class e{static call(t){return _asyncToGenerator(function*(){let r=hA(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,s=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let c=yield A(i,a);if(lp(c.status))throw c;return c});return function s(){return _ref.apply(this,arguments)}}();try{let c=yield(0,dp.backOff)(s,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(u){let h=u&&lp(u.status);return h&&(n.info("Platform retrying request"),yield new Promise(v=>setTimeout(v,1e3))),h});return function retry(_x2){return _ref2.apply(this,arguments)}}()});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new Mn;case 404:throw new Br(i,c.status);default:return n.info({response:c,requestInfo:o},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new Br(i):c}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:s,...c}=t,u=Zo(c);try{let h=yield o(t,n,a);return{...t,...h}}catch(h){i.error(h,"Platform request preprocessing failed. Returning default request options.")}return u})()}};function We(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function dr(e,t="prod"){return`${We(e,t)}/rest/search/v2`}function la(e,t="prod"){return`${We(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function hA(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,s=e.method==="POST"||e.method==="PUT",c=yA(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(s&&{body:c}),signal:a}}function yA(e,t){return t==="application/x-www-form-urlencoded"?up(e)?cp(e):"":JSON.stringify(e)}m();d();p();f();m();d();p();f();var da=e=>e;m();d();p();f();m();d();p();f();function fa(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function Mt(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:fa(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:fa(),extendedResults:{},searchAction:void 0}}m();d();p();f();function fr(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var pr=e=>{let{response:t}=e;return t.body?vA(e):SA(t)},vA=e=>AA(e)?wA(e):bA(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},SA=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function bA(e){return e.body.statusCode!==void 0}function AA(e){return e.body.exception!==void 0}var wA=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});m();d();p();f();var mr=class{constructor(){we(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new l.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};m();d();p();f();m();d();p();f();var ri=class{constructor(t){we(this,"_basePath");we(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};m();d();p();f();function fp(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}m();d();p();f();var Yt=(e,t,r,n)=>{let o=new ri(`${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 pp=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield kt.call({...Yt(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:fr(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=fp(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return xA(a)?{success:a}:{error:pr({response:r,body:a})}});return function pp(_x3,_x4){return _ref3.apply(this,arguments)}}();function xA(e){return typeof e=="string"}m();d();p();f();function CA(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function EA(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function pa(e,t){if(t&&e.name==="AbortError")return{error:EA(e)};if(e instanceof Br)return{error:CA(e)};throw e}var ma=class{constructor(t){this.options=t;we(this,"apiCallsQueues",{unknown:new mr,mainSearch:new mr,facetValues:new mr,foldingCollection:new mr,instantResults:new mr})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield kt.call({...Yt(t,"POST","application/json","/plan"),requestParams:fr(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return pa(r);let n=yield r.json();return IA(n)?{success:n}:{error:pr({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield kt.call({...Yt(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:fr(t),..._this3.options});if(r instanceof Error)return pa(r);let n=yield r.json(),o={response:r,body:n};return RA(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:pr(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(s=>kt.call({...Yt(t,"POST","application/json",""),requestParams:fr(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:s??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return pa(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return mp(i)?(a.body=gp(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:pr(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield kt.call({...Yt(t,"POST","application/json","/facet"),requestParams:fr(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 kt.call({...Yt(t,"POST","application/json",""),requestParams:fr(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if(mp(n)){let o={response:r,body:n};return o.body=gp(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:pr({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return pp(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield kt.call({...Yt(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return TA(n)?{success:n}:{error:pr({response:r,body:n})}})()}},ga=e=>e.success!==void 0,dt=e=>e.error!==void 0;function mp(e){return e.results!==void 0}function gp(e){let t=fa();return ie(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function RA(e){return e.completions!==void 0}function IA(e){return e.preprocessingOutput!==void 0}function TA(e){return e.fields!==void 0}m();d();p();f();var hp=e=>e,yp=e=>e,vp=e=>e;m();d();p();f();m();d();p();f();m();d();p();f();function Ke(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 _A=typeof Symbol=="function"&&Symbol.observable||"@@observable",Sp=_A,ju=()=>Math.random().toString(36).substring(7).split("").join("."),kA={INIT:`@@redux/INIT${ju()}`,REPLACE:`@@redux/REPLACE${ju()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ju()}`},ha=kA;function qt(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 Lu(e,t,r){if(typeof e!="function")throw new Error(Ke(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ke(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ke(1));return r(Lu)(e,t)}let n=e,o=t,i=new Map,a=i,s=0,c=!1;function u(){a===i&&(a=new Map,i.forEach((R,x)=>{a.set(x,R)}))}function h(){if(c)throw new Error(Ke(3));return o}function v(R){if(typeof R!="function")throw new Error(Ke(4));if(c)throw new Error(Ke(5));let x=!0;u();let I=s++;return a.set(I,R),function(){if(x){if(c)throw new Error(Ke(6));x=!1,u(),a.delete(I),i=null}}}function S(R){if(!qt(R))throw new Error(Ke(7));if(typeof R.type>"u")throw new Error(Ke(8));if(typeof R.type!="string")throw new Error(Ke(17));if(c)throw new Error(Ke(9));try{c=!0,o=n(o,R)}finally{c=!1}return(i=a).forEach(I=>{I()}),R}function g(R){if(typeof R!="function")throw new Error(Ke(10));n=R,S({type:ha.REPLACE})}function y(){let R=v;return{subscribe(x){if(typeof x!="object"||x===null)throw new Error(Ke(11));function I(){let _=x;_.next&&_.next(h())}return I(),{unsubscribe:R(I)}},[Sp](){return this}}}return S({type:ha.INIT}),{dispatch:S,subscribe:v,getState:h,replaceReducer:g,[Sp]:y}}function OA(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:ha.INIT})>"u")throw new Error(Ke(12));if(typeof r(void 0,{type:ha.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ke(13))})}function qn(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let s=t[a];typeof e[s]=="function"&&(r[s]=e[s])}let n=Object.keys(r),o,i;try{OA(r)}catch(a){i=a}return function(s={},c){if(i)throw i;let u=!1,h={};for(let v=0;v<n.length;v++){let S=n[v],g=r[S],y=s[S],C=g(y,c);if(typeof C>"u"){let R=c&&c.type;throw new Error(Ke(14))}h[S]=C,u=u||C!==y}return u=u||n.length!==Object.keys(s).length,u?h:s}}function jn(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function bp(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(Ke(15))},a={getState:o.getState,dispatch:(c,...u)=>i(c,...u)},s=e.map(c=>c(a));return i=jn(...s)(o.dispatch),{...o,dispatch:i}}}function Ln(e){return qt(e)&&"type"in e&&typeof e.type=="string"}m();d();p();f();var Ku=Symbol.for("immer-nothing"),ni=Symbol.for("immer-draftable"),ft=Symbol.for("immer-state");function Ye(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Vn=Object.getPrototypeOf;function vt(e){return!!e&&!!e[ft]}function pt(e){return e?Rp(e)||Array.isArray(e)||!!e[ni]||!!e.constructor?.[ni]||Un(e)||ui(e):!1}var PA=Object.prototype.constructor.toString(),Ap=new WeakMap;function Rp(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=Ap.get(r);return n===void 0&&(n=Function.toString.call(r),Ap.set(r,n)),n===PA}function Yu(e){return vt(e)||Ye(15,e),e[ft].base_}function oi(e,t,r=!0){Gr(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 Gr(e){let t=e[ft];return t?t.type_:Array.isArray(e)?1:Un(e)?2:ui(e)?3:0}function ii(e,t){return Gr(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Vu(e,t){return Gr(e)===2?e.get(t):e[t]}function Ip(e,t,r){let n=Gr(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function NA(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Un(e){return e instanceof Map}function ui(e){return e instanceof Set}function $r(e){return e.copy_||e.base_}function $u(e,t){if(Un(e))return new Map(e);if(ui(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Rp(e);if(t===!0||t==="class_only"&&!r){let n=Object.getOwnPropertyDescriptors(e);delete n[ft];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],s=n[a];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[a]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[a]})}return Object.create(Vn(e),n)}else{let n=Vn(e);if(n!==null&&r)return{...e};let o=Object.create(n);return Object.assign(o,e)}}function ba(e,t=!1){return Aa(e)||vt(e)||!pt(e)||(Gr(e)>1&&Object.defineProperties(e,{set:ya,add:ya,clear:ya,delete:ya}),Object.freeze(e),t&&Object.values(e).forEach(r=>ba(r,!0))),e}function FA(){Ye(2)}var ya={value:FA};function Aa(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Gu={};function Qr(e){let t=Gu[e];return t||Ye(0,e),t}function DA(e,t){Gu[e]||(Gu[e]=t)}var ai;function Tp(){return ai}function MA(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function wp(e,t){t&&(Qr("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Qu(e){Hu(e),e.drafts_.forEach(qA),e.drafts_=null}function Hu(e){e===ai&&(ai=e.parent_)}function xp(e){return ai=MA(ai,e)}function qA(e){let t=e[ft];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Cp(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[ft].modified_&&(Qu(t),Ye(4)),pt(e)&&(e=va(t,e),t.parent_||Sa(t,e)),t.patches_&&Qr("Patches").generateReplacementPatches_(r[ft].base_,e,t.patches_,t.inversePatches_)):e=va(t,r,[]),Qu(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ku?e:void 0}function va(e,t,r){if(Aa(t))return t;let n=e.immer_.shouldUseStrictIteration(),o=t[ft];if(!o)return oi(t,(i,a)=>Ep(e,o,t,i,a,r),n),t;if(o.scope_!==e)return t;if(!o.modified_)return Sa(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;let i=o.copy_,a=i,s=!1;o.type_===3&&(a=new Set(i),i.clear(),s=!0),oi(a,(c,u)=>Ep(e,o,i,c,u,r,s),n),Sa(e,i,!1),r&&e.patches_&&Qr("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function Ep(e,t,r,n,o,i,a){if(o==null||typeof o!="object"&&!a)return;let s=Aa(o);if(!(s&&!a)){if(vt(o)){let c=i&&t&&t.type_!==3&&!ii(t.assigned_,n)?i.concat(n):void 0,u=va(e,o,c);if(Ip(r,n,u),vt(u))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(pt(o)&&!s){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===o&&s)return;va(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Un(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Sa(e,o)}}}function Sa(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ba(t,r)}function jA(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Tp(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=n,i=Xu;r&&(o=[n],i=si);let{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,s}var Xu={get(e,t){if(t===ft)return e;let r=$r(e);if(!ii(r,t))return LA(e,r,t);let n=r[t];return e.finalized_||!pt(n)?n:n===Uu(e.base_,t)?(Bu(e),e.copy_[t]=Wu(n,e)):n},has(e,t){return t in $r(e)},ownKeys(e){return Reflect.ownKeys($r(e))},set(e,t,r){let n=_p($r(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=Uu($r(e),t),i=o?.[ft];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(NA(r,o)&&(r!==void 0||ii(e.base_,t)))return!0;Bu(e),zu(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 Uu(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Bu(e),zu(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=$r(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Ye(11)},getPrototypeOf(e){return Vn(e.base_)},setPrototypeOf(){Ye(12)}},si={};oi(Xu,(e,t)=>{si[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});si.deleteProperty=function(e,t){return si.set.call(this,e,t,void 0)};si.set=function(e,t,r){return Xu.set.call(this,e[0],t,r,e[0])};function Uu(e,t){let r=e[ft];return(r?$r(r):e)[t]}function LA(e,t,r){let n=_p(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function _p(e,t){if(!(t in e))return;let r=Vn(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Vn(r)}}function zu(e){e.modified_||(e.modified_=!0,e.parent_&&zu(e.parent_))}function Bu(e){e.copy_||(e.copy_=$u(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var VA=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 i=r;r=t;let a=this;return function(c=i,...u){return a.produce(c,h=>r.call(this,h,...u))}}typeof r!="function"&&Ye(6),n!==void 0&&typeof n!="function"&&Ye(7);let o;if(pt(t)){let i=xp(this),a=Wu(t,void 0),s=!0;try{o=r(a),s=!1}finally{s?Qu(i):Hu(i)}return wp(i,n),Cp(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===Ku&&(o=void 0),this.autoFreeze_&&ba(o,!0),n){let i=[],a=[];Qr("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else Ye(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...s)=>this.produceWithPatches(a,c=>t(c,...s));let n,o;return[this.produce(t,r,(a,s)=>{n=a,o=s}),n,o]},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){pt(e)||Ye(8),vt(e)&&(e=kp(e));let t=xp(this),r=Wu(e,void 0);return r[ft].isManual_=!0,Hu(t),r}finishDraft(e,t){let r=e&&e[ft];(!r||!r.isManual_)&&Ye(9);let{scope_:n}=r;return wp(n,t),Cp(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=Qr("Patches").applyPatches_;return vt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Wu(e,t){let r=Un(e)?Qr("MapSet").proxyMap_(e,t):ui(e)?Qr("MapSet").proxySet_(e,t):jA(e,t);return(t?t.scope_:Tp()).drafts_.push(r),r}function kp(e){return vt(e)||Ye(10,e),Op(e)}function Op(e){if(!pt(e)||Aa(e))return e;let t=e[ft],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=$u(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=$u(e,!0);return oi(r,(o,i)=>{Ip(r,o,Op(i))},n),t&&(t.finalized_=!1),r}function Pp(){let t="replace",r="add",n="remove";function o(S,g,y,C){switch(S.type_){case 0:case 2:return a(S,g,y,C);case 1:return i(S,g,y,C);case 3:return s(S,g,y,C)}}function i(S,g,y,C){let{base_:R,assigned_:x}=S,I=S.copy_;I.length<R.length&&([R,I]=[I,R],[y,C]=[C,y]);for(let T=0;T<R.length;T++)if(x[T]&&I[T]!==R[T]){let _=g.concat([T]);y.push({op:t,path:_,value:v(I[T])}),C.push({op:t,path:_,value:v(R[T])})}for(let T=R.length;T<I.length;T++){let _=g.concat([T]);y.push({op:r,path:_,value:v(I[T])})}for(let T=I.length-1;R.length<=T;--T){let _=g.concat([T]);C.push({op:n,path:_})}}function a(S,g,y,C){let{base_:R,copy_:x}=S;oi(S.assigned_,(I,T)=>{let _=Vu(R,I),j=Vu(x,I),N=T?ii(R,I)?t:r:n;if(_===j&&N===t)return;let k=g.concat(I);y.push(N===n?{op:N,path:k}:{op:N,path:k,value:j}),C.push(N===r?{op:n,path:k}:N===n?{op:r,path:k,value:v(_)}:{op:t,path:k,value:v(_)})})}function s(S,g,y,C){let{base_:R,copy_:x}=S,I=0;R.forEach(T=>{if(!x.has(T)){let _=g.concat([I]);y.push({op:n,path:_,value:T}),C.unshift({op:r,path:_,value:T})}I++}),I=0,x.forEach(T=>{if(!R.has(T)){let _=g.concat([I]);y.push({op:r,path:_,value:T}),C.unshift({op:n,path:_,value:T})}I++})}function c(S,g,y,C){y.push({op:t,path:[],value:g===Ku?void 0:g}),C.push({op:t,path:[],value:S})}function u(S,g){return g.forEach(y=>{let{path:C,op:R}=y,x=S;for(let j=0;j<C.length-1;j++){let N=Gr(x),k=C[j];typeof k!="string"&&typeof k!="number"&&(k=""+k),(N===0||N===1)&&(k==="__proto__"||k==="constructor")&&Ye(19),typeof x=="function"&&k==="prototype"&&Ye(19),x=Vu(x,k),typeof x!="object"&&Ye(18,C.join("/"))}let I=Gr(x),T=h(y.value),_=C[C.length-1];switch(R){case t:switch(I){case 2:return x.set(_,T);case 3:Ye(16);default:return x[_]=T}case r:switch(I){case 1:return _==="-"?x.push(T):x.splice(_,0,T);case 2:return x.set(_,T);case 3:return x.add(T);default:return x[_]=T}case n:switch(I){case 1:return x.splice(_,1);case 2:return x.delete(_);case 3:return x.delete(y.value);default:return delete x[_]}default:Ye(17,R)}}),S}function h(S){if(!pt(S))return S;if(Array.isArray(S))return S.map(h);if(Un(S))return new Map(Array.from(S.entries()).map(([y,C])=>[y,h(C)]));if(ui(S))return new Set(Array.from(S).map(h));let g=Object.create(Vn(S));for(let y in S)g[y]=h(S[y]);return ii(S,ni)&&(g[ni]=S[ni]),g}function v(S){return vt(S)?h(S):S}DA("Patches",{applyPatches_:u,generatePatches_:o,generateReplacementPatches_:c})}var ci=new VA,Xt=ci.produce,wa=ci.produceWithPatches.bind(ci);var Ju=ci.applyPatches.bind(ci);m();d();p();f();function UA(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function BA(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function $A(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 Np=e=>Array.isArray(e)?e:[e];function GA(e){let t=Array.isArray(e[0])?e[0]:e;return $A(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function QA(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var mF=Object.getPrototypeOf({});var HA=class{constructor(e){this.value=e}deref(){return this.value}},zA=typeof WeakRef<"u"?WeakRef:HA,WA=0,Fp=1;function xa(){return{s:WA,v:void 0,o:null,p:null}}function Bn(e,t={}){let r=xa(),{resultEqualityCheck:n}=t,o,i=0;function a(){let s=r,{length:c}=arguments;for(let v=0,S=c;v<S;v++){let g=arguments[v];if(typeof g=="function"||typeof g=="object"&&g!==null){let y=s.o;y===null&&(s.o=y=new WeakMap);let C=y.get(g);C===void 0?(s=xa(),y.set(g,s)):s=C}else{let y=s.p;y===null&&(s.p=y=new Map);let C=y.get(g);C===void 0?(s=xa(),y.set(g,s)):s=C}}let u=s,h;if(s.s===Fp)h=s.v;else if(h=e.apply(null,arguments),i++,n){let v=o?.deref?.()??o;v!=null&&n(v,h)&&(h=v,i!==0&&i--),o=typeof h=="object"&&h!==null||typeof h=="function"?new zA(h):h}return u.s=Fp,u.v=h,h}return a.clearCache=()=>{r=xa(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function Dp(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,s,c={},u=o.pop();typeof u=="object"&&(c=u,u=o.pop()),UA(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);let h={...r,...c},{memoize:v,memoizeOptions:S=[],argsMemoize:g=Bn,argsMemoizeOptions:y=[],devModeChecks:C={}}=h,R=Np(S),x=Np(y),I=GA(o),T=v(function(){return i++,u.apply(null,arguments)},...R),_=!0,j=g(function(){a++;let k=QA(I,arguments);return s=T.apply(null,k),s},...x);return Object.assign(j,{resultFunc:u,memoizedResultFunc:T,dependencies:I,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:v,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var Ve=Dp(Bn),KA=Object.assign((e,t=Ve)=>{BA(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(i=>e[i]);return t(n,(...i)=>i.reduce((a,s,c)=>(a[r[c]]=s,a),{}))},{withTypes:()=>KA});m();d();p();f();function Mp(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var qp=Mp(),jp=Mp;var YA=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?jn:jn.apply(null,arguments)},PF=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},XA=e=>e&&typeof e.match=="function";function P(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(st(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=>Ln(n)&&n.type===e,r}var Hp=class li extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,li.prototype)}static get[Symbol.species](){return li}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new li(...t[0].concat(this)):new li(...t.concat(this))}};function Lp(e){return pt(e)?Xt(e,()=>{}):e}function Vp(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function JA(e){return typeof e=="boolean"}var ZA=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Hp;return r&&(JA(r)?a.push(qp):a.push(jp(r.extraArgument))),a},di="RTK_autoBatch",Qn=()=>e=>({payload:e,meta:{[di]:!0}}),Up=e=>t=>{setTimeout(t,e)},ew=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Up(10):e.type==="callback"?e.queueNotification:Up(e.timeout),u=()=>{a=!1,i&&(i=!1,s.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let v=()=>o&&h(),S=n.subscribe(v);return s.add(h),()=>{S(),s.delete(h)}},dispatch(h){try{return o=!h?.meta?.[di],i=!o,i&&(a||(a=!0,c(u))),n.dispatch(h)}finally{o=!0}}})},tw=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Hp(e);return n&&o.push(ew(typeof n=="object"?n:void 0)),o};function zp(e){let t=ZA(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},s;if(typeof r=="function")s=r;else if(qt(r))s=qn(r);else throw new Error(st(1));let c;typeof n=="function"?c=n(t):c=t();let u=jn;o&&(u=YA({trace:!1,...(typeof o=="object"&&o)}));let h=bp(...c),v=tw(h),S=typeof a=="function"?a(v):v(),g=u(...S);return Lu(s,i,g)}function Wp(e){let t={},r=[],n,o={addCase(i,a){let s=typeof i=="string"?i:i.type;if(!s)throw new Error(st(28));if(s in t)throw new Error(st(29));return t[s]=a,o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function rw(e){return typeof e=="function"}function Me(e,t){let[r,n,o]=Wp(t),i;if(rw(e))i=()=>Lp(e());else{let s=Lp(e);i=()=>s}function a(s=i(),c){let u=[r[c.type],...n.filter(({matcher:h})=>h(c)).map(({reducer:h})=>h)];return u.filter(h=>!!h).length===0&&(u=[o]),u.reduce((h,v)=>{if(v)if(vt(h)){let g=v(h,c);return g===void 0?h:g}else{if(pt(h))return Xt(h,S=>v(S,c));{let S=v(h,c);if(S===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}}return h},s)}return a.getInitialState=i,a}var Kp=(e,t)=>XA(e)?e.match(t):e(t);function jt(...e){return t=>e.some(r=>Kp(r,t))}function Gn(...e){return t=>e.every(r=>Kp(r,t))}function Ia(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 fi(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Ta(...e){return e.length===0?t=>Ia(t,["pending"]):fi(e)?jt(...e.map(t=>t.pending)):Ta()(e[0])}function Wr(...e){return e.length===0?t=>Ia(t,["rejected"]):fi(e)?jt(...e.map(t=>t.rejected)):Wr()(e[0])}function pi(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Gn(Wr(...e),t):fi(e)?Gn(Wr(...e),t):pi()(e[0])}function Jt(...e){return e.length===0?t=>Ia(t,["fulfilled"]):fi(e)?jt(...e.map(t=>t.fulfilled)):Jt()(e[0])}function _a(...e){return e.length===0?t=>Ia(t,["pending","fulfilled","rejected"]):fi(e)?jt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):_a()(e[0])}var nw="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",mi=(e=21)=>{let t="",r=e;for(;r--;)t+=nw[Math.random()*64|0];return t},ow=["name","message","stack","code"],Zu=class{constructor(e,t){we(this,"_type");this.payload=e,this.meta=t}},Bp=class{constructor(e,t){we(this,"_type");this.payload=e,this.meta=t}},iw=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of ow)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},Ee=(()=>{function e(t,r,n){let o=P(t+"/fulfilled",(c,u,h,v)=>({payload:c,meta:{...(v||{}),arg:h,requestId:u,requestStatus:"fulfilled"}})),i=P(t+"/pending",(c,u,h)=>({payload:void 0,meta:{...(h||{}),arg:u,requestId:c,requestStatus:"pending"}})),a=P(t+"/rejected",(c,u,h,v,S)=>({payload:v,error:(n&&n.serializeError||iw)(c||"Rejected"),meta:{...(S||{}),arg:h,requestId:u,rejectedWithValue:!!v,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function s(c){return(u,h,v)=>{let S=n?.idGenerator?n.idGenerator(c):mi(),g=new l.AbortController,y,C;function R(I){C=I,g.abort()}let x=_asyncToGenerator(function*(){let I;try{let _=n?.condition?.(c,{getState:h,extra:v});if(sw(_)&&(_=yield _),_===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let j=new Promise((N,k)=>{y=()=>{k({name:"AbortError",message:C||"Aborted"})},g.signal.addEventListener("abort",y)});u(i(S,c,n?.getPendingMeta?.({requestId:S,arg:c},{getState:h,extra:v}))),I=yield Promise.race([j,Promise.resolve(r(c,{dispatch:u,getState:h,extra:v,requestId:S,signal:g.signal,abort:R,rejectWithValue:(N,k)=>new Zu(N,k),fulfillWithValue:(N,k)=>new Bp(N,k)})).then(N=>{if(N instanceof Zu)throw N;return N instanceof Bp?o(N.payload,S,c,N.meta):o(N,S,c)})])}catch(_){I=_ instanceof Zu?a(null,S,c,_.payload,_.meta):a(_,S,c)}finally{y&&g.signal.removeEventListener("abort",y)}return n&&!n.dispatchConditionRejection&&a.match(I)&&I.meta.condition||u(I),I})();return Object.assign(x,{abort:R,requestId:S,arg:c,unwrap(){return x.then(aw)}})}}return Object.assign(s,{pending:i,rejected:a,fulfilled:o,settled:jt(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function aw(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function sw(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Yp=Symbol.for("rtk-slice-createasyncthunk"),qF={[Yp]:Ee};function cw(e,t){return`${e}/${t}`}function uw({creators:e}={}){let t=e?.asyncThunk?.[Yp];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(st(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(dw()):n.reducers)||{},s=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(I,T){let _=typeof I=="string"?I:I.type;if(!_)throw new Error(st(12));if(_ in c.sliceCaseReducersByType)throw new Error(st(13));return c.sliceCaseReducersByType[_]=T,u},addMatcher(I,T){return c.sliceMatchers.push({matcher:I,reducer:T}),u},exposeAction(I,T){return c.actionCreators[I]=T,u},exposeCaseReducer(I,T){return c.sliceCaseReducersByName[I]=T,u}};s.forEach(I=>{let T=a[I],_={reducerName:I,type:cw(o,I),createNotation:typeof n.reducers=="function"};pw(T)?gw(_,T,u,t):fw(_,T,u)});function h(){let[I={},T=[],_=void 0]=typeof n.extraReducers=="function"?Wp(n.extraReducers):[n.extraReducers],j={...I,...c.sliceCaseReducersByType};return Me(n.initialState,N=>{for(let k in j)N.addCase(k,j[k]);for(let k of c.sliceMatchers)N.addMatcher(k.matcher,k.reducer);for(let k of T)N.addMatcher(k.matcher,k.reducer);_&&N.addDefaultCase(_)})}let v=I=>I,S=new Map,g;function y(I,T){return g||(g=h()),g(I,T)}function C(){return g||(g=h()),g.getInitialState()}function R(I,T=!1){function _(N){let k=N[I];return typeof k>"u"&&T&&(k=C()),k}function j(N=v){let k=Vp(S,T,()=>new WeakMap);return Vp(k,N,()=>{let O={};for(let[D,V]of Object.entries(n.selectors??{}))O[D]=lw(V,N,C,T);return O})}return{reducerPath:I,getSelectors:j,get selectors(){return j(_)},selectSlice:_}}let x={name:o,reducer:y,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:C,...R(i),injectInto(I,{reducerPath:T,..._}={}){let j=T??i;return I.inject({reducerPath:j,reducer:y},_),{...x,...R(j,!0)}}};return x}}function lw(e,t,r,n){function o(i,...a){let s=t(i);return typeof s>"u"&&n&&(s=r()),e(s,...a)}return o.unwrapped=e,o}var Kr=uw();function dw(){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 fw({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!mw(n))throw new Error(st(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?P(e,a):P(e))}function pw(e){return e._reducerDefinitionType==="asyncThunk"}function mw(e){return e._reducerDefinitionType==="reducerWithPrepare"}function gw({type:e,reducerName:t},r,n,o){if(!o)throw new Error(st(18));let{payloadCreator:i,fulfilled:a,pending:s,rejected:c,settled:u,options:h}=r,v=o(e,i,h);n.exposeAction(t,v),a&&n.addCase(v.fulfilled,a),s&&n.addCase(v.pending,s),c&&n.addCase(v.rejected,c),u&&n.addMatcher(v.settled,u),n.exposeCaseReducer(t,{fulfilled:a||Ca,pending:s||Ca,rejected:c||Ca,settled:u||Ca})}function Ca(){}var hw="task",Xp="listener",Jp="completed",rl="cancelled",yw=`task-${rl}`,vw=`task-${Jp}`,el=`${Xp}-${rl}`,Sw=`${Xp}-${Jp}`,ka=class{constructor(e){we(this,"name","TaskAbortError");we(this,"message");this.code=e,this.message=`${hw} ${rl} (reason: ${e})`}},nl=(e,t)=>{if(typeof e!="function")throw new TypeError(st(32))},Ea=()=>{},Zp=(e,t=Ea)=>(e.catch(t),e),em=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Hr=(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))},zr=e=>{if(e.aborted){let{reason:t}=e;throw new ka(t)}};function tm(e,t){let r=Ea;return new Promise((n,o)=>{let i=()=>o(new ka(e.reason));if(e.aborted){i();return}r=em(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Ea})}var bw=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof ka?"cancelled":"rejected",error:r}}finally{t?.()}});return function bw(_x5,_x6){return _ref5.apply(this,arguments)}}(),Ra=e=>t=>Zp(tm(e,t).then(r=>(zr(e),r))),rm=e=>{let t=Ra(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:$n}=Object,$p={},Oa="listenerMiddleware",Aw=(e,t)=>{let r=n=>em(e,()=>Hr(n,e.reason));return(n,o)=>{nl(n,"taskExecutor");let i=new l.AbortController;r(i);let a=bw(/*#__PURE__*/_asyncToGenerator(function*(){zr(e),zr(i.signal);let s=yield n({pause:Ra(i.signal),delay:rm(i.signal),signal:i.signal});return zr(i.signal),s}),()=>Hr(i,vw));return o?.autoJoin&&t.push(a.catch(Ea)),{result:Ra(e)(a),cancel(){Hr(i,yw)}}}},ww=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){zr(t);let i=()=>{},s=[new Promise((c,u)=>{let h=e({predicate:n,effect:(v,S)=>{S.unsubscribe(),c([v,S.getState(),S.getOriginalState()])}});i=()=>{h(),u()}})];o!=null&&s.push(new Promise(c=>setTimeout(c,o,null)));try{let c=yield tm(t,Promise.race(s));return zr(t),c}finally{i()}});return function r(_x7,_x8){return _ref7.apply(this,arguments)}}();return(n,o)=>Zp(r(n,o))},nm=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=P(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(st(21));return nl(i,"options.listener"),{predicate:o,type:t,effect:i}},om=$n(e=>{let{type:t,predicate:r,effect:n}=nm(e);return{id:mi(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(st(22))}}},{withTypes:()=>om}),Gp=(e,t)=>{let{type:r,effect:n,predicate:o}=nm(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},tl=e=>{e.pending.forEach(t=>{Hr(t,el)})},xw=e=>()=>{e.forEach(tl),e.clear()},Qp=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},im=$n(P(`${Oa}/add`),{withTypes:()=>im}),Cw=P(`${Oa}/removeAll`),am=$n(P(`${Oa}/remove`),{withTypes:()=>am}),Ew=(...e)=>{console.error(`${Oa}/error`,...e)},sm=(e={})=>{let t=new Map,{extra:r,onError:n=Ew}=e;nl(n,"onError");let o=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),v=>{h.unsubscribe(),v?.cancelActive&&tl(h)}),i=h=>{let v=Gp(t,h)??om(h);return o(v)};$n(i,{withTypes:()=>i});let a=h=>{let v=Gp(t,h);return v&&(v.unsubscribe(),h.cancelActive&&tl(v)),!!v};$n(a,{withTypes:()=>a});let s=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(h,v,S,g){let y=new l.AbortController,C=ww(i,y.signal),R=[];try{h.pending.add(y),yield Promise.resolve(h.effect(v,$n({},S,{getOriginalState:g,condition:(x,I)=>C(x,I).then(Boolean),take:C,delay:rm(y.signal),pause:Ra(y.signal),extra:r,signal:y.signal,fork:Aw(y.signal,R),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((x,I,T)=>{x!==y&&(Hr(x,el),T.delete(x))})},cancel:()=>{Hr(y,el),h.pending.delete(y)},throwIfCancelled:()=>{zr(y.signal)}})))}catch(x){x instanceof ka||Qp(n,x,{raisedBy:"effect"})}finally{yield Promise.all(R),Hr(y,Sw),h.pending.delete(y)}});return function s(_x9,_x0,_x1,_x10){return _ref8.apply(this,arguments)}}(),c=xw(t);return{middleware:h=>v=>S=>{if(!Ln(S))return v(S);if(im.match(S))return i(S.payload);if(Cw.match(S)){c();return}if(am.match(S))return a(S.payload);let g=h.getState(),y=()=>{if(g===$p)throw new Error(st(23));return g},C;try{if(C=v(S),t.size>0){let R=h.getState(),x=Array.from(t.values());for(let I of x){let T=!1;try{T=I.predicate(S,R,g)}catch(_){T=!1,Qp(n,_,{raisedBy:"predicate"})}T&&s(I,S,h,y)}}}finally{g=$p}return C},startListening:i,stopListening:a,clearListeners:c}};function st(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}m();d();p();f();var X=new H({required:!0,emptyAllowed:!1}),Xe=new H({required:!1,emptyAllowed:!1}),Je=new H({required:!0,emptyAllowed:!0}),YF=new H({required:!1,emptyAllowed:!0}),Pa=new ge({each:X,required:!0}),cm=new H({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),um=new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),XF=new H({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),Zt=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),At=(e,t)=>{if("required"in t)return{payload:new lt({value:t}).validate({value:e}).value};let o=new ee({options:{required:!0},values:t}).validate(e);if(o)throw new Jo(o);return{payload:e}},q=(e,t)=>{try{return At(e,t)}catch(r){return{payload:e,error:Zt(r)}}},lm=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return fm(e,t,r,o,"Controller initialization error")},dm=(e,t,r,n)=>{let o=`Check the options of ${n}`;return fm(e,t,r,o,"Controller initialization error")},fm=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};m();d();p();f();var Hn="3.47.2",pm=["@coveo/atomic","@coveo/quantic"];var ol=()=>Xe,mm=()=>X,gr=P("configuration/updateBasicConfiguration",e=>q(e,{accessToken:Xe,environment:new H({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:Xe})),Lt=P("configuration/updateSearchConfiguration",e=>q(e,{proxyBaseUrl:new H({required:!1,url:!0}),pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Xe,timezone:Xe,locale:Xe,authenticationProviders:new ge({required:!1,each:X})})),Rw={enabled:new ue({default:!0}),originContext:ol(),originLevel2:ol(),originLevel3:ol(),proxyBaseUrl:new H({required:!1,url:!0}),runtimeEnvironment:new Oe,anonymous:new ue({default:!1}),deviceId:Xe,userDisplayName:Xe,documentLocation:Xe,trackingId:um,analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new ee({options:{required:!1},values:pm.reduce((e,t)=>(e[t]=cm,e),{})})},zn=P("configuration/updateAnalyticsConfiguration",e=>q(e,Rw)),Wn=P("configuration/analytics/disable"),Kn=P("configuration/analytics/enable"),Na=P("configuration/analytics/originlevel2",e=>q(e,{originLevel2:mm()})),Fa=P("configuration/analytics/originlevel3",e=>q(e,{originLevel3:mm()})),gm=P("knowledge/setAgentId",e=>q(e,new H({required:!0})));m();d();p();f();m();d();p();f();m();d();p();f();var hm={q:new H,enableQuerySyntax:new ue,aq:new H,cq:new H,firstResult:new te({min:0}),numberOfResults:new te({min:0}),sortCriteria:new H,f:new ee,fExcluded:new ee,cf:new ee,nf:new ee,mnf:new ee,df:new ee,debug:new ue,sf:new ee,tab:new H,af:new ee};var hr=P("searchParameters/restore",e=>q(e,hm)),ym=P("searchParameters/restoreTab",e=>q(e,X));m();d();p();f();var Da=P("debug/enable"),Ma=P("debug/disable");m();d();p();f();var qa=()=>!1;var ja=Me(qa(),e=>{e.addCase(Da,()=>!0).addCase(Ma,()=>!1).addCase(hr,(t,r)=>r.payload.debug??t)});m();d();p();f();var Yn=P("pipeline/set",e=>q(e,new H({required:!0,emptyAllowed:!0})));m();d();p();f();m();d();p();f();var Iw=P("history/undo"),Tw=P("history/redo"),Vt=P("history/snapshot"),aM=Ee("history/back",/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(e,{dispatch:t}){t(Iw()),yield t(mt())});return function(_x11,_x12){return _ref9.apply(this,arguments)}}()),sM=Ee("history/forward",/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(e,{dispatch:t}){t(Tw()),yield t(mt())});return function(_x13,_x14){return _ref0.apply(this,arguments)}}()),mt=Ee("history/change",/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x15,_x16){return _ref1.apply(this,arguments)}}());m();d();p();f();var Xn=()=>"";var Jn=Me(Xn(),e=>{e.addCase(Yn,(t,r)=>r.payload).addCase(mt.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Lt,(t,r)=>r.payload.pipeline||t)});m();d();p();f();m();d();p();f();var La=P("app/setError");m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();var Zn=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let s=window.location.hostname,c=/^(\d{1,3}\.){3}\d{1,3}$/,u=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;c.test(s)||u.test(s)||s.indexOf(".")===-1?il(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],il(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function il(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}m();d();p();f();function _w(){return typeof navigator<"u"}function vm(){try{return typeof localStorage<"u"}catch{return!1}}function Sm(){try{return typeof sessionStorage<"u"}catch{return!1}}function bm(){return!!(_w()&&navigator.cookieEnabled)}var Am=null;function wm(){return Am||(vm()?localStorage:bm()?new al:Sm()?sessionStorage:new sl)}var eo=class eo{getItem(t){return Zn.get(`${eo.prefix}${t}`)}removeItem(t){Zn.erase(`${eo.prefix}${t}`)}setItem(t,r,n){Zn.set(`${eo.prefix}${t}`,r,n)}};we(eo,"prefix","coveo_");var al=eo;var sl=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var Va="__coveo.analytics.history",kw=20,Ow=1e3*60,Pw=75,Yr=class Yr{constructor(t){we(this,"store");this.store=t||wm()}static getInstance(t){return Yr.instance||(Yr.instance=new Yr(t)),Yr.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(Va);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(Va);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(Va,JSON.stringify(t.slice(0,kw)))}catch{}}clear(){try{this.store.removeItem(Va)}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,Pw)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>Ow:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};we(Yr,"instance",null);var cl=Yr,wt=cl;m();d();p();f();m();d();p();f();var to=Ve(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Hn}`));m();d();p();f();m();d();p();f();function er(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 M(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(v){a(v)}}function c(h){try{u(n.throw(h))}catch(v){a(v)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}var ve;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ve||(ve={}));function dl(){return typeof window<"u"}function Cl(){return typeof navigator<"u"}function ro(){return typeof document<"u"}function fl(){try{return typeof localStorage<"u"}catch{return!1}}function Nw(){try{return typeof sessionStorage<"u"}catch{return!1}}function Mm(){return Cl()&&navigator.cookieEnabled}var Fw=[ve.click,ve.custom,ve.search,ve.view],Dw=(e,t)=>Fw.indexOf(e)!==-1?Object.assign({language:ro()?document.documentElement.lang:"unknown",userAgent:Cl()?navigator.userAgent:"unknown"},t):t,hi=class e{static set(t,r,n){var o,i,a,s;n&&(i=new Date,i.setTime(i.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?xm(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],xm(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function xm(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function Mw(){return fl()?localStorage:Mm()?new yi:Nw()?sessionStorage:new oo}var yi=class e{getItem(t){return hi.get(`${e.prefix}${t}`)}removeItem(t){hi.erase(`${e.prefix}${t}`)}setItem(t,r,n){hi.set(`${e.prefix}${t}`,r,n)}};yi.prefix="coveo_";var pl=class{constructor(){this.cookieStorage=new yi}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)}},oo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},Ua="__coveo.analytics.history",qw=20,jw=1e3*60,Lw=75,Ga=class{constructor(t){this.store=t||Mw()}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 M(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 M(this,void 0,void 0,function*(){let t=yield this.getHistoryWithInternalTimeAsync();return this.stripEmptyQueries(this.stripInternalTime(t))})}getHistoryWithInternalTime(){try{let t=this.store.getItem(Ua);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){return M(this,void 0,void 0,function*(){try{let t=yield this.store.getItem(Ua);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(Ua,JSON.stringify(t.slice(0,qw)))}catch{}}clear(){try{this.store.removeItem(Ua)}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,Lw)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>jw:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var Vw=(e,t)=>M(void 0,void 0,void 0,function*(){return e===ve.view?(yield Uw(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Uw=e=>M(void 0,void 0,void 0,function*(){let t=new Ga,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),Ba,Bw=new Uint8Array(16);function $w(){if(!Ba&&(Ba=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ba))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ba(Bw)}var Gw=/^(?:[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 Qa(e){return typeof e=="string"&&Gw.test(e)}var Ze=[];for(let e=0;e<256;++e)Ze.push((e+256).toString(16).slice(1));function qm(e,t=0){return Ze[e[t+0]]+Ze[e[t+1]]+Ze[e[t+2]]+Ze[e[t+3]]+"-"+Ze[e[t+4]]+Ze[e[t+5]]+"-"+Ze[e[t+6]]+Ze[e[t+7]]+"-"+Ze[e[t+8]]+Ze[e[t+9]]+"-"+Ze[e[t+10]]+Ze[e[t+11]]+Ze[e[t+12]]+Ze[e[t+13]]+Ze[e[t+14]]+Ze[e[t+15]]}function Qw(e){if(!Qa(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 Hw(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var zw="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Ww="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Kw(e,t,r){function n(o,i,a,s){var c;if(typeof o=="string"&&(o=Hw(o)),typeof i=="string"&&(i=Qw(i)),((c=i)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+o.length);if(u.set(i),u.set(o,i.length),u=r(u),u[6]=u[6]&15|t,u[8]=u[8]&63|128,a){s=s||0;for(let h=0;h<16;++h)a[s+h]=u[h];return a}return qm(u)}try{n.name=e}catch{}return n.DNS=zw,n.URL=Ww,n}var Yw=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Cm={randomUUID:Yw};function Xr(e,t,r){if(Cm.randomUUID&&!t&&!e)return Cm.randomUUID();e=e||{};let n=e.random||(e.rng||$w)();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 qm(n)}function Xw(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 ul(e,t){return e<<t|e>>>32-t}function Jw(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let s=0;s<a.length;++s)e.push(a.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let s=new Uint32Array(16);for(let c=0;c<16;++c)s[c]=e[a*64+c*4]<<24|e[a*64+c*4+1]<<16|e[a*64+c*4+2]<<8|e[a*64+c*4+3];i[a]=s}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let s=new Uint32Array(80);for(let g=0;g<16;++g)s[g]=i[a][g];for(let g=16;g<80;++g)s[g]=ul(s[g-3]^s[g-8]^s[g-14]^s[g-16],1);let c=r[0],u=r[1],h=r[2],v=r[3],S=r[4];for(let g=0;g<80;++g){let y=Math.floor(g/20),C=ul(c,5)+Xw(y,u,h,v)+S+t[y]+s[g]>>>0;S=v,v=h,h=ul(u,30)>>>0,u=c,c=C}r[0]=r[0]+c>>>0,r[1]=r[1]+u>>>0,r[2]=r[2]+h>>>0,r[3]=r[3]+v>>>0,r[4]=r[4]+S>>>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 Zw=Kw("v5",80,Jw),Em=Zw,jm="2.30.52",Rm=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,gi={pageview:"pageview",event:"event"},Ha=class{constructor({client:t,uuidGenerator:r=Xr}){this.client=t,this.uuidGenerator=r}},ml=class extends Ha{constructor({client:t,uuidGenerator:r=Xr}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=Rm(window.location),this.lastReferrer=ro()?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:ro()?document.title:"",encoding:ro()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===gi.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===gi.pageview?this.nextPageViewId:this.pageViewId,referrer:t===gi.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===gi.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 Rm(window.location)}},yr=class e{constructor(t,r){if(!Qa(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return Qa(i)?new e(i,Number.parseInt(o)*1e3):null}};yr.cvo_cid="cvo_cid";yr.expirationTime=120;var gl=class extends Ha{constructor({client:t,uuidGenerator:r=Xr}){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 M(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(yr.cvo_cid,new yr(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};gl.Id="link";var Ct=Object.keys;function $a(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var ll=128,Lm=192,Im=224,Tm=240;function ex(e){return(e&248)===Tm?4:(e&Tm)===Im?3:(e&Im)===Lm?2:1}function tx(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&ll)!=ll)break;if(r-=3,(n&Lm)!=ll){t-r>=ex(n)*3&&(r=t);break}}return e.substring(0,r)}var hl={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"},rx=Ct(hl).map(e=>hl[e]),nx=[...rx].join("|"),ox=new RegExp(`^(${nx}$)`),ix={svcAction:"svc_action",svcActionData:"svc_action_data"},ax=e=>Ct(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=hl[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),sx=e=>ox.test(e),cx=[sx],_m={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},km={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},ot={action:"pa",list:"pal",listSource:"pls"},za={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},ux=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],yl={id:"quoteId",affiliation:"quoteAffiliation"},vl={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},lx={add:ot,bookmark_add:ot,bookmark_remove:ot,click:ot,checkout:ot,checkout_option:ot,detail:ot,impression:ot,remove:ot,refund:Object.assign(Object.assign({},ot),za),purchase:Object.assign(Object.assign({},ot),za),quickview:ot,quote:Object.assign(Object.assign({},ot),yl),review:Object.assign(Object.assign({},ot),vl)},dx=Ct(_m).map(e=>_m[e]),fx=Ct(km).map(e=>km[e]),px=Ct(ot).map(e=>ot[e]),mx=Ct(za).map(e=>za[e]),gx=Ct(vl).map(e=>vl[e]),hx=Ct(yl).map(e=>yl[e]),yx=[...dx,"custom"].join("|"),vx=[...fx,"custom"].join("|"),Vm="(pr[0-9]+)",Um="(il[0-9]+pi[0-9]+)",Sx=new RegExp(`^${Vm}(${yx})$`),bx=new RegExp(`^(${Um}(${vx}))|(il[0-9]+nm)$`),Ax=new RegExp(`^(${px.join("|")})$`),wx=new RegExp(`^(${mx.join("|")})$`),xx=new RegExp(`^${Vm}custom$`),Cx=new RegExp(`^${Um}custom$`),Ex=new RegExp(`^(${[...ux,...gx,...hx].join("|")})$`),Rx=e=>Sx.test(e),Ix=e=>bx.test(e),Tx=e=>Ax.test(e),_x=e=>wx.test(e),kx=e=>Ex.test(e),Ox=[Ix,Rx,Tx,_x,kx],Px=[xx,Cx],Nx={anonymizeIp:"aip"},Fx={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},Dx={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},Mx=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],qx=Object.assign(Object.assign(Object.assign(Object.assign({},Nx),Fx),Dx),Mx.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Sl=Object.assign(Object.assign({},qx),ix),jx=e=>{let t=!!e.action&&lx[e.action]||{};return Ct(e).reduce((r,n)=>{let o=t[n]||Sl[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},Lx=Ct(Sl).map(e=>Sl[e]),Vx=e=>Lx.indexOf(e)!==-1,Ux=e=>e==="custom",Bx=e=>[...Ox,...cx,Vx,Ux].some(t=>t(e)),$x=e=>Ct(e).reduce((t,r)=>{let n=Gx(r);return n?Object.assign(Object.assign({},t),Qx(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),Gx=e=>{let t;return[...Px].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},Qx=(e,t)=>Ct(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),bl=class{constructor(t){this.opts=t}sendEvent(t,r){return M(this,void 0,void 0,function*(){if(!this.isAvailable())throw new Error("navigator.sendBeacon is not supported in this browser. Consider adding a polyfill like \"sendbeacon-polyfill\".");let{baseUrl:n,preprocessRequest:o}=this.opts,i=yield this.getQueryParamsForEventType(t),{url:a,payload:s}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),c=this.encodeForEventType(t,s),u=new Blob([c],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,u)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return M(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:s,body:c}=a;o=s||t;try{i=JSON.parse(c)}catch(u){console.error("Unable to process the request body as a JSON string",u)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return M(this,void 0,void 0,function*(){let{token:r,visitorIdProvider:n}=this.opts,o=yield n.getCurrentVisitorId();return[r&&this.isEventTypeLegacy(t)?`access_token=${r}`:"",o?`visitorId=${o}`:"","discardVisitInfo=true"].filter(i=>!!i).join("&")})}isEventTypeLegacy(t){return[ve.click,ve.custom,ve.search,ve.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}},Al=class{sendEvent(t,r){return M(this,void 0,void 0,function*(){return Promise.resolve()})}deleteHttpCookieVisitorId(){return M(this,void 0,void 0,function*(){return Promise.resolve()})}},Om=b.fetch,Wa=class{constructor(t){this.opts=t}sendEvent(t,r){return M(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},c=Object.assign(Object.assign({},s),i?yield i(s,"analyticsFetch"):{}),{url:u}=c,h=er(c,["url"]),v;try{v=yield Om(u,h)}catch(S){console.error("An error has occured when sending the event.",S);return}if(v.ok){let S=yield v.json();return S.visitorId&&o.setCurrentVisitorId(S.visitorId),S}else{try{v.json()}catch{}throw console.error(`An error has occured when sending the "${t}" event.`,v,r),new Error(`An error has occurred when sending the "${t}" event. Check the console logs for more details.`)}})}deleteHttpCookieVisitorId(){return M(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield Om(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ve.click,ve.custom,ve.search,ve.view].indexOf(t)!==-1}getVisitorIdParam(){return M(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"})}},wl=class{constructor(t,r){fl()&&Mm()?this.storage=new pl:fl()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new oo),this.client=new Wa(t),this.beaconClient=new bl(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},xl=class{constructor(t,r){this.storage=r||new oo,this.client=new Wa(t)}getClientDependingOnEventType(t){return this.client}},Ka=class{constructor(){this.storage=new oo,this.client=new Al}getClientDependingOnEventType(t){return this.client}},Hx="xx",zx=e=>e?.startsWith(Hx)||!1,Wx=`
|
|
26
|
+
`;return new ni(r)}var ni=class extends Error{constructor(e){super(e),this.name="SchemaValidationError"}},gt=class{constructor(e){this.definition=e}validate(e={},t=""){let r={...this.default,...e},n=[];for(let o in this.definition){let i=this.definition[o].validate(r[o]);i&&n.push(`${o}: ${i}`)}if(n.length)throw kw(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}},Fe=class{constructor(e={}){this.baseConfig=e}validate(e){return this.baseConfig.required&&se(e)?"value is required.":null}get default(){return this.baseConfig.default instanceof Function?this.baseConfig.default():this.baseConfig.default}get required(){return this.baseConfig.required===!0}};function Xe(e){return e===void 0}function Ow(e){return e===null}function se(e){return Xe(e)||Ow(e)}var fe=class{constructor(e={}){Ae(this,"value");this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t||(Pw(e)?null:"value is not a boolean.")}get default(){return this.value.default}get required(){return this.value.required}};function Pw(e){return Xe(e)||Ap(e)}function Ap(e){return typeof e=="boolean"}var ne=class{constructor(e={}){Ae(this,"value");this.config=e,this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t||(Nw(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 Nw(e){return Xe(e)||xp(e)}function xp(e){return typeof e=="number"&&!Number.isNaN(e)}var Fw=/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i,z=class{constructor(e={}){Ae(this,"value");Ae(this,"config");this.config={emptyAllowed:!0,url:!1,...e},this.value=new Fe(this.config)}validate(e){let{emptyAllowed:t,url:r,regex:n,constrainTo:o,ISODate:i}=this.config,a=this.value.validate(e);if(a)return a;if(Xe(e))return null;if(!xa(e))return"value is not a string.";if(!t&&!e.length)return"value is an empty string.";if(r)try{new URL(e)}catch{return"value is not a valid URL."}return n&&!n.test(e)?`value did not match provided regex ${n}`:o&&!o.includes(e)?`value should be one of: ${o.join(", ")}.`:i&&!(Fw.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 xa(e){return Object.prototype.toString.call(e)==="[object String]"}var re=class{constructor(e={}){Ae(this,"config");this.config={options:{required:!1},values:{},...e}}validate(e){if(Xe(e))return this.config.options.required?"value is required and is currently undefined":null;if(!Cp(e))return"value is not an object";for(let[r,n]of Object.entries(this.config.values))if(n.required&&se(e[r]))return`value does not contain ${r}`;let t="";for(let[r,n]of Object.entries(this.config.values)){let o=e[r],i=n.validate(o);i!==null&&(t+=` ${i}`)}return t===""?null:t}get default(){}get required(){return!!this.config.options.required}};function Cp(e){return e!==void 0&&typeof e=="object"}var he=class{constructor(e={}){Ae(this,"value");this.config=e,this.value=new Fe(this.config)}validate(e){if(!se(e)&&!Array.isArray(e))return"value is not an array";let t=this.value.validate(e);if(t!==null)return t;if(se(e))return null;if(this.config.max!==void 0&&e.length>this.config.max)return`value contains more than ${this.config.max}`;if(this.config.min!==void 0&&e.length<this.config.min)return`value contains less than ${this.config.min}`;if(this.config.each!==void 0){let r="";return e.forEach(n=>{this.config.each.required&&se(n)&&(r=`value is null or undefined: ${e.join(",")}`);let o=this.validatePrimitiveValue(n,this.config.each);o!==null&&(r+=` ${o}`)}),r===""?null:r}return null}validatePrimitiveValue(e,t){return Ap(e)||xa(e)||xp(e)||Cp(e)?t.validate(e):"value is not a primitive value"}get default(){}get required(){return this.value.required}};function Ep(e){return Array.isArray(e)}var el=class{constructor(e){Ae(this,"value");this.config=e,this.value=new Fe(e)}validate(e){let t=this.value.validate(e);return t!==null?t:Xe(e)||Object.values(this.config.enum).find(n=>n===e)?null:"value is not in enum."}get default(){return this.value.default}get required(){return this.value.required}};m();d();p();f();function Rp(e){return Array.isArray(e)}function Ca(e){return e.trim()===""}var Dw=new Set(["1",1,"yes",!0]);function Ip(){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=>Dw.has(r))}function Tp(e){let t={};for(let[r,n]of e)t[r]=n;return t}function oi(e){if(typeof e!="object"||!e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Ea(e,t,r={}){let n;return(...o)=>{let i=r.isImmediate&&!n;if(clearTimeout(n),n=setTimeout(()=>{n=void 0,r.isImmediate||e.apply(void 0,o)},t),i)return e.apply(void 0,o)}}function Mw(e){if(Ca(e.openingDelimiter)||Ca(e.closingDelimiter))throw Error("delimiters should be a non-empty string");if(se(e.content)||Ca(e.content))return e.content;if(e.highlights.length===0)return Gn(e.content);let t=e.content.length,r="",n=0;for(let o=0;o<e.highlights.length;o++){let i=e.highlights[o],a=i.offset,s=a+i.length;if(s>t)break;r+=Gn(e.content.slice(n,a)),r+=e.openingDelimiter,r+=Gn(e.content.slice(a,s)),r+=e.closingDelimiter,n=s}return n!==t&&(r+=Gn(e.content.slice(n))),r}function qw(e,t){return e=Gn(e),e.replace(/\[(.*?)\]|\{(.*?)\}|\((.*?)\)/g,(r,n,o,i)=>n?tl(n,t.notMatchDelimiters):o?tl(o,t.exactMatchDelimiters):i?tl(i,t.correctionDelimiters):r)}function tl(e,t){return t?t.open+e+t.close:e}function Gn(e){let t={"&":"&","<":"<",">":">","\"":""","'":"'","`":"`"},r=`(?:${Object.keys(t).join("|")})`,n=RegExp(r),o=RegExp(r,"g");return n.test(e)?e.replace(o,i=>t[i]):e}m();d();p();f();var Vp=Dt(Mp(),1);m();d();p();f();var Bt=new Error("Failed to load reducers."),Qn=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."}},Yr=class extends Error{constructor(r,n){super();Ae(this,"statusCode");this.name="Disconnected",this.message=`Client could not connect to the following URL: ${r}`,this.statusCode=n??0}};m();d();p();f();function qp(e){let t=[];for(let r in e){let n=encodeURIComponent(r),o=encodeURIComponent(e[r]);t.push(`${n}=${o}`)}return t.join("&")}function jp(e){return typeof e!="object"||!e?!1:Object.values(e).every(uA)}function uA(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function Lp(e){return e===429}var Mt=class e{static call(t){return _asyncToGenerator(function*(){let r=lA(t),{logger:n}=t,o=yield e.preprocessRequest(r,t);n.info(o,"Platform request");let{url:i,...a}=o,s=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(){let c=yield w(i,a);if(Lp(c.status))throw c;return c});return function s(){return _ref.apply(this,arguments)}}();try{let c=yield(0,Vp.backOff)(s,{startingDelay:100,timeMultiple:2,maxDelay:800,numOfAttempts:4,jitter:"full",retry:function(){var _ref2=_asyncToGenerator(function*(u){let h=u&&Lp(u.status);return h&&(n.info("Platform retrying request"),yield new Promise(S=>setTimeout(S,1e3))),h});return function retry(_x2){return _ref2.apply(this,arguments)}}()});switch(c.status){case 419:case 401:throw n.info("Platform renewing token"),new Qn;case 404:throw new Yr(i,c.status);default:return n.info({response:c,requestInfo:o},"Platform response"),c}}catch(c){return c.message==="Failed to fetch"?new Yr(i):c}})()}static preprocessRequest(t,r){return _asyncToGenerator(function*(){let{origin:n,preprocessRequest:o,logger:i,requestMetadata:a}=r,{signal:s,...c}=t,u=oi(c);try{let h=yield o(t,n,a);return{...t,...h}}catch(h){i.error(h,"Platform request preprocessing failed. Returning default request options.")}return u})()}};function Je(e,t="prod",r="platform"){let n=t==="prod"?"":t,o=r==="platform"?"":`.${r}`;return`https://${e}${o}.org${n}.coveo.com`}function vr(e,t="prod"){return`${Je(e,t)}/rest/search/v2`}function Ia(e,t="prod"){return`${Je(e,t,"analytics")}/rest/organizations/${e}/events/v1`}function lA(e){let{url:t,method:r,requestParams:n,contentType:o,accessToken:i,signal:a}=e,s=e.method==="POST"||e.method==="PUT",c=dA(n,o);return{url:t,method:r,headers:{"Content-Type":o,Authorization:`Bearer ${i}`,...e.headers},...(s&&{body:c}),signal:a}}function dA(e,t){return t==="application/x-www-form-urlencoded"?jp(e)?qp(e):"":JSON.stringify(e)}m();d();p();f();m();d();p();f();var Ta=e=>e;m();d();p();f();m();d();p();f();function _a(){return{answerSnippet:"",documentId:{contentIdKey:"",contentIdValue:""},question:"",relatedQuestions:[],score:0}}function $t(){return{response:{results:[],searchUid:"",totalCountFiltered:0,facets:[],generateAutomaticFacets:{facets:[]},queryCorrections:[],triggers:[],questionAnswer:_a(),pipeline:"",splitTestRun:"",termsToHighlight:{},phrasesToHighlight:{},extendedResults:{}},duration:0,queryExecuted:"",error:null,automaticallyCorrected:!1,isLoading:!1,results:[],searchResponseId:"",requestId:"",questionAnswer:_a(),extendedResults:{},searchAction:void 0}}m();d();p();f();function br(e){let{url:t,accessToken:r,organizationId:n,authentication:o,...i}=e;return i}var wr=e=>{let{response:t}=e;return t.body?fA(e):pA(t)},fA=e=>gA(e)?hA(e):mA(e)?e.body:{message:"unknown",statusCode:0,type:"unknown"},pA=e=>{let t=JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)));return{...t,message:`Client side error: ${t.message||""}`,statusCode:400,type:"ClientError"}};function mA(e){return e.body.statusCode!==void 0}function gA(e){return e.body.exception!==void 0}var hA=e=>({message:e.body.exception.code,statusCode:e.response.status,type:e.body.exception.code});m();d();p();f();var Ar=class{constructor(){Ae(this,"currentAbortController",null)}enqueue(t,r){var _this=this;return _asyncToGenerator(function*(){let n=_this.currentAbortController;_this.currentAbortController=new l.AbortController;let o=_this.currentAbortController;n&&(r.warnOnAbort&&r.logger.warn("Cancelling current pending search query"),n.abort());try{return yield t(o?.signal??null)}finally{_this.currentAbortController===o&&(_this.currentAbortController=null)}})()}};m();d();p();f();m();d();p();f();var si=class{constructor(t){Ae(this,"_basePath");Ae(this,"_params",{});this._basePath=t}addParam(t,r){this._params={...this.params,[t]:r}}get basePath(){return this._basePath}get params(){return this._params}get hasParams(){return Object.entries(this._params).length}get href(){return this.hasParams?`${this.basePath}?${Object.entries(this.params).map(([t,r])=>`${t}=${encodeURIComponent(r)}`).join("&")}`:this.basePath}};m();d();p();f();function Up(e){return((e.headers.get("content-type")||"").split(";").find(n=>n.indexOf("charset=")!==-1)||"").split("=")[1]||"UTF-8"}m();d();p();f();var nr=(e,t,r,n)=>{let o=new si(`${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 Bp=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(function*(e,t){let r=yield Mt.call({...nr(e,"POST","application/x-www-form-urlencoded","/html"),requestParams:br(e),requestMetadata:{method:"html"},...t});if(r instanceof Error)throw r;let n=Up(r),o=yield r.arrayBuffer(),a=new TextDecoder(n).decode(o);return yA(a)?{success:a}:{error:wr({response:r,body:a})}});return function Bp(_x3,_x4){return _ref3.apply(this,arguments)}}();function yA(e){return typeof e=="string"}m();d();p();f();function SA(e){return{statusCode:e.statusCode,type:e.name,message:e.message}}function vA(e){return{statusCode:e.code,type:e.name,message:e.message,ignored:!0}}function ka(e,t){if(t&&e.name==="AbortError")return{error:vA(e)};if(e instanceof Yr)return{error:SA(e)};throw e}var Oa=class{constructor(t){this.options=t;Ae(this,"apiCallsQueues",{unknown:new Ar,mainSearch:new Ar,facetValues:new Ar,foldingCollection:new Ar,instantResults:new Ar})}plan(t){var _this2=this;return _asyncToGenerator(function*(){let r=yield Mt.call({...nr(t,"POST","application/json","/plan"),requestParams:br(t),requestMetadata:{method:"plan"},..._this2.options});if(r instanceof Error)return ka(r);let n=yield r.json();return wA(n)?{success:n}:{error:wr({response:r,body:n})}})()}querySuggest(t){var _this3=this;return _asyncToGenerator(function*(){let r=yield Mt.call({...nr(t,"POST","application/json","/querySuggest"),requestMetadata:{method:"querySuggest"},requestParams:br(t),..._this3.options});if(r instanceof Error)return ka(r);let n=yield r.json(),o={response:r,body:n};return bA(n)?{success:(yield _this3.options.postprocessQuerySuggestResponseMiddleware(o)).body}:{error:wr(o)}})()}search(t,r){var _this4=this;return _asyncToGenerator(function*(){let n=r?.origin??"unknown",o=yield _this4.apiCallsQueues[n].enqueue(s=>Mt.call({...nr(t,"POST","application/json",""),requestParams:br(t),requestMetadata:{method:"search",origin:r?.origin},..._this4.options,signal:s??void 0}),{logger:_this4.options.logger,warnOnAbort:!r?.disableAbortWarning});if(o instanceof Error)return ka(o,r?.disableAbortWarning);let i=yield o.json(),a={response:o,body:i};return $p(i)?(a.body=Gp(i),{success:(yield _this4.options.postprocessSearchResponseMiddleware(a)).body}):{error:wr(a)}})()}facetSearch(t){var _this5=this;return _asyncToGenerator(function*(){let r=yield Mt.call({...nr(t,"POST","application/json","/facet"),requestParams:br(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 Mt.call({...nr(t,"POST","application/json",""),requestParams:br(t),requestMetadata:{method:"recommendations"},..._this6.options});if(r instanceof Error)throw r;let n=yield r.json();if($p(n)){let o={response:r,body:n};return o.body=Gp(n),{success:(yield _this6.options.postprocessSearchResponseMiddleware(o)).body}}return{error:wr({response:r,body:n})}})()}html(t){var _this7=this;return _asyncToGenerator(function*(){return Bp(t,{..._this7.options})})()}fieldDescriptions(t){var _this8=this;return _asyncToGenerator(function*(){let r=yield Mt.call({...nr(t,"GET","application/json","/fields"),requestParams:{},requestMetadata:{method:"fieldDescriptions"},..._this8.options});if(r instanceof Error)throw r;let n=yield r.json();return AA(n)?{success:n}:{error:wr({response:r,body:n})}})()}},Pa=e=>e.success!==void 0,ht=e=>e.error!==void 0;function $p(e){return e.results!==void 0}function Gp(e){let t=_a();return se(e.questionAnswer)?(e.questionAnswer=t,e):(e.questionAnswer={...t,...e.questionAnswer},e)}function bA(e){return e.completions!==void 0}function wA(e){return e.preprocessingOutput!==void 0}function AA(e){return e.fields!==void 0}m();d();p();f();var Qp=e=>e,Hp=e=>e,zp=e=>e;m();d();p();f();m();d();p();f();m();d();p();f();function Ze(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 xA=typeof Symbol=="function"&&Symbol.observable||"@@observable",Wp=xA,dl=()=>Math.random().toString(36).substring(7).split("").join("."),CA={INIT:`@@redux/INIT${dl()}`,REPLACE:`@@redux/REPLACE${dl()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${dl()}`},Na=CA;function Gt(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 fl(e,t,r){if(typeof e!="function")throw new Error(Ze(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ze(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ze(1));return r(fl)(e,t)}let n=e,o=t,i=new Map,a=i,s=0,c=!1;function u(){a===i&&(a=new Map,i.forEach((C,E)=>{a.set(E,C)}))}function h(){if(c)throw new Error(Ze(3));return o}function S(C){if(typeof C!="function")throw new Error(Ze(4));if(c)throw new Error(Ze(5));let E=!0;u();let _=s++;return a.set(_,C),function(){if(E){if(c)throw new Error(Ze(6));E=!1,u(),a.delete(_),i=null}}}function v(C){if(!Gt(C))throw new Error(Ze(7));if(typeof C.type>"u")throw new Error(Ze(8));if(typeof C.type!="string")throw new Error(Ze(17));if(c)throw new Error(Ze(9));try{c=!0,o=n(o,C)}finally{c=!1}return(i=a).forEach(_=>{_()}),C}function g(C){if(typeof C!="function")throw new Error(Ze(10));n=C,v({type:Na.REPLACE})}function y(){let C=S;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(Ze(11));function _(){let k=E;k.next&&k.next(h())}return _(),{unsubscribe:C(_)}},[Wp](){return this}}}return v({type:Na.INIT}),{dispatch:v,subscribe:S,getState:h,replaceReducer:g,[Wp]:y}}function EA(e){Object.keys(e).forEach(t=>{let r=e[t];if(typeof r(void 0,{type:Na.INIT})>"u")throw new Error(Ze(12));if(typeof r(void 0,{type:Na.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ze(13))})}function Hn(e){let t=Object.keys(e),r={};for(let a=0;a<t.length;a++){let s=t[a];typeof e[s]=="function"&&(r[s]=e[s])}let n=Object.keys(r),o,i;try{EA(r)}catch(a){i=a}return function(s={},c){if(i)throw i;let u=!1,h={};for(let S=0;S<n.length;S++){let v=n[S],g=r[v],y=s[v],x=g(y,c);if(typeof x>"u"){let C=c&&c.type;throw new Error(Ze(14))}h[v]=x,u=u||x!==y}return u=u||n.length!==Object.keys(s).length,u?h:s}}function ci(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Kp(...e){return t=>(r,n)=>{let o=t(r,n),i=()=>{throw new Error(Ze(15))},a={getState:o.getState,dispatch:(c,...u)=>i(c,...u)},s=e.map(c=>c(a));return i=ci(...s)(o.dispatch),{...o,dispatch:i}}}function ui(e){return Gt(e)&&"type"in e&&typeof e.type=="string"}m();d();p();f();var wl=Symbol.for("immer-nothing"),li=Symbol.for("immer-draftable"),ze=Symbol.for("immer-state");function et(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var At=Object,Jr=At.getPrototypeOf,fi="constructor",yi="prototype",gl="configurable",qa="enumerable",Da="writable",pi="value",dt=e=>!!e&&!!e[ze];function ft(e){return e?nm(e)||vi(e)||!!e[li]||!!e[fi]?.[li]||bi(e)||wi(e):!1}var RA=At[yi][fi].toString(),Yp=new WeakMap;function nm(e){if(!e||!zn(e))return!1;let t=Jr(e);if(t===null||t===At[yi])return!0;let r=At.hasOwnProperty.call(t,fi)&&t[fi];if(r===Object)return!0;if(!Xr(r))return!1;let n=Yp.get(r);return n===void 0&&(n=Function.toString.call(r),Yp.set(r,n)),n===RA}function om(e){return dt(e)||et(15,e),e[ze].base_}function Si(e,t,r=!0){Zr(e)===0?(r?Reflect.ownKeys(e):At.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Zr(e){let t=e[ze];return t?t.type_:vi(e)?1:bi(e)?2:wi(e)?3:0}var di=(e,t,r=Zr(e))=>r===2?e.has(t):At[yi].hasOwnProperty.call(e,t),or=(e,t,r=Zr(e))=>r===2?e.get(t):e[t],ja=(e,t,r,n=Zr(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function IA(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var vi=Array.isArray,bi=e=>e instanceof Map,wi=e=>e instanceof Set,zn=e=>typeof e=="object",Xr=e=>typeof e=="function",pl=e=>typeof e=="boolean";function TA(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var _A=e=>zn(e)?e?.[ze]:null,ir=e=>e.copy_||e.base_;var Al=e=>e.modified_?e.copy_:e.base_;function hl(e,t){if(bi(e))return new Map(e);if(wi(e))return new Set(e);if(vi(e))return Array[yi].slice.call(e);let r=nm(e);if(t===!0||t==="class_only"&&!r){let n=At.getOwnPropertyDescriptors(e);delete n[ze];let o=Reflect.ownKeys(n);for(let i=0;i<o.length;i++){let a=o[i],s=n[a];s[Da]===!1&&(s[Da]=!0,s[gl]=!0),(s.get||s.set)&&(n[a]={[gl]:!0,[Da]:!0,[qa]:s[qa],[pi]:e[a]})}return At.create(Jr(e),n)}else{let n=Jr(e);if(n!==null&&r)return{...e};let o=At.create(n);return At.assign(o,e)}}function xl(e,t=!1){return Ga(e)||dt(e)||!ft(e)||(Zr(e)>1&&At.defineProperties(e,{set:Fa,add:Fa,clear:Fa,delete:Fa}),At.freeze(e),t&&Si(e,(r,n)=>{xl(n,!0)},!1)),e}function kA(){et(2)}var Fa={[pi]:kA};function Ga(e){return e===null||!zn(e)?!0:At.isFrozen(e)}var La="MapSet",Va="Patches",Xp="ArrayMethods",Ua={};function en(e){let t=Ua[e];return t||et(0,e),t}var Jp=e=>!!Ua[e];function OA(e,t){Ua[e]||(Ua[e]=t)}var mi,im=()=>mi,PA=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Jp(La)?en(La):void 0,arrayMethodsPlugin_:Jp(Xp)?en(Xp):void 0});function Zp(e,t){t&&(e.patchPlugin_=en(Va),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function yl(e){Sl(e),e.drafts_.forEach(NA),e.drafts_=null}function Sl(e){e===mi&&(mi=e.parent_)}var em=e=>mi=PA(mi,e);function NA(e){let t=e[ze];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function tm(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];if(e!==void 0&&e!==r){r[ze].modified_&&(yl(t),et(4)),ft(e)&&(e=rm(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[ze].base_,e,t)}else e=rm(t,r);return FA(t,e,!0),yl(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==wl?e:void 0}function rm(e,t){if(Ga(t))return t;let r=t[ze];if(!r)return Ba(t,e.handledSet_,e);if(!Qa(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);cm(r,e)}return r.copy_}function FA(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&xl(t,r)}function am(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Qa=(e,t)=>e.scope_===t,DA=[];function sm(e,t,r,n){let o=ir(e),i=e.type_;if(n!==void 0&&or(o,n,i)===t){ja(o,n,r,i);return}if(!e.draftLocations_){let s=e.draftLocations_=new Map;Si(o,(c,u)=>{if(dt(u)){let h=s.get(u)||[];h.push(c),s.set(u,h)}})}let a=e.draftLocations_.get(t)??DA;for(let s of a)ja(o,s,r,i)}function MA(e,t,r){e.callbacks_.push(function(o){let i=t;if(!i||!Qa(i,o))return;o.mapSetPlugin_?.fixSetContents(i);let a=Al(i);sm(e,i.draft_??i,a,r),cm(i,o)})}function cm(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let o=n.getPath(e);o&&n.generatePatches_(e,o,t)}am(e)}}function qA(e,t,r){let{scope_:n}=e;if(dt(r)){let o=r[ze];Qa(o,n)&&o.callbacks_.push(function(){Ma(e);let a=Al(o);sm(e,r,a,t)})}else ft(r)&&e.callbacks_.push(function(){let i=ir(e);e.type_===3?i.has(r)&&Ba(r,n.handledSet_,n):or(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Ba(or(e.copy_,t,e.type_),n.handledSet_,n)})}function Ba(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||dt(e)||t.has(e)||!ft(e)||Ga(e)||(t.add(e),Si(e,(n,o)=>{if(dt(o)){let i=o[ze];if(Qa(i,r)){let a=Al(i);ja(e,n,a,e.type_),am(i)}}else ft(o)&&Ba(o,t,r)})),e}function jA(e,t){let r=vi(e),n={type_:r?1:0,scope_:t?t.scope_:im(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=n,i=$a;r&&(o=[n],i=gi);let{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,[s,n]}var $a={get(e,t){if(t===ze)return e;let r=e.scope_.arrayMethodsPlugin_,n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=ir(e);if(!di(o,t,e.type_))return LA(e,o,t);let i=o[t];if(e.finalized_||!ft(i)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&TA(t))return i;if(i===ml(e.base_,t)){Ma(e);let a=e.type_===1?+t:t,s=bl(e.scope_,i,e,a);return e.copy_[a]=s}return i},has(e,t){return t in ir(e)},ownKeys(e){return Reflect.ownKeys(ir(e))},set(e,t,r){let n=um(ir(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let o=ml(ir(e),t),i=o?.[ze];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(IA(r,o)&&(r!==void 0||di(e.base_,t,e.type_)))return!0;Ma(e),vl(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),qA(e,t,r)),!0},deleteProperty(e,t){return Ma(e),ml(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),vl(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=ir(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Da]:!0,[gl]:e.type_!==1||t!=="length",[qa]:n[qa],[pi]:r[t]}},defineProperty(){et(11)},getPrototypeOf(e){return Jr(e.base_)},setPrototypeOf(){et(12)}},gi={};for(let e in $a){let t=$a[e];gi[e]=function(){let r=arguments;return r[0]=r[0][0],t.apply(this,r)}}gi.deleteProperty=function(e,t){return gi.set.call(this,e,t,void 0)};gi.set=function(e,t,r){return $a.set.call(this,e[0],t,r,e[0])};function ml(e,t){let r=e[ze];return(r?ir(r):e)[t]}function LA(e,t,r){let n=um(t,r);return n?pi in n?n[pi]:n.get?.call(e.draft_):void 0}function um(e,t){if(!(t in e))return;let r=Jr(e);for(;r;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Jr(r)}}function vl(e){e.modified_||(e.modified_=!0,e.parent_&&vl(e.parent_))}function Ma(e){e.copy_||(e.assigned_=new Map,e.copy_=hl(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var VA=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(Xr(t)&&!Xr(r)){let i=r;r=t;let a=this;return function(c=i,...u){return a.produce(c,h=>r.call(this,h,...u))}}Xr(r)||et(6),n!==void 0&&!Xr(n)&&et(7);let o;if(ft(t)){let i=em(this),a=bl(i,t,void 0),s=!0;try{o=r(a),s=!1}finally{s?yl(i):Sl(i)}return Zp(i,n),tm(o,i)}else if(!t||!zn(t)){if(o=r(t),o===void 0&&(o=t),o===wl&&(o=void 0),this.autoFreeze_&&xl(o,!0),n){let i=[],a=[];en(Va).generateReplacementPatches_(t,o,{patches_:i,inversePatches_:a}),n(i,a)}return o}else et(1,t)},this.produceWithPatches=(t,r)=>{if(Xr(t))return(a,...s)=>this.produceWithPatches(a,c=>t(c,...s));let n,o;return[this.produce(t,r,(a,s)=>{n=a,o=s}),n,o]},pl(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),pl(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),pl(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ft(e)||et(8),dt(e)&&(e=Ha(e));let t=em(this),r=bl(t,e,void 0);return r[ze].isManual_=!0,Sl(t),r}finishDraft(e,t){let r=e&&e[ze];(!r||!r.isManual_)&&et(9);let{scope_:n}=r;return Zp(n,t),tm(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=en(Va).applyPatches_;return dt(e)?n(e,t):this.produce(e,o=>n(o,t))}};function bl(e,t,r,n){let[o,i]=bi(t)?en(La).proxyMap_(t,r):wi(t)?en(La).proxySet_(t,r):jA(t,r);return(r?.scope_??im()).drafts_.push(o),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?MA(r,i,n):i.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:u}=c;i.modified_&&u&&u.generatePatches_(i,[],c)}),o}function Ha(e){return dt(e)||et(10,e),lm(e)}function lm(e){if(!ft(e)||Ga(e))return e;let t=e[ze],r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=hl(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=hl(e,!0);return Si(r,(o,i)=>{ja(r,o,lm(i))},n),t&&(t.finalized_=!1),r}function dm(){function t(y,x=[]){if(y.key_!==void 0){let C=y.parent_.copy_??y.parent_.base_,E=_A(or(C,y.key_)),_=or(C,y.key_);if(_===void 0||_!==y.draft_&&_!==y.base_&&_!==y.copy_||E!=null&&E.base_!==y.base_)return null;let I=y.parent_.type_===3,k;if(I){let T=y.parent_;k=Array.from(T.drafts_.keys()).indexOf(y.key_)}else k=y.key_;if(!(I&&C.size>k||di(C,k)))return null;x.push(k)}if(y.parent_)return t(y.parent_,x);x.reverse();try{r(y.copy_,x)}catch{return null}return x}function r(y,x){let C=y;for(let E=0;E<x.length-1;E++){let _=x[E];if(C=or(C,_),!zn(C)||C===null)throw new Error(`Cannot resolve path at '${x.join("/")}'`)}return C}let n="replace",o="add",i="remove";function a(y,x,C){if(y.scope_.processedForPatches_.has(y))return;y.scope_.processedForPatches_.add(y);let{patches_:E,inversePatches_:_}=C;switch(y.type_){case 0:case 2:return c(y,x,E,_);case 1:return s(y,x,E,_);case 3:return u(y,x,E,_)}}function s(y,x,C,E){let{base_:_,assigned_:I}=y,k=y.copy_;k.length<_.length&&([_,k]=[k,_],[C,E]=[E,C]);let T=y.allIndicesReassigned_===!0;for(let D=0;D<_.length;D++){let B=k[D],L=_[D];if((T||I?.get(D.toString()))&&B!==L){let U=B?.[ze];if(U&&U.modified_)continue;let q=x.concat([D]);C.push({op:n,path:q,value:g(B)}),E.push({op:n,path:q,value:g(L)})}}for(let D=_.length;D<k.length;D++){let B=x.concat([D]);C.push({op:o,path:B,value:g(k[D])})}for(let D=k.length-1;_.length<=D;--D){let B=x.concat([D]);E.push({op:i,path:B})}}function c(y,x,C,E){let{base_:_,copy_:I,type_:k}=y;Si(y.assigned_,(T,D)=>{let B=or(_,T,k),L=or(I,T,k),j=D?di(_,T)?n:o:i;if(B===L&&j===n)return;let U=x.concat(T);C.push(j===i?{op:j,path:U}:{op:j,path:U,value:g(L)}),E.push(j===o?{op:i,path:U}:j===i?{op:o,path:U,value:g(B)}:{op:n,path:U,value:g(B)})})}function u(y,x,C,E){let{base_:_,copy_:I}=y,k=0;_.forEach(T=>{if(!I.has(T)){let D=x.concat([k]);C.push({op:i,path:D,value:T}),E.unshift({op:o,path:D,value:T})}k++}),k=0,I.forEach(T=>{if(!_.has(T)){let D=x.concat([k]);C.push({op:o,path:D,value:T}),E.unshift({op:i,path:D,value:T})}k++})}function h(y,x,C){let{patches_:E,inversePatches_:_}=C;E.push({op:n,path:[],value:x===wl?void 0:x}),_.push({op:n,path:[],value:y})}function S(y,x){return x.forEach(C=>{let{path:E,op:_}=C,I=y;for(let B=0;B<E.length-1;B++){let L=Zr(I),j=E[B];typeof j!="string"&&typeof j!="number"&&(j=""+j),(L===0||L===1)&&(j==="__proto__"||j===fi)&&et(19),Xr(I)&&j===yi&&et(19),I=or(I,j),zn(I)||et(18,E.join("/"))}let k=Zr(I),T=v(C.value),D=E[E.length-1];switch(_){case n:switch(k){case 2:return I.set(D,T);case 3:et(16);default:return I[D]=T}case o:switch(k){case 1:return D==="-"?I.push(T):I.splice(D,0,T);case 2:return I.set(D,T);case 3:return I.add(T);default:return I[D]=T}case i:switch(k){case 1:return I.splice(D,1);case 2:return I.delete(D);case 3:return I.delete(C.value);default:return delete I[D]}default:et(17,_)}}),y}function v(y){if(!ft(y))return y;if(vi(y))return y.map(v);if(bi(y))return new Map(Array.from(y.entries()).map(([C,E])=>[C,v(E)]));if(wi(y))return new Set(Array.from(y).map(v));let x=Object.create(Jr(y));for(let C in y)x[C]=v(y[C]);return di(y,li)&&(x[li]=y[li]),x}function g(y){return dt(y)?v(y):y}OA(Va,{applyPatches_:S,generatePatches_:a,generateReplacementPatches_:h,getPath:t})}var hi=new VA,tn=hi.produce,Cl=hi.produceWithPatches.bind(hi);var El=hi.applyPatches.bind(hi);m();d();p();f();function UA(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function BA(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function $A(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 fm=e=>Array.isArray(e)?e:[e];function GA(e){let t=Array.isArray(e[0])?e[0]:e;return $A(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function QA(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}var yD=Object.getPrototypeOf({});var HA=class{constructor(e){this.value=e}deref(){return this.value}},zA=typeof WeakRef<"u"?WeakRef:HA,WA=0,pm=1;function za(){return{s:WA,v:void 0,o:null,p:null}}function Ai(e,t={}){let r=za(),{resultEqualityCheck:n}=t,o,i=0;function a(){let s=r,{length:c}=arguments;for(let S=0,v=c;S<v;S++){let g=arguments[S];if(typeof g=="function"||typeof g=="object"&&g!==null){let y=s.o;y===null&&(s.o=y=new WeakMap);let x=y.get(g);x===void 0?(s=za(),y.set(g,s)):s=x}else{let y=s.p;y===null&&(s.p=y=new Map);let x=y.get(g);x===void 0?(s=za(),y.set(g,s)):s=x}}let u=s,h;if(s.s===pm)h=s.v;else if(h=e.apply(null,arguments),i++,n){let S=o?.deref?.()??o;S!=null&&n(S,h)&&(h=S,i!==0&&i--),o=typeof h=="object"&&h!==null||typeof h=="function"?new zA(h):h}return u.s=pm,u.v=h,h}return a.clearCache=()=>{r=za(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function KA(e,...t){let r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,s,c={},u=o.pop();typeof u=="object"&&(c=u,u=o.pop()),UA(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);let h={...r,...c},{memoize:S,memoizeOptions:v=[],argsMemoize:g=Ai,argsMemoizeOptions:y=[],devModeChecks:x={}}=h,C=fm(v),E=fm(y),_=GA(o),I=S(function(){return i++,u.apply(null,arguments)},...C),k=!0,T=g(function(){a++;let B=QA(_,arguments);return s=I.apply(null,B),s},...E);return Object.assign(T,{resultFunc:u,memoizedResultFunc:I,dependencies:_,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:S,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var Be=KA(Ai),YA=Object.assign((e,t=Be)=>{BA(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(i=>e[i]);return t(n,(...i)=>i.reduce((a,s,c)=>(a[r[c]]=s,a),{}))},{withTypes:()=>YA});m();d();p();f();function mm(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var gm=mm(),hm=mm;var XA=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ci:ci.apply(null,arguments)},DD=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},JA=e=>e&&typeof e.match=="function";function N(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(pt(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=>ui(n)&&n.type===e,r}var Cm=class xi extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,xi.prototype)}static get[Symbol.species](){return xi}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new xi(...t[0].concat(this)):new xi(...t.concat(this))}};function ym(e){return ft(e)?tn(e,()=>{}):e}function Wa(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function ZA(e){return typeof e=="boolean"}var ex=()=>function(t){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{},a=new Cm;return r&&(ZA(r)?a.push(gm):a.push(hm(r.extraArgument))),a},Ci="RTK_autoBatch",Yn=()=>e=>({payload:e,meta:{[Ci]:!0}}),Sm=e=>t=>{setTimeout(t,e)},tx=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),o=!0,i=!1,a=!1,s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Sm(10):e.type==="callback"?e.queueNotification:Sm(e.timeout),u=()=>{a=!1,i&&(i=!1,s.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){let S=()=>o&&h(),v=n.subscribe(S);return s.add(h),()=>{v(),s.delete(h)}},dispatch(h){try{return o=!h?.meta?.[Ci],i=!o,i&&(a||(a=!0,c(u))),n.dispatch(h)}finally{o=!0}}})},rx=e=>function(r){let{autoBatch:n=!0}=r??{},o=new Cm(e);return n&&o.push(tx(typeof n=="object"?n:void 0)),o};function Em(e){let t=ex(),{reducer:r=void 0,middleware:n,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{},c;if(typeof r=="function")c=r;else if(Gt(r))c=Hn(r);else throw new Error(pt(1));let u;typeof n=="function"?u=n(t):u=t();let h=ci;o&&(h=XA({trace:!1,...(typeof o=="object"&&o)}));let S=Kp(...u),v=rx(S),g=typeof s=="function"?s(v):v(),y=h(...g);return fl(c,a,y)}function Rm(e){let t={},r=[],n,o={addCase(i,a){let s=typeof i=="string"?i:i.type;if(!s)throw new Error(pt(28));if(s in t)throw new Error(pt(29));return t[s]=a,o},addAsyncThunk(i,a){return a.pending&&(t[i.pending.type]=a.pending),a.rejected&&(t[i.rejected.type]=a.rejected),a.fulfilled&&(t[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function nx(e){return typeof e=="function"}function Le(e,t){let[r,n,o]=Rm(t),i;if(nx(e))i=()=>ym(e());else{let s=ym(e);i=()=>s}function a(s=i(),c){let u=[r[c.type],...n.filter(({matcher:h})=>h(c)).map(({reducer:h})=>h)];return u.filter(h=>!!h).length===0&&(u=[o]),u.reduce((h,S)=>{if(S)if(dt(h)){let g=S(h,c);return g===void 0?h:g}else{if(ft(h))return tn(h,v=>S(v,c));{let v=S(h,c);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},s)}return a.getInitialState=i,a}var Im=(e,t)=>JA(e)?e.match(t):e(t);function Qt(...e){return t=>e.some(r=>Im(r,t))}function Kn(...e){return t=>e.every(r=>Im(r,t))}function Ja(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 Ei(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Za(...e){return e.length===0?t=>Ja(t,["pending"]):Ei(e)?Qt(...e.map(t=>t.pending)):Za()(e[0])}function nn(...e){return e.length===0?t=>Ja(t,["rejected"]):Ei(e)?Qt(...e.map(t=>t.rejected)):nn()(e[0])}function Ri(...e){let t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Kn(nn(...e),t):Ei(e)?Kn(nn(...e),t):Ri()(e[0])}function ar(...e){return e.length===0?t=>Ja(t,["fulfilled"]):Ei(e)?Qt(...e.map(t=>t.fulfilled)):ar()(e[0])}function es(...e){return e.length===0?t=>Ja(t,["pending","fulfilled","rejected"]):Ei(e)?Qt(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):es()(e[0])}var ox="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ii=(e=21)=>{let t="",r=e;for(;r--;)t+=ox[Math.random()*64|0];return t},ix=["name","message","stack","code"],Rl=class{constructor(e,t){Ae(this,"_type");this.payload=e,this.meta=t}},vm=class{constructor(e,t){Ae(this,"_type");this.payload=e,this.meta=t}},ax=e=>{if(typeof e=="object"&&e!==null){let t={};for(let r of ix)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},bm="External signal was aborted",Ee=(()=>{function e(t,r,n){let o=N(t+"/fulfilled",(c,u,h,S)=>({payload:c,meta:{...(S||{}),arg:h,requestId:u,requestStatus:"fulfilled"}})),i=N(t+"/pending",(c,u,h)=>({payload:void 0,meta:{...(h||{}),arg:u,requestId:c,requestStatus:"pending"}})),a=N(t+"/rejected",(c,u,h,S,v)=>({payload:S,error:(n&&n.serializeError||ax)(c||"Rejected"),meta:{...(v||{}),arg:h,requestId:u,rejectedWithValue:!!S,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function s(c,{signal:u}={}){return(h,S,v)=>{let g=n?.idGenerator?n.idGenerator(c):Ii(),y=new l.AbortController,x,C;function E(I){C=I,y.abort()}u&&(u.aborted?E(bm):u.addEventListener("abort",()=>E(bm),{once:!0}));let _=_asyncToGenerator(function*(){let I;try{let T=n?.condition?.(c,{getState:S,extra:v});if(cx(T)&&(T=yield T),T===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let D=new Promise((B,L)=>{x=()=>{L({name:"AbortError",message:C||"Aborted"})},y.signal.addEventListener("abort",x,{once:!0})});h(i(g,c,n?.getPendingMeta?.({requestId:g,arg:c},{getState:S,extra:v}))),I=yield Promise.race([D,Promise.resolve(r(c,{dispatch:h,getState:S,extra:v,requestId:g,signal:y.signal,abort:E,rejectWithValue:(B,L)=>new Rl(B,L),fulfillWithValue:(B,L)=>new vm(B,L)})).then(B=>{if(B instanceof Rl)throw B;return B instanceof vm?o(B.payload,g,c,B.meta):o(B,g,c)})])}catch(T){I=T instanceof Rl?a(null,g,c,T.payload,T.meta):a(T,g,c)}finally{x&&y.signal.removeEventListener("abort",x)}return n&&!n.dispatchConditionRejection&&a.match(I)&&I.meta.condition||h(I),I})();return Object.assign(_,{abort:E,requestId:g,arg:c,unwrap(){return _.then(sx)}})}}return Object.assign(s,{pending:i,rejected:a,fulfilled:o,settled:Qt(a,o),typePrefix:t})}return e.withTypes=()=>e,e})();function sx(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function cx(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Tm=Symbol.for("rtk-slice-createasyncthunk"),qD={[Tm]:Ee};function ux(e,t){return`${e}/${t}`}function lx({creators:e}={}){let t=e?.asyncThunk?.[Tm];return function(n){let{name:o,reducerPath:i=o}=n;if(!o)throw new Error(pt(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(fx()):n.reducers)||{},s=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(I,k){let T=typeof I=="string"?I:I.type;if(!T)throw new Error(pt(12));if(T in c.sliceCaseReducersByType)throw new Error(pt(13));return c.sliceCaseReducersByType[T]=k,u},addMatcher(I,k){return c.sliceMatchers.push({matcher:I,reducer:k}),u},exposeAction(I,k){return c.actionCreators[I]=k,u},exposeCaseReducer(I,k){return c.sliceCaseReducersByName[I]=k,u}};s.forEach(I=>{let k=a[I],T={reducerName:I,type:ux(o,I),createNotation:typeof n.reducers=="function"};mx(k)?hx(T,k,u,t):px(T,k,u)});function h(){let[I={},k=[],T=void 0]=typeof n.extraReducers=="function"?Rm(n.extraReducers):[n.extraReducers],D={...I,...c.sliceCaseReducersByType};return Le(n.initialState,B=>{for(let L in D)B.addCase(L,D[L]);for(let L of c.sliceMatchers)B.addMatcher(L.matcher,L.reducer);for(let L of k)B.addMatcher(L.matcher,L.reducer);T&&B.addDefaultCase(T)})}let S=I=>I,v=new Map,g=new WeakMap,y;function x(I,k){return y||(y=h()),y(I,k)}function C(){return y||(y=h()),y.getInitialState()}function E(I,k=!1){function T(B){let L=B[I];return typeof L>"u"&&k&&(L=Wa(g,T,C)),L}function D(B=S){let L=Wa(v,k,()=>new WeakMap);return Wa(L,B,()=>{let j={};for(let[U,q]of Object.entries(n.selectors??{}))j[U]=dx(q,B,()=>Wa(g,B,C),k);return j})}return{reducerPath:I,getSelectors:D,get selectors(){return D(T)},selectSlice:T}}let _={name:o,reducer:x,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:C,...E(i),injectInto(I,{reducerPath:k,...T}={}){let D=k??i;return I.inject({reducerPath:D,reducer:x},T),{..._,...E(D,!0)}}};return _}}function dx(e,t,r,n){function o(i,...a){let s=t(i);return typeof s>"u"&&n&&(s=r()),e(s,...a)}return o.unwrapped=e,o}var on=lx();function fx(){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 px({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!gx(n))throw new Error(pt(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?N(e,a):N(e))}function mx(e){return e._reducerDefinitionType==="asyncThunk"}function gx(e){return e._reducerDefinitionType==="reducerWithPrepare"}function hx({type:e,reducerName:t},r,n,o){if(!o)throw new Error(pt(18));let{payloadCreator:i,fulfilled:a,pending:s,rejected:c,settled:u,options:h}=r,S=o(e,i,h);n.exposeAction(t,S),a&&n.addCase(S.fulfilled,a),s&&n.addCase(S.pending,s),c&&n.addCase(S.rejected,c),u&&n.addMatcher(S.settled,u),n.exposeCaseReducer(t,{fulfilled:a||Ka,pending:s||Ka,rejected:c||Ka,settled:u||Ka})}function Ka(){}var yx="task",_m="listener",km="completed",_l="cancelled",Sx=`task-${_l}`,vx=`task-${km}`,Il=`${_m}-${_l}`,bx=`${_m}-${km}`,ts=class{constructor(e){Ae(this,"name","TaskAbortError");Ae(this,"message");this.code=e,this.message=`${yx} ${_l} (reason: ${e})`}},kl=(e,t)=>{if(typeof e!="function")throw new TypeError(pt(32))},Ya=()=>{},Om=(e,t=Ya)=>(e.catch(t),e),Pm=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),rn=e=>{if(e.aborted)throw new ts(e.reason)};function Nm(e,t){let r=Ya;return new Promise((n,o)=>{let i=()=>o(new ts(e.reason));if(e.aborted){i();return}r=Pm(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=Ya})}var wx=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(function*(e,t){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof ts?"cancelled":"rejected",error:r}}finally{t?.()}});return function wx(_x5,_x6){return _ref5.apply(this,arguments)}}(),Xa=e=>t=>Om(Nm(e,t).then(r=>(rn(e),r))),Fm=e=>{let t=Xa(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Wn}=Object,wm={},rs="listenerMiddleware",Ax=(e,t)=>{let r=n=>Pm(e,()=>n.abort(e.reason));return(n,o)=>{kl(n,"taskExecutor");let i=new l.AbortController;r(i);let a=wx(/*#__PURE__*/_asyncToGenerator(function*(){rn(e),rn(i.signal);let s=yield n({pause:Xa(i.signal),delay:Fm(i.signal),signal:i.signal});return rn(i.signal),s}),()=>i.abort(vx));return o?.autoJoin&&t.push(a.catch(Ya)),{result:Xa(e)(a),cancel(){i.abort(Sx)}}}},xx=(e,t)=>{let r=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(function*(n,o){rn(t);let i=()=>{},s=[new Promise((c,u)=>{let h=e({predicate:n,effect:(S,v)=>{v.unsubscribe(),c([S,v.getState(),v.getOriginalState()])}});i=()=>{h(),u()}})];o!=null&&s.push(new Promise(c=>setTimeout(c,o,null)));try{let c=yield Nm(t,Promise.race(s));return rn(t),c}finally{i()}});return function r(_x7,_x8){return _ref7.apply(this,arguments)}}();return(n,o)=>Om(r(n,o))},Dm=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=N(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(pt(21));return kl(i,"options.listener"),{predicate:o,type:t,effect:i}},Mm=Wn(e=>{let{type:t,predicate:r,effect:n}=Dm(e);return{id:Ii(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(pt(22))}}},{withTypes:()=>Mm}),Am=(e,t)=>{let{type:r,effect:n,predicate:o}=Dm(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},Tl=e=>{e.pending.forEach(t=>{t.abort(Il)})},Cx=(e,t)=>()=>{for(let r of t.keys())Tl(r);e.clear()},xm=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},qm=Wn(N(`${rs}/add`),{withTypes:()=>qm}),Ex=N(`${rs}/removeAll`),jm=Wn(N(`${rs}/remove`),{withTypes:()=>jm}),Rx=(...e)=>{console.error(`${rs}/error`,...e)},Lm=(e={})=>{let t=new Map,r=new Map,n=g=>{let y=r.get(g)??0;r.set(g,y+1)},o=g=>{let y=r.get(g)??1;y===1?r.delete(g):r.set(g,y-1)},{extra:i,onError:a=Rx}=e;kl(a,"onError");let s=g=>(g.unsubscribe=()=>t.delete(g.id),t.set(g.id,g),y=>{g.unsubscribe(),y?.cancelActive&&Tl(g)}),c=g=>{let y=Am(t,g)??Mm(g);return s(y)};Wn(c,{withTypes:()=>c});let u=g=>{let y=Am(t,g);return y&&(y.unsubscribe(),g.cancelActive&&Tl(y)),!!y};Wn(u,{withTypes:()=>u});let h=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(function*(g,y,x,C){let E=new l.AbortController,_=xx(c,E.signal),I=[];try{g.pending.add(E),n(g),yield Promise.resolve(g.effect(y,Wn({},x,{getOriginalState:C,condition:(k,T)=>_(k,T).then(Boolean),take:_,delay:Fm(E.signal),pause:Xa(E.signal),extra:i,signal:E.signal,fork:Ax(E.signal,I),unsubscribe:g.unsubscribe,subscribe:()=>{t.set(g.id,g)},cancelActiveListeners:()=>{g.pending.forEach((k,T,D)=>{k!==E&&(k.abort(Il),D.delete(k))})},cancel:()=>{E.abort(Il),g.pending.delete(E)},throwIfCancelled:()=>{rn(E.signal)}})))}catch(k){k instanceof ts||xm(a,k,{raisedBy:"effect"})}finally{yield Promise.all(I),E.abort(bx),o(g),g.pending.delete(E)}});return function h(_x9,_x0,_x1,_x10){return _ref8.apply(this,arguments)}}(),S=Cx(t,r);return{middleware:g=>y=>x=>{if(!ui(x))return y(x);if(qm.match(x))return c(x.payload);if(Ex.match(x)){S();return}if(jm.match(x))return u(x.payload);let C=g.getState(),E=()=>{if(C===wm)throw new Error(pt(23));return C},_;try{if(_=y(x),t.size>0){let I=g.getState(),k=Array.from(t.values());for(let T of k){let D=!1;try{D=T.predicate(x,I,C)}catch(B){D=!1,xm(a,B,{raisedBy:"predicate"})}D&&h(T,x,g,E)}}}finally{C=wm}return _},startListening:c,stopListening:u,clearListeners:S}};function pt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}m();d();p();f();var J=new z({required:!0,emptyAllowed:!1}),tt=new z({required:!1,emptyAllowed:!1}),rt=new z({required:!0,emptyAllowed:!0}),KD=new z({required:!1,emptyAllowed:!0}),ns=new he({each:J,required:!0}),Vm=new z({required:!1,emptyAllowed:!1,regex:/^\d+\.\d+\.\d+$/}),Um=new z({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),YD=new z({required:!0,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/}),sr=({message:e,name:t,stack:r})=>({message:e,name:t,stack:r}),Et=(e,t)=>{if("required"in t)return{payload:new gt({value:t}).validate({value:e}).value};let o=new re({options:{required:!0},values:t}).validate(e);if(o)throw new ni(o);return{payload:e}},$=(e,t)=>{try{return Et(e,t)}catch(r){return{payload:e,error:sr(r)}}},Bm=(e,t,r,n)=>{let o=`Check the initialState of ${n}`;return Gm(e,t,r,o,"Controller initialization error")},$m=(e,t,r,n)=>{let o=`Check the options of ${n}`;return Gm(e,t,r,o,"Controller initialization error")},Gm=(e,t,r,n,o)=>{try{return t.validate(r,n)}catch(i){throw e.logger.error(i,o),i}};m();d();p();f();var Xn="3.48.1",Qm=["@coveo/atomic","@coveo/quantic"];var Ol=()=>tt,Hm=()=>J,xr=N("configuration/updateBasicConfiguration",e=>$(e,{accessToken:tt,environment:new z({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:tt})),Ht=N("configuration/updateSearchConfiguration",e=>$(e,{proxyBaseUrl:new z({required:!1,url:!0}),pipeline:new z({required:!1,emptyAllowed:!0}),searchHub:tt,timezone:tt,locale:tt,authenticationProviders:new he({required:!1,each:J})})),Ix={enabled:new fe({default:!0}),originContext:Ol(),originLevel2:Ol(),originLevel3:Ol(),proxyBaseUrl:new z({required:!1,url:!0}),runtimeEnvironment:new Fe,anonymous:new fe({default:!1}),deviceId:tt,userDisplayName:tt,documentLocation:tt,trackingId:Um,analyticsMode:new z({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new re({options:{required:!1},values:Qm.reduce((e,t)=>(e[t]=Vm,e),{})})},Jn=N("configuration/updateAnalyticsConfiguration",e=>$(e,Ix)),Zn=N("configuration/analytics/disable"),eo=N("configuration/analytics/enable"),os=N("configuration/analytics/originlevel2",e=>$(e,{originLevel2:Hm()})),is=N("configuration/analytics/originlevel3",e=>$(e,{originLevel3:Hm()})),zm=N("knowledge/setAgentId",e=>$(e,new z({required:!0})));m();d();p();f();m();d();p();f();m();d();p();f();var Wm={q:new z,enableQuerySyntax:new fe,aq:new z,cq:new z,firstResult:new ne({min:0}),numberOfResults:new ne({min:0}),sortCriteria:new z,f:new re,fExcluded:new re,cf:new re,nf:new re,mnf:new re,df:new re,debug:new fe,sf:new re,tab:new z,af:new re};var Cr=N("searchParameters/restore",e=>$(e,Wm)),Km=N("searchParameters/restoreTab",e=>$(e,J));m();d();p();f();var as=N("debug/enable"),ss=N("debug/disable");m();d();p();f();var cs=()=>!1;var us=Le(cs(),e=>{e.addCase(as,()=>!0).addCase(ss,()=>!1).addCase(Cr,(t,r)=>r.payload.debug??t)});m();d();p();f();var to=N("pipeline/set",e=>$(e,new z({required:!0,emptyAllowed:!0})));m();d();p();f();m();d();p();f();var Tx=N("history/undo"),_x=N("history/redo"),zt=N("history/snapshot"),iq=Ee("history/back",/*#__PURE__*/function(){var _ref9=_asyncToGenerator(function*(e,{dispatch:t}){t(Tx()),yield t(yt())});return function(_x11,_x12){return _ref9.apply(this,arguments)}}()),aq=Ee("history/forward",/*#__PURE__*/function(){var _ref0=_asyncToGenerator(function*(e,{dispatch:t}){t(_x()),yield t(yt())});return function(_x13,_x14){return _ref0.apply(this,arguments)}}()),yt=Ee("history/change",/*#__PURE__*/function(){var _ref1=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x15,_x16){return _ref1.apply(this,arguments)}}());m();d();p();f();var ro=()=>"";var no=Le(ro(),e=>{e.addCase(to,(t,r)=>r.payload).addCase(yt.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Ht,(t,r)=>r.payload.pipeline||t)});m();d();p();f();m();d();p();f();var ls=N("app/setError");m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();var oo=class e{static set(t,r,n){let o,i,a;n&&(i=new Date,i.setTime(i.getTime()+n));let s=window.location.hostname,c=/^(\d{1,3}\.){3}\d{1,3}$/,u=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;c.test(s)||u.test(s)||s.indexOf(".")===-1?Pl(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],Pl(t,r,i,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function Pl(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}m();d();p();f();function kx(){return typeof navigator<"u"}function Ym(){try{return typeof localStorage<"u"}catch{return!1}}function Xm(){try{return typeof sessionStorage<"u"}catch{return!1}}function Jm(){return!!(kx()&&navigator.cookieEnabled)}var Zm=null;function eg(){return Zm||(Ym()?localStorage:Jm()?new Nl:Xm()?sessionStorage:new Fl)}var io=class io{getItem(t){return oo.get(`${io.prefix}${t}`)}removeItem(t){oo.erase(`${io.prefix}${t}`)}setItem(t,r,n){oo.set(`${io.prefix}${t}`,r,n)}};Ae(io,"prefix","coveo_");var Nl=io;var Fl=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var ds="__coveo.analytics.history",Ox=20,Px=1e3*60,Nx=75,an=class an{constructor(t){Ae(this,"store");this.store=t||eg()}static getInstance(t){return an.instance||(an.instance=new an(t)),an.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(ds);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(ds);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(ds,JSON.stringify(t.slice(0,Ox)))}catch{}}clear(){try{this.store.removeItem(ds)}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,Nx)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>Px:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};Ae(an,"instance",null);var Dl=an,Rt=Dl;m();d();p();f();m();d();p();f();var ao=Be(e=>e.source,e=>Object.entries(e).map(([t,r])=>`${t}@${r}`).concat(`@coveo/headless@${Xn}`));m();d();p();f();m();d();p();f();function cr(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(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(S){a(S)}}function c(h){try{u(n.throw(h))}catch(S){a(S)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}var ve;(function(e){e.search="search",e.click="click",e.custom="custom",e.view="view",e.collect="collect"})(ve||(ve={}));function jl(){return typeof window<"u"}function Xl(){return typeof navigator<"u"}function so(){return typeof document<"u"}function Ll(){try{return typeof localStorage<"u"}catch{return!1}}function Fx(){try{return typeof sessionStorage<"u"}catch{return!1}}function mg(){return Xl()&&navigator.cookieEnabled}var Dx=[ve.click,ve.custom,ve.search,ve.view],Mx=(e,t)=>Dx.indexOf(e)!==-1?Object.assign({language:so()?document.documentElement.lang:"unknown",userAgent:Xl()?navigator.userAgent:"unknown"},t):t,_i=class e{static set(t,r,n){var o,i,a,s;n&&(i=new Date,i.setTime(i.getTime()+n)),s=window.location.hostname,s.indexOf(".")===-1?tg(t,r,i):(a=s.split("."),o=a[a.length-2]+"."+a[a.length-1],tg(t,r,i,o))}static get(t){for(var r=t+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o];if(i=i.replace(/^\s+/,""),i.lastIndexOf(r,0)===0)return i.substring(r.length,i.length)}return null}static erase(t){e.set(t,"",-1)}};function tg(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"}function qx(){return Ll()?localStorage:mg()?new ki:Fx()?sessionStorage:new uo}var ki=class e{getItem(t){return _i.get(`${e.prefix}${t}`)}removeItem(t){_i.erase(`${e.prefix}${t}`)}setItem(t,r,n){_i.set(`${e.prefix}${t}`,r,n)}};ki.prefix="coveo_";var Vl=class{constructor(){this.cookieStorage=new ki}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)}},uo=class{getItem(t){return null}removeItem(t){}setItem(t,r){}},fs="__coveo.analytics.history",jx=20,Lx=1e3*60,Vx=75,gs=class{constructor(t){this.store=t||qx()}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(fs);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(fs);return t?JSON.parse(t):[]}catch{return[]}})}setHistory(t){try{this.store.setItem(fs,JSON.stringify(t.slice(0,jx)))}catch{}}clear(){try{this.store.removeItem(fs)}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,Vx)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value==t.value?(t.internalTime||0)-(r.internalTime||0)>Lx:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:i}=r;return{name:n,time:o,value:i}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};var Ux=(e,t)=>V(void 0,void 0,void 0,function*(){return e===ve.view?(yield Bx(t.contentIdValue),Object.assign({location:window.location.toString(),referrer:document.referrer,title:document.title},t)):t}),Bx=e=>V(void 0,void 0,void 0,function*(){let t=new gs,r={name:"PageView",value:e,time:new Date().toISOString()};yield t.addElementAsync(r)}),ps,$x=new Uint8Array(16);function Gx(){if(!ps&&(ps=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ps))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ps($x)}var Qx=/^(?:[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 hs(e){return typeof e=="string"&&Qx.test(e)}var nt=[];for(let e=0;e<256;++e)nt.push((e+256).toString(16).slice(1));function gg(e,t=0){return nt[e[t+0]]+nt[e[t+1]]+nt[e[t+2]]+nt[e[t+3]]+"-"+nt[e[t+4]]+nt[e[t+5]]+"-"+nt[e[t+6]]+nt[e[t+7]]+"-"+nt[e[t+8]]+nt[e[t+9]]+"-"+nt[e[t+10]]+nt[e[t+11]]+nt[e[t+12]]+nt[e[t+13]]+nt[e[t+14]]+nt[e[t+15]]}function Hx(e){if(!hs(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 zx(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Wx="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Kx="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Yx(e,t,r){function n(o,i,a,s){var c;if(typeof o=="string"&&(o=zx(o)),typeof i=="string"&&(i=Hx(i)),((c=i)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+o.length);if(u.set(i),u.set(o,i.length),u=r(u),u[6]=u[6]&15|t,u[8]=u[8]&63|128,a){s=s||0;for(let h=0;h<16;++h)a[s+h]=u[h];return a}return gg(u)}try{n.name=e}catch{}return n.DNS=Wx,n.URL=Kx,n}var Xx=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),rg={randomUUID:Xx};function sn(e,t,r){if(rg.randomUUID&&!t&&!e)return rg.randomUUID();e=e||{};let n=e.random||(e.rng||Gx)();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 gg(n)}function Jx(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 Ml(e,t){return e<<t|e>>>32-t}function Zx(e){let t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){let a=unescape(encodeURIComponent(e));e=[];for(let s=0;s<a.length;++s)e.push(a.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);let n=e.length/4+2,o=Math.ceil(n/16),i=new Array(o);for(let a=0;a<o;++a){let s=new Uint32Array(16);for(let c=0;c<16;++c)s[c]=e[a*64+c*4]<<24|e[a*64+c*4+1]<<16|e[a*64+c*4+2]<<8|e[a*64+c*4+3];i[a]=s}i[o-1][14]=(e.length-1)*8/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<o;++a){let s=new Uint32Array(80);for(let g=0;g<16;++g)s[g]=i[a][g];for(let g=16;g<80;++g)s[g]=Ml(s[g-3]^s[g-8]^s[g-14]^s[g-16],1);let c=r[0],u=r[1],h=r[2],S=r[3],v=r[4];for(let g=0;g<80;++g){let y=Math.floor(g/20),x=Ml(c,5)+Jx(y,u,h,S)+v+t[y]+s[g]>>>0;v=S,S=h,h=Ml(u,30)>>>0,u=c,c=x}r[0]=r[0]+c>>>0,r[1]=r[1]+u>>>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 eC=Yx("v5",80,Zx),ng=eC,hg="2.30.54",og=e=>`${e.protocol}//${e.hostname}${e.pathname.indexOf("/")===0?e.pathname:`/${e.pathname}`}${e.search}`,Ti={pageview:"pageview",event:"event"},ys=class{constructor({client:t,uuidGenerator:r=sn}){this.client=t,this.uuidGenerator=r}},Ul=class extends ys{constructor({client:t,uuidGenerator:r=sn}){super({client:t,uuidGenerator:r}),this.actionData={},this.pageViewId=r(),this.nextPageViewId=this.pageViewId,this.currentLocation=og(window.location),this.lastReferrer=so()?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:so()?document.title:"",encoding:so()?document.characterSet:"UTF-8"},n={screenResolution:`${screen.width}x${screen.height}`,screenColor:`${screen.colorDepth}-bit`},o={language:navigator.language,userAgent:navigator.userAgent},i={time:Date.now(),eventId:this.uuidGenerator()};return Object.assign(Object.assign(Object.assign(Object.assign({},i),n),o),r)}updateLocationForNextPageView(t,r){let{pageViewId:n,referrer:o,location:i}=this.getNextValues(t,r);this.lastReferrer=o,this.pageViewId=n,this.currentLocation=i,t===Ti.pageview&&(this.nextPageViewId=this.uuidGenerator(),this.hasSentFirstPageView=!0)}getNextValues(t,r){return{pageViewId:t===Ti.pageview?this.nextPageViewId:this.pageViewId,referrer:t===Ti.pageview&&this.hasSentFirstPageView?this.currentLocation:this.lastReferrer,location:t===Ti.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 og(window.location)}},Er=class e{constructor(t,r){if(!hs(t))throw Error("Not a valid uuid");this.clientId=t,this.creationDate=Math.floor(r/1e3)}toString(){return this.clientId.replace(/-/g,"")+"."+this.creationDate.toString()}get expired(){let t=Math.floor(Date.now()/1e3)-this.creationDate;return t<0||t>e.expirationTime}validate(t,r){return!this.expired&&this.matchReferrer(t,r)}matchReferrer(t,r){try{let n=new URL(t);return r.some(o=>new RegExp(o.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(n.host))}catch{return!1}}static fromString(t){let r=t.split(".");if(r.length!==2)return null;let[n,o]=r;if(n.length!==32||isNaN(parseInt(o)))return null;let i=n.substring(0,8)+"-"+n.substring(8,12)+"-"+n.substring(12,16)+"-"+n.substring(16,20)+"-"+n.substring(20,32);return hs(i)?new e(i,Number.parseInt(o)*1e3):null}};Er.cvo_cid="cvo_cid";Er.expirationTime=120;var Bl=class extends ys{constructor({client:t,uuidGenerator:r=sn}){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(Er.cvo_cid,new Er(n,Date.now()).toString()),r.toString()}catch{throw new Error("Invalid URL provided")}})}acceptFrom(t){this.client.setAcceptedLinkReferrers(t)}};Bl.Id="link";var Tt=Object.keys;function ms(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var ql=128,yg=192,ig=224,ag=240;function tC(e){return(e&248)===ag?4:(e&ag)===ig?3:(e&ig)===yg?2:1}function rC(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&ql)!=ql)break;if(r-=3,(n&yg)!=ql){t-r>=tC(n)*3&&(r=t);break}}return e.substring(0,r)}var $l={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"},nC=Tt($l).map(e=>$l[e]),oC=[...nC].join("|"),iC=new RegExp(`^(${oC}$)`),aC={svcAction:"svc_action",svcActionData:"svc_action_data"},sC=e=>Tt(e).filter(t=>e[t]!==void 0).reduce((t,r)=>{let n=$l[r]||r;return Object.assign(Object.assign({},t),{[n]:e[r]})},{}),cC=e=>iC.test(e),uC=[cC],sg={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",price:"pr",quantity:"qt",coupon:"cc",position:"ps",group:"group"},cg={id:"id",name:"nm",brand:"br",category:"ca",variant:"va",position:"ps",price:"pr",group:"group"},ct={action:"pa",list:"pal",listSource:"pls"},Ss={id:"ti",revenue:"tr",tax:"tt",shipping:"ts",coupon:"tcc",affiliation:"ta",step:"cos",option:"col"},lC=["loyaltyCardId","loyaltyTier","thirdPartyPersona","companyName","favoriteStore","storeName","userIndustry","userRole","userDepartment","businessUnit"],Gl={id:"quoteId",affiliation:"quoteAffiliation"},Ql={id:"reviewId",rating:"reviewRating",comment:"reviewComment"},dC={add:ct,bookmark_add:ct,bookmark_remove:ct,click:ct,checkout:ct,checkout_option:ct,detail:ct,impression:ct,remove:ct,refund:Object.assign(Object.assign({},ct),Ss),purchase:Object.assign(Object.assign({},ct),Ss),quickview:ct,quote:Object.assign(Object.assign({},ct),Gl),review:Object.assign(Object.assign({},ct),Ql)},fC=Tt(sg).map(e=>sg[e]),pC=Tt(cg).map(e=>cg[e]),mC=Tt(ct).map(e=>ct[e]),gC=Tt(Ss).map(e=>Ss[e]),hC=Tt(Ql).map(e=>Ql[e]),yC=Tt(Gl).map(e=>Gl[e]),SC=[...fC,"custom"].join("|"),vC=[...pC,"custom"].join("|"),Sg="(pr[0-9]+)",vg="(il[0-9]+pi[0-9]+)",bC=new RegExp(`^${Sg}(${SC})$`),wC=new RegExp(`^(${vg}(${vC}))|(il[0-9]+nm)$`),AC=new RegExp(`^(${mC.join("|")})$`),xC=new RegExp(`^(${gC.join("|")})$`),CC=new RegExp(`^${Sg}custom$`),EC=new RegExp(`^${vg}custom$`),RC=new RegExp(`^(${[...lC,...hC,...yC].join("|")})$`),IC=e=>bC.test(e),TC=e=>wC.test(e),_C=e=>AC.test(e),kC=e=>xC.test(e),OC=e=>RC.test(e),PC=[TC,IC,_C,kC,OC],NC=[CC,EC],FC={anonymizeIp:"aip"},DC={eventCategory:"ec",eventAction:"ea",eventLabel:"el",eventValue:"ev",page:"dp",visitorId:"cid",clientId:"cid",userId:"uid",currencyCode:"cu"},MC={hitType:"t",pageViewId:"pid",encoding:"de",location:"dl",referrer:"dr",screenColor:"sd",screenResolution:"sr",title:"dt",userAgent:"ua",language:"ul",eventId:"z",time:"tm"},qC=["contentId","contentIdKey","contentType","searchHub","tab","searchUid","permanentId","contentLocale","trackingId"],jC=Object.assign(Object.assign(Object.assign(Object.assign({},FC),DC),MC),qC.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:t}),{})),Hl=Object.assign(Object.assign({},jC),aC),LC=e=>{let t=!!e.action&&dC[e.action]||{};return Tt(e).reduce((r,n)=>{let o=t[n]||Hl[n]||n;return Object.assign(Object.assign({},r),{[o]:e[n]})},{})},VC=Tt(Hl).map(e=>Hl[e]),UC=e=>VC.indexOf(e)!==-1,BC=e=>e==="custom",$C=e=>[...PC,...uC,UC,BC].some(t=>t(e)),GC=e=>Tt(e).reduce((t,r)=>{let n=QC(r);return n?Object.assign(Object.assign({},t),HC(n,e[r])):Object.assign(Object.assign({},t),{[r]:e[r]})},{}),QC=e=>{let t;return[...NC].every(r=>{var n;return t=(n=r.exec(e))===null||n===void 0?void 0:n[1],!t}),t},HC=(e,t)=>Tt(t).reduce((r,n)=>Object.assign(Object.assign({},r),{[`${e}${n}`]:t[n]}),{}),zl=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,i=yield this.getQueryParamsForEventType(t),{url:a,payload:s}=yield this.preProcessRequestAsPotentialJSONString(`${n}/analytics/${t}?${i}`,r,o),c=this.encodeForEventType(t,s),u=new Blob([c],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(a,u)})}isAvailable(){return"sendBeacon"in navigator}deleteHttpCookieVisitorId(){return Promise.resolve()}preProcessRequestAsPotentialJSONString(t,r,n){return V(this,void 0,void 0,function*(){let o=t,i=r;if(n){let a=yield n({url:t,body:JSON.stringify(r)},"analyticsBeacon"),{url:s,body:c}=a;o=s||t;try{i=JSON.parse(c)}catch(u){console.error("Unable to process the request body as a JSON string",u)}}return{payload:i,url:o}})}encodeForEventType(t,r){return this.isEventTypeLegacy(t)?this.encodeEventToJson(t,r):this.encodeEventToJson(t,r,this.opts.token)}getQueryParamsForEventType(t){return 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(i=>!!i).join("&")})}isEventTypeLegacy(t){return[ve.click,ve.custom,ve.search,ve.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}},Wl=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()})}},ug=b.fetch,vs=class{constructor(t){this.opts=t}sendEvent(t,r){return V(this,void 0,void 0,function*(){let{baseUrl:n,visitorIdProvider:o,preprocessRequest:i}=this.opts,a=this.shouldAppendVisitorId(t)?yield this.getVisitorIdParam():"",s={url:`${n}/analytics/${t}${a}`,credentials:"include",mode:"cors",headers:this.getHeaders(),method:"POST",body:JSON.stringify(r)},c=Object.assign(Object.assign({},s),i?yield i(s,"analyticsFetch"):{}),{url:u}=c,h=cr(c,["url"]),S;try{S=yield ug(u,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 V(this,void 0,void 0,function*(){let{baseUrl:t}=this.opts,r=`${t}/analytics/visit`;yield ug(r,{headers:this.getHeaders(),method:"DELETE"})})}shouldAppendVisitorId(t){return[ve.click,ve.custom,ve.search,ve.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"})}},Kl=class{constructor(t,r){Ll()&&mg()?this.storage=new Vl:Ll()?this.storage=localStorage:(console.warn("BrowserRuntime detected no valid storage available.",this),this.storage=new uo),this.client=new vs(t),this.beaconClient=new zl(t),window.addEventListener("beforeunload",()=>{let n=r();for(let{eventType:o,payload:i}of n)this.beaconClient.sendEvent(o,i)})}getClientDependingOnEventType(t){return t==="click"&&this.beaconClient.isAvailable()?this.beaconClient:this.client}},Yl=class{constructor(t,r){this.storage=r||new uo,this.client=new vs(t)}getClientDependingOnEventType(t){return this.client}},bs=class{constructor(){this.storage=new uo,this.client=new Wl}getClientDependingOnEventType(t){return this.client}},zC="xx",WC=e=>e?.startsWith(zC)||!1,KC=`
|
|
27
27
|
We've detected you're using React Native but have not provided the corresponding runtime,
|
|
28
28
|
for an optimal experience please use the "coveo.analytics/react-native" subpackage.
|
|
29
29
|
Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
|
|
30
|
-
`;function Kx(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var Yx=["1",1,"yes",!0];function Ya(){let e=[];return dl()&&e.push(window.doNotTrack),Cl()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>Yx.indexOf(t)!==-1)}var Bm="v15",$m={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 Xx(e=$m.default,t=Bm,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 Jx="38824e1f-37f5-42d3-8372-a4b8fa9df946",Ut=class{get defaultOptions(){return{endpoint:$m.default,isCustomEndpoint:!1,token:"",version:Bm,beforeSendHooks:[],afterSendHooks:[]}}get version(){return jm}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=[Vw,Dw].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};Ya()?this.runtime=new Ka:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(ve.view,{newEventType:ve.view,addClientIdParameter:!0}),this.addEventTypeMapping(ve.click,{newEventType:ve.click,addClientIdParameter:!0}),this.addEventTypeMapping(ve.custom,{newEventType:ve.custom,addClientIdParameter:!0}),this.addEventTypeMapping(ve.search,{newEventType:ve.search,addClientIdParameter:!0})}initRuntime(t){return dl()&&ro()?new wl(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(Kx()&&console.warn(Wx),new xl(t))}get storage(){return this.runtime.storage}determineVisitorId(){return M(this,void 0,void 0,function*(){try{return dl()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Xr()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Xr()}})}getCurrentVisitorId(){return M(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return M(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return M(this,void 0,void 0,function*(){if(Qa(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(Em(t,Em(r,Jx)))}})}getParameters(t,...r){return M(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return M(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(Xr()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(Ya())return null;try{let r=new URL(t).searchParams.get(yr.cvo_cid);if(r==null)return null;let n=yr.fromString(r);return!n||!ro()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return M(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[g=>n.length>0?this.parseVariableArgumentsPayload(n,g):g[0],g=>M(this,void 0,void 0,function*(){return Object.assign(Object.assign({},g),{visitorId:o?yield this.getCurrentVisitorId():""})}),g=>M(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},g),{clientId:yield this.getCurrentVisitorId()}):g}),g=>i?this.ensureAnonymousUserWhenUsingApiKey(g):g,g=>this.beforeSendHooks.reduce((y,C)=>M(this,void 0,void 0,function*(){let R=yield y;return yield C(t,R)}),g)].reduce((g,y)=>M(this,void 0,void 0,function*(){let C=yield g;return yield y(C)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return M(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[v=>this.setTrackingIdIfTrackingIdNotPresent(v),v=>this.removeEmptyPayloadValues(v,t),v=>this.validateParams(v,t),v=>n?jx(v):v,v=>n?this.removeUnknownParameters(v):v,v=>n?this.processCustomParameters(v):this.mapCustomParametersToCustomData(v)].reduce((v,S)=>M(this,void 0,void 0,function*(){let g=yield v;return yield S(g)}),Promise.resolve(r))})}makeEvent(t,...r){return M(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>M(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(s=>s(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return M(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return M(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 Ga().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return M(this,void 0,void 0,function*(){return this.makeEvent(ve.search,t)})}sendSearchEvent(t){return M(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=er(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return M(this,void 0,void 0,function*(){return this.makeEvent(ve.click,t)})}sendClickEvent(t){return M(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=er(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return M(this,void 0,void 0,function*(){return this.makeEvent(ve.custom,t)})}sendCustomEvent(t){return M(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=er(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return M(this,void 0,void 0,function*(){return this.makeEvent(ve.view,t)})}sendViewEvent(t){return M(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return M(this,void 0,void 0,function*(){let r=yield(yield A(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return M(this,void 0,void 0,function*(){return yield(yield A(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[ve.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(Bx(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=er(t,["custom"]),o={};r&&$a(r)&&(o=this.lowercaseKeys(r));let i=$x(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=er(t,["custom"]);if(r&&$a(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=er(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==ve.view||r==ve.click||r==ve.search||r==ve.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==ve.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=er(t,["userId"]);return zx(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=er(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&$a(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&$a(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"?tx(t,r):t}get baseUrl(){return Xx(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},tr;(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"})(tr||(tr={}));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 Pm={[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",[tr.expandToFullUI]:"interface",[tr.openUserActions]:"User Actions",[tr.showPrecedingSessions]:"User Actions",[tr.showFollowingSessions]:"User Actions",[tr.clickViewedDocument]:"User Actions",[tr.clickPageView]:"User Actions",[tr.createArticle]:"createArticle"},io=class{constructor(){this.runtime=new Ka,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(ve.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(ve.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(ve.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(ve.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return jm}};function Zx(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function eC(e){return e.map(t=>t.replace(/;/g,""))}function Gm(e){let r=e.join(";");return r.length<=256?r:Gm(e.slice(1))}var Nm=e=>{let t=eC(e),r=Zx(t);return Gm(r)};function Fm(e){let t=typeof e.partialQueries=="string"?e.partialQueries:Nm(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:Nm(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var Xa=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||Ya();this.coveoAnalyticsClient=n?new io:new Ut(t)}disable(){this.coveoAnalyticsClient=new io}enable(){this.coveoAnalyticsClient=new Ut(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(L.interfaceLoad)}logInterfaceLoad(){return M(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(L.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return M(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(L.recommendation)}logRecommendation(){return M(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 M(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 M(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 M(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 M(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 M(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 M(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent(L.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return M(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(L.didyoumeanClick)}logDidYouMeanClick(){return M(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 M(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent(L.searchboxSubmit)}logSearchboxSubmit(){return M(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(L.searchboxClear)}logSearchboxClear(){return M(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(L.searchboxAsYouType)}logSearchboxAsYouType(){return M(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 M(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent(L.breadcrumbResetAll)}logBreadcrumbResetAll(){return M(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 M(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 M(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent(L.omniboxAnalytics,Fm(t))}logOmniboxAnalytics(t){return M(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent(L.omniboxFromLink,Fm(t))}logOmniboxFromLink(t){return M(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent(L.searchFromLink)}logSearchFromLink(){return M(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 M(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 M(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 M(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 M(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 M(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 M(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 M(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 M(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 M(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent(L.pagerScrolling)}logPagerScrolling(){return M(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 M(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 M(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 M(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 M(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 M(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 M(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 M(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 M(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 M(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 M(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 M(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return M(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(L.queryErrorBack);return{description:t.description,log:()=>M(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(L.queryErrorBack)})}})}logQueryErrorBack(){return M(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return M(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(L.queryErrorRetry);return{description:t.description,log:()=>M(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(L.queryErrorRetry)})}})}logQueryErrorRetry(){return M(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return M(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent(L.queryErrorClear);return{description:t.description,log:()=>M(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(L.queryErrorClear)})}})}logQueryErrorClear(){return M(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(L.likeSmartSnippet)}logLikeSmartSnippet(){return M(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(L.dislikeSmartSnippet)}logDislikeSmartSnippet(){return M(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(L.expandSmartSnippet)}logExpandSmartSnippet(){return M(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(L.collapseSmartSnippet)}logCollapseSmartSnippet(){return M(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(L.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return M(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(L.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return M(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 M(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 M(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 M(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 M(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 M(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 M(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 M(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return M(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 M(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 M(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 M(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(L.clearRecentQueries)}logClearRecentQueries(){return M(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 M(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 M(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(L.noResultsBack)}logNoResultsBack(){return M(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 M(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 M(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 M(this,arguments,void 0,function*(n,o,i=Pm[n]){this.coveoAnalyticsClient.getParameters;let a=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),s=Object.assign(Object.assign({},yield this.getBaseEventRequest(a)),{eventType:i,eventValue:n}),c=yield this.coveoAnalyticsClient.makeCustomEvent(s);return{description:this.makeEventDescription(c,n),log:({searchUID:u})=>c.log({lastSearchQueryUid:u})}})}logCustomEvent(t,r){return M(this,arguments,void 0,function*(n,o,i=Pm[n]){return(yield this.makeCustomEvent(n,o,i)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return M(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:s})=>a.log({lastSearchQueryUid:s})}})}logCustomEventWithType(t,r,n){return M(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return M(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return M(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return M(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:s})=>a.log({searchQueryUid:s})}})}logClickEvent(t,r,n,o){return M(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return M(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 M(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 Ut?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 M(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 M(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 M(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 M(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 M(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 M(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 M(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 M(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 M(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 M(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 M(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 M(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 M(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent(L.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return M(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 M(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},Ja=Object.assign({},gi),Dm=Object.keys(Ja).map(e=>Ja[e]),no=class extends ml{constructor({client:t,uuidGenerator:r=Xr}){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])=>Dm.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(Dm.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(Ja.pageview,{newEventType:ve.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(Ja.event,{newEventType:ve.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return ax(this.ticket)}};no.Id="svc";var Za;(function(e){e.click="click",e.flowStart="flowStart"})(Za||(Za={}));var xt;(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"})(xt||(xt={}));var es;(function(e){e.quit="Quit",e.solved="Solved"})(es||(es={}));var ts=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!Ya();this.coveoAnalyticsClient=o?new Ut(t):new io,this.svc=new no({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new io,this.svc=new no({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Ut(this.options),this.svc=new no({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(xt.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(xt.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(xt.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(xt.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(xt.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(xt.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(xt.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(xt.caseCancelled,{reason:es.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(xt.caseSolved,{reason:es.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(xt.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Za.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Za.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return M(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 Ut?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){return M(this,void 0,void 0,function*(){var i,a;let s=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(s)})}};var Qm=e=>new Ut(e).getCurrentVisitorId(),vi=(e,t)=>typeof t=="function"?(...r)=>{let n=Zo(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,Si=(e,t)=>(...r)=>{let n=Zo(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();function rs(){return{desiredCount:5,numberOfValues:8,set:{}}}m();d();p();f();m();d();p();f();m();d();p();f();function Hm(e){let{activeValue:t,ancestryMap:r}=tC(e);return t?rC(t,r):[]}function tC(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 rC(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var nC=(e,t)=>e.categoryFacetSet[t]?.request;var Il=(e,t)=>{let r=nC(e,t);return Hm(r?.currentValues??[])};m();d();p();f();function ns(){return{}}m();d();p();f();function os(){return{}}m();d();p();f();function is(){return{}}m();d();p();f();function as(){return{}}function Tl(e){return{facetSet:e.facetSet??as(),categoryFacetSet:e.categoryFacetSet??ns(),dateFacetSet:e.dateFacetSet??os(),numericFacetSet:e.numericFacetSet??is(),automaticFacetSet:e.automaticFacetSet??rs()}}var _l=e=>{let t=[];return aC(e).forEach((r,n)=>{let o=mC(e,r.facetId),i=fC(r,n+1);if(iC(r)){if(!!!Il(e,r.facetId).length)return;t.push({...i,...lC(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,s)=>{if(a.state==="idle")return;let c=zm(a,s+1,o),u=oC(r)?Wm(a):cC(a);t.push({...i,...c,...u})})}),sC(e).forEach((r,n)=>{let o=dC(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let s=zm(i,a+1,"specific"),c=Wm(i);t.push({...o,...s,...c})})}),t},oC=e=>e.type==="specific",iC=e=>e.type==="hierarchical",aC=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),sC=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),zm=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),cC=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),Wm=e=>({displayValue:e.value,value:e.value}),uC=(e,t)=>Il(e,t).map(n=>n.value).join(";"),lC=(e,t)=>{let n=uC(e,t);return{value:n,valuePosition:1,displayValue:n}},dC=(e,t)=>({title:Km(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),fC=(e,t)=>({title:Km(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),Km=(e,t)=>`${e}_${t}`,pC=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,mC=(e,t)=>{let r=pC(e,t);return r?r.type:"specific"};m();d();p();f();m();d();p();f();var kl=e=>e.configuration.search.locale,Ym=e=>e.configuration.search.timezone,Xm=e=>e.configuration.accessToken,Jm=e=>e.configuration.organizationId,Zm=e=>e.configuration.environment,ss=e=>e.configuration?.knowledge?.agentId;var Jr=e=>{if(gC(e)||Ol(e))return e.generatedAnswer?.answerId;if(hC(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},gC=e=>"answer"in e&&"generatedAnswer"in e&&!ie(e.generatedAnswer?.answerConfigurationId),Ol=e=>{let t=ss(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},hC=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",Pl=e=>e.generatedAnswer?.fieldsToIncludeInCitations,yC=Ve(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));m();d();p();f();var St=()=>({q:"",enableQuerySyntax:!1});m();d();p();f();m();d();p();f();var eg=(r=>(r.Ascending="ascending",r.Descending="descending",r))(eg||{}),tg=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(tg||{}),Nl=e=>{if(Yf(e))return e.map(t=>Nl(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""}},rg=()=>({by:"relevancy"});var Kj=new ee({values:{by:new Iu({enum:tg,required:!0}),order:new Iu({enum:eg}),field:new H}});function cs(){return Nl(rg())}m();d();p();f();m();d();p();f();var ao=()=>"default";var vC=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},rr=class{constructor(t){this.getState=t;we(this,"state");this.state=t()}getLanguage(){return vC(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let s=`context_${i}`;o[s]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=Hn),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||ao()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};var bi=class bi extends rr{constructor(){super(...arguments);we(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 _l(Tl(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||bi.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||Mt().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||bi.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Jr(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??cs()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],i=o.completions.map(u=>u.expression),a=o.partialQueries.length-1,s=o.partialQueries[a]||"",c=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:s,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:c}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||St().q}get responseTime(){return this.state.search?.duration||Mt().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||Mt().response.totalCountFiltered}};we(bi,"fallbackPipelineName","default");var vr=bi,ng=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o})=>{let i=t(),a=i.configuration.accessToken,s=i.configuration.analytics.apiBaseUrl??We(i.configuration.organizationId,i.configuration.environment,"analytics"),c=i.configuration.analytics.runtimeEnvironment,u=i.configuration.analytics.enabled,h=new Xa({token:a,endpoint:s,runtimeEnvironment:c,preprocessRequest:vi(e,n),beforeSendHooks:[Si(e,r),(v,S)=>(e.info({...S,type:v,endpoint:s,token:a},"Analytics request"),S)]},o);return u||h.disable(),h},Fl=()=>{let t=wt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};var us=/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield Qm(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}),...(Fl()&&{pageId:Fl()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:to(e)})}}});return function us(_x17,_x18){return _ref10.apply(this,arguments)}}();m();d();p();f();m();d();p();f();m();d();p();f();var so=()=>({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""});var Ai=class extends rr{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:St().q,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||so().searchUid}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.recommendation?.pipeline||this.state.pipeline||"default";return t?r:void 0}get responseTime(){return this.state.recommendation?.duration||so().duration}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.recommendation?.recommendations.length||so().recommendations.length}};m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();function og(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}m();d();p();f();m();d();p();f();m();d();p();f();var ig=/^(?:[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 SC(e){return typeof e=="string"&&ig.test(e)}var Dl=SC;m();d();p();f();var et=[];for(let e=0;e<256;++e)et.push((e+256).toString(16).slice(1));function ag(e,t=0){return(et[e[t+0]]+et[e[t+1]]+et[e[t+2]]+et[e[t+3]]+"-"+et[e[t+4]]+et[e[t+5]]+"-"+et[e[t+6]]+et[e[t+7]]+"-"+et[e[t+8]]+et[e[t+9]]+"-"+et[e[t+10]]+et[e[t+11]]+et[e[t+12]]+et[e[t+13]]+et[e[t+14]]+et[e[t+15]]).toLowerCase()}m();d();p();f();var Ml,bC=new Uint8Array(16);function ql(){if(!Ml){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ml=crypto.getRandomValues.bind(crypto)}return Ml(bC)}m();d();p();f();m();d();p();f();var AC=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),jl={randomUUID:AC};function wC(e,t,r){e=e||{};let n=e.random??e.rng?.()??ql();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 ag(n)}function xC(e,t,r){return jl.randomUUID&&!t&&!e?jl.randomUUID():wC(e,t,r)}var Ll=xC;function CC(_x19){return _CC.apply(this,arguments)}function _CC(){_CC=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;if(a!=="disabled")return n.call(r),t.send(o,i,r)});return _CC.apply(this,arguments)}var fg="2.0.4",Vl=128,pg=192,sg=224,cg=240,EC=248;function RC(e){return(e&EC)===cg?4:(e&cg)===sg?3:(e&sg)===pg?2:1}function IC(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&Vl)!=Vl)break;if(r-=3,(n&pg)!=Vl){t-r>=RC(n)*3&&(r=t);break}}return e.substring(0,r)}function TC(e){let{trackingId:t}=e;return{trackingId:t}}function _C(e){return(e.source||[]).concat([`relay@${fg}`])}function mg(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:i}=r,a=TC(t),s=r.getClientId();return Object.freeze({type:e,config:a,ts:Date.now(),source:_C(t),clientId:s,userAgent:i(),referrer:ug(n()),location:ug(o())})}function ug(e){return e!==null?IC(e,1024):null}function kC(e,t,r,n){return{...t,meta:mg(e,r,n)}}var OC="*";function PC(){let e=[];function t({type:c,callback:u}){return e.findIndex(h=>h.type===c&&h.callback===u)}function r(c,u){return c.type==="*"||u===c.type}function n(c){return t(c)<0&&e.push(c),()=>s(c.type,c.callback)}function o(c){e.forEach(u=>{if(r(u,c.meta.type))try{u.callback(c)}catch(h){console.error(h)}})}function i(c){if(c===OC)e.length=0;else for(let u=e.length-1;u>=0;u--)e[u].type===c&&e.splice(u,1)}function a(c){let u=t(c);u>=0&&e.splice(u,1)}function s(c,u){u?a({type:c,callback:u}):i(c)}return{add:n,call:o,remove:s}}function lg({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 NC(e){let t=lg(e);return{get:()=>t,update:r=>{t=lg({...t,...r})}}}var Ul=FC();function FC(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,s=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${s};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function DC(){return{getItem(e){return Ul.getItem(e)||localStorage.getItem(e)},removeItem(e){Ul.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),Ul.setItem(e,t,31556952e3)}}}var dg="visitorId";function MC(){let e=document.referrer;return e===""?null:e}function Bl(){let e=DC();return{runtime:"browser",send:function(){var _ref11=_asyncToGenerator(function*(t,r,n){let o=A(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});og().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let a=yield o;if(a?.ok){let s;try{s=yield a.json()}catch{return}for(let c of s.events)if(!c.accepted)throw new Error(`Received event was rejected for processing: ${c.errorMessage}`)}else throw new Error(`Error ${a.status}: Failed to send the event(s).`)});return function send(_x20,_x21,_x22){return _ref11.apply(this,arguments)}}(),getReferrer:()=>MC(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(dg);if(t&&Dl(t))return t;let r=Ll();return e.setItem(dg,r),r}}}function qC(){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 jC(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function LC(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=jC();return t&&r?{...r,runtime:"custom"}:t&&VC()&&qC()?Bl():n}function VC(){try{return typeof window=="object"}catch{return!1}}function UC(e){return{get:()=>Object.freeze(LC(e))}}function gg(e){let t=NC(e),r=PC(),n=UC(t);return{emit:function(){var _ref12=_asyncToGenerator(function*(o,i){let a=t.get(),s=n.get(),c=kC(o,i,a,s);return CC({config:a,environment:s,event:c,listenerManager:r})});return function emit(_x23,_x24){return _ref12.apply(this,arguments)}}(),getMeta:o=>mg(o,t.get(),n.get()),on:(o,i)=>r.add({type:o,callback:i}),off:(o,i)=>r.remove(o,i),updateConfig:o=>t.update(o),version:fg}}m();d();p();f();function hg(){return typeof window<"u"&&typeof document<"u"}var wi=Ve(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>to(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,s)=>{let c=$C(s);return gg({mode:i?"emit":"disabled",url:o??la(e,t),token:r,trackingId:n??null,source:a,environment:c})}),BC={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref13=_asyncToGenerator(function*(){});return function send(){return _ref13.apply(this,arguments)}}()},$C=e=>{if(!e)return;let t=e();return{...(hg()?Bl():BC),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};m();d();p();f();var xi=class extends rr{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},yg=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new xi(t)})=>{let i=t(),a=i.configuration.accessToken,s=i.configuration.analytics.apiBaseUrl??We(i.configuration.organizationId,i.configuration.environment,"analytics"),c=i.configuration.analytics.runtimeEnvironment,u=i.configuration.analytics.enabled,h=new ts({enableAnalytics:u,token:a,endpoint:s,runtimeEnvironment:c,preprocessRequest:vi(e,n),beforeSendHooks:[Si(e,r),(v,S)=>(e.info({...S,type:v,endpoint:s,token:a},"Analytics request"),S)]},o);return u||h.disable(),h};m();d();p();f();m();d();p();f();function vg(e,t){return{...new vr(t).getBaseMetadata(),actionCause:e,type:e}}function GC(e){return Object.assign(e,{instantlyCallable:!0})}function QC(e,t){let r=i=>GC(Ee(e,i)),n=r(/*#__PURE__*/function(){var _ref14=_asyncToGenerator(function*(i,{getState:a,extra:s}){let{analyticsClientMiddleware:c,preprocessRequest:u,logger:h}=s;return yield(yield t({getState:a,analyticsClientMiddleware:c,preprocessRequest:u,logger:h})).log({state:a(),extra:s})});return function(_x25,_x26){return _ref14.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref15=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:s,logger:c}){let{description:u,log:h}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:s,logger:c});return{description:u,action:r(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(v,{getState:S,extra:g}){return yield h({state:S(),extra:g})});return function(_x28,_x29){return _ref16.apply(this,arguments)}}())}});return function prepare(_x27){return _ref15.apply(this,arguments)}}()}),n}var Sg=(e,t,r)=>{function n(...o){let i=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return WC(i)}return n},HC=e=>e.configuration.analytics.analyticsMode==="legacy",zC=e=>e.configuration.analytics.analyticsMode==="next",WC=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=s=>new a(s)),QC(e,/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*({getState:s,analyticsClientMiddleware:c,preprocessRequest:u,logger:h}){let v=[],S={log:function(){var _ref18=_asyncToGenerator(function*({state:x}){for(let I of v)yield I(x)});return function log(_x31){return _ref18.apply(this,arguments)}}()},g=s(),y=i({getState:s,logger:h,analyticsClientMiddleware:c,preprocessRequest:u,provider:r(s)}),C=yield t(y,s());S.description=C?.description,v.push(/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(x){HC(x)&&(yield KC(C,r,x,h,y.coveoAnalyticsClient))});return function(_x32){return _ref19.apply(this,arguments)}}());let{emit:R}=wi(g);return v.push(/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(x){if(zC(x)&&o&&n){let I=n(x);yield rE(R,o,I)}});return function(_x33){return _ref20.apply(this,arguments)}}()),S});return function(_x30){return _ref17.apply(this,arguments)}}()));function KC(_x34,_x35,_x36,_x37,_x38){return _KC.apply(this,arguments)}function _KC(){_KC=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _KC.apply(this,arguments)}var YC=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref21=_asyncToGenerator(function*(i){r(n,o)});return function log(_x39){return _ref21.apply(this,arguments)}}()}),ct=Sg(e=>ng({...e,provider:e.provider||new vr(e.getState)}),e=>e,vr),i1=Sg(yg,YC("caseAssist"),xi);var $l=(e,t)=>{let r=t.recommendation?.recommendations.findIndex(({uniqueId:n})=>e.uniqueId===n)||0;return XC(e,r,t)};function XC(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:eE(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:tE(e),queryPipeline:r.pipeline||Xn()}}var ls=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||""}),bg={urihash:new H,sourcetype:new H,permanentid:new H},Ag={uniqueId:X,raw:new ee({values:bg}),title:X,uri:X,clickUri:X,rankingModifier:new H({required:!1,emptyAllowed:!0})};function JC(e){return Object.assign({},...Object.keys(bg).map(t=>({[t]:e[t]})))}function ZC(e){return Object.assign({},...Object.keys(Ag).map(t=>({[t]:e[t]})),{raw:JC(e.raw)})}function eE(e){let t=e.raw.author;return ie(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function tE(e){let t=e.raw.source;return ie(t)?"unknown":t}var Gl=e=>new lt(Ag).validate(ZC(e));function rE(_x40,_x41,_x42){return _rE.apply(this,arguments)}function _rE(){_rE=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _rE.apply(this,arguments)}m();d();p();f();var wg=()=>ct("analytics/recommendation/update",e=>e.makeRecommendationInterfaceLoad(),e=>new Ai(e)),xg=()=>({actionCause:"recommendationInterfaceLoad"}),fs=e=>ct({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(Gl(e),t.makeRecommendationOpen($l(e,r),ls(e))),__legacy__provider:t=>new Ai(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=$l(e,t),n=ls(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});var co=P("recommendation/set",e=>q(e,{id:X})),Sr=Ee("recommendation/get",/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=Date.now(),a=yield nE(o),s=yield n.recommendations(a),c=Date.now()-i;return dt(s)?r(s.error):{recommendations:s.success.results,analyticsAction:wg(),duration:c,searchUid:s.success.searchUid,splitTestRun:s.success.splitTestRun,pipeline:s.success.pipeline}});return function(_x43,_x44){return _ref22.apply(this,arguments)}}()),nE=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??dr(e.configuration.organizationId,e.configuration.environment),recommendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?wt.getInstance().getHistory():[],...(e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.context&&{context:e.context.contextValues}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.configuration.analytics.enabled&&(yield oE(e,xg()))),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}),...(e.pagination&&{numberOfResults:e.pagination.numberOfResults})}});return function nE(_x45){return _ref23.apply(this,arguments)}}(),oE=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=e.configuration.analytics.analyticsMode==="legacy"?void 0:{actionCause:t.actionCause,type:t.actionCause};return yield us(e.configuration.analytics,r)});return function oE(_x46,_x47){return _ref24.apply(this,arguments)}}();var uo=Me(so(),e=>{e.addCase(co,(t,r)=>{t.id=r.payload.id}).addCase(Sr.rejected,(t,r)=>{t.error=r.payload?r.payload:null,t.isLoading=!1}).addCase(Sr.fulfilled,(t,r)=>{t.error=null,t.recommendations=r.payload.recommendations.map(n=>({...n,searchUid:r.payload.searchUid})),t.duration=r.payload.duration,t.isLoading=!1,t.searchUid=r.payload.searchUid,t.splitTestRun=r.payload.splitTestRun,t.pipeline=r.payload.pipeline}).addCase(Sr.pending,t=>{t.isLoading=!0}).addCase(La,(t,r)=>{t.error=r.payload,t.isLoading=!1})});m();d();p();f();var lo=P("searchHub/set",e=>q(e,new H({required:!0,emptyAllowed:!0})));m();d();p();f();var fo=Me(ao(),e=>{e.addCase(lo,(t,r)=>r.payload).addCase(mt.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Lt,(t,r)=>r.payload.searchHub||t)});m();d();p();f();m();d();p();f();m();d();p();f();function Cg(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var Eg=qt;function qg(e,t){if(e===t||!(Eg(e)&&Eg(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=qg(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function po(e){let t=0;for(let r in e)t++;return t}var Rg=e=>[].concat(...e);function iE(e){return new RegExp("(^|:)//").test(e)}function aE(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function gs(e){return e!=null}function sE(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var cE=e=>e.replace(/\/$/,""),uE=e=>e.replace(/^\//,"");function lE(e,t){if(!e)return t;if(!t)return e;if(iE(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=cE(e),t=uE(t),`${e}${r}${t}`}function dE(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var Ig=(...e)=>A(...e),fE=e=>e.status>=200&&e.status<=299,pE=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function Tg(e){if(!qt(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}function jg({baseUrl:e,prepareHeaders:t=v=>v,fetchFn:r=Ig,paramsSerializer:n,isJsonContentType:o=pE,jsonContentType:i="application/json",jsonReplacer:a,timeout:s,responseHandler:c,validateStatus:u,...h}={}){return typeof A>"u"&&r===Ig&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(S,g,y){let{getState:C,extra:R,endpoint:x,forced:I,type:T}=g,_,{url:j,headers:N=new w(h.headers),params:k=void 0,responseHandler:O=c??"json",validateStatus:D=u??fE,timeout:V=s,...z}=typeof S=="string"?{url:S}:S,G,B=g.signal;V&&(G=new l.AbortController,g.signal.addEventListener("abort",G.abort),B=G.signal);let U={...h,signal:B,...z};N=new w(Tg(N)),U.headers=(yield t(N,{getState:C,arg:S,extra:R,endpoint:x,forced:I,type:T,extraOptions:y}))||N;let Q=le=>typeof le=="object"&&(qt(le)||Array.isArray(le)||typeof le.toJSON=="function");if(!U.headers.has("content-type")&&Q(U.body)&&U.headers.set("content-type",i),Q(U.body)&&o(U.headers)&&(U.body=JSON.stringify(U.body,a)),k){let le=~j.indexOf("?")?"&":"?",he=n?n(k):new URLSearchParams(Tg(k));j+=le+he}j=lE(e,j);let $=new Request(j,U);_={request:new Request(j,U)};let Y,ne=!1,fe=G&&setTimeout(()=>{ne=!0,G.abort()},V);try{Y=yield r($)}catch(le){return{error:{status:ne?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(le)},meta:_}}finally{fe&&clearTimeout(fe),G?.signal.removeEventListener("abort",G.abort)}let be=Y.clone();_.response=be;let de,pe="";try{let le;if(yield Promise.all([v(Y,O).then(he=>de=he,he=>le=he),be.text().then(he=>pe=he,()=>{})]),le)throw le}catch(le){return{error:{status:"PARSING_ERROR",originalStatus:Y.status,data:pe,error:String(le)},meta:_}}return D(Y,de)?{data:de,meta:_}:{error:{status:Y.status,data:de},meta:_}});return function(_x48,_x49,_x50){return _ref25.apply(this,arguments)}}());function v(_x51,_x52){return _v2.apply(this,arguments)}function _v2(){_v2=_asyncToGenerator(function*(S,g){if(typeof g=="function")return g(S);if(g==="content-type"&&(g=o(S.headers)?"json":"text"),g==="json"){let y=yield S.text();return y.length?JSON.parse(y):null}return S.text()});return _v2.apply(this,arguments)}}var mo=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function mE(){return _mE.apply(this,arguments)}function _mE(){_mE=_asyncToGenerator(function*(e=0,t=5){let r=Math.min(e,t),n=~~((Math.random()+.4)*(300<<r));yield new Promise(o=>setTimeout(i=>o(i),n))});return _mE.apply(this,arguments)}function gE(e,t){throw Object.assign(new mo({error:e,meta:t}),{throwImmediately:!0})}var _g={},hE=(e,t)=>(/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(r,n,o){let i=[5,(t||_g).maxRetries,(o||_g).maxRetries].filter(h=>h!==void 0),[a]=i.slice(-1),c={maxRetries:a,backoff:mE,retryCondition:(h,v,{attempt:S})=>S<=a,...t,...o},u=0;for(;;)try{let h=yield e(r,n,o);if(h.error)throw new mo(h);return h}catch(h){if(u++,h.throwImmediately){if(h instanceof mo)return h.value;throw h}if(h instanceof mo&&!c.retryCondition(h.value.error,r,{attempt:u,baseQueryApi:n,extraOptions:o}))return h.value;yield c.backoff(u,c.maxRetries)}});return function(_x53,_x54,_x55){return _ref26.apply(this,arguments)}}()),Lg=Object.assign(hE,{fail:gE}),Kl=P("__rtkq/focused"),Vg=P("__rtkq/unfocused"),Yl=P("__rtkq/online"),Ug=P("__rtkq/offline");function Xl(e){return e.type==="query"}function yE(e){return e.type==="mutation"}function Jl(e){return e.type==="infinitequery"}function Zl(e,t,r,n,o,i){return vE(e)?e(t,r,n,o).filter(gs).map(Hl).map(i):Array.isArray(e)?e.map(Hl).map(i):[]}function vE(e){return typeof e=="function"}function Hl(e){return typeof e=="string"?{type:e}:e}function SE(e,t){return e.catch(t)}var Ei=Symbol("forceQueryFn"),zl=e=>typeof e[Ei]=="function";function bE({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i}){let a=new Map,s=new Map,{unsubscribeQueryResult:c,removeMutationResult:u,updateSubscriptionOptions:h}=o.internalActions;return{buildInitiateQuery:x,buildInitiateInfiniteQuery:I,buildInitiateMutation:T,getRunningQueryThunk:v,getRunningMutationThunk:S,getRunningQueriesThunk:g,getRunningMutationsThunk:y};function v(_,j){return N=>{let k=i.endpointDefinitions[_],O=e({queryArgs:j,endpointDefinition:k,endpointName:_});return a.get(N)?.[O]}}function S(_,j){return N=>s.get(N)?.[j]}function g(){return _=>Object.values(a.get(_)||{}).filter(gs)}function y(){return _=>Object.values(s.get(_)||{}).filter(gs)}function C(_){}function R(_,j){let N=(k,{subscribe:O=!0,forceRefetch:D,subscriptionOptions:V,[Ei]:z,...G}={})=>(B,U)=>{let Q=e({queryArgs:k,endpointDefinition:j,endpointName:_}),$,K={...G,type:"query",subscribe:O,forceRefetch:D,subscriptionOptions:V,endpointName:_,originalArgs:k,queryCacheKey:Q,[Ei]:z};if(Xl(j))$=t(K);else{let{direction:Ce,initialPageParam:De}=G;$=r({...K,direction:Ce,initialPageParam:De})}let Y=o.endpoints[_].select(k),ne=B($),fe=Y(U());let{requestId:be,abort:de}=ne,pe=fe.requestId!==be,le=a.get(B)?.[Q],he=()=>Y(U()),Le=Object.assign(z?ne.then(he):pe&&!le?Promise.resolve(fe):Promise.all([le,ne]).then(he),{arg:k,requestId:be,subscriptionOptions:V,queryCacheKey:Q,abort:de,unwrap(){return _asyncToGenerator(function*(){let Ce=yield Le;if(Ce.isError)throw Ce.error;return Ce.data})()},refetch:()=>B(N(k,{subscribe:!1,forceRefetch:!0})),unsubscribe(){O&&B(c({queryCacheKey:Q,requestId:be}))},updateSubscriptionOptions(Ce){Le.subscriptionOptions=Ce,B(h({endpointName:_,requestId:be,queryCacheKey:Q,options:Ce}))}});if(!le&&!pe&&!z){let Ce=dE(a,B,{});Ce[Q]=Le,Le.then(()=>{delete Ce[Q],po(Ce)||a.delete(B)})}return Le};return N}function x(_,j){return R(_,j)}function I(_,j){return R(_,j)}function T(_){return(j,{track:N=!0,fixedCacheKey:k}={})=>(O,D)=>{let V=n({type:"mutation",endpointName:_,originalArgs:j,track:N,fixedCacheKey:k}),z=O(V);let{requestId:G,abort:B,unwrap:U}=z,Q=SE(z.unwrap().then(ne=>({data:ne})),ne=>({error:ne})),$=()=>{O(u({requestId:G,fixedCacheKey:k}))},K=Object.assign(Q,{arg:z.arg,requestId:G,abort:B,unwrap:U,reset:$}),Y=s.get(O)||{};return s.set(O,Y),Y[G]=K,K.then(()=>{delete Y[G],po(Y)||s.delete(O)}),k&&(Y[k]=K,K.then(()=>{Y[k]===K&&(delete Y[k],po(Y)||s.delete(O))})),K}}}function AE(e){return e}var ps=(e={})=>({...e,[di]:!0});function wE({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a}){let s=(O,D,V,z)=>(G,B)=>{let U=r[O],Q=n({queryArgs:D,endpointDefinition:U,endpointName:O});if(G(o.internalActions.queryResultPatched({queryCacheKey:Q,patches:V})),!z)return;let $=o.endpoints[O].select(D)(B()),K=Zl(U.providesTags,$.data,void 0,D,{},i);G(o.internalActions.updateProvidedBy({queryCacheKey:Q,providedTags:K}))};function c(O,D,V=0){let z=[D,...O];return V&&z.length>V?z.slice(0,-1):z}function u(O,D,V=0){let z=[...O,D];return V&&z.length>V?z.slice(1):z}let h=(O,D,V,z=!0)=>(G,B)=>{let Q=o.endpoints[O].select(D)(B()),$={patches:[],inversePatches:[],undo:()=>G(o.util.patchQueryData(O,D,$.inversePatches,z))};if(Q.status==="uninitialized")return $;let K;if("data"in Q)if(pt(Q.data)){let[Y,ne,fe]=wa(Q.data,V);$.patches.push(...ne),$.inversePatches.push(...fe),K=Y}else K=V(Q.data),$.patches.push({op:"replace",path:[],value:K}),$.inversePatches.push({op:"replace",path:[],value:Q.data});return $.patches.length===0||G(o.util.patchQueryData(O,D,$.patches,z)),$},v=(O,D,V)=>z=>z(o.endpoints[O].initiate(D,{subscribe:!1,forceRefetch:!0,[Ei]:()=>({data:V})})),S=(O,D)=>O.query&&O[D]?O[D]:AE,g=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(O,{signal:D,abort:V,rejectWithValue:z,fulfillWithValue:G,dispatch:B,getState:U,extra:Q}){let $=r[O.endpointName];try{let K=S($,"transformResponse"),Y={signal:D,abort:V,dispatch:B,getState:U,extra:Q,endpoint:O.endpointName,type:O.type,forced:O.type==="query"?y(O,U()):void 0,queryCacheKey:O.type==="query"?O.queryCacheKey:void 0},ne=O.type==="query"?O[Ei]:void 0,fe,be=/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(pe,le,he,Le){if(le==null&&pe.pages.length)return Promise.resolve({data:pe});let Ce={queryArg:O.originalArgs,pageParam:le},De=yield de(Ce),Be=Le?c:u;return{data:{pages:Be(pe.pages,De.data,he),pageParams:Be(pe.pageParams,le,he)}}});return function be(_x58,_x59,_x60,_x61){return _ref28.apply(this,arguments)}}();function de(_x62){return _de.apply(this,arguments)}function _de(){_de=_asyncToGenerator(function*(pe){let le,{extraOptions:he}=$;if(ne?le=ne():$.query?le=yield t($.query(pe),Y,he):le=yield $.queryFn(pe,Y,he,Ce=>t(Ce,Y,he)),typeof process<"u",le.error)throw new mo(le.error,le.meta);let Le=yield K(le.data,le.meta,pe);return{...le,data:Le}});return _de.apply(this,arguments)}if(O.type==="query"&&"infiniteQueryOptions"in $){let{infiniteQueryOptions:pe}=$,{maxPages:le=1/0}=pe,he,Le={pages:[],pageParams:[]},Ce=a.selectQueryEntry(U(),O.queryCacheKey)?.data,Be=y(O,U())&&!O.direction||!Ce?Le:Ce;if("direction"in O&&O.direction&&Be.pages.length){let ut=O.direction==="backward",lr=(ut?Bg:Wl)(pe,Be);he=yield be(Be,lr,le,ut)}else{let{initialPageParam:ut=pe.initialPageParam}=O,bt=Ce?.pageParams??[],lr=bt[0]??ut,_n=bt.length;he=yield be(Be,lr,le),ne&&(he={data:he.data.pages[0]});for(let kn=1;kn<_n;kn++){let Ho=Wl(pe,he.data);he=yield be(he.data,Ho,le)}}fe=he}else fe=yield de(O.originalArgs);return G(fe.data,ps({fulfilledTimeStamp:Date.now(),baseQueryMeta:fe.meta}))}catch(K){let Y=K;if(Y instanceof mo){let ne=S($,"transformErrorResponse");try{return z(yield ne(Y.value,Y.meta,O.originalArgs),ps({baseQueryMeta:Y.meta}))}catch(fe){Y=fe}}throw typeof process<"u",console.error(Y),Y}});return function g(_x56,_x57){return _ref27.apply(this,arguments)}}();function y(O,D){let V=a.selectQueryEntry(D,O.queryCacheKey),z=a.selectConfig(D).refetchOnMountOrArgChange,G=V?.fulfilledTimeStamp,B=O.forceRefetch??(O.subscribe&&z);return B?B===!0||(Number(new Date)-Number(G))/1e3>=B:!1}let C=()=>Ee(`${e}/executeQuery`,g,{getPendingMeta({arg:D}){let V=r[D.endpointName];return ps({startedTimeStamp:Date.now(),...(Jl(V)?{direction:D.direction}:{})})},condition(D,{getState:V}){let z=V(),G=a.selectQueryEntry(z,D.queryCacheKey),B=G?.fulfilledTimeStamp,U=D.originalArgs,Q=G?.originalArgs,$=r[D.endpointName],K=D.direction;return zl(D)?!0:G?.status==="pending"?!1:y(D,z)||Xl($)&&$?.forceRefetch?.({currentArg:U,previousArg:Q,endpointState:G,state:z})?!0:!(B&&!K)},dispatchConditionRejection:!0}),R=C(),x=C(),I=Ee(`${e}/executeMutation`,g,{getPendingMeta(){return ps({startedTimeStamp:Date.now()})}}),T=O=>"force"in O,_=O=>"ifOlderThan"in O,j=(O,D,V)=>(z,G)=>{let B=T(V)&&V.force,U=_(V)&&V.ifOlderThan,Q=(K=!0)=>{let Y={forceRefetch:K,isPrefetch:!0};return o.endpoints[O].initiate(D,Y)},$=o.endpoints[O].select(D)(G());if(B)z(Q());else if(U){let K=$?.fulfilledTimeStamp;if(!K){z(Q());return}(Number(new Date)-Number(new Date(K)))/1e3>=U&&z(Q())}else z(Q(!1))};function N(O){return D=>D?.meta?.arg?.endpointName===O}function k(O,D){return{matchPending:Gn(Ta(O),N(D)),matchFulfilled:Gn(Jt(O),N(D)),matchRejected:Gn(Wr(O),N(D))}}return{queryThunk:R,mutationThunk:I,infiniteQueryThunk:x,prefetch:j,updateQueryData:h,upsertQueryData:v,patchQueryData:s,buildMatchThunkActions:k}}function Wl(e,{pages:t,pageParams:r}){let n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function Bg(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}function $g(e,t,r,n){return Zl(r[e.meta.arg.endpointName][t],Jt(e)?e.payload:void 0,pi(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function ms(e,t,r){let n=e[t];n&&r(n)}function Ri(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function kg(e,t,r){let n=e[Ri(t)];n&&r(n)}var Ci={};function xE({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:s},assertTagType:c,config:u}){let h=P(`${e}/resetApiState`);function v(N,k,O,D){var V;N[V=k.queryCacheKey]??(N[V]={status:"uninitialized",endpointName:k.endpointName}),ms(N,k.queryCacheKey,z=>{z.status="pending",z.requestId=O&&z.requestId?z.requestId:D.requestId,k.originalArgs!==void 0&&(z.originalArgs=k.originalArgs),z.startedTimeStamp=D.startedTimeStamp;let G=o[D.arg.endpointName];Jl(G)&&"direction"in k&&(z.direction=k.direction)})}function S(N,k,O,D){ms(N,k.arg.queryCacheKey,V=>{if(V.requestId!==k.requestId&&!D)return;let{merge:z}=o[k.arg.endpointName];if(V.status="fulfilled",z){if(V.data!==void 0){let{fulfilledTimeStamp:G,arg:B,baseQueryMeta:U,requestId:Q}=k,$=Xt(V.data,K=>z(K,O,{arg:B.originalArgs,baseQueryMeta:U,fulfilledTimeStamp:G,requestId:Q}));V.data=$}else V.data=O;}else V.data=o[k.arg.endpointName].structuralSharing??!0?qg(vt(V.data)?Yu(V.data):V.data,O):O;delete V.error,V.fulfilledTimeStamp=k.fulfilledTimeStamp})}let g=Kr({name:`${e}/queries`,initialState:Ci,reducers:{removeQueryResult:{reducer(N,{payload:{queryCacheKey:k}}){delete N[k]},prepare:Qn()},cacheEntriesUpserted:{reducer(N,k){for(let O of k.payload){let{queryDescription:D,value:V}=O;v(N,D,!0,{arg:D,requestId:k.meta.requestId,startedTimeStamp:k.meta.timestamp}),S(N,{arg:D,requestId:k.meta.requestId,fulfilledTimeStamp:k.meta.timestamp,baseQueryMeta:{}},V,!0)}},prepare:N=>({payload:N.map(D=>{let{endpointName:V,arg:z,value:G}=D,B=o[V];return{queryDescription:{type:"query",endpointName:V,originalArgs:D.arg,queryCacheKey:n({queryArgs:z,endpointDefinition:B,endpointName:V})},value:G}}),meta:{[di]:!0,requestId:mi(),timestamp:Date.now()}})},queryResultPatched:{reducer(N,{payload:{queryCacheKey:k,patches:O}}){ms(N,k,D=>{D.data=Ju(D.data,O.concat())})},prepare:Qn()}},extraReducers(N){N.addCase(t.pending,(k,{meta:O,meta:{arg:D}})=>{let V=zl(D);v(k,D,V,O)}).addCase(t.fulfilled,(k,{meta:O,payload:D})=>{let V=zl(O.arg);S(k,O,D,V)}).addCase(t.rejected,(k,{meta:{condition:O,arg:D,requestId:V},error:z,payload:G})=>{ms(k,D.queryCacheKey,B=>{if(!O){if(B.requestId!==V)return;B.status="rejected",B.error=G??z}})}).addMatcher(s,(k,O)=>{let{queries:D}=a(O);for(let[V,z]of Object.entries(D))(z?.status==="fulfilled"||z?.status==="rejected")&&(k[V]=z)})}}),y=Kr({name:`${e}/mutations`,initialState:Ci,reducers:{removeMutationResult:{reducer(N,{payload:k}){let O=Ri(k);O in N&&delete N[O]},prepare:Qn()}},extraReducers(N){N.addCase(r.pending,(k,{meta:O,meta:{requestId:D,arg:V,startedTimeStamp:z}})=>{V.track&&(k[Ri(O)]={requestId:D,status:"pending",endpointName:V.endpointName,startedTimeStamp:z})}).addCase(r.fulfilled,(k,{payload:O,meta:D})=>{D.arg.track&&kg(k,D,V=>{V.requestId===D.requestId&&(V.status="fulfilled",V.data=O,V.fulfilledTimeStamp=D.fulfilledTimeStamp)})}).addCase(r.rejected,(k,{payload:O,error:D,meta:V})=>{V.arg.track&&kg(k,V,z=>{z.requestId===V.requestId&&(z.status="rejected",z.error=O??D)})}).addMatcher(s,(k,O)=>{let{mutations:D}=a(O);for(let[V,z]of Object.entries(D))(z?.status==="fulfilled"||z?.status==="rejected")&&V!==z?.requestId&&(k[V]=z)})}}),C=Kr({name:`${e}/invalidation`,initialState:Ci,reducers:{updateProvidedBy:{reducer(N,k){var V,z;let{queryCacheKey:O,providedTags:D}=k.payload;for(let G of Object.values(N))for(let B of Object.values(G)){let U=B.indexOf(O);U!==-1&&B.splice(U,1)}for(let{type:G,id:B}of D){let U=(V=N[G]??(N[G]={}))[z=B||"__internal_without_id"]??(V[z]=[]);U.includes(O)||U.push(O)}},prepare:Qn()}},extraReducers(N){N.addCase(g.actions.removeQueryResult,(k,{payload:{queryCacheKey:O}})=>{for(let D of Object.values(k))for(let V of Object.values(D)){let z=V.indexOf(O);z!==-1&&V.splice(z,1)}}).addMatcher(s,(k,O)=>{var V,z;let{provided:D}=a(O);for(let[G,B]of Object.entries(D))for(let[U,Q]of Object.entries(B)){let $=(V=k[G]??(k[G]={}))[z=U||"__internal_without_id"]??(V[z]=[]);for(let K of Q)$.includes(K)||$.push(K)}}).addMatcher(jt(Jt(t),pi(t)),(k,O)=>{let D=$g(O,"providesTags",o,c),{queryCacheKey:V}=O.meta.arg;C.caseReducers.updateProvidedBy(k,C.actions.updateProvidedBy({queryCacheKey:V,providedTags:D}))})}}),R=Kr({name:`${e}/subscriptions`,initialState:Ci,reducers:{updateSubscriptionOptions(N,k){},unsubscribeQueryResult(N,k){},internal_getRTKQSubscriptions(){}}}),x=Kr({name:`${e}/internalSubscriptions`,initialState:Ci,reducers:{subscriptionsUpdated:{reducer(N,k){return Ju(N,k.payload)},prepare:Qn()}}}),I=Kr({name:`${e}/config`,initialState:{online:sE(),focused:aE(),middlewareRegistered:!1,...u},reducers:{middlewareRegistered(N,{payload:k}){N.middlewareRegistered=N.middlewareRegistered==="conflict"||i!==k?"conflict":!0}},extraReducers:N=>{N.addCase(Yl,k=>{k.online=!0}).addCase(Ug,k=>{k.online=!1}).addCase(Kl,k=>{k.focused=!0}).addCase(Vg,k=>{k.focused=!1}).addMatcher(s,k=>({...k}))}}),T=qn({queries:g.reducer,mutations:y.reducer,provided:C.reducer,subscriptions:x.reducer,config:I.reducer}),_=(N,k)=>T(h.match(k)?void 0:N,k),j={...I.actions,...g.actions,...R.actions,...x.actions,...y.actions,...C.actions,resetApiState:h};return{reducer:_,actions:j}}var Ql=Symbol.for("RTKQ/skipToken"),Gg={status:"uninitialized"},Og=Xt(Gg,()=>{}),Pg=Xt(Gg,()=>{});function CE({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=T=>Og,o=T=>Pg;return{buildQuerySelector:S,buildInfiniteQuerySelector:g,buildMutationSelector:y,selectInvalidatedBy:C,selectCachedArgsForQuery:R,selectApiState:a,selectQueries:s,selectMutations:u,selectQueryEntry:c,selectConfig:h};function i(T){return{...T,...Cg(T.status)}}function a(T){return T[t]}function s(T){return a(T)?.queries}function c(T,_){return s(T)?.[_]}function u(T){return a(T)?.mutations}function h(T){return a(T)?.config}function v(T,_,j){return N=>{if(N===Ql)return r(n,j);let k=e({queryArgs:N,endpointDefinition:_,endpointName:T});return r(D=>c(D,k)??Og,j)}}function S(T,_){return v(T,_,i)}function g(T,_){let{infiniteQueryOptions:j}=_;function N(k){let O={...k,...Cg(k.status)},{isLoading:D,isError:V,direction:z}=O,G=z==="forward",B=z==="backward";return{...O,hasNextPage:x(j,O.data),hasPreviousPage:I(j,O.data),isFetchingNextPage:D&&G,isFetchingPreviousPage:D&&B,isFetchNextPageError:V&&G,isFetchPreviousPageError:V&&B}}return v(T,_,N)}function y(){return T=>{let _;return typeof T=="object"?_=Ri(T)??Ql:_=T,r(_===Ql?o:k=>a(k)?.mutations?.[_]??Pg,i)}}function C(T,_){let j=T[t],N=new Set;for(let k of _.filter(gs).map(Hl)){let O=j.provided[k.type];if(!O)continue;let D=(k.id!==void 0?O[k.id]:Rg(Object.values(O)))??[];for(let V of D)N.add(V)}return Rg(Array.from(N.values()).map(k=>{let O=j.queries[k];return O?[{queryCacheKey:k,endpointName:O.endpointName,originalArgs:O.originalArgs}]:[]}))}function R(T,_){return Object.values(s(T)).filter(j=>j?.endpointName===_&&j.status!=="uninitialized").map(j=>j.originalArgs)}function x(T,_){return _?Wl(T,_)!=null:!1}function I(T,_){return!_||!T.getPreviousPageParam?!1:Bg(T,_)!=null}}var Ng=WeakMap?new WeakMap:void 0,Fg=({endpointName:e,queryArgs:t})=>{let r="",n=Ng?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=qt(a)?Object.keys(a).sort().reduce((s,c)=>(s[c]=a[c],s),{}):a,a));qt(t)&&Ng?.set(t,o),r=o}return`${e}(${r})`};function EE(...e){return function(r){let n=Bn(u=>r.extractRehydrationInfo?.(u,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(u){let h=Fg;if("serializeQueryArgs"in u.endpointDefinition){let v=u.endpointDefinition.serializeQueryArgs;h=S=>{let g=v(S);return typeof g=="string"?g:Fg({...S,queryArgs:g})}}else r.serializeQueryArgs&&(h=r.serializeQueryArgs);return h(u)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(u){u()},apiUid:mi(),extractRehydrationInfo:n,hasRehydrationInfo:Bn(u=>n(u)!=null)},a={injectEndpoints:c,enhanceEndpoints({addTagTypes:u,endpoints:h}){if(u)for(let v of u)o.tagTypes.includes(v)||o.tagTypes.push(v);if(h)for(let[v,S]of Object.entries(h))typeof S=="function"?S(i.endpointDefinitions[v]):Object.assign(i.endpointDefinitions[v]||{},S);return a}},s=e.map(u=>u.init(a,o,i));function c(u){let h=u.endpoints({query:v=>({...v,type:"query"}),mutation:v=>({...v,type:"mutation"}),infiniteQuery:v=>({...v,type:"infinitequery"})});for(let[v,S]of Object.entries(h)){if(u.overrideExisting!==!0&&v in i.endpointDefinitions){if(u.overrideExisting==="throw")throw new Error(st(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[v]=S;for(let g of s)g.injectEndpoint(v,S)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function nr(e,...t){return Object.assign(e,...t)}var RE=({api:e,queryThunk:t,internalState:r})=>{let n=`${e.reducerPath}/subscriptions`,o=null,i=null,{updateSubscriptionOptions:a,unsubscribeQueryResult:s}=e.internalActions,c=(g,y)=>{var R,x;if(a.match(y)){let{queryCacheKey:I,requestId:T,options:_}=y.payload;return g?.[I]?.[T]&&(g[I][T]=_),!0}if(s.match(y)){let{queryCacheKey:I,requestId:T}=y.payload;return g[I]&&delete g[I][T],!0}if(e.internalActions.removeQueryResult.match(y))return delete g[y.payload.queryCacheKey],!0;if(t.pending.match(y)){let{meta:{arg:I,requestId:T}}=y,_=g[R=I.queryCacheKey]??(g[R]={});return _[`${T}_running`]={},I.subscribe&&(_[T]=I.subscriptionOptions??_[T]??{}),!0}let C=!1;if(t.fulfilled.match(y)||t.rejected.match(y)){let I=g[y.meta.arg.queryCacheKey]||{},T=`${y.meta.requestId}_running`;C||(C=!!I[T]),delete I[T]}if(t.rejected.match(y)){let{meta:{condition:I,arg:T,requestId:_}}=y;if(I&&T.subscribe){let j=g[x=T.queryCacheKey]??(g[x]={});j[_]=T.subscriptionOptions??j[_]??{},C=!0}}return C},u=()=>r.currentSubscriptions,S={getSubscriptions:u,getSubscriptionCount:g=>{let C=u()[g]??{};return po(C)},isRequestSubscribed:(g,y)=>!!u()?.[g]?.[y]};return(g,y)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(g))return o=r.currentSubscriptions={},i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(g))return[!1,S];let C=c(r.currentSubscriptions,g),R=!0;if(C){i||(i=setTimeout(()=>{let T=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,_]=wa(o,()=>T);y.next(e.internalActions.subscriptionsUpdated(_)),o=T,i=null},500));let x=typeof g.type=="string"&&!!g.type.startsWith(n),I=t.rejected.match(g)&&g.meta.condition&&!!g.meta.arg.subscribe;R=!x&&!I}return[R,!1]}};function IE(e){for(let t in e)return!1;return!0}var TE=2147483647/1e3-1,_E=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a}})=>{let{removeQueryResult:s,unsubscribeQueryResult:c,cacheEntriesUpserted:u}=t.internalActions,h=jt(c.match,r.fulfilled,r.rejected,u.match);function v(R){let x=o.currentSubscriptions[R];return!!x&&!IE(x)}let S={},g=(R,x,I)=>{let T=x.getState(),_=a(T);if(h(R)){let j;if(u.match(R))j=R.payload.map(N=>N.queryDescription.queryCacheKey);else{let{queryCacheKey:N}=c.match(R)?R.payload:R.meta.arg;j=[N]}y(j,x,_)}if(t.util.resetApiState.match(R))for(let[j,N]of Object.entries(S))N&&clearTimeout(N),delete S[j];if(n.hasRehydrationInfo(R)){let{queries:j}=n.extractRehydrationInfo(R);y(Object.keys(j),x,_)}};function y(R,x,I){let T=x.getState();for(let _ of R){let j=i(T,_);C(_,j?.endpointName,x,I)}}function C(R,x,I,T){let j=n.endpointDefinitions[x]?.keepUnusedDataFor??T.keepUnusedDataFor;if(j===1/0)return;let N=Math.max(0,Math.min(j,TE));if(!v(R)){let k=S[R];k&&clearTimeout(k),S[R]=setTimeout(()=>{v(R)||I.dispatch(s({queryCacheKey:R})),delete S[R]},N*1e3)}}return g},Dg=new Error("Promise never resolved before cacheEntryRemoved."),kE=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:s}})=>{let c=_a(n),u=_a(o),h=Jt(n,o),v={};function S(x,I,T){let _=v[x];_?.valueResolved&&(_.valueResolved({data:I,meta:T}),delete _.valueResolved)}function g(x){let I=v[x];I&&(delete v[x],I.cacheEntryRemoved())}let y=(x,I,T)=>{let _=C(x);function j(N,k,O,D){let V=a(T,k),z=a(I.getState(),k);!V&&z&&R(N,D,k,I,O)}if(n.pending.match(x))j(x.meta.arg.endpointName,_,x.meta.requestId,x.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(x))for(let{queryDescription:N,value:k}of x.payload){let{endpointName:O,originalArgs:D,queryCacheKey:V}=N;j(O,V,x.meta.requestId,D),S(V,k,{})}else if(o.pending.match(x))I.getState()[t].mutations[_]&&R(x.meta.arg.endpointName,x.meta.arg.originalArgs,_,I,x.meta.requestId);else if(h(x))S(_,x.payload,x.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(x)||e.internalActions.removeMutationResult.match(x))g(_);else if(e.util.resetApiState.match(x))for(let N of Object.keys(v))g(N)};function C(x){return c(x)?x.meta.arg.queryCacheKey:u(x)?x.meta.arg.fixedCacheKey??x.meta.requestId:e.internalActions.removeQueryResult.match(x)?x.payload.queryCacheKey:e.internalActions.removeMutationResult.match(x)?Ri(x.payload):""}function R(x,I,T,_,j){let N=r.endpointDefinitions[x],k=N?.onCacheEntryAdded;if(!k)return;let O={},D=new Promise(Q=>{O.cacheEntryRemoved=Q}),V=Promise.race([new Promise(Q=>{O.valueResolved=Q}),D.then(()=>{throw Dg})]);V.catch(()=>{}),v[T]=O;let z=e.endpoints[x].select(N.type==="query"?I:T),G=_.dispatch((Q,$,K)=>K),B={..._,getCacheEntry:()=>z(_.getState()),requestId:j,extra:G,updateCachedData:N.type==="query"?Q=>_.dispatch(e.util.updateQueryData(x,I,Q)):void 0,cacheDataLoaded:V,cacheEntryRemoved:D},U=k(I,B);Promise.resolve(U).catch(Q=>{if(Q!==Dg)throw Q})}return y},OE=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},PE=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:s,internalState:c})=>{let{removeQueryResult:u}=i.internalActions,h=jt(Jt(n),pi(n)),v=jt(Jt(n,o),Wr(n,o)),S=[],g=(R,x)=>{h(R)?C($g(R,"invalidatesTags",r,a),x):v(R)?C([],x):i.util.invalidateTags.match(R)&&C(Zl(R.payload,void 0,void 0,void 0,void 0,a),x)};function y(R){let{queries:x,mutations:I}=R;for(let T of[x,I])for(let _ in T)if(T[_]?.status==="pending")return!0;return!1}function C(R,x){let I=x.getState(),T=I[e];if(S.push(...R),T.config.invalidationBehavior==="delayed"&&y(T))return;let _=S;if(S=[],_.length===0)return;let j=i.util.selectInvalidatedBy(I,_);t.batch(()=>{let N=Array.from(j.values());for(let{queryCacheKey:k}of N){let O=T.queries[k],D=c.currentSubscriptions[k]??{};O&&(po(D)===0?x.dispatch(u({queryCacheKey:k})):O.status!=="uninitialized"&&x.dispatch(s(O)))}})}return g},NE=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let i={},a=(g,y)=>{(r.internalActions.updateSubscriptionOptions.match(g)||r.internalActions.unsubscribeQueryResult.match(g))&&u(g.payload,y),(t.pending.match(g)||t.rejected.match(g)&&g.meta.condition)&&u(g.meta.arg,y),(t.fulfilled.match(g)||t.rejected.match(g)&&!g.meta.condition)&&c(g.meta.arg,y),r.util.resetApiState.match(g)&&v()};function s(g,y){let R=y.getState()[e].queries[g],x=o.currentSubscriptions[g];if(!(!R||R.status==="uninitialized"))return x}function c({queryCacheKey:g},y){let C=y.getState()[e],R=C.queries[g],x=o.currentSubscriptions[g];if(!R||R.status==="uninitialized")return;let{lowestPollingInterval:I,skipPollingIfUnfocused:T}=S(x);if(!Number.isFinite(I))return;let _=i[g];_?.timeout&&(clearTimeout(_.timeout),_.timeout=void 0);let j=Date.now()+I;i[g]={nextPollTimestamp:j,pollingInterval:I,timeout:setTimeout(()=>{(C.config.focused||!T)&&y.dispatch(n(R)),c({queryCacheKey:g},y)},I)}}function u({queryCacheKey:g},y){let R=y.getState()[e].queries[g],x=o.currentSubscriptions[g];if(!R||R.status==="uninitialized")return;let{lowestPollingInterval:I}=S(x);if(!Number.isFinite(I)){h(g);return}let T=i[g],_=Date.now()+I;(!T||_<T.nextPollTimestamp)&&c({queryCacheKey:g},y)}function h(g){let y=i[g];y?.timeout&&clearTimeout(y.timeout),delete i[g]}function v(){for(let g of Object.keys(i))h(g)}function S(g={}){let y=!1,C=Number.POSITIVE_INFINITY;for(let R in g)g[R].pollingInterval&&(C=Math.min(g[R].pollingInterval,C),y=g[R].skipPollingIfUnfocused||y);return{lowestPollingInterval:C,skipPollingIfUnfocused:y}}return a},FE=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=Ta(r,n),i=Wr(r,n),a=Jt(r,n),s={};return(u,h)=>{if(o(u)){let{requestId:v,arg:{endpointName:S,originalArgs:g}}=u.meta,y=t.endpointDefinitions[S],C=y?.onQueryStarted;if(C){let R={},x=new Promise((j,N)=>{R.resolve=j,R.reject=N});x.catch(()=>{}),s[v]=R;let I=e.endpoints[S].select(y.type==="query"?g:v),T=h.dispatch((j,N,k)=>k),_={...h,getCacheEntry:()=>I(h.getState()),requestId:v,extra:T,updateCachedData:y.type==="query"?j=>h.dispatch(e.util.updateQueryData(S,g,j)):void 0,queryFulfilled:x};C(g,_)}}else if(a(u)){let{requestId:v,baseQueryMeta:S}=u.meta;s[v]?.resolve({data:u.payload,meta:S}),delete s[v]}else if(i(u)){let{requestId:v,rejectedWithValue:S,baseQueryMeta:g}=u.meta;s[v]?.reject({error:u.payload??u.error,isUnhandledError:!S,meta:g}),delete s[v]}}},DE=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(c,u)=>{Kl.match(c)&&s(u,"refetchOnFocus"),Yl.match(c)&&s(u,"refetchOnReconnect")};function s(c,u){let h=c.getState()[e],v=h.queries,S=o.currentSubscriptions;t.batch(()=>{for(let g of Object.keys(S)){let y=v[g],C=S[g];if(!C||!y)continue;(Object.values(C).some(x=>x[u]===!0)||Object.values(C).every(x=>x[u]===void 0)&&h.config[u])&&(po(C)===0?c.dispatch(i({queryCacheKey:g})):y.status!=="uninitialized"&&c.dispatch(n(y)))}})}return a};function ME(e){let{reducerPath:t,queryThunk:r,api:n,context:o}=e,{apiUid:i}=o,a={invalidateTags:P(`${t}/invalidateTags`)},s=v=>v.type.startsWith(`${t}/`),c=[OE,_E,PE,NE,kE,FE];return{middleware:v=>{let S=!1,y={...e,internalState:{currentSubscriptions:{}},refetchQuery:h,isThisApiSliceAction:s},C=c.map(I=>I(y)),R=RE(y),x=DE(y);return I=>T=>{if(!Ln(T))return I(T);S||(S=!0,v.dispatch(n.internalActions.middlewareRegistered(i)));let _={...v,next:I},j=v.getState(),[N,k]=R(T,_,j),O;if(N?O=I(T):O=k,v.getState()[t]&&(x(T,_,j),s(T)||o.hasRehydrationInfo(T)))for(let D of C)D(T,_,j);return O}},actions:a};function h(v){return e.api.endpoints[v.endpointName].initiate(v.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Mg=Symbol(),qE=({createSelector:e=Ve}={})=>({name:Mg,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:s,refetchOnFocus:c,refetchOnReconnect:u,invalidationBehavior:h},v){Pp();let S=de=>(typeof process<"u",de);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:Yl,onOffline:Ug,onFocus:Kl,onFocusLost:Vg},util:{}});let g=CE({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:y,selectCachedArgsForQuery:C,buildQuerySelector:R,buildInfiniteQuerySelector:x,buildMutationSelector:I}=g;nr(t.util,{selectInvalidatedBy:y,selectCachedArgsForQuery:C});let{queryThunk:T,infiniteQueryThunk:_,mutationThunk:j,patchQueryData:N,updateQueryData:k,upsertQueryData:O,prefetch:D,buildMatchThunkActions:V}=wE({baseQuery:r,reducerPath:o,context:v,api:t,serializeQueryArgs:i,assertTagType:S,selectors:g}),{reducer:z,actions:G}=xE({context:v,queryThunk:T,infiniteQueryThunk:_,mutationThunk:j,serializeQueryArgs:i,reducerPath:o,assertTagType:S,config:{refetchOnFocus:c,refetchOnReconnect:u,refetchOnMountOrArgChange:s,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:h}});nr(t.util,{patchQueryData:N,updateQueryData:k,upsertQueryData:O,prefetch:D,resetApiState:G.resetApiState,upsertQueryEntries:G.cacheEntriesUpserted}),nr(t.internalActions,G);let{middleware:B,actions:U}=ME({reducerPath:o,context:v,queryThunk:T,mutationThunk:j,infiniteQueryThunk:_,api:t,assertTagType:S,selectors:g});nr(t.util,U),nr(t,{reducer:z,middleware:B});let{buildInitiateQuery:Q,buildInitiateInfiniteQuery:$,buildInitiateMutation:K,getRunningMutationThunk:Y,getRunningMutationsThunk:ne,getRunningQueriesThunk:fe,getRunningQueryThunk:be}=bE({queryThunk:T,mutationThunk:j,infiniteQueryThunk:_,api:t,serializeQueryArgs:i,context:v});return nr(t.util,{getRunningMutationThunk:Y,getRunningMutationsThunk:ne,getRunningQueryThunk:be,getRunningQueriesThunk:fe}),{name:Mg,injectEndpoint(de,pe){var Le;let he=(Le=t.endpoints)[de]??(Le[de]={});Xl(pe)&&nr(he,{name:de,select:R(de,pe),initiate:Q(de,pe)},V(T,de)),yE(pe)&&nr(he,{name:de,select:I(),initiate:K(de)},V(j,de)),Jl(pe)&&nr(he,{name:de,select:x(de,pe),initiate:$(de,pe)},V(T,de))}}}}),Qg=EE(qE());m();d();p();f();m();d();p();f();var Zr=e=>e.query,Hg=e=>e.query?.enableQuerySyntax;var P2=Ve(e=>Zr(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})),jE=Ve(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);m();d();p();f();m();d();p();f();var go=e=>ct({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(t,r)=>{let n=Jr(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:Jr(t)??"",answerGenerated:e??!1})}),ho=()=>ct({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:e=>({answerId:Jr(e)??"",responseId:e.search?.searchResponseId||e.search?.response.searchUid||""})});m();d();p();f();m();d();p();f();var zg=Ve(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});m();d();p();f();var Ii=(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:to(e)}});m();d();p();f();var Wg=e=>e.context;m();d();p();f();var ed=e=>e.pipeline;m();d();p();f();m();d();p();f();var Ti=_t(hs(),1),eh=_t(Kg(),1);m();d();p();f();var ys=_t(hs(),1),Xg=_t(Yg(),1);ys.default.extend(Xg.default);var Jg="YYYY/MM/DD@HH:mm:ss",LE="1401-01-01";function yo(e,t){let r=(0,ys.default)(e,t);return!r.isValid()&&!t?(0,ys.default)(e,Jg):r}function vs(e){return e.format(Jg)}function Zg(e,t){let r=yo(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}`)}sd(r)}function sd(e){if(e.isBefore(LE))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}Ti.default.extend(eh.default);var th=["past","now","next"],rh=["minute","hour","day","week","month","quarter","year"],VE=e=>{let t=e==="now";return{amount:new te({required:!t,min:1}),unit:new H({required:!t,constrainTo:rh}),period:new H({required:!0,constrainTo:th})}};function cd(e){if(typeof e=="string"&&!br(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?sh(e):e;new lt(VE(t.period)).validate(t);let r=oh(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);sd(r)}function nh(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function oh(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,Ti.default)().subtract(r,n);case"next":return(0,Ti.default)().add(r,n);case"now":return(0,Ti.default)()}}function _i(e){return vs(oh(sh(e)))}function ih(e){return e.toLocaleLowerCase().split("-")}function br(e){let[t,r,n]=ih(e);if(t==="now")return!0;if(!th.includes(t)||!rh.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function ah(e){return!!e&&typeof e=="object"&&"period"in e}function sh(e){let[t,r,n]=ih(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}m();d();p();f();function ch(e){return e.type==="dateRange"}function uh(e){return`start${e}`}function lh(e){return`end${e}`}var ud=()=>({dateFacetValueMap:{}});function UE(e,t,r){let n=e.start,o=e.end;return br(n)&&(n=_i(n),r.dateFacetValueMap[t][uh(n)]=e.start),br(o)&&(o=_i(o),r.dateFacetValueMap[t][lh(o)]=e.end),{...e,start:n,end:o}}function ld(e,t){if(ch(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>UE(o,r,t))}}return e}function Ar(e){let t=ud();return{request:{...e,facets:e.facets?.map(n=>ld(n,t))},mappings:t}}function BE(e,t,r){return{...e,start:r.dateFacetValueMap[t][uh(e.start)]||e.start,end:r.dateFacetValueMap[t][lh(e.end)]||e.end}}function $E(e,t){return e.facetId in t.dateFacetValueMap}function GE(e,t){return $E(e,t)?{...e,values:e.values.map(r=>BE(r,e.facetId,t))}:e}function Ss(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>GE(n,t))}}:e}m();d();p();f();m();d();p();f();m();d();p();f();function wr(e){return Object.values(e).map(t=>t.request)}function dd(e,t){let r={};e.forEach(i=>{r[i.facetId]=i});let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function dh(e){return wr(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var fd={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function QE(e){return wr(e).map(t=>{let r=fd[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function HE(e){return[...QE(e.facetSet??{}),...dh(e.numericFacetSet??{}),...dh(e.dateFacetSet??{}),...wr(e.categoryFacetSet??{})]}function zE(e){return HE(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function bs(e){return dd(zE(e),e.facetOrder??[])}m();d();p();f();m();d();p();f();var xr=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??dr(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 us(e.configuration.analytics,t))),...(e.excerptLength&&!ie(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function xr(_x63,_x64){return _ref29.apply(this,arguments)}}();m();d();p();f();var vo=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??dr(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&&Ii(e.configuration.analytics,t,r)),...(e.excerptLength&&!ie(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});m();d();p();f();var fh=Ve(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Cr=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t,r){let n=md(e),o=WE(e),i=KE(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield xr(e,r):vo(e,t,r);return Ar({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:pd(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Cr(_x65,_x66,_x67){return _ref30.apply(this,arguments)}}();function pd(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function WE(e){return dd(XE(e),e.facetOrder??[])}function KE(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(YE).filter(r=>r.currentValues.length>0):void 0}function YE(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function XE(e){return JE(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function JE(e){return[...ZE(e.facetSet??{}),...ph(e.numericFacetSet??{}),...ph(e.dateFacetSet??{}),...wr(e.categoryFacetSet??{})]}function ZE(e){return wr(e).map(t=>{let r=fd[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function ph(e){return wr(e).map(t=>{let r=t.currentValues,n=r.some(({state:i})=>i!=="idle"),o=r.some(i=>i.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function md(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=fh(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}m();d();p();f();m();d();p();f();var ki=(e,t)=>{let r=e;return ie(r[t])?ie(e.raw[t])?null:e.raw[t]:r[t]},eR=e=>t=>e.every(r=>!ie(ki(t,r))),tR=e=>t=>e.every(r=>ie(ki(t,r))),rR=(e,t)=>r=>{let n=mh(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},nR=(e,t)=>r=>{let n=mh(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},mh=(e,t)=>{let r=ki(t,e);return Xf(r)?r:[r]},gh={getResultProperty:ki,fieldsMustBeDefined:eR,fieldsMustNotBeDefined:tR,fieldMustMatch:rR,fieldMustNotMatch:nR};var gd=Ve(e=>e.search,e=>e?.searchAction?.actionCause||"");m();d();p();f();var hd=e=>e.searchHub;m();d();p();f();var yd=Ve(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),gG=Ve(e=>e,e=>{let t=yd(e);return t&&e?e[t].expression:""});m();d();p();f();var hh=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};m();d();p();f();var yh=e=>e.excerptLength?.length;m();d();p();f();var vh=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};m();d();p();f();var Sh=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};m();d();p();f();var bh=e=>e.sortCriteria;var Ah=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:We(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function Ah(_x68){return _ref31.apply(this,arguments)}}(),wh=(e,t)=>{let r=Zr(e)?.q,{aq:n,cq:o,dq:i,lq:a}=iR(e),s=Wg(e),c=Ii(e.configuration.analytics,t,{actionCause:gd(e)}),u=hd(e),h=ed(e),v=Pl(e)??[],S=Ch(e),g=yd(e.tabSet)||"default",y=kl(e),C=Ym(e),R=t.referrer||"",x=vh(e),I=bh(e),T=oR(e),_=yh(e),j=Sh(e),N=hh(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(i&&{dq:i}),...(a&&{lq:a}),...(e.query&&{enableQuerySyntax:Hg(e)}),...(s?.contextValues&&{context:s.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:v}},...(u?.length&&{searchHub:u}),...(h?.length&&{pipeline:h}),...(S.length&&{facets:S}),...(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:pd(e),firstResult:e.pagination.firstResult}),tab:g,locale:y,timezone:C,...(e.debug!==void 0&&{debug:e.debug}),referrer:R,...T,...(j??{}),...(_&&{excerptLength:_}),...(N&&{dictionaryFieldContext:N}),sortCriteria:I,...(x&&{facetOptions:x}),...c,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},xh=(e,t)=>{let r=Zr(e)?.q,n=Ch(e),o=Ii(e.configuration.analytics,t,{actionCause:gd(e)}),i=kl(e),a=hd(e),s=ed(e),c=Pl(e)??[];return{q:r||"",...(n.length&&{facets:n}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:c}},...(a?.length&&{searchHub:a}),...(s?.length&&{pipeline:s}),...o,locale:i}},Ch=e=>bs(e)?.map(t=>ld(t,ud())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),oR=e=>({actionsHistory:e.configuration.analytics.enabled?wt.getInstance().getHistory():[]}),iR=e=>{let t=zg(e),r=md(e);return{...t,...(r&&{cq:r})}};m();d();p();f();var As=["searching","thinking","answering"];function ws(e){return e.toLowerCase()}m();d();p();f();var Eh=["text/plain","text/markdown"];var So=new H({required:!0}),Rh=new H,bo=new ue({required:!0}),vd={id:So,title:So,uri:So,permanentid:So,clickUri:Rh},xs=new H({required:!0,constrainTo:Eh}),Ih=new H({required:!0,constrainTo:As}),Th=e=>({...e,name:ws(e.name)}),DQ=P("generatedAnswer/setIsVisible",e=>q(e,bo)),Cs=P("generatedAnswer/setAnswerId",e=>q(e,X)),MQ=P("generatedAnswer/setAnswerGenerationMode",e=>q(e,new H({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),qQ=P("generatedAnswer/setIsEnabled",e=>q(e,bo)),Pi=P("generatedAnswer/updateMessage",e=>q(e,{textDelta:So})),Ni=P("generatedAnswer/updateCitations",e=>q(e,{citations:new ge({required:!0,each:new ee({values:vd})})})),Fi=P("generatedAnswer/updateError",e=>q(e,{message:Rh,code:new te({min:0})})),Es=P("generatedAnswer/resetAnswer"),jQ=P("generatedAnswer/like"),LQ=P("generatedAnswer/dislike"),VQ=P("generatedAnswer/feedbackModal/open"),UQ=P("generatedAnswer/expand"),BQ=P("generatedAnswer/collapse"),$Q=P("generatedAnswer/setId",e=>q(e,{id:new H({required:!0})})),GQ=P("generatedAnswer/feedbackModal/close"),QQ=P("generatedAnswer/sendFeedback"),Er=P("generatedAnswer/setIsLoading",e=>q(e,bo)),Oi=P("generatedAnswer/setIsStreaming",e=>q(e,bo)),Di=P("generatedAnswer/setAnswerContentFormat",e=>q(e,xs)),HQ=P("generatedAnswer/updateResponseFormat",e=>q(e,{contentFormat:new ge({each:xs,default:["text/plain"]})})),zQ=P("knowledge/updateAnswerConfigurationId",e=>q(e,So)),WQ=P("generatedAnswer/registerFieldsToIncludeInCitations",e=>q(e,Pa)),Sd=P("generatedAnswer/setIsAnswerGenerated",e=>q(e,bo)),Mi=P("generatedAnswer/setCannotAnswer",e=>q(e,bo)),aR=P("generatedAnswer/setAnswerApiQueryParams",e=>q(e,new ee({}))),_h=P("generatedAnswer/startStep",e=>q(Th(e),{name:Ih,startedAt:new te({min:0,required:!0})})),kh=P("generatedAnswer/finishStep",e=>q(Th(e),{name:Ih,finishedAt:new te({min:0,required:!0})})),KQ=Ee("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{search:a}=i(),{queryExecuted:s}=a,{setAbortControllerRef:c}=e,u=yield Ah(r),h=(g,y)=>{switch(g){case"genqa.headerMessageType":{let C=JSON.parse(y);n(Di(C.contentFormat));break}case"genqa.messageType":n(Pi(JSON.parse(y)));break;case"genqa.citationsType":n(Ni(JSON.parse(y)));break;case"genqa.endOfStreamType":{let C=JSON.parse(y).answerGenerated,R=s.length!==0&&!C;n(Mi(R)),n(Oi(!1)),n(Sd(C)),n(go(C)),n(ho());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${g}"`)}};n(Er(!0));let v=g=>g.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,S=o.streamingClient?.streamGeneratedAnswer(u,{write:g=>{v(u)&&(n(Er(!1)),g.payload&&g.payloadType&&h(g.payloadType,g.payload))},abort:g=>{v(u)&&n(Fi(g))},close:()=>{v(u)&&n(Oi(!1))},resetAnswer:()=>{v(u)&&n(Es())}});S?c(S):n(Er(!1))});return function(_x69,_x70){return _ref32.apply(this,arguments)}}()),YQ=Ee("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(Es());let i=t();if(i.generatedAnswer.answerConfigurationId){let a=wh(i,n);r(aR(a)),yield r(Oh(a))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x71,_x72){return _ref33.apply(this,arguments)}}());m();d();p();f();m();d();p();f();function Nh(_x73,_x74){return _Nh.apply(this,arguments)}function _Nh(){_Nh=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _Nh.apply(this,arguments)}function Fh(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=cR(t,a);let s=t.length,c=0;for(;r<s;){o&&(t[r]===10&&(c=++r),o=!1);let u=-1;for(;r<s&&u===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-c);break;case 13:o=!0,u=r;break;case 10:u=r;break}if(u===-1)break;e(t.subarray(c,u),n),c=r,n=-1}c===s?t=void 0:c!==0&&(t=t.subarray(c),r-=c)}}function Dh(e,t,r){let n=Ph(),o=new TextDecoder;return function(a,s){if(a.length===0)r?.(n),n=Ph();else if(s>0){let c=o.decode(a.subarray(0,s)),u=s+(a[s+1]===32?2:1),h=o.decode(a.subarray(u));switch(c){case"data":n.data=n.data?`${n.data}
|
|
31
|
-
${h}`:h;break;case"event":n.event=h;break;case"id":e(n.id=h);break;case"retry":sR(h,n,t);break}}}}function sR(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function cR(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Ph(){return{data:"",event:"",id:"",retry:void 0}}var bd="text/event-stream",uR=1e3,Mh="last-event-id";function qh(){return typeof window<"u"}function jh(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:s,fetch:c,...u}){return new Promise((h,v)=>{let S={...r};S.accept||(S.accept=bd);let g;function y(){g?.abort(),document.hidden||_()}!s&&qh()&&document.addEventListener("visibilitychange",y);let C=uR,R;function x(){qh()&&document.removeEventListener("visibilitychange",y),clearTimeout(R),g?.abort()}t?.addEventListener("abort",()=>{x(),h()});let I=c??A,T=n??lR;function _(){return _2.apply(this,arguments)}function _2(){_2=_asyncToGenerator(function*(){g=l.AbortController?new l.AbortController:null;try{let j=yield I(e,{...u,headers:S,signal:g?.signal});yield T(j),yield Nh(j.body,Fh(Dh(N=>{N?S[Mh]=N:delete S[Mh]},N=>{C=N},o))),i?.(),x(),h()}catch(j){if(!g?.signal?.aborted)try{let N=a?.(j)??C;clearTimeout(R),R=setTimeout(_,N)}catch(N){x(),v(N)}}});return _2.apply(this,arguments)}_()})}function lR(e){let t=e.headers.get("content-type");if(!t?.startsWith(bd))throw new Error(`Expected content-type to be ${bd}, Actual: ${t}`)}m();d();p();f();var dR=/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,s=n.generatedAnswer.answerConfigurationId,c={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let u=We(a,i);return{data:jg({baseUrl:`${u}/rest/organizations/${a}/answer/v1/configs/${s}`,fetchFn:function(){var _ref35=_asyncToGenerator(function*(v){if(v instanceof String)throw new Error("The provided 'request' must be a Request object.");let S=v.url,g={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(y=>{g[y]=v[y]}),g.duplex="half",g.body=yield v.text(),A(S,g)});return function fetchFn(_x78){return _ref35.apply(this,arguments)}}()})(c,{...t,signal:null},r)}}catch(u){return{error:u}}});return function dR(_x75,_x76,_x77){return _ref34.apply(this,arguments)}}(),Lh=Qg({reducerPath:"answer",baseQuery:Lg(dR,{maxRetries:3}),endpoints:()=>({})});var fR=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},pR=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},mR=(e,t)=>{e.citations=t.citations},gR=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},hR=(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})`)},yR=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&hR(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(fR(t,o),r(Di(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(pR(t,o),r(Pi({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(mR(t,o),r(Ni({citations:o.citations})));break;case"genqa.endOfStreamType":gR(t,o),r(go(o.answerGenerated??!1)),r(ho());break}},vR=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,i=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${i}/${r}/generate`},Ad=Lh.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(_x79,_x80){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i}){yield n;let{configuration:a,generatedAnswer:s,insightConfiguration:c}=r(),{organizationId:u,environment:h,accessToken:v}=a,S=We(u,h),g=vR(S,u,s.answerConfigurationId,c?.insightId);yield jh(g,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${v}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:A,onopen:function(){var _ref36=_asyncToGenerator(function*(y){let C=y.headers.get("x-answer-id");C&&o(R=>{R.answerId=C,i(Cs(C))})});return function onopen(_x81){return _ref36.apply(this,arguments)}}(),onmessage:y=>{o(C=>{yR(y,C,i)})},onerror:y=>{throw y},onclose:()=>{o(y=>{i(Mi(!y.generated))})}})}).apply(this,arguments)}})})}),Oh=e=>Ad.endpoints.getAnswer.initiate(e);m();d();p();f();var Vh=Me(Hn,e=>e);m();d();p();f();function SR(e){let t=e.payload?.analyticsAction;return Uh(e)&&!ie(t)}function Uh(e){return"type"in e}var Bh=e=>t=>r=>{let n;SR(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return Uh(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};m();d();p();f();m();d();p();f();m();d();p();f();var z3=P("tab/register",e=>{let t=new ee({values:{id:X,expression:Je}});return q(e,t)}),Rs=P("tab/updateActiveTab",e=>q(e,X));m();d();p();f();var Is=_t(hs(),1),Qh=_t($h(),1),Hh=_t(Gh(),1);Is.default.extend(Hh.default);Is.default.extend(Qh.default);var zh=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Is.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"});m();d();p();f();var bR=/(^|; )Coveo-Pendragon=([^;]*)/;function Rd(){return typeof window>"u"?!1:bR.exec(document.cookie)?.pop()||null}var Wh=Me(zh(),e=>e.addCase(gr,(t,r)=>{AR(t,r.payload)}).addCase(Lt,(t,r)=>{wR(t,r.payload)}).addCase(zn,(t,r)=>{xR(t,r.payload)}).addCase(Wn,t=>{t.analytics.enabled=!1}).addCase(Kn,t=>{t.analytics.enabled=!0}).addCase(Na,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(Fa,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(Rs,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(ym,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(hr,(t,r)=>{ie(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(gm,(t,{payload:r})=>{t.knowledge.agentId=r}));function AR(e,t){ie(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",ie(t.organizationId)||(e.organizationId=t.organizationId)}function wR(e,t){ie(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),ie(t.locale)||(e.search.locale=t.locale),ie(t.timezone)||(e.search.timezone=t.timezone),ie(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function xR(e,t){ie(t.enabled)||(e.analytics.enabled=t.enabled),ie(t.originContext)||(e.analytics.originContext=t.originContext),ie(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),ie(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),ie(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),ie(t.trackingId)||(e.analytics.trackingId=t.trackingId),ie(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),ie(t.source)||(e.analytics.source=t.source);try{let r=Rd();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}ie(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),ie(t.anonymous)||(e.analytics.anonymous=t.anonymous),ie(t.deviceId)||(e.analytics.deviceId=t.deviceId),ie(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),ie(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}var Ot=Wh;m();d();p();f();function CR(e){return e.instantlyCallable}var Kh=()=>e=>t=>e(CR(t)?t():t);m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();var tt=[];for(let e=0;e<256;++e)tt.push((e+256).toString(16).slice(1));function Yh(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()}m();d();p();f();var Id,ER=new Uint8Array(16);function Td(){if(!Id){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Id=crypto.getRandomValues.bind(crypto)}return Id(ER)}m();d();p();f();m();d();p();f();var RR=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),_d={randomUUID:RR};function IR(e,t,r){if(_d.randomUUID&&!t&&!e)return _d.randomUUID();e=e||{};let n=e.random??e.rng?.()??Td();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 Yh(n)}var Rr=IR;m();d();p();f();m();d();p();f();var E={};Wo(E,{BRAND:()=>ZR,DIRTY:()=>tn,EMPTY_PATH:()=>OR,INVALID:()=>se,NEVER:()=>qI,OK:()=>it,ParseStatus:()=>rt,Schema:()=>ye,ZodAny:()=>_r,ZodArray:()=>sr,ZodBigInt:()=>nn,ZodBoolean:()=>on,ZodBranded:()=>ji,ZodCatch:()=>hn,ZodDate:()=>an,ZodDefault:()=>gn,ZodDiscriminatedUnion:()=>ks,ZodEffects:()=>It,ZodEnum:()=>pn,ZodError:()=>gt,ZodFirstPartyTypeKind:()=>ce,ZodFunction:()=>Ps,ZodIntersection:()=>ln,ZodIssueCode:()=>W,ZodLazy:()=>dn,ZodLiteral:()=>fn,ZodMap:()=>Ro,ZodNaN:()=>To,ZodNativeEnum:()=>mn,ZodNever:()=>Pt,ZodNull:()=>cn,ZodNullable:()=>Gt,ZodNumber:()=>rn,ZodObject:()=>ht,ZodOptional:()=>Et,ZodParsedType:()=>Z,ZodPipeline:()=>Li,ZodPromise:()=>kr,ZodReadonly:()=>yn,ZodRecord:()=>Os,ZodSchema:()=>ye,ZodSet:()=>Io,ZodString:()=>Tr,ZodSymbol:()=>Co,ZodTransformer:()=>It,ZodTuple:()=>$t,ZodType:()=>ye,ZodUndefined:()=>sn,ZodUnion:()=>un,ZodUnknown:()=>ar,ZodVoid:()=>Eo,addIssueToContext:()=>J,any:()=>cI,array:()=>fI,bigint:()=>nI,boolean:()=>sy,coerce:()=>MI,custom:()=>oy,date:()=>oI,datetimeRegex:()=>ry,defaultErrorMap:()=>or,discriminatedUnion:()=>hI,effect:()=>TI,enum:()=>EI,function:()=>wI,getErrorMap:()=>Ao,getParsedType:()=>Bt,instanceof:()=>tI,intersection:()=>yI,isAborted:()=>Ts,isAsync:()=>wo,isDirty:()=>_s,isValid:()=>Ir,late:()=>eI,lazy:()=>xI,literal:()=>CI,makeIssue:()=>qi,map:()=>bI,nan:()=>rI,nativeEnum:()=>RI,never:()=>lI,null:()=>sI,nullable:()=>kI,number:()=>ay,object:()=>pI,objectUtil:()=>kd,oboolean:()=>DI,onumber:()=>FI,optional:()=>_I,ostring:()=>NI,pipeline:()=>PI,preprocess:()=>OI,promise:()=>II,quotelessJson:()=>TR,record:()=>SI,set:()=>AI,setErrorMap:()=>kR,strictObject:()=>mI,string:()=>iy,symbol:()=>iI,transformer:()=>TI,tuple:()=>vI,undefined:()=>aI,union:()=>gI,unknown:()=>uI,util:()=>Ae,void:()=>dI});m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();var Ae;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(s=>typeof o[o[s]]!="number"),a={};for(let s of i)a[s]=o[s];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},e.find=(o,i)=>{for(let a of o)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Ae||(Ae={}));var kd;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(kd||(kd={}));var Z=Ae.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Bt=e=>{switch(typeof e){case"undefined":return Z.undefined;case"string":return Z.string;case"number":return Number.isNaN(e)?Z.nan:Z.number;case"boolean":return Z.boolean;case"function":return Z.function;case"bigint":return Z.bigint;case"symbol":return Z.symbol;case"object":return Array.isArray(e)?Z.array:e===null?Z.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Z.promise:typeof Map<"u"&&e instanceof Map?Z.map:typeof Set<"u"&&e instanceof Set?Z.set:typeof Date<"u"&&e instanceof Date?Z.date:Z.object;default:return Z.unknown}};var W=Ae.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"]),TR=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),gt=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let s=n,c=0;for(;c<a.path.length;){let u=a.path[c];c===a.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(r(a))):s[u]=s[u]||{_errors:[]},s=s[u],c++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ae.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};gt.create=e=>new gt(e);var _R=(e,t)=>{let r;switch(e.code){case W.invalid_type:e.received===Z.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case W.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ae.jsonStringifyReplacer)}`;break;case W.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ae.joinValues(e.keys,", ")}`;break;case W.invalid_union:r="Invalid input";break;case W.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ae.joinValues(e.options)}`;break;case W.invalid_enum_value:r=`Invalid enum value. Expected ${Ae.joinValues(e.options)}, received '${e.received}'`;break;case W.invalid_arguments:r="Invalid function arguments";break;case W.invalid_return_type:r="Invalid function return type";break;case W.invalid_date:r="Invalid date";break;case W.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}"`:Ae.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case W.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 W.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 W.custom:r="Invalid input";break;case W.invalid_intersection_types:r="Intersection results could not be merged";break;case W.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case W.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ae.assertNever(e)}return{message:r}},or=_R;var Xh=or;function kR(e){Xh=e}function Ao(){return Xh}m();d();p();f();var qi=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...(o.path||[])],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let s="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)s=u(a,{data:t,defaultError:s}).message;return{...o,path:i,message:s}},OR=[];function J(e,t){let r=Ao(),n=qi({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===or?void 0:or].filter(o=>!!o)});e.common.issues.push(n)}var rt=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 se;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static mergeObjectAsync(t,r){return _asyncToGenerator(function*(){let n=[];for(let o of r){let i=yield o.key,a=yield o.value;n.push({key:i,value:a})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return se;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(n[i.value]=a.value)}return{status:t.value,value:n}}},se=Object.freeze({status:"aborted"}),tn=e=>({status:"dirty",value:e}),it=e=>({status:"valid",value:e}),Ts=e=>e.status==="aborted",_s=e=>e.status==="dirty",Ir=e=>e.status==="valid",wo=e=>typeof Promise<"u"&&e instanceof Promise;m();d();p();f();m();d();p();f();var re;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(re||(re={}));var Rt=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}},Jh=(e,t)=>{if(Ir(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 gt(e.common.issues);return this._error=r,this._error}}};function me(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(a,s)=>{let{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??n??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:c??r??s.defaultError}},description:o}}var ye=class{get description(){return this._def.description}_getType(t){return Bt(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Bt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new rt,ctx:{common:t.parent.common,data:t.data,parsedType:Bt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(wo(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:Bt(t)},o=this._parseSync({data:t,path:n.path,parent:n});return Jh(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Bt(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Ir(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=>Ir(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this10=this;return _asyncToGenerator(function*(){let n=yield _this10.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this11=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this11._def.errorMap,parent:null,data:t,parsedType:Bt(t)},o=_this11._parse({data:t,path:n.path,parent:n}),i=yield wo(o)?o:Promise.resolve(o);return Jh(n,i)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let a=t(o),s=()=>i.addIssue({code:W.custom,...n(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new It({schema:this,typeName:ce.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 Et.create(this,this._def)}nullable(){return Gt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sr.create(this)}promise(){return kr.create(this,this._def)}or(t){return un.create([this,t],this._def)}and(t){return ln.create(this,t,this._def)}transform(t){return new It({...me(this._def),schema:this,typeName:ce.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new gn({...me(this._def),innerType:this,defaultValue:r,typeName:ce.ZodDefault})}brand(){return new ji({typeName:ce.ZodBranded,type:this,...me(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new hn({...me(this._def),innerType:this,catchValue:r,typeName:ce.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Li.create(this,t)}readonly(){return yn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},PR=/^c[^\s-]{8,}$/i,NR=/^[0-9a-z]+$/,FR=/^[0-9A-HJKMNP-TV-Z]{26}$/i,DR=/^[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,MR=/^[a-z0-9_-]{21}$/i,qR=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,jR=/^[-+]?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)?)??$/,LR=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,VR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Od,UR=/^(?:(?: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])$/,BR=/^(?:(?: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])$/,$R=/^(([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]))$/,GR=/^(([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])$/,QR=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,HR=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ey="((\\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])))",zR=new RegExp(`^${ey}$`);function ty(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 WR(e){return new RegExp(`^${ty(e)}$`)}function ry(e){let t=`${ey}T${ty(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 KR(e,t){return!!((t==="v4"||!t)&&UR.test(e)||(t==="v6"||!t)&&$R.test(e))}function YR(e,t){if(!qR.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 XR(e,t){return!!((t==="v4"||!t)&&BR.test(e)||(t==="v6"||!t)&&GR.test(e))}var Tr=class e extends ye{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Z.string){let i=this._getOrReturnCtx(t);return J(i,{code:W.invalid_type,expected:Z.string,received:i.parsedType}),se}let n=new rt,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),J(o,{code:W.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),J(o,{code:W.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,s=t.data.length<i.value;(a||s)&&(o=this._getOrReturnCtx(t,o),a?J(o,{code:W.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&J(o,{code:W.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")LR.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"email",code:W.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Od||(Od=new RegExp(VR,"u")),Od.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"emoji",code:W.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")DR.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"uuid",code:W.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")MR.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"nanoid",code:W.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")PR.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"cuid",code:W.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")NR.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"cuid2",code:W.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")FR.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"ulid",code:W.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),J(o,{validation:"url",code:W.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"regex",code:W.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),J(o,{code:W.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),J(o,{code:W.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),J(o,{code:W.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?ry(i).test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{code:W.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?zR.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{code:W.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?WR(i).test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{code:W.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?jR.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"duration",code:W.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?KR(t.data,i.version)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"ip",code:W.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?YR(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"jwt",code:W.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?XR(t.data,i.version)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"cidr",code:W.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?QR.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"base64",code:W.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?HR.test(t.data)||(o=this._getOrReturnCtx(t,o),J(o,{validation:"base64url",code:W.invalid_string,message:i.message}),n.dirty()):Ae.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:W.invalid_string,...re.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...re.errToObj(t)})}url(t){return this._addCheck({kind:"url",...re.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...re.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...re.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...re.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...re.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...re.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...re.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...re.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...re.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...re.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...re.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...re.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,...re.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,...re.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...re.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...re.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...re.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...re.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...re.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...re.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...re.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...re.errToObj(r)})}nonempty(t){return this.min(1,re.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}};Tr.create=e=>new Tr({checks:[],typeName:ce.ZodString,coerce:e?.coerce??!1,...me(e)});function JR(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return i%a/10**o}var rn=class e extends ye{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)!==Z.number){let i=this._getOrReturnCtx(t);return J(i,{code:W.invalid_type,expected:Z.number,received:i.parsedType}),se}let n,o=new rt;for(let i of this._def.checks)i.kind==="int"?Ae.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),J(n,{code:W.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),J(n,{code:W.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),J(n,{code:W.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?JR(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),J(n,{code:W.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),J(n,{code:W.not_finite,message:i.message}),o.dirty()):Ae.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,re.toString(r))}gt(t,r){return this.setLimit("min",t,!1,re.toString(r))}lte(t,r){return this.setLimit("max",t,!0,re.toString(r))}lt(t,r){return this.setLimit("max",t,!1,re.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:re.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:re.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:re.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:re.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:re.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:re.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:re.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:re.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:re.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:re.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"&&Ae.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)}};rn.create=e=>new rn({checks:[],typeName:ce.ZodNumber,coerce:e?.coerce||!1,...me(e)});var nn=class e extends ye{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)!==Z.bigint)return this._getInvalidInput(t);let n,o=new rt;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),J(n,{code:W.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),J(n,{code:W.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),J(n,{code:W.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Ae.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return J(r,{code:W.invalid_type,expected:Z.bigint,received:r.parsedType}),se}gte(t,r){return this.setLimit("min",t,!0,re.toString(r))}gt(t,r){return this.setLimit("min",t,!1,re.toString(r))}lte(t,r){return this.setLimit("max",t,!0,re.toString(r))}lt(t,r){return this.setLimit("max",t,!1,re.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:re.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:re.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:re.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:re.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:re.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:re.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}};nn.create=e=>new nn({checks:[],typeName:ce.ZodBigInt,coerce:e?.coerce??!1,...me(e)});var on=class extends ye{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Z.boolean){let n=this._getOrReturnCtx(t);return J(n,{code:W.invalid_type,expected:Z.boolean,received:n.parsedType}),se}return it(t.data)}};on.create=e=>new on({typeName:ce.ZodBoolean,coerce:e?.coerce||!1,...me(e)});var an=class e extends ye{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Z.date){let i=this._getOrReturnCtx(t);return J(i,{code:W.invalid_type,expected:Z.date,received:i.parsedType}),se}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return J(i,{code:W.invalid_date}),se}let n=new rt,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),J(o,{code:W.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),J(o,{code:W.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Ae.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:re.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:re.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}};an.create=e=>new an({checks:[],coerce:e?.coerce||!1,typeName:ce.ZodDate,...me(e)});var Co=class extends ye{_parse(t){if(this._getType(t)!==Z.symbol){let n=this._getOrReturnCtx(t);return J(n,{code:W.invalid_type,expected:Z.symbol,received:n.parsedType}),se}return it(t.data)}};Co.create=e=>new Co({typeName:ce.ZodSymbol,...me(e)});var sn=class extends ye{_parse(t){if(this._getType(t)!==Z.undefined){let n=this._getOrReturnCtx(t);return J(n,{code:W.invalid_type,expected:Z.undefined,received:n.parsedType}),se}return it(t.data)}};sn.create=e=>new sn({typeName:ce.ZodUndefined,...me(e)});var cn=class extends ye{_parse(t){if(this._getType(t)!==Z.null){let n=this._getOrReturnCtx(t);return J(n,{code:W.invalid_type,expected:Z.null,received:n.parsedType}),se}return it(t.data)}};cn.create=e=>new cn({typeName:ce.ZodNull,...me(e)});var _r=class extends ye{constructor(){super(...arguments),this._any=!0}_parse(t){return it(t.data)}};_r.create=e=>new _r({typeName:ce.ZodAny,...me(e)});var ar=class extends ye{constructor(){super(...arguments),this._unknown=!0}_parse(t){return it(t.data)}};ar.create=e=>new ar({typeName:ce.ZodUnknown,...me(e)});var Pt=class extends ye{_parse(t){let r=this._getOrReturnCtx(t);return J(r,{code:W.invalid_type,expected:Z.never,received:r.parsedType}),se}};Pt.create=e=>new Pt({typeName:ce.ZodNever,...me(e)});var Eo=class extends ye{_parse(t){if(this._getType(t)!==Z.undefined){let n=this._getOrReturnCtx(t);return J(n,{code:W.invalid_type,expected:Z.void,received:n.parsedType}),se}return it(t.data)}};Eo.create=e=>new Eo({typeName:ce.ZodVoid,...me(e)});var sr=class e extends ye{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==Z.array)return J(r,{code:W.invalid_type,expected:Z.array,received:r.parsedType}),se;if(o.exactLength!==null){let a=r.data.length>o.exactLength.value,s=r.data.length<o.exactLength.value;(a||s)&&(J(r,{code:a?W.too_big:W.too_small,minimum:s?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(J(r,{code:W.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&&(J(r,{code:W.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,s)=>o.type._parseAsync(new Rt(r,a,r.path,s)))).then(a=>rt.mergeArray(n,a));let i=[...r.data].map((a,s)=>o.type._parseSync(new Rt(r,a,r.path,s)));return rt.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:re.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:re.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:re.toString(r)}})}nonempty(t){return this.min(1,t)}};sr.create=(e,t)=>new sr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ce.ZodArray,...me(t)});function xo(e){if(e instanceof ht){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Et.create(xo(n))}return new ht({...e._def,shape:()=>t})}else return e instanceof sr?new sr({...e._def,type:xo(e.element)}):e instanceof Et?Et.create(xo(e.unwrap())):e instanceof Gt?Gt.create(xo(e.unwrap())):e instanceof $t?$t.create(e.items.map(t=>xo(t))):e}var ht=class e extends ye{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=Ae.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==Z.object){let u=this._getOrReturnCtx(t);return J(u,{code:W.invalid_type,expected:Z.object,received:u.parsedType}),se}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Pt&&this._def.unknownKeys==="strip"))for(let u in o.data)a.includes(u)||s.push(u);let c=[];for(let u of a){let h=i[u],v=o.data[u];c.push({key:{status:"valid",value:u},value:h._parse(new Rt(o,v,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof Pt){let u=this._def.unknownKeys;if(u==="passthrough")for(let h of s)c.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(u==="strict")s.length>0&&(J(o,{code:W.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let h of s){let v=o.data[h];c.push({key:{status:"valid",value:h},value:u._parse(new Rt(o,v,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let u=[];for(let h of c){let v=yield h.key,S=yield h.value;u.push({key:v,value:S,alwaysSet:h.alwaysSet})}return u})).then(u=>rt.mergeObjectSync(n,u)):rt.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return re.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:re.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:ce.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 Ae.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 Ae.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return xo(this)}partial(t){let r={};for(let n of Ae.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 Ae.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Et;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return ny(Ae.objectKeys(this.shape))}};ht.create=(e,t)=>new ht({shape:()=>e,unknownKeys:"strip",catchall:Pt.create(),typeName:ce.ZodObject,...me(t)});ht.strictCreate=(e,t)=>new ht({shape:()=>e,unknownKeys:"strict",catchall:Pt.create(),typeName:ce.ZodObject,...me(t)});ht.lazycreate=(e,t)=>new ht({shape:e,unknownKeys:"strip",catchall:Pt.create(),typeName:ce.ZodObject,...me(t)});var un=class extends ye{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let s of i)if(s.result.status==="valid")return s.result;for(let s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(s=>new gt(s.ctx.common.issues));return J(r,{code:W.invalid_union,unionErrors:a}),se}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(i){let a={...r,common:{...r.common,issues:[]},parent:null};return{result:yield i._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}});return function(_x82){return _ref38.apply(this,arguments)}}())).then(o);{let i,a=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},h=c._parseSync({data:r.data,path:r.path,parent:u});if(h.status==="valid")return h;h.status==="dirty"&&!i&&(i={result:h,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let s=a.map(c=>new gt(c));return J(r,{code:W.invalid_union,unionErrors:s}),se}}get options(){return this._def.options}};un.create=(e,t)=>new un({options:e,typeName:ce.ZodUnion,...me(t)});var ir=e=>e instanceof dn?ir(e.schema):e instanceof It?ir(e.innerType()):e instanceof fn?[e.value]:e instanceof pn?e.options:e instanceof mn?Ae.objectValues(e.enum):e instanceof gn?ir(e._def.innerType):e instanceof sn?[void 0]:e instanceof cn?[null]:e instanceof Et?[void 0,...ir(e.unwrap())]:e instanceof Gt?[null,...ir(e.unwrap())]:e instanceof ji||e instanceof yn?ir(e.unwrap()):e instanceof hn?ir(e._def.innerType):[],ks=class e extends ye{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Z.object)return J(r,{code:W.invalid_type,expected:Z.object,received:r.parsedType}),se;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(J(r,{code:W.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),se)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let i of r){let a=ir(i.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of a){if(o.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);o.set(s,i)}}return new e({typeName:ce.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...me(n)})}};function Pd(e,t){let r=Bt(e),n=Bt(t);if(e===t)return{valid:!0,data:e};if(r===Z.object&&n===Z.object){let o=Ae.objectKeys(t),i=Ae.objectKeys(e).filter(s=>o.indexOf(s)!==-1),a={...e,...t};for(let s of i){let c=Pd(e[s],t[s]);if(!c.valid)return{valid:!1};a[s]=c.data}return{valid:!0,data:a}}else if(r===Z.array&&n===Z.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let a=e[i],s=t[i],c=Pd(a,s);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===Z.date&&n===Z.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var ln=class extends ye{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,a)=>{if(Ts(i)||Ts(a))return se;let s=Pd(i.value,a.value);return s.valid?((_s(i)||_s(a))&&r.dirty(),{status:r.value,value:s.data}):(J(n,{code:W.invalid_intersection_types}),se)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,a])=>o(i,a)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ln.create=(e,t,r)=>new ln({left:e,right:t,typeName:ce.ZodIntersection,...me(r)});var $t=class e extends ye{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Z.array)return J(n,{code:W.invalid_type,expected:Z.array,received:n.parsedType}),se;if(n.data.length<this._def.items.length)return J(n,{code:W.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),se;!this._def.rest&&n.data.length>this._def.items.length&&(J(n,{code:W.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((a,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new Rt(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>rt.mergeArray(r,a)):rt.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};$t.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $t({items:e,typeName:ce.ZodTuple,rest:null,...me(t)})};var Os=class e extends ye{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!==Z.object)return J(n,{code:W.invalid_type,expected:Z.object,received:n.parsedType}),se;let o=[],i=this._def.keyType,a=this._def.valueType;for(let s in n.data)o.push({key:i._parse(new Rt(n,s,n.path,s)),value:a._parse(new Rt(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?rt.mergeObjectAsync(r,o):rt.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof ye?new e({keyType:t,valueType:r,typeName:ce.ZodRecord,...me(n)}):new e({keyType:Tr.create(),valueType:t,typeName:ce.ZodRecord,...me(r)})}},Ro=class extends ye{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!==Z.map)return J(n,{code:W.invalid_type,expected:Z.map,received:n.parsedType}),se;let o=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([s,c],u)=>({key:o._parse(new Rt(n,s,n.path,[u,"key"])),value:i._parse(new Rt(n,c,n.path,[u,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let c of a){let u=yield c.key,h=yield c.value;if(u.status==="aborted"||h.status==="aborted")return se;(u.status==="dirty"||h.status==="dirty")&&r.dirty(),s.set(u.value,h.value)}return{status:r.value,value:s}}))}else{let s=new Map;for(let c of a){let u=c.key,h=c.value;if(u.status==="aborted"||h.status==="aborted")return se;(u.status==="dirty"||h.status==="dirty")&&r.dirty(),s.set(u.value,h.value)}return{status:r.value,value:s}}}};Ro.create=(e,t,r)=>new Ro({valueType:t,keyType:e,typeName:ce.ZodMap,...me(r)});var Io=class e extends ye{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Z.set)return J(n,{code:W.invalid_type,expected:Z.set,received:n.parsedType}),se;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(J(n,{code:W.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&&(J(n,{code:W.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function a(c){let u=new Set;for(let h of c){if(h.status==="aborted")return se;h.status==="dirty"&&r.dirty(),u.add(h.value)}return{status:r.value,value:u}}let s=[...n.data.values()].map((c,u)=>i._parse(new Rt(n,c,n.path,u)));return n.common.async?Promise.all(s).then(c=>a(c)):a(s)}min(t,r){return new e({...this._def,minSize:{value:t,message:re.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:re.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Io.create=(e,t)=>new Io({valueType:e,minSize:null,maxSize:null,typeName:ce.ZodSet,...me(t)});var Ps=class e extends ye{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Z.function)return J(r,{code:W.invalid_type,expected:Z.function,received:r.parsedType}),se;function n(s,c){return qi({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ao(),or].filter(u=>!!u),issueData:{code:W.invalid_arguments,argumentsError:c}})}function o(s,c){return qi({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ao(),or].filter(u=>!!u),issueData:{code:W.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof kr){let s=this;return it(/*#__PURE__*/_asyncToGenerator(function*(...c){let u=new gt([]),h=yield s._def.args.parseAsync(c,i).catch(g=>{throw u.addIssue(n(c,g)),u}),v=yield Reflect.apply(a,this,h);return yield s._def.returns._def.type.parseAsync(v,i).catch(g=>{throw u.addIssue(o(v,g)),u})}))}else{let s=this;return it(function(...c){let u=s._def.args.safeParse(c,i);if(!u.success)throw new gt([n(c,u.error)]);let h=Reflect.apply(a,this,u.data),v=s._def.returns.safeParse(h,i);if(!v.success)throw new gt([o(h,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:$t.create(t).rest(ar.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||$t.create([]).rest(ar.create()),returns:r||ar.create(),typeName:ce.ZodFunction,...me(n)})}},dn=class extends ye{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})}};dn.create=(e,t)=>new dn({getter:e,typeName:ce.ZodLazy,...me(t)});var fn=class extends ye{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return J(r,{received:r.data,code:W.invalid_literal,expected:this._def.value}),se}return{status:"valid",value:t.data}}get value(){return this._def.value}};fn.create=(e,t)=>new fn({value:e,typeName:ce.ZodLiteral,...me(t)});function ny(e,t){return new pn({values:e,typeName:ce.ZodEnum,...me(t)})}var pn=class e extends ye{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return J(r,{expected:Ae.joinValues(n),received:r.parsedType,code:W.invalid_type}),se}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 J(r,{received:r.data,code:W.invalid_enum_value,options:n}),se}return it(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})}};pn.create=ny;var mn=class extends ye{_parse(t){let r=Ae.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==Z.string&&n.parsedType!==Z.number){let o=Ae.objectValues(r);return J(n,{expected:Ae.joinValues(o),received:n.parsedType,code:W.invalid_type}),se}if(this._cache||(this._cache=new Set(Ae.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=Ae.objectValues(r);return J(n,{received:n.data,code:W.invalid_enum_value,options:o}),se}return it(t.data)}get enum(){return this._def.values}};mn.create=(e,t)=>new mn({values:e,typeName:ce.ZodNativeEnum,...me(t)});var kr=class extends ye{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Z.promise&&r.common.async===!1)return J(r,{code:W.invalid_type,expected:Z.promise,received:r.parsedType}),se;let n=r.parsedType===Z.promise?r.data:Promise.resolve(r.data);return it(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};kr.create=(e,t)=>new kr({type:e,typeName:ce.ZodPromise,...me(t)});var It=class extends ye{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ce.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this12=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:a=>{J(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(n.data,i);if(n.common.async)return Promise.resolve(a).then(/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(s){if(r.value==="aborted")return se;let c=yield _this12._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?se:c.status==="dirty"?tn(c.value):r.value==="dirty"?tn(c.value):c});return function(_x83){return _ref41.apply(this,arguments)}}());{if(r.value==="aborted")return se;let s=this._def.schema._parseSync({data:a,path:n.path,parent:n});return s.status==="aborted"?se:s.status==="dirty"?tn(s.value):r.value==="dirty"?tn(s.value):s}}if(o.type==="refinement"){let a=s=>{let c=o.refinement(s,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?se:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?se:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(o.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ir(a))return se;let s=o.transform(a.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>Ir(a)?Promise.resolve(o.transform(a.value,i)).then(s=>({status:r.value,value:s})):se);Ae.assertNever(o)}};It.create=(e,t,r)=>new It({schema:e,typeName:ce.ZodEffects,effect:t,...me(r)});It.createWithPreprocess=(e,t,r)=>new It({schema:t,effect:{type:"preprocess",transform:e},typeName:ce.ZodEffects,...me(r)});var Et=class extends ye{_parse(t){return this._getType(t)===Z.undefined?it(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Et.create=(e,t)=>new Et({innerType:e,typeName:ce.ZodOptional,...me(t)});var Gt=class extends ye{_parse(t){return this._getType(t)===Z.null?it(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Gt.create=(e,t)=>new Gt({innerType:e,typeName:ce.ZodNullable,...me(t)});var gn=class extends ye{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===Z.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};gn.create=(e,t)=>new gn({innerType:e,typeName:ce.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...me(t)});var hn=class extends ye{_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 wo(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new gt(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new gt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};hn.create=(e,t)=>new hn({innerType:e,typeName:ce.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...me(t)});var To=class extends ye{_parse(t){if(this._getType(t)!==Z.nan){let n=this._getOrReturnCtx(t);return J(n,{code:W.invalid_type,expected:Z.nan,received:n.parsedType}),se}return{status:"valid",value:t.data}}};To.create=e=>new To({typeName:ce.ZodNaN,...me(e)});var ZR=Symbol("zod_brand"),ji=class extends ye{_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}},Li=class e extends ye{_parse(t){var _this13=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let i=yield _this13._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?se:i.status==="dirty"?(r.dirty(),tn(i.value)):_this13._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?se: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:ce.ZodPipeline})}},yn=class extends ye{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Ir(o)&&(o.value=Object.freeze(o.value)),o);return wo(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};yn.create=(e,t)=>new yn({innerType:e,typeName:ce.ZodReadonly,...me(t)});function Zh(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function oy(e,t={},r){return e?_r.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(a=>{if(!a){let s=Zh(t,n),c=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:c})}});if(!i){let a=Zh(t,n),s=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:s})}}):_r.create()}var eI={object:ht.lazycreate},ce;(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"})(ce||(ce={}));var tI=(e,t={message:`Input not instance of ${e.name}`})=>oy(r=>r instanceof e,t),iy=Tr.create,ay=rn.create,rI=To.create,nI=nn.create,sy=on.create,oI=an.create,iI=Co.create,aI=sn.create,sI=cn.create,cI=_r.create,uI=ar.create,lI=Pt.create,dI=Eo.create,fI=sr.create,pI=ht.create,mI=ht.strictCreate,gI=un.create,hI=ks.create,yI=ln.create,vI=$t.create,SI=Os.create,bI=Ro.create,AI=Io.create,wI=Ps.create,xI=dn.create,CI=fn.create,EI=pn.create,RI=mn.create,II=kr.create,TI=It.create,_I=Et.create,kI=Gt.create,OI=It.createWithPreprocess,PI=Li.create,NI=()=>iy().optional(),FI=()=>ay().optional(),DI=()=>sy().optional(),MI={string:e=>Tr.create({...e,coerce:!0}),number:e=>rn.create({...e,coerce:!0}),boolean:e=>on.create({...e,coerce:!0}),bigint:e=>nn.create({...e,coerce:!0}),date:e=>an.create({...e,coerce:!0})};var qI=se;var jI=E.object({name:E.string(),arguments:E.string()}),LI=E.object({id:E.string(),type:E.literal("function"),function:jI,encryptedValue:E.string().optional()}),Ns=E.object({id:E.string(),role:E.string(),content:E.string().optional(),name:E.string().optional(),encryptedValue:E.string().optional()}),VI=E.object({type:E.literal("text"),text:E.string()}),cy=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()}),uy=(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"]})},C4=cy.superRefine((e,t)=>{uy(e,t)}),UI=E.discriminatedUnion("type",[VI,cy]),BI=UI.superRefine((e,t)=>{e.type==="binary"&&uy(e,t)}),$I=Ns.extend({role:E.literal("developer"),content:E.string()}),GI=Ns.extend({role:E.literal("system"),content:E.string()}),QI=Ns.extend({role:E.literal("assistant"),content:E.string().optional(),toolCalls:E.array(LI).optional()}),HI=Ns.extend({role:E.literal("user"),content:E.union([E.string(),E.array(BI)])}),zI=E.object({id:E.string(),content:E.string(),role:E.literal("tool"),toolCallId:E.string(),error:E.string().optional(),encryptedValue:E.string().optional()}),WI=E.object({id:E.string(),role:E.literal("activity"),activityType:E.string(),content:E.record(E.any())}),KI=E.object({id:E.string(),role:E.literal("reasoning"),content:E.string(),encryptedValue:E.string().optional()}),ly=E.discriminatedUnion("role",[$I,GI,QI,HI,zI,WI,KI]),E4=E.union([E.literal("developer"),E.literal("system"),E.literal("assistant"),E.literal("user"),E.literal("tool"),E.literal("activity"),E.literal("reasoning")]),YI=E.object({description:E.string(),value:E.string()}),XI=E.object({name:E.string(),description:E.string(),parameters:E.any()}),JI=E.object({threadId:E.string(),runId:E.string(),parentRunId:E.string().optional(),state:E.any(),messages:E.array(ly),tools:E.array(XI),context:E.array(YI),forwardedProps:E.any()}),ZI=E.any(),qe=class extends Error{constructor(e){super(e)}},Nd=class extends qe{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},dy=E.union([E.literal("developer"),E.literal("system"),E.literal("assistant"),E.literal("user")]),F=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}({}),Re=E.object({type:E.nativeEnum(F),timestamp:E.number().optional(),rawEvent:E.any().optional()}).passthrough(),eT=Re.extend({type:E.literal(F.TEXT_MESSAGE_START),messageId:E.string(),role:dy.default("assistant")}),fy=Re.extend({type:E.literal(F.TEXT_MESSAGE_CONTENT),messageId:E.string(),delta:E.string().refine(e=>e.length>0,"Delta must not be an empty string")}),tT=Re.extend({type:E.literal(F.TEXT_MESSAGE_END),messageId:E.string()}),rT=Re.extend({type:E.literal(F.TEXT_MESSAGE_CHUNK),messageId:E.string().optional(),role:dy.optional(),delta:E.string().optional()}),nT=Re.extend({type:E.literal(F.THINKING_TEXT_MESSAGE_START)}),oT=fy.omit({messageId:!0,type:!0}).extend({type:E.literal(F.THINKING_TEXT_MESSAGE_CONTENT)}),iT=Re.extend({type:E.literal(F.THINKING_TEXT_MESSAGE_END)}),aT=Re.extend({type:E.literal(F.TOOL_CALL_START),toolCallId:E.string(),toolCallName:E.string(),parentMessageId:E.string().optional()}),sT=Re.extend({type:E.literal(F.TOOL_CALL_ARGS),toolCallId:E.string(),delta:E.string()}),cT=Re.extend({type:E.literal(F.TOOL_CALL_END),toolCallId:E.string()}),uT=Re.extend({messageId:E.string(),type:E.literal(F.TOOL_CALL_RESULT),toolCallId:E.string(),content:E.string(),role:E.literal("tool").optional()}),lT=Re.extend({type:E.literal(F.TOOL_CALL_CHUNK),toolCallId:E.string().optional(),toolCallName:E.string().optional(),parentMessageId:E.string().optional(),delta:E.string().optional()}),dT=Re.extend({type:E.literal(F.THINKING_START),title:E.string().optional()}),fT=Re.extend({type:E.literal(F.THINKING_END)}),pT=Re.extend({type:E.literal(F.STATE_SNAPSHOT),snapshot:ZI}),mT=Re.extend({type:E.literal(F.STATE_DELTA),delta:E.array(E.any())}),gT=Re.extend({type:E.literal(F.MESSAGES_SNAPSHOT),messages:E.array(ly)}),hT=Re.extend({type:E.literal(F.ACTIVITY_SNAPSHOT),messageId:E.string(),activityType:E.string(),content:E.record(E.any()),replace:E.boolean().optional().default(!0)}),yT=Re.extend({type:E.literal(F.ACTIVITY_DELTA),messageId:E.string(),activityType:E.string(),patch:E.array(E.any())}),vT=Re.extend({type:E.literal(F.RAW),event:E.any(),source:E.string().optional()}),ST=Re.extend({type:E.literal(F.CUSTOM),name:E.string(),value:E.any()}),bT=Re.extend({type:E.literal(F.RUN_STARTED),threadId:E.string(),runId:E.string(),parentRunId:E.string().optional(),input:JI.optional()}),AT=Re.extend({type:E.literal(F.RUN_FINISHED),threadId:E.string(),runId:E.string(),result:E.any().optional()}),wT=Re.extend({type:E.literal(F.RUN_ERROR),message:E.string(),code:E.string().optional()}),xT=Re.extend({type:E.literal(F.STEP_STARTED),stepName:E.string()}),CT=Re.extend({type:E.literal(F.STEP_FINISHED),stepName:E.string()}),ET=E.union([E.literal("tool-call"),E.literal("message")]),RT=Re.extend({type:E.literal(F.REASONING_START),messageId:E.string()}),IT=Re.extend({type:E.literal(F.REASONING_MESSAGE_START),messageId:E.string(),role:E.literal("reasoning")}),TT=Re.extend({type:E.literal(F.REASONING_MESSAGE_CONTENT),messageId:E.string(),delta:E.string().refine(e=>e.length>0,"Delta must not be an empty string")}),_T=Re.extend({type:E.literal(F.REASONING_MESSAGE_END),messageId:E.string()}),kT=Re.extend({type:E.literal(F.REASONING_MESSAGE_CHUNK),messageId:E.string().optional(),delta:E.string().optional()}),OT=Re.extend({type:E.literal(F.REASONING_END),messageId:E.string()}),PT=Re.extend({type:E.literal(F.REASONING_ENCRYPTED_VALUE),subtype:ET,entityId:E.string(),encryptedValue:E.string()}),Fs=E.discriminatedUnion("type",[eT,fy,tT,rT,dT,fT,nT,oT,iT,aT,sT,cT,lT,uT,pT,mT,gT,hT,yT,vT,ST,bT,AT,wT,xT,CT,RT,IT,TT,_T,kT,OT,PT]);m();d();p();f();var Fd={};Wo(Fd,{JsonPatchError:()=>Ue,_areEquals:()=>Bi,applyOperation:()=>vn,applyPatch:()=>Or,applyReducer:()=>qT,deepClone:()=>DT,getValueByPointer:()=>Ls,validate:()=>my,validator:()=>Vs});m();d();p();f();m();d();p();f();var NT=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),FT=Object.prototype.hasOwnProperty;function Ms(e,t){return FT.call(e,t)}function qs(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)Ms(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 js(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 Qt(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Vi(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Ds(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Ds(e[t]))return!0}else if(typeof e=="object"){for(var n=qs(e),o=n.length,i=0;i<o;i++)if(Ds(e[n[i]]))return!0}}return!1}function py(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 Ui=function(e){NT(t,e);function t(r,n,o,i,a){var s=this.constructor,c=e.call(this,py(r,{name:n,index:o,operation:i,tree:a}))||this;return c.name=n,c.index=o,c.operation=i,c.tree=a,Object.setPrototypeOf(c,s.prototype),c.message=py(r,{name:n,index:o,operation:i,tree:a}),c}return t}(Error);var Ue=Ui,DT=nt,_o={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=Ls(r,this.path);n&&(n=nt(n));var o=vn(r,{op:"remove",path:this.from}).removed;return vn(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=Ls(r,this.from);return vn(r,{op:"add",path:this.path,value:nt(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:Bi(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},MT={add:function(e,t,r){return js(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:_o.move,copy:_o.copy,test:_o.test,_get:_o._get};function Ls(e,t){if(t=="")return e;var r={op:"_get",path:t};return vn(e,r),r.value}function vn(e,t,r,n,o,i){if(r===void 0&&(r=!1),n===void 0&&(n=!0),o===void 0&&(o=!0),i===void 0&&(i=0),r&&(typeof r=="function"?r(t,0,e,t.path):Vs(t,0)),t.path===""){var a={newDocument:e};if(t.op==="add")return a.newDocument=t.value,a;if(t.op==="replace")return a.newDocument=t.value,a.removed=e,a;if(t.op==="move"||t.op==="copy")return a.newDocument=Ls(e,t.from),t.op==="move"&&(a.removed=e),a;if(t.op==="test"){if(a.test=Bi(e,t.value),a.test===!1)throw new Ue("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a.newDocument=e,a}else{if(t.op==="remove")return a.removed=e,a.newDocument=null,a;if(t.op==="_get")return t.value=e,a;if(r)throw new Ue("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",i,t,e);return a}}else{n||(e=nt(e));var s=t.path||"",c=s.split("/"),u=e,h=1,v=c.length,S=void 0,g=void 0,y=void 0;for(typeof r=="function"?y=r:y=Vs;;){if(g=c[h],g&&g.indexOf("~")!=-1&&(g=Vi(g)),o&&(g=="__proto__"||g=="prototype"&&h>0&&c[h-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&S===void 0&&(u[g]===void 0?S=c.slice(0,h).join("/"):h==v-1&&(S=t.path),S!==void 0&&y(t,0,e,S)),h++,Array.isArray(u)){if(g==="-")g=u.length;else{if(r&&!js(g))throw new Ue("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",i,t,e);js(g)&&(g=~~g)}if(h>=v){if(r&&t.op==="add"&&g>u.length)throw new Ue("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",i,t,e);var a=MT[t.op].call(t,u,g,e);if(a.test===!1)throw new Ue("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}}else if(h>=v){var a=_o[t.op].call(t,u,g,e);if(a.test===!1)throw new Ue("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}if(u=u[g],r&&h<v&&(!u||typeof u!="object"))throw new Ue("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",i,t,e)}}}function Or(e,t,r,n,o){if(n===void 0&&(n=!0),o===void 0&&(o=!0),r&&!Array.isArray(t))throw new Ue("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=nt(e));for(var i=new Array(t.length),a=0,s=t.length;a<s;a++)i[a]=vn(e,t[a],r,!0,o,a),e=i[a].newDocument;return i.newDocument=e,i}function qT(e,t,r){var n=vn(e,t);if(n.test===!1)throw new Ue("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function Vs(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new Ue("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(_o[e.op]){if(typeof e.path!="string")throw new Ue("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Ue("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 Ue("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 Ue("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")&&Ds(e.value))throw new Ue("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var o=e.path.split("/").length,i=n.split("/").length;if(o!==i+1&&o!==i)throw new Ue("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 Ue("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var a={op:"_get",path:e.from,value:void 0},s=my([a],r);if(s&&s.name==="OPERATION_PATH_UNRESOLVABLE")throw new Ue("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new Ue("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function my(e,t,r){try{if(!Array.isArray(e))throw new Ue("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Or(nt(t),nt(e),r||!0);else{r=r||Vs;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(o){if(o instanceof Ue)return o;throw o}}function Bi(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),o,i,a;if(r&&n){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(!Bi(e[o],t[o]))return!1;return!0}if(r!=n)return!1;var s=Object.keys(e);if(i=s.length,i!==Object.keys(t).length)return!1;for(o=i;o--!==0;)if(!t.hasOwnProperty(s[o]))return!1;for(o=i;o--!==0;)if(a=s[o],!Bi(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var jd={};Wo(jd,{compare:()=>QT,generate:()=>Dd,observe:()=>GT,unobserve:()=>$T});m();d();p();f();var Md=new WeakMap,jT=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),LT=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function VT(e){return Md.get(e)}function UT(e,t){return e.observers.get(t)}function BT(e,t){e.observers.delete(t.callback)}function $T(e,t){t.unobserve()}function GT(e,t){var r=[],n,o=VT(e);if(!o)o=new jT(e),Md.set(e,o);else{var i=UT(o,t);n=i&&i.observer}if(n)return n;if(n={},o.value=nt(e),t){n.callback=t,n.next=null;var a=function(){Dd(n)},s=function(){clearTimeout(n.next),n.next=setTimeout(a)};typeof window<"u"&&(window.addEventListener("mouseup",s),window.addEventListener("keyup",s),window.addEventListener("mousedown",s),window.addEventListener("keydown",s),window.addEventListener("change",s))}return n.patches=r,n.object=e,n.unobserve=function(){Dd(n),clearTimeout(n.next),BT(o,n),typeof window<"u"&&(window.removeEventListener("mouseup",s),window.removeEventListener("keyup",s),window.removeEventListener("mousedown",s),window.removeEventListener("keydown",s),window.removeEventListener("change",s))},o.observers.set(t,new LT(t,n)),n}function Dd(e,t){t===void 0&&(t=!1);var r=Md.get(e.object);qd(r.value,e.object,e.patches,"",t),e.patches.length&&Or(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function qd(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var i=qs(t),a=qs(e),s=!1,c=!1,u=a.length-1;u>=0;u--){var h=a[u],v=e[h];if(Ms(t,h)&&!(t[h]===void 0&&v!==void 0&&Array.isArray(t)===!1)){var S=t[h];typeof v=="object"&&v!=null&&typeof S=="object"&&S!=null&&Array.isArray(v)===Array.isArray(S)?qd(v,S,r,n+"/"+Qt(h),o):v!==S&&(s=!0,o&&r.push({op:"test",path:n+"/"+Qt(h),value:nt(v)}),r.push({op:"replace",path:n+"/"+Qt(h),value:nt(S)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+Qt(h),value:nt(v)}),r.push({op:"remove",path:n+"/"+Qt(h)}),c=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),s=!0)}if(!(!c&&i.length==a.length))for(var u=0;u<i.length;u++){var h=i[u];!Ms(e,h)&&t[h]!==void 0&&r.push({op:"add",path:n+"/"+Qt(h),value:nt(t[h])})}}}function QT(e,t,r){r===void 0&&(r=!1);var n=[];return qd(e,t,n,"",r),n}var Y4=Object.assign({},Fd,jd,{JsonPatchError:Ui,deepClone:nt,escapePathComponent:Qt,unescapePathComponent:Vi});m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();var Ld=function(e,t){return Ld=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])},Ld(e,t)};function Ht(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ld(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function gy(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(v){a(v)}}function c(h){try{u(n.throw(h))}catch(v){a(v)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}function Us(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(h){return c([u,h])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(r=0)),r;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(h){u=[6,h],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function cr(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 ko(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-->0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function Oo(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function Sn(e){return this instanceof Sn?(this.v=e,this):new Sn(e)}function hy(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(g){return function(y){return Promise.resolve(y).then(g,v)}}function s(g,y){n[g]&&(o[g]=function(C){return new Promise(function(R,x){i.push([g,C,R,x])>1||c(g,C)})},y&&(o[g]=y(o[g])))}function c(g,y){try{u(n[g](y))}catch(C){S(i[0][3],C)}}function u(g){g.value instanceof Sn?Promise.resolve(g.value.v).then(h,v):S(i[0][2],g)}function h(g){c("next",g)}function v(g){c("throw",g)}function S(g,y){g(y),i.shift(),i.length&&c(i[0][0],i[0][1])}}function yy(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 cr=="function"?cr(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(s,c){a=e[i](a),o(s,c,a.done,a.value)})}}function o(i,a,s,c){Promise.resolve(c).then(function(u){i({value:u,done:s})},a)}}m();d();p();f();function Se(e){return typeof e=="function"}m();d();p();f();m();d();p();f();m();d();p();f();function Po(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 Bs=Po(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
30
|
+
`;function YC(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var XC=["1",1,"yes",!0];function ws(){let e=[];return jl()&&e.push(window.doNotTrack),Xl()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>XC.indexOf(t)!==-1)}var bg="v15",wg={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 JC(e=wg.default,t=bg,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 ZC="38824e1f-37f5-42d3-8372-a4b8fa9df946",Wt=class{get defaultOptions(){return{endpoint:wg.default,isCustomEndpoint:!1,token:"",version:bg,beforeSendHooks:[],afterSendHooks:[]}}get version(){return hg}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=[Ux,Mx].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};ws()?this.runtime=new bs:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(ve.view,{newEventType:ve.view,addClientIdParameter:!0}),this.addEventTypeMapping(ve.click,{newEventType:ve.click,addClientIdParameter:!0}),this.addEventTypeMapping(ve.custom,{newEventType:ve.custom,addClientIdParameter:!0}),this.addEventTypeMapping(ve.search,{newEventType:ve.search,addClientIdParameter:!0})}initRuntime(t){return jl()&&so()?new Kl(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(YC()&&console.warn(KC),new Yl(t))}get storage(){return this.runtime.storage}determineVisitorId(){return V(this,void 0,void 0,function*(){try{return jl()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||sn()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),sn()}})}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(hs(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(ng(t,ng(r,ZC)))}})}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(sn()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(ws())return null;try{let r=new URL(t).searchParams.get(Er.cvo_cid);if(r==null)return null;let n=Er.fromString(r);return!n||!so()||!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:i=!1,addClientIdParameter:a=!1}=this.eventTypeMapping[t]||{};return yield[g=>n.length>0?this.parseVariableArgumentsPayload(n,g):g[0],g=>V(this,void 0,void 0,function*(){return Object.assign(Object.assign({},g),{visitorId:o?yield this.getCurrentVisitorId():""})}),g=>V(this,void 0,void 0,function*(){return a?Object.assign(Object.assign({},g),{clientId:yield this.getCurrentVisitorId()}):g}),g=>i?this.ensureAnonymousUserWhenUsingApiKey(g):g,g=>this.beforeSendHooks.reduce((y,x)=>V(this,void 0,void 0,function*(){let C=yield y;return yield x(t,C)}),g)].reduce((g,y)=>V(this,void 0,void 0,function*(){let x=yield g;return yield y(x)}),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?LC(S):S,S=>n?this.removeUnknownParameters(S):S,S=>n?this.processCustomParameters(S):this.mapCustomParametersToCustomData(S)].reduce((S,v)=>V(this,void 0,void 0,function*(){let g=yield S;return yield v(g)}),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),i=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:i,log:a=>V(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},i),a)}),yield Promise.all(this.afterSendHooks.map(s=>s(t,Object.assign(Object.assign({},o),a)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return 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 gs().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return V(this,void 0,void 0,function*(){return this.makeEvent(ve.search,t)})}sendSearchEvent(t){return V(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=cr(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return V(this,void 0,void 0,function*(){return this.makeEvent(ve.click,t)})}sendClickEvent(t){return V(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=cr(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return V(this,void 0,void 0,function*(){return this.makeEvent(ve.custom,t)})}sendCustomEvent(t){return V(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=cr(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return V(this,void 0,void 0,function*(){return this.makeEvent(ve.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 w(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return V(this,void 0,void 0,function*(){return yield(yield w(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,i=r.length;o<i;o++){let a=r[o];if(typeof a=="string")n[t[o]]=a;else if(typeof a=="object")return Object.assign(Object.assign({},n),a)}return n}isKeyAllowedEmpty(t,r){return({[ve.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,i)=>Object.assign(Object.assign({},o),{[i]:t[i]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if($C(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=cr(t,["custom"]),o={};r&&ms(r)&&(o=this.lowercaseKeys(r));let i=GC(n);return Object.assign(Object.assign({},o),i)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=cr(t,["custom"]);if(r&&ms(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=cr(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==ve.view||r==ve.click||r==ve.search||r==ve.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==ve.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=cr(t,["userId"]);return WC(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=cr(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&ms(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&ms(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"?rC(t,r):t}get baseUrl(){return JC(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},ur;(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"})(ur||(ur={}));var G;(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"})(G||(G={}));var lg={[G.triggerNotify]:"queryPipelineTriggers",[G.triggerExecute]:"queryPipelineTriggers",[G.triggerQuery]:"queryPipelineTriggers",[G.triggerRedirect]:"queryPipelineTriggers",[G.queryErrorBack]:"errors",[G.queryErrorClear]:"errors",[G.queryErrorRetry]:"errors",[G.pagerNext]:"getMoreResults",[G.pagerPrevious]:"getMoreResults",[G.pagerNumber]:"getMoreResults",[G.pagerResize]:"getMoreResults",[G.pagerScrolling]:"getMoreResults",[G.facetSearch]:"facet",[G.facetShowLess]:"facet",[G.facetShowMore]:"facet",[G.recommendation]:"recommendation",[G.likeSmartSnippet]:"smartSnippet",[G.dislikeSmartSnippet]:"smartSnippet",[G.expandSmartSnippet]:"smartSnippet",[G.collapseSmartSnippet]:"smartSnippet",[G.openSmartSnippetFeedbackModal]:"smartSnippet",[G.closeSmartSnippetFeedbackModal]:"smartSnippet",[G.sendSmartSnippetReason]:"smartSnippet",[G.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[G.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[G.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[G.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[G.clearRecentQueries]:"recentQueries",[G.recentResultClick]:"recentlyClickedDocuments",[G.clearRecentResults]:"recentlyClickedDocuments",[G.showLessFoldedResults]:"folding",[G.caseDetach]:"case",[G.likeGeneratedAnswer]:"generatedAnswer",[G.dislikeGeneratedAnswer]:"generatedAnswer",[G.openGeneratedAnswerSource]:"generatedAnswer",[G.generatedAnswerStreamEnd]:"generatedAnswer",[G.generatedAnswerSourceHover]:"generatedAnswer",[G.generatedAnswerCopyToClipboard]:"generatedAnswer",[G.generatedAnswerHideAnswers]:"generatedAnswer",[G.generatedAnswerShowAnswers]:"generatedAnswer",[G.generatedAnswerExpand]:"generatedAnswer",[G.generatedAnswerCollapse]:"generatedAnswer",[G.generatedAnswerFeedbackSubmit]:"generatedAnswer",[G.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[ur.expandToFullUI]:"interface",[ur.openUserActions]:"User Actions",[ur.showPrecedingSessions]:"User Actions",[ur.showFollowingSessions]:"User Actions",[ur.clickViewedDocument]:"User Actions",[ur.clickPageView]:"User Actions",[ur.createArticle]:"createArticle"},lo=class{constructor(){this.runtime=new bs,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(ve.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(ve.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(ve.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(ve.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return hg}};function eE(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function tE(e){return e.map(t=>t.replace(/;/g,""))}function Ag(e){let r=e.join(";");return r.length<=256?r:Ag(e.slice(1))}var dg=e=>{let t=tE(e),r=eE(t);return Ag(r)};function fg(e){let t=typeof e.partialQueries=="string"?e.partialQueries:dg(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:dg(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var As=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||ws();this.coveoAnalyticsClient=n?new lo:new Wt(t)}disable(){this.coveoAnalyticsClient=new lo}enable(){this.coveoAnalyticsClient=new Wt(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent(G.interfaceLoad)}logInterfaceLoad(){return V(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent(G.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return V(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent(G.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(G.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(G.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(G.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(G.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(G.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(G.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(G.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return V(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent(G.didyoumeanClick)}logDidYouMeanClick(){return V(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent(G.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(G.searchboxSubmit)}logSearchboxSubmit(){return V(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent(G.searchboxClear)}logSearchboxClear(){return V(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent(G.searchboxAsYouType)}logSearchboxAsYouType(){return V(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent(G.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(G.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(G.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(G.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(G.omniboxAnalytics,fg(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(G.omniboxFromLink,fg(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(G.searchFromLink)}logSearchFromLink(){return V(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent(G.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(G.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(G.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(G.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(G.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(G.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(G.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(G.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(G.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(G.pagerScrolling)}logPagerScrolling(){return V(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent(G.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(G.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(G.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(G.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(G.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(G.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(G.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(G.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(G.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(G.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(G.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(G.queryErrorBack);return{description:t.description,log:()=>V(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(G.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(G.queryErrorRetry);return{description:t.description,log:()=>V(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(G.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(G.queryErrorClear);return{description:t.description,log:()=>V(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent(G.queryErrorClear)})}})}logQueryErrorClear(){return V(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent(G.likeSmartSnippet)}logLikeSmartSnippet(){return V(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent(G.dislikeSmartSnippet)}logDislikeSmartSnippet(){return V(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent(G.expandSmartSnippet)}logExpandSmartSnippet(){return V(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent(G.collapseSmartSnippet)}logCollapseSmartSnippet(){return V(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent(G.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return V(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent(G.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(G.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(G.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(G.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(G.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(G.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(G.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(G.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent(G.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(G.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(G.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(G.recentQueryClick)}logRecentQueryClick(){return V(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent(G.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(G.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(G.clearRecentResults)}logClearRecentResults(){return V(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent(G.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(G.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(G.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,i=lg[n]){this.coveoAnalyticsClient.getParameters;let a=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),s=Object.assign(Object.assign({},yield this.getBaseEventRequest(a)),{eventType:i,eventValue:n}),c=yield this.coveoAnalyticsClient.makeCustomEvent(s);return{description:this.makeEventDescription(c,n),log:({searchUID:u})=>c.log({lastSearchQueryUid:u})}})}logCustomEvent(t,r){return V(this,arguments,void 0,function*(n,o,i=lg[n]){return(yield this.makeCustomEvent(n,o,i)).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),i=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),a=yield this.coveoAnalyticsClient.makeCustomEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:s})=>a.log({lastSearchQueryUid:s})}})}logCustomEventWithType(t,r,n){return 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:i})=>o.log({searchQueryUid:i})}})}makeClickEvent(t,r,n,o){return V(this,void 0,void 0,function*(){let i=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),a=yield this.coveoAnalyticsClient.makeClickEvent(i);return{description:this.makeEventDescription(a,t),log:({searchUID:s})=>a.log({searchQueryUid:s})}})}logClickEvent(t,r,n,o){return 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 Wt?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(G.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(G.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(G.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(G.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(G.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(G.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(G.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(G.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(G.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(G.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(G.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(G.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(G.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(G.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return V(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent(G.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return V(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},xs=Object.assign({},Ti),pg=Object.keys(xs).map(e=>xs[e]),co=class extends Ul{constructor({client:t,uuidGenerator:r=sn}){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])=>pg.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(pg.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(xs.pageview,{newEventType:ve.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(xs.event,{newEventType:ve.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),i=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},i),o),r)}getTicketPayload(){return sC(this.ticket)}};co.Id="svc";var Cs;(function(e){e.click="click",e.flowStart="flowStart"})(Cs||(Cs={}));var It;(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"})(It||(It={}));var Es;(function(e){e.quit="Quit",e.solved="Solved"})(Es||(Es={}));var Rs=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!ws();this.coveoAnalyticsClient=o?new Wt(t):new lo,this.svc=new co({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new lo,this.svc=new co({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new Wt(this.options),this.svc=new co({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(It.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(It.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(It.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(It.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(It.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(It.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(It.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(It.caseCancelled,{reason:Es.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(It.caseSolved,{reason:Es.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(It.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Cs.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",Cs.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 Wt?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,i;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(i=this.provider)===null||i===void 0?void 0:i.getOriginLevel3()}}logClickEvent(t,r,n,o){return V(this,void 0,void 0,function*(){var i,a;let s=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(a=(i=this.provider)===null||i===void 0?void 0:i.getSearchUID())!==null&&a!==void 0?a:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(s)})}};var xg=e=>new Wt(e).getCurrentVisitorId(),Oi=(e,t)=>typeof t=="function"?(...r)=>{let n=oi(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,Pi=(e,t)=>(...r)=>{let n=oi(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();function Is(){return{desiredCount:5,numberOfValues:8,set:{}}}m();d();p();f();m();d();p();f();m();d();p();f();function Cg(e){let{activeValue:t,ancestryMap:r}=rE(e);return t?nE(t,r):[]}function rE(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 nE(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}var oE=(e,t)=>e.categoryFacetSet[t]?.request;var ed=(e,t)=>{let r=oE(e,t);return Cg(r?.currentValues??[])};m();d();p();f();function Ts(){return{}}m();d();p();f();function _s(){return{}}m();d();p();f();function ks(){return{}}m();d();p();f();function Os(){return{}}function td(e){return{facetSet:e.facetSet??Os(),categoryFacetSet:e.categoryFacetSet??Ts(),dateFacetSet:e.dateFacetSet??_s(),numericFacetSet:e.numericFacetSet??ks(),automaticFacetSet:e.automaticFacetSet??Is()}}var rd=e=>{let t=[];return sE(e).forEach((r,n)=>{let o=gE(e,r.facetId),i=pE(r,n+1);if(aE(r)){if(!!!ed(e,r.facetId).length)return;t.push({...i,...dE(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((a,s)=>{if(a.state==="idle")return;let c=Eg(a,s+1,o),u=iE(r)?Rg(a):uE(a);t.push({...i,...c,...u})})}),cE(e).forEach((r,n)=>{let o=fE(r,n+1);r.values.forEach((i,a)=>{if(i.state==="idle")return;let s=Eg(i,a+1,"specific"),c=Rg(i);t.push({...o,...s,...c})})}),t},iE=e=>e.type==="specific",aE=e=>e.type==="hierarchical",sE=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),cE=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Eg=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),uE=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),Rg=e=>({displayValue:e.value,value:e.value}),lE=(e,t)=>ed(e,t).map(n=>n.value).join(";"),dE=(e,t)=>{let n=lE(e,t);return{value:n,valuePosition:1,displayValue:n}},fE=(e,t)=>({title:Ig(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),pE=(e,t)=>({title:Ig(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),Ig=(e,t)=>`${e}_${t}`,mE=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,gE=(e,t)=>{let r=mE(e,t);return r?r.type:"specific"};m();d();p();f();m();d();p();f();var nd=e=>e.configuration.search.locale,Tg=e=>e.configuration.search.timezone,_g=e=>e.configuration.accessToken,kg=e=>e.configuration.organizationId,Og=e=>e.configuration.environment,Ps=e=>e.configuration?.knowledge?.agentId,Pg=e=>e.configuration.knowledge.debugAgentSession;var cn=e=>{if(hE(e)||od(e))return e.generatedAnswer?.answerId;if(yE(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},hE=e=>"answer"in e&&"generatedAnswer"in e&&!se(e.generatedAnswer?.answerConfigurationId),od=e=>{let t=Ps(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},yE=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",id=e=>e.generatedAnswer?.fieldsToIncludeInCitations,SE=Be(e=>e.generatedAnswer?.citations,(e,t)=>t,(e,t)=>e?.find(r=>r.id===t));m();d();p();f();var xt=()=>({q:"",enableQuerySyntax:!1});m();d();p();f();m();d();p();f();var Ng=(r=>(r.Ascending="ascending",r.Descending="descending",r))(Ng||{}),Fg=(i=>(i.Relevancy="relevancy",i.QRE="qre",i.Date="date",i.Field="field",i.NoSort="nosort",i))(Fg||{}),ad=e=>{if(Ep(e))return e.map(t=>ad(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""}},Dg=()=>({by:"relevancy"});var WL=new re({values:{by:new el({enum:Fg,required:!0}),order:new el({enum:Ng}),field:new z}});function Ns(){return ad(Dg())}m();d();p();f();m();d();p();f();var fo=()=>"default";var vE=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},lr=class{constructor(t){this.getState=t;Ae(this,"state");this.state=t()}getLanguage(){return vE(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[i,a]of Object.entries(n)){let s=`context_${i}`;o[s]=a}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=Xn),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||fo()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};var Ni=class Ni extends lr{constructor(){super(...arguments);Ae(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return rd(td(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||Ni.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||$t().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||Ni.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=cn(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetValue:n,facetTitle:`${i}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,criteria:n,facetTitle:`${i}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:i,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${i}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??Ns()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let i=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:i,categoryFacetPath:n,categoryFacetTitle:`${i}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],i=o.completions.map(u=>u.expression),a=o.partialQueries.length-1,s=o.partialQueries[a]||"",c=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:i.indexOf(n),partialQuery:s,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:i.length>0?i:"",querySuggestResponseId:c}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||xt().q}get responseTime(){return this.state.search?.duration||$t().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||$t().response.totalCountFiltered}};Ae(Ni,"fallbackPipelineName","default");var Rr=Ni,Mg=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o})=>{let i=t(),a=i.configuration.accessToken,s=i.configuration.analytics.apiBaseUrl??Je(i.configuration.organizationId,i.configuration.environment,"analytics"),c=i.configuration.analytics.runtimeEnvironment,u=i.configuration.analytics.enabled,h=new As({token:a,endpoint:s,runtimeEnvironment:c,preprocessRequest:Oi(e,n),beforeSendHooks:[Pi(e,r),(S,v)=>(e.info({...v,type:S,endpoint:s,token:a},"Analytics request"),v)]},o);return u||h.disable(),h},sd=()=>{let t=Rt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};var Fs=/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield xg(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}),...(sd()&&{pageId:sd()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:ao(e)})}}});return function Fs(_x17,_x18){return _ref10.apply(this,arguments)}}();m();d();p();f();m();d();p();f();m();d();p();f();var po=()=>({duration:0,error:null,isLoading:!1,id:"Recommendation",recommendations:[],searchUid:"",splitTestRun:"",pipeline:""});var Fi=class extends lr{getPipeline(){return this.state.pipeline||this.state.recommendation?.pipeline||"default"}getSearchEventRequestPayload(){return{queryText:xt().q,responseTime:this.responseTime,results:this.mapResultsToAnalyticsDocument(),numberOfResults:this.numberOfResults}}getSearchUID(){return this.getState().recommendation?.searchUid||po().searchUid}getSplitTestRunName(){return this.state.recommendation?.splitTestRun}getSplitTestRunVersion(){let t=!!this.getSplitTestRunName(),r=this.state.recommendation?.pipeline||this.state.pipeline||"default";return t?r:void 0}get responseTime(){return this.state.recommendation?.duration||po().duration}mapResultsToAnalyticsDocument(){return this.state.recommendation?.recommendations.map(t=>({documentUri:t.uri,documentUriHash:t.raw.urihash}))}get numberOfResults(){return this.state.recommendation?.recommendations.length||po().recommendations.length}};m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();function qg(){let e=typeof window<"u";return{sendMessage(t){e&&window.postMessage(t,"*")}}}m();d();p();f();m();d();p();f();m();d();p();f();var jg=/^(?:[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 bE(e){return typeof e=="string"&&jg.test(e)}var cd=bE;m();d();p();f();var ot=[];for(let e=0;e<256;++e)ot.push((e+256).toString(16).slice(1));function Lg(e,t=0){return(ot[e[t+0]]+ot[e[t+1]]+ot[e[t+2]]+ot[e[t+3]]+"-"+ot[e[t+4]]+ot[e[t+5]]+"-"+ot[e[t+6]]+ot[e[t+7]]+"-"+ot[e[t+8]]+ot[e[t+9]]+"-"+ot[e[t+10]]+ot[e[t+11]]+ot[e[t+12]]+ot[e[t+13]]+ot[e[t+14]]+ot[e[t+15]]).toLowerCase()}m();d();p();f();var ud,wE=new Uint8Array(16);function ld(){if(!ud){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ud=crypto.getRandomValues.bind(crypto)}return ud(wE)}m();d();p();f();m();d();p();f();var AE=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),dd={randomUUID:AE};function xE(e,t,r){e=e||{};let n=e.random??e.rng?.()??ld();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return Lg(n)}function CE(e,t,r){return dd.randomUUID&&!t&&!e?dd.randomUUID():xE(e,t,r)}var fd=CE;function EE(_x19){return _EE.apply(this,arguments)}function _EE(){_EE=_asyncToGenerator(function*({config:e,environment:t,event:r,listenerManager:n}){let{url:o,token:i,mode:a}=e;if(a!=="disabled")return n.call(r),t.send(o,i,r)});return _EE.apply(this,arguments)}var Qg="2.1.1",pd=128,Hg=192,Vg=224,Ug=240,RE=248;function IE(e){return(e&RE)===Ug?4:(e&Ug)===Vg?3:(e&Vg)===Hg?2:1}function TE(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&pd)!=pd)break;if(r-=3,(n&Hg)!=pd){t-r>=IE(n)*3&&(r=t);break}}return e.substring(0,r)}function _E(e){let{trackingId:t}=e;return{trackingId:t}}function kE(e){return(e.source||[]).concat([`relay@${Qg}`])}function zg(e,t,r){let{getReferrer:n,getLocation:o,getUserAgent:i}=r,a=_E(t),s=r.getClientId();return Object.freeze({type:e,config:a,ts:Date.now(),source:kE(t),clientId:s,userAgent:i(),referrer:Bg(n()),location:Bg(o())})}function Bg(e){return e!==null?TE(e,1024):null}function OE(e,t,r,n){return{...t,meta:zg(e,r,n)}}var PE="*";function NE(){let e=[];function t({type:c,callback:u}){return e.findIndex(h=>h.type===c&&h.callback===u)}function r(c,u){return c.type==="*"||u===c.type}function n(c){return t(c)<0&&e.push(c),()=>s(c.type,c.callback)}function o(c){e.forEach(u=>{if(r(u,c.meta.type))try{u.callback(c)}catch(h){console.error(h)}})}function i(c){if(c===PE)e.length=0;else for(let u=e.length-1;u>=0;u--)e[u].type===c&&e.splice(u,1)}function a(c){let u=t(c);u>=0&&e.splice(u,1)}function s(c,u){u?a({type:c,callback:u}):i(c)}return{add:n,call:o,remove:s}}function $g({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 FE(e){let t=$g(e);return{get:()=>t,update:r=>{t=$g({...t,...r})}}}var md=DE();function DE(){let e="coveo_",t=r=>{let n=r.split(".").slice(-2);return n.length==2?n.join("."):""};return{getItem(r){let n=`${e}${r}=`,o=document.cookie.split(";");for(let i of o){let a=i.replace(/^\s+/,"");if(a.lastIndexOf(n,0)===0)return a.substring(n.length,a.length)}return null},setItem(r,n,o){let i=t(window.location.hostname),a=`;expires=${new Date(new Date().getTime()+o).toUTCString()}`,s=i?`;domain=${i}`:"";document.cookie=`${e}${r}=${n}${a}${s};path=/;SameSite=Lax`},removeItem(r){this.setItem(r,"",-1)}}}function ME(){return{getItem(e){return md.getItem(e)||localStorage.getItem(e)},removeItem(e){md.removeItem(e),localStorage.removeItem(e)},setItem(e,t){localStorage.setItem(e,t),md.setItem(e,t,31556952e3)}}}var Gg="visitorId";function qE(){let e=document.referrer;return e===""?null:e}function gd(){let e=ME();return{runtime:"browser",send:function(){var _ref11=_asyncToGenerator(function*(t,r,n){let o=w(t,{method:"POST",body:JSON.stringify([n]),keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});qg().sendMessage({kind:"EVENT_PROTOCOL",event:n,url:t,token:r});let a=yield o;if(a?.ok){let s;try{s=yield a.json()}catch{return}for(let c of s.events)if(!c.accepted)throw new Error(`Received event was rejected for processing: ${c.errorMessage}`)}else throw new Error(`Error ${a.status}: Failed to send the event(s).`)});return function send(_x20,_x21,_x22){return _ref11.apply(this,arguments)}}(),getReferrer:()=>qE(),getLocation:()=>window.location.href,getUserAgent:()=>navigator.userAgent,getClientId:()=>{let t=e.getItem(Gg);if(t&&cd(t))return t;let r=fd();return e.setItem(Gg,r),r}}}function jE(){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 LE(){return{runtime:"null",send:()=>Promise.resolve(void 0),getReferrer:()=>null,getLocation:()=>null,getUserAgent:()=>null,getClientId:()=>""}}function VE(e){let t=e.get().mode!=="disabled",r=e.get().environment,n=LE();return t&&r?{...r,runtime:"custom"}:t&&UE()&&jE()?gd():n}function UE(){try{return typeof window=="object"}catch{return!1}}function BE(e){return{get:()=>Object.freeze(VE(e))}}function Wg(e){let t=FE(e),r=NE(),n=BE(t);return{emit:function(){var _ref12=_asyncToGenerator(function*(o,i){let a=t.get(),s=n.get(),c=OE(o,i,a,s);return EE({config:a,environment:s,event:c,listenerManager:r})});return function emit(_x23,_x24){return _ref12.apply(this,arguments)}}(),getMeta:o=>zg(o,t.get(),n.get()),on:(o,i)=>r.add({type:o,callback:i}),off:(o,i)=>r.remove(o,i),updateConfig:o=>t.update(o),version:Qg}}m();d();p();f();function Kg(){return typeof window<"u"&&typeof document<"u"}var Di=Be(e=>e.configuration.organizationId,e=>e.configuration.environment,e=>e.configuration.accessToken,e=>e.configuration.analytics,e=>ao(e.configuration.analytics),(e,t)=>t,(e,t,r,{trackingId:n,apiBaseUrl:o,enabled:i},a,s)=>{let c=GE(s);return Wg({mode:i?"emit":"disabled",url:o??Ia(e,t),token:r,trackingId:n??null,source:a,environment:c})}),$E={getClientId:()=>"",getLocation:()=>null,getReferrer:()=>null,getUserAgent:()=>null,send:function(){var _ref13=_asyncToGenerator(function*(){});return function send(){return _ref13.apply(this,arguments)}}()},GE=e=>{if(!e)return;let t=e();return{...(Kg()?gd():$E),getClientId:()=>t.clientId,getLocation:()=>t.location,getReferrer:()=>t.referrer,getUserAgent:()=>t.userAgent}};m();d();p();f();var Mi=class extends lr{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},Yg=({logger:e,getState:t,analyticsClientMiddleware:r=(i,a)=>a,preprocessRequest:n,provider:o=new Mi(t)})=>{let i=t(),a=i.configuration.accessToken,s=i.configuration.analytics.apiBaseUrl??Je(i.configuration.organizationId,i.configuration.environment,"analytics"),c=i.configuration.analytics.runtimeEnvironment,u=i.configuration.analytics.enabled,h=new Rs({enableAnalytics:u,token:a,endpoint:s,runtimeEnvironment:c,preprocessRequest:Oi(e,n),beforeSendHooks:[Pi(e,r),(S,v)=>(e.info({...v,type:S,endpoint:s,token:a},"Analytics request"),v)]},o);return u||h.disable(),h};m();d();p();f();m();d();p();f();function Xg(e,t){return{...new Rr(t).getBaseMetadata(),actionCause:e,type:e}}function QE(e){return Object.assign(e,{instantlyCallable:!0})}function HE(e,t){let r=i=>{let a=Ee(e,i);return QE(Object.assign(a,{type:a.typePrefix}))},n=r(/*#__PURE__*/function(){var _ref14=_asyncToGenerator(function*(i,{getState:a,extra:s}){let{analyticsClientMiddleware:c,preprocessRequest:u,logger:h}=s;return yield(yield t({getState:a,analyticsClientMiddleware:c,preprocessRequest:u,logger:h})).log({state:a(),extra:s})});return function(_x25,_x26){return _ref14.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref15=_asyncToGenerator(function*({getState:i,analyticsClientMiddleware:a,preprocessRequest:s,logger:c}){let{description:u,log:h}=yield t({getState:i,analyticsClientMiddleware:a,preprocessRequest:s,logger:c});return{description:u,action:r(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(S,{getState:v,extra:g}){return yield h({state:v(),extra:g})});return function(_x28,_x29){return _ref16.apply(this,arguments)}}())}});return function prepare(_x27){return _ref15.apply(this,arguments)}}()}),n}var Jg=(e,t,r)=>{function n(...o){let i=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return KE(i)}return n},zE=e=>e.configuration.analytics.analyticsMode==="legacy",WE=e=>e.configuration.analytics.analyticsMode==="next",KE=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:i,providerClass:a})=>(r??(r=s=>new a(s)),HE(e,/*#__PURE__*/function(){var _ref17=_asyncToGenerator(function*({getState:s,analyticsClientMiddleware:c,preprocessRequest:u,logger:h}){let S=[],v={log:function(){var _ref18=_asyncToGenerator(function*({state:E}){for(let _ of S)yield _(E)});return function log(_x31){return _ref18.apply(this,arguments)}}()},g=s(),y=i({getState:s,logger:h,analyticsClientMiddleware:c,preprocessRequest:u,provider:r(s)}),x=yield t(y,s());v.description=x?.description,S.push(/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(E){zE(E)&&(yield YE(x,r,E,h,y.coveoAnalyticsClient))});return function(_x32){return _ref19.apply(this,arguments)}}());let{emit:C}=Di(g);return S.push(/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(E){if(WE(E)&&o&&n){let _=n(E);yield nR(C,o,_)}});return function(_x33){return _ref20.apply(this,arguments)}}()),v});return function(_x30){return _ref17.apply(this,arguments)}}()));function YE(_x34,_x35,_x36,_x37,_x38){return _YE.apply(this,arguments)}function _YE(){_YE=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let i=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:i},"Analytics response")});return _YE.apply(this,arguments)}var XE=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref21=_asyncToGenerator(function*(i){r(n,o)});return function log(_x39){return _ref21.apply(this,arguments)}}()}),mt=Jg(e=>Mg({...e,provider:e.provider||new Rr(e.getState)}),e=>e,Rr),o2=Jg(Yg,XE("caseAssist"),Mi);var hd=(e,t)=>{let r=t.recommendation?.recommendations.findIndex(({uniqueId:n})=>e.uniqueId===n)||0;return JE(e,r,t)};function JE(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:tR(e),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:rR(e),queryPipeline:r.pipeline||ro()}}var Ds=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||""}),Zg={urihash:new z,sourcetype:new z,permanentid:new z},eh={uniqueId:J,raw:new re({values:Zg}),title:J,uri:J,clickUri:J,rankingModifier:new z({required:!1,emptyAllowed:!0})};function ZE(e){return Object.assign({},...Object.keys(Zg).map(t=>({[t]:e[t]})))}function eR(e){return Object.assign({},...Object.keys(eh).map(t=>({[t]:e[t]})),{raw:ZE(e.raw)})}function tR(e){let t=e.raw.author;return se(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function rR(e){let t=e.raw.source;return se(t)?"unknown":t}var yd=e=>new gt(eh).validate(eR(e));function nR(_x40,_x41,_x42){return _nR.apply(this,arguments)}function _nR(){_nR=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _nR.apply(this,arguments)}m();d();p();f();var th=()=>mt("analytics/recommendation/update",e=>e.makeRecommendationInterfaceLoad(),e=>new Fi(e)),rh=()=>({actionCause:"recommendationInterfaceLoad"}),qs=e=>mt({prefix:"analytics/recommendation/open",__legacy__getBuilder:(t,r)=>(yd(e),t.makeRecommendationOpen(hd(e,r),Ds(e))),__legacy__provider:t=>new Fi(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=hd(e,t),n=Ds(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}});var mo=N("recommendation/set",e=>$(e,{id:J})),Ir=Ee("recommendation/get",/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n}}){let o=t(),i=Date.now(),a=yield oR(o),s=yield n.recommendations(a),c=Date.now()-i;return ht(s)?r(s.error):{recommendations:s.success.results,analyticsAction:th(),duration:c,searchUid:s.success.searchUid,splitTestRun:s.success.splitTestRun,pipeline:s.success.pipeline}});return function(_x43,_x44){return _ref22.apply(this,arguments)}}()),oR=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??vr(e.configuration.organizationId,e.configuration.environment),recommendation:e.recommendation.id,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,locale:e.configuration.search.locale,actionsHistory:e.configuration.analytics.enabled?Rt.getInstance().getHistory():[],...(e.advancedSearchQueries&&{aq:e.advancedSearchQueries.aq,cq:e.advancedSearchQueries.cq}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.context&&{context:e.context.contextValues}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.configuration.analytics.enabled&&(yield iR(e,rh()))),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")}),...(e.pagination&&{numberOfResults:e.pagination.numberOfResults})}});return function oR(_x45){return _ref23.apply(this,arguments)}}(),iR=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=e.configuration.analytics.analyticsMode==="legacy"?void 0:{actionCause:t.actionCause,type:t.actionCause};return yield Fs(e.configuration.analytics,r)});return function iR(_x46,_x47){return _ref24.apply(this,arguments)}}();var go=Le(po(),e=>{e.addCase(mo,(t,r)=>{t.id=r.payload.id}).addCase(Ir.rejected,(t,r)=>{t.error=r.payload?r.payload:null,t.isLoading=!1}).addCase(Ir.fulfilled,(t,r)=>{t.error=null,t.recommendations=r.payload.recommendations.map(n=>({...n,searchUid:r.payload.searchUid})),t.duration=r.payload.duration,t.isLoading=!1,t.searchUid=r.payload.searchUid,t.splitTestRun=r.payload.splitTestRun,t.pipeline=r.payload.pipeline}).addCase(Ir.pending,t=>{t.isLoading=!0}).addCase(ls,(t,r)=>{t.error=r.payload,t.isLoading=!1})});m();d();p();f();var ho=N("searchHub/set",e=>$(e,new z({required:!0,emptyAllowed:!0})));m();d();p();f();var yo=Le(fo(),e=>{e.addCase(ho,(t,r)=>r.payload).addCase(yt.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Ht,(t,r)=>r.payload.searchHub||t)});m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();var nh=class extends Error{constructor(t){super(t[0].message);Ae(this,"issues");this.name="SchemaError",this.issues=t}};var fr="uninitialized",bd="pending",ji="fulfilled",Li="rejected";function oh(e){return{status:e,isUninitialized:e===fr,isLoading:e===bd,isSuccess:e===ji,isError:e===Li}}var ih=Gt;function vh(e,t){if(e===t||!(ih(e)&&ih(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,i=Array.isArray(t)?[]:{};for(let a of r)i[a]=vh(e[a],t[a]),o&&(o=e[a]===i[a]);return o?e:i}function wd(e,t,r){return e.reduce((n,o,i)=>(t(o,i)&&n.push(r(o,i)),n),[]).flat()}function aR(e){return new RegExp("(^|:)//").test(e)}function sR(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Ed(e){return e!=null}function ah(e){return[...(e?.values()??[])].filter(Ed)}function cR(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var uR=e=>e.replace(/\/$/,""),lR=e=>e.replace(/^\//,"");function dR(e,t){if(!e)return t;if(!t)return e;if(aR(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=uR(e),t=lR(t),`${e}${r}${t}`}function Vs(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var Ad=()=>new Map,fR=e=>{let t=new l.AbortController;return setTimeout(()=>{let r="signal timed out",n="TimeoutError";t.abort(typeof DOMException<"u"?new DOMException(r,n):Object.assign(new Error(r),{name:n}))},e),t.signal},pR=(...e)=>{for(let r of e)if(r.aborted)return l.AbortSignal.abort(r.reason);let t=new l.AbortController;for(let r of e)r.addEventListener("abort",()=>t.abort(r.reason),{signal:t.signal,once:!0});return t.signal},sh=(...e)=>w(...e),mR=e=>e.status>=200&&e.status<=299,gR=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function ch(e){if(!Gt(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}var hR=e=>typeof e=="object"&&(Gt(e)||Array.isArray(e)||typeof e.toJSON=="function");function bh({baseUrl:e,prepareHeaders:t=S=>S,fetchFn:r=sh,paramsSerializer:n,isJsonContentType:o=gR,jsonContentType:i="application/json",jsonReplacer:a,timeout:s,responseHandler:c,validateStatus:u,...h}={}){return typeof w>"u"&&r===sh&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(v,g,y){let{getState:x,extra:C,endpoint:E,forced:_,type:I}=g,k,{url:T,headers:D=new A(h.headers),params:B=void 0,responseHandler:L=c??"json",validateStatus:j=u??mR,timeout:U=s,...q}=typeof v=="string"?{url:v}:v,O={...h,signal:U?pR(g.signal,fR(U)):g.signal,...q};D=new A(ch(D)),O.headers=(yield t(D,{getState:x,arg:v,extra:C,endpoint:E,forced:_,type:I,extraOptions:y}))||D;let P=hR(O.body);if(O.body!=null&&!P&&typeof O.body!="string"&&O.headers.delete("content-type"),!O.headers.has("content-type")&&P&&O.headers.set("content-type",i),P&&o(O.headers)&&(O.body=JSON.stringify(O.body,a)),O.headers.has("accept")||(L==="json"?O.headers.set("accept","application/json"):L==="text"&&O.headers.set("accept","text/plain, text/html, */*")),B){let ee=~T.indexOf("?")?"&":"?",ae=n?n(B):new URLSearchParams(ch(B));T+=ee+ae}T=dR(e,T);let F=new Request(T,O);k={request:new Request(T,O)};let Q;try{Q=yield r(F)}catch(ee){return{error:{status:(ee instanceof Error||typeof DOMException<"u"&&ee instanceof DOMException)&&ee.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ee)},meta:k}}let X=Q.clone();k.response=X;let Y,W="";try{let ee;if(yield Promise.all([S(Q,L).then(ae=>Y=ae,ae=>ee=ae),X.text().then(ae=>W=ae,()=>{})]),ee)throw ee}catch(ee){return{error:{status:"PARSING_ERROR",originalStatus:Q.status,data:W,error:String(ee)},meta:k}}return j(Q,Y)?{data:Y,meta:k}:{error:{status:Q.status,data:Y},meta:k}});return function(_x48,_x49,_x50){return _ref25.apply(this,arguments)}}());function S(_x51,_x52){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 y=yield v.text();return y.length?JSON.parse(y):null}return v.text()});return _S2.apply(this,arguments)}}var So=class{constructor(e,t=void 0){this.value=e,this.meta=t}};function yR(){return _yR.apply(this,arguments)}function _yR(){_yR=_asyncToGenerator(function*(e=0,t=5,r){let n=Math.min(e,t),o=~~((Math.random()+.4)*(300<<n));yield new Promise((i,a)=>{let s=setTimeout(()=>i(),o);if(r){let c=()=>{clearTimeout(s),a(new Error("Aborted"))};r.aborted?(clearTimeout(s),a(new Error("Aborted"))):r.addEventListener("abort",c,{once:!0})}})});return _yR.apply(this,arguments)}function wh(e,t){throw Object.assign(new So({error:e,meta:t}),{throwImmediately:!0})}function Sd(e){e.aborted&&wh({status:"CUSTOM_ERROR",error:"Aborted"})}var uh={},SR=(e,t)=>(/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(r,n,o){let i=[5,(t||uh).maxRetries,(o||uh).maxRetries].filter(h=>h!==void 0),[a]=i.slice(-1),c={maxRetries:a,backoff:yR,retryCondition:(h,S,{attempt:v})=>v<=a,...t,...o},u=0;for(;;){Sd(n.signal);try{let h=yield e(r,n,o);if(h.error)throw new So(h);return h}catch(h){if(u++,h.throwImmediately){if(h instanceof So)return h.value;throw h}if(h instanceof So){if(!c.retryCondition(h.value.error,r,{attempt:u,baseQueryApi:n,extraOptions:o}))return h.value}else if(u>c.maxRetries)return{error:h};Sd(n.signal);try{yield c.backoff(u,c.maxRetries,n.signal)}catch(S){throw Sd(n.signal),S}}}});return function(_x53,_x54,_x55){return _ref26.apply(this,arguments)}}()),Ah=Object.assign(SR,{fail:wh}),Bs="__rtkq/",vR="online",bR="offline";var xh="focused";var Rd=N(`${Bs}${xh}`),Ch=N(`${Bs}un${xh}`),Id=N(`${Bs}${vR}`),Eh=N(`${Bs}${bR}`);var Bi="query",Rh="mutation",Ih="infinitequery";function $s(e){return e.type===Bi}function wR(e){return e.type===Rh}function Gs(e){return e.type===Ih}function Us(e){return $s(e)||Gs(e)}function Td(e,t,r,n,o,i){let a=AR(e)?e(t,r,n,o):e;return a?wd(a,Ed,s=>i(Th(s))):[]}function AR(e){return typeof e=="function"}function Th(e){return typeof e=="string"?{type:e}:e}function xR(e,t){return e.catch(t)}var vo=(e,t)=>e.endpointDefinitions[t],Vi=Symbol("forceQueryFn"),xd=e=>typeof e[Vi]=="function";function CR({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:i,getInternalState:a}){let s=T=>a(T)?.runningQueries,c=T=>a(T)?.runningMutations,{unsubscribeQueryResult:u,removeMutationResult:h,updateSubscriptionOptions:S}=o.internalActions;return{buildInitiateQuery:_,buildInitiateInfiniteQuery:I,buildInitiateMutation:k,getRunningQueryThunk:v,getRunningMutationThunk:g,getRunningQueriesThunk:y,getRunningMutationsThunk:x};function v(T,D){return B=>{let L=vo(i,T),j=e({queryArgs:D,endpointDefinition:L,endpointName:T});return s(B)?.get(j)}}function g(T,D){return B=>c(B)?.get(D)}function y(){return T=>ah(s(T))}function x(){return T=>ah(c(T))}function C(T){}function E(T,D){let B=(L,{subscribe:j=!0,forceRefetch:U,subscriptionOptions:q,[Vi]:O,...P}={})=>(F,H)=>{let Q=e({queryArgs:L,endpointDefinition:D,endpointName:T}),X,Y={...P,type:Bi,subscribe:j,forceRefetch:U,subscriptionOptions:q,endpointName:T,originalArgs:L,queryCacheKey:Q,[Vi]:O};if($s(D))X=t(Y);else{let{direction:de,initialPageParam:ye,refetchCachedPages:me}=P;X=r({...Y,direction:de,initialPageParam:ye,refetchCachedPages:me})}let W=o.endpoints[T].select(L),ee=F(X),ae=W(H());let{requestId:xe,abort:Me}=ee,_e=ae.requestId!==xe,Pe=s(F)?.get(Q),Ne=()=>W(H()),pe=Object.assign(O?ee.then(Ne):_e&&!Pe?Promise.resolve(ae):Promise.all([Pe,ee]).then(Ne),{arg:L,requestId:xe,subscriptionOptions:q,queryCacheKey:Q,abort:Me,unwrap(){return _asyncToGenerator(function*(){let de=yield pe;if(de.isError)throw de.error;return de.data})()},refetch:de=>F(B(L,{subscribe:!1,forceRefetch:!0,...de})),unsubscribe(){j&&F(u({queryCacheKey:Q,requestId:xe}))},updateSubscriptionOptions(de){pe.subscriptionOptions=de,F(S({endpointName:T,requestId:xe,queryCacheKey:Q,options:de}))}});if(!Pe&&!_e&&!O){let de=s(F);de.set(Q,pe),pe.then(()=>{de.delete(Q)})}return pe};return B}function _(T,D){return E(T,D)}function I(T,D){return E(T,D)}function k(T){return(D,{track:B=!0,fixedCacheKey:L}={})=>(j,U)=>{let q=n({type:"mutation",endpointName:T,originalArgs:D,track:B,fixedCacheKey:L}),O=j(q);let{requestId:P,abort:F,unwrap:H}=O,Q=xR(O.unwrap().then(ee=>({data:ee})),ee=>({error:ee})),X=()=>{j(h({requestId:P,fixedCacheKey:L}))},Y=Object.assign(Q,{arg:O.arg,requestId:P,abort:F,unwrap:H,reset:X}),W=c(j);return W.set(P,Y),Y.then(()=>{W.delete(P)}),L&&(W.set(L,Y),Y.then(()=>{W.get(L)===Y&&W.delete(L)})),Y}}}var _h=class extends nh{constructor(e,t,r,n){super(e),this.value=t,this.schemaName=r,this._bqMeta=n}},un=(e,t)=>Array.isArray(e)?e.includes(t):!!e;function ln(_x56,_x57,_x58,_x59){return _ln.apply(this,arguments)}function _ln(){_ln=_asyncToGenerator(function*(e,t,r,n){let o=yield e["~standard"].validate(t);if(o.issues)throw new _h(o.issues,t,r,n);return o.value});return _ln.apply(this,arguments)}function lh(e){return e}var qi=(e={})=>({...e,[Ci]:!0});function ER({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:i,selectors:a,onSchemaFailure:s,catchSchemaFailure:c,skipSchemaValidation:u}){let h=(q,O,P,F)=>(H,Q)=>{let X=r[q],Y=n({queryArgs:O,endpointDefinition:X,endpointName:q});if(H(o.internalActions.queryResultPatched({queryCacheKey:Y,patches:P})),!F)return;let W=o.endpoints[q].select(O)(Q()),ee=Td(X.providesTags,W.data,void 0,O,{},i);H(o.internalActions.updateProvidedBy([{queryCacheKey:Y,providedTags:ee}]))};function S(q,O,P=0){let F=[O,...q];return P&&F.length>P?F.slice(0,-1):F}function v(q,O,P=0){let F=[...q,O];return P&&F.length>P?F.slice(1):F}let g=(q,O,P,F=!0)=>(H,Q)=>{let Y=o.endpoints[q].select(O)(Q()),W={patches:[],inversePatches:[],undo:()=>H(o.util.patchQueryData(q,O,W.inversePatches,F))};if(Y.status===fr)return W;let ee;if("data"in Y)if(ft(Y.data)){let[ae,xe,Me]=Cl(Y.data,P);W.patches.push(...xe),W.inversePatches.push(...Me),ee=ae}else ee=P(Y.data),W.patches.push({op:"replace",path:[],value:ee}),W.inversePatches.push({op:"replace",path:[],value:Y.data});return W.patches.length===0||H(o.util.patchQueryData(q,O,W.patches,F)),W},y=(q,O,P)=>F=>F(o.endpoints[q].initiate(O,{subscribe:!1,forceRefetch:!0,[Vi]:()=>({data:P})})),x=(q,O)=>q.query&&q[O]?q[O]:lh,C=/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(q,{signal:O,abort:P,rejectWithValue:F,fulfillWithValue:H,dispatch:Q,getState:X,extra:Y}){let W=r[q.endpointName],{metaSchema:ee,skipSchemaValidation:ae=u}=W,xe=q.type===Bi;try{let Me=lh,_e={signal:O,abort:P,dispatch:Q,getState:X,extra:Y,endpoint:q.endpointName,type:q.type,forced:xe?E(q,X()):void 0,queryCacheKey:xe?q.queryCacheKey:void 0},Pe=xe?q[Vi]:void 0,Ne,pe=/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(ye,me,Ge,He){if(me==null&&ye.pages.length)return Promise.resolve({data:ye});let Nt={queryArg:q.originalArgs,pageParam:me},wt=yield de(Nt),Ut=He?S:v;return{data:{pages:Ut(ye.pages,wt.data,Ge),pageParams:Ut(ye.pageParams,me,Ge)},meta:wt.meta}});return function pe(_x62,_x63,_x64,_x65){return _ref28.apply(this,arguments)}}();function de(_x66){return _de2.apply(this,arguments)}function _de2(){_de2=_asyncToGenerator(function*(ye){let me,{extraOptions:Ge,argSchema:He,rawResponseSchema:Nt,responseSchema:wt}=W;if(He&&!un(ae,"arg")&&(ye=yield ln(He,ye,"argSchema",{})),Pe?me=Pe():W.query?(Me=x(W,"transformResponse"),me=yield t(W.query(ye),_e,Ge)):me=yield W.queryFn(ye,_e,Ge,Ft=>t(Ft,_e,Ge)),typeof process<"u",me.error)throw new So(me.error,me.meta);let{data:Ut}=me;Nt&&!un(ae,"rawResponse")&&(Ut=yield ln(Nt,me.data,"rawResponseSchema",me.meta));let Ct=yield Me(Ut,me.meta,ye);return wt&&!un(ae,"response")&&(Ct=yield ln(wt,Ct,"responseSchema",me.meta)),{...me,data:Ct}});return _de2.apply(this,arguments)}if(xe&&"infiniteQueryOptions"in W){let{infiniteQueryOptions:ye}=W,{maxPages:me=1/0}=ye,Ge=q.refetchCachedPages??ye.refetchCachedPages??!0,He,Nt={pages:[],pageParams:[]},wt=a.selectQueryEntry(X(),q.queryCacheKey)?.data,Ct=E(q,X())&&!q.direction||!wt?Nt:wt;if("direction"in q&&q.direction&&Ct.pages.length){let Ft=q.direction==="backward",Sa=(Ft?kh:Cd)(ye,Ct,q.originalArgs);He=yield pe(Ct,Sa,me,Ft)}else{let{initialPageParam:Ft=ye.initialPageParam}=q,Xo=wt?.pageParams??[],Sa=Xo[0]??Ft,ew=Xo.length;if(He=yield pe(Ct,Sa,me),Pe&&(He={data:He.data.pages[0]}),Ge)for(let ap=1;ap<ew;ap++){let tw=Cd(ye,He.data,q.originalArgs);He=yield pe(He.data,tw,me)}}Ne=He}else Ne=yield de(q.originalArgs);return ee&&!un(ae,"meta")&&Ne.meta&&(Ne.meta=yield ln(ee,Ne.meta,"metaSchema",Ne.meta)),H(Ne.data,qi({fulfilledTimeStamp:Date.now(),baseQueryMeta:Ne.meta}))}catch(Me){let _e=Me;if(_e instanceof So){let Pe=x(W,"transformErrorResponse"),{rawErrorResponseSchema:Ne,errorResponseSchema:pe}=W,{value:de,meta:ye}=_e;try{Ne&&!un(ae,"rawErrorResponse")&&(de=yield ln(Ne,de,"rawErrorResponseSchema",ye)),ee&&!un(ae,"meta")&&(ye=yield ln(ee,ye,"metaSchema",ye));let me=yield Pe(de,ye,q.originalArgs);return pe&&!un(ae,"errorResponse")&&(me=yield ln(pe,me,"errorResponseSchema",ye)),F(me,qi({baseQueryMeta:ye}))}catch(me){_e=me}}try{if(_e instanceof _h){let Pe={endpoint:q.endpointName,arg:q.originalArgs,type:q.type,queryCacheKey:xe?q.queryCacheKey:void 0};W.onSchemaFailure?.(_e,Pe),s?.(_e,Pe);let{catchSchemaFailure:Ne=c}=W;if(Ne)return F(Ne(_e,Pe),qi({baseQueryMeta:_e._bqMeta}))}}catch(Pe){_e=Pe}throw typeof process<"u",console.error(_e),_e}});return function C(_x60,_x61){return _ref27.apply(this,arguments)}}();function E(q,O){let P=a.selectQueryEntry(O,q.queryCacheKey),F=a.selectConfig(O).refetchOnMountOrArgChange,H=P?.fulfilledTimeStamp,Q=q.forceRefetch??(q.subscribe&&F);return Q?Q===!0||(Number(new Date)-Number(H))/1e3>=Q:!1}let _=()=>Ee(`${e}/executeQuery`,C,{getPendingMeta({arg:O}){let P=r[O.endpointName];return qi({startedTimeStamp:Date.now(),...(Gs(P)?{direction:O.direction}:{})})},condition(O,{getState:P}){let F=P(),H=a.selectQueryEntry(F,O.queryCacheKey),Q=H?.fulfilledTimeStamp,X=O.originalArgs,Y=H?.originalArgs,W=r[O.endpointName],ee=O.direction;return xd(O)?!0:H?.status==="pending"?!1:E(O,F)||$s(W)&&W?.forceRefetch?.({currentArg:X,previousArg:Y,endpointState:H,state:F})?!0:!(Q&&!ee)},dispatchConditionRejection:!0}),I=_(),k=_(),T=Ee(`${e}/executeMutation`,C,{getPendingMeta(){return qi({startedTimeStamp:Date.now()})}}),D=q=>"force"in q,B=q=>"ifOlderThan"in q,L=(q,O,P={})=>(F,H)=>{let Q=D(P)&&P.force,X=B(P)&&P.ifOlderThan,Y=(ee=!0)=>{let ae={forceRefetch:ee,subscribe:!1};return o.endpoints[q].initiate(O,ae)},W=o.endpoints[q].select(O)(H());if(Q)F(Y());else if(X){let ee=W?.fulfilledTimeStamp;if(!ee){F(Y());return}(Number(new Date)-Number(new Date(ee)))/1e3>=X&&F(Y())}else F(Y(!1))};function j(q){return O=>O?.meta?.arg?.endpointName===q}function U(q,O){return{matchPending:Kn(Za(q),j(O)),matchFulfilled:Kn(ar(q),j(O)),matchRejected:Kn(nn(q),j(O))}}return{queryThunk:I,mutationThunk:T,infiniteQueryThunk:k,prefetch:L,updateQueryData:g,upsertQueryData:y,patchQueryData:h,buildMatchThunkActions:U}}function Cd(e,{pages:t,pageParams:r},n){let o=t.length-1;return e.getNextPageParam(t[o],t,r[o],r,n)}function kh(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function Oh(e,t,r,n){return Td(r[e.meta.arg.endpointName][t],ar(e)?e.payload:void 0,Ri(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function dh(e){return dt(e)?Ha(e):e}function js(e,t,r){let n=e[t];n&&r(n)}function Ui(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function fh(e,t,r){let n=e[Ui(t)];n&&r(n)}var Ls={};function RR({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:i,extractRehydrationInfo:a,hasRehydrationInfo:s},assertTagType:c,config:u}){let h=N(`${e}/resetApiState`);function S(j,U,q,O){var P;j[P=U.queryCacheKey]??(j[P]={status:fr,endpointName:U.endpointName}),js(j,U.queryCacheKey,F=>{F.status=bd,F.requestId=q&&F.requestId?F.requestId:O.requestId,U.originalArgs!==void 0&&(F.originalArgs=U.originalArgs),F.startedTimeStamp=O.startedTimeStamp;let H=o[O.arg.endpointName];Gs(H)&&"direction"in U&&(F.direction=U.direction)})}function v(j,U,q,O){js(j,U.arg.queryCacheKey,P=>{if(P.requestId!==U.requestId&&!O)return;let{merge:F}=o[U.arg.endpointName];if(P.status=ji,F){if(P.data!==void 0){let{fulfilledTimeStamp:H,arg:Q,baseQueryMeta:X,requestId:Y}=U,W=tn(P.data,ee=>F(ee,q,{arg:Q.originalArgs,baseQueryMeta:X,fulfilledTimeStamp:H,requestId:Y}));P.data=W}else P.data=q;}else P.data=o[U.arg.endpointName].structuralSharing??!0?vh(dt(P.data)?om(P.data):P.data,q):q;delete P.error,P.fulfilledTimeStamp=U.fulfilledTimeStamp})}let g=on({name:`${e}/queries`,initialState:Ls,reducers:{removeQueryResult:{reducer(j,{payload:{queryCacheKey:U}}){delete j[U]},prepare:Yn()},cacheEntriesUpserted:{reducer(j,U){for(let q of U.payload){let{queryDescription:O,value:P}=q;S(j,O,!0,{arg:O,requestId:U.meta.requestId,startedTimeStamp:U.meta.timestamp}),v(j,{arg:O,requestId:U.meta.requestId,fulfilledTimeStamp:U.meta.timestamp,baseQueryMeta:{}},P,!0)}},prepare:j=>({payload:j.map(O=>{let{endpointName:P,arg:F,value:H}=O,Q=o[P];return{queryDescription:{type:Bi,endpointName:P,originalArgs:O.arg,queryCacheKey:n({queryArgs:F,endpointDefinition:Q,endpointName:P})},value:H}}),meta:{[Ci]:!0,requestId:Ii(),timestamp:Date.now()}})},queryResultPatched:{reducer(j,{payload:{queryCacheKey:U,patches:q}}){js(j,U,O=>{O.data=El(O.data,q.concat())})},prepare:Yn()}},extraReducers(j){j.addCase(t.pending,(U,{meta:q,meta:{arg:O}})=>{let P=xd(O);S(U,O,P,q)}).addCase(t.fulfilled,(U,{meta:q,payload:O})=>{let P=xd(q.arg);v(U,q,O,P)}).addCase(t.rejected,(U,{meta:{condition:q,arg:O,requestId:P},error:F,payload:H})=>{js(U,O.queryCacheKey,Q=>{if(!q){if(Q.requestId!==P)return;Q.status=Li,Q.error=H??F}})}).addMatcher(s,(U,q)=>{let{queries:O}=a(q);for(let[P,F]of Object.entries(O))(F?.status===ji||F?.status===Li)&&(U[P]=F)})}}),y=on({name:`${e}/mutations`,initialState:Ls,reducers:{removeMutationResult:{reducer(j,{payload:U}){let q=Ui(U);q in j&&delete j[q]},prepare:Yn()}},extraReducers(j){j.addCase(r.pending,(U,{meta:q,meta:{requestId:O,arg:P,startedTimeStamp:F}})=>{P.track&&(U[Ui(q)]={requestId:O,status:bd,endpointName:P.endpointName,startedTimeStamp:F})}).addCase(r.fulfilled,(U,{payload:q,meta:O})=>{O.arg.track&&fh(U,O,P=>{P.requestId===O.requestId&&(P.status=ji,P.data=q,P.fulfilledTimeStamp=O.fulfilledTimeStamp)})}).addCase(r.rejected,(U,{payload:q,error:O,meta:P})=>{P.arg.track&&fh(U,P,F=>{F.requestId===P.requestId&&(F.status=Li,F.error=q??O)})}).addMatcher(s,(U,q)=>{let{mutations:O}=a(q);for(let[P,F]of Object.entries(O))(F?.status===ji||F?.status===Li)&&P!==F?.requestId&&(U[P]=F)})}}),x={tags:{},keys:{}},C=on({name:`${e}/invalidation`,initialState:x,reducers:{updateProvidedBy:{reducer(j,U){var q,O,P;for(let{queryCacheKey:F,providedTags:H}of U.payload){E(j,F);for(let{type:Q,id:X}of H){let Y=(O=(q=j.tags)[Q]??(q[Q]={}))[P=X||"__internal_without_id"]??(O[P]=[]);Y.includes(F)||Y.push(F)}j.keys[F]=H}},prepare:Yn()}},extraReducers(j){j.addCase(g.actions.removeQueryResult,(U,{payload:{queryCacheKey:q}})=>{E(U,q)}).addMatcher(s,(U,q)=>{var P,F,H;let{provided:O}=a(q);for(let[Q,X]of Object.entries(O.tags??{}))for(let[Y,W]of Object.entries(X)){let ee=(F=(P=U.tags)[Q]??(P[Q]={}))[H=Y||"__internal_without_id"]??(F[H]=[]);for(let ae of W)ee.includes(ae)||ee.push(ae),U.keys[ae]=O.keys[ae]}}).addMatcher(Qt(ar(t),Ri(t)),(U,q)=>{_(U,[q])}).addMatcher(g.actions.cacheEntriesUpserted.match,(U,q)=>{let O=q.payload.map(({queryDescription:P,value:F})=>({type:"UNKNOWN",payload:F,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:P}}));_(U,O)})}});function E(j,U){let q=dh(j.keys[U]??[]);for(let O of q){let P=O.type,F=O.id??"__internal_without_id",H=j.tags[P]?.[F];H&&(j.tags[P][F]=dh(H).filter(Q=>Q!==U))}delete j.keys[U]}function _(j,U){let q=U.map(O=>{let P=Oh(O,"providesTags",o,c),{queryCacheKey:F}=O.meta.arg;return{queryCacheKey:F,providedTags:P}});C.caseReducers.updateProvidedBy(j,C.actions.updateProvidedBy(q))}let I=on({name:`${e}/subscriptions`,initialState:Ls,reducers:{updateSubscriptionOptions(j,U){},unsubscribeQueryResult(j,U){},internal_getRTKQSubscriptions(){}}}),k=on({name:`${e}/internalSubscriptions`,initialState:Ls,reducers:{subscriptionsUpdated:{reducer(j,U){return El(j,U.payload)},prepare:Yn()}}}),T=on({name:`${e}/config`,initialState:{online:cR(),focused:sR(),middlewareRegistered:!1,...u},reducers:{middlewareRegistered(j,{payload:U}){j.middlewareRegistered=j.middlewareRegistered==="conflict"||i!==U?"conflict":!0}},extraReducers:j=>{j.addCase(Id,U=>{U.online=!0}).addCase(Eh,U=>{U.online=!1}).addCase(Rd,U=>{U.focused=!0}).addCase(Ch,U=>{U.focused=!1}).addMatcher(s,U=>({...U}))}}),D=Hn({queries:g.reducer,mutations:y.reducer,provided:C.reducer,subscriptions:k.reducer,config:T.reducer}),B=(j,U)=>D(h.match(U)?void 0:j,U),L={...T.actions,...g.actions,...I.actions,...k.actions,...y.actions,...C.actions,resetApiState:h};return{reducer:B,actions:L}}var vd=Symbol.for("RTKQ/skipToken"),Ph={status:fr},ph=tn(Ph,()=>{}),mh=tn(Ph,()=>{});function IR({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=I=>ph,o=I=>mh;return{buildQuerySelector:v,buildInfiniteQuerySelector:g,buildMutationSelector:y,selectInvalidatedBy:x,selectCachedArgsForQuery:C,selectApiState:a,selectQueries:s,selectMutations:u,selectQueryEntry:c,selectConfig:h};function i(I){return{...I,...oh(I.status)}}function a(I){return I[t]}function s(I){return a(I)?.queries}function c(I,k){return s(I)?.[k]}function u(I){return a(I)?.mutations}function h(I){return a(I)?.config}function S(I,k,T){return D=>{if(D===vd)return r(n,T);let B=e({queryArgs:D,endpointDefinition:k,endpointName:I});return r(j=>c(j,B)??ph,T)}}function v(I,k){return S(I,k,i)}function g(I,k){let{infiniteQueryOptions:T}=k;function D(B){let L={...B,...oh(B.status)},{isLoading:j,isError:U,direction:q}=L,O=q==="forward",P=q==="backward";return{...L,hasNextPage:E(T,L.data,L.originalArgs),hasPreviousPage:_(T,L.data,L.originalArgs),isFetchingNextPage:j&&O,isFetchingPreviousPage:j&&P,isFetchNextPageError:U&&O,isFetchPreviousPageError:U&&P}}return S(I,k,D)}function y(){return I=>{let k;return typeof I=="object"?k=Ui(I)??vd:k=I,r(k===vd?o:B=>a(B)?.mutations?.[k]??mh,i)}}function x(I,k){let T=I[t],D=new Set,B=wd(k,Ed,Th);for(let L of B){let j=T.provided.tags[L.type];if(!j)continue;let U=(L.id!==void 0?j[L.id]:Object.values(j).flat())??[];for(let q of U)D.add(q)}return Array.from(D.values()).flatMap(L=>{let j=T.queries[L];return j?{queryCacheKey:L,endpointName:j.endpointName,originalArgs:j.originalArgs}:[]})}function C(I,k){return wd(Object.values(s(I)),T=>T?.endpointName===k&&T.status!==fr,T=>T.originalArgs)}function E(I,k,T){return k?Cd(I,k,T)!=null:!1}function _(I,k,T){return!k||!I.getPreviousPageParam?!1:kh(I,k,T)!=null}}var gh=WeakMap?new WeakMap:void 0,hh=({endpointName:e,queryArgs:t})=>{let r="",n=gh?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(i,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=Gt(a)?Object.keys(a).sort().reduce((s,c)=>(s[c]=a[c],s),{}):a,a));Gt(t)&&gh?.set(t,o),r=o}return`${e}(${r})`};function TR(...e){return function(r){let n=Ai(u=>r.extractRehydrationInfo?.(u,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(u){let h=hh;if("serializeQueryArgs"in u.endpointDefinition){let S=u.endpointDefinition.serializeQueryArgs;h=v=>{let g=S(v);return typeof g=="string"?g:hh({...v,queryArgs:g})}}else r.serializeQueryArgs&&(h=r.serializeQueryArgs);return h(u)},tagTypes:[...(r.tagTypes||[])]},i={endpointDefinitions:{},batch(u){u()},apiUid:Ii(),extractRehydrationInfo:n,hasRehydrationInfo:Ai(u=>n(u)!=null)},a={injectEndpoints:c,enhanceEndpoints({addTagTypes:u,endpoints:h}){if(u)for(let S of u)o.tagTypes.includes(S)||o.tagTypes.push(S);if(h)for(let[S,v]of Object.entries(h))typeof v=="function"?v(vo(i,S)):Object.assign(vo(i,S)||{},v);return a}},s=e.map(u=>u.init(a,o,i));function c(u){let h=u.endpoints({query:S=>({...S,type:Bi}),mutation:S=>({...S,type:Rh}),infiniteQuery:S=>({...S,type:Ih})});for(let[S,v]of Object.entries(h)){if(u.overrideExisting!==!0&&S in i.endpointDefinitions){if(u.overrideExisting==="throw")throw new Error(pt(39));typeof process<"u";continue}typeof process<"u",i.endpointDefinitions[S]=v;for(let g of s)g.injectEndpoint(S,v)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function dr(e,...t){return Object.assign(e,...t)}var _R=({api:e,queryThunk:t,internalState:r,mwApi:n})=>{let o=`${e.reducerPath}/subscriptions`,i=null,a=null,{updateSubscriptionOptions:s,unsubscribeQueryResult:c}=e.internalActions,u=(x,C)=>{if(s.match(C)){let{queryCacheKey:_,requestId:I,options:k}=C.payload,T=x.get(_);return T?.has(I)&&T.set(I,k),!0}if(c.match(C)){let{queryCacheKey:_,requestId:I}=C.payload,k=x.get(_);return k&&k.delete(I),!0}if(e.internalActions.removeQueryResult.match(C))return x.delete(C.payload.queryCacheKey),!0;if(t.pending.match(C)){let{meta:{arg:_,requestId:I}}=C,k=Vs(x,_.queryCacheKey,Ad);return _.subscribe&&k.set(I,_.subscriptionOptions??k.get(I)??{}),!0}let E=!1;if(t.rejected.match(C)){let{meta:{condition:_,arg:I,requestId:k}}=C;if(_&&I.subscribe){let T=Vs(x,I.queryCacheKey,Ad);T.set(k,I.subscriptionOptions??T.get(k)??{}),E=!0}}return E},h=()=>r.currentSubscriptions,g={getSubscriptions:h,getSubscriptionCount:x=>h().get(x)?.size??0,isRequestSubscribed:(x,C)=>!!h()?.get(x)?.get(C)};function y(x){return JSON.parse(JSON.stringify(Object.fromEntries([...x].map(([C,E])=>[C,Object.fromEntries(E)]))))}return(x,C)=>{if(i||(i=y(r.currentSubscriptions)),e.util.resetApiState.match(x))return i={},r.currentSubscriptions.clear(),a=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(x))return[!1,g];let E=u(r.currentSubscriptions,x),_=!0;if(E){a||(a=setTimeout(()=>{let T=y(r.currentSubscriptions),[,D]=Cl(i,()=>T);C.next(e.internalActions.subscriptionsUpdated(D)),i=T,a=null},500));let I=typeof x.type=="string"&&!!x.type.startsWith(o),k=t.rejected.match(x)&&x.meta.condition&&!!x.meta.arg.subscribe;_=!I&&!k}return[_,!1]}},kR=2147483647/1e3-1,OR=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:i,selectConfig:a},getRunningQueryThunk:s,mwApi:c})=>{let{removeQueryResult:u,unsubscribeQueryResult:h,cacheEntriesUpserted:S}=t.internalActions,v=Qt(h.match,r.fulfilled,r.rejected,S.match);function g(I){let k=o.currentSubscriptions.get(I);return k?k.size>0:!1}let y={};function x(I){for(let k of I.values())k?.abort?.()}let C=(I,k)=>{let T=k.getState(),D=a(T);if(v(I)){let B;if(S.match(I))B=I.payload.map(L=>L.queryDescription.queryCacheKey);else{let{queryCacheKey:L}=h.match(I)?I.payload:I.meta.arg;B=[L]}E(B,k,D)}if(t.util.resetApiState.match(I)){for(let[B,L]of Object.entries(y))L&&clearTimeout(L),delete y[B];x(o.runningQueries),x(o.runningMutations)}if(n.hasRehydrationInfo(I)){let{queries:B}=n.extractRehydrationInfo(I);E(Object.keys(B),k,D)}};function E(I,k,T){let D=k.getState();for(let B of I){let L=i(D,B);L?.endpointName&&_(B,L.endpointName,k,T)}}function _(I,k,T,D){let L=vo(n,k)?.keepUnusedDataFor??D.keepUnusedDataFor;if(L===1/0)return;let j=Math.max(0,Math.min(L,kR));if(!g(I)){let U=y[I];U&&clearTimeout(U),y[I]=setTimeout(()=>{if(!g(I)){let q=i(T.getState(),I);q?.endpointName&&T.dispatch(s(q.endpointName,q.originalArgs))?.abort(),T.dispatch(u({queryCacheKey:I}))}delete y[I]},j*1e3)}}return C},yh=new Error("Promise never resolved before cacheEntryRemoved."),PR=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:i,selectors:{selectQueryEntry:a,selectApiState:s}})=>{let c=es(n),u=es(o),h=ar(n,o),S={},{removeQueryResult:v,removeMutationResult:g,cacheEntriesUpserted:y}=e.internalActions;function x(T,D,B){let L=S[T];L?.valueResolved&&(L.valueResolved({data:D,meta:B}),delete L.valueResolved)}function C(T){let D=S[T];D&&(delete S[T],D.cacheEntryRemoved())}function E(T){let{arg:D,requestId:B}=T.meta,{endpointName:L,originalArgs:j}=D;return[L,j,B]}let _=(T,D,B)=>{let L=I(T);function j(U,q,O,P){let F=a(B,q),H=a(D.getState(),q);!F&&H&&k(U,P,q,D,O)}if(n.pending.match(T)){let[U,q,O]=E(T);j(U,L,O,q)}else if(y.match(T))for(let{queryDescription:U,value:q}of T.payload){let{endpointName:O,originalArgs:P,queryCacheKey:F}=U;j(O,F,T.meta.requestId,P),x(F,q,{})}else if(o.pending.match(T)){if(D.getState()[t].mutations[L]){let[q,O,P]=E(T);k(q,O,L,D,P)}}else if(h(T))x(L,T.payload,T.meta.baseQueryMeta);else if(v.match(T)||g.match(T))C(L);else if(e.util.resetApiState.match(T))for(let U of Object.keys(S))C(U)};function I(T){return c(T)?T.meta.arg.queryCacheKey:u(T)?T.meta.arg.fixedCacheKey??T.meta.requestId:v.match(T)?T.payload.queryCacheKey:g.match(T)?Ui(T.payload):""}function k(T,D,B,L,j){let U=vo(r,T),q=U?.onCacheEntryAdded;if(!q)return;let O={},P=new Promise(W=>{O.cacheEntryRemoved=W}),F=Promise.race([new Promise(W=>{O.valueResolved=W}),P.then(()=>{throw yh})]);F.catch(()=>{}),S[B]=O;let H=e.endpoints[T].select(Us(U)?D:B),Q=L.dispatch((W,ee,ae)=>ae),X={...L,getCacheEntry:()=>H(L.getState()),requestId:j,extra:Q,updateCachedData:Us(U)?W=>L.dispatch(e.util.updateQueryData(T,D,W)):void 0,cacheDataLoaded:F,cacheEntryRemoved:P},Y=q(D,X);Promise.resolve(Y).catch(W=>{if(W!==yh)throw W})}return _},NR=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},FR=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:i,assertTagType:a,refetchQuery:s,internalState:c})=>{let{removeQueryResult:u}=i.internalActions,h=Qt(ar(n),Ri(n)),S=Qt(ar(o,n),nn(o,n)),v=[],g=0,y=(E,_)=>{(o.pending.match(E)||n.pending.match(E))&&g++,S(E)&&(g=Math.max(0,g-1)),h(E)?C(Oh(E,"invalidatesTags",r,a),_):S(E)?C([],_):i.util.invalidateTags.match(E)&&C(Td(E.payload,void 0,void 0,void 0,void 0,a),_)};function x(){return g>0}function C(E,_){let I=_.getState(),k=I[e];if(v.push(...E),k.config.invalidationBehavior==="delayed"&&x())return;let T=v;if(v=[],T.length===0)return;let D=i.util.selectInvalidatedBy(I,T);t.batch(()=>{let B=Array.from(D.values());for(let{queryCacheKey:L}of B){let j=k.queries[L],U=Vs(c.currentSubscriptions,L,Ad);j&&(U.size===0?_.dispatch(u({queryCacheKey:L})):j.status!==fr&&_.dispatch(s(j)))}})}return y},DR=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let{currentPolls:i,currentSubscriptions:a}=o,s=new Set,c=null,u=(C,E)=>{(r.internalActions.updateSubscriptionOptions.match(C)||r.internalActions.unsubscribeQueryResult.match(C))&&h(C.payload.queryCacheKey,E),(t.pending.match(C)||t.rejected.match(C)&&C.meta.condition)&&h(C.meta.arg.queryCacheKey,E),(t.fulfilled.match(C)||t.rejected.match(C)&&!C.meta.condition)&&S(C.meta.arg,E),r.util.resetApiState.match(C)&&(y(),c&&(clearTimeout(c),c=null),s.clear())};function h(C,E){s.add(C),c||(c=setTimeout(()=>{for(let _ of s)v({queryCacheKey:_},E);s.clear(),c=null},0))}function S({queryCacheKey:C},E){let _=E.getState()[e],I=_.queries[C],k=a.get(C);if(!I||I.status===fr)return;let{lowestPollingInterval:T,skipPollingIfUnfocused:D}=x(k);if(!Number.isFinite(T))return;let B=i.get(C);B?.timeout&&(clearTimeout(B.timeout),B.timeout=void 0);let L=Date.now()+T;i.set(C,{nextPollTimestamp:L,pollingInterval:T,timeout:setTimeout(()=>{(_.config.focused||!D)&&E.dispatch(n(I)),S({queryCacheKey:C},E)},T)})}function v({queryCacheKey:C},E){let I=E.getState()[e].queries[C],k=a.get(C);if(!I||I.status===fr)return;let{lowestPollingInterval:T}=x(k);if(!Number.isFinite(T)){g(C);return}let D=i.get(C),B=Date.now()+T;(!D||B<D.nextPollTimestamp)&&S({queryCacheKey:C},E)}function g(C){let E=i.get(C);E?.timeout&&clearTimeout(E.timeout),i.delete(C)}function y(){for(let C of i.keys())g(C)}function x(C=new Map){let E=!1,_=Number.POSITIVE_INFINITY;for(let I of C.values())I.pollingInterval&&(_=Math.min(I.pollingInterval,_),E=I.skipPollingIfUnfocused||E);return{lowestPollingInterval:_,skipPollingIfUnfocused:E}}return u},MR=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=Za(r,n),i=nn(r,n),a=ar(r,n),s={};return(u,h)=>{if(o(u)){let{requestId:S,arg:{endpointName:v,originalArgs:g}}=u.meta,y=vo(t,v),x=y?.onQueryStarted;if(x){let C={},E=new Promise((T,D)=>{C.resolve=T,C.reject=D});E.catch(()=>{}),s[S]=C;let _=e.endpoints[v].select(Us(y)?g:S),I=h.dispatch((T,D,B)=>B),k={...h,getCacheEntry:()=>_(h.getState()),requestId:S,extra:I,updateCachedData:Us(y)?T=>h.dispatch(e.util.updateQueryData(v,g,T)):void 0,queryFulfilled:E};x(g,k)}}else if(a(u)){let{requestId:S,baseQueryMeta:v}=u.meta;s[S]?.resolve({data:u.payload,meta:v}),delete s[S]}else if(i(u)){let{requestId:S,rejectedWithValue:v,baseQueryMeta:g}=u.meta;s[S]?.reject({error:u.payload??u.error,isUnhandledError:!v,meta:g}),delete s[S]}}},qR=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:i}=r.internalActions,a=(c,u)=>{Rd.match(c)&&s(u,"refetchOnFocus"),Id.match(c)&&s(u,"refetchOnReconnect")};function s(c,u){let h=c.getState()[e],S=h.queries,v=o.currentSubscriptions;t.batch(()=>{for(let g of v.keys()){let y=S[g],x=v.get(g);if(!x||!y)continue;let C=[...x.values()];(C.some(_=>_[u]===!0)||C.every(_=>_[u]===void 0)&&h.config[u])&&(x.size===0?c.dispatch(i({queryCacheKey:g})):y.status!==fr&&c.dispatch(n(y)))}})}return a};function jR(e){let{reducerPath:t,queryThunk:r,api:n,context:o,getInternalState:i}=e,{apiUid:a}=o,s={invalidateTags:N(`${t}/invalidateTags`)},c=v=>v.type.startsWith(`${t}/`),u=[NR,OR,FR,DR,PR,MR];return{middleware:v=>{let g=!1,y=i(v.dispatch),x={...e,internalState:y,refetchQuery:S,isThisApiSliceAction:c,mwApi:v},C=u.map(I=>I(x)),E=_R(x),_=qR(x);return I=>k=>{if(!ui(k))return I(k);g||(g=!0,v.dispatch(n.internalActions.middlewareRegistered(a)));let T={...v,next:I},D=v.getState(),[B,L]=E(k,T,D),j;if(B?j=I(k):j=L,v.getState()[t]&&(_(k,T,D),c(k)||o.hasRehydrationInfo(k)))for(let U of C)U(k,T,D);return j}},actions:s};function S(v){return e.api.endpoints[v.endpointName].initiate(v.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Sh=Symbol(),LR=({createSelector:e=Be}={})=>({name:Sh,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:i,keepUnusedDataFor:a,refetchOnMountOrArgChange:s,refetchOnFocus:c,refetchOnReconnect:u,invalidationBehavior:h,onSchemaFailure:S,catchSchemaFailure:v,skipSchemaValidation:g},y){dm();let x=pe=>(typeof process<"u",pe);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:Id,onOffline:Eh,onFocus:Rd,onFocusLost:Ch},util:{}});let C=IR({serializeQueryArgs:i,reducerPath:o,createSelector:e}),{selectInvalidatedBy:E,selectCachedArgsForQuery:_,buildQuerySelector:I,buildInfiniteQuerySelector:k,buildMutationSelector:T}=C;dr(t.util,{selectInvalidatedBy:E,selectCachedArgsForQuery:_});let{queryThunk:D,infiniteQueryThunk:B,mutationThunk:L,patchQueryData:j,updateQueryData:U,upsertQueryData:q,prefetch:O,buildMatchThunkActions:P}=ER({baseQuery:r,reducerPath:o,context:y,api:t,serializeQueryArgs:i,assertTagType:x,selectors:C,onSchemaFailure:S,catchSchemaFailure:v,skipSchemaValidation:g}),{reducer:F,actions:H}=RR({context:y,queryThunk:D,infiniteQueryThunk:B,mutationThunk:L,serializeQueryArgs:i,reducerPath:o,assertTagType:x,config:{refetchOnFocus:c,refetchOnReconnect:u,refetchOnMountOrArgChange:s,keepUnusedDataFor:a,reducerPath:o,invalidationBehavior:h}});dr(t.util,{patchQueryData:j,updateQueryData:U,upsertQueryData:q,prefetch:O,resetApiState:H.resetApiState,upsertQueryEntries:H.cacheEntriesUpserted}),dr(t.internalActions,H);let Q=new WeakMap,X=pe=>Vs(Q,pe,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:Y,buildInitiateInfiniteQuery:W,buildInitiateMutation:ee,getRunningMutationThunk:ae,getRunningMutationsThunk:xe,getRunningQueriesThunk:Me,getRunningQueryThunk:_e}=CR({queryThunk:D,mutationThunk:L,infiniteQueryThunk:B,api:t,serializeQueryArgs:i,context:y,getInternalState:X});dr(t.util,{getRunningMutationThunk:ae,getRunningMutationsThunk:xe,getRunningQueryThunk:_e,getRunningQueriesThunk:Me});let{middleware:Pe,actions:Ne}=jR({reducerPath:o,context:y,queryThunk:D,mutationThunk:L,infiniteQueryThunk:B,api:t,assertTagType:x,selectors:C,getRunningQueryThunk:_e,getInternalState:X});return dr(t.util,Ne),dr(t,{reducer:F,middleware:Pe}),{name:Sh,injectEndpoint(pe,de){var Ge;let me=(Ge=t.endpoints)[pe]??(Ge[pe]={});$s(de)&&dr(me,{name:pe,select:I(pe,de),initiate:Y(pe,de)},P(D,pe)),wR(de)&&dr(me,{name:pe,select:T(),initiate:ee(pe)},P(L,pe)),Gs(de)&&dr(me,{name:pe,select:k(pe,de),initiate:W(pe,de)},P(D,pe))}}}}),Nh=TR(LR());m();d();p();f();m();d();p();f();var dn=e=>e.query,Fh=e=>e.query?.enableQuerySyntax;var MB=Be(e=>dn(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})),VR=Be(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);m();d();p();f();m();d();p();f();var bo=(e,t,r,n)=>mt({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(o,i)=>{let a=t??cn(i),s=e?r??(!i.generatedAnswer?.answer||!i.generatedAnswer?.answer.length):void 0;return a?o.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:a,answerGenerated:e,answerTextIsEmpty:s,...(n&&{conversationId:n})}):null},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:o=>({answerId:t??cn(o)??"",answerGenerated:e??!1})}),wo=e=>mt({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:t=>({answerId:e??cn(t)??"",responseId:t.search?.searchResponseId||t.search?.response.searchUid||""})});m();d();p();f();m();d();p();f();var Dh=Be(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});m();d();p();f();var $i=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...(r&&{actionCause:r.actionCause}),...(r&&{customData:r.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.deviceId&&{deviceId:e.deviceId}),...(e.trackingId&&{trackingId:e.trackingId}),capture:t.capture??t.clientId!=="",source:ao(e)}});m();d();p();f();var Mh=e=>e.context;m();d();p();f();var _d=e=>e.pipeline;m();d();p();f();m();d();p();f();var Gi=Dt(Qs(),1),Bh=Dt(qh(),1);m();d();p();f();var Hs=Dt(Qs(),1),Lh=Dt(jh(),1);Hs.default.extend(Lh.default);var Vh="YYYY/MM/DD@HH:mm:ss",UR="1401-01-01";function Ao(e,t){let r=(0,Hs.default)(e,t);return!r.isValid()&&!t?(0,Hs.default)(e,Vh):r}function zs(e){return e.format(Vh)}function Uh(e,t){let r=Ao(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}`)}Md(r)}function Md(e){if(e.isBefore(UR))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}Gi.default.extend(Bh.default);var $h=["past","now","next"],Gh=["minute","hour","day","week","month","quarter","year"],BR=e=>{let t=e==="now";return{amount:new ne({required:!t,min:1}),unit:new z({required:!t,constrainTo:Gh}),period:new z({required:!0,constrainTo:$h})}};function qd(e){if(typeof e=="string"&&!Tr(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?Kh(e):e;new gt(BR(t.period)).validate(t);let r=Hh(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);Md(r)}function Qh(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function Hh(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,Gi.default)().subtract(r,n);case"next":return(0,Gi.default)().add(r,n);case"now":return(0,Gi.default)()}}function Qi(e){return zs(Hh(Kh(e)))}function zh(e){return e.toLocaleLowerCase().split("-")}function Tr(e){let[t,r,n]=zh(e);if(t==="now")return!0;if(!$h.includes(t)||!Gh.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function Wh(e){return!!e&&typeof e=="object"&&"period"in e}function Kh(e){let[t,r,n]=zh(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}m();d();p();f();function Yh(e){return e.type==="dateRange"}function Xh(e){return`start${e}`}function Jh(e){return`end${e}`}var jd=()=>({dateFacetValueMap:{}});function $R(e,t,r){let n=e.start,o=e.end;return Tr(n)&&(n=Qi(n),r.dateFacetValueMap[t][Xh(n)]=e.start),Tr(o)&&(o=Qi(o),r.dateFacetValueMap[t][Jh(o)]=e.end),{...e,start:n,end:o}}function Ld(e,t){if(Yh(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>$R(o,r,t))}}return e}function _r(e){let t=jd();return{request:{...e,facets:e.facets?.map(n=>Ld(n,t))},mappings:t}}function GR(e,t,r){return{...e,start:r.dateFacetValueMap[t][Xh(e.start)]||e.start,end:r.dateFacetValueMap[t][Jh(e.end)]||e.end}}function QR(e,t){return e.facetId in t.dateFacetValueMap}function HR(e,t){return QR(e,t)?{...e,values:e.values.map(r=>GR(r,e.facetId,t))}:e}function Ws(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>HR(n,t))}}:e}m();d();p();f();m();d();p();f();m();d();p();f();function kr(e){return Object.values(e).map(t=>t.request)}function Vd(e,t){let r={};e.forEach(i=>{r[i.facetId]=i});let n=[];t.forEach(i=>{i in r&&(n.push(r[i]),delete r[i])});let o=Object.values(r);return[...n,...o]}function Zh(e){return kr(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var Ud={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function zR(e){return kr(e).map(t=>{let r=Ud[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function WR(e){return[...zR(e.facetSet??{}),...Zh(e.numericFacetSet??{}),...Zh(e.dateFacetSet??{}),...kr(e.categoryFacetSet??{})]}function KR(e){return WR(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Ks(e){return Vd(KR(e),e.facetOrder??[])}m();d();p();f();m();d();p();f();var Or=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??vr(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:Rt.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 Fs(e.configuration.analytics,t))),...(e.excerptLength&&!se(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function Or(_x67,_x68){return _ref29.apply(this,arguments)}}();m();d();p();f();var xo=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??vr(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&$i(e.configuration.analytics,t,r)),...(e.excerptLength&&!se(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});m();d();p();f();var ey=Be(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o}));var Pr=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t,r){let n=$d(e),o=YR(e),i=XR(e),a=e.configuration.analytics.analyticsMode==="legacy"?yield Or(e,r):xo(e,t,r);return _r({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:Bd(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:i}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Pr(_x69,_x70,_x71){return _ref30.apply(this,arguments)}}();function Bd(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function YR(e){return Vd(ZR(e),e.facetOrder??[])}function XR(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(JR).filter(r=>r.currentValues.length>0):void 0}function JR(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function ZR(e){return eI(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function eI(e){return[...tI(e.facetSet??{}),...ty(e.numericFacetSet??{}),...ty(e.dateFacetSet??{}),...kr(e.categoryFacetSet??{})]}function tI(e){return kr(e).map(t=>{let r=Ud[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function ty(e){return kr(e).map(t=>{let r=t.currentValues,n=r.some(({state:i})=>i!=="idle"),o=r.some(i=>i.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function $d(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=ey(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}m();d();p();f();m();d();p();f();var Hi=(e,t)=>{let r=e;return se(r[t])?se(e.raw[t])?null:e.raw[t]:r[t]},rI=e=>t=>e.every(r=>!se(Hi(t,r))),nI=e=>t=>e.every(r=>se(Hi(t,r))),oI=(e,t)=>r=>{let n=ry(e,r);return t.some(o=>n.some(i=>`${i}`.toLowerCase()===o.toLowerCase()))},iI=(e,t)=>r=>{let n=ry(e,r);return t.every(o=>n.every(i=>`${i}`.toLowerCase()!==o.toLowerCase()))},ry=(e,t)=>{let r=Hi(t,e);return Rp(r)?r:[r]},ny={getResultProperty:Hi,fieldsMustBeDefined:rI,fieldsMustNotBeDefined:nI,fieldMustMatch:oI,fieldMustNotMatch:iI};var Gd=Be(e=>e.search,e=>e?.searchAction?.actionCause||"");m();d();p();f();var Qd=e=>e.searchHub;m();d();p();f();var Hd=Be(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),vQ=Be(e=>e,e=>{let t=Hd(e);return t&&e?e[t].expression:""});m();d();p();f();var oy=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};m();d();p();f();var iy=e=>e.excerptLength?.length;m();d();p();f();var ay=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};m();d();p();f();var sy=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};m();d();p();f();var cy=e=>e.sortCriteria;var uy=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Je(e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function uy(_x72){return _ref31.apply(this,arguments)}}(),ly=(e,t)=>{let r=dn(e)?.q,{aq:n,cq:o,dq:i,lq:a}=sI(e),s=Mh(e),c=$i(e.configuration.analytics,t,{actionCause:Gd(e)}),u=Qd(e),h=_d(e),S=id(e)??[],v=fy(e),g=Hd(e.tabSet)||"default",y=nd(e),x=Tg(e),C=t.referrer||"",E=ay(e),_=cy(e),I=aI(e),k=iy(e),T=sy(e),D=oy(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(i&&{dq:i}),...(a&&{lq:a}),...(e.query&&{enableQuerySyntax:Fh(e)}),...(s?.contextValues&&{context:s.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:S}},...(u?.length&&{searchHub:u}),...(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:Bd(e),firstResult:e.pagination.firstResult}),tab:g,locale:y,timezone:x,...(e.debug!==void 0&&{debug:e.debug}),referrer:C,...I,...(T??{}),...(k&&{excerptLength:k}),...(D&&{dictionaryFieldContext:D}),sortCriteria:_,...(E&&{facetOptions:E}),...c,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},dy=(e,t)=>{let r=dn(e)?.q,n=fy(e),o=$i(e.configuration.analytics,t,{actionCause:Gd(e)}),i=nd(e),a=Qd(e),s=_d(e),c=id(e)??[];return{q:r||"",...(n.length&&{facets:n}),citationsFieldToInclude:c,...(a?.length&&{searchHub:a}),...(s?.length&&{pipeline:s}),...o,locale:i}},fy=e=>Ks(e)?.map(t=>Ld(t,jd())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),aI=e=>({actionsHistory:e.configuration.analytics.enabled?Rt.getInstance().getHistory():[]}),sI=e=>{let t=Dh(e),r=$d(e);return{...t,...(r&&{cq:r})}};m();d();p();f();var Ys=["searching","thinking","answering"];function Xs(e){return e.toLowerCase()}m();d();p();f();var py=["text/plain","text/markdown"];var Co=new z({required:!0}),my=new z,Eo=new fe({required:!0}),zd={id:Co,title:Co,uri:Co,permanentid:Co,clickUri:my},Js=new z({required:!0,constrainTo:py}),gy=new z({required:!0,constrainTo:Ys}),hy=e=>({...e,name:Xs(e.name)}),L3=N("generatedAnswer/setIsVisible",e=>$(e,Eo)),Zs=N("generatedAnswer/setAnswerId",e=>$(e,J)),V3=N("generatedAnswer/setAnswerGenerationMode",e=>$(e,new z({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),U3=N("generatedAnswer/setIsEnabled",e=>$(e,Eo)),Wi=N("generatedAnswer/updateMessage",e=>$(e,{textDelta:Co})),Ki=N("generatedAnswer/updateCitations",e=>$(e,{citations:new he({required:!0,each:new re({values:zd})})})),Yi=N("generatedAnswer/updateError",e=>$(e,{message:my,code:new ne({min:0})})),ec=N("generatedAnswer/resetAnswer"),B3=N("generatedAnswer/like"),$3=N("generatedAnswer/dislike"),G3=N("generatedAnswer/feedbackModal/open"),Q3=N("generatedAnswer/expand"),H3=N("generatedAnswer/collapse"),z3=N("generatedAnswer/setId",e=>$(e,{id:new z({required:!0})})),W3=N("generatedAnswer/feedbackModal/close"),K3=N("generatedAnswer/sendFeedback"),Nr=N("generatedAnswer/setIsLoading",e=>$(e,Eo)),zi=N("generatedAnswer/setIsStreaming",e=>$(e,Eo)),Xi=N("generatedAnswer/setAnswerContentFormat",e=>$(e,Js)),Y3=N("generatedAnswer/updateResponseFormat",e=>$(e,{contentFormat:new he({each:Js,default:["text/plain"]})})),X3=N("knowledge/updateAnswerConfigurationId",e=>$(e,Co)),J3=N("generatedAnswer/registerFieldsToIncludeInCitations",e=>$(e,ns)),Wd=N("generatedAnswer/setIsAnswerGenerated",e=>$(e,Eo)),Ji=N("generatedAnswer/setCannotAnswer",e=>$(e,Eo)),cI=N("generatedAnswer/setAnswerApiQueryParams",e=>$(e,new re({}))),yy=N("generatedAnswer/startStep",e=>$(hy(e),{name:gy,startedAt:new ne({min:0,required:!0})})),Sy=N("generatedAnswer/finishStep",e=>$(hy(e),{name:gy,finishedAt:new ne({min:0,required:!0})})),Z3=Ee("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:i}=t,{search:a}=i(),{queryExecuted:s}=a,{setAbortControllerRef:c}=e,u=yield uy(r),h=(g,y)=>{switch(g){case"genqa.headerMessageType":{let x=JSON.parse(y);n(Xi(x.contentFormat));break}case"genqa.messageType":n(Wi(JSON.parse(y)));break;case"genqa.citationsType":n(Ki(JSON.parse(y)));break;case"genqa.endOfStreamType":{let x=JSON.parse(y).answerGenerated,C=i().generatedAnswer.answerId,E=s.length!==0&&!x,_=x?!i().generatedAnswer.answer?.length:void 0;n(Ji(E)),n(zi(!1)),n(Wd(x)),n(bo(x,C,_)),n(wo());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${g}"`)}};n(Nr(!0));let S=g=>g.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,v=o.streamingClient?.streamGeneratedAnswer(u,{write:g=>{S(u)&&(n(Nr(!1)),g.payload&&g.payloadType&&h(g.payloadType,g.payload))},abort:g=>{S(u)&&n(Yi(g))},close:()=>{S(u)&&n(zi(!1))},resetAnswer:()=>{S(u)&&n(ec())}});v?c(v):n(Nr(!1))});return function(_x73,_x74){return _ref32.apply(this,arguments)}}()),eH=Ee("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(ec());let i=t();if(i.generatedAnswer.answerConfigurationId){let a=ly(i,n);r(cI(a)),yield r(vy(a))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x75,_x76){return _ref33.apply(this,arguments)}}());m();d();p();f();m();d();p();f();function wy(_x77,_x78){return _wy.apply(this,arguments)}function _wy(){_wy=_asyncToGenerator(function*(e,t){let r=e.getReader(),n;for(;!(n=yield r.read()).done;)t(n.value)});return _wy.apply(this,arguments)}function Ay(e){let t,r,n,o=!1;return function(a){t===void 0?(t=a,r=0,n=-1):t=lI(t,a);let s=t.length,c=0;for(;r<s;){o&&(t[r]===10&&(c=++r),o=!1);let u=-1;for(;r<s&&u===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-c);break;case 13:o=!0,u=r;break;case 10:u=r;break}if(u===-1)break;e(t.subarray(c,u),n),c=r,n=-1}c===s?t=void 0:c!==0&&(t=t.subarray(c),r-=c)}}function xy(e,t,r){let n=by(),o=new TextDecoder;return function(a,s){if(a.length===0)r?.(n),n=by();else if(s>0){let c=o.decode(a.subarray(0,s)),u=s+(a[s+1]===32?2:1),h=o.decode(a.subarray(u));switch(c){case"data":n.data=n.data?`${n.data}
|
|
31
|
+
${h}`:h;break;case"event":n.event=h;break;case"id":e(n.id=h);break;case"retry":uI(h,n,t);break}}}}function uI(e,t,r){let n=parseInt(e,10);Number.isNaN(n)||r(t.retry=n)}function lI(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function by(){return{data:"",event:"",id:"",retry:void 0}}var Kd="text/event-stream",dI=1e3,Cy="last-event-id";function Ey(){return typeof window<"u"}function Ry(e,{signal:t,headers:r,onopen:n,onmessage:o,onclose:i,onerror:a,openWhenHidden:s,fetch:c,...u}){return new Promise((h,S)=>{let v={...r};v.accept||(v.accept=Kd);let g;function y(){g?.abort(),document.hidden||k()}!s&&Ey()&&document.addEventListener("visibilitychange",y);let x=dI,C;function E(){Ey()&&document.removeEventListener("visibilitychange",y),clearTimeout(C),g?.abort()}t?.addEventListener("abort",()=>{E(),h()});let _=c??w,I=n??fI;function k(){return _k2.apply(this,arguments)}function _k2(){_k2=_asyncToGenerator(function*(){g=l.AbortController?new l.AbortController:null;try{let T=yield _(e,{...u,headers:v,signal:g?.signal});yield I(T),yield wy(T.body,Ay(xy(D=>{D?v[Cy]=D:delete v[Cy]},D=>{x=D},o))),i?.(),E(),h()}catch(T){if(!g?.signal?.aborted)try{let D=a?.(T)??x;clearTimeout(C),C=setTimeout(k,D)}catch(D){E(),S(D)}}});return _k2.apply(this,arguments)}k()})}function fI(e){let t=e.headers.get("content-type");if(!t?.startsWith(Kd))throw new Error(`Expected content-type to be ${Kd}, Actual: ${t}`)}m();d();p();f();var pI=/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:i,organizationId:a}=n.configuration,s=n.generatedAnswer.answerConfigurationId,c={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let u=Je(a,i);return{data:bh({baseUrl:`${u}/rest/organizations/${a}/answer/v1/configs/${s}`,fetchFn:function(){var _ref35=_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(y=>{g[y]=S[y]}),g.duplex="half",g.body=yield S.text(),w(v,g)});return function fetchFn(_x82){return _ref35.apply(this,arguments)}}()})(c,{...t,signal:null},r)}}catch(u){return{error:u}}});return function pI(_x79,_x80,_x81){return _ref34.apply(this,arguments)}}(),Iy=Nh({reducerPath:"answer",baseQuery:Ah(pI,{maxRetries:3}),endpoints:()=>({})});var mI=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},gI=(e,t)=>{e.answer===void 0?e.answer=t.textDelta:typeof t.textDelta=="string"&&(e.answer=e.answer.concat(t.textDelta))},hI=(e,t)=>{e.citations=t.citations},yI=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},SI=(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})`)},vI=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&SI(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(mI(t,o),r(Xi(o.contentFormat)));break;case"genqa.messageType":o.textDelta&&(gI(t,o),r(Wi({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(hI(t,o),r(Ki({citations:o.citations})));break;case"genqa.endOfStreamType":{yI(t,o);let i=t.answerId,a=o.answerGenerated??!1,s=a?!t.answer?.length:void 0;r(bo(a,i,s)),r(wo());break}}},bI=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,i=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${i}/${r}/generate`},Yd=Iy.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let{analytics:n,...o}=r;return`${t}(${JSON.stringify(o)})`},onCacheEntryAdded(_x83,_x84){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:i}){yield n;let{configuration:a,generatedAnswer:s,insightConfiguration:c}=r(),{organizationId:u,environment:h,accessToken:S}=a,v=Je(u,h),g=bI(v,u,s.answerConfigurationId,c?.insightId);yield Ry(g,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${S}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:w,onopen:function(){var _ref36=_asyncToGenerator(function*(y){let x=y.headers.get("x-answer-id");x&&o(C=>{C.answerId=x,i(Zs(x))})});return function onopen(_x85){return _ref36.apply(this,arguments)}}(),onmessage:y=>{o(x=>{vI(y,x,i)})},onerror:y=>{throw y},onclose:()=>{o(y=>{i(Ji(!y.generated))})}})}).apply(this,arguments)}})})}),vy=e=>Yd.endpoints.getAnswer.initiate(e);m();d();p();f();var Ty=Le(Xn,e=>e);m();d();p();f();function wI(e){let t=e.payload?.analyticsAction;return _y(e)&&!se(t)}function _y(e){return"type"in e}var ky=e=>t=>r=>{let n;wI(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return _y(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};m();d();p();f();m();d();p();f();m();d();p();f();var XH=N("tab/register",e=>{let t=new re({values:{id:J,expression:rt}});return $(e,t)}),tc=N("tab/updateActiveTab",e=>$(e,J));m();d();p();f();var rc=Dt(Qs(),1),Ny=Dt(Oy(),1),Fy=Dt(Py(),1);rc.default.extend(Fy.default);rc.default.extend(Ny.default);var Dy=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:rc.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"});m();d();p();f();var AI=/(^|; )Coveo-Pendragon=([^;]*)/,xI=/(^|; )Coveo-SearchAgentDebug=([^;]*)/;function My(){return typeof window>"u"?!1:AI.exec(document.cookie)?.pop()||null}function qy(){return typeof window>"u"?!1:xI.test(document.cookie)}var jy=Le(Dy(),e=>e.addCase(xr,(t,r)=>{CI(t,r.payload)}).addCase(Ht,(t,r)=>{EI(t,r.payload)}).addCase(Jn,(t,r)=>{RI(t,r.payload)}).addCase(Zn,t=>{t.analytics.enabled=!1}).addCase(eo,t=>{t.analytics.enabled=!0}).addCase(os,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(is,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(tc,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Km,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Cr,(t,r)=>{se(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(zm,(t,{payload:r})=>{II(t,r)}));function CI(e,t){se(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",se(t.organizationId)||(e.organizationId=t.organizationId)}function EI(e,t){se(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),se(t.locale)||(e.search.locale=t.locale),se(t.timezone)||(e.search.timezone=t.timezone),se(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function RI(e,t){se(t.enabled)||(e.analytics.enabled=t.enabled),se(t.originContext)||(e.analytics.originContext=t.originContext),se(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),se(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),se(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),se(t.trackingId)||(e.analytics.trackingId=t.trackingId),se(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),se(t.source)||(e.analytics.source=t.source);try{let r=My();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}se(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),se(t.anonymous)||(e.analytics.anonymous=t.anonymous),se(t.deviceId)||(e.analytics.deviceId=t.deviceId),se(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),se(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}function II(e,t){e.knowledge.agentId=t;try{let r=qy();se(r)||(e.knowledge.debugAgentSession=!0)}catch{}}var qt=jy;m();d();p();f();function TI(e){return e.instantlyCallable}var Ly=()=>e=>t=>e(TI(t)?t():t);m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();var it=[];for(let e=0;e<256;++e)it.push((e+256).toString(16).slice(1));function Vy(e,t=0){return(it[e[t+0]]+it[e[t+1]]+it[e[t+2]]+it[e[t+3]]+"-"+it[e[t+4]]+it[e[t+5]]+"-"+it[e[t+6]]+it[e[t+7]]+"-"+it[e[t+8]]+it[e[t+9]]+"-"+it[e[t+10]]+it[e[t+11]]+it[e[t+12]]+it[e[t+13]]+it[e[t+14]]+it[e[t+15]]).toLowerCase()}m();d();p();f();var tf,_I=new Uint8Array(16);function rf(){if(!tf){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");tf=crypto.getRandomValues.bind(crypto)}return tf(_I)}m();d();p();f();m();d();p();f();var kI=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),nf={randomUUID:kI};function OI(e,t,r){if(nf.randomUUID&&!t&&!e)return nf.randomUUID();e=e||{};let n=e.random??e.rng?.()??rf();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 Vy(n)}var Fr=OI;m();d();p();f();m();d();p();f();var R={};Zo(R,{BRAND:()=>nT,DIRTY:()=>pn,EMPTY_PATH:()=>DI,INVALID:()=>ue,NEVER:()=>UT,OK:()=>ut,ParseStatus:()=>at,Schema:()=>Se,ZodAny:()=>qr,ZodArray:()=>hr,ZodBigInt:()=>gn,ZodBoolean:()=>hn,ZodBranded:()=>ea,ZodCatch:()=>In,ZodDate:()=>yn,ZodDefault:()=>Rn,ZodDiscriminatedUnion:()=>ic,ZodEffects:()=>Ot,ZodEnum:()=>Cn,ZodError:()=>St,ZodFirstPartyTypeKind:()=>le,ZodFunction:()=>sc,ZodIntersection:()=>wn,ZodIssueCode:()=>K,ZodLazy:()=>An,ZodLiteral:()=>xn,ZodMap:()=>Oo,ZodNaN:()=>No,ZodNativeEnum:()=>En,ZodNever:()=>jt,ZodNull:()=>vn,ZodNullable:()=>Xt,ZodNumber:()=>mn,ZodObject:()=>vt,ZodOptional:()=>_t,ZodParsedType:()=>te,ZodPipeline:()=>ta,ZodPromise:()=>jr,ZodReadonly:()=>Tn,ZodRecord:()=>ac,ZodSchema:()=>Se,ZodSet:()=>Po,ZodString:()=>Mr,ZodSymbol:()=>_o,ZodTransformer:()=>Ot,ZodTuple:()=>Yt,ZodType:()=>Se,ZodUndefined:()=>Sn,ZodUnion:()=>bn,ZodUnknown:()=>gr,ZodVoid:()=>ko,addIssueToContext:()=>Z,any:()=>fT,array:()=>hT,bigint:()=>sT,boolean:()=>Xy,coerce:()=>VT,custom:()=>Wy,date:()=>cT,datetimeRegex:()=>Hy,defaultErrorMap:()=>pr,discriminatedUnion:()=>bT,effect:()=>PT,enum:()=>_T,function:()=>RT,getErrorMap:()=>Ro,getParsedType:()=>Kt,instanceof:()=>iT,intersection:()=>wT,isAborted:()=>nc,isAsync:()=>Io,isDirty:()=>oc,isValid:()=>Dr,late:()=>oT,lazy:()=>IT,literal:()=>TT,makeIssue:()=>Zi,map:()=>CT,nan:()=>aT,nativeEnum:()=>kT,never:()=>mT,null:()=>dT,nullable:()=>FT,number:()=>Yy,object:()=>yT,objectUtil:()=>of,oboolean:()=>LT,onumber:()=>jT,optional:()=>NT,ostring:()=>qT,pipeline:()=>MT,preprocess:()=>DT,promise:()=>OT,quotelessJson:()=>PI,record:()=>xT,set:()=>ET,setErrorMap:()=>FI,strictObject:()=>ST,string:()=>Ky,symbol:()=>uT,transformer:()=>PT,tuple:()=>AT,undefined:()=>lT,union:()=>vT,unknown:()=>pT,util:()=>we,void:()=>gT});m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();var we;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(s=>typeof o[o[s]]!="number"),a={};for(let s of i)a[s]=o[s];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},e.find=(o,i)=>{for(let a of o)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(we||(we={}));var of;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(of||(of={}));var te=we.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Kt=e=>{switch(typeof e){case"undefined":return te.undefined;case"string":return te.string;case"number":return Number.isNaN(e)?te.nan:te.number;case"boolean":return te.boolean;case"function":return te.function;case"bigint":return te.bigint;case"symbol":return te.symbol;case"object":return Array.isArray(e)?te.array:e===null?te.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?te.promise:typeof Map<"u"&&e instanceof Map?te.map:typeof Set<"u"&&e instanceof Set?te.set:typeof Date<"u"&&e instanceof Date?te.date:te.object;default:return te.unknown}};var K=we.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"]),PI=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),St=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let s=n,c=0;for(;c<a.path.length;){let u=a.path[c];c===a.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(r(a))):s[u]=s[u]||{_errors:[]},s=s[u],c++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,we.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};St.create=e=>new St(e);var NI=(e,t)=>{let r;switch(e.code){case K.invalid_type:e.received===te.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case K.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,we.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:r=`Unrecognized key(s) in object: ${we.joinValues(e.keys,", ")}`;break;case K.invalid_union:r="Invalid input";break;case K.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${we.joinValues(e.options)}`;break;case K.invalid_enum_value:r=`Invalid enum value. Expected ${we.joinValues(e.options)}, received '${e.received}'`;break;case K.invalid_arguments:r="Invalid function arguments";break;case K.invalid_return_type:r="Invalid function return type";break;case K.invalid_date:r="Invalid date";break;case K.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:we.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case K.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case K.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case K.custom:r="Invalid input";break;case K.invalid_intersection_types:r="Intersection results could not be merged";break;case K.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case K.not_finite:r="Number must be finite";break;default:r=t.defaultError,we.assertNever(e)}return{message:r}},pr=NI;var Uy=pr;function FI(e){Uy=e}function Ro(){return Uy}m();d();p();f();var Zi=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...(o.path||[])],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let s="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)s=u(a,{data:t,defaultError:s}).message;return{...o,path:i,message:s}},DI=[];function Z(e,t){let r=Ro(),n=Zi({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===pr?void 0:pr].filter(o=>!!o)});e.common.issues.push(n)}var at=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 ue;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static mergeObjectAsync(t,r){return _asyncToGenerator(function*(){let n=[];for(let o of r){let i=yield o.key,a=yield o.value;n.push({key:i,value:a})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return ue;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(n[i.value]=a.value)}return{status:t.value,value:n}}},ue=Object.freeze({status:"aborted"}),pn=e=>({status:"dirty",value:e}),ut=e=>({status:"valid",value:e}),nc=e=>e.status==="aborted",oc=e=>e.status==="dirty",Dr=e=>e.status==="valid",Io=e=>typeof Promise<"u"&&e instanceof Promise;m();d();p();f();m();d();p();f();var oe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(oe||(oe={}));var kt=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}},By=(e,t)=>{if(Dr(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new St(e.common.issues);return this._error=r,this._error}}};function ge(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(a,s)=>{let{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??n??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:c??r??s.defaultError}},description:o}}var Se=class{get description(){return this._def.description}_getType(t){return Kt(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Kt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new at,ctx:{common:t.parent.common,data:t.data,parsedType:Kt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Io(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:Kt(t)},o=this._parseSync({data:t,path:n.path,parent:n});return By(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Kt(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Dr(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=>Dr(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this10=this;return _asyncToGenerator(function*(){let n=yield _this10.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this11=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this11._def.errorMap,parent:null,data:t,parsedType:Kt(t)},o=_this11._parse({data:t,path:n.path,parent:n}),i=yield Io(o)?o:Promise.resolve(o);return By(n,i)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let a=t(o),s=()=>i.addIssue({code:K.custom,...n(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new Ot({schema:this,typeName:le.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 _t.create(this,this._def)}nullable(){return Xt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hr.create(this)}promise(){return jr.create(this,this._def)}or(t){return bn.create([this,t],this._def)}and(t){return wn.create(this,t,this._def)}transform(t){return new Ot({...ge(this._def),schema:this,typeName:le.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Rn({...ge(this._def),innerType:this,defaultValue:r,typeName:le.ZodDefault})}brand(){return new ea({typeName:le.ZodBranded,type:this,...ge(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new In({...ge(this._def),innerType:this,catchValue:r,typeName:le.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ta.create(this,t)}readonly(){return Tn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},MI=/^c[^\s-]{8,}$/i,qI=/^[0-9a-z]+$/,jI=/^[0-9A-HJKMNP-TV-Z]{26}$/i,LI=/^[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,VI=/^[a-z0-9_-]{21}$/i,UI=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,BI=/^[-+]?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)?)??$/,$I=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,GI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",af,QI=/^(?:(?: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])$/,HI=/^(?:(?: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])$/,zI=/^(([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]))$/,WI=/^(([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])$/,KI=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,YI=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Gy="((\\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])))",XI=new RegExp(`^${Gy}$`);function Qy(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 JI(e){return new RegExp(`^${Qy(e)}$`)}function Hy(e){let t=`${Gy}T${Qy(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 ZI(e,t){return!!((t==="v4"||!t)&&QI.test(e)||(t==="v6"||!t)&&zI.test(e))}function eT(e,t){if(!UI.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 tT(e,t){return!!((t==="v4"||!t)&&HI.test(e)||(t==="v6"||!t)&&WI.test(e))}var Mr=class e extends Se{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==te.string){let i=this._getOrReturnCtx(t);return Z(i,{code:K.invalid_type,expected:te.string,received:i.parsedType}),ue}let n=new at,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),Z(o,{code:K.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),Z(o,{code:K.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,s=t.data.length<i.value;(a||s)&&(o=this._getOrReturnCtx(t,o),a?Z(o,{code:K.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&Z(o,{code:K.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")$I.test(t.data)||(o=this._getOrReturnCtx(t,o),Z(o,{validation:"email",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")af||(af=new RegExp(GI,"u")),af.test(t.data)||(o=this._getOrReturnCtx(t,o),Z(o,{validation:"emoji",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")LI.test(t.data)||(o=this._getOrReturnCtx(t,o),Z(o,{validation:"uuid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")VI.test(t.data)||(o=this._getOrReturnCtx(t,o),Z(o,{validation:"nanoid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")MI.test(t.data)||(o=this._getOrReturnCtx(t,o),Z(o,{validation:"cuid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")qI.test(t.data)||(o=this._getOrReturnCtx(t,o),Z(o,{validation:"cuid2",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")jI.test(t.data)||(o=this._getOrReturnCtx(t,o),Z(o,{validation:"ulid",code:K.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),Z(o,{validation:"url",code:K.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),Z(o,{validation:"regex",code:K.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),Z(o,{code:K.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),Z(o,{code:K.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),Z(o,{code:K.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Hy(i).test(t.data)||(o=this._getOrReturnCtx(t,o),Z(o,{code:K.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?XI.test(t.data)||(o=this._getOrReturnCtx(t,o),Z(o,{code:K.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?JI(i).test(t.data)||(o=this._getOrReturnCtx(t,o),Z(o,{code:K.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?BI.test(t.data)||(o=this._getOrReturnCtx(t,o),Z(o,{validation:"duration",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?ZI(t.data,i.version)||(o=this._getOrReturnCtx(t,o),Z(o,{validation:"ip",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?eT(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),Z(o,{validation:"jwt",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?tT(t.data,i.version)||(o=this._getOrReturnCtx(t,o),Z(o,{validation:"cidr",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?KI.test(t.data)||(o=this._getOrReturnCtx(t,o),Z(o,{validation:"base64",code:K.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?YI.test(t.data)||(o=this._getOrReturnCtx(t,o),Z(o,{validation:"base64url",code:K.invalid_string,message:i.message}),n.dirty()):we.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:K.invalid_string,...oe.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...oe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...oe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...oe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...oe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...oe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...oe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...oe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...oe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...oe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...oe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...oe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...oe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...oe.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,...oe.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,...oe.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...oe.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...oe.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...oe.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...oe.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...oe.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...oe.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...oe.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...oe.errToObj(r)})}nonempty(t){return this.min(1,oe.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}};Mr.create=e=>new Mr({checks:[],typeName:le.ZodString,coerce:e?.coerce??!1,...ge(e)});function rT(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return i%a/10**o}var mn=class e extends Se{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)!==te.number){let i=this._getOrReturnCtx(t);return Z(i,{code:K.invalid_type,expected:te.number,received:i.parsedType}),ue}let n,o=new at;for(let i of this._def.checks)i.kind==="int"?we.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),Z(n,{code:K.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:K.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:K.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?rT(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),Z(n,{code:K.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),Z(n,{code:K.not_finite,message:i.message}),o.dirty()):we.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,oe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,oe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,oe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,oe.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:oe.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:oe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:oe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:oe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:oe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:oe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:oe.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:oe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:oe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:oe.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"&&we.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)}};mn.create=e=>new mn({checks:[],typeName:le.ZodNumber,coerce:e?.coerce||!1,...ge(e)});var gn=class e extends Se{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)!==te.bigint)return this._getInvalidInput(t);let n,o=new at;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:K.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:K.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),Z(n,{code:K.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):we.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return Z(r,{code:K.invalid_type,expected:te.bigint,received:r.parsedType}),ue}gte(t,r){return this.setLimit("min",t,!0,oe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,oe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,oe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,oe.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:oe.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:oe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:oe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:oe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:oe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:oe.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}};gn.create=e=>new gn({checks:[],typeName:le.ZodBigInt,coerce:e?.coerce??!1,...ge(e)});var hn=class extends Se{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==te.boolean){let n=this._getOrReturnCtx(t);return Z(n,{code:K.invalid_type,expected:te.boolean,received:n.parsedType}),ue}return ut(t.data)}};hn.create=e=>new hn({typeName:le.ZodBoolean,coerce:e?.coerce||!1,...ge(e)});var yn=class e extends Se{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==te.date){let i=this._getOrReturnCtx(t);return Z(i,{code:K.invalid_type,expected:te.date,received:i.parsedType}),ue}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return Z(i,{code:K.invalid_date}),ue}let n=new at,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),Z(o,{code:K.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),Z(o,{code:K.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):we.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:oe.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:oe.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}};yn.create=e=>new yn({checks:[],coerce:e?.coerce||!1,typeName:le.ZodDate,...ge(e)});var _o=class extends Se{_parse(t){if(this._getType(t)!==te.symbol){let n=this._getOrReturnCtx(t);return Z(n,{code:K.invalid_type,expected:te.symbol,received:n.parsedType}),ue}return ut(t.data)}};_o.create=e=>new _o({typeName:le.ZodSymbol,...ge(e)});var Sn=class extends Se{_parse(t){if(this._getType(t)!==te.undefined){let n=this._getOrReturnCtx(t);return Z(n,{code:K.invalid_type,expected:te.undefined,received:n.parsedType}),ue}return ut(t.data)}};Sn.create=e=>new Sn({typeName:le.ZodUndefined,...ge(e)});var vn=class extends Se{_parse(t){if(this._getType(t)!==te.null){let n=this._getOrReturnCtx(t);return Z(n,{code:K.invalid_type,expected:te.null,received:n.parsedType}),ue}return ut(t.data)}};vn.create=e=>new vn({typeName:le.ZodNull,...ge(e)});var qr=class extends Se{constructor(){super(...arguments),this._any=!0}_parse(t){return ut(t.data)}};qr.create=e=>new qr({typeName:le.ZodAny,...ge(e)});var gr=class extends Se{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ut(t.data)}};gr.create=e=>new gr({typeName:le.ZodUnknown,...ge(e)});var jt=class extends Se{_parse(t){let r=this._getOrReturnCtx(t);return Z(r,{code:K.invalid_type,expected:te.never,received:r.parsedType}),ue}};jt.create=e=>new jt({typeName:le.ZodNever,...ge(e)});var ko=class extends Se{_parse(t){if(this._getType(t)!==te.undefined){let n=this._getOrReturnCtx(t);return Z(n,{code:K.invalid_type,expected:te.void,received:n.parsedType}),ue}return ut(t.data)}};ko.create=e=>new ko({typeName:le.ZodVoid,...ge(e)});var hr=class e extends Se{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==te.array)return Z(r,{code:K.invalid_type,expected:te.array,received:r.parsedType}),ue;if(o.exactLength!==null){let a=r.data.length>o.exactLength.value,s=r.data.length<o.exactLength.value;(a||s)&&(Z(r,{code:a?K.too_big:K.too_small,minimum:s?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(Z(r,{code:K.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(Z(r,{code:K.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,s)=>o.type._parseAsync(new kt(r,a,r.path,s)))).then(a=>at.mergeArray(n,a));let i=[...r.data].map((a,s)=>o.type._parseSync(new kt(r,a,r.path,s)));return at.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:oe.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:oe.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:oe.toString(r)}})}nonempty(t){return this.min(1,t)}};hr.create=(e,t)=>new hr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:le.ZodArray,...ge(t)});function To(e){if(e instanceof vt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=_t.create(To(n))}return new vt({...e._def,shape:()=>t})}else return e instanceof hr?new hr({...e._def,type:To(e.element)}):e instanceof _t?_t.create(To(e.unwrap())):e instanceof Xt?Xt.create(To(e.unwrap())):e instanceof Yt?Yt.create(e.items.map(t=>To(t))):e}var vt=class e extends Se{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=we.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==te.object){let u=this._getOrReturnCtx(t);return Z(u,{code:K.invalid_type,expected:te.object,received:u.parsedType}),ue}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof jt&&this._def.unknownKeys==="strip"))for(let u in o.data)a.includes(u)||s.push(u);let c=[];for(let u of a){let h=i[u],S=o.data[u];c.push({key:{status:"valid",value:u},value:h._parse(new kt(o,S,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof jt){let u=this._def.unknownKeys;if(u==="passthrough")for(let h of s)c.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(u==="strict")s.length>0&&(Z(o,{code:K.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let h of s){let S=o.data[h];c.push({key:{status:"valid",value:h},value:u._parse(new kt(o,S,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let u=[];for(let h of c){let S=yield h.key,v=yield h.value;u.push({key:S,value:v,alwaysSet:h.alwaysSet})}return u})).then(u=>at.mergeObjectSync(n,u)):at.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return oe.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:oe.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:le.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 we.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 we.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return To(this)}partial(t){let r={};for(let n of we.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 we.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof _t;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return zy(we.objectKeys(this.shape))}};vt.create=(e,t)=>new vt({shape:()=>e,unknownKeys:"strip",catchall:jt.create(),typeName:le.ZodObject,...ge(t)});vt.strictCreate=(e,t)=>new vt({shape:()=>e,unknownKeys:"strict",catchall:jt.create(),typeName:le.ZodObject,...ge(t)});vt.lazycreate=(e,t)=>new vt({shape:e,unknownKeys:"strip",catchall:jt.create(),typeName:le.ZodObject,...ge(t)});var bn=class extends Se{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let s of i)if(s.result.status==="valid")return s.result;for(let s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(s=>new St(s.ctx.common.issues));return Z(r,{code:K.invalid_union,unionErrors:a}),ue}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(i){let a={...r,common:{...r.common,issues:[]},parent:null};return{result:yield i._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}});return function(_x86){return _ref38.apply(this,arguments)}}())).then(o);{let i,a=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},h=c._parseSync({data:r.data,path:r.path,parent:u});if(h.status==="valid")return h;h.status==="dirty"&&!i&&(i={result:h,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let s=a.map(c=>new St(c));return Z(r,{code:K.invalid_union,unionErrors:s}),ue}}get options(){return this._def.options}};bn.create=(e,t)=>new bn({options:e,typeName:le.ZodUnion,...ge(t)});var mr=e=>e instanceof An?mr(e.schema):e instanceof Ot?mr(e.innerType()):e instanceof xn?[e.value]:e instanceof Cn?e.options:e instanceof En?we.objectValues(e.enum):e instanceof Rn?mr(e._def.innerType):e instanceof Sn?[void 0]:e instanceof vn?[null]:e instanceof _t?[void 0,...mr(e.unwrap())]:e instanceof Xt?[null,...mr(e.unwrap())]:e instanceof ea||e instanceof Tn?mr(e.unwrap()):e instanceof In?mr(e._def.innerType):[],ic=class e extends Se{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==te.object)return Z(r,{code:K.invalid_type,expected:te.object,received:r.parsedType}),ue;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(Z(r,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ue)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let i of r){let a=mr(i.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of a){if(o.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);o.set(s,i)}}return new e({typeName:le.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...ge(n)})}};function sf(e,t){let r=Kt(e),n=Kt(t);if(e===t)return{valid:!0,data:e};if(r===te.object&&n===te.object){let o=we.objectKeys(t),i=we.objectKeys(e).filter(s=>o.indexOf(s)!==-1),a={...e,...t};for(let s of i){let c=sf(e[s],t[s]);if(!c.valid)return{valid:!1};a[s]=c.data}return{valid:!0,data:a}}else if(r===te.array&&n===te.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let a=e[i],s=t[i],c=sf(a,s);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===te.date&&n===te.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var wn=class extends Se{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,a)=>{if(nc(i)||nc(a))return ue;let s=sf(i.value,a.value);return s.valid?((oc(i)||oc(a))&&r.dirty(),{status:r.value,value:s.data}):(Z(n,{code:K.invalid_intersection_types}),ue)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,a])=>o(i,a)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};wn.create=(e,t,r)=>new wn({left:e,right:t,typeName:le.ZodIntersection,...ge(r)});var Yt=class e extends Se{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==te.array)return Z(n,{code:K.invalid_type,expected:te.array,received:n.parsedType}),ue;if(n.data.length<this._def.items.length)return Z(n,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ue;!this._def.rest&&n.data.length>this._def.items.length&&(Z(n,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((a,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new kt(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>at.mergeArray(r,a)):at.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Yt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Yt({items:e,typeName:le.ZodTuple,rest:null,...ge(t)})};var ac=class e extends Se{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!==te.object)return Z(n,{code:K.invalid_type,expected:te.object,received:n.parsedType}),ue;let o=[],i=this._def.keyType,a=this._def.valueType;for(let s in n.data)o.push({key:i._parse(new kt(n,s,n.path,s)),value:a._parse(new kt(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?at.mergeObjectAsync(r,o):at.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Se?new e({keyType:t,valueType:r,typeName:le.ZodRecord,...ge(n)}):new e({keyType:Mr.create(),valueType:t,typeName:le.ZodRecord,...ge(r)})}},Oo=class extends Se{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!==te.map)return Z(n,{code:K.invalid_type,expected:te.map,received:n.parsedType}),ue;let o=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([s,c],u)=>({key:o._parse(new kt(n,s,n.path,[u,"key"])),value:i._parse(new kt(n,c,n.path,[u,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let c of a){let u=yield c.key,h=yield c.value;if(u.status==="aborted"||h.status==="aborted")return ue;(u.status==="dirty"||h.status==="dirty")&&r.dirty(),s.set(u.value,h.value)}return{status:r.value,value:s}}))}else{let s=new Map;for(let c of a){let u=c.key,h=c.value;if(u.status==="aborted"||h.status==="aborted")return ue;(u.status==="dirty"||h.status==="dirty")&&r.dirty(),s.set(u.value,h.value)}return{status:r.value,value:s}}}};Oo.create=(e,t,r)=>new Oo({valueType:t,keyType:e,typeName:le.ZodMap,...ge(r)});var Po=class e extends Se{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==te.set)return Z(n,{code:K.invalid_type,expected:te.set,received:n.parsedType}),ue;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(Z(n,{code:K.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(Z(n,{code:K.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function a(c){let u=new Set;for(let h of c){if(h.status==="aborted")return ue;h.status==="dirty"&&r.dirty(),u.add(h.value)}return{status:r.value,value:u}}let s=[...n.data.values()].map((c,u)=>i._parse(new kt(n,c,n.path,u)));return n.common.async?Promise.all(s).then(c=>a(c)):a(s)}min(t,r){return new e({...this._def,minSize:{value:t,message:oe.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:oe.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Po.create=(e,t)=>new Po({valueType:e,minSize:null,maxSize:null,typeName:le.ZodSet,...ge(t)});var sc=class e extends Se{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==te.function)return Z(r,{code:K.invalid_type,expected:te.function,received:r.parsedType}),ue;function n(s,c){return Zi({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ro(),pr].filter(u=>!!u),issueData:{code:K.invalid_arguments,argumentsError:c}})}function o(s,c){return Zi({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ro(),pr].filter(u=>!!u),issueData:{code:K.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof jr){let s=this;return ut(/*#__PURE__*/_asyncToGenerator(function*(...c){let u=new St([]),h=yield s._def.args.parseAsync(c,i).catch(g=>{throw u.addIssue(n(c,g)),u}),S=yield Reflect.apply(a,this,h);return yield s._def.returns._def.type.parseAsync(S,i).catch(g=>{throw u.addIssue(o(S,g)),u})}))}else{let s=this;return ut(function(...c){let u=s._def.args.safeParse(c,i);if(!u.success)throw new St([n(c,u.error)]);let h=Reflect.apply(a,this,u.data),S=s._def.returns.safeParse(h,i);if(!S.success)throw new St([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:Yt.create(t).rest(gr.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||Yt.create([]).rest(gr.create()),returns:r||gr.create(),typeName:le.ZodFunction,...ge(n)})}},An=class extends Se{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})}};An.create=(e,t)=>new An({getter:e,typeName:le.ZodLazy,...ge(t)});var xn=class extends Se{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return Z(r,{received:r.data,code:K.invalid_literal,expected:this._def.value}),ue}return{status:"valid",value:t.data}}get value(){return this._def.value}};xn.create=(e,t)=>new xn({value:e,typeName:le.ZodLiteral,...ge(t)});function zy(e,t){return new Cn({values:e,typeName:le.ZodEnum,...ge(t)})}var Cn=class e extends Se{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return Z(r,{expected:we.joinValues(n),received:r.parsedType,code:K.invalid_type}),ue}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 Z(r,{received:r.data,code:K.invalid_enum_value,options:n}),ue}return ut(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})}};Cn.create=zy;var En=class extends Se{_parse(t){let r=we.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==te.string&&n.parsedType!==te.number){let o=we.objectValues(r);return Z(n,{expected:we.joinValues(o),received:n.parsedType,code:K.invalid_type}),ue}if(this._cache||(this._cache=new Set(we.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=we.objectValues(r);return Z(n,{received:n.data,code:K.invalid_enum_value,options:o}),ue}return ut(t.data)}get enum(){return this._def.values}};En.create=(e,t)=>new En({values:e,typeName:le.ZodNativeEnum,...ge(t)});var jr=class extends Se{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==te.promise&&r.common.async===!1)return Z(r,{code:K.invalid_type,expected:te.promise,received:r.parsedType}),ue;let n=r.parsedType===te.promise?r.data:Promise.resolve(r.data);return ut(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};jr.create=(e,t)=>new jr({type:e,typeName:le.ZodPromise,...ge(t)});var Ot=class extends Se{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this12=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:a=>{Z(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(n.data,i);if(n.common.async)return Promise.resolve(a).then(/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(s){if(r.value==="aborted")return ue;let c=yield _this12._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?ue:c.status==="dirty"?pn(c.value):r.value==="dirty"?pn(c.value):c});return function(_x87){return _ref41.apply(this,arguments)}}());{if(r.value==="aborted")return ue;let s=this._def.schema._parseSync({data:a,path:n.path,parent:n});return s.status==="aborted"?ue:s.status==="dirty"?pn(s.value):r.value==="dirty"?pn(s.value):s}}if(o.type==="refinement"){let a=s=>{let c=o.refinement(s,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?ue:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?ue:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(o.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Dr(a))return ue;let s=o.transform(a.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>Dr(a)?Promise.resolve(o.transform(a.value,i)).then(s=>({status:r.value,value:s})):ue);we.assertNever(o)}};Ot.create=(e,t,r)=>new Ot({schema:e,typeName:le.ZodEffects,effect:t,...ge(r)});Ot.createWithPreprocess=(e,t,r)=>new Ot({schema:t,effect:{type:"preprocess",transform:e},typeName:le.ZodEffects,...ge(r)});var _t=class extends Se{_parse(t){return this._getType(t)===te.undefined?ut(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};_t.create=(e,t)=>new _t({innerType:e,typeName:le.ZodOptional,...ge(t)});var Xt=class extends Se{_parse(t){return this._getType(t)===te.null?ut(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Xt.create=(e,t)=>new Xt({innerType:e,typeName:le.ZodNullable,...ge(t)});var Rn=class extends Se{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===te.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Rn.create=(e,t)=>new Rn({innerType:e,typeName:le.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ge(t)});var In=class extends Se{_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 Io(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new St(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new St(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};In.create=(e,t)=>new In({innerType:e,typeName:le.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ge(t)});var No=class extends Se{_parse(t){if(this._getType(t)!==te.nan){let n=this._getOrReturnCtx(t);return Z(n,{code:K.invalid_type,expected:te.nan,received:n.parsedType}),ue}return{status:"valid",value:t.data}}};No.create=e=>new No({typeName:le.ZodNaN,...ge(e)});var nT=Symbol("zod_brand"),ea=class extends Se{_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}},ta=class e extends Se{_parse(t){var _this13=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let i=yield _this13._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?ue:i.status==="dirty"?(r.dirty(),pn(i.value)):_this13._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?ue: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:le.ZodPipeline})}},Tn=class extends Se{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Dr(o)&&(o.value=Object.freeze(o.value)),o);return Io(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Tn.create=(e,t)=>new Tn({innerType:e,typeName:le.ZodReadonly,...ge(t)});function $y(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Wy(e,t={},r){return e?qr.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(a=>{if(!a){let s=$y(t,n),c=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:c})}});if(!i){let a=$y(t,n),s=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:s})}}):qr.create()}var oT={object:vt.lazycreate},le;(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"})(le||(le={}));var iT=(e,t={message:`Input not instance of ${e.name}`})=>Wy(r=>r instanceof e,t),Ky=Mr.create,Yy=mn.create,aT=No.create,sT=gn.create,Xy=hn.create,cT=yn.create,uT=_o.create,lT=Sn.create,dT=vn.create,fT=qr.create,pT=gr.create,mT=jt.create,gT=ko.create,hT=hr.create,yT=vt.create,ST=vt.strictCreate,vT=bn.create,bT=ic.create,wT=wn.create,AT=Yt.create,xT=ac.create,CT=Oo.create,ET=Po.create,RT=sc.create,IT=An.create,TT=xn.create,_T=Cn.create,kT=En.create,OT=jr.create,PT=Ot.create,NT=_t.create,FT=Xt.create,DT=Ot.createWithPreprocess,MT=ta.create,qT=()=>Ky().optional(),jT=()=>Yy().optional(),LT=()=>Xy().optional(),VT={string:e=>Mr.create({...e,coerce:!0}),number:e=>mn.create({...e,coerce:!0}),boolean:e=>hn.create({...e,coerce:!0}),bigint:e=>gn.create({...e,coerce:!0}),date:e=>yn.create({...e,coerce:!0})};var UT=ue;var BT=R.object({name:R.string(),arguments:R.string()}),$T=R.object({id:R.string(),type:R.literal("function"),function:BT,encryptedValue:R.string().optional()}),cc=R.object({id:R.string(),role:R.string(),content:R.string().optional(),name:R.string().optional(),encryptedValue:R.string().optional()}),GT=R.object({type:R.literal("text"),text:R.string()}),Jy=R.object({type:R.literal("binary"),mimeType:R.string(),id:R.string().optional(),url:R.string().optional(),data:R.string().optional(),filename:R.string().optional()}),Zy=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:R.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},TW=Jy.superRefine((e,t)=>{Zy(e,t)}),QT=R.discriminatedUnion("type",[GT,Jy]),HT=QT.superRefine((e,t)=>{e.type==="binary"&&Zy(e,t)}),zT=cc.extend({role:R.literal("developer"),content:R.string()}),WT=cc.extend({role:R.literal("system"),content:R.string()}),KT=cc.extend({role:R.literal("assistant"),content:R.string().optional(),toolCalls:R.array($T).optional()}),YT=cc.extend({role:R.literal("user"),content:R.union([R.string(),R.array(HT)])}),XT=R.object({id:R.string(),content:R.string(),role:R.literal("tool"),toolCallId:R.string(),error:R.string().optional(),encryptedValue:R.string().optional()}),JT=R.object({id:R.string(),role:R.literal("activity"),activityType:R.string(),content:R.record(R.any())}),ZT=R.object({id:R.string(),role:R.literal("reasoning"),content:R.string(),encryptedValue:R.string().optional()}),eS=R.discriminatedUnion("role",[zT,WT,KT,YT,XT,JT,ZT]),_W=R.union([R.literal("developer"),R.literal("system"),R.literal("assistant"),R.literal("user"),R.literal("tool"),R.literal("activity"),R.literal("reasoning")]),e_=R.object({description:R.string(),value:R.string()}),t_=R.object({name:R.string(),description:R.string(),parameters:R.any()}),r_=R.object({threadId:R.string(),runId:R.string(),parentRunId:R.string().optional(),state:R.any(),messages:R.array(eS),tools:R.array(t_),context:R.array(e_),forwardedProps:R.any()}),n_=R.any(),Ve=class extends Error{constructor(e){super(e)}},cf=class extends Ve{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},tS=R.union([R.literal("developer"),R.literal("system"),R.literal("assistant"),R.literal("user")]),M=function(e){return e.TEXT_MESSAGE_START="TEXT_MESSAGE_START",e.TEXT_MESSAGE_CONTENT="TEXT_MESSAGE_CONTENT",e.TEXT_MESSAGE_END="TEXT_MESSAGE_END",e.TEXT_MESSAGE_CHUNK="TEXT_MESSAGE_CHUNK",e.TOOL_CALL_START="TOOL_CALL_START",e.TOOL_CALL_ARGS="TOOL_CALL_ARGS",e.TOOL_CALL_END="TOOL_CALL_END",e.TOOL_CALL_CHUNK="TOOL_CALL_CHUNK",e.TOOL_CALL_RESULT="TOOL_CALL_RESULT",e.THINKING_START="THINKING_START",e.THINKING_END="THINKING_END",e.THINKING_TEXT_MESSAGE_START="THINKING_TEXT_MESSAGE_START",e.THINKING_TEXT_MESSAGE_CONTENT="THINKING_TEXT_MESSAGE_CONTENT",e.THINKING_TEXT_MESSAGE_END="THINKING_TEXT_MESSAGE_END",e.STATE_SNAPSHOT="STATE_SNAPSHOT",e.STATE_DELTA="STATE_DELTA",e.MESSAGES_SNAPSHOT="MESSAGES_SNAPSHOT",e.ACTIVITY_SNAPSHOT="ACTIVITY_SNAPSHOT",e.ACTIVITY_DELTA="ACTIVITY_DELTA",e.RAW="RAW",e.CUSTOM="CUSTOM",e.RUN_STARTED="RUN_STARTED",e.RUN_FINISHED="RUN_FINISHED",e.RUN_ERROR="RUN_ERROR",e.STEP_STARTED="STEP_STARTED",e.STEP_FINISHED="STEP_FINISHED",e.REASONING_START="REASONING_START",e.REASONING_MESSAGE_START="REASONING_MESSAGE_START",e.REASONING_MESSAGE_CONTENT="REASONING_MESSAGE_CONTENT",e.REASONING_MESSAGE_END="REASONING_MESSAGE_END",e.REASONING_MESSAGE_CHUNK="REASONING_MESSAGE_CHUNK",e.REASONING_END="REASONING_END",e.REASONING_ENCRYPTED_VALUE="REASONING_ENCRYPTED_VALUE",e}({}),Re=R.object({type:R.nativeEnum(M),timestamp:R.number().optional(),rawEvent:R.any().optional()}).passthrough(),o_=Re.extend({type:R.literal(M.TEXT_MESSAGE_START),messageId:R.string(),role:tS.default("assistant")}),rS=Re.extend({type:R.literal(M.TEXT_MESSAGE_CONTENT),messageId:R.string(),delta:R.string().refine(e=>e.length>0,"Delta must not be an empty string")}),i_=Re.extend({type:R.literal(M.TEXT_MESSAGE_END),messageId:R.string()}),a_=Re.extend({type:R.literal(M.TEXT_MESSAGE_CHUNK),messageId:R.string().optional(),role:tS.optional(),delta:R.string().optional()}),s_=Re.extend({type:R.literal(M.THINKING_TEXT_MESSAGE_START)}),c_=rS.omit({messageId:!0,type:!0}).extend({type:R.literal(M.THINKING_TEXT_MESSAGE_CONTENT)}),u_=Re.extend({type:R.literal(M.THINKING_TEXT_MESSAGE_END)}),l_=Re.extend({type:R.literal(M.TOOL_CALL_START),toolCallId:R.string(),toolCallName:R.string(),parentMessageId:R.string().optional()}),d_=Re.extend({type:R.literal(M.TOOL_CALL_ARGS),toolCallId:R.string(),delta:R.string()}),f_=Re.extend({type:R.literal(M.TOOL_CALL_END),toolCallId:R.string()}),p_=Re.extend({messageId:R.string(),type:R.literal(M.TOOL_CALL_RESULT),toolCallId:R.string(),content:R.string(),role:R.literal("tool").optional()}),m_=Re.extend({type:R.literal(M.TOOL_CALL_CHUNK),toolCallId:R.string().optional(),toolCallName:R.string().optional(),parentMessageId:R.string().optional(),delta:R.string().optional()}),g_=Re.extend({type:R.literal(M.THINKING_START),title:R.string().optional()}),h_=Re.extend({type:R.literal(M.THINKING_END)}),y_=Re.extend({type:R.literal(M.STATE_SNAPSHOT),snapshot:n_}),S_=Re.extend({type:R.literal(M.STATE_DELTA),delta:R.array(R.any())}),v_=Re.extend({type:R.literal(M.MESSAGES_SNAPSHOT),messages:R.array(eS)}),b_=Re.extend({type:R.literal(M.ACTIVITY_SNAPSHOT),messageId:R.string(),activityType:R.string(),content:R.record(R.any()),replace:R.boolean().optional().default(!0)}),w_=Re.extend({type:R.literal(M.ACTIVITY_DELTA),messageId:R.string(),activityType:R.string(),patch:R.array(R.any())}),A_=Re.extend({type:R.literal(M.RAW),event:R.any(),source:R.string().optional()}),x_=Re.extend({type:R.literal(M.CUSTOM),name:R.string(),value:R.any()}),C_=Re.extend({type:R.literal(M.RUN_STARTED),threadId:R.string(),runId:R.string(),parentRunId:R.string().optional(),input:r_.optional()}),E_=Re.extend({type:R.literal(M.RUN_FINISHED),threadId:R.string(),runId:R.string(),result:R.any().optional()}),R_=Re.extend({type:R.literal(M.RUN_ERROR),message:R.string(),code:R.string().optional()}),I_=Re.extend({type:R.literal(M.STEP_STARTED),stepName:R.string()}),T_=Re.extend({type:R.literal(M.STEP_FINISHED),stepName:R.string()}),__=R.union([R.literal("tool-call"),R.literal("message")]),k_=Re.extend({type:R.literal(M.REASONING_START),messageId:R.string()}),O_=Re.extend({type:R.literal(M.REASONING_MESSAGE_START),messageId:R.string(),role:R.literal("reasoning")}),P_=Re.extend({type:R.literal(M.REASONING_MESSAGE_CONTENT),messageId:R.string(),delta:R.string().refine(e=>e.length>0,"Delta must not be an empty string")}),N_=Re.extend({type:R.literal(M.REASONING_MESSAGE_END),messageId:R.string()}),F_=Re.extend({type:R.literal(M.REASONING_MESSAGE_CHUNK),messageId:R.string().optional(),delta:R.string().optional()}),D_=Re.extend({type:R.literal(M.REASONING_END),messageId:R.string()}),M_=Re.extend({type:R.literal(M.REASONING_ENCRYPTED_VALUE),subtype:__,entityId:R.string(),encryptedValue:R.string()}),uc=R.discriminatedUnion("type",[o_,rS,i_,a_,g_,h_,s_,c_,u_,l_,d_,f_,m_,p_,y_,S_,v_,b_,w_,A_,x_,C_,E_,R_,I_,T_,k_,O_,P_,N_,F_,D_,M_]);m();d();p();f();var uf={};Zo(uf,{JsonPatchError:()=>$e,_areEquals:()=>oa,applyOperation:()=>_n,applyPatch:()=>Lr,applyReducer:()=>U_,deepClone:()=>L_,getValueByPointer:()=>mc,validate:()=>oS,validator:()=>gc});m();d();p();f();m();d();p();f();var q_=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),j_=Object.prototype.hasOwnProperty;function dc(e,t){return j_.call(e,t)}function fc(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)dc(e,o)&&n.push(o);return n}function st(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function pc(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 Jt(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function ra(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function lc(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(lc(e[t]))return!0}else if(typeof e=="object"){for(var n=fc(e),o=n.length,i=0;i<o;i++)if(lc(e[n[i]]))return!0}}return!1}function nS(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 na=function(e){q_(t,e);function t(r,n,o,i,a){var s=this.constructor,c=e.call(this,nS(r,{name:n,index:o,operation:i,tree:a}))||this;return c.name=n,c.index=o,c.operation=i,c.tree=a,Object.setPrototypeOf(c,s.prototype),c.message=nS(r,{name:n,index:o,operation:i,tree:a}),c}return t}(Error);var $e=na,L_=st,Fo={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=mc(r,this.path);n&&(n=st(n));var o=_n(r,{op:"remove",path:this.from}).removed;return _n(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=mc(r,this.from);return _n(r,{op:"add",path:this.path,value:st(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:oa(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},V_={add:function(e,t,r){return pc(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:Fo.move,copy:Fo.copy,test:Fo.test,_get:Fo._get};function mc(e,t){if(t=="")return e;var r={op:"_get",path:t};return _n(e,r),r.value}function _n(e,t,r,n,o,i){if(r===void 0&&(r=!1),n===void 0&&(n=!0),o===void 0&&(o=!0),i===void 0&&(i=0),r&&(typeof r=="function"?r(t,0,e,t.path):gc(t,0)),t.path===""){var a={newDocument:e};if(t.op==="add")return a.newDocument=t.value,a;if(t.op==="replace")return a.newDocument=t.value,a.removed=e,a;if(t.op==="move"||t.op==="copy")return a.newDocument=mc(e,t.from),t.op==="move"&&(a.removed=e),a;if(t.op==="test"){if(a.test=oa(e,t.value),a.test===!1)throw new $e("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a.newDocument=e,a}else{if(t.op==="remove")return a.removed=e,a.newDocument=null,a;if(t.op==="_get")return t.value=e,a;if(r)throw new $e("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",i,t,e);return a}}else{n||(e=st(e));var s=t.path||"",c=s.split("/"),u=e,h=1,S=c.length,v=void 0,g=void 0,y=void 0;for(typeof r=="function"?y=r:y=gc;;){if(g=c[h],g&&g.indexOf("~")!=-1&&(g=ra(g)),o&&(g=="__proto__"||g=="prototype"&&h>0&&c[h-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&v===void 0&&(u[g]===void 0?v=c.slice(0,h).join("/"):h==S-1&&(v=t.path),v!==void 0&&y(t,0,e,v)),h++,Array.isArray(u)){if(g==="-")g=u.length;else{if(r&&!pc(g))throw new $e("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",i,t,e);pc(g)&&(g=~~g)}if(h>=S){if(r&&t.op==="add"&&g>u.length)throw new $e("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",i,t,e);var a=V_[t.op].call(t,u,g,e);if(a.test===!1)throw new $e("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}}else if(h>=S){var a=Fo[t.op].call(t,u,g,e);if(a.test===!1)throw new $e("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}if(u=u[g],r&&h<S&&(!u||typeof u!="object"))throw new $e("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",i,t,e)}}}function Lr(e,t,r,n,o){if(n===void 0&&(n=!0),o===void 0&&(o=!0),r&&!Array.isArray(t))throw new $e("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=st(e));for(var i=new Array(t.length),a=0,s=t.length;a<s;a++)i[a]=_n(e,t[a],r,!0,o,a),e=i[a].newDocument;return i.newDocument=e,i}function U_(e,t,r){var n=_n(e,t);if(n.test===!1)throw new $e("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function gc(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new $e("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(Fo[e.op]){if(typeof e.path!="string")throw new $e("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new $e("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 $e("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 $e("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")&&lc(e.value))throw new $e("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var o=e.path.split("/").length,i=n.split("/").length;if(o!==i+1&&o!==i)throw new $e("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 $e("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var a={op:"_get",path:e.from,value:void 0},s=oS([a],r);if(s&&s.name==="OPERATION_PATH_UNRESOLVABLE")throw new $e("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new $e("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function oS(e,t,r){try{if(!Array.isArray(e))throw new $e("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Lr(st(t),st(e),r||!0);else{r=r||gc;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(o){if(o instanceof $e)return o;throw o}}function oa(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),o,i,a;if(r&&n){if(i=e.length,i!=t.length)return!1;for(o=i;o--!==0;)if(!oa(e[o],t[o]))return!1;return!0}if(r!=n)return!1;var s=Object.keys(e);if(i=s.length,i!==Object.keys(t).length)return!1;for(o=i;o--!==0;)if(!t.hasOwnProperty(s[o]))return!1;for(o=i;o--!==0;)if(a=s[o],!oa(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var pf={};Zo(pf,{compare:()=>K_,generate:()=>lf,observe:()=>W_,unobserve:()=>z_});m();d();p();f();var df=new WeakMap,B_=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),$_=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function G_(e){return df.get(e)}function Q_(e,t){return e.observers.get(t)}function H_(e,t){e.observers.delete(t.callback)}function z_(e,t){t.unobserve()}function W_(e,t){var r=[],n,o=G_(e);if(!o)o=new B_(e),df.set(e,o);else{var i=Q_(o,t);n=i&&i.observer}if(n)return n;if(n={},o.value=st(e),t){n.callback=t,n.next=null;var a=function(){lf(n)},s=function(){clearTimeout(n.next),n.next=setTimeout(a)};typeof window<"u"&&(window.addEventListener("mouseup",s),window.addEventListener("keyup",s),window.addEventListener("mousedown",s),window.addEventListener("keydown",s),window.addEventListener("change",s))}return n.patches=r,n.object=e,n.unobserve=function(){lf(n),clearTimeout(n.next),H_(o,n),typeof window<"u"&&(window.removeEventListener("mouseup",s),window.removeEventListener("keyup",s),window.removeEventListener("mousedown",s),window.removeEventListener("keydown",s),window.removeEventListener("change",s))},o.observers.set(t,new $_(t,n)),n}function lf(e,t){t===void 0&&(t=!1);var r=df.get(e.object);ff(r.value,e.object,e.patches,"",t),e.patches.length&&Lr(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function ff(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var i=fc(t),a=fc(e),s=!1,c=!1,u=a.length-1;u>=0;u--){var h=a[u],S=e[h];if(dc(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)?ff(S,v,r,n+"/"+Jt(h),o):S!==v&&(s=!0,o&&r.push({op:"test",path:n+"/"+Jt(h),value:st(S)}),r.push({op:"replace",path:n+"/"+Jt(h),value:st(v)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+Jt(h),value:st(S)}),r.push({op:"remove",path:n+"/"+Jt(h)}),c=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),s=!0)}if(!(!c&&i.length==a.length))for(var u=0;u<i.length;u++){var h=i[u];!dc(e,h)&&t[h]!==void 0&&r.push({op:"add",path:n+"/"+Jt(h),value:st(t[h])})}}}function K_(e,t,r){r===void 0&&(r=!1);var n=[];return ff(e,t,n,"",r),n}var e6=Object.assign({},uf,pf,{JsonPatchError:na,deepClone:st,escapePathComponent:Jt,unescapePathComponent:ra});m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();var mf=function(e,t){return mf=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])},mf(e,t)};function Zt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");mf(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function iS(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(h){try{u(n.next(h))}catch(S){a(S)}}function c(h){try{u(n.throw(h))}catch(S){a(S)}}function u(h){h.done?i(h.value):o(h.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}function hc(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(h){return c([u,h])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(r=0)),r;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(h){u=[6,h],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function yr(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 Do(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-->0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function Mo(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function kn(e){return this instanceof kn?(this.v=e,this):new kn(e)}function aS(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(g){return function(y){return Promise.resolve(y).then(g,S)}}function s(g,y){n[g]&&(o[g]=function(x){return new Promise(function(C,E){i.push([g,x,C,E])>1||c(g,x)})},y&&(o[g]=y(o[g])))}function c(g,y){try{u(n[g](y))}catch(x){v(i[0][3],x)}}function u(g){g.value instanceof kn?Promise.resolve(g.value.v).then(h,S):v(i[0][2],g)}function h(g){c("next",g)}function S(g){c("throw",g)}function v(g,y){g(y),i.shift(),i.length&&c(i[0][0],i[0][1])}}function sS(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 yr=="function"?yr(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(s,c){a=e[i](a),o(s,c,a.done,a.value)})}}function o(i,a,s,c){Promise.resolve(c).then(function(u){i({value:u,done:s})},a)}}m();d();p();f();function be(e){return typeof e=="function"}m();d();p();f();m();d();p();f();m();d();p();f();function qo(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 yc=qo(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}});m();d();p();f();function $i(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var No=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=cr(a),c=s.next();!c.done;c=s.next()){var u=c.value;u.remove(this)}}catch(C){t={error:C}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var h=this.initialTeardown;if(Se(h))try{h()}catch(C){i=C instanceof Bs?C.errors:[C]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var S=cr(v),g=S.next();!g.done;g=S.next()){var y=g.value;try{vy(y)}catch(C){i=i??[],C instanceof Bs?i=Oo(Oo([],ko(i)),ko(C.errors)):i.push(C)}}}catch(C){n={error:C}}finally{try{g&&!g.done&&(o=S.return)&&o.call(S)}finally{if(n)throw n.error}}}if(i)throw new Bs(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)vy(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)&&$i(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&$i(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var Vd=No.EMPTY;function $s(e){return e instanceof No||e&&"closed"in e&&Se(e.remove)&&Se(e.add)&&Se(e.unsubscribe)}function vy(e){Se(e)?e():e.unsubscribe()}m();d();p();f();var Nt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};m();d();p();f();m();d();p();f();var Fo={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Fo.delegate;return o?.setTimeout?o.setTimeout.apply(o,Oo([e,t],ko(r))):setTimeout.apply(void 0,Oo([e,t],ko(r)))},clearTimeout:function(e){var t=Fo.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Gs(e){Fo.setTimeout(function(){var t=Nt.onUnhandledError;if(t)t(e);else throw e})}m();d();p();f();function Gi(){}m();d();p();f();var Sy=function(){return Ud("C",void 0,void 0)}();function by(e){return Ud("E",void 0,e)}function Ay(e){return Ud("N",e,void 0)}function Ud(e,t,r){return{kind:e,value:t,error:r}}m();d();p();f();var bn=null;function Do(e){if(Nt.useDeprecatedSynchronousErrorHandling){var t=!bn;if(t&&(bn={errorThrown:!1,error:null}),e(),t){var r=bn,n=r.errorThrown,o=r.error;if(bn=null,n)throw o}}else e()}function wy(e){Nt.useDeprecatedSynchronousErrorHandling&&bn&&(bn.errorThrown=!0,bn.error=e)}var Qi=function(e){Ht(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,$s(r)&&r.add(n)):n.destination=YT,n}return t.create=function(r,n,o){return new Hs(r,n,o)},t.prototype.next=function(r){this.isStopped?$d(Ay(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?$d(by(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?$d(Sy,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}(No);var zT=Function.prototype.bind;function Bd(e,t){return zT.call(e,t)}var WT=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){Qs(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Qs(n)}else Qs(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Qs(r)}},e}(),Hs=function(e){Ht(t,e);function t(r,n,o){var i=e.call(this)||this,a;if(Se(r)||!r)a={next:r??void 0,error:n??void 0,complete:o??void 0};else{var s;i&&Nt.useDeprecatedNextContext?(s=Object.create(r),s.unsubscribe=function(){return i.unsubscribe()},a={next:r.next&&Bd(r.next,s),error:r.error&&Bd(r.error,s),complete:r.complete&&Bd(r.complete,s)}):a=r}return i.destination=new WT(a),i}return t}(Qi);function Qs(e){Nt.useDeprecatedSynchronousErrorHandling?wy(e):Gs(e)}function KT(e){throw e}function $d(e,t){var r=Nt.onStoppedNotification;r&&Fo.setTimeout(function(){return r(e,t)})}var YT={closed:!0,next:Gi,error:KT,complete:Gi};m();d();p();f();var Mo=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();m();d();p();f();m();d();p();f();function qo(e){return e}function zs(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Gd(e)}function Gd(e){return e.length===0?qo:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var Ne=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,i=JT(t)?t:new Hs(t,r,n);return Do(function(){var a=o,s=a.operator,c=a.source;i.add(s?s.call(i,c):c?o._subscribe(i):o._trySubscribe(i))}),i},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=xy(r),new r(function(o,i){var a=new Hs({next:function(s){try{t(s)}catch(c){i(c),a.unsubscribe()}},error:i,complete:o});n.subscribe(a)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[Mo]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Gd(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=xy(t),new t(function(n,o){var i;r.subscribe(function(a){return i=a},function(a){return o(a)},function(){return n(i)})})},e.create=function(t){return new e(t)},e}();function xy(e){var t;return(t=e??Nt.Promise)!==null&&t!==void 0?t:Promise}function XT(e){return e&&Se(e.next)&&Se(e.error)&&Se(e.complete)}function JT(e){return e&&e instanceof Qi||XT(e)&&$s(e)}m();d();p();f();function ZT(e){return Se(e?.lift)}function $e(e){return function(t){if(ZT(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}m();d();p();f();function Ge(e,t,r,n,o){return new e_(e,t,r,n,o)}var e_=function(e){Ht(t,e);function t(r,n,o,i,a,s){var c=e.call(this,r)||this;return c.onFinalize=a,c.shouldUnsubscribe=s,c._next=n?function(u){try{n(u)}catch(h){r.error(h)}}:e.prototype._next,c._error=i?function(u){try{i(u)}catch(h){r.error(h)}finally{this.unsubscribe()}}:e.prototype._error,c._complete=o?function(){try{o()}catch(u){r.error(u)}finally{this.unsubscribe()}}:e.prototype._complete,c}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t}(Qi);m();d();p();f();m();d();p();f();var Cy=Po(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var zt=function(e){Ht(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 Ey(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Cy},t.prototype.next=function(r){var n=this;Do(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=cr(n.currentObservers),s=a.next();!s.done;s=a.next()){var c=s.value;c.next(r)}}catch(u){o={error:u}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;Do(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;Do(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,a=o.isStopped,s=o.observers;return i||a?Vd:(this.currentObservers=null,s.push(r),new No(function(){n.currentObservers=null,$i(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,a=n.isStopped;o?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new Ne;return r.source=this,r},t.create=function(r,n){return new Ey(r,n)},t}(Ne);var Ey=function(e){Ht(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:Vd},t}(zt);m();d();p();f();m();d();p();f();var Qd={now:function(){return(Qd.delegate||Date).now()},delegate:void 0};var Ws=function(e){Ht(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=Qd);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(r){var n=this,o=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,s=n._timestampProvider,c=n._windowTime;o||(i.push(r),!a&&i.push(s.now()+c)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,i=o._infiniteTimeWindow,a=o._buffer,s=a.slice(),c=0;c<s.length&&!r.closed;c+=i?1:2)r.next(s[c]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,i=r._buffer,a=r._infiniteTimeWindow,s=(a?1:2)*n;if(n<1/0&&s<i.length&&i.splice(0,i.length-s),!a){for(var c=o.now(),u=0,h=1;h<i.length&&i[h]<=c;h+=2)u=h;u&&i.splice(0,u+1)}},t}(zt);m();d();p();f();var Ks=new Ne(function(e){return e.complete()});m();d();p();f();m();d();p();f();m();d();p();f();function Ry(e){return e&&Se(e.schedule)}function t_(e){return e[e.length-1]}function Iy(e){return Ry(t_(e))?e.pop():void 0}m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();var Ys=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};m();d();p();f();function Xs(e){return Se(e?.then)}m();d();p();f();function Js(e){return Se(e[Mo])}m();d();p();f();function Zs(e){return Symbol.asyncIterator&&Se(e?.[Symbol.asyncIterator])}m();d();p();f();function ec(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}m();d();p();f();m();d();p();f();function r_(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var tc=r_();function rc(e){return Se(e?.[tc])}m();d();p();f();function nc(e){return hy(this,arguments,function(){var r,n,o,i;return Us(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Sn(r.read())];case 3:return n=a.sent(),o=n.value,i=n.done,i?[4,Sn(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Sn(o)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function oc(e){return Se(e?.getReader)}function Qe(e){if(e instanceof Ne)return e;if(e!=null){if(Js(e))return n_(e);if(Ys(e))return o_(e);if(Xs(e))return i_(e);if(Zs(e))return Ty(e);if(rc(e))return a_(e);if(oc(e))return s_(e)}throw ec(e)}function n_(e){return new Ne(function(t){var r=e[Mo]();if(Se(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function o_(e){return new Ne(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function i_(e){return new Ne(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Gs)})}function a_(e){return new Ne(function(t){var r,n;try{for(var o=cr(e),i=o.next();!i.done;i=o.next()){var a=i.value;if(t.next(a),t.closed)return}}catch(s){r={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function Ty(e){return new Ne(function(t){c_(e,t).catch(function(r){return t.error(r)})})}function s_(e){return Ty(nc(e))}function c_(e,t){var r,n,o,i;return gy(this,void 0,void 0,function(){var a,s;return Us(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=yy(e),c.label=1;case 1:return[4,r.next()];case 2:if(n=c.sent(),!!n.done)return[3,4];if(a=n.value,t.next(a),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),o={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(i=r.return)?[4,i.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}m();d();p();f();m();d();p();f();function Tt(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var i=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(i),!o)return i}function ic(e,t){return t===void 0&&(t=0),$e(function(r,n){r.subscribe(Ge(n,function(o){return Tt(n,e,function(){return n.next(o)},t)},function(){return Tt(n,e,function(){return n.complete()},t)},function(o){return Tt(n,e,function(){return n.error(o)},t)}))})}m();d();p();f();function ac(e,t){return t===void 0&&(t=0),$e(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function _y(e,t){return Qe(e).pipe(ac(t),ic(t))}m();d();p();f();function ky(e,t){return Qe(e).pipe(ac(t),ic(t))}m();d();p();f();function Oy(e,t){return new Ne(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}m();d();p();f();function Py(e,t){return new Ne(function(r){var n;return Tt(r,t,function(){n=e[tc](),Tt(r,t,function(){var o,i,a;try{o=n.next(),i=o.value,a=o.done}catch(s){r.error(s);return}a?r.complete():r.next(i)},0,!0)}),function(){return Se(n?.return)&&n.return()}})}m();d();p();f();function sc(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ne(function(r){Tt(r,t,function(){var n=e[Symbol.asyncIterator]();Tt(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}m();d();p();f();function Ny(e,t){return sc(nc(e),t)}function Fy(e,t){if(e!=null){if(Js(e))return _y(e,t);if(Ys(e))return Oy(e,t);if(Xs(e))return ky(e,t);if(Zs(e))return sc(e,t);if(rc(e))return Py(e,t);if(oc(e))return Ny(e,t)}throw ec(e)}function An(e,t){return t?Fy(e,t):Qe(e)}function je(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Iy(e);return An(e,r)}m();d();p();f();function Fe(e,t){var r=Se(e)?e:function(){return e},n=function(o){return o.error(r())};return new Ne(t?function(o){return t.schedule(n,0,o)}:n)}m();d();p();f();m();d();p();f();var Dy=Po(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function cc(e,t){var r=typeof t=="object";return new Promise(function(n,o){var i=!1,a;e.subscribe({next:function(s){a=s,i=!0},error:o,complete:function(){i?n(a):r?n(t.defaultValue):o(new Dy)}})})}m();d();p();f();function wn(e,t){return $e(function(r,n){var o=0;r.subscribe(Ge(n,function(i){n.next(e.call(t,i,o++))}))})}m();d();p();f();m();d();p();f();m();d();p();f();function My(e,t,r,n,o,i,a,s){var c=[],u=0,h=0,v=!1,S=function(){v&&!c.length&&!u&&t.complete()},g=function(C){return u<n?y(C):c.push(C)},y=function(C){i&&t.next(C),u++;var R=!1;Qe(r(C,h++)).subscribe(Ge(t,function(x){o?.(x),i?g(x):t.next(x)},function(){R=!0},void 0,function(){if(R)try{u--;for(var x=function(){var I=c.shift();a?Tt(t,a,function(){return y(I)}):y(I)};c.length&&u<n;)x();S()}catch(I){t.error(I)}}))};return e.subscribe(Ge(t,g,function(){v=!0,S()})),function(){s?.()}}function yt(e,t,r){return r===void 0&&(r=1/0),Se(t)?yt(function(n,o){return wn(function(i,a){return t(n,i,o,a)})(Qe(e(n,o)))},r):(typeof t=="number"&&(r=t),$e(function(n,o){return My(n,o,e,r)}))}function Hd(e){return e===void 0&&(e=1/0),yt(qo,e)}m();d();p();f();function zd(e){return new Ne(function(t){Qe(e()).subscribe(t)})}m();d();p();f();function Hi(e){return $e(function(t,r){var n=null,o=!1,i;n=t.subscribe(Ge(r,void 0,void 0,function(a){i=Qe(e(a,Hi(e)(t))),n?(n.unsubscribe(),n=null,i.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,i.subscribe(r))})}m();d();p();f();function uc(e,t){return Se(t)?yt(e,t,1):yt(e,1)}m();d();p();f();function Wd(e){return $e(function(t,r){var n=!1;t.subscribe(Ge(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}m();d();p();f();function xn(e){return $e(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}m();d();p();f();function Kd(e,t){return $e(function(r,n){var o=null,i=0,a=!1,s=function(){return a&&!o&&n.complete()};r.subscribe(Ge(n,function(c){o?.unsubscribe();var u=0,h=i++;Qe(e(c,h)).subscribe(o=Ge(n,function(v){return n.next(t?t(c,v,h,u++):v)},function(){o=null,s()}))},function(){a=!0,s()}))})}m();d();p();f();function lc(e){return $e(function(t,r){Qe(e).subscribe(Ge(r,function(){return r.complete()},Gi)),!r.closed&&t.subscribe(r)})}m();d();p();f();function Yd(e,t,r){var n=Se(e)||t||r?{next:e,error:t,complete:r}:e;return n?$e(function(o,i){var a;(a=n.subscribe)===null||a===void 0||a.call(n);var s=!0;o.subscribe(Ge(i,function(c){var u;(u=n.next)===null||u===void 0||u.call(n,c),i.next(c)},function(){var c;s=!1,(c=n.complete)===null||c===void 0||c.call(n),i.complete()},function(c){var u;s=!1,(u=n.error)===null||u===void 0||u.call(n,c),i.error(c)},function(){var c,u;s&&((c=n.unsubscribe)===null||c===void 0||c.call(n)),(u=n.finalize)===null||u===void 0||u.call(n)}))}):qo}m();d();p();f();m();d();p();f();function qy(e){return` \r
|
|
35
|
-
`.indexOf(e)>=0}function dc(e){for(var t=["topLevel"],r=0,n,o,i,a=function(I){return t.push(I)},s=function(I){return t[t.length-1]=I},c=function(I){n==null&&(n=r,o=t.length,i=I)},u=function(I){I===i&&(n=void 0,o=void 0,i=void 0)},h=function(){return t.pop()},v=function(){return r--},S=function(I){if("0"<=I&&I<="9"){a("number");return}switch(I){case"\"":a("string");return;case"-":a("numberNeedsDigit");return;case"t":a("true");return;case"f":a("false");return;case"n":a("null");return;case"[":a("arrayNeedsValue");return;case"{":a("objectNeedsKey");return}},g=e.length;r<g;r++){var y=e[r];switch(t[t.length-1]){case"topLevel":S(y);break;case"string":switch(y){case"\"":h();break;case"\\":c("stringEscape"),a("stringEscaped");break}break;case"stringEscaped":y==="u"?a("stringUnicode"):(u("stringEscape"),h());break;case"stringUnicode":r-e.lastIndexOf("u",r)===4&&(u("stringEscape"),h());break;case"number":y==="."?s("numberNeedsDigit"):y==="e"||y==="E"?s("numberNeedsExponent"):(y<"0"||y>"9")&&(v(),h());break;case"numberNeedsDigit":s("number");break;case"numberNeedsExponent":s(y==="+"||y==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(y<"a"||y>"z")&&(v(),h());break;case"arrayNeedsValue":y==="]"?h():qy(y)||(u("collectionItem"),s("arrayNeedsComma"),S(y));break;case"arrayNeedsComma":y==="]"?h():y===","&&(c("collectionItem"),s("arrayNeedsValue"));break;case"objectNeedsKey":y==="}"?h():y==="\""&&(c("collectionItem"),s("objectNeedsColon"),a("string"));break;case"objectNeedsColon":y===":"&&s("objectNeedsValue");break;case"objectNeedsValue":qy(y)||(u("collectionItem"),s("objectNeedsComma"),S(y));break;case"objectNeedsComma":y==="}"?h():y===","&&(c("collectionItem"),s("objectNeedsKey"));break}}o!=null&&(t.length=o);for(var C=[n!=null?e.slice(0,n):e],R=function(I){return C.push(I.slice(e.length-e.lastIndexOf(I[0])))},x=t.length-1;x>=0;x--)switch(t[x]){case"string":C.push("\"");break;case"numberNeedsDigit":case"numberNeedsExponent":C.push("0");break;case"true":R("true");break;case"false":R("false");break;case"null":R("null");break;case"arrayNeedsValue":case"arrayNeedsComma":C.push("]");break;case"objectNeedsKey":case"objectNeedsColon":case"objectNeedsValue":case"objectNeedsComma":C.push("}");break}return C.join("")}m();d();p();f();m();d();p();f();m();d();p();f();function Ly(){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 pc(e,t,r){for(let i=0;i<28;i=i+7){let a=e>>>i,s=!(!(a>>>7)&&t==0),c=(s?a|128:a)&255;if(r.push(c),!s)return}let n=e>>>28&15|(t&7)<<4,o=t>>3!=0;if(r.push((o?n|128:n)&255),!!o){for(let i=3;i<31;i=i+7){let a=t>>>i,s=!!(a>>>7),c=(s?a|128:a)&255;if(r.push(c),!s)return}r.push(t>>>31&1)}}var fc=4294967296;function Xd(e){let t=e[0]==="-";t&&(e=e.slice(1));let r=1e6,n=0,o=0;function i(a,s){let c=Number(e.slice(a,s));o*=r,n=n*r+c,n>=fc&&(o=o+(n/fc|0),n=n%fc)}return i(-24,-18),i(-18,-12),i(-12,-6),i(-6),t?Uy(n,o):Zd(n,o)}function Vy(e,t){let r=Zd(e,t),n=r.hi&2147483648;n&&(r=Uy(r.lo,r.hi));let o=Jd(r.lo,r.hi);return n?"-"+o:o}function Jd(e,t){if({lo:e,hi:t}=u_(e,t),t<=2097151)return String(fc*t+e);let r=e&16777215,n=(e>>>24|t<<8)&16777215,o=t>>16&65535,i=r+n*6777216+o*6710656,a=n+o*8147497,s=o*2,c=1e7;return i>=c&&(a+=Math.floor(i/c),i%=c),a>=c&&(s+=Math.floor(a/c),a%=c),s.toString()+jy(a)+jy(i)}function u_(e,t){return{lo:e>>>0,hi:t>>>0}}function Zd(e,t){return{lo:e|0,hi:t|0}}function Uy(e,t){return t=~t,e?e=~e+1:t+=1,Zd(e,t)}var jy=e=>{let t=String(e);return"0000000".slice(t.length)+t};function ef(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 By(){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}m();d();p();f();var Ft=l_();function l_(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!b.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let r=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),o=BigInt("0"),i=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(a){let s=typeof a=="bigint"?a:BigInt(a);if(s>n||s<r)throw new Error(`invalid int64: ${a}`);return s},uParse(a){let s=typeof a=="bigint"?a:BigInt(a);if(s>i||s<o)throw new Error(`invalid uint64: ${a}`);return s},enc(a){return e.setBigInt64(0,this.parse(a),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(a){return e.setBigInt64(0,this.uParse(a),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(a,s){return e.setInt32(0,a,!0),e.setInt32(4,s,!0),e.getBigInt64(0,!0)},uDec(a,s){return e.setInt32(0,a,!0),e.setInt32(4,s,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),$y(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),Gy(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),$y(r),Xd(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),Gy(r),Xd(r)},dec(r,n){return Vy(r,n)},uDec(r,n){return Jd(r,n)}}}function $y(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function Gy(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}m();d();p();f();var tf=Symbol.for("@bufbuild/protobuf/text-encoding");function rf(){if(b[tf]==null){let e=new b.TextEncoder,t=new b.TextDecoder;b[tf]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return b[tf]}var Pr;(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"})(Pr||(Pr={}));var d_=34028234663852886e22,f_=-34028234663852886e22,p_=4294967295,m_=2147483647,g_=-2147483648,Te=class{constructor(t=rf().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(Qy(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return nf(t),ef(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){h_(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){Qy(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){nf(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return nf(t),t=(t<<1^t>>31)>>>0,ef(t,this.buf),this}sfixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),o=Ft.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=Ft.uEnc(t);return n.setInt32(0,o.lo,!0),n.setInt32(4,o.hi,!0),this.raw(r)}int64(t){let r=Ft.enc(t);return pc(r.lo,r.hi,this.buf),this}sint64(t){let r=Ft.enc(t),n=r.hi>>31,o=r.lo<<1^n,i=(r.hi<<1|r.lo>>>31)^n;return pc(o,i,this.buf),this}uint64(t){let r=Ft.uEnc(t);return pc(r.lo,r.hi,this.buf),this}},oe=class{constructor(t,r=rf().decodeUtf8){this.decodeUtf8=r,this.varint64=Ly,this.uint32=By,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 Pr.Varint:for(;this.buf[this.pos++]&128;);break;case Pr.Bit64:this.pos+=4;case Pr.Bit32:this.pos+=4;break;case Pr.LengthDelimited:let o=this.uint32();this.pos+=o;break;case Pr.StartGroup:for(;;){let[i,a]=this.tag();if(a===Pr.EndGroup){if(r!==void 0&&i!==r)throw new Error("invalid end group tag");break}this.skip(a,i)}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 Ft.dec(...this.varint64())}uint64(){return Ft.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),n=-(t&1);return t=(t>>>1|(r&1)<<31)^n,r=r>>>1^n,Ft.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 Ft.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Ft.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 nf(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>m_||e<g_)throw new Error("invalid int32: "+e)}function Qy(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>p_||e<0)throw new Error("invalid uint32: "+e)}function h_(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>d_||e<f_))throw new Error("invalid float32: "+e)}var y_=function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function of(){return{fields:{}}}var zi={encode(e,t=new Te){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&cf.encode({key:r,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=of();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;let a=cf.decode(r,r.uint32());a.value!==void 0&&(o.fields[a.key]=a.value);continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return zi.fromPartial(e??{})},fromPartial(e){let t=of();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,o])=>(o!==void 0&&(r[n]=o),r),{}),t},wrap(e){let t=of();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 Hy(){return{key:"",value:void 0}}var cf={encode(e,t=new Te){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&xe.encode(xe.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Hy();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.key=r.string();continue;case 2:if(i!==18)break;o.value=xe.unwrap(xe.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return cf.fromPartial(e??{})},fromPartial(e){let t=Hy();return t.key=e.key??"",t.value=e.value??void 0,t}};function af(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var xe={encode(e,t=new Te){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&&zi.encode(zi.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&Wi.encode(Wi.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=af();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.nullValue=r.int32();continue;case 2:if(i!==17)break;o.numberValue=r.double();continue;case 3:if(i!==26)break;o.stringValue=r.string();continue;case 4:if(i!==32)break;o.boolValue=r.bool();continue;case 5:if(i!==42)break;o.structValue=zi.unwrap(zi.decode(r,r.uint32()));continue;case 6:if(i!==50)break;o.listValue=Wi.unwrap(Wi.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return xe.fromPartial(e??{})},fromPartial(e){let t=af();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=af();if(e===null)t.nullValue=y_.NULL_VALUE;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(b.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new b.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function sf(){return{values:[]}}var Wi={encode(e,t=new Te){for(let r of e.values)xe.encode(xe.wrap(r),t.uint32(10).fork()).join();return t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=sf();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.values.push(xe.unwrap(xe.decode(r,r.uint32())));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Wi.fromPartial(e??{})},fromPartial(e){let t=sf();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=sf();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&b.Array.isArray(e.values)?e.values:e}},v_=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 zy(){return{op:0,path:"",from:void 0,value:void 0}}var mc={encode(e,t=new Te){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&&xe.encode(xe.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=zy();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.op=r.int32();continue;case 2:if(i!==18)break;o.path=r.string();continue;case 3:if(i!==26)break;o.from=r.string();continue;case 4:if(i!==34)break;o.value=xe.unwrap(xe.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return mc.fromPartial(e??{})},fromPartial(e){let t=zy();return t.op=e.op??0,t.path=e.path??"",t.from=e.from??void 0,t.value=e.value??void 0,t}};function Wy(){return{id:"",type:"",function:void 0}}var gc={encode(e,t=new Te){return e.id!==""&&t.uint32(10).string(e.id),e.type!==""&&t.uint32(18).string(e.type),e.function!==void 0&&hc.encode(e.function,t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Wy();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.id=r.string();continue;case 2:if(i!==18)break;o.type=r.string();continue;case 3:if(i!==26)break;o.function=hc.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return gc.fromPartial(e??{})},fromPartial(e){let t=Wy();return t.id=e.id??"",t.type=e.type??"",t.function=e.function!==void 0&&e.function!==null?hc.fromPartial(e.function):void 0,t}};function Ky(){return{name:"",arguments:""}}var hc={encode(e,t=new Te){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 oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Ky();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.name=r.string();continue;case 2:if(i!==18)break;o.arguments=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return hc.fromPartial(e??{})},fromPartial(e){let t=Ky();return t.name=e.name??"",t.arguments=e.arguments??"",t}};function Yy(){return{id:"",role:"",content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0}}var yc={encode(e,t=new Te){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)gc.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 oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Yy();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.id=r.string();continue;case 2:if(i!==18)break;o.role=r.string();continue;case 3:if(i!==26)break;o.content=r.string();continue;case 4:if(i!==34)break;o.name=r.string();continue;case 5:if(i!==42)break;o.toolCalls.push(gc.decode(r,r.uint32()));continue;case 6:if(i!==50)break;o.toolCallId=r.string();continue;case 7:if(i!==58)break;o.error=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return yc.fromPartial(e??{})},fromPartial(e){let t=Yy();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=>gc.fromPartial(r))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t}},S_=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 Xy(){return{type:0,timestamp:void 0,rawEvent:void 0}}var ae={encode(e,t=new Te){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&xe.encode(xe.wrap(e.rawEvent),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Xy();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.type=r.int32();continue;case 2:if(i!==16)break;o.timestamp=b_(r.int64());continue;case 3:if(i!==26)break;o.rawEvent=xe.unwrap(xe.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return ae.fromPartial(e??{})},fromPartial(e){let t=Xy();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function Jy(){return{baseEvent:void 0,messageId:"",role:void 0}}var vc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.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 oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Jy();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.role=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return vc.fromPartial(e??{})},fromPartial(e){let t=Jy();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.role=e.role??void 0,t}};function Zy(){return{baseEvent:void 0,messageId:"",delta:""}}var Sc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.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 oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=Zy();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Sc.fromPartial(e??{})},fromPartial(e){let t=Zy();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.delta=e.delta??"",t}};function ev(){return{baseEvent:void 0,messageId:""}}var bc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=ev();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return bc.fromPartial(e??{})},fromPartial(e){let t=ev();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t}};function tv(){return{baseEvent:void 0,toolCallId:"",toolCallName:"",parentMessageId:void 0}}var Ac={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.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 oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=tv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.toolCallName=r.string();continue;case 4:if(i!==34)break;o.parentMessageId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ac.fromPartial(e??{})},fromPartial(e){let t=tv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.toolCallName=e.toolCallName??"",t.parentMessageId=e.parentMessageId??void 0,t}};function rv(){return{baseEvent:void 0,toolCallId:"",delta:""}}var wc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.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 oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=rv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return wc.fromPartial(e??{})},fromPartial(e){let t=rv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.delta=e.delta??"",t}};function nv(){return{baseEvent:void 0,toolCallId:""}}var xc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=nv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return xc.fromPartial(e??{})},fromPartial(e){let t=nv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t}};function ov(){return{baseEvent:void 0,snapshot:void 0}}var Cc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&xe.encode(xe.wrap(e.snapshot),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=ov();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.snapshot=xe.unwrap(xe.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Cc.fromPartial(e??{})},fromPartial(e){let t=ov();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function iv(){return{baseEvent:void 0,delta:[]}}var Ec={encode(e,t=new Te){e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.delta)mc.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=iv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.delta.push(mc.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ec.fromPartial(e??{})},fromPartial(e){let t=iv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(r=>mc.fromPartial(r))||[],t}};function av(){return{baseEvent:void 0,messages:[]}}var Rc={encode(e,t=new Te){e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.messages)yc.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=av();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messages.push(yc.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Rc.fromPartial(e??{})},fromPartial(e){let t=av();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(r=>yc.fromPartial(r))||[],t}};function sv(){return{baseEvent:void 0,event:void 0,source:void 0}}var Ic={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&xe.encode(xe.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 oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=sv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.event=xe.unwrap(xe.decode(r,r.uint32()));continue;case 3:if(i!==26)break;o.source=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ic.fromPartial(e??{})},fromPartial(e){let t=sv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function cv(){return{baseEvent:void 0,name:"",value:void 0}}var Tc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==""&&t.uint32(18).string(e.name),e.value!==void 0&&xe.encode(xe.wrap(e.value),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=cv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.name=r.string();continue;case 3:if(i!==26)break;o.value=xe.unwrap(xe.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Tc.fromPartial(e??{})},fromPartial(e){let t=cv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.name=e.name??"",t.value=e.value??void 0,t}};function uv(){return{baseEvent:void 0,threadId:"",runId:""}}var _c={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.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 oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=uv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.threadId=r.string();continue;case 3:if(i!==26)break;o.runId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return _c.fromPartial(e??{})},fromPartial(e){let t=uv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t}};function lv(){return{baseEvent:void 0,threadId:"",runId:"",result:void 0}}var kc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.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&&xe.encode(xe.wrap(e.result),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=lv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.threadId=r.string();continue;case 3:if(i!==26)break;o.runId=r.string();continue;case 4:if(i!==34)break;o.result=xe.unwrap(xe.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return kc.fromPartial(e??{})},fromPartial(e){let t=lv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t.result=e.result??void 0,t}};function dv(){return{baseEvent:void 0,code:void 0,message:""}}var Oc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.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 oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=dv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.code=r.string();continue;case 3:if(i!==26)break;o.message=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Oc.fromPartial(e??{})},fromPartial(e){let t=dv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??"",t}};function fv(){return{baseEvent:void 0,stepName:""}}var Pc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=fv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.stepName=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Pc.fromPartial(e??{})},fromPartial(e){let t=fv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function pv(){return{baseEvent:void 0,stepName:""}}var Nc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=pv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.stepName=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Nc.fromPartial(e??{})},fromPartial(e){let t=pv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function mv(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0}}var Fc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.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 oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=mv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.role=r.string();continue;case 4:if(i!==34)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Fc.fromPartial(e??{})},fromPartial(e){let t=mv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.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 gv(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var Dc={encode(e,t=new Te){return e.baseEvent!==void 0&&ae.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 oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=gv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ae.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.toolCallName=r.string();continue;case 4:if(i!==34)break;o.parentMessageId=r.string();continue;case 5:if(i!==42)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Dc.fromPartial(e??{})},fromPartial(e){let t=gv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ae.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 hv(){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 yv={encode(e,t=new Te){return e.textMessageStart!==void 0&&vc.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&Sc.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&bc.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&Ac.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&wc.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&xc.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&Cc.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&Ec.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&Rc.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&Ic.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&Tc.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&_c.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&kc.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&Oc.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&Pc.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&Nc.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&Fc.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&Dc.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t},decode(e,t){let r=e instanceof oe?e:new oe(e),n=t===void 0?r.len:r.pos+t,o=hv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.textMessageStart=vc.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.textMessageContent=Sc.decode(r,r.uint32());continue;case 3:if(i!==26)break;o.textMessageEnd=bc.decode(r,r.uint32());continue;case 4:if(i!==34)break;o.toolCallStart=Ac.decode(r,r.uint32());continue;case 5:if(i!==42)break;o.toolCallArgs=wc.decode(r,r.uint32());continue;case 6:if(i!==50)break;o.toolCallEnd=xc.decode(r,r.uint32());continue;case 7:if(i!==58)break;o.stateSnapshot=Cc.decode(r,r.uint32());continue;case 8:if(i!==66)break;o.stateDelta=Ec.decode(r,r.uint32());continue;case 9:if(i!==74)break;o.messagesSnapshot=Rc.decode(r,r.uint32());continue;case 10:if(i!==82)break;o.raw=Ic.decode(r,r.uint32());continue;case 11:if(i!==90)break;o.custom=Tc.decode(r,r.uint32());continue;case 12:if(i!==98)break;o.runStarted=_c.decode(r,r.uint32());continue;case 13:if(i!==106)break;o.runFinished=kc.decode(r,r.uint32());continue;case 14:if(i!==114)break;o.runError=Oc.decode(r,r.uint32());continue;case 15:if(i!==122)break;o.stepStarted=Pc.decode(r,r.uint32());continue;case 16:if(i!==130)break;o.stepFinished=Nc.decode(r,r.uint32());continue;case 17:if(i!==138)break;o.textMessageChunk=Fc.decode(r,r.uint32());continue;case 18:if(i!==146)break;o.toolCallChunk=Dc.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return yv.fromPartial(e??{})},fromPartial(e){let t=hv();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?vc.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?Sc.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?bc.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?Ac.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?wc.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?xc.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?Cc.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?Ec.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?Rc.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?Ic.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?Tc.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?_c.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?kc.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?Oc.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?Pc.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?Nc.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?Fc.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?Dc.fromPartial(e.toolCallChunk):void 0,t}};function b_(e){let t=b.Number(e.toString());if(t>b.Number.MAX_SAFE_INTEGER)throw new b.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(t<b.Number.MIN_SAFE_INTEGER)throw new b.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return t}function vv(e){let t=yv.decode(e),r=Object.values(t).find(n=>n!==void 0);if(!r)throw new Error("Invalid event");if(r.type=S_[r.baseEvent.type],r.timestamp=r.baseEvent.timestamp,r.rawEvent=r.baseEvent.rawEvent,r.type===F.MESSAGES_SNAPSHOT)for(let n of r.messages){let o=n;o.toolCalls?.length===0&&(o.toolCalls=void 0)}if(r.type===F.STATE_DELTA)for(let n of r.delta)n.op=v_[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]}),Fs.parse(r)}var Sv="application/vnd.ag-ui.event+proto";m();d();p();f();m();d();p();f();m();d();p();f();var w_=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,uf=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(w_);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},bv=e=>e==="*"||e==="x"||e==="X",Av=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},x_=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],C_=(e,t)=>{if(bv(e)||bv(t))return 0;let[r,n]=x_(Av(e),Av(t));return r>n?1:r<n?-1:0},lf=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=C_(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var Mc=(e,t)=>{let r=uf(e),n=uf(t),o=r.pop(),i=n.pop(),a=lf(r,n);return a!==0?a:o&&i?lf(o.split("."),i.split(".")):o||i?o?-1:1:0};var ke=e=>{if(typeof structuredClone=="function")return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return{...e}}};function Ki(){return Rr()}function _e(_x84,_x85,_x86,_x87){return _e2.apply(this,arguments)}function _e2(){_e2=_asyncToGenerator(function*(e,t,r,n){let o=t,i=r,a;for(let s of e)try{let c=yield n(s,ke(o),ke(i));if(c===void 0)continue;if(c.messages!==void 0&&(o=c.messages),c.state!==void 0&&(i=c.state),a=c.stopPropagation,a===!0)break}catch(c){process.env.VITEST_WORKER_ID!==void 0||console.error("Subscriber error:",c);continue}return{...(JSON.stringify(o)===JSON.stringify(t)?{}:{messages:o}),...(JSON.stringify(i)===JSON.stringify(r)?{}:{state:i}),...(a===void 0?{}:{stopPropagation:a})}});return _e2.apply(this,arguments)}var Iv=(e,t,r,n)=>{let o=ke(r.messages),i=ke(e.state),a={},s=u=>{u.messages!==void 0&&(o=u.messages,a.messages=u.messages),u.state!==void 0&&(i=u.state,a.state=u.state)},c=()=>{let u=ke(a);return a={},u.messages!==void 0||u.state!==void 0?je(u):Ks};return t.pipe(uc(/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(u){let h=yield _e(n,o,i,(v,S,g)=>v.onEvent?.({event:u,agent:r,input:e,messages:S,state:g}));if(s(h),h.stopPropagation===!0)return c();switch(u.type){case F.TEXT_MESSAGE_START:{let v=yield _e(n,o,i,(S,g,y)=>S.onTextMessageStartEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(v),v.stopPropagation!==!0){let{messageId:S,role:g="assistant"}=u;if(!o.find(y=>y.id===S)){let y={id:S,role:g,content:""};o.push(y),s({messages:o})}}return c()}case F.TEXT_MESSAGE_CONTENT:{let{messageId:v,delta:S}=u,g=o.find(C=>C.id===v);if(!g)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${v}'`),c();let y=yield _e(n,o,i,(C,R,x)=>C.onTextMessageContentEvent?.({event:u,messages:R,state:x,agent:r,input:e,textMessageBuffer:typeof g.content=="string"?g.content:""}));return s(y),y.stopPropagation!==!0&&(g.content=`${typeof g.content=="string"?g.content:""}${S}`,s({messages:o})),c()}case F.TEXT_MESSAGE_END:{let{messageId:v}=u,S=o.find(g=>g.id===v);return S?(s(yield _e(n,o,i,(g,y,C)=>g.onTextMessageEndEvent?.({event:u,messages:y,state:C,agent:r,input:e,textMessageBuffer:typeof S.content=="string"?S.content:""}))),yield Promise.all(n.map(g=>{g.onNewMessage?.({message:S,messages:o,state:i,agent:r,input:e})})),c()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${v}'`),c())}case F.TOOL_CALL_START:{let v=yield _e(n,o,i,(S,g,y)=>S.onToolCallStartEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(v),v.stopPropagation!==!0){let{toolCallId:S,toolCallName:g,parentMessageId:y}=u,C;y&&o.length>0&&o[o.length-1].id===y?C=o[o.length-1]:(C={id:y||S,role:"assistant",toolCalls:[]},o.push(C)),C.toolCalls??(C.toolCalls=[]),C.toolCalls.push({id:S,type:"function",function:{name:g,arguments:""}}),s({messages:o})}return c()}case F.TOOL_CALL_ARGS:{let{toolCallId:v,delta:S}=u,g=o.find(R=>R.toolCalls?.some(x=>x.id===v));if(!g)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${v}'`),c();let y=g.toolCalls?.find(R=>R.id===v);if(!y)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${v}'`),c();let C=yield _e(n,o,i,(R,x,I)=>{let T=y.function.arguments,_=y.function.name,j={};try{j=dc(T)}catch{}return R.onToolCallArgsEvent?.({event:u,messages:x,state:I,agent:r,input:e,toolCallBuffer:T,toolCallName:_,partialToolCallArgs:j})});return s(C),C.stopPropagation!==!0&&(y.function.arguments+=S,s({messages:o})),c()}case F.TOOL_CALL_END:{let{toolCallId:v}=u,S=o.find(y=>y.toolCalls?.some(C=>C.id===v));if(!S)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${v}'`),c();let g=S.toolCalls?.find(y=>y.id===v);return g?(s(yield _e(n,o,i,(y,C,R)=>{let x=g.function.arguments,I=g.function.name,T={};try{T=JSON.parse(x)}catch{}return y.onToolCallEndEvent?.({event:u,messages:C,state:R,agent:r,input:e,toolCallName:I,toolCallArgs:T})})),yield Promise.all(n.map(y=>{y.onNewToolCall?.({toolCall:g,messages:o,state:i,agent:r,input:e})})),c()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${v}'`),c())}case F.TOOL_CALL_RESULT:{let v=yield _e(n,o,i,(S,g,y)=>S.onToolCallResultEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(v),v.stopPropagation!==!0){let{messageId:S,toolCallId:g,content:y,role:C}=u,R={id:S,toolCallId:g,role:C||"tool",content:y};o.push(R),yield Promise.all(n.map(x=>{x.onNewMessage?.({message:R,messages:o,state:i,agent:r,input:e})})),s({messages:o})}return c()}case F.STATE_SNAPSHOT:{let v=yield _e(n,o,i,(S,g,y)=>S.onStateSnapshotEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(v),v.stopPropagation!==!0){let{snapshot:S}=u;i=S,s({state:i})}return c()}case F.STATE_DELTA:{let v=yield _e(n,o,i,(S,g,y)=>S.onStateDeltaEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(v),v.stopPropagation!==!0){let{delta:S}=u;try{i=Or(i,S,!0,!1).newDocument,s({state:i})}catch(g){let y=g instanceof Error?g.message:String(g);console.warn(`Failed to apply state patch:
|
|
34
|
+
`):"",this.name="UnsubscriptionError",this.errors=r}});m();d();p();f();function ia(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var jo=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=yr(a),c=s.next();!c.done;c=s.next()){var u=c.value;u.remove(this)}}catch(x){t={error:x}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var h=this.initialTeardown;if(be(h))try{h()}catch(x){i=x instanceof yc?x.errors:[x]}var S=this._finalizers;if(S){this._finalizers=null;try{for(var v=yr(S),g=v.next();!g.done;g=v.next()){var y=g.value;try{cS(y)}catch(x){i=i??[],x instanceof yc?i=Mo(Mo([],Do(i)),Do(x.errors)):i.push(x)}}}catch(x){n={error:x}}finally{try{g&&!g.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}if(i)throw new yc(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)cS(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)&&ia(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&ia(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var gf=jo.EMPTY;function Sc(e){return e instanceof jo||e&&"closed"in e&&be(e.remove)&&be(e.add)&&be(e.unsubscribe)}function cS(e){be(e)?e():e.unsubscribe()}m();d();p();f();var Lt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};m();d();p();f();m();d();p();f();var Lo={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Lo.delegate;return o?.setTimeout?o.setTimeout.apply(o,Mo([e,t],Do(r))):setTimeout.apply(void 0,Mo([e,t],Do(r)))},clearTimeout:function(e){var t=Lo.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function vc(e){Lo.setTimeout(function(){var t=Lt.onUnhandledError;if(t)t(e);else throw e})}m();d();p();f();function aa(){}m();d();p();f();var uS=function(){return hf("C",void 0,void 0)}();function lS(e){return hf("E",void 0,e)}function dS(e){return hf("N",e,void 0)}function hf(e,t,r){return{kind:e,value:t,error:r}}m();d();p();f();var On=null;function Vo(e){if(Lt.useDeprecatedSynchronousErrorHandling){var t=!On;if(t&&(On={errorThrown:!1,error:null}),e(),t){var r=On,n=r.errorThrown,o=r.error;if(On=null,n)throw o}}else e()}function fS(e){Lt.useDeprecatedSynchronousErrorHandling&&On&&(On.errorThrown=!0,On.error=e)}var sa=function(e){Zt(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Sc(r)&&r.add(n)):n.destination=e0,n}return t.create=function(r,n,o){return new wc(r,n,o)},t.prototype.next=function(r){this.isStopped?Sf(dS(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?Sf(lS(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?Sf(uS,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}(jo);var X_=Function.prototype.bind;function yf(e,t){return X_.call(e,t)}var J_=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){bc(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){bc(n)}else bc(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){bc(r)}},e}(),wc=function(e){Zt(t,e);function t(r,n,o){var i=e.call(this)||this,a;if(be(r)||!r)a={next:r??void 0,error:n??void 0,complete:o??void 0};else{var s;i&&Lt.useDeprecatedNextContext?(s=Object.create(r),s.unsubscribe=function(){return i.unsubscribe()},a={next:r.next&&yf(r.next,s),error:r.error&&yf(r.error,s),complete:r.complete&&yf(r.complete,s)}):a=r}return i.destination=new J_(a),i}return t}(sa);function bc(e){Lt.useDeprecatedSynchronousErrorHandling?fS(e):vc(e)}function Z_(e){throw e}function Sf(e,t){var r=Lt.onStoppedNotification;r&&Lo.setTimeout(function(){return r(e,t)})}var e0={closed:!0,next:aa,error:Z_,complete:aa};m();d();p();f();var Uo=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();m();d();p();f();m();d();p();f();function Bo(e){return e}function Ac(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return vf(e)}function vf(e){return e.length===0?Bo:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var qe=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,i=r0(t)?t:new wc(t,r,n);return Vo(function(){var a=o,s=a.operator,c=a.source;i.add(s?s.call(i,c):c?o._subscribe(i):o._trySubscribe(i))}),i},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=pS(r),new r(function(o,i){var a=new wc({next:function(s){try{t(s)}catch(c){i(c),a.unsubscribe()}},error:i,complete:o});n.subscribe(a)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[Uo]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return vf(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=pS(t),new t(function(n,o){var i;r.subscribe(function(a){return i=a},function(a){return o(a)},function(){return n(i)})})},e.create=function(t){return new e(t)},e}();function pS(e){var t;return(t=e??Lt.Promise)!==null&&t!==void 0?t:Promise}function t0(e){return e&&be(e.next)&&be(e.error)&&be(e.complete)}function r0(e){return e&&e instanceof sa||t0(e)&&Sc(e)}m();d();p();f();function n0(e){return be(e?.lift)}function Qe(e){return function(t){if(n0(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}m();d();p();f();function We(e,t,r,n,o){return new o0(e,t,r,n,o)}var o0=function(e){Zt(t,e);function t(r,n,o,i,a,s){var c=e.call(this,r)||this;return c.onFinalize=a,c.shouldUnsubscribe=s,c._next=n?function(u){try{n(u)}catch(h){r.error(h)}}:e.prototype._next,c._error=i?function(u){try{i(u)}catch(h){r.error(h)}finally{this.unsubscribe()}}:e.prototype._error,c._complete=o?function(){try{o()}catch(u){r.error(u)}finally{this.unsubscribe()}}:e.prototype._complete,c}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t}(sa);m();d();p();f();m();d();p();f();var mS=qo(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var er=function(e){Zt(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 gS(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new mS},t.prototype.next=function(r){var n=this;Vo(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=yr(n.currentObservers),s=a.next();!s.done;s=a.next()){var c=s.value;c.next(r)}}catch(u){o={error:u}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;Vo(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;Vo(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,a=o.isStopped,s=o.observers;return i||a?gf:(this.currentObservers=null,s.push(r),new jo(function(){n.currentObservers=null,ia(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,a=n.isStopped;o?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new qe;return r.source=this,r},t.create=function(r,n){return new gS(r,n)},t}(qe);var gS=function(e){Zt(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:gf},t}(er);m();d();p();f();m();d();p();f();var bf={now:function(){return(bf.delegate||Date).now()},delegate:void 0};var xc=function(e){Zt(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=bf);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(r){var n=this,o=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,s=n._timestampProvider,c=n._windowTime;o||(i.push(r),!a&&i.push(s.now()+c)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,i=o._infiniteTimeWindow,a=o._buffer,s=a.slice(),c=0;c<s.length&&!r.closed;c+=i?1:2)r.next(s[c]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,i=r._buffer,a=r._infiniteTimeWindow,s=(a?1:2)*n;if(n<1/0&&s<i.length&&i.splice(0,i.length-s),!a){for(var c=o.now(),u=0,h=1;h<i.length&&i[h]<=c;h+=2)u=h;u&&i.splice(0,u+1)}},t}(er);m();d();p();f();var Cc=new qe(function(e){return e.complete()});m();d();p();f();m();d();p();f();m();d();p();f();function hS(e){return e&&be(e.schedule)}function i0(e){return e[e.length-1]}function yS(e){return hS(i0(e))?e.pop():void 0}m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();var Ec=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};m();d();p();f();function Rc(e){return be(e?.then)}m();d();p();f();function Ic(e){return be(e[Uo])}m();d();p();f();function Tc(e){return Symbol.asyncIterator&&be(e?.[Symbol.asyncIterator])}m();d();p();f();function _c(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}m();d();p();f();m();d();p();f();function a0(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var kc=a0();function Oc(e){return be(e?.[kc])}m();d();p();f();function Pc(e){return aS(this,arguments,function(){var r,n,o,i;return hc(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,kn(r.read())];case 3:return n=a.sent(),o=n.value,i=n.done,i?[4,kn(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,kn(o)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Nc(e){return be(e?.getReader)}function Ke(e){if(e instanceof qe)return e;if(e!=null){if(Ic(e))return s0(e);if(Ec(e))return c0(e);if(Rc(e))return u0(e);if(Tc(e))return SS(e);if(Oc(e))return l0(e);if(Nc(e))return d0(e)}throw _c(e)}function s0(e){return new qe(function(t){var r=e[Uo]();if(be(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function c0(e){return new qe(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function u0(e){return new qe(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,vc)})}function l0(e){return new qe(function(t){var r,n;try{for(var o=yr(e),i=o.next();!i.done;i=o.next()){var a=i.value;if(t.next(a),t.closed)return}}catch(s){r={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function SS(e){return new qe(function(t){f0(e,t).catch(function(r){return t.error(r)})})}function d0(e){return SS(Pc(e))}function f0(e,t){var r,n,o,i;return iS(this,void 0,void 0,function(){var a,s;return hc(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=sS(e),c.label=1;case 1:return[4,r.next()];case 2:if(n=c.sent(),!!n.done)return[3,4];if(a=n.value,t.next(a),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),o={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(i=r.return)?[4,i.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}m();d();p();f();m();d();p();f();function Pt(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var i=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(i),!o)return i}function Fc(e,t){return t===void 0&&(t=0),Qe(function(r,n){r.subscribe(We(n,function(o){return Pt(n,e,function(){return n.next(o)},t)},function(){return Pt(n,e,function(){return n.complete()},t)},function(o){return Pt(n,e,function(){return n.error(o)},t)}))})}m();d();p();f();function Dc(e,t){return t===void 0&&(t=0),Qe(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function vS(e,t){return Ke(e).pipe(Dc(t),Fc(t))}m();d();p();f();function bS(e,t){return Ke(e).pipe(Dc(t),Fc(t))}m();d();p();f();function wS(e,t){return new qe(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}m();d();p();f();function AS(e,t){return new qe(function(r){var n;return Pt(r,t,function(){n=e[kc](),Pt(r,t,function(){var o,i,a;try{o=n.next(),i=o.value,a=o.done}catch(s){r.error(s);return}a?r.complete():r.next(i)},0,!0)}),function(){return be(n?.return)&&n.return()}})}m();d();p();f();function Mc(e,t){if(!e)throw new Error("Iterable cannot be null");return new qe(function(r){Pt(r,t,function(){var n=e[Symbol.asyncIterator]();Pt(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}m();d();p();f();function xS(e,t){return Mc(Pc(e),t)}function CS(e,t){if(e!=null){if(Ic(e))return vS(e,t);if(Ec(e))return wS(e,t);if(Rc(e))return bS(e,t);if(Tc(e))return Mc(e,t);if(Oc(e))return AS(e,t);if(Nc(e))return xS(e,t)}throw _c(e)}function Pn(e,t){return t?CS(e,t):Ke(e)}function Ue(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=yS(e);return Pn(e,r)}m();d();p();f();function je(e,t){var r=be(e)?e:function(){return e},n=function(o){return o.error(r())};return new qe(t?function(o){return t.schedule(n,0,o)}:n)}m();d();p();f();m();d();p();f();var ES=qo(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function qc(e,t){var r=typeof t=="object";return new Promise(function(n,o){var i=!1,a;e.subscribe({next:function(s){a=s,i=!0},error:o,complete:function(){i?n(a):r?n(t.defaultValue):o(new ES)}})})}m();d();p();f();function Nn(e,t){return Qe(function(r,n){var o=0;r.subscribe(We(n,function(i){n.next(e.call(t,i,o++))}))})}m();d();p();f();m();d();p();f();m();d();p();f();function RS(e,t,r,n,o,i,a,s){var c=[],u=0,h=0,S=!1,v=function(){S&&!c.length&&!u&&t.complete()},g=function(x){return u<n?y(x):c.push(x)},y=function(x){i&&t.next(x),u++;var C=!1;Ke(r(x,h++)).subscribe(We(t,function(E){o?.(E),i?g(E):t.next(E)},function(){C=!0},void 0,function(){if(C)try{u--;for(var E=function(){var _=c.shift();a?Pt(t,a,function(){return y(_)}):y(_)};c.length&&u<n;)E();v()}catch(_){t.error(_)}}))};return e.subscribe(We(t,g,function(){S=!0,v()})),function(){s?.()}}function bt(e,t,r){return r===void 0&&(r=1/0),be(t)?bt(function(n,o){return Nn(function(i,a){return t(n,i,o,a)})(Ke(e(n,o)))},r):(typeof t=="number"&&(r=t),Qe(function(n,o){return RS(n,o,e,r)}))}function wf(e){return e===void 0&&(e=1/0),bt(Bo,e)}m();d();p();f();function Af(e){return new qe(function(t){Ke(e()).subscribe(t)})}m();d();p();f();function ca(e){return Qe(function(t,r){var n=null,o=!1,i;n=t.subscribe(We(r,void 0,void 0,function(a){i=Ke(e(a,ca(e)(t))),n?(n.unsubscribe(),n=null,i.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,i.subscribe(r))})}m();d();p();f();function jc(e,t){return be(t)?bt(e,t,1):bt(e,1)}m();d();p();f();function xf(e){return Qe(function(t,r){var n=!1;t.subscribe(We(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}m();d();p();f();function Fn(e){return Qe(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}m();d();p();f();function Cf(e,t){return Qe(function(r,n){var o=null,i=0,a=!1,s=function(){return a&&!o&&n.complete()};r.subscribe(We(n,function(c){o?.unsubscribe();var u=0,h=i++;Ke(e(c,h)).subscribe(o=We(n,function(S){return n.next(t?t(c,S,h,u++):S)},function(){o=null,s()}))},function(){a=!0,s()}))})}m();d();p();f();function Lc(e){return Qe(function(t,r){Ke(e).subscribe(We(r,function(){return r.complete()},aa)),!r.closed&&t.subscribe(r)})}m();d();p();f();function Ef(e,t,r){var n=be(e)||t||r?{next:e,error:t,complete:r}:e;return n?Qe(function(o,i){var a;(a=n.subscribe)===null||a===void 0||a.call(n);var s=!0;o.subscribe(We(i,function(c){var u;(u=n.next)===null||u===void 0||u.call(n,c),i.next(c)},function(){var c;s=!1,(c=n.complete)===null||c===void 0||c.call(n),i.complete()},function(c){var u;s=!1,(u=n.error)===null||u===void 0||u.call(n,c),i.error(c)},function(){var c,u;s&&((c=n.unsubscribe)===null||c===void 0||c.call(n)),(u=n.finalize)===null||u===void 0||u.call(n)}))}):Bo}m();d();p();f();m();d();p();f();function IS(e){return` \r
|
|
35
|
+
`.indexOf(e)>=0}function Vc(e){for(var t=["topLevel"],r=0,n,o,i,a=function(_){return t.push(_)},s=function(_){return t[t.length-1]=_},c=function(_){n==null&&(n=r,o=t.length,i=_)},u=function(_){_===i&&(n=void 0,o=void 0,i=void 0)},h=function(){return t.pop()},S=function(){return r--},v=function(_){if("0"<=_&&_<="9"){a("number");return}switch(_){case"\"":a("string");return;case"-":a("numberNeedsDigit");return;case"t":a("true");return;case"f":a("false");return;case"n":a("null");return;case"[":a("arrayNeedsValue");return;case"{":a("objectNeedsKey");return}},g=e.length;r<g;r++){var y=e[r];switch(t[t.length-1]){case"topLevel":v(y);break;case"string":switch(y){case"\"":h();break;case"\\":c("stringEscape"),a("stringEscaped");break}break;case"stringEscaped":y==="u"?a("stringUnicode"):(u("stringEscape"),h());break;case"stringUnicode":r-e.lastIndexOf("u",r)===4&&(u("stringEscape"),h());break;case"number":y==="."?s("numberNeedsDigit"):y==="e"||y==="E"?s("numberNeedsExponent"):(y<"0"||y>"9")&&(S(),h());break;case"numberNeedsDigit":s("number");break;case"numberNeedsExponent":s(y==="+"||y==="-"?"numberNeedsDigit":"number");break;case"true":case"false":case"null":(y<"a"||y>"z")&&(S(),h());break;case"arrayNeedsValue":y==="]"?h():IS(y)||(u("collectionItem"),s("arrayNeedsComma"),v(y));break;case"arrayNeedsComma":y==="]"?h():y===","&&(c("collectionItem"),s("arrayNeedsValue"));break;case"objectNeedsKey":y==="}"?h():y==="\""&&(c("collectionItem"),s("objectNeedsColon"),a("string"));break;case"objectNeedsColon":y===":"&&s("objectNeedsValue");break;case"objectNeedsValue":IS(y)||(u("collectionItem"),s("objectNeedsComma"),v(y));break;case"objectNeedsComma":y==="}"?h():y===","&&(c("collectionItem"),s("objectNeedsKey"));break}}o!=null&&(t.length=o);for(var x=[n!=null?e.slice(0,n):e],C=function(_){return x.push(_.slice(e.length-e.lastIndexOf(_[0])))},E=t.length-1;E>=0;E--)switch(t[E]){case"string":x.push("\"");break;case"numberNeedsDigit":case"numberNeedsExponent":x.push("0");break;case"true":C("true");break;case"false":C("false");break;case"null":C("null");break;case"arrayNeedsValue":case"arrayNeedsComma":x.push("]");break;case"objectNeedsKey":case"objectNeedsColon":case"objectNeedsValue":case"objectNeedsComma":x.push("}");break}return x.join("")}m();d();p();f();m();d();p();f();m();d();p();f();function _S(){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 Bc(e,t,r){for(let i=0;i<28;i=i+7){let a=e>>>i,s=!(!(a>>>7)&&t==0),c=(s?a|128:a)&255;if(r.push(c),!s)return}let n=e>>>28&15|(t&7)<<4,o=t>>3!=0;if(r.push((o?n|128:n)&255),!!o){for(let i=3;i<31;i=i+7){let a=t>>>i,s=!!(a>>>7),c=(s?a|128:a)&255;if(r.push(c),!s)return}r.push(t>>>31&1)}}var Uc=4294967296;function Rf(e){let t=e[0]==="-";t&&(e=e.slice(1));let r=1e6,n=0,o=0;function i(a,s){let c=Number(e.slice(a,s));o*=r,n=n*r+c,n>=Uc&&(o=o+(n/Uc|0),n=n%Uc)}return i(-24,-18),i(-18,-12),i(-12,-6),i(-6),t?OS(n,o):Tf(n,o)}function kS(e,t){let r=Tf(e,t),n=r.hi&2147483648;n&&(r=OS(r.lo,r.hi));let o=If(r.lo,r.hi);return n?"-"+o:o}function If(e,t){if({lo:e,hi:t}=p0(e,t),t<=2097151)return String(Uc*t+e);let r=e&16777215,n=(e>>>24|t<<8)&16777215,o=t>>16&65535,i=r+n*6777216+o*6710656,a=n+o*8147497,s=o*2,c=1e7;return i>=c&&(a+=Math.floor(i/c),i%=c),a>=c&&(s+=Math.floor(a/c),a%=c),s.toString()+TS(a)+TS(i)}function p0(e,t){return{lo:e>>>0,hi:t>>>0}}function Tf(e,t){return{lo:e|0,hi:t|0}}function OS(e,t){return t=~t,e?e=~e+1:t+=1,Tf(e,t)}var TS=e=>{let t=String(e);return"0000000".slice(t.length)+t};function _f(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 PS(){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}m();d();p();f();var Vt=m0();function m0(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!b.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let r=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),o=BigInt("0"),i=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(a){let s=typeof a=="bigint"?a:BigInt(a);if(s>n||s<r)throw new Error(`invalid int64: ${a}`);return s},uParse(a){let s=typeof a=="bigint"?a:BigInt(a);if(s>i||s<o)throw new Error(`invalid uint64: ${a}`);return s},enc(a){return e.setBigInt64(0,this.parse(a),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(a){return e.setBigInt64(0,this.uParse(a),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(a,s){return e.setInt32(0,a,!0),e.setInt32(4,s,!0),e.getBigInt64(0,!0)},uDec(a,s){return e.setInt32(0,a,!0),e.setInt32(4,s,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),NS(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),FS(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),NS(r),Rf(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),FS(r),Rf(r)},dec(r,n){return kS(r,n)},uDec(r,n){return If(r,n)}}}function NS(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function FS(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}m();d();p();f();var kf=Symbol.for("@bufbuild/protobuf/text-encoding");function Of(){if(b[kf]==null){let e=new b.TextEncoder,t=new b.TextDecoder;b[kf]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return b[kf]}var Vr;(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"})(Vr||(Vr={}));var g0=34028234663852886e22,h0=-34028234663852886e22,y0=4294967295,S0=2147483647,v0=-2147483648,Te=class{constructor(t=Of().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(DS(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return Pf(t),_f(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){b0(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){DS(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){Pf(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return Pf(t),t=(t<<1^t>>31)>>>0,_f(t,this.buf),this}sfixed64(t){let r=new Uint8Array(8),n=new DataView(r.buffer),o=Vt.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=Vt.uEnc(t);return n.setInt32(0,o.lo,!0),n.setInt32(4,o.hi,!0),this.raw(r)}int64(t){let r=Vt.enc(t);return Bc(r.lo,r.hi,this.buf),this}sint64(t){let r=Vt.enc(t),n=r.hi>>31,o=r.lo<<1^n,i=(r.hi<<1|r.lo>>>31)^n;return Bc(o,i,this.buf),this}uint64(t){let r=Vt.uEnc(t);return Bc(r.lo,r.hi,this.buf),this}},ie=class{constructor(t,r=Of().decodeUtf8){this.decodeUtf8=r,this.varint64=_S,this.uint32=PS,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 Vr.Varint:for(;this.buf[this.pos++]&128;);break;case Vr.Bit64:this.pos+=4;case Vr.Bit32:this.pos+=4;break;case Vr.LengthDelimited:let o=this.uint32();this.pos+=o;break;case Vr.StartGroup:for(;;){let[i,a]=this.tag();if(a===Vr.EndGroup){if(r!==void 0&&i!==r)throw new Error("invalid end group tag");break}this.skip(a,i)}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 Vt.dec(...this.varint64())}uint64(){return Vt.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),n=-(t&1);return t=(t>>>1|(r&1)<<31)^n,r=r>>>1^n,Vt.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 Vt.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Vt.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 Pf(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>S0||e<v0)throw new Error("invalid int32: "+e)}function DS(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>y0||e<0)throw new Error("invalid uint32: "+e)}function b0(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>g0||e<h0))throw new Error("invalid float32: "+e)}var w0=function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e}({});function Nf(){return{fields:{}}}var ua={encode(e,t=new Te){return Object.entries(e.fields).forEach(([r,n])=>{n!==void 0&&Mf.encode({key:r,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=Nf();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:{if(i!==10)break;let a=Mf.decode(r,r.uint32());a.value!==void 0&&(o.fields[a.key]=a.value);continue}}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return ua.fromPartial(e??{})},fromPartial(e){let t=Nf();return t.fields=Object.entries(e.fields??{}).reduce((r,[n,o])=>(o!==void 0&&(r[n]=o),r),{}),t},wrap(e){let t=Nf();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 MS(){return{key:"",value:void 0}}var Mf={encode(e,t=new Te){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&Ce.encode(Ce.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=MS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.key=r.string();continue;case 2:if(i!==18)break;o.value=Ce.unwrap(Ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Mf.fromPartial(e??{})},fromPartial(e){let t=MS();return t.key=e.key??"",t.value=e.value??void 0,t}};function Ff(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var Ce={encode(e,t=new Te){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&&ua.encode(ua.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&la.encode(la.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=Ff();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.nullValue=r.int32();continue;case 2:if(i!==17)break;o.numberValue=r.double();continue;case 3:if(i!==26)break;o.stringValue=r.string();continue;case 4:if(i!==32)break;o.boolValue=r.bool();continue;case 5:if(i!==42)break;o.structValue=ua.unwrap(ua.decode(r,r.uint32()));continue;case 6:if(i!==50)break;o.listValue=la.unwrap(la.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Ce.fromPartial(e??{})},fromPartial(e){let t=Ff();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=Ff();if(e===null)t.nullValue=w0.NULL_VALUE;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(b.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new b.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function Df(){return{values:[]}}var la={encode(e,t=new Te){for(let r of e.values)Ce.encode(Ce.wrap(r),t.uint32(10).fork()).join();return t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=Df();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.values.push(Ce.unwrap(Ce.decode(r,r.uint32())));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return la.fromPartial(e??{})},fromPartial(e){let t=Df();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=Df();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&b.Array.isArray(e.values)?e.values:e}},A0=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 qS(){return{op:0,path:"",from:void 0,value:void 0}}var $c={encode(e,t=new Te){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==""&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&Ce.encode(Ce.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=qS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.op=r.int32();continue;case 2:if(i!==18)break;o.path=r.string();continue;case 3:if(i!==26)break;o.from=r.string();continue;case 4:if(i!==34)break;o.value=Ce.unwrap(Ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return $c.fromPartial(e??{})},fromPartial(e){let t=qS();return t.op=e.op??0,t.path=e.path??"",t.from=e.from??void 0,t.value=e.value??void 0,t}};function jS(){return{id:"",type:"",function:void 0}}var Gc={encode(e,t=new Te){return e.id!==""&&t.uint32(10).string(e.id),e.type!==""&&t.uint32(18).string(e.type),e.function!==void 0&&Qc.encode(e.function,t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=jS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.id=r.string();continue;case 2:if(i!==18)break;o.type=r.string();continue;case 3:if(i!==26)break;o.function=Qc.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Gc.fromPartial(e??{})},fromPartial(e){let t=jS();return t.id=e.id??"",t.type=e.type??"",t.function=e.function!==void 0&&e.function!==null?Qc.fromPartial(e.function):void 0,t}};function LS(){return{name:"",arguments:""}}var Qc={encode(e,t=new Te){return e.name!==""&&t.uint32(10).string(e.name),e.arguments!==""&&t.uint32(18).string(e.arguments),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=LS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.name=r.string();continue;case 2:if(i!==18)break;o.arguments=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Qc.fromPartial(e??{})},fromPartial(e){let t=LS();return t.name=e.name??"",t.arguments=e.arguments??"",t}};function VS(){return{id:"",role:"",content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0}}var Hc={encode(e,t=new Te){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)Gc.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 ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=VS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.id=r.string();continue;case 2:if(i!==18)break;o.role=r.string();continue;case 3:if(i!==26)break;o.content=r.string();continue;case 4:if(i!==34)break;o.name=r.string();continue;case 5:if(i!==42)break;o.toolCalls.push(Gc.decode(r,r.uint32()));continue;case 6:if(i!==50)break;o.toolCallId=r.string();continue;case 7:if(i!==58)break;o.error=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Hc.fromPartial(e??{})},fromPartial(e){let t=VS();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=>Gc.fromPartial(r))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t}},x0=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 US(){return{type:0,timestamp:void 0,rawEvent:void 0}}var ce={encode(e,t=new Te){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&Ce.encode(Ce.wrap(e.rawEvent),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=US();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;o.type=r.int32();continue;case 2:if(i!==16)break;o.timestamp=C0(r.int64());continue;case 3:if(i!==26)break;o.rawEvent=Ce.unwrap(Ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return ce.fromPartial(e??{})},fromPartial(e){let t=US();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function BS(){return{baseEvent:void 0,messageId:"",role:void 0}}var zc={encode(e,t=new Te){return e.baseEvent!==void 0&&ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=BS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ce.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.role=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return zc.fromPartial(e??{})},fromPartial(e){let t=BS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ce.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.role=e.role??void 0,t}};function $S(){return{baseEvent:void 0,messageId:"",delta:""}}var Wc={encode(e,t=new Te){return e.baseEvent!==void 0&&ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=$S();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ce.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Wc.fromPartial(e??{})},fromPartial(e){let t=$S();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ce.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t.delta=e.delta??"",t}};function GS(){return{baseEvent:void 0,messageId:""}}var Kc={encode(e,t=new Te){return e.baseEvent!==void 0&&ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==""&&t.uint32(18).string(e.messageId),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=GS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ce.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Kc.fromPartial(e??{})},fromPartial(e){let t=GS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ce.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??"",t}};function QS(){return{baseEvent:void 0,toolCallId:"",toolCallName:"",parentMessageId:void 0}}var Yc={encode(e,t=new Te){return e.baseEvent!==void 0&&ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.toolCallName!==""&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=QS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ce.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.toolCallName=r.string();continue;case 4:if(i!==34)break;o.parentMessageId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Yc.fromPartial(e??{})},fromPartial(e){let t=QS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ce.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.toolCallName=e.toolCallName??"",t.parentMessageId=e.parentMessageId??void 0,t}};function HS(){return{baseEvent:void 0,toolCallId:"",delta:""}}var Xc={encode(e,t=new Te){return e.baseEvent!==void 0&&ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),e.delta!==""&&t.uint32(26).string(e.delta),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=HS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ce.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Xc.fromPartial(e??{})},fromPartial(e){let t=HS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ce.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t.delta=e.delta??"",t}};function zS(){return{baseEvent:void 0,toolCallId:""}}var Jc={encode(e,t=new Te){return e.baseEvent!==void 0&&ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==""&&t.uint32(18).string(e.toolCallId),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=zS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ce.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Jc.fromPartial(e??{})},fromPartial(e){let t=zS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ce.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??"",t}};function WS(){return{baseEvent:void 0,snapshot:void 0}}var Zc={encode(e,t=new Te){return e.baseEvent!==void 0&&ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&Ce.encode(Ce.wrap(e.snapshot),t.uint32(18).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=WS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ce.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.snapshot=Ce.unwrap(Ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return Zc.fromPartial(e??{})},fromPartial(e){let t=WS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ce.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function KS(){return{baseEvent:void 0,delta:[]}}var eu={encode(e,t=new Te){e.baseEvent!==void 0&&ce.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.delta)$c.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=KS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ce.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.delta.push($c.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return eu.fromPartial(e??{})},fromPartial(e){let t=KS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ce.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(r=>$c.fromPartial(r))||[],t}};function YS(){return{baseEvent:void 0,messages:[]}}var tu={encode(e,t=new Te){e.baseEvent!==void 0&&ce.encode(e.baseEvent,t.uint32(10).fork()).join();for(let r of e.messages)Hc.encode(r,t.uint32(18).fork()).join();return t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=YS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ce.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messages.push(Hc.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return tu.fromPartial(e??{})},fromPartial(e){let t=YS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ce.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(r=>Hc.fromPartial(r))||[],t}};function XS(){return{baseEvent:void 0,event:void 0,source:void 0}}var ru={encode(e,t=new Te){return e.baseEvent!==void 0&&ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&Ce.encode(Ce.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=XS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ce.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.event=Ce.unwrap(Ce.decode(r,r.uint32()));continue;case 3:if(i!==26)break;o.source=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return ru.fromPartial(e??{})},fromPartial(e){let t=XS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ce.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function JS(){return{baseEvent:void 0,name:"",value:void 0}}var nu={encode(e,t=new Te){return e.baseEvent!==void 0&&ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==""&&t.uint32(18).string(e.name),e.value!==void 0&&Ce.encode(Ce.wrap(e.value),t.uint32(26).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=JS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ce.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.name=r.string();continue;case 3:if(i!==26)break;o.value=Ce.unwrap(Ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return nu.fromPartial(e??{})},fromPartial(e){let t=JS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ce.fromPartial(e.baseEvent):void 0,t.name=e.name??"",t.value=e.value??void 0,t}};function ZS(){return{baseEvent:void 0,threadId:"",runId:""}}var ou={encode(e,t=new Te){return e.baseEvent!==void 0&&ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=ZS();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ce.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.threadId=r.string();continue;case 3:if(i!==26)break;o.runId=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return ou.fromPartial(e??{})},fromPartial(e){let t=ZS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ce.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t}};function ev(){return{baseEvent:void 0,threadId:"",runId:"",result:void 0}}var iu={encode(e,t=new Te){return e.baseEvent!==void 0&&ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==""&&t.uint32(18).string(e.threadId),e.runId!==""&&t.uint32(26).string(e.runId),e.result!==void 0&&Ce.encode(Ce.wrap(e.result),t.uint32(34).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=ev();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ce.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.threadId=r.string();continue;case 3:if(i!==26)break;o.runId=r.string();continue;case 4:if(i!==34)break;o.result=Ce.unwrap(Ce.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return iu.fromPartial(e??{})},fromPartial(e){let t=ev();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ce.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??"",t.runId=e.runId??"",t.result=e.result??void 0,t}};function tv(){return{baseEvent:void 0,code:void 0,message:""}}var au={encode(e,t=new Te){return e.baseEvent!==void 0&&ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==""&&t.uint32(26).string(e.message),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=tv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ce.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.code=r.string();continue;case 3:if(i!==26)break;o.message=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return au.fromPartial(e??{})},fromPartial(e){let t=tv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ce.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??"",t}};function rv(){return{baseEvent:void 0,stepName:""}}var su={encode(e,t=new Te){return e.baseEvent!==void 0&&ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=rv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ce.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.stepName=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return su.fromPartial(e??{})},fromPartial(e){let t=rv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ce.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function nv(){return{baseEvent:void 0,stepName:""}}var cu={encode(e,t=new Te){return e.baseEvent!==void 0&&ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==""&&t.uint32(18).string(e.stepName),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=nv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ce.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.stepName=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return cu.fromPartial(e??{})},fromPartial(e){let t=nv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ce.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??"",t}};function ov(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0}}var uu={encode(e,t=new Te){return e.baseEvent!==void 0&&ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=ov();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ce.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.messageId=r.string();continue;case 3:if(i!==26)break;o.role=r.string();continue;case 4:if(i!==34)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return uu.fromPartial(e??{})},fromPartial(e){let t=ov();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ce.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t}};function iv(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var lu={encode(e,t=new Te){return e.baseEvent!==void 0&&ce.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=iv();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.baseEvent=ce.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.toolCallId=r.string();continue;case 3:if(i!==26)break;o.toolCallName=r.string();continue;case 4:if(i!==34)break;o.parentMessageId=r.string();continue;case 5:if(i!==42)break;o.delta=r.string();continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return lu.fromPartial(e??{})},fromPartial(e){let t=iv();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?ce.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t}};function av(){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 sv={encode(e,t=new Te){return e.textMessageStart!==void 0&&zc.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&Wc.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&Kc.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&Yc.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&Xc.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&Jc.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&Zc.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&eu.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&tu.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&ru.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&nu.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&ou.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&iu.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&au.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&su.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&cu.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&uu.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&lu.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t},decode(e,t){let r=e instanceof ie?e:new ie(e),n=t===void 0?r.len:r.pos+t,o=av();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;o.textMessageStart=zc.decode(r,r.uint32());continue;case 2:if(i!==18)break;o.textMessageContent=Wc.decode(r,r.uint32());continue;case 3:if(i!==26)break;o.textMessageEnd=Kc.decode(r,r.uint32());continue;case 4:if(i!==34)break;o.toolCallStart=Yc.decode(r,r.uint32());continue;case 5:if(i!==42)break;o.toolCallArgs=Xc.decode(r,r.uint32());continue;case 6:if(i!==50)break;o.toolCallEnd=Jc.decode(r,r.uint32());continue;case 7:if(i!==58)break;o.stateSnapshot=Zc.decode(r,r.uint32());continue;case 8:if(i!==66)break;o.stateDelta=eu.decode(r,r.uint32());continue;case 9:if(i!==74)break;o.messagesSnapshot=tu.decode(r,r.uint32());continue;case 10:if(i!==82)break;o.raw=ru.decode(r,r.uint32());continue;case 11:if(i!==90)break;o.custom=nu.decode(r,r.uint32());continue;case 12:if(i!==98)break;o.runStarted=ou.decode(r,r.uint32());continue;case 13:if(i!==106)break;o.runFinished=iu.decode(r,r.uint32());continue;case 14:if(i!==114)break;o.runError=au.decode(r,r.uint32());continue;case 15:if(i!==122)break;o.stepStarted=su.decode(r,r.uint32());continue;case 16:if(i!==130)break;o.stepFinished=cu.decode(r,r.uint32());continue;case 17:if(i!==138)break;o.textMessageChunk=uu.decode(r,r.uint32());continue;case 18:if(i!==146)break;o.toolCallChunk=lu.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skip(i&7)}return o},create(e){return sv.fromPartial(e??{})},fromPartial(e){let t=av();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?zc.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?Wc.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?Kc.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?Yc.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?Xc.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?Jc.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?Zc.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?eu.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?tu.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?ru.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?nu.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?ou.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?iu.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?au.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?su.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?cu.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?uu.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?lu.fromPartial(e.toolCallChunk):void 0,t}};function C0(e){let t=b.Number(e.toString());if(t>b.Number.MAX_SAFE_INTEGER)throw new b.Error("Value is larger than Number.MAX_SAFE_INTEGER");if(t<b.Number.MIN_SAFE_INTEGER)throw new b.Error("Value is smaller than Number.MIN_SAFE_INTEGER");return t}function cv(e){let t=sv.decode(e),r=Object.values(t).find(n=>n!==void 0);if(!r)throw new Error("Invalid event");if(r.type=x0[r.baseEvent.type],r.timestamp=r.baseEvent.timestamp,r.rawEvent=r.baseEvent.rawEvent,r.type===M.MESSAGES_SNAPSHOT)for(let n of r.messages){let o=n;o.toolCalls?.length===0&&(o.toolCalls=void 0)}if(r.type===M.STATE_DELTA)for(let n of r.delta)n.op=A0[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]}),uc.parse(r)}var uv="application/vnd.ag-ui.event+proto";m();d();p();f();m();d();p();f();m();d();p();f();var R0=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,qf=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(R0);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},lv=e=>e==="*"||e==="x"||e==="X",dv=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},I0=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],T0=(e,t)=>{if(lv(e)||lv(t))return 0;let[r,n]=I0(dv(e),dv(t));return r>n?1:r<n?-1:0},jf=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=T0(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var du=(e,t)=>{let r=qf(e),n=qf(t),o=r.pop(),i=n.pop(),a=jf(r,n);return a!==0?a:o&&i?jf(o.split("."),i.split(".")):o||i?o?-1:1:0};var Oe=e=>{if(typeof structuredClone=="function")return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return{...e}}};function da(){return Fr()}function ke(_x88,_x89,_x90,_x91){return _ke.apply(this,arguments)}function _ke(){_ke=_asyncToGenerator(function*(e,t,r,n){let o=t,i=r,a;for(let s of e)try{let c=yield n(s,Oe(o),Oe(i));if(c===void 0)continue;if(c.messages!==void 0&&(o=c.messages),c.state!==void 0&&(i=c.state),a=c.stopPropagation,a===!0)break}catch(c){process.env.VITEST_WORKER_ID!==void 0||console.error("Subscriber error:",c);continue}return{...(JSON.stringify(o)===JSON.stringify(t)?{}:{messages:o}),...(JSON.stringify(i)===JSON.stringify(r)?{}:{state:i}),...(a===void 0?{}:{stopPropagation:a})}});return _ke.apply(this,arguments)}var yv=(e,t,r,n)=>{let o=Oe(r.messages),i=Oe(e.state),a={},s=u=>{u.messages!==void 0&&(o=u.messages,a.messages=u.messages),u.state!==void 0&&(i=u.state,a.state=u.state)},c=()=>{let u=Oe(a);return a={},u.messages!==void 0||u.state!==void 0?Ue(u):Cc};return t.pipe(jc(/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(u){let h=yield ke(n,o,i,(S,v,g)=>S.onEvent?.({event:u,agent:r,input:e,messages:v,state:g}));if(s(h),h.stopPropagation===!0)return c();switch(u.type){case M.TEXT_MESSAGE_START:{let S=yield ke(n,o,i,(v,g,y)=>v.onTextMessageStartEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(S),S.stopPropagation!==!0){let{messageId:v,role:g="assistant"}=u;if(!o.find(y=>y.id===v)){let y={id:v,role:g,content:""};o.push(y),s({messages:o})}}return c()}case M.TEXT_MESSAGE_CONTENT:{let{messageId:S,delta:v}=u,g=o.find(x=>x.id===S);if(!g)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${S}'`),c();let y=yield ke(n,o,i,(x,C,E)=>x.onTextMessageContentEvent?.({event:u,messages:C,state:E,agent:r,input:e,textMessageBuffer:typeof g.content=="string"?g.content:""}));return s(y),y.stopPropagation!==!0&&(g.content=`${typeof g.content=="string"?g.content:""}${v}`,s({messages:o})),c()}case M.TEXT_MESSAGE_END:{let{messageId:S}=u,v=o.find(g=>g.id===S);return v?(s(yield ke(n,o,i,(g,y,x)=>g.onTextMessageEndEvent?.({event:u,messages:y,state:x,agent:r,input:e,textMessageBuffer:typeof v.content=="string"?v.content:""}))),yield Promise.all(n.map(g=>{g.onNewMessage?.({message:v,messages:o,state:i,agent:r,input:e})})),c()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${S}'`),c())}case M.TOOL_CALL_START:{let S=yield ke(n,o,i,(v,g,y)=>v.onToolCallStartEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(S),S.stopPropagation!==!0){let{toolCallId:v,toolCallName:g,parentMessageId:y}=u,x;y&&o.length>0&&o[o.length-1].id===y?x=o[o.length-1]:(x={id:y||v,role:"assistant",toolCalls:[]},o.push(x)),x.toolCalls??(x.toolCalls=[]),x.toolCalls.push({id:v,type:"function",function:{name:g,arguments:""}}),s({messages:o})}return c()}case M.TOOL_CALL_ARGS:{let{toolCallId:S,delta:v}=u,g=o.find(C=>C.toolCalls?.some(E=>E.id===S));if(!g)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${S}'`),c();let y=g.toolCalls?.find(C=>C.id===S);if(!y)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${S}'`),c();let x=yield ke(n,o,i,(C,E,_)=>{let I=y.function.arguments,k=y.function.name,T={};try{T=Vc(I)}catch{}return C.onToolCallArgsEvent?.({event:u,messages:E,state:_,agent:r,input:e,toolCallBuffer:I,toolCallName:k,partialToolCallArgs:T})});return s(x),x.stopPropagation!==!0&&(y.function.arguments+=v,s({messages:o})),c()}case M.TOOL_CALL_END:{let{toolCallId:S}=u,v=o.find(y=>y.toolCalls?.some(x=>x.id===S));if(!v)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${S}'`),c();let g=v.toolCalls?.find(y=>y.id===S);return g?(s(yield ke(n,o,i,(y,x,C)=>{let E=g.function.arguments,_=g.function.name,I={};try{I=JSON.parse(E)}catch{}return y.onToolCallEndEvent?.({event:u,messages:x,state:C,agent:r,input:e,toolCallName:_,toolCallArgs:I})})),yield Promise.all(n.map(y=>{y.onNewToolCall?.({toolCall:g,messages:o,state:i,agent:r,input:e})})),c()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${S}'`),c())}case M.TOOL_CALL_RESULT:{let S=yield ke(n,o,i,(v,g,y)=>v.onToolCallResultEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(S),S.stopPropagation!==!0){let{messageId:v,toolCallId:g,content:y,role:x}=u,C={id:v,toolCallId:g,role:x||"tool",content:y};o.push(C),yield Promise.all(n.map(E=>{E.onNewMessage?.({message:C,messages:o,state:i,agent:r,input:e})})),s({messages:o})}return c()}case M.STATE_SNAPSHOT:{let S=yield ke(n,o,i,(v,g,y)=>v.onStateSnapshotEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(S),S.stopPropagation!==!0){let{snapshot:v}=u;i=v,s({state:i})}return c()}case M.STATE_DELTA:{let S=yield ke(n,o,i,(v,g,y)=>v.onStateDeltaEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(S),S.stopPropagation!==!0){let{delta:v}=u;try{i=Lr(i,v,!0,!1).newDocument,s({state:i})}catch(g){let y=g instanceof Error?g.message:String(g);console.warn(`Failed to apply state patch:
|
|
36
36
|
Current state: ${JSON.stringify(i,null,2)}
|
|
37
|
-
Patch operations: ${JSON.stringify(
|
|
38
|
-
Error: ${y}`)}}return c()}case F.MESSAGES_SNAPSHOT:{let v=yield _e(n,o,i,(S,g,y)=>S.onMessagesSnapshotEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(v),v.stopPropagation!==!0){let{messages:S}=u;o=S,s({messages:o})}return c()}case F.ACTIVITY_SNAPSHOT:{let v=u,S=o.findIndex(x=>x.id===v.messageId),g=S>=0?o[S]:void 0,y=g?.role==="activity"?g:void 0,C=v.replace??!0,R=yield _e(n,o,i,(x,I,T)=>x.onActivitySnapshotEvent?.({event:v,messages:I,state:T,agent:r,input:e,activityMessage:y,existingMessage:g}));if(s(R),R.stopPropagation!==!0){let x={id:v.messageId,role:"activity",activityType:v.activityType,content:ke(v.content)},I;S===-1?(o.push(x),I=x):y?C&&(o[S]={...y,activityType:v.activityType,content:ke(v.content)}):C&&(o[S]=x,I=x),s({messages:o}),I&&(yield Promise.all(n.map(T=>T.onNewMessage?.({message:I,messages:o,state:i,agent:r,input:e}))))}return c()}case F.ACTIVITY_DELTA:{let v=u,S=o.findIndex(R=>R.id===v.messageId);if(S===-1)return console.warn(`ACTIVITY_DELTA: No message found with ID '${v.messageId}' to apply patch`),c();let g=o[S];if(g.role!=="activity")return console.warn(`ACTIVITY_DELTA: Message '${v.messageId}' is not an activity message`),c();let y=g,C=yield _e(n,o,i,(R,x,I)=>R.onActivityDeltaEvent?.({event:v,messages:x,state:I,agent:r,input:e,activityMessage:y}));if(s(C),C.stopPropagation!==!0)try{let R=ke(y.content??{}),x=Or(R,v.patch??[],!0,!1).newDocument;o[S]={...y,content:ke(x),activityType:v.activityType},s({messages:o})}catch(R){let x=R instanceof Error?R.message:String(R);console.warn(`Failed to apply activity patch for '${v.messageId}': ${x}`)}return c()}case F.RAW:return s(yield _e(n,o,i,(v,S,g)=>v.onRawEvent?.({event:u,messages:S,state:g,agent:r,input:e}))),c();case F.CUSTOM:return s(yield _e(n,o,i,(v,S,g)=>v.onCustomEvent?.({event:u,messages:S,state:g,agent:r,input:e}))),c();case F.RUN_STARTED:{let v=yield _e(n,o,i,(S,g,y)=>S.onRunStartedEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(v),v.stopPropagation!==!0){let S=u;if(S.input?.messages){for(let g of S.input.messages)o.find(y=>y.id===g.id)||o.push(g);s({messages:o})}}return c()}case F.RUN_FINISHED:return s(yield _e(n,o,i,(v,S,g)=>v.onRunFinishedEvent?.({event:u,messages:S,state:g,agent:r,input:e,result:u.result}))),c();case F.RUN_ERROR:return s(yield _e(n,o,i,(v,S,g)=>v.onRunErrorEvent?.({event:u,messages:S,state:g,agent:r,input:e}))),c();case F.STEP_STARTED:return s(yield _e(n,o,i,(v,S,g)=>v.onStepStartedEvent?.({event:u,messages:S,state:g,agent:r,input:e}))),c();case F.STEP_FINISHED:return s(yield _e(n,o,i,(v,S,g)=>v.onStepFinishedEvent?.({event:u,messages:S,state:g,agent:r,input:e}))),c();case F.TEXT_MESSAGE_CHUNK:throw Error("TEXT_MESSAGE_CHUNK must be tranformed before being applied");case F.TOOL_CALL_CHUNK:throw Error("TOOL_CALL_CHUNK must be tranformed before being applied");case F.THINKING_START:return c();case F.THINKING_END:return c();case F.THINKING_TEXT_MESSAGE_START:return c();case F.THINKING_TEXT_MESSAGE_CONTENT:return c();case F.THINKING_TEXT_MESSAGE_END:return c();case F.REASONING_START:return s(yield _e(n,o,i,(v,S,g)=>v.onReasoningStartEvent?.({event:u,messages:S,state:g,agent:r,input:e}))),c();case F.REASONING_MESSAGE_START:{let v=yield _e(n,o,i,(S,g,y)=>S.onReasoningMessageStartEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(v),v.stopPropagation!==!0){let{messageId:S}=u;if(!o.find(g=>g.id===S)){let g={id:S,role:"reasoning",content:""};o.push(g),s({messages:o})}}return c()}case F.REASONING_MESSAGE_CONTENT:{let{messageId:v,delta:S}=u,g=o.find(C=>C.id===v);if(!g)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${v}'`),c();let y=yield _e(n,o,i,(C,R,x)=>C.onReasoningMessageContentEvent?.({event:u,messages:R,state:x,agent:r,input:e,reasoningMessageBuffer:typeof g.content=="string"?g.content:""}));return s(y),y.stopPropagation!==!0&&(g.content=`${typeof g.content=="string"?g.content:""}${S}`,s({messages:o})),c()}case F.REASONING_MESSAGE_END:{let{messageId:v}=u,S=o.find(g=>g.id===v);return S?(s(yield _e(n,o,i,(g,y,C)=>g.onReasoningMessageEndEvent?.({event:u,messages:y,state:C,agent:r,input:e,reasoningMessageBuffer:typeof S.content=="string"?S.content:""}))),yield Promise.all(n.map(g=>{g.onNewMessage?.({message:S,messages:o,state:i,agent:r,input:e})})),c()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${v}'`),c())}case F.REASONING_MESSAGE_CHUNK:throw Error("REASONING_MESSAGE_CHUNK must be transformed before being applied");case F.REASONING_END:return s(yield _e(n,o,i,(v,S,g)=>v.onReasoningEndEvent?.({event:u,messages:S,state:g,agent:r,input:e}))),c();case F.REASONING_ENCRYPTED_VALUE:{let{subtype:v,entityId:S,encryptedValue:g}=u,y=yield _e(n,o,i,(C,R,x)=>C.onReasoningEncryptedValueEvent?.({event:u,messages:R,state:x,agent:r,input:e}));if(s(y),y.stopPropagation!==!0){let C=!1;if(v==="tool-call"){for(let R of o)if(R.role==="assistant"&&R.toolCalls){let x=R.toolCalls.find(I=>I.id===S);if(x){x.encryptedValue=g,C=!0;break}}}else{let R=o.find(x=>x.id===S);R?.role!=="activity"&&R&&(R.encryptedValue=g,C=!0)}C&&(a.messages=o)}return c()}}return u.type,c()});return function(_x88){return _ref43.apply(this,arguments)}}()),Hd(),n.length>0?Wd({}):u=>u)},df=e=>t=>{let r=new Map,n=new Map,o=!1,i=!1,a=!1,s=new Map,c=!1,u=!1,h=!1,v=()=>{r.clear(),n.clear(),s.clear(),c=!1,u=!1,o=!1,i=!1,h=!0};return t.pipe(yt(S=>{let g=S.type;if(e&&console.debug("[VERIFY]:",JSON.stringify(S)),i)return Fe(()=>new qe(`Cannot send event type '${g}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(o&&g!==F.RUN_ERROR&&g!==F.RUN_STARTED)return Fe(()=>new qe(`Cannot send event type '${g}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(a){if(g===F.RUN_STARTED){if(h&&!o)return Fe(()=>new qe("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&&v()}}else if(a=!0,g!==F.RUN_STARTED&&g!==F.RUN_ERROR)return Fe(()=>new qe("First event must be 'RUN_STARTED'"));switch(g){case F.TEXT_MESSAGE_START:{let y=S.messageId;return r.has(y)?Fe(()=>new qe(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${y}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(r.set(y,!0),je(S))}case F.TEXT_MESSAGE_CONTENT:{let y=S.messageId;return r.has(y)?je(S):Fe(()=>new qe(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${y}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case F.TEXT_MESSAGE_END:{let y=S.messageId;return r.has(y)?(r.delete(y),je(S)):Fe(()=>new qe(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${y}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case F.TOOL_CALL_START:{let y=S.toolCallId;return n.has(y)?Fe(()=>new qe(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${y}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(n.set(y,!0),je(S))}case F.TOOL_CALL_ARGS:{let y=S.toolCallId;return n.has(y)?je(S):Fe(()=>new qe(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${y}'. Start a tool call with 'TOOL_CALL_START' first.`))}case F.TOOL_CALL_END:{let y=S.toolCallId;return n.has(y)?(n.delete(y),je(S)):Fe(()=>new qe(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${y}'. A 'TOOL_CALL_START' event must be sent first.`))}case F.STEP_STARTED:{let y=S.stepName;return s.has(y)?Fe(()=>new qe(`Step "${y}" is already active for 'STEP_STARTED'`)):(s.set(y,!0),je(S))}case F.STEP_FINISHED:{let y=S.stepName;return s.has(y)?(s.delete(y),je(S)):Fe(()=>new qe(`Cannot send 'STEP_FINISHED' for step "${y}" that was not started`))}case F.RUN_STARTED:return h=!0,je(S);case F.RUN_FINISHED:if(s.size>0){let y=Array.from(s.keys()).join(", ");return Fe(()=>new qe(`Cannot send 'RUN_FINISHED' while steps are still active: ${y}`))}if(r.size>0){let y=Array.from(r.keys()).join(", ");return Fe(()=>new qe(`Cannot send 'RUN_FINISHED' while text messages are still active: ${y}`))}if(n.size>0){let y=Array.from(n.keys()).join(", ");return Fe(()=>new qe(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${y}`))}return o=!0,je(S);case F.RUN_ERROR:return i=!0,je(S);case F.CUSTOM:return je(S);case F.THINKING_TEXT_MESSAGE_START:return c?u?Fe(()=>new qe("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.")):(u=!0,je(S)):Fe(()=>new qe("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first."));case F.THINKING_TEXT_MESSAGE_CONTENT:return u?je(S):Fe(()=>new qe("Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first."));case F.THINKING_TEXT_MESSAGE_END:return u?(u=!1,je(S)):Fe(()=>new qe("Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first."));case F.THINKING_START:return c?Fe(()=>new qe("Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.")):(c=!0,je(S));case F.THINKING_END:return c?(c=!1,je(S)):Fe(()=>new qe("Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."));default:return je(S)}}))},Cn=function(e){return e.HEADERS="headers",e.DATA="data",e}({}),E_=(e,t)=>zd(()=>An(A(e,t))).pipe(Kd(r=>{if(!r.ok){let i=r.headers.get("content-type")||"";return An(r.text()).pipe(yt(a=>{let s=a;if(i.includes("application/json"))try{s=JSON.parse(a)}catch{}let c=Error(`HTTP ${r.status}: ${typeof s=="string"?s:JSON.stringify(s)}`);return c.status=r.status,c.payload=s,Fe(()=>c)}))}let n={type:Cn.HEADERS,status:r.status,headers:r.headers},o=r.body?.getReader();return o?new Ne(i=>(i.next(n),_asyncToGenerator(function*(){try{for(;;){let{done:a,value:s}=yield o.read();if(a)break;let c={type:Cn.DATA,data:s};i.next(c)}i.complete()}catch(a){i.error(a)}})(),()=>{o.cancel().catch(a=>{if(a?.name!=="AbortError")throw a})})):Fe(()=>Error("Failed to getReader() from response"))})),R_=e=>{let t=new zt,r=new TextDecoder("utf-8",{fatal:!1}),n="";e.subscribe({next:i=>{if(i.type!==Cn.HEADERS&&i.type===Cn.DATA&&i.data){let a=r.decode(i.data,{stream:!0});n+=a;let s=n.split(/\n\n/);n=s.pop()||"";for(let c of s)o(c)}},error:i=>t.error(i),complete:()=>{n&&(n+=r.decode(),o(n)),t.complete()}});function o(i){let a=i.split(`
|
|
37
|
+
Patch operations: ${JSON.stringify(v,null,2)}
|
|
38
|
+
Error: ${y}`)}}return c()}case M.MESSAGES_SNAPSHOT:{let S=yield ke(n,o,i,(v,g,y)=>v.onMessagesSnapshotEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(S),S.stopPropagation!==!0){let{messages:v}=u;o=v,s({messages:o})}return c()}case M.ACTIVITY_SNAPSHOT:{let S=u,v=o.findIndex(E=>E.id===S.messageId),g=v>=0?o[v]:void 0,y=g?.role==="activity"?g:void 0,x=S.replace??!0,C=yield ke(n,o,i,(E,_,I)=>E.onActivitySnapshotEvent?.({event:S,messages:_,state:I,agent:r,input:e,activityMessage:y,existingMessage:g}));if(s(C),C.stopPropagation!==!0){let E={id:S.messageId,role:"activity",activityType:S.activityType,content:Oe(S.content)},_;v===-1?(o.push(E),_=E):y?x&&(o[v]={...y,activityType:S.activityType,content:Oe(S.content)}):x&&(o[v]=E,_=E),s({messages:o}),_&&(yield Promise.all(n.map(I=>I.onNewMessage?.({message:_,messages:o,state:i,agent:r,input:e}))))}return c()}case M.ACTIVITY_DELTA:{let S=u,v=o.findIndex(C=>C.id===S.messageId);if(v===-1)return console.warn(`ACTIVITY_DELTA: No message found with ID '${S.messageId}' to apply patch`),c();let g=o[v];if(g.role!=="activity")return console.warn(`ACTIVITY_DELTA: Message '${S.messageId}' is not an activity message`),c();let y=g,x=yield ke(n,o,i,(C,E,_)=>C.onActivityDeltaEvent?.({event:S,messages:E,state:_,agent:r,input:e,activityMessage:y}));if(s(x),x.stopPropagation!==!0)try{let C=Oe(y.content??{}),E=Lr(C,S.patch??[],!0,!1).newDocument;o[v]={...y,content:Oe(E),activityType:S.activityType},s({messages:o})}catch(C){let E=C instanceof Error?C.message:String(C);console.warn(`Failed to apply activity patch for '${S.messageId}': ${E}`)}return c()}case M.RAW:return s(yield ke(n,o,i,(S,v,g)=>S.onRawEvent?.({event:u,messages:v,state:g,agent:r,input:e}))),c();case M.CUSTOM:return s(yield ke(n,o,i,(S,v,g)=>S.onCustomEvent?.({event:u,messages:v,state:g,agent:r,input:e}))),c();case M.RUN_STARTED:{let S=yield ke(n,o,i,(v,g,y)=>v.onRunStartedEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(S),S.stopPropagation!==!0){let v=u;if(v.input?.messages){for(let g of v.input.messages)o.find(y=>y.id===g.id)||o.push(g);s({messages:o})}}return c()}case M.RUN_FINISHED:return s(yield ke(n,o,i,(S,v,g)=>S.onRunFinishedEvent?.({event:u,messages:v,state:g,agent:r,input:e,result:u.result}))),c();case M.RUN_ERROR:return s(yield ke(n,o,i,(S,v,g)=>S.onRunErrorEvent?.({event:u,messages:v,state:g,agent:r,input:e}))),c();case M.STEP_STARTED:return s(yield ke(n,o,i,(S,v,g)=>S.onStepStartedEvent?.({event:u,messages:v,state:g,agent:r,input:e}))),c();case M.STEP_FINISHED:return s(yield ke(n,o,i,(S,v,g)=>S.onStepFinishedEvent?.({event:u,messages:v,state:g,agent:r,input:e}))),c();case M.TEXT_MESSAGE_CHUNK:throw Error("TEXT_MESSAGE_CHUNK must be tranformed before being applied");case M.TOOL_CALL_CHUNK:throw Error("TOOL_CALL_CHUNK must be tranformed before being applied");case M.THINKING_START:return c();case M.THINKING_END:return c();case M.THINKING_TEXT_MESSAGE_START:return c();case M.THINKING_TEXT_MESSAGE_CONTENT:return c();case M.THINKING_TEXT_MESSAGE_END:return c();case M.REASONING_START:return s(yield ke(n,o,i,(S,v,g)=>S.onReasoningStartEvent?.({event:u,messages:v,state:g,agent:r,input:e}))),c();case M.REASONING_MESSAGE_START:{let S=yield ke(n,o,i,(v,g,y)=>v.onReasoningMessageStartEvent?.({event:u,messages:g,state:y,agent:r,input:e}));if(s(S),S.stopPropagation!==!0){let{messageId:v}=u;if(!o.find(g=>g.id===v)){let g={id:v,role:"reasoning",content:""};o.push(g),s({messages:o})}}return c()}case M.REASONING_MESSAGE_CONTENT:{let{messageId:S,delta:v}=u,g=o.find(x=>x.id===S);if(!g)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${S}'`),c();let y=yield ke(n,o,i,(x,C,E)=>x.onReasoningMessageContentEvent?.({event:u,messages:C,state:E,agent:r,input:e,reasoningMessageBuffer:typeof g.content=="string"?g.content:""}));return s(y),y.stopPropagation!==!0&&(g.content=`${typeof g.content=="string"?g.content:""}${v}`,s({messages:o})),c()}case M.REASONING_MESSAGE_END:{let{messageId:S}=u,v=o.find(g=>g.id===S);return v?(s(yield ke(n,o,i,(g,y,x)=>g.onReasoningMessageEndEvent?.({event:u,messages:y,state:x,agent:r,input:e,reasoningMessageBuffer:typeof v.content=="string"?v.content:""}))),yield Promise.all(n.map(g=>{g.onNewMessage?.({message:v,messages:o,state:i,agent:r,input:e})})),c()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${S}'`),c())}case M.REASONING_MESSAGE_CHUNK:throw Error("REASONING_MESSAGE_CHUNK must be transformed before being applied");case M.REASONING_END:return s(yield ke(n,o,i,(S,v,g)=>S.onReasoningEndEvent?.({event:u,messages:v,state:g,agent:r,input:e}))),c();case M.REASONING_ENCRYPTED_VALUE:{let{subtype:S,entityId:v,encryptedValue:g}=u,y=yield ke(n,o,i,(x,C,E)=>x.onReasoningEncryptedValueEvent?.({event:u,messages:C,state:E,agent:r,input:e}));if(s(y),y.stopPropagation!==!0){let x=!1;if(S==="tool-call"){for(let C of o)if(C.role==="assistant"&&C.toolCalls){let E=C.toolCalls.find(_=>_.id===v);if(E){E.encryptedValue=g,x=!0;break}}}else{let C=o.find(E=>E.id===v);C?.role!=="activity"&&C&&(C.encryptedValue=g,x=!0)}x&&(a.messages=o)}return c()}}return u.type,c()});return function(_x92){return _ref43.apply(this,arguments)}}()),wf(),n.length>0?xf({}):u=>u)},Lf=e=>t=>{let r=new Map,n=new Map,o=!1,i=!1,a=!1,s=new Map,c=!1,u=!1,h=!1,S=()=>{r.clear(),n.clear(),s.clear(),c=!1,u=!1,o=!1,i=!1,h=!0};return t.pipe(bt(v=>{let g=v.type;if(e&&console.debug("[VERIFY]:",JSON.stringify(v)),i)return je(()=>new Ve(`Cannot send event type '${g}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(o&&g!==M.RUN_ERROR&&g!==M.RUN_STARTED)return je(()=>new Ve(`Cannot send event type '${g}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(a){if(g===M.RUN_STARTED){if(h&&!o)return je(()=>new Ve("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(a=!0,g!==M.RUN_STARTED&&g!==M.RUN_ERROR)return je(()=>new Ve("First event must be 'RUN_STARTED'"));switch(g){case M.TEXT_MESSAGE_START:{let y=v.messageId;return r.has(y)?je(()=>new Ve(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${y}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(r.set(y,!0),Ue(v))}case M.TEXT_MESSAGE_CONTENT:{let y=v.messageId;return r.has(y)?Ue(v):je(()=>new Ve(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${y}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case M.TEXT_MESSAGE_END:{let y=v.messageId;return r.has(y)?(r.delete(y),Ue(v)):je(()=>new Ve(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${y}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case M.TOOL_CALL_START:{let y=v.toolCallId;return n.has(y)?je(()=>new Ve(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${y}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(n.set(y,!0),Ue(v))}case M.TOOL_CALL_ARGS:{let y=v.toolCallId;return n.has(y)?Ue(v):je(()=>new Ve(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${y}'. Start a tool call with 'TOOL_CALL_START' first.`))}case M.TOOL_CALL_END:{let y=v.toolCallId;return n.has(y)?(n.delete(y),Ue(v)):je(()=>new Ve(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${y}'. A 'TOOL_CALL_START' event must be sent first.`))}case M.STEP_STARTED:{let y=v.stepName;return s.has(y)?je(()=>new Ve(`Step "${y}" is already active for 'STEP_STARTED'`)):(s.set(y,!0),Ue(v))}case M.STEP_FINISHED:{let y=v.stepName;return s.has(y)?(s.delete(y),Ue(v)):je(()=>new Ve(`Cannot send 'STEP_FINISHED' for step "${y}" that was not started`))}case M.RUN_STARTED:return h=!0,Ue(v);case M.RUN_FINISHED:if(s.size>0){let y=Array.from(s.keys()).join(", ");return je(()=>new Ve(`Cannot send 'RUN_FINISHED' while steps are still active: ${y}`))}if(r.size>0){let y=Array.from(r.keys()).join(", ");return je(()=>new Ve(`Cannot send 'RUN_FINISHED' while text messages are still active: ${y}`))}if(n.size>0){let y=Array.from(n.keys()).join(", ");return je(()=>new Ve(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${y}`))}return o=!0,Ue(v);case M.RUN_ERROR:return i=!0,Ue(v);case M.CUSTOM:return Ue(v);case M.THINKING_TEXT_MESSAGE_START:return c?u?je(()=>new Ve("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.")):(u=!0,Ue(v)):je(()=>new Ve("Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first."));case M.THINKING_TEXT_MESSAGE_CONTENT:return u?Ue(v):je(()=>new Ve("Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first."));case M.THINKING_TEXT_MESSAGE_END:return u?(u=!1,Ue(v)):je(()=>new Ve("Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first."));case M.THINKING_START:return c?je(()=>new Ve("Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.")):(c=!0,Ue(v));case M.THINKING_END:return c?(c=!1,Ue(v)):je(()=>new Ve("Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first."));default:return Ue(v)}}))},Dn=function(e){return e.HEADERS="headers",e.DATA="data",e}({}),_0=(e,t)=>Af(()=>Pn(w(e,t))).pipe(Cf(r=>{if(!r.ok){let i=r.headers.get("content-type")||"";return Pn(r.text()).pipe(bt(a=>{let s=a;if(i.includes("application/json"))try{s=JSON.parse(a)}catch{}let c=Error(`HTTP ${r.status}: ${typeof s=="string"?s:JSON.stringify(s)}`);return c.status=r.status,c.payload=s,je(()=>c)}))}let n={type:Dn.HEADERS,status:r.status,headers:r.headers},o=r.body?.getReader();return o?new qe(i=>(i.next(n),_asyncToGenerator(function*(){try{for(;;){let{done:a,value:s}=yield o.read();if(a)break;let c={type:Dn.DATA,data:s};i.next(c)}i.complete()}catch(a){i.error(a)}})(),()=>{o.cancel().catch(a=>{if(a?.name!=="AbortError")throw a})})):je(()=>Error("Failed to getReader() from response"))})),k0=e=>{let t=new er,r=new TextDecoder("utf-8",{fatal:!1}),n="";e.subscribe({next:i=>{if(i.type!==Dn.HEADERS&&i.type===Dn.DATA&&i.data){let a=r.decode(i.data,{stream:!0});n+=a;let s=n.split(/\n\n/);n=s.pop()||"";for(let c of s)o(c)}},error:i=>t.error(i),complete:()=>{n&&(n+=r.decode(),o(n)),t.complete()}});function o(i){let a=i.split(`
|
|
39
39
|
`),s=[];for(let c of a)c.startsWith("data:")&&s.push(c.slice(5).replace(/^ /,""));if(s.length>0)try{let c=s.join(`
|
|
40
|
-
`),u=JSON.parse(c);t.next(u)}catch(c){t.error(c)}}return t.asObservable()},
|
|
41
|
-
`)},U_=(e,t,r)=>n=>{let o={},i=!0,a=!0,s="",c=null,u=null,h=[],v={},S=g=>{typeof g=="object"&&g&&("messages"in g&&delete g.messages,o=g)};return n.pipe(yt(g=>{switch(g.type){case F.TEXT_MESSAGE_START:{let y=g;return[{type:Pe.enum.TextMessageStart,messageId:y.messageId,role:y.role}]}case F.TEXT_MESSAGE_CONTENT:{let y=g;return[{type:Pe.enum.TextMessageContent,messageId:y.messageId,content:y.delta}]}case F.TEXT_MESSAGE_END:{let y=g;return[{type:Pe.enum.TextMessageEnd,messageId:y.messageId}]}case F.TOOL_CALL_START:{let y=g;return h.push({id:y.toolCallId,type:"function",function:{name:y.toolCallName,arguments:""}}),a=!0,v[y.toolCallId]=y.toolCallName,[{type:Pe.enum.ActionExecutionStart,actionExecutionId:y.toolCallId,actionName:y.toolCallName,parentMessageId:y.parentMessageId}]}case F.TOOL_CALL_ARGS:{let y=g,C=h.find(x=>x.id===y.toolCallId);if(!C)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${y.toolCallId}'`),[];C.function.arguments+=y.delta;let R=!1;if(u){let x=u.find(I=>I.tool==C.function.name);if(x)try{let I=JSON.parse(dc(C.function.arguments));x.tool_argument&&x.tool_argument in I?(S({...o,[x.state_key]:I[x.tool_argument]}),R=!0):x.tool_argument||(S({...o,[x.state_key]:I}),R=!0)}catch{}}return[{type:Pe.enum.ActionExecutionArgs,actionExecutionId:y.toolCallId,args:y.delta},...(R?[{type:Pe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}]:[])]}case F.TOOL_CALL_END:{let y=g;return[{type:Pe.enum.ActionExecutionEnd,actionExecutionId:y.toolCallId}]}case F.TOOL_CALL_RESULT:{let y=g;return[{type:Pe.enum.ActionExecutionResult,actionExecutionId:y.toolCallId,result:y.content,actionName:v[y.toolCallId]||"unknown"}]}case F.RAW:return[];case F.CUSTOM:{let y=g;switch(y.name){case"Exit":i=!1;break;case"PredictState":u=y.value;break}return[{type:Pe.enum.MetaEvent,name:y.name,value:y.value}]}case F.STATE_SNAPSHOT:return S(g.snapshot),[{type:Pe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}];case F.STATE_DELTA:{let y=g,C=Or(o,y.delta,!0,!1);return C?(S(C.newDocument),[{type:Pe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}]):[]}case F.MESSAGES_SNAPSHOT:return c=g.messages,[{type:Pe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify({...o,...(c?{messages:c}:{})}),active:!0}];case F.RUN_STARTED:return[];case F.RUN_FINISHED:return c&&(o.messages=c),Object.keys(o).length===0?[]:[{type:Pe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify({...o,...(c?{messages:B_(c)}:{})}),active:!1}];case F.RUN_ERROR:{let y=g;return[{type:Pe.enum.RunError,message:y.message,code:y.code}]}case F.STEP_STARTED:return s=g.stepName,h=[],u=null,[{type:Pe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:!0}];case F.STEP_FINISHED:return h=[],u=null,[{type:Pe.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:!1}];default:return[]}}))};function B_(e){let t=[];for(let r of e)if(r.role==="assistant"||r.role==="user"||r.role==="system"){let n=V_(r.content);if(n){let o={id:r.id,role:r.role,content:n};t.push(o)}if(r.role==="assistant"&&r.toolCalls&&r.toolCalls.length>0)for(let o of r.toolCalls){let i={id:o.id,name:o.function.name,arguments:JSON.parse(o.function.arguments),parentMessageId:r.id};t.push(i)}}else if(r.role==="tool"){let n="unknown";for(let i of e)if(i.role==="assistant"&&i.toolCalls?.length){for(let a of i.toolCalls)if(a.id===r.toolCallId){n=a.function.name;break}}let o={id:r.id,result:r.content,actionExecutionId:r.toolCallId,actionName:n};t.push(o)}return t}var qc=e=>t=>{let r,n,o,i,a=()=>{if(!r||i!=="text")throw Error("No text message to close");let h={type:F.TEXT_MESSAGE_END,messageId:r.messageId};return i=void 0,r=void 0,e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_END",JSON.stringify(h)),h},s=()=>{if(!n||i!=="tool")throw Error("No tool call to close");let h={type:F.TOOL_CALL_END,toolCallId:n.toolCallId};return i=void 0,n=void 0,e&&console.debug("[TRANSFORM]: TOOL_CALL_END",JSON.stringify(h)),h},c=()=>{if(!o||i!=="reasoning")throw Error("No reasoning message to close");let h={type:F.REASONING_MESSAGE_END,messageId:o.messageId};return i=void 0,o=void 0,e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_END",JSON.stringify(h)),h},u=()=>i==="text"?[a()]:i==="tool"?[s()]:i==="reasoning"?[c()]:[];return t.pipe(yt(h=>{switch(h.type){case F.TEXT_MESSAGE_START:case F.TEXT_MESSAGE_CONTENT:case F.TEXT_MESSAGE_END:case F.TOOL_CALL_START:case F.TOOL_CALL_ARGS:case F.TOOL_CALL_END:case F.TOOL_CALL_RESULT:case F.STATE_SNAPSHOT:case F.STATE_DELTA:case F.MESSAGES_SNAPSHOT:case F.CUSTOM:case F.RUN_STARTED:case F.RUN_FINISHED:case F.RUN_ERROR:case F.STEP_STARTED:case F.STEP_FINISHED:case F.THINKING_START:case F.THINKING_END:case F.THINKING_TEXT_MESSAGE_START:case F.THINKING_TEXT_MESSAGE_CONTENT:case F.THINKING_TEXT_MESSAGE_END:case F.REASONING_START:case F.REASONING_MESSAGE_START:case F.REASONING_MESSAGE_CONTENT:case F.REASONING_MESSAGE_END:case F.REASONING_END:return[...u(),h];case F.RAW:case F.ACTIVITY_SNAPSHOT:case F.ACTIVITY_DELTA:case F.REASONING_ENCRYPTED_VALUE:return[h];case F.TEXT_MESSAGE_CHUNK:let v=h,S=[];if((i!=="text"||v.messageId!==void 0&&v.messageId!==r?.messageId)&&S.push(...u()),i!=="text"){if(v.messageId===void 0)throw Error("First TEXT_MESSAGE_CHUNK must have a messageId");r={messageId:v.messageId},i="text";let x={type:F.TEXT_MESSAGE_START,messageId:v.messageId,role:v.role||"assistant"};S.push(x),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_START",JSON.stringify(x))}if(v.delta!==void 0){let x={type:F.TEXT_MESSAGE_CONTENT,messageId:r.messageId,delta:v.delta};S.push(x),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_CONTENT",JSON.stringify(x))}return S;case F.TOOL_CALL_CHUNK:let g=h,y=[];if((i!=="tool"||g.toolCallId!==void 0&&g.toolCallId!==n?.toolCallId)&&y.push(...u()),i!=="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},i="tool";let x={type:F.TOOL_CALL_START,toolCallId:g.toolCallId,toolCallName:g.toolCallName,parentMessageId:g.parentMessageId};y.push(x),e&&console.debug("[TRANSFORM]: TOOL_CALL_START",JSON.stringify(x))}if(g.delta!==void 0){let x={type:F.TOOL_CALL_ARGS,toolCallId:n.toolCallId,delta:g.delta};y.push(x),e&&console.debug("[TRANSFORM]: TOOL_CALL_ARGS",JSON.stringify(x))}return y;case F.REASONING_MESSAGE_CHUNK:let C=h,R=[];if((i!=="reasoning"||C.messageId&&C.messageId!==o?.messageId)&&R.push(...u()),i!=="reasoning"){if(C.messageId===void 0)throw Error("First REASONING_MESSAGE_CHUNK must have a messageId");o={messageId:C.messageId},i="reasoning";let x={type:F.REASONING_MESSAGE_START,messageId:C.messageId};R.push(x),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_START",JSON.stringify(x))}if(C.delta!==void 0){let x={type:F.REASONING_MESSAGE_CONTENT,messageId:o.messageId,delta:C.delta};R.push(x),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_CONTENT",JSON.stringify(x))}return R}return h.type,[]}),xn(()=>{u()}))},ff=class{runNext(e,t){return t.run(e).pipe(qc(!1))}runNextWithState(e,t){let r=ke(e.messages||[]),n=ke(e.state||{}),o=new Ws;return Iv(e,o,t,[]).subscribe(i=>{i.messages!==void 0&&(r=i.messages),i.state!==void 0&&(n=i.state)}),this.runNext(e,t).pipe(uc(/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(i){return o.next(i),yield new Promise(a=>setTimeout(a,0)),{event:i,messages:ke(r),state:ke(n)}});return function(_x89){return _ref45.apply(this,arguments)}}()))}},$_=class extends ff{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function G_(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 Q_=class extends ff{run(e,t){let{parentRunId:r,...n}=e,o={...n,messages:n.messages.map(G_)};return this.runNext(o,t)}},wv="THINKING_START",xv="THINKING_END",Cv="THINKING_TEXT_MESSAGE_START",Ev="THINKING_TEXT_MESSAGE_CONTENT",Rv="THINKING_TEXT_MESSAGE_END",H_=class extends ff{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(wn(r=>this.transformEvent(r)))}transformEvent(e){switch(e.type){case wv:{this.currentReasoningId=Ki();let{title:t,...r}=e;return this.warnAboutTransformation(wv,F.REASONING_START),{...r,type:F.REASONING_START,messageId:this.currentReasoningId}}case Cv:return this.currentMessageId=Ki(),this.warnAboutTransformation(Cv,F.REASONING_MESSAGE_START),{...e,type:F.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case Ev:{let{delta:t,...r}=e;return this.warnAboutTransformation(Ev,F.REASONING_MESSAGE_CONTENT),{...r,type:F.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??Ki(),delta:t}}case Rv:{let t=this.currentMessageId??Ki();return this.warnAboutTransformation(Rv,F.REASONING_MESSAGE_END),{...e,type:F.REASONING_MESSAGE_END,messageId:t}}case xv:{let t=this.currentReasoningId??Ki();return this.warnAboutTransformation(xv,F.REASONING_END),{...e,type:F.REASONING_END,messageId:t}}default:return e}}},z_="0.0.45",W_=class{get maxVersion(){return z_}constructor({agentId:e,description:t,threadId:r,initialMessages:n,initialState:o,debug:i}={}){this.debug=!1,this.subscribers=[],this.isRunning=!1,this.middlewares=[],this.agentId=e,this.description=t??"",this.threadId=r??Rr(),this.messages=ke(n??[]),this.state=ke(o??{}),this.debug=i??!1,Mc(this.maxVersion,"0.0.39")<=0&&this.middlewares.unshift(new Q_),Mc(this.maxVersion,"0.0.45")<=0&&this.middlewares.unshift(new H_)}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 $_(r):r);return this.middlewares.push(...t),this}runAgent(e,t){var _this14=this;return _asyncToGenerator(function*(){try{_this14.isRunning=!0,_this14.agentId=_this14.agentId??Rr();let r=_this14.prepareRunAgentInput(e),n,o=new Set(_this14.messages.map(c=>c.id)),i=[{onRunFinishedEvent:c=>{n=c.result}},..._this14.subscribers,t??{}];yield _this14.onInitialize(r,i),_this14.activeRunDetach$=new zt;let a;_this14.activeRunCompletionPromise=new Promise(c=>{a=c}),yield cc(zs(()=>_this14.middlewares.length===0?_this14.run(r):_this14.middlewares.reduceRight((c,u)=>({run:h=>u.run(h,c)}),_this14).run(r),qc(_this14.debug),df(_this14.debug),c=>c.pipe(lc(_this14.activeRunDetach$)),c=>_this14.apply(r,c,i),c=>_this14.processApplyEvents(r,c,i),Hi(c=>(_this14.isRunning=!1,_this14.onError(r,c,i))),xn(()=>{_this14.isRunning=!1,_this14.onFinalize(r,i),a?.(),a=void 0,_this14.activeRunCompletionPromise=void 0,_this14.activeRunDetach$=void 0}))(je(null)));let s=ke(_this14.messages).filter(c=>!o.has(c.id));return{result:n,newMessages:s}}finally{_this14.isRunning=!1}})()}connect(e){throw new Nd}connectAgent(e,t){var _this15=this;return _asyncToGenerator(function*(){try{_this15.isRunning=!0,_this15.agentId=_this15.agentId??Rr();let r=_this15.prepareRunAgentInput(e),n,o=new Set(_this15.messages.map(c=>c.id)),i=[{onRunFinishedEvent:c=>{n=c.result}},..._this15.subscribers,t??{}];yield _this15.onInitialize(r,i),_this15.activeRunDetach$=new zt;let a;_this15.activeRunCompletionPromise=new Promise(c=>{a=c}),yield cc(zs(()=>_this15.connect(r),qc(_this15.debug),df(_this15.debug),c=>c.pipe(lc(_this15.activeRunDetach$)),c=>_this15.apply(r,c,i),c=>_this15.processApplyEvents(r,c,i),Hi(c=>(_this15.isRunning=!1,c instanceof Nd?Ks:_this15.onError(r,c,i))),xn(()=>{_this15.isRunning=!1,_this15.onFinalize(r,i),a?.(),a=void 0,_this15.activeRunCompletionPromise=void 0,_this15.activeRunDetach$=void 0}))(je(null)));let s=ke(_this15.messages).filter(c=>!o.has(c.id));return{result:n,newMessages:s}}finally{_this15.isRunning=!1}})()}abortRun(){}detachActiveRun(){var _this16=this;return _asyncToGenerator(function*(){if(!_this16.activeRunDetach$)return;let e=_this16.activeRunCompletionPromise??Promise.resolve();_this16.activeRunDetach$.next(),_this16.activeRunDetach$?.complete(),yield e})()}apply(e,t,r){return Iv(e,t,this,r)}processApplyEvents(e,t,r){return t.pipe(Yd(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=ke(this.messages).filter(r=>r.role!=="activity");return{threadId:this.threadId,runId:e?.runId||Rr(),tools:ke(e?.tools??[]),context:ke(e?.context??[]),forwardedProps:ke(e?.forwardedProps??{}),state:ke(this.state),messages:t}}onInitialize(e,t){var _this17=this;return _asyncToGenerator(function*(){let r=yield _e(t,_this17.messages,_this17.state,(n,o,i)=>n.onRunInitialized?.({messages:o,state:i,agent:_this17,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages&&(_this17.messages=r.messages,e.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this17.messages,state:_this17.state,agent:_this17,input:e})})),r.state&&(_this17.state=r.state,e.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this17.state,messages:_this17.messages,agent:_this17,input:e})})))})()}onError(e,t,r){return An(_e(r,this.messages,this.state,(n,o,i)=>n.onRunFailed?.({error:t,messages:o,state:i,agent:this,input:e}))).pipe(wn(n=>{let o=n;if((o.messages!==void 0||o.state!==void 0)&&(o.messages!==void 0&&(this.messages=o.messages,r.forEach(i=>{i.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),o.state!==void 0&&(this.state=o.state,r.forEach(i=>{i.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),o.stopPropagation!==!0)throw console.error("Agent execution failed:",t),t;return{}}))}onFinalize(e,t){var _this18=this;return _asyncToGenerator(function*(){let r=yield _e(t,_this18.messages,_this18.state,(n,o,i)=>n.onRunFinalized?.({messages:o,state:i,agent:_this18,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages!==void 0&&(_this18.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this18.messages,state:_this18.state,agent:_this18,input:e})})),r.state!==void 0&&(_this18.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this18.state,messages:_this18.messages,agent:_this18,input:e})})))})()}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=ke(this.messages),e.state=ke(this.state),e.debug=this.debug,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e}addMessage(e){var _this19=this;this.messages.push(e),_asyncToGenerator(function*(){for(let t of _this19.subscribers)yield t.onNewMessage?.({message:e,messages:_this19.messages,state:_this19.state,agent:_this19});if(e.role==="assistant"&&e.toolCalls)for(let t of e.toolCalls)for(let r of _this19.subscribers)yield r.onNewToolCall?.({toolCall:t,messages:_this19.messages,state:_this19.state,agent:_this19});for(let t of _this19.subscribers)yield t.onMessagesChanged?.({messages:_this19.messages,state:_this19.state,agent:_this19})})()}addMessages(e){var _this20=this;this.messages.push(...e),_asyncToGenerator(function*(){for(let t of e){for(let r of _this20.subscribers)yield r.onNewMessage?.({message:t,messages:_this20.messages,state:_this20.state,agent:_this20});if(t.role==="assistant"&&t.toolCalls)for(let r of t.toolCalls)for(let n of _this20.subscribers)yield n.onNewToolCall?.({toolCall:r,messages:_this20.messages,state:_this20.state,agent:_this20})}for(let t of _this20.subscribers)yield t.onMessagesChanged?.({messages:_this20.messages,state:_this20.state,agent:_this20})})()}setMessages(e){var _this21=this;this.messages=ke(e),_asyncToGenerator(function*(){for(let t of _this21.subscribers)yield t.onMessagesChanged?.({messages:_this21.messages,state:_this21.state,agent:_this21})})()}setState(e){var _this22=this;this.state=ke(e),_asyncToGenerator(function*(){for(let t of _this22.subscribers)yield t.onStateChanged?.({messages:_this22.messages,state:_this22.state,agent:_this22})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??Rr();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(qc(this.debug),df(this.debug),U_(this.threadId,t.runId,this.agentId),r=>r.pipe(wn(n=>(this.debug&&console.debug("[LEGACY]:",JSON.stringify(n)),n))))}},Tv=class extends W_{requestInit(e){return{method:"POST",headers:{...this.headers,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(e),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new l.AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new l.AbortController,this.url=e.url,this.headers=ke(e.headers??{})}run(e){return T_(E_(this.url,this.requestInit(e)))}clone(){let e=super.clone();e.url=this.url,e.headers=ke(this.headers??{});let t=new l.AbortController,r=this.abortController.signal;return r.aborted&&t.abort(r.reason),e.abortController=t,e}};m();d();p();f();var _v=(e,t,r)=>{let n=We(t,r),o=e?.trim();if(!n||!t||!o)throw new Error("Missing required parameters for answer endpoint");let i=`/api/preview/organizations/${t}/agents`;return`${n}${i}/${o}`};var pf=class extends Tv{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}}},kv=(e,t,r)=>new pf({url:`${_v(e,t,r)}/answer`});m();d();p();f();m();d();p();f();var K_=new H({required:!0}),Ov=new H({required:!0,constrainTo:As}),Pv=e=>({...e,name:ws(e.name)}),Nv=P("followUpAnswers/setIsEnabled",e=>q(e,new ue({required:!0}))),Fv=P("followUpAnswers/setFollowUpAnswersConversationId",e=>q(e,X)),PZ=P("followUpAnswers/createFollowUpAnswer",e=>q(e,{question:X})),NZ=P("followUpAnswers/setActiveFollowUpAnswerId",e=>q(e,X)),FZ=P("followUpAnswers/setFollowUpAnswerContentFormat",e=>q(e,{contentFormat:xs,answerId:X})),DZ=P("followUpAnswers/setFollowUpIsLoading",e=>q(e,{isLoading:new ue({required:!0}),answerId:X})),MZ=P("followUpAnswers/setFollowUpIsStreaming",e=>q(e,{isStreaming:new ue({required:!0}),answerId:X})),qZ=P("followUpAnswers/followUpMessageChunkReceived",e=>q(e,{textDelta:K_,answerId:X})),jZ=P("followUpAnswers/followUpCitationsReceived",e=>q(e,{citations:new ge({required:!0,each:new ee({values:vd})}),answerId:X})),LZ=P("followUpAnswers/followUpCompleted",e=>q(e,{answerId:X,cannotAnswer:new ue({required:!1})})),VZ=P("followUpAnswers/followUpFailed",e=>q(e,{message:new H,code:new te({min:0}),answerId:X})),UZ=P("followUpAnswers/activeFollowUpStartFailed",e=>q(e,{message:new H})),BZ=P("followUpAnswers/likeFollowUp",e=>q(e,{answerId:X})),$Z=P("followUpAnswers/dislikeFollowUp",e=>q(e,{answerId:X})),GZ=P("followUpAnswers/submitFollowUpFeedback",e=>q(e,{answerId:X})),Dv=P("followUpAnswers/resetFollowUpAnswers"),QZ=P("followUpAnswers/stepStarted",e=>q(Pv(e),{answerId:X,name:Ov,startedAt:new te({min:0,required:!0})})),HZ=P("followUpAnswers/stepFinished",e=>q(Pv(e),{answerId:X,name:Ov,finishedAt:new te({min:0,required:!0})}));m();d();p();f();var Y_={"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 Mv(e){return e?Y_[e]??1004:1004}var qv=e=>({onRunStartedEvent:({event:t})=>{e(Cs(t.runId)),e(Er(!1)),e(Oi(!0)),e(Fv(t.threadId))},onStepStartedEvent:({event:t})=>{e(_h({name:t.stepName,startedAt:t.timestamp??Date.now()}))},onStepFinishedEvent:({event:t})=>{e(kh({name:t.stepName,finishedAt:t.timestamp??Date.now()}))},onTextMessageContentEvent:({event:t})=>{e(Pi({textDelta:t.delta}))},onCustomEvent:({event:t})=>{let{name:r,value:n}=t;switch(r){case"header":{n?.contentFormat&&e(Di(n.contentFormat)),n?.followUpEnabled&&e(Nv(n.followUpEnabled));return}case"citations":{e(Ni({citations:n.citations}));return}}},onRunErrorEvent:({event:t})=>{let r=Mv(t.code);e(Fi({message:t.message,code:r}))},onRunFinishedEvent:({event:t})=>{let r=t.result?.completionReason==="ANSWERED";e(Sd(r)),e(Mi(!r)),e(Oi(!1)),e(go(r)),e(ho())}});var jv=()=>{let e,t=()=>{e?.abortRun(),e=void 0};return{run:function(){var _ref50=_asyncToGenerator(function*(n,o,i){t();let a=ss(n),s=Jm(n),c=Zm(n),u=Xm(n),h=kv(a,s,c);e=h;let v=qv(o),S=xh(n,i());try{o(Er(!0)),yield h.runAgent({forwardedProps:{params:S,accessToken:u}},v)}catch(g){o(Er(!1)),o(Fi({message:"An error occurred while starting the answer generation."})),console.error("Error running the answer agent:",g)}});return function run(_x90,_x91,_x92){return _ref50.apply(this,arguments)}}(),abortRun:t}};m();d();p();f();m();d();p();f();var jc=P("breadcrumb/deselectAll"),Lv=P("breadcrumb/deselectAllNonBreadcrumbs");m();d();p();f();var Vv=P("facet/updateFacetAutoSelection",e=>q(e,{allow:new ue({required:!0})}));m();d();p();f();m();d();p();f();var Lc=class extends vr{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??St().q}get responseTime(){return this.activeInstantResultCache?.duration??Mt().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??Mt().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var Uv=()=>ct("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new Lc(e)),Bv=()=>({actionCause:"searchboxAsYouType"});m();d();p();f();var mf={id:X},X_={...mf,q:Je},tte=P("instantResults/register",e=>q(e,mf)),Vc=P("instantResults/updateQuery",e=>q(e,X_)),rte=P("instantResults/clearExpired",e=>q(e,mf));m();d();p();f();var Uc=new te({required:!0,min:0}),Bc=P("pagination/registerNumberOfResults",e=>q(e,Uc)),$c=P("pagination/updateNumberOfResults",e=>q(e,Uc)),Gc=P("pagination/registerPage",e=>q(e,Uc)),jo=P("pagination/updatePage",e=>q(e,Uc)),Qc=P("pagination/nextPage"),Hc=P("pagination/previousPage");m();d();p();f();var Lo=P("query/updateQuery",e=>q(e,{q:new H,enableQuerySyntax:new ue}));m();d();p();f();m();d();p();f();m();d();p();f();var Nr=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var gf=()=>ct("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),Fr=e=>ct("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||St().q,aq:r.advancedSearchQueries?.aq||Nr().aq,cq:r.advancedSearchQueries?.cq||Nr().cq,dq:r.advancedSearchQueries?.dq||Nr().dq,errorType:e.type,errorMessage:e.message}));m();d();p();f();m();d();p();f();var Vte=P("didYouMean/enable"),Ute=P("didYouMean/disable"),Bte=P("didYouMean/automaticCorrections/disable"),$te=P("didYouMean/automaticCorrections/enable"),zc=P("didYouMean/correction",e=>q(e,X)),Gte=P("didYouMean/automaticCorrections/mode",e=>q(e,new H({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));m();d();p();f();var hf=()=>ct("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());var $v=()=>({actionCause:"didYouMeanAutomatic"});m();d();p();f();m();d();p();f();function Wc(){return{contextValues:{}}}m();d();p();f();function Kc(){return{contextValues:{}}}m();d();p();f();function Gv(){return{freezeFacetOrder:!1,facets:{}}}m();d();p();f();function Qv(){return[]}m();d();p();f();function Yi(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}m();d();p();f();function Hv(){return{}}m();d();p();f();function zv(){return{}}m();d();p();f();function Wv(){return{}}function Wt(e){return{context:e.context||Wc(),dictionaryFieldContext:e.dictionaryFieldContext||Kc(),facetSet:e.facetSet||as(),numericFacetSet:e.numericFacetSet||is(),dateFacetSet:e.dateFacetSet||os(),categoryFacetSet:e.categoryFacetSet||ns(),automaticFacetSet:e.automaticFacetSet??rs(),pagination:e.pagination||Yi(),query:e.query||St(),tabSet:e.tabSet||Wv(),advancedSearchQueries:e.advancedSearchQueries||Nr(),staticFilterSet:e.staticFilterSet||zv(),querySet:e.querySet||Hv(),sortCriteria:e.sortCriteria||cs(),pipeline:e.pipeline||Xn(),searchHub:e.searchHub||ao(),facetOptions:e.facetOptions||Gv(),facetOrder:e.facetOrder??Qv(),debug:e.debug??qa()}}m();d();p();f();var hne=new ee({values:{undoneQuery:Je},options:{required:!0}}),Kv=()=>ct("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);m();d();p();f();var Yc=P("trigger/query/ignore",e=>q(e,new H({emptyAllowed:!0,required:!0}))),Xc=P("trigger/query/modification",e=>q(e,new ee({values:{originalQuery:Xe,modification:Xe}})));m();d();p();f();var Dr=/*#__PURE__*/function(){var _ref51=_asyncToGenerator(function*(e,t){let r=e0(e),n=bs(e),o=J_(e),i=yield xr(e,t),a=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Ar({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:a(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Dr(_x93,_x94){return _ref51.apply(this,arguments)}}();function J_(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(Z_).filter(r=>r.currentValues.length>0):void 0}function Z_(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function e0(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=t0(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}function t0(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o})}var Mr=class{constructor(t,r=n=>{this.dispatch(Lo({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x95,_x96){var _this23=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=Ss(yield _this23.extra.apiClient.search(r,n),t),a=Date.now()-o,s=_this23.getState().query?.q||"";return{response:i,duration:a,queryExecuted:s,requestExecuted:r}}).apply(this,arguments)}process(t){var _this24=this;return _asyncToGenerator(function*(){return _this24.processQueryErrorOrContinue(t)??(yield _this24.processQueryCorrectionsOrContinue(t))??(yield _this24.processQueryTriggersOrContinue(t))??_this24.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return dt(t.response)?(this.dispatch(Fr(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this25=this;return _asyncToGenerator(function*(){let r=_this25.getState(),n=_this25.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:s,queryCorrection:c}=n;if(!o||!i)return null;let u=a.length===0&&s&&s.length!==0,h=!ie(c)&&!ie(c.correctedQuery);if(!u&&!h)return null;let S=u?yield _this25.processLegacyDidYouMeanAutoCorrection(t):_this25.processModernDidYouMeanAutoCorrection(t);return _this25.dispatch(Vt(Wt(_this25.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this26=this;return _asyncToGenerator(function*(){let r=_this26.getCurrentQuery(),n=_this26.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this26.automaticallyRetryQueryWithCorrection(o);return dt(i.response)?(_this26.dispatch(Fr(i.response.error)),_this26.rejectWithValue(i.response.error)):(_this26.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this26.dispatch(Vt(Wt(_this26.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:hf()})})()}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:hf()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this27=this;return _asyncToGenerator(function*(){let r=_this27.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(s=>s.type==="query")?.content||"";if(!n)return null;if(_this27.getState().triggers?.queryModification.queryToIgnore===n)return _this27.dispatch(Yc("")),null;_this27.analyticsAction&&(yield _this27.dispatch(_this27.analyticsAction));let i=_this27.getCurrentQuery(),a=yield _this27.automaticallyRetryQueryWithTriggerModification(n);return dt(a.response)?(_this27.dispatch(Fr(a.response.error)),_this27.rejectWithValue(a.response.error)):(_this27.dispatch(Vt(Wt(_this27.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i,analyticsAction:Kv()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??St().enableQuerySyntax},search:{...Mt(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(Vt(Wt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return ga(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this28=this;return _asyncToGenerator(function*(){_this28.onUpdateQueryForCorrection(t);let r=yield _this28.fetchFromAPI(yield Dr(_this28.getState()),{origin:"mainSearch"});return _this28.dispatch(zc(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this29=this;return _asyncToGenerator(function*(){return _this29.dispatch(Xc({newQuery:t,originalQuery:_this29.getCurrentQuery()})),_this29.onUpdateQueryForCorrection(t),yield _this29.fetchFromAPI(yield Dr(_this29.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var goe=Ee("search/executeSearch",/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Jc(r,t,e)});return function(_x97,_x98){return _ref52.apply(this,arguments)}}()),hoe=Ee("search/fetchPage",/*#__PURE__*/function(){var _ref53=_asyncToGenerator(function*(e,t){let r=t.getState();return yield vf(r,t,e)});return function(_x99,_x100){return _ref53.apply(this,arguments)}}()),yoe=Ee("search/fetchMoreResults",/*#__PURE__*/function(){var _ref54=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Sf(t,r)});return function(_x101,_x102){return _ref54.apply(this,arguments)}}()),voe=Ee("search/fetchFacetValues",/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(e,t){let r=t.getState();return yield i0(t,e,r)});return function(_x103,_x104){return _ref55.apply(this,arguments)}}()),Soe=Ee("search/fetchInstantResults",/*#__PURE__*/function(){var _ref56=_asyncToGenerator(function*(e,t){return yf(e,t)});return function(_x105,_x106){return _ref56.apply(this,arguments)}}()),r0=/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(e,t){let r=yield Dr(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function r0(_x107,_x108){return _ref57.apply(this,arguments)}}(),n0=/*#__PURE__*/function(){var _ref58=_asyncToGenerator(function*(e,t,r){let n=yield xr(e);return Ar({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function n0(_x109,_x110,_x111){return _ref58.apply(this,arguments)}}(),o0=/*#__PURE__*/function(){var _ref59=_asyncToGenerator(function*(e,t){let r=yield Dr(e,t);return r.request.numberOfResults=0,r});return function o0(_x112,_x113){return _ref59.apply(this,arguments)}}(),Yv=e=>{e.configuration.analytics.enabled&&wt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function yf(_x114,_x115){return _yf.apply(this,arguments)}function _yf(){_yf=_asyncToGenerator(function*(e,t){q(e,{id:X,q:X,maxResultsPerQuery:new te({required:!0,min:1}),cacheTimeout:new te});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),i=new Mr({...t,analyticsAction:Uv()},u=>{t.dispatch(Vc({q:u,id:e.id}))}),a=yield n0(o,r,n),s=yield i.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),c=yield i.process(s);return"response"in c?{results:c.response.results,searchUid:c.response.searchUid,analyticsAction:c.analyticsAction,totalCountFiltered:c.response.totalCountFiltered,duration:c.duration}:c});return _yf.apply(this,arguments)}function vf(_x116,_x117,_x118){return _vf.apply(this,arguments)}function _vf(){_vf=_asyncToGenerator(function*(e,t,r){Yv(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),s=new Mr({...t,analyticsAction:r}),c=yield Dr(e,a),u=yield s.fetchFromAPI(c,{origin:"mainSearch"});return yield s.process(u)});return _vf.apply(this,arguments)}function Sf(_x119,_x120){return _Sf.apply(this,arguments)}function _Sf(){_Sf=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:i}=yield gf().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),a=new Mr({...e,analyticsAction:gf()}),s=yield r0(t,i),c=yield a.fetchFromAPI(s,{origin:"mainSearch"});return yield a.process(c)});return _Sf.apply(this,arguments)}function i0(_x121,_x122,_x123){return _i2.apply(this,arguments)}function _i2(){_i2=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=e.extra,{description:a}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),s=new Mr({...e,analyticsAction:t}),c=yield o0(r,a),u=yield s.fetchFromAPI(c,{origin:"facetValues"});return yield s.process(u)});return _i2.apply(this,arguments)}function Jc(_x124,_x125,_x126){return _Jc.apply(this,arguments)}function _Jc(){_Jc=_asyncToGenerator(function*(e,t,r){Yv(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),s=yield Dr(e,a),c=new Mr({...t,analyticsAction:r}),u=yield c.fetchFromAPI(s,{origin:"mainSearch"});return yield c.process(u)});return _Jc.apply(this,arguments)}m();d();p();f();var qr=class{constructor(t,r=n=>{this.dispatch(Lo({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x127,_x128){var _this30=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=Ss(yield _this30.extra.apiClient.search(r,n),t),a=Date.now()-o,s=_this30.getState().query?.q||"";return{response:i,duration:a,queryExecuted:s,requestExecuted:r}}).apply(this,arguments)}process(t){var _this31=this;return _asyncToGenerator(function*(){return _this31.processQueryErrorOrContinue(t)??(yield _this31.processQueryCorrectionsOrContinue(t))??(yield _this31.processQueryTriggersOrContinue(t))??_this31.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return dt(t.response)?(this.dispatch(Fr(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this32=this;return _asyncToGenerator(function*(){let r=_this32.getState(),n=_this32.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:s,queryCorrection:c}=n;if(!o||!i)return null;let u=a.length===0&&s&&s.length!==0,h=!ie(c)&&!ie(c.correctedQuery);if(!u&&!h)return null;let S=u?yield _this32.processLegacyDidYouMeanAutoCorrection(t):_this32.processModernDidYouMeanAutoCorrection(t);return _this32.dispatch(Vt(Wt(_this32.getState()))),S})()}processLegacyDidYouMeanAutoCorrection(t){var _this33=this;return _asyncToGenerator(function*(){let r=_this33.getCurrentQuery(),n=_this33.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this33.automaticallyRetryQueryWithCorrection(o);return dt(i.response)?(_this33.dispatch(Fr(i.response.error)),_this33.rejectWithValue(i.response.error)):(_this33.dispatch(Vt(Wt(_this33.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this34=this;return _asyncToGenerator(function*(){let r=_this34.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(s=>s.type==="query")?.content||"";if(!n)return null;if(_this34.getState().triggers?.queryModification.queryToIgnore===n)return _this34.dispatch(Yc("")),null;let i=_this34.getCurrentQuery(),a=yield _this34.automaticallyRetryQueryWithTriggerModification(n);return dt(a.response)?(_this34.dispatch(Fr(a.response.error)),_this34.rejectWithValue(a.response.error)):(_this34.dispatch(Vt(Wt(_this34.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i})})()}processSuccessResponse(t){return this.dispatch(Vt(Wt(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return ga(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this35=this;return _asyncToGenerator(function*(){_this35.onUpdateQueryForCorrection(t);let r=_this35.getState(),{actionCause:n}=$v(),o=yield _this35.fetchFromAPI(yield Cr(r,_this35.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this35.dispatch(zc(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this36=this;return _asyncToGenerator(function*(){return _this36.dispatch(Xc({newQuery:t,originalQuery:_this36.getCurrentQuery()})),_this36.onUpdateQueryForCorrection(t),yield _this36.fetchFromAPI(yield Cr(_this36.getState(),_this36.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var oie=Ee("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;q(e,{q:new H,enableQuerySyntax:new ue,clearFilters:new ue}),e.clearFilters&&(r(jc()),r(Lv())),r(Vv({allow:!0})),r(Lo({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(jo(1))}),iie=P("search/updateSearchAction"),Zc=Ee("search/executeSearch",/*#__PURE__*/function(){var _ref60=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Jc(r,t,e.legacy);Jv(r);let n=e.next?Zv(e.next):void 0,o=yield Cr(r,t.extra.navigatorContext,n),i=new qr({...t,analyticsAction:n??{}}),a=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(a)});return function(_x129,_x130){return _ref60.apply(this,arguments)}}()),Xv=Ee("search/fetchPage",/*#__PURE__*/function(){var _ref61=_asyncToGenerator(function*(e,t){let r=t.getState();if(Jv(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return vf(r,t,e.legacy);let n=new qr({...t,analyticsAction:e.next}),o=yield Cr(r,t.extra.navigatorContext,e.next),i=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(i)});return function(_x131,_x132){return _ref61.apply(this,arguments)}}()),aie=Ee("search/fetchMoreResults",/*#__PURE__*/function(){var _ref62=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Sf(t,r);let n=vg("browseResults",t.getState),o=new qr({...t,analyticsAction:n}),i=yield a0(r,t.extra.navigatorContext,n),a=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(a)});return function(_x133,_x134){return _ref62.apply(this,arguments)}}()),sie=Ee("search/fetchFacetValues",/*#__PURE__*/function(){var _ref63=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Jc(r,t,e.legacy);let n=new qr({...t,analyticsAction:{}}),o=yield c0(r,t.extra.navigatorContext),i=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(i)});return function(_x135,_x136){return _ref63.apply(this,arguments)}}()),cie=Ee("search/fetchInstantResults",/*#__PURE__*/function(){var _ref64=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return yf(e,t);q(e,{id:X,q:X,maxResultsPerQuery:new te({required:!0,min:1}),cacheTimeout:new te});let{q:n,maxResultsPerQuery:o}=e,i=Zv(Bv()),a=yield s0(r,t.extra.navigatorContext,n,o,i),s=new qr({...t,analyticsAction:i},h=>{t.dispatch(Vc({q:h,id:e.id}))}),c=yield s.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),u=yield s.process(c);return"response"in u?{results:u.response.results,searchUid:u.response.searchUid,totalCountFiltered:u.response.totalCountFiltered,duration:u.duration}:u});return function(_x137,_x138){return _ref64.apply(this,arguments)}}()),a0=/*#__PURE__*/function(){var _ref65=_asyncToGenerator(function*(e,t,r){let n=yield Cr(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function a0(_x139,_x140,_x141){return _ref65.apply(this,arguments)}}(),s0=/*#__PURE__*/function(){var _ref66=_asyncToGenerator(function*(e,t,r,n,o){let i=vo(e,t,o);return Ar({...i,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function s0(_x142,_x143,_x144,_x145,_x146){return _ref66.apply(this,arguments)}}(),c0=/*#__PURE__*/function(){var _ref67=_asyncToGenerator(function*(e,t,r){let n=yield Cr(e,t,r);return n.request.numberOfResults=0,n});return function c0(_x147,_x148,_x149){return _ref67.apply(this,arguments)}}(),Jv=e=>{e.configuration.analytics.enabled&&wt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},Zv=e=>({actionCause:e.actionCause,type:e.actionCause});var eS=e=>{let t=sm({extra:e}),r=jv();return t.startListening({actionCreator:Zc.pending,effect:function(){var _ref68=_asyncToGenerator(function*(n,o){let i=o.getState();if(!Ol(i))return;r.abortRun(),o.dispatch(Es()),o.dispatch(Dv());let a=Zr(i)?.q;!a||a.trim()===""||r.run(i,o.dispatch,e.getNavigatorContext)});return function effect(_x150,_x151){return _ref68.apply(this,arguments)}}()}),t};m();d();p();f();var tS=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)},rS=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));m();d();p();f();var bf=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:i}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:i}};m();d();p();f();function nS(e,t){let r={...e},n,o=i=>(a,s)=>{let c=i(a,s);return n?n(c,s):c};return{get combinedReducer(){let i=Zf(Object.entries(t).filter(([a])=>!(a in r)).map(([a,s])=>[a,()=>s]));return o(qn({...i,...r}))},containsAll(i){return Object.keys(i).every(s=>s in r)},add(i){Object.keys(i).filter(a=>!(a in r)).forEach(a=>{r[a]=i[a]})},addCrossReducer(i){n=i}}}m();d();p();f();m();d();p();f();function u0(e){if(!e||!l0(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function oS(e,t=60){if(!e)return!1;let r=u0(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function l0(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function aS(e,t){let r=0,n=null,o=ca(()=>{r=0},500),i=/*#__PURE__*/function(){var _ref69=_asyncToGenerator(function*(c,u=!1){let h=!n;h&&t&&(n=_asyncToGenerator(function*(){try{return yield t()}catch(S){if(!u)throw S;return null}})().finally(()=>{n=null}));let v=yield n;return h&&v&&c.dispatch(gr({accessToken:v})),v});return function i(_x152){return _ref69.apply(this,arguments)}}(),a=/*#__PURE__*/function(){var _ref71=_asyncToGenerator(function*(c){let u=c.getState(),h=f0(u);if(!(!h||!oS(h))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield i(c))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(v){e.warn(v,"Access token renewal failed. A retry will occur if necessary.")}}});return function a(_x153){return _ref71.apply(this,arguments)}}(),s=/*#__PURE__*/function(){var _ref72=_asyncToGenerator(function*(c,u,h){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),iS(c,u.error),u;r++,o(),yield i(c,!0),c.dispatch(h)});return function s(_x154,_x155,_x156){return _ref72.apply(this,arguments)}}();return c=>u=>(/*#__PURE__*/function(){var _ref73=_asyncToGenerator(function*(h){let v=typeof h=="function",S=typeof t=="function";if(!v)return u(h);S&&(yield a(c));let g=yield u(h);return d0(g)?S?yield s(c,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."),iS(c,g.error),g):g});return function(_x157){return _ref73.apply(this,arguments)}}())}function d0(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new Mn().name}function iS(e,t){e.dispatch(La({status:401,statusCode:401,message:t.message,type:t.name}))}function f0(e){return e.configuration.accessToken}m();d();p();f();function sS({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return zp({reducer:e,preloadedState:t,devTools:{stateSanitizer:i=>i.history?{...i,history:"<<OMIT>>"}:i,name:o,shouldHotReload:!1},middleware:i=>i({thunk:{extraArgument:n}}).prepend(...r).concat(rS(n.logger))})}function p0(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},i={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return i.analyticsMode!=="next"&&Jf()?(t.info("Analytics disabled since doNotTrack is active."),{...i,enabled:!1}):i}function cS(e,t){let r={...e.reducers,configuration:Ot,version:Vh},n=m0({...e,reducers:r},t,Ot),{accessToken:o,environment:i,organizationId:a}=e.configuration;n.dispatch(gr({accessToken:o,environment:i,organizationId:a}));let s=p0(e.configuration,n.logger);return s&&n.dispatch(zn(s)),n}function m0(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,i=nS({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&i.addCrossReducer(e.crossReducer);let a=t.logger,s={...t,get relay(){return wi(u.state,o)},get navigatorContext(){return bf(this.relay,o)}},c=g0(e,s,i),u={addReducers(h){i.containsAll(h)||(i.add(h),c.replaceReducer(i.combinedReducer))},dispatch:c.dispatch,subscribe:c.subscribe,enableAnalytics(){c.dispatch(Kn())},disableAnalytics(){c.dispatch(Wn())},get state(){return c.getState()},get relay(){return wi(this.state,o)},get navigatorContext(){return bf(this.relay,o)},logger:a,store:c};return u}function g0(e,t,r){let{preloadedState:n,configuration:o}=e,i=o.name||"coveo-headless",a=h0(e,t.logger,()=>t.navigatorContext);return sS({preloadedState:n,reducer:r.combinedReducer,middlewares:a,thunkExtraArguments:t,name:i})}function h0(e,t,r){let{renewAccessToken:n}=e.configuration,o=aS(t,n),i=eS({getNavigatorContext:r});return[Kh,o,tS(t),Bh].concat(Ad.middleware,i.middleware,e.middlewares||[])}m();d();p();f();var yS=_t(hS(),1);function vS(e){return(0,yS.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}m();d();p();f();function SS(e,t){let r=F0(e),n=At,o=D0(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function F0(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function D0(e){return e.preprocessRequest||da}m();d();p();f();m();d();p();f();var bS={organizationId:X,accessToken:X,name:new H({required:!1,emptyAllowed:!1}),analytics:new ee({options:{required:!1},values:{enabled:new ue({required:!1}),originContext:new H({required:!1}),originLevel2:new H({required:!1}),originLevel3:new H({required:!1}),analyticsMode:new H({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new H({required:!1,url:!0}),trackingId:new H({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new H({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function AS(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var wS=new lt({...bS,pipeline:new H({required:!1,emptyAllowed:!0}),searchHub:Xe,locale:Xe,timezone:Xe});function Rf(){return{...AS(),searchHub:"default"}}var M0={debug:ja,pipeline:Jn,searchHub:fo,recommendation:uo};function xS(e){let t=vS(e.loggerOptions);q0(e.configuration,t);let r=j0(e.configuration,t),n={...SS(e.configuration,t),apiClient:r},o={...e,reducers:M0},i=cS(o,n),{pipeline:a,searchHub:s,timezone:c,locale:u,proxyBaseUrl:h}=e.configuration;return i.dispatch(Lt({timezone:c,locale:u,proxyBaseUrl:h})),ie(a)||i.dispatch(Yn(a)),ie(s)||i.dispatch(lo(s)),{...i,get state(){return i.state}}}function q0(e,t){try{wS.validate(e)}catch(r){throw t.error(r,"Recommendation engine configuration error"),r}}function j0(e,t){return new ma({logger:t,preprocessRequest:e.preprocessRequest||da,postprocessSearchResponseMiddleware:e.preprocessSearchResponseMiddleware||hp,postprocessFacetSearchResponseMiddleware:yp,postprocessQuerySuggestResponseMiddleware:vp})}m();d();p();f();m();d();p();f();m();d();p();f();var L0=new ge({each:X,required:!0}),CS=(e,t)=>(q(e,X),aa(t)?q(t,X):q(t,L0),{payload:{contextKey:e,contextValue:t}}),Rn=P("context/set",e=>{for(let[t,r]of Object.entries(e))CS(t,r);return{payload:e}}),In=P("context/add",e=>CS(e.contextKey,e.contextValue)),Tn=P("context/remove",e=>q(e,X));m();d();p();f();var ru=Me(Wc(),e=>{e.addCase(Rn,(t,r)=>{t.contextValues=r.payload}).addCase(In,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(Tn,(t,r)=>{delete t.contextValues[r.payload]}).addCase(mt.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});m();d();p();f();function Lr(e){let t,r=new Map,n=()=>r.size===0,o=i=>{try{let a=JSON.stringify(i),s=t!==a;return t=a,s}catch(a){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",a),!0}};return{subscribe(i){i();let a=Symbol(),s;return n()&&(t=JSON.stringify(this.state),s=e.subscribe(()=>{o(this.state)&&r.forEach(c=>c())})),r.set(a,i),()=>{r.delete(a),n()&&s?.()}},get state(){return{}}}}m();d();p();f();var V0=["caseId","caseNumber"],U0={caseId:"caseContext",caseNumber:"caseContext"},Ji=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${U0[t]} to set this value.}`)}};function If(e){return V0.includes(e)}var B0=new lt({values:new ee({options:{required:!1}})});function ES(e,t={}){if(!Q0(e))throw Dt;let r=Lr(e),{dispatch:n}=e,o=()=>e.state,i=lm(e,B0,t.initialState,"buildContext");return i.values&&n(Rn(i.values)),{...r,get state(){return{values:o().context.contextValues}},set(a){n(Rn(a))},...(o().configuration.analytics.analyticsMode==="legacy"?$0(n):G0(n))}}var $0=e=>({add(t,r){e(In({contextKey:t,contextValue:r}))},remove(t){e(Tn(t))}}),G0=e=>({add(t,r){if(If(t))throw new Ji(t);e(In({contextKey:t,contextValue:r}))},remove(t){if(If(t))throw new Ji(t);e(Tn(t))}});function Q0(e){return e.addReducers({context:ru}),!0}function RS(e,t){return ES(e,t)}m();d();p();f();m();d();p();f();var Uo=P("dictionaryFieldContext/set",e=>{let t=new ee({options:{required:!0}}),r=q(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new ge({each:Je}),i=q(n,o).error;return i?{payload:e,error:i}:{payload:e}}),Bo=P("dictionaryFieldContext/add",e=>{let t=new ee({options:{required:!0},values:{field:Je,key:Je}});return q(e,t)}),$o=P("dictionaryFieldContext/remove",e=>q(e,Je));m();d();p();f();var nu=Me(Kc(),e=>{e.addCase(Uo,(t,r)=>{t.contextValues=r.payload}).addCase(Bo,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase($o,(t,r)=>{delete t.contextValues[r.payload]}).addCase(mt.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function IS(e){if(!H0(e))throw Dt;let t=Lr(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(Uo(o))},add(o,i){r(Bo({field:o,key:i}))},remove(o){r($o(o))}}}function H0(e){return e.addReducers({dictionaryFieldContext:nu}),!0}m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();var Zi={value:X,numberOfResults:new te({min:0}),state:X};m();d();p();f();var Ie=X;var Y0=new te({min:1,default:8,required:!1}),X0=new te({min:1,max:20,default:5,required:!1}),J0={desiredCount:X0,numberOfValues:Y0},gue=P("automaticFacet/setOptions",e=>q(e,J0)),hue=P("automaticFacet/deselectAll",e=>q(e,Ie)),Z0=X,TS=P("automaticFacet/toggleSelectValue",e=>q(e,{field:Z0,selection:new ee({values:Zi})}));m();d();p();f();m();d();p();f();var ek={state:new Oe({required:!0}),numberOfResults:new te({required:!0,min:0}),value:new H({required:!0,emptyAllowed:!0}),path:new ge({required:!0,each:X}),moreValuesAvailable:new ue({required:!1})};function Tf(e){e.children.forEach(t=>{Tf(t)}),At({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},ek)}var Go={facetId:Ie,field:X,tabs:new ee({options:{required:!1},values:{included:new ge({each:new H}),excluded:new ge({each:new H})}}),activeTab:new H({required:!1}),delimitingCharacter:new H({required:!1,emptyAllowed:!0}),filterFacetCount:new ue({required:!1}),injectionDepth:new te({required:!1,min:0}),numberOfValues:new te({required:!1,min:1}),sortCriteria:new Oe({required:!1}),basePath:new ge({required:!1,each:X}),filterByBasePath:new ue({required:!1})};var Fue=P("categoryFacet/register",e=>q(e,Go)),_S=P("categoryFacet/toggleSelectValue",e=>{try{return At(e.facetId,X),Tf(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:Zt(t)}}}),kS=P("categoryFacet/deselectAll",e=>q(e,Go.facetId)),Due=P("categoryFacet/updateNumberOfValues",e=>q(e,{facetId:Go.facetId,numberOfValues:Go.numberOfValues})),Mue=P("categoryFacet/updateSortCriterion",e=>q(e,{facetId:Go.facetId,criterion:new Oe})),que=P("categoryFacet/updateBasePath",e=>q(e,{facetId:Go.facetId,basePath:new ge({each:X})}));m();d();p();f();m();d();p();f();var ea={facetId:Ie,captions:new ee({options:{required:!1}}),numberOfValues:new te({required:!1,min:1}),query:new H({required:!1,emptyAllowed:!0})};var tk={path:new ge({required:!0,each:X}),displayValue:Je,rawValue:Je,count:new te({required:!0,min:0})},OS=P("categoryFacet/selectSearchResult",e=>q(e,{facetId:Ie,value:new ee({values:tk})})),tle=P("categoryFacetSearch/register",e=>q(e,ea));m();d();p();f();var PS={facetId:Ie,value:new ee({values:{displayValue:Je,rawValue:Je,count:new te({required:!0,min:0})}})},fle=P("facetSearch/register",e=>q(e,ea)),ple=P("facetSearch/update",e=>q(e,ea)),NS=P("facetSearch/toggleSelectValue",e=>q(e,PS)),FS=P("facetSearch/toggleExcludeValue",e=>q(e,PS));m();d();p();f();m();d();p();f();var ble=new H({regex:/^[a-zA-Z0-9-_]+$/}),Ale=new H({required:!0}),wle=new ge({each:new H}),xle=new H,Cle=new ue,Ele=new ue,Rle=new te({min:0}),rk=new te({min:1}),Ile=new ue({required:!0}),nk=new ee,ok=new H,ik={captions:nk,numberOfValues:rk,query:ok},Tle=new ee({values:ik}),DS=new ee({options:{required:!1},values:{type:new H({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new ge({required:!0,max:25,each:new H({emptyAllowed:!1,required:!0})})}}),_le=new ue,MS=new ge({min:1,max:25,required:!1,each:new H({emptyAllowed:!1,required:!0})});var ak={facetId:Ie,field:new H({required:!0,emptyAllowed:!0}),tabs:new ee({options:{required:!1},values:{included:new ge({each:new H}),excluded:new ge({each:new H})}}),activeTab:new H({required:!1}),filterFacetCount:new ue({required:!1}),injectionDepth:new te({required:!1,min:0}),numberOfValues:new te({required:!1,min:1}),sortCriteria:new Oe({required:!1}),resultsMustMatch:new Oe({required:!1}),allowedValues:DS,customSort:MS},Ule=P("facet/register",e=>q(e,ak)),qS=P("facet/toggleSelectValue",e=>q(e,{facetId:Ie,selection:new ee({values:Zi})})),jS=P("facet/toggleExcludeValue",e=>q(e,{facetId:Ie,selection:new ee({values:Zi})})),ou=P("facet/deselectAll",e=>q(e,Ie)),Ble=P("facet/updateSortCriterion",e=>q(e,{facetId:Ie,criterion:new Oe({required:!0})})),$le=P("facet/updateNumberOfValues",e=>q(e,{facetId:Ie,numberOfValues:new te({required:!0,min:1})})),Gle=P("facet/updateIsFieldExpanded",e=>q(e,{facetId:Ie,isFieldExpanded:new ue({required:!0})})),Qle=P("facet/updateFreezeCurrentValues",e=>q(e,{facetId:Ie,freezeCurrentValues:new ue({required:!0})}));m();d();p();f();m();d();p();f();function VS(e){let t=LS(e.start,e),r=LS(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function LS(e,t){let{dateFormat:r}=t;return ah(e)?(cd(e),nh(e)):typeof e=="string"&&br(e)?(cd(e),e):(Zg(e,r),vs(yo(e,r)))}m();d();p();f();var US=P("rangeFacet/updateSortCriterion",e=>q(e,{facetId:Ie,criterion:new Oe({required:!0})}));m();d();p();f();var iu={state:X,start:new te({required:!0}),end:new te({required:!0}),endInclusive:new ue({required:!0}),numberOfResults:new te({required:!0,min:0})},au={start:X,end:X,endInclusive:new ue({required:!0}),state:X,numberOfResults:new te({required:!0,min:0})};var sk={start:X,end:X,endInclusive:new ue({required:!0}),state:X},ck={facetId:Ie,field:X,tabs:new ee({options:{required:!1},values:{included:new ge({each:new H}),excluded:new ge({each:new H})}}),activeTab:new H({required:!1}),currentValues:new ge({required:!1,each:new ee({values:sk})}),generateAutomaticRanges:new ue({required:!0}),filterFacetCount:new ue({required:!1}),injectionDepth:new te({required:!1,min:0}),numberOfValues:new te({required:!1,min:1}),sortCriteria:new Oe({required:!1}),rangeAlgorithm:new Oe({required:!1})};function BS(e){return br(e)?_i(e):e}function $S(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=VS(t);if(yo(BS(r)).isAfter(yo(BS(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var Ode=P("dateFacet/register",e=>{try{return At(e,ck),$S(e),{payload:e,error:null}}catch(t){return{payload:e,error:Zt(t)}}}),GS=P("dateFacet/toggleSelectValue",e=>q(e,{facetId:Ie,selection:new ee({values:au})})),QS=P("dateFacet/toggleExcludeValue",e=>q(e,{facetId:Ie,selection:new ee({values:au})})),HS=P("dateFacet/updateFacetValues",e=>{try{return At(e,{facetId:Ie,values:new ge({each:new ee({values:au})})}),$S({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:Zt(t)}}});m();d();p();f();var uk={state:X,start:new te({required:!0}),end:new te({required:!0}),endInclusive:new ue({required:!0})},lk={facetId:Ie,field:X,tabs:new ee({options:{required:!1},values:{included:new ge({each:new H}),excluded:new ge({each:new H})}}),activeTab:new H({required:!1}),currentValues:new ge({required:!1,each:new ee({values:uk})}),generateAutomaticRanges:new ue({required:!0}),filterFacetCount:new ue({required:!1}),injectionDepth:new te({required:!1,min:0}),numberOfValues:new te({required:!1,min:1}),sortCriteria:new Oe({required:!1}),rangeAlgorithm:new Oe({required:!1})};function zS(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 Gde=P("numericFacet/register",e=>{try{return q(e,lk),zS(e),{payload:e,error:null}}catch(t){return{payload:e,error:Zt(t)}}}),WS=P("numericFacet/toggleSelectValue",e=>q(e,{facetId:Ie,selection:new ee({values:iu})})),KS=P("numericFacet/toggleExcludeValue",e=>q(e,{facetId:Ie,selection:new ee({values:iu})})),YS=P("numericFacet/updateFacetValues",e=>{try{return At(e,{facetId:Ie,values:new ge({each:new ee({values:iu})})}),zS({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:Zt(t)}}});var XS=Me(Yi(),e=>{e.addCase(Bc,(t,r)=>{let n=_f(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=ta(n,o)}).addCase($c,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(Rs,t=>{t.firstResult=0}).addCase(Gc,(t,r)=>{let n=r.payload;t.firstResult=ta(n,t.numberOfResults)}).addCase(jo,(t,r)=>{let n=r.payload;t.firstResult=ta(n,t.numberOfResults)}).addCase(Hc,t=>{let r=_f(t),n=Math.max(r-1,1);t.firstResult=ta(n,t.numberOfResults)}).addCase(Qc,t=>{let r=_f(t),n=fk(t),o=Math.min(r+1,n);t.firstResult=ta(o,t.numberOfResults)}).addCase(mt.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(hr,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(Zc.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(Xv.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(ou,t=>{at(t)}).addCase(QS,t=>{at(t)}).addCase(jS,t=>{at(t)}).addCase(KS,t=>{at(t)}).addCase(FS,t=>{at(t)}).addCase(qS,t=>{at(t)}).addCase(kS,t=>{at(t)}).addCase(_S,t=>{at(t)}).addCase(OS,t=>{at(t)}).addCase(GS,t=>{at(t)}).addCase(WS,t=>{at(t)}).addCase(jc,t=>{at(t)}).addCase(HS,t=>{at(t)}).addCase(YS,t=>{at(t)}).addCase(NS,t=>{at(t)}).addCase(TS,t=>{at(t)})});function at(e){e.firstResult=Yi().firstResult}function _f(e){let{firstResult:t,numberOfResults:r}=e;return pk(t,r)}function fk(e){let{totalCountFiltered:t,numberOfResults:r}=e;return mk(t,r)}function ta(e,t){return(e-1)*t}function pk(e,t){return Math.round(e/t)+1}function mk(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function kf(e){return e.addReducers({pagination:XS}),{nextPage:Qc,previousPage:Hc,registerNumberOfResults:Bc,registerPage:Gc,updateNumberOfResults:$c,updatePage:jo}}var gk=new lt({id:new H({emptyAllowed:!0,required:!1,default:""}),numberOfRecommendations:new te({min:0})});function JS(e,t={}){if(!hk(e))throw Dt;let r=Lr(e),{dispatch:n}=e,o=()=>e.state,i=dm(e,gk,t.options,"buildRecommendationList");return i.id!==""&&n(co({id:i.id})),i.numberOfRecommendations&&n(kf(e).updateNumberOfResults(i.numberOfRecommendations)),{...r,refresh(){n(Sr())},get state(){let a=o();return{recommendations:a.recommendation.recommendations,error:a.recommendation.error,isLoading:a.recommendation.isLoading,searchResponseId:a.recommendation.searchUid}}}}function hk(e){return e.addReducers({recommendation:uo,configuration:Ot}),!0}m();d();p();f();m();d();p();f();function ZS(e,t,r){if(!yk(e))throw Dt;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},i;return{select:ca(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){i=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){i&&clearTimeout(i)}}}function yk(e){return e.addReducers({configuration:Ot}),!0}function eb(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(fs(t.options.result)))};return ZS(e,t,()=>{n()})}m();d();p();f();m();d();p();f();m();d();p();f();var Vr=()=>new H({required:!1,emptyAllowed:!0}),su=P("advancedSearchQueries/update",e=>q(e,{aq:Vr(),cq:Vr(),lq:Vr(),dq:Vr()})),cu=P("advancedSearchQueries/register",e=>q(e,{aq:Vr(),cq:Vr(),lq:Vr(),dq:Vr()}));var tb=Me(Nr(),e=>{e.addCase(su,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ze(n)||(t.aq=n,t.aqWasSet=!0),ze(o)||(t.cq=o,t.cqWasSet=!0),ze(i)||(t.lq=i,t.lqWasSet=!0),ze(a)||(t.dq=a,t.dqWasSet=!0)}).addCase(cu,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;ze(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),ze(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),ze(i)||(t.defaultFilters.lq=i,t.lqWasSet||(t.lq=i)),ze(a)||(t.defaultFilters.dq=a,t.dqWasSet||(t.dq=a))}).addCase(mt.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(hr,(t,r)=>{let{aq:n,cq:o}=r.payload;ze(n)||(t.aq=n,t.aqWasSet=!0),ze(o)||(t.cq=o,t.cqWasSet=!0)})});function vk(e){return e.addReducers({advancedSearchQueries:tb}),{updateAdvancedSearchQueries:su,registerAdvancedSearchQueries:cu}}m();d();p();f();function Sk(e){return e.addReducers({configuration:Ot}),{disableAnalytics:Wn,enableAnalytics:Kn,setOriginLevel2:Na,setOriginLevel3:Fa,updateAnalyticsConfiguration:zn,updateBasicConfiguration:gr}}m();d();p();f();function bk(e){return e.addReducers({configuration:Ot,pipeline:Jn,searchHub:fo}),{updateSearchConfiguration:Lt}}m();d();p();f();function Ak(e){return e.addReducers({context:ru}),{addContext:In,removeContext:Tn,setContext:Rn}}m();d();p();f();function wk(e){return e.addReducers({debug:ja}),{disableDebug:Ma,enableDebug:Da}}m();d();p();f();function xk(e){return e.addReducers({dictionaryFieldContext:nu}),{addContext:Bo,removeContext:$o,setContext:Uo}}m();d();p();f();m();d();p();f();m();d();p();f();var Ck={collectionField:new H({emptyAllowed:!1,required:!1}),parentField:new H({emptyAllowed:!1,required:!1}),childField:new H({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new te({min:0,required:!1})},rb=P("folding/register",e=>q(e,Ck)),pme=Ee("folding/loadCollection",/*#__PURE__*/function(){var _ref74=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let i=t(),a=i.configuration.analytics.analyticsMode==="legacy"?yield xr(i):vo(i,o),s=yield n.search({...a,q:Ek(i),enableQuerySyntax:!0,cq:`@${i.folding.fields.collection}="${e}"`,filterField:i.folding.fields.collection,childField:i.folding.fields.parent,parentField:i.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return dt(s)?r(s.error):{collectionId:e,results:s.success.results,searchUid:s.success.searchUid,rootResult:i.folding.collections[e].result}});return function(_x158,_x159){return _ref74.apply(this,arguments)}}());function Ek(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}m();d();p();f();var nb=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});m();d();p();f();var Qo=P("fields/registerFieldsToInclude",e=>q(e,Pa)),uu=P("fields/fetchall/enable"),lu=P("fields/fetchall/disable"),du=Ee("fields/fetchDescription",/*#__PURE__*/function(){var _ref75=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:i,environment:a,organizationId:s}=o.configuration,{apiBaseUrl:c}=o.configuration.search,u=yield t.apiClient.fieldDescriptions({accessToken:i,organizationId:s,url:c??dr(s,a)});return dt(u)?n(u.error):u.success.fields});return function(_x160,_x161){return _ref75.apply(this,arguments)}}());m();d();p();f();var fu=["author","language","urihash","objecttype","collection","source","permanentid"],Of=[...fu,"date","filetype","parents"],ob=[...Of,"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"],ib=()=>({fieldsToInclude:fu,fetchAllFields:!1,fieldsDescription:[]});var pu=Me(ib(),e=>e.addCase(Qo,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(uu,t=>{t.fetchAllFields=!0}).addCase(lu,t=>{t.fetchAllFields=!1}).addCase(du.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(rb,(t,{payload:r})=>{let n=nb().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));function Rk(e){return e.addReducers({fields:pu}),{registerFieldsToInclude:Qo,enableFetchAllFields:uu,disableFetchAllFields:lu,fetchFieldsDescription:du}}m();d();p();f();function Ik(e){return e.addReducers({pipeline:Jn}),{setPipeline:Yn}}m();d();p();f();function Tk(e){return e.addReducers({recommendation:uo}),{getRecommendations:Sr,setRecommendationId:co}}m();d();p();f();function _k(e){return e.addReducers({}),{logRecommendationOpen:fs}}m();d();p();f();m();d();p();f();var kk=new lt({content:new Oe({required:!0}),conditions:new Oe({required:!0}),priority:new te({required:!1,default:0,min:0}),fields:new ge({required:!1,each:X})});function ab(){let e=[],t=r=>{let n=kk.validate(r);if(!r.conditions.every(i=>i instanceof Function))throw new Jo("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.linkContent:null}}}function sb(e){if(!Ok(e))throw Dt;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=ab();return{registerTemplates:(...o)=>{t(...o);let i=[];o.forEach(a=>{a.fields&&i.push(...a.fields)}),e.dispatch(Qo(i))},selectTemplate:r,selectLinkTemplate:n}}function Ok(e){return e.addReducers({fields:pu}),!0}m();d();p();f();function Pk(e){return e.addReducers({searchHub:fo}),{setSearchHub:lo}}/**
|
|
40
|
+
`),u=JSON.parse(c);t.next(u)}catch(c){t.error(c)}}return t.asObservable()},O0=e=>{let t=new er,r=new Uint8Array;e.subscribe({next:o=>{if(o.type!==Dn.HEADERS&&o.type===Dn.DATA&&o.data){let i=new Uint8Array(r.length+o.data.length);i.set(r,0),i.set(o.data,r.length),r=i,n()}},error:o=>t.error(o),complete:()=>{if(r.length>0)try{n()}catch{console.warn("Incomplete or invalid protocol buffer data at stream end")}t.complete()}});function n(){for(;r.length>=4;){let o=4+new DataView(r.buffer,r.byteOffset,4).getUint32(0,!1);if(r.length<o)break;try{let i=r.slice(4,o),a=cv(i);t.next(a),r=r.slice(o)}catch(i){let a=i instanceof Error?i.message:String(i);t.error(Error(`Failed to decode protocol buffer message: ${a}`));return}}}return t.asObservable()},P0=e=>{let t=new er,r=new xc,n=!1;return e.subscribe({next:o=>{r.next(o),o.type===Dn.HEADERS&&!n?(n=!0,o.headers.get("content-type")===uv?O0(r).subscribe({next:i=>t.next(i),error:i=>t.error(i),complete:()=>t.complete()}):k0(r).subscribe({next:i=>{try{let a=uc.parse(i);t.next(a)}catch(a){t.error(a)}},error:i=>{if(i?.name==="AbortError"){t.next({type:M.RUN_ERROR,message:i.message||"Request aborted",code:"abort",rawEvent:i}),t.complete();return}return t.error(i)},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()},De=R.enum(["TextMessageStart","TextMessageContent","TextMessageEnd","ActionExecutionStart","ActionExecutionArgs","ActionExecutionEnd","ActionExecutionResult","AgentStateMessage","MetaEvent","RunStarted","RunFinished","RunError","NodeStarted","NodeFinished"]),N0=R.enum(["LangGraphInterruptEvent","PredictState","Exit"]),F0=R.object({type:R.literal(De.enum.TextMessageStart),messageId:R.string(),parentMessageId:R.string().optional(),role:R.string().optional()}),D0=R.object({type:R.literal(De.enum.TextMessageContent),messageId:R.string(),content:R.string()}),M0=R.object({type:R.literal(De.enum.TextMessageEnd),messageId:R.string()}),q0=R.object({type:R.literal(De.enum.ActionExecutionStart),actionExecutionId:R.string(),actionName:R.string(),parentMessageId:R.string().optional()}),j0=R.object({type:R.literal(De.enum.ActionExecutionArgs),actionExecutionId:R.string(),args:R.string()}),L0=R.object({type:R.literal(De.enum.ActionExecutionEnd),actionExecutionId:R.string()}),V0=R.object({type:R.literal(De.enum.ActionExecutionResult),actionName:R.string(),actionExecutionId:R.string(),result:R.string()}),U0=R.object({type:R.literal(De.enum.AgentStateMessage),threadId:R.string(),agentName:R.string(),nodeName:R.string(),runId:R.string(),active:R.boolean(),role:R.string(),state:R.string(),running:R.boolean()}),B0=R.object({type:R.literal(De.enum.MetaEvent),name:N0,value:R.any()}),$0=R.object({type:R.literal(De.enum.RunError),message:R.string(),code:R.string().optional()});R.discriminatedUnion("type",[F0,D0,M0,q0,j0,L0,V0,U0,B0,$0]),R.object({id:R.string(),role:R.string(),content:R.string(),parentMessageId:R.string().optional()}),R.object({id:R.string(),name:R.string(),arguments:R.any(),parentMessageId:R.string().optional()}),R.object({id:R.string(),result:R.any(),actionExecutionId:R.string(),actionName:R.string()});var G0=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
|
+
`)},Q0=(e,t,r)=>n=>{let o={},i=!0,a=!0,s="",c=null,u=null,h=[],S={},v=g=>{typeof g=="object"&&g&&("messages"in g&&delete g.messages,o=g)};return n.pipe(bt(g=>{switch(g.type){case M.TEXT_MESSAGE_START:{let y=g;return[{type:De.enum.TextMessageStart,messageId:y.messageId,role:y.role}]}case M.TEXT_MESSAGE_CONTENT:{let y=g;return[{type:De.enum.TextMessageContent,messageId:y.messageId,content:y.delta}]}case M.TEXT_MESSAGE_END:{let y=g;return[{type:De.enum.TextMessageEnd,messageId:y.messageId}]}case M.TOOL_CALL_START:{let y=g;return h.push({id:y.toolCallId,type:"function",function:{name:y.toolCallName,arguments:""}}),a=!0,S[y.toolCallId]=y.toolCallName,[{type:De.enum.ActionExecutionStart,actionExecutionId:y.toolCallId,actionName:y.toolCallName,parentMessageId:y.parentMessageId}]}case M.TOOL_CALL_ARGS:{let y=g,x=h.find(E=>E.id===y.toolCallId);if(!x)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${y.toolCallId}'`),[];x.function.arguments+=y.delta;let C=!1;if(u){let E=u.find(_=>_.tool==x.function.name);if(E)try{let _=JSON.parse(Vc(x.function.arguments));E.tool_argument&&E.tool_argument in _?(v({...o,[E.state_key]:_[E.tool_argument]}),C=!0):E.tool_argument||(v({...o,[E.state_key]:_}),C=!0)}catch{}}return[{type:De.enum.ActionExecutionArgs,actionExecutionId:y.toolCallId,args:y.delta},...(C?[{type:De.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}]:[])]}case M.TOOL_CALL_END:{let y=g;return[{type:De.enum.ActionExecutionEnd,actionExecutionId:y.toolCallId}]}case M.TOOL_CALL_RESULT:{let y=g;return[{type:De.enum.ActionExecutionResult,actionExecutionId:y.toolCallId,result:y.content,actionName:S[y.toolCallId]||"unknown"}]}case M.RAW:return[];case M.CUSTOM:{let y=g;switch(y.name){case"Exit":i=!1;break;case"PredictState":u=y.value;break}return[{type:De.enum.MetaEvent,name:y.name,value:y.value}]}case M.STATE_SNAPSHOT:return v(g.snapshot),[{type:De.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}];case M.STATE_DELTA:{let y=g,x=Lr(o,y.delta,!0,!1);return x?(v(x.newDocument),[{type:De.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:a}]):[]}case M.MESSAGES_SNAPSHOT:return c=g.messages,[{type:De.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify({...o,...(c?{messages:c}:{})}),active:!0}];case M.RUN_STARTED:return[];case M.RUN_FINISHED:return c&&(o.messages=c),Object.keys(o).length===0?[]:[{type:De.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify({...o,...(c?{messages:H0(c)}:{})}),active:!1}];case M.RUN_ERROR:{let y=g;return[{type:De.enum.RunError,message:y.message,code:y.code}]}case M.STEP_STARTED:return s=g.stepName,h=[],u=null,[{type:De.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:!0}];case M.STEP_FINISHED:return h=[],u=null,[{type:De.enum.AgentStateMessage,threadId:e,agentName:r,nodeName:s,runId:t,running:i,role:"assistant",state:JSON.stringify(o),active:!1}];default:return[]}}))};function H0(e){let t=[];for(let r of e)if(r.role==="assistant"||r.role==="user"||r.role==="system"){let n=G0(r.content);if(n){let o={id:r.id,role:r.role,content:n};t.push(o)}if(r.role==="assistant"&&r.toolCalls&&r.toolCalls.length>0)for(let o of r.toolCalls){let i={id:o.id,name:o.function.name,arguments:JSON.parse(o.function.arguments),parentMessageId:r.id};t.push(i)}}else if(r.role==="tool"){let n="unknown";for(let i of e)if(i.role==="assistant"&&i.toolCalls?.length){for(let a of i.toolCalls)if(a.id===r.toolCallId){n=a.function.name;break}}let o={id:r.id,result:r.content,actionExecutionId:r.toolCallId,actionName:n};t.push(o)}return t}var fu=e=>t=>{let r,n,o,i,a=()=>{if(!r||i!=="text")throw Error("No text message to close");let h={type:M.TEXT_MESSAGE_END,messageId:r.messageId};return i=void 0,r=void 0,e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_END",JSON.stringify(h)),h},s=()=>{if(!n||i!=="tool")throw Error("No tool call to close");let h={type:M.TOOL_CALL_END,toolCallId:n.toolCallId};return i=void 0,n=void 0,e&&console.debug("[TRANSFORM]: TOOL_CALL_END",JSON.stringify(h)),h},c=()=>{if(!o||i!=="reasoning")throw Error("No reasoning message to close");let h={type:M.REASONING_MESSAGE_END,messageId:o.messageId};return i=void 0,o=void 0,e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_END",JSON.stringify(h)),h},u=()=>i==="text"?[a()]:i==="tool"?[s()]:i==="reasoning"?[c()]:[];return t.pipe(bt(h=>{switch(h.type){case M.TEXT_MESSAGE_START:case M.TEXT_MESSAGE_CONTENT:case M.TEXT_MESSAGE_END:case M.TOOL_CALL_START:case M.TOOL_CALL_ARGS:case M.TOOL_CALL_END:case M.TOOL_CALL_RESULT:case M.STATE_SNAPSHOT:case M.STATE_DELTA:case M.MESSAGES_SNAPSHOT:case M.CUSTOM:case M.RUN_STARTED:case M.RUN_FINISHED:case M.RUN_ERROR:case M.STEP_STARTED:case M.STEP_FINISHED:case M.THINKING_START:case M.THINKING_END:case M.THINKING_TEXT_MESSAGE_START:case M.THINKING_TEXT_MESSAGE_CONTENT:case M.THINKING_TEXT_MESSAGE_END:case M.REASONING_START:case M.REASONING_MESSAGE_START:case M.REASONING_MESSAGE_CONTENT:case M.REASONING_MESSAGE_END:case M.REASONING_END:return[...u(),h];case M.RAW:case M.ACTIVITY_SNAPSHOT:case M.ACTIVITY_DELTA:case M.REASONING_ENCRYPTED_VALUE:return[h];case M.TEXT_MESSAGE_CHUNK:let S=h,v=[];if((i!=="text"||S.messageId!==void 0&&S.messageId!==r?.messageId)&&v.push(...u()),i!=="text"){if(S.messageId===void 0)throw Error("First TEXT_MESSAGE_CHUNK must have a messageId");r={messageId:S.messageId},i="text";let E={type:M.TEXT_MESSAGE_START,messageId:S.messageId,role:S.role||"assistant"};v.push(E),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_START",JSON.stringify(E))}if(S.delta!==void 0){let E={type:M.TEXT_MESSAGE_CONTENT,messageId:r.messageId,delta:S.delta};v.push(E),e&&console.debug("[TRANSFORM]: TEXT_MESSAGE_CONTENT",JSON.stringify(E))}return v;case M.TOOL_CALL_CHUNK:let g=h,y=[];if((i!=="tool"||g.toolCallId!==void 0&&g.toolCallId!==n?.toolCallId)&&y.push(...u()),i!=="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},i="tool";let E={type:M.TOOL_CALL_START,toolCallId:g.toolCallId,toolCallName:g.toolCallName,parentMessageId:g.parentMessageId};y.push(E),e&&console.debug("[TRANSFORM]: TOOL_CALL_START",JSON.stringify(E))}if(g.delta!==void 0){let E={type:M.TOOL_CALL_ARGS,toolCallId:n.toolCallId,delta:g.delta};y.push(E),e&&console.debug("[TRANSFORM]: TOOL_CALL_ARGS",JSON.stringify(E))}return y;case M.REASONING_MESSAGE_CHUNK:let x=h,C=[];if((i!=="reasoning"||x.messageId&&x.messageId!==o?.messageId)&&C.push(...u()),i!=="reasoning"){if(x.messageId===void 0)throw Error("First REASONING_MESSAGE_CHUNK must have a messageId");o={messageId:x.messageId},i="reasoning";let E={type:M.REASONING_MESSAGE_START,messageId:x.messageId};C.push(E),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_START",JSON.stringify(E))}if(x.delta!==void 0){let E={type:M.REASONING_MESSAGE_CONTENT,messageId:o.messageId,delta:x.delta};C.push(E),e&&console.debug("[TRANSFORM]: REASONING_MESSAGE_CONTENT",JSON.stringify(E))}return C}return h.type,[]}),Fn(()=>{u()}))},Vf=class{runNext(e,t){return t.run(e).pipe(fu(!1))}runNextWithState(e,t){let r=Oe(e.messages||[]),n=Oe(e.state||{}),o=new xc;return yv(e,o,t,[]).subscribe(i=>{i.messages!==void 0&&(r=i.messages),i.state!==void 0&&(n=i.state)}),this.runNext(e,t).pipe(jc(/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(i){return o.next(i),yield new Promise(a=>setTimeout(a,0)),{event:i,messages:Oe(r),state:Oe(n)}});return function(_x93){return _ref45.apply(this,arguments)}}()))}},z0=class extends Vf{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function W0(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 K0=class extends Vf{run(e,t){let{parentRunId:r,...n}=e,o={...n,messages:n.messages.map(W0)};return this.runNext(o,t)}},fv="THINKING_START",pv="THINKING_END",mv="THINKING_TEXT_MESSAGE_START",gv="THINKING_TEXT_MESSAGE_CONTENT",hv="THINKING_TEXT_MESSAGE_END",Y0=class extends Vf{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(Nn(r=>this.transformEvent(r)))}transformEvent(e){switch(e.type){case fv:{this.currentReasoningId=da();let{title:t,...r}=e;return this.warnAboutTransformation(fv,M.REASONING_START),{...r,type:M.REASONING_START,messageId:this.currentReasoningId}}case mv:return this.currentMessageId=da(),this.warnAboutTransformation(mv,M.REASONING_MESSAGE_START),{...e,type:M.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:"assistant"};case gv:{let{delta:t,...r}=e;return this.warnAboutTransformation(gv,M.REASONING_MESSAGE_CONTENT),{...r,type:M.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??da(),delta:t}}case hv:{let t=this.currentMessageId??da();return this.warnAboutTransformation(hv,M.REASONING_MESSAGE_END),{...e,type:M.REASONING_MESSAGE_END,messageId:t}}case pv:{let t=this.currentReasoningId??da();return this.warnAboutTransformation(pv,M.REASONING_END),{...e,type:M.REASONING_END,messageId:t}}default:return e}}},X0="0.0.45",J0=class{get maxVersion(){return X0}constructor({agentId:e,description:t,threadId:r,initialMessages:n,initialState:o,debug:i}={}){this.debug=!1,this.subscribers=[],this.isRunning=!1,this.middlewares=[],this.agentId=e,this.description=t??"",this.threadId=r??Fr(),this.messages=Oe(n??[]),this.state=Oe(o??{}),this.debug=i??!1,du(this.maxVersion,"0.0.39")<=0&&this.middlewares.unshift(new K0),du(this.maxVersion,"0.0.45")<=0&&this.middlewares.unshift(new Y0)}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 z0(r):r);return this.middlewares.push(...t),this}runAgent(e,t){var _this14=this;return _asyncToGenerator(function*(){try{_this14.isRunning=!0,_this14.agentId=_this14.agentId??Fr();let r=_this14.prepareRunAgentInput(e),n,o=new Set(_this14.messages.map(c=>c.id)),i=[{onRunFinishedEvent:c=>{n=c.result}},..._this14.subscribers,t??{}];yield _this14.onInitialize(r,i),_this14.activeRunDetach$=new er;let a;_this14.activeRunCompletionPromise=new Promise(c=>{a=c}),yield qc(Ac(()=>_this14.middlewares.length===0?_this14.run(r):_this14.middlewares.reduceRight((c,u)=>({run:h=>u.run(h,c)}),_this14).run(r),fu(_this14.debug),Lf(_this14.debug),c=>c.pipe(Lc(_this14.activeRunDetach$)),c=>_this14.apply(r,c,i),c=>_this14.processApplyEvents(r,c,i),ca(c=>(_this14.isRunning=!1,_this14.onError(r,c,i))),Fn(()=>{_this14.isRunning=!1,_this14.onFinalize(r,i),a?.(),a=void 0,_this14.activeRunCompletionPromise=void 0,_this14.activeRunDetach$=void 0}))(Ue(null)));let s=Oe(_this14.messages).filter(c=>!o.has(c.id));return{result:n,newMessages:s}}finally{_this14.isRunning=!1}})()}connect(e){throw new cf}connectAgent(e,t){var _this15=this;return _asyncToGenerator(function*(){try{_this15.isRunning=!0,_this15.agentId=_this15.agentId??Fr();let r=_this15.prepareRunAgentInput(e),n,o=new Set(_this15.messages.map(c=>c.id)),i=[{onRunFinishedEvent:c=>{n=c.result}},..._this15.subscribers,t??{}];yield _this15.onInitialize(r,i),_this15.activeRunDetach$=new er;let a;_this15.activeRunCompletionPromise=new Promise(c=>{a=c}),yield qc(Ac(()=>_this15.connect(r),fu(_this15.debug),Lf(_this15.debug),c=>c.pipe(Lc(_this15.activeRunDetach$)),c=>_this15.apply(r,c,i),c=>_this15.processApplyEvents(r,c,i),ca(c=>(_this15.isRunning=!1,c instanceof cf?Cc:_this15.onError(r,c,i))),Fn(()=>{_this15.isRunning=!1,_this15.onFinalize(r,i),a?.(),a=void 0,_this15.activeRunCompletionPromise=void 0,_this15.activeRunDetach$=void 0}))(Ue(null)));let s=Oe(_this15.messages).filter(c=>!o.has(c.id));return{result:n,newMessages:s}}finally{_this15.isRunning=!1}})()}abortRun(){}detachActiveRun(){var _this16=this;return _asyncToGenerator(function*(){if(!_this16.activeRunDetach$)return;let e=_this16.activeRunCompletionPromise??Promise.resolve();_this16.activeRunDetach$.next(),_this16.activeRunDetach$?.complete(),yield e})()}apply(e,t,r){return yv(e,t,this,r)}processApplyEvents(e,t,r){return t.pipe(Ef(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=Oe(this.messages).filter(r=>r.role!=="activity");return{threadId:this.threadId,runId:e?.runId||Fr(),tools:Oe(e?.tools??[]),context:Oe(e?.context??[]),forwardedProps:Oe(e?.forwardedProps??{}),state:Oe(this.state),messages:t}}onInitialize(e,t){var _this17=this;return _asyncToGenerator(function*(){let r=yield ke(t,_this17.messages,_this17.state,(n,o,i)=>n.onRunInitialized?.({messages:o,state:i,agent:_this17,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages&&(_this17.messages=r.messages,e.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this17.messages,state:_this17.state,agent:_this17,input:e})})),r.state&&(_this17.state=r.state,e.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this17.state,messages:_this17.messages,agent:_this17,input:e})})))})()}onError(e,t,r){return Pn(ke(r,this.messages,this.state,(n,o,i)=>n.onRunFailed?.({error:t,messages:o,state:i,agent:this,input:e}))).pipe(Nn(n=>{let o=n;if((o.messages!==void 0||o.state!==void 0)&&(o.messages!==void 0&&(this.messages=o.messages,r.forEach(i=>{i.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),o.state!==void 0&&(this.state=o.state,r.forEach(i=>{i.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),o.stopPropagation!==!0)throw console.error("Agent execution failed:",t),t;return{}}))}onFinalize(e,t){var _this18=this;return _asyncToGenerator(function*(){let r=yield ke(t,_this18.messages,_this18.state,(n,o,i)=>n.onRunFinalized?.({messages:o,state:i,agent:_this18,input:e}));(r.messages!==void 0||r.state!==void 0)&&(r.messages!==void 0&&(_this18.messages=r.messages,t.forEach(n=>{n.onMessagesChanged?.({messages:_this18.messages,state:_this18.state,agent:_this18,input:e})})),r.state!==void 0&&(_this18.state=r.state,t.forEach(n=>{n.onStateChanged?.({state:_this18.state,messages:_this18.messages,agent:_this18,input:e})})))})()}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=Oe(this.messages),e.state=Oe(this.state),e.debug=this.debug,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e}addMessage(e){var _this19=this;this.messages.push(e),_asyncToGenerator(function*(){for(let t of _this19.subscribers)yield t.onNewMessage?.({message:e,messages:_this19.messages,state:_this19.state,agent:_this19});if(e.role==="assistant"&&e.toolCalls)for(let t of e.toolCalls)for(let r of _this19.subscribers)yield r.onNewToolCall?.({toolCall:t,messages:_this19.messages,state:_this19.state,agent:_this19});for(let t of _this19.subscribers)yield t.onMessagesChanged?.({messages:_this19.messages,state:_this19.state,agent:_this19})})()}addMessages(e){var _this20=this;this.messages.push(...e),_asyncToGenerator(function*(){for(let t of e){for(let r of _this20.subscribers)yield r.onNewMessage?.({message:t,messages:_this20.messages,state:_this20.state,agent:_this20});if(t.role==="assistant"&&t.toolCalls)for(let r of t.toolCalls)for(let n of _this20.subscribers)yield n.onNewToolCall?.({toolCall:r,messages:_this20.messages,state:_this20.state,agent:_this20})}for(let t of _this20.subscribers)yield t.onMessagesChanged?.({messages:_this20.messages,state:_this20.state,agent:_this20})})()}setMessages(e){var _this21=this;this.messages=Oe(e),_asyncToGenerator(function*(){for(let t of _this21.subscribers)yield t.onMessagesChanged?.({messages:_this21.messages,state:_this21.state,agent:_this21})})()}setState(e){var _this22=this;this.state=Oe(e),_asyncToGenerator(function*(){for(let t of _this22.subscribers)yield t.onStateChanged?.({messages:_this22.messages,state:_this22.state,agent:_this22})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??Fr();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(fu(this.debug),Lf(this.debug),Q0(this.threadId,t.runId,this.agentId),r=>r.pipe(Nn(n=>(this.debug&&console.debug("[LEGACY]:",JSON.stringify(n)),n))))}},Sv=class extends J0{requestInit(e){return{method:"POST",headers:{...this.headers,"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(e),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new l.AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new l.AbortController,this.url=e.url,this.headers=Oe(e.headers??{})}run(e){return P0(_0(this.url,this.requestInit(e)))}clone(){let e=super.clone();e.url=this.url,e.headers=Oe(this.headers??{});let t=new l.AbortController,r=this.abortController.signal;return r.aborted&&t.abort(r.reason),e.abortController=t,e}};m();d();p();f();var vv=(e,t,r)=>{let n=Je(t,r),o=e?.trim();if(!n||!t||!o)throw new Error("Missing required parameters for answer endpoint");let i=`/api/preview/organizations/${t}/agents`;return`${n}${i}/${o}`};var Uf=class extends Sv{requestInit(t){let{params:r,accessToken:n,recordDebugSession:o}=t.forwardedProps||{},i={...r,...(o&&{recordDebugSession:!0})};return{method:"POST",headers:{...this.headers,Authorization:`Bearer ${n}`,"Content-Type":"application/json",Accept:"text/event-stream, application/json"},body:JSON.stringify(i),signal:this.abortController.signal}}},bv=(e,t,r)=>new Uf({url:`${vv(e,t,r)}/answer`});m();d();p();f();m();d();p();f();var Z0=new z({required:!0}),wv=new z({required:!0,constrainTo:Ys}),Av=e=>({...e,name:Xs(e.name)}),xv=N("followUpAnswers/setIsEnabled",e=>$(e,new fe({required:!0}))),Cv=N("followUpAnswers/setFollowUpAnswersConversationId",e=>$(e,J)),Ev=N("followUpAnswers/setFollowUpAnswersConversationToken",e=>$(e,J)),Rv=N("followUpAnswers/clearFollowUpAnswersConversationToken"),Mee=N("followUpAnswers/createFollowUpAnswer",e=>$(e,{question:J})),qee=N("followUpAnswers/setActiveFollowUpAnswerId",e=>$(e,J)),jee=N("followUpAnswers/setFollowUpAnswerContentFormat",e=>$(e,{contentFormat:Js,answerId:J})),Lee=N("followUpAnswers/setFollowUpIsLoading",e=>$(e,{isLoading:new fe({required:!0}),answerId:J})),Vee=N("followUpAnswers/setFollowUpIsStreaming",e=>$(e,{isStreaming:new fe({required:!0}),answerId:J})),Uee=N("followUpAnswers/followUpMessageChunkReceived",e=>$(e,{textDelta:Z0,answerId:J})),Bee=N("followUpAnswers/followUpCitationsReceived",e=>$(e,{citations:new he({required:!0,each:new re({values:zd})}),answerId:J})),$ee=N("followUpAnswers/followUpCompleted",e=>$(e,{answerId:J,cannotAnswer:new fe({required:!1})})),Gee=N("followUpAnswers/followUpFailed",e=>$(e,{message:new z,code:new ne({min:0}),answerId:J})),Qee=N("followUpAnswers/activeFollowUpStartFailed",e=>$(e,{message:new z})),Hee=N("followUpAnswers/likeFollowUp",e=>$(e,{answerId:J})),zee=N("followUpAnswers/dislikeFollowUp",e=>$(e,{answerId:J})),Wee=N("followUpAnswers/submitFollowUpFeedback",e=>$(e,{answerId:J})),Iv=N("followUpAnswers/resetFollowUpAnswers"),Kee=N("followUpAnswers/stepStarted",e=>$(Av(e),{answerId:J,name:wv,startedAt:new ne({min:0,required:!0})})),Yee=N("followUpAnswers/stepFinished",e=>$(Av(e),{answerId:J,name:wv,finishedAt:new ne({min:0,required:!0})}));m();d();p();f();var ek={"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 Tv(e){return e?ek[e]??1004:1004}var _v=e=>{let t="",r=!1;return{onRunStartedEvent:({event:n})=>{t=n.runId,r=!1,e(Zs(n.runId)),e(Nr(!1)),e(zi(!0)),e(Cv(n.threadId)),e(Rv())},onStepStartedEvent:({event:n})=>{e(yy({name:n.stepName,startedAt:n.timestamp??Date.now()}))},onStepFinishedEvent:({event:n})=>{e(Sy({name:n.stepName,finishedAt:n.timestamp??Date.now()}))},onTextMessageContentEvent:({event:n})=>{n.delta.length>0&&(r=!0),e(Wi({textDelta:n.delta}))},onCustomEvent:({event:n})=>{let{name:o,value:i}=n;switch(o){case"header":{i?.contentFormat&&e(Xi(i.contentFormat)),typeof i?.followUpEnabled=="boolean"&&e(xv(i.followUpEnabled)),i?.conversationToken&&e(Ev(i.conversationToken));return}case"citations":{e(Ki({citations:i.citations}));return}}},onRunErrorEvent:({event:n})=>{let o=Tv(n.code);e(Yi({message:n.message,code:o}))},onRunFinishedEvent:({event:n})=>{let o=n.result?.completionReason==="ANSWERED",i=o?!r:void 0;e(Wd(o)),e(Ji(!o)),e(zi(!1)),e(bo(o,t,i,n.threadId)),e(wo())}}};var kv=()=>{let e,t=()=>{e?.abortRun(),e=void 0};return{run:function(){var _ref50=_asyncToGenerator(function*(n,o,i){t();let a=Ps(n),s=kg(n),c=Og(n),u=_g(n),h=Pg(n),S=bv(a,s,c);e=S;let v=_v(o),g=dy(n,i());try{o(Nr(!0)),yield S.runAgent({forwardedProps:{params:g,accessToken:u,recordDebugSession:h}},v)}catch(y){o(Nr(!1)),o(Yi({message:"An error occurred while starting the answer generation."})),console.error("Error running the answer agent:",y)}});return function run(_x94,_x95,_x96){return _ref50.apply(this,arguments)}}(),abortRun:t}};m();d();p();f();m();d();p();f();var pu=N("breadcrumb/deselectAll"),Ov=N("breadcrumb/deselectAllNonBreadcrumbs");m();d();p();f();var Pv=N("facet/updateFacetAutoSelection",e=>$(e,{allow:new fe({required:!0})}));m();d();p();f();m();d();p();f();var mu=class extends Rr{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??xt().q}get responseTime(){return this.activeInstantResultCache?.duration??$t().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??$t().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var Nv=()=>mt("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new mu(e)),Fv=()=>({actionCause:"searchboxAsYouType"});m();d();p();f();var Bf={id:J},tk={...Bf,q:rt},ire=N("instantResults/register",e=>$(e,Bf)),gu=N("instantResults/updateQuery",e=>$(e,tk)),are=N("instantResults/clearExpired",e=>$(e,Bf));m();d();p();f();var hu=new ne({required:!0,min:0}),yu=N("pagination/registerNumberOfResults",e=>$(e,hu)),Su=N("pagination/updateNumberOfResults",e=>$(e,hu)),vu=N("pagination/registerPage",e=>$(e,hu)),$o=N("pagination/updatePage",e=>$(e,hu)),bu=N("pagination/nextPage"),wu=N("pagination/previousPage");m();d();p();f();var Go=N("query/updateQuery",e=>$(e,{q:new z,enableQuerySyntax:new fe}));m();d();p();f();m();d();p();f();m();d();p();f();var Ur=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var $f=()=>mt("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),Br=e=>mt("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||xt().q,aq:r.advancedSearchQueries?.aq||Ur().aq,cq:r.advancedSearchQueries?.cq||Ur().cq,dq:r.advancedSearchQueries?.dq||Ur().dq,errorType:e.type,errorMessage:e.message}));m();d();p();f();m();d();p();f();var Gre=N("didYouMean/enable"),Qre=N("didYouMean/disable"),Hre=N("didYouMean/automaticCorrections/disable"),zre=N("didYouMean/automaticCorrections/enable"),Au=N("didYouMean/correction",e=>$(e,J)),Wre=N("didYouMean/automaticCorrections/mode",e=>$(e,new z({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));m();d();p();f();var Gf=()=>mt("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic());var Dv=()=>({actionCause:"didYouMeanAutomatic"});m();d();p();f();m();d();p();f();function xu(){return{contextValues:{}}}m();d();p();f();function Cu(){return{contextValues:{}}}m();d();p();f();function Mv(){return{freezeFacetOrder:!1,facets:{}}}m();d();p();f();function qv(){return[]}m();d();p();f();function fa(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}m();d();p();f();function jv(){return{}}m();d();p();f();function Lv(){return{}}m();d();p();f();function Vv(){return{}}function tr(e){return{context:e.context||xu(),dictionaryFieldContext:e.dictionaryFieldContext||Cu(),facetSet:e.facetSet||Os(),numericFacetSet:e.numericFacetSet||ks(),dateFacetSet:e.dateFacetSet||_s(),categoryFacetSet:e.categoryFacetSet||Ts(),automaticFacetSet:e.automaticFacetSet??Is(),pagination:e.pagination||fa(),query:e.query||xt(),tabSet:e.tabSet||Vv(),advancedSearchQueries:e.advancedSearchQueries||Ur(),staticFilterSet:e.staticFilterSet||Lv(),querySet:e.querySet||jv(),sortCriteria:e.sortCriteria||Ns(),pipeline:e.pipeline||ro(),searchHub:e.searchHub||fo(),facetOptions:e.facetOptions||Mv(),facetOrder:e.facetOrder??qv(),debug:e.debug??cs()}}m();d();p();f();var boe=new re({values:{undoneQuery:rt},options:{required:!0}}),Uv=()=>mt("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null);m();d();p();f();var Eu=N("trigger/query/ignore",e=>$(e,new z({emptyAllowed:!0,required:!0}))),Ru=N("trigger/query/modification",e=>$(e,new re({values:{originalQuery:tt,modification:tt}})));m();d();p();f();var $r=/*#__PURE__*/function(){var _ref51=_asyncToGenerator(function*(e,t){let r=ok(e),n=Ks(e),o=rk(e),i=yield Or(e,t),a=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return _r({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:a(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function $r(_x97,_x98){return _ref51.apply(this,arguments)}}();function rk(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(nk).filter(r=>r.currentValues.length>0):void 0}function nk(e){let{field:t,label:r,values:n}=e,o=n.filter(i=>i.state==="selected");return{field:t,label:r,currentValues:o}}function ok(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(i=>i.isActive)?.expression.trim()||"",o=ik(e);return[t,n,...o].filter(i=>!!i).join(" AND ")}function ik(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(i=>i.state==="selected"&&!!i.expression.trim()),o=n.map(i=>i.expression).join(" OR ");return n.length>1?`(${o})`:o})}var Gr=class{constructor(t,r=n=>{this.dispatch(Go({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x99,_x100){var _this23=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=Ws(yield _this23.extra.apiClient.search(r,n),t),a=Date.now()-o,s=_this23.getState().query?.q||"";return{response:i,duration:a,queryExecuted:s,requestExecuted:r}}).apply(this,arguments)}process(t){var _this24=this;return _asyncToGenerator(function*(){return _this24.processQueryErrorOrContinue(t)??(yield _this24.processQueryCorrectionsOrContinue(t))??(yield _this24.processQueryTriggersOrContinue(t))??_this24.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return ht(t.response)?(this.dispatch(Br(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this25=this;return _asyncToGenerator(function*(){let r=_this25.getState(),n=_this25.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:s,queryCorrection:c}=n;if(!o||!i)return null;let u=a.length===0&&s&&s.length!==0,h=!se(c)&&!se(c.correctedQuery);if(!u&&!h)return null;let v=u?yield _this25.processLegacyDidYouMeanAutoCorrection(t):_this25.processModernDidYouMeanAutoCorrection(t);return _this25.dispatch(zt(tr(_this25.getState()))),v})()}processLegacyDidYouMeanAutoCorrection(t){var _this26=this;return _asyncToGenerator(function*(){let r=_this26.getCurrentQuery(),n=_this26.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this26.automaticallyRetryQueryWithCorrection(o);return ht(i.response)?(_this26.dispatch(Br(i.response.error)),_this26.rejectWithValue(i.response.error)):(_this26.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this26.dispatch(zt(tr(_this26.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:Gf()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:Gf()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this27=this;return _asyncToGenerator(function*(){let r=_this27.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(s=>s.type==="query")?.content||"";if(!n)return null;if(_this27.getState().triggers?.queryModification.queryToIgnore===n)return _this27.dispatch(Eu("")),null;_this27.analyticsAction&&(yield _this27.dispatch(_this27.analyticsAction));let i=_this27.getCurrentQuery(),a=yield _this27.automaticallyRetryQueryWithTriggerModification(n);return ht(a.response)?(_this27.dispatch(Br(a.response.error)),_this27.rejectWithValue(a.response.error)):(_this27.dispatch(zt(tr(_this27.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i,analyticsAction:Uv()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??xt().enableQuerySyntax},search:{...$t(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(zt(tr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return Pa(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this28=this;return _asyncToGenerator(function*(){_this28.onUpdateQueryForCorrection(t);let r=yield _this28.fetchFromAPI(yield $r(_this28.getState()),{origin:"mainSearch"});return _this28.dispatch(Au(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this29=this;return _asyncToGenerator(function*(){return _this29.dispatch(Ru({newQuery:t,originalQuery:_this29.getCurrentQuery()})),_this29.onUpdateQueryForCorrection(t),yield _this29.fetchFromAPI(yield $r(_this29.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var vie=Ee("search/executeSearch",/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Iu(r,t,e)});return function(_x101,_x102){return _ref52.apply(this,arguments)}}()),bie=Ee("search/fetchPage",/*#__PURE__*/function(){var _ref53=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Hf(r,t,e)});return function(_x103,_x104){return _ref53.apply(this,arguments)}}()),wie=Ee("search/fetchMoreResults",/*#__PURE__*/function(){var _ref54=_asyncToGenerator(function*(e,t){let r=t.getState();return yield zf(t,r)});return function(_x105,_x106){return _ref54.apply(this,arguments)}}()),Aie=Ee("search/fetchFacetValues",/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(e,t){let r=t.getState();return yield uk(t,e,r)});return function(_x107,_x108){return _ref55.apply(this,arguments)}}()),xie=Ee("search/fetchInstantResults",/*#__PURE__*/function(){var _ref56=_asyncToGenerator(function*(e,t){return Qf(e,t)});return function(_x109,_x110){return _ref56.apply(this,arguments)}}()),ak=/*#__PURE__*/function(){var _ref57=_asyncToGenerator(function*(e,t){let r=yield $r(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function ak(_x111,_x112){return _ref57.apply(this,arguments)}}(),sk=/*#__PURE__*/function(){var _ref58=_asyncToGenerator(function*(e,t,r){let n=yield Or(e);return _r({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function sk(_x113,_x114,_x115){return _ref58.apply(this,arguments)}}(),ck=/*#__PURE__*/function(){var _ref59=_asyncToGenerator(function*(e,t){let r=yield $r(e,t);return r.request.numberOfResults=0,r});return function ck(_x116,_x117){return _ref59.apply(this,arguments)}}(),Bv=e=>{e.configuration.analytics.enabled&&Rt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Qf(_x118,_x119){return _Qf.apply(this,arguments)}function _Qf(){_Qf=_asyncToGenerator(function*(e,t){$(e,{id:J,q:J,maxResultsPerQuery:new ne({required:!0,min:1}),cacheTimeout:new ne});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),i=new Gr({...t,analyticsAction:Nv()},u=>{t.dispatch(gu({q:u,id:e.id}))}),a=yield sk(o,r,n),s=yield i.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),c=yield i.process(s);return"response"in c?{results:c.response.results,searchUid:c.response.searchUid,analyticsAction:c.analyticsAction,totalCountFiltered:c.response.totalCountFiltered,duration:c.duration}:c});return _Qf.apply(this,arguments)}function Hf(_x120,_x121,_x122){return _Hf.apply(this,arguments)}function _Hf(){_Hf=_asyncToGenerator(function*(e,t,r){Bv(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),s=new Gr({...t,analyticsAction:r}),c=yield $r(e,a),u=yield s.fetchFromAPI(c,{origin:"mainSearch"});return yield s.process(u)});return _Hf.apply(this,arguments)}function zf(_x123,_x124){return _zf.apply(this,arguments)}function _zf(){_zf=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:i}=yield $f().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),a=new Gr({...e,analyticsAction:$f()}),s=yield ak(t,i),c=yield a.fetchFromAPI(s,{origin:"mainSearch"});return yield a.process(c)});return _zf.apply(this,arguments)}function uk(_x125,_x126,_x127){return _uk.apply(this,arguments)}function _uk(){_uk=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=e.extra,{description:a}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),s=new Gr({...e,analyticsAction:t}),c=yield ck(r,a),u=yield s.fetchFromAPI(c,{origin:"facetValues"});return yield s.process(u)});return _uk.apply(this,arguments)}function Iu(_x128,_x129,_x130){return _Iu.apply(this,arguments)}function _Iu(){_Iu=_asyncToGenerator(function*(e,t,r){Bv(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:i}=t.extra,{description:a}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:i}),s=yield $r(e,a),c=new Gr({...t,analyticsAction:r}),u=yield c.fetchFromAPI(s,{origin:"mainSearch"});return yield c.process(u)});return _Iu.apply(this,arguments)}m();d();p();f();var Qr=class{constructor(t,r=n=>{this.dispatch(Go({q:n}))}){this.config=t;this.onUpdateQueryForCorrection=r}fetchFromAPI(_x131,_x132){var _this30=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),i=Ws(yield _this30.extra.apiClient.search(r,n),t),a=Date.now()-o,s=_this30.getState().query?.q||"";return{response:i,duration:a,queryExecuted:s,requestExecuted:r}}).apply(this,arguments)}process(t){var _this31=this;return _asyncToGenerator(function*(){return _this31.processQueryErrorOrContinue(t)??(yield _this31.processQueryCorrectionsOrContinue(t))??(yield _this31.processQueryTriggersOrContinue(t))??_this31.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return ht(t.response)?(this.dispatch(Br(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this32=this;return _asyncToGenerator(function*(){let r=_this32.getState(),n=_this32.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:i}=r.didYouMean,{results:a,queryCorrections:s,queryCorrection:c}=n;if(!o||!i)return null;let u=a.length===0&&s&&s.length!==0,h=!se(c)&&!se(c.correctedQuery);if(!u&&!h)return null;let v=u?yield _this32.processLegacyDidYouMeanAutoCorrection(t):_this32.processModernDidYouMeanAutoCorrection(t);return _this32.dispatch(zt(tr(_this32.getState()))),v})()}processLegacyDidYouMeanAutoCorrection(t){var _this33=this;return _asyncToGenerator(function*(){let r=_this33.getCurrentQuery(),n=_this33.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],i=yield _this33.automaticallyRetryQueryWithCorrection(o);return ht(i.response)?(_this33.dispatch(Br(i.response.error)),_this33.rejectWithValue(i.response.error)):(_this33.dispatch(zt(tr(_this33.getState()))),{...i,response:{...i.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this34=this;return _asyncToGenerator(function*(){let r=_this34.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(s=>s.type==="query")?.content||"";if(!n)return null;if(_this34.getState().triggers?.queryModification.queryToIgnore===n)return _this34.dispatch(Eu("")),null;let i=_this34.getCurrentQuery(),a=yield _this34.automaticallyRetryQueryWithTriggerModification(n);return ht(a.response)?(_this34.dispatch(Br(a.response.error)),_this34.rejectWithValue(a.response.error)):(_this34.dispatch(zt(tr(_this34.getState()))),{...a,response:{...a.response.success},automaticallyCorrected:!1,originalQuery:i})})()}processSuccessResponse(t){return this.dispatch(zt(tr(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return Pa(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this35=this;return _asyncToGenerator(function*(){_this35.onUpdateQueryForCorrection(t);let r=_this35.getState(),{actionCause:n}=Dv(),o=yield _this35.fetchFromAPI(yield Pr(r,_this35.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this35.dispatch(Au(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this36=this;return _asyncToGenerator(function*(){return _this36.dispatch(Ru({newQuery:t,originalQuery:_this36.getCurrentQuery()})),_this36.onUpdateQueryForCorrection(t),yield _this36.fetchFromAPI(yield Pr(_this36.getState(),_this36.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var cae=Ee("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;$(e,{q:new z,enableQuerySyntax:new fe,clearFilters:new fe}),e.clearFilters&&(r(pu()),r(Ov())),r(Pv({allow:!0})),r(Go({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r($o(1))}),uae=N("search/updateSearchAction"),Tu=Ee("search/executeSearch",/*#__PURE__*/function(){var _ref60=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Iu(r,t,e.legacy);Gv(r);let n=e.next?Qv(e.next):void 0,o=yield Pr(r,t.extra.navigatorContext,n),i=new Qr({...t,analyticsAction:n??{}}),a=yield i.fetchFromAPI(o,{origin:"mainSearch"});return yield i.process(a)});return function(_x133,_x134){return _ref60.apply(this,arguments)}}()),$v=Ee("search/fetchPage",/*#__PURE__*/function(){var _ref61=_asyncToGenerator(function*(e,t){let r=t.getState();if(Gv(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return Hf(r,t,e.legacy);let n=new Qr({...t,analyticsAction:e.next}),o=yield Pr(r,t.extra.navigatorContext,e.next),i=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(i)});return function(_x135,_x136){return _ref61.apply(this,arguments)}}()),lae=Ee("search/fetchMoreResults",/*#__PURE__*/function(){var _ref62=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return zf(t,r);let n=Xg("browseResults",t.getState),o=new Qr({...t,analyticsAction:n}),i=yield lk(r,t.extra.navigatorContext,n),a=yield o.fetchFromAPI(i,{origin:"mainSearch"});return yield o.process(a)});return function(_x137,_x138){return _ref62.apply(this,arguments)}}()),dae=Ee("search/fetchFacetValues",/*#__PURE__*/function(){var _ref63=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Iu(r,t,e.legacy);let n=new Qr({...t,analyticsAction:{}}),o=yield fk(r,t.extra.navigatorContext),i=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(i)});return function(_x139,_x140){return _ref63.apply(this,arguments)}}()),fae=Ee("search/fetchInstantResults",/*#__PURE__*/function(){var _ref64=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Qf(e,t);$(e,{id:J,q:J,maxResultsPerQuery:new ne({required:!0,min:1}),cacheTimeout:new ne});let{q:n,maxResultsPerQuery:o}=e,i=Qv(Fv()),a=yield dk(r,t.extra.navigatorContext,n,o,i),s=new Qr({...t,analyticsAction:i},h=>{t.dispatch(gu({q:h,id:e.id}))}),c=yield s.fetchFromAPI(a,{origin:"instantResults",disableAbortWarning:!0}),u=yield s.process(c);return"response"in u?{results:u.response.results,searchUid:u.response.searchUid,totalCountFiltered:u.response.totalCountFiltered,duration:u.duration}:u});return function(_x141,_x142){return _ref64.apply(this,arguments)}}()),lk=/*#__PURE__*/function(){var _ref65=_asyncToGenerator(function*(e,t,r){let n=yield Pr(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function lk(_x143,_x144,_x145){return _ref65.apply(this,arguments)}}(),dk=/*#__PURE__*/function(){var _ref66=_asyncToGenerator(function*(e,t,r,n,o){let i=xo(e,t,o);return _r({...i,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function dk(_x146,_x147,_x148,_x149,_x150){return _ref66.apply(this,arguments)}}(),fk=/*#__PURE__*/function(){var _ref67=_asyncToGenerator(function*(e,t,r){let n=yield Pr(e,t,r);return n.request.numberOfResults=0,n});return function fk(_x151,_x152,_x153){return _ref67.apply(this,arguments)}}(),Gv=e=>{e.configuration.analytics.enabled&&Rt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},Qv=e=>({actionCause:e.actionCause,type:e.actionCause});var Hv=e=>{let t=Lm({extra:e}),r=kv();return t.startListening({actionCreator:Tu.pending,effect:function(){var _ref68=_asyncToGenerator(function*(n,o){let i=o.getState();if(!od(i))return;r.abortRun(),o.dispatch(ec()),o.dispatch(Iv());let a=dn(i)?.q;!a||a.trim()===""||r.run(i,o.dispatch,e.getNavigatorContext)});return function effect(_x154,_x155){return _ref68.apply(this,arguments)}}()}),t};m();d();p();f();var zv=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)},Wv=e=>t=>r=>n=>(e.debug({action:n,nextState:t.getState()},`Action dispatched: ${n.type}`),r(n));m();d();p();f();var Wf=(e,t)=>{let{referrer:r,userAgent:n,location:o,clientId:i}=e.getMeta("");return{...(t?t():{}),referrer:r,userAgent:n,location:o,clientId:i}};m();d();p();f();function Kv(e,t){let r={...e},n,o=i=>(a,s)=>{let c=i(a,s);return n?n(c,s):c};return{get combinedReducer(){let i=Tp(Object.entries(t).filter(([a])=>!(a in r)).map(([a,s])=>[a,()=>s]));return o(Hn({...i,...r}))},containsAll(i){return Object.keys(i).every(s=>s in r)},add(i){Object.keys(i).filter(a=>!(a in r)).forEach(a=>{r[a]=i[a]})},addCrossReducer(i){n=i}}}m();d();p();f();m();d();p();f();function pk(e){if(!e||!mk(e))return null;try{let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(r),o=decodeURIComponent(n.split("").map(i=>`%${`00${i.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(o)}catch{return null}}function Yv(e,t=60){if(!e)return!1;let r=pk(e);if(!r||typeof r.exp!="number")return!1;let n=Math.floor(Date.now()/1e3);return r.exp<=n+t}function mk(e){return e?/^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(e):!1}function Jv(e,t){let r=0,n=null,o=Ea(()=>{r=0},500),i=/*#__PURE__*/function(){var _ref69=_asyncToGenerator(function*(c,u=!1){let h=!n;h&&t&&(n=_asyncToGenerator(function*(){try{return yield t()}catch(v){if(!u)throw v;return null}})().finally(()=>{n=null}));let S=yield n;return h&&S&&c.dispatch(xr({accessToken:S})),S});return function i(_x156){return _ref69.apply(this,arguments)}}(),a=/*#__PURE__*/function(){var _ref71=_asyncToGenerator(function*(c){let u=c.getState(),h=hk(u);if(!(!h||!Yv(h))){e.debug("Access token is expired or about to expire, attempting renewal.");try{(yield i(c))?e.debug("Access token was renewed."):e.warn("Access token renewal returned an empty token. Please check the #renewAccessToken function.")}catch(S){e.warn(S,"Access token renewal failed. A retry will occur if necessary.")}}});return function a(_x157){return _ref71.apply(this,arguments)}}(),s=/*#__PURE__*/function(){var _ref72=_asyncToGenerator(function*(c,u,h){if(r>=5)return e.warn("Attempted to renew the token but was not successful. Please check the #renewAccessToken function."),Xv(c,u.error),u;!n&&(r++,o());try{yield i(c,!0)}catch(v){e.debug(v,"Token renewal failed in reactive path (piggybacked on a proactive renewal). The action will be re-dispatched.")}c.dispatch(h)});return function s(_x158,_x159,_x160){return _ref72.apply(this,arguments)}}();return c=>u=>(/*#__PURE__*/function(){var _ref73=_asyncToGenerator(function*(h){let S=typeof h=="function",v=typeof t=="function";if(!S)return u(h);v&&(yield a(c));let g=yield u(h);return gk(g)?v?yield s(c,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."),Xv(c,g.error),g):g});return function(_x161){return _ref73.apply(this,arguments)}}())}function gk(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error?.name===new Qn().name}function Xv(e,t){e.dispatch(ls({status:401,statusCode:401,message:t.message,type:t.name}))}function hk(e){return e.configuration.accessToken}m();d();p();f();function Zv({reducer:e,preloadedState:t,middlewares:r=[],thunkExtraArguments:n,name:o}){return Em({reducer:e,preloadedState:t,devTools:{stateSanitizer:i=>i.history?{...i,history:"<<OMIT>>"}:i,name:o,shouldHotReload:!1},middleware:i=>i({thunk:{extraArgument:n}}).prepend(...r).concat(Wv(n.logger))})}function yk(e,t){let{analytics:r}=e,{analyticsClientMiddleware:n,...o}=r??{},i={...o,...(r?.proxyBaseUrl&&{apiBaseUrl:r.proxyBaseUrl,nexApiBaseUrl:r.proxyBaseUrl})};return i.analyticsMode!=="next"&&Ip()?(t.info("Analytics disabled since doNotTrack is active."),{...i,enabled:!1}):i}function eb(e,t){let r={...e.reducers,configuration:qt,version:Ty},n=Sk({...e,reducers:r},t,qt),{accessToken:o,environment:i,organizationId:a}=e.configuration;n.dispatch(xr({accessToken:o,environment:i,organizationId:a}));let s=yk(e.configuration,n.logger);return s&&n.dispatch(Jn(s)),n}function Sk(e,t,r){let{reducers:n,navigatorContextProvider:o}=e,i=Kv({...n,configurationReducer:r},e.preloadedState??{});e.crossReducer&&i.addCrossReducer(e.crossReducer);let a=t.logger,s={...t,get relay(){return Di(u.state,o)},get navigatorContext(){return Wf(this.relay,o)}},c=vk(e,s,i),u={addReducers(h){i.containsAll(h)||(i.add(h),c.replaceReducer(i.combinedReducer))},dispatch:c.dispatch,subscribe:c.subscribe,enableAnalytics(){c.dispatch(eo())},disableAnalytics(){c.dispatch(Zn())},get state(){return c.getState()},get relay(){return Di(this.state,o)},get navigatorContext(){return Wf(this.relay,o)},logger:a,store:c};return u}function vk(e,t,r){let{preloadedState:n,configuration:o}=e,i=o.name||"coveo-headless",a=bk(e,t.logger,()=>t.navigatorContext);return Zv({preloadedState:n,reducer:r.combinedReducer,middlewares:a,thunkExtraArguments:t,name:i})}function bk(e,t,r){let{renewAccessToken:n}=e.configuration,o=Jv(t,n),i=Hv({getNavigatorContext:r});return[Ly,o,zv(t),ky].concat(Yd.middleware,i.middleware,e.middlewares||[])}m();d();p();f();var ub=Dt(cb(),1);function lb(e){return(0,ub.pino)({name:"@coveo/headless",level:e?.level||"warn",formatters:{log:e?.logFormatter}})}m();d();p();f();function db(e,t){let r=jk(e),n=Et,o=Lk(e);return{analyticsClientMiddleware:r,validatePayload:n,preprocessRequest:o,logger:t}}function jk(e){let{analytics:t}=e,r=(n,o)=>o;return t?.analyticsClientMiddleware||r}function Lk(e){return e.preprocessRequest||Ta}m();d();p();f();m();d();p();f();var fb={organizationId:J,accessToken:J,name:new z({required:!1,emptyAllowed:!1}),analytics:new re({options:{required:!1},values:{enabled:new fe({required:!1}),originContext:new z({required:!1}),originLevel2:new z({required:!1}),originLevel3:new z({required:!1}),analyticsMode:new z({constrainTo:["legacy","next"],required:!1,default:"next"}),proxyBaseUrl:new z({required:!1,url:!0}),trackingId:new z({required:!1,emptyAllowed:!1,regex:/^[a-zA-Z0-9_\-.]{1,100}$/})}}),environment:new z({required:!1,default:"prod",constrainTo:["prod","hipaa","stg","dev"]})};function pb(){return{organizationId:"searchuisamples",accessToken:"xx564559b1-0045-48e1-953c-3addd1ee4457"}}var mb=new gt({...fb,pipeline:new z({required:!1,emptyAllowed:!0}),searchHub:tt,locale:tt,timezone:tt});function ep(){return{...pb(),searchHub:"default"}}var Vk={debug:us,pipeline:no,searchHub:yo,recommendation:go};function gb(e){let t=lb(e.loggerOptions);Uk(e.configuration,t);let r=Bk(e.configuration,t),n={...db(e.configuration,t),apiClient:r},o={...e,reducers:Vk},i=eb(o,n),{pipeline:a,searchHub:s,timezone:c,locale:u,proxyBaseUrl:h}=e.configuration;return i.dispatch(Ht({timezone:c,locale:u,proxyBaseUrl:h})),se(a)||i.dispatch(to(a)),se(s)||i.dispatch(ho(s)),{...i,get state(){return i.state}}}function Uk(e,t){try{mb.validate(e)}catch(r){throw t.error(r,"Recommendation engine configuration error"),r}}function Bk(e,t){return new Oa({logger:t,preprocessRequest:e.preprocessRequest||Ta,postprocessSearchResponseMiddleware:e.preprocessSearchResponseMiddleware||Qp,postprocessFacetSearchResponseMiddleware:Hp,postprocessQuerySuggestResponseMiddleware:zp})}m();d();p();f();m();d();p();f();m();d();p();f();var $k=new he({each:J,required:!0}),hb=(e,t)=>($(e,J),xa(t)?$(t,J):$(t,$k),{payload:{contextKey:e,contextValue:t}}),qn=N("context/set",e=>{for(let[t,r]of Object.entries(e))hb(t,r);return{payload:e}}),jn=N("context/add",e=>hb(e.contextKey,e.contextValue)),Ln=N("context/remove",e=>$(e,J));m();d();p();f();var Ou=Le(xu(),e=>{e.addCase(qn,(t,r)=>{t.contextValues=r.payload}).addCase(jn,(t,r)=>{t.contextValues[r.payload.contextKey]=r.payload.contextValue}).addCase(Ln,(t,r)=>{delete t.contextValues[r.payload]}).addCase(yt.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.context.contextValues)})});m();d();p();f();function zr(e){let t,r=new Map,n=()=>r.size===0,o=i=>{try{let a=JSON.stringify(i),s=t!==a;return t=a,s}catch(a){return console.warn("Could not detect if state has changed, check the controller \"get state method\"",a),!0}};return{subscribe(i){i();let a=Symbol(),s;return n()&&(t=JSON.stringify(this.state),s=e.subscribe(()=>{o(this.state)&&r.forEach(c=>c())})),r.set(a,i),()=>{r.delete(a),n()&&s?.()}},get state(){return{}}}}m();d();p();f();var Gk=["caseId","caseNumber"],Qk={caseId:"caseContext",caseNumber:"caseContext"},ma=class extends Error{constructor(t){super(`The key "${t}" is reserved for internal use. Use ${Qk[t]} to set this value.}`)}};function tp(e){return Gk.includes(e)}var Hk=new gt({values:new re({options:{required:!1}})});function yb(e,t={}){if(!Kk(e))throw Bt;let r=zr(e),{dispatch:n}=e,o=()=>e.state,i=Bm(e,Hk,t.initialState,"buildContext");return i.values&&n(qn(i.values)),{...r,get state(){return{values:o().context.contextValues}},set(a){n(qn(a))},...(o().configuration.analytics.analyticsMode==="legacy"?zk(n):Wk(n))}}var zk=e=>({add(t,r){e(jn({contextKey:t,contextValue:r}))},remove(t){e(Ln(t))}}),Wk=e=>({add(t,r){if(tp(t))throw new ma(t);e(jn({contextKey:t,contextValue:r}))},remove(t){if(tp(t))throw new ma(t);e(Ln(t))}});function Kk(e){return e.addReducers({context:Ou}),!0}function Sb(e,t){return yb(e,t)}m();d();p();f();m();d();p();f();var Ho=N("dictionaryFieldContext/set",e=>{let t=new re({options:{required:!0}}),r=$(e,t).error;if(r)return{payload:e,error:r};let n=Object.values(e),o=new he({each:rt}),i=$(n,o).error;return i?{payload:e,error:i}:{payload:e}}),zo=N("dictionaryFieldContext/add",e=>{let t=new re({options:{required:!0},values:{field:rt,key:rt}});return $(e,t)}),Wo=N("dictionaryFieldContext/remove",e=>$(e,rt));m();d();p();f();var Pu=Le(Cu(),e=>{e.addCase(Ho,(t,r)=>{t.contextValues=r.payload}).addCase(zo,(t,r)=>{let{field:n,key:o}=r.payload;t.contextValues[n]=o}).addCase(Wo,(t,r)=>{delete t.contextValues[r.payload]}).addCase(yt.fulfilled,(t,r)=>{r.payload&&(t.contextValues=r.payload.dictionaryFieldContext.contextValues)})});function vb(e){if(!Yk(e))throw Bt;let t=zr(e),{dispatch:r}=e,n=()=>e.state;return{...t,get state(){return{values:n().dictionaryFieldContext.contextValues}},set(o){r(Ho(o))},add(o,i){r(zo({field:o,key:i}))},remove(o){r(Wo(o))}}}function Yk(e){return e.addReducers({dictionaryFieldContext:Pu}),!0}m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();m();d();p();f();var ga={value:J,numberOfResults:new ne({min:0}),state:J};m();d();p();f();var Ie=J;var eO=new ne({min:1,default:8,required:!1}),tO=new ne({min:1,max:20,default:5,required:!1}),rO={desiredCount:tO,numberOfValues:eO},vle=N("automaticFacet/setOptions",e=>$(e,rO)),ble=N("automaticFacet/deselectAll",e=>$(e,Ie)),nO=J,bb=N("automaticFacet/toggleSelectValue",e=>$(e,{field:nO,selection:new re({values:ga})}));m();d();p();f();m();d();p();f();var oO={state:new Fe({required:!0}),numberOfResults:new ne({required:!0,min:0}),value:new z({required:!0,emptyAllowed:!0}),path:new he({required:!0,each:J}),moreValuesAvailable:new fe({required:!1})};function rp(e){e.children.forEach(t=>{rp(t)}),Et({state:e.state,numberOfResults:e.numberOfResults,value:e.value,path:e.path,moreValuesAvailable:e.moreValuesAvailable},oO)}var Ko={facetId:Ie,field:J,tabs:new re({options:{required:!1},values:{included:new he({each:new z}),excluded:new he({each:new z})}}),activeTab:new z({required:!1}),delimitingCharacter:new z({required:!1,emptyAllowed:!0}),filterFacetCount:new fe({required:!1}),injectionDepth:new ne({required:!1,min:0}),numberOfValues:new ne({required:!1,min:1}),sortCriteria:new Fe({required:!1}),basePath:new he({required:!1,each:J}),filterByBasePath:new fe({required:!1})};var jle=N("categoryFacet/register",e=>$(e,Ko)),wb=N("categoryFacet/toggleSelectValue",e=>{try{return Et(e.facetId,J),rp(e.selection),{payload:e,error:null}}catch(t){return{payload:e,error:sr(t)}}}),Ab=N("categoryFacet/deselectAll",e=>$(e,Ko.facetId)),Lle=N("categoryFacet/updateNumberOfValues",e=>$(e,{facetId:Ko.facetId,numberOfValues:Ko.numberOfValues})),Vle=N("categoryFacet/updateSortCriterion",e=>$(e,{facetId:Ko.facetId,criterion:new Fe})),Ule=N("categoryFacet/updateBasePath",e=>$(e,{facetId:Ko.facetId,basePath:new he({each:J})}));m();d();p();f();m();d();p();f();var ha={facetId:Ie,captions:new re({options:{required:!1}}),numberOfValues:new ne({required:!1,min:1}),query:new z({required:!1,emptyAllowed:!0})};var iO={path:new he({required:!0,each:J}),displayValue:rt,rawValue:rt,count:new ne({required:!0,min:0})},xb=N("categoryFacet/selectSearchResult",e=>$(e,{facetId:Ie,value:new re({values:iO})})),ide=N("categoryFacetSearch/register",e=>$(e,ha));m();d();p();f();var Cb={facetId:Ie,value:new re({values:{displayValue:rt,rawValue:rt,count:new ne({required:!0,min:0})}})},hde=N("facetSearch/register",e=>$(e,ha)),yde=N("facetSearch/update",e=>$(e,ha)),Eb=N("facetSearch/toggleSelectValue",e=>$(e,Cb)),Rb=N("facetSearch/toggleExcludeValue",e=>$(e,Cb));m();d();p();f();m();d();p();f();var Cde=new z({regex:/^[a-zA-Z0-9-_]+$/}),Ede=new z({required:!0}),Rde=new he({each:new z}),Ide=new z,Tde=new fe,_de=new fe,kde=new ne({min:0}),aO=new ne({min:1}),Ode=new fe({required:!0}),sO=new re,cO=new z,uO={captions:sO,numberOfValues:aO,query:cO},Pde=new re({values:uO}),Ib=new re({options:{required:!1},values:{type:new z({constrainTo:["simple"],emptyAllowed:!1,required:!0}),values:new he({required:!0,max:25,each:new z({emptyAllowed:!1,required:!0})})}}),Nde=new fe,Tb=new he({min:1,max:25,required:!1,each:new z({emptyAllowed:!1,required:!0})});var lO={facetId:Ie,field:new z({required:!0,emptyAllowed:!0}),tabs:new re({options:{required:!1},values:{included:new he({each:new z}),excluded:new he({each:new z})}}),activeTab:new z({required:!1}),filterFacetCount:new fe({required:!1}),injectionDepth:new ne({required:!1,min:0}),numberOfValues:new ne({required:!1,min:1}),sortCriteria:new Fe({required:!1}),resultsMustMatch:new Fe({required:!1}),allowedValues:Ib,customSort:Tb},Qde=N("facet/register",e=>$(e,lO)),_b=N("facet/toggleSelectValue",e=>$(e,{facetId:Ie,selection:new re({values:ga})})),kb=N("facet/toggleExcludeValue",e=>$(e,{facetId:Ie,selection:new re({values:ga})})),Nu=N("facet/deselectAll",e=>$(e,Ie)),Hde=N("facet/updateSortCriterion",e=>$(e,{facetId:Ie,criterion:new Fe({required:!0})})),zde=N("facet/updateNumberOfValues",e=>$(e,{facetId:Ie,numberOfValues:new ne({required:!0,min:1})})),Wde=N("facet/updateIsFieldExpanded",e=>$(e,{facetId:Ie,isFieldExpanded:new fe({required:!0})})),Kde=N("facet/updateFreezeCurrentValues",e=>$(e,{facetId:Ie,freezeCurrentValues:new fe({required:!0})}));m();d();p();f();m();d();p();f();function Pb(e){let t=Ob(e.start,e),r=Ob(e.end,e),n=e.endInclusive??!1,o=e.state??"idle";return{start:t,end:r,endInclusive:n,state:o}}function Ob(e,t){let{dateFormat:r}=t;return Wh(e)?(qd(e),Qh(e)):typeof e=="string"&&Tr(e)?(qd(e),e):(Uh(e,r),zs(Ao(e,r)))}m();d();p();f();var Nb=N("rangeFacet/updateSortCriterion",e=>$(e,{facetId:Ie,criterion:new Fe({required:!0})}));m();d();p();f();var Fu={state:J,start:new ne({required:!0}),end:new ne({required:!0}),endInclusive:new fe({required:!0}),numberOfResults:new ne({required:!0,min:0})},Du={start:J,end:J,endInclusive:new fe({required:!0}),state:J,numberOfResults:new ne({required:!0,min:0})};var dO={start:J,end:J,endInclusive:new fe({required:!0}),state:J},fO={facetId:Ie,field:J,tabs:new re({options:{required:!1},values:{included:new he({each:new z}),excluded:new he({each:new z})}}),activeTab:new z({required:!1}),currentValues:new he({required:!1,each:new re({values:dO})}),generateAutomaticRanges:new fe({required:!0}),filterFacetCount:new fe({required:!1}),injectionDepth:new ne({required:!1,min:0}),numberOfValues:new ne({required:!1,min:1}),sortCriteria:new Fe({required:!1}),rangeAlgorithm:new Fe({required:!1})};function Fb(e){return Tr(e)?Qi(e):e}function Db(e){e.currentValues&&e.currentValues.forEach(t=>{let{start:r,end:n}=Pb(t);if(Ao(Fb(r)).isAfter(Ao(Fb(n))))throw new Error(`The start value is greater than the end value for the date range ${t.start} to ${t.end}`)})}var Dfe=N("dateFacet/register",e=>{try{return Et(e,fO),Db(e),{payload:e,error:null}}catch(t){return{payload:e,error:sr(t)}}}),Mb=N("dateFacet/toggleSelectValue",e=>$(e,{facetId:Ie,selection:new re({values:Du})})),qb=N("dateFacet/toggleExcludeValue",e=>$(e,{facetId:Ie,selection:new re({values:Du})})),jb=N("dateFacet/updateFacetValues",e=>{try{return Et(e,{facetId:Ie,values:new he({each:new re({values:Du})})}),Db({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:sr(t)}}});m();d();p();f();var pO={state:J,start:new ne({required:!0}),end:new ne({required:!0}),endInclusive:new fe({required:!0})},mO={facetId:Ie,field:J,tabs:new re({options:{required:!1},values:{included:new he({each:new z}),excluded:new he({each:new z})}}),activeTab:new z({required:!1}),currentValues:new he({required:!1,each:new re({values:pO})}),generateAutomaticRanges:new fe({required:!0}),filterFacetCount:new fe({required:!1}),injectionDepth:new ne({required:!1,min:0}),numberOfValues:new ne({required:!1,min:1}),sortCriteria:new Fe({required:!1}),rangeAlgorithm:new Fe({required:!1})};function Lb(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 Wfe=N("numericFacet/register",e=>{try{return $(e,mO),Lb(e),{payload:e,error:null}}catch(t){return{payload:e,error:sr(t)}}}),Vb=N("numericFacet/toggleSelectValue",e=>$(e,{facetId:Ie,selection:new re({values:Fu})})),Ub=N("numericFacet/toggleExcludeValue",e=>$(e,{facetId:Ie,selection:new re({values:Fu})})),Bb=N("numericFacet/updateFacetValues",e=>{try{return Et(e,{facetId:Ie,values:new he({each:new re({values:Fu})})}),Lb({currentValues:e.values}),{payload:e,error:null}}catch(t){return{payload:e,error:sr(t)}}});var $b=Le(fa(),e=>{e.addCase(yu,(t,r)=>{let n=np(t),o=r.payload;t.defaultNumberOfResults=t.numberOfResults=o,t.firstResult=ya(n,o)}).addCase(Su,(t,r)=>{t.numberOfResults=r.payload,t.firstResult=0}).addCase(tc,t=>{t.firstResult=0}).addCase(vu,(t,r)=>{let n=r.payload;t.firstResult=ya(n,t.numberOfResults)}).addCase($o,(t,r)=>{let n=r.payload;t.firstResult=ya(n,t.numberOfResults)}).addCase(wu,t=>{let r=np(t),n=Math.max(r-1,1);t.firstResult=ya(n,t.numberOfResults)}).addCase(bu,t=>{let r=np(t),n=hO(t),o=Math.min(r+1,n);t.firstResult=ya(o,t.numberOfResults)}).addCase(yt.fulfilled,(t,r)=>{r.payload&&(t.numberOfResults=r.payload.pagination.numberOfResults,t.firstResult=r.payload.pagination.firstResult)}).addCase(Cr,(t,r)=>{t.firstResult=r.payload.firstResult??t.firstResult,t.numberOfResults=r.payload.numberOfResults??t.defaultNumberOfResults}).addCase(Tu.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase($v.fulfilled,(t,r)=>{let{response:n}=r.payload;t.totalCountFiltered=n.totalCountFiltered}).addCase(Nu,t=>{lt(t)}).addCase(qb,t=>{lt(t)}).addCase(kb,t=>{lt(t)}).addCase(Ub,t=>{lt(t)}).addCase(Rb,t=>{lt(t)}).addCase(_b,t=>{lt(t)}).addCase(Ab,t=>{lt(t)}).addCase(wb,t=>{lt(t)}).addCase(xb,t=>{lt(t)}).addCase(Mb,t=>{lt(t)}).addCase(Vb,t=>{lt(t)}).addCase(pu,t=>{lt(t)}).addCase(jb,t=>{lt(t)}).addCase(Bb,t=>{lt(t)}).addCase(Eb,t=>{lt(t)}).addCase(bb,t=>{lt(t)})});function lt(e){e.firstResult=fa().firstResult}function np(e){let{firstResult:t,numberOfResults:r}=e;return yO(t,r)}function hO(e){let{totalCountFiltered:t,numberOfResults:r}=e;return SO(t,r)}function ya(e,t){return(e-1)*t}function yO(e,t){return Math.round(e/t)+1}function SO(e,t){let r=Math.min(e,5e3);return Math.ceil(r/t)}function op(e){return e.addReducers({pagination:$b}),{nextPage:bu,previousPage:wu,registerNumberOfResults:yu,registerPage:vu,updateNumberOfResults:Su,updatePage:$o}}var vO=new gt({id:new z({emptyAllowed:!0,required:!1,default:""}),numberOfRecommendations:new ne({min:0})});function Gb(e,t={}){if(!bO(e))throw Bt;let r=zr(e),{dispatch:n}=e,o=()=>e.state,i=$m(e,vO,t.options,"buildRecommendationList");return i.id!==""&&n(mo({id:i.id})),i.numberOfRecommendations&&n(op(e).updateNumberOfResults(i.numberOfRecommendations)),{...r,refresh(){n(Ir())},get state(){let a=o();return{recommendations:a.recommendation.recommendations,error:a.recommendation.error,isLoading:a.recommendation.isLoading,searchResponseId:a.recommendation.searchUid}}}}function bO(e){return e.addReducers({recommendation:go,configuration:qt}),!0}m();d();p();f();m();d();p();f();function Qb(e,t,r){if(!wO(e))throw Bt;let n=1e3,o={selectionDelay:n,debounceWait:n,...t.options},i;return{select:Ea(r,o.debounceWait,{isImmediate:!0}),beginDelayedSelect(){i=setTimeout(r,o.selectionDelay)},cancelPendingSelect(){i&&clearTimeout(i)}}}function wO(e){return e.addReducers({configuration:qt}),!0}function Hb(e,t){let r=!1,n=()=>{r||(r=!0,e.dispatch(qs(t.options.result)))};return Qb(e,t,()=>{n()})}m();d();p();f();m();d();p();f();m();d();p();f();var Wr=()=>new z({required:!1,emptyAllowed:!0}),Mu=N("advancedSearchQueries/update",e=>$(e,{aq:Wr(),cq:Wr(),lq:Wr(),dq:Wr()})),qu=N("advancedSearchQueries/register",e=>$(e,{aq:Wr(),cq:Wr(),lq:Wr(),dq:Wr()}));var zb=Le(Ur(),e=>{e.addCase(Mu,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;Xe(n)||(t.aq=n,t.aqWasSet=!0),Xe(o)||(t.cq=o,t.cqWasSet=!0),Xe(i)||(t.lq=i,t.lqWasSet=!0),Xe(a)||(t.dq=a,t.dqWasSet=!0)}).addCase(qu,(t,r)=>{let{aq:n,cq:o,lq:i,dq:a}=r.payload;Xe(n)||(t.defaultFilters.aq=n,t.aqWasSet||(t.aq=n)),Xe(o)||(t.defaultFilters.cq=o,t.cqWasSet||(t.cq=o)),Xe(i)||(t.defaultFilters.lq=i,t.lqWasSet||(t.lq=i)),Xe(a)||(t.defaultFilters.dq=a,t.dqWasSet||(t.dq=a))}).addCase(yt.fulfilled,(t,r)=>r.payload?.advancedSearchQueries??t).addCase(Cr,(t,r)=>{let{aq:n,cq:o}=r.payload;Xe(n)||(t.aq=n,t.aqWasSet=!0),Xe(o)||(t.cq=o,t.cqWasSet=!0)})});function AO(e){return e.addReducers({advancedSearchQueries:zb}),{updateAdvancedSearchQueries:Mu,registerAdvancedSearchQueries:qu}}m();d();p();f();function xO(e){return e.addReducers({configuration:qt}),{disableAnalytics:Zn,enableAnalytics:eo,setOriginLevel2:os,setOriginLevel3:is,updateAnalyticsConfiguration:Jn,updateBasicConfiguration:xr}}m();d();p();f();function CO(e){return e.addReducers({configuration:qt,pipeline:no,searchHub:yo}),{updateSearchConfiguration:Ht}}m();d();p();f();function EO(e){return e.addReducers({context:Ou}),{addContext:jn,removeContext:Ln,setContext:qn}}m();d();p();f();function RO(e){return e.addReducers({debug:us}),{disableDebug:ss,enableDebug:as}}m();d();p();f();function IO(e){return e.addReducers({dictionaryFieldContext:Pu}),{addContext:zo,removeContext:Wo,setContext:Ho}}m();d();p();f();m();d();p();f();m();d();p();f();var TO={collectionField:new z({emptyAllowed:!1,required:!1}),parentField:new z({emptyAllowed:!1,required:!1}),childField:new z({emptyAllowed:!1,required:!1}),numberOfFoldedResults:new ne({min:0,required:!1})},Wb=N("folding/register",e=>$(e,TO)),yge=Ee("folding/loadCollection",/*#__PURE__*/function(){var _ref74=_asyncToGenerator(function*(e,{getState:t,rejectWithValue:r,extra:{apiClient:n,navigatorContext:o}}){let i=t(),a=i.configuration.analytics.analyticsMode==="legacy"?yield Or(i):xo(i,o),s=yield n.search({...a,q:_O(i),enableQuerySyntax:!0,cq:`@${i.folding.fields.collection}="${e}"`,filterField:i.folding.fields.collection,childField:i.folding.fields.parent,parentField:i.folding.fields.child,filterFieldRange:100},{origin:"foldingCollection"});return ht(s)?r(s.error):{collectionId:e,results:s.success.results,searchUid:s.success.searchUid,rootResult:i.folding.collections[e].result}});return function(_x162,_x163){return _ref74.apply(this,arguments)}}());function _O(e){return e.query.q===""?"":e.query.enableQuerySyntax?`${e.query.q} OR @uri`:`( <@- ${e.query.q} -@> ) OR @uri`}m();d();p();f();var Kb=()=>({enabled:!1,fields:{collection:"foldingcollection",parent:"foldingparent",child:"foldingchild"},filterFieldRange:2,collections:{}});m();d();p();f();var Yo=N("fields/registerFieldsToInclude",e=>$(e,ns)),ju=N("fields/fetchall/enable"),Lu=N("fields/fetchall/disable"),Vu=Ee("fields/fetchDescription",/*#__PURE__*/function(){var _ref75=_asyncToGenerator(function*(e,{extra:t,getState:r,rejectWithValue:n}){let o=r(),{accessToken:i,environment:a,organizationId:s}=o.configuration,{apiBaseUrl:c}=o.configuration.search,u=yield t.apiClient.fieldDescriptions({accessToken:i,organizationId:s,url:c??vr(s,a)});return ht(u)?n(u.error):u.success.fields});return function(_x164,_x165){return _ref75.apply(this,arguments)}}());m();d();p();f();var Uu=["author","language","urihash","objecttype","collection","source","permanentid"],ip=[...Uu,"date","filetype","parents"],Yb=[...ip,"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"],Xb=()=>({fieldsToInclude:Uu,fetchAllFields:!1,fieldsDescription:[]});var Bu=Le(Xb(),e=>e.addCase(Yo,(t,r)=>{t.fieldsToInclude=[...new Set(t.fieldsToInclude.concat(r.payload))]}).addCase(ju,t=>{t.fetchAllFields=!0}).addCase(Lu,t=>{t.fetchAllFields=!1}).addCase(Vu.fulfilled,(t,{payload:r})=>{t.fieldsDescription=r}).addCase(Wb,(t,{payload:r})=>{let n=Kb().fields;t.fieldsToInclude.push(r.collectionField??n.collection,r.parentField??n.parent,r.childField??n.child)}));function kO(e){return e.addReducers({fields:Bu}),{registerFieldsToInclude:Yo,enableFetchAllFields:ju,disableFetchAllFields:Lu,fetchFieldsDescription:Vu}}m();d();p();f();function OO(e){return e.addReducers({pipeline:no}),{setPipeline:to}}m();d();p();f();function PO(e){return e.addReducers({recommendation:go}),{getRecommendations:Ir,setRecommendationId:mo}}m();d();p();f();function NO(e){return e.addReducers({}),{logRecommendationOpen:qs}}m();d();p();f();m();d();p();f();var FO=new gt({content:new Fe({required:!0}),conditions:new Fe({required:!0}),priority:new ne({required:!1,default:0,min:0}),fields:new he({required:!1,each:J})});function Jb(){let e=[],t=r=>{let n=FO.validate(r);if(!r.conditions.every(i=>i instanceof Function))throw new ni("Each template condition should be a function that takes a Result or Product as an argument and returns a boolean");return n};return{registerTemplates(...r){r.forEach(n=>{let o={...t(n),fields:n.fields||[]};e.push(o)}),e.sort((n,o)=>o.priority-n.priority)},selectTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.content:null},selectLinkTemplate(r){let n=e.find(o=>o.conditions.every(i=>i(r)));return n?n.linkContent:null}}}function Zb(e){if(!DO(e))throw Bt;let{registerTemplates:t,selectTemplate:r,selectLinkTemplate:n}=Jb();return{registerTemplates:(...o)=>{t(...o);let i=[];o.forEach(a=>{a.fields&&i.push(...a.fields)}),e.dispatch(Yo(i))},selectTemplate:r,selectLinkTemplate:n}}function DO(e){return e.addReducers({fields:Bu}),!0}m();d();p();f();function MO(e){return e.addReducers({searchHub:yo}),{setSearchHub:ho}}/**
|
|
42
42
|
* @license
|
|
43
43
|
*
|
|
44
44
|
* Copyright 2026 Coveo Solutions Inc.
|
|
@@ -71,4 +71,4 @@ fast-json-patch/module/duplex.mjs:
|
|
|
71
71
|
*)
|
|
72
72
|
*/if(__exports!=exports)module.exports=exports;return module.exports});
|
|
73
73
|
|
|
74
|
-
window.coveoQuanticVersion = '3.
|
|
74
|
+
window.coveoQuanticVersion = '3.37.1';
|