@docsearch/js 4.6.2 → 5.0.0-beta.0

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/dist/umd/index.js CHANGED
@@ -1,7 +1,176 @@
1
- /*! @docsearch/js 4.6.2 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */
2
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).docsearch=t()}(this,function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function n(e,t,n,r,u,a,i){try{var o=e[a](i),s=o.value}catch(e){return void n(e)}o.done?t(s):Promise.resolve(s).then(r,u)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(u,a){var i=e.apply(t,r);function o(e){n(i,u,a,o,s,"next",e)}function s(e){n(i,u,a,o,s,"throw",e)}o(void 0)})}}function u(e,n,r){return n=l(n),function(e,n){if(n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return t(e)}(e,d()?Reflect.construct(n,r||[],l(e).constructor):n.apply(e,r))}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,E(r.key),r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=b(e))||t){n&&(e=n);var r=0,u=function(){};return{s:u,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:u}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){o=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(o)throw a}}}}function c(e,t,n){return(t=E(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function f(e,t){if("function"!=typeof t&&null!==t)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&&y(e,t)}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(d=function(){return!!e})()}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function v(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}function m(){
3
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
4
- var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",u=n.toStringTag||"@@toStringTag";function a(n,r,u,a){var s=r&&r.prototype instanceof o?r:o,c=Object.create(s.prototype);return D(c,"_invoke",function(n,r,u){var a,o,s,c=0,l=u||[],f=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,o=0,s=e,d.n=n,i}};function p(n,r){for(o=n,s=r,t=0;!f&&c&&!u&&t<l.length;t++){var u,a=l[t],p=d.p,h=a[2];n>3?(u=h===r)&&(s=a[(o=a[4])?5:(o=3,3)],a[4]=a[5]=e):a[0]<=p&&((u=n<2&&p<a[1])?(o=0,d.v=r,d.n=a[1]):p<h&&(u=n<3||a[0]>r||r>h)&&(a[4]=n,a[5]=r,d.n=h,o=0))}if(u||n>1)return i;throw f=!0,r}return function(u,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,h),o=l,s=h;(t=o<2?e:s)||!f;){a||(o?o<3?(o>1&&(d.n=-1),p(o,s)):d.n=s:d.v=s);try{if(c=2,a){if(o||(u="next"),t=a[u]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,o<2&&(o=0)}else 1===o&&(t=a.return)&&t.call(a),o<2&&(s=TypeError("The iterator does not provide a '"+u+"' method"),o=1);a=e}else if((t=(f=d.n<0)?s:n.call(r,d))!==i)break}catch(t){a=e,o=1,s=t}finally{c=1}}return{value:t,done:f}}}(n,u,a),!0),c}var i={};function o(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(D(t={},r,function(){return this}),t),f=c.prototype=o.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,D(e,u,"GeneratorFunction")),e.prototype=Object.create(f),e}return s.prototype=c,D(f,"constructor",c),D(c,"constructor",s),s.displayName="GeneratorFunction",D(c,u,"GeneratorFunction"),D(f),D(f,u,"Generator"),D(f,r,function(){return this}),D(f,"toString",function(){return"[object Generator]"}),(m=function(){return{w:a,m:d}})()}function D(e,t,n,r){var u=Object.defineProperty;try{u({},"",{})}catch(e){u=0}D=function(e,t,n,r){function a(t,n){D(e,t,function(e){return this._invoke(t,n,e)})}t?u?u(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},D(e,t,n,r)}function y(e,t){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},y(e,t)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,a,i,o=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t);else for(;!(s=(r=a.call(n)).done)&&(o.push(r.value),o.length!==t);s=!0);}catch(e){c=!0,u=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw u}}return o}}(e,t)||b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||b(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function _(e){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_(e)}function b(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}function C(e){var t="function"==typeof Map?new Map:void 0;return C=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(d())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var u=new(e.bind.apply(e,r));return n&&y(u,n.prototype),u}(e,arguments,l(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),y(n,e)},C(e)}var k,A,w,S,x,O,B,I,T,P,j,N={},z=[],R=Array.isArray,M=z.slice,Z=Object.assign;function L(e){e&&e.parentNode&&e.remove()}function $(e,t,n){var r,u,a,i={};for(a in t)"key"==a?r=t[a]:"ref"==a&&"function"!=typeof e?u=t[a]:i[a]=t[a];return arguments.length>2&&(i.children=arguments.length>3?M.call(arguments,2):n),q(e,i,r,u,null)}function q(e,t,n,r,u){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==u?++A:u,__i:-1,__u:0};return null==u&&null!=k.vnode&&k.vnode(a),a}function U(){return{current:null}}function H(e){return e.children}function V(e,t){this.props=e,this.context=t,this.__g=0}function W(e,t){if(null==t)return e.__?W(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?W(e):null}function K(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=n.__e;break}return K(e)}}function J(e){(8&e.__g||!(e.__g|=8)||!w.push(e)||x++)&&S==k.debounceRendering||((S=k.debounceRendering)||queueMicrotask)(Q)}function Q(){for(var e,t,n,r,u,a,i,o,s=1;w.length;)w.length>s&&w.sort(O),e=w.shift(),s=w.length,8&e.__g&&(n=void 0,u=(r=(t=e).__v).__e,a=[],i=[],(o=t.__P)&&((n=Z({},r)).__v=r.__v+1,k.vnode&&k.vnode(n),ue(o,n,r,t.__n,o.namespaceURI,32&r.__u?[u]:null,a,null==u?W(r):u,!!(32&r.__u),i,o.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,ie(a,n,i),n.__e!=u&&K(n)));x=0}function G(e,t,n,r,u,a,i,o,s,c,l,f){var d,p,h,v,m,D,y,g=r&&r.__k||z,F=t.length;for(s=function(e,t,n,r,u){var a,i,o,s,c,l=n.length,f=l,d=0;for(e.__k=new Array(u),a=0;a<u;a++)null!=(i=t[a])&&"boolean"!=typeof i&&"function"!=typeof i?(s=a+d,(i=e.__k[a]="string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?q(null,i,null,null,null):R(i)?q(H,{children:i},null,null,null):null==i.constructor&&i.__b>0?q(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=e,i.__b=e.__b+1,o=null,-1!=(c=i.__i=ee(i,n,s,f))&&(f--,(o=n[c])&&(o.__u|=2)),null==o||null==o.__v?(-1==c&&(u>l?d--:u<l&&d++),"function"!=typeof i.type&&(i.__u|=4)):c!=s&&(c==s-1?d--:c==s+1?d++:(c>s?d--:d++,i.__u|=4))):e.__k[a]=null;if(f)for(a=0;a<l;a++)null!=(o=n[a])&&!(2&o.__u)&&(o.__e==r&&(r=W(o)),ce(o,o));return r}(n,t,g,s,F),d=0;d<F;d++)null!=(h=n.__k[d])&&(p=-1==h.__i?N:g[h.__i]||N,h.__i=d,D=ue(e,h,p,u,a,i,o,s,c,l,f),v=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&se(p.ref,null,h),l.push(h.ref,h.__c||v,h)),null==m&&null!=v&&(m=v),(y=!!(4&h.__u))||p.__k===h.__k?s=Y(h,s,e,y):"function"==typeof h.type&&void 0!==D?s=D:v&&(s=v.nextSibling),h.__u&=-7);return n.__e=m,s}function Y(e,t,n,r){var u,a;if("function"==typeof e.type){for(u=e.__k,a=0;u&&a<u.length;a++)u[a]&&(u[a].__=e,t=Y(u[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=W(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function X(e,t){return t=t||[],null==e||"boolean"==typeof e||(R(e)?e.some(function(e){X(e,t)}):t.push(e)),t}function ee(e,t,n,r){var u,a,i,o=e.key,s=e.type,c=t[n],l=null!=c&&!(2&c.__u);if(null===c&&null==e.key||l&&o==c.key&&s==c.type)return n;if(r>(l?1:0))for(u=n-1,a=n+1;u>=0||a<t.length;)if(null!=(c=t[i=u>=0?u--:a++])&&!(2&c.__u)&&o==c.key&&s==c.type)return i;return-1}function te(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":n}function ne(e,t,n,r,u){var a;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||te(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||te(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])a=t!=(t=t.replace(B,"$1")),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||(e.__l={}),e.__l[t+a]=n,n?r?n.l=r.l:(n.l=I,e.addEventListener(t,a?P:T,a)):e.removeEventListener(t,a?P:T,a);else{if("http://www.w3.org/2000/svg"==u)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function re(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(null==t.u)t.u=I++;else if(t.u<n.l)return;return n(k.event?k.event(t):t)}}}function ue(e,t,n,r,u,a,i,o,s,c,l){var f,d,p,h,v,m,D,y,g,F,E,_,b,C,A,w,S,x,O,B,I,T=t.type;if(null!=t.constructor)return null;128&n.__u&&(s=!!(32&n.__u),n.__c.__z&&(o=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(f=k.__b)&&f(t);e:if("function"==typeof T)try{if(y=t.props,g="prototype"in T&&T.prototype.render,F=(f=T.contextType)&&r[f.__c],E=f?F?F.props.value:f.__:r,n.__c?2&(d=t.__c=n.__c).__g&&(d.__g|=1,D=!0):(g?t.__c=d=new T(y,E):(t.__c=d=new V(y,E),d.constructor=T,d.render=le),F&&F.sub(d),d.props=y,d.state||(d.state={}),d.context=E,d.__n=r,p=!0,d.__g|=8,d.__h=[],d._sb=[]),g&&null==d.__s&&(d.__s=d.state),g&&null!=T.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Z({},d.__s)),Z(d.__s,T.getDerivedStateFromProps(y,d.__s))),h=d.props,v=d.state,d.__v=t,p)g&&null==T.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),g&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(g&&null==T.getDerivedStateFromProps&&y!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,E),!(4&d.__g)&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,E)||t.__v==n.__v){for(t.__v!=n.__v&&(d.props=y,d.state=d.__s,d.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),_=0;_<d._sb.length;_++)d.__h.push(d._sb[_]);d._sb=[],d.__h.length&&i.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,E),g&&null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(h,v,m)})}if(d.context=E,d.props=y,d.__P=e,d.__g&=-5,b=k.__r,C=0,g){for(d.state=d.__s,d.__g&=-9,b&&b(t),f=d.render(d.props,d.state,d.context),A=0;A<d._sb.length;A++)d.__h.push(d._sb[A]);d._sb=[]}else do{d.__g&=-9,b&&b(t),f=d.render(d.props,d.state,d.context),d.state=d.__s}while(8&d.__g&&++C<25);d.state=d.__s,null!=d.getChildContext&&(r=Z({},r,d.getChildContext())),g&&!p&&null!=d.getSnapshotBeforeUpdate&&(m=d.getSnapshotBeforeUpdate(h,v)),w=f,null!=f&&f.type===H&&null==f.key&&(w=oe(f.props.children)),o=G(e,R(w)?w:[w],t,n,r,u,a,i,o,s,c,l),t.__u&=-161,d.__h.length&&i.push(d),D&&(d.__g&=-4)}catch(e){if(t.__v=null,s||null!=a)if(e.then){for(S=0,x=!1,t.__u|=s?160:128,t.__c.__z=[],O=0;O<a.length;O++)null==(B=a[O])||x||(8==B.nodeType&&"$s"==B.data?(S>0&&t.__c.__z.push(B),S++,a[O]=null):8==B.nodeType&&"/$s"==B.data?(--S>0&&t.__c.__z.push(B),x=0===S,o=a[O],a[O]=null):S>0&&(t.__c.__z.push(B),a[O]=null));if(!x){for(;o&&8==o.nodeType&&o.nextSibling;)o=o.nextSibling;a[a.indexOf(o)]=null,t.__c.__z=[o]}t.__e=o}else{for(I=a.length;I--;)L(a[I]);ae(t)}else t.__e=n.__e,t.__k=n.__k,e.then||ae(t);k.__e(e,t,n)}else o=t.__e=function(e,t,n,r,u,a,i,o,s,c){var l,f,d,p,h,v,m,D,y=n.props,g=t.props,F=t.type;if("svg"==F?u="http://www.w3.org/2000/svg":"math"==F?u="http://www.w3.org/1998/Math/MathML":u||(u="http://www.w3.org/1999/xhtml"),null!=a)for(l=0;l<a.length;l++)if((h=a[l])&&"setAttribute"in h==!!F&&(F?h.localName==F:3==h.nodeType)){e=h,a[l]=null;break}if(null==e){if(null==F)return c.createTextNode(g);e=c.createElementNS(u,F,g.is&&g),o&&(k.__m&&k.__m(t,a),o=!1),a=null}if(null==F)y===g||o&&e.data==g||(e.data=g);else{if(a=a&&M.call(e.childNodes),y=n.props||N,!o&&null!=a)for(y={},l=0;l<e.attributes.length;l++)y[(h=e.attributes[l]).name]=h.value;for(l in y)if(h=y[l],"children"==l);else if("dangerouslySetInnerHTML"==l)d=h;else if(!(l in g)){if("value"==l&&"defaultValue"in g||"checked"==l&&"defaultChecked"in g)continue;ne(e,l,null,h,u)}for(l in D=1&n.__u,g)h=g[l],"children"==l?p=h:"dangerouslySetInnerHTML"==l?f=h:"value"==l?v=h:"checked"==l?m=h:o&&"function"!=typeof h||y[l]===h&&!D||ne(e,l,h,y[l],u);if(f)o||d&&(f.__html==d.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(d&&(e.innerHTML=""),G("template"==F?e.content:e,R(p)?p:[p],t,n,r,"foreignObject"==F?"http://www.w3.org/1999/xhtml":u,a,i,a?a[0]:n.__k&&W(n,0),o,s,c),null!=a)for(l=a.length;l--;)L(a[l]);o||(l="value","progress"==F&&null==v?e.removeAttribute("value"):null==v||v===e[l]&&("progress"!==F||v)||ne(e,l,v,y[l],u),l="checked",null!=m&&m!=e[l]&&ne(e,l,m,y[l],u))}return e}(n.__e,t,n,r,u,a,i,s,c,l);return(f=k.diffed)&&f(t),128&t.__u?void 0:o}function ae(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(ae)}function ie(e,t,n){for(var r=0;r<n.length;r++)se(n[r],n[++r],n[++r]);k.__c&&k.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){k.__e(e,t.__v)}})}function oe(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:R(e)?e.map(oe):Z({},e)}function se(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){k.__e(e,n)}}function ce(e,t,n){var r,u;if(k.unmount&&k.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||se(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){k.__e(e,t)}r.__P=null}if(r=e.__k)for(u=0;u<r.length;u++)r[u]&&ce(r[u],t,n||"function"!=typeof e.type);n||L(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function le(e,t,n){return this.constructor(e,n)}function fe(e,t){var n,r,u,a;t==document&&(t=document.documentElement),k.__&&k.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=$(H,null,[e]),u=[],a=[],ue(t,e,r||N,N,t.namespaceURI,r?null:t.firstChild?M.call(t.childNodes):null,u,r?r.__e:t.firstChild,n,a,t.ownerDocument),ie(u,e,a)}function de(e,t,n){var r,u,a,i=Z({},e.props);for(a in t)"key"==a?r=t[a]:"ref"==a&&"function"!=typeof e.type?u=t[a]:i[a]=t[a];return arguments.length>2&&(i.children=arguments.length>3?M.call(arguments,2):n),q(e.type,i,r||e.key,u||e.ref,null)}k={__e:function(e,t,n,r){for(var u,a,i;t=t.__;)if((u=t.__c)&&!(1&u.__g)){u.__g|=4;try{if((a=u.constructor)&&null!=a.getDerivedStateFromError&&(u.setState(a.getDerivedStateFromError(e)),i=8&u.__g),null!=u.componentDidCatch&&(u.componentDidCatch(e,r||{}),i=8&u.__g),i)return void(u.__g|=2)}catch(t){e=t}}throw x=0,e}},A=0,V.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Z({},this.state),"function"==typeof e&&(e=e(Z({},n),this.props)),e&&Z(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),J(this))},V.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),J(this))},V.prototype.render=H,w=[],x=0,O=function(e,t){return e.__v.__b-t.__v.__b},B=/(PointerCapture)$|Capture$/i,I=0,T=re(!1),P=re(!0),j=0;var pe,he,ve,me,De=Object.is,ye=0,ge=[],Fe=k,Ee=Fe.__b,_e=Fe.__r,be=Fe.diffed,Ce=Fe.__c,ke=Fe.unmount,Ae=Fe.__;function we(e,t){Fe.__h&&Fe.__h(he,e,ye||t),ye=0;var n=he.__H||(he.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Se(e){return ye=1,xe(He,e)}function xe(e,t,n){var r=we(pe++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):He(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);De(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=he,!he.__f)){var u=function(e,t,n){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(e){return!!e.__c});if(u.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var i=r.__c.props!==e;return u.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,De(t,e.__[0])||(i=!0)}}),a&&a.call(this,e,t,n)||i};he.__f=!0;var a=he.shouldComponentUpdate,i=he.componentWillUpdate;he.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,u(e,t,n),a=r}i&&i.call(this,e,t,n)},he.shouldComponentUpdate=u}return r.__N||r.__}function Oe(e,t){var n=we(pe++,3);!Fe.__s&&Ue(n.__H,t)&&(n.__=e,n.u=t,he.__H.__h.push(n))}function Be(e,t){var n=we(pe++,4);!Fe.__s&&Ue(n.__H,t)&&(n.__=e,n.u=t,he.__h.push(n))}function Ie(e){return ye=5,Pe(function(){return{current:e}},[])}function Te(e,t,n){ye=6,Be(function(){if("function"==typeof e){var n=e(t());return function(){e(null),n&&"function"==typeof n&&n()}}if(e)return e.current=t(),function(){return e.current=null}},null==n?n:n.concat(e))}function Pe(e,t){var n=we(pe++,7);return Ue(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function je(e,t){return ye=8,Pe(function(){return e},t)}function Ne(e){var t=he.context[e.__c],n=we(pe++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(he)),t.props.value):e.__}function ze(e,t){Fe.useDebugValue&&Fe.useDebugValue(t?t(e):e)}function Re(){var e=we(pe++,11);if(!e.__){for(var t=he.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Me(){for(var e;e=ge.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach($e),e.__H.__h.forEach(qe),e.__H.__h=[]}catch(t){e.__H.__h=[],Fe.__e(t,e.__v)}}Fe.__b=function(e){he=null,Ee&&Ee(e)},Fe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ae&&Ae(e,t)},Fe.__r=function(e){_e&&_e(e),pe=0;var t=(he=e.__c).__H;t&&(ve===he?(t.__h=[],he.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach($e),t.__h.forEach(qe),t.__h=[],pe=0)),ve=he},Fe.diffed=function(e){be&&be(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ge.push(t)&&me===Fe.requestAnimationFrame||((me=Fe.requestAnimationFrame)||Le)(Me)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),ve=he=null},Fe.__c=function(e,t){t.some(function(e){try{e.__h.forEach($e),e.__h=e.__h.filter(function(e){return!e.__||qe(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],Fe.__e(n,e.__v)}}),Ce&&Ce(e,t)},Fe.unmount=function(e){ke&&ke(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{$e(e)}catch(e){t=e}}),n.__H=void 0,t&&Fe.__e(t,n.__v))};var Ze="function"==typeof requestAnimationFrame;function Le(e){var t,n=function(){clearTimeout(r),Ze&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ze&&(t=requestAnimationFrame(n))}function $e(e){var t=he,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),he=t}function qe(e){var t=he;e.__c=e.__(),he=t}function Ue(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!De(t,e[n])})}function He(e,t){return"function"==typeof t?t(e):t}function Ve(e,t){var n=t(),r=Se({t:{__:n,u:t}}),u=r[0].t,a=r[1];return Be(function(){u.__=n,u.u=t,We(u)&&a({t:u})},[e,n,t]),Oe(function(){return We(u)&&a({t:u}),e(function(){We(u)&&a({t:u})})},[e]),n}function We(e){var t=e.u,n=e.__;try{var r=t();return!Object.is(n,r)}catch(e){return!0}}function Ke(e){e()}function Je(e){return e}function Qe(){return[!1,Ke]}var Ge=Be,Ye=Object.assign;function Xe(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}var et=/^(-|f[lo].*[^se]$|g.{5,}[^ps]$|z|o[pr]|(W.{5})?[lL]i.*(t|mp)$|an|(bo|s).{4}Im|sca|m.{6}[ds]|ta|c.*[st]$|wido|ini)/;function tt(e,t){this.props=e,this.context=t}function nt(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:Xe(this.props,e)}function r(t){return this.shouldComponentUpdate=n,$(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.type=e,r}(tt.prototype=new V).isPureReactComponent=!0,tt.prototype.shouldComponentUpdate=function(e,t){return Xe(this.props,e)||Xe(this.state,t)};var rt=Symbol.for("react.forward_ref");var ut=function(e,t,n){return null==e?null:X(X(e).map(t.bind(n)))},at={map:ut,forEach:ut,count:function(e){return e?X(e).length:0},only:function(e){var t=X(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:X},it=k.__e;k.__e=function(e,t,n,r){if(e.then)for(var u,a=t;a=a.__;)if((u=a.__c)&&u.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),u.__c(e,t);it(e,t,n,r)};var ot=k.unmount;function st(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=Ye({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__g|=4,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return st(e,t,n)})),e}function ct(e,t,n){return e&&n&&("string"==typeof e.type&&(e.__u|=1),e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return ct(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__g|=4,e.__c.__P=n)),e}function lt(){this.__u=0,this.o=null,this.__b=null}function ft(e){return this.getChildContext=function(){return e.context},e.children}function dt(e){var t=this,n=e.i;if(t.componentWillUnmount=function(){fe(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),!t.l){for(var r=t.__v;null!==r&&!r.__m&&null!==r.__;)r=r.__;t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],__k:{__m:r.__m},ownerDocument:n.ownerDocument,insertBefore:function(e,n){this.childNodes.push(e),t.i.insertBefore(e,n)}}}fe($(ft,{context:t.context},e.__v),t.l)}function pt(e,t){var n=$(dt,{__v:e,i:t});return n.containerInfo=t,n}k.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),ot&&ot(e)},(lt.prototype=new V).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var u=!1,a=function(){u||(u=!0,n.__R=null,i())};n.__R=a;var i=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=ct(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},lt.prototype.componentWillUnmount=function(){this.o=[]},lt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=st(this.__b,n,r.__O=r.__P)}this.__b=null}return[$(H,null,t.__a?null:e.children),t.__a&&$(H,null,e.fallback)]};var ht=Symbol.for("react.element"),vt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,mt=/[A-Z0-9]/g,Dt="undefined"!=typeof document,yt=function(e){return/fil|che|rad/.test(e)};function gt(e,t,n){return null==t.__k&&(t.textContent=""),fe(e,t),"function"==typeof n&&n(),e?e.__c:null}V.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(V.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Ft=k.event;function Et(){}function _t(){return this.cancelBubble}function bt(){return this.defaultPrevented}k.event=function(e){return Ft&&(e=Ft(e)),e.persist=Et,e.isPropagationStopped=_t,e.isDefaultPrevented=bt,e.nativeEvent=e};var Ct,kt={enumerable:!1,configurable:!0,get:function(){return this.class}},At=k.vnode;k.vnode=function(e){if("string"==typeof e.type)!function(e){var t=e.props,n=e.type,r={},u=-1===n.indexOf("-");for(var a in t){var i=t[a];if(!("value"===a&&"defaultValue"in t&&null==i||Dt&&"children"===a&&"noscript"===n||"class"===a||"className"===a)){if("style"===a&&"object"==typeof i)for(var o in i)"number"!=typeof i[o]||et.test(o)||(i[o]+="px");else if("defaultValue"===a&&"value"in t&&null==t.value)a="value";else if("download"===a&&!0===i)i="";else if("translate"===a&&"no"===i)i=!1;else if("o"===a[0]&&"n"===a[1]){var s=a.toLowerCase();"ondoubleclick"===s?a="ondblclick":"onchange"!==s||"input"!==n&&"textarea"!==n||yt(t.type)?"onfocus"===s?a="onfocusin":"onblur"===s&&(a="onfocusout"):s=a="oninput","oninput"===s&&r[a=s]&&(a="oninputCapture")}else u&&vt.test(a)?a=a.replace(mt,"-$&").toLowerCase():null===i&&(i=void 0);r[a]=i}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=X(t.children).forEach(function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)})),"select"==n&&null!=r.defaultValue&&(r.value=X(t.children).forEach(function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value})),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",kt)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e);else if("function"==typeof e.type&&("ref"in e.props&&"prototype"in e.type&&e.type.prototype.render&&(e.ref=e.props.ref,delete e.props.ref),e.type.defaultProps)){var t=Ye({},e.props);for(var n in e.type.defaultProps)void 0===t[n]&&(t[n]=e.type.defaultProps[n]);e.props=t}e.$$typeof=ht,At&&At(e)};var wt=k.__r;k.__r=function(e){wt&&wt(e),Ct=e.__c};var St=k.diffed;k.diffed=function(e){St&&St(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),Ct=null};var xt={ReactCurrentDispatcher:{current:{readContext:function(e){return Ct.__n[e.__c].props.value},useCallback:je,useContext:Ne,useDebugValue:ze,useDeferredValue:Je,useEffect:Oe,useId:Re,useImperativeHandle:Te,useInsertionEffect:Ge,useLayoutEffect:Be,useMemo:Pe,useReducer:xe,useRef:Ie,useState:Se,useSyncExternalStore:Ve,useTransition:Qe}}};function Ot(e){return!!e&&e.$$typeof===ht}function Bt(e){return!!e.__k&&(fe(null,e),!0)}var It={useState:Se,useId:Re,useReducer:xe,useEffect:Oe,useLayoutEffect:Be,useInsertionEffect:Ge,useTransition:Qe,useDeferredValue:Je,useSyncExternalStore:Ve,startTransition:Ke,useRef:Ie,useImperativeHandle:Te,useMemo:Pe,useCallback:je,useContext:Ne,useDebugValue:ze,version:"18.3.1",Children:at,render:gt,hydrate:function(e,t,n){return function(e,t){e.__u|=32,fe(e,t)}(e,t),"function"==typeof n&&n(),e?e.__c:null},unmountComponentAtNode:Bt,createPortal:pt,createElement:$,createContext:function(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__g|=4,J(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+j++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t},createFactory:function(e){return $.bind(null,e)},cloneElement:function(e){return Ot(e)?de.apply(null,arguments):e},createRef:U,Fragment:H,isValidElement:Ot,isElement:Ot,isFragment:function(e){return Ot(e)&&e.type===H},isMemo:function(e){return!!e&&!!e.displayName&&("string"==typeof e.displayName||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")},findDOMNode:function(e){return e&&(e.__v&&e.__v.__e||1===e.nodeType&&e)||null},Component:V,PureComponent:tt,memo:nt,forwardRef:function(e){function t(t){var n=Ye({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=rt,t.render=e,t.prototype.isReactComponent=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},flushSync:function(e,t){return e(t)},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:H,Suspense:lt,lazy:function(e){var t,n,r;function u(u){if(t||(t=e()).then(function(e){n=e.default||e},function(e){r=e}),r)throw r;if(!n)throw t;return $(n,u)}return u.displayName="Lazy",u},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:xt};function Tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Pt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=_(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==_(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Nt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jt(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function zt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,a,i,o=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t);else for(;!(s=(r=a.call(n)).done)&&(o.push(r.value),o.length!==t);s=!0);}catch(e){c=!0,u=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw u}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Tt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Rt={"Ctrl/Cmd+K":!0,"/":!0,"Ctrl/Cmd+I":!0};function Mt(e){return Nt(Nt({},Rt),e)}function Zt(e){var t=e.isOpen,n=e.isAskAiActive,r=e.onAskAiToggle,u=e.onClose,a=e.onOpen,i=e.keyboardShortcuts,o=void 0===i?Rt:i;It.useEffect(function(){function e(e){var i;if(t&&"Escape"===e.code&&n)r(!1);else{var s=o["Ctrl/Cmd+K"]&&"k"===(null===(i=e.key)||void 0===i?void 0:i.toLowerCase())&&(e.metaKey||e.ctrlKey),c=o["/"]&&"/"===e.key;("Escape"===e.code&&t||s||!function(e){var t=e.composedPath()[0],n=t.tagName;return t.isContentEditable||"INPUT"===n||"SELECT"===n||"TEXTAREA"===n}(e)&&c&&!t)&&(e.preventDefault(),t?u():document.body.classList.contains("DocSearch--active")||a())}}return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}},[t,n,o,a,u,r])}var Lt=["children","theme","onReady","onOpen","onClose","onSidepanelOpen","onSidepanelClose"],$t=It.createContext(void 0);$t.displayName="DocSearchContext";var qt=It.forwardRef(function(e,t){var n=e.children,r=e.theme,u=e.onReady,a=e.onOpen,i=e.onClose,o=e.onSidepanelOpen,s=e.onSidepanelClose,c=function(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}(e,Lt),l=zt(It.useState("ready"),2),f=l[0],d=l[1],p=zt(It.useState(c.initialQuery||""),2),h=p[0],v=p[1],m=It.useRef(null),D=Mt(c.keyboardShortcuts),y=zt(It.useState(),2),g=y[0],F=y[1],E=zt(It.useState(function(){return new Set}),2),_=E[0],b=E[1],C=function(){var e=zt(It.useState(!1),2),t=e[0],n=e[1];return It.useEffect(function(){var e=function(){var e=window.matchMedia("(max-width: 768px)");n(e.matches)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[]),t}(),k=It.useRef("ready"),A=["modal-search","modal-askai"].includes(f),w="modal-askai"===f,S=!C&&_.has("sidepanel"),x="sidepanel"===f;It.useEffect(function(){null==u||u()},[u]),It.useEffect(function(){var e=k.current,t=f;"modal-search"!==t&&"modal-askai"!==t||"modal-search"===e||"modal-askai"===e||null==a||a(),"ready"!==t||"modal-search"!==e&&"modal-askai"!==e||null==i||i(),"sidepanel"===t&&"sidepanel"!==e&&(null==o||o()),"sidepanel"!==t&&"sidepanel"===e&&(null==s||s()),k.current=t},[f,a,i,o,s]);var O=It.useCallback(function(){d("modal-search")},[]),B=It.useCallback(function(){var e,t;d("ready"),null===(e=m.current)||void 0===e||e.focus(),v(null!==(t=c.initialQuery)&&void 0!==t?t:"")},[d,c.initialQuery]),I=It.useCallback(function(e,t){if(!C&&e&&S)return F(t),void d("sidepanel");d(e?"modal-askai":"modal-search")},[d,C,S]),T=It.useCallback(function(e){_.has("sidepanel")&&(F(e),d("sidepanel"))},[d,_]);It.useCallback(function(e){d("modal-search"),v(e.key)},[d,v]);var P=It.useCallback(function(e){_.has(e)||b(function(t){var n=new Set(t);return n.add(e),n})},[_]);It.useImperativeHandle(t,function(){return{open:O,close:B,openAskAi:function(e){return I(!0,e)},openSidepanel:T,get isReady(){return!0},get isOpen(){return A},get isSidepanelOpen(){return x},get isSidepanelSupported(){return S}}},[O,B,I,T,A,x,S]),function(e){var t=e.theme;Oe(function(){if(t){var e=document.documentElement.dataset.theme;if(t!==e)return document.documentElement.dataset.theme=t,function(){void 0===e?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=e}}},[t])}({theme:r}),Zt({isOpen:A,onOpen:O,onClose:B,onAskAiToggle:I,isAskAiActive:w,keyboardShortcuts:D});var j=It.useMemo(function(){return{docsearchState:f,setDocsearchState:d,searchButtonRef:m,initialQuery:h,keyboardShortcuts:D,openModal:O,closeModal:B,isAskAiActive:w,isModalActive:A,onAskAiToggle:I,initialAskAiMessage:g,registerView:P,isHybridModeSupported:S}},[f,m,h,D,O,B,w,A,I,g,P,S]);return It.createElement($t.Provider,{value:j},n)});qt.displayName="DocSearch";var Ut=["type"],Ht=["type"],Vt=["additionalProperties"],Wt=["abortSignal"],Kt=["messageId"],Jt=["messages"],Qt=["experimental_throttle","resume"];function Gt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Yt(e,t,n,r,u,a,i){try{var o=e[a](i),s=o.value}catch(e){return void n(e)}o.done?t(s):Promise.resolve(s).then(r,u)}function Xt(e){return function(){var t=this,n=arguments;return new Promise(function(r,u){var a=e.apply(t,n);function i(e){Yt(a,r,u,i,o,"next",e)}function o(e){Yt(a,r,u,i,o,"throw",e)}i(void 0)})}}function en(e,t,n){return t=cn(t),function(e,t){if(t&&("object"==_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,fn()?Reflect.construct(t,n||[],cn(e).constructor):t.apply(e,n))}function tn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nn(e,t,n){if(fn())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var u=new(e.bind.apply(e,r));return n&&Dn(u,n.prototype),u}function rn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Fn(r.key),r)}}function un(e,t,n){return t&&rn(e.prototype,t),n&&rn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function an(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_n(e))||t){n&&(e=n);var r=0,u=function(){};return{s:u,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:u}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){o=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(o)throw a}}}}function on(e,t,n){return(t=Fn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sn(){return sn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sn.apply(null,arguments)}function cn(e){return cn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cn(e)}function ln(e,t){if("function"!=typeof t&&null!==t)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&&Dn(e,t)}function fn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(fn=function(){return!!e})()}function dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dn(Object(n),!0).forEach(function(t){on(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function hn(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}function vn(){
5
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
6
- var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",u=n.toStringTag||"@@toStringTag";function a(n,r,u,a){var s=r&&r.prototype instanceof o?r:o,c=Object.create(s.prototype);return mn(c,"_invoke",function(n,r,u){var a,o,s,c=0,l=u||[],f=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,o=0,s=e,d.n=n,i}};function p(n,r){for(o=n,s=r,t=0;!f&&c&&!u&&t<l.length;t++){var u,a=l[t],p=d.p,h=a[2];n>3?(u=h===r)&&(s=a[(o=a[4])?5:(o=3,3)],a[4]=a[5]=e):a[0]<=p&&((u=n<2&&p<a[1])?(o=0,d.v=r,d.n=a[1]):p<h&&(u=n<3||a[0]>r||r>h)&&(a[4]=n,a[5]=r,d.n=h,o=0))}if(u||n>1)return i;throw f=!0,r}return function(u,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,h),o=l,s=h;(t=o<2?e:s)||!f;){a||(o?o<3?(o>1&&(d.n=-1),p(o,s)):d.n=s:d.v=s);try{if(c=2,a){if(o||(u="next"),t=a[u]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,o<2&&(o=0)}else 1===o&&(t=a.return)&&t.call(a),o<2&&(s=TypeError("The iterator does not provide a '"+u+"' method"),o=1);a=e}else if((t=(f=d.n<0)?s:n.call(r,d))!==i)break}catch(t){a=e,o=1,s=t}finally{c=1}}return{value:t,done:f}}}(n,u,a),!0),c}var i={};function o(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(mn(t={},r,function(){return this}),t),f=c.prototype=o.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,mn(e,u,"GeneratorFunction")),e.prototype=Object.create(f),e}return s.prototype=c,mn(f,"constructor",c),mn(c,"constructor",s),s.displayName="GeneratorFunction",mn(c,u,"GeneratorFunction"),mn(f),mn(f,u,"Generator"),mn(f,r,function(){return this}),mn(f,"toString",function(){return"[object Generator]"}),(vn=function(){return{w:a,m:d}})()}function mn(e,t,n,r){var u=Object.defineProperty;try{u({},"",{})}catch(e){u=0}mn=function(e,t,n,r){function a(t,n){mn(e,t,function(e){return this._invoke(t,n,e)})}t?u?u(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},mn(e,t,n,r)}function Dn(e,t){return Dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Dn(e,t)}function yn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,a,i,o=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(o.push(r.value),o.length!==t);s=!0);}catch(e){c=!0,u=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw u}}return o}}(e,t)||_n(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gn(e){return function(e){if(Array.isArray(e))return Gt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_n(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fn(e){var t=function(e,t){if("object"!=_(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==_(t)?t:t+""}function En(e){return En="function"==typeof Symbol&&"symbol"==_(Symbol.iterator)?function(e){return _(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_(e)},En(e)}function _n(e,t){if(e){if("string"==typeof e)return Gt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gt(e,t):void 0}}function bn(e){var t="function"==typeof Map?new Map:void 0;return bn=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return nn(e,arguments,cn(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Dn(n,e)},bn(e)}function Cn(){Cn=function(e,t){return new n(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function n(e,r,u){var a=RegExp(e,r);return t.set(a,u||t.get(e)),Dn(a,n.prototype)}function r(e,n){var r=t.get(n);return Object.keys(r).reduce(function(t,n){var u=r[n];if("number"==typeof u)t[n]=e[u];else{for(var a=0;void 0===e[u[a]]&&a+1<u.length;)a++;t[n]=e[u[a]]}return t},Object.create(null))}return ln(n,RegExp),n.prototype.exec=function(t){var n=e.exec.call(this,t);if(n){n.groups=r(n,this);var u=n.indices;u&&(u.groups=r(u,this))}return n},n.prototype[Symbol.replace]=function(n,u){if("string"==typeof u){var a=t.get(this);return e[Symbol.replace].call(this,n,u.replace(/\$<([^>]+)(>|$)/g,function(e,t,n){if(""===n)return e;var r=a[t];return Array.isArray(r)?"$"+r.join("$"):"number"==typeof r?"$"+r:""}))}if("function"==typeof u){var i=this;return e[Symbol.replace].call(this,n,function(){var e=arguments;return"object"!=_(e[e.length-1])&&(e=[].slice.call(e)).push(r(e,i)),u.apply(this,e)})}return e[Symbol.replace].call(this,n,u)},Cn.apply(this,arguments)}var kn=function(e){var t=e.theme;Oe(function(){if(t){var e=document.documentElement.dataset.theme;if(t!==e)return document.documentElement.dataset.theme=t,function(){void 0===e?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=e}}},[t])},An={"Ctrl/Cmd+K":!0,"/":!0};function wn(e){var t=e.size,n=void 0===t?20:t,r=e.color,u=void 0===r?"currentColor":r;return It.createElement("svg",{width:n,height:n,className:"DocSearch-Search-Icon",viewBox:"0 0 24 24","aria-hidden":"true"},It.createElement("circle",{cx:"11",cy:"11",r:"8",stroke:u,fill:"none",strokeWidth:"1.4"}),It.createElement("path",{d:"m21 21-4.3-4.3",stroke:u,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}))}function Sn(e,t,n){return e.reduce(function(e,r){var u=t(r);return e.hasOwnProperty(u)||(e[u]=[]),e[u].length<(n||5)&&e[u].push(r),e},{})}function xn(e){return e}function On(e){return 1===e.button||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}var Bn="Ctrl";function In(){}var Tn=/(<mark>|<\/mark>)/g,Pn=RegExp(Tn.source);function jn(e){var t,n,r=e;if(!r.__docsearch_parent&&!e._highlightResult)return e.hierarchy.lvl0;var u=r.__docsearch_parent?null===(t=r.__docsearch_parent)||void 0===t||null===(t=t._highlightResult)||void 0===t||null===(t=t.hierarchy)||void 0===t?void 0:t.lvl0:null===(n=e._highlightResult)||void 0===n||null===(n=n.hierarchy)||void 0===n?void 0:n.lvl0;return u?u.value&&Pn.test(u.value)?u.value.replace(Tn,""):u.value:e.hierarchy.lvl0}var Nn=["translations","keyboardShortcuts"],zn=It.forwardRef(function(e,t){var n=e.translations,r=void 0===n?{}:n,u=e.keyboardShortcuts,a=hn(e,Nn),i=r.buttonText,o=void 0===i?"Search":i,s=r.buttonAriaLabel,c=void 0===s?"Search":s,l=function(e){return pn(pn({},An),e)}(u),f=yn(Se(null),2),d=f[0],p=f[1];kn({theme:a.theme}),Oe(function(){"undefined"!=typeof navigator&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?p("⌘"):p(Bn))},[]);var h=yn(d===Bn?[Bn,"Control","Ctrl"]:["Meta","Meta","⌘"],3),v=h[0],m=h[1],D=h[2],y=l["Ctrl/Cmd+K"],g="".concat(m,"+k");return It.createElement("button",sn({type:"button",className:"DocSearch DocSearch-Button","aria-label":y?"".concat(c," (").concat(g,")"):c,"aria-keyshortcuts":y?g:void 0},a,{ref:t}),It.createElement("span",{className:"DocSearch-Button-Container"},It.createElement(wn,null),It.createElement("span",{className:"DocSearch-Button-Placeholder"},o)),It.createElement("span",{className:"DocSearch-Button-Keys"},null!==d&&y&&It.createElement(It.Fragment,null,It.createElement(Rn,{reactsToKey:v},D),It.createElement(Rn,{reactsToKey:"k"},"K"))))});function Rn(e){var t=e.reactsToKey,n=e.children,r=yn(Se(!1),2),u=r[0],a=r[1];return Oe(function(){if(t)return window.addEventListener("keydown",e),window.addEventListener("keyup",n),function(){window.removeEventListener("keydown",e),window.removeEventListener("keyup",n)};function e(e){e.key===t&&a(!0)}function n(e){e.key!==t&&"Meta"!==e.key||a(!1)}},[t]),It.createElement("kbd",{className:u?"DocSearch-Button-Key DocSearch-Button-Key--pressed":"DocSearch-Button-Key"+("Ctrl"===t?" DocSearch-Button-Key--ctrl":"")},n)}function Mn(e,t){var n=void 0;return function(){for(var r=arguments.length,u=new Array(r),a=0;a<r;a++)u[a]=arguments[a];n&&clearTimeout(n),n=setTimeout(function(){return e.apply(void 0,u)},t)}}function Zn(e){return e.reduce(function(e,t){return e.concat(t)},[])}var Ln=0;function $n(e){return 0===e.collections.length?0:e.collections.reduce(function(e,t){return e+t.items.length},0)}function qn(e){return e!==Object(e)}function Un(e,t){if(e===t)return!0;if(qn(e)||qn(t)||"function"==typeof e||"function"==typeof t)return e===t;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n=0,r=Object.keys(e);n<r.length;n++){var u=r[n];if(!(u in t))return!1;if(!Un(e[u],t[u]))return!1}return!0}var Hn=function(){},Vn=[{segment:"autocomplete-core",version:"1.19.2"}];function Wn(e){var t=e.item,n=e.items,r=void 0===n?[]:n;return{index:t.__autocomplete_indexName,items:[t],positions:[1+r.findIndex(function(e){return e.objectID===t.objectID})],queryID:t.__autocomplete_queryID,algoliaSource:["autocomplete"]}}function Kn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Jn=["items"],Qn=["items"];function Gn(e){return Gn="function"==typeof Symbol&&"symbol"==_(Symbol.iterator)?function(e){return _(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_(e)},Gn(e)}function Yn(e){return function(e){if(Array.isArray(e))return Xn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Xn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xn(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function er(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}function tr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tr(Object(n),!0).forEach(function(t){rr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rr(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Gn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==Gn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===Gn(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ur(e){return e.map(function(e){var t=e.items,n=er(e,Jn);return nr(nr({},n),{},{objectIDs:(null==t?void 0:t.map(function(e){return e.objectID}))||n.objectIDs})})}function ar(e){var t,n,r,u=(t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,a,i,o=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t);else for(;!(s=(r=a.call(n)).done)&&(o.push(r.value),o.length!==t);s=!0);}catch(e){c=!0,u=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw u}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Kn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Kn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((e.version||"").split(".").map(Number),2),n=t[0],r=t[1],n>=3||2===n&&r>=4||1===n&&r>=10);function a(t,n,r){if(u&&void 0!==r){var a=r[0].__autocomplete_algoliaCredentials,i={"X-Algolia-Application-Id":a.appId,"X-Algolia-API-Key":a.apiKey};e.apply(void 0,[t].concat(Yn(n),[{headers:i}]))}else e.apply(void 0,[t].concat(Yn(n)))}return{init:function(t,n){e("init",{appId:t,apiKey:n})},setAuthenticatedUserToken:function(t){e("setAuthenticatedUserToken",t)},setUserToken:function(t){e("setUserToken",t)},clickedObjectIDsAfterSearch:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length>0&&a("clickedObjectIDsAfterSearch",ur(t),t[0].items)},clickedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length>0&&a("clickedObjectIDs",ur(t),t[0].items)},clickedFilters:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.length>0&&e.apply(void 0,["clickedFilters"].concat(n))},convertedObjectIDsAfterSearch:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length>0&&a("convertedObjectIDsAfterSearch",ur(t),t[0].items)},convertedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length>0&&a("convertedObjectIDs",ur(t),t[0].items)},convertedFilters:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.length>0&&e.apply(void 0,["convertedFilters"].concat(n))},viewedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length>0&&t.reduce(function(e,t){var n=t.items,r=er(t,Qn);return[].concat(Yn(e),Yn(function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=[],r=0;r<e.objectIDs.length;r+=t)n.push(nr(nr({},e),{},{objectIDs:e.objectIDs.slice(r,r+t)}));return n}(nr(nr({},r),{},{objectIDs:(null==n?void 0:n.map(function(e){return e.objectID}))||r.objectIDs})).map(function(e){return{items:n,payload:e}})))},[]).forEach(function(e){var t=e.items;return a("viewedObjectIDs",[e.payload],t)})},viewedFilters:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.length>0&&e.apply(void 0,["viewedFilters"].concat(n))}}}function ir(e){var t=e.items.reduce(function(e,t){var n;return e[t.__autocomplete_indexName]=(null!==(n=e[t.__autocomplete_indexName])&&void 0!==n?n:[]).concat(t),e},{});return Object.keys(t).map(function(e){return{index:e,items:t[e],algoliaSource:["autocomplete"]}})}function or(e){return e.objectID&&e.__autocomplete_indexName&&e.__autocomplete_queryID}function sr(e){return sr="function"==typeof Symbol&&"symbol"==_(Symbol.iterator)?function(e){return _(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_(e)},sr(e)}function cr(e){return function(e){if(Array.isArray(e))return lr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return lr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lr(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fr(Object(n),!0).forEach(function(t){pr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pr(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==sr(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==sr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===sr(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var hr="2.15.0",vr="https://cdn.jsdelivr.net/npm/search-insights@".concat(hr,"/dist/search-insights.min.js"),mr=Mn(function(e){var t=e.onItemsChange,n=e.items,r=e.insights,u=e.state;t({insights:r,insightsEvents:ir({items:n}).map(function(e){return dr({eventName:"Items Viewed"},e)}),state:u})},400);function Dr(e){var t=function(e){return dr({onItemsChange:function(e){var t=e.insights,n=e.insightsEvents,r=e.state;t.viewedObjectIDs.apply(t,cr(n.map(function(e){return dr(dr({},e),{},{algoliaSource:yr(e.algoliaSource,r.context)})})))},onSelect:function(e){var t=e.insights,n=e.insightsEvents,r=e.state;t.clickedObjectIDsAfterSearch.apply(t,cr(n.map(function(e){return dr(dr({},e),{},{algoliaSource:yr(e.algoliaSource,r.context)})})))},onActive:Hn,__autocomplete_clickAnalytics:!0},e)}(e),n=t.insightsClient,r=t.insightsInitParams,u=t.onItemsChange,a=t.onSelect,i=t.onActive,o=t.__autocomplete_clickAnalytics,s=n;if(n||"undefined"!=typeof window&&function(e){var t=e.window,n=t.AlgoliaAnalyticsObject||"aa";"string"==typeof n&&(s=t[n]),s||(t.AlgoliaAnalyticsObject=n,t[n]||(t[n]=function(){t[n].queue||(t[n].queue=[]);for(var e=arguments.length,r=new Array(e),u=0;u<e;u++)r[u]=arguments[u];t[n].queue.push(r)}),t[n].version=hr,s=t[n],function(e){var t="[Autocomplete]: Could not load search-insights.js. Please load it manually following https://alg.li/insights-autocomplete";try{var n=e.document.createElement("script");n.async=!0,n.src=vr,n.onerror=function(){console.error(t)},document.body.appendChild(n)}catch(e){console.error(t)}}(t))}({window:window}),!s)return{};r&&s("init",dr({partial:!0},r));var c=ar(s),l={current:[]},f=Mn(function(e){var t=e.state;if(t.isOpen){var n=t.collections.reduce(function(e,t){return[].concat(cr(e),cr(t.items))},[]).filter(or);Un(l.current.map(function(e){return e.objectID}),n.map(function(e){return e.objectID}))||(l.current=n,n.length>0&&mr({onItemsChange:u,items:n,insights:c,state:t}))}},0);return{name:"aa.algoliaInsightsPlugin",subscribe:function(e){var t=e.setContext,n=e.onSelect,r=e.onActive;function u(e){t({algoliaInsightsPlugin:{__algoliaSearchParameters:dr(dr({},o?{clickAnalytics:!0}:{}),e?{userToken:gr(e)}:{}),insights:c}})}s("addAlgoliaAgent","insights-plugin"),u(),s("onUserTokenChange",function(e){u(e)}),s("getUserToken",null,function(e,t){u(t)}),n(function(e){var t=e.item,n=e.state,r=e.event,u=e.source;or(t)&&a({state:n,event:r,insights:c,item:t,insightsEvents:[dr({eventName:"Item Selected"},Wn({item:t,items:u.getItems().filter(or)}))]})}),r(function(e){var t=e.item,n=e.source,r=e.state,u=e.event;or(t)&&i({state:r,event:u,insights:c,item:t,insightsEvents:[dr({eventName:"Item Active"},Wn({item:t,items:n.getItems().filter(or)}))]})})},onStateChange:function(e){var t=e.state;f({state:t})},__autocomplete_pluginOptions:e}}function yr(){var e,t=arguments.length>1?arguments[1]:void 0;return[].concat(cr(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]),["autocomplete-internal"],cr(null!==(e=t.algoliaInsightsPlugin)&&void 0!==e&&e.__automaticInsights?["autocomplete-automatic"]:[]))}function gr(e){return"number"==typeof e?e.toString():e}function Fr(e,t){var n=t;return{then:function(t,r){return Fr(e.then(_r(t,n,e),_r(r,n,e)),n)},catch:function(t){return Fr(e.catch(_r(t,n,e)),n)},finally:function(t){return t&&n.onCancelList.push(t),Fr(e.finally(_r(t&&function(){return n.onCancelList=[],t()},n,e)),n)},cancel:function(){n.isCanceled=!0;var e=n.onCancelList;n.onCancelList=[],e.forEach(function(e){e()})},isCanceled:function(){return!0===n.isCanceled}}}function Er(e){return Fr(e,{isCanceled:!1,onCancelList:[]})}function _r(e,t,n){return e?function(n){return t.isCanceled?n:e(n)}:n}var br,Cr=!0;function kr(e,t,n,r){if(!n)return null;if(e<0&&(null===t||null!==r&&0===t))return n+e;var u=(null===t?-1:t)+e;return u<=-1||u>=n?null===r?null:0:u}function Ar(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ar(Object(n),!0).forEach(function(t){Sr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ar(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Sr(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==xr(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==xr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===xr(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xr(e){return xr="function"==typeof Symbol&&"symbol"==_(Symbol.iterator)?function(e){return _(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_(e)},xr(e)}function Or(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Br=function(e,t){var n,r=!1,u=[],a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Or(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Or(e,t):void 0}}(e))||t){n&&(e=n);var r=0,u=function(){};return{s:u,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:u}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){o=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(o)throw a}}}}(e);try{for(a.s();!(n=a.n()).done;){var i,o,s,c=null===(i=n.value.__autocomplete_pluginOptions)||void 0===i||null===(o=(s=i).awaitSubmit)||void 0===o?void 0:o.call(s);if("number"==typeof c)u.push(c);else if(!0===c){r=!0;break}}}catch(e){a.e(e)}finally{a.f()}return r?t.wait():u.length>0?t.wait(Math.max.apply(Math,u)):void 0};function Ir(e){var t=function(e){var t=e.collections.map(function(e){return e.items.length}).reduce(function(e,t,n){var r=(e[n-1]||0)+t;return e.push(r),e},[]).reduce(function(t,n){return n<=e.activeItemId?t+1:t},0);return e.collections[t]}(e);if(!t)return null;var n=t.items[function(e){for(var t=e.state,n=e.collection,r=!1,u=0,a=0;!1===r;){var i=t.collections[u];if(i===n){r=!0;break}a+=i.items.length,u++}return t.activeItemId-a}({state:e,collection:t})],r=t.source;return{item:n,itemInputValue:r.getItemInputValue({item:n,state:e}),itemUrl:r.getItemUrl({item:n,state:e}),source:r}}function Tr(e,t,n){return[e,null==n?void 0:n.sourceId,t].filter(Boolean).join("-").replace(/\s/g,"")}var Pr=/((gt|sm)-|galaxy nexus)|samsung[- ]|samsungbrowser/i;function jr(e){return e.nativeEvent||e}function Nr(e){return Nr="function"==typeof Symbol&&"symbol"==_(Symbol.iterator)?function(e){return _(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_(e)},Nr(e)}function zr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Rr(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Nr(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==Nr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===Nr(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mr(e){return Mr="function"==typeof Symbol&&"symbol"==_(Symbol.iterator)?function(e){return _(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_(e)},Mr(e)}function Zr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Lr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zr(Object(n),!0).forEach(function(t){$r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function $r(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Mr(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==Mr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===Mr(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qr(e){return qr="function"==typeof Symbol&&"symbol"==_(Symbol.iterator)?function(e){return _(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_(e)},qr(e)}function Ur(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Hr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Vr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hr(Object(n),!0).forEach(function(t){Wr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Wr(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==qr(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==qr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===qr(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kr(e,t){var n,r="undefined"!=typeof window?window:{},u=e.plugins||[];return Vr(Vr({debug:!1,openOnFocus:!1,enterKeyHint:void 0,ignoreCompositionEvents:!1,placeholder:"",autoFocus:!1,defaultActiveItemId:null,stallThreshold:300,insights:void 0,environment:r,shouldPanelOpen:function(e){return $n(e.state)>0},reshape:function(e){return e.sources}},e),{},{id:null!==(n=e.id)&&void 0!==n?n:"autocomplete-".concat(Ln++),plugins:u,initialState:Vr({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},e.initialState),onStateChange:function(t){var n;null===(n=e.onStateChange)||void 0===n||n.call(e,t),u.forEach(function(e){var n;return null===(n=e.onStateChange)||void 0===n?void 0:n.call(e,t)})},onSubmit:function(t){var n;null===(n=e.onSubmit)||void 0===n||n.call(e,t),u.forEach(function(e){var n;return null===(n=e.onSubmit)||void 0===n?void 0:n.call(e,t)})},onReset:function(t){var n;null===(n=e.onReset)||void 0===n||n.call(e,t),u.forEach(function(e){var n;return null===(n=e.onReset)||void 0===n?void 0:n.call(e,t)})},getSources:function(n){return Promise.all([].concat(function(e){return function(e){if(Array.isArray(e))return Ur(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Ur(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ur(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(u.map(function(e){return e.getSources})),[e.getSources]).filter(Boolean).map(function(e){return function(e,t){var n=[];return Promise.resolve(e(t)).then(function(e){return Promise.all(e.filter(function(e){return Boolean(e)}).map(function(e){if(e.sourceId,n.includes(e.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(e.sourceId)," is not unique."));n.push(e.sourceId);var t={getItemInputValue:function(e){return e.state.query},getItemUrl:function(){},onSelect:function(e){(0,e.setIsOpen)(!1)},onActive:Hn,onResolve:Hn};Object.keys(t).forEach(function(e){t[e].__default=!0});var r=wr(wr({},t),e);return Promise.resolve(r)}))})}(e,n)})).then(function(e){return Zn(e)}).then(function(e){return e.map(function(e){return Vr(Vr({},e),{},{onSelect:function(n){e.onSelect(n),t.forEach(function(e){var t;return null===(t=e.onSelect)||void 0===t?void 0:t.call(e,n)})},onActive:function(n){e.onActive(n),t.forEach(function(e){var t;return null===(t=e.onActive)||void 0===t?void 0:t.call(e,n)})},onResolve:function(n){e.onResolve(n),t.forEach(function(e){var t;return null===(t=e.onResolve)||void 0===t?void 0:t.call(e,n)})}})})})},navigator:Vr({navigate:function(e){var t=e.itemUrl;r.location.assign(t)},navigateNewTab:function(e){var t=e.itemUrl,n=r.open(t,"_blank","noopener");null==n||n.focus()},navigateNewWindow:function(e){var t=e.itemUrl;r.open(t,"_blank","noopener")}},e.navigator)})}function Jr(e){return Jr="function"==typeof Symbol&&"symbol"==_(Symbol.iterator)?function(e){return _(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_(e)},Jr(e)}function Qr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qr(Object(n),!0).forEach(function(t){Yr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Yr(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Jr(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==Jr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===Jr(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xr(e){return Xr="function"==typeof Symbol&&"symbol"==_(Symbol.iterator)?function(e){return _(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_(e)},Xr(e)}function eu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eu(Object(n),!0).forEach(function(t){nu(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nu(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Xr(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==Xr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===Xr(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ru(e){return function(e){if(Array.isArray(e))return uu(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return uu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uu(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function au(e){return Boolean(e.execute)}function iu(e){var t=e.reduce(function(e,t){if(!au(t))return e.push(t),e;var n=t.searchClient,r=t.execute,u=t.requesterId,a=t.requests,i=e.find(function(e){return au(t)&&au(e)&&e.searchClient===n&&Boolean(u)&&e.requesterId===u});if(i){var o;(o=i.items).push.apply(o,ru(a))}else{var s={execute:r,requesterId:u,items:a,searchClient:n};e.push(s)}return e},[]).map(function(e){if(!au(e))return Promise.resolve(e);var t=e,n=t.execute,r=t.items;return n({searchClient:t.searchClient,requests:r})});return Promise.all(t).then(function(e){return Zn(e)})}function ou(e){return ou="function"==typeof Symbol&&"symbol"==_(Symbol.iterator)?function(e){return _(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_(e)},ou(e)}var su=["event","nextState","props","query","refresh","store"];function cu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cu(Object(n),!0).forEach(function(t){fu(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fu(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==ou(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==ou(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===ou(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var du,pu,hu,vu=null,mu=(du=-1,pu=-1,hu=void 0,function(e){var t=++du;return Promise.resolve(e).then(function(e){return hu&&t<pu?hu:(pu=t,hu=e,e)})});function Du(e){var t=e.event,n=e.nextState,r=void 0===n?{}:n,u=e.props,a=e.query,i=e.refresh,o=e.store,s=function(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}(e,su);vu&&u.environment.clearTimeout(vu);var c=s.setCollections,l=s.setIsOpen,f=s.setQuery,d=s.setActiveItemId,p=s.setStatus,h=s.setContext;if(f(a),d(u.defaultActiveItemId),!a&&!1===u.openOnFocus){var v,m=o.getState().collections.map(function(e){return lu(lu({},e),{},{items:[]})});p("idle"),c(m),l(null!==(v=r.isOpen)&&void 0!==v?v:u.shouldPanelOpen({state:o.getState()}));var D=Er(mu(m).then(function(){return Promise.resolve()}));return o.pendingRequests.add(D)}p("loading"),vu=u.environment.setTimeout(function(){p("stalled")},u.stallThreshold);var y=Er(mu(u.getSources(lu({query:a,refresh:i,state:o.getState()},s)).then(function(e){return Promise.all(e.map(function(e){return Promise.resolve(e.getItems(lu({query:a,refresh:i,state:o.getState()},s))).then(function(t){return function(e,t,n){if(u=e,Boolean(null==u?void 0:u.execute)){var r="algolia"===e.requesterId?Object.assign.apply(Object,[{}].concat(ru(Object.keys(n.context).map(function(e){var t;return null===(t=n.context[e])||void 0===t?void 0:t.__algoliaSearchParameters})))):{};return tu(tu({},e),{},{requests:e.queries.map(function(n){return{query:"algolia"===e.requesterId?tu(tu({},n),{},{params:tu(tu({},r),n.params)}):n,sourceId:t,transformResponse:e.transformResponse}})})}var u;return{items:e,sourceId:t}}(t,e.sourceId,o.getState())})})).then(iu).then(function(t){var n,r=t.some(function(e){return function(e){return!Array.isArray(e)&&Boolean(null==e?void 0:e._automaticInsights)}(e.items)});return r&&h({algoliaInsightsPlugin:lu(lu({},(null===(n=o.getState().context)||void 0===n?void 0:n.algoliaInsightsPlugin)||{}),{},{__automaticInsights:r})}),function(e,t,n){return t.map(function(t){var r,u=e.filter(function(e){return e.sourceId===t.sourceId}),a=u.map(function(e){return e.items}),i=u[0].transformResponse,o=i?i({results:r=a,hits:r.map(function(e){return e.hits}).filter(Boolean),facetHits:r.map(function(e){var t;return null===(t=e.facetHits)||void 0===t?void 0:t.map(function(e){return{label:e.value,count:e.count,_highlightResult:{label:{value:e.highlighted}}}})}).filter(Boolean)}):a;return t.onResolve({source:t,results:a,items:o,state:n.getState()}),o.every(Boolean),'The `getItems` function from source "'.concat(t.sourceId,'" must return an array of items but returned ').concat(JSON.stringify(void 0),".\n\nDid you forget to return items?\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems"),{source:t,items:o}})}(t,e,o)}).then(function(e){return function(e){var t=e.props,n=e.state,r=e.collections.reduce(function(e,t){return Gr(Gr({},e),{},Yr({},t.source.sourceId,Gr(Gr({},t.source),{},{getItems:function(){return Zn(t.items)}})))},{}),u=t.plugins.reduce(function(e,t){return t.reshape?t.reshape(e):e},{sourcesBySourceId:r,state:n}).sourcesBySourceId;return Zn(t.reshape({sourcesBySourceId:u,sources:Object.values(u),state:n})).filter(Boolean).map(function(e){return{source:e,items:e.getItems()}})}({collections:e,props:u,state:o.getState()})})}))).then(function(e){var n;p("idle"),c(e);var f=u.shouldPanelOpen({state:o.getState()});l(null!==(n=r.isOpen)&&void 0!==n?n:u.openOnFocus&&!a&&f||f);var d=Ir(o.getState());if(null!==o.getState().activeItemId&&d){var h=d.item,v=d.itemInputValue,m=d.itemUrl,D=d.source;D.onActive(lu({event:t,item:h,itemInputValue:v,itemUrl:m,refresh:i,source:D,state:o.getState()},s))}}).finally(function(){p("idle"),vu&&u.environment.clearTimeout(vu)});return o.pendingRequests.add(y)}function yu(e){return yu="function"==typeof Symbol&&"symbol"==_(Symbol.iterator)?function(e){return _(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_(e)},yu(e)}var gu=["event","props","refresh","store"];function Fu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Eu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fu(Object(n),!0).forEach(function(t){_u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _u(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==yu(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==yu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===yu(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bu(e){return bu="function"==typeof Symbol&&"symbol"==_(Symbol.iterator)?function(e){return _(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_(e)},bu(e)}var Cu=["props","refresh","store"],ku=["inputElement","formElement","panelElement"],Au=["inputElement"],wu=["inputElement","maxLength"],Su=["source"],xu=["item","source"];function Ou(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Bu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ou(Object(n),!0).forEach(function(t){Iu(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ou(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Iu(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==bu(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==bu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===bu(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tu(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}function Pu(e){var t=e.props,n=e.refresh,r=e.store,u=Tu(e,Cu);return{getEnvironmentProps:function(e){var n=e.inputElement,u=e.formElement,a=e.panelElement;function i(e){!r.getState().isOpen&&r.pendingRequests.isEmpty()||e.target===n||!1===[u,a].some(function(t){return(n=t)===(r=e.target)||n.contains(r);var n,r})&&(r.dispatch("blur",null),t.debug||r.pendingRequests.cancelAll())}return Bu({onTouchStart:i,onMouseDown:i,onTouchMove:function(e){!1!==r.getState().isOpen&&n===t.environment.document.activeElement&&e.target!==n&&n.blur()}},Tu(e,ku))},getRootProps:function(e){return Bu({role:"combobox","aria-expanded":r.getState().isOpen,"aria-haspopup":"listbox","aria-controls":r.getState().isOpen?r.getState().collections.map(function(e){var n=e.source;return Tr(t.id,"list",n)}).join(" "):void 0,"aria-labelledby":Tr(t.id,"label")},e)},getFormProps:function(e){e.inputElement;var a=Tu(e,Au),i=function(a){var i;t.onSubmit(Bu({event:a,refresh:n,state:r.getState()},u)),r.dispatch("submit",null),null===(i=e.inputElement)||void 0===i||i.blur()};return Bu({action:"",noValidate:!0,role:"search",onSubmit:function(e){e.preventDefault();var n=Br(t.plugins,r.pendingRequests);void 0!==n?n.then(function(){return i(e)}):i(e)},onReset:function(a){var i;a.preventDefault(),t.onReset(Bu({event:a,refresh:n,state:r.getState()},u)),r.dispatch("reset",null),null===(i=e.inputElement)||void 0===i||i.focus()}},a)},getLabelProps:function(e){return Bu({htmlFor:Tr(t.id,"input"),id:Tr(t.id,"label")},e)},getInputProps:function(e){var a;function i(e){(t.openOnFocus||Boolean(r.getState().query))&&Du(Bu({event:e,props:t,query:r.getState().completion||r.getState().query,refresh:n,store:r},u)),r.dispatch("focus",null)}var o=e||{};o.inputElement;var s=o.maxLength,c=void 0===s?512:s,l=Tu(o,wu),f=Ir(r.getState()),d=function(e){return Boolean(e&&e.match(Pr))}((null===(a=t.environment.navigator)||void 0===a?void 0:a.userAgent)||""),p=t.enterKeyHint||(null!=f&&f.itemUrl&&!d?"go":"search");return Bu({"aria-autocomplete":"both","aria-activedescendant":r.getState().isOpen&&null!==r.getState().activeItemId?Tr(t.id,"item-".concat(r.getState().activeItemId),null==f?void 0:f.source):void 0,"aria-controls":r.getState().isOpen?r.getState().collections.filter(function(e){return e.items.length>0}).map(function(e){var n=e.source;return Tr(t.id,"list",n)}).join(" "):void 0,"aria-labelledby":Tr(t.id,"label"),value:r.getState().completion||r.getState().query,id:Tr(t.id,"input"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",enterKeyHint:p,spellCheck:"false",autoFocus:t.autoFocus,placeholder:t.placeholder,maxLength:c,type:"search",onChange:function(e){var a=e.currentTarget.value;t.ignoreCompositionEvents&&jr(e).isComposing?u.setQuery(a):Du(Bu({event:e,props:t,query:a.slice(0,c),refresh:n,store:r},u))},onCompositionEnd:function(e){Du(Bu({event:e,props:t,query:e.currentTarget.value.slice(0,c),refresh:n,store:r},u))},onKeyDown:function(e){jr(e).isComposing||function(e){var t=e.event,n=e.props,r=e.refresh,u=e.store,a=function(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}(e,gu);if("ArrowUp"===t.key||"ArrowDown"===t.key){var i=function(){var e=Ir(u.getState()),t=n.environment.document.getElementById(Tr(n.id,"item-".concat(u.getState().activeItemId),null==e?void 0:e.source));t&&(t.scrollIntoViewIfNeeded?t.scrollIntoViewIfNeeded(!1):t.scrollIntoView(!1))},o=function(){var e=Ir(u.getState());if(null!==u.getState().activeItemId&&e){var n=e.item,i=e.itemInputValue,o=e.itemUrl,s=e.source;s.onActive(Eu({event:t,item:n,itemInputValue:i,itemUrl:o,refresh:r,source:s,state:u.getState()},a))}};t.preventDefault(),!1===u.getState().isOpen&&(n.openOnFocus||Boolean(u.getState().query))?Du(Eu({event:t,props:n,query:u.getState().query,refresh:r,store:u},a)).then(function(){u.dispatch(t.key,{nextActiveItemId:n.defaultActiveItemId}),o(),setTimeout(i,0)}):(u.dispatch(t.key,{}),o(),i())}else if("Escape"===t.key)t.preventDefault(),u.dispatch(t.key,null),u.pendingRequests.cancelAll();else if("Tab"===t.key)u.dispatch("blur",null),u.pendingRequests.cancelAll();else if("Enter"===t.key){if(null===u.getState().activeItemId||u.getState().collections.every(function(e){return 0===e.items.length})){var s=Br(n.plugins,u.pendingRequests);return void(void 0!==s?s.then(u.pendingRequests.cancelAll):n.debug||u.pendingRequests.cancelAll())}t.preventDefault();var c=Ir(u.getState()),l=c.item,f=c.itemInputValue,d=c.itemUrl,p=c.source;if(t.metaKey||t.ctrlKey)void 0!==d&&(p.onSelect(Eu({event:t,item:l,itemInputValue:f,itemUrl:d,refresh:r,source:p,state:u.getState()},a)),n.navigator.navigateNewTab({itemUrl:d,item:l,state:u.getState()}));else if(t.shiftKey)void 0!==d&&(p.onSelect(Eu({event:t,item:l,itemInputValue:f,itemUrl:d,refresh:r,source:p,state:u.getState()},a)),n.navigator.navigateNewWindow({itemUrl:d,item:l,state:u.getState()}));else if(t.altKey);else{if(void 0!==d)return p.onSelect(Eu({event:t,item:l,itemInputValue:f,itemUrl:d,refresh:r,source:p,state:u.getState()},a)),void n.navigator.navigate({itemUrl:d,item:l,state:u.getState()});Du(Eu({event:t,nextState:{isOpen:!1},props:n,query:f,refresh:r,store:u},a)).then(function(){p.onSelect(Eu({event:t,item:l,itemInputValue:f,itemUrl:d,refresh:r,source:p,state:u.getState()},a))})}}}(Bu({event:e,props:t,refresh:n,store:r},u))},onFocus:i,onBlur:Hn,onClick:function(n){e.inputElement!==t.environment.document.activeElement||r.getState().isOpen||i(n)}},l)},getPanelProps:function(e){return Bu({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){r.dispatch("mouseleave",null)}},e)},getListProps:function(e){var n=e||{},r=n.source,u=Tu(n,Su);return Bu({role:"listbox","aria-labelledby":Tr(t.id,"label"),id:Tr(t.id,"list",r)},u)},getItemProps:function(e){var a=e.item,i=e.source,o=Tu(e,xu);return Bu({id:Tr(t.id,"item-".concat(a.__autocomplete_id),i),role:"option","aria-selected":r.getState().activeItemId===a.__autocomplete_id,onMouseMove:function(e){if(a.__autocomplete_id!==r.getState().activeItemId){r.dispatch("mousemove",a.__autocomplete_id);var t=Ir(r.getState());if(null!==r.getState().activeItemId&&t){var i=t.item,o=t.itemInputValue,s=t.itemUrl,c=t.source;c.onActive(Bu({event:e,item:i,itemInputValue:o,itemUrl:s,refresh:n,source:c,state:r.getState()},u))}}},onMouseDown:function(e){e.preventDefault()},onClick:function(e){var o=i.getItemInputValue({item:a,state:r.getState()}),s=i.getItemUrl({item:a,state:r.getState()});(s?Promise.resolve():Du(Bu({event:e,nextState:{isOpen:!1},props:t,query:o,refresh:n,store:r},u))).then(function(){i.onSelect(Bu({event:e,item:a,itemInputValue:o,itemUrl:s,refresh:n,source:i,state:r.getState()},u))})}},o)}}}function ju(e){return ju="function"==typeof Symbol&&"symbol"==_(Symbol.iterator)?function(e){return _(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_(e)},ju(e)}function Nu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function zu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nu(Object(n),!0).forEach(function(t){Ru(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ru(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==ju(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==ju(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===ju(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mu(e){var t,n,r,u,a=e.plugins,i=e.options,o=null===(t=((null===(n=i.__autocomplete_metadata)||void 0===n?void 0:n.userAgents)||[])[0])||void 0===t?void 0:t.segment,s=o?Ru({},o,Object.keys((null===(r=i.__autocomplete_metadata)||void 0===r?void 0:r.options)||{})):{};return{plugins:a.map(function(e){return{name:e.name,options:Object.keys(e.__autocomplete_pluginOptions||[])}}),options:zu({"autocomplete-core":Object.keys(i)},s),ua:Vn.concat((null===(u=i.__autocomplete_metadata)||void 0===u?void 0:u.userAgents)||[])}}function Zu(e){var t,n=e.state;return!1===n.isOpen||null===n.activeItemId?null:(null===(t=Ir(n))||void 0===t?void 0:t.itemInputValue)||null}function Lu(e){return Lu="function"==typeof Symbol&&"symbol"==_(Symbol.iterator)?function(e){return _(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_(e)},Lu(e)}function $u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$u(Object(n),!0).forEach(function(t){Uu(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Uu(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Lu(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==Lu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===Lu(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Hu=function(e,t){switch(t.type){case"setActiveItemId":case"mousemove":return qu(qu({},e),{},{activeItemId:t.payload});case"setQuery":return qu(qu({},e),{},{query:t.payload,completion:null});case"setCollections":return qu(qu({},e),{},{collections:t.payload});case"setIsOpen":return qu(qu({},e),{},{isOpen:t.payload});case"setStatus":return qu(qu({},e),{},{status:t.payload});case"setContext":return qu(qu({},e),{},{context:qu(qu({},e.context),t.payload)});case"ArrowDown":var n=qu(qu({},e),{},{activeItemId:t.payload.hasOwnProperty("nextActiveItemId")?t.payload.nextActiveItemId:kr(1,e.activeItemId,$n(e),t.props.defaultActiveItemId)});return qu(qu({},n),{},{completion:Zu({state:n})});case"ArrowUp":var r=qu(qu({},e),{},{activeItemId:kr(-1,e.activeItemId,$n(e),t.props.defaultActiveItemId)});return qu(qu({},r),{},{completion:Zu({state:r})});case"Escape":return e.isOpen?qu(qu({},e),{},{activeItemId:null,isOpen:!1,completion:null}):qu(qu({},e),{},{activeItemId:null,query:"",status:"idle",collections:[]});case"submit":return qu(qu({},e),{},{activeItemId:null,isOpen:!1,status:"idle"});case"reset":return qu(qu({},e),{},{activeItemId:!0===t.props.openOnFocus?t.props.defaultActiveItemId:null,status:"idle",completion:null,query:""});case"focus":return qu(qu({},e),{},{activeItemId:t.props.defaultActiveItemId,isOpen:(t.props.openOnFocus||Boolean(e.query))&&t.props.shouldPanelOpen({state:e})});case"blur":return t.props.debug?e:qu(qu({},e),{},{isOpen:!1,activeItemId:null});case"mouseleave":return qu(qu({},e),{},{activeItemId:t.props.defaultActiveItemId});default:return"The reducer action ".concat(JSON.stringify(t.type)," is not supported."),e}};function Vu(e){return Vu="function"==typeof Symbol&&"symbol"==_(Symbol.iterator)?function(e){return _(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_(e)},Vu(e)}function Wu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ku(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wu(Object(n),!0).forEach(function(t){Ju(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ju(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Vu(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==Vu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===Vu(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qu(e){var t=[],n=Kr(e,t),r=function(e,t,n){var r,u=t.initialState;return{getState:function(){return u},dispatch:function(r,a){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zr(Object(n),!0).forEach(function(t){Rr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},u);u=e(u,{type:r,props:t,payload:a}),n({state:u,prevState:i})},pendingRequests:(r=[],{add:function(e){return r.push(e),e.finally(function(){r=r.filter(function(t){return t!==e})})},cancelAll:function(){r.forEach(function(e){return e.cancel()})},isEmpty:function(){return 0===r.length},wait:function(e){return Cr?(Cr=!1,br=e?Promise.race([Promise.all(r),new Promise(function(t){return setTimeout(t,e)})]):Promise.all(r),br.then(function(){Cr=!0})):br}})}}(Hu,n,function(e){var t,r,a=e.prevState,c=e.state;if(n.onStateChange(Ku({prevState:a,state:c,refresh:i,navigator:n.navigator},u)),!s()&&null!==(t=c.context)&&void 0!==t&&null!==(r=t.algoliaInsightsPlugin)&&void 0!==r&&r.__automaticInsights&&!1!==n.insights){var l=Dr({__autocomplete_clickAnalytics:!1});n.plugins.push(l),o([l])}}),u=function(e){var t=e.store;return{setActiveItemId:function(e){t.dispatch("setActiveItemId",e)},setQuery:function(e){t.dispatch("setQuery",e)},setCollections:function(e){var n=0,r=e.map(function(e){return Lr(Lr({},e),{},{items:Zn(e.items).map(function(e){return Lr(Lr({},e),{},{__autocomplete_id:n++})})})});t.dispatch("setCollections",r)},setIsOpen:function(e){t.dispatch("setIsOpen",e)},setStatus:function(e){t.dispatch("setStatus",e)},setContext:function(e){t.dispatch("setContext",e)}}}({store:r}),a=Pu(Ku({props:n,refresh:i,store:r,navigator:n.navigator},u));function i(){return Du(Ku({event:new Event("input"),nextState:{isOpen:r.getState().isOpen},props:n,navigator:n.navigator,query:r.getState().query,refresh:i,store:r},u))}function o(e){e.forEach(function(e){var r;return null===(r=e.subscribe)||void 0===r?void 0:r.call(e,Ku(Ku({},u),{},{navigator:n.navigator,refresh:i,onSelect:function(e){t.push({onSelect:e})},onActive:function(e){t.push({onActive:e})},onResolve:function(e){t.push({onResolve:e})}}))})}function s(){return n.plugins.some(function(e){return"aa.algoliaInsightsPlugin"===e.name})}if(n.insights&&!s()){var c="boolean"==typeof n.insights?{}:n.insights;n.plugins.push(Dr(c))}return o(n.plugins),function(e){var t,n,r=e.metadata,u=e.environment;if(null===(t=u.navigator)||void 0===t||null===(n=t.userAgent)||void 0===n?void 0:n.includes("Algolia Crawler")){var a=u.document.createElement("meta"),i=u.document.querySelector("head");a.name="algolia:metadata",setTimeout(function(){a.content=JSON.stringify(r),i.appendChild(a)},0)}}({metadata:Mu({plugins:n.plugins,options:e}),environment:n.environment}),Ku(Ku({refresh:i,navigator:n.navigator},a),u)}var Gu="https://askai.algolia.com/chat",Yu="https://beta-chat-askai.algolia.com";function Xu(e){var t=e.translations,n=(void 0===t?{}:t).poweredByText,r=void 0===n?"Powered by":n;return It.createElement("a",{href:"https://www.algolia.com/ref/docsearch/?utm_source=".concat(window.location.hostname,"&utm_medium=referral&utm_content=powered_by&utm_campaign=docsearch"),target:"_blank",rel:"noopener noreferrer"},It.createElement("span",{className:"DocSearch-Label"},r),It.createElement("svg",{width:"80",height:"24","aria-label":"Algolia",role:"img",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2196.2 500"},It.createElement("defs",null,It.createElement("style",null,".cls-1,.cls-2{fill:#003dff;}.cls-2{fill-rule:evenodd;}")),It.createElement("path",{className:"cls-2",d:"M1070.38,275.3V5.91c0-3.63-3.24-6.39-6.82-5.83l-50.46,7.94c-2.87,.45-4.99,2.93-4.99,5.84l.17,273.22c0,12.92,0,92.7,95.97,95.49,3.33,.1,6.09-2.58,6.09-5.91v-40.78c0-2.96-2.19-5.51-5.12-5.84-34.85-4.01-34.85-47.57-34.85-54.72Z"}),It.createElement("rect",{className:"cls-1",x:"1845.88",y:"104.73",width:"62.58",height:"277.9",rx:"5.9",ry:"5.9"}),It.createElement("path",{className:"cls-2",d:"M1851.78,71.38h50.77c3.26,0,5.9-2.64,5.9-5.9V5.9c0-3.62-3.24-6.39-6.82-5.83l-50.77,7.95c-2.87,.45-4.99,2.92-4.99,5.83v51.62c0,3.26,2.64,5.9,5.9,5.9Z"}),It.createElement("path",{className:"cls-2",d:"M1764.03,275.3V5.91c0-3.63-3.24-6.39-6.82-5.83l-50.46,7.94c-2.87,.45-4.99,2.93-4.99,5.84l.17,273.22c0,12.92,0,92.7,95.97,95.49,3.33,.1,6.09-2.58,6.09-5.91v-40.78c0-2.96-2.19-5.51-5.12-5.84-34.85-4.01-34.85-47.57-34.85-54.72Z"}),It.createElement("path",{className:"cls-2",d:"M1631.95,142.72c-11.14-12.25-24.83-21.65-40.78-28.31-15.92-6.53-33.26-9.85-52.07-9.85-18.78,0-36.15,3.17-51.92,9.85-15.59,6.66-29.29,16.05-40.76,28.31-11.47,12.23-20.38,26.87-26.76,44.03-6.38,17.17-9.24,37.37-9.24,58.36,0,20.99,3.19,36.87,9.55,54.21,6.38,17.32,15.14,32.11,26.45,44.36,11.29,12.23,24.83,21.62,40.6,28.46,15.77,6.83,40.12,10.33,52.4,10.48,12.25,0,36.78-3.82,52.7-10.48,15.92-6.68,29.46-16.23,40.78-28.46,11.29-12.25,20.05-27.04,26.25-44.36,6.22-17.34,9.24-33.22,9.24-54.21,0-20.99-3.34-41.19-10.03-58.36-6.38-17.17-15.14-31.8-26.43-44.03Zm-44.43,163.75c-11.47,15.75-27.56,23.7-48.09,23.7-20.55,0-36.63-7.8-48.1-23.7-11.47-15.75-17.21-34.01-17.21-61.2,0-26.89,5.59-49.14,17.06-64.87,11.45-15.75,27.54-23.52,48.07-23.52,20.55,0,36.63,7.78,48.09,23.52,11.47,15.57,17.36,37.98,17.36,64.87,0,27.19-5.72,45.3-17.19,61.2Z"}),It.createElement("path",{className:"cls-2",d:"M894.42,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-14.52,22.58-22.99,49.63-22.99,78.73,0,44.89,20.13,84.92,51.59,111.1,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47,1.23,0,2.46-.03,3.68-.09,.36-.02,.71-.05,1.07-.07,.87-.05,1.75-.11,2.62-.2,.34-.03,.68-.08,1.02-.12,.91-.1,1.82-.21,2.73-.34,.21-.03,.42-.07,.63-.1,32.89-5.07,61.56-30.82,70.9-62.81v57.83c0,3.26,2.64,5.9,5.9,5.9h50.42c3.26,0,5.9-2.64,5.9-5.9V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,206.92c-12.2,10.16-27.97,13.98-44.84,15.12-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-42.24,0-77.12-35.89-77.12-79.37,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33v142.83Z"}),It.createElement("path",{className:"cls-2",d:"M2133.97,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-14.52,22.58-22.99,49.63-22.99,78.73,0,44.89,20.13,84.92,51.59,111.1,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47,1.23,0,2.46-.03,3.68-.09,.36-.02,.71-.05,1.07-.07,.87-.05,1.75-.11,2.62-.2,.34-.03,.68-.08,1.02-.12,.91-.1,1.82-.21,2.73-.34,.21-.03,.42-.07,.63-.1,32.89-5.07,61.56-30.82,70.9-62.81v57.83c0,3.26,2.64,5.9,5.9,5.9h50.42c3.26,0,5.9-2.64,5.9-5.9V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,206.92c-12.2,10.16-27.97,13.98-44.84,15.12-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-42.24,0-77.12-35.89-77.12-79.37,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33v142.83Z"}),It.createElement("path",{className:"cls-2",d:"M1314.05,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-11.79,18.34-19.6,39.64-22.11,62.59-.58,5.3-.88,10.68-.88,16.14s.31,11.15,.93,16.59c4.28,38.09,23.14,71.61,50.66,94.52,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47h0c17.99,0,34.61-5.93,48.16-15.97,16.29-11.58,28.88-28.54,34.48-47.75v50.26h-.11v11.08c0,21.84-5.71,38.27-17.34,49.36-11.61,11.08-31.04,16.63-58.25,16.63-11.12,0-28.79-.59-46.6-2.41-2.83-.29-5.46,1.5-6.27,4.22l-12.78,43.11c-1.02,3.46,1.27,7.02,4.83,7.53,21.52,3.08,42.52,4.68,54.65,4.68,48.91,0,85.16-10.75,108.89-32.21,21.48-19.41,33.15-48.89,35.2-88.52V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,64.1s.65,139.13,0,143.36c-12.08,9.77-27.11,13.59-43.49,14.7-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-1.32,0-2.63-.03-3.94-.1-40.41-2.11-74.52-37.26-74.52-79.38,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33Z"}),It.createElement("path",{className:"cls-1",d:"M249.83,0C113.3,0,2,110.09,.03,246.16c-2,138.19,110.12,252.7,248.33,253.5,42.68,.25,83.79-10.19,120.3-30.03,3.56-1.93,4.11-6.83,1.08-9.51l-23.38-20.72c-4.75-4.21-11.51-5.4-17.36-2.92-25.48,10.84-53.17,16.38-81.71,16.03-111.68-1.37-201.91-94.29-200.13-205.96,1.76-110.26,92-199.41,202.67-199.41h202.69V407.41l-115-102.18c-3.72-3.31-9.42-2.66-12.42,1.31-18.46,24.44-48.53,39.64-81.93,37.34-46.33-3.2-83.87-40.5-87.34-86.81-4.15-55.24,39.63-101.52,94-101.52,49.18,0,89.68,37.85,93.91,85.95,.38,4.28,2.31,8.27,5.52,11.12l29.95,26.55c3.4,3.01,8.79,1.17,9.63-3.3,2.16-11.55,2.92-23.58,2.07-35.92-4.82-70.34-61.8-126.93-132.17-131.26-80.68-4.97-148.13,58.14-150.27,137.25-2.09,77.1,61.08,143.56,138.19,145.26,32.19,.71,62.03-9.41,86.14-26.95l150.26,133.2c6.44,5.71,16.61,1.14,16.61-7.47V9.48C499.66,4.25,495.42,0,490.18,0H249.83Z"})))}function ea(e){return It.createElement("svg",{width:"20",height:"20","aria-label":e.ariaLabel,viewBox:"0 0 24 24",role:"img"},It.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.4"},e.children))}function ta(e){var t=e.translations,n=void 0===t?{}:t,r=e.isAskAiActive,u=void 0!==r&&r,a=n.selectText,i=void 0===a?"Select":a,o=n.selectKeyAriaLabel,s=void 0===o?"Enter key":o,c=n.submitQuestionText,l=void 0===c?"Submit question":c,f=n.navigateText,d=void 0===f?"Navigate":f,p=n.navigateUpKeyAriaLabel,h=void 0===p?"Arrow up":p,v=n.navigateDownKeyAriaLabel,m=void 0===v?"Arrow down":v,D=n.closeText,y=void 0===D?"Close":D,g=n.backToSearchText,F=void 0===g?"Back to search":g,E=n.closeKeyAriaLabel,_=void 0===E?"Escape key":E,b=n.poweredByText,C=void 0===b?"Powered by":b;return It.createElement(It.Fragment,null,It.createElement("div",{className:"DocSearch-Logo"},It.createElement(Xu,{translations:{poweredByText:C}})),It.createElement("ul",{className:"DocSearch-Commands"},It.createElement("li",null,It.createElement("kbd",{className:"DocSearch-Commands-Key"},It.createElement(ea,{ariaLabel:m},It.createElement("path",{d:"M12 5v14"}),It.createElement("path",{d:"m19 12-7 7-7-7"}))),It.createElement("kbd",{className:"DocSearch-Commands-Key"},It.createElement(ea,{ariaLabel:h},It.createElement("path",{d:"m5 12 7-7 7 7"}),It.createElement("path",{d:"M12 19V5"}))),It.createElement("span",{className:"DocSearch-Label"},d)),It.createElement("li",null,It.createElement("kbd",{className:"DocSearch-Commands-Key"},It.createElement(ea,{ariaLabel:s},It.createElement("polyline",{points:"9 10 4 15 9 20"}),It.createElement("path",{d:"M20 4v7a4 4 0 0 1-4 4H4"}))),It.createElement("span",{className:"DocSearch-Label"},u?l:i)),It.createElement("li",null,It.createElement("kbd",{className:"DocSearch-Commands-Key"},It.createElement("span",{className:"DocSearch-Escape-Key"},"ESC")),It.createElement("span",{className:"DocSearch-Label","aria-label":_},u?F:y))))}function na(e){var t=e.hit,n=e.children;return It.createElement("a",{href:t.url},n)}function ra(e){var t=e.className;return It.createElement("svg",{viewBox:"0 0 38 38",className:t,stroke:"currentColor",strokeOpacity:".5"},It.createElement("g",{fill:"none",fillRule:"evenodd"},It.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},It.createElement("circle",{strokeOpacity:".3",cx:"18",cy:"18",r:"18"}),It.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18"},It.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})))))}function ua(e){var t=e.className,n=void 0===t?"":t;return It.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",className:"DocSearch-Hit-icon-sparkles ".concat(n)},It.createElement("path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"}),It.createElement("path",{d:"M20 3v4"}),It.createElement("path",{d:"M22 5h-4"}),It.createElement("path",{d:"M4 17v2"}),It.createElement("path",{d:"M5 18H3"}))}function aa(){return It.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},It.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},It.createElement("path",{d:"M3.18 6.6a8.23 8.23 0 1112.93 9.94h0a8.23 8.23 0 01-11.63 0"}),It.createElement("path",{d:"M6.44 7.25H2.55V3.36M10.45 6v5.6M10.45 11.6L13 13"})))}function ia(){return It.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},It.createElement("path",{d:"M10 10l5.09-5.09L10 10l5.09 5.09L10 10zm0 0L4.91 4.91 10 10l-5.09 5.09L10 10z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function oa(){return It.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:"lucide lucide-triangle-alert-icon lucide-triangle-alert"},It.createElement("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),It.createElement("path",{d:"M12 9v4"}),It.createElement("path",{d:"M12 17h.01"}))}function sa(){return It.createElement("svg",{className:"DocSearch-Hit-Select-Icon",width:"20",height:"20",viewBox:"0 0 20 20"},It.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},It.createElement("path",{d:"M18 3v4c0 2-2 4-4 4H2"}),It.createElement("path",{d:"M8 17l-6-6 6-6"})))}var ca=function(){return It.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},It.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),It.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),It.createElement("path",{d:"M10 9H8"}),It.createElement("path",{d:"M16 13H8"}),It.createElement("path",{d:"M16 17H8"}))};function la(e){switch(e.type){case"lvl1":return It.createElement(ca,null);case"content":return It.createElement(da,null);default:return It.createElement(fa,null)}}function fa(){return It.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},It.createElement("line",{x1:"4",x2:"20",y1:"9",y2:"9"}),It.createElement("line",{x1:"4",x2:"20",y1:"15",y2:"15"}),It.createElement("line",{x1:"10",x2:"8",y1:"3",y2:"21"}),It.createElement("line",{x1:"16",x2:"14",y1:"3",y2:"21"}))}function da(){return It.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},It.createElement("path",{d:"M17 5H3h14zm0 5H3h14zm0 5H3h14z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function pa(){return It.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},It.createElement("path",{d:"M10 14.2L5 17l1-5.6-4-4 5.5-.7 2.5-5 2.5 5 5.6.8-4 4 .9 5.5z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function ha(){return It.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,viewBox:"0 0 18 18",fill:"none"},It.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.99984 1.29102C4.74264 1.29102 1.2915 4.74215 1.2915 8.99935C1.2915 13.2565 4.74264 16.7077 8.99984 16.7077C13.257 16.7077 16.7082 13.2565 16.7082 8.99935C16.7082 4.74215 13.257 1.29102 8.99984 1.29102ZM0.0415039 8.99935C0.0415039 4.0518 4.05229 0.0410156 8.99984 0.0410156C13.9474 0.0410156 17.9582 4.0518 17.9582 8.99935C17.9582 13.9469 13.9474 17.9577 8.99984 17.9577C4.05229 17.9577 0.0415039 13.9469 0.0415039 8.99935ZM5.87484 6.49935C5.87484 6.15417 6.15466 5.87435 6.49984 5.87435H11.4998C11.845 5.87435 12.1248 6.15417 12.1248 6.49935V11.4993C12.1248 11.8445 11.845 12.1243 11.4998 12.1243H6.49984C6.15466 12.1243 5.87484 11.8445 5.87484 11.4993V6.49935ZM7.12484 7.12435V10.8743H10.8748V7.12435H7.12484Z",fill:"currentcolor"}))}function va(){return It.createElement("svg",{width:"40",height:"40",viewBox:"0 0 20 20",fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},It.createElement("path",{d:"M19 4.8a16 16 0 00-2-1.2m-3.3-1.2A16 16 0 001.1 4.7M16.7 8a12 12 0 00-2.8-1.4M10 6a12 12 0 00-6.7 2M12.3 14.7a4 4 0 00-4.5 0M14.5 11.4A8 8 0 0010 10M3 16L18 2M10 18h0"}))}function ma(){return It.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 24 24",fill:"none",stroke:"#5a5e9a",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},It.createElement("path",{d:"m13.5 8.5-5 5"}),It.createElement("path",{d:"m8.5 8.5 5 5"}),It.createElement("circle",{cx:"11",cy:"11",r:"8"}),It.createElement("path",{d:"m21 21-4.3-4.3"}))}function Da(){return It.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:4,height:16,viewBox:"0 0 4 16",fill:"none"},It.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.99984 1.95898C1.88478 1.95898 1.7915 2.05226 1.7915 2.16732C1.7915 2.28238 1.88478 2.37565 1.99984 2.37565C2.1149 2.37565 2.20817 2.28238 2.20817 2.16732C2.20817 2.05226 2.1149 1.95898 1.99984 1.95898ZM0.541504 2.16732C0.541504 1.3619 1.19442 0.708984 1.99984 0.708984C2.80525 0.708984 3.45817 1.3619 3.45817 2.16732C3.45817 2.97273 2.80525 3.62565 1.99984 3.62565C1.19442 3.62565 0.541504 2.97273 0.541504 2.16732ZM1.99984 7.79232C1.88478 7.79232 1.7915 7.88559 1.7915 8.00065C1.7915 8.11571 1.88478 8.20898 1.99984 8.20898C2.1149 8.20898 2.20817 8.11571 2.20817 8.00065C2.20817 7.88559 2.1149 7.79232 1.99984 7.79232ZM0.541504 8.00065C0.541504 7.19524 1.19442 6.54232 1.99984 6.54232C2.80525 6.54232 3.45817 7.19524 3.45817 8.00065C3.45817 8.80607 2.80525 9.45898 1.99984 9.45898C1.19442 9.45898 0.541504 8.80607 0.541504 8.00065ZM1.99984 13.6257C1.88478 13.6257 1.7915 13.7189 1.7915 13.834C1.7915 13.949 1.88478 14.0423 1.99984 14.0423C2.1149 14.0423 2.20817 13.949 2.20817 13.834C2.20817 13.7189 2.1149 13.6257 1.99984 13.6257ZM0.541504 13.834C0.541504 13.0286 1.19442 12.3757 1.99984 12.3757C2.80525 12.3757 3.45817 13.0286 3.45817 13.834C3.45817 14.6394 2.80525 15.2923 1.99984 15.2923C1.19442 15.2923 0.541504 14.6394 0.541504 13.834Z",fill:"currentcolor"}))}function ya(){return It.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},It.createElement("path",{d:"M9 0.875C10.6068 0.875 12.1776 1.35149 13.5137 2.24414C14.8498 3.13693 15.8919 4.40598 16.5068 5.89062C17.1218 7.37522 17.2822 9.00892 16.9688 10.585C16.6552 12.1611 15.8814 13.6088 14.7451 14.7451C13.6088 15.8814 12.1611 16.6552 10.585 16.9688C9.00892 17.2822 7.37523 17.1218 5.89062 16.5068C4.40598 15.8919 3.13693 14.8498 2.24414 13.5137C1.35149 12.1776 0.875 10.6068 0.875 9C0.875 8.65482 1.15482 8.375 1.5 8.375C1.84518 8.375 2.125 8.65482 2.125 9C2.125 10.3596 2.52792 11.6888 3.2832 12.8193C4.03864 13.9499 5.1129 14.8312 6.36914 15.3516C7.62523 15.8718 9.00736 16.0083 10.3408 15.7432C11.6744 15.4779 12.8998 14.8228 13.8613 13.8613C14.8228 12.8998 15.4779 11.6744 15.7432 10.3408C16.0083 9.00736 15.8718 7.62523 15.3516 6.36914C14.8312 5.1129 13.9499 4.03864 12.8193 3.2832C11.6888 2.52792 10.3596 2.125 9 2.125C7.06829 2.125 5.21604 2.89096 3.82129 4.22949L3.00879 5.04199H5.66699C6.01202 5.04217 6.29199 5.32192 6.29199 5.66699C6.29182 6.01191 6.01191 6.29182 5.66699 6.29199H1.5C1.45939 6.29199 1.41889 6.28716 1.37891 6.2793C1.36148 6.27587 1.345 6.26949 1.32812 6.26465C1.267 6.24714 1.20782 6.22205 1.15332 6.18555C1.08536 6.14005 1.02604 6.08256 0.980469 6.01465C0.970244 5.99942 0.962841 5.98268 0.954102 5.9668C0.904937 5.87756 0.875056 5.77606 0.875 5.66699V1.5C0.875 1.15482 1.15482 0.875002 1.5 0.875C1.84518 0.875 2.125 1.15482 2.125 1.5V4.15723L2.94141 3.3418L2.9502 3.33301C4.57158 1.77433 6.73388 0.875 9 0.875ZM9.33301 4.20801C9.67808 4.20801 9.95783 4.48798 9.95801 4.83301V9.44727L12.9463 10.9414C13.2548 11.0958 13.3798 11.4707 13.2256 11.7793C13.0712 12.088 12.6955 12.213 12.3867 12.0586L9.05371 10.3926C8.84198 10.2867 8.70801 10.0697 8.70801 9.83301V4.83301C8.70818 4.48809 8.98809 4.20819 9.33301 4.20801Z",fill:"currentcolor"}))}function ga(){return It.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"19",height:"19",viewBox:"0 0 19 19",fill:"none"},It.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.712717 3.38039C1.14249 2.95062 1.72538 2.70917 2.33317 2.70917H8.1665C8.51168 2.70917 8.7915 2.989 8.7915 3.33417C8.7915 3.67935 8.51168 3.95917 8.1665 3.95917H2.33317C2.0569 3.95917 1.79195 4.06892 1.5966 4.26427C1.40125 4.45962 1.2915 4.72457 1.2915 5.00084V16.6675C1.2915 16.9438 1.40125 17.2087 1.5966 17.4041C1.79195 17.5994 2.0569 17.7092 2.33317 17.7092H13.9998C14.2761 17.7092 14.5411 17.5994 14.7364 17.4041C14.9318 17.2087 15.0415 16.9438 15.0415 16.6675V10.8342C15.0415 10.489 15.3213 10.2092 15.6665 10.2092C16.0117 10.2092 16.2915 10.489 16.2915 10.8342V16.6675C16.2915 17.2753 16.0501 17.8582 15.6203 18.288C15.1905 18.7177 14.6076 18.9592 13.9998 18.9592H2.33317C1.72538 18.9592 1.14249 18.7177 0.712717 18.288C0.282947 17.8582 0.0415039 17.2753 0.0415039 16.6675V5.00084C0.0415039 4.39305 0.282947 3.81016 0.712717 3.38039Z",fill:"currentcolor"}),It.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6665 2.19141C15.3634 2.19141 15.0728 2.3118 14.8584 2.52611L7.06419 10.3204L6.52548 12.4752L8.68031 11.9365L16.4746 4.14223C16.6889 3.92792 16.8093 3.63725 16.8093 3.33417C16.8093 3.03109 16.6889 2.74043 16.4746 2.52611C16.2603 2.3118 15.9696 2.19141 15.6665 2.19141ZM13.9746 1.64223C14.4233 1.1935 15.0319 0.941406 15.6665 0.941406C16.3011 0.941406 16.9097 1.1935 17.3584 1.64223C17.8072 2.09096 18.0593 2.69957 18.0593 3.33417C18.0593 3.96877 17.8072 4.57738 17.3584 5.02611L9.44178 12.9428C9.36168 13.0229 9.26132 13.0797 9.15142 13.1072L5.81809 13.9405C5.6051 13.9938 5.3798 13.9314 5.22456 13.7761C5.06932 13.6209 5.00692 13.3956 5.06016 13.1826L5.8935 9.84925C5.92097 9.73936 5.9778 9.639 6.0579 9.5589L13.9746 1.64223Z",fill:"currentcolor"}))}var Fa,Ea={before:"Searched for ",separator:", ",lastSeparator:" and ",after:""};function _a(e){var t=e.queries,n=e.translations,r=e.onSearchQueryClick;if(0===t.length)return null;if("function"==typeof n.aggregatedToolCallNode)return It.createElement(It.Fragment,null,n.aggregatedToolCallNode(t,r));var u=(n.aggregatedToolCallText?n.aggregatedToolCallText(t):Ea)||{},a=u.before,i=void 0===a?"":a,o=u.separator,s=void 0===o?", ":o,c=u.lastSeparator,l=void 0===c?" and ":c,f=u.after,d=void 0===f?"":f;return It.createElement("div",{className:"DocSearch-AskAiScreen-MessageContent-Tool Tool--AggregatedResult"},It.createElement(wn,{size:18}),It.createElement("span",null,i&&It.createElement("span",null,i),t.map(function(e,n){return It.createElement(H,{key:e+n},It.createElement("span",{role:"button",tabIndex:0,className:"DocSearch-AskAiScreen-MessageContent-Tool-Query",onKeyDown:function(t){"enter"!==t.key&&" "!==t.key||(t.preventDefault(),r(e))},onClick:function(){return r(e)}},'"',e,'"'),n<t.length-2&&s,n===t.length-2&&l)}),d&&It.createElement("span",null,d)))}var ba={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Ca(e){ba=e}var ka={exec:function(){return null}};function Aa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="string"==typeof e?e:e.source,r={replace:function(e,t){var u="string"==typeof t?t:t.source;return u=u.replace(Sa.caret,"$1"),n=n.replace(e,u),r},getRegex:function(){return new RegExp(n,t)}};return r}var wa=function(){try{return!!new RegExp("(?<=1)(?<!1)")}catch(e){return!1}}(),Sa={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDD40-\uDD65\uDD6F-\uDD85\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDED0-\uDEE3\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0\uDFF0-\uDFF9]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDDB0-\uDDDB\uDDE0-\uDDE9\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDF50-\uDF59\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D\uDD30-\uDD39]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDD70-\uDD79\uDE40-\uDE96\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2-\uDFF6]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD833[\uDCF0-\uDCF9]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDCD0-\uDCEB\uDCF0-\uDCF9\uDDD0-\uDDED\uDDF0-\uDDFA\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])/,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:function(e){return new RegExp("^( {0,3}".concat(e,")((?:[\t ][^\\n]*)?(?:\\n|$))"))},nextBulletRegex:function(e){return new RegExp("^ {0,".concat(Math.min(3,e-1),"}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))"))},hrRegex:function(e){return new RegExp("^ {0,".concat(Math.min(3,e-1),"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"))},fencesBeginRegex:function(e){return new RegExp("^ {0,".concat(Math.min(3,e-1),"}(?:```|~~~)"))},headingBeginRegex:function(e){return new RegExp("^ {0,".concat(Math.min(3,e-1),"}#"))},htmlBeginRegex:function(e){return new RegExp("^ {0,".concat(Math.min(3,e-1),"}<(?:[a-z].*>|!--)"),"i")}},xa=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Oa=/(?:[*+-]|\d{1,9}[.)])/,Ba=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ia=Aa(Ba).replace(/bull/g,Oa).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ta=Aa(Ba).replace(/bull/g,Oa).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Pa=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ja=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Na=Aa(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ja).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),za=Aa(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Oa).getRegex(),Ra="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ma=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Za=Aa("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",Ma).replace("tag",Ra).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),La=Aa(Pa).replace("hr",xa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ra).getRegex(),$a={blockquote:Aa(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",La).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Na,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:xa,html:Za,lheading:Ia,list:za,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:La,table:ka,text:/^[^\n]+/},qa=Aa("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",xa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ra).getRegex(),Ua=pn(pn({},$a),{},{lheading:Ta,table:qa,paragraph:Aa(Pa).replace("hr",xa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",qa).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ra).getRegex()}),Ha=pn(pn({},$a),{},{html:Aa("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Ma).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ka,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Aa(Pa).replace("hr",xa).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Ia).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),Va=/^( {2,}|\\)\n(?!\s*$)/,Wa=/(?:[!-\/:-@\[-`\{-~\xA1-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0606-\u060F\u061B\u061D-\u061F\u066A-\u066D\u06D4\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u0888\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C77\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2010-\u2027\u2030-\u205E\u207A-\u207E\u208A-\u208E\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uAB6A\uAB6B\uABEB\uFB29\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDD8E\uDD8F\uDEAD\uDED0-\uDED8\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3F]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFD5-\uDFF1\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F[\uDC9C\uDC9F]|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD838[\uDD4F\uDEFF]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA])/,Ka=/(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0606-\u060F\u061B\u061D-\u061F\u066A-\u066D\u06D4\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u0888\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C77\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u200A\u2010-\u2029\u202F-\u205F\u207A-\u207E\u208A-\u208E\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uAB6A\uAB6B\uABEB\uFB29\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDD8E\uDD8F\uDEAD\uDED0-\uDED8\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3F]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFD5-\uDFF1\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F[\uDC9C\uDC9F]|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD838[\uDD4F\uDEFF]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA])/,Ja=/(?:[\0-\x08\x0E-\x1F0-9A-Za-z\x7F-\x9F\xAA\xAD\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376-\u037D\u037F-\u0383\u0386\u0388-\u03F5\u03F7-\u0481\u0483-\u0559\u0560-\u0588\u058B\u058C\u0590-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7-\u05F2\u05F5-\u0605\u0610-\u061A\u061C\u0620-\u0669\u066E-\u06D3\u06D5-\u06DD\u06DF-\u06E8\u06EA-\u06FC\u06FF\u070E-\u07F5\u07FA-\u07FD\u0800-\u082F\u083F-\u085D\u085F-\u0887\u0889-\u0963\u0966-\u096F\u0971-\u09F1\u09F4-\u09F9\u09FC\u09FE-\u0A75\u0A77-\u0AEF\u0AF2-\u0B6F\u0B71-\u0BF2\u0BFB-\u0C76\u0C78-\u0C7E\u0C80-\u0C83\u0C85-\u0D4E\u0D50-\u0D78\u0D7A-\u0DF3\u0DF5-\u0E3E\u0E40-\u0E4E\u0E50-\u0E59\u0E5C-\u0F00\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39\u0F3E-\u0F84\u0F86-\u0FBD\u0FC6\u0FCD\u0FDB-\u1049\u1050-\u109D\u10A0-\u10FA\u10FC-\u135F\u1369-\u138F\u139A-\u13FF\u1401-\u166C\u166F-\u167F\u1681-\u169A\u169D-\u16EA\u16EE-\u1734\u1737-\u17D3\u17D7\u17DC-\u17FF\u180B-\u193F\u1941-\u1943\u1946-\u19DD\u1A00-\u1A1D\u1A20-\u1A9F\u1AA7\u1AAE-\u1B4D\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BFB\u1C00-\u1C3A\u1C40-\u1C7D\u1C80-\u1CBF\u1CC8-\u1CD2\u1CD4-\u1FBC\u1FBE\u1FC2-\u1FCC\u1FD0-\u1FDC\u1FE0-\u1FEC\u1FF0-\u1FFC\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u2079\u207F-\u2089\u208F-\u209F\u20C2-\u20FF\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u218C-\u218F\u242A-\u243F\u244B-\u249B\u24EA-\u24FF\u2776-\u2793\u2B74\u2B75\u2C00-\u2CE4\u2CEB-\u2CF8\u2CFD\u2D00-\u2D6F\u2D71-\u2DFF\u2E2F\u2E5E-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3040-\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u318F\u3192-\u3195\u31A0-\u31BF\u31E6-\u31EE\u31F0-\u31FF\u321F-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48F\uA4C7-\uA4FD\uA500-\uA60C\uA610-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA6F8-\uA6FF\uA717-\uA71F\uA722-\uA788\uA78B-\uA827\uA82C-\uA835\uA83A-\uA873\uA878-\uA8CD\uA8D0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA95E\uA960-\uA9C0\uA9CE-\uA9DD\uA9E0-\uAA5B\uAA60-\uAA76\uAA7A-\uAADD\uAAE0-\uAAEF\uAAF2-\uAB5A\uAB5C-\uAB69\uAB6C-\uABEA\uABEC-\uD7FF\uE000-\uFB28\uFB2A-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDD0-\uFDFB\uFE00-\uFE0F\uFE1A-\uFE2F\uFE53\uFE67\uFE6C-\uFEFE\uFF00\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]|\uD800[\uDC00-\uDCFF\uDD03-\uDD36\uDD40-\uDD78\uDD8A\uDD8B\uDD8F\uDD9D-\uDD9F\uDDA1-\uDDCF\uDDFD-\uDF9E\uDFA0-\uDFCF\uDFD1-\uDFFF]|\uD801[\uDC00-\uDD6E\uDD70-\uDFFF]|\uD802[\uDC00-\uDC56\uDC58-\uDC76\uDC79-\uDD1E\uDD20-\uDD3E\uDD40-\uDE4F\uDE59-\uDE7E\uDE80-\uDEC7\uDEC9-\uDEEF\uDEF7-\uDF38\uDF40-\uDF98\uDF9D-\uDFFF]|\uD803[\uDC00-\uDD6D\uDD6F-\uDD8D\uDD90-\uDEAC\uDEAE-\uDECF\uDED9-\uDF54\uDF5A-\uDF85\uDF8A-\uDFFF]|\uD804[\uDC00-\uDC46\uDC4E-\uDCBA\uDCBD\uDCC2-\uDD3F\uDD44-\uDD73\uDD76-\uDDC4\uDDC9-\uDDCC\uDDCE-\uDDDA\uDDDC\uDDE0-\uDE37\uDE3E-\uDEA8\uDEAA-\uDFD3\uDFD6\uDFD9-\uDFFF]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5C\uDC5E-\uDCC5\uDCC7-\uDDC0\uDDD8-\uDE40\uDE44-\uDE5F\uDE6D-\uDEB8\uDEBA-\uDF3B\uDF40-\uDFFF]|\uD806[\uDC00-\uDC3A\uDC3C-\uDD43\uDD47-\uDDE1\uDDE3-\uDE3E\uDE47-\uDE99\uDE9D\uDEA3-\uDEFF\uDF0A-\uDFE0\uDFE2-\uDFFF]|\uD807[\uDC00-\uDC40\uDC46-\uDC6F\uDC72-\uDEF6\uDEF9-\uDF42\uDF50-\uDFD4\uDFF2-\uDFFE]|[\uD808\uD80A\uD80C-\uD819\uD81C-\uD82E\uD830-\uD832\uD837\uD83F-\uDBFF][\uDC00-\uDFFF]|\uD809[\uDC00-\uDC6F\uDC75-\uDFFF]|\uD80B[\uDC00-\uDFF0\uDFF3-\uDFFF]|\uD81A[\uDC00-\uDE6D\uDE70-\uDEF4\uDEF6-\uDF36\uDF40-\uDF43\uDF46-\uDFFF]|\uD81B[\uDC00-\uDD6C\uDD70-\uDE96\uDE9B-\uDFE1\uDFE3-\uDFFF]|\uD82F[\uDC00-\uDC9B\uDC9D\uDC9E\uDCA0-\uDFFF]|\uD833[\uDCF0-\uDCF9\uDCFD-\uDCFF\uDEB4-\uDEB9\uDED1-\uDEDF\uDEF1-\uDF4F\uDFC4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD65-\uDD69\uDD6D-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDDEB-\uDDFF\uDE42-\uDE44\uDE46-\uDEFF\uDF57-\uDFFF]|\uD835[\uDC00-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE8C-\uDFFF]|\uD838[\uDC00-\uDD4E\uDD50-\uDEFE\uDF00-\uDFFF]|\uD839[\uDC00-\uDDFE\uDE00-\uDFFF]|\uD83A[\uDC00-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDD2D\uDD2F-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDD0C\uDDAE-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED9-\uDEDB\uDEED-\uDEEF\uDEFD-\uDEFF\uDFDA-\uDFDF\uDFEC-\uDFEF\uDFF1-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE\uDCAF\uDCBC-\uDCBF\uDCC2-\uDCCF\uDCD9-\uDCFF\uDE58-\uDE5F\uDE6E\uDE6F\uDE7D-\uDE7F\uDE8B-\uDE8D\uDEC7\uDEC9-\uDECC\uDEDD\uDEDE\uDEEB-\uDEEE\uDEF9-\uDEFF\uDF93\uDFF0-\uDFF9\uDFFB-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Qa=Aa(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ka).getRegex(),Ga=/(?!~)(?:[!-\/:-@\[-`\{-~\xA1-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0606-\u060F\u061B\u061D-\u061F\u066A-\u066D\u06D4\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u0888\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C77\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2010-\u2027\u2030-\u205E\u207A-\u207E\u208A-\u208E\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uAB6A\uAB6B\uABEB\uFB29\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDD8E\uDD8F\uDEAD\uDED0-\uDED8\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3F]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFD5-\uDFF1\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F[\uDC9C\uDC9F]|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD838[\uDD4F\uDEFF]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA])/,Ya=Aa(/link|precode-code|html/,"g").replace("link",Cn(/\[(?:[^\[\]`]|(`+)[^`]+\1(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/,{a:1})).replace("precode-",wa?"(?<!`)()":"(^^|[^`])").replace("code",Cn(/(`+)[^`]+\1(?!`)/,{b:1})).replace("html",/<(?! )[^<>]*?>/).getRegex(),Xa=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ei=Aa(Xa,"u").replace(/punct/g,Wa).getRegex(),ti=Aa(Xa,"u").replace(/punct/g,Ga).getRegex(),ni="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ri=Aa(ni,"gu").replace(/notPunctSpace/g,Ja).replace(/punctSpace/g,Ka).replace(/punct/g,Wa).getRegex(),ui=Aa(ni,"gu").replace(/notPunctSpace/g,/(?:(?:[\0-\x08\x0E-\x1F0-9A-Za-z\x7F-\x9F\xAA\xAD\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376-\u037D\u037F-\u0383\u0386\u0388-\u03F5\u03F7-\u0481\u0483-\u0559\u0560-\u0588\u058B\u058C\u0590-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7-\u05F2\u05F5-\u0605\u0610-\u061A\u061C\u0620-\u0669\u066E-\u06D3\u06D5-\u06DD\u06DF-\u06E8\u06EA-\u06FC\u06FF\u070E-\u07F5\u07FA-\u07FD\u0800-\u082F\u083F-\u085D\u085F-\u0887\u0889-\u0963\u0966-\u096F\u0971-\u09F1\u09F4-\u09F9\u09FC\u09FE-\u0A75\u0A77-\u0AEF\u0AF2-\u0B6F\u0B71-\u0BF2\u0BFB-\u0C76\u0C78-\u0C7E\u0C80-\u0C83\u0C85-\u0D4E\u0D50-\u0D78\u0D7A-\u0DF3\u0DF5-\u0E3E\u0E40-\u0E4E\u0E50-\u0E59\u0E5C-\u0F00\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39\u0F3E-\u0F84\u0F86-\u0FBD\u0FC6\u0FCD\u0FDB-\u1049\u1050-\u109D\u10A0-\u10FA\u10FC-\u135F\u1369-\u138F\u139A-\u13FF\u1401-\u166C\u166F-\u167F\u1681-\u169A\u169D-\u16EA\u16EE-\u1734\u1737-\u17D3\u17D7\u17DC-\u17FF\u180B-\u193F\u1941-\u1943\u1946-\u19DD\u1A00-\u1A1D\u1A20-\u1A9F\u1AA7\u1AAE-\u1B4D\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BFB\u1C00-\u1C3A\u1C40-\u1C7D\u1C80-\u1CBF\u1CC8-\u1CD2\u1CD4-\u1FBC\u1FBE\u1FC2-\u1FCC\u1FD0-\u1FDC\u1FE0-\u1FEC\u1FF0-\u1FFC\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u2079\u207F-\u2089\u208F-\u209F\u20C2-\u20FF\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u218C-\u218F\u242A-\u243F\u244B-\u249B\u24EA-\u24FF\u2776-\u2793\u2B74\u2B75\u2C00-\u2CE4\u2CEB-\u2CF8\u2CFD\u2D00-\u2D6F\u2D71-\u2DFF\u2E2F\u2E5E-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3040-\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u318F\u3192-\u3195\u31A0-\u31BF\u31E6-\u31EE\u31F0-\u31FF\u321F-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48F\uA4C7-\uA4FD\uA500-\uA60C\uA610-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA6F8-\uA6FF\uA717-\uA71F\uA722-\uA788\uA78B-\uA827\uA82C-\uA835\uA83A-\uA873\uA878-\uA8CD\uA8D0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA95E\uA960-\uA9C0\uA9CE-\uA9DD\uA9E0-\uAA5B\uAA60-\uAA76\uAA7A-\uAADD\uAAE0-\uAAEF\uAAF2-\uAB5A\uAB5C-\uAB69\uAB6C-\uABEA\uABEC-\uD7FF\uE000-\uFB28\uFB2A-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDD0-\uFDFB\uFE00-\uFE0F\uFE1A-\uFE2F\uFE53\uFE67\uFE6C-\uFEFE\uFF00\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]|\uD800[\uDC00-\uDCFF\uDD03-\uDD36\uDD40-\uDD78\uDD8A\uDD8B\uDD8F\uDD9D-\uDD9F\uDDA1-\uDDCF\uDDFD-\uDF9E\uDFA0-\uDFCF\uDFD1-\uDFFF]|\uD801[\uDC00-\uDD6E\uDD70-\uDFFF]|\uD802[\uDC00-\uDC56\uDC58-\uDC76\uDC79-\uDD1E\uDD20-\uDD3E\uDD40-\uDE4F\uDE59-\uDE7E\uDE80-\uDEC7\uDEC9-\uDEEF\uDEF7-\uDF38\uDF40-\uDF98\uDF9D-\uDFFF]|\uD803[\uDC00-\uDD6D\uDD6F-\uDD8D\uDD90-\uDEAC\uDEAE-\uDECF\uDED9-\uDF54\uDF5A-\uDF85\uDF8A-\uDFFF]|\uD804[\uDC00-\uDC46\uDC4E-\uDCBA\uDCBD\uDCC2-\uDD3F\uDD44-\uDD73\uDD76-\uDDC4\uDDC9-\uDDCC\uDDCE-\uDDDA\uDDDC\uDDE0-\uDE37\uDE3E-\uDEA8\uDEAA-\uDFD3\uDFD6\uDFD9-\uDFFF]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5C\uDC5E-\uDCC5\uDCC7-\uDDC0\uDDD8-\uDE40\uDE44-\uDE5F\uDE6D-\uDEB8\uDEBA-\uDF3B\uDF40-\uDFFF]|\uD806[\uDC00-\uDC3A\uDC3C-\uDD43\uDD47-\uDDE1\uDDE3-\uDE3E\uDE47-\uDE99\uDE9D\uDEA3-\uDEFF\uDF0A-\uDFE0\uDFE2-\uDFFF]|\uD807[\uDC00-\uDC40\uDC46-\uDC6F\uDC72-\uDEF6\uDEF9-\uDF42\uDF50-\uDFD4\uDFF2-\uDFFE]|[\uD808\uD80A\uD80C-\uD819\uD81C-\uD82E\uD830-\uD832\uD837\uD83F-\uDBFF][\uDC00-\uDFFF]|\uD809[\uDC00-\uDC6F\uDC75-\uDFFF]|\uD80B[\uDC00-\uDFF0\uDFF3-\uDFFF]|\uD81A[\uDC00-\uDE6D\uDE70-\uDEF4\uDEF6-\uDF36\uDF40-\uDF43\uDF46-\uDFFF]|\uD81B[\uDC00-\uDD6C\uDD70-\uDE96\uDE9B-\uDFE1\uDFE3-\uDFFF]|\uD82F[\uDC00-\uDC9B\uDC9D\uDC9E\uDCA0-\uDFFF]|\uD833[\uDCF0-\uDCF9\uDCFD-\uDCFF\uDEB4-\uDEB9\uDED1-\uDEDF\uDEF1-\uDF4F\uDFC4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD65-\uDD69\uDD6D-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDDEB-\uDDFF\uDE42-\uDE44\uDE46-\uDEFF\uDF57-\uDFFF]|\uD835[\uDC00-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE8C-\uDFFF]|\uD838[\uDC00-\uDD4E\uDD50-\uDEFE\uDF00-\uDFFF]|\uD839[\uDC00-\uDDFE\uDE00-\uDFFF]|\uD83A[\uDC00-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDD2D\uDD2F-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDD0C\uDDAE-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED9-\uDEDB\uDEED-\uDEEF\uDEFD-\uDEFF\uDFDA-\uDFDF\uDFEC-\uDFEF\uDFF1-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE\uDCAF\uDCBC-\uDCBF\uDCC2-\uDCCF\uDCD9-\uDCFF\uDE58-\uDE5F\uDE6E\uDE6F\uDE7D-\uDE7F\uDE8B-\uDE8D\uDEC7\uDEC9-\uDECC\uDEDD\uDEDE\uDEEB-\uDEEE\uDEF9-\uDEFF\uDF93\uDFF0-\uDFF9\uDFFB-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])|~)/).replace(/punctSpace/g,/(?!~)(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0606-\u060F\u061B\u061D-\u061F\u066A-\u066D\u06D4\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u0888\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C77\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u200A\u2010-\u2029\u202F-\u205F\u207A-\u207E\u208A-\u208E\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uAB6A\uAB6B\uABEB\uFB29\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDD8E\uDD8F\uDEAD\uDED0-\uDED8\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3F]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFD5-\uDFF1\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F[\uDC9C\uDC9F]|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD838[\uDD4F\uDEFF]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA])/).replace(/punct/g,Ga).getRegex(),ai=Aa("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ja).replace(/punctSpace/g,Ka).replace(/punct/g,Wa).getRegex(),ii=Aa(/\\(punct)/,"gu").replace(/punct/g,Wa).getRegex(),oi=Aa(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),si=Aa(Ma).replace("(?:--\x3e|$)","--\x3e").getRegex(),ci=Aa("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",si).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),li=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,fi=Aa(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",li).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),di=Aa(/^!?\[(label)\]\[(ref)\]/).replace("label",li).replace("ref",ja).getRegex(),pi=Aa(/^!?\[(ref)\](?:\[\])?/).replace("ref",ja).getRegex(),hi=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,vi={_backpedal:ka,anyPunctuation:ii,autolink:oi,blockSkip:Ya,br:Va,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:ka,emStrongLDelim:ei,emStrongRDelimAst:ri,emStrongRDelimUnd:ai,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:fi,nolink:pi,punctuation:Qa,reflink:di,reflinkSearch:Aa("reflink|nolink(?!\\()","g").replace("reflink",di).replace("nolink",pi).getRegex(),tag:ci,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:ka},mi=pn(pn({},vi),{},{link:Aa(/^!?\[(label)\]\((.*?)\)/).replace("label",li).getRegex(),reflink:Aa(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",li).getRegex()}),Di=pn(pn({},vi),{},{emStrongRDelimAst:ui,emStrongLDelim:ti,url:Aa(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",hi).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Aa(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",hi).getRegex()}),yi=pn(pn({},Di),{},{br:Aa(Va).replace("{2,}","*").getRegex(),text:Aa(Di.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),gi={normal:$a,gfm:Ua,pedantic:Ha},Fi={normal:vi,gfm:Di,breaks:yi,pedantic:mi},Ei={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_i=function(e){return Ei[e]};function bi(e,t){if(t){if(Sa.escapeTest.test(e))return e.replace(Sa.escapeReplace,_i)}else if(Sa.escapeTestNoEncode.test(e))return e.replace(Sa.escapeReplaceNoEncode,_i);return e}function Ci(e){try{e=encodeURI(e).replace(Sa.percentDecode,"%")}catch(e){return null}return e}function ki(e,t){var n,r=e.replace(Sa.findPipe,function(e,t,n){for(var r=!1,u=t;--u>=0&&"\\"===n[u];)r=!r;return r?"|":" |"}).split(Sa.splitPipe),u=0;if(r[0].trim()||r.shift(),r.length>0&&!(null!==(n=r.at(-1))&&void 0!==n&&n.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;u<r.length;u++)r[u]=r[u].trim().replace(Sa.slashPipe,"|");return r}function Ai(e,t,n){var r=e.length;if(0===r)return"";for(var u=0;u<r&&e.charAt(r-u-1)===t;)u++;return e.slice(0,r-u)}function wi(e,t,n,r,u){var a=t.href,i=t.title||null,o=e[1].replace(u.other.outputLinkReplace,"$1");r.state.inLink=!0;var s={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:a,title:i,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,s}var Si=un(function e(t){tn(this,e),on(this,"options",void 0),on(this,"rules",void 0),on(this,"lexer",void 0),this.options=t||ba},[{key:"space",value:function(e){var t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}},{key:"code",value:function(e){var t=this.rules.block.code.exec(e);if(t){var n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Ai(n,"\n")}}}},{key:"fences",value:function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],r=function(e,t,n){var r=e.match(n.other.indentCodeCompensation);if(null===r)return t;var u=r[1];return t.split("\n").map(function(e){var t=e.match(n.other.beginningSpace);return null===t?e:yn(t,1)[0].length>=u.length?e.slice(u.length):e}).join("\n")}(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}},{key:"heading",value:function(e){var t=this.rules.block.heading.exec(e);if(t){var n=t[2].trim();if(this.rules.other.endingHash.test(n)){var r=Ai(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}},{key:"hr",value:function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Ai(t[0],"\n")}}},{key:"blockquote",value:function(e){var t=this.rules.block.blockquote.exec(e);if(t){for(var n=Ai(t[0],"\n").split("\n"),r="",u="",a=[];n.length>0;){var i=!1,o=[],s=void 0;for(s=0;s<n.length;s++)if(this.rules.other.blockquoteStart.test(n[s]))o.push(n[s]),i=!0;else{if(i)break;o.push(n[s])}n=n.slice(s);var c=o.join("\n"),l=c.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");r=r?"".concat(r,"\n").concat(c):c,u=u?"".concat(u,"\n").concat(l):l;var f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,a,!0),this.lexer.state.top=f,0===n.length)break;var d=a.at(-1);if("code"===(null==d?void 0:d.type))break;if("blockquote"===(null==d?void 0:d.type)){var p=d,h=p.raw+"\n"+n.join("\n"),v=this.blockquote(h);a[a.length-1]=v,r=r.substring(0,r.length-p.raw.length)+v.raw,u=u.substring(0,u.length-p.text.length)+v.text;break}if("list"!==(null==d?void 0:d.type));else{var m=d,D=m.raw+"\n"+n.join("\n"),y=this.list(D);a[a.length-1]=y,r=r.substring(0,r.length-d.raw.length)+y.raw,u=u.substring(0,u.length-m.raw.length)+y.raw,n=D.substring(a.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:r,tokens:a,text:u}}}},{key:"list",value:function(e){var t=this,n=this.rules.block.list.exec(e);if(n){var r=n[1].trim(),u=r.length>1,a={type:"list",raw:"",ordered:u,start:u?+r.slice(0,-1):"",loose:!1,items:[]};r=u?"\\d{1,9}\\".concat(r.slice(-1)):"\\".concat(r),this.options.pedantic&&(r=u?r:"[*+-]");for(var i=this.rules.other.listItemRegex(r),o=!1;e;){var s=!1,c="",l="";if(!(n=i.exec(e))||this.rules.block.hr.test(e))break;c=n[0],e=e.substring(c.length);var f=n[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,function(e){return" ".repeat(3*e.length)}),d=e.split("\n",1)[0],p=!f.trim(),h=0;if(this.options.pedantic?(h=2,l=f.trimStart()):p?h=n[1].length+1:(h=(h=n[2].search(this.rules.other.nonSpaceChar))>4?1:h,l=f.slice(h),h+=n[1].length),p&&this.rules.other.blankLine.test(d)&&(c+=d+"\n",e=e.substring(d.length+1),s=!0),!s)for(var v=this.rules.other.nextBulletRegex(h),m=this.rules.other.hrRegex(h),D=this.rules.other.fencesBeginRegex(h),y=this.rules.other.headingBeginRegex(h),g=this.rules.other.htmlBeginRegex(h);e;){var F=e.split("\n",1)[0],E=void 0;if(d=F,E=this.options.pedantic?d=d.replace(this.rules.other.listReplaceNesting," "):d.replace(this.rules.other.tabCharGlobal," "),D.test(d)||y.test(d)||g.test(d)||v.test(d)||m.test(d))break;if(E.search(this.rules.other.nonSpaceChar)>=h||!d.trim())l+="\n"+E.slice(h);else{if(p||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||D.test(f)||y.test(f)||m.test(f))break;l+="\n"+d}!p&&!d.trim()&&(p=!0),c+=F+"\n",e=e.substring(F.length+1),f=E.slice(h)}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0));var _=null,b=void 0;this.options.gfm&&(_=this.rules.other.listIsTask.exec(l))&&(b="[ ] "!==_[0],l=l.replace(this.rules.other.listReplaceTask,"")),a.items.push({type:"list_item",raw:c,task:!!_,checked:b,loose:!1,text:l,tokens:[]}),a.raw+=c}var C=a.items.at(-1);if(!C)return;C.raw=C.raw.trimEnd(),C.text=C.text.trimEnd(),a.raw=a.raw.trimEnd();for(var k=0;k<a.items.length;k++)if(this.lexer.state.top=!1,a.items[k].tokens=this.lexer.blockTokens(a.items[k].text,[]),!a.loose){var A=a.items[k].tokens.filter(function(e){return"space"===e.type}),w=A.length>0&&A.some(function(e){return t.rules.other.anyLine.test(e.raw)});a.loose=w}if(a.loose)for(var S=0;S<a.items.length;S++)a.items[S].loose=!0;return a}}},{key:"html",value:function(e){var t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}},{key:"def",value:function(e){var t=this.rules.block.def.exec(e);if(t){var n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",u=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:u}}}},{key:"table",value:function(e){var t,n=this,r=this.rules.block.table.exec(e);if(r&&this.rules.other.tableDelimiter.test(r[2])){var u=ki(r[1]),a=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=null!==(t=r[3])&&void 0!==t&&t.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],o={type:"table",raw:r[0],header:[],align:[],rows:[]};if(u.length===a.length){var s,c=an(a);try{for(c.s();!(s=c.n()).done;){var l=s.value;this.rules.other.tableAlignRight.test(l)?o.align.push("right"):this.rules.other.tableAlignCenter.test(l)?o.align.push("center"):this.rules.other.tableAlignLeft.test(l)?o.align.push("left"):o.align.push(null)}}catch(e){c.e(e)}finally{c.f()}for(var f=0;f<u.length;f++)o.header.push({text:u[f],tokens:this.lexer.inline(u[f]),header:!0,align:o.align[f]});var d,p=an(i);try{for(p.s();!(d=p.n()).done;){var h=d.value;o.rows.push(ki(h,o.header.length).map(function(e,t){return{text:e,tokens:n.lexer.inline(e),header:!1,align:o.align[t]}}))}}catch(e){p.e(e)}finally{p.f()}return o}}}},{key:"lheading",value:function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}},{key:"paragraph",value:function(e){var t=this.rules.block.paragraph.exec(e);if(t){var n="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}},{key:"text",value:function(e){var t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}},{key:"escape",value:function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}},{key:"tag",value:function(e){var t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}},{key:"link",value:function(e){var t=this.rules.inline.link.exec(e);if(t){var n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;var r=Ai(n.slice(0,-1),"\\");if((n.length-r.length)%2==0)return}else{var u=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var n=0,r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&--n<0)return r;return n>0?-2:-1}(t[2],"()");if(-2===u)return;if(u>-1){var a=(0===t[0].indexOf("!")?5:4)+t[1].length+u;t[2]=t[2].substring(0,u),t[0]=t[0].substring(0,a).trim(),t[3]=""}}var i=t[2],o="";if(this.options.pedantic){var s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],o=s[3])}else o=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i.slice(1):i.slice(1,-1)),wi(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}},{key:"reflink",value:function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var r=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!r){var u=n[0].charAt(0);return{type:"text",raw:u,text:u}}return wi(n,r,n[0],this.lexer,this.rules)}}},{key:"emStrong",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){var u,a,i=gn(r[0]).length-1,o=i,s=0,c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+i);null!=(r=c.exec(t));)if(u=r[1]||r[2]||r[3]||r[4]||r[5]||r[6])if(a=gn(u).length,r[3]||r[4])o+=a;else if(!((r[5]||r[6])&&i%3)||(i+a)%3){if(!((o-=a)>0)){a=Math.min(a,a+o+s);var l=gn(r[0])[0].length,f=e.slice(0,i+r.index+l+a);if(Math.min(i,a)%2){var d=f.slice(1,-1);return{type:"em",raw:f,text:d,tokens:this.lexer.inlineTokens(d)}}var p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}else s+=a}}},{key:"codespan",value:function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),u=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&u&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}},{key:"br",value:function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}},{key:"del",value:function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}},{key:"autolink",value:function(e){var t,n,r=this.rules.inline.autolink.exec(e);if(r)return n="@"===r[2]?"mailto:"+(t=r[1]):t=r[1],{type:"link",raw:r[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}},{key:"url",value:function(e){var t;if(t=this.rules.inline.url.exec(e)){var n,r;if("@"===t[2])r="mailto:"+(n=t[0]);else{var u;do{var a,i;u=t[0],t[0]=null!==(a=null===(i=this.rules.inline._backpedal.exec(t[0]))||void 0===i?void 0:i[0])&&void 0!==a?a:""}while(u!==t[0]);n=t[0],r="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}},{key:"inlineText",value:function(e){var t=this.rules.inline.text.exec(e);if(t){var n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}}]),xi=function(){function e(t){tn(this,e),on(this,"tokens",void 0),on(this,"options",void 0),on(this,"state",void 0),on(this,"tokenizer",void 0),on(this,"inlineQueue",void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=t||ba,this.options.tokenizer=this.options.tokenizer||new Si,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var n={other:Sa,block:gi.normal,inline:Fi.normal};this.options.pedantic?(n.block=gi.pedantic,n.inline=Fi.pedantic):this.options.gfm&&(n.block=gi.gfm,this.options.breaks?n.inline=Fi.breaks:n.inline=Fi.gfm),this.tokenizer.rules=n}return un(e,[{key:"lex",value:function(e){e=e.replace(Sa.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(var t=0;t<this.inlineQueue.length;t++){var n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}},{key:"blockTokens",value:function(e){var t,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],u=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=function(){var t,a,i;if(null!==(t=n.options.extensions)&&void 0!==t&&null!==(t=t.block)&&void 0!==t&&t.some(function(t){return!!(i=t.call({lexer:n},e,r))&&(e=e.substring(i.raw.length),r.push(i),!0)}))return 0;if(i=n.tokenizer.space(e)){e=e.substring(i.raw.length);var o=r.at(-1);return 1===i.raw.length&&void 0!==o?o.raw+="\n":r.push(i),0}if(i=n.tokenizer.code(e)){e=e.substring(i.raw.length);var s=r.at(-1);return"paragraph"===(null==s?void 0:s.type)||"text"===(null==s?void 0:s.type)?(s.raw+=(s.raw.endsWith("\n")?"":"\n")+i.raw,s.text+="\n"+i.text,n.inlineQueue.at(-1).src=s.text):r.push(i),0}if(i=n.tokenizer.fences(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.heading(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.hr(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.blockquote(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.list(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.html(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.def(e)){e=e.substring(i.raw.length);var c=r.at(-1);return"paragraph"===(null==c?void 0:c.type)||"text"===(null==c?void 0:c.type)?(c.raw+=(c.raw.endsWith("\n")?"":"\n")+i.raw,c.text+="\n"+i.raw,n.inlineQueue.at(-1).src=c.text):n.tokens.links[i.tag]||(n.tokens.links[i.tag]={href:i.href,title:i.title},r.push(i)),0}if(i=n.tokenizer.table(e))return e=e.substring(i.raw.length),r.push(i),0;if(i=n.tokenizer.lheading(e))return e=e.substring(i.raw.length),r.push(i),0;var l=e;if(null!==(a=n.options.extensions)&&void 0!==a&&a.startBlock){var f,d=1/0,p=e.slice(1);n.options.extensions.startBlock.forEach(function(e){"number"==typeof(f=e.call({lexer:n},p))&&f>=0&&(d=Math.min(d,f))}),d<1/0&&d>=0&&(l=e.substring(0,d+1))}if(n.state.top&&(i=n.tokenizer.paragraph(l))){var h=r.at(-1);return u&&"paragraph"===(null==h?void 0:h.type)?(h.raw+=(h.raw.endsWith("\n")?"":"\n")+i.raw,h.text+="\n"+i.text,n.inlineQueue.pop(),n.inlineQueue.at(-1).src=h.text):r.push(i),u=l.length!==e.length,e=e.substring(i.raw.length),0}if(i=n.tokenizer.text(e)){e=e.substring(i.raw.length);var v=r.at(-1);return"text"===(null==v?void 0:v.type)?(v.raw+=(v.raw.endsWith("\n")?"":"\n")+i.raw,v.text+="\n"+i.text,n.inlineQueue.pop(),n.inlineQueue.at(-1).src=v.text):r.push(i),0}if(e){var m="Infinite loop on byte: "+e.charCodeAt(0);if(n.options.silent)return console.error(m),1;throw new Error(m)}};for(this.options.pedantic&&(e=e.replace(Sa.tabCharGlobal," ").replace(Sa.spaceLine,""));e&&(0===(t=a())||1!==t););return this.state.top=!0,r}},{key:"inline",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.inlineQueue.push({src:e,tokens:t}),t}},{key:"inlineTokens",value:function(e){var t,n,r,u=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=e,o=null;if(this.tokens.links){var s=Object.keys(this.tokens.links);if(s.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(i));)s.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(i));)i=i.slice(0,o.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(i));)r=o[2]?o[2].length:0,i=i.slice(0,o.index+r)+"["+"a".repeat(o[0].length-r-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=null!==(t=null===(n=this.options.hooks)||void 0===n||null===(n=n.emStrongMask)||void 0===n?void 0:n.call({lexer:this},i))&&void 0!==t?t:i;for(var c,l=!1,f="",d=function(){var t,n,r;if(l||(f=""),l=!1,null!==(t=u.options.extensions)&&void 0!==t&&null!==(t=t.inline)&&void 0!==t&&t.some(function(t){return!!(r=t.call({lexer:u},e,a))&&(e=e.substring(r.raw.length),a.push(r),!0)}))return 0;if(r=u.tokenizer.escape(e))return e=e.substring(r.raw.length),a.push(r),0;if(r=u.tokenizer.tag(e))return e=e.substring(r.raw.length),a.push(r),0;if(r=u.tokenizer.link(e))return e=e.substring(r.raw.length),a.push(r),0;if(r=u.tokenizer.reflink(e,u.tokens.links)){e=e.substring(r.raw.length);var o=a.at(-1);return"text"===r.type&&"text"===(null==o?void 0:o.type)?(o.raw+=r.raw,o.text+=r.text):a.push(r),0}if(r=u.tokenizer.emStrong(e,i,f))return e=e.substring(r.raw.length),a.push(r),0;if(r=u.tokenizer.codespan(e))return e=e.substring(r.raw.length),a.push(r),0;if(r=u.tokenizer.br(e))return e=e.substring(r.raw.length),a.push(r),0;if(r=u.tokenizer.del(e))return e=e.substring(r.raw.length),a.push(r),0;if(r=u.tokenizer.autolink(e))return e=e.substring(r.raw.length),a.push(r),0;if(!u.state.inLink&&(r=u.tokenizer.url(e)))return e=e.substring(r.raw.length),a.push(r),0;var s=e;if(null!==(n=u.options.extensions)&&void 0!==n&&n.startInline){var c,d=1/0,p=e.slice(1);u.options.extensions.startInline.forEach(function(e){"number"==typeof(c=e.call({lexer:u},p))&&c>=0&&(d=Math.min(d,c))}),d<1/0&&d>=0&&(s=e.substring(0,d+1))}if(r=u.tokenizer.inlineText(s)){e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(f=r.raw.slice(-1)),l=!0;var h=a.at(-1);return"text"===(null==h?void 0:h.type)?(h.raw+=r.raw,h.text+=r.text):a.push(r),0}if(e){var v="Infinite loop on byte: "+e.charCodeAt(0);if(u.options.silent)return console.error(v),1;throw new Error(v)}};e&&(0===(c=d())||1!==c););return a}}],[{key:"rules",get:function(){return{block:gi,inline:Fi}}},{key:"lex",value:function(t,n){return new e(n).lex(t)}},{key:"lexInline",value:function(t,n){return new e(n).inlineTokens(t)}}])}(),Oi=un(function e(t){tn(this,e),on(this,"options",void 0),on(this,"parser",void 0),this.options=t||ba},[{key:"space",value:function(e){return""}},{key:"code",value:function(e){var t,n=e.text,r=e.lang,u=e.escaped,a=null===(t=(r||"").match(Sa.notSpaceStart))||void 0===t?void 0:t[0],i=n.replace(Sa.endingNewline,"")+"\n";return a?'<pre><code class="language-'+bi(a)+'">'+(u?i:bi(i,!0))+"</code></pre>\n":"<pre><code>"+(u?i:bi(i,!0))+"</code></pre>\n"}},{key:"blockquote",value:function(e){var t=e.tokens;return"<blockquote>\n".concat(this.parser.parse(t),"</blockquote>\n")}},{key:"html",value:function(e){return e.text}},{key:"def",value:function(e){return""}},{key:"heading",value:function(e){var t=e.tokens,n=e.depth;return"<h".concat(n,">").concat(this.parser.parseInline(t),"</h").concat(n,">\n")}},{key:"hr",value:function(e){return"<hr>\n"}},{key:"list",value:function(e){for(var t=e.ordered,n=e.start,r="",u=0;u<e.items.length;u++){var a=e.items[u];r+=this.listitem(a)}var i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+i+">\n"}},{key:"listitem",value:function(e){var t="";if(e.task){var n,r=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===(null===(n=e.tokens[0])||void 0===n?void 0:n.type)?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=r+" "+bi(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),"<li>".concat(t,"</li>\n")}},{key:"checkbox",value:function(e){return"<input "+(e.checked?'checked="" ':"")+'disabled="" type="checkbox">'}},{key:"paragraph",value:function(e){var t=e.tokens;return"<p>".concat(this.parser.parseInline(t),"</p>\n")}},{key:"table",value:function(e){for(var t="",n="",r=0;r<e.header.length;r++)n+=this.tablecell(e.header[r]);t+=this.tablerow({text:n});for(var u="",a=0;a<e.rows.length;a++){var i=e.rows[a];n="";for(var o=0;o<i.length;o++)n+=this.tablecell(i[o]);u+=this.tablerow({text:n})}return u&&(u="<tbody>".concat(u,"</tbody>")),"<table>\n<thead>\n"+t+"</thead>\n"+u+"</table>\n"}},{key:"tablerow",value:function(e){var t=e.text;return"<tr>\n".concat(t,"</tr>\n")}},{key:"tablecell",value:function(e){var t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?"<".concat(n,' align="').concat(e.align,'">'):"<".concat(n,">"))+t+"</".concat(n,">\n")}},{key:"strong",value:function(e){var t=e.tokens;return"<strong>".concat(this.parser.parseInline(t),"</strong>")}},{key:"em",value:function(e){var t=e.tokens;return"<em>".concat(this.parser.parseInline(t),"</em>")}},{key:"codespan",value:function(e){var t=e.text;return"<code>".concat(bi(t,!0),"</code>")}},{key:"br",value:function(e){return"<br>"}},{key:"del",value:function(e){var t=e.tokens;return"<del>".concat(this.parser.parseInline(t),"</del>")}},{key:"link",value:function(e){var t=e.href,n=e.title,r=e.tokens,u=this.parser.parseInline(r),a=Ci(t);if(null===a)return u;var i='<a href="'+(t=a)+'"';return n&&(i+=' title="'+bi(n)+'"'),i+">"+u+"</a>"}},{key:"image",value:function(e){var t=e.href,n=e.title,r=e.text,u=e.tokens;u&&(r=this.parser.parseInline(u,this.parser.textRenderer));var a=Ci(t);if(null===a)return bi(r);var i='<img src="'.concat(t=a,'" alt="').concat(r,'"');return n&&(i+=' title="'.concat(bi(n),'"')),i+">"}},{key:"text",value:function(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:bi(e.text)}}]),Bi=un(function e(){tn(this,e)},[{key:"strong",value:function(e){return e.text}},{key:"em",value:function(e){return e.text}},{key:"codespan",value:function(e){return e.text}},{key:"del",value:function(e){return e.text}},{key:"html",value:function(e){return e.text}},{key:"text",value:function(e){return e.text}},{key:"link",value:function(e){return""+e.text}},{key:"image",value:function(e){return""+e.text}},{key:"br",value:function(){return""}}]),Ii=function(){function e(t){tn(this,e),on(this,"options",void 0),on(this,"renderer",void 0),on(this,"textRenderer",void 0),this.options=t||ba,this.options.renderer=this.options.renderer||new Oi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Bi}return un(e,[{key:"parse",value:function(e){for(var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="",r=0;r<e.length;r++){var u,a=e[r];if(null!==(u=this.options.extensions)&&void 0!==u&&null!==(u=u.renderers)&&void 0!==u&&u[a.type]){var i=a,o=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==o||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(i.type)){n+=o||"";continue}}var s=a;switch(s.type){case"space":n+=this.renderer.space(s);continue;case"hr":n+=this.renderer.hr(s);continue;case"heading":n+=this.renderer.heading(s);continue;case"code":n+=this.renderer.code(s);continue;case"table":n+=this.renderer.table(s);continue;case"blockquote":n+=this.renderer.blockquote(s);continue;case"list":n+=this.renderer.list(s);continue;case"html":n+=this.renderer.html(s);continue;case"def":n+=this.renderer.def(s);continue;case"paragraph":n+=this.renderer.paragraph(s);continue;case"text":for(var c=s,l=this.renderer.text(c);r+1<e.length&&"text"===e[r+1].type;)c=e[++r],l+="\n"+this.renderer.text(c);n+=t?this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):l;continue;default:var f='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(f),"";throw new Error(f)}}return n}},{key:"parseInline",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.renderer,n="",r=0;r<e.length;r++){var u,a=e[r];if(null!==(u=this.options.extensions)&&void 0!==u&&null!==(u=u.renderers)&&void 0!==u&&u[a.type]){var i=this.options.extensions.renderers[a.type].call({parser:this},a);if(!1!==i||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){n+=i||"";continue}}var o=a;switch(o.type){case"escape":case"text":n+=t.text(o);break;case"html":n+=t.html(o);break;case"link":n+=t.link(o);break;case"image":n+=t.image(o);break;case"strong":n+=t.strong(o);break;case"em":n+=t.em(o);break;case"codespan":n+=t.codespan(o);break;case"br":n+=t.br(o);break;case"del":n+=t.del(o);break;default:var s='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}return n}}],[{key:"parse",value:function(t,n){return new e(n).parse(t)}},{key:"parseInline",value:function(t,n){return new e(n).parseInline(t)}}])}(),Ti=(Fa=un(function e(t){tn(this,e),on(this,"options",void 0),on(this,"block",void 0),this.options=t||ba},[{key:"preprocess",value:function(e){return e}},{key:"postprocess",value:function(e){return e}},{key:"processAllTokens",value:function(e){return e}},{key:"emStrongMask",value:function(e){return e}},{key:"provideLexer",value:function(){return this.block?xi.lex:xi.lexInline}},{key:"provideParser",value:function(){return this.block?Ii.parse:Ii.parseInline}}]),on(Fa,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),on(Fa,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Fa),Pi=un(function e(){tn(this,e),on(this,"defaults",{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}),on(this,"options",this.setOptions),on(this,"parse",this.parseMarkdown(!0)),on(this,"parseInline",this.parseMarkdown(!1)),on(this,"Parser",Ii),on(this,"Renderer",Oi),on(this,"TextRenderer",Bi),on(this,"Lexer",xi),on(this,"Tokenizer",Si),on(this,"Hooks",Ti),this.use.apply(this,arguments)},[{key:"walkTokens",value:function(e,t){var n,r=this,u=[],a=an(e);try{var i=function(){var e=n.value;switch(u=u.concat(t.call(r,e)),e.type){case"table":var a,i=e,o=an(i.header);try{for(o.s();!(a=o.n()).done;){var s=a.value;u=u.concat(r.walkTokens(s.tokens,t))}}catch(e){o.e(e)}finally{o.f()}var c,l=an(i.rows);try{for(l.s();!(c=l.n()).done;){var f,d=an(c.value);try{for(d.s();!(f=d.n()).done;){var p=f.value;u=u.concat(r.walkTokens(p.tokens,t))}}catch(e){d.e(e)}finally{d.f()}}}catch(e){l.e(e)}finally{l.f()}break;case"list":var h=e;u=u.concat(r.walkTokens(h.items,t));break;default:var v,m=e;null!==(v=r.defaults.extensions)&&void 0!==v&&null!==(v=v.childTokens)&&void 0!==v&&v[m.type]?r.defaults.extensions.childTokens[m.type].forEach(function(e){var n=m[e].flat(1/0);u=u.concat(r.walkTokens(n,t))}):m.tokens&&(u=u.concat(r.walkTokens(m.tokens,t)))}};for(a.s();!(n=a.n()).done;)i()}catch(e){a.e(e)}finally{a.f()}return u}},{key:"use",value:function(){for(var e=this,t=this.defaults.extensions||{renderers:{},childTokens:{}},n=arguments.length,r=new Array(n),u=0;u<n;u++)r[u]=arguments[u];return r.forEach(function(n){var r=pn({},n);if(r.async=e.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(function(e){if(!e.name)throw new Error("extension name required");if("renderer"in e){var n=t.renderers[e.name];t.renderers[e.name]=n?function(){for(var t=arguments.length,r=new Array(t),u=0;u<t;u++)r[u]=arguments[u];var a=e.renderer.apply(this,r);return!1===a&&(a=n.apply(this,r)),a}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");var r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),r.extensions=t),n.renderer){var u=e.defaults.renderer||new Oi(e.defaults),a=function(){if(!(i in u))throw new Error("renderer '".concat(i,"' does not exist"));if(["options","parser"].includes(i))return 1;var e=i,t=n.renderer[e],r=u[e];u[e]=function(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];var i=t.apply(u,n);return!1===i&&(i=r.apply(u,n)),i||""}};for(var i in n.renderer)a();r.renderer=u}if(n.tokenizer){var o=e.defaults.tokenizer||new Si(e.defaults),s=function(){if(!(c in o))throw new Error("tokenizer '".concat(c,"' does not exist"));if(["options","rules","lexer"].includes(c))return 1;var e=c,t=n.tokenizer[e],r=o[e];o[e]=function(){for(var e=arguments.length,n=new Array(e),u=0;u<e;u++)n[u]=arguments[u];var a=t.apply(o,n);return!1===a&&(a=r.apply(o,n)),a}};for(var c in n.tokenizer)s();r.tokenizer=o}if(n.hooks){var l=e.defaults.hooks||new Ti,f=function(t){if(!(t in l))throw new Error("hook '".concat(t,"' does not exist"));if(["options","block"].includes(t))return 1;var r=t,u=n.hooks[r],a=l[r];Ti.passThroughHooks.has(t)?l[r]=function(n){if(e.defaults.async&&Ti.passThroughHooksRespectAsync.has(t))return Xt(vn().m(function e(){var t;return vn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,u.call(l,n);case 1:return t=e.v,e.a(2,a.call(l,t))}},e)}))();var r=u.call(l,n);return a.call(l,r)}:l[r]=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(e.defaults.async)return Xt(vn().m(function e(){var t;return vn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,u.apply(l,n);case 1:if(!1!==(t=e.v)){e.n=3;break}return e.n=2,a.apply(l,n);case 2:t=e.v;case 3:return e.a(2,t)}},e)}))();var i=u.apply(l,n);return!1===i&&(i=a.apply(l,n)),i}};for(var d in n.hooks)f(d);r.hooks=l}if(n.walkTokens){var p=e.defaults.walkTokens,h=n.walkTokens;r.walkTokens=function(e){var t=[];return t.push(h.call(this,e)),p&&(t=t.concat(p.call(this,e))),t}}e.defaults=pn(pn({},e.defaults),r)}),this}},{key:"setOptions",value:function(e){return this.defaults=pn(pn({},this.defaults),e),this}},{key:"lexer",value:function(e,t){return xi.lex(e,null!=t?t:this.defaults)}},{key:"parser",value:function(e,t){return Ii.parse(e,null!=t?t:this.defaults)}},{key:"parseMarkdown",value:function(e){var t=this;return function(n,r){var u=pn({},r),a=pn(pn({},t.defaults),u),i=t.onError(!!a.silent,!!a.async);if(!0===t.defaults.async&&!1===u.async)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(En(n)>"u"||null===n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return Xt(vn().m(function r(){var u,i,o,s,c,l,f,d,p,h,v;return vn().w(function(r){for(;;)switch(r.n){case 0:if(!a.hooks){r.n=2;break}return r.n=1,a.hooks.preprocess(n);case 1:c=r.v,r.n=3;break;case 2:c=n;case 3:if(u=c,!a.hooks){r.n=5;break}return r.n=4,a.hooks.provideLexer();case 4:l=r.v,r.n=6;break;case 5:l=e?xi.lex:xi.lexInline;case 6:return f=l,r.n=7,f(u,a);case 7:if(i=r.v,!a.hooks){r.n=9;break}return r.n=8,a.hooks.processAllTokens(i);case 8:d=r.v,r.n=10;break;case 9:d=i;case 10:if(o=d,!a.walkTokens){r.n=11;break}return r.n=11,Promise.all(t.walkTokens(o,a.walkTokens));case 11:if(!a.hooks){r.n=13;break}return r.n=12,a.hooks.provideParser();case 12:p=r.v,r.n=14;break;case 13:p=e?Ii.parse:Ii.parseInline;case 14:return h=p,r.n=15,h(o,a);case 15:if(s=r.v,!a.hooks){r.n=17;break}return r.n=16,a.hooks.postprocess(s);case 16:v=r.v,r.n=18;break;case 17:v=s;case 18:return r.a(2,v)}},r)}))().catch(i);try{a.hooks&&(n=a.hooks.preprocess(n));var o=(a.hooks?a.hooks.provideLexer():e?xi.lex:xi.lexInline)(n,a);a.hooks&&(o=a.hooks.processAllTokens(o)),a.walkTokens&&t.walkTokens(o,a.walkTokens);var s=(a.hooks?a.hooks.provideParser():e?Ii.parse:Ii.parseInline)(o,a);return a.hooks&&(s=a.hooks.postprocess(s)),s}catch(e){return i(e)}}}},{key:"onError",value:function(e,t){return function(n){if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){var r="<p>An error occurred:</p><pre>"+bi(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}}]),ji=new Pi;function Ni(e,t){return ji.parse(e,t)}function zi(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}Ni.options=Ni.setOptions=function(e){return ji.setOptions(e),Ni.defaults=ji.defaults,Ca(Ni.defaults),Ni},Ni.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},Ni.defaults=ba,Ni.use=function(){return ji.use.apply(ji,arguments),Ni.defaults=ji.defaults,Ca(Ni.defaults),Ni},Ni.walkTokens=function(e,t){return ji.walkTokens(e,t)},Ni.parseInline=ji.parseInline,Ni.Parser=Ii,Ni.parser=Ii.parse,Ni.Renderer=Oi,Ni.TextRenderer=Bi,Ni.Lexer=xi,Ni.lexer=xi.lex,Ni.Tokenizer=Si,Ni.Hooks=Ti,Ni.parse=Ni,Ni.options,Ni.setOptions,Ni.use,Ni.walkTokens,Ni.parseInline,Ii.parse,xi.lex;var Ri=new Ni.Renderer;Ri.code=function(e){var t=e.text,n=e.lang,r=void 0===n?"":n,u=e.escaped,a=r?"language-".concat(r):"",i=u?t:zi(t),o=encodeURIComponent(t);return'\n <div class="DocSearch-CodeSnippet">\n <button class="DocSearch-CodeSnippet-CopyButton" data-code="'.concat(o,'" aria-label="copy code">').concat('<svg class="DocSearch-CodeSnippet-CopyIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" /></svg>').concat('<svg class="DocSearch-CodeSnippet-CheckIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5" /></svg>','<span class="DocSearch-CodeSnippet-CopyButton-Label"></span></button>\n <pre><code class="').concat(a,'">').concat(i,"</code></pre>\n </div>\n ")},Ri.link=function(e){var t=e.href,n=e.title,r=e.text,u=n?' title="'.concat(zi(n),'"'):"",a=t?zi(t):"",i=zi(r);return'<a href="'.concat(a,'"').concat(u,' target="_blank" rel="noopener noreferrer">').concat(i,"</a>")};var Mi=nt(function(e){var t=e.content,n=e.copyButtonText,r=e.copyButtonCopiedText,u=e.isStreaming,a=Pe(function(){return Ni.parse(t,{gfm:!0,breaks:!0,renderer:Ri})},[t]),i=Ie(null);return Oe(function(){var e=i.current;if(e)return Array.from(e.querySelectorAll(".DocSearch-CodeSnippet-CopyButton")).forEach(function(e){var t=e.querySelector(".DocSearch-CodeSnippet-CopyButton-Label");t&&(t.textContent=n),e.classList.remove("DocSearch-CodeSnippet-CopyButton--copied")}),e.addEventListener("click",t),function(){e.removeEventListener("click",t)};function t(e){var t,u=e.target.closest(".DocSearch-CodeSnippet-CopyButton");if(u){var a=null!==(t=u.getAttribute("data-code"))&&void 0!==t?t:"";navigator.clipboard.writeText(decodeURIComponent(a)).catch(function(){});var i=u.querySelector(".DocSearch-CodeSnippet-CopyButton-Label");if(i){u.classList.add("DocSearch-CodeSnippet-CopyButton--copied");var o=n;i.textContent=r,setTimeout(function(){u.classList.remove("DocSearch-CodeSnippet-CopyButton--copied"),i.textContent=o},1500)}}}},[a,n,r]),It.createElement("div",{ref:i,className:"DocSearch-Markdown-Content ".concat(u?"DocSearch-Markdown-Content--streaming":""),dangerouslySetInnerHTML:{__html:a}})});function Zi(e){var t=e.part,n=e.translations,r=e.onSearchQueryClick,u=n.searchingText,a=n.preToolCallText,i=n.toolCallResultText;switch(t.state){case"input-streaming":return It.createElement("div",{className:"DocSearch-AskAiScreen-MessageContent-Tool Tool--PartialCall shimmer"},It.createElement(ra,{className:"DocSearch-AskAiScreen-SmallerLoadingIcon"}),It.createElement("span",null,u));case"input-available":return It.createElement("div",{className:"DocSearch-AskAiScreen-MessageContent-Tool Tool--Call shimmer"},It.createElement(ra,{className:"DocSearch-AskAiScreen-SmallerLoadingIcon"}),It.createElement("span",null,a," ",'"'.concat(t.input.query||"",'" ...')));case"output-available":var o,s,c="tool-searchIndex"===t.type?t.output.query:t.input.query,l=null!==(o=null===(s=t.output.hits)||void 0===s?void 0:s.length)&&void 0!==o?o:0;return It.createElement("div",{className:"DocSearch-AskAiScreen-MessageContent-Tool Tool--Result"},It.createElement(wn,null),It.createElement("span",null,i," ",r?It.createElement("span",{role:"button",tabIndex:0,className:"DocSearch-AskAiScreen-MessageContent-Tool-Query",onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),r(c||""))},onClick:function(){return r(c||"")}}," ",'"',c||"",'"'):It.createElement("span",{className:"DocSearch-AskAiScreen-MessageContent-Tool-Query"},' "',c||"",'"')," ","found ",l," results"));default:return null}}function Li(e){return e.replace(/<[^>]*>/g,"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}Mi.displayName="MemoizedMarkdown";var $i=function(e,t){var n=t[0].parts.find(function(e){return"text"===e.type}),r=null!=n&&n.text?Li(n.text):"";return{query:e,objectID:r,messages:t,type:"askAI",anchor:"stored",content:null,hierarchy:{lvl0:"askAI",lvl1:r,lvl2:null,lvl3:null,lvl4:null,lvl5:null,lvl6:null},url:"",url_without_anchor:""}},qi=function(e){return null==e?void 0:e.parts.find(function(e){return"text"===e.type})};function Ui(e){var t;return e&&(null===(t=e.message)||void 0===t?void 0:t.includes("AI-217"))||!1}var Hi=["translations"];function Vi(e){var t=e.disclaimerText;return It.createElement("p",{className:"DocSearch-AskAiScreen-Disclaimer"},t)}function Wi(e){var t,n,r,u=e.exchange,a=e.askAiError,i=e.isLastExchange,o=e.loadingStatus,s=e.onSearchQueryClick,c=e.translations,l=e.conversations,f=e.onFeedback,d=e.agentStudio,p=u.userMessage,h=u.assistantMessage,v=c.stoppedStreamingText,m=void 0===v?"You stopped this response":v,D=c.errorTitleText,y=void 0===D?"Chat error":D,g=c.preToolCallText,F=void 0===g?"Searching...":g,E=c.afterToolCallText,_=void 0===E?"Searched for":E,b=c.duringToolCallText,C=void 0===b?"Searching...":b,k=Ui(a),A=Pe(function(){return qi(h)},[h]),w=Pe(function(){return qi(p)},[p]),S=It.useMemo(function(){return e=h,t=[],n=new Set,e?(e.parts.forEach(function(e){if("text"===e.type&&0!==e.text.length){var r,u=e.text.replace(/```[\s\S]*?```/g,"").replace(/`[^`]*`/g,""),a=an(u.matchAll(/\[([^\]]*)\]\(([^)]+)\)/g));try{for(a.s();!(r=a.n()).done;){var i=r.value,o=i[1].trim(),s=i[2];n.has(s)||(n.add(s),t.push({url:s,title:o||void 0}))}}catch(e){a.e(e)}finally{a.f()}var c,l=an(u.matchAll(/(?<!\]\()https?:\/\/[^\s<>"{}|\\^`[\]]+/g));try{for(l.s();!(c=l.n()).done;){var f=c.value[0].replace(/[.,;:!?]+$/,"");n.has(f)||(n.add(f),t.push({url:f}))}}catch(e){l.e(e)}finally{l.f()}}}),t):[];var e,t,n},[h]),x=It.useMemo(function(){return function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];if("tool-searchIndex"===r.type&&"output-available"===r.state){for(var u=[],a=n;a<e.length;){var i=e[a];if("tool-searchIndex"!==i.type||"output-available"!==i.state)break;var o,s,c=(null!==(o=null===(s=i.output)||void 0===s?void 0:s.query)&&void 0!==o?o:"").trim();c&&c.length>0&&u.push(c),a++}u.length>1?t.push({type:"aggregated-tool-call",queries:u}):1===u.length&&t.push(r),n=a-1}else t.push(r)}return t}((null==h?void 0:h.parts)||[])},[h]),O=(null===(t=p.metadata)||void 0===t?void 0:t.stopped)||(null==h||null===(n=h.metadata)||void 0===n?void 0:n.stopped),B=!O&&(!i||i&&"ready"===o&&Boolean(h)),I=["submitted","streaming"].includes(o)&&i&&!x.some(function(e){return"step-start"!==e.type}),T=d?(null==h?void 0:h.id)||u.id:(null==p?void 0:p.id)||u.id;return It.createElement("div",{className:"DocSearch-AskAiScreen-Response-Container"},It.createElement("div",{className:"DocSearch-AskAiScreen-Response"},It.createElement("div",{className:"DocSearch-AskAiScreen-Message DocSearch-AskAiScreen-Message--user"},It.createElement("p",{className:"DocSearch-AskAiScreen-Query"},null!==(r=null==w?void 0:w.text)&&void 0!==r?r:"")),It.createElement("div",{className:"DocSearch-AskAiScreen-Message DocSearch-AskAiScreen-Message--assistant"},It.createElement("div",{className:"DocSearch-AskAiScreen-MessageContent"},"error"===o&&a&&i&&!k&&It.createElement("div",{className:"DocSearch-AskAiScreen-MessageContent DocSearch-AskAiScreen-Error"},It.createElement(oa,null),It.createElement("div",{className:"DocSearch-AskAiScreen-Error-Content"},It.createElement("h4",{className:"DocSearch-AskAiScreen-Error-Title"},y),It.createElement(Mi,{content:a.message,copyButtonText:"",copyButtonCopiedText:"",isStreaming:!1}))),I&&It.createElement("div",{className:"DocSearch-AskAiScreen-MessageContent-Reasoning"},It.createElement("span",{className:"shimmer"},c.thinkingText||"Thinking...")),x.map(function(e,t){var n=t;return"string"==typeof e?It.createElement(Mi,{key:n,content:e,copyButtonText:c.copyButtonText||"Copy",copyButtonCopiedText:c.copyButtonCopiedText||"Copied!",isStreaming:"streaming"===o}):"aggregated-tool-call"===e.type?It.createElement(_a,{key:n,queries:e.queries,translations:c,onSearchQueryClick:s}):"reasoning"===e.type&&"streaming"===e.state?It.createElement("div",{key:n,className:"DocSearch-AskAiScreen-MessageContent-Reasoning shimmer"},It.createElement(ra,{className:"DocSearch-AskAiScreen-SmallerLoadingIcon"}),It.createElement("span",{className:"shimmer"},"Reasoning...")):"text"===e.type?It.createElement(Mi,{key:n,content:e.text,copyButtonText:c.copyButtonText||"Copy",copyButtonCopiedText:c.copyButtonCopiedText||"Copied!",isStreaming:"streaming"===e.state}):"tool-searchIndex"===e.type||"tool-algolia_search_index"===e.type?It.createElement(Zi,{key:n,translations:{preToolCallText:F,searchingText:C,toolCallResultText:_},part:e,onSearchQueryClick:s}):null})),O&&It.createElement("p",{className:"DocSearck-AskAiScreen-MessageContent-Stopped"},m)),It.createElement("div",{className:"DocSearch-AskAiScreen-Answer-Footer"},It.createElement(Ki,{id:T,showActions:B,latestAssistantMessageContent:(null==A?void 0:A.text)||null,translations:c,conversations:l,onFeedback:f}))),S.length>0?It.createElement(Ji,{urlsToDisplay:S,relatedSourcesText:c.relatedSourcesText}):null)}function Ki(e){var t=e.id,n=e.showActions,r=e.latestAssistantMessageContent,u=e.translations,a=e.conversations,i=e.onFeedback,o=It.useMemo(function(){var e,n,r=null===(e=a.getOne)||void 0===e?void 0:e.call(a,t);return null!==(n=null==r?void 0:r.feedback)&&void 0!==n?n:null},[a,t]),s=yn(It.useState(o),2),c=s[0],l=s[1],f=yn(It.useState(!1),2),d=f[0],p=f[1],h=yn(It.useState(null),2),v=h[0],m=h[1],D=function(){var e=Xt(vn().m(function e(n){var r;return vn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!d){e.n=1;break}return e.a(2);case 1:return m(null),p(!0),e.p=2,e.n=3,null==i?void 0:i(t,"like"===n?1:0);case 3:l(n),e.n=5;break;case 4:e.p=4,r=e.v,m(r);case 5:return e.p=5,p(!1),e.f(5);case 6:return e.a(2)}},e,null,[[2,4,5,6]])}));return function(t){return e.apply(this,arguments)}}(),y=u.likeButtonTitle,g=void 0===y?"Like":y,F=u.dislikeButtonTitle,E=void 0===F?"Dislike":F,_=u.thanksForFeedbackText,b=void 0===_?"Thanks for your feedback!":_;return n&&r?It.createElement("div",{className:"DocSearch-AskAiScreen-Actions"},null===c?It.createElement(It.Fragment,null,d?It.createElement(ra,{className:"DocSearch-AskAiScreen-SmallerLoadingIcon"}):It.createElement(It.Fragment,null,It.createElement(Xi,{title:g,onClick:function(){return D("like")}}),It.createElement(eo,{title:E,onClick:function(){return D("dislike")}})),v&&It.createElement("p",{className:"DocSearch-AskAiScreen-FeedbackText"},v.message||"An error occured")):It.createElement("p",{className:"DocSearch-AskAiScreen-FeedbackText DocSearch-AskAiScreen-FeedbackText--visible"},b),It.createElement(Yi,{translations:u,onClick:function(){return navigator.clipboard.writeText(r)}})):null}function Ji(e){var t=e.urlsToDisplay,n=e.relatedSourcesText;return It.createElement("div",{className:"DocSearch-AskAiScreen-RelatedSources"},It.createElement("p",{className:"DocSearch-AskAiScreen-RelatedSources-Title"},n||"Related sources"),It.createElement("div",{className:"DocSearch-AskAiScreen-RelatedSources-List"},t.length>0&&t.map(function(e){return It.createElement("a",{key:e.url,href:e.url,className:"DocSearch-AskAiScreen-RelatedSources-Item-Link",target:"_blank",rel:"noopener noreferrer"},It.createElement(Gi,null),It.createElement("span",null,e.title||e.url))})))}function Qi(e){var t=e.translations,n=void 0===t?{}:t,r=hn(e,Hi),u=n.disclaimerText,a=void 0===u?"Answers are generated with AI which can make mistakes. Verify responses.":u,i=n.threadDepthExceededMessage,o=void 0===i?"This conversation is now closed to keep responses accurate.":i,s=n.startNewConversationButtonText,c=void 0===s?"Start a new conversation":s,l=r.messages,f=r.askAiError,d=r.status,p=r.agentStudio,h=Pe(function(){return"error"===d&&Ui(f)},[d,f]),v=Pe(function(){for(var e=[],t=0;t<l.length;t++)if("user"===l[t].role){var n,r=l[t],u="assistant"===(null===(n=l[t+1])||void 0===n?void 0:n.role)?l[t+1]:null;e.push({id:r.id,userMessage:r,assistantMessage:u}),u&&t++}return h&&e.length>0&&(e[e.length-1].assistantMessage||e.pop()),e},[l,h]),m=function(e){r.onAskAiToggle(!1),r.setQuery(e)},D=h&&l.some(function(e){return"assistant"===e.role});return It.createElement("div",{className:"DocSearch-AskAiScreen DocSearch-AskAiScreen-Container"},D&&It.createElement("div",{className:"DocSearch-AskAiScreen-MessageContent DocSearch-AskAiScreen-Error DocSearch-AskAiScreen-Error--ThreadDepth"},It.createElement("div",{className:"DocSearch-AskAiScreen-Error-Content"},It.createElement("p",null,o," ",It.createElement("button",{type:"button",className:"DocSearch-ThreadDepthError-Link",onClick:r.onNewConversation},c)," ","to continue."))),It.createElement(Vi,{disclaimerText:a}),It.createElement("div",{className:"DocSearch-AskAiScreen-Body"},It.createElement("div",{className:"DocSearch-AskAiScreen-ExchangesList"},v.slice().reverse().map(function(e,t){return It.createElement(Wi,{key:e.id,exchange:e,askAiError:r.askAiError,isLastExchange:0===t,loadingStatus:r.status,translations:n,conversations:r.conversations,agentStudio:p,onSearchQueryClick:m,onFeedback:r.onFeedback})}))))}function Gi(){return It.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},It.createElement("line",{x1:"4",x2:"20",y1:"9",y2:"9"}),It.createElement("line",{x1:"4",x2:"20",y1:"15",y2:"15"}),It.createElement("line",{x1:"10",x2:"8",y1:"3",y2:"21"}),It.createElement("line",{x1:"16",x2:"14",y1:"3",y2:"21"}))}function Yi(e){var t=e.onClick,n=e.translations,r=n.copyButtonTitle,u=void 0===r?"Copy":r,a=n.copyButtonCopiedText,i=void 0===a?"Copied!":a,o=yn(Se(!1),2),s=o[0],c=o[1];return Oe(function(){if(s){var e=setTimeout(function(){c(!1)},1500);return function(){return clearTimeout(e)}}},[s]),It.createElement("button",{type:"button",className:"DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-CopyButton ".concat(s?"DocSearch-AskAiScreen-CopyButton--copied":""),disabled:s,title:s?i:u,onClick:function(){t(),c(!0)}},s?It.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-check-icon lucide-check"},It.createElement("path",{d:"M20 6 9 17l-5-5"})):It.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-copy-icon lucide-copy"},It.createElement("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),It.createElement("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})))}function Xi(e){var t=e.title,n=e.onClick;return It.createElement("button",{type:"button",className:"DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-LikeButton",title:t,onClick:n},It.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-thumbs-up-icon lucide-thumbs-up"},It.createElement("path",{d:"M7 10v12"}),It.createElement("path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"})))}function eo(e){var t=e.title,n=e.onClick;return It.createElement("button",{type:"button",className:"DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-DislikeButton",title:t,onClick:n},It.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-thumbs-down-icon lucide-thumbs-down"},It.createElement("path",{d:"M17 14V2"}),It.createElement("path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z"})))}var to=["hit","attribute","tagName"];function no(e,t){return t.split(".").reduce(function(e,t){return null!=e&&e[t]?e[t]:null},e)}function ro(e){var t=e.hit,n=e.attribute,r=e.tagName;return $(void 0===r?"span":r,pn(pn({},hn(e,to)),{},{dangerouslySetInnerHTML:{__html:no(t,"_snippetResult.".concat(n,".value"))||no(t,n)}}))}var uo=["item","getItemProps","onItemClick","translations","collection"];function ao(e){var t=It.useMemo(function(){return e.title?e.title.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#039;/g,"'"):null},[e.title]);return e.collection&&0!==e.collection.items.length?"askAI"===e.collection.source.sourceId?It.createElement("section",{className:"DocSearch-AskAi-Section"},It.createElement("ul",e.getListProps({source:e.collection.source}),It.createElement(oo,sn({item:e.collection.items[0],translations:e.translations},e)))):(e.collection.source.sourceId,It.createElement("section",{className:"DocSearch-Hits"},It.createElement("div",{className:"DocSearch-Hit-source"},t),It.createElement("ul",e.getListProps({source:e.collection.source}),e.collection.items.map(function(t,n){return It.createElement(io,sn({key:[e.title,t.objectID].join(":"),item:t,index:n},e))})))):null}function io(e){var t=e.item,n=e.index,r=e.renderIcon,u=e.renderAction,a=e.getItemProps,i=e.onItemClick,o=e.collection,s=e.hitComponent;return It.createElement("li",sn({className:["DocSearch-Hit",t.__docsearch_parent&&"DocSearch-Hit--Child"].filter(Boolean).join(" ")},a({item:t,source:o.source,onClick:function(e){i(t,e)}})),It.createElement(s,{hit:t},It.createElement("div",{className:"DocSearch-Hit-Container"},r({item:t,index:n}),t.hierarchy[t.type]&&"lvl1"===t.type&&It.createElement("div",{className:"DocSearch-Hit-content-wrapper"},It.createElement(ro,{className:"DocSearch-Hit-title",hit:t,attribute:"hierarchy.lvl1"}),t.content&&It.createElement(ro,{className:"DocSearch-Hit-path",hit:t,attribute:"content"})),"askAI"===t.type&&It.createElement("div",{className:"DocSearch-Hit-content-wrapper"},It.createElement("span",{className:"DocSearch-Hit-title"},Li(t.hierarchy.lvl1||""))),t.hierarchy[t.type]&&("lvl2"===t.type||"lvl3"===t.type||"lvl4"===t.type||"lvl5"===t.type||"lvl6"===t.type)&&It.createElement("div",{className:"DocSearch-Hit-content-wrapper"},It.createElement(ro,{className:"DocSearch-Hit-title",hit:t,attribute:"hierarchy.".concat(t.type)}),It.createElement(ro,{className:"DocSearch-Hit-path",hit:t,attribute:"hierarchy.lvl1"})),"content"===t.type&&It.createElement("div",{className:"DocSearch-Hit-content-wrapper"},It.createElement(ro,{className:"DocSearch-Hit-title",hit:t,attribute:"content"}),It.createElement(ro,{className:"DocSearch-Hit-path",hit:t,attribute:"hierarchy.lvl1"})),u({item:t}))))}function oo(e){var t=e.item,n=e.getItemProps,r=e.onItemClick,u=e.translations,a=e.collection,i=hn(e,uo),o=u||{},s=o.askAiPlaceholder,c=void 0===s?"Ask AI: ":s,l=o.noResultsAskAiPlaceholder,f=void 0===l?"Didn't find it in the docs? Ask AI to help: ":l,d=1===i.state.collections.length?f:c;return It.createElement("li",sn({className:"DocSearch-Hit"},n({item:t,source:a.source,onClick:function(e){r(t,e)}})),It.createElement("div",{className:"DocSearch-Hit--AskAI"},It.createElement("div",{className:"DocSearch-Hit-AskAIButton DocSearch-Hit-Container"},It.createElement("div",{className:" DocSearch-Hit-AskAIButton-icon DocSearch-Hit-icon"},It.createElement(ua,null)),It.createElement("div",{className:"DocSearch-Hit-AskAIButton-title"},It.createElement("span",{className:"DocSearch-Hit-AskAIButton-title-highlight"},d),It.createElement("mark",{className:"DocSearch-Hit-AskAIButton-title-query"},String(t.query||""))))))}var so=["onAskAiToggle"];function co(e){var t=e.onAskAiToggle,n=hn(e,so),r=It.useMemo(function(){return n.state.collections[2]},[n.state]);return It.useEffect(function(){r&&0!==r.items.length||t(!0)},[r,t]),It.createElement("div",{className:"DocSearch-Dropdown-Container DocSearch-Conversation-History"},It.createElement(ao,sn({},n,{key:r.source.sourceId,title:"",translations:n.translations,collection:r,renderIcon:function(){return It.createElement("div",{className:"DocSearch-Hit-icon"},It.createElement(ua,null))},renderAction:function(e){var t=e.item;return It.createElement("div",{className:"DocSearch-Hit-action"},It.createElement("button",{type:"button",className:"DocSearch-Hit-action-button",onClick:function(e){e.preventDefault(),e.stopPropagation(),n.conversations.remove(t),n.refresh()}},It.createElement(ia,null)))}})))}function lo(e){var t=e.translations,n=void 0===t?{}:t,r=n.titleText,u=void 0===r?"Unable to fetch results":r,a=n.helpText,i=void 0===a?"You might want to check your network connection.":a;return It.createElement("div",{className:"DocSearch-ErrorScreen"},It.createElement("div",{className:"DocSearch-Screen-Icon"},It.createElement(va,null)),It.createElement("p",{className:"DocSearch-Title"},u),It.createElement("p",{className:"DocSearch-Help"},i))}function fo(e){var t=e.translations,n=void 0===t?{}:t,r=e.suggestedQuestions,u=void 0===r?[]:r,a=e.selectSuggestedQuestion,i=n.newConversationTitle,o=void 0===i?"How can I help you today?":i,s=n.newConversationDescription,c=void 0===s?"I search through your documentation to help you find setup guides, feature details and troubleshooting tips, fast.":s;return It.createElement("div",{className:"DocSearch-NewConversationScreen"},It.createElement("h3",{className:"DocSearch-NewConversationScreen-Title"},o),It.createElement("p",{className:"DocSearch-NewConversationScreen-Description"},c),It.createElement("div",{className:"DocSearch-NewConversationScreen-SuggestedQuestions"},u.map(function(e){return It.createElement("button",{key:e.objectID,type:"button",className:"DocSearch-NewConversationScreen-SuggestedQuestion",onClick:function(){return a(e)}},e.question)})))}var po=["translations"];function ho(e){var t=e.translations,n=void 0===t?{}:t,r=hn(e,po),u=n.noResultsText,a=void 0===u?"No results found for":u,i=n.suggestedQueryText,o=void 0===i?"Try searching for":i,s=n.reportMissingResultsText,c=void 0===s?"Believe this query should return results?":s,l=n.reportMissingResultsLinkText,f=void 0===l?"Let us know.":l,d=r.state.context.searchSuggestions;return It.createElement("div",{className:"DocSearch-NoResults ".concat(r.canHandleAskAi?"DocSearch-NoResults--withAskAi":"")},It.createElement("div",{className:"DocSearch-Screen-Icon"},It.createElement(ma,null)),It.createElement("p",{className:"DocSearch-Title"},a,' "',It.createElement("strong",null,r.state.query),'"'),d&&d.length>0&&It.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},It.createElement("p",{className:"DocSearch-Help"},o,":"),It.createElement("div",{className:"DocSearch-NoResults-Prefill-List-Items"},d.slice(0,3).reduce(function(e,t){return[].concat(gn(e),[It.createElement("p",{key:t},It.createElement(wn,{size:16}),It.createElement("button",{className:"DocSearch-Prefill",key:t,type:"button",onClick:function(){r.setQuery(t.toLowerCase()+" "),r.refresh(),r.inputRef.current.focus()}},t))])},[]))),r.getMissingResultsUrl&&It.createElement("p",{className:"DocSearch-Help"},"".concat(c," "),It.createElement("a",{href:r.getMissingResultsUrl({query:r.state.query}),target:"_blank",rel:"noopener noreferrer"},f)))}var vo=["translations"];function mo(e){var t=e.translations,n=void 0===t?{}:t,r=hn(e,vo);return It.createElement("div",{className:"DocSearch-Dropdown-Container"},r.state.collections.map(function(e){if(0===e.items.length)return null;var t=jn(e.items[0]);return It.createElement(ao,sn({},r,{key:e.source.sourceId,translations:n,title:t,collection:e,renderIcon:function(t){var n,r=t.item,u=t.index;return It.createElement(It.Fragment,null,r.__docsearch_parent&&It.createElement("svg",{className:"DocSearch-Hit-Tree",viewBox:"0 0 24 54"},It.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.__docsearch_parent!==(null===(n=e.items[u+1])||void 0===n?void 0:n.__docsearch_parent)?It.createElement("path",{d:"M8 6v21M20 27H8.3"}):It.createElement("path",{d:"M8 6v42M20 27H8.3"}))),It.createElement("div",{className:"DocSearch-Hit-icon"},It.createElement(la,{type:r.type})))},renderAction:function(){return It.createElement("div",{className:"DocSearch-Hit-action"},It.createElement(sa,null))}}))}),r.resultsFooterComponent&&It.createElement("section",{className:"DocSearch-HitsFooter"},It.createElement(r.resultsFooterComponent,{state:r.state})))}var Do=["translations"];function yo(e){var t=e.translations,n=void 0===t?{}:t,r=hn(e,Do),u=n.recentSearchesTitle,a=void 0===u?"Recent":u,i=n.saveRecentSearchButtonTitle,o=void 0===i?"Save this search":i,s=n.removeRecentSearchButtonTitle,c=void 0===s?"Remove this search from history":s,l=n.favoriteSearchesTitle,f=void 0===l?"Favorite":l,d=n.removeFavoriteSearchButtonTitle,p=void 0===d?"Remove this search from favorites":d,h=n.recentConversationsTitle,v=void 0===h?"Recent conversations":h,m=n.removeRecentConversationButtonTitle,D=void 0===m?"Remove this conversation from history":m;return It.createElement("div",{className:"DocSearch-Dropdown-Container"},It.createElement(ao,sn({},r,{title:a,collection:r.state.collections[0],renderIcon:function(){return It.createElement("div",{className:"DocSearch-Hit-icon"},It.createElement(aa,null))},renderAction:function(e){var t=e.item;return It.createElement(It.Fragment,null,It.createElement("div",{className:"DocSearch-Hit-action"},It.createElement("button",{className:"DocSearch-Hit-action-button",title:o,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),r.favoriteSearches.add(t),r.recentSearches.remove(t),r.refresh()}},It.createElement(pa,null))),It.createElement("div",{className:"DocSearch-Hit-action"},It.createElement("button",{className:"DocSearch-Hit-action-button",title:c,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),r.recentSearches.remove(t),r.refresh()}},It.createElement(ia,null))))}})),It.createElement(ao,sn({},r,{title:f,collection:r.state.collections[1],renderIcon:function(){return It.createElement("div",{className:"DocSearch-Hit-icon"},It.createElement(pa,null))},renderAction:function(e){var t=e.item;return It.createElement("div",{className:"DocSearch-Hit-action"},It.createElement("button",{className:"DocSearch-Hit-action-button",title:p,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),r.favoriteSearches.remove(t),r.refresh()}},It.createElement(ia,null)))}})),It.createElement(ao,sn({},r,{title:v,collection:r.state.collections[2],renderIcon:function(){return It.createElement("div",{className:"DocSearch-Hit-icon"},It.createElement(ua,null))},renderAction:function(e){var t=e.item;return It.createElement("div",{className:"DocSearch-Hit-action"},It.createElement("button",{className:"DocSearch-Hit-action-button",title:D,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),r.conversations.remove(t),r.refresh()}},It.createElement(ia,null)))}})))}var go=["translations"],Fo=It.memo(function(e){var t,n=e.translations,r=void 0===n?{}:n,u=hn(e,go);return u.canHandleAskAi&&u.isAskAiActive&&"conversation-history"===u.askAiState?It.createElement(co,u):u.canHandleAskAi&&u.isAskAiActive&&"new-conversation"===u.askAiState?It.createElement(fo,{translations:null==r?void 0:r.newConversation,selectSuggestedQuestion:u.selectSuggestedQuestion,suggestedQuestions:u.suggestedQuestions}):u.isAskAiActive&&u.canHandleAskAi?It.createElement(Qi,sn({},u,{messages:u.messages,status:u.status,askAiError:u.askAiError,translations:null==r?void 0:r.askAiScreen,agentStudio:u.agentStudio})):"error"===(null===(t=u.state)||void 0===t?void 0:t.status)?It.createElement(lo,{translations:null==r?void 0:r.errorScreen}):u.state.query?u.hasCollections||u.canHandleAskAi?It.createElement(It.Fragment,null,It.createElement(mo,sn({},u,{translations:null==r?void 0:r.resultsScreen})),u.canHandleAskAi&&1===u.state.collections.length&&It.createElement(ho,sn({},u,{translations:null==r?void 0:r.noResultsScreen}))):It.createElement(ho,sn({},u,{translations:null==r?void 0:r.noResultsScreen})):It.createElement(yo,sn({},u,{hasCollections:u.hasCollections,translations:null==r?void 0:r.startScreen}))},function(e,t){return"loading"===t.state.status||"stalled"===t.state.status});function Eo(e){var t=e.size,n=void 0===t?20:t,r=e.color,u=void 0===r?"currentColor":r;return It.createElement("svg",{width:n,height:n,className:"DocSearch-Back-Icon",viewBox:"0 0 24 24",fill:"none",stroke:u,strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},It.createElement("path",{d:"m12 19-7-7 7-7"}),It.createElement("path",{d:"M19 12H5"}))}var _o=["children","className","onClick"],bo=It.createContext({open:!1,setOpen:function(e){}});function Co(e){var t=e.children,n=yn(It.useState(!1),2),r=n[0],u=n[1],a=It.useRef(null);return It.useEffect(function(){function e(e){var t;null!==(t=a.current)&&void 0!==t&&t.contains(e.target)||u(!1)}return r&&window.addEventListener("click",e),function(){window.removeEventListener("click",e)}},[r]),It.createElement(bo.Provider,{value:{open:r,setOpen:u}},It.createElement("div",{ref:a,className:"DocSearch-Menu"},t))}function ko(e){var t=e.heading,n=e.shimmer,r=void 0!==n&&n;return It.createElement("span",{className:"DocSearch-Modal-heading".concat(r?" shimmer":"")},t)}Co.Trigger=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,u=e.disabled,a=It.useContext(bo),i=a.open,o=a.setOpen;return It.createElement("button",{type:"button",className:"DocSearch-Menu-trigger ".concat(r).concat(u?" disabled":""),"aria-disabled":u,onClick:function(){u||o(!i)}},t)},Co.Content=function(e){var t=e.children,n=It.useContext(bo).open;return It.createElement("div",{className:"DocSearch-Menu-content".concat(n?" open":"")},t)},Co.Item=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,u=e.onClick,a=hn(e,_o),i=It.useContext(bo).setOpen;return It.createElement("button",sn({type:"button",className:"DocSearch-Menu-item ".concat(r),onClick:function(e){u&&(u(e),i(!1))}},a),t)};var Ao=["translations","askAiState","onAskAiToggle","setAskAiState"];function wo(e){var t=e.translations,n=void 0===t?{}:t,r=e.askAiState,u=e.onAskAiToggle,a=e.setAskAiState,i=hn(e,Ao),o=n.clearButtonTitle,s=void 0===o?"Clear":o,c=n.clearButtonAriaLabel,l=void 0===c?"Clear the query":c,f=n.closeButtonText,d=void 0===f?"Close":f,p=n.closeButtonAriaLabel,h=void 0===p?"Close":p,v=n.searchInputLabel,m=void 0===v?"Search":v,D=n.backToKeywordSearchButtonText,y=void 0===D?"Back to keyword search":D,g=n.backToKeywordSearchButtonAriaLabel,F=void 0===g?"Back to keyword search":g,E=n.placeholderTextAskAiStreaming,_=void 0===E?"Answering...":E,b=n.newConversationPlaceholder,C=void 0===b?"Ask a question":b,k=n.conversationHistoryTitle,A=void 0===k?"My conversation history":k,w=n.startNewConversationText,S=void 0===w?"Start a new conversation":w,x=n.viewConversationHistoryText,O=void 0===x?"Conversation history":x,B=n.threadDepthErrorPlaceholder,I=void 0===B?"Conversation limit reached":B,T=i.getFormProps({inputElement:i.inputRef.current}).onReset;It.useEffect(function(){i.autoFocus&&i.inputRef.current&&i.inputRef.current.focus()},[i.autoFocus,i.inputRef]),It.useEffect(function(){i.isFromSelection&&i.inputRef.current&&i.inputRef.current.select()},[i.isFromSelection,i.inputRef]);var P=It.useMemo(function(){var e=i.state.collections[2];return!!e&&e.items.length>0},[i.state.collections]),j=i.getInputProps({inputElement:i.inputRef.current,autoFocus:i.autoFocus,maxLength:512}),N=new Set(["ArrowUp","ArrowDown","Enter"]),z=j.onKeyDown,R=j.onChange,M="streaming"===i.askAiStatus||"submitted"===i.askAiStatus,Z="stalled"===i.state.status,L=i.isAskAiActive&&"conversation-history"!==r,$=i.isThreadDepthError||!1,q=i.placeholder;"new-conversation"===r&&(q=C),$&&i.isAskAiActive&&(q=I);var U=null;M&&(U=_),"conversation-history"===r&&(U=A),It.useEffect(function(){"streaming"!==i.askAiStatus&&"submitted"!==i.askAiStatus&&i.inputRef.current&&i.inputRef.current.focus()},[i.askAiStatus,i.inputRef]);var H=pn(pn({},j),{},{enterKeyHint:i.isAskAiActive?"enter":"search",onKeyDown:function(e){if(i.isAskAiActive&&N.has(e.key))return"Enter"===e.key&&!M&&i.state.query&&i.onAskAgain(i.state.query),e.preventDefault(),void e.stopPropagation();null==z||z(e)},onChange:function(e){if(i.isAskAiActive)return i.setQuery(e.currentTarget.value),e.preventDefault(),void e.stopPropagation();null==R||R(e)},disabled:M||$&&i.isAskAiActive}),V=It.useCallback(function(){if(!$)return"conversation-history"===r?(u(!0),void a("initial")):void u(!1);i.onNewConversation()},[r,$,u,a,i]);return It.createElement(It.Fragment,null,It.createElement("form",{className:"DocSearch-Form",onSubmit:function(e){e.preventDefault()},onReset:T},i.isAskAiActive?It.createElement(It.Fragment,null,It.createElement("button",{type:"button",tabIndex:0,className:"DocSearch-Action DocSearch-AskAi-Return",title:y,"aria-label":F,onClick:V},It.createElement(Eo,null))):It.createElement(It.Fragment,null,Z&&It.createElement("div",{className:"DocSearch-LoadingIndicator"},It.createElement(ra,null)),!Z&&It.createElement("label",sn({className:"DocSearch-MagnifierLabel"},i.getLabelProps()),It.createElement(wn,null),It.createElement("span",{className:"DocSearch-VisuallyHiddenForAccessibility"},m))),U&&It.createElement(ko,{heading:U,shimmer:M}),It.createElement("input",sn({className:"DocSearch-Input",ref:i.inputRef},H,{placeholder:q,hidden:Boolean(U)})),It.createElement("div",{className:"DocSearch-Actions"},It.createElement("button",{className:"DocSearch-Clear",type:"reset","aria-label":l,hidden:!i.state.query,tabIndex:i.state.query?0:-1,"aria-hidden":i.state.query?"false":"true"},s),i.state.query&&It.createElement("div",{className:"DocSearch-Divider"}),M&&It.createElement(It.Fragment,null,It.createElement("button",{type:"button",className:"DocSearch-Action DocSearch-StopStreaming",onClick:i.onStopAskAiStreaming},It.createElement(ha,null)),It.createElement("div",{className:"DocSearch-Divider"})),L&&It.createElement(It.Fragment,null,It.createElement(Co,null,It.createElement(Co.Trigger,{className:"DocSearch-Action"},It.createElement(Da,null)),It.createElement(Co.Content,null,It.createElement(Co.Item,{onClick:i.onNewConversation},It.createElement(ga,null),S),P&&It.createElement(Co.Item,{onClick:i.onViewConversationHistory},It.createElement(ya,null),O))),It.createElement("div",{className:"DocSearch-Divider"})),It.createElement("button",{type:"button",title:d,className:"DocSearch-Action DocSearch-Close","aria-label":h,onClick:i.onClose},It.createElement(ia,null)))))}function So(){if("undefined"!=typeof window&&window.localStorage){var e=[];for(var t in window.localStorage)if(t.includes("__DOCSEARCH_")){var n=window.localStorage[t];e.push({key:t,size:n.length+t.length})}e.sort(function(e,t){return t.size-e.size});for(var r=Math.ceil(e.length/2),u=0;u<r&&u<e.length;u++)try{window.localStorage.removeItem(e[u].key)}catch(e){}}}function xo(e){return!1===function(){if("undefined"==typeof window||!("localStorage"in window))return!1;var e="__TEST_KEY__";try{return window.localStorage.setItem(e,""),window.localStorage.removeItem(e),!0}catch(e){return!1}}()?{setItem:function(){},getItem:function(){return[]}}:{setItem:function(t){!function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(n){if(n instanceof DOMException&&"QuotaExceededError"===n.name)try{So(),window.localStorage.setItem(e,JSON.stringify(t))}catch(e){}}}(e,t)},getItem:function(){var t=window.localStorage.getItem(e);if(null===t)return[];try{var n=JSON.parse(t);return Array.isArray(n)?n:[]}catch(t){return window.localStorage.removeItem(e),[]}}}}var Oo=["_highlightResult","_snippetResult"];function Bo(e){var t=e.key,n=e.limit,r=void 0===n?5:n,u=xo(t),a=u.getItem().slice(0,r);return{add:function(e){var t=e;t._highlightResult,t._snippetResult;var n=hn(t,Oo),i=a.findIndex(function(e){return e.objectID===n.objectID});i>-1&&a.splice(i,1),a.unshift(n),a=a.slice(0,r),u.setItem(a)},remove:function(e){a=a.filter(function(t){return t.objectID!==e.objectID}),u.setItem(a)},getAll:function(){return a}}}var Io,To="vercel.ai.error",Po=Symbol.for(To),jo=function(e){function t(e){var n,r=e.name,i=e.message,o=e.cause;return a(this,t),(n=u(this,t,[i]))[Io]=!0,n.name=r,n.cause=o,n}return f(t,e),o(t,null,[{key:"isInstance",value:function(e){return t.hasMarker(e,To)}},{key:"hasMarker",value:function(e,t){var n=Symbol.for(t);return null!=e&&"object"==_(e)&&n in e&&"boolean"==typeof e[n]&&!0===e[n]}}])}(C(Error));Io=Po;var No=jo;function zo(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}var Ro,Mo="AI_InvalidArgumentError",Zo="vercel.ai.error.".concat(Mo),Lo=Symbol.for(Zo),$o=function(e){function t(e){var n,r=e.message,i=e.cause,o=e.argument;return a(this,t),(n=u(this,t,[{name:Mo,message:r,cause:i}]))[Ro]=!0,n.argument=o,n}return f(t,e),o(t,null,[{key:"isInstance",value:function(e){return No.hasMarker(e,Zo)}}])}(No);Ro=Lo;var qo,Uo="AI_JSONParseError",Ho="vercel.ai.error.".concat(Uo),Vo=Symbol.for(Ho),Wo=function(e){function t(e){var n,r=e.text,i=e.cause;return a(this,t),(n=u(this,t,[{name:Uo,message:"JSON parsing failed: Text: ".concat(r,".\nError message: ").concat(zo(i)),cause:i}]))[qo]=!0,n.text=r,n}return f(t,e),o(t,null,[{key:"isInstance",value:function(e){return No.hasMarker(e,Ho)}}])}(No);qo=Vo;var Ko,Jo="AI_TypeValidationError",Qo="vercel.ai.error.".concat(Jo),Go=Symbol.for(Qo);Ko=Go;var Yo=function(e){function t(e){var n,r=e.value,i=e.cause;return a(this,t),(n=u(this,t,[{name:Jo,message:"Type validation failed: Value: ".concat(JSON.stringify(r),".\nError message: ").concat(zo(i)),cause:i}]))[Ko]=!0,n.value=r,n}return f(t,e),o(t,null,[{key:"isInstance",value:function(e){return No.hasMarker(e,Qo)}},{key:"wrap",value:function(e){var n=e.value,r=e.cause;return t.isInstance(r)&&r.value===n?r:new t({value:n,cause:r})}}])}(No),Xo=function(){function e(t,n){var r;return tn(this,e),(r=en(this,e,[t])).name="ParseError",r.type=n.type,r.field=n.field,r.value=n.value,r.line=n.line,r}return ln(e,bn(Error)),un(e)}();function es(e){}var ts=function(){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.onError,u=n.onRetry,a=n.onComment;return tn(this,e),en(this,e,[{start:function(e){t=function(e){if("function"==typeof e)throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");var t,n=e.onEvent,r=void 0===n?es:n,u=e.onError,a=void 0===u?es:u,i=e.onRetry,o=void 0===i?es:i,s=e.onComment,c="",l=!0,f="",d="";function p(e){if(""===e)return f.length>0&&r({id:t,event:d||void 0,data:f.endsWith("\n")?f.slice(0,-1):f}),t=void 0,f="",void(d="");if(e.startsWith(":"))s&&s(e.slice(e.startsWith(": ")?2:1));else{var n=e.indexOf(":");if(-1===n)h(e,"",e);else{var u=e.slice(0,n),a=" "===e[n+1]?2:1;h(u,e.slice(n+a),e)}}}function h(e,n,r){switch(e){case"event":d=n;break;case"data":f="".concat(f).concat(n,"\n");break;case"id":t=n.includes("\0")?void 0:n;break;case"retry":/^\d+$/.test(n)?o(parseInt(n,10)):a(new Xo('Invalid `retry` value: "'.concat(n,'"'),{type:"invalid-retry",value:n,line:r}));break;default:a(new Xo('Unknown field "'.concat(e.length>20?"".concat(e.slice(0,20),"…"):e,'"'),{type:"unknown-field",field:e,value:n,line:r}))}}return{feed:function(e){var t,n=l?e.replace(/^\xEF\xBB\xBF/,""):e,r=function(e){for(var t=[],n="",r=0;r<e.length;){var u=e.indexOf("\r",r),a=e.indexOf("\n",r),i=-1;if(-1!==u&&-1!==a?i=Math.min(u,a):-1!==u?i=u===e.length-1?-1:u:-1!==a&&(i=a),-1===i){n=e.slice(r);break}var o=e.slice(r,i);t.push(o),"\r"===e[(r=i+1)-1]&&"\n"===e[r]&&r++}return[t,n]}("".concat(c).concat(n)),u=yn(r,2),a=u[0],i=u[1],o=an(a);try{for(o.s();!(t=o.n()).done;)p(t.value)}catch(e){o.e(e)}finally{o.f()}c=i,l=!1},reset:function(){c&&(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).consume&&p(c),l=!0,t=void 0,f="",d="",c=""}}}({onEvent:function(t){e.enqueue(t)},onError:function(t){"terminate"===r?e.error(t):"function"==typeof r&&r(t)},onRetry:u,onComment:a})},transform:function(e){t.feed(e)}}])}return ln(e,bn(TransformStream)),un(e)}();function ns(e,t,n){var r;function u(n,r){var u,a,o;for(var s in Object.defineProperty(n,"_zod",{value:null!==(u=n._zod)&&void 0!==u?u:{},enumerable:!1}),null!==(a=(o=n._zod).traits)&&void 0!==a||(o.traits=new Set),n._zod.traits.add(e),t(n,r),i.prototype)s in n||Object.defineProperty(n,s,{value:i.prototype[s].bind(n)});n._zod.constr=i,n._zod.def=r}var a=function(e){function t(){return tn(this,t),en(this,t,arguments)}return ln(t,e),un(t)}(null!==(r=null==n?void 0:n.Parent)&&void 0!==r?r:Object);function i(e){var t,r,i=null!=n&&n.Parent?new a:this;u(i,e),null!==(t=(r=i._zod).deferred)&&void 0!==t||(r.deferred=[]);var o,s=an(i._zod.deferred);try{for(s.s();!(o=s.n()).done;)(0,o.value)()}catch(e){s.e(e)}finally{s.f()}return i}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(i,"init",{value:u}),Object.defineProperty(i,Symbol.hasInstance,{value:function(t){var r;return!!(null!=n&&n.Parent&&t instanceof n.Parent)||(null==t||null===(r=t._zod)||void 0===r||null===(r=r.traits)||void 0===r?void 0:r.has(e))}}),Object.defineProperty(i,"name",{value:e}),i}var rs=function(){function e(){return tn(this,e),en(this,e,["Encountered Promise during synchronous parse. Use .parseAsync() instead."])}return ln(e,bn(Error)),un(e)}(),us=function(){function e(t){var n;return tn(this,e),(n=en(this,e,["Encountered unidirectional transform during encode: ".concat(t)])).name="ZodEncodeError",n}return ln(e,bn(Error)),un(e)}(),as={};function is(e){return as}function os(e){var t=Object.values(e).filter(function(e){return"number"==typeof e}),n=Object.entries(e).filter(function(e){var n=yn(e,2),r=n[0];return n[1],-1===t.indexOf(+r)}).map(function(e){var t=yn(e,2);return t[0],t[1]});return n}function ss(e,t){return"bigint"==typeof t?t.toString():t}function cs(e){return{get value(){var t=e();return Object.defineProperty(this,"value",{value:t}),t}}}function ls(e){return null==e}function fs(e){var t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}var ds=Symbol("evaluating");function ps(e,t,n){var r=void 0;Object.defineProperty(e,t,{get:function(){if(r!==ds)return void 0===r&&(r=ds,r=n()),r},set:function(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function hs(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function vs(){for(var e={},t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var u=0,a=n;u<a.length;u++){var i=a[u],o=Object.getOwnPropertyDescriptors(i);Object.assign(e,o)}return Object.defineProperties({},e)}function ms(e){return JSON.stringify(e)}var Ds="captureStackTrace"in Error?Error.captureStackTrace:function(){};function ys(e){return"object"===En(e)&&null!==e&&!Array.isArray(e)}var gs=cs(function(){var e;if("undefined"!=typeof navigator&&null!==(e=navigator)&&void 0!==e&&null!==(e=e.userAgent)&&void 0!==e&&e.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Fs(e){if(!1===ys(e))return!1;var t=e.constructor;if(void 0===t)return!0;var n=t.prototype;return!1!==ys(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Es(e){return Fs(e)?pn({},e):Array.isArray(e)?gn(e):e}var _s=new Set(["string","number","symbol"]);function bs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Cs(e,t,n){var r=new e._zod.constr(null!=t?t:e._zod.def);return(!t||null!=n&&n.parent)&&(r._zod.parent=e),r}function ks(e){var t=e;if(!t)return{};if("string"==typeof t)return{error:function(){return t}};if(void 0!==(null==t?void 0:t.message)){if(void 0!==(null==t?void 0:t.error))throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?pn(pn({},t),{},{error:function(){return t.error}}):t}var As={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ws(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!0===e.aborted)return!0;for(var n=t;n<e.issues.length;n++){var r;if(!0!==(null===(r=e.issues[n])||void 0===r?void 0:r.continue))return!0}return!1}function Ss(e,t){return t.map(function(t){var n,r;return null!==(n=(r=t).path)&&void 0!==n||(r.path=[]),t.path.unshift(e),t})}function xs(e){return"string"==typeof e?e:null==e?void 0:e.message}function Os(e,t,n){var r,u=pn(pn({},e),{},{path:null!==(r=e.path)&&void 0!==r?r:[]});if(!e.message){var a,i,o,s,c,l,f,d,p,h=null!==(a=null!==(i=null!==(o=null!==(s=xs(null===(c=e.inst)||void 0===c||null===(c=c._zod.def)||void 0===c||null===(l=c.error)||void 0===l?void 0:l.call(c,e)))&&void 0!==s?s:xs(null==t||null===(f=t.error)||void 0===f?void 0:f.call(t,e)))&&void 0!==o?o:xs(null===(d=n.customError)||void 0===d?void 0:d.call(n,e)))&&void 0!==i?i:xs(null===(p=n.localeError)||void 0===p?void 0:p.call(n,e)))&&void 0!==a?a:"Invalid input";u.message=h}return delete u.inst,delete u.continue,null!=t&&t.reportInput||delete u.input,u}function Bs(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Is(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Ts(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0],u=t[1],a=t[2];return"string"==typeof r?{message:r,code:"custom",input:u,inst:a}:pn({},r)}var Ps=function(e,t){e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ss,2),Object.defineProperty(e,"toString",{value:function(){return e.message},enumerable:!1})},js=ns("$ZodError",Ps),Ns=ns("$ZodError",Ps,{Parent:Error}),zs=function(e){return function(t,n,r,u){var a=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},a);if(i instanceof Promise)throw new rs;if(i.issues.length){var o,s=new(null!==(o=null==u?void 0:u.Err)&&void 0!==o?o:e)(i.issues.map(function(e){return Os(e,a,is())}));throw Ds(s,null==u?void 0:u.callee),s}return i.value}},Rs=function(e){return function(){var t=Xt(vn().m(function t(n,r,u,a){var i,o,s,c;return vn().w(function(t){for(;;)switch(t.n){case 0:if(i=u?Object.assign(u,{async:!0}):{async:!0},!((o=n._zod.run({value:r,issues:[]},i))instanceof Promise)){t.n=2;break}return t.n=1,o;case 1:o=t.v;case 2:if(!o.issues.length){t.n=3;break}throw c=new(null!==(s=null==a?void 0:a.Err)&&void 0!==s?s:e)(o.issues.map(function(e){return Os(e,i,is())})),Ds(c,null==a?void 0:a.callee),c;case 3:return t.a(2,o.value)}},t)}));return function(e,n,r,u){return t.apply(this,arguments)}}()},Ms=function(e){return function(t,n,r){var u=r?pn(pn({},r),{},{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},u);if(a instanceof Promise)throw new rs;return a.issues.length?{success:!1,error:new(null!=e?e:js)(a.issues.map(function(e){return Os(e,u,is())}))}:{success:!0,data:a.value}}},Zs=Ms(Ns),Ls=function(e){return function(){var t=Xt(vn().m(function t(n,r,u){var a,i;return vn().w(function(t){for(;;)switch(t.n){case 0:if(a=u?Object.assign(u,{async:!0}):{async:!0},!((i=n._zod.run({value:r,issues:[]},a))instanceof Promise)){t.n=2;break}return t.n=1,i;case 1:i=t.v;case 2:return t.a(2,i.issues.length?{success:!1,error:new e(i.issues.map(function(e){return Os(e,a,is())}))}:{success:!0,data:i.value})}},t)}));return function(e,n,r){return t.apply(this,arguments)}}()},$s=Ls(Ns),qs=/^[cC][^\s-]{8,}$/,Us=/^[0-9a-z]+$/,Hs=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Vs=/^[0-9a-vA-V]{20}$/,Ws=/^[A-Za-z0-9]{27}$/,Ks=/^[a-zA-Z0-9_-]{21}$/,Js=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Qs=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Gs=function(e){return e?new RegExp("^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-".concat(e,"[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$")):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/},Ys=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Xs=/^(?:(?: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])$/,ec=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,tc=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,nc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,uc=/^[A-Za-z0-9_-]*$/,ac=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ic=/^\+(?:[0-9]){6,14}[0-9]$/,oc="(?:(?:\\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])))",sc=new RegExp("^".concat(oc,"$"));function cc(e){var t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?"".concat(t):0===e.precision?"".concat(t,":[0-5]\\d"):"".concat(t,":[0-5]\\d\\.\\d{").concat(e.precision,"}"):"".concat(t,"(?::[0-5]\\d(?:\\.\\d+)?)?")}var lc=/^-?\d+$/,fc=/^-?\d+(?:\.\d+)?/,dc=/^(?:true|false)$/i,pc=/^null$/i,hc=/^[^A-Z]*$/,vc=/^[^a-z]*$/,mc=ns("$ZodCheck",function(e,t){var n,r,u;null!==(n=e._zod)&&void 0!==n||(e._zod={}),e._zod.def=t,null!==(r=(u=e._zod).onattach)&&void 0!==r||(u.onattach=[])}),Dc={number:"number",bigint:"bigint",object:"date"},yc=ns("$ZodCheckLessThan",function(e,t){mc.init(e,t);var n=Dc[En(t.value)];e._zod.onattach.push(function(e){var n,r=e._zod.bag,u=null!==(n=t.inclusive?r.maximum:r.exclusiveMaximum)&&void 0!==n?n:Number.POSITIVE_INFINITY;t.value<u&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=function(r){(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),gc=ns("$ZodCheckGreaterThan",function(e,t){mc.init(e,t);var n=Dc[En(t.value)];e._zod.onattach.push(function(e){var n,r=e._zod.bag,u=null!==(n=t.inclusive?r.minimum:r.exclusiveMinimum)&&void 0!==n?n:Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=function(r){(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fc=ns("$ZodCheckMultipleOf",function(e,t){mc.init(e,t),e._zod.onattach.push(function(e){var n,r;null!==(n=(r=e._zod.bag).multipleOf)&&void 0!==n||(r.multipleOf=t.value)}),e._zod.check=function(n){if(En(n.value)!==En(t.value))throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){var n=(e.toString().split(".")[1]||"").length,r=t.toString(),u=(r.split(".")[1]||"").length;if(0===u&&/\d?e-\d?/.test(r)){var a=r.match(/\d?e-(\d?)/);null!=a&&a[1]&&(u=Number.parseInt(a[1]))}var i=n>u?n:u;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}(n.value,t.value))||n.issues.push({origin:En(n.value),code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ec=ns("$ZodCheckNumberFormat",function(e,t){var n;mc.init(e,t),t.format=t.format||"float64";var r=null===(n=t.format)||void 0===n?void 0:n.includes("int"),u=r?"int":"number",a=yn(As[t.format],2),i=a[0],o=a[1];e._zod.onattach.push(function(e){var n=e._zod.bag;n.format=t.format,n.minimum=i,n.maximum=o,r&&(n.pattern=lc)}),e._zod.check=function(n){var a=n.value;if(r){if(!Number.isInteger(a))return void n.issues.push({expected:u,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?n.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:u,continue:!t.abort}):n.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:u,continue:!t.abort}))}a<i&&n.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>o&&n.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inst:e})}}),_c=ns("$ZodCheckMaxSize",function(e,t){var n,r;mc.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=function(e){var t=e.value;return!ls(t)&&void 0!==t.size}),e._zod.onattach.push(function(e){var n,r=null!==(n=e._zod.bag.maximum)&&void 0!==n?n:Number.POSITIVE_INFINITY;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=function(n){var r=n.value;r.size<=t.maximum||n.issues.push({origin:Bs(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),bc=ns("$ZodCheckMinSize",function(e,t){var n,r;mc.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=function(e){var t=e.value;return!ls(t)&&void 0!==t.size}),e._zod.onattach.push(function(e){var n,r=null!==(n=e._zod.bag.minimum)&&void 0!==n?n:Number.NEGATIVE_INFINITY;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=function(n){var r=n.value;r.size>=t.minimum||n.issues.push({origin:Bs(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Cc=ns("$ZodCheckSizeEquals",function(e,t){var n,r;mc.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=function(e){var t=e.value;return!ls(t)&&void 0!==t.size}),e._zod.onattach.push(function(e){var n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=function(n){var r=n.value,u=r.size;if(u!==t.size){var a=u>t.size;n.issues.push(pn(pn({origin:Bs(r)},a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size}),{},{inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort}))}}}),kc=ns("$ZodCheckMaxLength",function(e,t){var n,r;mc.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=function(e){var t=e.value;return!ls(t)&&void 0!==t.length}),e._zod.onattach.push(function(e){var n,r=null!==(n=e._zod.bag.maximum)&&void 0!==n?n:Number.POSITIVE_INFINITY;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=function(n){var r=n.value;if(!(r.length<=t.maximum)){var u=Is(r);n.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}}),Ac=ns("$ZodCheckMinLength",function(e,t){var n,r;mc.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=function(e){var t=e.value;return!ls(t)&&void 0!==t.length}),e._zod.onattach.push(function(e){var n,r=null!==(n=e._zod.bag.minimum)&&void 0!==n?n:Number.NEGATIVE_INFINITY;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=function(n){var r=n.value;if(!(r.length>=t.minimum)){var u=Is(r);n.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}}),wc=ns("$ZodCheckLengthEquals",function(e,t){var n,r;mc.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=function(e){var t=e.value;return!ls(t)&&void 0!==t.length}),e._zod.onattach.push(function(e){var n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=function(n){var r=n.value,u=r.length;if(u!==t.length){var a=Is(r),i=u>t.length;n.issues.push(pn(pn({origin:a},i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length}),{},{inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort}))}}}),Sc=ns("$ZodCheckStringFormat",function(e,t){var n,r,u,a;mc.init(e,t),e._zod.onattach.push(function(e){var n,r=e._zod.bag;r.format=t.format,t.pattern&&(null!==(n=r.patterns)&&void 0!==n||(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?null!==(n=(u=e._zod).check)&&void 0!==n||(u.check=function(n){t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push(pn(pn({origin:"string",code:"invalid_format",format:t.format,input:n.value},t.pattern?{pattern:t.pattern.toString()}:{}),{},{inst:e,continue:!t.abort}))}):null!==(r=(a=e._zod).check)&&void 0!==r||(a.check=function(){})}),xc=ns("$ZodCheckRegex",function(e,t){Sc.init(e,t),e._zod.check=function(n){t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Oc=ns("$ZodCheckLowerCase",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=hc),Sc.init(e,t)}),Bc=ns("$ZodCheckUpperCase",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=vc),Sc.init(e,t)}),Ic=ns("$ZodCheckIncludes",function(e,t){mc.init(e,t);var n=bs(t.includes),r=new RegExp("number"==typeof t.position?"^.{".concat(t.position,"}").concat(n):n);t.pattern=r,e._zod.onattach.push(function(e){var t,n=e._zod.bag;null!==(t=n.patterns)&&void 0!==t||(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=function(n){n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Tc=ns("$ZodCheckStartsWith",function(e,t){var n;mc.init(e,t);var r=new RegExp("^".concat(bs(t.prefix),".*"));null!==(n=t.pattern)&&void 0!==n||(t.pattern=r),e._zod.onattach.push(function(e){var t,n=e._zod.bag;null!==(t=n.patterns)&&void 0!==t||(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=function(n){n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Pc=ns("$ZodCheckEndsWith",function(e,t){var n;mc.init(e,t);var r=new RegExp(".*".concat(bs(t.suffix),"$"));null!==(n=t.pattern)&&void 0!==n||(t.pattern=r),e._zod.onattach.push(function(e){var t,n=e._zod.bag;null!==(t=n.patterns)&&void 0!==t||(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=function(n){n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function jc(e,t,n){var r;e.issues.length&&(r=t.issues).push.apply(r,gn(Ss(n,e.issues)))}var Nc=ns("$ZodCheckProperty",function(e,t){mc.init(e,t),e._zod.check=function(e){var n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(function(n){return jc(n,e,t.property)});jc(n,e,t.property)}}),zc=ns("$ZodCheckMimeType",function(e,t){mc.init(e,t);var n=new Set(t.mime);e._zod.onattach.push(function(e){e._zod.bag.mime=t.mime}),e._zod.check=function(r){n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),Rc=ns("$ZodCheckOverwrite",function(e,t){mc.init(e,t),e._zod.check=function(e){e.value=t.tx(e.value)}}),Mc=un(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];tn(this,e),this.content=[],this.indent=0,this&&(this.args=t)},[{key:"indented",value:function(e){this.indent+=1,e(this),this.indent-=1}},{key:"write",value:function(e){var t=this;if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});var n,r=e.split("\n").filter(function(e){return e}),u=Math.min.apply(Math,gn(r.map(function(e){return e.length-e.trimStart().length}))),a=r.map(function(e){return e.slice(u)}).map(function(e){return" ".repeat(2*t.indent)+e}),i=an(a);try{for(i.s();!(n=i.n()).done;){var o=n.value;this.content.push(o)}}catch(e){i.e(e)}finally{i.f()}}},{key:"compile",value:function(){var e,t=Function,n=null==this?void 0:this.args,r=gn((null!==(e=null==this?void 0:this.content)&&void 0!==e?e:[""]).map(function(e){return" ".concat(e)}));return nn(t,gn(n).concat([r.join("\n")]))}}]),Zc={major:4,minor:1,patch:12},Lc=ns("$ZodType",function(e,t){var n,r;null!=e||(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Zc;var u=gn(null!==(n=e._zod.def.checks)&&void 0!==n?n:[]);e._zod.traits.has("$ZodCheck")&&u.unshift(e);var a,i=an(u);try{for(i.s();!(a=i.n()).done;){var o,s=an(a.value._zod.onattach);try{for(s.s();!(o=s.n()).done;)(0,o.value)(e)}catch(e){s.e(e)}finally{s.f()}}}catch(e){i.e(e)}finally{i.f()}if(0===u.length){var c,l;null!==(c=(r=e._zod).deferred)&&void 0!==c||(r.deferred=[]),null===(l=e._zod.deferred)||void 0===l||l.push(function(){e._zod.run=e._zod.parse})}else{var f=function(e,t,n){var r,u,a=ws(e),i=an(t);try{var o=function(){var t=u.value;if(t._zod.def.when){if(!t._zod.def.when(e))return 0}else if(a)return 0;var i=e.issues.length,o=t._zod.check(e);if(o instanceof Promise&&!1===(null==n?void 0:n.async))throw new rs;if(r||o instanceof Promise)r=(null!=r?r:Promise.resolve()).then(Xt(vn().m(function t(){return vn().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,o;case 1:if(e.issues.length!==i){t.n=2;break}return t.a(2);case 2:a||(a=ws(e,i));case 3:return t.a(2)}},t)})));else{if(e.issues.length===i)return 0;a||(a=ws(e,i))}};for(i.s();!(u=i.n()).done;)o()}catch(e){i.e(e)}finally{i.f()}return r?r.then(function(){return e}):e},d=function(t,n,r){if(ws(t))return t.aborted=!0,t;var a=f(n,u,r);if(a instanceof Promise){if(!1===r.async)throw new rs;return a.then(function(t){return e._zod.parse(t,r)})}return e._zod.parse(a,r)};e._zod.run=function(t,n){if(n.skipChecks)return e._zod.parse(t,n);if("backward"===n.direction){var r=e._zod.parse({value:t.value,issues:[]},pn(pn({},n),{},{skipChecks:!0}));return r instanceof Promise?r.then(function(e){return d(e,t,n)}):d(r,t,n)}var a=e._zod.parse(t,n);if(a instanceof Promise){if(!1===n.async)throw new rs;return a.then(function(e){return f(e,u,n)})}return f(a,u,n)}}e["~standard"]={validate:function(t){try{var n,r=Zs(e,t);return r.success?{value:r.data}:{issues:null===(n=r.error)||void 0===n?void 0:n.issues}}catch(n){return $s(e,t).then(function(e){var t;return e.success?{value:e.data}:{issues:null===(t=e.error)||void 0===t?void 0:t.issues}})}},vendor:"zod",version:1}}),$c=ns("$ZodString",function(e,t){var n,r,u;Lc.init(e,t),e._zod.pattern=null!==(n=gn(null!==(r=null==e||null===(u=e._zod.bag)||void 0===u?void 0:u.patterns)&&void 0!==r?r:[]).pop())&&void 0!==n?n:function(e){var t,n,r=e?"[\\s\\S]{".concat(null!==(t=null==e?void 0:e.minimum)&&void 0!==t?t:0,",").concat(null!==(n=null==e?void 0:e.maximum)&&void 0!==n?n:"","}"):"[\\s\\S]*";return new RegExp("^".concat(r,"$"))}(e._zod.bag),e._zod.parse=function(n,r){if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),qc=ns("$ZodStringFormat",function(e,t){Sc.init(e,t),$c.init(e,t)}),Uc=ns("$ZodGUID",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Qs),qc.init(e,t)}),Hc=ns("$ZodUUID",function(e,t){var n;if(t.version){var r,u={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===u)throw new Error('Invalid UUID version: "'.concat(t.version,'"'));null!==(r=t.pattern)&&void 0!==r||(t.pattern=Gs(u))}else null!==(n=t.pattern)&&void 0!==n||(t.pattern=Gs());qc.init(e,t)}),Vc=ns("$ZodEmail",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Ys),qc.init(e,t)}),Wc=ns("$ZodURL",function(e,t){qc.init(e,t),e._zod.check=function(n){try{var r=n.value.trim(),u=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(u.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:ac.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(u.protocol.endsWith(":")?u.protocol.slice(0,-1):u.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=u.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Kc=ns("$ZodEmoji",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),qc.init(e,t)}),Jc=ns("$ZodNanoID",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Ks),qc.init(e,t)}),Qc=ns("$ZodCUID",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=qs),qc.init(e,t)}),Gc=ns("$ZodCUID2",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Us),qc.init(e,t)}),Yc=ns("$ZodULID",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Hs),qc.init(e,t)}),Xc=ns("$ZodXID",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Vs),qc.init(e,t)}),el=ns("$ZodKSUID",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Ws),qc.init(e,t)}),tl=ns("$ZodISODateTime",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=function(e){var t=cc({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");var r="".concat(t,"(?:").concat(n.join("|"),")");return new RegExp("^".concat(oc,"T(?:").concat(r,")$"))}(t)),qc.init(e,t)}),nl=ns("$ZodISODate",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=sc),qc.init(e,t)}),rl=ns("$ZodISOTime",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=new RegExp("^".concat(cc(t),"$"))),qc.init(e,t)}),ul=ns("$ZodISODuration",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Js),qc.init(e,t)}),al=ns("$ZodIPv4",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Xs),qc.init(e,t),e._zod.onattach.push(function(e){e._zod.bag.format="ipv4"})}),il=ns("$ZodIPv6",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=ec),qc.init(e,t),e._zod.onattach.push(function(e){e._zod.bag.format="ipv6"}),e._zod.check=function(n){try{new URL("http://[".concat(n.value,"]"))}catch(r){n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),ol=ns("$ZodCIDRv4",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=tc),qc.init(e,t)}),sl=ns("$ZodCIDRv6",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=nc),qc.init(e,t),e._zod.check=function(n){var r=n.value.split("/");try{if(2!==r.length)throw new Error;var u=yn(r,2),a=u[0],i=u[1];if(!i)throw new Error;var o=Number(i);if("".concat(o)!==i)throw new Error;if(o<0||o>128)throw new Error;new URL("http://[".concat(a,"]"))}catch(r){n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function cl(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch(e){return!1}}var ll=ns("$ZodBase64",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=rc),qc.init(e,t),e._zod.onattach.push(function(e){e._zod.bag.contentEncoding="base64"}),e._zod.check=function(n){cl(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),fl=ns("$ZodBase64URL",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=uc),qc.init(e,t),e._zod.onattach.push(function(e){e._zod.bag.contentEncoding="base64url"}),e._zod.check=function(n){(function(e){if(!uc.test(e))return!1;var t=e.replace(/[-_]/g,function(e){return"-"===e?"+":"/"});return cl(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),dl=ns("$ZodE164",function(e,t){var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=ic),qc.init(e,t)}),pl=ns("$ZodJWT",function(e,t){qc.init(e,t),e._zod.check=function(n){(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{var n=e.split(".");if(3!==n.length)return!1;var r=yn(n,1)[0];if(!r)return!1;var u=JSON.parse(atob(r));return!("typ"in u&&"JWT"!==(null==u?void 0:u.typ)||!u.alg||t&&(!("alg"in u)||u.alg!==t))}catch(e){return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),hl=ns("$ZodNumber",function(e,t){var n;Lc.init(e,t),e._zod.pattern=null!==(n=e._zod.bag.pattern)&&void 0!==n?n:fc,e._zod.parse=function(n,r){if(t.coerce)try{n.value=Number(n.value)}catch(e){}var u=n.value;if("number"==typeof u&&!Number.isNaN(u)&&Number.isFinite(u))return n;var a="number"==typeof u?Number.isNaN(u)?"NaN":Number.isFinite(u)?void 0:"Infinity":void 0;return n.issues.push(pn({expected:"number",code:"invalid_type",input:u,inst:e},a?{received:a}:{})),n}}),vl=ns("$ZodNumber",function(e,t){Ec.init(e,t),hl.init(e,t)}),ml=ns("$ZodBoolean",function(e,t){Lc.init(e,t),e._zod.pattern=dc,e._zod.parse=function(n,r){if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}var u=n.value;return"boolean"==typeof u||n.issues.push({expected:"boolean",code:"invalid_type",input:u,inst:e}),n}}),Dl=ns("$ZodNull",function(e,t){Lc.init(e,t),e._zod.pattern=pc,e._zod.values=new Set([null]),e._zod.parse=function(t,n){var r=t.value;return null===r||t.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),t}}),yl=ns("$ZodUnknown",function(e,t){Lc.init(e,t),e._zod.parse=function(e){return e}}),gl=ns("$ZodNever",function(e,t){Lc.init(e,t),e._zod.parse=function(t,n){return t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t}});function Fl(e,t,n){var r;e.issues.length&&(r=t.issues).push.apply(r,gn(Ss(n,e.issues))),t.value[n]=e.value}var El=ns("$ZodArray",function(e,t){Lc.init(e,t),e._zod.parse=function(n,r){var u=n.value;if(!Array.isArray(u))return n.issues.push({expected:"array",code:"invalid_type",input:u,inst:e}),n;n.value=Array(u.length);for(var a=[],i=function(e){var i=u[e],o=t.element._zod.run({value:i,issues:[]},r);o instanceof Promise?a.push(o.then(function(t){return Fl(t,n,e)})):Fl(o,n,e)},o=0;o<u.length;o++)i(o);return a.length?Promise.all(a).then(function(){return n}):n}});function _l(e,t,n,r){var u;e.issues.length&&(u=t.issues).push.apply(u,gn(Ss(n,e.issues))),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function bl(e){for(var t=Object.keys(e.shape),n=0,r=t;n<r.length;n++){var u,a=r[n];if(null===(u=e.shape)||void 0===u||null===(u=u[a])||void 0===u||null===(u=u._zod)||void 0===u||null===(u=u.traits)||void 0===u||!u.has("$ZodType"))throw new Error('Invalid element at key "'.concat(a,'": expected a Zod schema'))}var i,o=(i=e.shape,Object.keys(i).filter(function(e){return"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout}));return pn(pn({},e),{},{keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)})}function Cl(e,t,n,r,u,a){for(var i=[],o=u.keySet,s=u.catchall._zod,c=s.def.type,l=function(){var u=d[f];if(o.has(u))return 0;if("never"===c)return i.push(u),0;var a=s.run({value:t[u],issues:[]},r);a instanceof Promise?e.push(a.then(function(e){return _l(e,n,u,t)})):_l(a,n,u,t)},f=0,d=Object.keys(t);f<d.length;f++)l();return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:a}),e.length?Promise.all(e).then(function(){return n}):n}var kl=ns("$ZodObject",function(e,t){Lc.init(e,t);var n=Object.getOwnPropertyDescriptor(t,"shape");if(null==n||!n.get){var r=t.shape;Object.defineProperty(t,"shape",{get:function(){var e=pn({},r);return Object.defineProperty(t,"shape",{value:e}),e}})}var u=cs(function(){return bl(t)});ps(e._zod,"propValues",function(){var e=t.shape,n={};for(var r in e){var u=e[r]._zod;if(u.values){var a;null!==(a=n[r])&&void 0!==a||(n[r]=new Set);var i,o=an(u.values);try{for(o.s();!(i=o.n()).done;){var s=i.value;n[r].add(s)}}catch(e){o.e(e)}finally{o.f()}}}return n});var a,i=ys,o=t.catchall;e._zod.parse=function(t,n){null!=a||(a=u.value);var r=t.value;if(!i(r))return t.issues.push({expected:"object",code:"invalid_type",input:r,inst:e}),t;t.value={};var s,c=[],l=a.shape,f=an(a.keys);try{var d=function(){var e=s.value,u=l[e]._zod.run({value:r[e],issues:[]},n);u instanceof Promise?c.push(u.then(function(n){return _l(n,t,e,r)})):_l(u,t,e,r)};for(f.s();!(s=f.n()).done;)d()}catch(e){f.e(e)}finally{f.f()}return o?Cl(c,r,t,n,u.value,e):c.length?Promise.all(c).then(function(){return t}):t}}),Al=ns("$ZodObjectJIT",function(e,t){kl.init(e,t);var n,r,u=e._zod.parse,a=cs(function(){return bl(t)}),i=ys,o=!as.jitless,s=o&&gs.value,c=t.catchall;e._zod.parse=function(l,f){null!=r||(r=a.value);var d=l.value;return i(d)?o&&s&&!1===(null==f?void 0:f.async)&&!0!==f.jitless?(n||(n=function(e){var t=new Mc(["shape","payload","ctx"]),n=a.value,r=function(e){var t=ms(e);return"shape[".concat(t,"]._zod.run({ value: input[").concat(t,"], issues: [] }, ctx)")};t.write("const input = payload.value;");var u,i=Object.create(null),o=0,s=an(n.keys);try{for(s.s();!(u=s.n()).done;)i[u.value]="key_".concat(o++)}catch(e){s.e(e)}finally{s.f()}t.write("const newResult = {};");var c,l=an(n.keys);try{for(l.s();!(c=l.n()).done;){var f=c.value,d=i[f],p=ms(f);t.write("const ".concat(d," = ").concat(r(f),";")),t.write("\n if (".concat(d,".issues.length) {\n payload.issues = payload.issues.concat(").concat(d,".issues.map(iss => ({\n ...iss,\n path: iss.path ? [").concat(p,", ...iss.path] : [").concat(p,"]\n })));\n }\n \n \n if (").concat(d,".value === undefined) {\n if (").concat(p," in input) {\n newResult[").concat(p,"] = undefined;\n }\n } else {\n newResult[").concat(p,"] = ").concat(d,".value;\n }\n \n "))}}catch(e){l.e(e)}finally{l.f()}t.write("payload.value = newResult;"),t.write("return payload;");var h=t.compile();return function(t,n){return h(e,t,n)}}(t.shape)),l=n(l,f),c?Cl([],d,l,f,r,e):l):u(l,f):(l.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),l)}});function wl(e,t,n,r){var u,a=an(e);try{for(a.s();!(u=a.n()).done;){var i=u.value;if(0===i.issues.length)return t.value=i.value,t}}catch(e){a.e(e)}finally{a.f()}var o=e.filter(function(e){return!ws(e)});return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(function(e){return e.issues.map(function(e){return Os(e,r,is())})})}),t)}var Sl=ns("$ZodUnion",function(e,t){Lc.init(e,t),ps(e._zod,"optin",function(){return t.options.some(function(e){return"optional"===e._zod.optin})?"optional":void 0}),ps(e._zod,"optout",function(){return t.options.some(function(e){return"optional"===e._zod.optout})?"optional":void 0}),ps(e._zod,"values",function(){if(t.options.every(function(e){return e._zod.values}))return new Set(t.options.flatMap(function(e){return Array.from(e._zod.values)}))}),ps(e._zod,"pattern",function(){if(t.options.every(function(e){return e._zod.pattern})){var e=t.options.map(function(e){return e._zod.pattern});return new RegExp("^(".concat(e.map(function(e){return fs(e.source)}).join("|"),")$"))}});var n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=function(u,a){if(n)return r(u,a);var i,o=!1,s=[],c=an(t.options);try{for(c.s();!(i=c.n()).done;){var l=i.value._zod.run({value:u.value,issues:[]},a);if(l instanceof Promise)s.push(l),o=!0;else{if(0===l.issues.length)return l;s.push(l)}}}catch(e){c.e(e)}finally{c.f()}return o?Promise.all(s).then(function(t){return wl(t,u,e,a)}):wl(s,u,e,a)}}),xl=ns("$ZodDiscriminatedUnion",function(e,t){Sl.init(e,t);var n=e._zod.parse;ps(e._zod,"propValues",function(){var e,n={},r=an(t.options);try{for(r.s();!(e=r.n()).done;){var u=e.value,a=u._zod.propValues;if(!a||0===Object.keys(a).length)throw new Error('Invalid discriminated union option at index "'.concat(t.options.indexOf(u),'"'));for(var i=0,o=Object.entries(a);i<o.length;i++){var s=yn(o[i],2),c=s[0],l=s[1];n[c]||(n[c]=new Set);var f,d=an(l);try{for(d.s();!(f=d.n()).done;){var p=f.value;n[c].add(p)}}catch(e){d.e(e)}finally{d.f()}}}}catch(e){r.e(e)}finally{r.f()}return n});var r=cs(function(){var e,n=t.options,r=new Map,u=an(n);try{for(u.s();!(e=u.n()).done;){var a,i=e.value,o=null===(a=i._zod.propValues)||void 0===a?void 0:a[t.discriminator];if(!o||0===o.size)throw new Error('Invalid discriminated union option at index "'.concat(t.options.indexOf(i),'"'));var s,c=an(o);try{for(c.s();!(s=c.n()).done;){var l=s.value;if(r.has(l))throw new Error('Duplicate discriminator value "'.concat(String(l),'"'));r.set(l,i)}}catch(e){c.e(e)}finally{c.f()}}}catch(e){u.e(e)}finally{u.f()}return r});e._zod.parse=function(u,a){var i=u.value;if(!ys(i))return u.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),u;var o=r.value.get(null==i?void 0:i[t.discriminator]);return o?o._zod.run(u,a):t.unionFallback?n(u,a):(u.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:i,path:[t.discriminator],inst:e}),u)}}),Ol=ns("$ZodIntersection",function(e,t){Lc.init(e,t),e._zod.parse=function(e,n){var r=e.value,u=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return u instanceof Promise||a instanceof Promise?Promise.all([u,a]).then(function(t){var n=yn(t,2),r=n[0],u=n[1];return Il(e,r,u)}):Il(e,u,a)}});function Bl(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Fs(e)&&Fs(t)){var n,r=Object.keys(t),u=Object.keys(e).filter(function(e){return-1!==r.indexOf(e)}),a=pn(pn({},e),t),i=an(u);try{for(i.s();!(n=i.n()).done;){var o=n.value,s=Bl(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o].concat(gn(s.mergeErrorPath))};a[o]=s.data}}catch(e){i.e(e)}finally{i.f()}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};for(var c=[],l=0;l<e.length;l++){var f=Bl(e[l],t[l]);if(!f.valid)return{valid:!1,mergeErrorPath:[l].concat(gn(f.mergeErrorPath))};c.push(f.data)}return{valid:!0,data:c}}return{valid:!1,mergeErrorPath:[]}}function Il(e,t,n){var r,u;if(t.issues.length&&(r=e.issues).push.apply(r,gn(t.issues)),n.issues.length&&(u=e.issues).push.apply(u,gn(n.issues)),ws(e))return e;var a=Bl(t.value,n.value);if(!a.valid)throw new Error("Unmergable intersection. Error path: "+"".concat(JSON.stringify(a.mergeErrorPath)));return e.value=a.data,e}var Tl=ns("$ZodRecord",function(e,t){Lc.init(e,t),e._zod.parse=function(n,r){var u=n.value;if(!Fs(u))return n.issues.push({expected:"record",code:"invalid_type",input:u,inst:e}),n;var a=[];if(t.keyType._zod.values){var i=t.keyType._zod.values;n.value={};var o,s,c=an(i);try{var l=function(){var e=o.value;if("string"==typeof e||"number"==typeof e||"symbol"===En(e)){var i,s=t.valueType._zod.run({value:u[e],issues:[]},r);if(s instanceof Promise)a.push(s.then(function(t){var r;t.issues.length&&(r=n.issues).push.apply(r,gn(Ss(e,t.issues))),n.value[e]=t.value}));else s.issues.length&&(i=n.issues).push.apply(i,gn(Ss(e,s.issues))),n.value[e]=s.value}};for(c.s();!(o=c.n()).done;)l()}catch(e){c.e(e)}finally{c.f()}for(var f in u)i.has(f)||(s=null!=s?s:[]).push(f);s&&s.length>0&&n.issues.push({code:"unrecognized_keys",input:u,inst:e,keys:s})}else{n.value={};var d,p=an(Reflect.ownKeys(u));try{var h=function(){var i=d.value;if("__proto__"===i)return 0;var o=t.keyType._zod.run({value:i,issues:[]},r);if(o instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(o.issues.length)return n.issues.push({code:"invalid_key",origin:"record",issues:o.issues.map(function(e){return Os(e,r,is())}),input:i,path:[i],inst:e}),n.value[o.value]=o.value,0;var s,c=t.valueType._zod.run({value:u[i],issues:[]},r);c instanceof Promise?a.push(c.then(function(e){var t;e.issues.length&&(t=n.issues).push.apply(t,gn(Ss(i,e.issues))),n.value[o.value]=e.value})):(c.issues.length&&(s=n.issues).push.apply(s,gn(Ss(i,c.issues))),n.value[o.value]=c.value)};for(p.s();!(d=p.n()).done;)h()}catch(e){p.e(e)}finally{p.f()}}return a.length?Promise.all(a).then(function(){return n}):n}}),Pl=ns("$ZodEnum",function(e,t){Lc.init(e,t);var n=os(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp("^(".concat(n.filter(function(e){return _s.has(En(e))}).map(function(e){return"string"==typeof e?bs(e):e.toString()}).join("|"),")$")),e._zod.parse=function(t,u){var a=t.value;return r.has(a)||t.issues.push({code:"invalid_value",values:n,input:a,inst:e}),t}}),jl=ns("$ZodLiteral",function(e,t){if(Lc.init(e,t),0===t.values.length)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp("^(".concat(t.values.map(function(e){return"string"==typeof e?bs(e):e?bs(e.toString()):String(e)}).join("|"),")$")),e._zod.parse=function(n,r){var u=n.value;return e._zod.values.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}}),Nl=ns("$ZodTransform",function(e,t){Lc.init(e,t),e._zod.parse=function(n,r){if("backward"===r.direction)throw new us(e.constructor.name);var u=t.transform(n.value,n);if(r.async)return(u instanceof Promise?u:Promise.resolve(u)).then(function(e){return n.value=e,n});if(u instanceof Promise)throw new rs;return n.value=u,n}});function zl(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}var Rl=ns("$ZodOptional",function(e,t){Lc.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ps(e._zod,"values",function(){return t.innerType._zod.values?new Set([].concat(gn(t.innerType._zod.values),[void 0])):void 0}),ps(e._zod,"pattern",function(){var e=t.innerType._zod.pattern;return e?new RegExp("^(".concat(fs(e.source),")?$")):void 0}),e._zod.parse=function(e,n){if("optional"===t.innerType._zod.optin){var r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(function(t){return zl(t,e.value)}):zl(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),Ml=ns("$ZodNullable",function(e,t){Lc.init(e,t),ps(e._zod,"optin",function(){return t.innerType._zod.optin}),ps(e._zod,"optout",function(){return t.innerType._zod.optout}),ps(e._zod,"pattern",function(){var e=t.innerType._zod.pattern;return e?new RegExp("^(".concat(fs(e.source),"|null)$")):void 0}),ps(e._zod,"values",function(){return t.innerType._zod.values?new Set([].concat(gn(t.innerType._zod.values),[null])):void 0}),e._zod.parse=function(e,n){return null===e.value?e:t.innerType._zod.run(e,n)}}),Zl=ns("$ZodDefault",function(e,t){Lc.init(e,t),e._zod.optin="optional",ps(e._zod,"values",function(){return t.innerType._zod.values}),e._zod.parse=function(e,n){if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;var r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(function(e){return Ll(e,t)}):Ll(r,t)}});function Ll(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}var $l=ns("$ZodPrefault",function(e,t){Lc.init(e,t),e._zod.optin="optional",ps(e._zod,"values",function(){return t.innerType._zod.values}),e._zod.parse=function(e,n){return"backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n)}}),ql=ns("$ZodNonOptional",function(e,t){Lc.init(e,t),ps(e._zod,"values",function(){var e=t.innerType._zod.values;return e?new Set(gn(e).filter(function(e){return void 0!==e})):void 0}),e._zod.parse=function(n,r){var u=t.innerType._zod.run(n,r);return u instanceof Promise?u.then(function(t){return Ul(t,e)}):Ul(u,e)}});function Ul(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var Hl=ns("$ZodCatch",function(e,t){Lc.init(e,t),ps(e._zod,"optin",function(){return t.innerType._zod.optin}),ps(e._zod,"optout",function(){return t.innerType._zod.optout}),ps(e._zod,"values",function(){return t.innerType._zod.values}),e._zod.parse=function(e,n){if("backward"===n.direction)return t.innerType._zod.run(e,n);var r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(function(r){return e.value=r.value,r.issues.length&&(e.value=t.catchValue(pn(pn({},e),{},{error:{issues:r.issues.map(function(e){return Os(e,n,is())})},input:e.value})),e.issues=[]),e}):(e.value=r.value,r.issues.length&&(e.value=t.catchValue(pn(pn({},e),{},{error:{issues:r.issues.map(function(e){return Os(e,n,is())})},input:e.value})),e.issues=[]),e)}}),Vl=ns("$ZodPipe",function(e,t){Lc.init(e,t),ps(e._zod,"values",function(){return t.in._zod.values}),ps(e._zod,"optin",function(){return t.in._zod.optin}),ps(e._zod,"optout",function(){return t.out._zod.optout}),ps(e._zod,"propValues",function(){return t.in._zod.propValues}),e._zod.parse=function(e,n){if("backward"===n.direction){var r=t.out._zod.run(e,n);return r instanceof Promise?r.then(function(e){return Wl(e,t.in,n)}):Wl(r,t.in,n)}var u=t.in._zod.run(e,n);return u instanceof Promise?u.then(function(e){return Wl(e,t.out,n)}):Wl(u,t.out,n)}});function Wl(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Kl=ns("$ZodReadonly",function(e,t){Lc.init(e,t),ps(e._zod,"propValues",function(){return t.innerType._zod.propValues}),ps(e._zod,"values",function(){return t.innerType._zod.values}),ps(e._zod,"optin",function(){return t.innerType._zod.optin}),ps(e._zod,"optout",function(){return t.innerType._zod.optout}),e._zod.parse=function(e,n){if("backward"===n.direction)return t.innerType._zod.run(e,n);var r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Jl):Jl(r)}});function Jl(e){return e.value=Object.freeze(e.value),e}var Ql=ns("$ZodLazy",function(e,t){Lc.init(e,t),ps(e._zod,"innerType",function(){return t.getter()}),ps(e._zod,"pattern",function(){return e._zod.innerType._zod.pattern}),ps(e._zod,"propValues",function(){return e._zod.innerType._zod.propValues}),ps(e._zod,"optin",function(){var t;return null!==(t=e._zod.innerType._zod.optin)&&void 0!==t?t:void 0}),ps(e._zod,"optout",function(){var t;return null!==(t=e._zod.innerType._zod.optout)&&void 0!==t?t:void 0}),e._zod.parse=function(t,n){return e._zod.innerType._zod.run(t,n)}}),Gl=ns("$ZodCustom",function(e,t){mc.init(e,t),Lc.init(e,t),e._zod.parse=function(e,t){return e},e._zod.check=function(n){var r=n.value,u=t.fn(r);if(u instanceof Promise)return u.then(function(t){return Yl(t,n,r,e)});Yl(u,n,r,e)}});function Yl(e,t,n,r){if(!e){var u,a={code:"custom",input:n,inst:r,path:gn(null!==(u=r._zod.def.path)&&void 0!==u?u:[]),continue:!r._zod.def.abort};r._zod.def.params&&(a.params=r._zod.def.params),t.issues.push(Ts(a))}}var Xl=un(function e(){tn(this,e),this._map=new WeakMap,this._idmap=new Map},[{key:"add",value:function(e){var t=arguments.length<=1?void 0:arguments[1];if(this._map.set(e,t),t&&"object"===En(t)&&"id"in t){if(this._idmap.has(t.id))throw new Error("ID ".concat(t.id," already exists in the registry"));this._idmap.set(t.id,e)}return this}},{key:"clear",value:function(){return this._map=new WeakMap,this._idmap=new Map,this}},{key:"remove",value:function(e){var t=this._map.get(e);return t&&"object"===En(t)&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}},{key:"get",value:function(e){var t=e._zod.parent;if(t){var n,r=pn({},null!==(n=this.get(t))&&void 0!==n?n:{});delete r.id;var u=pn(pn({},r),this._map.get(e));return Object.keys(u).length?u:void 0}return this._map.get(e)}},{key:"has",value:function(e){return this._map.has(e)}}]);var ef=new Xl;function tf(e,t){return new e(pn({type:"string",format:"guid",check:"string_format",abort:!1},ks(t)))}function nf(e,t){return new yc(pn(pn({check:"less_than"},ks(t)),{},{value:e,inclusive:!1}))}function rf(e,t){return new yc(pn(pn({check:"less_than"},ks(t)),{},{value:e,inclusive:!0}))}function uf(e,t){return new gc(pn(pn({check:"greater_than"},ks(t)),{},{value:e,inclusive:!1}))}function af(e,t){return new gc(pn(pn({check:"greater_than"},ks(t)),{},{value:e,inclusive:!0}))}function of(e,t){return new Fc(pn(pn({check:"multiple_of"},ks(t)),{},{value:e}))}function sf(e,t){return new kc(pn(pn({check:"max_length"},ks(t)),{},{maximum:e}))}function cf(e,t){return new Ac(pn(pn({check:"min_length"},ks(t)),{},{minimum:e}))}function lf(e,t){return new wc(pn(pn({check:"length_equals"},ks(t)),{},{length:e}))}function ff(e,t){return new xc(pn(pn({check:"string_format",format:"regex"},ks(t)),{},{pattern:e}))}function df(e){return new Oc(pn({check:"string_format",format:"lowercase"},ks(e)))}function pf(e){return new Bc(pn({check:"string_format",format:"uppercase"},ks(e)))}function hf(e,t){return new Ic(pn(pn({check:"string_format",format:"includes"},ks(t)),{},{includes:e}))}function vf(e,t){return new Tc(pn(pn({check:"string_format",format:"starts_with"},ks(t)),{},{prefix:e}))}function mf(e,t){return new Pc(pn(pn({check:"string_format",format:"ends_with"},ks(t)),{},{suffix:e}))}function Df(e){return new Rc({check:"overwrite",tx:e})}function yf(e){return Df(function(t){return t.normalize(e)})}function gf(){return Df(function(e){return e.trim()})}function Ff(){return Df(function(e){return e.toLowerCase()})}function Ef(){return Df(function(e){return e.toUpperCase()})}var _f=un(function e(t){var n,r,u,a,i;tn(this,e),this.counter=0,this.metadataRegistry=null!==(n=null==t?void 0:t.metadata)&&void 0!==n?n:ef,this.target=null!==(r=null==t?void 0:t.target)&&void 0!==r?r:"draft-2020-12",this.unrepresentable=null!==(u=null==t?void 0:t.unrepresentable)&&void 0!==u?u:"throw",this.override=null!==(a=null==t?void 0:t.override)&&void 0!==a?a:function(){},this.io=null!==(i=null==t?void 0:t.io)&&void 0!==i?i:"output",this.seen=new Map},[{key:"process",value:function(e){var t,n,r,u,a=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{path:[],schemaPath:[]},o=e._zod.def,s=this.seen.get(e);if(s)return s.count++,i.schemaPath.includes(e)&&(s.cycle=i.path),s.schema;var c={schema:{},count:1,cycle:void 0,path:i.path};this.seen.set(e,c);var l=null===(t=(n=e._zod).toJSONSchema)||void 0===t?void 0:t.call(n);if(l)c.schema=l;else{var f=pn(pn({},i),{},{schemaPath:[].concat(gn(i.schemaPath),[e]),path:i.path}),d=e._zod.parent;if(d)c.ref=d,this.process(d,f),this.seen.get(d).isParent=!0;else{var p=c.schema;switch(o.type){case"string":var h=p;h.type="string";var v,m=e._zod.bag,D=m.minimum,y=m.maximum,g=m.format,F=m.patterns,E=m.contentEncoding;if("number"==typeof D&&(h.minLength=D),"number"==typeof y&&(h.maxLength=y),g&&(h.format=null!==(v={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""}[g])&&void 0!==v?v:g,""===h.format&&delete h.format),E&&(h.contentEncoding=E),F&&F.size>0){var _=gn(F);1===_.length?h.pattern=_[0].source:_.length>1&&(c.schema.allOf=gn(_.map(function(e){return pn(pn({},"draft-7"===a.target||"draft-4"===a.target||"openapi-3.0"===a.target?{type:"string"}:{}),{},{pattern:e.source})})))}break;case"number":var b=p,C=e._zod.bag,k=C.minimum,A=C.maximum,w=C.format,S=C.multipleOf,x=C.exclusiveMaximum,O=C.exclusiveMinimum;"string"==typeof w&&w.includes("int")?b.type="integer":b.type="number","number"==typeof O&&("draft-4"===this.target||"openapi-3.0"===this.target?(b.minimum=O,b.exclusiveMinimum=!0):b.exclusiveMinimum=O),"number"==typeof k&&(b.minimum=k,"number"==typeof O&&"draft-4"!==this.target&&(O>=k?delete b.minimum:delete b.exclusiveMinimum)),"number"==typeof x&&("draft-4"===this.target||"openapi-3.0"===this.target?(b.maximum=x,b.exclusiveMaximum=!0):b.exclusiveMaximum=x),"number"==typeof A&&(b.maximum=A,"number"==typeof x&&"draft-4"!==this.target&&(x<=A?delete b.maximum:delete b.exclusiveMaximum)),"number"==typeof S&&(b.multipleOf=S);break;case"boolean":case"success":p.type="boolean";break;case"bigint":if("throw"===this.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema");break;case"symbol":if("throw"===this.unrepresentable)throw new Error("Symbols cannot be represented in JSON Schema");break;case"null":"openapi-3.0"===this.target?(p.type="string",p.nullable=!0,p.enum=[null]):p.type="null";break;case"any":case"unknown":break;case"undefined":if("throw"===this.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema");break;case"void":if("throw"===this.unrepresentable)throw new Error("Void cannot be represented in JSON Schema");break;case"never":p.not={};break;case"date":if("throw"===this.unrepresentable)throw new Error("Date cannot be represented in JSON Schema");break;case"array":var B=p,I=e._zod.bag,T=I.minimum,P=I.maximum;"number"==typeof T&&(B.minItems=T),"number"==typeof P&&(B.maxItems=P),B.type="array",B.items=this.process(o.element,pn(pn({},f),{},{path:[].concat(gn(f.path),["items"])}));break;case"object":var j,N=p;N.type="object",N.properties={};var z=o.shape;for(var R in z)N.properties[R]=this.process(z[R],pn(pn({},f),{},{path:[].concat(gn(f.path),["properties",R])}));var M=new Set(Object.keys(z)),Z=new Set(gn(M).filter(function(e){var t=o.shape[e]._zod;return"input"===a.io?void 0===t.optin:void 0===t.optout}));Z.size>0&&(N.required=Array.from(Z)),"never"===(null===(j=o.catchall)||void 0===j?void 0:j._zod.def.type)?N.additionalProperties=!1:o.catchall?o.catchall&&(N.additionalProperties=this.process(o.catchall,pn(pn({},f),{},{path:[].concat(gn(f.path),["additionalProperties"])}))):"output"===this.io&&(N.additionalProperties=!1);break;case"union":var L=p,$=o.options.map(function(e,t){return a.process(e,pn(pn({},f),{},{path:[].concat(gn(f.path),["anyOf",t])}))});L.anyOf=$;break;case"intersection":var q=p,U=this.process(o.left,pn(pn({},f),{},{path:[].concat(gn(f.path),["allOf",0])})),H=this.process(o.right,pn(pn({},f),{},{path:[].concat(gn(f.path),["allOf",1])})),V=function(e){return"allOf"in e&&1===Object.keys(e).length},W=[].concat(gn(V(U)?U.allOf:[U]),gn(V(H)?H.allOf:[H]));q.allOf=W;break;case"tuple":var K=p;K.type="array";var J="draft-2020-12"===this.target?"prefixItems":"items",Q="draft-2020-12"===this.target||"openapi-3.0"===this.target?"items":"additionalItems",G=o.items.map(function(e,t){return a.process(e,pn(pn({},f),{},{path:[].concat(gn(f.path),[J,t])}))}),Y=o.rest?this.process(o.rest,pn(pn({},f),{},{path:[].concat(gn(f.path),[Q],gn("openapi-3.0"===this.target?[o.items.length]:[]))})):null;"draft-2020-12"===this.target?(K.prefixItems=G,Y&&(K.items=Y)):"openapi-3.0"===this.target?(K.items={anyOf:G},Y&&K.items.anyOf.push(Y),K.minItems=G.length,Y||(K.maxItems=G.length)):(K.items=G,Y&&(K.additionalItems=Y));var X=e._zod.bag,ee=X.minimum,te=X.maximum;"number"==typeof ee&&(K.minItems=ee),"number"==typeof te&&(K.maxItems=te);break;case"record":var ne=p;ne.type="object","draft-7"!==this.target&&"draft-2020-12"!==this.target||(ne.propertyNames=this.process(o.keyType,pn(pn({},f),{},{path:[].concat(gn(f.path),["propertyNames"])}))),ne.additionalProperties=this.process(o.valueType,pn(pn({},f),{},{path:[].concat(gn(f.path),["additionalProperties"])}));break;case"map":if("throw"===this.unrepresentable)throw new Error("Map cannot be represented in JSON Schema");break;case"set":if("throw"===this.unrepresentable)throw new Error("Set cannot be represented in JSON Schema");break;case"enum":var re=p,ue=os(o.entries);ue.every(function(e){return"number"==typeof e})&&(re.type="number"),ue.every(function(e){return"string"==typeof e})&&(re.type="string"),re.enum=ue;break;case"literal":var ae,ie=p,oe=[],se=an(o.values);try{for(se.s();!(ae=se.n()).done;){var ce=ae.value;if(void 0===ce){if("throw"===this.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof ce){if("throw"===this.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");oe.push(Number(ce))}else oe.push(ce)}}catch(e){se.e(e)}finally{se.f()}if(0===oe.length);else if(1===oe.length){var le=oe[0];ie.type=null===le?"null":En(le),"draft-4"===this.target||"openapi-3.0"===this.target?ie.enum=[le]:ie.const=le}else oe.every(function(e){return"number"==typeof e})&&(ie.type="number"),oe.every(function(e){return"string"==typeof e})&&(ie.type="string"),oe.every(function(e){return"boolean"==typeof e})&&(ie.type="string"),oe.every(function(e){return null===e})&&(ie.type="null"),ie.enum=oe;break;case"file":var fe=p,de={type:"string",format:"binary",contentEncoding:"binary"},pe=e._zod.bag,he=pe.minimum,ve=pe.maximum,me=pe.mime;void 0!==he&&(de.minLength=he),void 0!==ve&&(de.maxLength=ve),me?1===me.length?(de.contentMediaType=me[0],Object.assign(fe,de)):fe.anyOf=me.map(function(e){return pn(pn({},de),{},{contentMediaType:e})}):Object.assign(fe,de);break;case"transform":if("throw"===this.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema");break;case"nullable":var De=this.process(o.innerType,f);"openapi-3.0"===this.target?(c.ref=o.innerType,p.nullable=!0):p.anyOf=[De,{type:"null"}];break;case"nonoptional":case"promise":case"optional":this.process(o.innerType,f),c.ref=o.innerType;break;case"default":this.process(o.innerType,f),c.ref=o.innerType,p.default=JSON.parse(JSON.stringify(o.defaultValue));break;case"prefault":this.process(o.innerType,f),c.ref=o.innerType,"input"===this.io&&(p._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break;case"catch":var ye;this.process(o.innerType,f),c.ref=o.innerType;try{ye=o.catchValue(void 0)}catch(e){throw new Error("Dynamic catch values are not supported in JSON Schema")}p.default=ye;break;case"nan":if("throw"===this.unrepresentable)throw new Error("NaN cannot be represented in JSON Schema");break;case"template_literal":var ge=p,Fe=e._zod.pattern;if(!Fe)throw new Error("Pattern not found in template literal");ge.type="string",ge.pattern=Fe.source;break;case"pipe":var Ee="input"===this.io?"transform"===o.in._zod.def.type?o.out:o.in:o.out;this.process(Ee,f),c.ref=Ee;break;case"readonly":this.process(o.innerType,f),c.ref=o.innerType,p.readOnly=!0;break;case"lazy":var _e=e._zod.innerType;this.process(_e,f),c.ref=_e;break;case"custom":if("throw"===this.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema");break;case"function":if("throw"===this.unrepresentable)throw new Error("Function types cannot be represented in JSON Schema")}}}var be=this.metadataRegistry.get(e);return be&&Object.assign(c.schema,be),"input"===this.io&&bf(e)&&(delete c.schema.examples,delete c.schema.default),"input"===this.io&&c.schema._prefault&&(null!==(r=(u=c.schema).default)&&void 0!==r||(u.default=c.schema._prefault)),delete c.schema._prefault,this.seen.get(e).schema}},{key:"emit",value:function(e,t){var n,r,u,a,i,o,s=this,c={cycles:null!==(n=null==t?void 0:t.cycles)&&void 0!==n?n:"ref",reused:null!==(r=null==t?void 0:t.reused)&&void 0!==r?r:"inline",external:null!==(u=null==t?void 0:t.external)&&void 0!==u?u:void 0},l=this.seen.get(e);if(!l)throw new Error("Unprocessed schema. This is a bug in Zod.");var f=function(e){if(!e[1].schema.$ref){var t=e[1],n=function(e){var t,n="draft-2020-12"===s.target?"$defs":"definitions";if(c.external){var r,u,a,i,o=null===(r=c.external.registry.get(e[0]))||void 0===r?void 0:r.id,f=null!==(u=c.external.uri)&&void 0!==u?u:function(e){return e};if(o)return{ref:f(o)};var d=null!==(a=null!==(i=e[1].defId)&&void 0!==i?i:e[1].schema.id)&&void 0!==a?a:"schema".concat(s.counter++);return e[1].defId=d,{defId:d,ref:"".concat(f("__shared"),"#/").concat(n,"/").concat(d)}}if(e[1]===l)return{ref:"#"};var p="".concat("#","/").concat(n,"/"),h=null!==(t=e[1].schema.id)&&void 0!==t?t:"__schema".concat(s.counter++);return{defId:h,ref:p+h}}(e),r=n.ref,u=n.defId;t.def=pn({},t.schema),u&&(t.defId=u);var a=t.schema;for(var i in a)delete a[i];a.$ref=r}};if("throw"===c.cycles){var d,p=an(this.seen.entries());try{for(p.s();!(d=p.n()).done;){var h,v=d.value[1];if(v.cycle)throw new Error("Cycle detected: "+"#/".concat(null===(h=v.cycle)||void 0===h?void 0:h.join("/"),"/<root>")+'\n\nSet the `cycles` parameter to `"ref"` to resolve cyclical schemas with defs.')}}catch(e){p.e(e)}finally{p.f()}}var m,D=an(this.seen.entries());try{for(D.s();!(m=D.n()).done;){var y,g=m.value,F=g[1];if(e!==g[0]){if(c.external){var E,_=null===(E=c.external.registry.get(g[0]))||void 0===E?void 0:E.id;if(e!==g[0]&&_){f(g);continue}}((null===(y=this.metadataRegistry.get(g[0]))||void 0===y?void 0:y.id)||F.cycle||F.count>1&&"ref"===c.reused)&&f(g)}else f(g)}}catch(e){D.e(e)}finally{D.f()}var b,C=function(e,t){var n,r,u=s.seen.get(e),a=null!==(n=u.def)&&void 0!==n?n:u.schema,i=pn({},a);if(null!==u.ref){var o=u.ref;if(u.ref=null,o){C(o,t);var c,l=s.seen.get(o).schema;!l.$ref||"draft-7"!==t.target&&"draft-4"!==t.target&&"openapi-3.0"!==t.target?(Object.assign(a,l),Object.assign(a,i)):(a.allOf=null!==(c=a.allOf)&&void 0!==c?c:[],a.allOf.push(l))}u.isParent||s.override({zodSchema:e,jsonSchema:a,path:null!==(r=u.path)&&void 0!==r?r:[]})}},k=an(gn(this.seen.entries()).reverse());try{for(k.s();!(b=k.n()).done;){var A=b.value;C(A[0],{target:this.target})}}catch(e){k.e(e)}finally{k.f()}var w={};if("draft-2020-12"===this.target?w.$schema="https://json-schema.org/draft/2020-12/schema":"draft-7"===this.target?w.$schema="http://json-schema.org/draft-07/schema#":"draft-4"===this.target?w.$schema="http://json-schema.org/draft-04/schema#":"openapi-3.0"===this.target||console.warn("Invalid target: ".concat(this.target)),null!==(a=c.external)&&void 0!==a&&a.uri){var S,x=null===(S=c.external.registry.get(e))||void 0===S?void 0:S.id;if(!x)throw new Error("Schema is missing an `id` property");w.$id=c.external.uri(x)}Object.assign(w,l.def);var O,B=null!==(i=null===(o=c.external)||void 0===o?void 0:o.defs)&&void 0!==i?i:{},I=an(this.seen.entries());try{for(I.s();!(O=I.n()).done;){var T=O.value[1];T.def&&T.defId&&(B[T.defId]=T.def)}}catch(e){I.e(e)}finally{I.f()}c.external||Object.keys(B).length>0&&("draft-2020-12"===this.target?w.$defs=B:w.definitions=B);try{return JSON.parse(JSON.stringify(w))}catch(e){throw new Error("Error converting schema to JSON.")}}}]);function bf(e,t){var n=null!=t?t:{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);var r=e._zod.def;switch(r.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":case"custom":case"success":case"catch":case"function":return!1;case"array":return bf(r.element,n);case"object":for(var u in r.shape)if(bf(r.shape[u],n))return!0;return!1;case"union":var a,i=an(r.options);try{for(i.s();!(a=i.n()).done;)if(bf(a.value,n))return!0}catch(e){i.e(e)}finally{i.f()}return!1;case"intersection":return bf(r.left,n)||bf(r.right,n);case"tuple":var o,s=an(r.items);try{for(s.s();!(o=s.n()).done;)if(bf(o.value,n))return!0}catch(e){s.e(e)}finally{s.f()}return!(!r.rest||!bf(r.rest,n));case"record":case"map":return bf(r.keyType,n)||bf(r.valueType,n);case"set":return bf(r.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":case"default":case"prefault":return bf(r.innerType,n);case"lazy":return bf(r.getter(),n);case"transform":return!0;case"pipe":return bf(r.in,n)||bf(r.out,n)}throw new Error("Unknown schema type: ".concat(r.type))}var Cf=Object.freeze({__proto__:null,endsWith:mf,gt:uf,gte:af,includes:hf,length:lf,lowercase:df,lt:nf,lte:rf,maxLength:sf,maxSize:function(e,t){return new _c(pn(pn({check:"max_size"},ks(t)),{},{maximum:e}))},mime:function(e,t){return new zc(pn({check:"mime_type",mime:e},ks(t)))},minLength:cf,minSize:function(e,t){return new bc(pn(pn({check:"min_size"},ks(t)),{},{minimum:e}))},multipleOf:of,negative:function(e){return nf(0,e)},nonnegative:function(e){return af(0,e)},nonpositive:function(e){return rf(0,e)},normalize:yf,overwrite:Df,positive:function(e){return uf(0,e)},property:function(e,t,n){return new Nc(pn({check:"property",property:e,schema:t},ks(n)))},regex:ff,size:function(e,t){return new Cc(pn(pn({check:"size_equals"},ks(t)),{},{size:e}))},startsWith:vf,toLowerCase:Ff,toUpperCase:Ef,trim:gf,uppercase:pf}),kf=ns("ZodISODateTime",function(e,t){tl.init(e,t),Vf.init(e,t)});var Af=ns("ZodISODate",function(e,t){nl.init(e,t),Vf.init(e,t)});var wf=ns("ZodISOTime",function(e,t){rl.init(e,t),Vf.init(e,t)});var Sf=ns("ZodISODuration",function(e,t){ul.init(e,t),Vf.init(e,t)});var xf=ns("ZodError",function(e,t){js.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:function(t){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e.message},n={_errors:[]},r=function(e){var u,a=an(e.issues);try{for(a.s();!(u=a.n()).done;){var i=u.value;if("invalid_union"===i.code&&i.errors.length)i.errors.map(function(e){return r({issues:e})});else if("invalid_key"===i.code)r({issues:i.issues});else if("invalid_element"===i.code)r({issues:i.issues});else if(0===i.path.length)n._errors.push(t(i));else for(var o=n,s=0;s<i.path.length;){var c=i.path[s];s===i.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(i))):o[c]=o[c]||{_errors:[]},o=o[c],s++}}}catch(e){a.e(e)}finally{a.f()}};return r(e),n}(e,t)}},flatten:{value:function(t){return function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e.message},r={},u=[],a=an(e.issues);try{for(a.s();!(t=a.n()).done;){var i=t.value;i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(n(i))):u.push(n(i))}}catch(e){a.e(e)}finally{a.f()}return{formErrors:u,fieldErrors:r}}(e,t)}},addIssue:{value:function(t){e.issues.push(t),e.message=JSON.stringify(e.issues,ss,2)}},addIssues:{value:function(t){var n;(n=e.issues).push.apply(n,gn(t)),e.message=JSON.stringify(e.issues,ss,2)}},isEmpty:{get:function(){return 0===e.issues.length}}})},{Parent:Error}),Of=zs(xf),Bf=Rs(xf),If=Ms(xf),Tf=Ls(xf),Pf=function(e){return function(t,n,r){var u=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return zs(e)(t,n,u)}}(xf),jf=function(e){return function(t,n,r){return zs(e)(t,n,r)}}(xf),Nf=function(e){return function(){var t=Xt(vn().m(function t(n,r,u){var a;return vn().w(function(t){for(;;)if(0===t.n)return a=u?Object.assign(u,{direction:"backward"}):{direction:"backward"},t.a(2,Rs(e)(n,r,a))},t)}));return function(e,n,r){return t.apply(this,arguments)}}()}(xf),zf=function(e){return function(){var t=Xt(vn().m(function t(n,r,u){return vn().w(function(t){for(;;)if(0===t.n)return t.a(2,Rs(e)(n,r,u))},t)}));return function(e,n,r){return t.apply(this,arguments)}}()}(xf),Rf=function(e){return function(t,n,r){var u=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ms(e)(t,n,u)}}(xf),Mf=function(e){return function(t,n,r){return Ms(e)(t,n,r)}}(xf),Zf=function(e){return function(){var t=Xt(vn().m(function t(n,r,u){var a;return vn().w(function(t){for(;;)if(0===t.n)return a=u?Object.assign(u,{direction:"backward"}):{direction:"backward"},t.a(2,Ls(e)(n,r,a))},t)}));return function(e,n,r){return t.apply(this,arguments)}}()}(xf),Lf=function(e){return function(){var t=Xt(vn().m(function t(n,r,u){return vn().w(function(t){for(;;)if(0===t.n)return t.a(2,Ls(e)(n,r,u))},t)}));return function(e,n,r){return t.apply(this,arguments)}}()}(xf),$f=ns("ZodType",function(e,t){return Lc.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=function(){for(var n,r=arguments.length,u=new Array(r),a=0;a<r;a++)u[a]=arguments[a];return e.clone(vs(t,{checks:[].concat(gn(null!==(n=t.checks)&&void 0!==n?n:[]),gn(u.map(function(e){return"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e})))}))},e.clone=function(t,n){return Cs(e,t,n)},e.brand=function(){return e},e.register=function(t,n){return t.add(e,n),e},e.parse=function(t,n){return Of(e,t,n,{callee:e.parse})},e.safeParse=function(t,n){return If(e,t,n)},e.parseAsync=function(){var t=Xt(vn().m(function t(n,r){return vn().w(function(t){for(;;)if(0===t.n)return t.a(2,Bf(e,n,r,{callee:e.parseAsync}))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.safeParseAsync=function(){var t=Xt(vn().m(function t(n,r){return vn().w(function(t){for(;;)if(0===t.n)return t.a(2,Tf(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.spa=e.safeParseAsync,e.encode=function(t,n){return Pf(e,t,n)},e.decode=function(t,n){return jf(e,t,n)},e.encodeAsync=function(){var t=Xt(vn().m(function t(n,r){return vn().w(function(t){for(;;)if(0===t.n)return t.a(2,Nf(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.decodeAsync=function(){var t=Xt(vn().m(function t(n,r){return vn().w(function(t){for(;;)if(0===t.n)return t.a(2,zf(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.safeEncode=function(t,n){return Rf(e,t,n)},e.safeDecode=function(t,n){return Mf(e,t,n)},e.safeEncodeAsync=function(){var t=Xt(vn().m(function t(n,r){return vn().w(function(t){for(;;)if(0===t.n)return t.a(2,Zf(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.safeDecodeAsync=function(){var t=Xt(vn().m(function t(n,r){return vn().w(function(t){for(;;)if(0===t.n)return t.a(2,Lf(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.refine=function(t,n){return e.check(function(e){return function(e,t,n){return new e(pn({type:"custom",check:"custom",fn:t},ks(n)))}(ep,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(t,n))},e.superRefine=function(t){return e.check(function(e){var t=function(e){var t=new mc(pn({check:"custom"},ks(void 0)));return t._zod.check=e,t}(function(n){return n.addIssue=function(e){if("string"==typeof e)n.issues.push(Ts(e,n.value,t._zod.def));else{var r,u,a,i,o=e;o.fatal&&(o.continue=!1),null!==(r=o.code)&&void 0!==r||(o.code="custom"),null!==(u=o.input)&&void 0!==u||(o.input=n.value),null!==(a=o.inst)&&void 0!==a||(o.inst=t),null!==(i=o.continue)&&void 0!==i||(o.continue=!t._zod.def.abort),n.issues.push(Ts(o))}},e(n.value,n)});return t}(t))},e.overwrite=function(t){return e.check(Df(t))},e.optional=function(){return Ld(e)},e.nullable=function(){return qd(e)},e.nullish=function(){return Ld(qd(e))},e.nonoptional=function(t){return function(e,t){return new Vd(pn({type:"nonoptional",innerType:e},ks(t)))}(e,t)},e.array=function(){return kd(e)},e.or=function(t){return Od([e,t])},e.and=function(t){return new Id({type:"intersection",left:e,right:t})},e.transform=function(t){return Jd(e,new Md({type:"transform",transform:t}))},e.default=function(t){return n=t,new Ud({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():Es(n)}});var n},e.prefault=function(t){return n=t,new Hd({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():Es(n)}});var n},e.catch=function(t){return new Wd({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:function(){return n}});var n},e.pipe=function(t){return Jd(e,t)},e.readonly=function(){return new Yd({type:"readonly",innerType:e})},e.describe=function(t){var n=e.clone();return ef.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:function(){var t;return null===(t=ef.get(e))||void 0===t?void 0:t.description},configurable:!0}),e.meta=function(){if(0===arguments.length)return ef.get(e);var t=e.clone();return ef.add(t,arguments.length<=0?void 0:arguments[0]),t},e.isOptional=function(){return e.safeParse(void 0).success},e.isNullable=function(){return e.safeParse(null).success},e}),qf=ns("_ZodString",function(e,t){var n,r,u;$c.init(e,t),$f.init(e,t);var a=e._zod.bag;e.format=null!==(n=a.format)&&void 0!==n?n:null,e.minLength=null!==(r=a.minimum)&&void 0!==r?r:null,e.maxLength=null!==(u=a.maximum)&&void 0!==u?u:null,e.regex=function(){return e.check(ff.apply(Cf,arguments))},e.includes=function(){return e.check(hf.apply(Cf,arguments))},e.startsWith=function(){return e.check(vf.apply(Cf,arguments))},e.endsWith=function(){return e.check(mf.apply(Cf,arguments))},e.min=function(){return e.check(cf.apply(Cf,arguments))},e.max=function(){return e.check(sf.apply(Cf,arguments))},e.length=function(){return e.check(lf.apply(Cf,arguments))},e.nonempty=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.check(cf.apply(Cf,[1].concat(n)))},e.lowercase=function(t){return e.check(df(t))},e.uppercase=function(t){return e.check(pf(t))},e.trim=function(){return e.check(gf())},e.normalize=function(){return e.check(yf.apply(Cf,arguments))},e.toLowerCase=function(){return e.check(Ff())},e.toUpperCase=function(){return e.check(Ef())}}),Uf=ns("ZodString",function(e,t){$c.init(e,t),qf.init(e,t),e.email=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"email",check:"string_format",abort:!1},ks(t)))}(Wf,t))},e.url=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"url",check:"string_format",abort:!1},ks(t)))}(Qf,t))},e.jwt=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"jwt",check:"string_format",abort:!1},ks(t)))}(fd,t))},e.emoji=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"emoji",check:"string_format",abort:!1},ks(t)))}(Gf,t))},e.guid=function(t){return e.check(tf(Kf,t))},e.uuid=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"uuid",check:"string_format",abort:!1},ks(t)))}(Jf,t))},e.uuidv4=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4"},ks(t)))}(Jf,t))},e.uuidv6=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6"},ks(t)))}(Jf,t))},e.uuidv7=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7"},ks(t)))}(Jf,t))},e.nanoid=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"nanoid",check:"string_format",abort:!1},ks(t)))}(Yf,t))},e.guid=function(t){return e.check(tf(Kf,t))},e.cuid=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"cuid",check:"string_format",abort:!1},ks(t)))}(Xf,t))},e.cuid2=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"cuid2",check:"string_format",abort:!1},ks(t)))}(ed,t))},e.ulid=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"ulid",check:"string_format",abort:!1},ks(t)))}(td,t))},e.base64=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"base64",check:"string_format",abort:!1},ks(t)))}(sd,t))},e.base64url=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"base64url",check:"string_format",abort:!1},ks(t)))}(cd,t))},e.xid=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"xid",check:"string_format",abort:!1},ks(t)))}(nd,t))},e.ksuid=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"ksuid",check:"string_format",abort:!1},ks(t)))}(rd,t))},e.ipv4=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"ipv4",check:"string_format",abort:!1},ks(t)))}(ud,t))},e.ipv6=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"ipv6",check:"string_format",abort:!1},ks(t)))}(ad,t))},e.cidrv4=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"cidrv4",check:"string_format",abort:!1},ks(t)))}(id,t))},e.cidrv6=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"cidrv6",check:"string_format",abort:!1},ks(t)))}(od,t))},e.e164=function(t){return e.check(function(e,t){return new e(pn({type:"string",format:"e164",check:"string_format",abort:!1},ks(t)))}(ld,t))},e.datetime=function(t){return e.check(function(e){return function(e,t){return new e(pn({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null},ks(t)))}(kf,e)}(t))},e.date=function(t){return e.check(function(e){return function(e,t){return new e(pn({type:"string",format:"date",check:"string_format"},ks(t)))}(Af,e)}(t))},e.time=function(t){return e.check(function(e){return function(e,t){return new e(pn({type:"string",format:"time",check:"string_format",precision:null},ks(t)))}(wf,e)}(t))},e.duration=function(t){return e.check(function(e){return function(e,t){return new e(pn({type:"string",format:"duration",check:"string_format"},ks(t)))}(Sf,e)}(t))}});function Hf(e){return function(e,t){return new e(pn({type:"string"},ks(t)))}(Uf,e)}var Vf=ns("ZodStringFormat",function(e,t){qc.init(e,t),qf.init(e,t)}),Wf=ns("ZodEmail",function(e,t){Vc.init(e,t),Vf.init(e,t)}),Kf=ns("ZodGUID",function(e,t){Uc.init(e,t),Vf.init(e,t)}),Jf=ns("ZodUUID",function(e,t){Hc.init(e,t),Vf.init(e,t)}),Qf=ns("ZodURL",function(e,t){Wc.init(e,t),Vf.init(e,t)}),Gf=ns("ZodEmoji",function(e,t){Kc.init(e,t),Vf.init(e,t)}),Yf=ns("ZodNanoID",function(e,t){Jc.init(e,t),Vf.init(e,t)}),Xf=ns("ZodCUID",function(e,t){Qc.init(e,t),Vf.init(e,t)}),ed=ns("ZodCUID2",function(e,t){Gc.init(e,t),Vf.init(e,t)}),td=ns("ZodULID",function(e,t){Yc.init(e,t),Vf.init(e,t)}),nd=ns("ZodXID",function(e,t){Xc.init(e,t),Vf.init(e,t)}),rd=ns("ZodKSUID",function(e,t){el.init(e,t),Vf.init(e,t)}),ud=ns("ZodIPv4",function(e,t){al.init(e,t),Vf.init(e,t)}),ad=ns("ZodIPv6",function(e,t){il.init(e,t),Vf.init(e,t)}),id=ns("ZodCIDRv4",function(e,t){ol.init(e,t),Vf.init(e,t)}),od=ns("ZodCIDRv6",function(e,t){sl.init(e,t),Vf.init(e,t)}),sd=ns("ZodBase64",function(e,t){ll.init(e,t),Vf.init(e,t)}),cd=ns("ZodBase64URL",function(e,t){fl.init(e,t),Vf.init(e,t)}),ld=ns("ZodE164",function(e,t){dl.init(e,t),Vf.init(e,t)}),fd=ns("ZodJWT",function(e,t){pl.init(e,t),Vf.init(e,t)}),dd=ns("ZodNumber",function(e,t){var n,r,u,a,i,o,s,c,l;hl.init(e,t),$f.init(e,t),e.gt=function(t,n){return e.check(uf(t,n))},e.gte=function(t,n){return e.check(af(t,n))},e.min=function(t,n){return e.check(af(t,n))},e.lt=function(t,n){return e.check(nf(t,n))},e.lte=function(t,n){return e.check(rf(t,n))},e.max=function(t,n){return e.check(rf(t,n))},e.int=function(t){return e.check(vd(t))},e.safe=function(t){return e.check(vd(t))},e.positive=function(t){return e.check(uf(0,t))},e.nonnegative=function(t){return e.check(af(0,t))},e.negative=function(t){return e.check(nf(0,t))},e.nonpositive=function(t){return e.check(rf(0,t))},e.multipleOf=function(t,n){return e.check(of(t,n))},e.step=function(t,n){return e.check(of(t,n))},e.finite=function(){return e};var f=e._zod.bag;e.minValue=null!==(n=Math.max(null!==(r=f.minimum)&&void 0!==r?r:Number.NEGATIVE_INFINITY,null!==(u=f.exclusiveMinimum)&&void 0!==u?u:Number.NEGATIVE_INFINITY))&&void 0!==n?n:null,e.maxValue=null!==(a=Math.min(null!==(i=f.maximum)&&void 0!==i?i:Number.POSITIVE_INFINITY,null!==(o=f.exclusiveMaximum)&&void 0!==o?o:Number.POSITIVE_INFINITY))&&void 0!==a?a:null,e.isInt=(null!==(s=f.format)&&void 0!==s?s:"").includes("int")||Number.isSafeInteger(null!==(c=f.multipleOf)&&void 0!==c?c:.5),e.isFinite=!0,e.format=null!==(l=f.format)&&void 0!==l?l:null});function pd(e){return function(e,t){return new e(pn({type:"number",checks:[]},ks(t)))}(dd,e)}var hd=ns("ZodNumberFormat",function(e,t){vl.init(e,t),dd.init(e,t)});function vd(e){return function(e,t){return new e(pn({type:"number",check:"number_format",abort:!1,format:"safeint"},ks(t)))}(hd,e)}var md=ns("ZodBoolean",function(e,t){ml.init(e,t),$f.init(e,t)});function Dd(e){return function(e,t){return new e(pn({type:"boolean"},ks(t)))}(md,e)}var yd=ns("ZodNull",function(e,t){Dl.init(e,t),$f.init(e,t)});function gd(e){return function(e,t){return new e(pn({type:"null"},ks(t)))}(yd,e)}var Fd=ns("ZodUnknown",function(e,t){yl.init(e,t),$f.init(e,t)});function Ed(){return new Fd({type:"unknown"})}var _d=ns("ZodNever",function(e,t){gl.init(e,t),$f.init(e,t)});function bd(e){return function(e,t){return new e(pn({type:"never"},ks(t)))}(_d,e)}var Cd=ns("ZodArray",function(e,t){El.init(e,t),$f.init(e,t),e.element=t.element,e.min=function(t,n){return e.check(cf(t,n))},e.nonempty=function(t){return e.check(cf(1,t))},e.max=function(t,n){return e.check(sf(t,n))},e.length=function(t,n){return e.check(lf(t,n))},e.unwrap=function(){return e.element}});function kd(e,t){return function(e,t,n){return new e(pn({type:"array",element:t},ks(n)))}(Cd,e,t)}var Ad=ns("ZodObject",function(e,t){Al.init(e,t),$f.init(e,t),ps(e,"shape",function(){return t.shape}),e.keyof=function(){return Nd(Object.keys(e._zod.def.shape))},e.catchall=function(t){return e.clone(pn(pn({},e._zod.def),{},{catchall:t}))},e.passthrough=function(){return e.clone(pn(pn({},e._zod.def),{},{catchall:Ed()}))},e.loose=function(){return e.clone(pn(pn({},e._zod.def),{},{catchall:Ed()}))},e.strict=function(){return e.clone(pn(pn({},e._zod.def),{},{catchall:bd()}))},e.strip=function(){return e.clone(pn(pn({},e._zod.def),{},{catchall:void 0}))},e.extend=function(t){return function(e,t){if(!Fs(t))throw new Error("Invalid input to extend: expected a plain object");var n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");var r=vs(e._zod.def,{get shape(){var n=pn(pn({},e._zod.def.shape),t);return hs(this,"shape",n),n},checks:[]});return Cs(e,r)}(e,t)},e.safeExtend=function(t){return function(e,t){if(!Fs(t))throw new Error("Invalid input to safeExtend: expected a plain object");var n=pn(pn({},e._zod.def),{},{get shape(){var n=pn(pn({},e._zod.def.shape),t);return hs(this,"shape",n),n},checks:e._zod.def.checks});return Cs(e,n)}(e,t)},e.merge=function(t){return function(e,t){var n=vs(e._zod.def,{get shape(){var n=pn(pn({},e._zod.def.shape),t._zod.def.shape);return hs(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Cs(e,n)}(e,t)},e.pick=function(t){return function(e,t){var n=e._zod.def;return Cs(e,vs(e._zod.def,{get shape(){var e={};for(var r in t){if(!(r in n.shape))throw new Error('Unrecognized key: "'.concat(r,'"'));t[r]&&(e[r]=n.shape[r])}return hs(this,"shape",e),e},checks:[]}))}(e,t)},e.omit=function(t){return function(e,t){var n=e._zod.def,r=vs(e._zod.def,{get shape(){var r=pn({},e._zod.def.shape);for(var u in t){if(!(u in n.shape))throw new Error('Unrecognized key: "'.concat(u,'"'));t[u]&&delete r[u]}return hs(this,"shape",r),r},checks:[]});return Cs(e,r)}(e,t)},e.partial=function(){return function(e,t,n){var r=vs(t._zod.def,{get shape(){var r=t._zod.def.shape,u=pn({},r);if(n)for(var a in n){if(!(a in r))throw new Error('Unrecognized key: "'.concat(a,'"'));n[a]&&(u[a]=e?new e({type:"optional",innerType:r[a]}):r[a])}else for(var i in r)u[i]=e?new e({type:"optional",innerType:r[i]}):r[i];return hs(this,"shape",u),u},checks:[]});return Cs(t,r)}(Zd,e,arguments.length<=0?void 0:arguments[0])},e.required=function(){return function(e,t,n){var r=vs(t._zod.def,{get shape(){var r=t._zod.def.shape,u=pn({},r);if(n)for(var a in n){if(!(a in u))throw new Error('Unrecognized key: "'.concat(a,'"'));n[a]&&(u[a]=new e({type:"nonoptional",innerType:r[a]}))}else for(var i in r)u[i]=new e({type:"nonoptional",innerType:r[i]});return hs(this,"shape",u),u},checks:[]});return Cs(t,r)}(Vd,e,arguments.length<=0?void 0:arguments[0])}});function wd(e,t){var n=pn({type:"object",shape:null!=e?e:{}},ks(t));return new Ad(n)}function Sd(e,t){return new Ad(pn({type:"object",shape:e,catchall:bd()},ks(t)))}var xd=ns("ZodUnion",function(e,t){Sl.init(e,t),$f.init(e,t),e.options=t.options});function Od(e,t){return new xd(pn({type:"union",options:e},ks(t)))}var Bd=ns("ZodDiscriminatedUnion",function(e,t){xd.init(e,t),xl.init(e,t)}),Id=ns("ZodIntersection",function(e,t){Ol.init(e,t),$f.init(e,t)}),Td=ns("ZodRecord",function(e,t){Tl.init(e,t),$f.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Pd(e,t,n){return new Td(pn({type:"record",keyType:e,valueType:t},ks(n)))}var jd=ns("ZodEnum",function(e,t){Pl.init(e,t),$f.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);var n=new Set(Object.keys(t.entries));e.extract=function(e,r){var u,a={},i=an(e);try{for(i.s();!(u=i.n()).done;){var o=u.value;if(!n.has(o))throw new Error("Key ".concat(o," not found in enum"));a[o]=t.entries[o]}}catch(e){i.e(e)}finally{i.f()}return new jd(pn(pn(pn({},t),{},{checks:[]},ks(r)),{},{entries:a}))},e.exclude=function(e,r){var u,a=pn({},t.entries),i=an(e);try{for(i.s();!(u=i.n()).done;){var o=u.value;if(!n.has(o))throw new Error("Key ".concat(o," not found in enum"));delete a[o]}}catch(e){i.e(e)}finally{i.f()}return new jd(pn(pn(pn({},t),{},{checks:[]},ks(r)),{},{entries:a}))}});function Nd(e,t){var n=Array.isArray(e)?Object.fromEntries(e.map(function(e){return[e,e]})):e;return new jd(pn({type:"enum",entries:n},ks(t)))}var zd=ns("ZodLiteral",function(e,t){jl.init(e,t),$f.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get:function(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Rd(e,t){return new zd(pn({type:"literal",values:Array.isArray(e)?e:[e]},ks(t)))}var Md=ns("ZodTransform",function(e,t){Nl.init(e,t),$f.init(e,t),e._zod.parse=function(n,r){if("backward"===r.direction)throw new us(e.constructor.name);n.addIssue=function(r){if("string"==typeof r)n.issues.push(Ts(r,n.value,t));else{var u,a,i,o=r;o.fatal&&(o.continue=!1),null!==(u=o.code)&&void 0!==u||(o.code="custom"),null!==(a=o.input)&&void 0!==a||(o.input=n.value),null!==(i=o.inst)&&void 0!==i||(o.inst=e),n.issues.push(Ts(o))}};var u=t.transform(n.value,n);return u instanceof Promise?u.then(function(e){return n.value=e,n}):(n.value=u,n)}}),Zd=ns("ZodOptional",function(e,t){Rl.init(e,t),$f.init(e,t),e.unwrap=function(){return e._zod.def.innerType}});function Ld(e){return new Zd({type:"optional",innerType:e})}var $d=ns("ZodNullable",function(e,t){Ml.init(e,t),$f.init(e,t),e.unwrap=function(){return e._zod.def.innerType}});function qd(e){return new $d({type:"nullable",innerType:e})}var Ud=ns("ZodDefault",function(e,t){Zl.init(e,t),$f.init(e,t),e.unwrap=function(){return e._zod.def.innerType},e.removeDefault=e.unwrap}),Hd=ns("ZodPrefault",function(e,t){$l.init(e,t),$f.init(e,t),e.unwrap=function(){return e._zod.def.innerType}}),Vd=ns("ZodNonOptional",function(e,t){ql.init(e,t),$f.init(e,t),e.unwrap=function(){return e._zod.def.innerType}}),Wd=ns("ZodCatch",function(e,t){Hl.init(e,t),$f.init(e,t),e.unwrap=function(){return e._zod.def.innerType},e.removeCatch=e.unwrap}),Kd=ns("ZodPipe",function(e,t){Vl.init(e,t),$f.init(e,t),e.in=t.in,e.out=t.out});function Jd(e,t){return new Kd({type:"pipe",in:e,out:t})}var Qd,Gd,Yd=ns("ZodReadonly",function(e,t){Kl.init(e,t),$f.init(e,t),e.unwrap=function(){return e._zod.def.innerType}}),Xd=ns("ZodLazy",function(e,t){Ql.init(e,t),$f.init(e,t),e.unwrap=function(){return e._zod.def.getter()}}),ep=ns("ZodCustom",function(e,t){Gl.init(e,t),$f.init(e,t)});function tp(e,t){return function(e,t,n){var r,u=ks(n);return null!==(r=u.abort)&&void 0!==r||(u.abort=!0),new e(pn({type:"custom",check:"custom",fn:t},u))}(ep,null!=e?e:function(){return!0},t)}function np(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{error:"Input not instance of ".concat(e.name)},n=new ep(pn({type:"custom",check:"custom",fn:function(t){return t instanceof e},abort:!0},ks(t)));return n._zod.bag.Class=e,n}!function(e){e.assertEqual=function(e){},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=function(e){var t,n={},r=an(e);try{for(r.s();!(t=r.n()).done;){var u=t.value;n[u]=u}}catch(e){r.e(e)}finally{r.f()}return n},e.getValidEnumValues=function(t){var n,r={},u=an(e.objectKeys(t).filter(function(e){return"number"!=typeof t[t[e]]}));try{for(u.s();!(n=u.n()).done;){var a=n.value;r[a]=t[a]}}catch(e){u.e(e)}finally{u.f()}return e.objectValues(r)},e.objectValues=function(t){return e.objectKeys(t).map(function(e){return t[e]})},e.objectKeys="function"==typeof Object.keys?function(e){return Object.keys(e)}:function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=function(e,t){var n,r=an(e);try{for(r.s();!(n=r.n()).done;){var u=n.value;if(t(u))return u}}catch(e){r.e(e)}finally{r.f()}},e.isInteger="function"==typeof Number.isInteger?function(e){return Number.isInteger(e)}:function(e){return"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e},e.joinValues=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" | ";return e.map(function(e){return"string"==typeof e?"'".concat(e,"'"):e}).join(t)},e.jsonStringifyReplacer=function(e,t){return"bigint"==typeof t?t.toString():t}}(Qd||(Qd={})),function(e){e.mergeShapes=function(e,t){return pn(pn({},e),t)}}(Gd||(Gd={}));var rp=Qd.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),up=function(e){switch(En(e)){case"undefined":return rp.undefined;case"string":return rp.string;case"number":return Number.isNaN(e)?rp.nan:rp.number;case"boolean":return rp.boolean;case"function":return rp.function;case"bigint":return rp.bigint;case"symbol":return rp.symbol;case"object":return Array.isArray(e)?rp.array:null===e?rp.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?rp.promise:"undefined"!=typeof Map&&e instanceof Map?rp.map:"undefined"!=typeof Set&&e instanceof Set?rp.set:"undefined"!=typeof Date&&e instanceof Date?rp.date:rp.object;default:return rp.unknown}},ap=Qd.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"]),ip=function(){function e(t){var n;tn(this,e),(n=en(this,e)).issues=[],n.addIssue=function(e){n.issues=[].concat(gn(n.issues),[e])},n.addIssues=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];n.issues=[].concat(gn(n.issues),gn(e))};var r=(this instanceof e?this.constructor:void 0).prototype;return Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r,n.name="ZodError",n.issues=t,n}return ln(e,bn(Error)),un(e,[{key:"errors",get:function(){return this.issues}},{key:"format",value:function(e){var t=e||function(e){return e.message},n={_errors:[]},r=function(e){var u,a=an(e.issues);try{for(a.s();!(u=a.n()).done;){var i=u.value;if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else for(var o=n,s=0;s<i.path.length;){var c=i.path[s];s===i.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(i))):o[c]=o[c]||{_errors:[]},o=o[c],s++}}}catch(e){a.e(e)}finally{a.f()}};return r(this),n}},{key:"toString",value:function(){return this.message}},{key:"message",get:function(){return JSON.stringify(this.issues,Qd.jsonStringifyReplacer,2)}},{key:"isEmpty",get:function(){return 0===this.issues.length}},{key:"flatten",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e.message},n=Object.create(null),r=[],u=an(this.issues);try{for(u.s();!(e=u.n()).done;){var a=e.value;if(a.path.length>0){var i=a.path[0];n[i]=n[i]||[],n[i].push(t(a))}else r.push(t(a))}}catch(e){u.e(e)}finally{u.f()}return{formErrors:r,fieldErrors:n}}},{key:"formErrors",get:function(){return this.flatten()}}],[{key:"assert",value:function(t){if(!(t instanceof e))throw new Error("Not a ZodError: ".concat(t))}}])}();ip.create=function(e){return new ip(e)};var op=function(e,t){var n;switch(e.code){case ap.invalid_type:n=e.received===rp.undefined?"Required":"Expected ".concat(e.expected,", received ").concat(e.received);break;case ap.invalid_literal:n="Invalid literal value, expected ".concat(JSON.stringify(e.expected,Qd.jsonStringifyReplacer));break;case ap.unrecognized_keys:n="Unrecognized key(s) in object: ".concat(Qd.joinValues(e.keys,", "));break;case ap.invalid_union:n="Invalid input";break;case ap.invalid_union_discriminator:n="Invalid discriminator value. Expected ".concat(Qd.joinValues(e.options));break;case ap.invalid_enum_value:n="Invalid enum value. Expected ".concat(Qd.joinValues(e.options),", received '").concat(e.received,"'");break;case ap.invalid_arguments:n="Invalid function arguments";break;case ap.invalid_return_type:n="Invalid function return type";break;case ap.invalid_date:n="Invalid date";break;case ap.invalid_string:"object"===En(e.validation)?"includes"in e.validation?(n='Invalid input: must include "'.concat(e.validation.includes,'"'),"number"==typeof e.validation.position&&(n="".concat(n," at one or more positions greater than or equal to ").concat(e.validation.position))):"startsWith"in e.validation?n='Invalid input: must start with "'.concat(e.validation.startsWith,'"'):"endsWith"in e.validation?n='Invalid input: must end with "'.concat(e.validation.endsWith,'"'):Qd.assertNever(e.validation):n="regex"!==e.validation?"Invalid ".concat(e.validation):"Invalid";break;case ap.too_small:n="array"===e.type?"Array must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"more than"," ").concat(e.minimum," element(s)"):"string"===e.type?"String must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"over"," ").concat(e.minimum," character(s)"):"number"===e.type||"bigint"===e.type?"Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum):"date"===e.type?"Date must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(e.minimum))):"Invalid input";break;case ap.too_big:n="array"===e.type?"Array must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"less than"," ").concat(e.maximum," element(s)"):"string"===e.type?"String must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"under"," ").concat(e.maximum," character(s)"):"number"===e.type?"Number must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):"bigint"===e.type?"BigInt must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):"date"===e.type?"Date must be ".concat(e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(e.maximum))):"Invalid input";break;case ap.custom:n="Invalid input";break;case ap.invalid_intersection_types:n="Intersection results could not be merged";break;case ap.not_multiple_of:n="Number must be a multiple of ".concat(e.multipleOf);break;case ap.not_finite:n="Number must be finite";break;default:n=t.defaultError,Qd.assertNever(e)}return{message:n}},sp=op;function cp(){return sp}var lp=function(e){var t=e.data,n=e.path,r=e.errorMaps,u=e.issueData,a=[].concat(gn(n),gn(u.path||[])),i=pn(pn({},u),{},{path:a});if(void 0!==u.message)return pn(pn({},u),{},{path:a,message:u.message});var o,s="",c=r.filter(function(e){return!!e}).slice().reverse(),l=an(c);try{for(l.s();!(o=l.n()).done;)s=(0,o.value)(i,{data:t,defaultError:s}).message}catch(e){l.e(e)}finally{l.f()}return pn(pn({},u),{},{path:a,message:s})};function fp(e,t){var n=cp(),r=lp({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===op?void 0:op].filter(function(e){return!!e})});e.common.issues.push(r)}var dp,pp=function(){function e(){tn(this,e),this.value="valid"}return un(e,[{key:"dirty",value:function(){"valid"===this.value&&(this.value="dirty")}},{key:"abort",value:function(){"aborted"!==this.value&&(this.value="aborted")}}],[{key:"mergeArray",value:function(e,t){var n,r=[],u=an(t);try{for(u.s();!(n=u.n()).done;){var a=n.value;if("aborted"===a.status)return hp;"dirty"===a.status&&e.dirty(),r.push(a.value)}}catch(e){u.e(e)}finally{u.f()}return{status:e.value,value:r}}},{key:"mergeObjectAsync",value:(t=Xt(vn().m(function t(n,r){var u,a,i,o,s,c,l;return vn().w(function(t){for(;;)switch(t.p=t.n){case 0:u=[],a=an(r),t.p=1,a.s();case 2:if((i=a.n()).done){t.n=6;break}return o=i.value,t.n=3,o.key;case 3:return s=t.v,t.n=4,o.value;case 4:c=t.v,u.push({key:s,value:c});case 5:t.n=2;break;case 6:t.n=8;break;case 7:t.p=7,l=t.v,a.e(l);case 8:return t.p=8,a.f(),t.f(8);case 9:return t.a(2,e.mergeObjectSync(n,u))}},t,null,[[1,7,8,9]])})),function(e,n){return t.apply(this,arguments)})},{key:"mergeObjectSync",value:function(e,t){var n,r={},u=an(t);try{for(u.s();!(n=u.n()).done;){var a=n.value,i=a.key,o=a.value;if("aborted"===i.status)return hp;if("aborted"===o.status)return hp;"dirty"===i.status&&e.dirty(),"dirty"===o.status&&e.dirty(),"__proto__"===i.value||void 0===o.value&&!a.alwaysSet||(r[i.value]=o.value)}}catch(e){u.e(e)}finally{u.f()}return{status:e.value,value:r}}}]);var t}(),hp=Object.freeze({status:"aborted"}),vp=function(e){return{status:"dirty",value:e}},mp=function(e){return{status:"valid",value:e}},Dp=function(e){return"aborted"===e.status},yp=function(e){return"dirty"===e.status},gp=function(e){return"valid"===e.status},Fp=function(e){return"undefined"!=typeof Promise&&e instanceof Promise};!function(e){e.errToObj=function(e){return"string"==typeof e?{message:e}:e||{}},e.toString=function(e){return"string"==typeof e?e:null==e?void 0:e.message}}(dp||(dp={}));var Ep=un(function e(t,n,r,u){tn(this,e),this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=u},[{key:"path",get:function(){var e,t;return this._cachedPath.length||(Array.isArray(this._key)?(e=this._cachedPath).push.apply(e,gn(this._path).concat(gn(this._key))):(t=this._cachedPath).push.apply(t,gn(this._path).concat([this._key]))),this._cachedPath}}]),_p=function(e,t){if(gp(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;var t=new ip(e.common.issues);return this._error=t,this._error}}};function bp(e){if(!e)return{};var t=e.errorMap,n=e.invalid_type_error,r=e.required_error,u=e.description;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:u}:{errorMap:function(t,u){var a,i,o=e.message;return"invalid_enum_value"===t.code?{message:null!=o?o:u.defaultError}:void 0===u.data?{message:null!==(i=null!=o?o:r)&&void 0!==i?i:u.defaultError}:"invalid_type"!==t.code?{message:u.defaultError}:{message:null!==(a=null!=o?o:n)&&void 0!==a?a:u.defaultError}},description:u}}var Cp,kp=function(){return un(function e(t){var n=this;tn(this,e),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:function(e){return n["~validate"](e)}}},[{key:"description",get:function(){return this._def.description}},{key:"_getType",value:function(e){return up(e.data)}},{key:"_getOrReturnCtx",value:function(e,t){return t||{common:e.parent.common,data:e.data,parsedType:up(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}},{key:"_processInputParams",value:function(e){return{status:new pp,ctx:{common:e.parent.common,data:e.data,parsedType:up(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}},{key:"_parseSync",value:function(e){var t=this._parse(e);if(Fp(t))throw new Error("Synchronous parse encountered promise.");return t}},{key:"_parseAsync",value:function(e){var t=this._parse(e);return Promise.resolve(t)}},{key:"parse",value:function(e,t){var n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}},{key:"safeParse",value:function(e,t){var n,r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:up(e)},u=this._parseSync({data:e,path:r.path,parent:r});return _p(r,u)}},{key:"~validate",value:function(e){var t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:up(e)};if(!this["~standard"].async)try{var n=this._parseSync({data:e,path:[],parent:t});return gp(n)?{value:n.value}:{issues:t.common.issues}}catch(e){var r;null!=e&&null!==(r=e.message)&&void 0!==r&&null!==(r=r.toLowerCase())&&void 0!==r&&r.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(function(e){return gp(e)?{value:e.value}:{issues:t.common.issues}})}},{key:"parseAsync",value:(e=Xt(vn().m(function e(t,n){var r;return vn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.safeParseAsync(t,n);case 1:if(!(r=e.v).success){e.n=2;break}return e.a(2,r.data);case 2:throw r.error;case 3:return e.a(2)}},e,this)})),function(t,n){return e.apply(this,arguments)})},{key:"safeParseAsync",value:function(){var e=Xt(vn().m(function e(t,n){var r,u,a;return vn().w(function(e){for(;;)switch(e.n){case 0:return r={common:{issues:[],contextualErrorMap:null==n?void 0:n.errorMap,async:!0},path:(null==n?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:up(t)},u=this._parse({data:t,path:r.path,parent:r}),e.n=1,Fp(u)?u:Promise.resolve(u);case 1:return a=e.v,e.a(2,_p(r,a))}},e,this)}));return function(t,n){return e.apply(this,arguments)}}()},{key:"refine",value:function(e,t){return this._refinement(function(n,r){var u=e(n),a=function(){return r.addIssue(pn({code:ap.custom},function(e){return"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t}(n)))};return"undefined"!=typeof Promise&&u instanceof Promise?u.then(function(e){return!!e||(a(),!1)}):!!u||(a(),!1)})}},{key:"refinement",value:function(e,t){return this._refinement(function(n,r){return!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)})}},{key:"_refinement",value:function(e){return new Ah({schema:this,typeName:Ih.ZodEffects,effect:{type:"refinement",refinement:e}})}},{key:"superRefine",value:function(e){return this._refinement(e)}},{key:"optional",value:function(){return wh.create(this,this._def)}},{key:"nullable",value:function(){return Sh.create(this,this._def)}},{key:"nullish",value:function(){return this.nullable().optional()}},{key:"array",value:function(){return oh.create(this)}},{key:"promise",value:function(){return kh.create(this,this._def)}},{key:"or",value:function(e){return lh.create([this,e],this._def)}},{key:"and",value:function(e){return hh.create(this,e,this._def)}},{key:"transform",value:function(e){return new Ah(pn(pn({},bp(this._def)),{},{schema:this,typeName:Ih.ZodEffects,effect:{type:"transform",transform:e}}))}},{key:"default",value:function(e){var t="function"==typeof e?e:function(){return e};return new xh(pn(pn({},bp(this._def)),{},{innerType:this,defaultValue:t,typeName:Ih.ZodDefault}))}},{key:"brand",value:function(){return new Th(pn({typeName:Ih.ZodBranded,type:this},bp(this._def)))}},{key:"catch",value:function(e){var t="function"==typeof e?e:function(){return e};return new Oh(pn(pn({},bp(this._def)),{},{innerType:this,catchValue:t,typeName:Ih.ZodCatch}))}},{key:"describe",value:function(e){return new this.constructor(pn(pn({},this._def),{},{description:e}))}},{key:"pipe",value:function(e){return Ph.create(this,e)}},{key:"readonly",value:function(){return jh.create(this)}},{key:"isOptional",value:function(){return this.safeParse(void 0).success}},{key:"isNullable",value:function(){return this.safeParse(null).success}}]);var e}(),Ap=/^c[^\s-]{8,}$/i,wp=/^[0-9a-z]+$/,Sp=/^[0-9A-HJKMNP-TV-Z]{26}$/i,xp=/^[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,Op=/^[a-z0-9_-]{21}$/i,Bp=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ip=/^[-+]?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)?)??$/,Tp=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Pp=/^(?:(?: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])$/,jp=/^(?:(?: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])$/,Np=/^(([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]))$/,zp=/^(([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])$/,Rp=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Mp=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Zp="((\\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])))",Lp=new RegExp("^".concat(Zp,"$"));function $p(e){var t="[0-5]\\d";e.precision?t="".concat(t,"\\.\\d{").concat(e.precision,"}"):null==e.precision&&(t="".concat(t,"(\\.\\d+)?"));var n=e.precision?"+":"?";return"([01]\\d|2[0-3]):[0-5]\\d(:".concat(t,")").concat(n)}function qp(e){return new RegExp("^".concat($p(e),"$"))}function Up(e){var t="".concat(Zp,"T").concat($p(e)),n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(n.join("|"),")"),new RegExp("^".concat(t,"$"))}function Hp(e,t){return!("v4"!==t&&t||!Pp.test(e))||!("v6"!==t&&t||!Np.test(e))}function Vp(e,t){if(!Bp.test(e))return!1;try{var n=yn(e.split("."),1)[0];if(!n)return!1;var r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),u=JSON.parse(atob(r));return!("object"!==En(u)||null===u||"typ"in u&&"JWT"!==(null==u?void 0:u.typ)||!u.alg||t&&u.alg!==t)}catch(e){return!1}}function Wp(e,t){return!("v4"!==t&&t||!jp.test(e))||!("v6"!==t&&t||!zp.test(e))}var Kp=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==rp.string){var t=this._getOrReturnCtx(e);return fp(t,{code:ap.invalid_type,expected:rp.string,received:t.parsedType}),hp}var n,r=new pp,u=void 0,a=an(this._def.checks);try{for(a.s();!(n=a.n()).done;){var i=n.value;if("min"===i.kind)e.data.length<i.value&&(fp(u=this._getOrReturnCtx(e,u),{code:ap.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if("max"===i.kind)e.data.length>i.value&&(fp(u=this._getOrReturnCtx(e,u),{code:ap.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if("length"===i.kind){var o=e.data.length>i.value,s=e.data.length<i.value;(o||s)&&(u=this._getOrReturnCtx(e,u),o?fp(u,{code:ap.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&fp(u,{code:ap.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if("email"===i.kind)Tp.test(e.data)||(fp(u=this._getOrReturnCtx(e,u),{validation:"email",code:ap.invalid_string,message:i.message}),r.dirty());else if("emoji"===i.kind)Cp||(Cp=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Cp.test(e.data)||(fp(u=this._getOrReturnCtx(e,u),{validation:"emoji",code:ap.invalid_string,message:i.message}),r.dirty());else if("uuid"===i.kind)xp.test(e.data)||(fp(u=this._getOrReturnCtx(e,u),{validation:"uuid",code:ap.invalid_string,message:i.message}),r.dirty());else if("nanoid"===i.kind)Op.test(e.data)||(fp(u=this._getOrReturnCtx(e,u),{validation:"nanoid",code:ap.invalid_string,message:i.message}),r.dirty());else if("cuid"===i.kind)Ap.test(e.data)||(fp(u=this._getOrReturnCtx(e,u),{validation:"cuid",code:ap.invalid_string,message:i.message}),r.dirty());else if("cuid2"===i.kind)wp.test(e.data)||(fp(u=this._getOrReturnCtx(e,u),{validation:"cuid2",code:ap.invalid_string,message:i.message}),r.dirty());else if("ulid"===i.kind)Sp.test(e.data)||(fp(u=this._getOrReturnCtx(e,u),{validation:"ulid",code:ap.invalid_string,message:i.message}),r.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(t){fp(u=this._getOrReturnCtx(e,u),{validation:"url",code:ap.invalid_string,message:i.message}),r.dirty()}else"regex"===i.kind?(i.regex.lastIndex=0,i.regex.test(e.data)||(fp(u=this._getOrReturnCtx(e,u),{validation:"regex",code:ap.invalid_string,message:i.message}),r.dirty())):"trim"===i.kind?e.data=e.data.trim():"includes"===i.kind?e.data.includes(i.value,i.position)||(fp(u=this._getOrReturnCtx(e,u),{code:ap.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):"toLowerCase"===i.kind?e.data=e.data.toLowerCase():"toUpperCase"===i.kind?e.data=e.data.toUpperCase():"startsWith"===i.kind?e.data.startsWith(i.value)||(fp(u=this._getOrReturnCtx(e,u),{code:ap.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):"endsWith"===i.kind?e.data.endsWith(i.value)||(fp(u=this._getOrReturnCtx(e,u),{code:ap.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):"datetime"===i.kind?Up(i).test(e.data)||(fp(u=this._getOrReturnCtx(e,u),{code:ap.invalid_string,validation:"datetime",message:i.message}),r.dirty()):"date"===i.kind?Lp.test(e.data)||(fp(u=this._getOrReturnCtx(e,u),{code:ap.invalid_string,validation:"date",message:i.message}),r.dirty()):"time"===i.kind?qp(i).test(e.data)||(fp(u=this._getOrReturnCtx(e,u),{code:ap.invalid_string,validation:"time",message:i.message}),r.dirty()):"duration"===i.kind?Ip.test(e.data)||(fp(u=this._getOrReturnCtx(e,u),{validation:"duration",code:ap.invalid_string,message:i.message}),r.dirty()):"ip"===i.kind?Hp(e.data,i.version)||(fp(u=this._getOrReturnCtx(e,u),{validation:"ip",code:ap.invalid_string,message:i.message}),r.dirty()):"jwt"===i.kind?Vp(e.data,i.alg)||(fp(u=this._getOrReturnCtx(e,u),{validation:"jwt",code:ap.invalid_string,message:i.message}),r.dirty()):"cidr"===i.kind?Wp(e.data,i.version)||(fp(u=this._getOrReturnCtx(e,u),{validation:"cidr",code:ap.invalid_string,message:i.message}),r.dirty()):"base64"===i.kind?Rp.test(e.data)||(fp(u=this._getOrReturnCtx(e,u),{validation:"base64",code:ap.invalid_string,message:i.message}),r.dirty()):"base64url"===i.kind?Mp.test(e.data)||(fp(u=this._getOrReturnCtx(e,u),{validation:"base64url",code:ap.invalid_string,message:i.message}),r.dirty()):Qd.assertNever(i)}}catch(e){a.e(e)}finally{a.f()}return{status:r.value,value:e.data}}},{key:"_regex",value:function(e,t,n){return this.refinement(function(t){return e.test(t)},pn({validation:t,code:ap.invalid_string},dp.errToObj(n)))}},{key:"_addCheck",value:function(t){return new e(pn(pn({},this._def),{},{checks:[].concat(gn(this._def.checks),[t])}))}},{key:"email",value:function(e){return this._addCheck(pn({kind:"email"},dp.errToObj(e)))}},{key:"url",value:function(e){return this._addCheck(pn({kind:"url"},dp.errToObj(e)))}},{key:"emoji",value:function(e){return this._addCheck(pn({kind:"emoji"},dp.errToObj(e)))}},{key:"uuid",value:function(e){return this._addCheck(pn({kind:"uuid"},dp.errToObj(e)))}},{key:"nanoid",value:function(e){return this._addCheck(pn({kind:"nanoid"},dp.errToObj(e)))}},{key:"cuid",value:function(e){return this._addCheck(pn({kind:"cuid"},dp.errToObj(e)))}},{key:"cuid2",value:function(e){return this._addCheck(pn({kind:"cuid2"},dp.errToObj(e)))}},{key:"ulid",value:function(e){return this._addCheck(pn({kind:"ulid"},dp.errToObj(e)))}},{key:"base64",value:function(e){return this._addCheck(pn({kind:"base64"},dp.errToObj(e)))}},{key:"base64url",value:function(e){return this._addCheck(pn({kind:"base64url"},dp.errToObj(e)))}},{key:"jwt",value:function(e){return this._addCheck(pn({kind:"jwt"},dp.errToObj(e)))}},{key:"ip",value:function(e){return this._addCheck(pn({kind:"ip"},dp.errToObj(e)))}},{key:"cidr",value:function(e){return this._addCheck(pn({kind:"cidr"},dp.errToObj(e)))}},{key:"datetime",value:function(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck(pn({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null==e?void 0:e.local)&&void 0!==n&&n},dp.errToObj(null==e?void 0:e.message)))}},{key:"date",value:function(e){return this._addCheck({kind:"date",message:e})}},{key:"time",value:function(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck(pn({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision},dp.errToObj(null==e?void 0:e.message)))}},{key:"duration",value:function(e){return this._addCheck(pn({kind:"duration"},dp.errToObj(e)))}},{key:"regex",value:function(e,t){return this._addCheck(pn({kind:"regex",regex:e},dp.errToObj(t)))}},{key:"includes",value:function(e,t){return this._addCheck(pn({kind:"includes",value:e,position:null==t?void 0:t.position},dp.errToObj(null==t?void 0:t.message)))}},{key:"startsWith",value:function(e,t){return this._addCheck(pn({kind:"startsWith",value:e},dp.errToObj(t)))}},{key:"endsWith",value:function(e,t){return this._addCheck(pn({kind:"endsWith",value:e},dp.errToObj(t)))}},{key:"min",value:function(e,t){return this._addCheck(pn({kind:"min",value:e},dp.errToObj(t)))}},{key:"max",value:function(e,t){return this._addCheck(pn({kind:"max",value:e},dp.errToObj(t)))}},{key:"length",value:function(e,t){return this._addCheck(pn({kind:"length",value:e},dp.errToObj(t)))}},{key:"nonempty",value:function(e){return this.min(1,dp.errToObj(e))}},{key:"trim",value:function(){return new e(pn(pn({},this._def),{},{checks:[].concat(gn(this._def.checks),[{kind:"trim"}])}))}},{key:"toLowerCase",value:function(){return new e(pn(pn({},this._def),{},{checks:[].concat(gn(this._def.checks),[{kind:"toLowerCase"}])}))}},{key:"toUpperCase",value:function(){return new e(pn(pn({},this._def),{},{checks:[].concat(gn(this._def.checks),[{kind:"toUpperCase"}])}))}},{key:"isDatetime",get:function(){return!!this._def.checks.find(function(e){return"datetime"===e.kind})}},{key:"isDate",get:function(){return!!this._def.checks.find(function(e){return"date"===e.kind})}},{key:"isTime",get:function(){return!!this._def.checks.find(function(e){return"time"===e.kind})}},{key:"isDuration",get:function(){return!!this._def.checks.find(function(e){return"duration"===e.kind})}},{key:"isEmail",get:function(){return!!this._def.checks.find(function(e){return"email"===e.kind})}},{key:"isURL",get:function(){return!!this._def.checks.find(function(e){return"url"===e.kind})}},{key:"isEmoji",get:function(){return!!this._def.checks.find(function(e){return"emoji"===e.kind})}},{key:"isUUID",get:function(){return!!this._def.checks.find(function(e){return"uuid"===e.kind})}},{key:"isNANOID",get:function(){return!!this._def.checks.find(function(e){return"nanoid"===e.kind})}},{key:"isCUID",get:function(){return!!this._def.checks.find(function(e){return"cuid"===e.kind})}},{key:"isCUID2",get:function(){return!!this._def.checks.find(function(e){return"cuid2"===e.kind})}},{key:"isULID",get:function(){return!!this._def.checks.find(function(e){return"ulid"===e.kind})}},{key:"isIP",get:function(){return!!this._def.checks.find(function(e){return"ip"===e.kind})}},{key:"isCIDR",get:function(){return!!this._def.checks.find(function(e){return"cidr"===e.kind})}},{key:"isBase64",get:function(){return!!this._def.checks.find(function(e){return"base64"===e.kind})}},{key:"isBase64url",get:function(){return!!this._def.checks.find(function(e){return"base64url"===e.kind})}},{key:"minLength",get:function(){var e,t=null,n=an(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"min"===r.kind&&(null===t||r.value>t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"maxLength",get:function(){var e,t=null,n=an(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"max"===r.kind&&(null===t||r.value<t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}}])}();function Jp(e,t){var n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,u=n>r?n:r;return Number.parseInt(e.toFixed(u).replace(".",""))%Number.parseInt(t.toFixed(u).replace(".",""))/Math.pow(10,u)}Kp.create=function(e){var t;return new Kp(pn({checks:[],typeName:Ih.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t},bp(e)))};var Qp=function(){function e(){var t;return tn(this,e),(t=en(this,e,arguments)).min=t.gte,t.max=t.lte,t.step=t.multipleOf,t}return ln(e,kp),un(e,[{key:"_parse",value:function(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==rp.number){var t=this._getOrReturnCtx(e);return fp(t,{code:ap.invalid_type,expected:rp.number,received:t.parsedType}),hp}var n,r=void 0,u=new pp,a=an(this._def.checks);try{for(a.s();!(n=a.n()).done;){var i=n.value;"int"===i.kind?Qd.isInteger(e.data)||(fp(r=this._getOrReturnCtx(e,r),{code:ap.invalid_type,expected:"integer",received:"float",message:i.message}),u.dirty()):"min"===i.kind?(i.inclusive?e.data<i.value:e.data<=i.value)&&(fp(r=this._getOrReturnCtx(e,r),{code:ap.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),u.dirty()):"max"===i.kind?(i.inclusive?e.data>i.value:e.data>=i.value)&&(fp(r=this._getOrReturnCtx(e,r),{code:ap.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),u.dirty()):"multipleOf"===i.kind?0!==Jp(e.data,i.value)&&(fp(r=this._getOrReturnCtx(e,r),{code:ap.not_multiple_of,multipleOf:i.value,message:i.message}),u.dirty()):"finite"===i.kind?Number.isFinite(e.data)||(fp(r=this._getOrReturnCtx(e,r),{code:ap.not_finite,message:i.message}),u.dirty()):Qd.assertNever(i)}}catch(e){a.e(e)}finally{a.f()}return{status:u.value,value:e.data}}},{key:"gte",value:function(e,t){return this.setLimit("min",e,!0,dp.toString(t))}},{key:"gt",value:function(e,t){return this.setLimit("min",e,!1,dp.toString(t))}},{key:"lte",value:function(e,t){return this.setLimit("max",e,!0,dp.toString(t))}},{key:"lt",value:function(e,t){return this.setLimit("max",e,!1,dp.toString(t))}},{key:"setLimit",value:function(t,n,r,u){return new e(pn(pn({},this._def),{},{checks:[].concat(gn(this._def.checks),[{kind:t,value:n,inclusive:r,message:dp.toString(u)}])}))}},{key:"_addCheck",value:function(t){return new e(pn(pn({},this._def),{},{checks:[].concat(gn(this._def.checks),[t])}))}},{key:"int",value:function(e){return this._addCheck({kind:"int",message:dp.toString(e)})}},{key:"positive",value:function(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:dp.toString(e)})}},{key:"negative",value:function(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:dp.toString(e)})}},{key:"nonpositive",value:function(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:dp.toString(e)})}},{key:"nonnegative",value:function(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:dp.toString(e)})}},{key:"multipleOf",value:function(e,t){return this._addCheck({kind:"multipleOf",value:e,message:dp.toString(t)})}},{key:"finite",value:function(e){return this._addCheck({kind:"finite",message:dp.toString(e)})}},{key:"safe",value:function(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:dp.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:dp.toString(e)})}},{key:"minValue",get:function(){var e,t=null,n=an(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"min"===r.kind&&(null===t||r.value>t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"maxValue",get:function(){var e,t=null,n=an(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"max"===r.kind&&(null===t||r.value<t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"isInt",get:function(){return!!this._def.checks.find(function(e){return"int"===e.kind||"multipleOf"===e.kind&&Qd.isInteger(e.value)})}},{key:"isFinite",get:function(){var e,t=null,n=null,r=an(this._def.checks);try{for(r.s();!(e=r.n()).done;){var u=e.value;if("finite"===u.kind||"int"===u.kind||"multipleOf"===u.kind)return!0;"min"===u.kind?(null===n||u.value>n)&&(n=u.value):"max"===u.kind&&(null===t||u.value<t)&&(t=u.value)}}catch(e){r.e(e)}finally{r.f()}return Number.isFinite(n)&&Number.isFinite(t)}}])}();Qp.create=function(e){return new Qp(pn({checks:[],typeName:Ih.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1},bp(e)))};var Gp=function(){function e(){var t;return tn(this,e),(t=en(this,e,arguments)).min=t.gte,t.max=t.lte,t}return ln(e,kp),un(e,[{key:"_parse",value:function(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==rp.bigint)return this._getInvalidInput(e);var t,n=void 0,r=new pp,u=an(this._def.checks);try{for(u.s();!(t=u.n()).done;){var a=t.value;"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(fp(n=this._getOrReturnCtx(e,n),{code:ap.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(fp(n=this._getOrReturnCtx(e,n),{code:ap.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(fp(n=this._getOrReturnCtx(e,n),{code:ap.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):Qd.assertNever(a)}}catch(e){u.e(e)}finally{u.f()}return{status:r.value,value:e.data}}},{key:"_getInvalidInput",value:function(e){var t=this._getOrReturnCtx(e);return fp(t,{code:ap.invalid_type,expected:rp.bigint,received:t.parsedType}),hp}},{key:"gte",value:function(e,t){return this.setLimit("min",e,!0,dp.toString(t))}},{key:"gt",value:function(e,t){return this.setLimit("min",e,!1,dp.toString(t))}},{key:"lte",value:function(e,t){return this.setLimit("max",e,!0,dp.toString(t))}},{key:"lt",value:function(e,t){return this.setLimit("max",e,!1,dp.toString(t))}},{key:"setLimit",value:function(t,n,r,u){return new e(pn(pn({},this._def),{},{checks:[].concat(gn(this._def.checks),[{kind:t,value:n,inclusive:r,message:dp.toString(u)}])}))}},{key:"_addCheck",value:function(t){return new e(pn(pn({},this._def),{},{checks:[].concat(gn(this._def.checks),[t])}))}},{key:"positive",value:function(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:dp.toString(e)})}},{key:"negative",value:function(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:dp.toString(e)})}},{key:"nonpositive",value:function(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:dp.toString(e)})}},{key:"nonnegative",value:function(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:dp.toString(e)})}},{key:"multipleOf",value:function(e,t){return this._addCheck({kind:"multipleOf",value:e,message:dp.toString(t)})}},{key:"minValue",get:function(){var e,t=null,n=an(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"min"===r.kind&&(null===t||r.value>t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"maxValue",get:function(){var e,t=null,n=an(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"max"===r.kind&&(null===t||r.value<t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}}])}();Gp.create=function(e){var t;return new Gp(pn({checks:[],typeName:Ih.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t},bp(e)))};var Yp=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==rp.boolean){var t=this._getOrReturnCtx(e);return fp(t,{code:ap.invalid_type,expected:rp.boolean,received:t.parsedType}),hp}return mp(e.data)}}])}();Yp.create=function(e){return new Yp(pn({typeName:Ih.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1},bp(e)))};var Xp=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==rp.date){var t=this._getOrReturnCtx(e);return fp(t,{code:ap.invalid_type,expected:rp.date,received:t.parsedType}),hp}if(Number.isNaN(e.data.getTime()))return fp(this._getOrReturnCtx(e),{code:ap.invalid_date}),hp;var n,r=new pp,u=void 0,a=an(this._def.checks);try{for(a.s();!(n=a.n()).done;){var i=n.value;"min"===i.kind?e.data.getTime()<i.value&&(fp(u=this._getOrReturnCtx(e,u),{code:ap.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):"max"===i.kind?e.data.getTime()>i.value&&(fp(u=this._getOrReturnCtx(e,u),{code:ap.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Qd.assertNever(i)}}catch(e){a.e(e)}finally{a.f()}return{status:r.value,value:new Date(e.data.getTime())}}},{key:"_addCheck",value:function(t){return new e(pn(pn({},this._def),{},{checks:[].concat(gn(this._def.checks),[t])}))}},{key:"min",value:function(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:dp.toString(t)})}},{key:"max",value:function(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:dp.toString(t)})}},{key:"minDate",get:function(){var e,t=null,n=an(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"min"===r.kind&&(null===t||r.value>t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return null!=t?new Date(t):null}},{key:"maxDate",get:function(){var e,t=null,n=an(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;"max"===r.kind&&(null===t||r.value<t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return null!=t?new Date(t):null}}])}();Xp.create=function(e){return new Xp(pn({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ih.ZodDate},bp(e)))};var eh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){if(this._getType(e)!==rp.symbol){var t=this._getOrReturnCtx(e);return fp(t,{code:ap.invalid_type,expected:rp.symbol,received:t.parsedType}),hp}return mp(e.data)}}])}();eh.create=function(e){return new eh(pn({typeName:Ih.ZodSymbol},bp(e)))};var th=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){if(this._getType(e)!==rp.undefined){var t=this._getOrReturnCtx(e);return fp(t,{code:ap.invalid_type,expected:rp.undefined,received:t.parsedType}),hp}return mp(e.data)}}])}();th.create=function(e){return new th(pn({typeName:Ih.ZodUndefined},bp(e)))};var nh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){if(this._getType(e)!==rp.null){var t=this._getOrReturnCtx(e);return fp(t,{code:ap.invalid_type,expected:rp.null,received:t.parsedType}),hp}return mp(e.data)}}])}();nh.create=function(e){return new nh(pn({typeName:Ih.ZodNull},bp(e)))};var rh=function(){function e(){var t;return tn(this,e),(t=en(this,e,arguments))._any=!0,t}return ln(e,kp),un(e,[{key:"_parse",value:function(e){return mp(e.data)}}])}();rh.create=function(e){return new rh(pn({typeName:Ih.ZodAny},bp(e)))};var uh=function(){function e(){var t;return tn(this,e),(t=en(this,e,arguments))._unknown=!0,t}return ln(e,kp),un(e,[{key:"_parse",value:function(e){return mp(e.data)}}])}();uh.create=function(e){return new uh(pn({typeName:Ih.ZodUnknown},bp(e)))};var ah=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){var t=this._getOrReturnCtx(e);return fp(t,{code:ap.invalid_type,expected:rp.never,received:t.parsedType}),hp}}])}();ah.create=function(e){return new ah(pn({typeName:Ih.ZodNever},bp(e)))};var ih=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){if(this._getType(e)!==rp.undefined){var t=this._getOrReturnCtx(e);return fp(t,{code:ap.invalid_type,expected:rp.void,received:t.parsedType}),hp}return mp(e.data)}}])}();ih.create=function(e){return new ih(pn({typeName:Ih.ZodVoid},bp(e)))};var oh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){var t=this._processInputParams(e),n=t.ctx,r=t.status,u=this._def;if(n.parsedType!==rp.array)return fp(n,{code:ap.invalid_type,expected:rp.array,received:n.parsedType}),hp;if(null!==u.exactLength){var a=n.data.length>u.exactLength.value,i=n.data.length<u.exactLength.value;(a||i)&&(fp(n,{code:a?ap.too_big:ap.too_small,minimum:i?u.exactLength.value:void 0,maximum:a?u.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:u.exactLength.message}),r.dirty())}if(null!==u.minLength&&n.data.length<u.minLength.value&&(fp(n,{code:ap.too_small,minimum:u.minLength.value,type:"array",inclusive:!0,exact:!1,message:u.minLength.message}),r.dirty()),null!==u.maxLength&&n.data.length>u.maxLength.value&&(fp(n,{code:ap.too_big,maximum:u.maxLength.value,type:"array",inclusive:!0,exact:!1,message:u.maxLength.message}),r.dirty()),n.common.async)return Promise.all(gn(n.data).map(function(e,t){return u.type._parseAsync(new Ep(n,e,n.path,t))})).then(function(e){return pp.mergeArray(r,e)});var o=gn(n.data).map(function(e,t){return u.type._parseSync(new Ep(n,e,n.path,t))});return pp.mergeArray(r,o)}},{key:"element",get:function(){return this._def.type}},{key:"min",value:function(t,n){return new e(pn(pn({},this._def),{},{minLength:{value:t,message:dp.toString(n)}}))}},{key:"max",value:function(t,n){return new e(pn(pn({},this._def),{},{maxLength:{value:t,message:dp.toString(n)}}))}},{key:"length",value:function(t,n){return new e(pn(pn({},this._def),{},{exactLength:{value:t,message:dp.toString(n)}}))}},{key:"nonempty",value:function(e){return this.min(1,e)}}])}();function sh(e){if(e instanceof ch){var t={};for(var n in e.shape){var r=e.shape[n];t[n]=wh.create(sh(r))}return new ch(pn(pn({},e._def),{},{shape:function(){return t}}))}return e instanceof oh?new oh(pn(pn({},e._def),{},{type:sh(e.element)})):e instanceof wh?wh.create(sh(e.unwrap())):e instanceof Sh?Sh.create(sh(e.unwrap())):e instanceof vh?vh.create(e.items.map(function(e){return sh(e)})):e}oh.create=function(e,t){return new oh(pn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ih.ZodArray},bp(t)))};var ch=function(){function e(){var t;return tn(this,e),(t=en(this,e,arguments))._cached=null,t.nonstrict=t.passthrough,t.augment=t.extend,t}return ln(e,kp),un(e,[{key:"_getCached",value:function(){if(null!==this._cached)return this._cached;var e=this._def.shape(),t=Qd.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}},{key:"_parse",value:function(e){if(this._getType(e)!==rp.object){var t=this._getOrReturnCtx(e);return fp(t,{code:ap.invalid_type,expected:rp.object,received:t.parsedType}),hp}var n=this._processInputParams(e),r=n.status,u=n.ctx,a=this._getCached(),i=a.shape,o=a.keys,s=[];if(!(this._def.catchall instanceof ah&&"strip"===this._def.unknownKeys))for(var c in u.data)o.includes(c)||s.push(c);var l,f=[],d=an(o);try{for(d.s();!(l=d.n()).done;){var p=l.value,h=i[p],v=u.data[p];f.push({key:{status:"valid",value:p},value:h._parse(new Ep(u,v,u.path,p)),alwaysSet:p in u.data})}}catch(e){d.e(e)}finally{d.f()}if(this._def.catchall instanceof ah){var m=this._def.unknownKeys;if("passthrough"===m){var D,y=an(s);try{for(y.s();!(D=y.n()).done;){var g=D.value;f.push({key:{status:"valid",value:g},value:{status:"valid",value:u.data[g]}})}}catch(e){y.e(e)}finally{y.f()}}else if("strict"===m)s.length>0&&(fp(u,{code:ap.unrecognized_keys,keys:s}),r.dirty());else if("strip"!==m)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{var F,E=this._def.catchall,_=an(s);try{for(_.s();!(F=_.n()).done;){var b=F.value,C=u.data[b];f.push({key:{status:"valid",value:b},value:E._parse(new Ep(u,C,u.path,b)),alwaysSet:b in u.data})}}catch(e){_.e(e)}finally{_.f()}}return u.common.async?Promise.resolve().then(Xt(vn().m(function e(){var t,n,r,u,a,i,o;return vn().w(function(e){for(;;)switch(e.p=e.n){case 0:t=[],n=an(f),e.p=1,n.s();case 2:if((r=n.n()).done){e.n=6;break}return u=r.value,e.n=3,u.key;case 3:return a=e.v,e.n=4,u.value;case 4:i=e.v,t.push({key:a,value:i,alwaysSet:u.alwaysSet});case 5:e.n=2;break;case 6:e.n=8;break;case 7:e.p=7,o=e.v,n.e(o);case 8:return e.p=8,n.f(),e.f(8);case 9:return e.a(2,t)}},e,null,[[1,7,8,9]])}))).then(function(e){return pp.mergeObjectSync(r,e)}):pp.mergeObjectSync(r,f)}},{key:"shape",get:function(){return this._def.shape()}},{key:"strict",value:function(t){var n=this;return dp.errToObj,new e(pn(pn({},this._def),{},{unknownKeys:"strict"},void 0!==t?{errorMap:function(e,r){var u,a,i,o,s=null!==(u=null===(a=(i=n._def).errorMap)||void 0===a?void 0:a.call(i,e,r).message)&&void 0!==u?u:r.defaultError;return"unrecognized_keys"===e.code?{message:null!==(o=dp.errToObj(t).message)&&void 0!==o?o:s}:{message:s}}}:{}))}},{key:"strip",value:function(){return new e(pn(pn({},this._def),{},{unknownKeys:"strip"}))}},{key:"passthrough",value:function(){return new e(pn(pn({},this._def),{},{unknownKeys:"passthrough"}))}},{key:"extend",value:function(t){var n=this;return new e(pn(pn({},this._def),{},{shape:function(){return pn(pn({},n._def.shape()),t)}}))}},{key:"merge",value:function(t){var n=this;return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:function(){return pn(pn({},n._def.shape()),t._def.shape())},typeName:Ih.ZodObject})}},{key:"setKey",value:function(e,t){return this.augment(on({},e,t))}},{key:"catchall",value:function(t){return new e(pn(pn({},this._def),{},{catchall:t}))}},{key:"pick",value:function(t){var n,r={},u=an(Qd.objectKeys(t));try{for(u.s();!(n=u.n()).done;){var a=n.value;t[a]&&this.shape[a]&&(r[a]=this.shape[a])}}catch(e){u.e(e)}finally{u.f()}return new e(pn(pn({},this._def),{},{shape:function(){return r}}))}},{key:"omit",value:function(t){var n,r={},u=an(Qd.objectKeys(this.shape));try{for(u.s();!(n=u.n()).done;){var a=n.value;t[a]||(r[a]=this.shape[a])}}catch(e){u.e(e)}finally{u.f()}return new e(pn(pn({},this._def),{},{shape:function(){return r}}))}},{key:"deepPartial",value:function(){return sh(this)}},{key:"partial",value:function(t){var n,r={},u=an(Qd.objectKeys(this.shape));try{for(u.s();!(n=u.n()).done;){var a=n.value,i=this.shape[a];t&&!t[a]?r[a]=i:r[a]=i.optional()}}catch(e){u.e(e)}finally{u.f()}return new e(pn(pn({},this._def),{},{shape:function(){return r}}))}},{key:"required",value:function(t){var n,r={},u=an(Qd.objectKeys(this.shape));try{for(u.s();!(n=u.n()).done;){var a=n.value;if(t&&!t[a])r[a]=this.shape[a];else{for(var i=this.shape[a];i instanceof wh;)i=i._def.innerType;r[a]=i}}}catch(e){u.e(e)}finally{u.f()}return new e(pn(pn({},this._def),{},{shape:function(){return r}}))}},{key:"keyof",value:function(){return _h(Qd.objectKeys(this.shape))}}])}();ch.create=function(e,t){return new ch(pn({shape:function(){return e},unknownKeys:"strip",catchall:ah.create(),typeName:Ih.ZodObject},bp(t)))},ch.strictCreate=function(e,t){return new ch(pn({shape:function(){return e},unknownKeys:"strict",catchall:ah.create(),typeName:Ih.ZodObject},bp(t)))},ch.lazycreate=function(e,t){return new ch(pn({shape:e,unknownKeys:"strip",catchall:ah.create(),typeName:Ih.ZodObject},bp(t)))};var lh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){var t=this._processInputParams(e).ctx,n=this._def.options;if(t.common.async)return Promise.all(n.map(function(){var e=Xt(vn().m(function e(n){var r,u,a;return vn().w(function(e){for(;;)switch(e.n){case 0:return r=pn(pn({},t),{},{common:pn(pn({},t.common),{},{issues:[]}),parent:null}),e.n=1,n._parseAsync({data:t.data,path:t.path,parent:r});case 1:return u=e.v,a=r,e.a(2,{result:u,ctx:a})}},e)}));return function(t){return e.apply(this,arguments)}}())).then(function(e){var n,r=an(e);try{for(r.s();!(n=r.n()).done;){var u=n.value;if("valid"===u.result.status)return u.result}}catch(e){r.e(e)}finally{r.f()}var a,i=an(e);try{for(i.s();!(a=i.n()).done;){var o,s=a.value;if("dirty"===s.result.status)return(o=t.common.issues).push.apply(o,gn(s.ctx.common.issues)),s.result}}catch(e){i.e(e)}finally{i.f()}var c=e.map(function(e){return new ip(e.ctx.common.issues)});return fp(t,{code:ap.invalid_union,unionErrors:c}),hp});var r,u,a=void 0,i=[],o=an(n);try{for(o.s();!(r=o.n()).done;){var s=r.value,c=pn(pn({},t),{},{common:pn(pn({},t.common),{},{issues:[]}),parent:null}),l=s._parseSync({data:t.data,path:t.path,parent:c});if("valid"===l.status)return l;"dirty"!==l.status||a||(a={result:l,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}}catch(e){o.e(e)}finally{o.f()}if(a)return(u=t.common.issues).push.apply(u,gn(a.ctx.common.issues)),a.result;var f=i.map(function(e){return new ip(e)});return fp(t,{code:ap.invalid_union,unionErrors:f}),hp}},{key:"options",get:function(){return this._def.options}}])}();lh.create=function(e,t){return new lh(pn({options:e,typeName:Ih.ZodUnion},bp(t)))};var fh=function(e){return e instanceof Fh?fh(e.schema):e instanceof Ah?fh(e.innerType()):e instanceof Eh?[e.value]:e instanceof bh?e.options:e instanceof Ch?Qd.objectValues(e.enum):e instanceof xh?fh(e._def.innerType):e instanceof th?[void 0]:e instanceof nh?[null]:e instanceof wh?[void 0].concat(gn(fh(e.unwrap()))):e instanceof Sh?[null].concat(gn(fh(e.unwrap()))):e instanceof Th||e instanceof jh?fh(e.unwrap()):e instanceof Oh?fh(e._def.innerType):[]},dh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){var t=this._processInputParams(e).ctx;if(t.parsedType!==rp.object)return fp(t,{code:ap.invalid_type,expected:rp.object,received:t.parsedType}),hp;var n=this.discriminator,r=t.data[n],u=this.optionsMap.get(r);return u?t.common.async?u._parseAsync({data:t.data,path:t.path,parent:t}):u._parseSync({data:t.data,path:t.path,parent:t}):(fp(t,{code:ap.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),hp)}},{key:"discriminator",get:function(){return this._def.discriminator}},{key:"options",get:function(){return this._def.options}},{key:"optionsMap",get:function(){return this._def.optionsMap}}],[{key:"create",value:function(t,n,r){var u,a=new Map,i=an(n);try{for(i.s();!(u=i.n()).done;){var o=u.value,s=fh(o.shape[t]);if(!s.length)throw new Error("A discriminator value for key `".concat(t,"` could not be extracted from all schema options"));var c,l=an(s);try{for(l.s();!(c=l.n()).done;){var f=c.value;if(a.has(f))throw new Error("Discriminator property ".concat(String(t)," has duplicate value ").concat(String(f)));a.set(f,o)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){i.e(e)}finally{i.f()}return new e(pn({typeName:Ih.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:a},bp(r)))}}])}();function ph(e,t){var n=up(e),r=up(t);if(e===t)return{valid:!0,data:e};if(n===rp.object&&r===rp.object){var u,a=Qd.objectKeys(t),i=Qd.objectKeys(e).filter(function(e){return-1!==a.indexOf(e)}),o=pn(pn({},e),t),s=an(i);try{for(s.s();!(u=s.n()).done;){var c=u.value,l=ph(e[c],t[c]);if(!l.valid)return{valid:!1};o[c]=l.data}}catch(e){s.e(e)}finally{s.f()}return{valid:!0,data:o}}if(n===rp.array&&r===rp.array){if(e.length!==t.length)return{valid:!1};for(var f=[],d=0;d<e.length;d++){var p=ph(e[d],t[d]);if(!p.valid)return{valid:!1};f.push(p.data)}return{valid:!0,data:f}}return n===rp.date&&r===rp.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}var hh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){var t=this._processInputParams(e),n=t.status,r=t.ctx,u=function(e,t){if(Dp(e)||Dp(t))return hp;var u=ph(e.value,t.value);return u.valid?((yp(e)||yp(t))&&n.dirty(),{status:n.value,value:u.data}):(fp(r,{code:ap.invalid_intersection_types}),hp)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(function(e){var t=yn(e,2),n=t[0],r=t[1];return u(n,r)}):u(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}])}();hh.create=function(e,t,n){return new hh(pn({left:e,right:t,typeName:Ih.ZodIntersection},bp(n)))};var vh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){var t=this,n=this._processInputParams(e),r=n.status,u=n.ctx;if(u.parsedType!==rp.array)return fp(u,{code:ap.invalid_type,expected:rp.array,received:u.parsedType}),hp;if(u.data.length<this._def.items.length)return fp(u,{code:ap.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),hp;!this._def.rest&&u.data.length>this._def.items.length&&(fp(u,{code:ap.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());var a=gn(u.data).map(function(e,n){var r=t._def.items[n]||t._def.rest;return r?r._parse(new Ep(u,e,u.path,n)):null}).filter(function(e){return!!e});return u.common.async?Promise.all(a).then(function(e){return pp.mergeArray(r,e)}):pp.mergeArray(r,a)}},{key:"items",get:function(){return this._def.items}},{key:"rest",value:function(t){return new e(pn(pn({},this._def),{},{rest:t}))}}])}();vh.create=function(e,t){if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vh(pn({items:e,typeName:Ih.ZodTuple,rest:null},bp(t)))};var mh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"keySchema",get:function(){return this._def.keyType}},{key:"valueSchema",get:function(){return this._def.valueType}},{key:"_parse",value:function(e){var t=this._processInputParams(e),n=t.status,r=t.ctx;if(r.parsedType!==rp.object)return fp(r,{code:ap.invalid_type,expected:rp.object,received:r.parsedType}),hp;var u=[],a=this._def.keyType,i=this._def.valueType;for(var o in r.data)u.push({key:a._parse(new Ep(r,o,r.path,o)),value:i._parse(new Ep(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?pp.mergeObjectAsync(n,u):pp.mergeObjectSync(n,u)}},{key:"element",get:function(){return this._def.valueType}}],[{key:"create",value:function(t,n,r){return new e(n instanceof kp?pn({keyType:t,valueType:n,typeName:Ih.ZodRecord},bp(r)):pn({keyType:Kp.create(),valueType:t,typeName:Ih.ZodRecord},bp(n)))}}])}(),Dh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"keySchema",get:function(){return this._def.keyType}},{key:"valueSchema",get:function(){return this._def.valueType}},{key:"_parse",value:function(e){var t=this._processInputParams(e),n=t.status,r=t.ctx;if(r.parsedType!==rp.map)return fp(r,{code:ap.invalid_type,expected:rp.map,received:r.parsedType}),hp;var u=this._def.keyType,a=this._def.valueType,i=gn(r.data.entries()).map(function(e,t){var n=yn(e,2),i=n[0],o=n[1];return{key:u._parse(new Ep(r,i,r.path,[t,"key"])),value:a._parse(new Ep(r,o,r.path,[t,"value"]))}});if(r.common.async){var o=new Map;return Promise.resolve().then(Xt(vn().m(function e(){var t,r,u,a,s,c;return vn().w(function(e){for(;;)switch(e.p=e.n){case 0:t=an(i),e.p=1,t.s();case 2:if((r=t.n()).done){e.n=7;break}return u=r.value,e.n=3,u.key;case 3:return a=e.v,e.n=4,u.value;case 4:if(s=e.v,"aborted"!==a.status&&"aborted"!==s.status){e.n=5;break}return e.a(2,hp);case 5:"dirty"!==a.status&&"dirty"!==s.status||n.dirty(),o.set(a.value,s.value);case 6:e.n=2;break;case 7:e.n=9;break;case 8:e.p=8,c=e.v,t.e(c);case 9:return e.p=9,t.f(),e.f(9);case 10:return e.a(2,{status:n.value,value:o})}},e,null,[[1,8,9,10]])})))}var s,c=new Map,l=an(i);try{for(l.s();!(s=l.n()).done;){var f=s.value,d=f.key,p=f.value;if("aborted"===d.status||"aborted"===p.status)return hp;"dirty"!==d.status&&"dirty"!==p.status||n.dirty(),c.set(d.value,p.value)}}catch(e){l.e(e)}finally{l.f()}return{status:n.value,value:c}}}])}();Dh.create=function(e,t,n){return new Dh(pn({valueType:t,keyType:e,typeName:Ih.ZodMap},bp(n)))};var yh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){var t=this._processInputParams(e),n=t.status,r=t.ctx;if(r.parsedType!==rp.set)return fp(r,{code:ap.invalid_type,expected:rp.set,received:r.parsedType}),hp;var u=this._def;null!==u.minSize&&r.data.size<u.minSize.value&&(fp(r,{code:ap.too_small,minimum:u.minSize.value,type:"set",inclusive:!0,exact:!1,message:u.minSize.message}),n.dirty()),null!==u.maxSize&&r.data.size>u.maxSize.value&&(fp(r,{code:ap.too_big,maximum:u.maxSize.value,type:"set",inclusive:!0,exact:!1,message:u.maxSize.message}),n.dirty());var a=this._def.valueType;function i(e){var t,r=new Set,u=an(e);try{for(u.s();!(t=u.n()).done;){var a=t.value;if("aborted"===a.status)return hp;"dirty"===a.status&&n.dirty(),r.add(a.value)}}catch(e){u.e(e)}finally{u.f()}return{status:n.value,value:r}}var o=gn(r.data.values()).map(function(e,t){return a._parse(new Ep(r,e,r.path,t))});return r.common.async?Promise.all(o).then(function(e){return i(e)}):i(o)}},{key:"min",value:function(t,n){return new e(pn(pn({},this._def),{},{minSize:{value:t,message:dp.toString(n)}}))}},{key:"max",value:function(t,n){return new e(pn(pn({},this._def),{},{maxSize:{value:t,message:dp.toString(n)}}))}},{key:"size",value:function(e,t){return this.min(e,t).max(e,t)}},{key:"nonempty",value:function(e){return this.min(1,e)}}])}();yh.create=function(e,t){return new yh(pn({valueType:e,minSize:null,maxSize:null,typeName:Ih.ZodSet},bp(t)))};var gh=function(){function e(){var t;return tn(this,e),(t=en(this,e,arguments)).validate=t.implement,t}return ln(e,kp),un(e,[{key:"_parse",value:function(e){var t=this._processInputParams(e).ctx;if(t.parsedType!==rp.function)return fp(t,{code:ap.invalid_type,expected:rp.function,received:t.parsedType}),hp;function n(e,n){return lp({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,cp(),op].filter(function(e){return!!e}),issueData:{code:ap.invalid_arguments,argumentsError:n}})}function r(e,n){return lp({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,cp(),op].filter(function(e){return!!e}),issueData:{code:ap.invalid_return_type,returnTypeError:n}})}var u={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof kh){var i=this;return mp(Xt(vn().m(function e(){var t,o,s,c,l,f,d,p=arguments;return vn().w(function(e){for(;;)switch(e.n){case 0:for(t=p.length,o=new Array(t),s=0;s<t;s++)o[s]=p[s];return c=new ip([]),e.n=1,i._def.args.parseAsync(o,u).catch(function(e){throw c.addIssue(n(o,e)),c});case 1:return l=e.v,e.n=2,Reflect.apply(a,this,l);case 2:return f=e.v,e.n=3,i._def.returns._def.type.parseAsync(f,u).catch(function(e){throw c.addIssue(r(f,e)),c});case 3:return d=e.v,e.a(2,d)}},e,this)})))}var o=this;return mp(function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var s=o._def.args.safeParse(t,u);if(!s.success)throw new ip([n(t,s.error)]);var c=Reflect.apply(a,this,s.data),l=o._def.returns.safeParse(c,u);if(!l.success)throw new ip([r(c,l.error)]);return l.data})}},{key:"parameters",value:function(){return this._def.args}},{key:"returnType",value:function(){return this._def.returns}},{key:"args",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return new e(pn(pn({},this._def),{},{args:vh.create(n).rest(uh.create())}))}},{key:"returns",value:function(t){return new e(pn(pn({},this._def),{},{returns:t}))}},{key:"implement",value:function(e){return this.parse(e)}},{key:"strictImplement",value:function(e){return this.parse(e)}}],[{key:"create",value:function(t,n,r){return new e(pn({args:t||vh.create([]).rest(uh.create()),returns:n||uh.create(),typeName:Ih.ZodFunction},bp(r)))}}])}(),Fh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"schema",get:function(){return this._def.getter()}},{key:"_parse",value:function(e){var t=this._processInputParams(e).ctx;return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}])}();Fh.create=function(e,t){return new Fh(pn({getter:e,typeName:Ih.ZodLazy},bp(t)))};var Eh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){if(e.data!==this._def.value){var t=this._getOrReturnCtx(e);return fp(t,{received:t.data,code:ap.invalid_literal,expected:this._def.value}),hp}return{status:"valid",value:e.data}}},{key:"value",get:function(){return this._def.value}}])}();function _h(e,t){return new bh(pn({values:e,typeName:Ih.ZodEnum},bp(t)))}Eh.create=function(e,t){return new Eh(pn({value:e,typeName:Ih.ZodLiteral},bp(t)))};var bh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){if("string"!=typeof e.data){var t=this._getOrReturnCtx(e),n=this._def.values;return fp(t,{expected:Qd.joinValues(n),received:t.parsedType,code:ap.invalid_type}),hp}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){var r=this._getOrReturnCtx(e),u=this._def.values;return fp(r,{received:r.data,code:ap.invalid_enum_value,options:u}),hp}return mp(e.data)}},{key:"options",get:function(){return this._def.values}},{key:"enum",get:function(){var e,t={},n=an(this._def.values);try{for(n.s();!(e=n.n()).done;){var r=e.value;t[r]=r}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"Values",get:function(){var e,t={},n=an(this._def.values);try{for(n.s();!(e=n.n()).done;){var r=e.value;t[r]=r}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"Enum",get:function(){var e,t={},n=an(this._def.values);try{for(n.s();!(e=n.n()).done;){var r=e.value;t[r]=r}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"extract",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._def;return e.create(t,pn(pn({},this._def),n))}},{key:"exclude",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._def;return e.create(this.options.filter(function(e){return!t.includes(e)}),pn(pn({},this._def),n))}}])}();bh.create=_h;var Ch=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){var t=Qd.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==rp.string&&n.parsedType!==rp.number){var r=Qd.objectValues(t);return fp(n,{expected:Qd.joinValues(r),received:n.parsedType,code:ap.invalid_type}),hp}if(this._cache||(this._cache=new Set(Qd.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){var u=Qd.objectValues(t);return fp(n,{received:n.data,code:ap.invalid_enum_value,options:u}),hp}return mp(e.data)}},{key:"enum",get:function(){return this._def.values}}])}();Ch.create=function(e,t){return new Ch(pn({values:e,typeName:Ih.ZodNativeEnum},bp(t)))};var kh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"unwrap",value:function(){return this._def.type}},{key:"_parse",value:function(e){var t=this,n=this._processInputParams(e).ctx;if(n.parsedType!==rp.promise&&!1===n.common.async)return fp(n,{code:ap.invalid_type,expected:rp.promise,received:n.parsedType}),hp;var r=n.parsedType===rp.promise?n.data:Promise.resolve(n.data);return mp(r.then(function(e){return t._def.type.parseAsync(e,{path:n.path,errorMap:n.common.contextualErrorMap})}))}}])}();kh.create=function(e,t){return new kh(pn({type:e,typeName:Ih.ZodPromise},bp(t)))};var Ah=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"innerType",value:function(){return this._def.schema}},{key:"sourceType",value:function(){return this._def.schema._def.typeName===Ih.ZodEffects?this._def.schema.sourceType():this._def.schema}},{key:"_parse",value:function(e){var t=this,n=this._processInputParams(e),r=n.status,u=n.ctx,a=this._def.effect||null,i={addIssue:function(e){fp(u,e),e.fatal?r.abort():r.dirty()},get path(){return u.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===a.type){var o=a.transform(u.data,i);if(u.common.async)return Promise.resolve(o).then(function(){var e=Xt(vn().m(function e(n){var a;return vn().w(function(e){for(;;)switch(e.n){case 0:if("aborted"!==r.value){e.n=1;break}return e.a(2,hp);case 1:return e.n=2,t._def.schema._parseAsync({data:n,path:u.path,parent:u});case 2:if("aborted"!==(a=e.v).status){e.n=3;break}return e.a(2,hp);case 3:if("dirty"!==a.status){e.n=4;break}return e.a(2,vp(a.value));case 4:if("dirty"!==r.value){e.n=5;break}return e.a(2,vp(a.value));case 5:return e.a(2,a)}},e)}));return function(t){return e.apply(this,arguments)}}());if("aborted"===r.value)return hp;var s=this._def.schema._parseSync({data:o,path:u.path,parent:u});return"aborted"===s.status?hp:"dirty"===s.status||"dirty"===r.value?vp(s.value):s}if("refinement"===a.type){var c=function(e){var t=a.refinement(e,i);if(u.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===u.common.async){var l=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});return"aborted"===l.status?hp:("dirty"===l.status&&r.dirty(),c(l.value),{status:r.value,value:l.value})}return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(function(e){return"aborted"===e.status?hp:("dirty"===e.status&&r.dirty(),c(e.value).then(function(){return{status:r.value,value:e.value}}))})}if("transform"===a.type){if(!1===u.common.async){var f=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});if(!gp(f))return hp;var d=a.transform(f.value,i);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:d}}return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(function(e){return gp(e)?Promise.resolve(a.transform(e.value,i)).then(function(e){return{status:r.value,value:e}}):hp})}Qd.assertNever(a)}}])}();Ah.create=function(e,t,n){return new Ah(pn({schema:e,typeName:Ih.ZodEffects,effect:t},bp(n)))},Ah.createWithPreprocess=function(e,t,n){return new Ah(pn({schema:t,effect:{type:"preprocess",transform:e},typeName:Ih.ZodEffects},bp(n)))};var wh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){return this._getType(e)===rp.undefined?mp(void 0):this._def.innerType._parse(e)}},{key:"unwrap",value:function(){return this._def.innerType}}])}();wh.create=function(e,t){return new wh(pn({innerType:e,typeName:Ih.ZodOptional},bp(t)))};var Sh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){return this._getType(e)===rp.null?mp(null):this._def.innerType._parse(e)}},{key:"unwrap",value:function(){return this._def.innerType}}])}();Sh.create=function(e,t){return new Sh(pn({innerType:e,typeName:Ih.ZodNullable},bp(t)))};var xh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){var t=this._processInputParams(e).ctx,n=t.data;return t.parsedType===rp.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}},{key:"removeDefault",value:function(){return this._def.innerType}}])}();xh.create=function(e,t){return new xh(pn({innerType:e,typeName:Ih.ZodDefault,defaultValue:"function"==typeof t.default?t.default:function(){return t.default}},bp(t)))};var Oh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){var t=this,n=this._processInputParams(e).ctx,r=pn(pn({},n),{},{common:pn(pn({},n.common),{},{issues:[]})}),u=this._def.innerType._parse({data:r.data,path:r.path,parent:pn({},r)});return Fp(u)?u.then(function(e){return{status:"valid",value:"valid"===e.status?e.value:t._def.catchValue({get error(){return new ip(r.common.issues)},input:r.data})}}):{status:"valid",value:"valid"===u.status?u.value:this._def.catchValue({get error(){return new ip(r.common.issues)},input:r.data})}}},{key:"removeCatch",value:function(){return this._def.innerType}}])}();Oh.create=function(e,t){return new Oh(pn({innerType:e,typeName:Ih.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:function(){return t.catch}},bp(t)))};var Bh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){if(this._getType(e)!==rp.nan){var t=this._getOrReturnCtx(e);return fp(t,{code:ap.invalid_type,expected:rp.nan,received:t.parsedType}),hp}return{status:"valid",value:e.data}}}])}();Bh.create=function(e){return new Bh(pn({typeName:Ih.ZodNaN},bp(e)))};var Ih,Th=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){var t=this._processInputParams(e).ctx,n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}},{key:"unwrap",value:function(){return this._def.type}}])}(),Ph=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){var t=this,n=this._processInputParams(e),r=n.status,u=n.ctx;if(u.common.async){var a=function(){var e=Xt(vn().m(function e(){var n;return vn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,t._def.in._parseAsync({data:u.data,path:u.path,parent:u});case 1:if("aborted"!==(n=e.v).status){e.n=2;break}return e.a(2,hp);case 2:if("dirty"!==n.status){e.n=3;break}return r.dirty(),e.a(2,vp(n.value));case 3:return e.a(2,t._def.out._parseAsync({data:n.value,path:u.path,parent:u}));case 4:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();return a()}var i=this._def.in._parseSync({data:u.data,path:u.path,parent:u});return"aborted"===i.status?hp:"dirty"===i.status?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:u.path,parent:u})}}],[{key:"create",value:function(t,n){return new e({in:t,out:n,typeName:Ih.ZodPipeline})}}])}(),jh=function(){function e(){return tn(this,e),en(this,e,arguments)}return ln(e,kp),un(e,[{key:"_parse",value:function(e){var t=this._def.innerType._parse(e),n=function(e){return gp(e)&&(e.value=Object.freeze(e.value)),e};return Fp(t)?t.then(function(e){return n(e)}):n(t)}},{key:"unwrap",value:function(){return this._def.innerType}}])}();jh.create=function(e,t){return new jh(pn({innerType:e,typeName:Ih.ZodReadonly},bp(t)))},ch.lazycreate,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"}(Ih||(Ih={})),Kp.create,Qp.create,Bh.create,Gp.create,Yp.create,Xp.create,eh.create,th.create,nh.create,rh.create,uh.create,ah.create,ih.create,oh.create,ch.create,ch.strictCreate,lh.create,dh.create,hh.create,vh.create,mh.create,Dh.create,yh.create,gh.create,Fh.create,Eh.create,bh.create,Ch.create,kh.create,Ah.create,wh.create,Sh.create,Ah.createWithPreprocess,Ph.create;var Nh=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.prefix,n=e.size,r=void 0===n?16:n,u=e.alphabet,a=void 0===u?"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz":u,i=e.separator,o=void 0===i?"-":i,s=function(){for(var e=a.length,t=new Array(r),n=0;n<r;n++)t[n]=a[Math.random()*e|0];return t.join("")};if(null==t)return s;if(a.includes(o))throw new $o({argument:"separator",message:'The separator "'.concat(o,'" must not be part of the alphabet "').concat(a,'".')});return function(){return"".concat(t).concat(o).concat(s())}},zh=Nh();function Rh(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:globalThis;return r.window?"runtime/browser":(null==(e=r.navigator)?void 0:e.userAgent)?"runtime/".concat(r.navigator.userAgent.toLowerCase()):(null==(n=null==(t=r.process)?void 0:t.versions)?void 0:n.node)?"runtime/node.js/".concat(r.process.version.substring(0)):r.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Mh(e){if(null==e)return{};var t={};if(e instanceof Headers)e.forEach(function(e,n){t[n.toLowerCase()]=e});else{Array.isArray(e)||(e=Object.entries(e));var n,r=s(e);try{for(r.s();!(n=r.n()).done;){var u=g(n.value,2),a=u[0],i=u[1];null!=i&&(t[a.toLowerCase()]=i)}}catch(e){r.e(e)}finally{r.f()}}return t}function Zh(e){for(var t=new Headers(Mh(e)),n=t.get("user-agent")||"",r=arguments.length,u=new Array(r>1?r-1:0),a=1;a<r;a++)u[a-1]=arguments[a];return t.set("user-agent",[n].concat(u).filter(Boolean).join(" ")),Object.fromEntries(t.entries())}var Lh=/"__proto__"\s*:/,$h=/"constructor"\s*:/;function qh(e){var t=JSON.parse(e);return null===t||"object"!=_(t)||!1===Lh.test(e)&&!1===$h.test(e)?t:function(e){for(var t=[e];t.length;){var n=t;t=[];var r,u=s(n);try{for(u.s();!(r=u.n()).done;){var a=r.value;if(Object.prototype.hasOwnProperty.call(a,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(a,"constructor")&&Object.prototype.hasOwnProperty.call(a.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(var i in a){var o=a[i];o&&"object"==_(o)&&t.push(o)}}}catch(e){u.e(e)}finally{u.f()}}return e}(t)}var Uh=Symbol.for("vercel.ai.validator");function Hh(e){return function(e){return"object"==_(e)&&null!==e&&Uh in e&&!0===e[Uh]&&"validate"in e}(e)?e:"function"==typeof e?e():(t=e,n=function(){var e=r(m().m(function e(n){var r;return m().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,t["~standard"].validate(n);case 1:return r=e.v,e.a(2,null==r.issues?{success:!0,value:r.value}:{success:!1,error:new Yo({value:n,cause:r.issues})})}},e)}));return function(t){return e.apply(this,arguments)}}(),c(c({},Uh,!0),"validate",n));var t,n}function Vh(e){return Wh.apply(this,arguments)}function Wh(){return Wh=r(m().m(function e(t){var n,r,u;return m().w(function(e){for(;;)switch(e.n){case 0:return n=t.value,r=t.schema,e.n=1,Kh({value:n,schema:r});case 1:if((u=e.v).success){e.n=2;break}throw Yo.wrap({value:n,cause:u.error});case 2:return e.a(2,u.value)}},e)})),Wh.apply(this,arguments)}function Kh(e){return Jh.apply(this,arguments)}function Jh(){return Jh=r(m().m(function e(t){var n,r,u,a,i;return m().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=t.value,r=t.schema,u=Hh(r),e.p=1,null!=u.validate){e.n=2;break}return e.a(2,{success:!0,value:n,rawValue:n});case 2:return e.n=3,u.validate(n);case 3:return a=e.v,e.a(2,a.success?{success:!0,value:a.value,rawValue:n}:{success:!1,error:Yo.wrap({value:n,cause:a.error}),rawValue:n});case 4:return e.p=4,i=e.v,e.a(2,{success:!1,error:Yo.wrap({value:n,cause:i}),rawValue:n})}},e,null,[[1,4]])})),Jh.apply(this,arguments)}function Qh(e){return Gh.apply(this,arguments)}function Gh(){return Gh=r(m().m(function e(t){var n,r,u,a,i;return m().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=t.text,r=t.schema,e.p=1,u=function(e){var t=Error.stackTraceLimit;try{Error.stackTraceLimit=0}catch(t){return qh(e)}try{return qh(e)}finally{Error.stackTraceLimit=t}}(n),null!=r){e.n=2;break}a={success:!0,value:u,rawValue:u},e.n=4;break;case 2:return e.n=3,Kh({value:u,schema:r});case 3:a=e.v;case 4:return e.a(2,a);case 5:return e.p=5,i=e.v,e.a(2,{success:!1,error:Wo.isInstance(i)?i:new Wo({text:n,cause:i}),rawValue:void 0})}},e,null,[[1,5]])})),Gh.apply(this,arguments)}function Yh(e){return Xh.apply(this,arguments)}function Xh(){return Xh=r(m().m(function e(t){return m().w(function(e){for(;;)if(0===e.n)return e.a(2,("function"==typeof t&&(t=t()),Promise.resolve(t)))},e)})),Xh.apply(this,arguments)}var ev=function(e,t){for(var n=0;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString()].concat(F(t.slice(n))).join("/")},tv=Symbol("Let zodToJsonSchema decide on which parser to use"),nv={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"};function rv(e,t){return Sv(e.type._def,t)}function uv(e,t,n){var r=null!=n?n:t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map(function(n,r){return uv(e,t,n)})};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return av(e)}}var av=function(e){var t,n={type:"integer",format:"unix-time"},r=s(e.checks);try{for(r.s();!(t=r.n()).done;){var u=t.value;switch(u.kind){case"min":n.minimum=u.value;break;case"max":n.maximum=u.value}}}catch(e){r.e(e)}finally{r.f()}return n},iv=void 0,ov=/^[cC][^\s-]{8,}$/,sv=/^[0-9a-z]+$/,cv=/^[0-9A-HJKMNP-TV-Z]{26}$/,lv=/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,fv=function(){return void 0===iv&&(iv=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),iv},dv=/^(?:(?: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])$/,pv=/^(([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])$/,hv=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vv=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,mv=/^[a-zA-Z0-9_-]{21}$/,Dv=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;function yv(e,t){var n={type:"string"};if(e.checks){var r,u=s(e.checks);try{for(u.s();!(r=u.n()).done;){var a=r.value;switch(a.kind){case"min":n.minLength="number"==typeof n.minLength?Math.max(n.minLength,a.value):a.value;break;case"max":n.maxLength="number"==typeof n.maxLength?Math.min(n.maxLength,a.value):a.value;break;case"email":switch(t.emailStrategy){case"format:email":Ev(n,"email",a.message,t);break;case"format:idn-email":Ev(n,"idn-email",a.message,t);break;case"pattern:zod":_v(n,lv,a.message,t)}break;case"url":Ev(n,"uri",a.message,t);break;case"uuid":Ev(n,"uuid",a.message,t);break;case"regex":_v(n,a.regex,a.message,t);break;case"cuid":_v(n,ov,a.message,t);break;case"cuid2":_v(n,sv,a.message,t);break;case"startsWith":_v(n,RegExp("^".concat(gv(a.value,t))),a.message,t);break;case"endsWith":_v(n,RegExp("".concat(gv(a.value,t),"$")),a.message,t);break;case"datetime":Ev(n,"date-time",a.message,t);break;case"date":Ev(n,"date",a.message,t);break;case"time":Ev(n,"time",a.message,t);break;case"duration":Ev(n,"duration",a.message,t);break;case"length":n.minLength="number"==typeof n.minLength?Math.max(n.minLength,a.value):a.value,n.maxLength="number"==typeof n.maxLength?Math.min(n.maxLength,a.value):a.value;break;case"includes":_v(n,RegExp(gv(a.value,t)),a.message,t);break;case"ip":"v6"!==a.version&&Ev(n,"ipv4",a.message,t),"v4"!==a.version&&Ev(n,"ipv6",a.message,t);break;case"base64url":_v(n,vv,a.message,t);break;case"jwt":_v(n,Dv,a.message,t);break;case"cidr":"v6"!==a.version&&_v(n,dv,a.message,t),"v4"!==a.version&&_v(n,pv,a.message,t);break;case"emoji":_v(n,fv(),a.message,t);break;case"ulid":_v(n,cv,a.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":Ev(n,"binary",a.message,t);break;case"contentEncoding:base64":n.contentEncoding="base64";break;case"pattern:zod":_v(n,hv,a.message,t)}break;case"nanoid":_v(n,mv,a.message,t)}}}catch(e){u.e(e)}finally{u.f()}}return n}function gv(e,t){return"escape"===t.patternStrategy?function(e){for(var t="",n=0;n<e.length;n++)Fv.has(e[n])||(t+="\\"),t+=e[n];return t}(e):e}var Fv=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Ev(e,t,n,r){var u;e.format||(null==(u=e.anyOf)?void 0:u.some(function(e){return e.format}))?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push(h({format:t},n&&r.errorMessages&&{errorMessage:{format:n}}))):e.format=t}function _v(e,t,n,r){var u;e.pattern||(null==(u=e.allOf)?void 0:u.some(function(e){return e.pattern}))?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push(h({pattern:bv(t,r)},n&&r.errorMessages&&{errorMessage:{pattern:n}}))):e.pattern=bv(t,r)}function bv(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;for(var r=e.flags.includes("i"),u=e.flags.includes("m"),a=e.flags.includes("s"),i=r?e.source.toLowerCase():e.source,o="",s=!1,c=!1,l=!1,f=0;f<i.length;f++)if(s)o+=i[f],s=!1;else{if(r)if(c){if(i[f].match(/[a-z]/)){l?(o+=i[f],o+="".concat(i[f-2],"-").concat(i[f]).toUpperCase(),l=!1):"-"===i[f+1]&&(null==(n=i[f+2])?void 0:n.match(/[a-z]/))?(o+=i[f],l=!0):o+="".concat(i[f]).concat(i[f].toUpperCase());continue}}else if(i[f].match(/[a-z]/)){o+="[".concat(i[f]).concat(i[f].toUpperCase(),"]");continue}if(u){if("^"===i[f]){o+="(^|(?<=[\r\n]))";continue}if("$"===i[f]){o+="($|(?=[\r\n]))";continue}}a&&"."===i[f]?o+=c?"".concat(i[f],"\r\n"):"[".concat(i[f],"\r\n]"):(o+=i[f],"\\"===i[f]?s=!0:c&&"]"===i[f]?c=!1:c||"["!==i[f]||(c=!0))}try{new RegExp(o)}catch(n){return console.warn("Could not convert regex pattern at ".concat(t.currentPath.join("/")," to a flag-independent form! Falling back to the flag-ignorant source")),e.source}return o}function Cv(e,t){var n,r,u,a,i,o,s={type:"object",additionalProperties:null!=(n=Sv(e.valueType._def,h(h({},t),{},{currentPath:[].concat(F(t.currentPath),["additionalProperties"])})))?n:t.allowedAdditionalProperties};if((null==(r=e.keyType)?void 0:r._def.typeName)===Ih.ZodString&&(null==(u=e.keyType._def.checks)?void 0:u.length)){var c=yv(e.keyType._def,t);c.type;var l=v(c,Ut);return h(h({},s),{},{propertyNames:l})}if((null==(a=e.keyType)?void 0:a._def.typeName)===Ih.ZodEnum)return h(h({},s),{},{propertyNames:{enum:e.keyType._def.values}});if((null==(i=e.keyType)?void 0:i._def.typeName)===Ih.ZodBranded&&e.keyType._def.type._def.typeName===Ih.ZodString&&(null==(o=e.keyType._def.type._def.checks)?void 0:o.length)){var f=rv(e.keyType._def,t);f.type;var d=v(f,Ht);return h(h({},s),{},{propertyNames:d})}return s}var kv={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Av(e){try{return e.isOptional()}catch(e){return!0}}var wv=function(e,t,n){switch(t){case Ih.ZodString:return yv(e,n);case Ih.ZodNumber:return function(e){var t={type:"number"};if(!e.checks)return t;var n,r=s(e.checks);try{for(r.s();!(n=r.n()).done;){var u=n.value;switch(u.kind){case"int":t.type="integer";break;case"min":u.inclusive?t.minimum=u.value:t.exclusiveMinimum=u.value;break;case"max":u.inclusive?t.maximum=u.value:t.exclusiveMaximum=u.value;break;case"multipleOf":t.multipleOf=u.value}}}catch(e){r.e(e)}finally{r.f()}return t}(e);case Ih.ZodObject:return function(e,t){var n={type:"object",properties:{}},r=[],u=e.shape();for(var a in u){var i=u[a];if(void 0!==i&&void 0!==i._def){var o=Av(i),s=Sv(i._def,h(h({},t),{},{currentPath:[].concat(F(t.currentPath),["properties",a]),propertyPath:[].concat(F(t.currentPath),["properties",a])}));void 0!==s&&(n.properties[a]=s,o||r.push(a))}}r.length&&(n.required=r);var c=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return Sv(e.catchall._def,h(h({},t),{},{currentPath:[].concat(F(t.currentPath),["additionalProperties"])}));switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==c&&(n.additionalProperties=c),n}(e,n);case Ih.ZodBigInt:return function(e){var t={type:"integer",format:"int64"};if(!e.checks)return t;var n,r=s(e.checks);try{for(r.s();!(n=r.n()).done;){var u=n.value;switch(u.kind){case"min":u.inclusive?t.minimum=u.value:t.exclusiveMinimum=u.value;break;case"max":u.inclusive?t.maximum=u.value:t.exclusiveMaximum=u.value;break;case"multipleOf":t.multipleOf=u.value}}}catch(e){r.e(e)}finally{r.f()}return t}(e);case Ih.ZodBoolean:return{type:"boolean"};case Ih.ZodDate:return uv(e,n);case Ih.ZodUndefined:return{not:{}};case Ih.ZodNull:return{type:"null"};case Ih.ZodArray:return function(e,t){var n,r,u,a={type:"array"};return(null==(n=e.type)?void 0:n._def)&&(null==(u=null==(r=e.type)?void 0:r._def)?void 0:u.typeName)!==Ih.ZodAny&&(a.items=Sv(e.type._def,h(h({},t),{},{currentPath:[].concat(F(t.currentPath),["items"])}))),e.minLength&&(a.minItems=e.minLength.value),e.maxLength&&(a.maxItems=e.maxLength.value),e.exactLength&&(a.minItems=e.exactLength.value,a.maxItems=e.exactLength.value),a}(e,n);case Ih.ZodUnion:case Ih.ZodDiscriminatedUnion:return function(e,t){var n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(function(e){return e._def.typeName in kv&&(!e._def.checks||!e._def.checks.length)})){var r=n.reduce(function(e,t){var n=kv[t._def.typeName];return n&&!e.includes(n)?[].concat(F(e),[n]):e},[]);return{type:r.length>1?r:r[0]}}if(n.every(function(e){return"ZodLiteral"===e._def.typeName&&!e.description})){var u=n.reduce(function(e,t){var n=_(t._def.value);switch(n){case"string":case"number":case"boolean":return[].concat(F(e),[n]);case"bigint":return[].concat(F(e),["integer"]);case"object":if(null===t._def.value)return[].concat(F(e),["null"]);default:return e}},[]);if(u.length===n.length){var a=u.filter(function(e,t,n){return n.indexOf(e)===t});return{type:a.length>1?a:a[0],enum:n.reduce(function(e,t){return e.includes(t._def.value)?e:[].concat(F(e),[t._def.value])},[])}}}else if(n.every(function(e){return"ZodEnum"===e._def.typeName}))return{type:"string",enum:n.reduce(function(e,t){return[].concat(F(e),F(t._def.values.filter(function(t){return!e.includes(t)})))},[])};return function(e,t){var n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map(function(e,n){return Sv(e._def,h(h({},t),{},{currentPath:[].concat(F(t.currentPath),["anyOf","".concat(n)])}))}).filter(function(e){return!!e&&(!t.strictUnions||"object"==_(e)&&Object.keys(e).length>0)});return n.length?{anyOf:n}:void 0}(e,t)}(e,n);case Ih.ZodIntersection:return function(e,t){var n=[Sv(e.left._def,h(h({},t),{},{currentPath:[].concat(F(t.currentPath),["allOf","0"])})),Sv(e.right._def,h(h({},t),{},{currentPath:[].concat(F(t.currentPath),["allOf","1"])}))].filter(function(e){return!!e}),r=[];return n.forEach(function(e){if("type"in(n=e)&&"string"===n.type||!("allOf"in n)){var t=e;if("additionalProperties"in e&&!1===e.additionalProperties)e.additionalProperties,t=v(e,Vt);r.push(t)}else r.push.apply(r,F(e.allOf));var n}),r.length?{allOf:r}:void 0}(e,n);case Ih.ZodTuple:return function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map(function(e,n){return Sv(e._def,h(h({},t),{},{currentPath:[].concat(F(t.currentPath),["items","".concat(n)])}))}).reduce(function(e,t){return void 0===t?e:[].concat(F(e),[t])},[]),additionalItems:Sv(e.rest._def,h(h({},t),{},{currentPath:[].concat(F(t.currentPath),["additionalItems"])}))}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map(function(e,n){return Sv(e._def,h(h({},t),{},{currentPath:[].concat(F(t.currentPath),["items","".concat(n)])}))}).reduce(function(e,t){return void 0===t?e:[].concat(F(e),[t])},[])}}(e,n);case Ih.ZodRecord:return Cv(e,n);case Ih.ZodLiteral:return function(e){var t=_(e.value);return"bigint"!==t&&"number"!==t&&"boolean"!==t&&"string"!==t?{type:Array.isArray(e.value)?"array":"object"}:{type:"bigint"===t?"integer":t,const:e.value}}(e);case Ih.ZodEnum:return function(e){return{type:"string",enum:Array.from(e.values)}}(e);case Ih.ZodNativeEnum:return function(e){var t=e.values,n=Object.keys(e.values).filter(function(e){return"number"!=typeof t[t[e]]}).map(function(e){return t[e]}),r=Array.from(new Set(n.map(function(e){return _(e)})));return{type:1===r.length?"string"===r[0]?"string":"number":["string","number"],enum:n}}(e);case Ih.ZodNullable:return function(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[kv[e.innerType._def.typeName],"null"]};var n=Sv(e.innerType._def,h(h({},t),{},{currentPath:[].concat(F(t.currentPath),["anyOf","0"])}));return n&&{anyOf:[n,{type:"null"}]}}(e,n);case Ih.ZodOptional:return function(e,t){var n;if(t.currentPath.toString()===(null==(n=t.propertyPath)?void 0:n.toString()))return Sv(e.innerType._def,t);var r=Sv(e.innerType._def,h(h({},t),{},{currentPath:[].concat(F(t.currentPath),["anyOf","1"])}));return r?{anyOf:[{not:{}},r]}:{}}(e,n);case Ih.ZodMap:return function(e,t){return"record"===t.mapStrategy?Cv(e,t):{type:"array",maxItems:125,items:{type:"array",items:[Sv(e.keyType._def,h(h({},t),{},{currentPath:[].concat(F(t.currentPath),["items","items","0"])}))||{},Sv(e.valueType._def,h(h({},t),{},{currentPath:[].concat(F(t.currentPath),["items","items","1"])}))||{}],minItems:2,maxItems:2}}}(e,n);case Ih.ZodSet:return function(e,t){var n={type:"array",uniqueItems:!0,items:Sv(e.valueType._def,h(h({},t),{},{currentPath:[].concat(F(t.currentPath),["items"])}))};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}(e,n);case Ih.ZodLazy:return function(){return e.getter()._def};case Ih.ZodPromise:return function(e,t){return Sv(e.type._def,t)}(e,n);case Ih.ZodNaN:case Ih.ZodNever:return{not:{}};case Ih.ZodEffects:return function(e,t){return"input"===t.effectStrategy?Sv(e.schema._def,t):{}}(e,n);case Ih.ZodAny:case Ih.ZodUnknown:return{};case Ih.ZodDefault:return function(e,t){return h(h({},Sv(e.innerType._def,t)),{},{default:e.defaultValue()})}(e,n);case Ih.ZodBranded:return rv(e,n);case Ih.ZodReadonly:case Ih.ZodCatch:return function(e,t){return Sv(e.innerType._def,t)}(e,n);case Ih.ZodPipeline:return function(e,t){if("input"===t.pipeStrategy)return Sv(e.in._def,t);if("output"===t.pipeStrategy)return Sv(e.out._def,t);var n=Sv(e.in._def,h(h({},t),{},{currentPath:[].concat(F(t.currentPath),["allOf","0"])}));return{allOf:[n,Sv(e.out._def,h(h({},t),{},{currentPath:[].concat(F(t.currentPath),["allOf",n?"1":"0"])}))].filter(function(e){return void 0!==e})}}(e,n);case Ih.ZodFunction:case Ih.ZodVoid:case Ih.ZodSymbol:default:return}};function Sv(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],u=t.seen.get(e);if(t.override){var a=null==(n=t.override)?void 0:n.call(t,e,t,u,r);if(a!==tv)return a}if(u&&!r){var i=xv(u,t);if(void 0!==i)return i}var o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);var s=wv(e,e.typeName,t),c="function"==typeof s?Sv(s(),t):s;if(c&&Ov(e,t,c),t.postProcess){var l=t.postProcess(c,e,t);return o.jsonSchema=c,l}return o.jsonSchema=c,c}var xv=function(e,t){switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:ev(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every(function(e,n){return t.currentPath[n]===e})?(console.warn("Recursive reference detected at ".concat(t.currentPath.join("/"),"! Defaulting to any")),{}):"seen"===t.$refStrategy?{}:void 0}},Ov=function(e,t,n){return e.description&&(n.description=e.description),n},Bv=function(e,t){var n,r=function(e){var t=function(e){return"string"==typeof e?h(h({},nv),{},{name:e}):h(h({},nv),e)}(e),n=void 0!==t.name?[].concat(F(t.basePath),[t.definitionPath,t.name]):t.basePath;return h(h({},t),{},{currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(function(e){var n=g(e,2),r=n[0],u=n[1];return[u._def,{def:u._def,path:[].concat(F(t.basePath),[t.definitionPath,r]),jsonSchema:void 0}]}))})}(t),u="object"==_(t)&&t.definitions?Object.entries(t.definitions).reduce(function(e,t){var n,u=g(t,2),a=u[0],i=u[1];return h(h({},e),{},c({},a,null!=(n=Sv(i._def,h(h({},r),{},{currentPath:[].concat(F(r.basePath),[r.definitionPath,a])}),!0))?n:{}))},{}):void 0,a="string"==typeof t?t:"title"===(null==t?void 0:t.nameStrategy)||null==t?void 0:t.name,i=null!=(n=Sv(e._def,void 0===a?r:h(h({},r),{},{currentPath:[].concat(F(r.basePath),[r.definitionPath,a])}),!1))?n:{},o="object"==_(t)&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==o&&(i.title=o);var s=void 0===a?u?h(h({},i),{},c({},r.definitionPath,u)):i:c({$ref:[].concat(F("relative"===r.$refStrategy?[]:r.basePath),[r.definitionPath,a]).join("/")},r.definitionPath,h(h({},u),{},c({},a,i)));return s.$schema="http://json-schema.org/draft-07/schema#",s};function Iv(e,t){return function(e){return"_zod"in e}(e)?function(e){return Pv(function(){return function(e,t){if(e instanceof Xl){var n,r=new _f(t),u={},a=an(e._idmap.entries());try{for(a.s();!(n=a.n()).done;){var i=yn(n.value,2),o=(i[0],i[1]);r.process(o)}}catch(e){a.e(e)}finally{a.f()}var s,c={},l={registry:e,uri:null==t?void 0:t.uri,defs:u},f=an(e._idmap.entries());try{for(f.s();!(s=f.n()).done;){var d=yn(s.value,2),p=d[0],h=d[1];c[p]=r.emit(h,pn(pn({},t),{},{external:l}))}}catch(e){f.e(e)}finally{f.f()}if(Object.keys(u).length>0){var v="draft-2020-12"===r.target?"$defs":"definitions";c.__shared=on({},v,u)}return{schemas:c}}var m=new _f(t);return m.process(e),m.emit(e,t)}(e,{target:"draft-7",io:"output",reused:"inline"})},{validate:(t=r(m().m(function t(n){var r;return m().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,Tf(e,n);case 1:return r=t.v,t.a(2,r.success?{success:!0,value:r.data}:{success:!1,error:r.error})}},t)})),function(e){return t.apply(this,arguments)})});var t}(e):function(e){return Pv(function(){return Bv(e,{$refStrategy:"none"})},{validate:(t=r(m().m(function t(n){var r;return m().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,e.safeParseAsync(n);case 1:return r=t.v,t.a(2,r.success?{success:!0,value:r.data}:{success:!1,error:r.error})}},t)})),function(e){return t.apply(this,arguments)})});var t}(e)}var Tv=Symbol.for("vercel.ai.schema");function Pv(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).validate;return c(function(e,t,n,r){var u={configurable:!0,enumerable:!0};return u[e]=r,Object.defineProperty(t,n,u)}("get",c(c(c({},Tv,!0),"_type",void 0),Uh,!0),"jsonSchema",function(){return"function"==typeof e&&(e=e()),e}),"validate",t)}var jv,Nv=Object.defineProperty,zv="AI_NoObjectGeneratedError",Rv="vercel.ai.error.".concat(zv),Mv=Symbol.for(Rv),Zv=function(e){function t(e){var n,r=e.message,i=void 0===r?"No object generated.":r,o=e.cause,s=e.text,c=e.response,l=e.usage,f=e.finishReason;return a(this,t),(n=u(this,t,[{name:zv,message:i,cause:o}]))[jv]=!0,n.text=s,n.response=c,n.usage=l,n.finishReason=f,n}return f(t,e),o(t,null,[{key:"isInstance",value:function(e){return No.hasMarker(e,Rv)}}])}(No);jv=Mv;var Lv="5.0.93",$v=Od([Hf(),np(Uint8Array),np(ArrayBuffer),tp(function(e){var t,n;return null!=(n=null==(t=globalThis.Buffer)?void 0:t.isBuffer(e))&&n},{message:"Must be a Buffer"})]),qv=new Xd({type:"lazy",getter:function(){return Od([gd(),Hf(),pd(),Dd(),Pd(Hf(),qv),kd(qv)])}}),Uv=Pd(Hf(),Pd(Hf(),qv)),Hv=wd({type:Rd("text"),text:Hf(),providerOptions:Uv.optional()}),Vv=wd({type:Rd("image"),image:Od([$v,np(URL)]),mediaType:Hf().optional(),providerOptions:Uv.optional()}),Wv=wd({type:Rd("file"),data:Od([$v,np(URL)]),filename:Hf().optional(),mediaType:Hf(),providerOptions:Uv.optional()}),Kv=wd({type:Rd("reasoning"),text:Hf(),providerOptions:Uv.optional()}),Jv=wd({type:Rd("tool-call"),toolCallId:Hf(),toolName:Hf(),input:Ed(),providerOptions:Uv.optional(),providerExecuted:Dd().optional()}),Qv=new Bd(pn({type:"union",options:[wd({type:Rd("text"),value:Hf()}),wd({type:Rd("json"),value:qv}),wd({type:Rd("error-text"),value:Hf()}),wd({type:Rd("error-json"),value:qv}),wd({type:Rd("content"),value:kd(Od([wd({type:Rd("text"),text:Hf()}),wd({type:Rd("media"),data:Hf(),mediaType:Hf()})]))})],discriminator:"type"},ks(undefined))),Gv=wd({type:Rd("tool-result"),toolCallId:Hf(),toolName:Hf(),output:Qv,providerOptions:Uv.optional()}),Yv=wd({role:Rd("system"),content:Hf(),providerOptions:Uv.optional()}),Xv=wd({role:Rd("user"),content:Od([Hf(),kd(Od([Hv,Vv,Wv]))]),providerOptions:Uv.optional()}),em=wd({role:Rd("assistant"),content:Od([Hf(),kd(Od([Hv,Wv,Kv,Jv,Gv]))]),providerOptions:Uv.optional()});Od([Yv,Xv,em,wd({role:Rd("tool"),content:kd(Gv),providerOptions:Uv.optional()})]),Nh({prefix:"aitxt",size:24}),TransformStream;var tm=function(){var e;return function(){return null==e&&(e=Iv(Od([Sd({type:Rd("text-start"),id:Hf(),providerMetadata:Uv.optional()}),Sd({type:Rd("text-delta"),id:Hf(),delta:Hf(),providerMetadata:Uv.optional()}),Sd({type:Rd("text-end"),id:Hf(),providerMetadata:Uv.optional()}),Sd({type:Rd("error"),errorText:Hf()}),Sd({type:Rd("tool-input-start"),toolCallId:Hf(),toolName:Hf(),providerExecuted:Dd().optional(),dynamic:Dd().optional()}),Sd({type:Rd("tool-input-delta"),toolCallId:Hf(),inputTextDelta:Hf()}),Sd({type:Rd("tool-input-available"),toolCallId:Hf(),toolName:Hf(),input:Ed(),providerExecuted:Dd().optional(),providerMetadata:Uv.optional(),dynamic:Dd().optional()}),Sd({type:Rd("tool-input-error"),toolCallId:Hf(),toolName:Hf(),input:Ed(),providerExecuted:Dd().optional(),providerMetadata:Uv.optional(),dynamic:Dd().optional(),errorText:Hf()}),Sd({type:Rd("tool-output-available"),toolCallId:Hf(),output:Ed(),providerExecuted:Dd().optional(),dynamic:Dd().optional(),preliminary:Dd().optional()}),Sd({type:Rd("tool-output-error"),toolCallId:Hf(),errorText:Hf(),providerExecuted:Dd().optional(),dynamic:Dd().optional()}),Sd({type:Rd("reasoning-start"),id:Hf(),providerMetadata:Uv.optional()}),Sd({type:Rd("reasoning-delta"),id:Hf(),delta:Hf(),providerMetadata:Uv.optional()}),Sd({type:Rd("reasoning-end"),id:Hf(),providerMetadata:Uv.optional()}),Sd({type:Rd("source-url"),sourceId:Hf(),url:Hf(),title:Hf().optional(),providerMetadata:Uv.optional()}),Sd({type:Rd("source-document"),sourceId:Hf(),mediaType:Hf(),title:Hf(),filename:Hf().optional(),providerMetadata:Uv.optional()}),Sd({type:Rd("file"),url:Hf(),mediaType:Hf(),providerMetadata:Uv.optional()}),Sd({type:tp(function(e){return"string"==typeof e&&e.startsWith("data-")},{message:'Type must start with "data-"'}),id:Hf().optional(),data:Ed(),transient:Dd().optional()}),Sd({type:Rd("start-step")}),Sd({type:Rd("finish-step")}),Sd({type:Rd("start"),messageId:Hf().optional(),messageMetadata:Ed().optional()}),Sd({type:Rd("finish"),finishReason:Nd(["stop","length","content-filter","tool-calls","error","other","unknown"]).optional(),messageMetadata:Ed().optional()}),Sd({type:Rd("abort")}),Sd({type:Rd("message-metadata"),messageMetadata:Ed()})]))),e}}();function nm(e,t){if(void 0!==e||void 0!==t){if(void 0===e)return t;if(void 0===t)return e;var n=h({},e);for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var u=t[r];if(void 0===u)continue;var a=r in e?e[r]:void 0,i=!(null===u||"object"!=_(u)||Array.isArray(u)||u instanceof Date||u instanceof RegExp),o=!(null==a||"object"!=_(a)||Array.isArray(a)||a instanceof Date||a instanceof RegExp);n[r]=i&&o?nm(a,u):u}return n}}function rm(e){var t=["ROOT"],n=-1,r=null;function u(e,u,a){switch(e){case'"':n=u,t.pop(),t.push(a),t.push("INSIDE_STRING");break;case"f":case"t":case"n":n=u,r=u,t.pop(),t.push(a),t.push("INSIDE_LITERAL");break;case"-":t.pop(),t.push(a),t.push("INSIDE_NUMBER");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=u,t.pop(),t.push(a),t.push("INSIDE_NUMBER");break;case"{":n=u,t.pop(),t.push(a),t.push("INSIDE_OBJECT_START");break;case"[":n=u,t.pop(),t.push(a),t.push("INSIDE_ARRAY_START")}}function a(e,r){switch(e){case",":t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":n=r,t.pop()}}function i(e,r){switch(e){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=r,t.pop()}}for(var o=0;o<e.length;o++){var s=e[o];switch(t[t.length-1]){case"ROOT":u(s,o,"FINISH");break;case"INSIDE_OBJECT_START":switch(s){case'"':t.pop(),t.push("INSIDE_OBJECT_KEY");break;case"}":n=o,t.pop()}break;case"INSIDE_OBJECT_AFTER_COMMA":'"'===s&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break;case"INSIDE_OBJECT_KEY":'"'===s&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break;case"INSIDE_OBJECT_AFTER_KEY":":"===s&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break;case"INSIDE_OBJECT_BEFORE_VALUE":u(s,o,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":a(s,o);break;case"INSIDE_STRING":switch(s){case'"':t.pop(),n=o;break;case"\\":t.push("INSIDE_STRING_ESCAPE");break;default:n=o}break;case"INSIDE_ARRAY_START":"]"===s?(n=o,t.pop()):(n=o,u(s,o,"INSIDE_ARRAY_AFTER_VALUE"));break;case"INSIDE_ARRAY_AFTER_VALUE":switch(s){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=o,t.pop();break;default:n=o}break;case"INSIDE_ARRAY_AFTER_COMMA":u(s,o,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":t.pop(),n=o;break;case"INSIDE_NUMBER":switch(s){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=o;break;case"e":case"E":case"-":case".":break;case",":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(s,o),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&a(s,o);break;case"}":t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&a(s,o);break;case"]":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(s,o);break;default:t.pop()}break;case"INSIDE_LITERAL":var c=e.substring(r,o+1);"false".startsWith(c)||"true".startsWith(c)||"null".startsWith(c)?n=o:(t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]?a(s,o):"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(s,o))}}for(var l=e.slice(0,n+1),f=t.length-1;f>=0;f--)switch(t[f]){case"INSIDE_STRING":l+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":l+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":l+="]";break;case"INSIDE_LITERAL":var d=e.substring(r,e.length);"true".startsWith(d)?l+="true".slice(d.length):"false".startsWith(d)?l+="false".slice(d.length):"null".startsWith(d)&&(l+="null".slice(d.length))}return l}function um(e){return am.apply(this,arguments)}function am(){return am=r(m().m(function e(t){var n,r;return m().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==t){e.n=1;break}return e.a(2,{value:void 0,state:"undefined-input"});case 1:return e.n=2,Qh({text:t});case 2:if(!(n=e.v).success){e.n=3;break}r={value:n.value,state:"successful-parse"},e.n=5;break;case 3:return e.n=4,Qh({text:rm(t)});case 4:n=e.v,r=n.success?{value:n.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"};case 5:return e.a(2,r)}},e)})),am.apply(this,arguments)}function im(e){return e.type.startsWith("tool-")}function om(e){return im(e)||function(e){return"dynamic-tool"===e.type}(e)}function sm(e){return e.type.split("-").slice(1).join("-")}function cm(e){var t=e.lastMessage,n=e.messageId;return{message:"assistant"===(null==t?void 0:t.role)?t:{id:n,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function lm(e){var t=e.stream,n=e.messageMetadataSchema,u=e.dataPartSchemas,a=e.runUpdateMessageJob,i=e.onError,o=e.onToolCall,s=e.onData;return t.pipeThrough(new TransformStream({transform:function(e,t){return r(m().m(function c(){return m().w(function(c){for(;;)switch(c.n){case 0:return c.n=1,a(function(){var a=r(m().m(function a(c){var l,f,d,p,v,D,y,g,F,E,_,b,C,k,A,w,S,x,O,B,I,T,P,j,N,z,R,M,Z;return m().w(function(a){for(;;)switch(a.n){case 0:b=function(){return b=r(m().m(function e(t){var r;return m().w(function(e){for(;;)switch(e.n){case 0:if(null==t){e.n=2;break}if(r=null!=l.message.metadata?nm(l.message.metadata,t):t,!(null!=n)){e.n=1;break}return e.n=1,Vh({value:r,schema:n});case 1:l.message.metadata=r;case 2:return e.a(2)}},e)})),b.apply(this,arguments)},_=function(e){return b.apply(this,arguments)},E=function(e){var t,n,r=l.message.parts.find(function(t){return"dynamic-tool"===t.type&&t.toolCallId===e.toolCallId}),u=e,a=r;null!=r?(r.state=e.state,a.toolName=e.toolName,a.input=u.input,a.output=u.output,a.errorText=u.errorText,a.rawInput=null!=(t=u.rawInput)?t:a.rawInput,a.preliminary=u.preliminary,a.providerExecuted=null!=(n=u.providerExecuted)?n:r.providerExecuted,null!=u.providerMetadata&&"input-available"===r.state&&(r.callProviderMetadata=u.providerMetadata)):l.message.parts.push(h({type:"dynamic-tool",toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:u.input,output:u.output,errorText:u.errorText,preliminary:u.preliminary,providerExecuted:u.providerExecuted},null!=u.providerMetadata?{callProviderMetadata:u.providerMetadata}:{}))},F=function(e){var t,n=l.message.parts.find(function(t){return im(t)&&t.toolCallId===e.toolCallId}),r=e,u=n;null!=n?(n.state=e.state,u.input=r.input,u.output=r.output,u.errorText=r.errorText,u.rawInput=r.rawInput,u.preliminary=r.preliminary,u.providerExecuted=null!=(t=r.providerExecuted)?t:n.providerExecuted,null!=r.providerMetadata&&"input-available"===n.state&&(n.callProviderMetadata=r.providerMetadata)):l.message.parts.push(h({type:"tool-".concat(e.toolName),toolCallId:e.toolCallId,state:e.state,input:r.input,output:r.output,rawInput:r.rawInput,errorText:r.errorText,providerExecuted:r.providerExecuted,preliminary:r.preliminary},null!=r.providerMetadata?{callProviderMetadata:r.providerMetadata}:{}))},g=function(e){var t=l.message.parts.filter(function(e){return"dynamic-tool"===e.type}).find(function(t){return t.toolCallId===e});if(null==t)throw new Error("tool-output-error must be preceded by a tool-input-available");return t},y=function(e){var t=l.message.parts.filter(im).find(function(t){return t.toolCallId===e});if(null==t)throw new Error("tool-output-error must be preceded by a tool-input-available");return t},l=c.state,f=c.write,Z=e.type,a.n="text-start"===Z?1:"text-delta"===Z?2:"text-end"===Z?3:"reasoning-start"===Z?4:"reasoning-delta"===Z?5:"reasoning-end"===Z?6:"file"===Z?7:"source-url"===Z?8:"source-document"===Z?9:"tool-input-start"===Z?10:"tool-input-delta"===Z?11:"tool-input-available"===Z?13:"tool-input-error"===Z?15:"tool-output-available"===Z?16:"tool-output-error"===Z?17:"start-step"===Z?18:"finish-step"===Z?19:"start"===Z?20:"finish"===Z?22:"message-metadata"===Z?24:"error"===Z?26:27;break;case 1:return C={type:"text",text:"",providerMetadata:e.providerMetadata,state:"streaming"},l.activeTextParts[e.id]=C,l.message.parts.push(C),f(),a.a(3,30);case 2:return(k=l.activeTextParts[e.id]).text+=e.delta,k.providerMetadata=null!=(d=e.providerMetadata)?d:k.providerMetadata,f(),a.a(3,30);case 3:return(A=l.activeTextParts[e.id]).state="done",A.providerMetadata=null!=(p=e.providerMetadata)?p:A.providerMetadata,delete l.activeTextParts[e.id],f(),a.a(3,30);case 4:return w={type:"reasoning",text:"",providerMetadata:e.providerMetadata,state:"streaming"},l.activeReasoningParts[e.id]=w,l.message.parts.push(w),f(),a.a(3,30);case 5:return(S=l.activeReasoningParts[e.id]).text+=e.delta,S.providerMetadata=null!=(v=e.providerMetadata)?v:S.providerMetadata,f(),a.a(3,30);case 6:return(x=l.activeReasoningParts[e.id]).providerMetadata=null!=(D=e.providerMetadata)?D:x.providerMetadata,x.state="done",delete l.activeReasoningParts[e.id],f(),a.a(3,30);case 7:return l.message.parts.push({type:"file",mediaType:e.mediaType,url:e.url}),f(),a.a(3,30);case 8:return l.message.parts.push({type:"source-url",sourceId:e.sourceId,url:e.url,title:e.title,providerMetadata:e.providerMetadata}),f(),a.a(3,30);case 9:return l.message.parts.push({type:"source-document",sourceId:e.sourceId,mediaType:e.mediaType,title:e.title,filename:e.filename,providerMetadata:e.providerMetadata}),f(),a.a(3,30);case 10:return O=l.message.parts.filter(im),l.partialToolCalls[e.toolCallId]={text:"",toolName:e.toolName,index:O.length,dynamic:e.dynamic},e.dynamic?E({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted}):F({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted}),f(),a.a(3,30);case 11:return(B=l.partialToolCalls[e.toolCallId]).text+=e.inputTextDelta,a.n=12,um(B.text);case 12:return I=a.v,T=I.value,B.dynamic?E({toolCallId:e.toolCallId,toolName:B.toolName,state:"input-streaming",input:T}):F({toolCallId:e.toolCallId,toolName:B.toolName,state:"input-streaming",input:T}),f(),a.a(3,30);case 13:if(e.dynamic?E({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}):F({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),f(),!(o&&!e.providerExecuted)){a.n=14;break}return a.n=14,o({toolCall:e});case 14:return a.a(3,30);case 15:return e.dynamic?E({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}):F({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:void 0,rawInput:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),f(),a.a(3,30);case 16:return e.dynamic?(P=g(e.toolCallId),E({toolCallId:e.toolCallId,toolName:P.toolName,state:"output-available",input:P.input,output:e.output,preliminary:e.preliminary})):(j=y(e.toolCallId),F({toolCallId:e.toolCallId,toolName:sm(j),state:"output-available",input:j.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary})),f(),a.a(3,30);case 17:return e.dynamic?(N=g(e.toolCallId),E({toolCallId:e.toolCallId,toolName:N.toolName,state:"output-error",input:N.input,errorText:e.errorText,providerExecuted:e.providerExecuted})):(z=y(e.toolCallId),F({toolCallId:e.toolCallId,toolName:sm(z),state:"output-error",input:z.input,rawInput:z.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted})),f(),a.a(3,30);case 18:return l.message.parts.push({type:"step-start"}),a.a(3,30);case 19:return l.activeTextParts={},l.activeReasoningParts={},a.a(3,30);case 20:return null!=e.messageId&&(l.message.id=e.messageId),a.n=21,_(e.messageMetadata);case 21:return null==e.messageId&&null==e.messageMetadata||f(),a.a(3,30);case 22:return null!=e.finishReason&&(l.finishReason=e.finishReason),a.n=23,_(e.messageMetadata);case 23:return null!=e.messageMetadata&&f(),a.a(3,30);case 24:return a.n=25,_(e.messageMetadata);case 25:return null!=e.messageMetadata&&f(),a.a(3,30);case 26:return null==i||i(new Error(e.errorText)),a.a(3,30);case 27:if(!function(e){return e.type.startsWith("data-")}(e)){a.n=30;break}if(!(null!=(null==u?void 0:u[e.type]))){a.n=28;break}return a.n=28,Vh({value:e.data,schema:u[e.type]});case 28:if(!(R=e).transient){a.n=29;break}return null==s||s(R),a.a(3,30);case 29:M=null!=R.id?l.message.parts.find(function(e){return R.type===e.type&&R.id===e.id}):void 0,null!=M?M.data=R.data:l.message.parts.push(R),null==s||s(R),f();case 30:t.enqueue(e);case 31:return a.a(2)}},a)}));return function(e){return a.apply(this,arguments)}}());case 1:return c.a(2)}},c)}))()}}))}Nh({prefix:"aitxt",size:24}),Nh({prefix:"aiobj",size:24});var fm=function(){return o(function e(){a(this,e),this.queue=[],this.isProcessing=!1},[{key:"processQueue",value:(t=r(m().m(function e(){return m().w(function(e){for(;;)switch(e.n){case 0:if(this.isProcessing){e.n=5;break}this.isProcessing=!0;case 1:if(!(this.queue.length>0)){e.n=4;break}return e.n=2,this.queue[0]();case 2:this.queue.shift();case 3:e.n=1;break;case 4:this.isProcessing=!1;case 5:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"run",value:(e=r(m().m(function e(t){var n=this;return m().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,u){n.queue.push(r(m().m(function n(){var r;return m().w(function(n){for(;;)switch(n.p=n.n){case 0:return n.p=0,n.n=1,t();case 1:e(),n.n=3;break;case 2:n.p=2,r=n.v,u(r);case 3:return n.a(2)}},n,null,[[0,2]])}))),n.processQueue()}))},e)})),function(t){return e.apply(this,arguments)})}]);var e,t}();Nh({prefix:"aiobj",size:24}),function(e,t){for(var n in t)Nv(e,n,{get:t[n],enumerable:!0})}({},{object:function(){return vm},text:function(){return hm}});var dm,pm,hm=function(){return{type:"text",responseFormat:{type:"text"},parsePartial:(t=r(m().m(function e(t){var n;return m().w(function(e){for(;;)if(0===e.n)return n=t.text,e.a(2,{partial:n})},e)})),function(e){return t.apply(this,arguments)}),parseOutput:(e=r(m().m(function e(t){var n;return m().w(function(e){for(;;)if(0===e.n)return n=t.text,e.a(2,n)},e)})),function(t){return e.apply(this,arguments)})};var e,t},vm=function(e){var t=function(e){return null==e?Pv({properties:{},additionalProperties:!1}):"object"==_(t=e)&&null!==t&&Tv in t&&!0===t[Tv]&&"jsonSchema"in t&&"validate"in t?e:"function"==typeof e?e():Iv(e);var t}(e.schema);return{type:"object",responseFormat:{type:"json",schema:t.jsonSchema},parsePartial:function(e){return r(m().m(function t(){var n,r,u,a;return m().w(function(t){for(;;)switch(t.n){case 0:return n=e.text,t.n=1,um(n);case 1:r=t.v,a=r.state,t.n="failed-parse"===a||"undefined-input"===a?2:"repaired-parse"===a||"successful-parse"===a?3:4;break;case 2:case 5:return t.a(2);case 3:return t.a(2,{partial:r.value});case 4:throw u=r.state,new Error("Unsupported parse state: ".concat(u))}},t)}))()},parseOutput:function(e,n){return r(m().m(function r(){var u,a,i;return m().w(function(r){for(;;)switch(r.n){case 0:return u=e.text,r.n=1,Qh({text:u});case 1:if((a=r.v).success){r.n=2;break}throw new Zv({message:"No object generated: could not parse the response.",cause:a.error,text:u,response:n.response,usage:n.usage,finishReason:n.finishReason});case 2:return r.n=3,Kh({value:a.value,schema:t});case 3:if((i=r.v).success){r.n=4;break}throw new Zv({message:"No object generated: response did not match schema.",cause:i.error,text:u,response:n.response,usage:n.usage,finishReason:n.finishReason});case 4:return r.a(2,i.value)}},r)}))()}}},mm=function(){return o(function e(t){var n=t.api,r=void 0===n?"/api/chat":n,u=t.credentials,i=t.headers,o=t.body,s=t.fetch,c=t.prepareSendMessagesRequest,l=t.prepareReconnectToStreamRequest;a(this,e),this.api=r,this.credentials=u,this.headers=i,this.body=o,this.fetch=s,this.prepareSendMessagesRequest=c,this.prepareReconnectToStreamRequest=l},[{key:"sendMessages",value:(t=r(m().m(function e(t){var n,r,u,a,i,o,s,c,l,f,d,p,D,y,g,F,E,_,b,C;return m().w(function(e){for(;;)switch(e.n){case 0:return n=t.abortSignal,r=v(t,Wt),e.n=1,Yh(this.body);case 1:return c=e.v,e.n=2,Yh(this.headers);case 2:return l=e.v,e.n=3,Yh(this.credentials);case 3:return f=e.v,d=h(h({},Mh(l)),Mh(r.headers)),e.n=4,null==(u=this.prepareSendMessagesRequest)?void 0:u.call(this,{api:this.api,id:r.chatId,messages:r.messages,body:h(h({},c),r.body),headers:d,credentials:f,requestMetadata:r.metadata,trigger:r.trigger,messageId:r.messageId});case 4:return p=e.v,D=null!=(a=null==p?void 0:p.api)?a:this.api,y=void 0!==(null==p?void 0:p.headers)?Mh(p.headers):d,g=void 0!==(null==p?void 0:p.body)?p.body:h(h(h({},c),r.body),{},{id:r.chatId,messages:r.messages,trigger:r.trigger,messageId:r.messageId}),F=null!=(i=null==p?void 0:p.credentials)?i:f,E=null!=(o=this.fetch)?o:globalThis.fetch,e.n=5,E(D,{method:"POST",headers:Zh(h({"Content-Type":"application/json"},y),"ai-sdk/".concat(Lv),Rh()),body:JSON.stringify(g),credentials:F,signal:n});case 5:if((_=e.v).ok){e.n=9;break}return b=Error,e.n=6,_.text();case 6:if(null==(s=e.v)){e.n=7;break}C=s,e.n=8;break;case 7:C="Failed to fetch the chat response.";case 8:throw new b(C);case 9:if(_.body){e.n=10;break}throw new Error("The response body is empty.");case 10:return e.a(2,this.processResponseStream(_.body))}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"reconnectToStream",value:(e=r(m().m(function e(t){var n,r,u,a,i,o,s,c,l,f,d,p,v,D,y,g,F;return m().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yh(this.body);case 1:return o=e.v,e.n=2,Yh(this.headers);case 2:return s=e.v,e.n=3,Yh(this.credentials);case 3:return c=e.v,l=h(h({},Mh(s)),Mh(t.headers)),e.n=4,null==(n=this.prepareReconnectToStreamRequest)?void 0:n.call(this,{api:this.api,id:t.chatId,body:h(h({},o),t.body),headers:l,credentials:c,requestMetadata:t.metadata});case 4:return f=e.v,d=null!=(r=null==f?void 0:f.api)?r:"".concat(this.api,"/").concat(t.chatId,"/stream"),p=void 0!==(null==f?void 0:f.headers)?Mh(f.headers):l,v=null!=(u=null==f?void 0:f.credentials)?u:c,D=null!=(a=this.fetch)?a:globalThis.fetch,e.n=5,D(d,{method:"GET",headers:Zh(p,"ai-sdk/".concat(Lv),Rh()),credentials:v});case 5:if(204!==(y=e.v).status){e.n=6;break}return e.a(2,null);case 6:if(y.ok){e.n=10;break}return g=Error,e.n=7,y.text();case 7:if(null==(i=e.v)){e.n=8;break}F=i,e.n=9;break;case 8:F="Failed to fetch the chat response.";case 9:throw new g(F);case 10:if(y.body){e.n=11;break}throw new Error("The response body is empty.");case 11:return e.a(2,this.processResponseStream(y.body))}},e,this)})),function(t){return e.apply(this,arguments)})}]);var e,t}(),Dm=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,t),u(this,t,[e])}return f(t,e),o(t,[{key:"processResponseStream",value:function(e){return function(e){var t=e.schema;return e.stream.pipeThrough(new TextDecoderStream).pipeThrough(new ts).pipeThrough(new TransformStream({transform:function(e,n){return r(m().m(function r(){var u,a;return m().w(function(r){for(;;)switch(r.n){case 0:if(u=e.data,!("[DONE]"!==u)){r.n=2;break}return a=n,r.n=1,Qh({text:u,schema:t});case 1:a.enqueue.call(a,r.v);case 2:return r.a(2)}},r)}))()}}))}({stream:e,schema:tm}).pipeThrough(new TransformStream({transform:function(e,t){return r(m().m(function n(){return m().w(function(n){for(;;)switch(n.n){case 0:if(e.success){n.n=1;break}throw e.error;case 1:t.enqueue(e.value);case 2:return n.a(2)}},n)}))()}}))}}])}(mm),ym=function(){return o(function e(t){var n=this,u=t.generateId,i=void 0===u?zh:u,o=t.id,s=void 0===o?i():o,c=t.transport,l=void 0===c?new Dm:c,f=t.messageMetadataSchema,d=t.dataPartSchemas,p=t.state,D=t.onError,y=t.onToolCall,g=t.onFinish,E=t.onData,_=t.sendAutomaticallyWhen;a(this,e),this.activeResponse=void 0,this.jobExecutor=new fm,this.sendMessage=function(){var e=r(m().m(function e(t,u){var a,i,o,s,c,l,f;return m().w(function(e){for(;;)switch(e.n){case 0:if(null!=t){e.n=2;break}return e.n=1,n.makeRequest(h({trigger:"submit-message",messageId:null==(a=n.lastMessage)?void 0:a.id},u));case 1:return e.a(2,void e.v);case 2:if(!("text"in t)&&!("files"in t)){e.n=6;break}if(!Array.isArray(t.files)){e.n=3;break}f=t.files,e.n=5;break;case 3:return e.n=4,function(){var e=r(m().m(function e(t){return m().w(function(e){for(;;)switch(e.n){case 0:if(null!=t){e.n=1;break}return e.a(2,[]);case 1:if(globalThis.FileList&&t instanceof globalThis.FileList){e.n=2;break}throw new Error("FileList is not supported in the current environment");case 2:return e.a(2,Promise.all(Array.from(t).map(function(){var e=r(m().m(function e(t){var n,r,u,a,i;return m().w(function(e){for(;;)switch(e.n){case 0:return n=t.name,r=t.type,u=r,a=n,e.n=1,new Promise(function(e,n){var r=new FileReader;r.onload=function(t){var n;e(null==(n=t.target)?void 0:n.result)},r.onerror=function(e){return n(e)},r.readAsDataURL(t)});case 1:return i=e.v,e.a(2,{type:"file",mediaType:u,filename:a,url:i})}},e)}));return function(t){return e.apply(this,arguments)}}())))}},e)}));return function(t){return e.apply(this,arguments)}}()(t.files);case 4:f=e.v;case 5:c={parts:[].concat(F(f),F("text"in t&&null!=t.text?[{type:"text",text:t.text}]:[]))},e.n=7;break;case 6:c=t;case 7:if(null==t.messageId){e.n=10;break}if(l=n.state.messages.findIndex(function(e){return e.id===t.messageId}),-1!==l){e.n=8;break}throw new Error("message with id ".concat(t.messageId," not found"));case 8:if("user"===n.state.messages[l].role){e.n=9;break}throw new Error("message with id ".concat(t.messageId," is not a user message"));case 9:n.state.messages=n.state.messages.slice(0,l+1),n.state.replaceMessage(l,h(h({},c),{},{id:t.messageId,role:null!=(i=c.role)?i:"user",metadata:t.metadata})),e.n=11;break;case 10:n.state.pushMessage(h(h({},c),{},{id:null!=(o=c.id)?o:n.generateId(),role:null!=(s=c.role)?s:"user",metadata:t.metadata}));case 11:return e.n=12,n.makeRequest(h({trigger:"submit-message",messageId:t.messageId},u));case 12:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),this.regenerate=r(m().m(function e(){var t,r,u,a,i=arguments;return m().w(function(e){for(;;)switch(e.n){case 0:if(r=(t=i.length>0&&void 0!==i[0]?i[0]:{}).messageId,u=v(t,Kt),a=null==r?n.state.messages.length-1:n.state.messages.findIndex(function(e){return e.id===r}),-1!==a){e.n=1;break}throw new Error("message ".concat(r," not found"));case 1:return n.state.messages=n.state.messages.slice(0,"assistant"===n.messages[a].role?a:a+1),e.n=2,n.makeRequest(h({trigger:"regenerate-message",messageId:r},u));case 2:return e.a(2)}},e)})),this.resumeStream=r(m().m(function e(){var t,r=arguments;return m().w(function(e){for(;;)switch(e.n){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:{},e.n=1,n.makeRequest(h({trigger:"resume-stream"},t));case 1:return e.a(2)}},e)})),this.clearError=function(){"error"===n.status&&(n.state.error=void 0,n.setStatus({status:"ready"}))},this.addToolOutput=function(){var e=r(m().m(function e(t){var u,a,i,o,s;return m().w(function(e){for(;;)if(0===e.n)return u=t.state,a=void 0===u?"output-available":u,t.tool,i=t.toolCallId,o=t.output,s=t.errorText,e.a(2,n.jobExecutor.run(r(m().m(function e(){var t,r,u,c;return m().w(function(e){for(;;)switch(e.n){case 0:u=n.state.messages,c=u[u.length-1],n.state.replaceMessage(u.length-1,h(h({},c),{},{parts:c.parts.map(function(e){return om(e)&&e.toolCallId===i?h(h({},e),{},{state:a,output:o,errorText:s}):e})})),n.activeResponse&&(n.activeResponse.state.message.parts=n.activeResponse.state.message.parts.map(function(e){return om(e)&&e.toolCallId===i?h(h({},e),{},{state:a,output:o,errorText:s}):e})),"streaming"!==n.status&&"submitted"!==n.status&&(null==(t=n.sendAutomaticallyWhen)?void 0:t.call(n,{messages:n.state.messages}))&&n.makeRequest({trigger:"submit-message",messageId:null==(r=n.lastMessage)?void 0:r.id});case 1:return e.a(2)}},e)}))))},e)}));return function(t){return e.apply(this,arguments)}}(),this.addToolResult=this.addToolOutput,this.stop=r(m().m(function e(){var t;return m().w(function(e){for(;;)switch(e.n){case 0:"streaming"!==n.status&&"submitted"!==n.status||(null==(t=n.activeResponse)?void 0:t.abortController)&&n.activeResponse.abortController.abort();case 1:return e.a(2)}},e)})),this.id=s,this.transport=l,this.generateId=i,this.messageMetadataSchema=f,this.dataPartSchemas=d,this.state=p,this.onError=D,this.onToolCall=y,this.onFinish=g,this.onData=E,this.sendAutomaticallyWhen=_},[{key:"status",get:function(){return this.state.status}},{key:"setStatus",value:function(e){var t=e.status,n=e.error;this.status!==t&&(this.state.status=t,this.state.error=n)}},{key:"error",get:function(){return this.state.error}},{key:"messages",get:function(){return this.state.messages},set:function(e){this.state.messages=e}},{key:"lastMessage",get:function(){return this.state.messages[this.state.messages.length-1]}},{key:"makeRequest",value:(e=r(m().m(function e(t){var n,u,a,i,o,s,c,l,f,d,p,h,v,D,y,g,F,E,_=this;return m().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=t.trigger,u=t.metadata,a=t.headers,i=t.body,o=t.messageId,this.setStatus({status:"submitted",error:void 0}),d=this.lastMessage,p=!1,h=!1,v=!1,e.p=1,(D={state:cm({lastMessage:this.state.snapshot(d),messageId:this.generateId()}),abortController:new AbortController}).abortController.signal.addEventListener("abort",function(){p=!0}),this.activeResponse=D,"resume-stream"!==n){e.n=4;break}return e.n=2,this.transport.reconnectToStream({chatId:this.id,metadata:u,headers:a,body:i});case 2:if(null!=(g=e.v)){e.n=3;break}return e.a(2,void this.setStatus({status:"ready"}));case 3:y=g,e.n=6;break;case 4:return e.n=5,this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:D.abortController.signal,metadata:u,headers:a,body:i,trigger:n,messageId:o});case 5:y=e.v;case 6:return F=function(e){return _.jobExecutor.run(function(){return e({state:D.state,write:function(){var e;_.setStatus({status:"streaming"}),D.state.message.id===(null==(e=_.lastMessage)?void 0:e.id)?_.state.replaceMessage(_.state.messages.length-1,D.state.message):_.state.pushMessage(D.state.message)}})})},e.n=7,function(){var e=r(m().m(function e(t){var n,r,u,a;return m().w(function(e){for(;;)switch(e.p=e.n){case 0:n=t.stream,r=t.onError,u=n.getReader(),e.p=1;case 2:return e.n=3,u.read();case 3:if(!e.v.done){e.n=4;break}return e.a(3,5);case 4:e.n=2;break;case 5:e.n=7;break;case 6:e.p=6,a=e.v,null==r||r(a);case 7:return e.p=7,u.releaseLock(),e.f(7);case 8:return e.a(2)}},e,null,[[1,6,7,8]])}));return function(t){return e.apply(this,arguments)}}()({stream:lm({stream:y,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:F,onError:function(e){throw e}}),onError:function(e){throw e}});case 7:this.setStatus({status:"ready"}),e.n=10;break;case 8:if(e.p=8,E=e.v,!p&&"AbortError"!==E.name){e.n=9;break}return e.a(2,(p=!0,this.setStatus({status:"ready"}),null));case 9:v=!0,E instanceof TypeError&&(E.message.toLowerCase().includes("fetch")||E.message.toLowerCase().includes("network"))&&(h=!0),this.onError&&E instanceof Error&&this.onError(E),this.setStatus({status:"error",error:E});case 10:e.p=10;try{null==(c=this.onFinish)||c.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:p,isDisconnect:h,isError:v,finishReason:null==(s=this.activeResponse)?void 0:s.state.finishReason})}catch(e){console.error(e)}return this.activeResponse=void 0,e.f(10);case 11:if(!(null==(l=this.sendAutomaticallyWhen)?void 0:l.call(this,{messages:this.state.messages}))||v){e.n=12;break}return e.n=12,this.makeRequest({trigger:"submit-message",messageId:null==(f=this.lastMessage)?void 0:f.id,metadata:u,headers:a,body:i});case 12:return e.a(2)}},e,this,[[1,8,10,11]])})),function(t){return e.apply(this,arguments)})}]);var e}();function gm(e){var t=e.messages,n=t[t.length-1];if(!n)return!1;if("assistant"!==n.role)return!1;var r=n.parts.reduce(function(e,t,n){return"step-start"===t.type?n:e},-1),u=n.parts.slice(r+1).filter(om).filter(function(e){return!e.providerExecuted});return u.length>0&&u.every(function(e){return"output-available"===e.state||"output-error"===e.state})}var Fm,Em,_m,bm,Cm,km,Am,wm,Sm,xm,Om=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((pm||(pm=1,dm=function(e,t){if("function"!=typeof e)throw new TypeError("Expected the first argument to be a `function`, got `".concat(En(e),"`."));var n,r=0;return function(){for(var u=this,a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];clearTimeout(n);var s=Date.now(),c=t-(s-r);c<=0?(r=s,e.apply(this,i)):n=setTimeout(function(){r=Date.now(),e.apply(u,i)},c)}}),dm)),Bm=function(e,t,n){if(!t.has(e))throw TypeError("Cannot "+n)},Im=function(e,t,n){return Bm(e,t,"read from private field"),n?n.call(e):t.get(e)},Tm=function(e,t,n){if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Pm=function(e,t,n,r){return Bm(e,t,"write to private field"),t.set(e,n),n},jm=function(){return o(function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];a(this,e),Tm(this,Fm,void 0),Tm(this,Em,"ready"),Tm(this,_m,void 0),Tm(this,bm,new Set),Tm(this,Cm,new Set),Tm(this,km,new Set),this.pushMessage=function(e){Pm(t,Fm,Im(t,Fm).concat(e)),Im(t,Am).call(t)},this.popMessage=function(){Pm(t,Fm,Im(t,Fm).slice(0,-1)),Im(t,Am).call(t)},this.replaceMessage=function(e,n){Pm(t,Fm,[].concat(F(Im(t,Fm).slice(0,e)),[t.snapshot(n)],F(Im(t,Fm).slice(e+1)))),Im(t,Am).call(t)},this.snapshot=function(e){return structuredClone(e)},this["~registerMessagesCallback"]=function(e,n){var r,u,a=n?(r=e,null!=(u=n)?Om(r,u):r):e;return Im(t,bm).add(a),function(){Im(t,bm).delete(a)}},this["~registerStatusCallback"]=function(e){return Im(t,Cm).add(e),function(){Im(t,Cm).delete(e)}},this["~registerErrorCallback"]=function(e){return Im(t,km).add(e),function(){Im(t,km).delete(e)}},Tm(this,Am,function(){Im(t,bm).forEach(function(e){return e()})}),Tm(this,wm,function(){Im(t,Cm).forEach(function(e){return e()})}),Tm(this,Sm,function(){Im(t,km).forEach(function(e){return e()})}),Pm(this,Fm,n)},[{key:"status",get:function(){return Im(this,Em)},set:function(e){Pm(this,Em,e),Im(this,wm).call(this)}},{key:"error",get:function(){return Im(this,_m)},set:function(e){Pm(this,_m,e),Im(this,Sm).call(this)}},{key:"messages",get:function(){return Im(this,Fm)},set:function(e){Pm(this,Fm,F(e)),Im(this,Am).call(this)}}])}();Fm=new WeakMap,Em=new WeakMap,_m=new WeakMap,bm=new WeakMap,Cm=new WeakMap,km=new WeakMap,Am=new WeakMap,wm=new WeakMap,Sm=new WeakMap;var Nm=function(e){function n(e){var r,i=e.messages,o=v(e,Jt);a(this,n);var s=new jm(i);return r=u(this,n,[h(h({},o),{},{state:s})]),Tm(t(r),xm,void 0),r["~registerMessagesCallback"]=function(e,n){return Im(t(r),xm)["~registerMessagesCallback"](e,n)},r["~registerStatusCallback"]=function(e){return Im(t(r),xm)["~registerStatusCallback"](e)},r["~registerErrorCallback"]=function(e){return Im(t(r),xm)["~registerErrorCallback"](e)},Pm(t(r),xm,s),r}return f(n,e),o(n)}(ym);xm=new WeakMap;var zm="askai_token",Rm=function(e){return"https://".concat(e,".algolia.net/agent-studio/1")},Mm=function(e){if(!e)return!0;try{var t=function(e){var t=yn(e.split("."),1)[0];return JSON.parse(atob(t))}(e),n=t.exp;return Date.now()/1e3>n-30}catch(e){return!0}},Zm=null,Lm=function(){var e=Xt(vn().m(function e(t){var n,r,u,a,i,o;return vn().w(function(e){for(;;)switch(e.n){case 0:if(n=t.assistantId,r=t.abortSignal,u=t.useStagingEnv,a=void 0!==u&&u,i=sessionStorage.getItem(zm),Mm(i)){e.n=1;break}return e.a(2,i);case 1:return o=a?Yu:Gu,Zm||(Zm=fetch("".concat(o,"/token"),{method:"POST",headers:{"x-algolia-assistant-id":n,"content-type":"application/json"},signal:r}).then(function(e){return e.json()}).then(function(e){var t=e.token,n=e.success,r=e.message;if(!n&&r)throw new Error(r);return sessionStorage.setItem(zm,t),t}).finally(function(){return Zm=null})),e.a(2,Zm)}},e)}));return function(t){return e.apply(this,arguments)}}(),$m=function(){var e=Xt(vn().m(function e(t){var n,r,u,a,i,o,s,c,l,f;return vn().w(function(e){for(;;)switch(e.n){case 0:return n=t.assistantId,r=t.thumbs,u=t.messageId,a=t.appId,i=t.abortSignal,o=t.useStagingEnv,s=void 0!==o&&o,(c=new Headers).set("x-algolia-assistant-id",n),c.set("content-type","application/json"),e.n=1,Lm({assistantId:n,abortSignal:i,useStagingEnv:s});case 1:return l=e.v,c.set("authorization","TOKEN ".concat(l)),f=s?Yu:Gu,e.a(2,fetch("".concat(f,"/feedback"),{method:"POST",body:JSON.stringify({appId:a,messageId:u,thumbs:r}),headers:c}))}},e)}));return function(t){return e.apply(this,arguments)}}(),qm=function(e){var t=e.agentId,n=e.vote,r=e.messageId,u=e.appId,a=e.apiKey,i=e.abortSignal,o=new Headers;o.set("x-algolia-application-id",u),o.set("x-algolia-api-key",a),o.set("content-type","application/json");var s="".concat(Rm(u),"/feedback");return fetch(s,{method:"POST",body:JSON.stringify({messageId:r,agentId:t,vote:n}),headers:o,signal:i})},Um=["assistantId","apiKey","appId","indexName","useStagingEnv"];function Hm(e){var t,n="algolia-client-js-".concat(e.key);function r(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function u(){return JSON.parse(r().getItem(n)||"{}")}function a(e){r().setItem(n,JSON.stringify(e))}return{get:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){var n,r,i;return n=e.timeToLive?1e3*e.timeToLive:null,r=u(),a(i=Object.fromEntries(Object.entries(r).filter(function(e){return void 0!==yn(e,2)[1].timestamp}))),n&&a(Object.fromEntries(Object.entries(i).filter(function(e){var t=yn(e,2)[1],r=(new Date).getTime();return!(t.timestamp+n<r)}))),u()[JSON.stringify(t)]}).then(function(e){return Promise.all([e?e.value:n(),void 0!==e])}).then(function(e){var t=yn(e,2),n=t[0],u=t[1];return Promise.all([n,u||r.miss(n)])}).then(function(e){return yn(e,1)[0]})},set:function(e,t){return Promise.resolve().then(function(){var a=u();return a[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},r().setItem(n,JSON.stringify(a)),t})},delete:function(e){return Promise.resolve().then(function(){var t=u();delete t[JSON.stringify(e)],r().setItem(n,JSON.stringify(t))})},clear:function(){return Promise.resolve().then(function(){r().removeItem(n)})}}}function Vm(e){var t=gn(e.caches),n=t.shift();return void 0===n?{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then(function(e){return Promise.all([e,n.miss(e)])}).then(function(e){return yn(e,1)[0]})},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,r){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return n.get(e,r,u).catch(function(){return Vm({caches:t}).get(e,r,u)})},set:function(e,r){return n.set(e,r).catch(function(){return Vm({caches:t}).set(e,r)})},delete:function(e){return n.delete(e).catch(function(){return Vm({caches:t}).delete(e)})},clear:function(){return n.clear().catch(function(){return Vm({caches:t}).clear()})}}}function Wm(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(n,r){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(n);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var i=r();return i.then(function(e){return u.miss(e)}).then(function(){return i})},set:function(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function Km(e){var t=e.algoliaAgents,n=e.client,r=e.version,u=function(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var n="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(n)&&(t.value="".concat(t.value).concat(n)),t}};return t}(r).add({segment:n,version:r});return t.forEach(function(e){return u.add(e)}),u}var Jm=12e4;function Qm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"up",n=Date.now();return pn(pn({},e),{},{status:t,lastUpdate:n,isUp:function(){return"up"===t||Date.now()-n>Jm},isTimedOut:function(){return"timed out"===t&&Date.now()-n<=Jm}})}var Gm=function(){function e(t,n){var r;return tn(this,e),on(r=en(this,e,[t]),"name","AlgoliaError"),n&&(r.name=n),r}return ln(e,bn(Error)),un(e)}(),Ym=function(){function e(t,n,r){var u;return tn(this,e),on(u=en(this,e,[t,r]),"stackTrace",void 0),u.stackTrace=n,u}return ln(e,Gm),un(e)}(),Xm=function(){function e(t){return tn(this,e),en(this,e,["Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",t,"RetryError"])}return ln(e,Ym),un(e)}(),eD=function(){function e(t,n,r){var u,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"ApiError";return tn(this,e),on(u=en(this,e,[t,r,a]),"status",void 0),u.status=n,u}return ln(e,Ym),un(e)}(),tD=function(){function e(t,n){var r;return tn(this,e),on(r=en(this,e,[t,"DeserializationError"]),"response",void 0),r.response=n,r}return ln(e,Gm),un(e)}(),nD=function(){function e(t,n,r,u){var a;return tn(this,e),on(a=en(this,e,[t,n,u,"DetailedApiError"]),"error",void 0),a.error=r,a}return ln(e,eD),un(e)}();function rD(e,t,n){var r,u=(r=n,Object.keys(r).filter(function(e){return void 0!==r[e]}).sort().map(function(e){return"".concat(e,"=").concat(encodeURIComponent("[object Array]"===Object.prototype.toString.call(r[e])?r[e].join(","):r[e]).replace(/\+/g,"%20"))}).join("&")),a="".concat(e.protocol,"://").concat(e.url).concat(e.port?":".concat(e.port):"","/").concat("/"===t.charAt(0)?t.substring(1):t);return u.length&&(a+="?".concat(u)),a}function uD(e,t){if("GET"!==e.method&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:pn(pn({},e.data),t.data);return JSON.stringify(n)}}function aD(e,t,n){var r=pn(pn(pn({Accept:"application/json"},e),t),n),u={};return Object.keys(r).forEach(function(e){var t=r[e];u[e.toLowerCase()]=t}),u}function iD(e){try{return JSON.parse(e.content)}catch(t){throw new tD(t.message,e)}}function oD(e,t){var n=e.content,r=e.status;try{var u=JSON.parse(n);return"error"in u?new nD(u.message,r,u.error,t):new eD(u.message,r,t)}catch(e){}return new eD(n,r,t)}function sD(e){var t=e.isTimedOut,n=e.status;return t||function(e){return!e.isTimedOut&&0===~~e.status}({isTimedOut:t,status:n})||2!=~~(n/100)&&4!=~~(n/100)}function cD(e){return 2==~~(e.status/100)}function lD(e){return e.map(function(e){return fD(e)})}function fD(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return pn(pn({},e),{},{request:pn(pn({},e.request),{},{headers:pn(pn({},e.request.headers),t)})})}var dD=["appId","apiKey","authMode","algoliaAgents"],pD=["params"],hD="5.43.0";function vD(e){return[{url:"".concat(e,"-dsn.algolia.net"),accept:"read",protocol:"https"},{url:"".concat(e,".algolia.net"),accept:"write",protocol:"https"}].concat(function(e){for(var t=e,n=e.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1)),u=e[n];t[n]=e[r],t[r]=u}return t}([{url:"".concat(e,"-1.algolianet.com"),accept:"readWrite",protocol:"https"},{url:"".concat(e,"-2.algolianet.com"),accept:"readWrite",protocol:"https"},{url:"".concat(e,"-3.algolianet.com"),accept:"readWrite",protocol:"https"}]))}var mD="4.6.2";function DD(e,t,n){var r=It.useMemo(function(){var r=function(e,t){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!t||"string"!=typeof t)throw new Error("`apiKey` is missing.");return function(e){var t=e.appId,n=e.apiKey,r=e.authMode,u=e.algoliaAgents,a=hn(e,dD),i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"WithinHeaders",r={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:function(){return"WithinHeaders"===n?r:{}},queryParameters:function(){return"WithinQueryParameters"===n?r:{}}}}(t,n,r),o=function(e){var t=e.hosts,n=e.hostsCache,r=e.baseHeaders,u=e.logger,a=e.baseQueryParameters,i=e.algoliaAgent,o=e.timeouts,s=e.requester,c=e.requestsCache,l=e.responsesCache;function f(e){return d.apply(this,arguments)}function d(){return(d=Xt(vn().m(function e(t){var r,u,a,i,o;return vn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Promise.all(t.map(function(e){return n.get(e,function(){return Promise.resolve(Qm(e))})}));case 1:return r=e.v,u=r.filter(function(e){return e.isUp()}),a=r.filter(function(e){return e.isTimedOut()}),i=[].concat(gn(u),gn(a)),o=i.length>0?i:t,e.a(2,{hosts:o,getTimeout:function(e,t){return(0===a.length&&0===e?1:a.length+3+e)*t}})}},e)}))).apply(this,arguments)}function p(e,t){return h.apply(this,arguments)}function h(){return h=Xt(vn().m(function e(c,l){var d,p,h,v,m,D,y,g,F,E,_,b,C,k=arguments;return vn().w(function(e){for(;;)switch(e.n){case 0:if(d=!(k.length>2&&void 0!==k[2])||k[2],p=[],h=uD(c,l),v=aD(r,c.headers,l.headers),m="GET"===c.method?pn(pn({},c.data),l.data):{},D=pn(pn(pn({},a),c.queryParameters),m),i.value&&(D["x-algolia-agent"]=i.value),l&&l.queryParameters)for(y=0,g=Object.keys(l.queryParameters);y<g.length;y++)F=g[y],l.queryParameters[F]&&"[object Object]"!==Object.prototype.toString.call(l.queryParameters[F])?D[F]=l.queryParameters[F].toString():D[F]=l.queryParameters[F];return E=0,_=function(){var e=Xt(vn().m(function e(t,r){var a,i,f,m,y,g;return vn().w(function(e){for(;;)switch(e.n){case 0:if(void 0!==(a=t.pop())){e.n=1;break}throw new Xm(lD(p));case 1:return i=pn(pn({},o),l.timeouts),f={data:h,headers:v,method:c.method,url:rD(a,c.path,D),connectTimeout:r(E,i.connect),responseTimeout:r(E,d?i.read:i.write)},m=function(e){var n={request:f,response:e,host:a,triesLeft:t.length};return p.push(n),n},e.n=2,s.send(f);case 2:if(!sD(y=e.v)){e.n=4;break}return g=m(y),y.isTimedOut&&E++,u.info("Retryable failure",fD(g)),e.n=3,n.set(a,Qm(a,y.isTimedOut?"timed out":"down"));case 3:return e.a(2,_(t,r));case 4:if(!cD(y)){e.n=5;break}return e.a(2,iD(y));case 5:throw m(y),oD(y,p);case 6:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),b=t.filter(function(e){return"readWrite"===e.accept||(d?"read"===e.accept:"write"===e.accept)}),e.n=1,f(b);case 1:return C=e.v,e.a(2,_(gn(C.hosts).reverse(),C.getTimeout))}},e)})),h.apply(this,arguments)}return{hostsCache:n,requester:s,timeouts:o,logger:u,algoliaAgent:i,baseHeaders:r,baseQueryParameters:a,hosts:t,request:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.useReadTransporter||"GET"===e.method;if(!n)return p(e,t,n);var u=function(){return p(e,t)};if(!0!==(t.cacheable||e.cacheable))return u();var i={request:e,requestOptions:t,transporter:{queryParameters:a,headers:r}};return l.get(i,function(){return c.get(i,function(){return c.set(i,u()).then(function(e){return Promise.all([c.delete(i),e])},function(e){return Promise.all([c.delete(i),Promise.reject(e)])}).then(function(e){var t=yn(e,2);return t[0],t[1]})})},{miss:function(e){return l.set(i,e)}})},requestsCache:c,responsesCache:l}}(pn(pn({hosts:vD(t)},a),{},{algoliaAgent:Km({algoliaAgents:u,client:"Lite",version:hD}),baseHeaders:pn(pn({"content-type":"text/plain"},i.headers()),a.baseHeaders),baseQueryParameters:pn(pn({},i.queryParameters()),a.baseQueryParameters)}));return{transporter:o,appId:t,apiKey:n,clearCache:function(){return Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then(function(){})},get _ua(){return o.algoliaAgent.value},addAlgoliaAgent:function(e,t){o.algoliaAgent.add({segment:e,version:t})},setClientApiKey:function(e){var t=e.apiKey;r&&"WithinHeaders"!==r?o.baseQueryParameters["x-algolia-api-key"]=t:o.baseHeaders["x-algolia-api-key"]=t},searchForHits:function(e,t){return this.search(e,t)},searchForFacets:function(e,t){return this.search(e,t)},customPost:function(e,t){var n=e.path,r=e.parameters,u=e.body;if(!n)throw new Error("Parameter `path` is required when calling `customPost`.");var a={method:"POST",path:"/{path}".replace("{path}",n),queryParameters:r||{},headers:{},data:u||{}};return o.request(a,t)},getRecommendations:function(e,t){if(e&&Array.isArray(e)&&(e={requests:e}),!e)throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!e.requests)throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");var n={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return o.request(n,t)},search:function(e,t){if(e&&Array.isArray(e)){var n={requests:e.map(function(e){var t=e.params,n=hn(e,pD);return"facet"===n.type?pn(pn(pn({},n),t),{},{type:"facet"}):pn(pn(pn({},n),t),{},{facet:void 0,maxFacetHits:void 0,facetQuery:void 0})})};e=n}if(!e)throw new Error("Parameter `searchMethodParams` is required when calling `search`.");if(!e.requests)throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");var r={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return o.request(r,t)}}}(pn({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:{debug:function(e,t){return Promise.resolve()},info:function(e,t){return Promise.resolve()},error:function(e,t){return Promise.resolve()}},requester:{send:function(e){return new Promise(function(t){var n=new XMLHttpRequest;n.open(e.method,e.url,!0),Object.keys(e.headers).forEach(function(t){return n.setRequestHeader(t,e.headers[t])});var r,u=function(e,r){return setTimeout(function(){n.abort(),t({status:0,content:r,isTimedOut:!0})},e)},a=u(e.connectTimeout,"Connection timeout");n.onreadystatechange=function(){n.readyState>n.OPENED&&void 0===r&&(clearTimeout(a),r=u(e.responseTimeout,"Socket timeout"))},n.onerror=function(){0===n.status&&(clearTimeout(a),clearTimeout(r),t({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=function(){clearTimeout(a),clearTimeout(r),t({content:n.responseText,status:n.status,isTimedOut:!1})},n.send(e.data)})}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:Wm(),requestsCache:Wm({serializable:!1}),hostsCache:Vm({caches:[Hm({key:"".concat(hD,"-").concat(e)}),Wm()]})},void 0))}(e,t);return r.addAlgoliaAgent("docsearch",mD),!1===/docsearch.js \(.*\)/.test(r.transporter.algoliaAgent.value)&&r.addAlgoliaAgent("docsearch-react",mD),n(r)},[e,t,n]);return r}var yD=["appId","apiKey","askAi","maxResultsPerGroup","theme","onClose","transformItems","hitComponent","resultsFooterComponent","navigator","initialScrollY","transformSearchClient","disableUserPersonalization","initialQuery","translations","getMissingResultsUrl","insights","onAskAiToggle","interceptAskAiEvent","isAskAiActive","recentSearchesLimit","recentSearchesWithFavoritesLimit","indices","indexName","searchParameters","isHybridModeSupported"],gD=["footer","searchBox"],FD=function(){var e=Xt(vn().m(function e(t){var n,r,u,a,i,o,s,c,l,f,d,p,h,v,m,D,y,g,F;return vn().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=t.query,r=t.state,u=t.setContext,a=t.setStatus,i=t.searchClient,o=t.indexes,s=t.snippetLength,c=t.insights,l=t.appId,f=t.apiKey,d=t.maxResultsPerGroup,p=t.transformItems,h=void 0===p?xn:p,v=t.saveRecentSearch,m=t.onClose,D=c,e.p=1,e.n=2,i.search({requests:o.map(function(e){var t,r,u,a,i,o,c,l="string"==typeof e?e:e.name,f="string"==typeof e?{}:e.searchParameters;return pn({query:n,indexName:l,attributesToRetrieve:null!==(t=null==f?void 0:f.attributesToRetrieve)&&void 0!==t?t:["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"],attributesToSnippet:null!==(r=null==f?void 0:f.attributesToSnippet)&&void 0!==r?r:["hierarchy.lvl1:".concat(s.current),"hierarchy.lvl2:".concat(s.current),"hierarchy.lvl3:".concat(s.current),"hierarchy.lvl4:".concat(s.current),"hierarchy.lvl5:".concat(s.current),"hierarchy.lvl6:".concat(s.current),"content:".concat(s.current)],snippetEllipsisText:null!==(u=null==f?void 0:f.snippetEllipsisText)&&void 0!==u?u:"…",highlightPreTag:null!==(a=null==f?void 0:f.highlightPreTag)&&void 0!==a?a:"<mark>",highlightPostTag:null!==(i=null==f?void 0:f.highlightPostTag)&&void 0!==i?i:"</mark>",hitsPerPage:null!==(o=null==f?void 0:f.hitsPerPage)&&void 0!==o?o:20,clickAnalytics:null!==(c=null==f?void 0:f.clickAnalytics)&&void 0!==c?c:D},null!=f?f:{})})});case 2:return y=e.v,g=y.results,e.a(2,g.flatMap(function(e){var t,n=e,a=n.hits,i=n.nbHits,o=Sn(h(a),function(e){return jn(e)},d);if(r.context.searchSuggestions.length<Object.keys(o).length&&u({searchSuggestions:pn(pn({},null!==(t=r.context.searchSuggestions)&&void 0!==t?t:[]),Object.keys(o))}),i){var s=r.context.nbHits;u({nbHits:(null!=s?s:0)+i})}var c={};return D&&(c={__autocomplete_indexName:n.index,__autocomplete_queryID:n.queryID,__autocomplete_algoliaCredentials:{appId:l,apiKey:f}}),Object.values(o).map(function(e,t){return{sourceId:"hits_".concat(n.index,"_").concat(t),onSelect:function(e){var t=e.item,n=e.event;v(t),On(n)||m()},getItemUrl:function(e){return e.item.url},getItems:function(){return Object.values(Sn(e,function(e){return e.hierarchy.lvl1},d)).map(function(e){return e.map(function(t){var n=null,r=e.find(function(e){return"lvl1"===e.type&&e.hierarchy.lvl1===t.hierarchy.lvl1});return"lvl1"!==t.type&&r&&(n=r),pn(pn({},t),{},{__docsearch_parent:n},c)})}).flat()}}})}));case 3:throw e.p=3,"RetryError"===(F=e.v).name&&a("error"),F;case 4:return e.a(2)}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}();function ED(e){var t,n,r,u,a=e.appId,i=e.apiKey,o=e.askAi,s=e.maxResultsPerGroup,c=e.theme,l=e.onClose,f=void 0===l?In:l,d=e.transformItems,p=void 0===d?xn:d,h=e.hitComponent,m=void 0===h?na:h,D=e.resultsFooterComponent,y=void 0===D?function(){return null}:D,g=e.navigator,F=e.initialScrollY,E=void 0===F?0:F,_=e.transformSearchClient,b=void 0===_?xn:_,C=e.disableUserPersonalization,k=void 0!==C&&C,A=e.initialQuery,w=void 0===A?"":A,S=e.translations,x=void 0===S?{}:S,O=e.getMissingResultsUrl,B=e.insights,I=void 0!==B&&B,T=e.onAskAiToggle,P=e.interceptAskAiEvent,j=e.isAskAiActive,N=void 0!==j&&j,z=e.recentSearchesLimit,R=void 0===z?7:z,M=e.recentSearchesWithFavoritesLimit,Z=void 0===M?4:M,L=e.indices,$=void 0===L?[]:L,q=e.indexName,U=e.searchParameters,H=e.isHybridModeSupported,V=void 0!==H&&H,W=hn(e,yD),K=x.footer,J=x.searchBox,Q=hn(x,gD),G=yn(It.useState({query:"",collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:"idle"}),2),Y=G[0],X=G[1],ee=Boolean(o),te=(null==x||null===(t=x.searchBox)||void 0===t?void 0:t.placeholderText)||W.placeholder||"Search docs";ee&&(te=(null==x||null===(r=x.searchBox)||void 0===r?void 0:r.placeholderText)||"Search docs or ask AI a question"),N&&(te=(null==x||null===(u=x.searchBox)||void 0===u?void 0:u.placeholderTextAskAi)||"Ask another question...");var ne=It.useRef(null),re=It.useRef(null),ue=It.useRef(null),ae=It.useRef(null),ie=It.useRef(null),oe=It.useRef(15),se=It.useRef("undefined"!=typeof window?window.getSelection().toString().slice(0,512):"").current,ce=It.useRef(w||se).current,le=DD(a,i,b),fe="object"===En(o)?o:null,de="string"==typeof o?o:(null==fe?void 0:fe.assistantId)||null,pe=null==fe?void 0:fe.searchParameters,he=(null==fe?void 0:fe.useStagingEnv)||!1,ve=yn(It.useState("initial"),2),me=ve[0],De=ve[1],ye=function(e){var t=e.assistantId,n=e.searchClient,r=e.suggestedQuestionsEnabled,u=void 0!==r&&r,a=yn(Se([]),2),i=a[0],o=a[1];return Oe(function(){var e=function(){var e=Xt(vn().m(function e(){var r,u,a;return vn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n.search({requests:[{indexName:"algolia_ask_ai_suggested_questions",filters:"state:published AND assistantId:".concat(t),hitsPerPage:3}]});case 1:r=e.v,u=r.results,a=u[0],o(a.hits);case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();u&&t&&""!==t&&e()},[u,t,n]),i}({assistantId:de,searchClient:le,suggestedQuestionsEnabled:null==fe?void 0:fe.suggestedQuestions}),ge=null!==(n=null==fe?void 0:fe.agentStudio)&&void 0!==n&&n,Fe=[];if(q&&""!==q&&Fe.push({name:q,searchParameters:U}),$.length>0&&$.forEach(function(e){Fe.push("string"==typeof e?{name:e}:e)}),Fe.length<1)throw new Error("Must supply either `indexName` or `indices` for DocSearch to work");var Ee=Fe[0].name,_e=It.useRef(Bo({key:"__DOCSEARCH_FAVORITE_SEARCHES__".concat(Ee),limit:10})).current,be=It.useRef(Bo({key:"__DOCSEARCH_RECENT_SEARCHES__".concat(Ee),limit:0===_e.getAll().length?R:Z})).current,Ce=yn(It.useState(!1),2),ke=Ce[0],Ae=Ce[1],we=function(e){var t=e.assistantId,n=e.apiKey,r=e.appId,u=e.indexName,a=e.useStagingEnv,i=void 0!==a&&a,o=hn(e,Um),s=Ie(new AbortController),c=Pe(function(){return o.agentStudio?function(e){var t=e.appId,n=e.apiKey,r=e.assistantId,u=e.searchParameters;return new Dm({api:"".concat(Rm(t),"/agents/").concat(r,"/completions?stream=true&compatibilityMode=ai-sdk-5"),headers:{"x-algolia-application-id":t,"x-algolia-api-key":n},body:u?{algolia:{searchParameters:u}}:{}})}({apiKey:n,appId:r,assistantId:null!=t?t:"",searchParameters:o.searchParameters}):function(e){var t,n=e.assistantId,r=e.apiKey,u=e.indexName,a=e.searchParameters,i=e.appId,o=e.abortController,s=e.useStagingEnv;return new Dm({api:s?Yu:Gu,headers:(t=Xt(vn().m(function e(){var t;return vn().w(function(e){for(;;)switch(e.n){case 0:if(n){e.n=1;break}throw new Error("Ask AI assistant ID is required");case 1:return e.n=2,Lm({assistantId:n,abortSignal:o.signal,useStagingEnv:s});case 2:return t=e.v,e.a(2,pn(pn({},t?{authorization:"TOKEN ".concat(t)}:{}),{},{"X-Algolia-API-Key":r,"X-Algolia-Application-Id":i,"X-Algolia-Index-Name":u,"X-Algolia-Assistant-Id":n||"","X-AI-SDK-Version":"v5"}))}},e)})),function(){return t.apply(this,arguments)}),body:a?{searchParameters:a}:{}})}({assistantId:null!=t?t:"",apiKey:n,appId:r,indexName:u,searchParameters:o.searchParameters,abortController:s.current,useStagingEnv:i})},[n,r,t,u,i,o]),l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.experimental_throttle,n=e.resume,r=void 0!==n&&n,u=v(e,Qt),a=Ie("chat"in u?u.chat:new Nm(u));("chat"in u&&u.chat!==a.current||"id"in u&&a.current.id!==u.id)&&(a.current="chat"in u?u.chat:new Nm(u));var i="id"in u?u.id:null,o=je(function(e){return a.current["~registerMessagesCallback"](e,t)},[t,i]),s=Ve(o,function(){return a.current.messages}),c=Ve(a.current["~registerStatusCallback"],function(){return a.current.status}),l=Ve(a.current["~registerErrorCallback"],function(){return a.current.error}),f=je(function(e){"function"==typeof e&&(e=e(a.current.messages)),a.current.messages=e},[a]);return Oe(function(){r&&a.current.resumeStream()},[r,a]),{id:a.current.id,messages:s,setMessages:f,sendMessage:a.current.sendMessage,regenerate:a.current.regenerate,clearError:a.current.clearError,stop:a.current.stop,error:l,resumeStream:a.current.resumeStream,status:c,addToolResult:a.current.addToolOutput,addToolOutput:a.current.addToolOutput}}({sendAutomaticallyWhen:gm,transport:c}),f=l.messages,d=l.sendMessage,p=l.status,h=l.setMessages,m=l.error,D=l.stop,y=Ie(function(e){var t=e.limit,n=void 0===t?5:t,r=xo(e.key),u=r.getItem().slice(0,n);return{add:function(e){var t=e.objectID,a=e.query,i=u.findIndex(function(e){return e.objectID===t||e.query===a});i>-1?u[i]=e:(u.unshift(e),u=u.slice(0,n)),r.setItem(u)},addFeedback:function(e,t){var n=u.find(function(t){var n;return null===(n=t.messages)||void 0===n?void 0:n.some(function(t){return t.id===e})});if(n&&n.messages){var a=n.messages.find(function(t){return t.id===e});a&&(a.feedback=t,r.setItem(u))}},getOne:function(e){var t,n=u.find(function(t){var n;return null===(n=t.messages)||void 0===n?void 0:n.some(function(t){return t.id===e})});return null==n||null===(t=n.messages)||void 0===t?void 0:t.find(function(t){return t.id===e})},getAll:function(){return u},remove:function(e){u=u.filter(function(t){return t.objectID!==e.objectID}),r.setItem(u)},getConversation:function(e){var t=u.find(function(t){var n;return null===(n=t.messages)||void 0===n?void 0:n.some(function(t){return t.id===e})});if(t&&t.messages)return t}}}({key:"__DOCSEARCH_ASKAI_CONVERSATIONS__".concat(u),limit:10})).current,g=je(function(){var e=Xt(vn().m(function e(u,a){var c;return vn().w(function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}return e.a(2);case 1:return e.n=2,o.agentStudio?qm({agentId:t,vote:a,messageId:u,appId:r,apiKey:n,abortSignal:s.current.signal}):$m({assistantId:t,thumbs:a,messageId:u,appId:r,abortSignal:s.current.signal,useStagingEnv:i});case 2:if(!(e.v.status>=300)){e.n=3;break}throw new Error("Failed, try again later.");case 3:null===(c=y.addFeedback)||void 0===c||c.call(y,u,1===a?"like":"dislike");case 4:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),[t,o.agentStudio,r,n,i,y]),F=function(){var e=Xt(vn().m(function e(){return vn().w(function(e){for(;;)switch(e.n){case 0:return s.current.abort(),e.n=1,D();case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),E=Pe(function(){for(var e=[],t=0;t<f.length;t++)if("user"===f[t].role){var n,r=f[t],u="assistant"===(null===(n=f[t+1])||void 0===n?void 0:n.role)?f[t+1]:null;e.push({id:r.id,userMessage:r,assistantMessage:u}),u&&t++}return e},[f]),_="streaming"===p||"submitted"===p,b=Pe(function(){if(m)return o.agentStudio?function(e){var t=e.message;try{var n=JSON.parse(e.message);if("ValidationError"===n.name){var r=n;if(r.detail&&r.detail.length>0){var u=r.detail[0],a=u.msg,i=u.loc.at(-1);t="".concat(a,": ").concat(i)}}else t=n.message}catch(e){}return new Error(t)}(m):m},[m,o.agentStudio]);return{messages:f,sendMessage:d,status:p,setMessages:h,askAiError:b,stopAskAiStreaming:F,isStreaming:_,exchanges:E,conversations:y,sendFeedback:g}}({assistantId:de,apiKey:(null==fe?void 0:fe.apiKey)||i,appId:(null==fe?void 0:fe.appId)||a,indexName:(null==fe?void 0:fe.indexName)||Ee,searchParameters:pe,useStagingEnv:he,agentStudio:ge}),xe=we.messages,Be=we.status,Te=we.setMessages,Ne=we.sendMessage,ze=we.stopAskAiStreaming,Re=we.askAiError,Me=we.sendFeedback,Ze=we.conversations,Le=It.useRef(Be);It.useEffect(function(){if(!k){if("streaming"===Le.current&&"ready"===Be){ke&&xe.at(-1)&&(xe.at(-1).metadata={stopped:!0});var e,t=an(xe[0].parts);try{for(t.s();!(e=t.n()).done;){var n=e.value;"text"===n.type&&Ze.add($i(n.text,xe))}}catch(e){t.e(e)}finally{t.f()}}Le.current=Be}},[Be,xe,Ze,k,ke]);var $e=It.useMemo(function(){return"error"===Be&&Ui(Re)},[Be,Re]),qe=It.useCallback(function(e){var t=e.hierarchy,n=["lvl6","lvl5","lvl4","lvl3","lvl2","lvl1","lvl0"].find(function(e){return t[e]});return pn(pn({},e),{},{type:n||"lvl0",content:null})},[]),Ue=It.useCallback(function(e){if(!k){var t="content"===e.type?e.__docsearch_parent||qe(e):e;t&&-1===_e.getAll().findIndex(function(e){return e.objectID===t.objectID})&&be.add(t)}},[_e,be,k,qe]),He=It.useCallback(function(e){if(Y.context.algoliaInsightsPlugin&&e.__autocomplete_id){var t=e,n={eventName:"Item Selected",index:t.__autocomplete_indexName,items:[t],positions:[e.__autocomplete_id],queryID:t.__autocomplete_queryID};Y.context.algoliaInsightsPlugin.insights.clickedObjectIDsAfterSearch(n)}},[Y.context.algoliaInsightsPlugin]),We=It.useRef(void 0),Ke=It.useCallback(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(e){var r={query:t,suggestedQuestionId:null==n?void 0:n.objectID};if(null!=P&&P(r))return void(We.current&&We.current.setQuery(""))}if(e&&"new-conversation"===me&&De("initial"),T(e,{query:t,suggestedQuestionId:null==n?void 0:n.objectID}),!V){Ae(!1);var u={};if(n&&(u.body={suggestedQuestionId:n.objectID}),Ne({role:"user",parts:[{type:"text",text:t}]},u),ae.current){var a=ae.current;"function"==typeof a.scrollTo?a.scrollTo({top:0,behavior:"smooth"}):a.scrollTop=0}We.current&&We.current.setQuery("")}},[T,P,Ne,me,De,V]),Je=It.useCallback(function(){var e=Xt(vn().m(function e(t,n){return vn().w(function(e){for(;;)switch(e.n){case 0:if(de&&a){e.n=1;break}return e.a(2);case 1:return e.n=2,Me(t,n);case 2:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),[de,a,Me]);We.current||(We.current=Qu({id:"docsearch",defaultActiveItemId:0,openOnFocus:!0,initialState:{query:ce,context:{searchSuggestions:[]}},insights:Boolean(I),navigator:g,onStateChange:function(e){X(e.state)},getSources:function(e){var t=e.query,n=e.state,r=e.setContext,u=e.setStatus;if(!t){var o=function(e){var t=e.recentSearches,n=e.favoriteSearches,r=e.saveRecentSearch,u=e.onClose;return e.disableUserPersonalization?[]:[{sourceId:"recentSearches",onSelect:function(e){var t=e.item,n=e.event;r(t),On(n)||u()},getItemUrl:function(e){return e.item.url},getItems:function(){return t.getAll()}},{sourceId:"favoriteSearches",onSelect:function(e){var t=e.item,n=e.event;r(t),On(n)||u()},getItemUrl:function(e){return e.item.url},getItems:function(){return n.getAll()}}]}({recentSearches:be,favoriteSearches:_e,saveRecentSearch:Ue,onClose:f,disableUserPersonalization:k}),c=ee?[{sourceId:"recentConversations",getItems:function(){return k?[]:Ze.getAll()},onSelect:function(e){var t=e.item;t.messages&&(Te(t.messages),T(!0))}}]:[];return[].concat(gn(o),c)}var l={context:n.context},d=FD({query:t,state:l,setContext:r,setStatus:u,searchClient:le,indexes:Fe,snippetLength:oe,insights:Boolean(I),appId:a,apiKey:i,maxResultsPerGroup:s,transformItems:p,saveRecentSearch:Ue,onClose:f}),h=ee?[{sourceId:"askAI",getItems:function(){return[{type:"askAI",query:t,url_without_anchor:"",objectID:"ask-ai-button",content:null,url:"",anchor:null,hierarchy:{lvl0:"Ask AI",lvl1:t,lvl2:null,lvl3:null,lvl4:null,lvl5:null,lvl6:null},_highlightResult:{},_snippetResult:{},__docsearch_parent:null}]},onSelect:function(e){var t=e.item;"askAI"===t.type&&t.query&&Ke(!0,t.query)}}]:[];return d.then(function(e){return[].concat(h,gn(e))})}}));var Qe,Ge,Ye=We.current,Xe=Ye.getEnvironmentProps,et=Ye.getRootProps,tt=Ye.refresh;!function(e){var t=e.getEnvironmentProps,n=e.panelElement,r=e.formElement,u=e.inputElement;It.useEffect(function(){if(n&&r&&u){var e=t({panelElement:n,formElement:r,inputElement:u}),a=e.onTouchStart,i=e.onTouchMove;return window.addEventListener("touchstart",a),window.addEventListener("touchmove",i),function(){window.removeEventListener("touchstart",a),window.removeEventListener("touchmove",i)}}},[t,n,r,u])}({getEnvironmentProps:Xe,panelElement:ae.current,formElement:ue.current,inputElement:ie.current}),Qe={container:ne.current},Ge=Qe.container,It.useEffect(function(){if(Ge){var e=Ge.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), input:not([disabled])"),t=e[0],n=e[e.length-1];return Ge.addEventListener("keydown",r),function(){Ge.removeEventListener("keydown",r)}}function r(e){"Tab"===e.key&&(e.shiftKey?document.activeElement===t&&(e.preventDefault(),n.focus()):document.activeElement===n&&(e.preventDefault(),t.focus()))}},[Ge]),kn({theme:c}),It.useEffect(function(){return document.body.classList.add("DocSearch--active"),function(){var e,t;document.body.classList.remove("DocSearch--active"),null===(e=(t=window).scrollTo)||void 0===e||e.call(t,0,E)}},[]),It.useEffect(function(){"undefined"!=typeof window&&window.localStorage&&function(){if("undefined"==typeof window||!window.localStorage)return 0;var e=0;for(var t in window.localStorage)window.localStorage.hasOwnProperty(t)&&(e+=window.localStorage[t].length+t.length);return e}()>4194304&&So()},[]),It.useLayoutEffect(function(){var e=window.innerWidth-document.body.clientWidth;return document.body.style.marginInlineEnd="".concat(e,"px"),function(){document.body.style.marginInlineEnd="0px"}},[]),It.useEffect(function(){window.matchMedia("(max-width: 768px)").matches&&(oe.current=5)},[]),It.useEffect(function(){var e;ae.current&&!N&&("function"==typeof(e=ae.current).scrollTo?e.scrollTo({top:0,behavior:"smooth"}):e.scrollTop=0)},[Y.query,N]),It.useEffect(function(){ce.length>0&&(tt(),ie.current&&ie.current.focus())},[ce,tt]),It.useEffect(function(){function e(){if(re.current){var e=.01*window.innerHeight;re.current.style.setProperty("--docsearch-vh","".concat(e,"px"))}}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[]),It.useEffect(function(){N||(Ye.refresh(),Te([]))},[N,Ye,Te]),It.useEffect(function(){De("initial")},[N,De]);var nt=function(){var e=Xt(vn().m(function e(){return vn().w(function(e){for(;;)switch(e.n){case 0:return Ae(!0),e.n=1,ze();case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),rt=function(){Te([]),De("new-conversation")},ut=!0,at=Y.collections.some(function(e){return e.items.length>0});return"idle"!==Y.status||!1!==at||0!==Y.query.length||N||(ut=!1),It.createElement("div",sn({ref:ne},et({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container","stalled"===Y.status&&"DocSearch-Container--Stalled","error"===Y.status&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),role:"button",tabIndex:0,onMouseDown:function(e){e.target===e.currentTarget&&f()}}),It.createElement("div",{className:"DocSearch-Modal",ref:re},It.createElement("header",{className:"DocSearch-SearchBar",ref:ue},It.createElement(wo,sn({},Ye,{state:Y,placeholder:te||"Search docs",autoFocus:0===ce.length,inputRef:ie,isFromSelection:Boolean(ce)&&ce===se,translations:J,isAskAiActive:N,askAiStatus:Be,askAiError:Re,askAiState:me,setAskAiState:De,isThreadDepthError:$e&&"new-conversation"!==me,onClose:f,onAskAiToggle:T,onAskAgain:function(e){Ke(!0,e)},onStopAskAiStreaming:nt,onNewConversation:rt,onViewConversationHistory:function(){De("conversation-history")}}))),ut&&It.createElement("div",{className:"DocSearch-Dropdown",ref:ae},It.createElement(Fo,sn({},Ye,{indexName:Ee,state:Y,hitComponent:m,resultsFooterComponent:y,disableUserPersonalization:k,recentSearches:be,favoriteSearches:_e,conversations:Ze,inputRef:ie,translations:Q,getMissingResultsUrl:O,isAskAiActive:N,canHandleAskAi:ee,messages:xe,askAiError:Re,status:Be,hasCollections:at,askAiState:me,selectAskAiQuestion:Ke,suggestedQuestions:ye,selectSuggestedQuestion:function(e){Ke(!0,e.question,e)},agentStudio:ge,onAskAiToggle:T,onNewConversation:rt,onItemClick:function(e,t){if("askAI"===e.type&&e.query){if("stored"===e.anchor&&"messages"in e){Te(e.messages);var n={query:e.query,messageId:e.messages[0].id};if(null!=P&&P(n))return We.current&&We.current.setQuery(""),void t.preventDefault();T(!0,n)}else Ke(!0,e.query);return De("initial"),void t.preventDefault()}He(e),Ue(e),On(t)||f()},onFeedback:Je}))),It.createElement("footer",{className:"DocSearch-Footer"},It.createElement(ta,{translations:K,isAskAiActive:N}))))}var _D=It.forwardRef(function(e,t){return It.createElement(qt,sn({},e,{ref:t}),It.createElement(bD,e))});function bD(e){var t,n,r,u=function(){var e=It.useContext($t);if(void 0===e)throw new Error("`useDocSearch` must be used within the `DocSearch` provider");return e}(),a=u.searchButtonRef,i=u.keyboardShortcuts,o=u.isModalActive,s=u.isAskAiActive,c=u.initialQuery,l=u.onAskAiToggle,f=u.openModal,d=u.closeModal;return It.createElement(It.Fragment,null,It.createElement(zn,{keyboardShortcuts:i,ref:a,translations:null===(t=e.translations)||void 0===t?void 0:t.button,onClick:f}),o&&pt(It.createElement(ED,sn({},e,{initialScrollY:window.scrollY,initialQuery:c,translations:null==e||null===(n=e.translations)||void 0===n?void 0:n.modal,isAskAiActive:s,onAskAiToggle:l,onClose:d})),null!==(r=e.portalContainer)&&void 0!==r?r:document.body))}var CD=function(e,t,n,r){var u;t[0]=0;for(var a=1;a<t.length;a++){var i=t[a++],o=t[a]?(t[0]|=i?1:2,n[t[a++]]):t[++a];3===i?r[0]=o:4===i?r[1]=Object.assign(r[1]||{},o):5===i?(r[1]=r[1]||{})[t[++a]]=o:6===i?r[1][t[++a]]+=o+"":i?(u=e.apply(o,CD(e,o,n,["",null])),r.push(u),o[0]?t[0]|=2:(t[a-2]=0,t[a]=u)):r.push(o)}return r},kD=new Map;var AD=["container","environment","transformSearchClient","hitComponent","resultsFooterComponent"];var wD=function(e){var t=kD.get(this);return t||(t=new Map,kD.set(this,t)),(t=CD(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,r=1,u="",a="",i=[0],o=function(e){1===r&&(e||(u=u.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?i.push(0,e,u):3===r&&(e||u)?(i.push(3,e,u),r=2):2===r&&"..."===u&&e?i.push(4,e,0):2===r&&u&&!e?i.push(5,0,!0,u):r>=5&&((u||!e&&5===r)&&(i.push(r,0,u,n),r=6),e&&(i.push(r,e,0,n),r=6)),u=""},s=0;s<e.length;s++){s&&(1===r&&o(),o(s));for(var c=0;c<e[s].length;c++)t=e[s][c],1===r?"<"===t?(o(),i=[i],r=3):u+=t:4===r?"--"===u&&">"===t?(r=1,u=""):u=t+u[0]:a?t===a?a="":u+=t:'"'===t||"'"===t?a=t:">"===t?(o(),r=1):r&&("="===t?(r=5,n=u,u=""):"/"===t&&(r<5||">"===e[s][c+1])?(o(),3===r&&(i=i[0]),r=i,(i=i[0]).push(2,0,r),r=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(o(),r=2):u+=t),3===r&&"!--"===u&&(r=4,i=i[0])}return o(),i}(e)),t),arguments,[])).length>1?t:t[0]}.bind($);function SD(e){if(e)return function(t){var n=e(t,{html:wD});return Ot(n)?n:"function"==typeof n?n(t):"string"==typeof n?$("span",null,n):n}}return function(e){var t=e.container,n=e.environment,r=e.transformSearchClient,u=e.hitComponent,a=e.resultsFooterComponent,i=v(e,AD),o=function(e,t){if("string"!=typeof e)return e;if(!t)throw new Error("Cannot resolve a selector without a browser environment.");var n=t.document.querySelector(e);if(!n)throw new Error('Container selector did not match any element: "'.concat(e,'"'));return n}(t,n||("undefined"!=typeof window?window:void 0)),s={current:null},c=!1,l=h(h({},i),{},{ref:s,hitComponent:SD(u),resultsFooterComponent:SD(a),transformSearchClient:function(e){return null!=e&&e.addAlgoliaAgent&&e.addAlgoliaAgent("docsearch.js",mD),"function"==typeof r?r(e):e}});return gt($(_D,l),o),c=!0,{open:function(){var e;null===(e=s.current)||void 0===e||e.open()},close:function(){var e;null===(e=s.current)||void 0===e||e.close()},openAskAi:function(e){var t;null===(t=s.current)||void 0===t||t.openAskAi(e)},get isReady(){return c},get isOpen(){var e,t;return null!==(e=null===(t=s.current)||void 0===t?void 0:t.isOpen)&&void 0!==e&&e},destroy:function(){Bt(o),c=!1}}}});
7
- //# sourceMappingURL=index.js.map
1
+ /*! @docsearch/js 5.0.0-beta.0 (UNRELEASED 1b6607c) | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */
2
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.docsearch=t())})(this,function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);function f(e){"@babel/helpers - typeof";return f=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},f(e)}function p(e,t){if(f(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(f(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function m(e){var t=p(e,`string`);return f(t)==`symbol`?t:t+``}function h(e,t,n){return(t=m(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?g(Object(n),!0).forEach(function(t){h(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let v={"Ctrl/Cmd+K":!0,"/":!0};function y(e){return _(_({},v),e)}let b=`Ctrl`;function x(){return/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)}function S(e){e&&e.parentNode&&e.remove()}function C(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?ke.call(arguments,2):n),w(e,o,r,i,null)}function w(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++ge:i,__i:-1,__u:0};return i==null&&I.vnode!=null&&I.vnode(a),a}function T(){return{current:null}}function E(e){return e.children}function D(e,t){this.props=e,this.context=t,this.__g=0}function O(e,t){if(t==null)return e.__?O(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?O(e):null}function k(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return k(e)}}function A(e){(8&e.__g||!(e.__g|=8)||!_e.push(e)||ye++)&&ve==I.debounceRendering||((ve=I.debounceRendering)||queueMicrotask)(j)}function j(){for(var e,t,n,r,i,a,o,s,c=1;_e.length;)_e.length>c&&_e.sort(be),e=_e.shift(),c=_e.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=Ae({},r)).__v=r.__v+1,I.vnode&&I.vnode(n),ae(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i==null?O(r):i,!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,se(a,n,o),n.__e!=i&&k(n)));ye=0}function M(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||De,b=t.length;for(c=ee(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?Ee:y[m.__i]||Ee,m.__i=f,_=ae(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&F(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=N(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function ee(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?w(null,o,null,null,null):Oe(o)?w(E,{children:o},null,null,null):o.constructor==null&&o.__b>0?w(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=ne(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=O(s)),ue(s,s));return r}function N(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=N(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=O(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function te(e,t){return t=t||[],e==null||typeof e==`boolean`||(Oe(e)?e.some(function(e){te(e,t)}):t.push(e)),t}function ne(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function P(e,t,n){t[0]==`-`?e.setProperty(t,n==null?``:n):e[t]=n==null?``:n}function re(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||P(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||P(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(xe,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||(e.__l={}),e.__l[t+a]=n,n?r?n.l=r.l:(n.l=Se,e.addEventListener(t,a?we:Ce,a)):e.removeEventListener(t,a?we:Ce,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n==null?``:n;break n}catch(e){}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function ie(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=Se++;else if(t.u<n.l)return;return n(I.event?I.event(t):t)}}}function ae(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,C,w,T,O,k,A,j,ee,N,te,ne=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=I.__b)&&d(t);n:if(typeof ne==`function`)try{if(v=t.props,y=`prototype`in ne&&ne.prototype.render,b=(d=ne.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new ne(v,x):(t.__c=f=new D(v,x),f.constructor=ne,f.render=de),b&&b.sub(f),f.props=v,f.state||(f.state={}),f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&ne.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Ae({},f.__s)),Ae(f.__s,ne.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&ne.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&ne.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),C=0;C<f._sb.length;C++)f.__h.push(f._sb[C]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,w=I.__r,T=0,y){for(f.state=f.__s,f.__g&=-9,w&&w(t),d=f.render(f.props,f.state,f.context),O=0;O<f._sb.length;O++)f.__h.push(f._sb[O]);f._sb=[]}else do f.__g&=-9,w&&w(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++T<25);f.state=f.__s,f.getChildContext!=null&&(r=Ae({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),k=d,d!=null&&d.type===E&&d.key==null&&(k=ce(d.props.children)),s=M(e,Oe(k)?k:[k],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(A=0,j=!1,t.__u|=c?160:128,t.__c.__z=[],ee=0;ee<a.length;ee++)(N=a[ee])==null||j||(N.nodeType==8&&N.data==`$s`?(A>0&&t.__c.__z.push(N),A++,a[ee]=null):N.nodeType==8&&N.data==`/$s`?(--A>0&&t.__c.__z.push(N),j=A===0,s=a[ee],a[ee]=null):A>0&&(t.__c.__z.push(N),a[ee]=null));if(!j){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(te=a.length;te--;)S(a[te]);oe(t)}else t.__e=n.__e,t.__k=n.__k,e.then||oe(t);I.__e(e,t,n)}else s=t.__e=le(n.__e,t,n,r,i,a,o,c,l,u);return(d=I.diffed)&&d(t),128&t.__u?void 0:s}function oe(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(oe)}function se(e,t,n){for(var r=0;r<n.length;r++)F(n[r],n[++r],n[++r]);I.__c&&I.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){I.__e(e,t.__v)}})}function ce(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:Oe(e)?e.map(ce):Ae({},e)}function le(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||(i=`http://www.w3.org/1999/xhtml`),a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&(I.__m&&I.__m(t,a),s=!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a=a&&ke.call(e.childNodes),v=n.props||Ee,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;re(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||re(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),M(b==`template`?e.content:e,Oe(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&O(n,0),s,c,l),a!=null)for(u=a.length;u--;)S(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||re(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&re(e,u,g,v[u],i))}return e}function F(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){I.__e(e,n)}}function ue(e,t,n){var r,i;if(I.unmount&&I.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||F(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){I.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&ue(r[i],t,n||typeof e.type!=`function`);n||S(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function de(e,t,n){return this.constructor(e,n)}function fe(e,t){var n,r,i,a;t==document&&(t=document.documentElement),I.__&&I.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=C(E,null,[e]),i=[],a=[],ae(t,e,r||Ee,Ee,t.namespaceURI,r?null:t.firstChild?ke.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),se(i,e,a)}function pe(e,t){e.__u|=32,fe(e,t)}function me(e,t,n){var r,i,a,o=Ae({},e.props);for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e.type!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?ke.call(arguments,2):n),w(e.type,o,r||e.key,i||e.ref,null)}function he(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__g|=4,A(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c=`__cC`+Te++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}var I,ge,_e,ve,ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je=o((()=>{Ee={},De=[],Oe=Array.isArray,ke=De.slice,Ae=Object.assign,I={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw ye=0,e}},ge=0,D.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Ae({},this.state);typeof e==`function`&&(e=e(Ae({},n),this.props)),e&&Ae(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),A(this))},D.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),A(this))},D.prototype.render=E,_e=[],ye=0,be=function(e,t){return e.__v.__b-t.__v.__b},xe=/(PointerCapture)$|Capture$/i,Se=0,Ce=ie(!1),we=ie(!0),Te=0}));function Me(e,t){nt.__h&&nt.__h(Xe,e,et||t),et=0;var n=Xe.__H||(Xe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Ne(e){return et=1,Pe(Je,e)}function Pe(e,t,n){var r=Me(Ye++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Je(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);$e(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Xe,!Xe.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,$e(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};Xe.__f=!0;var a=Xe.shouldComponentUpdate,o=Xe.componentWillUpdate;Xe.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},Xe.shouldComponentUpdate=i}return r.__N||r.__}function Fe(e,t){var n=Me(Ye++,3);!nt.__s&&qe(n.__H,t)&&(n.__=e,n.u=t,Xe.__H.__h.push(n))}function Ie(e,t){var n=Me(Ye++,4);!nt.__s&&qe(n.__H,t)&&(n.__=e,n.u=t,Xe.__h.push(n))}function L(e){return et=5,R(function(){return{current:e}},[])}function Le(e,t,n){et=6,Ie(function(){if(typeof e==`function`){var n=e(t());return function(){e(null),n&&typeof n==`function`&&n()}}if(e)return e.current=t(),function(){return e.current=null}},n==null?n:n.concat(e))}function R(e,t){var n=Me(Ye++,7);return qe(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Re(e,t){return et=8,R(function(){return e},t)}function ze(e){var t=Xe.context[e.__c],n=Me(Ye++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(Xe)),t.props.value):e.__}function Be(e,t){nt.useDebugValue&&nt.useDebugValue(t?t(e):e)}function Ve(e){var t=Me(Ye++,10),n=Ne();return t.__=e,Xe.componentDidCatch||(Xe.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function He(){var e=Me(Ye++,11);if(!e.__){for(var t=Xe.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__=`P`+n[0]+`-`+n[1]++}return e.__}function Ue(){for(var e;e=tt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ge),e.__H.__h.forEach(Ke),e.__H.__h=[]}catch(t){e.__H.__h=[],nt.__e(t,e.__v)}}function We(e){var t,n=function(){clearTimeout(r),lt&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);lt&&(t=requestAnimationFrame(n))}function Ge(e){var t=Xe,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),Xe=t}function Ke(e){var t=Xe;e.__c=e.__(),Xe=t}function qe(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!$e(t,e[n])})}function Je(e,t){return typeof t==`function`?t(e):t}var Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,ot,st,ct,lt,ut=o((()=>{je(),$e=Object.is,et=0,tt=[],nt=I,rt=nt.__b,it=nt.__r,at=nt.diffed,ot=nt.__c,st=nt.unmount,ct=nt.__,nt.__b=function(e){Xe=null,rt&&rt(e)},nt.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ct&&ct(e,t)},nt.__r=function(e){it&&it(e),Ye=0;var t=(Xe=e.__c).__H;t&&(Ze===Xe?(t.__h=[],Xe.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(Ge),t.__h.forEach(Ke),t.__h=[],Ye=0)),Ze=Xe},nt.diffed=function(e){at&&at(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(tt.push(t)!==1&&Qe===nt.requestAnimationFrame||((Qe=nt.requestAnimationFrame)||We)(Ue)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Ze=Xe=null},nt.__c=function(e,t){t.some(function(e){try{e.__h.forEach(Ge),e.__h=e.__h.filter(function(e){return!e.__||Ke(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],nt.__e(n,e.__v)}}),ot&&ot(e,t)},nt.unmount=function(e){st&&st(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{Ge(e)}catch(e){t=e}}),n.__H=void 0,t&&nt.__e(t,n.__v))},lt=typeof requestAnimationFrame==`function`})),dt=c({Children:()=>Kt,Component:()=>D,Fragment:()=>E,PureComponent:()=>vt,StrictMode:()=>un,Suspense:()=>Ct,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>sn,cloneElement:()=>Lt,createContext:()=>he,createElement:()=>C,createFactory:()=>Nt,createPortal:()=>Dt,createRef:()=>T,default:()=>z,findDOMNode:()=>zt,flushSync:()=>ln,forwardRef:()=>bt,hydrate:()=>kt,isElement:()=>dn,isFragment:()=>Ft,isMemo:()=>It,isValidElement:()=>Pt,lazy:()=>wt,memo:()=>yt,render:()=>Ot,startTransition:()=>mt,unmountComponentAtNode:()=>Rt,unstable_batchedUpdates:()=>Bt,useCallback:()=>Re,useContext:()=>ze,useDebugValue:()=>Be,useDeferredValue:()=>ht,useEffect:()=>Fe,useErrorBoundary:()=>Ve,useId:()=>He,useImperativeHandle:()=>Le,useInsertionEffect:()=>Vt,useLayoutEffect:()=>Ie,useMemo:()=>R,useReducer:()=>Pe,useRef:()=>L,useState:()=>Ne,useSyncExternalStore:()=>ft,useTransition:()=>gt,version:()=>cn});function ft(e,t){var n=t(),r=Ne({t:{__:n,u:t}}),i=r[0].t,a=r[1];return Ie(function(){i.__=n,i.u=t,pt(i)&&a({t:i})},[e,n,t]),Fe(function(){return pt(i)&&a({t:i}),e(function(){pt(i)&&a({t:i})})},[e]),n}function pt(e){var t=e.u,n=e.__;try{var r=t();return!Object.is(n,r)}catch(e){return!0}}function mt(e){e()}function ht(e){return e}function gt(){return[!1,mt]}function _t(e,t){for(var n in e)if(n!==`__source`&&!(n in t))return!0;for(var r in t)if(r!==`__source`&&e[r]!==t[r])return!0;return!1}function vt(e,t){this.props=e,this.context=t}function yt(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:_t(this.props,e)}function r(t){return this.shouldComponentUpdate=n,C(e,t)}return r.displayName=`Memo(`+(e.displayName||e.name)+`)`,r.prototype.isReactComponent=!0,r.type=e,r}function bt(e){function t(t){var n=Ht({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=Wt,t.render=e,t.prototype.isReactComponent=!0,t.displayName=`ForwardRef(`+(e.displayName||e.name)+`)`,t}function xt(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){typeof e.__c==`function`&&e.__c()}),e.__c.__H=null),(e=Ht({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__g|=4,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return xt(e,t,n)})),e}function St(e,t,n){return e&&n&&(typeof e.type==`string`&&(e.__u|=1),e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return St(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__g|=4,e.__c.__P=n)),e}function Ct(){this.__u=0,this.o=null,this.__b=null}function wt(e){var t,n,r;function i(i){if(t||(t=e()).then(function(e){n=e.default||e},function(e){r=e}),r)throw r;if(!n)throw t;return C(n,i)}return i.displayName=`Lazy`,i}function Tt(e){return this.getChildContext=function(){return e.context},e.children}function Et(e){var t=this,n=e.i;if(t.componentWillUnmount=function(){fe(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),!t.l){for(var r=t.__v;r!==null&&!r.__m&&r.__!==null;)r=r.__;t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],__k:{__m:r.__m},ownerDocument:n.ownerDocument,insertBefore:function(e,n){this.childNodes.push(e),t.i.insertBefore(e,n)}}}fe(C(Tt,{context:t.context},e.__v),t.l)}function Dt(e,t){var n=C(Et,{__v:e,i:t});return n.containerInfo=t,n}function Ot(e,t,n){return t.__k==null&&(t.textContent=``),fe(e,t),typeof n==`function`&&n(),e?e.__c:null}function kt(e,t,n){return pe(e,t),typeof n==`function`&&n(),e?e.__c:null}function At(){}function jt(){return this.cancelBubble}function Mt(){return this.defaultPrevented}function Nt(e){return C.bind(null,e)}function Pt(e){return!!e&&e.$$typeof===Yt}function Ft(e){return Pt(e)&&e.type===E}function It(e){return!!e&&!!e.displayName&&(typeof e.displayName==`string`||e.displayName instanceof String)&&e.displayName.startsWith(`Memo(`)}function Lt(e){return Pt(e)?me.apply(null,arguments):e}function Rt(e){return!!e.__k&&(fe(null,e),!0)}function zt(e){return e&&(e.__v&&e.__v.__e||e.nodeType===1&&e)||null}function Bt(e,t){return e(t)}var Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,on,sn,cn,ln,un,dn,z,B=o((()=>{je(),ut(),ut(),Vt=Ie,Ht=Object.assign,Ut=/^(-|f[lo].*[^se]$|g.{5,}[^ps]$|z|o[pr]|(W.{5})?[lL]i.*(t|mp)$|an|(bo|s).{4}Im|sca|m.{6}[ds]|ta|c.*[st]$|wido|ini)/,(vt.prototype=new D).isPureReactComponent=!0,vt.prototype.shouldComponentUpdate=function(e,t){return _t(this.props,e)||_t(this.state,t)},Wt=Symbol.for(`react.forward_ref`),Gt=function(e,t,n){return e==null?null:te(te(e).map(t.bind(n)))},Kt={map:Gt,forEach:Gt,count:function(e){return e?te(e).length:0},only:function(e){var t=te(e);if(t.length!==1)throw`Children.only`;return t[0]},toArray:te},qt=I.__e,I.__e=function(e,t,n,r){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}qt(e,t,n,r)},Jt=I.unmount,I.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),Jt&&Jt(e)},(Ct.prototype=new D).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var i=!1,a=function(){i||(i=!0,n.__R=null,o())};n.__R=a;var o=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=St(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},Ct.prototype.componentWillUnmount=function(){this.o=[]},Ct.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement(`div`),r=this.__v.__k[0].__c;this.__v.__k[0]=xt(this.__b,n,r.__O=r.__P)}this.__b=null}return[C(E,null,t.__a?null:e.children),t.__a&&C(E,null,e.fallback)]},Yt=Symbol.for(`react.element`),Xt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Zt=/[A-Z0-9]/g,Qt=typeof document<`u`,$t=function(e){return/fil|che|rad/.test(e)},D.prototype.isReactComponent={},[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(e){Object.defineProperty(D.prototype,e,{configurable:!0,get:function(){return this[`UNSAFE_`+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}),en=I.event,I.event=function(e){return en&&(e=en(e)),e.persist=At,e.isPropagationStopped=jt,e.isDefaultPrevented=Mt,e.nativeEvent=e},nn={enumerable:!1,configurable:!0,get:function(){return this.class}},rn=I.vnode,I.vnode=function(e){if(typeof e.type==`string`)(function(e){var t=e.props,n=e.type,r={},i=n.indexOf(`-`)===-1;for(var a in t){var o=t[a];if(!(a===`value`&&`defaultValue`in t&&o==null||Qt&&a===`children`&&n===`noscript`||a===`class`||a===`className`)){if(a===`style`&&typeof o==`object`)for(var s in o)typeof o[s]!=`number`||Ut.test(s)||(o[s]+=`px`);else if(a===`defaultValue`&&`value`in t&&t.value==null)a=`value`;else if(a===`download`&&!0===o)o=``;else if(a===`translate`&&o===`no`)o=!1;else if(a[0]===`o`&&a[1]===`n`){var c=a.toLowerCase();c===`ondoubleclick`?a=`ondblclick`:c!==`onchange`||n!==`input`&&n!==`textarea`||$t(t.type)?c===`onfocus`?a=`onfocusin`:c===`onblur`&&(a=`onfocusout`):c=a=`oninput`,c===`oninput`&&r[a=c]&&(a=`oninputCapture`)}else i&&Xt.test(a)?a=a.replace(Zt,`-$&`).toLowerCase():o===null&&(o=void 0);r[a]=o}}n==`select`&&r.multiple&&Array.isArray(r.value)&&(r.value=te(t.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),n==`select`&&r.defaultValue!=null&&(r.value=te(t.children).forEach(function(e){e.props.selected=r.multiple?r.defaultValue.indexOf(e.props.value)!=-1:r.defaultValue==e.props.value})),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",nn)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r})(e);else if(typeof e.type==`function`&&(`ref`in e.props&&`prototype`in e.type&&e.type.prototype.render&&(e.ref=e.props.ref,delete e.props.ref),e.type.defaultProps)){var t=Ht({},e.props);for(var n in e.type.defaultProps)t[n]===void 0&&(t[n]=e.type.defaultProps[n]);e.props=t}e.$$typeof=Yt,rn&&rn(e)},an=I.__r,I.__r=function(e){an&&an(e),tn=e.__c},on=I.diffed,I.diffed=function(e){on&&on(e);var t=e.props,n=e.__e;n!=null&&e.type===`textarea`&&`value`in t&&t.value!==n.value&&(n.value=t.value==null?``:t.value),tn=null},sn={ReactCurrentDispatcher:{current:{readContext:function(e){return tn.__n[e.__c].props.value},useCallback:Re,useContext:ze,useDebugValue:Be,useDeferredValue:ht,useEffect:Fe,useId:He,useImperativeHandle:Le,useInsertionEffect:Vt,useLayoutEffect:Ie,useMemo:R,useReducer:Pe,useRef:L,useState:Ne,useSyncExternalStore:ft,useTransition:gt}}},cn=`18.3.1`,ln=function(e,t){return e(t)},un=E,dn=Pt,z={useState:Ne,useId:He,useReducer:Pe,useEffect:Fe,useLayoutEffect:Ie,useInsertionEffect:Vt,useTransition:gt,useDeferredValue:ht,useSyncExternalStore:ft,startTransition:mt,useRef:L,useImperativeHandle:Le,useMemo:R,useCallback:Re,useContext:ze,useDebugValue:Be,version:`18.3.1`,Children:Kt,render:Ot,hydrate:kt,unmountComponentAtNode:Rt,createPortal:Dt,createElement:C,createContext:he,createFactory:Nt,cloneElement:Lt,createRef:T,Fragment:E,isValidElement:Pt,isElement:dn,isFragment:Ft,isMemo:It,findDOMNode:zt,Component:D,PureComponent:vt,memo:yt,forwardRef:bt,flushSync:ln,unstable_batchedUpdates:Bt,StrictMode:un,Suspense:Ct,lazy:wt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:sn}}));B();function fn({size:e=20,color:t=`currentColor`}){return z.createElement(`svg`,{width:e,height:e,className:`DocSearch-Search-Icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`},z.createElement(`circle`,{cx:`11`,cy:`11`,r:`8`,stroke:t,fill:`none`,strokeWidth:`1.4`}),z.createElement(`path`,{d:`m21 21-4.3-4.3`,stroke:t,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`}))}function pn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function mn(e,t){if(e==null)return{};var n,r,i=pn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}B();let hn=({theme:e})=>{Fe(()=>{if(!e)return;let t=document.documentElement.dataset.theme;if(e!==t)return document.documentElement.dataset.theme=e,()=>{t===void 0?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=t}},[e])};B();function gn(){let[e,t]=Ne(null);Fe(()=>{typeof navigator<`u`&&(x()?t(`⌘`):t(b))},[]);let[n,r,i]=e===`Ctrl`?[b,`Control`,`Ctrl`]:[`Meta`,`Meta`,`⌘`];return{actionKeyReactsTo:n,actionKeyAltText:r,actionKeyLabel:i,key:e}}let _n=[`translations`,`keyboardShortcuts`],vn=z.forwardRef((e,t)=>{let{translations:n={},keyboardShortcuts:r}=e,i=mn(e,_n),{buttonText:a=`Search`,buttonAriaLabel:o=`Search`}=n,s=y(r),{actionKeyReactsTo:c,actionKeyAltText:l,actionKeyLabel:u,key:d}=gn();hn({theme:i.theme});let f=s[`Ctrl/Cmd+K`],p=`${l}+k`;return z.createElement(`button`,_(_({type:`button`,className:`DocSearch DocSearch-Button`,"aria-label":f?`${o} (${p})`:o,"aria-keyshortcuts":f?p:void 0},i),{},{ref:t}),z.createElement(`span`,{className:`DocSearch-Button-Container`},z.createElement(fn,null),z.createElement(`span`,{className:`DocSearch-Button-Placeholder`},a)),z.createElement(`span`,{className:`DocSearch-Button-Keys`},d!==null&&f&&z.createElement(z.Fragment,null,z.createElement(yn,{reactsToKey:c},u),z.createElement(yn,{reactsToKey:`k`},`K`))))});function yn({reactsToKey:e,children:t}){let[n,r]=Ne(!1);return Fe(()=>{if(!e)return;function t(t){t.key===e&&r(!0)}function n(t){(t.key===e||t.key===`Meta`)&&r(!1)}return window.addEventListener(`keydown`,t),window.addEventListener(`keyup`,n),()=>{window.removeEventListener(`keydown`,t),window.removeEventListener(`keyup`,n)}},[e]),z.createElement(`kbd`,{className:n?`DocSearch-Button-Key DocSearch-Button-Key--pressed`:`DocSearch-Button-Key`+(e===`Ctrl`?` DocSearch-Button-Key--ctrl`:``)},t)}let bn=`5.0.0-beta.0`;function xn(e,t){this.v=e,this.k=t}function Sn(e){return new xn(e,0)}function Cn(e){return function(){return new wn(e.apply(this,arguments))}}function wn(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof xn;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`?`return`:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(a.done?`return`:`normal`,n)},function(e){r(`throw`,e)})}catch(e){i(`throw`,e)}}function i(e,i){switch(e){case`return`:t.resolve({value:i,done:!0});break;case`throw`:t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}wn.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},wn.prototype.next=function(e){return this._invoke(`next`,e)},wn.prototype.throw=function(e){return this._invoke(`throw`,e)},wn.prototype.return=function(e){return this._invoke(`return`,e)};function Tn(e){var t,n,r,i=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new En(t.call(e));n=`@@asyncIterator`,r=`@@iterator`}throw TypeError(`Object is not async iterable`)}function En(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return En=function(e){this.s=e,this.n=e.next},En.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new En(e)}function Dn(e){"@babel/helpers - typeof";return Dn=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Dn(e)}function On(e,t){if(Dn(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Dn(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function kn(e){var t=On(e,`string`);return Dn(t)==`symbol`?t:t+``}function V(e,t,n){return(t=kn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function An(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?An(Object(n),!0).forEach(function(t){V(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):An(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function jn(e){var t={},n=!1;function r(t,r){return n=!0,r=new Promise(function(n){n(e[t](r))}),{done:!1,value:new xn(r,1)}}return t[typeof Symbol<`u`&&Symbol.iterator||`@@iterator`]=function(){return this},t.next=function(e){return n?(n=!1,e):r(`next`,e)},typeof e.throw==`function`&&(t.throw=function(e){if(n)throw n=!1,e;return r(`throw`,e)}),typeof e.return==`function`&&(t.return=function(e){return n?(n=!1,e):r(`return`,e)}),t}function Mn(e){let t,n=`algolia-client-js-${e.key}`;function r(){return t===void 0&&(t=e.localStorage||window.localStorage),t}function i(){return JSON.parse(r().getItem(n)||`{}`)}function a(e){r().setItem(n,JSON.stringify(e))}function o(){return new Promise(e=>setTimeout(e,0))}function s(){let t=e.timeToLive?e.timeToLive*1e3:null,n=i(),r=new Date().getTime(),a=!1;return{namespace:Object.fromEntries(Object.entries(n).filter(([,e])=>!e||e.timestamp===void 0||t&&e.timestamp+t<r?(a=!0,!1):!0)),changed:a}}return{get(e,t,n={miss:()=>Promise.resolve()}){return o().then(()=>{let{namespace:r,changed:i}=s(),o=r[JSON.stringify(e)];return i&&a(r),o?o.value:t().then(e=>n.miss(e).then(()=>e))})},set(e,t){return o().then(()=>{let a=i();return a[JSON.stringify(e)]={timestamp:new Date().getTime(),value:t},r().setItem(n,JSON.stringify(a)),t})},delete(e){return o().then(()=>{let t=i();delete t[JSON.stringify(e)],r().setItem(n,JSON.stringify(t))})},clear(){return Promise.resolve().then(()=>{r().removeItem(n)})}}}function Nn(){return{get(e,t,n={miss:()=>Promise.resolve()}){return t().then(e=>Promise.all([e,n.miss(e)])).then(([e])=>e)},set(e,t){return Promise.resolve(t)},delete(e){return Promise.resolve()},clear(){return Promise.resolve()}}}function Pn(e){let t=[...e.caches],n=t.shift();return n===void 0?Nn():{get(e,r,i={miss:()=>Promise.resolve()}){return n.get(e,r,i).catch(()=>Pn({caches:t}).get(e,r,i))},set(e,r){return n.set(e,r).catch(()=>Pn({caches:t}).set(e,r))},delete(e){return n.delete(e).catch(()=>Pn({caches:t}).delete(e))},clear(){return n.clear().catch(()=>Pn({caches:t}).clear())}}}function Fn(e={serializable:!0}){let t={};return{get(n,r,i={miss:()=>Promise.resolve()}){let a=JSON.stringify(n);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);let o=r();return o.then(e=>i.miss(e)).then(()=>o)},set(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear(){return t={},Promise.resolve()}}}function In(e){let t={value:`Algolia for JavaScript (${e})`,add(e){let n=`; ${e.segment}${e.version===void 0?``:` (${e.version})`}`;return t.value.indexOf(n)===-1&&(t.value=`${t.value}${n}`),t}};return t}function Ln(e,t,n=`WithinHeaders`){let r={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers(){return n===`WithinHeaders`?r:{}},queryParameters(){return n===`WithinQueryParameters`?r:{}}}}function Rn({algoliaAgents:e,client:t,version:n}){let r=In(n).add({segment:t,version:n});return e.forEach(e=>r.add(e)),r}function zn(){return{debug(e,t){return Promise.resolve()},info(e,t){return Promise.resolve()},error(e,t){return Promise.resolve()}}}var Bn=10*1024*1024;function Vn(e){return Hn.apply(this,arguments)}function Hn(){return Hn=Cn(function*(e){let t=e.getReader();try{for(;;){let{done:e,value:n}=yield Sn(t.read());if(e)return;yield n}}finally{t.releaseLock()}}),Hn.apply(this,arguments)}function Un(e){return Symbol.asyncIterator in e?e:Vn(e)}function Wn(e){return Gn.apply(this,arguments)}function Gn(){return Gn=Cn(function*(e){let t=new TextDecoder(`utf-8`),n=[],r=0,i=!1,a=!0;var o=!1,s=!1,c;try{for(var l=Tn(Un(e)),u;o=!(u=yield Sn(l.next())).done;o=!1){let e=u.value;{let o=t.decode(e,{stream:!0}),s=0;for(i&&(i=!1,o.length>0&&o[0]===`
3
+ `&&(s=1));s<o.length;){let e=o.indexOf(`\r`,s),t=o.indexOf(`
4
+ `,s);if(e===-1&&t===-1){let e=o.slice(s);if(n.push(e),r+=e.length,r>Bn)throw Error(`SSE line buffer exceeded 10MB`);break}let c,l;e!==-1&&(t===-1||e<t)?(c=e,e+1<o.length?l=o[e+1]===`
5
+ `?2:1:(i=!0,l=1)):(c=t,l=1);let u=o.slice(s,c);n.push(u);let d=n.length===1?n[0]:n.join(``);n.length=0,r=0,a&&(d.startsWith(``)&&(d=d.slice(1)),a=!1),yield d,s=c+l}}}}catch(e){s=!0,c=e}finally{try{o&&l.return!=null&&(yield Sn(l.return()))}finally{if(s)throw c}}let d=t.decode();if(d&&n.push(d),n.length>0){let e=n.join(``);a&&e.startsWith(``)&&(e=e.slice(1)),yield e}}),Gn.apply(this,arguments)}var Kn=class{constructor(){V(this,`data`,[]),V(this,`eventType`,``),V(this,`lastEventId`,null),V(this,`retry`,null)}decode(e){if(e===``)return this.dispatch();if(e[0]===`:`)return null;let t=e.indexOf(`:`),n,r;switch(t===-1?(n=e,r=``):(n=e.slice(0,t),r=e.slice(t+1),r[0]===` `&&(r=r.slice(1))),n){case`data`:this.data.push(r);break;case`event`:this.eventType=r;break;case`id`:r.includes(`\0`)||(this.lastEventId=r);break;case`retry`:/^[0-9]+$/.test(r)&&(this.retry=parseInt(r,10));break}return null}dispatch(){let e=this.eventType;if(this.eventType=``,this.data.length===0)return null;let t={data:this.data.join(`
6
+ `),event:e,id:this.lastEventId,retry:this.retry};return this.data=[],t}};function qn(e){return Jn.apply(this,arguments)}function Jn(){return Jn=Cn(function*(e){let t=new Kn;var n=!1,r=!1,i;try{for(var a=Tn(Wn(e)),o;n=!(o=yield Sn(a.next())).done;n=!1){let e=o.value;{let n=t.decode(e);n!==null&&(yield n)}}}catch(e){r=!0,i=e}finally{try{n&&a.return!=null&&(yield Sn(a.return()))}finally{if(r)throw i}}}),Jn.apply(this,arguments)}var Yn=120*1e3;function Xn(e,t=`up`){let n=Date.now();function r(){return t===`up`||Date.now()-n>Yn}function i(){return t===`timed out`&&Date.now()-n<=Yn}return H(H({},e),{},{status:t,lastUpdate:n,isUp:r,isTimedOut:i})}var Zn=class extends Error{constructor(e,t){super(e),V(this,`name`,`AlgoliaError`),t&&(this.name=t)}},Qn=class extends Zn{constructor(e,t,n){super(e,n),V(this,`stackTrace`,void 0),this.stackTrace=t}},$n=class extends Qn{constructor(e){super(`Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support`,e,`RetryError`)}},er=class extends Qn{constructor(e,t,n,r=`ApiError`){super(e,n,r),V(this,`status`,void 0),this.status=t}},tr=class extends Zn{constructor(e,t){super(e,`DeserializationError`),V(this,`response`,void 0),this.response=t}},nr=class extends er{constructor(e,t,n,r){super(e,t,r,`DetailedApiError`),V(this,`error`,void 0),this.error=n}};function rr(e){let t=e;for(let n=e.length-1;n>0;n--){let r=Math.floor(Math.random()*(n+1)),i=e[n];t[n]=e[r],t[r]=i}return t}function ir(e,t,n){let r=ar(n),i=`${e.protocol}://${e.url}${e.port?`:${e.port}`:``}/${t.charAt(0)===`/`?t.substring(1):t}`;return r.length&&(i+=`?${r}`),i}function ar(e){return Object.keys(e).filter(t=>e[t]!==void 0).sort().map(t=>`${t}=${encodeURIComponent(Object.prototype.toString.call(e[t])===`[object Array]`?e[t].join(`,`):e[t]).replace(/\+/g,`%20`)}`).join(`&`)}function or(e,t){if(e.method===`GET`||e.data===void 0&&t.data===void 0)return;let n=Array.isArray(e.data)?e.data:H(H({},e.data),t.data);return JSON.stringify(n)}function sr(e,t,n){let r=H(H(H({Accept:`application/json`},e),t),n),i={};return Object.keys(r).forEach(e=>{let t=r[e];i[e.toLowerCase()]=t}),i}function cr(e){if(!(e.status===204||e.content.length===0))try{return JSON.parse(e.content)}catch(t){throw new tr(t.message,e)}}function lr({content:e,status:t},n){try{let r=JSON.parse(e);return`error`in r?new nr(r.message,t,r.error,n):new er(r.message,t,n)}catch(e){}return new er(e,t,n)}function ur({isTimedOut:e,status:t}){return!e&&~~t===0}function dr({isTimedOut:e,status:t}){return e||ur({isTimedOut:e,status:t})||~~(t/100)!=2&&~~(t/100)!=4}function fr({status:e}){return~~(e/100)==2}function pr(e){return e.map(e=>mr(e))}function mr(e){let t=e.request.headers[`x-algolia-api-key`]?{"x-algolia-api-key":`*****`}:{};return H(H({},e),{},{request:H(H({},e.request),{},{headers:H(H({},e.request.headers),t)})})}function hr({hosts:e,hostsCache:t,baseHeaders:n,logger:r,baseQueryParameters:i,algoliaAgent:a,timeouts:o,requester:s,requestsCache:c,responsesCache:l,compress:u,compression:d}){async function f(e){let n=await Promise.all(e.map(e=>t.get(e,()=>Promise.resolve(Xn(e))))),r=n.filter(e=>e.isUp()),i=n.filter(e=>e.isTimedOut()),a=[...r,...i];return{hosts:a.length>0?a:e,getTimeout(e,t){return(i.length===0&&e===0?1:i.length+3+e)*t}}}async function p(c,l,p){let m=[],h=or(c,l),g=sr(n,c.headers,l.headers),_=d===`gzip`&&h!==void 0&&h.length>750&&(c.method===`POST`||c.method===`PUT`);_&&u===void 0&&r.info(`Compression is disabled because no compress method is available.`);let v=_&&u!==void 0,y=v?await u(h):h;v&&(g[`content-encoding`]=`gzip`);let b=c.method===`GET`?H(H({},c.data),l.data):{},x=H(H(H({},i),c.queryParameters),b);if(a.value&&(x[`x-algolia-agent`]=a.value),l&&l.queryParameters)for(let e of Object.keys(l.queryParameters))!l.queryParameters[e]||Object.prototype.toString.call(l.queryParameters[e])===`[object Object]`?x[e]=l.queryParameters[e]:x[e]=l.queryParameters[e].toString();let S=0,C=async(e,n)=>{let i=e.pop();if(i===void 0)throw new $n(pr(m));let a=H(H({},o),l.timeouts),u={data:y,headers:g,method:c.method,url:ir(i,c.path,x),connectTimeout:n(S,a.connect),responseTimeout:n(S,p?a.read:a.write)},d=t=>{let n={request:u,response:t,host:i,triesLeft:e.length};return m.push(n),n},f=await s.send(u);if(dr(f)){let a=d(f);return f.isTimedOut&&S++,r.info(`Retryable failure`,mr(a)),await t.set(i,Xn(i,f.isTimedOut?`timed out`:`down`)),C(e,n)}if(fr(f))return cr(f);throw d(f),lr(f,m)},w=await f(e.filter(e=>e.accept===`readWrite`||(p?e.accept===`read`:e.accept===`write`)));return C([...w.hosts].reverse(),w.getTimeout)}function m(e,t={}){let r=()=>p(e,t,a),a=e.useReadTransporter||e.method===`GET`;if((t.cacheable||e.cacheable)!==!0)return r();let o={request:e,requestOptions:t,transporter:{queryParameters:i,headers:n}};return l.get(o,()=>c.get(o,()=>c.set(o,r()).then(e=>Promise.all([c.delete(o),e]),e=>Promise.all([c.delete(o),Promise.reject(e)])).then(([e,t])=>t)),{miss:e=>l.set(o,e)})}function h(e){return g.apply(this,arguments)}function g(){return g=Cn(function*(t,r={}){if(!s.sendStream)throw Error(`This requester does not support streaming`);let c=or(t,r),l=sr(n,t.headers,r.headers);l.accept=`text/event-stream`;let u=t.method===`GET`?H(H({},t.data),r.data):{},d=H(H(H({},i),t.queryParameters),u);if(a.value&&(d[`x-algolia-agent`]=a.value),r&&r.queryParameters)for(let e of Object.keys(r.queryParameters))!r.queryParameters[e]||Object.prototype.toString.call(r.queryParameters[e])===`[object Object]`?d[e]=r.queryParameters[e]:d[e]=r.queryParameters[e].toString();let p=t.useReadTransporter||t.method===`GET`,m=(yield Sn(f(e.filter(e=>e.accept===`readWrite`||(p?e.accept===`read`:e.accept===`write`))))).hosts[0];if(!m)throw new $n([]);let h=H(H({},o),r.timeouts),g={data:c,headers:l,method:t.method,url:ir(m,t.path,d),connectTimeout:h.connect,responseTimeout:p?h.read:h.write};yield*jn(Tn(qn(yield Sn(s.sendStream(g)))))}),g.apply(this,arguments)}return{hostsCache:t,requester:s,timeouts:o,logger:r,algoliaAgent:a,baseHeaders:n,baseQueryParameters:i,hosts:e,request:m,requestStream:h,requestsCache:c,responsesCache:l}}function gr(e,t,n){if(n==null||typeof n==`string`&&n.length===0)throw Error(`Parameter \`${e}\` is required when calling \`${t}\`.`)}function _r(){function e(e){return new Promise(t=>{let n=new XMLHttpRequest;n.open(e.method,e.url,!0),Object.keys(e.headers).forEach(t=>n.setRequestHeader(t,e.headers[t]));let r=(e,r)=>setTimeout(()=>{n.abort(),t({status:0,content:r,isTimedOut:!0})},e),i=r(e.connectTimeout,`Connection timeout`),a;n.onreadystatechange=()=>{n.readyState>n.OPENED&&a===void 0&&(clearTimeout(i),a=r(e.responseTimeout,`Socket timeout`))},n.onerror=()=>{n.status===0&&(clearTimeout(i),clearTimeout(a),t({content:n.responseText||`Network request failed`,status:n.status,isTimedOut:!1}))},n.onload=()=>{clearTimeout(i),clearTimeout(a),t({content:n.responseText,status:n.status,isTimedOut:!1})},n.send(e.data)})}return{send:e}}function vr(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function yr(e,t){if(e==null)return{};var n,r,i=vr(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}let br=[`appId`,`apiKey`,`authMode`,`algoliaAgents`],xr=[`params`],Sr=[`compression`];var Cr=`5.55.2`;function wr(e){return[{url:`${e}-dsn.algolia.net`,accept:`read`,protocol:`https`},{url:`${e}.algolia.net`,accept:`write`,protocol:`https`}].concat(rr([{url:`${e}-1.algolianet.com`,accept:`readWrite`,protocol:`https`},{url:`${e}-2.algolianet.com`,accept:`readWrite`,protocol:`https`},{url:`${e}-3.algolianet.com`,accept:`readWrite`,protocol:`https`}]))}function Tr(e){let{appId:t,apiKey:n,authMode:r,algoliaAgents:i}=e,a=yr(e,br),o=Ln(t,n,r),s=hr(H(H({hosts:wr(t)},a),{},{algoliaAgent:Rn({algoliaAgents:i,client:`Lite`,version:Cr}),baseHeaders:H(H({"content-type":`text/plain`},o.headers()),a.baseHeaders),baseQueryParameters:H(H({},o.queryParameters()),a.baseQueryParameters)}));return{transporter:s,appId:t,apiKey:n,clearCache(){return Promise.all([s.requestsCache.clear(),s.responsesCache.clear()]).then(()=>void 0)},get _ua(){return s.algoliaAgent.value},addAlgoliaAgent(e,t){s.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){!r||r===`WithinHeaders`?s.baseHeaders[`x-algolia-api-key`]=e:s.baseQueryParameters[`x-algolia-api-key`]=e},searchForHits(e,t){return this.search(e,t)},searchForFacets(e,t){return this.search(e,t)},customPost({path:e,parameters:t,body:n},r){gr(`path`,`customPost`,e);let i={method:`POST`,path:`/{path}`.replace(`{path}`,e),queryParameters:t||{},headers:{},data:n||{}};return s.request(i,r)},getRecommendations(e,t){e&&Array.isArray(e)&&(e={requests:e}),gr(`getRecommendationsParams`,`getRecommendations`,e),gr(`getRecommendationsParams.requests`,`getRecommendations`,e.requests);let n={method:`POST`,path:`/1/indexes/*/recommendations`,queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return s.request(n,t)},search(e,t){e&&Array.isArray(e)&&(e={requests:e.map(e=>{let{params:t}=e,n=yr(e,xr);return n.type===`facet`?H(H(H({},n),t),{},{type:`facet`}):H(H(H({},n),t),{},{facet:void 0,maxFacetHits:void 0,facetQuery:void 0})})}),gr(`searchMethodParams`,`search`,e),gr(`searchMethodParams.requests`,`search`,e.requests);let n={method:`POST`,path:`/1/indexes/*/queries`,queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return s.request(n,t)}}}function Er(e,t,n){if(!e||typeof e!=`string`)throw Error("`appId` is missing.");if(!t||typeof t!=`string`)throw Error("`apiKey` is missing.");let r=n||{},{compression:i}=r,a=yr(r,Sr);return Tr(H({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:zn(),requester:_r(),algoliaAgents:[{segment:`Browser`}],authMode:`WithinQueryParameters`,responsesCache:Fn(),requestsCache:Fn({serializable:!1}),hostsCache:Pn({caches:[Mn({key:`${Cr}-${e}`}),Fn()]})},a))}B();function Dr({className:e}){return z.createElement(`svg`,{viewBox:`0 0 38 38`,className:e,stroke:`currentColor`,strokeOpacity:`.5`},z.createElement(`g`,{fill:`none`,fillRule:`evenodd`},z.createElement(`g`,{transform:`translate(1 1)`,strokeWidth:`2`},z.createElement(`circle`,{strokeOpacity:`.3`,cx:`18`,cy:`18`,r:`18`}),z.createElement(`path`,{d:`M36 18c0-9.94-8.06-18-18-18`},z.createElement(`animateTransform`,{attributeName:`transform`,type:`rotate`,from:`0 18 18`,to:`360 18 18`,dur:`1s`,repeatCount:`indefinite`})))))}function Or({className:e=``}){return z.createElement(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`DocSearch-Hit-icon-sparkles ${e}`,"aria-hidden":`true`},z.createElement(`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`}),z.createElement(`path`,{d:`M20 3v4`}),z.createElement(`path`,{d:`M22 5h-4`}),z.createElement(`path`,{d:`M4 17v2`}),z.createElement(`path`,{d:`M5 18H3`}))}function kr(){return z.createElement(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`},z.createElement(`g`,{stroke:`currentColor`,fill:`none`,fillRule:`evenodd`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`path`,{d:`M3.18 6.6a8.23 8.23 0 1112.93 9.94h0a8.23 8.23 0 01-11.63 0`}),z.createElement(`path`,{d:`M6.44 7.25H2.55V3.36M10.45 6v5.6M10.45 11.6L13 13`})))}function Ar(e){if(e==null)throw TypeError(`Cannot destructure `+e)}function jr(){return jr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jr.apply(null,arguments)}function Mr(e){let t=jr({},(Ar(e),e));return z.createElement(`svg`,_({width:`20`,height:`20`,viewBox:`0 0 20 20`},t),z.createElement(`path`,{d:`M10 10l5.09-5.09L10 10l5.09 5.09L10 10zm0 0L4.91 4.91 10 10l-5.09 5.09L10 10z`,stroke:`currentColor`,fill:`none`,fillRule:`evenodd`,strokeLinecap:`round`,strokeLinejoin:`round`}))}let Nr=()=>z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`}),z.createElement(`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`}),z.createElement(`path`,{d:`M10 9H8`}),z.createElement(`path`,{d:`M16 13H8`}),z.createElement(`path`,{d:`M16 17H8`}));function Pr(e){switch(e.type){case`lvl1`:return z.createElement(Nr,null);case`content`:return z.createElement(Ir,null);default:return z.createElement(Fr,null)}}function Fr(){return z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`}),z.createElement(`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`}),z.createElement(`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`}),z.createElement(`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`}))}function Ir(){return z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),z.createElement(`polyline`,{points:`14 2 14 8 20 8`}),z.createElement(`line`,{x1:`16`,y1:`13`,x2:`8`,y2:`13`}),z.createElement(`line`,{x1:`16`,y1:`17`,x2:`8`,y2:`17`}),z.createElement(`polyline`,{points:`10 9 9 9 8 9`}))}function Lr({translations:e={}}){let{poweredByText:t=`Powered by`}=e;return z.createElement(`a`,{href:`https://www.algolia.com/ref/docsearch/?utm_source=${window.location.hostname}&utm_medium=referral&utm_content=powered_by&utm_campaign=docsearch`,target:`_blank`,rel:`noopener noreferrer`},z.createElement(`span`,{className:`DocSearch-Label`},t),z.createElement(`svg`,{width:`80`,height:`24`,"aria-label":`Algolia`,role:`img`,id:`Layer_1`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 2196.2 500`},z.createElement(`defs`,null,z.createElement(`style`,null,`.cls-1,.cls-2{fill:#003dff;}.cls-2{fill-rule:evenodd;}`)),z.createElement(`path`,{className:`cls-2`,d:`M1070.38,275.3V5.91c0-3.63-3.24-6.39-6.82-5.83l-50.46,7.94c-2.87,.45-4.99,2.93-4.99,5.84l.17,273.22c0,12.92,0,92.7,95.97,95.49,3.33,.1,6.09-2.58,6.09-5.91v-40.78c0-2.96-2.19-5.51-5.12-5.84-34.85-4.01-34.85-47.57-34.85-54.72Z`}),z.createElement(`rect`,{className:`cls-1`,x:`1845.88`,y:`104.73`,width:`62.58`,height:`277.9`,rx:`5.9`,ry:`5.9`}),z.createElement(`path`,{className:`cls-2`,d:`M1851.78,71.38h50.77c3.26,0,5.9-2.64,5.9-5.9V5.9c0-3.62-3.24-6.39-6.82-5.83l-50.77,7.95c-2.87,.45-4.99,2.92-4.99,5.83v51.62c0,3.26,2.64,5.9,5.9,5.9Z`}),z.createElement(`path`,{className:`cls-2`,d:`M1764.03,275.3V5.91c0-3.63-3.24-6.39-6.82-5.83l-50.46,7.94c-2.87,.45-4.99,2.93-4.99,5.84l.17,273.22c0,12.92,0,92.7,95.97,95.49,3.33,.1,6.09-2.58,6.09-5.91v-40.78c0-2.96-2.19-5.51-5.12-5.84-34.85-4.01-34.85-47.57-34.85-54.72Z`}),z.createElement(`path`,{className:`cls-2`,d:`M1631.95,142.72c-11.14-12.25-24.83-21.65-40.78-28.31-15.92-6.53-33.26-9.85-52.07-9.85-18.78,0-36.15,3.17-51.92,9.85-15.59,6.66-29.29,16.05-40.76,28.31-11.47,12.23-20.38,26.87-26.76,44.03-6.38,17.17-9.24,37.37-9.24,58.36,0,20.99,3.19,36.87,9.55,54.21,6.38,17.32,15.14,32.11,26.45,44.36,11.29,12.23,24.83,21.62,40.6,28.46,15.77,6.83,40.12,10.33,52.4,10.48,12.25,0,36.78-3.82,52.7-10.48,15.92-6.68,29.46-16.23,40.78-28.46,11.29-12.25,20.05-27.04,26.25-44.36,6.22-17.34,9.24-33.22,9.24-54.21,0-20.99-3.34-41.19-10.03-58.36-6.38-17.17-15.14-31.8-26.43-44.03Zm-44.43,163.75c-11.47,15.75-27.56,23.7-48.09,23.7-20.55,0-36.63-7.8-48.1-23.7-11.47-15.75-17.21-34.01-17.21-61.2,0-26.89,5.59-49.14,17.06-64.87,11.45-15.75,27.54-23.52,48.07-23.52,20.55,0,36.63,7.78,48.09,23.52,11.47,15.57,17.36,37.98,17.36,64.87,0,27.19-5.72,45.3-17.19,61.2Z`}),z.createElement(`path`,{className:`cls-2`,d:`M894.42,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-14.52,22.58-22.99,49.63-22.99,78.73,0,44.89,20.13,84.92,51.59,111.1,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47,1.23,0,2.46-.03,3.68-.09,.36-.02,.71-.05,1.07-.07,.87-.05,1.75-.11,2.62-.2,.34-.03,.68-.08,1.02-.12,.91-.1,1.82-.21,2.73-.34,.21-.03,.42-.07,.63-.1,32.89-5.07,61.56-30.82,70.9-62.81v57.83c0,3.26,2.64,5.9,5.9,5.9h50.42c3.26,0,5.9-2.64,5.9-5.9V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,206.92c-12.2,10.16-27.97,13.98-44.84,15.12-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-42.24,0-77.12-35.89-77.12-79.37,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33v142.83Z`}),z.createElement(`path`,{className:`cls-2`,d:`M2133.97,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-14.52,22.58-22.99,49.63-22.99,78.73,0,44.89,20.13,84.92,51.59,111.1,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47,1.23,0,2.46-.03,3.68-.09,.36-.02,.71-.05,1.07-.07,.87-.05,1.75-.11,2.62-.2,.34-.03,.68-.08,1.02-.12,.91-.1,1.82-.21,2.73-.34,.21-.03,.42-.07,.63-.1,32.89-5.07,61.56-30.82,70.9-62.81v57.83c0,3.26,2.64,5.9,5.9,5.9h50.42c3.26,0,5.9-2.64,5.9-5.9V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,206.92c-12.2,10.16-27.97,13.98-44.84,15.12-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-42.24,0-77.12-35.89-77.12-79.37,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33v142.83Z`}),z.createElement(`path`,{className:`cls-2`,d:`M1314.05,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-11.79,18.34-19.6,39.64-22.11,62.59-.58,5.3-.88,10.68-.88,16.14s.31,11.15,.93,16.59c4.28,38.09,23.14,71.61,50.66,94.52,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47h0c17.99,0,34.61-5.93,48.16-15.97,16.29-11.58,28.88-28.54,34.48-47.75v50.26h-.11v11.08c0,21.84-5.71,38.27-17.34,49.36-11.61,11.08-31.04,16.63-58.25,16.63-11.12,0-28.79-.59-46.6-2.41-2.83-.29-5.46,1.5-6.27,4.22l-12.78,43.11c-1.02,3.46,1.27,7.02,4.83,7.53,21.52,3.08,42.52,4.68,54.65,4.68,48.91,0,85.16-10.75,108.89-32.21,21.48-19.41,33.15-48.89,35.2-88.52V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,64.1s.65,139.13,0,143.36c-12.08,9.77-27.11,13.59-43.49,14.7-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-1.32,0-2.63-.03-3.94-.1-40.41-2.11-74.52-37.26-74.52-79.38,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33Z`}),z.createElement(`path`,{className:`cls-1`,d:`M249.83,0C113.3,0,2,110.09,.03,246.16c-2,138.19,110.12,252.7,248.33,253.5,42.68,.25,83.79-10.19,120.3-30.03,3.56-1.93,4.11-6.83,1.08-9.51l-23.38-20.72c-4.75-4.21-11.51-5.4-17.36-2.92-25.48,10.84-53.17,16.38-81.71,16.03-111.68-1.37-201.91-94.29-200.13-205.96,1.76-110.26,92-199.41,202.67-199.41h202.69V407.41l-115-102.18c-3.72-3.31-9.42-2.66-12.42,1.31-18.46,24.44-48.53,39.64-81.93,37.34-46.33-3.2-83.87-40.5-87.34-86.81-4.15-55.24,39.63-101.52,94-101.52,49.18,0,89.68,37.85,93.91,85.95,.38,4.28,2.31,8.27,5.52,11.12l29.95,26.55c3.4,3.01,8.79,1.17,9.63-3.3,2.16-11.55,2.92-23.58,2.07-35.92-4.82-70.34-61.8-126.93-132.17-131.26-80.68-4.97-148.13,58.14-150.27,137.25-2.09,77.1,61.08,143.56,138.19,145.26,32.19,.71,62.03-9.41,86.14-26.95l150.26,133.2c6.44,5.71,16.61,1.14,16.61-7.47V9.48C499.66,4.25,495.42,0,490.18,0H249.83Z`})))}function Rr(){if(typeof window>`u`||!window.localStorage)return 0;let e=0;for(let t in window.localStorage)window.localStorage.hasOwnProperty(t)&&(e+=window.localStorage[t].length+t.length);return e}function zr(){if(typeof window>`u`||!window.localStorage)return;let e=[];for(let t in window.localStorage)if(t.includes(`__DOCSEARCH_`)){let n=window.localStorage[t];e.push({key:t,size:n.length+t.length})}e.sort((e,t)=>t.size-e.size);let t=Math.ceil(e.length/2);for(let n=0;n<t&&n<e.length;n++)try{window.localStorage.removeItem(e[n].key)}catch(e){}}function Br(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(n){if(n instanceof DOMException&&n.name===`QuotaExceededError`)try{zr(),window.localStorage.setItem(e,JSON.stringify(t))}catch(e){}}}function Vr(){typeof window>`u`||!window.localStorage||Rr()>4*1024*1024&&zr()}function Hr(){if(typeof window>`u`||!(`localStorage`in window))return!1;let e=`__TEST_KEY__`;try{return window.localStorage.setItem(e,``),window.localStorage.removeItem(e),!0}catch(e){return!1}}function Ur(e){return Hr()===!1?{setItem(){},getItem(){return[]}}:{setItem(t){Br(e,t)},getItem(){let t=window.localStorage.getItem(e);if(t===null)return[];try{let e=JSON.parse(t);return Array.isArray(e)?e:[]}catch(t){return window.localStorage.removeItem(e),[]}}}}let Wr=[`_highlightResult`,`_snippetResult`];function Gr({key:e,limit:t=5}){let n=Ur(e),r=n.getItem().slice(0,t);return{add(e){let i=e,{_highlightResult:a,_snippetResult:o}=i,s=mn(i,Wr),c=r.findIndex(e=>e.objectID===s.objectID);c>-1&&r.splice(c,1),r.unshift(s),r=r.slice(0,t),n.setItem(r)},remove(e){r=r.filter(t=>t.objectID!==e.objectID),n.setItem(r)},getAll(){return r}}}function Kr({key:e,limit:t=5}){let n=Ur(e),r=n.getItem().slice(0,t);return{add(e){let{objectID:i,query:a}=e,o=r.findIndex(e=>e.objectID===i||e.query===a);o>-1?r[o]=e:(r.unshift(e),r=r.slice(0,t)),n.setItem(r)},addFeedback(e,t,i){let a=r.find(t=>{var n;return(n=t.messages)==null?void 0:n.some(t=>t.id===e)});if(!a||!a.messages)return;let o=a.messages.find(t=>t.id===e);o&&(o.feedback=t,o.feedbackTags=i==null?void 0:i.tags,o.feedbackNotes=i==null?void 0:i.notes,n.setItem(r))},getOne(e){var t;let n=r.find(t=>{var n;return(n=t.messages)==null?void 0:n.some(t=>t.id===e)});return n==null||(t=n.messages)==null?void 0:t.find(t=>t.id===e)},getAll(){return r},remove(e){r=r.filter(t=>t.objectID!==e.objectID),n.setItem(r)},getConversation(e){let t=r.find(t=>{var n;return(n=t.messages)==null?void 0:n.some(t=>t.id===e)});if(!(!t||!t.messages))return t}}}function qr(e,t,n){return z.useMemo(()=>{let r=Er(e,t);return r.addAlgoliaAgent(`docsearch`,bn),/docsearch.js \(.*\)/.test(r.transporter.algoliaAgent.value)===!1&&r.addAlgoliaAgent(`docsearch-react`,bn),n(r)},[e,t,n])}function Jr(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}let Yr=Jr(`https://base-ui.com/production-error`,`Base UI`);B();let Xr=he(void 0);function Zr(e){let t=ze(Xr);if(t===void 0&&!e)throw Error(Yr(33));return t}B();let Qr=he(void 0);function $r(e){let t=ze(Qr);if(t===void 0&&!e)throw Error(Yr(36));return t}B();let ei={};function ti(e,t){let n=L(ei);return n.current===ei&&(n.current=e(t)),n}function ni(e,t,n,r){let i=ti(ii).current;return ai(i,e,t,n,r)&&si(i,[e,t,n,r]),i.callback}function ri(e){let t=ti(ii).current;return oi(t,e)&&si(t,e),t.callback}function ii(){return{callback:null,cleanup:null,refs:[]}}function ai(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function oi(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function si(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}B();let ci=parseInt(cn,10);function li(e){return ci>=e}B();function ui(e){var t;if(!Pt(e))return null;let n=e,r=n.props;return(t=li(19)?r==null?void 0:r.ref:n.ref)==null?null:t}function di(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return H(H({},e),t)}function fi(){}let pi=Object.freeze([]),mi=Object.freeze({});function hi(e,t){let n={};for(let r in e){let i=e[r];if(t!=null&&t.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function gi(e,t){return typeof e==`function`?e(t):e}function _i(e,t){return typeof e==`function`?e(t):e}let vi={};function yi(e,t,n,r,i){if(!n&&!r&&!i&&!e)return xi(t);let a=xi(e);return t&&(a=Si(a,t)),n&&(a=Si(a,n)),r&&(a=Si(a,r)),i&&(a=Si(a,i)),a}function bi(e){if(e.length===0)return vi;if(e.length===1)return xi(e[0]);let t=xi(e[0]);for(let n=1;n<e.length;n+=1)t=Si(t,e[n]);return t}function xi(e){return Ei(e)?H({},Di(e,vi)):Ci(e)}function Si(e,t){return Ei(t)?Di(t,e):wi(e,t)}function Ci(e){let t=H({},e);for(let e in t){let n=t[e];Ti(e,n)&&(t[e]=ki(n))}return t}function wi(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=di(e.style,r);break;case`className`:e[n]=ji(e.className,r);break;default:Ti(n,r)?e[n]=Oi(e[n],r):e[n]=r}}return e}function Ti(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Ei(e){return typeof e==`function`}function Di(e,t){return Ei(e)?e(t):e==null?vi:e}function Oi(e,t){return t?e?(...n)=>{let r=n[0];if(Mi(r)){let i=r;Ai(i);let a=t(...n);return i.baseUIHandlerPrevented||e==null||e(...n),a}let i=t(...n);return e==null||e(...n),i}:ki(t):e}function ki(e){return e&&((...t)=>{let n=t[0];return Mi(n)&&Ai(n),e(...t)})}function Ai(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function ji(e,t){return t?e?t+` `+e:t:e}function Mi(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}B();function Ni(e,t,n={}){var r;let i=t.render,a=Pi(t,n);return n.enabled===!1?null:Li(e,i,a,(r=n.state)==null?mi:r)}function Pi(e,t={}){var n;let{className:r,style:i,render:a}=e,{state:o=mi,ref:s,props:c,stateAttributesMapping:l,enabled:u=!0}=t,d=u?gi(r,o):void 0,f=u?_i(i,o):void 0,p=u?hi(o,l):mi,m=u&&c?Fi(c):void 0,h=u?(n=di(p,m))==null?{}:n:mi;return typeof document<`u`&&(u?Array.isArray(s)?h.ref=ri([h.ref,ui(a),...s]):h.ref=ni(h.ref,ui(a),s):ni(null,null)),u?(d!==void 0&&(h.className=ji(h.className,d)),f!==void 0&&(h.style=di(h.style,f)),h):mi}function Fi(e){return Array.isArray(e)?bi(e):yi(void 0,e)}let Ii=Symbol.for(`react.lazy`);function Li(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=yi(n,t.props);e.ref=n.ref;let i=t;return(i==null?void 0:i.$$typeof)===Ii&&(i=Kt.toArray(t)[0]),Lt(i,e)}if(e&&typeof e==`string`)return Ri(e,n);throw Error(Yr(8))}function Ri(e,t){return e===`button`?C(`button`,H(H({type:`button`},t),{},{key:t.key})):e===`img`?C(`img`,H(H({alt:``},t),{},{key:t.key})):C(e,t)}let zi=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),Bi={[zi.startingStyle]:``},Vi={[zi.endingStyle]:``},Hi={transitionStatus(e){return e===`starting`?Bi:e===`ending`?Vi:null}},Ui=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=zi.startingStyle]=`startingStyle`,e[e.endingStyle=zi.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),Wi=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),Gi={[Wi.popupOpen]:``},Ki={[Wi.popupOpen]:``,[Wi.pressed]:``},qi={[Ui.open]:``},Ji={[Ui.closed]:``},Yi={[Ui.anchorHidden]:``},Xi={open(e){return e?Gi:null}},Zi={open(e){return e?Ki:null}},Qi={open(e){return e?qi:Ji},anchorHidden(e){return e?Yi:null}};B();let $i=he(void 0);function ea(e=!0){let t=ze($i);if(t===void 0&&!e)throw Error(Yr(25));return t}let ta=`trigger-press`,na=`trigger-hover`,ra=`trigger-focus`,ia=`item-press`,aa=`focus-out`,oa=`list-navigation`,sa=`sibling-open`,ca=`imperative-action`;B();function la({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=L(e!==void 0),[a,o]=Ne(t);return[i?e:a,Re(e=>{i||o(e)},[])]}function ua(){return typeof window<`u`}function da(e){return ma(e)?(e.nodeName||``).toLowerCase():`#document`}function fa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pa(e){var t;return(t=(ma(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ma(e){return ua()?e instanceof Node||e instanceof fa(e).Node:!1}function ha(e){return ua()?e instanceof Element||e instanceof fa(e).Element:!1}function ga(e){return ua()?e instanceof HTMLElement||e instanceof fa(e).HTMLElement:!1}function _a(e){return!ua()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof fa(e).ShadowRoot}function va(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ka(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ya(e){return/^(table|td|th)$/.test(da(e))}function ba(e){try{if(e.matches(`:popover-open`))return!0}catch(e){}try{return e.matches(`:modal`)}catch(e){return!1}}let xa=/transform|translate|scale|rotate|perspective|filter/,Sa=/paint|layout|strict|content/,Ca=e=>!!e&&e!==`none`,wa;function Ta(e){let t=ha(e)?ka(e):e;return Ca(t.transform)||Ca(t.translate)||Ca(t.scale)||Ca(t.rotate)||Ca(t.perspective)||!Da()&&(Ca(t.backdropFilter)||Ca(t.filter))||xa.test(t.willChange||``)||Sa.test(t.contain||``)}function Ea(e){let t=ja(e);for(;ga(t)&&!Oa(t);){if(Ta(t))return t;if(ba(t))return null;t=ja(t)}return null}function Da(){return wa==null&&(wa=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`)),wa}function Oa(e){return/^(html|body|#document)$/.test(da(e))}function ka(e){return fa(e).getComputedStyle(e)}function Aa(e){return ha(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ja(e){if(da(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||_a(e)&&e.host||pa(e);return _a(t)?t.host:t}function Ma(e){let t=ja(e);return Oa(t)?(e.ownerDocument||e).body:ga(t)&&va(t)?t:Ma(t)}function Na(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);let i=Ma(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=fa(i);if(a){let e=Pa(o);return t.concat(o,o.visualViewport||[],va(i)?i:[],e&&n?Na(e):[])}else return t.concat(i,Na(i,[],n))}function Pa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}B();let Fa=H({},dt),Ia=Fa.useInsertionEffect,La=Ia&&Ia!==Fa.useLayoutEffect?Ia:e=>e();function Ra(e){let t=ti(za).current;return t.next=e,La(t.effect),t.trampoline}function za(){let e={next:void 0,callback:Ba,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function Ba(){}B();let U=typeof document<`u`?Ie:()=>{};B();let Va=he(void 0);function Ha(e=!1){let t=ze(Va);if(t===void 0&&!e)throw Error(Yr(16));return t}B();function Ua(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:R(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}B();let Wa=[`onClick`,`onMouseDown`,`onKeyUp`,`onKeyDown`,`onPointerDown`];function Ga(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=L(null),s=Ha(!0),c=a==null?s!==void 0:a,{props:l}=Ua({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=Re(()=>{let e=o.current;Ka(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return U(u,[u]),{getButtonProps:Re((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s}=e,u=yr(e,Wa);return yi({onClick(e){if(t){e.preventDefault();return}n==null||n(e)},onMouseDown(e){t||r==null||r(e)},onKeyDown(e){if(t||(Ai(e),o==null||o(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,a=e.currentTarget,s=Ka(a),l=!i&&qa(a),u=r&&(i?s:!l),d=e.key===`Enter`,f=e.key===` `,p=a.getAttribute(`role`),m=(p==null?void 0:p.startsWith(`menuitem`))||p===`option`||p===`gridcell`;if(r&&c&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),l||i&&s?(a.click(),e.preventBaseUIHandler()):u&&(n==null||n(e),e.preventBaseUIHandler());return}u&&(!i&&(f||d)&&e.preventDefault(),!i&&d&&(n==null||n(e)))},onKeyUp(e){if(!t){if(Ai(e),a==null||a(e),e.target===e.currentTarget&&i&&c&&Ka(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&e.key===` `&&(n==null||n(e))}},onPointerDown(e){if(t){e.preventDefault();return}s==null||s(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Ra(e=>{o.current=e,u()})}}function Ka(e){return ga(e)&&e.tagName===`BUTTON`}function qa(e){return!!((e==null?void 0:e.tagName)===`A`&&e!=null&&e.href)}function Ja(){var e,t;return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:(e=navigator.platform)==null?``:e,maxTouchPoints:(t=navigator.maxTouchPoints)==null?0:t}}let{userAgent:Ya,platform:Xa,maxTouchPoints:Za}=Ja(),Qa=Ya.toLowerCase(),$a=Xa.toLowerCase(),eo=/^i(os$|p)/.test($a)||$a===`macintel`&&Za>1,to=`android`,no=$a===to||Qa.includes(to),ro=!eo&&$a.startsWith(`mac`);$a.startsWith(`win`),!no&&/^(linux|chrome os)/.test($a);let io=ro||eo;var ao,oo;let so=typeof CSS<`u`&&!!((ao=(oo=CSS).supports)!=null&&ao.call(oo,`-webkit-backdrop-filter:none`));!so&&Qa.includes(`firefox`),!so&&Qa.includes(`chrom`);let co=io,lo=/jsdom|happydom/.test(Qa);B();function uo(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=ea(!0),f=d!==void 0;return R(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o!=null&&o.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:ia})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!ro&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&(!c||c.type===`regular-item`)&&s.current.click()}}),[t,n,r,l,i,u,a,o,s,d,f,c])}B();let fo={type:`regular-item`};function po(e){let{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=a.useState(`disabled`),d=n||u,f=L(null),{getButtonProps:p,buttonRef:m}=Ga({disabled:d,focusableWhenDisabled:!0,native:s,composite:!0}),h=uo({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:f,itemMetadata:c}),g=Re(e=>yi(h,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,p),[h,p,c]),_=ni(f,m);return R(()=>({getItemProps:g,itemRef:_}),[g,_])}B();let mo=he({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function ho(){return ze(mo)}B();let go=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function _o(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=ho(),f=L(-1),[p,m]=Ne(a==null?i===go.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1:a),h=L(null),g=Re(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){var n,i;let a=t!==void 0;u.current[p]=a?t:(n=r==null||(i=r.current)==null?void 0:i.textContent)==null?e.textContent:n}},[p,l,u,t,r]);return U(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),U(()=>{if(a==null)return c(e=>{var t;let n=h.current?(t=e.get(h.current))==null?void 0:t.index:null;n!=null&&m(n)})},[a,c,m]),{ref:g,index:p}}B();let vo=0;function yo(e,t=`mui`){let[n,r]=Ne(e),i=e||n;return Fe(()=>{n==null&&(vo+=1,r(`${t}-${vo}`))},[n,t]),i}let bo=Fa.useId;function xo(e,t){if(bo!==void 0){let n=bo();return e==null?t?`${t}-${n}`:n:e}return yo(e,t)}function So(e){return xo(e,`base-ui`)}let Co=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.highlighted=`data-highlighted`,e}({}),wo=H({checked(e){return e?{[Co.checked]:``}:{[Co.unchecked]:``}}},Hi);function To(e,t,n,r){let i=!1,a=!1,o=r==null?mi:r;return H({reason:e,event:t==null?new Event(`base-ui`):t,cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n},o)}je();var Eo=0;Array.isArray;function W(e,t,n,r,i,a){t||(t={});var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Eo,__i:-1,__u:0,__source:i,__self:a};return I.vnode&&I.vnode(l),l}B(),B();let Do=[];function Oo(e){Fe(e,Do)}globalThis.requestAnimationFrame;let ko=new class{constructor(){V(this,`callbacks`,[]),V(this,`callbacksCount`,0),V(this,`nextId`,1),V(this,`startId`,1),V(this,`isScheduled`,!1),V(this,`tick`,e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1){var r;(r=t[n])==null||r.call(t,e)}})}request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}};var Ao=class e{constructor(){V(this,`currentId`,null),V(this,`cancel`,()=>{this.currentId!==null&&(ko.cancel(this.currentId),this.currentId=null)}),V(this,`disposeEffect`,()=>this.cancel)}static create(){return new e}static request(e){return ko.request(e)}static cancel(e){return ko.cancel(e)}request(e){this.cancel(),this.currentId=ko.request(()=>{this.currentId=null,e()})}};function jo(){let e=ti(Ao.create).current;return Oo(e.disposeEffect),e}B();function Mo(e,t=!1,n=!1){let[r,i]=Ne(e&&t?`idle`:void 0),[a,o]=Ne(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),U(()=>{if(!e&&a&&r!==`ending`&&n){let e=Ao.request(()=>{i(`ending`)});return()=>{Ao.cancel(e)}}},[e,a,r,n]),U(()=>{if(!e||t)return;let n=Ao.request(()=>{i(void 0)});return()=>{Ao.cancel(n)}},[t,e]),U(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Ao.request(()=>{i(`idle`)});return()=>{Ao.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function No(e){return e==null?e:`current`in e?e.current:e}B();function Po(e,t=!1,n=!0){let r=jo();return Ra((i,a=null)=>{r.cancel();let o=No(e);if(o==null)return;let s=o,c=()=>{ln(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a!=null&&a.aborted||c()}).catch(()=>{if(n){a!=null&&a.aborted||c();return}let e=s.getAnimations();!(a!=null&&a.aborted)&&e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&l()})}if(t){let e=zi.startingStyle;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a==null||a.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}B();function Fo(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=Ra(i),o=Po(r,n,!1);Fe(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}B();let Io=he(void 0);function Lo(){let e=ze(Io);if(e===void 0)throw Error(Yr(31));return e}B();let Ro=[`render`,`className`,`style`,`id`],zo=bt(function(e,t){let{render:n,className:r,style:i,id:a}=e,o=yr(e,Ro),s=So(a),c=Lo();return U(()=>(c(s),()=>{c(void 0)}),[c,s]),Ni(`div`,e,{ref:t,props:H({id:s,role:`presentation`},o)})});var Bo=class e{constructor(){V(this,`currentId`,0),V(this,`clear`,()=>{this.currentId!==0&&(clearTimeout(this.currentId),this.currentId=0)}),V(this,`disposeEffect`,()=>this.clear)}static create(){return new e}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=0,t()},e)}isStarted(){return this.currentId!==0}};function Vo(){let e=ti(Bo.create).current;return Oo(e.disposeEffect),e}function Ho(e){e.preventDefault(),e.stopPropagation()}function Uo(e){return`nativeEvent`in e}function Wo(e){return e.pointerType===``&&e.isTrusted?!0:no&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Go(e){return lo?!1:!no&&e.width===0&&e.height===0||no&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Ko(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function qo(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}let Jo=`ArrowLeft`,Yo=`ArrowRight`;function Xo(e){var t;let n=e.activeElement;for(;(n==null||(t=n.shadowRoot)==null?void 0:t.activeElement)!=null;)n=n.shadowRoot.activeElement;return n}function Zo(e,t){var n;if(!e||!t)return!1;let r=(n=t.getRootNode)==null?void 0:n.call(t);if(e.contains(t))return!0;if(r&&_a(r)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Qo(e){return`composedPath`in e?e.composedPath()[0]:e.target}function $o(e,t){if(!ha(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(Zo(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function es(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function ts(e){return e.matches(`html,body`)}function ns(e){return ga(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function rs(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`))!=null}function is(e){return e?e.getAttribute(`role`)===`combobox`&&ns(e):!1}function as(e){if(!e||lo)return!0;try{return e.matches(`:focus-visible`)}catch(e){return!0}}function os(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function ss(e,t){return t!=null&&!Ko(t)?0:typeof e==`function`?e():e}function cs(e,t,n){let r=ss(e,n);return typeof r==`number`?r:r==null?void 0:r[t]}function ls(e){return typeof e==`function`?e():e}function us(e,t){return t||e===`click`||e===`mousedown`}function ds(e){return(e==null?void 0:e.includes(`mouse`))&&e!==`mousedown`}function fs(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function ps(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function ms(e){let t=ti(hs,e).current;return t.next=e,U(t.effect),t}function hs(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function gs(e){return(e==null?void 0:e.ownerDocument)||document}let _s={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},vs=H(H({},_s),{},{position:`fixed`,top:0,left:0});H(H({},_s),{},{position:`absolute`}),B();let ys=bt(function(e,t){let[n,r]=Ne();U(()=>{co&&so&&r(`button`)},[]);let i={tabIndex:0,role:n};return W(`span`,H(H(H({},e),{},{ref:t,style:vs,"aria-hidden":!n||void 0},i),{},{"data-base-ui-focus-guard":``}))}),bs=[`top`,`right`,`bottom`,`left`],xs=Math.min,Ss=Math.max,Cs=Math.round,ws=Math.floor,Ts=e=>({x:e,y:e}),Es={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ds(e,t,n){return Ss(e,xs(t,n))}function Os(e,t){return typeof e==`function`?e(t):e}function ks(e){return e.split(`-`)[0]}function As(e){return e.split(`-`)[1]}function js(e){return e===`x`?`y`:`x`}function Ms(e){return e===`y`?`height`:`width`}function Ns(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ps(e){return js(Ns(e))}function Fs(e,t,n){n===void 0&&(n=!1);let r=As(e),i=Ps(e),a=Ms(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ws(o)),[o,Ws(o)]}function Is(e){let t=Ws(e);return[Ls(e),t,Ls(t)]}function Ls(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}let Rs=[`left`,`right`],zs=[`right`,`left`],Bs=[`top`,`bottom`],Vs=[`bottom`,`top`];function Hs(e,t,n){switch(e){case`top`:case`bottom`:return n?t?zs:Rs:t?Rs:zs;case`left`:case`right`:return t?Bs:Vs;default:return[]}}function Us(e,t,n,r){let i=As(e),a=Hs(ks(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ls)))),a}function Ws(e){let t=ks(e);return Es[t]+e.slice(t.length)}function Gs(e){var t,n,r,i;return{top:(t=e.top)==null?0:t,right:(n=e.right)==null?0:n,bottom:(r=e.bottom)==null?0:r,left:(i=e.left)==null?0:i}}function Ks(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Gs(e)}function qs(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Js(e,t){return t<0||t>=e.length}function Ys(e,t){return Zs(e.current,{disabledIndices:t})}function Xs(e,t){return Zs(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Zs(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Qs(e,a,r));return a}function Qs(e,t,n){var r;if(typeof n==`function`?n(t):(r=n==null?void 0:n.includes(t))!=null&&r)return!0;let i=e[t];return i?!ec(i)||!n&&(i.hasAttribute(`disabled`)||i.getAttribute(`aria-disabled`)===`true`):!1}function $s(e){return e.visibility===`hidden`||e.visibility===`collapse`}function ec(e,t=e?ka(e):null){return!e||!e.isConnected||!t||$s(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}function tc(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return _a(n)?n.host:null}function nc(e){for(let t of Array.from(e.children))if(da(t)===`summary`)return t;return null}function rc(e,t){let n=nc(t);return!!n&&(e===n||Zo(n,e))}function ic(e){let t=e?da(e):``;return e!=null&&e.matches(`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`)&&(t!==`summary`||e.parentElement!=null&&da(e.parentElement)===`details`&&nc(e.parentElement)===e)&&(t!==`details`||nc(e)==null)&&(t!==`input`||e.type!==`hidden`)}function ac(e){if(!ic(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=tc(t)){let n=t!==e,r=da(t)===`slot`;if(t.hasAttribute(`inert`)||n&&da(t)===`details`&&!t.open&&!rc(e,t)||t.hasAttribute(`hidden`)||!r&&!oc(t,n))return!1}return!0}function oc(e,t){let n=ka(e);return t?n.display!==`none`:ec(e,n)}function sc(e){let t=e.tabIndex;if(t<0){let t=da(e);if(t===`details`||t===`audio`||t===`video`||ga(e)&&e.isContentEditable)return 0}return t}function cc(e){if(da(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function lc(e,t){let n=cc(e);if(!n)return!0;let r=t.find(e=>{let t=cc(e);return(t==null?void 0:t.name)===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=cc(e);return(t==null?void 0:t.name)===n.name&&t.form===n.form})===n}function uc(e){if(ga(e)&&da(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return ga(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function dc(e,t){uc(e).forEach(e=>{ic(e)&&t.push(e),dc(e,t)})}function fc(e,t,n){uc(e).forEach(e=>{ga(e)&&e.matches(t)&&n.push(e),fc(e,t,n)})}function pc(e){return ac(e)&&sc(e)>=0}function mc(e){let t=[];return dc(e,t),t.filter(ac)}function hc(e){let t=mc(e);return t.filter(e=>sc(e)>=0&&lc(e,t))}function gc(e,t){let n=hc(e),r=n.length;if(r===0)return;let i=Xo(gs(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function _c(e){return gc(gs(e).body,1)||e}function vc(e){return gc(gs(e).body,-1)||e}function yc(e,t){if(!e)return null;let n=hc(gs(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function bc(e){return yc(e,1)}function xc(e){return yc(e,-1)}function Sc(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Zo(n,r)}function Cc(e){hc(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function wc(e){let t=[];fc(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Tc(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>{var r;return[...!n||(r=t.context)!=null&&r.open?[t]:[],...Tc(e,t.id,n)]})}function Ec(e,t){var n;let r=[],i=(n=e.find(e=>e.id===t))==null?void 0:n.parentId;for(;i;){let t=e.find(e=>e.id===i);i=t==null?void 0:t.parentId,t&&(r=r.concat(t))}return r}function Dc(e){return`data-base-ui-${e}`}let Oc=0;function kc(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Oc);function a(){i&&!i()||e==null||e.focus({preventScroll:n})}if(r)return a(),fi;let o=requestAnimationFrame(a);return Oc=o,()=>{Oc===o&&(cancelAnimationFrame(o),Oc=0)}}let Ac={inert:new WeakMap,"aria-hidden":new WeakMap},jc=`data-base-ui-inert`,Mc={inert:new WeakSet,"aria-hidden":new WeakSet},Nc=new WeakMap,Pc=0;function Fc(e){return Mc[e]}function Ic(e){return e?_a(e)?e.host:Ic(e.parentNode):null}let Lc=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Ic(t);return e.contains(n)?n:null}).filter(e=>e!=null),Rc=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},zc=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{da(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Bc(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=Lc(t,e),l=i?zc(t,Rc(c),new Set(c)):[],u=[],d=[];if(a){let e=Ac[a],n=Fc(a);s=n,o=e;let r=Lc(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);zc(t,Rc(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(Nc.get(e)||0)+1;Nc.set(e,t),d.push(e),t===1&&e.setAttribute(jc,``)}),Pc+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!(s!=null&&s.has(e))&&a&&e.removeAttribute(a),s==null||s.delete(e))}),i&&d.forEach(e=>{let t=(Nc.get(e)||0)-1;Nc.set(e,t),t||e.removeAttribute(jc)}),--Pc,Pc||(Ac.inert=new WeakMap,Ac[`aria-hidden`]=new WeakMap,Mc.inert=new WeakSet,Mc[`aria-hidden`]=new WeakSet,Nc=new WeakMap)}}function Vc(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=gs(e[0]).body;return Bc(e,a,n,r,{mark:i})}let Hc={style:{transition:`none`}},Uc={fallbackAxisSide:`none`},Wc={fallbackAxisSide:`end`},Gc={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};B();let Kc=[`render`,`className`,`style`,`children`,`container`,`renderGuards`],qc=he(null),Jc=()=>ze(qc),Yc=Dc(`portal`);function Xc(e={}){let{ref:t,container:n,componentProps:r=mi,elementProps:i}=e,a=xo(),o=Jc(),s=o==null?void 0:o.portalNode,[c,l]=Ne(null),[u,d]=Ne(null),f=Ra(e=>{e!==null&&d(e)}),p=L(null);U(()=>{var e,t;if(n===null){p.current&&(p.current=null,d(null),l(null));return}if(a==null)return;let r=(e=(t=n&&(ma(n)?n:n.current))==null?s:t)==null?document.body:e;if(r==null){p.current&&(p.current=null,d(null),l(null));return}p.current!==r&&(p.current=r,d(null),l(r))},[n,s,a]);let m=Ni(`div`,r,{ref:[t,f],props:[{id:a,[Yc]:``},i]});return{portalNode:u,portalSubtree:c&&m?Dt(m,c):null}}let Zc=bt(function(e,t){let{render:n,className:r,style:i,children:a,container:o,renderGuards:s}=e,{portalNode:c,portalSubtree:l}=Xc({container:o,ref:t,componentProps:e,elementProps:yr(e,Kc)}),u=L(null),d=L(null),f=L(null),p=L(null),[m,h]=Ne(null),g=L(!1),_=m==null?void 0:m.modal,v=m==null?void 0:m.open,y=typeof s==`boolean`?s:!!m&&!m.modal&&m.open&&!!c;Fe(()=>{if(!c||_)return;function e(e){c&&e.relatedTarget&&Sc(e)&&(e.type===`focusin`?g.current&&(wc(c),g.current=!1):(Cc(c),g.current=!0))}return ps(fs(c,`focusin`,e,!0),fs(c,`focusout`,e,!0))},[c,_]),U(()=>{!c||v!==!0||!g.current||(wc(c),g.current=!1)},[v,c]);let b=R(()=>({beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:f,afterInsideRef:p,portalNode:c,setFocusManagerState:h}),[c]);return W(E,{children:[l,W(qc.Provider,{value:b,children:[y&&c&&W(ys,{"data-type":`outside`,ref:u,onFocus:e=>{if(Sc(e,c)){var t;(t=f.current)==null||t.focus()}else{let e=vc(m?m.domReference:null);e==null||e.focus()}}}),y&&c&&W(`span`,{"aria-owns":c.id,style:Gc}),c&&Dt(a,c),y&&c&&W(ys,{"data-type":`outside`,ref:d,onFocus:e=>{if(Sc(e,c)){var t;(t=p.current)==null||t.focus()}else{let t=_c(m?m.domReference:null);t==null||t.focus(),m!=null&&m.closeOnFocusOut&&(m==null||m.onOpenChange(!1,To(`focus-out`,e.nativeEvent)))}}})]})]})});function Qc(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var $c=class{constructor(){V(this,`nodesRef`,{current:[]}),V(this,`events`,Qc())}addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}};B();let el=he(null),tl=he(null),nl=()=>{var e;return((e=ze(el))==null?void 0:e.id)||null},rl=e=>{let t=ze(tl);return e==null?t:e};function il(e){let t=xo(),n=rl(e),r=nl();return U(()=>{if(!t)return;let e={id:t,parentId:r};return n==null||n.addNode(e),()=>{n==null||n.removeNode(e)}},[n,t,r]),t}function al(e){let{children:t,id:n}=e,r=nl();return W(el.Provider,{value:R(()=>({id:n,parentId:r}),[n,r]),children:t})}function ol(e){let{children:t,externalTree:n}=e,r=ti(()=>n==null?new $c:n).current;return W(tl.Provider,{value:r,children:t})}B();function sl(e,t){let n=fa(Qo(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}let cl=[];function ll(){cl=cl.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function ul(e){ll(),e&&da(e)!==`body`&&(cl.push(new WeakRef(e)),cl.length>20&&(cl=cl.slice(-20)))}function dl(){var e;return ll(),(e=cl[cl.length-1])==null?void 0:e.deref()}function fl(e){return e?pc(e)?e:hc(e)[0]||e:null}function pl(e){var t;if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!((t=e.getAttribute(`role`))!=null&&t.includes(`dialog`)))return;let n=mc(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return pc(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),r=e.getAttribute(`tabindex`);n.length===0?r!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(r!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function ml(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=Ra(()=>{var e;return(e=b.current.floatingContext)==null?void 0:e.nodeId}),S=i===!1,C=is(_)&&S,w=ms(i),T=ms(a),D=ms(l),O=ms(g),k=rl(p),A=Jc(),j=L(!1),M=L(!1),ee=L(!1),N=L(null),te=L(``),ne=L(``),P=L(null),re=L(null),ie=ni(P,f,A==null?void 0:A.beforeInsideRef),ae=ni(re,A==null?void 0:A.afterInsideRef),oe=Vo(),se=Vo(),ce=jo(),le=A!=null,F=os(v),ue=Ra((e=F)=>e?hc(e):[]),de=Ra(()=>{var e;return(e=m==null?void 0:m().filter(e=>e!=null))==null?[]:e});Fe(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&Zo(F,Xo(gs(F)))&&ue().length===0&&!C&&Ho(e)}return fs(gs(F),`keydown`,e)},[r,F,s,C,ue]),Fe(()=>{if(r||!g)return;let e=gs(F);function t(){ee.current=!1}function n(e){let t=Qo(e),n=de(),r=Zo(v,t)||Zo(_,t)||Zo(A==null?void 0:A.portalNode,t)||n.some(e=>e===t||Zo(e,t));ee.current=!r,ne.current=e.pointerType||`keyboard`,t!=null&&t.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,se.start(0,()=>{M.current=!1}))}function i(){ne.current=`keyboard`}return ps(fs(e,`pointerdown`,n,!0),fs(e,`pointerup`,t,!0),fs(e,`pointercancel`,t,!0),fs(e,`keydown`,i,!0),t)},[r,v,_,F,g,A,se,de]),Fe(()=>{if(r||!c)return;let e=gs(F);function t(){M.current=!0,se.start(0,()=>{M.current=!1})}function n(e){let t=Qo(e);pc(t)&&(N.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=Qo(t);s&&n==null&&i!=null&&Zo(v,i)&&ul(i),queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=de(),f=(n==null?void 0:n.hasAttribute(Dc(`focus-guard`)))&&[P.current,re.current,A==null?void 0:A.beforeInsideRef.current,A==null?void 0:A.afterInsideRef.current,A==null?void 0:A.beforeOutsideRef.current,A==null?void 0:A.afterOutsideRef.current,No(d),No(u)].includes(n),p=!(Zo(_,n)||Zo(v,n)||Zo(n,v)||Zo(A==null?void 0:A.portalNode,n)||l.some(e=>e===n||Zo(e,n))||n!=null&&c.hasElement(n)||c.hasMatchingElement(e=>Zo(e,n))||f||k&&(Tc(k.nodesRef.current,a).find(e=>{var t,r;return Zo((t=e.context)==null?void 0:t.elements.floating,n)||Zo((r=e.context)==null?void 0:r.elements.domReference,n)})||Ec(k.nodesRef.current,a).find(e=>{var t,r,i;return[(t=e.context)==null?void 0:t.elements.floating,os((r=e.context)==null?void 0:r.elements.floating)].includes(n)||((i=e.context)==null?void 0:i.elements.domReference)===n})));if(r===_&&F&&pl(F),o&&r!==_&&!ec(i)&&Xo(e)===e.body){if(ga(F)&&(F.focus(),o===`popup`)){ce.request(()=>{F.focus()});return}let e=ue(),t=N.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||F;ga(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!M.current&&(C||n!==dl())&&(j.current=!0,h.setOpen(!1,To(aa,t)))})}function a(){ee.current||(b.current.insideReactTree=!0,oe.start(0,()=>{b.current.insideReactTree=!1}))}let l=ga(_)?_:null;if(!(!v&&!l))return ps(l&&fs(l,`focusout`,i),l&&fs(l,`pointerdown`,t),v&&fs(v,`focusin`,n),v&&fs(v,`focusout`,i),v&&A&&fs(v,`focusout`,a,!0))},[r,_,v,F,s,k,A,h,c,o,ue,C,x,b,oe,se,ce,u,d,de]),Fe(()=>{var e,t;if(r||!v||!g)return;let n=Array.from((A==null||(e=A.portalNode)==null?void 0:e.querySelectorAll(`[${Dc(`portal`)}]`))||[]),i=(t=(k?Ec(k.nodesRef.current,x()):[]).find(e=>{var t;return is(((t=e.context)==null?void 0:t.elements.domReference)||null)}))==null||(t=t.context)==null?void 0:t.elements.domReference,a=Vc([v,...n,P.current,re.current,A==null?void 0:A.beforeOutsideRef.current,A==null?void 0:A.afterOutsideRef.current,...de(),i,No(d),No(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),o=Vc([v,...n].filter(e=>e!=null));return()=>{o(),a()}},[g,r,_,v,s,A,C,k,x,u,d,de]),U(()=>{if(!g||r||!ga(F))return;let e=gs(F),t=Xo(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||Zo(F,t))return;let i=null,a=()=>(i==null&&(i=ue(F)),i[0]||F),o;o=r===!0||r===null?a():No(r),o=o||a();let s=Zo(F,Xo(e));kc(o,{preventScroll:o===F,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=Xo(e);return!(t!==o&&Zo(F,t))}})})},[r,g,F,ue,w,D,O]),U(()=>{if(r||!F)return;let e=gs(F),t=Xo(e),n=D.current==null;ul(t);function i(e){if(e.open||(te.current=sl(e.nativeEvent,ne.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`)if(e.nested)j.current=!1;else if(Wo(e.nativeEvent)||Go(e.nativeEvent))j.current=!1;else{let e=!1;gs(F).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}y.on(`openchange`,i);function a(){let e=T.current,r=typeof e==`function`?e(te.current):e;if(r===void 0||r===!1)return null;r===null&&(r=!0);let i=_!=null&&_.isConnected?_:null,a=t!=null&&t.isConnected&&da(t)!==`body`?t:null,o=n?a||i:i||a;return o||(o=dl()||null),typeof r==`boolean`?o:No(r)||o||null}return()=>{y.off(`openchange`,i);let t=Xo(e),n=de(),r=Zo(v,t)||n.some(e=>e===t||Zo(e,t))||k&&Tc(k.nodesRef.current,x(),!1).some(e=>{var n;return Zo((n=e.context)==null?void 0:n.elements.floating,t)}),o=T.current,s=a();queueMicrotask(()=>{let n=fl(s),i=typeof o!=`boolean`;o&&!j.current&&ga(n)&&(!(!i&&n!==t&&t!==e.body)||r)&&n.focus({preventScroll:!0}),j.current=!1})}},[r,v,F,T,D,y,k,_,x,de]),U(()=>{if(!so||g||!v)return;let e=Xo(gs(v));!ga(e)||!ns(e)||Zo(v,e)&&e.blur()},[g,v]),U(()=>{if(!(r||!A))return A.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,s,g,h,c,_]),U(()=>{if(!(r||!F))return pl(F),()=>{queueMicrotask(ll)}},[r,F]);let fe=!r&&(!s||!C)&&(le||s);return W(E,{children:[fe&&W(ys,{"data-type":`inside`,ref:ie,onFocus:e=>{if(s){let e=ue();kc(e[e.length-1])}else if(A!=null&&A.portalNode)if(j.current=!1,Sc(e,A.portalNode)){let e=_c(_);e==null||e.focus()}else{var t;(t=No(d==null?A.beforeOutsideRef:d))==null||t.focus()}}}),n,fe&&W(ys,{"data-type":`inside`,ref:ae,onFocus:e=>{if(s)kc(ue()[0]);else if(A!=null&&A.portalNode)if(c&&(j.current=!0),Sc(e,A.portalNode)){let e=vc(_);e==null||e.focus()}else{var t;(t=No(u==null?A.afterOutsideRef:u))==null||t.focus()}}})]})}B();function hl(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=ta}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=L(void 0),f=jo(),p=Vo(),m=R(()=>{function e(e,t,n,r){let i=To(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||Ko(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=Qo(o);if(ns(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}Ko(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return R(()=>n?{reference:m}:mi,[n,m])}B();function gl(){return!1}function _l(e){var t,n;return{escapeKey:typeof e==`boolean`?e:(t=e==null?void 0:e.escapeKey)!=null&&t,outsidePress:typeof e==`boolean`?e:(n=e==null?void 0:e.outsidePress)==null||n}}function vl(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=gl,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f}=l.context,p=rl(c),m=Ra(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=Ra(()=>a),{escapeKey:v,outsidePress:y}=_l(s),b=L(!1),x=L(!1),S=L(!1),C=L(!1),w=L(``),T=L(null),E=Vo(),D=Vo(),O=Ra(()=>{D.clear(),f.current.insideReactTree=!1}),k=Ra(e=>{var t;let n=(t=f.current.floatingContext)==null?void 0:t.nodeId;return(p?Tc(p.nodesRef.current,n):[]).some(t=>{var n;return((n=t.context)==null?void 0:n.open)&&!t.context.dataRef.current[e]})}),A=Ra(e=>es(e,l.select(`floatingElement`))||es(e,l.select(`domReferenceElement`))),j=Ra(e=>{o()&&l.setOpen(!1,To(ta,e.nativeEvent))}),M=Ra(e=>{if(!u||!n||!r||e.key!==`Escape`||C.current||!v&&k(`__escapeKeyBubbles`))return;let t=To(`escape-key`,Uo(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!v&&!t.isPropagationAllowed&&e.stopPropagation()}),ee=Ra(()=>{f.current.insideReactTree=!0,D.start(0,O)}),N=Ra(e=>{if(!u||!n||e.button!==0)return;let t=Qo(e.nativeEvent);Zo(l.select(`floatingElement`),t)&&(b.current||(b.current=!0,x.current=!1))}),te=Ra(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});Fe(()=>{if(!u||!n)return;f.current.__escapeKeyBubbles=v,f.current.__outsidePressBubbles=y;let e=new Bo,t=new Bo;function i(){e.clear(),C.current=!0}function a(){e.start(so?5:0,()=>{C.current=!1})}function o(){S.current=!0,t.start(0,()=>{S.current=!1})}function s(){b.current=!1,x.current=!1}function c(){let e=w.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function D(e){var t;let n=(t=f.current.floatingContext)==null?void 0:t.nodeId,r=p&&Tc(p.nodesRef.current,n).some(t=>{var n;return es(e,(n=t.context)==null?void 0:n.elements.floating)});return A(e)||r}function j(e){if(m(e)){e.type!==`click`&&!A(e)&&(t.clear(),S.current=!1),O();return}if(f.current.insideReactTree){O();return}let n=Qo(e),r=`[${Dc(`inert`)}]`,i=ha(n)?n.getRootNode():null,a=Array.from((_a(i)?i:gs(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Zo(e,n))))return;let s=ha(n)?n:null;for(;s&&!Oa(s);){let e=ja(s);if(Oa(e)||!ha(e))break;s=e}if(!(a.length&&ha(n)&&!ts(n)&&!Zo(n,l.select(`floatingElement`))&&a.every(e=>!Zo(s,e)))){if(ga(n)&&!(`touches`in e)){let t=Oa(n),r=ka(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!D(e)){if(c()===`intentional`&&S.current){t.clear(),S.current=!1;return}typeof h==`function`&&!h(e)||k(`__outsidePressBubbles`)||(l.setOpen(!1,To(`outside-press`,e)),O())}}}function ee(e){c()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||A(e)||j(e)}function N(e){if(c()!==`sloppy`||!l.select(`open`)||!n||A(e))return;let t=e.touches[0];t&&(T.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}function te(e,t){let n=Qo(e);if(!n)return;let r=fs(n,e.type,()=>{t(e),r()})}function ne(e){w.current=`touch`,te(e,N)}function P(e){E.clear(),e.type===`pointerdown`&&(w.current=e.pointerType),!(e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)&&te(e,e=>{e.type===`pointerdown`?ee(e):j(e)})}function re(e){if(!b.current)return;let n=x.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!D(e)){if(n){o();return}typeof h==`function`&&!h(e)||(t.clear(),S.current=!0,O())}}}function ie(e){if(c()!==`sloppy`||!T.current||A(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-T.current.startX),r=Math.abs(t.clientY-T.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(T.current.dismissOnTouchEnd=!0),i>10&&(j(e),E.clear(),T.current=null)}function ae(e){te(e,ie)}function oe(e){c()!==`sloppy`||!T.current||A(e)||(T.current.dismissOnTouchEnd&&j(e),E.clear(),T.current=null)}function se(e){te(e,oe)}let ce=gs(d),le=ps(r&&ps(fs(ce,`keydown`,M),fs(ce,`compositionstart`,i),fs(ce,`compositionend`,a)),g&&ps(fs(ce,`click`,P,!0),fs(ce,`pointerdown`,P,!0),fs(ce,`pointerup`,re,!0),fs(ce,`pointercancel`,re,!0),fs(ce,`mousedown`,P,!0),fs(ce,`mouseup`,re,!0),fs(ce,`touchstart`,ne,!0),fs(ce,`touchmove`,ae,!0),fs(ce,`touchend`,se,!0)));return()=>{le(),e.clear(),t.clear(),s(),S.current=!1}},[f,d,r,g,h,u,n,v,y,M,O,_,k,A,p,l,E]),Fe(O,[h,O]);let ne=R(()=>({onKeyDown:M,onPointerDown:j,onClick:j}),[M,j]),P=R(()=>({onKeyDown:M,onPointerDown:te,onMouseDown:te,onClickCapture:ee,onMouseDownCapture(e){ee(),N(e)},onPointerDownCapture(e){ee(),N(e)},onMouseUpCapture:ee,onTouchEndCapture:ee,onTouchMoveCapture:ee}),[M,ee,N,te]);return R(()=>n?{reference:ne,floating:P,trigger:ne}:{},[n,ne,P])}let yl=[`mainAxis`,`crossAxis`,`fallbackPlacements`,`fallbackStrategy`,`fallbackAxisSideDirection`,`flipAlignment`],bl=[`strategy`],xl=[`mainAxis`,`crossAxis`,`limiter`],Sl=[`apply`];function Cl(e,t,n){let{reference:r,floating:i}=e,a=Ns(t),o=Ps(t),s=Ms(o),c=ks(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=As(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function wl(e,t){var n;t===void 0&&(t={});let{x:r,y:i,platform:a,rects:o,elements:s,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=Os(t,e),m=Ks(p),h=s[f?d===`floating`?`reference`:`floating`:d],g=qs(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(h)))==null||n?h:h.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),_=d===`floating`?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,v=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),y=await(a.isElement==null?void 0:a.isElement(v))&&await(a.getScale==null?void 0:a.getScale(v))||{x:1,y:1},b=qs(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:_,offsetParent:v,strategy:c}):_);return{top:(g.top-b.top+m.top)/y.y,bottom:(b.bottom-g.bottom+m.bottom)/y.y,left:(g.left-b.left+m.left)/y.x,right:(b.right-g.right+m.right)/y.x}}let Tl=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:H(H({},o),{},{detectOverflow:wl}),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Cl(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v==null?u:v,d=y==null?d:y,m[g]=H(H({},m[g]),b),x&&p<50&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Cl(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},El=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n,r;let{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:c,elements:l}=t,u=Os(e,t),{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m=`bestFit`,fallbackAxisSideDirection:h=`none`,flipAlignment:g=!0}=u,_=yr(u,yl);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let v=ks(i),y=Ns(s),b=ks(s)===s,x=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=p||(b||!g?[Ws(s)]:Is(s)),C=h!==`none`;!p&&C&&S.push(...Us(s,g,h,x));let w=[s,...S],T=await c.detectOverflow(t,_),E=[],D=((r=a.flip)==null?void 0:r.overflows)||[];if(d&&E.push(T[v]),f){let e=Fs(i,o,x);E.push(T[e[0]],T[e[1]])}if(D=[...D,{placement:i,overflows:E}],!E.every(e=>e<=0)){var O,k;let e=(((O=a.flip)==null?void 0:O.index)||0)+1,t=w[e];if(t&&(!(f===`alignment`&&y!==Ns(t))||D.every(e=>Ns(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:D},reset:{placement:t}};let n=(k=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])==null?void 0:k.placement;if(!n)switch(m){case`bestFit`:{var A;let e=(A=D.filter(e=>{if(C){let t=Ns(e.placement);return t===y||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])==null?void 0:A[0];e&&(n=e);break}case`initialPlacement`:n=s;break}if(i!==n)return{reset:{placement:n}}}return{}}}};function Dl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ol(e){return bs.some(t=>e[t]>=0)}let kl=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,i=Os(e,t),{strategy:a=`referenceHidden`}=i,o=yr(i,bl);switch(a){case`referenceHidden`:{let e=Dl(await r.detectOverflow(t,H(H({},o),{},{elementContext:`reference`})),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ol(e)}}}case`escaped`:{let e=Dl(await r.detectOverflow(t,H(H({},o),{},{altBoundary:!0})),n.floating);return{data:{escapedOffsets:e,escaped:Ol(e)}}}default:return{}}}}},Al=new Set([`left`,`top`]);async function jl(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ks(n),s=As(n),c=Ns(n)===`y`,l=Al.has(o)?-1:1,u=a&&c?-1:1,d=Os(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}let Ml=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n,r;let{x:i,y:a,placement:o,middlewareData:s}=t,c=await jl(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:a+c.y,data:H(H({},c),{},{placement:o})}}}},Nl=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,o=Os(e,t),{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}}}=o,u=yr(o,xl),d={x:n,y:r},f=await a.detectOverflow(t,u),p=Ns(i),m=js(p),h=d[m],g=d[p],_=(e,t)=>Ds(t+f[e===`y`?`top`:`left`],t,t-f[e===`y`?`bottom`:`right`]);s&&(h=_(m,h)),c&&(g=_(p,g));let v=l.fn(H(H({},t),{},{[m]:h,[p]:g}));return H(H({},v),{},{data:{x:v.x-n,y:v.y-r,enabled:{[m]:s,[p]:c}}})}}},Pl=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;let{x:i,y:a,placement:o,rects:s,middlewareData:c}=t,{offset:l=0,mainAxis:u=!0,crossAxis:d=!0}=Os(e,t),f={x:i,y:a},p=Ns(o),m=js(p),h=f[m],g=f[p],_=Os(l,t),v=typeof _==`number`?{mainAxis:_,crossAxis:0}:{mainAxis:(n=_.mainAxis)==null?0:n,crossAxis:(r=_.crossAxis)==null?0:r};if(u){let e=m===`y`?`height`:`width`,t=s.reference[m]-s.floating[e]+v.mainAxis,n=s.reference[m]+s.reference[e]-v.mainAxis;h<t?h=t:h>n&&(h=n)}if(d){var y,b;let e=m===`y`?`width`:`height`,t=Al.has(ks(o)),n=s.reference[p]-s.floating[e]+(t&&((y=c.offset)==null?void 0:y[p])||0)+(t?0:v.crossAxis),r=s.reference[p]+s.reference[e]+(t?0:((b=c.offset)==null?void 0:b[p])||0)-(t?v.crossAxis:0);g<n?g=n:g>r&&(g=r)}return{[m]:h,[p]:g}}}},Fl=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,o=Os(e,t),{apply:s=()=>{}}=o,c=yr(o,Sl),l=await i.detectOverflow(t,c),u=ks(n),d=As(n),f=Ns(n)===`y`,{width:p,height:m}=r.floating,h,g;u===`top`||u===`bottom`?(h=u,g=d===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(g=u,h=d===`end`?`top`:`bottom`);let _=m-l.top-l.bottom,v=p-l.left-l.right,y=xs(m-l[h],_),b=xs(p-l[g],v),x=t.middlewareData.shift,S=!x,C=y,w=b;x!=null&&x.enabled.x&&(w=v),x!=null&&x.enabled.y&&(C=_),S&&!d&&(f?w=p-2*Ss(l.left,l.right):C=m-2*Ss(l.top,l.bottom)),await s(H(H({},t),{},{availableWidth:w,availableHeight:C}));let T=await i.getDimensions(a.floating);return p!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}};function Il(e){let t=ka(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ga(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Cs(n)!==a||Cs(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ll(e){return ha(e)?e:e.contextElement}function Rl(e){let t=Ll(e);if(!ga(t))return Ts(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Il(t),o=(a?Cs(n.width):n.width)/r,s=(a?Cs(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}let zl=Ts(0);function Bl(e){let t=fa(e);return!Da()||!t.visualViewport?zl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Vl(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===fa(e)}function Hl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ll(e),o=Ts(1);t&&(r?ha(r)&&(o=Rl(r)):o=Rl(e));let s=Vl(a,n,r)?Bl(a):Ts(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=fa(a),t=ha(r)?fa(r):r,n=e,i=Pa(n);for(;i&&t!==n;){let e=Rl(i),t=i.getBoundingClientRect(),r=ka(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=fa(i),i=Pa(n)}}return qs({width:u,height:d,x:c,y:l})}function Ul(e,t){let n=Aa(e).scrollLeft;return t?t.left+n:Hl(pa(e)).left+n}function Wl(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ul(e,n),y:n.top+t.scrollTop}}function Gl(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=pa(r),s=t?ba(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ts(1),u=Ts(0),d=ga(r);if((d||!a)&&((da(r)!==`body`||va(o))&&(c=Aa(r)),d)){let e=Hl(r);l=Rl(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Wl(o,c):Ts(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Kl(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ql(e){let t=Aa(e),n=e.ownerDocument.body,r=Ss(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Ss(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Ul(e),o=-t.scrollTop;return ka(n).direction===`rtl`&&(a+=Ss(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}function Jl(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=fa(e),a=pa(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Da()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Ul(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=25&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Yl(e,t){let n=Hl(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Rl(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Xl(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Jl(e,n,t);else if(t===`document`)r=ql(pa(e));else if(ha(t))r=Yl(t,n);else{let n=Bl(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return qs(r)}function Zl(e,t){let n=t.get(e);if(n)return n;let r=Na(e,[],!1).filter(e=>ha(e)&&da(e)!==`body`),i=null,a=ka(e).position===`fixed`,o=a?ja(e):e;for(;ha(o)&&!Oa(o);){let e=ka(o),t=Ta(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=ja(o)}return t.set(e,r),r}function Ql(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ba(t)?[]:Zl(t,this._c):[].concat(n),r],o=Xl(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Xl(t,a[e],i);s=Ss(n.top,s),c=xs(n.right,c),l=xs(n.bottom,l),u=Ss(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function $l(e){let{width:t,height:n}=Il(e);return{width:t,height:n}}function eu(e,t,n){let r=ga(t),i=pa(t),a=n===`fixed`,o=Hl(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ts(0);if((r||!a)&&((da(t)!==`body`||va(i))&&(s=Aa(t)),r)){let e=Hl(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Ul(i));let l=i&&!r&&!a?Wl(i,s):Ts(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function tu(e){return ka(e).position===`static`}function nu(e,t){if(!ga(e)||ka(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return pa(e)===n&&(n=n.ownerDocument.body),n}function ru(e,t){let n=fa(e);if(ba(e))return n;if(!ga(e)){let t=ja(e);for(;t&&!Oa(t);){if(ha(t)&&!tu(t))return t;t=ja(t)}return n}let r=nu(e,t);for(;r&&ya(r)&&tu(r);)r=nu(r,t);return r&&Oa(r)&&tu(r)&&!Ta(r)?n:r||Ea(e)||n}let iu=async function(e){let t=this.getOffsetParent||ru,n=this.getDimensions,r=await n(e.floating);return{reference:eu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function au(e){return ka(e).direction===`rtl`}let ou={convertOffsetParentRelativeRectToViewportRelativeRect:Gl,getDocumentElement:pa,getClippingRect:Ql,getOffsetParent:ru,getElementRects:iu,getClientRects:Kl,getDimensions:$l,getScale:Rl,isElement:ha,isRTL:au};function su(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cu(e,t,n){let r=null,i,a=pa(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=ws(d),h=ws(a.clientWidth-(u+f)),g=ws(a.clientHeight-(d+p)),_=ws(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Ss(0,xs(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!su(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,H(H({},v),{},{root:a.ownerDocument}))}catch(e){r=new IntersectionObserver(b,v)}r.observe(e)}let c=fa(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function lu(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ll(e),u=i||a?[...l?Na(l):[],...t?Na(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?cu(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Hl(e):null;c&&g();function g(){let t=Hl(e);h&&!su(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d==null||d(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}let uu=Ml,du=Nl,fu=El,pu=Fl,mu=kl,hu=Pl,gu=(e,t,n)=>{let r=new Map,i=n==null?{}:n,a=H(H(H({},ou),i.platform),{},{_c:r});return Tl(e,t,H(H({},i),{},{platform:a}))};B();var _u=typeof document<`u`?Ie:function(){};function vu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!vu(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!vu(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function yu(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bu(e,t){let n=yu(e);return Math.round(t*n)/n}function xu(e){let t=L(e);return _u(()=>{t.current=e}),t}function Su(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=Ne({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=Ne(r);vu(f,r)||p(r);let[m,h]=Ne(null),[g,_]=Ne(null),v=Re(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=Re(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=L(null),C=L(null),w=L(u),T=c!=null,E=xu(c),D=xu(i),O=xu(l),k=Re(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),gu(S.current,C.current,e).then(e=>{let t=H(H({},e),{},{isPositioned:O.current!==!1});A.current&&!vu(w.current,t)&&(w.current=t,ln(()=>{d(t)}))})},[f,t,n,D,O]);_u(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>H(H({},e),{},{isPositioned:!1})))},[l]);let A=L(!1);_u(()=>(A.current=!0,()=>{A.current=!1}),[]),_u(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=R(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=R(()=>({reference:b,floating:x}),[b,x]),ee=R(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=bu(M.floating,u.x),r=bu(M.floating,u.y);return s?H(H({},e),{},{transform:`translate(`+t+`px, `+r+`px)`},yu(M.floating)>=1.5&&{willChange:`transform`}):{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return R(()=>H(H({},u),{},{update:k,refs:j,elements:M,floatingStyles:ee}),[u,k,j,M,ee])}let Cu=(e,t)=>{let n=uu(e);return{name:n.name,fn:n.fn,options:[e,t]}},wu=(e,t)=>{let n=du(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tu=(e,t)=>({fn:hu(e).fn,options:[e,t]}),Eu=(e,t)=>{let n=fu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Du=(e,t)=>{let n=pu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ou=(e,t)=>{let n=mu(e);return{name:n.name,fn:n.fn,options:[e,t]}};B();function ku(e){let t=L(!0);t.current&&(t.current=!1,e())}let G=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(Yr(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s};
7
+ /**
8
+ * @license React
9
+ * use-sync-external-store-shim.production.js
10
+ *
11
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
12
+ *
13
+ * This source code is licensed under the MIT license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ */
16
+ var Au=s((e=>{var t=(B(),d(dt));function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),ju=s(((e,t)=>{t.exports=Au()})),Mu=s((e=>{
17
+ /**
18
+ * @license React
19
+ * use-sync-external-store-shim/with-selector.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */
26
+ var t=(B(),d(dt)),n=ju();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Nu=s(((e,t)=>{t.exports=Mu()}));B();let Pu=[],Fu;function Iu(){return Fu}function Lu(e){Pu.push(e)}function Ru(e){let t=(t,n)=>{let r=ti(Bu).current,i;try{Fu=r;for(let e of Pu)e.before(r);i=e(t,n);for(let e of Pu)e.after(r);r.didInitialize=!0}finally{Fu=void 0}return i};return t.displayName=e.displayName||e.name,t}function zu(e){return bt(Ru(e))}function Bu(){return{didInitialize:!1}}B();var Vu=ju(),Hu=Nu();let Uu=li(19)?Ku:qu;function Wu(e,t,n,r,i){return Uu(e,t,n,r,i)}function Gu(e,t,n,r,i){let a=Re(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Vu.useSyncExternalStore)(e.subscribe,a,a)}Lu({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Vu.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Ku(e,t,n,r,i){let a=Iu();if(!a)return Gu(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function qu(e,t,n,r,i){return(0,Hu.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Ju=class{constructor(e){V(this,`subscribe`,e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})),V(this,`getSnapshot`,()=>this.state),this.state=e,this.listeners=new Set,this.updateTick=0}setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState(H(H({},this.state),e));return}}set(e,t){Object.is(this.state[e],t)||this.setState(H(H({},this.state),{},{[e]:t}))}notifyAll(){let e=H({},this.state);this.setState(e)}use(e,t,n,r){return Wu(this,e,t,n,r)}};B();var Yu=class extends Ju{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){Be(e);let n=this;U(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;U(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;U(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){Be(e);let n=this,r=t!==void 0;U(()=>{r&&!Object.is(n.state[e],t)&&n.setState(H(H({},n.state),{},{[e]:t}))},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return Be(e),Wu(this,this.selectors[e],t,n,r)}useContextCallback(e,t){Be(e);let n=Ra(t==null?fi:t);this.context[e]=n}useStateSetter(e){let t=L(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};let Xu=[`syncOnly`,`nested`,`onOpenChange`,`triggerElements`],Zu={open:G(e=>e.open),transitionStatus:G(e=>e.transitionStatus),domReferenceElement:G(e=>e.domReferenceElement),referenceElement:G(e=>{var t;return(t=e.positionReference)==null?e.referenceElement:t}),floatingElement:G(e=>e.floatingElement),floatingId:G(e=>e.floatingId)};var Qu=class extends Yu{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i}=e,a=yr(e,Xu);super(H(H({},a),{},{positionReference:a.referenceElement,domReferenceElement:a.referenceElement}),{onOpenChange:r,dataRef:{current:{}},events:Qc(),nested:n,triggerElements:i},Zu),V(this,`syncOpenEvent`,(e,t)=>{(!e||!this.state.open||t!=null&&qo(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)}),V(this,`dispatchOpenChange`,(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}),V(this,`setOpen`,(e,t)=>{var n,r;if(this.syncOnly){var i,a;(i=(a=this.context).onOpenChange)==null||i.call(a,e,t);return}this.dispatchOpenChange(e,t),(n=(r=this.context).onOpenChange)==null||n.call(r,e,t)}),this.syncOnly=t}};B();function $u(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=L(null);r===void 0&&f.current===null&&(f.current=new Qu({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r==null?f.current:r;return t.useSyncedValue(`floatingId`,i),U(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};ha(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}B();let ed={tabIndex:-1,"data-base-ui-focusable":``};function td(e){return t=>t!==`touch`||e.current}function nd(e,t,n=!1){let r=xo(),i=nl()!=null,a=L(null);e===void 0&&a.current===null&&(a.current=t(r,i));let o=e==null?a.current:e;return $u({popupStore:o,treatPopupAsFloatingElement:n,floatingRootContext:o.state.floatingRootContext,floatingId:r,nested:i,onOpenChange:o.setOpen}),{store:o,internalStore:a.current}}function rd(e,t){let n=L(null),r=L(null);return Re(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function id(e,t,n,r=!1){var i;t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let a=(i=n==null?void 0:n.id)==null?null:i;(a||t)&&(e.activeTriggerId=a,e.activeTriggerElement=n==null?null:n)}function ad(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function od(e,t,n,r){ku(()=>{t===void 0&&e.state.open===!1&&n&&(e.state=H(H({},e.state),{},{open:!0,activeTriggerId:r,preventUnmountingOnClose:!1}))})}function sd(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=rd(e,n),o=Ra(t=>{if(a(t),!t)return;let i=n.select(`open`),o=n.select(`activeTriggerId`);if(o===e){n.update(H({activeTriggerElement:t},i?r:null));return}o==null&&i&&n.update(H({activeTriggerId:e,activeTriggerElement:t},r))});return U(()=>{i&&n.update(H({activeTriggerElement:t.current},r))},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function cd(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=e.useState(`open`);U(()=>{if(!r){e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,i={};e.state.triggerCount!==t&&(i.triggerCount=t);let a=e.select(`activeTriggerId`),o=null;if(a){let t=e.context.triggerElements.getById(a);t?t!==e.state.activeTriggerElement&&(i.activeTriggerElement=t):o=a}if(!o&&!a&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;i.activeTriggerId=e,i.activeTriggerElement=n}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),o&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===o&&!e.context.triggerElements.getById(o)){let t=To(`none`);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,e.useState(`triggerCount`),n])}function ld(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=Mo(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=Ra(()=>{var e,r;i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(e=(r=t.context).onOpenChangeComplete)==null||e.call(r,!1)});return Fo({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function ud(e,t){e.useSyncedValues(t),U(()=>()=>{e.update({activeTriggerProps:mi,inactiveTriggerProps:mi,popupProps:mi})},[e])}function dd(e,t){U(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),U(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var fd=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function pd(){return new Qu({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new fd,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function md(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:pd(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:mi,inactiveTriggerProps:mi,popupProps:mi}}function hd(e,t,n=!1){return new Qu({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}let gd=G(e=>{var t;return(t=e.triggerIdProp)==null?e.activeTriggerId:t}),_d=G(e=>{var t;return(t=e.openProp)==null?e.open:t}),vd=G(e=>{var t,n;return((t=(n=e.popupElement)==null?void 0:n.id)==null?e.floatingId:t)||void 0});function yd(e,t){return t!==void 0&&_d(e)&&gd(e)===t}function bd(e,t){return yd(e,t)?!0:t!==void 0&&_d(e)&&gd(e)==null&&e.triggerCount===1}let xd={open:_d,mounted:G(e=>e.mounted),transitionStatus:G(e=>e.transitionStatus),floatingRootContext:G(e=>e.floatingRootContext),triggerCount:G(e=>e.triggerCount),preventUnmountingOnClose:G(e=>e.preventUnmountingOnClose),payload:G(e=>e.payload),activeTriggerId:gd,activeTriggerElement:G(e=>e.mounted?e.activeTriggerElement:null),popupId:vd,isTriggerActive:G((e,t)=>t!==void 0&&gd(e)===t),isOpenedByTrigger:G((e,t)=>yd(e,t)),isMountedByTrigger:G((e,t)=>t!==void 0&&gd(e)===t&&e.mounted),triggerProps:G((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:G((e,t)=>bd(e,t)?vd(e):void 0),popupProps:G(e=>e.popupProps),popupElement:G(e=>e.popupElement),positionerElement:G(e=>e.positionerElement)};function Sd(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=xo(),a=nl()!=null,o=ti(()=>{var e,o;return new Qu({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:(e=r.reference)==null?null:e,floatingElement:(o=r.floating)==null?null:o,triggerElements:new fd,floatingId:i,syncOnly:!1,nested:a})}).current;return U(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=ha(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}B();function Cd(e={}){let{nodeId:t,externalTree:n}=e,r=Sd(e),i=e.rootContext||r,a=i.useState(`referenceElement`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.useState(`open`),l=i.useState(`floatingId`),[u,d]=Ne(null),[f,p]=Ne(void 0),[m,h]=Ne(void 0),g=L(null),_=rl(n),v=R(()=>({reference:a,floating:o,domReference:s}),[a,o,s]),y=Su(H(H({},e),{},{elements:H(H({},v),u&&{reference:u})})),b=ha(f)?f:null,x=m===void 0?i.state.floatingElement:m;i.useSyncedValue(`referenceElement`,f==null?null:f),i.useSyncedValue(`domReferenceElement`,f===void 0?s:b),i.useSyncedValue(`floatingElement`,x);let S=Re(e=>{let t=ha(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),y.refs.setReference(t)},[y.refs]),C=Re(e=>{(ha(e)||e===null)&&(g.current=e,p(e)),(ha(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!ha(e))&&y.refs.setReference(e)},[y.refs,p]),w=Re(e=>{h(e),y.refs.setFloating(e)},[y.refs]),T=R(()=>H(H({},y.refs),{},{setReference:C,setFloating:w,setPositionReference:S,domReference:g}),[y.refs,C,w,S]),E=R(()=>H(H({},y.elements),{},{domReference:s}),[y.elements,s]),D=R(()=>H(H({},y),{},{dataRef:i.context.dataRef,open:c,onOpenChange:i.setOpen,events:i.context.events,floatingId:l,refs:T,elements:E,nodeId:t,rootStore:i}),[y,T,E,t,i,c,l]);return U(()=>{s&&(g.current=s)},[s]),U(()=>{i.context.dataRef.current.floatingContext=D;let e=_==null?void 0:_.nodesRef.current.find(e=>e.id===t);e&&(e.context=D)}),R(()=>H(H({},y),{},{context:D,refs:T,elements:E,rootStore:i}),[y,T,E,D,i])}B();let wd=ro&&so;function Td(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=L(!1),c=L(null),l=L(!0),u=Vo();Fe(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=fa(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&ga(e)&&e===Xo(gs(e))&&(s.current=!0)}function a(){l.current=!0}function o(){l.current=!1}return ps(fs(t,`blur`,r),wd&&fs(t,`keydown`,a,!0),wd&&fs(t,`pointerdown`,o,!0))},[i,n]),Fe(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);ha(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=R(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=Qo(t.nativeEvent);if(ha(a)){if(wd&&!t.relatedTarget){if(!l.current&&!ns(a))return}else if(!as(a))return}let o=$o(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,To(ra,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,To(ra,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=ha(n)&&n.hasAttribute(Dc(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{var e;let t=i.select(`domReferenceElement`),s=Xo(gs(t));!n&&s===t||Zo((e=o.current.floatingContext)==null?void 0:e.refs.floating.current,s)||Zo(t,s)||a||$o(n==null?s:n,i.context.triggerElements)||i.setOpen(!1,To(ra,r))})}}},[o,r,i,u]);return R(()=>n?{reference:d,trigger:d}:{},[n,d])}var Ed=class e{constructor(){V(this,`dispose`,()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()}),V(this,`disposeEffect`,()=>this.dispose),this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Bo,this.restTimeout=new Bo,this.handleCloseOptions=void 0}static create(){return new e}};let Dd=new WeakMap;function Od(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;if(t&&Dd.get(t)===e){var n,r,i;(n=e.pointerEventsScopeElement)==null||n.style.removeProperty(`pointer-events`),(r=e.pointerEventsReferenceElement)==null||r.style.removeProperty(`pointer-events`),(i=e.pointerEventsFloatingElement)==null||i.style.removeProperty(`pointer-events`),Dd.delete(t)}e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function kd(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Dd.get(n);a&&a!==e&&Od(a),Od(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Dd.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Ad(e){let t=e.context.dataRef.current,n=ti(()=>{var e;return(e=t.hoverInteractionState)==null?Ed.create():e}).current;return t.hoverInteractionState||(t.hoverInteractionState=n),Oo(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}B();function jd(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=rl(),d=nl(),f=Ad(a),p=Vo(),m=Ra(()=>{var e;return us((e=l.current.openEvent)==null?void 0:e.type,f.interactedInside)}),h=Ra(()=>{var e;return ds((e=l.current.openEvent)==null?void 0:e.type)}),g=Ra(()=>{Od(f)});U(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),Fe(()=>g,[g]),U(()=>{var e;if(n&&o&&(e=f.handleCloseOptions)!=null&&e.blockPointerEvents&&h()&&ha(c)&&s){var t,r,i,a,l,p,m;let e=c,n=s,o=gs(s),h=u==null||(t=u.nodesRef.current.find(e=>e.id===d))==null||(t=t.context)==null?void 0:t.elements.floating;h&&(h.style.pointerEvents=``);let _=f.pointerEventsScopeElement===n?null:f.pointerEventsScopeElement,v=h===n?null:h,y=(r=(i=(a=(l=(p=f.handleCloseOptions)==null||(m=p.getScope)==null?void 0:m.call(p))==null?_:l)==null?v:a)==null?e.closest(`[data-rootownerid]`):i)==null?o.body:r;return kd(f,{scopeElement:y,referenceElement:e,floatingElement:n}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),Fe(()=>{if(!n)return;function e(){return!!(u&&d&&Tc(u.nodesRef.current,d).length>0)}function t(e){let t=cs(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,To(na,e)),u==null||u.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=Qo(e);if(!rs(t)){f.interactedInside=!1;return}f.interactedInside=(t==null?void 0:t.closest(`[aria-haspopup]`))!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u==null||u.events.off(`floating.closed`,v),g()}function _(n){var r,o;if(e()&&u){u.events.on(`floating.closed`,v);return}if($o(n.relatedTarget,a.context.triggerElements))return;let s=(r=(o=l.current.floatingContext)==null?void 0:o.nodeId)==null?i:r,c=n.relatedTarget;if(!(u&&s&&ha(c)&&Tc(u.nodesRef.current,s,!1).some(e=>{var t;return Zo((t=e.context)==null?void 0:t.elements.floating,c)}))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,To(na,t)),u.events.emit(`floating.closed`,t)})}let y=s;return ps(y&&fs(y,`mouseenter`,c),y&&fs(y,`mouseleave`,_),y&&fs(y,`pointerdown`,o,!0),()=>{u==null||u.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}B();let Md={current:null};function Nd(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Md,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p}=t,m=`rootStore`in e?e.rootStore:e,{dataRef:h,events:g}=m.context,_=rl(l),v=Ad(m),y=L(!1),b=ms(i),x=ms(r),S=ms(o),C=ms(n),w=ms(p),T=ms(f),E=Ra(()=>{var e;return us((e=h.current.openEvent)==null?void 0:e.type,v.interactedInside)}),D=Ra(()=>{var e;return((e=w.current)==null?void 0:e.call(w))!==!1}),O=Ra((e,t,n)=>{let r=m.context.triggerElements;if(r.hasElement(t))return!e||!Zo(e,t);if(!ha(n))return!1;let i=n;return r.hasMatchingElement(e=>Zo(e,i))&&(!e||!Zo(e,i))}),k=Ra(()=>{v.handler&&(gs(m.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),v.handler=void 0)}),A=Ra(()=>{Od(v)});if(u){var j;v.handleCloseOptions=(j=b.current)==null?void 0:j.__options}return Fe(()=>k,[k]),Fe(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===na,k(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,k]),Fe(()=>{var e;if(!n)return;function t(e,t=!0){let n=cs(x.current,`close`,v.pointerType);n?v.openChangeTimeout.start(n,()=>{m.setOpen(!1,To(na,e)),_==null||_.events.emit(`floating.closed`,e)}):t&&(v.openChangeTimeout.clear(),m.setOpen(!1,To(na,e)),_==null||_.events.emit(`floating.closed`,e))}let r=(e=c.current)==null?u?m.select(`domReferenceElement`):null:e;if(!ha(r))return;function i(e){var t,n,r;if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!Ko(v.pointerType))return;let i=ls(S.current),o=cs(x.current,`open`,v.pointerType),s=Qo(e),c=(t=e.currentTarget)==null?null:t,l=m.select(`domReferenceElement`),u=c;if(ha(s)&&!m.context.triggerElements.hasElement(s)){for(let e of m.context.triggerElements.elements())if(Zo(e,s)){u=e;break}}ha(c)&&ha(l)&&!m.context.triggerElements.hasElement(c)&&Zo(c,l)&&(u=l);let d=u!=null&&O(l,u,s),f=m.select(`open`),p=(n=(r=T.current)==null?void 0:r.call(T))==null?m.select(`transitionStatus`)===`ending`:n,h=!f&&p&&y.current,g=!d&&ha(u)&&ha(l)&&Zo(l,u)&&h,_=i>0&&!o,b=d&&(f||h)||g,C=!f||d;if(b){D()&&m.setOpen(!0,To(na,e,u));return}_||(o?v.openChangeTimeout.start(o,()=>{C&&D()&&m.setOpen(!0,To(na,e,u))}):C&&D()&&m.setOpen(!0,To(na,e,u)))}function o(e){var n;if(E()){A();return}k();let r=gs(m.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=(n=h.current.floatingContext)==null?d==null?void 0:d():n;if(!$o(e.relatedTarget,m.context.triggerElements)){if(b.current&&i){m.select(`open`)||v.openChangeTimeout.clear();let n=c.current;v.handler=b.current(H(H({},i),{},{tree:_,x:e.clientX,y:e.clientY,onClose(){A(),k(),C.current&&!E()&&n===m.select(`domReferenceElement`)&&t(e,!0)}})),r.addEventListener(`mousemove`,v.handler),v.handler(e);return}(v.pointerType!==`touch`||!Zo(m.select(`floatingElement`),e.relatedTarget))&&t(e)}}return s?ps(fs(r,`mousemove`,i,{once:!0}),fs(r,`mouseenter`,i),fs(r,`mouseleave`,o)):ps(fs(r,`mouseenter`,i),fs(r,`mouseleave`,o))},[k,A,h,x,m,n,b,v,u,O,E,a,s,S,c,_,C,d,T,D]),R(()=>{if(!n)return;function e(e){v.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){var t;let{nativeEvent:n}=e,r=e.currentTarget,i=m.select(`domReferenceElement`),o=m.select(`open`),s=O(i,r,e.target);if(a&&!Ko(v.pointerType))return;if(o&&s&&(t=v.handleCloseOptions)!=null&&t.blockPointerEvents){let e=m.select(`floatingElement`);if(e){var c,l,u;let t=(c=(l=v.handleCloseOptions)==null||(u=l.getScope)==null?void 0:u.call(l))==null?r.ownerDocument.body:c;kd(v,{scopeElement:t,referenceElement:r,floatingElement:e})}}let d=ls(S.current);if(o&&!s||d===0||!s&&v.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;v.restTimeout.clear();function f(){if(v.restTimeoutPending=!1,E())return;let e=m.select(`open`);!v.blockMouseMove&&(!e||s)&&D()&&m.setOpen(!0,To(na,n,r))}v.pointerType===`touch`?ln(()=>{f()}):s&&o?f():(v.restTimeoutPending=!0,v.restTimeout.start(d,f))}}},[n,v,E,O,a,m,S,D])}B();function Pd(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Fd(e,t){return Pd(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Id(e,t,n){return Pd(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Ld(e,t,n){return Pd(t,n?e===Jo:e===Yo,e===`ArrowDown`)}function Rd(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:Pd(t,n?e===Yo:e===Jo,e===`ArrowUp`)}function zd(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:v,resetOnPointerLeave:y=!0,externalTree:b,grid:x}=t,S=x!=null,C=`rootStore`in e?e.rootStore:e,w=C.useState(`open`),T=C.useState(`floatingElement`),E=C.useState(`domReferenceElement`),D=C.context.dataRef,O=os(T),k=is(E),A=ms(O),j=nl(),M=rl(b),ee=L(f),N=L(o==null?-1:o),te=L(null),ne=L(!0),P=Ra(e=>{i(N.current===-1?null:N.current,e)}),re=L(!!T),ie=L(w),ae=L(!1),oe=L(!1),se=L(null),ce=ms(h),le=ms(w),F=ms(o),ue=ms(y),de=jo(),fe=jo(),pe=Ra(()=>{function e(e){d?M==null||M.events.emit(`virtualfocus`,e):se.current=kc(e,{sync:ae.current,preventScroll:!0})}let t=n.current[N.current],r=oe.current;t&&e(t),(ae.current?e=>e():e=>de.request(e))(()=>{let i=n.current[N.current]||t;if(i&&(t||e(i),ve&&(r||!ne.current))){var a;(a=i.scrollIntoView)==null||a.call(i,{block:`nearest`,inline:`nearest`})}})});U(()=>{D.current.orientation=g},[D,g]),U(()=>{a&&(w&&T?(N.current=o==null?-1:o,ee.current&&o!=null&&(oe.current=!0,P())):re.current&&(N.current=-1,P()))},[a,w,T,o,P]),U(()=>{if(a){if(!w){ae.current=!1;return}if(T)if(r==null){if(ae.current=!1,F.current!=null)return;if(re.current&&(N.current=-1,pe()),(!ie.current||!re.current)&&ee.current&&(te.current!=null||ee.current===!0&&te.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>fe.request(e):queueMicrotask)(t),e+=1):(N.current=te.current==null||Id(te.current,g,u)||l?Ys(n):Xs(n),te.current=null,P())};t()}}else Js(n.current,r)||(N.current=r,pe(),oe.current=!1)}},[a,w,T,r,F,l,n,g,u,P,pe,fe]),U(()=>{var e,t;if(!a||T||!M||d||!re.current)return;let n=M.nodesRef.current,r=(e=n.find(e=>e.id===j))==null||(e=e.context)==null?void 0:e.elements.floating,i=Xo(gs((t=E==null?r:E)==null?null:t)),o=n.some(e=>e.context&&Zo(e.context.elements.floating,i));r&&!o&&ne.current&&r.focus({preventScroll:!0})},[a,T,E,M,j,d]),U(()=>{ie.current=w,re.current=!!T}),U(()=>{w||(te.current=null,ee.current=f)},[w,f]);let me=r!=null,he=Ra(e=>{if(!le.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(N.current!==t||r!==t)&&(N.current=t,P(e))}),I=Ra(()=>{var e;return _==null?M==null||(e=M.nodesRef.current.find(e=>e.id===j))==null||(e=e.context)==null||(e=e.dataRef)==null?void 0:e.current.orientation:_}),ge=Ra(()=>Ys(n,ce.current)),_e=Ra(e=>{if(ne.current=!1,ae.current=!0,e.which===229||!le.current&&e.currentTarget===A.current)return;if(l&&Rd(e.key,g,u,S)){Fd(e.key,I())||Ho(e),C.setOpen(!1,To(oa,e.nativeEvent)),ga(E)&&(d?M==null||M.events.emit(`virtualfocus`,E):E.focus());return}let t=N.current,r=Ys(n,h),i=Xs(n,h);if(k||(e.key===`Home`&&(Ho(e),N.current=r,P(e)),e.key===`End`&&(Ho(e),N.current=i,P(e))),x!=null){let t=x(e,N.current,n,g,c,u,h,r,i);if(t!=null&&(N.current=t,P(e)),g===`both`)return}if(Fd(e.key,g)){if(Ho(e),w&&!d&&Xo(e.currentTarget.ownerDocument)===e.currentTarget){N.current=Id(e.key,g,u)?r:i,P(e);return}Id(e.key,g,u)?c?t>=i?s&&t!==n.current.length?N.current=-1:(ae.current=!1,N.current=r):N.current=Zs(n.current,{startingIndex:t,disabledIndices:h}):N.current=Math.min(i,Zs(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?N.current=n.current.length:(ae.current=!1,N.current=i):N.current=Zs(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):N.current=Math.max(r,Zs(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),Js(n.current,N.current)&&(N.current=-1),P(e)}}),ve=R(()=>({onFocus(e){ae.current=!0,he(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){ae.current=!0,oe.current=!1,p&&he(e)},onPointerLeave(e){var t;if(!le.current||!ne.current||e.pointerType===`touch`)return;ae.current=!0;let r=e.relatedTarget;if(!(!p||n.current.includes(r))&&ue.current&&((t=se.current)==null||t.call(se),se.current=null,N.current=-1,P(e),!d)){let e=A.current,t=Xo(gs(e));e&&Zo(e,t)&&e.focus({preventScroll:!0})}}}),[he,le,A,p,n,P,ue,d]),ye=R(()=>d&&w&&me&&{"aria-activedescendant":`${v}-${r}`},[d,w,me,v,r]),be=R(()=>H(H({"aria-orientation":g===`both`?void 0:g},k?{}:ye),{},{onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&w&&!d){let t=Qo(e.nativeEvent);if(t&&!Zo(A.current,t))return;Ho(e),C.setOpen(!1,To(aa,e.nativeEvent)),ga(E)&&E.focus();return}_e(e)},onPointerMove(){ne.current=!0}}),[ye,_e,A,g,k,C,w,d,E]),xe=R(()=>{function e(e){C.setOpen(!0,To(oa,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&Wo(e.nativeEvent)&&(ee.current=!d)}function n(e){ee.current=f,f===`auto`&&Go(e.nativeEvent)&&(ee.current=!0)}return{onKeyDown(t){let n=C.select(`open`);ne.current=!1;let r=t.key.startsWith(`Arrow`),i=Ld(t.key,I(),u),a=Fd(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return _e(t);if(!(!n&&!m&&r)){if(o){let e=Fd(t.key,I());te.current=l&&e?null:t.key}if(l){i&&(Ho(t),n?(N.current=ge(),P(t)):e(t));return}a&&(F.current!=null&&(N.current=F.current),Ho(t),!n&&m?e(t):_e(t),n&&P(t))}},onFocus(e){C.select(`open`)&&!d&&(N.current=-1,P(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[_e,f,ge,l,P,C,m,g,I,u,F,d]),Se=R(()=>H(H({},ye),xe),[ye,xe]);return R(()=>a?{reference:Se,floating:be,item:ve,trigger:xe}:{},[a,Se,be,xe,ve])}B();function Bd(e,t){var n;let{listRef:r,elementsRef:i,activeIndex:a,onMatch:o,disabledIndices:s,onTyping:c,enabled:l=!0,resetMs:u=750,selectedIndex:d=null}=t,f=`rootStore`in e?e.rootStore:e,p=f.useState(`open`),m=Vo(),h=L(``),g=L((n=d==null?a:d)==null?-1:n),_=L(null),v=Ra(e=>{var t;function n(e){let t=i==null?void 0:i.current[e];return!t||ec(t)}function l(e){return n(e)?s==null||!Qs(pi,e,s):!1}function f(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length,a=e[n];if(!(!(a!=null&&a.toLowerCase().startsWith(i))||!l(n)))return n}return-1}let v=r.current;if(h.current.length>0&&e.key===` `&&(Ho(e),c==null||c(!0)),h.current.length>0&&h.current[0]!==` `&&f(v,h.current)===-1&&e.key!==` `&&(c==null||c(!1)),v==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;p&&e.key!==` `&&(Ho(e),c==null||c(!0));let y=h.current===``;if(y){var b;g.current=(b=d==null?a:d)==null?-1:b}v.every((e,t)=>{var n,r;return e&&l(t)?((n=e[0])==null?void 0:n.toLowerCase())!==((r=e[1])==null?void 0:r.toLowerCase()):!0})&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(u,()=>{h.current=``,g.current=_.current,c==null||c(!1)});let x=y?(t=d==null?a:d)==null?-1:t:g.current,S=(x==null?0:x)+1,C=f(v,h.current,S);C===-1?e.key!==` `&&(h.current=``,c==null||c(!1)):(o==null||o(C),_.current=C)}),y=Ra(e=>{let t=e.relatedTarget,n=f.select(`domReferenceElement`),r=f.select(`floatingElement`);Zo(n,t)||Zo(r,t)||(m.clear(),h.current=``,g.current=_.current,c==null||c(!1))});U(()=>{!p&&d!==null||(m.clear(),_.current=null,h.current!==``&&(h.current=``))},[p,d,m]),U(()=>{if(p&&h.current===``){var e;g.current=(e=d==null?a:d)==null?-1:e}},[p,d,a]);let b=R(()=>({onKeyDown:v,onBlur:y}),[v,y]);return R(()=>l?{reference:b,floating:b}:{},[l,b])}let Vd=.5;function Hd(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Ud(e,t,n,r,i,a,o,s,c,l){let u=!1;return Hd(e,t,n,r,i,a)&&(u=!u),Hd(e,t,i,a,o,s)&&(u=!u),Hd(e,t,o,s,c,l)&&(u=!u),Hd(e,t,c,l,n,r)&&(u=!u),u}function Wd(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Gd(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Kd(e={}){let{blockPointerEvents:t=!1}=e,n=new Bo,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r==null?void 0:r.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*.010000000000000002;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Qo(r),g=r.type===`mouseleave`,_=Zo(u,h),v=Zo(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&ha(r.relatedTarget)&&Zo(u,r.relatedTarget))return;function y(){return!!(s&&Tc(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Gd(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Gd(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Gd(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Gd(d,f,x.right-1,A,S.left+1,k);break;default:}if(j)return;if(l&&!Wd(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Vd/2:Vd*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Vd+1,o=C||T?S.bottom-Vd:S.top,s=C?T?S.bottom-Vd:S.top:S.bottom-Vd;M=Ud(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Vd/2:Vd*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Vd,o=C||T?S.top+Vd:S.bottom,s=C?T?S.top+Vd:S.bottom:S.top+Vd;M=Ud(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Vd/2:Vd*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Vd+1,o=w||E?S.right-Vd:S.left,s=w?E?S.right-Vd:S.left:S.right-Vd;M=Ud(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Vd/2:Vd*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Vd,o=w||E?S.left+Vd:S.right,s=w?E?S.left+Vd:S.right:S.left+Vd;M=Ud(d,f,a,r,a,i,o,S.top,s,S.bottom);break}default:}M?l||n.start(40,b):b()}};return r.__options=H(H({},e),{},{blockPointerEvents:t}),r}B();let qd=he(void 0);function Jd(e){let t=ze(qd);if(t===void 0&&!e)throw Error(Yr(69));return t}let Yd=new Set([`ArrowLeft`,`ArrowRight`]),Xd=new Set([`ArrowUp`,`ArrowDown`]),Zd=new Set([...Yd,...Xd]),Qd=new Set([...Zd,`Home`,`End`]);function $d(e){return e===`starting`?Hc:mi}B();let ef=[`render`,`className`,`style`,`finalFocus`],tf=H(H({},Qi),Hi),nf=bt(function(e,t){let{render:n,className:r,style:i,finalFocus:a}=e,o=yr(e,ef),{store:s}=$r(),{side:c,align:l}=Zr(),u=Jd(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),b=s.useState(`floatingRootContext`),x=s.useState(`floatingTreeRoot`),S=s.useState(`closeDelay`),C=s.useState(`activeTriggerElement`),w=s.useState(`hoverEnabled`),T=s.useState(`disabled`),E=s.useState(`openMethod`),D=_.type===`context-menu`;Fo({open:d,ref:s.context.popupRef,onComplete(){if(d){var e,t;(e=(t=s.context).onOpenChangeComplete)==null||e.call(t,!0)}}}),Fe(()=>{function e(e){s.setOpen(!1,To(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]),jd(b,{enabled:w&&!T&&!D&&_.type!==`menubar`,closeDelay:S});let O=Re(e=>{s.set(`popupElement`,e)},[s]),k=Ni(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,O],stateAttributesMapping:tf,props:[p,{onKeyDown(e){u&&Qd.has(e.key)&&e.stopPropagation()}},$d(f),o,{"data-rootownerid":y}]}),A=_.type===void 0||D;return(g||_.type===`menubar`&&v!==`outside-press`)&&(A=!0),W(ml,{context:b,openInteractionType:E,modal:D,disabled:!m,returnFocus:a===void 0?A:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:x,previousFocusableElement:C,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:k})});B();let rf=he(void 0);function af(){let e=ze(rf);if(e===void 0)throw Error(Yr(32));return e}B();let of=[`keepMounted`],sf=bt(function(e,t){let{keepMounted:n=!1}=e,r=yr(e,of),{store:i}=$r();return i.useState(`mounted`)||n?W(rf.Provider,{value:n,children:W(Zc,H({ref:t},r))}):null});function cf(e){return li(19)?e:e?`true`:void 0}B();let lf=he(void 0);function uf(){var e;let t=ze(lf);return(e=t==null?void 0:t.direction)==null?`ltr`:e}let df=e=>({name:`arrow`,options:e,async fn(t){var n,r;let{x:i,y:a,placement:o,rects:s,platform:c,elements:l,middlewareData:u}=t,{element:d,padding:f=0,offsetParent:p=`real`}=Os(e,t)||{};if(d==null)return{};let m=Ks(f),h={x:i,y:a},g=Ps(o),_=Ms(g),v=await c.getDimensions(d),y=g===`y`,b=y?`top`:`left`,x=y?`bottom`:`right`,S=y?`clientHeight`:`clientWidth`,C=s.reference[_]+s.reference[g]-h[g]-s.floating[_],w=h[g]-s.reference[g],T=p===`real`?await((n=c.getOffsetParent)==null?void 0:n.call(c,d)):l.floating,E=l.floating[S]||s.floating[_];(!E||!await((r=c.isElement)==null?void 0:r.call(c,T)))&&(E=l.floating[S]||s.floating[_]);let D=C/2-w/2,O=E/2-v[_]/2-1,k=Math.min(m[b],O),A=Math.min(m[x],O),j=k,M=E-v[_]-A,ee=E/2-v[_]/2+D,N=Ds(j,ee,M),te=!u.arrow&&As(o)!=null&&ee!==N&&s.reference[_]/2-(ee<j?k:A)-v[_]/2<0,ne=te?ee<j?ee-j:ee-M:0;return{[g]:h[g]+ne,data:H({[g]:N,centerOffset:ee-N-ne},te&&{alignmentOffset:ne}),reset:te}}}),ff=(e,t)=>H(H({},df(e)),{},{options:[e,t]}),pf=Ou().fn,mf={name:`hide`,async fn(e){var t;let{width:n,height:r,x:i,y:a}=e.rects.reference,o=n===0&&r===0&&i===0&&a===0;return{data:{referenceHidden:((t=(await pf(e)).data)==null?void 0:t.referenceHidden)||o}}}},hf={sideX:`left`,sideY:`top`},gf={name:`adaptiveOrigin`,async fn(e){var t,n;let{x:r,y:i,rects:{floating:a},elements:{floating:o},platform:s,strategy:c,placement:l}=e,u=fa(o),d=u.getComputedStyle(o);if(!(d.transitionDuration!==`0s`&&d.transitionDuration!==``))return{x:r,y:i,data:hf};let f=await((t=s.getOffsetParent)==null?void 0:t.call(s,o)),p={width:0,height:0};if(c===`fixed`&&u!=null&&u.visualViewport)p={width:u.visualViewport.width,height:u.visualViewport.height};else if(f===u){let e=gs(o);p={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await((n=s.isElement)==null?void 0:n.call(s,f))&&(p=await s.getDimensions(f));let m=ks(l),h=r,g=i;m===`left`&&(h=p.width-(r+a.width)),m===`top`&&(g=p.height-(i+a.height));let _=m===`left`?`right`:hf.sideX,v=m===`top`?`bottom`:hf.sideY;return{x:h,y:g,data:{sideX:_,sideY:v}}}};B();function _f(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function vf(e,t,n){let{rects:r,placement:i}=e;return{side:_f(t,ks(i),n),align:As(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function yf(e){var t,n;let{anchor:r,positionMethod:i=`absolute`,side:a=`bottom`,sideOffset:o=0,align:s=`center`,alignOffset:c=0,collisionBoundary:l,collisionPadding:u=5,sticky:d=!1,arrowPadding:f=5,disableAnchorTracking:p=!1,inline:m,keepMounted:h=!1,floatingRootContext:g,mounted:_,collisionAvoidance:v,shiftCrossAxis:y=!1,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,[w,T]=Ne(null);!_&&w!==null&&T(null);let E=v.side||`flip`,D=v.align||`flip`,O=v.fallbackAxisSide||`end`,k=typeof r==`function`?r:void 0,A=Ra(k),j=k?A:r,M=ms(r),ee=ms(_),N=uf()===`rtl`,te=w||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":N?`left`:`right`,"inline-start":N?`right`:`left`}[a],ne=s===`center`?te:`${te}-${s}`,P=u,re=+(a===`bottom`),ie=+(a===`top`),ae=+(a===`right`),oe=+(a===`left`);typeof P==`number`?P={top:P+re,right:P+oe,bottom:P+ie,left:P+ae}:P&&(P={top:(P.top||0)+re,right:(P.right||0)+oe,bottom:(P.bottom||0)+ie,left:(P.left||0)+ae});let se={boundary:l===`clipping-ancestors`?`clippingAncestors`:l,padding:P},ce=L(null),le=ms(o),F=ms(c),ue=typeof o==`function`?0:o,de=typeof c==`function`?0:c,fe=[];m&&fe.push(m),fe.push(Cu(e=>{let t=vf(e,a,N),n=typeof le.current==`function`?le.current(t):le.current,r=typeof F.current==`function`?F.current(t):F.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ue,de,N,a]));let pe=D===`none`&&E!==`shift`,me=!pe&&(d||y||E===`shift`),he=E===`none`?null:Eu(H(H({},se),{},{padding:{top:P.top+1,right:P.right+1,bottom:P.bottom+1,left:P.left+1},mainAxis:!y&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:O})),I=pe?null:wu(e=>{let t=gs(e.elements.floating).documentElement;return H(H({},se),{},{rootBoundary:y?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:D!==`none`,crossAxis:me,limiter:d||y?void 0:Tu(e=>{if(!ce.current)return{};let{width:t,height:n}=ce.current.getBoundingClientRect(),r=Ns(ks(e.placement)),i=r===`y`?t:n,a=r===`y`?P.left+P.right:P.top+P.bottom;return{offset:i/2+a/2}})})},[se,d,y,P,D]);E===`shift`||D===`shift`||s===`center`?fe.push(I,he):fe.push(he,I),fe.push(Du(H(H({},se),{},{apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!ee.current)return;let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=fa(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}})),ff(e=>({element:ce.current||gs(e.elements.floating).createElement(`div`),padding:f,offsetParent:`floating`}),[f]),{name:`transformOrigin`,fn(e){var t,n,r;let{elements:i,middlewareData:s,placement:c,rects:l,y:u}=e,d=ks(c),f=Ns(d),p=ce.current,m=((t=s.arrow)==null?void 0:t.x)||0,h=((n=s.arrow)==null?void 0:n.y)||0,g=(p==null?void 0:p.clientWidth)||0,_=(p==null?void 0:p.clientHeight)||0,v=m+g/2,y=h+_/2,b=Math.abs(((r=s.shift)==null?void 0:r.y)||0),x=l.reference.height/2,S=typeof o==`function`?o(vf(e,a,N)):o,C=b>S,w={top:`${v}px calc(100% + ${S}px)`,bottom:`${v}px ${-S}px`,left:`calc(100% + ${S}px) ${y}px`,right:`${-S}px ${y}px`}[d],T=`${v}px ${l.reference.y+x-u}px`;return i.floating.style.setProperty(`--transform-origin`,me&&f===`y`&&C?T:w),{}}},mf,x),U(()=>{!_&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,g]);let ge=R(()=>({elementResize:!p&&typeof ResizeObserver<`u`,layoutShift:!p&&typeof IntersectionObserver<`u`}),[p]),{refs:_e,elements:ve,x:ye,y:be,middlewareData:xe,update:Se,placement:Ce,context:we,isPositioned:Te,floatingStyles:Ee}=Cd({rootContext:g,open:h?_:void 0,placement:ne,middleware:fe,strategy:i,whileElementsMounted:h?void 0:(...e)=>lu(...e,ge),nodeId:b,externalTree:C}),{sideX:De,sideY:Oe}=xe.adaptiveOrigin||hf,ke=Te?i:`fixed`,Ae=R(()=>{let e=x?{position:ke,[De]:ye,[Oe]:be}:H({position:ke},Ee);return Te||(e.opacity=0),e},[x,ke,De,ye,Oe,be,Ee,Te]),je=L(null);U(()=>{if(!_)return;let e=M.current,t=typeof e==`function`?e():e,n=(bf(t)?t.current:t)||null;n!==je.current&&(_e.setPositionReference(n),je.current=n)},[_,_e,j,M]),Fe(()=>{if(!_)return;let e=M.current;typeof e!=`function`&&bf(e)&&e.current!==je.current&&(_e.setPositionReference(e.current),je.current=e.current)},[_,_e,j,M]),Fe(()=>{if(h&&_&&ve.reference&&ve.floating)return lu(ve.reference,ve.floating,Se,ge)},[h,_,ve,Se,ge]);let Me=ks(Ce),Pe=_f(a,Me,N),Ie=As(Ce)||`center`,Le=!!((t=xe.hide)!=null&&t.referenceHidden);U(()=>{S&&_&&Te&&T(Me)},[S,_,Te,Me]);let Re=R(()=>{var e,t;return{position:`absolute`,top:(e=xe.arrow)==null?void 0:e.y,left:(t=xe.arrow)==null?void 0:t.x}},[xe.arrow]),ze=((n=xe.arrow)==null?void 0:n.centerOffset)!==0;return R(()=>({positionerStyles:Ae,arrowStyles:Re,arrowRef:ce,arrowUncentered:ze,side:Pe,align:Ie,physicalSide:Me,anchorHidden:Le,refs:_e,context:we,isPositioned:Te,update:Se}),[Ae,Re,ce,ze,Pe,Ie,Me,Le,_e,we,Te,Se])}function bf(e){return e!=null&&`current`in e}B();function xf(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Ra(i),o=L(0),s=ti(Cf).current,c=ti(Sf).current,[l,u]=Ne(0),d=L(l),f=Ra((e,t)=>{c.set(e,t==null?null:t),d.current+=1,u(d.current)}),p=Ra(e=>{c.delete(e),d.current+=1,u(d.current)}),m=R(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(wf).forEach((t,n)=>{var r;let i=(r=c.get(t))==null?{}:r;e.set(t,H(H({},i),{},{index:n}))}),e},[c,l]);U(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),U(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),U(()=>()=>{n.current=[]},[n]),U(()=>()=>{r&&(r.current=[])},[r]);let h=Ra(e=>(s.add(e),()=>{s.delete(e)}));U(()=>{s.forEach(e=>e(m))},[s,m]);let g=R(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return W(mo.Provider,{value:g,children:t})}function Sf(){return new Map}function Cf(){return new Set}function wf(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}B();let Tf=[`cutout`],Ef=bt(function(e,t){let{cutout:n}=e,r=yr(e,Tf),i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return W(`div`,H(H({ref:t,role:`presentation`,"data-base-ui-inert":``},r),{},{style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}}))});function Df(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c=H({},n);return s&&(c.pointerEvents=`none`),Ni(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},$d(r),i],stateAttributesMapping:Qi})}let Of={},kf={},Af=``;function jf(e){if(typeof document>`u`)return!1;let t=gs(e);return fa(t).innerWidth-t.documentElement.clientWidth>0}function Mf(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=gs(e),n=t.documentElement,r=t.body,i=va(n)?n:r,a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Nf(e){let t=gs(e),n=t.documentElement,r=t.body,i=va(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Pf(e){var t,n;let r=gs(e),i=r.documentElement,a=r.body,o=fa(i),s=0,c=0,l=!1,u=Ao.create();if(so&&((t=(n=o.visualViewport)==null?void 0:n.scale)==null?1:t)!==1)return()=>{};function d(){let t=o.getComputedStyle(i),n=o.getComputedStyle(a),r=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;s=i.scrollTop,c=i.scrollLeft,Of={scrollbarGutter:i.style.scrollbarGutter,overflowY:i.style.overflowY,overflowX:i.style.overflowX},Af=i.style.scrollBehavior,kf={position:a.style.position,height:a.style.height,width:a.style.width,boxSizing:a.style.boxSizing,overflowY:a.style.overflowY,overflowX:a.style.overflowX,scrollBehavior:a.style.scrollBehavior};let u=i.scrollHeight>i.clientHeight,d=i.scrollWidth>i.clientWidth,f=t.overflowY===`scroll`||n.overflowY===`scroll`,p=t.overflowX===`scroll`||n.overflowX===`scroll`,m=Math.max(0,o.innerWidth-a.clientWidth),h=Math.max(0,o.innerHeight-a.clientHeight),g=parseFloat(n.marginTop)+parseFloat(n.marginBottom),_=parseFloat(n.marginLeft)+parseFloat(n.marginRight),v=va(i)?i:a;if(l=Mf(e),l){i.style.scrollbarGutter=r,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(i.style,{scrollbarGutter:r,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(i.style.overflowY=`scroll`),(d||p)&&(i.style.overflowX=`scroll`),Object.assign(a.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),a.scrollTop=s,a.scrollLeft=c,i.setAttribute(`data-base-ui-scroll-locked`,``),i.style.scrollBehavior=`unset`}function f(){Object.assign(i.style,Of),Object.assign(a.style,kf),l||(i.scrollTop=s,i.scrollLeft=c,i.removeAttribute(`data-base-ui-scroll-locked`),i.style.scrollBehavior=Af)}function p(){f(),u.request(d)}d();let m=fs(o,`resize`,p);return()=>{u.cancel(),f(),typeof o.removeEventListener==`function`&&m()}}let Ff=new class{constructor(){V(this,`lockCount`,0),V(this,`restore`,null),V(this,`timeoutLock`,Bo.create()),V(this,`timeoutUnlock`,Bo.create()),V(this,`release`,()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)}),V(this,`unlock`,()=>{if(this.lockCount===0&&this.restore){var e;(e=this.restore)==null||e.call(this),this.restore=null}})}acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}lock(e){if(this.lockCount===0||this.restore!==null)return;let t=gs(e).documentElement,n=fa(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=fi;return}let r=eo||!jf(e);this.restore=r?Nf(e):Pf(e)}};function If(e=!0,t=null){U(()=>{if(e)return Ff.acquire(t)},[e,t])}B();function Lf(e,t,n,r){let[i,a]=Ne(!1);U(()=>{if(!e||!t||n==null){a(!1);return}let r=gs(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-20)},[e,t,n]),If(e&&(!t||i),r)}B();let Rf=[`anchor`,`positionMethod`,`className`,`render`,`side`,`align`,`sideOffset`,`alignOffset`,`collisionBoundary`,`collisionPadding`,`arrowPadding`,`sticky`,`disableAnchorTracking`,`collisionAvoidance`,`style`],zf=bt(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Uc,style:g}=e,_=yr(e,Rf),{store:v}=$r(),y=af(),b=ea(!0),x=v.useState(`parent`),S=v.useState(`floatingRootContext`),C=v.useState(`floatingTreeRoot`),w=v.useState(`mounted`),T=v.useState(`open`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`activeTriggerElement`),k=v.useState(`transitionStatus`),A=v.useState(`positionerElement`),j=v.useState(`instantType`),M=v.useState(`hasViewport`),ee=v.useState(`lastOpenChangeReason`),N=v.useState(`floatingNodeId`),te=v.useState(`floatingParentNodeId`),ne=S.useState(`domReferenceElement`),P=L(null),re=Po(A,!1,!1),ie=n,ae=c,oe=l,se=s,ce=h;if(x.type===`context-menu`){var le,F;if(ie=n==null?(le=x.context)==null?void 0:le.anchor:n,se=(F=se)==null?`start`:F,!o&&se!==`center`){var ue,de;oe=(ue=e.alignOffset)==null?2:ue,ae=(de=e.sideOffset)==null?-5:de}}let fe=o,pe=se;if(x.type===`menu`){var me,he,I;fe=(me=fe)==null?`inline-end`:me,pe=(he=pe)==null?`start`:he,ce=(I=e.collisionAvoidance)==null?Wc:I}else if(x.type===`menubar`){var ge,_e;fe=(ge=fe)==null?x.context.orientation===`vertical`?`inline-end`:`bottom`:ge,pe=(_e=pe)==null?`start`:_e}let ve=x.type===`context-menu`,ye=yf({anchor:ie,floatingRootContext:S,positionMethod:b?`fixed`:r,mounted:w,side:fe,sideOffset:ae,align:pe,alignOffset:oe,arrowPadding:ve?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:N,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:ce,shiftCrossAxis:ve&&!(`side`in ce&&ce.side===`flip`),externalTree:C,adaptiveOrigin:M?gf:void 0});Fe(()=>{function e(e){e.open&&(e.parentNodeId===N&&v.set(`hoverEnabled`,!1),e.nodeId!==N&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,To(sa)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,N]),Fe(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){var t;if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let n=(t=e.reason)==null?sa:t;v.setOpen(!1,To(n))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let be=Vo();Fe(()=>{T||be.clear()},[T,be]),Fe(()=>{function e(e){if(!(!T||e.nodeId!==v.select(`floatingParentNodeId`)))if(e.target&&O&&O!==e.target){let e=v.select(`closeDelay`);e>0?be.isStarted()||be.start(e,()=>{v.setOpen(!1,To(sa))}):v.setOpen(!1,To(sa))}else be.clear()}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,T,O,v,be]),Fe(()=>{let e={open:T,nodeId:N,parentNodeId:te,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,T,v,N,te]),U(()=>{let e=ne,t=P.current;if(e&&(P.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return re(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[ne,re,v]);let xe={open:T,side:ye.side,align:ye.align,anchorHidden:ye.anchorHidden,nested:x.type===`menu`,instant:j},Se=x.type===`menubar`&&x.context.modal;Lf(T&&(Se||E&&ee!==`trigger-hover`),D===`touch`,A,O);let Ce=Df(e,xe,{styles:ye.positionerStyles,transitionStatus:k,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!T}),we=w&&x.type!==`menu`&&(x.type!==`menubar`&&E&&ee!==`trigger-hover`||x.type===`menubar`&&x.context.modal),Te=null;return x.type===`menubar`?Te=x.context.contentElement:x.type===void 0&&(Te=O),W(Xr.Provider,{value:ye,children:[we&&W(Ef,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:cf(!T),cutout:Te}),W(al,{id:N,children:W(xf,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:Ce})})]})});B();let Bf=he(void 0);function Vf(){let e=ze(Bf);if(e===void 0)throw Error(Yr(34));return e}B();let Hf=[`render`,`className`,`value`,`defaultValue`,`onValueChange`,`disabled`,`style`,`aria-labelledby`],Uf=yt(bt(function(e,t){let{render:n,className:r,value:i,defaultValue:a,onValueChange:o,disabled:s=!1,style:c,"aria-labelledby":l}=e,u=yr(e,Hf),[d,f]=Ne(void 0),[p,m]=la({controlled:i,default:a,name:`MenuRadioGroup`}),h=Ra((e,t)=>{o==null||o(e,t),!t.isCanceled&&m(e)}),g=Ni(`div`,e,{state:{disabled:s},ref:t,props:H({role:`group`,"aria-labelledby":l==null?d:l,"aria-disabled":s||void 0},u)}),_=R(()=>({value:p,setValue:h,disabled:s}),[p,h,s]);return W(Io.Provider,{value:f,children:W(Bf.Provider,{value:_,children:g})})}));B();let Wf=he(void 0);function Gf(){let e=ze(Wf);if(e===void 0)throw Error(Yr(35));return e}B();let Kf=[`render`,`className`,`id`,`label`,`nativeButton`,`disabled`,`closeOnClick`,`value`,`style`],qf=bt(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,value:l,style:u}=e,d=yr(e,Kf),f=_o({label:a}),p=Zr(!0),m=So(i),{store:h}=$r(),g=h.useState(`isActive`,f.index),_=h.useState(`itemProps`),{value:v,setValue:y,disabled:b}=Vf(),x=b||s,S=v===l,{getItemProps:C,itemRef:w}=po({closeOnClick:c,disabled:x,highlighted:g,id:m,store:h,nativeButton:o,nodeId:p==null?void 0:p.context.nodeId,itemMetadata:fo}),T=R(()=>({disabled:x,highlighted:g,checked:S}),[x,g,S]);function E(e){let t=To(ia,e.nativeEvent,void 0,{preventUnmountOnClose(){}});y(l,t)}let D=Ni(`div`,e,{state:T,stateAttributesMapping:wo,props:[_,{role:`menuitemradio`,"aria-checked":S,onClick:E},d,C],ref:[w,t,f.ref]});return W(Wf.Provider,{value:T,children:D})});B();let Jf=[`render`,`className`,`style`,`keepMounted`],Yf=bt(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1}=e,o=yr(e,Jf),s=Gf(),c=L(null),{transitionStatus:l,setMounted:u}=Mo(s.checked);return Fo({open:s.checked,ref:c,onComplete(){s.checked||u(!1)}}),Ni(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},stateAttributesMapping:wo,ref:[t,c],props:H({"aria-hidden":!0},o),enabled:a||s.checked})});B();let Xf=he(null);function Zf(e){let t=ze(Xf);if(t===null&&!e)throw Error(Yr(5));return t}B();function Qf(e){let t=L(``),n=Re(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:Re(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}B();function $f(e,t){let n=L(e),r=Ra(t);U(()=>{n.current!==e&&r(n.current)},[e,r]),U(()=>{n.current=e},[e])}B();function ep(e,t){let{onClick:n,onPointerDown:r}=Qf(Ra((n,r)=>{(typeof e==`function`?e():e)||t(r||(eo?`touch`:``))}));return R(()=>({onClick:n,onPointerDown:r}),[n,r])}function tp(e){let[t,n]=Ne(null),r=ep(e,n);return $f(e,t=>{t&&!e&&n(null)}),R(()=>({openMethod:t,triggerProps:r}),[t,r])}B();let np=H(H({},xd),{},{disabled:G(e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled),modal:G(e=>{var t;return(e.parent.type===void 0||e.parent.type===`context-menu`)&&((t=e.modal)==null||t)}),openMethod:G(e=>e.openMethod),allowMouseEnter:G(e=>e.allowMouseEnter),highlightItemOnHover:G(e=>e.highlightItemOnHover),stickIfOpen:G(e=>e.stickIfOpen),parent:G(e=>e.parent),rootId:G(e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId),activeIndex:G(e=>e.activeIndex),isActive:G((e,t)=>e.activeIndex===t),hoverEnabled:G(e=>e.hoverEnabled),instantType:G(e=>e.instantType),lastOpenChangeReason:G(e=>e.openChangeReason),floatingTreeRoot:G(e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot),floatingNodeId:G(e=>e.floatingNodeId),floatingParentNodeId:G(e=>e.floatingParentNodeId),itemProps:G(e=>e.itemProps),closeDelay:G(e=>e.closeDelay),hasViewport:G(e=>e.hasViewport),keyboardEventRelay:G(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)})});var rp=class e extends Yu{constructor(e){super(H(H({},ip()),e),{positionerRef:T(),popupRef:T(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:T(),beforeContentFocusGuardRef:T(),onOpenChangeComplete:void 0,triggerElements:new fd},np),V(this,`unsubscribeParentListener`,null),this.unsubscribeParentListener=this.observe(`parent`,e=>{var t;if((t=this.unsubscribeParentListener)==null||t.call(this),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);t===i&&n===a&&r===o||(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}static useStore(t,n){let r=ti(()=>new e(n)).current;return t==null?r:t}};function ip(){return H(H({},md()),{},{disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new $c,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:mi,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1})}B();let ap=he(void 0);function op(){return ze(ap)}B();let sp=Ru(function(e){var t;let{children:n,open:r,onOpenChange:i,onOpenChangeComplete:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:g=!0}=e,_=ea(!0),v=$r(!0),y=Zf(!0),b=op(),x=R(()=>b&&v?{type:`menu`,store:v.store}:y?{type:`menubar`,context:y}:_&&!v?{type:`context-menu`,context:_}:{type:void 0},[_,v,y,b]),S=rp.useStore(p==null?void 0:p.store,{open:o,openProp:r,activeTriggerId:h,triggerIdProp:m,parent:x});od(S,r,o,h),S.useControlledProp(`openProp`,r),S.useControlledProp(`triggerIdProp`,m),S.useContextCallback(`onOpenChangeComplete`,a);let C=xo(),w=xo(),T=S.useState(`floatingTreeRoot`),E=il(T),D=nl(),O=S.useState(`open`),k=S.useState(`activeTriggerElement`),A=S.useState(`positionerElement`),j=S.useState(`hoverEnabled`),M=S.useState(`disabled`),ee=S.useState(`lastOpenChangeReason`),N=S.useState(`parent`),te=S.useState(`activeIndex`),ne=S.useState(`payload`),P=S.useState(`floatingParentNodeId`),re=L(null),ie=L(N.type!==`context-menu`),ae=Vo(),oe=L(!0),se=Vo(),ce=P!=null,{openMethod:le,triggerProps:F}=tp(O);S.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:N.type===void 0?c:void 0,openMethod:le,rootId:C}),cd(S);let{forceUnmount:ue}=ld(O,S,()=>{S.update({allowMouseEnter:!1,stickIfOpen:!0})});U(()=>{_&&!v?S.update({parent:{type:`context-menu`,context:_},floatingNodeId:E,floatingParentNodeId:D}):v&&S.update({floatingNodeId:E,floatingParentNodeId:D})},[_,v,E,D,S]),Fe(()=>{if(O||(re.current=null),N.type===`context-menu`){if(!O){ae.clear(),ie.current=!1;return}ae.start(500,()=>{ie.current=!0})}},[ae,O,N.type]),U(()=>{!O&&!j&&S.set(`hoverEnabled`,!0)},[O,j,S]);let de=Ra((e,t)=>{var n;let r=t.reason;if(O===e&&t.trigger===k&&ee===r)return;let a=ad(t);if(!e&&t.trigger==null&&(t.trigger=k==null?void 0:k),i==null||i(e,t),t.isCanceled)return;S.state.floatingRootContext.dispatchOpenChange(e,t);let o=t.event;if(e===!1&&(o==null?void 0:o.type)===`click`&&o.pointerType===`touch`&&!oe.current)return;e&&r===`trigger-focus`?(oe.current=!1,se.start(300,()=>{oe.current=!0})):(oe.current=!0,se.clear());let s=(r===`trigger-press`||r===`item-press`)&&o.detail===0&&(o==null?void 0:o.isTrusted),c=!e&&(r===`escape-key`||r==null),l={open:e,openChangeReason:r};re.current=(n=t.event)==null?null:n,id(l,e,t.trigger,a()),S.update(l),N.type===`menubar`&&(r===`trigger-focus`||r===`focus-out`||r===`trigger-hover`||r===`list-navigation`||r===`sibling-open`)?S.set(`instantType`,`group`):s||c?S.set(`instantType`,s?`click`:`dismiss`):S.set(`instantType`,void 0)}),fe=$u({popupStore:S,floatingId:w,nested:D!=null,onOpenChange:de}),pe=fe.context.events;Fe(()=>{let e=({open:e,eventDetails:t})=>de(e,t);return pe.on(`setOpen`,e),()=>{pe==null||pe.off(`setOpen`,e)}},[pe,de]);let me=Re(()=>{S.setOpen(!1,To(ca))},[S]);Le(d,()=>({unmount:ue,close:me}),[ue,me]);let he;N.type===`context-menu`&&(he=N.context),Le(he==null?void 0:he.positionerRef,()=>A,[A]),Le(he==null?void 0:he.actionsRef,()=>({setOpen:de}),[de]);let I=vl(fe,{enabled:!M,bubbles:{escapeKey:f&&N.type===`menu`},outsidePress(){var e;return N.type!==`context-menu`||((e=re.current)==null?void 0:e.type)===`contextmenu`||ie.current},externalTree:ce?T:void 0}),ge=uf(),_e=Re(e=>{S.select(`activeIndex`)!==e&&S.set(`activeIndex`,e)},[S]),ve=zd(fe,{enabled:!M,listRef:S.context.itemDomElements,activeIndex:te,nested:N.type!==void 0,loopFocus:l,orientation:u,parentOrientation:N.type===`menubar`?N.context.orientation:void 0,rtl:ge===`rtl`,disabledIndices:pi,onNavigate:_e,openOnArrowKeyDown:N.type!==`context-menu`,externalTree:ce?T:void 0,focusItemOnHover:g}),ye=Re(e=>{S.context.typingRef.current=e},[S]),be=Bd(fe,{enabled:!M,listRef:S.context.itemLabels,elementsRef:S.context.itemDomElements,activeIndex:te,resetMs:500,onMatch:e=>{O&&e!==te&&S.set(`activeIndex`,e)},onTyping:ye});ud(S,{floatingRootContext:fe,activeTriggerProps:R(()=>{let e=yi(be.reference,ve.reference,I.reference,{onMouseMove(){S.set(`allowMouseEnter`,!0)}},F);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=O,e},[S,be.reference,ve.reference,I.reference,F,O]),inactiveTriggerProps:R(()=>{let e=yi(ve.trigger,I.trigger,F);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[ve.trigger,I.trigger,F]),popupProps:R(()=>yi(ed,{id:w,role:`menu`,"aria-labelledby":k==null?void 0:k.id,onMouseMove(){S.set(`allowMouseEnter`,!0),N.type===`menu`&&S.set(`hoverEnabled`,!1)},onClick(){S.select(`hoverEnabled`)&&S.set(`hoverEnabled`,!1)},onKeyDown(e){let t=S.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},be.floating,ve.floating,I.floating),[k,w,N.type,S,be.floating,ve.floating,I.floating]),itemProps:(t=ve.item)==null?mi:t});let xe=R(()=>({store:S,parent:x}),[S,x]),Se=W(Qr.Provider,{value:xe,children:typeof n==`function`?n({payload:ne}):n});return N.type===void 0||N.type===`context-menu`?W(ol,{externalTree:T,children:Se}):Se});function cp(e){let t=e.getBoundingClientRect(),n=fa(e);if(lo)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(!(r.content!==`none`||i.content!==`none`))return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}B();function lp(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Ha(),{ref:i,index:a}=_o(e),o=n===a,s=L(null),c=ni(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}let up=[`render`,`className`,`style`,`state`,`props`,`refs`,`metadata`,`stateAttributesMapping`,`tag`];function dp(e){let{render:t,className:n,style:r,state:i=mi,props:a=pi,refs:o=pi,metadata:s,stateAttributesMapping:c,tag:l=`div`}=e,u=yr(e,up),{compositeProps:d,compositeRef:f}=lp({metadata:s});return Ni(l,e,{state:i,ref:[...o,f],props:[d,...a,u],stateAttributesMapping:c})}function fp(e){if(ga(e)&&e.hasAttribute(`data-rootownerid`)){var t;return(t=e.getAttribute(`data-rootownerid`))==null?void 0:t}if(!Oa(e))return fp(ja(e))}B();function pp(e,t){let n=L(null);function r(t){ln(()=>{e.setOpen(!1,To(aa,t.nativeEvent,t.currentTarget))});let r=xc(n.current);r==null||r.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&Sc(n,r)){var i;(i=e.context.beforeContentFocusGuardRef.current)==null||i.focus()}else{ln(()=>{e.setOpen(!1,To(aa,n.nativeEvent,n.currentTarget))});let i=bc(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&Zo(r,i);){let e=i;if(i=_c(i),i===e)break}i==null||i.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}B();function mp(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=L(!1);return R(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,gs(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:mi,[t,n,r])}B();let hp=[`render`,`className`,`style`,`disabled`,`nativeButton`,`id`,`openOnHover`,`delay`,`closeDelay`,`handle`,`payload`],gp=zu(function(e,t){var n;let{render:r,className:i,style:a,disabled:o=!1,nativeButton:s=!0,id:c,openOnHover:l,delay:u=100,closeDelay:d=0,handle:f,payload:p}=e,m=yr(e,hp),h=$r(!0),g=(n=f==null?void 0:f.store)==null?h==null?void 0:h.store:n;if(!g)throw Error(Yr(85));let _=So(c),v=g.useState(`isTriggerActive`,_),y=g.useState(`floatingRootContext`),b=g.useState(`isOpenedByTrigger`,_),x=g.useState(`triggerPopupId`,_),S=L(null),C=vp(),w=Ha(!0),T=rl(),D=R(()=>T==null?new $c:T,[T]),{registerTrigger:O,isMountedByThisTrigger:k}=sd(_,S,g,{payload:p,closeDelay:d,parent:C,floatingTreeRoot:D,floatingNodeId:il(D),floatingParentNodeId:nl(),keyboardEventRelay:w==null?void 0:w.relayKeyboardEvent}),A=C.type===`menubar`,j=g.useState(`disabled`),M=o||j||A&&C.context.disabled,{getButtonProps:ee,buttonRef:N}=Ga({disabled:M,native:s});Fe(()=>{!b&&C.type===void 0&&(g.context.allowMouseUpTriggerRef.current=!1)},[g,b,C.type]);let te=L(null),ne=Vo(),P=Ra(e=>{if(!te.current)return;ne.clear(),g.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if(Zo(te.current,t)||Zo(g.select(`positionerElement`),t)||t===te.current||t!=null&&fp(t)===g.select(`rootId`))return;let n=cp(te.current);e.clientX>=n.left-2&&e.clientX<=n.right+2&&e.clientY>=n.top-2&&e.clientY<=n.bottom+2||D.events.emit(`close`,{domEvent:e,reason:`cancel-open`})});Fe(()=>{b&&g.select(`lastOpenChangeReason`)===`trigger-hover`&&gs(te.current).addEventListener(`mouseup`,P,{once:!0})},[b,P,g]);let re=A&&C.context.hasSubmenuOpen,ie=Nd(y,{enabled:(l==null?re:l)&&!M&&C.type!==`context-menu`&&(!A||re&&!k),handleClose:Kd({blockPointerEvents:!A}),mouseOnly:!0,move:!1,restMs:C.type===void 0?u:void 0,delay:{close:d},triggerElementRef:S,externalTree:D,isActiveTrigger:v,isClosing:()=>g.select(`transitionStatus`)===`ending`}),ae=_p(b,g.select(`lastOpenChangeReason`)),oe=hl(y,{enabled:!M&&C.type!==`context-menu`,event:b&&A?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0&&ae}),se=Td(y,{enabled:!M&&re}),ce=mp({open:b,enabled:A,mouseDownAction:`open`}),le=R(()=>yi(se.reference,oe.reference),[se.reference,oe.reference]),F=g.useState(`triggerProps`,k),{preFocusGuardRef:ue,handlePreFocusGuardFocus:de,handleFocusTargetFocus:fe}=pp(g,S),pe={disabled:M,open:b},me=[te,t,N,O,S],he=[le,ie==null?mi:ie,F,{"aria-haspopup":`menu`,"aria-controls":x,id:_,onMouseDown:e=>{g.select(`open`)||(ne.start(200,()=>{g.context.allowMouseUpTriggerRef.current=!0}),gs(e.currentTarget).addEventListener(`mouseup`,P,{once:!0}))}},A?{role:`menuitem`}:{},ce,m,ee],I=Ni(`button`,e,{enabled:!A,stateAttributesMapping:Zi,state:pe,ref:me,props:he});return A?W(dp,{tag:`button`,render:r,className:i,style:a,state:pe,refs:me,props:he,stateAttributesMapping:Zi}):b?W(E,{children:[W(ys,{ref:ue,onFocus:de},`${_}-pre-focus-guard`),W(E,{children:I},_),W(ys,{ref:g.context.triggerFocusTargetRef,onFocus:fe},`${_}-post-focus-guard`)]}):W(E,{children:I},_)});function _p(e,t){let n=Vo(),[r,i]=Ne(!1);return U(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function vp(){let e=ea(!0),t=$r(!0),n=Zf(!0);return R(()=>n?{type:`menubar`,context:n}:e&&!t?{type:`context-menu`,context:e}:{type:void 0},[e,t,n])}B();function yp(e){return`${e.charAt(0).toLocaleUpperCase()}${e.substring(1)}`}let bp={askAI:`askAI`,favoriteSearches:`favoriteSearches`,recentConversations:`recentConversations`,recentSearches:`recentSearches`};function xp(e,t){return e.collections.find(e=>(e==null?void 0:e.source.sourceId)===t)}function Sp(e){return e.replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&quot;/g,`"`).replace(/&#039;/g,`'`).replace(/&amp;/g,`&`)}let Cp=[`lvl0`,`lvl1`,`lvl2`,`lvl3`,`lvl4`,`lvl5`,`lvl6`];function wp(e){let t=e.type===`content`||e.type===`askAI`?Cp.length:Cp.indexOf(e.type);return Cp.slice(0,t).map(t=>e.hierarchy[t]?Sp(e.hierarchy[t]):null).filter(Boolean).join(` > `)}let Tp=new Map;function Ep(e){let t=Tp.get(e);if(t)return t;let n=e.replace(/\[(\w+)\]/g,`.$1`).replace(/^\/./,``).split(`.`);return Tp.set(e,n),n}function Dp(e,t){return Ep(t).reduce((e,t)=>{if(e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,t))return e[t]},e)}function Op(e,t,n){return e.reduce((e,r)=>{let i=t(r);return e.hasOwnProperty(i)||(e[i]=[]),e[i].length<(n||5)&&e[i].push(r),e},{})}function kp(e){return e}function Ap(e){return e.button===1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function jp(...e){}let Mp=/(<mark>|<\/mark>)/g,Np=RegExp(Mp.source);function Pp(e){var t,n;let r=e;if(!r.__docsearch_parent&&!e._highlightResult)return e.hierarchy.lvl0;let i=r.__docsearch_parent?(t=r.__docsearch_parent)==null||(t=t._highlightResult)==null||(t=t.hierarchy)==null?void 0:t.lvl0:(n=e._highlightResult)==null||(n=n.hierarchy)==null?void 0:n.lvl0;return i?i.value&&Np.test(i.value)?i.value.replace(Mp,``):i.value:e.hierarchy.lvl0}function Fp(e){typeof e.scrollTo==`function`?e.scrollTo({top:0,behavior:`smooth`}):e.scrollTop=0}function Ip(){return z.createElement(`svg`,{className:`DocSearch-Hit-Select-Icon`,width:`20`,height:`20`,viewBox:`0 0 20 20`},z.createElement(`g`,{stroke:`currentColor`,fill:`none`,fillRule:`evenodd`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`path`,{d:`M18 3v4c0 2-2 4-4 4H2`}),z.createElement(`path`,{d:`M8 17l-6-6 6-6`})))}function Lp(){return z.createElement(`svg`,{width:`40`,height:`40`,viewBox:`0 0 20 20`,fill:`none`,fillRule:`evenodd`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`path`,{d:`M19 4.8a16 16 0 00-2-1.2m-3.3-1.2A16 16 0 001.1 4.7M16.7 8a12 12 0 00-2.8-1.4M10 6a12 12 0 00-6.7 2M12.3 14.7a4 4 0 00-4.5 0M14.5 11.4A8 8 0 0010 10M3 16L18 2M10 18h0`}))}function Rp(){return z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`64`,height:`64`,viewBox:`0 0 24 24`,fill:`none`,stroke:`#5a5e9a`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`path`,{d:`m13.5 8.5-5 5`}),z.createElement(`path`,{d:`m8.5 8.5 5 5`}),z.createElement(`circle`,{cx:`11`,cy:`11`,r:`8`}),z.createElement(`path`,{d:`m21 21-4.3-4.3`}))}function zp(){return z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`path`,{d:`M12 17v5`}),z.createElement(`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}))}function Bp(){return z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},z.createElement(`polyline`,{points:`6 9 12 15 18 9`}))}function Vp(){return z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},z.createElement(`polyline`,{points:`20 6 9 17 4 12`}))}function Hp(e=[]){let t=new Map;for(let n of e){let e=n.key.trim().toLowerCase();if(!(e.length===0||t.has(e))){if(t.size>=5)break;t.set(e,n)}}return Array.from(t.values())}function Up(e){return e.label?e.label:e.key.replace(/[._-]+/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}let Wp=[`className`,`type`];function Gp({children:e}){return z.createElement(`div`,{className:`DocSearch-Chip`},e)}function Kp(e){let{className:t,type:n=`button`}=e,r=mn(e,Wp),i=`DocSearch-Chip-Dismiss${t?` ${t}`:``}`;return z.createElement(`button`,_({type:n,className:i,tabIndex:0},r),z.createElement(Mr,{"aria-hidden":`true`}))}Gp.Dismiss=Kp;let qp=[`className`],Jp=[`align`,`alignOffset`,`side`,`sideOffset`,`collisionBoundary`,`container`],Yp=[`className`,`children`],Xp=[`className`];function Zp(e){let t=jr({},(Ar(e),e));return z.createElement(sp,t)}function Qp(e){let{className:t}=e,n=mn(e,qp),r=`DocSearch-Menu-Trigger${t?` ${t}`:``}`;return z.createElement(gp,_({className:r},n))}Zp.Trigger=Qp;function $p(e){let{align:t=`start`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,collisionBoundary:a=`clipping-ancestors`,container:o}=e,s=mn(e,Jp);return z.createElement(sf,{container:o},z.createElement(zf,{className:`DocSearch-Menu-Positioner`,align:t,alignOffset:n,side:r,sideOffset:i,collisionBoundary:a},z.createElement(nf,_({className:`DocSearch-Menu-Popup`},s))))}Zp.Popup=$p;function em(e){let t=jr({},(Ar(e),e));return z.createElement(Uf,t)}Zp.RadioGroup=em;function tm(e){let{className:t,children:n}=e,r=mn(e,Yp),i=`DocSearch-Menu-Item DocSearch-Menu-RadioItem${t?` ${t}`:``}`;return z.createElement(qf,_({className:i,closeOnClick:!0},r),z.createElement(`span`,{className:`DocSearch-Menu-RadioItem-Indicator`},z.createElement(Yf,null,z.createElement(Vp,null))),n)}Zp.RadioItem=tm;function nm(e){let{className:t}=e,n=mn(e,Xp),r=`DocSearch-Menu-GroupLabel${t?` ${t}`:``}`;return z.createElement(zo,_({className:r},n))}Zp.GroupLabel=nm;let rm=z.memo(function({facet:e,selectedValue:t,defaultValueLabel:n,onSelectionChange:r,registerTrigger:i,menuTriggerSelectedAriaLabel:a}){let o=Up(e),s=z.useCallback(t=>{r(e.key,t)},[e.key,r]),c=z.useCallback(t=>{i(e.key,t)},[e.key,i]);return z.createElement(Zp,null,z.createElement(Zp.Trigger,{ref:c,"data-has-selection":!!t,"aria-label":t?`${o}, ${t} ${a}`:o},z.createElement(`span`,null,yp(o)),z.createElement(Bp,null)),z.createElement(Zp.Popup,null,z.createElement(Zp.RadioGroup,{value:t,onValueChange:s},z.createElement(Zp.RadioItem,{value:``,label:`${n} ${o}`},n),e.values.map(e=>z.createElement(Zp.RadioItem,{key:e,value:e,label:e},yp(e))))))}),im=z.memo(function({facetKey:e,facetLabel:t,value:n,dismissAriaLabel:r,onDismiss:i}){let a=z.useCallback(t=>{i(e,t)},[e,i]);return z.createElement(Gp,null,yp(n),z.createElement(Gp.Dismiss,{"aria-label":`${r} ${yp(n)} (${t})`,onClick:a}))}),am=z.memo(function({facets:e,selections:t,onSelectionChange:n,clearSelections:r,translations:i={}}){let{defaultValueLabel:a=`All`,facetMenuTriggerAriaLabel:o=`selected`,clearAllLabel:s=`Clear all`,facetsAriaLabel:c=`Search filters`,selectedFacetsAriaLabel:l=`Selected search filters`,clearFacetAriaLabel:u=`Clear filter:`}=i,d=z.useMemo(()=>Object.entries(t).filter(([e,t])=>!!t),[t]),f=z.useRef(new Map),p=z.useCallback((e,t)=>{t?f.current.set(e,t):f.current.delete(e)},[]),m=z.useCallback((e,t)=>{let r=t.currentTarget,i=r.closest(`.DocSearch-FacetSelectionBar`);if(i){var a,o;let t=Array.from(i.querySelectorAll(`.DocSearch-Chip-Dismiss`)),n=t.indexOf(r),s=(a=(o=t[n+1])==null?t[n-1]:o)==null?f.current.get(e):a;s==null||s.focus()}n(e,``)},[n]),h=z.useCallback(()=>{var e;(e=f.current.values().next().value)==null||e.focus(),r()},[r]),g=z.useMemo(()=>new Map(e.map(e=>[e.key,Up(e)])),[e]);return e.length===0?null:z.createElement(z.Fragment,null,z.createElement(`div`,{className:`DocSearch-FacetBar`,role:`group`,"aria-label":c},e.map(e=>{var r;let i=(r=t[e.key])==null?``:r;return z.createElement(rm,{key:e.key,facet:e,selectedValue:i,defaultValueLabel:a,registerTrigger:p,menuTriggerSelectedAriaLabel:o,onSelectionChange:n})})),d.length>0&&z.createElement(`div`,{className:`DocSearch-FacetSelectionBar`,role:`group`,"aria-label":l},d.map(([e,t])=>{var n;return z.createElement(im,{key:e,facetKey:e,facetLabel:(n=g.get(e))==null?e:n,value:t,dismissAriaLabel:u,onDismiss:m})}),z.createElement(`button`,{type:`button`,className:`DocSearch-FacetSelectionBar-Action`,onClick:h},s)))}),om=[`actionsBeforeClose`,`autoFocus`,`clearButtonAriaLabel`,`clearButtonTitle`,`closeButtonAriaLabel`,`closeButtonText`,`hideInput`,`inputOverlay`,`inputProps`,`inputRef`,`isFromSelection`,`leadingElement`,`onClose`,`placeholder`,`searchInputLabel`,`state`];function sm(e){let{actionsBeforeClose:t,autoFocus:n,clearButtonAriaLabel:r,clearButtonTitle:i,closeButtonAriaLabel:a,closeButtonText:o,hideInput:s,inputOverlay:c,inputProps:l,inputRef:u,isFromSelection:d,leadingElement:f,onClose:p,placeholder:m,searchInputLabel:h,state:g}=e,v=mn(e,om),{onReset:y}=v.getFormProps({inputElement:u.current});z.useEffect(()=>{n&&u.current&&u.current.focus()},[n,u]),z.useEffect(()=>{d&&u.current&&u.current.select()},[d,u]);let b=v.getInputProps({inputElement:u.current,autoFocus:n,maxLength:512}),x=g.status===`stalled`;return z.createElement(`form`,{className:`DocSearch-Form`,onSubmit:e=>{e.preventDefault()},onReset:y},f||(x?z.createElement(`div`,{className:`DocSearch-LoadingIndicator`},z.createElement(Dr,null)):z.createElement(`label`,_({className:`DocSearch-MagnifierLabel`},v.getLabelProps()),z.createElement(fn,null),z.createElement(`span`,{className:`DocSearch-VisuallyHiddenForAccessibility`},h))),c,z.createElement(`input`,_(_(_({className:`DocSearch-Input`,ref:u},b),l),{},{placeholder:m,hidden:s})),z.createElement(`div`,{className:`DocSearch-Actions`},t,z.createElement(`button`,{type:`button`,title:o,className:`DocSearch-Action DocSearch-Close`,"aria-label":a,onClick:p},z.createElement(Mr,null))))}function cm({state:e,containerRef:t,modalRef:n,formElementRef:r,dropdownRef:i,getRootProps:a,onClose:o,showDropdown:s,searchBox:c,filterBar:l,screenState:u,footer:d}){return z.createElement(`div`,_(_({ref:t},a({"aria-expanded":!0})),{},{className:[`DocSearch`,`DocSearch-Container`,e.status===`stalled`&&`DocSearch-Container--Stalled`,e.status===`error`&&`DocSearch-Container--Errored`].filter(Boolean).join(` `),role:`button`,tabIndex:0,onMouseDown:e=>{e.target===e.currentTarget&&o()}}),z.createElement(`div`,{className:`DocSearch-Modal`,ref:n},z.createElement(`header`,{className:`DocSearch-SearchBar`,ref:r},c),l,s&&z.createElement(`div`,{className:`DocSearch-Dropdown`,ref:i},u),z.createElement(`footer`,{className:`DocSearch-Footer`},d)))}function lm(e){return z.createElement(`svg`,{width:`20`,height:`20`,"aria-label":e.ariaLabel,viewBox:`0 0 24 24`,role:`img`},z.createElement(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.4`},e.children))}function um({translations:e={},isAskAiActive:t=!1}){let{selectText:n=`Select`,selectKeyAriaLabel:r=`Enter key`,submitQuestionText:i=`Submit question`,navigateText:a=`Navigate`,navigateUpKeyAriaLabel:o=`Arrow up`,navigateDownKeyAriaLabel:s=`Arrow down`,closeText:c=`Close`,backToSearchText:l=`Back to search`,closeKeyAriaLabel:u=`Escape key`,poweredByText:d=`Powered by`}=e;return z.createElement(z.Fragment,null,z.createElement(`div`,{className:`DocSearch-Logo`},z.createElement(Lr,{translations:{poweredByText:d}})),z.createElement(`ul`,{className:`DocSearch-Commands`},z.createElement(`li`,null,z.createElement(`kbd`,{className:`DocSearch-Commands-Key`},z.createElement(lm,{ariaLabel:s},z.createElement(`path`,{d:`M12 5v14`}),z.createElement(`path`,{d:`m19 12-7 7-7-7`}))),z.createElement(`kbd`,{className:`DocSearch-Commands-Key`},z.createElement(lm,{ariaLabel:o},z.createElement(`path`,{d:`m5 12 7-7 7 7`}),z.createElement(`path`,{d:`M12 19V5`}))),z.createElement(`span`,{className:`DocSearch-Label`},a)),z.createElement(`li`,null,z.createElement(`kbd`,{className:`DocSearch-Commands-Key`},z.createElement(lm,{ariaLabel:r},z.createElement(`polyline`,{points:`9 10 4 15 9 20`}),z.createElement(`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`}))),z.createElement(`span`,{className:`DocSearch-Label`},t?i:n)),z.createElement(`li`,null,z.createElement(`kbd`,{className:`DocSearch-Commands-Key`},z.createElement(`span`,{className:`DocSearch-Escape-Key`},`ESC`)),z.createElement(`span`,{className:`DocSearch-Label`,"aria-label":u},t?l:c))))}function dm({hit:e,children:t}){return z.createElement(`a`,{href:e.url},t)}function fm({facets:e,indexes:t,searchClient:n}){let[r,i]=z.useState({}),a=e.map(e=>e.key).join(`,`),o=JSON.stringify(t.map(e=>{var t;return[e.name,(t=e.searchParameters)==null?null:t]}));return z.useEffect(()=>{let e=!0,r=a?a.split(`,`):[];return r.length===0||t.length===0?(i({}),()=>{e=!1}):(n.search({requests:t.map(e=>{var t;return _(_({},(t=e.searchParameters)==null?{}:t),{},{indexName:e.name,query:``,hitsPerPage:0,facets:r})})}).then(({results:t})=>{if(!e)return;let n=r.reduce((e,t)=>(e[t]=[],e),{});t.forEach(e=>{var t;Object.entries((t=e.facets)==null?{}:t).forEach(([e,t])=>{n[e]&&(n[e]=Array.from(new Set([...n[e],...Object.keys(t)])).sort())})}),i(n)}).catch(()=>{e&&i({})}),()=>{e=!1})},[a,o,n]),r}function pm({facets:e,indexes:t,searchClient:n,onSelectionsChange:r}){let i=z.useMemo(()=>Hp(e),[e]),a=fm({facets:i,indexes:t,searchClient:n}),[o,s]=z.useState({}),c=z.useRef(o),l=z.useRef(r);l.current=r;let u=z.useMemo(()=>i.map(e=>{var t;return _(_({},e),{},{values:(t=a[e.key])==null?[]:t})}).filter(e=>e.values.length>0),[a,i]),d=z.useCallback(e=>{var t;c.current=e,s(e),(t=l.current)==null||t.call(l)},[]);return{visibleFacets:u,facetSelections:o,facetSelectionsRef:c,handleFacetSelectionChange:z.useCallback((e,t)=>{if(c.current[e]===t)return;let n=_({},c.current);t===``?delete n[e]:n[e]=t,d(n)},[d]),clearFacetSelections:z.useCallback(()=>{Object.keys(c.current).length!==0&&d({})},[d])}}function mm(e){return z.useCallback(t=>{if(!e.context.algoliaInsightsPlugin||!t.__autocomplete_id)return;let n=t;e.context.algoliaInsightsPlugin.insights.clickedObjectIDsAfterSearch({eventName:`Item Selected`,index:n.__autocomplete_indexName,items:[n],positions:[t.__autocomplete_id],queryID:n.__autocomplete_queryID})},[e.context.algoliaInsightsPlugin])}function hm(e){let t=z.useRef(typeof window<`u`?window.getSelection().toString().slice(0,512):``).current;return{initialQuery:z.useRef(e||t).current,initialQueryFromSelection:t}}function gm({getEnvironmentProps:e,panelElement:t,formElement:n,inputElement:r}){z.useEffect(()=>{if(!(t&&n&&r))return;let{onTouchStart:i,onTouchMove:a}=e({panelElement:t,formElement:n,inputElement:r});return window.addEventListener(`touchstart`,i),window.addEventListener(`touchmove`,a),()=>{window.removeEventListener(`touchstart`,i),window.removeEventListener(`touchmove`,a)}},[e,t,n,r])}function _m({container:e}){z.useEffect(()=>{if(!e)return;let t=e.querySelectorAll(`a[href]:not([disabled]), button:not([disabled]), input:not([disabled])`),n=t[0],r=t[t.length-1];function i(e){e.key===`Tab`&&(e.shiftKey?document.activeElement===n&&(e.preventDefault(),r.focus()):document.activeElement===r&&(e.preventDefault(),n.focus()))}return e.addEventListener(`keydown`,i),()=>{e.removeEventListener(`keydown`,i)}},[e])}function vm({initialScrollY:e,modalRef:t,snippetLength:n,theme:r}){hn({theme:r}),z.useEffect(()=>(document.body.classList.add(`DocSearch--active`),()=>{var t,n;document.body.classList.remove(`DocSearch--active`),(t=(n=window).scrollTo)==null||t.call(n,0,e)}),[e]),z.useEffect(()=>{Vr()},[]),z.useLayoutEffect(()=>{let e=window.innerWidth-document.body.clientWidth;return document.body.style.marginInlineEnd=`${e}px`,()=>{document.body.style.marginInlineEnd=`0px`}},[]),z.useEffect(()=>{window.matchMedia(`(max-width: 768px)`).matches&&(n.current=5)},[n]),z.useEffect(()=>{function e(){if(t.current){let e=window.innerHeight*.01;t.current.style.setProperty(`--docsearch-vh`,`${e}px`)}}return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[t])}function ym({getEnvironmentProps:e,containerRef:t,dropdownRef:n,formElementRef:r,inputRef:i,initialScrollY:a,modalRef:o,snippetLength:s,theme:c}){gm({getEnvironmentProps:e,panelElement:n.current,formElement:r.current,inputElement:i.current}),_m({container:t.current}),vm({initialScrollY:a,modalRef:o,snippetLength:s,theme:c})}function bm(){return{containerRef:z.useRef(null),modalRef:z.useRef(null),formElementRef:z.useRef(null),dropdownRef:z.useRef(null),inputRef:z.useRef(null),snippetLength:z.useRef(15)}}function xm({initialQuery:e,inputRef:t,refresh:n}){z.useEffect(()=>{e.length>0&&(n(),t.current&&t.current.focus())},[e,t,n])}function Sm(e){let t=e.hierarchy,n=[`lvl6`,`lvl5`,`lvl4`,`lvl3`,`lvl2`,`lvl1`,`lvl0`].find(e=>t[e]);return _(_({},e),{},{type:n||`lvl0`,content:null})}function Cm({favoriteSearches:e,recentSearches:t,disableUserPersonalization:n}){return z.useCallback(function(r){if(n)return;let i=r.type===`content`?r.__docsearch_parent||Sm(r):r;i&&e.getAll().findIndex(e=>e.objectID===i.objectID)===-1&&t.add(i)},[e,t,n])}function wm({defaultIndexName:e,recentSearchesLimit:t,recentSearchesWithFavoritesLimit:n}){let r=z.useRef(Gr({key:`__DOCSEARCH_FAVORITE_SEARCHES__${e}`,limit:10})).current;return{favoriteSearches:r,recentSearches:z.useRef(Gr({key:`__DOCSEARCH_RECENT_SEARCHES__${e}`,limit:r.getAll().length===0?t:n})).current}}function Tm({title:e,subText:t}){return z.createElement(`div`,{className:`DocSearch-Hit-content-wrapper`},z.createElement(`span`,{className:`DocSearch-Hit-title`},e),z.createElement(`span`,{className:`DocSearch-Hit-path`},t))}let Em=1e3,Dm=Em*60,Om=Dm*60,km=[[Om*24,`day`],[Om,`hour`],[Dm,`minute`],[Em,`second`]];function Am(e,t=Date.now()){let[n]=Ne(()=>{var n;let r=Math.abs(Number(t)-Number(e)),[i,a]=(n=km.find(([e])=>r>=e))==null?km[km.length-1]:n;return[Math.floor(r/i),a]}),r=R(()=>{let e=typeof navigator<`u`?navigator.language:void 0,[t,r]=n;return new Intl.RelativeTimeFormat(e,{style:`long`}).format(t*-1,r)},[n]);return e?r:null}let jm=[`hit`,`attribute`,`tagName`];function Mm(e,t){return t.split(`.`).reduce((e,t)=>e!=null&&e[t]?e[t]:null,e)}function Nm(e){let{hit:t,attribute:n,tagName:r=`span`}=e;return C(r,_(_({},mn(e,jm)),{},{dangerouslySetInnerHTML:{__html:Mm(t,`_snippetResult.${n}.value`)||Mm(t,n)}}))}function Pm(e){var t;let{askAiResultsTitle:n=`Ask AI Assistant`}=e.translations||{},r=z.useId(),i=z.useMemo(()=>e.title?Sp(e.title):null,[e.title]);return!e.collection||e.collection.items.length===0?null:e.collection.source.sourceId===bp.askAI?z.createElement(`section`,{className:`DocSearch-Hits`},z.createElement(`h2`,{id:r,className:`DocSearch-Hit-source`},n),z.createElement(`ul`,_(_({className:`DocSearch-Hits-padded`},e.getListProps({source:e.collection.source})),{},{"aria-labelledby":r}),e.collection.items.map(t=>z.createElement(Lm,_({key:t.objectID,item:t,translations:e.translations},e))))):e.collection.source.sourceId===bp.recentConversations?z.createElement(`section`,{className:`DocSearch-Hits`},z.createElement(`div`,{className:`DocSearch-Hit-source`},z.createElement(Or,null),i),z.createElement(`ul`,_({className:`DocSearch-Hits-padded`},e.getListProps({source:e.collection.source})),e.collection.items.map((t,n)=>z.createElement(Fm,_({key:[e.title,t.objectID].join(`:`),item:t,index:n},e))))):z.createElement(`section`,{className:`DocSearch-Hits`},z.createElement(`div`,{className:`DocSearch-Hit-source`},(t=e.sourceIcon)==null?null:t,i),z.createElement(`ul`,_({className:`DocSearch-Hits-padded`},e.getListProps({source:e.collection.source})),e.collection.items.map((t,n)=>z.createElement(Fm,_({key:[e.title,t.objectID].join(`:`),item:t,index:n},e)))))}function Fm({item:e,index:t,renderIcon:n,renderAction:r,getItemProps:i,onItemClick:a,collection:o,hitComponent:s,translations:c={},renderResultBadge:l}){let u=s,{recentConversationTimestampFallback:d=`A while ago`}=c,f=e.type===`content`?`content`:`hierarchy.${e.type}`,p=wp(e);return z.createElement(`li`,_({className:[`DocSearch-Hit`,e.__docsearch_parent&&`DocSearch-Hit--Child`].filter(Boolean).join(` `)},i({item:e,source:o.source,onClick(t){a(e,t)}})),z.createElement(u,{hit:e},z.createElement(`div`,{className:`DocSearch-Hit-Container`},n({item:e,index:t}),e.type===`lvl0`&&z.createElement(Tm,{title:z.createElement(Nm,{hit:e,attribute:`hierarchy.lvl0`}),subText:z.createElement(Nm,{hit:e,attribute:`content`})}),e.type===`askAI`?z.createElement(Im,{item:e,relativeDateFallbackText:d}):z.createElement(Tm,{title:z.createElement(Nm,{hit:e,attribute:f}),subText:p}),l==null?void 0:l({item:e}),r({item:e}))))}function Im({item:e,relativeDateFallbackText:t}){let n=Am(e.hierarchy.lvl2?new Date(e.hierarchy.lvl2):null);return z.createElement(Tm,{title:Sp(e.hierarchy.lvl1||``),subText:n||t})}function Lm({item:e,getItemProps:t,onItemClick:n,collection:r}){return e.query?z.createElement(`li`,_({className:`DocSearch-Hit`},t({item:e,source:r.source,onClick(t){n(e,t)}})),z.createElement(`div`,{className:`DocSearch-Hit--AskAI`},z.createElement(`div`,{className:`DocSearch-Hit-AskAIButton DocSearch-Hit-Container`},z.createElement(`div`,{className:` DocSearch-Hit-AskAIButton-icon DocSearch-Hit-icon`},z.createElement(Or,null)),z.createElement(`div`,{className:`DocSearch-Hit-AskAIButton-title`},z.createElement(`span`,{className:`DocSearch-Hit-AskAIButton-title-query`},e.query))))):null}let Rm=[`translations`];function zm(e){let{translations:t={}}=e,n=mn(e,Rm),{recentSearchesTitle:r=`Recently viewed docs`,saveRecentSearchButtonTitle:i=`Pin this search`,removeRecentSearchButtonTitle:a=`Remove this search from history`,favoriteSearchesTitle:o=`Pinned`,removeFavoriteSearchButtonTitle:s=`Remove this saved search`}=t,c=xp(n.state,`favoriteSearches`),l=xp(n.state,`recentSearches`);return z.createElement(z.Fragment,null,c&&z.createElement(Pm,_(_({},n),{},{title:o,collection:c,sourceIcon:z.createElement(zp,null),renderIcon:({item:e})=>z.createElement(`div`,{className:`DocSearch-Hit-icon`},z.createElement(Pr,{type:e.type})),renderAction:({item:e})=>z.createElement(`div`,{className:`DocSearch-Hit-action`},z.createElement(`button`,{className:`DocSearch-Hit-action-button`,title:s,type:`submit`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.favoriteSearches.remove(e),n.refresh()}},z.createElement(Mr,null)))})),l&&z.createElement(Pm,_(_({},n),{},{title:r,collection:l,sourceIcon:z.createElement(kr,null),renderIcon:({item:e})=>z.createElement(`div`,{className:`DocSearch-Hit-icon`},z.createElement(Pr,{type:e.type})),renderAction:({item:e})=>z.createElement(z.Fragment,null,z.createElement(`div`,{className:`DocSearch-Hit-action`},z.createElement(`button`,{className:`DocSearch-Hit-action-button DocSearch-Hit-action-button--pin`,title:i,type:`submit`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.favoriteSearches.add(e),n.recentSearches.remove(e),n.refresh()}},z.createElement(zp,null))),z.createElement(`div`,{className:`DocSearch-Hit-action`},z.createElement(`button`,{className:`DocSearch-Hit-action-button`,title:a,type:`submit`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.recentSearches.remove(e),n.refresh()}},z.createElement(Mr,null))))})))}function Bm({translations:e={}}){let{titleText:t=`Unable to fetch results`,helpText:n=`You might want to check your network connection.`}=e;return z.createElement(`div`,{className:`DocSearch-ErrorScreen`},z.createElement(`div`,{className:`DocSearch-Screen-Icon`},z.createElement(Lp,null)),z.createElement(`p`,{className:`DocSearch-Title`},t),z.createElement(`p`,{className:`DocSearch-Help`},n))}let Vm=[`translations`];function Hm(e){let{translations:t={}}=e,n=mn(e,Vm),{noResultsText:r=`No results found for`,suggestedQueryText:i=`Try searching for`,reportMissingResultsText:a=`Believe this query should return results?`,reportMissingResultsLinkText:o=`Let us know.`}=t,s=n.state.context.searchSuggestions;return z.createElement(`div`,{className:`DocSearch-NoResults ${n.canHandleAskAi?`DocSearch-NoResults--withAskAi`:``}`},z.createElement(`div`,{className:`DocSearch-Screen-Icon`},z.createElement(Rp,null)),z.createElement(`p`,{className:`DocSearch-Title`},r,` "`,z.createElement(`strong`,null,n.state.query),`"`),s&&s.length>0&&z.createElement(`div`,{className:`DocSearch-NoResults-Prefill-List`},z.createElement(`p`,{className:`DocSearch-Help`},i,`:`),z.createElement(`div`,{className:`DocSearch-NoResults-Prefill-List-Items`},s.slice(0,3).reduce((e,t)=>[...e,z.createElement(`p`,{key:t},z.createElement(fn,{size:16}),z.createElement(`button`,{className:`DocSearch-Prefill`,key:t,type:`button`,onClick:()=>{n.setQuery(t.toLowerCase()+` `),n.refresh(),n.inputRef.current.focus()}},t))],[]))),n.getMissingResultsUrl&&z.createElement(`p`,{className:`DocSearch-Help`},`${a} `,z.createElement(`a`,{href:n.getMissingResultsUrl({query:n.state.query}),target:`_blank`,rel:`noopener noreferrer`},o)))}function Um(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function Wm({item:e,resultBadgeKey:t,translations:n={}}){if(!t)return null;let r=Dp(e,t);if(r==null)return null;let{resultBadgeLabelText:i=`Category`}=n,a=null;if(Um(r))a=String(r).trim();else if(Array.isArray(r)){let e=r.filter(Um).map(e=>String(e).trim());a=e.length>0?e.join(`, `):null}return a===null||a.length===0?null:z.createElement(`div`,{className:`DocSearch-Hit-badge`},z.createElement(`span`,{className:`DocSearch-VisuallyHiddenForAccessibility`},`${i}: ${a}`),z.createElement(`span`,{"aria-hidden":`true`},a))}let Gm=[`translations`,`resultBadgeKey`];function Km(e){let{translations:t={},resultBadgeKey:n}=e,r=mn(e,Gm),{resultsSectionTitle:i=`Results`}=t,a=z.useCallback(({item:e})=>z.createElement(`div`,{className:`DocSearch-Hit-icon`},z.createElement(Pr,{type:e.type})),[]),o=z.useCallback(()=>z.createElement(`div`,{className:`DocSearch-Hit-action`},z.createElement(Ip,null)),[]),s=z.useCallback(({item:e})=>z.createElement(Wm,{item:e,resultBadgeKey:n,translations:{resultBadgeLabelText:t.resultBadgeLabelText}}),[n,t.resultBadgeLabelText]);return z.createElement(`div`,{className:`DocSearch-Dropdown-Container`},r.state.collections.map(e=>e.items.length===0?null:z.createElement(Pm,_(_({},r),{},{key:e.source.sourceId,translations:t,title:i,collection:e,renderIcon:a,renderAction:o,renderResultBadge:s}))),r.resultsFooterComponent&&z.createElement(`section`,{className:`DocSearch-HitsFooter`},z.createElement(r.resultsFooterComponent,{state:r.state})))}function qm(e,t){let n=Object.entries(t).filter(([,e])=>e).map(([e,t])=>`${e}:${t}`);return n.length===0?e:e?[...e,...n]:n}function Jm({recentSearches:e,favoriteSearches:t,saveRecentSearch:n,onClose:r,disableUserPersonalization:i}){return i?[]:[{sourceId:bp.favoriteSearches,onSelect({item:e,event:t}){n(e),Ap(t)||r()},getItemUrl({item:e}){return e.url},getItems(){return t.getAll()}},{sourceId:bp.recentSearches,onSelect({item:e,event:t}){n(e),Ap(t)||r()},getItemUrl({item:e}){return e.url},getItems(){return e.getAll()}}]}async function Ym({query:e,state:t,setContext:n,setStatus:r,searchClient:i,indexes:a,snippetLength:o,insights:s,appId:c,apiKey:l,maxResultsPerGroup:u,transformItems:d=kp,saveRecentSearch:f,onClose:p,facetSelections:m}){let h=s;try{let{results:r}=await i.search({requests:a.map(t=>{var n,r,i,a,s,c,l;let u=t.name,d=t.searchParameters,f=qm(d==null?void 0:d.facetFilters,m.current);return _(_({query:e,indexName:u,attributesToRetrieve:(n=d==null?void 0:d.attributesToRetrieve)==null?[`hierarchy.lvl0`,`hierarchy.lvl1`,`hierarchy.lvl2`,`hierarchy.lvl3`,`hierarchy.lvl4`,`hierarchy.lvl5`,`hierarchy.lvl6`,`content`,`type`,`url`]:n,attributesToSnippet:(r=d==null?void 0:d.attributesToSnippet)==null?[`hierarchy.lvl1:${o.current}`,`hierarchy.lvl2:${o.current}`,`hierarchy.lvl3:${o.current}`,`hierarchy.lvl4:${o.current}`,`hierarchy.lvl5:${o.current}`,`hierarchy.lvl6:${o.current}`,`content:${o.current}`]:r,snippetEllipsisText:(i=d==null?void 0:d.snippetEllipsisText)==null?`…`:i,highlightPreTag:(a=d==null?void 0:d.highlightPreTag)==null?`<mark>`:a,highlightPostTag:(s=d==null?void 0:d.highlightPostTag)==null?`</mark>`:s,hitsPerPage:(c=d==null?void 0:d.hitsPerPage)==null?20:c,clickAnalytics:(l=d==null?void 0:d.clickAnalytics)==null?h:l},d==null?{}:d),f?{facetFilters:f}:{})})});return r.flatMap(e=>{let r=e,{hits:i,nbHits:a}=r,o=Op(d(i),e=>Pp(e),u);if(t.context.searchSuggestions.length<Object.keys(o).length){var s;n({searchSuggestions:_(_({},(s=t.context.searchSuggestions)==null?[]:s),Object.keys(o))})}if(a){let e=t.context.nbHits;n({nbHits:(e==null?0:e)+a})}let m={};h&&(m={__autocomplete_indexName:r.index,__autocomplete_queryID:r.queryID,__autocomplete_algoliaCredentials:{appId:c,apiKey:l}});let g=Object.values(o).flat();return{sourceId:`hits_${r.index}`,onSelect({item:e,event:t}){f(e),Ap(t)||p()},getItemUrl({item:e}){return e.url},getItems(){return Object.values(Op(g,e=>e.hierarchy.lvl1,u)).map(e=>e.map(t=>{let n=null,r=e.find(e=>e.type===`lvl1`&&e.hierarchy.lvl1===t.hierarchy.lvl1);return t.type!==`lvl1`&&r&&(n=r),_(_({},t),{},{__docsearch_parent:n},m)}).flat()).flat()}}})}catch(e){throw e.name===`RetryError`&&r(`error`),e}}function Xm({indexName:e,indices:t=[],searchParameters:n}){let r=[];if(e&&e!==``&&r.push({name:e,searchParameters:n}),t.length>0&&t.forEach(e=>{r.push(typeof e==`string`?{name:e}:e)}),r.length<1)throw Error("Must supply either `indexName` or `indices` for DocSearch to work");return r}B();let Zm=he(void 0);function Qm(e){let t=ze(Zm);if(t===void 0&&!e)throw Error(Yr(47));return t}B();function $m(){return H(H({},md()),{},{disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1})}let eh=H(H({},xd),{},{disabled:G(e=>e.disabled),instantType:G(e=>e.instantType),openMethod:G(e=>e.openMethod),openChangeReason:G(e=>e.openChangeReason),modal:G(e=>e.modal),focusManagerModal:G(e=>e.focusManagerModal),stickIfOpen:G(e=>e.stickIfOpen),titleElementId:G(e=>e.titleElementId),descriptionElementId:G(e=>e.descriptionElementId),openOnHover:G(e=>e.openOnHover),closeDelay:G(e=>e.closeDelay),hasViewport:G(e=>e.hasViewport)});var th=class e extends Yu{constructor(e,t,n=!1){let r=H(H({},$m()),e),i=new fd;r.open&&(e==null?void 0:e.mounted)===void 0&&(r.mounted=!0),r.floatingRootContext=hd(i,t,n),super(r,{popupRef:T(),backdropRef:T(),internalBackdropRef:T(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:T(),beforeContentFocusGuardRef:T(),stickIfOpenTimeout:new Bo,triggerElements:i},eh),V(this,`setOpen`,(e,t)=>{var n,r;let i=t.reason===na,a=t.reason===`trigger-press`&&t.event.detail===0,o=!e&&(t.reason===`escape-key`||t.reason==null),s=ad(t),c=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&c!=null){var l,u;t.trigger=(l=(u=this.context.triggerElements.getById(c))==null?this.select(`activeTriggerElement`):u)==null?void 0:l}if((n=(r=this.context).onOpenChange)==null||n.call(r,e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let d=()=>{let n={open:e,openChangeReason:t.reason};id(n,e,t.trigger,s()),this.update(n)};i?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),ln(d)):d(),a||o?this.set(`instantType`,a?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)}),V(this,`disposeEffect`,()=>this.context.stickIfOpenTimeout.disposeEffect())}static useStore(t,n){let{store:r,internalStore:i}=nd(t,(t,r)=>new e(n,t,r));return Fe(()=>i==null?void 0:i.disposeEffect(),[i]),r}};B();function nh({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=th.useStore(s==null?void 0:s.store,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});od(u,n,r,l),u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`),m=nl()!=null;u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),dd(u,d),cd(u);let{forceUnmount:h}=ld(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o,nested:m}),Fe(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let g=Re(()=>{u.setOpen(!1,To(ca))},[u]);Le(e.actionsRef,()=>({unmount:h,close:g}),[h,g]);let _=d||f,v=R(()=>({store:u}),[u]);return W(Zm.Provider,{value:v,children:[_&&W(ih,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})}function rh(e){return Qm(!0)?W(nh,{props:e}):W(ol,{children:W(nh,{props:e})})}function ih({store:e,modal:t}){var n,r;let i=vl(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}});return ud(e,{activeTriggerProps:(n=i.reference)==null?mi:n,inactiveTriggerProps:(r=i.trigger)==null?mi:r,popupProps:R(()=>yi(ed,i.floating),[i.floating])}),null}B();let ah=[`render`,`className`,`style`,`disabled`,`nativeButton`,`handle`,`payload`,`openOnHover`,`delay`,`closeDelay`,`id`],oh=bt(function(e,t){var n;let{render:r,className:i,style:a,disabled:o=!1,nativeButton:s=!0,handle:c,payload:l,openOnHover:u=!1,delay:d=300,closeDelay:f=0,id:p}=e,m=yr(e,ah),h=Qm(!0),g=(n=c==null?void 0:c.store)==null?h==null?void 0:h.store:n;if(!g)throw Error(Yr(74));let _=So(p),v=g.useState(`isTriggerActive`,_),y=g.useState(`floatingRootContext`),b=g.useState(`isOpenedByTrigger`,_),x=g.useState(`triggerPopupId`,_),S=L(null),{registerTrigger:C,isMountedByThisTrigger:w}=sd(_,S,g,{payload:l,disabled:o,openOnHover:u,closeDelay:f}),T=g.useState(`openChangeReason`),D=g.useState(`stickIfOpen`),O=g.useState(`openMethod`),k=g.useState(`focusManagerModal`),A=Nd(y,{enabled:!o&&y!=null&&u&&(O!==`touch`||T!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:Kd(),restMs:d,delay:{close:f},triggerElementRef:S,isActiveTrigger:v,isClosing:()=>g.select(`transitionStatus`)===`ending`}),j=hl(y,{enabled:y!=null,stickIfOpen:D}),M=ep(()=>g.select(`open`),e=>{g.set(`openMethod`,e)}),ee=g.useState(`triggerProps`,w),{getButtonProps:N,buttonRef:te}=Ga({disabled:o,native:s}),ne={open(e){return e&&T===`trigger-press`?Zi.open(e):Xi.open(e)}},{preFocusGuardRef:P,handlePreFocusGuardFocus:re,handleFocusTargetFocus:ie}=pp(g,S),ae=Ni(`button`,e,{state:{disabled:o,open:b},ref:[te,t,C,S],props:[j.reference,A,ee,M,{"data-base-ui-click-trigger":``,id:_,"aria-haspopup":`dialog`,"aria-expanded":b,"aria-controls":x},m,N],stateAttributesMapping:ne});return w&&!k?W(E,{children:[W(ys,{ref:P,onFocus:re}),W(E,{children:ae},_),W(ys,{ref:g.context.triggerFocusTargetRef,onFocus:ie})]}):W(E,{children:ae},_)});B();let sh=he(void 0);function ch(){let e=ze(sh);if(e===void 0)throw Error(Yr(45));return e}B();let lh=[`keepMounted`],uh=bt(function(e,t){let{keepMounted:n=!1}=e,r=yr(e,lh),{store:i}=Qm();return i.useState(`mounted`)||n?W(sh.Provider,{value:n,children:W(Zc,H({ref:t},r))}):null});B();let dh=he(void 0);function fh(){let e=ze(dh);if(!e)throw Error(Yr(46));return e}B();let ph=[`render`,`className`,`style`,`anchor`,`positionMethod`,`side`,`align`,`sideOffset`,`alignOffset`,`collisionBoundary`,`collisionPadding`,`arrowPadding`,`sticky`,`disableAnchorTracking`,`collisionAvoidance`],mh=bt(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o=`absolute`,side:s=`bottom`,align:c=`center`,sideOffset:l=0,alignOffset:u=0,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f=5,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:h=!1,collisionAvoidance:g=Wc}=e,_=yr(e,ph),{store:v}=Qm(),y=ch(),b=il(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=v.useState(`hasViewport`),M=L(null),ee=Po(O,!1,!1),N=yf({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:j?gf:void 0}),te=x.useState(`domReferenceElement`);U(()=>{let e=te,t=M.current;if(e&&(M.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return ee(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[te,ee,v]),Lf(C&&E===!0&&w!==`trigger-hover`,D===`touch`,O,T);let ne=Re(e=>{v.set(`positionerElement`,e)},[v]),P=Df(e,{open:C,side:N.side,align:N.align,anchorHidden:N.anchorHidden,instant:k},{styles:N.positionerStyles,transitionStatus:A,props:_,refs:[t,ne],hidden:!S,inert:!C});return W(dh.Provider,{value:N,children:[S&&E===!0&&w!==`trigger-hover`&&W(Ef,{ref:v.context.internalBackdropRef,inert:cf(!C),cutout:T}),W(al,{id:b,children:P})]})});B();let hh=he(void 0);function gh(){let[e,t]=Ne(0),n=Ra(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:R(()=>({register:n}),[n]),hasClosePart:e>0}}function _h(e){let{value:t,children:n}=e;return W(hh.Provider,{value:t,children:n})}function vh(){let e=ze(hh);U(()=>e==null?void 0:e.register(),[e])}B();let yh=[`render`,`className`,`style`,`initialFocus`,`finalFocus`],bh=H(H({},Qi),Hi),xh=bt(function(e,t){var n;let{render:r,className:i,style:a,initialFocus:o,finalFocus:s}=e,c=yr(e,yh),{store:l}=Qm(),u=fh(),d=Jd(!0)!=null,{context:f,hasClosePart:p}=gh(),m=l.useState(`open`),h=l.useState(`openMethod`),g=l.useState(`instantType`),_=l.useState(`transitionStatus`),v=l.useState(`popupProps`),y=l.useState(`titleElementId`),b=l.useState(`descriptionElementId`),x=l.useState(`modal`),S=l.useState(`mounted`),C=l.useState(`openChangeReason`),w=l.useState(`activeTriggerElement`),T=l.useState(`floatingRootContext`),E=T.useState(`floatingId`),D=l.useState(`disabled`),O=l.useState(`openOnHover`),k=l.useState(`closeDelay`),A=(n=c.id)==null?E:n;Fo({open:m,ref:l.context.popupRef,onComplete(){if(m){var e,t;(e=(t=l.context).onOpenChangeComplete)==null||e.call(t,!0)}}}),jd(T,{enabled:O&&!D,closeDelay:k});let j=o===void 0?td(l.context.popupRef):o,M=x!==!1&&p;l.useSyncedValue(`focusManagerModal`,M);let ee=Re(e=>{l.set(`popupElement`,e)},[l]),N=Ni(`div`,e,{state:{open:m,side:u.side,align:u.align,instant:g,transitionStatus:_},ref:[t,l.context.popupRef,ee],props:[v,H(H({id:A,role:`dialog`},ed),{},{"aria-labelledby":y,"aria-describedby":b,onKeyDown(e){d&&Qd.has(e.key)&&e.stopPropagation()}}),$d(_),c],stateAttributesMapping:bh});return W(ml,{context:T,openInteractionType:h,modal:M,disabled:!S||C===`trigger-hover`,initialFocus:j,returnFocus:s,restoreFocus:`popup`,previousFocusableElement:ga(w)?w:void 0,nextFocusableElement:l.context.triggerFocusTargetRef,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:W(_h,{value:f,children:N})})});B();let Sh=[`render`,`className`,`style`],Ch=bt(function(e,t){let{render:n,className:r,style:i}=e,a=yr(e,Sh),{store:o}=Qm(),s=o.useState(`open`),{arrowRef:c,side:l,align:u,arrowUncentered:d,arrowStyles:f}=fh();return Ni(`div`,e,{state:{open:s,side:l,align:u,uncentered:d},ref:[t,c],props:[{style:f,"aria-hidden":!0},a],stateAttributesMapping:Qi})});B();let wh=[`render`,`className`,`style`],Th=bt(function(e,t){let{render:n,className:r,style:i}=e,a=yr(e,wh),{store:o}=Qm(),s=So(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),Ni(`h2`,e,{ref:t,props:[{id:s},a]})});B();let Eh=[`render`,`className`,`style`,`disabled`,`nativeButton`],Dh=bt(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0}=e,s=yr(e,Eh),{buttonRef:c,getButtonProps:l}=Ga({disabled:a,focusableWhenDisabled:!1,native:o}),{store:u}=Qm();return vh(),Ni(`button`,e,{ref:[t,c],props:[{onClick(e){u.setOpen(!1,To(`close-press`,e.nativeEvent))}},s,l]})});var Oh;function kh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ah=kh();function jh(e){Ah=e}var Mh={exec:()=>null};function Nh(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Fh.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Ph=(()=>{try{return!0}catch(e){return!1}})(),Fh={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:RegExp(`[\\p{L}\\p{N}]`,`u`),escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`)},Ih=/^(?:[ \t]*(?:\n|$))+/,Lh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Rh=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,zh=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Bh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Vh=/(?:[*+-]|\d{1,9}[.)])/,Hh=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Uh=Nh(Hh).replace(/bull/g,Vh).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Wh=Nh(Hh).replace(/bull/g,Vh).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Gh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Kh=/^[^\n]+/,qh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Jh=Nh(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,qh).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Yh=Nh(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Vh).getRegex(),Xh=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Zh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Qh=Nh(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Zh).replace(`tag`,Xh).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$h=Nh(Gh).replace(`hr`,zh).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Xh).getRegex(),eg={blockquote:Nh(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,$h).getRegex(),code:Lh,def:Jh,fences:Rh,heading:Bh,hr:zh,html:Qh,lheading:Uh,list:Yh,newline:Ih,paragraph:$h,table:Mh,text:Kh},tg=Nh(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,zh).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Xh).getRegex(),ng=H(H({},eg),{},{lheading:Wh,table:tg,paragraph:Nh(Gh).replace(`hr`,zh).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,tg).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Xh).getRegex()}),rg=H(H({},eg),{},{html:Nh(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Zh).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Mh,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Nh(Gh).replace(`hr`,zh).replace(`heading`,` *#{1,6} *[^
27
+ ]`).replace(`lheading`,Uh).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()}),ig=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ag=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,og=/^( {2,}|\\)\n(?!\s*$)/,sg=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,cg=RegExp(`[\\p{P}\\p{S}]`,`u`),lg=RegExp(`[\\s\\p{P}\\p{S}]`,`u`),ug=RegExp(`[^\\s\\p{P}\\p{S}]`,`u`),dg=Nh(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,lg).getRegex(),fg=RegExp(`(?!~)[\\p{P}\\p{S}]`,`u`),pg=RegExp(`(?!~)[\\s\\p{P}\\p{S}]`,`u`),mg=RegExp(`(?:[^\\s\\p{P}\\p{S}]|~)`,`u`),hg=Nh(/link|precode-code|html/,`g`).replace(`link`,RegExp("\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)",``)).replace(`precode-`,Ph?"(?<!`)()":"(^^|[^`])").replace(`code`,RegExp("(?<b>`+)[^`]+\\k<b>(?!`)",``)).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),gg=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,_g=Nh(gg,`u`).replace(/punct/g,cg).getRegex(),vg=Nh(gg,`u`).replace(/punct/g,fg).getRegex(),yg=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,bg=Nh(yg,`gu`).replace(/notPunctSpace/g,ug).replace(/punctSpace/g,lg).replace(/punct/g,cg).getRegex(),xg=Nh(yg,`gu`).replace(/notPunctSpace/g,mg).replace(/punctSpace/g,pg).replace(/punct/g,fg).getRegex(),Sg=Nh(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,ug).replace(/punctSpace/g,lg).replace(/punct/g,cg).getRegex(),Cg=Nh(/\\(punct)/,`gu`).replace(/punct/g,cg).getRegex(),wg=Nh(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Tg=Nh(Zh).replace(`(?:-->|$)`,`-->`).getRegex(),Eg=Nh(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Tg).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Dg=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Og=Nh(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,Dg).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),kg=Nh(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Dg).replace(`ref`,qh).getRegex(),Ag=Nh(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,qh).getRegex(),jg=Nh(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,kg).replace(`nolink`,Ag).getRegex(),Mg=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ng={_backpedal:Mh,anyPunctuation:Cg,autolink:wg,blockSkip:hg,br:og,code:ag,del:Mh,emStrongLDelim:_g,emStrongRDelimAst:bg,emStrongRDelimUnd:Sg,escape:ig,link:Og,nolink:Ag,punctuation:dg,reflink:kg,reflinkSearch:jg,tag:Eg,text:sg,url:Mh},Pg=H(H({},Ng),{},{link:Nh(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Dg).getRegex(),reflink:Nh(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Dg).getRegex()}),Fg=H(H({},Ng),{},{emStrongRDelimAst:xg,emStrongLDelim:vg,url:Nh(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Mg).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Nh(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Mg).getRegex()}),Ig=H(H({},Fg),{},{br:Nh(og).replace(`{2,}`,`*`).getRegex(),text:Nh(Fg.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()}),Lg={normal:eg,gfm:ng,pedantic:rg},Rg={normal:Ng,gfm:Fg,breaks:Ig,pedantic:Pg},zg={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},Bg=e=>zg[e];function Vg(e,t){if(t){if(Fh.escapeTest.test(e))return e.replace(Fh.escapeReplace,Bg)}else if(Fh.escapeTestNoEncode.test(e))return e.replace(Fh.escapeReplaceNoEncode,Bg);return e}function Hg(e){try{e=encodeURI(e).replace(Fh.percentDecode,`%`)}catch(e){return null}return e}function Ug(e,t){var n;let r=e.replace(Fh.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Fh.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((n=r.at(-1))!=null&&n.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push(``);for(;i<r.length;i++)r[i]=r[i].trim().replace(Fh.slashPipe,`|`);return r}function Wg(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Gg(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Kg(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function qg(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
28
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
29
+ `)}var Jg=class{constructor(e){V(this,`options`,void 0),V(this,`rules`,void 0),V(this,`lexer`,void 0),this.options=e||Ah}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:Wg(e,`
30
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=qg(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Wg(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Wg(t[0],`
31
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Wg(t[0],`
32
+ `).split(`
33
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
34
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
35
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
36
+ ${s}`:s,r=r?`${r}
37
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if((u==null?void 0:u.type)===`code`)break;if((u==null?void 0:u.type)===`blockquote`){let t=u,a=t.raw+`
38
+ `+e.join(`
39
+ `),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if((u==null?void 0:u.type)===`list`){let t=u,a=t.raw+`
40
+ `+e.join(`
41
+ `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
42
+ `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
43
+ `,1)[0].replace(this.rules.other.listReplaceTabs,e=>` `.repeat(3*e.length)),l=e.split(`
44
+ `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
45
+ `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let f=e.split(`
46
+ `,1)[0],p;if(l=f,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),p=l):p=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||t.test(l)||n.test(l))break;if(p.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
47
+ `+p.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
48
+ `+l}!u&&!l.trim()&&(u=!0),r+=f+`
49
+ `,e=e.substring(f.length+1),c=p.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let f=null,p;this.options.gfm&&(f=this.rules.other.listIsTask.exec(s),f&&(p=f[0]!==`[ ] `,s=s.replace(this.rules.other.listReplaceTask,``))),i.items.push({type:`list_item`,raw:r,task:!!f,checked:p,loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){var t;let n=this.rules.block.table.exec(e);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=Ug(n[1]),i=n[2].replace(this.rules.other.tableAlignChars,``).split(`|`),a=(t=n[3])!=null&&t.trim()?n[3].replace(this.rules.other.tableRowBlankLine,``).split(`
50
+ `):[],o={type:`table`,raw:n[0],header:[],align:[],rows:[]};if(r.length===i.length){for(let e of i)this.rules.other.tableAlignRight.test(e)?o.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?o.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?o.align.push(`left`):o.align.push(null);for(let e=0;e<r.length;e++)o.header.push({text:r[e],tokens:this.lexer.inline(r[e]),header:!0,align:o.align[e]});for(let e of a)o.rows.push(Ug(e,o.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:o.align[t]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
51
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=Wg(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Gg(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Kg(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Kg(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,i;if(t[2]===`@`)e=t[0],i=`mailto:`+e;else{var n,r;let a;do a=t[0],t[0]=(n=(r=this.rules.inline._backpedal.exec(t[0]))==null?void 0:r[0])==null?``:n;while(a!==t[0]);e=t[0],i=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:i,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},Yg=class e{constructor(e){V(this,`tokens`,void 0),V(this,`options`,void 0),V(this,`state`,void 0),V(this,`tokenizer`,void 0),V(this,`inlineQueue`,void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ah,this.options.tokenizer=this.options.tokenizer||new Jg,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Fh,block:Lg.normal,inline:Rg.normal};this.options.pedantic?(t.block=Lg.pedantic,t.inline=Rg.pedantic):this.options.gfm&&(t.block=Lg.gfm,this.options.breaks?t.inline=Rg.breaks:t.inline=Rg.gfm),this.tokenizer.rules=t}static get rules(){return{block:Lg,inline:Rg}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Fh.carriageReturn,`
52
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(Fh.tabCharGlobal,` `).replace(Fh.spaceLine,``));e;){var r,i;let a;if(!((r=this.options.extensions)==null||(r=r.block)==null)&&r.some(n=>(a=n.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);let n=t.at(-1);a.raw.length===1&&n!==void 0?n.raw+=`
53
+ `:t.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);let n=t.at(-1);(n==null?void 0:n.type)===`paragraph`||(n==null?void 0:n.type)===`text`?(n.raw+=(n.raw.endsWith(`
54
+ `)?``:`
55
+ `)+a.raw,n.text+=`
56
+ `+a.text,this.inlineQueue.at(-1).src=n.text):t.push(a);continue}if(a=this.tokenizer.fences(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.heading(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.hr(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.blockquote(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.list(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.html(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.def(e)){e=e.substring(a.raw.length);let n=t.at(-1);(n==null?void 0:n.type)===`paragraph`||(n==null?void 0:n.type)===`text`?(n.raw+=(n.raw.endsWith(`
57
+ `)?``:`
58
+ `)+a.raw,n.text+=`
59
+ `+a.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},t.push(a));continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),t.push(a);continue}let o=e;if((i=this.options.extensions)!=null&&i.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(a=this.tokenizer.paragraph(o))){let r=t.at(-1);n&&(r==null?void 0:r.type)===`paragraph`?(r.raw+=(r.raw.endsWith(`
60
+ `)?``:`
61
+ `)+a.raw,r.text+=`
62
+ `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(a),n=o.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);let n=t.at(-1);(n==null?void 0:n.type)===`text`?(n.raw+=(n.raw.endsWith(`
63
+ `)?``:`
64
+ `)+a.raw,n.text+=`
65
+ `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(a);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var n,r;let i=e,a=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)e.includes(a[0].slice(a[0].lastIndexOf(`[`)+1,-1))&&(i=i.slice(0,a.index)+`[`+`a`.repeat(a[0].length-2)+`]`+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,a.index)+`++`+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)o=a[2]?a[2].length:0,i=i.slice(0,a.index+o)+`[`+`a`.repeat(a[0].length-o-2)+`]`+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=(n=(r=this.options.hooks)==null||(r=r.emStrongMask)==null?void 0:r.call({lexer:this},i))==null?i:n;let s=!1,c=``;for(;e;){var l,u;s||(c=``),s=!1;let n;if(!((l=this.options.extensions)==null||(l=l.inline)==null)&&l.some(r=>(n=r.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))continue;if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length);let r=t.at(-1);n.type===`text`&&(r==null?void 0:r.type)===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,i,c)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}let r=e;if((u=this.options.extensions)!=null&&u.startInline){let t=1/0,n=e.slice(1),i;this.options.extensions.startInline.forEach(e=>{i=e.call({lexer:this},n),typeof i==`number`&&i>=0&&(t=Math.min(t,i))}),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(r)){e=e.substring(n.raw.length),n.raw.slice(-1)!==`_`&&(c=n.raw.slice(-1)),s=!0;let r=t.at(-1);(r==null?void 0:r.type)===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},Xg=class{constructor(e){V(this,`options`,void 0),V(this,`parser`,void 0),this.options=e||Ah}space(e){return``}code({text:e,lang:t,escaped:n}){var r;let i=(r=(t||``).match(Fh.notSpaceStart))==null?void 0:r[0],a=e.replace(Fh.endingNewline,``)+`
66
+ `;return i?`<pre><code class="language-`+Vg(i)+`">`+(n?a:Vg(a,!0))+`</code></pre>
67
+ `:`<pre><code>`+(n?a:Vg(a,!0))+`</code></pre>
68
+ `}blockquote({tokens:e}){return`<blockquote>
69
+ ${this.parser.parse(e)}</blockquote>
70
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
71
+ `}hr(e){return`<hr>
72
+ `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
73
+ `+r+`</`+i+`>
74
+ `}listitem(e){let t=``;if(e.task){var n;let r=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)===`paragraph`?(e.tokens[0].text=r+` `+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type===`text`&&(e.tokens[0].tokens[0].text=r+` `+Vg(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:`text`,raw:r+` `,text:r+` `,escaped:!0}):t+=r+` `}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
75
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox">`}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
76
+ `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
77
+ <thead>
78
+ `+t+`</thead>
79
+ `+r+`</table>
80
+ `}tablerow({text:e}){return`<tr>
81
+ ${e}</tr>
82
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
83
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Vg(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Hg(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+Vg(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Hg(e);if(i===null)return Vg(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${Vg(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Vg(e.text)}},Zg=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}},Qg=class e{constructor(e){V(this,`options`,void 0),V(this,`renderer`,void 0),V(this,`textRenderer`,void 0),this.options=e||Ah,this.options.renderer=this.options.renderer||new Xg,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Zg}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let i=0;i<e.length;i++){var r;let a=e[i];if(!((r=this.options.extensions)==null||(r=r.renderers)==null)&&r[a.type]){let e=a,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let o=a;switch(o.type){case`space`:n+=this.renderer.space(o);continue;case`hr`:n+=this.renderer.hr(o);continue;case`heading`:n+=this.renderer.heading(o);continue;case`code`:n+=this.renderer.code(o);continue;case`table`:n+=this.renderer.table(o);continue;case`blockquote`:n+=this.renderer.blockquote(o);continue;case`list`:n+=this.renderer.list(o);continue;case`html`:n+=this.renderer.html(o);continue;case`def`:n+=this.renderer.def(o);continue;case`paragraph`:n+=this.renderer.paragraph(o);continue;case`text`:{let r=o,a=this.renderer.text(r);for(;i+1<e.length&&e[i+1].type===`text`;)r=e[++i],a+=`
84
+ `+this.renderer.text(r);t?n+=this.renderer.paragraph({type:`paragraph`,raw:a,text:a,tokens:[{type:`text`,raw:a,text:a,escaped:!0}]}):n+=a;continue}default:{let e=`Token with "`+o.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t=this.renderer){let n=``;for(let i=0;i<e.length;i++){var r;let a=e[i];if(!((r=this.options.extensions)==null||(r=r.renderers)==null)&&r[a.type]){let e=this.options.extensions.renderers[a.type].call({parser:this},a);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(a.type)){n+=e||``;continue}}let o=a;switch(o.type){case`escape`:n+=t.text(o);break;case`html`:n+=t.html(o);break;case`link`:n+=t.link(o);break;case`image`:n+=t.image(o);break;case`strong`:n+=t.strong(o);break;case`em`:n+=t.em(o);break;case`codespan`:n+=t.codespan(o);break;case`br`:n+=t.br(o);break;case`del`:n+=t.del(o);break;case`text`:n+=t.text(o);break;default:{let e=`Token with "`+o.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},$g=(Oh=class{constructor(e){V(this,`options`,void 0),V(this,`block`,void 0),this.options=e||Ah}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Yg.lex:Yg.lexInline}provideParser(){return this.block?Qg.parse:Qg.parseInline}},V(Oh,`passThroughHooks`,new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`])),V(Oh,`passThroughHooksRespectAsync`,new Set([`preprocess`,`postprocess`,`processAllTokens`])),Oh),e_=new class{constructor(...e){V(this,`defaults`,kh()),V(this,`options`,this.setOptions),V(this,`parse`,this.parseMarkdown(!0)),V(this,`parseInline`,this.parseMarkdown(!1)),V(this,`Parser`,Qg),V(this,`Renderer`,Xg),V(this,`TextRenderer`,Zg),V(this,`Lexer`,Yg),V(this,`Tokenizer`,Jg),V(this,`Hooks`,$g),this.use(...e)}walkTokens(e,t){let n=[];for(let i of e)switch(n=n.concat(t.call(this,i)),i.type){case`table`:{let e=i;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=i;n=n.concat(this.walkTokens(e.items,t));break}default:{var r;let e=i;!((r=this.defaults.extensions)==null||(r=r.childTokens)==null)&&r[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n=H({},e);if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Xg(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Jg(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new $g;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];$g.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&$g.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults=H(H({},this.defaults),n)}),this}setOptions(e){return this.defaults=H(H({},this.defaults),e),this}lexer(e,t){return Yg.lex(e,t==null?this.defaults:t)}parser(e,t){return Qg.parse(e,t==null?this.defaults:t)}parseMarkdown(e){var t=this;return(n,r)=>{let i=H({},r),a=H(H({},this.defaults),i),o=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return o(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof n>`u`||n===null)return o(Error(`marked(): input parameter is undefined or null`));if(typeof n!=`string`)return o(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(n)+`, string expected`));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let r=a.hooks?await a.hooks.preprocess(n):n,i=await(a.hooks?await a.hooks.provideLexer():e?Yg.lex:Yg.lexInline)(r,a),o=a.hooks?await a.hooks.processAllTokens(i):i;a.walkTokens&&await Promise.all(t.walkTokens(o,a.walkTokens));let s=await(a.hooks?await a.hooks.provideParser():e?Qg.parse:Qg.parseInline)(o,a);return a.hooks?await a.hooks.postprocess(s):s})().catch(o);try{a.hooks&&(n=a.hooks.preprocess(n));let t=(a.hooks?a.hooks.provideLexer():e?Yg.lex:Yg.lexInline)(n,a);a.hooks&&(t=a.hooks.processAllTokens(t)),a.walkTokens&&this.walkTokens(t,a.walkTokens);let r=(a.hooks?a.hooks.provideParser():e?Qg.parse:Qg.parseInline)(t,a);return a.hooks&&(r=a.hooks.postprocess(r)),r}catch(e){return o(e)}}}onError(e,t){return n=>{if(n.message+=`
85
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Vg(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function t_(e,t){return e_.parse(e,t)}t_.options=t_.setOptions=function(e){return e_.setOptions(e),t_.defaults=e_.defaults,jh(t_.defaults),t_},t_.getDefaults=kh,t_.defaults=Ah,t_.use=function(...e){return e_.use(...e),t_.defaults=e_.defaults,jh(t_.defaults),t_},t_.walkTokens=function(e,t){return e_.walkTokens(e,t)},t_.parseInline=e_.parseInline,t_.Parser=Qg,t_.parser=Qg.parse,t_.Renderer=Xg,t_.TextRenderer=Zg,t_.Lexer=Yg,t_.lexer=Yg.lex,t_.Tokenizer=Jg,t_.Hooks=$g,t_.parse=t_,t_.options,t_.setOptions,t_.use,t_.walkTokens,t_.parseInline,Qg.parse,Yg.lex;var n_=`vercel.ai.error`,r_=Symbol.for(n_),i_,a_,o_=class e extends (a_=Error,i_=r_,a_){constructor({name:e,message:t,cause:n}){super(t),this[i_]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,n_)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}};function s_(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.message:JSON.stringify(e)}var c_=`AI_InvalidArgumentError`,l_=`vercel.ai.error.${c_}`,u_=Symbol.for(l_),d_,f_,p_=class extends (f_=o_,d_=u_,f_){constructor({message:e,cause:t,argument:n}){super({name:c_,message:e,cause:t}),this[d_]=!0,this.argument=n}static isInstance(e){return o_.hasMarker(e,l_)}},m_=`AI_JSONParseError`,h_=`vercel.ai.error.${m_}`,g_=Symbol.for(h_),__,v_,y_=class extends (v_=o_,__=g_,v_){constructor({text:e,cause:t}){super({name:m_,message:`JSON parsing failed: Text: ${e}.
86
+ Error message: ${s_(t)}`,cause:t}),this[__]=!0,this.text=e}static isInstance(e){return o_.hasMarker(e,h_)}},b_=`AI_TypeValidationError`,x_=`vercel.ai.error.${b_}`,S_=Symbol.for(x_),C_,w_,T_=class e extends (w_=o_,C_=S_,w_){constructor({value:e,cause:t}){super({name:b_,message:`Type validation failed: Value: ${JSON.stringify(e)}.
87
+ Error message: ${s_(t)}`,cause:t}),this[C_]=!0,this.value=e}static isInstance(e){return o_.hasMarker(e,x_)}static wrap({value:t,cause:n}){return e.isInstance(n)&&n.value===t?n:new e({value:t,cause:n})}},E_=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}};function D_(e){}function O_(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=D_,onError:n=D_,onRetry:r=D_,onComment:i,maxBufferSize:a}=e,o=[],s=0,c=!0,l,u=``,d=0,f,p=!1;function m(e){if(p)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(c&&(c=!1,e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),o.length===0){let t=g(e);t!==``&&(o.push(t),s=t.length),h();return}if(e.indexOf(`
88
+ `)===-1&&e.indexOf(`\r`)===-1){o.push(e),s+=e.length,h();return}o.push(e);let t=o.join(``);o.length=0,s=0;let n=g(t);n!==``&&(o.push(n),s=n.length),h()}function h(){a!==void 0&&(s+u.length<=a||(p=!0,o.length=0,s=0,l=void 0,u=``,d=0,f=void 0,n(new E_(`Buffered data exceeded max buffer size of ${a} characters`,{type:`max-buffer-size-exceeded`}))))}function g(e){let n=0;if(e.indexOf(`\r`)===-1){let r=e.indexOf(`
89
+ `,n);for(;r!==-1;){if(n===r){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0,n=r+1,r=e.indexOf(`
90
+ `,n);continue}let i=e.charCodeAt(n);if(k_(e,n,i)){let i=e.charCodeAt(n+5)===32?n+6:n+5,a=e.slice(i,r);if(d===0&&e.charCodeAt(r+1)===10){t({id:l,event:f,data:a}),l=void 0,u=``,f=void 0,n=r+2,r=e.indexOf(`
91
+ `,n);continue}u=d===0?a:`${u}
92
+ ${a}`,d++}else A_(e,n,i)?f=e.slice(e.charCodeAt(n+6)===32?n+7:n+6,r)||void 0:_(e,n,r);n=r+1,r=e.indexOf(`
93
+ `,n)}return e.slice(n)}for(;n<e.length;){let t=e.indexOf(`\r`,n),r=e.indexOf(`
94
+ `,n),i=-1;if(t!==-1&&r!==-1?i=t<r?t:r:t===-1?r!==-1&&(i=r):i=t===e.length-1?-1:t,i===-1)break;_(e,n,i),n=i+1,e.charCodeAt(n-1)===13&&e.charCodeAt(n)===10&&n++}return e.slice(n)}function _(e,t,n){if(t===n){y();return}let r=e.charCodeAt(t);if(k_(e,t,r)){let r=e.charCodeAt(t+5)===32?t+6:t+5,i=e.slice(r,n);u=d===0?i:`${u}
95
+ ${i}`,d++;return}if(A_(e,t,r)){f=e.slice(e.charCodeAt(t+6)===32?t+7:t+6,n)||void 0;return}if(r===105&&e.charCodeAt(t+1)===100&&e.charCodeAt(t+2)===58){let r=e.slice(e.charCodeAt(t+3)===32?t+4:t+3,n);l=r.includes(`\0`)?void 0:r;return}if(r===58){if(i){let r=e.slice(t,n);i(r.slice(e.charCodeAt(t+1)===32?2:1))}return}let a=e.slice(t,n),o=a.indexOf(`:`);if(o===-1){v(a,``,a);return}let s=a.slice(0,o),c=a.charCodeAt(o+1)===32?2:1;v(s,a.slice(o+c),a)}function v(e,t,i){switch(e){case`event`:f=t||void 0;break;case`data`:u=d===0?t:`${u}
96
+ ${t}`,d++;break;case`id`:l=t.includes(`\0`)?void 0:t;break;case`retry`:/^\d+$/.test(t)?r(parseInt(t,10)):n(new E_(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:i}));break;default:n(new E_(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:`unknown-field`,field:e,value:t,line:i}));break}}function y(){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0}function b(e={}){if(e.consume&&o.length>0){let e=o.join(``);_(e,0,e.length)}c=!0,l=void 0,u=``,d=0,f=void 0,o.length=0,s=0,p=!1}return{feed:m,reset:b}}function k_(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function A_(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var j_=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n,maxBufferSize:r}={}){let i;super({start(a){i=O_({onEvent:e=>{a.enqueue(e)},onError(t){typeof e==`function`&&e(t),(e===`terminate`||t.type===`max-buffer-size-exceeded`)&&a.error(t)},onRetry:t,onComment:n,maxBufferSize:r})},transform(e){i.feed(e)}})}},M_;function K(e,t,n){var r;function i(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:s,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=s.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let a=(r=n==null?void 0:n.Parent)==null?Object:r;class o extends a{}Object.defineProperty(o,"name",{value:e});function s(e){var t;let r=n!=null&&n.Parent?new o:this;i(r,e),(t=r._zod).deferred!=null||(t.deferred=[]);for(let e of r._zod.deferred)e();return r}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>{var r;return n!=null&&n.Parent&&t instanceof n.Parent?!0:t==null||(r=t._zod)==null||(r=r.traits)==null?void 0:r.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}var N_=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},P_=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(M_=globalThis).__zod_globalConfig!=null||(M_.__zod_globalConfig={});let F_=globalThis.__zod_globalConfig;function I_(e){return e&&Object.assign(F_,e),F_}let L_=[`inst`,`continue`,`input`];function R_(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function z_(e,t){return typeof t==`bigint`?t.toString():t}function B_(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function V_(e){return e==null}function H_(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function U_(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}let W_=Symbol(`evaluating`);function G_(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==W_)return r===void 0&&(r=W_,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function K_(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function q_(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function J_(e){return JSON.stringify(e)}function Y_(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}let X_=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Z_(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}let Q_=B_(()=>{var e;if(F_.jitless||typeof navigator<`u`&&!((e=navigator)==null||(e=e.userAgent)==null)&&e.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch(e){return!1}});function $_(e){if(Z_(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Z_(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ev(e){return $_(e)?H({},e):Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let tv=new Set([`string`,`number`,`symbol`]);function nv(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function rv(e,t,n){let r=new e._zod.constr(t==null?e._zod.def:t);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function q(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?H(H({},t),{},{error:()=>t.error}):t}function iv(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}let av={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ov(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return rv(e,q_(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return K_(this,`shape`,e),e},checks:[]}))}function sv(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return rv(e,q_(e._zod.def,{get shape(){let r=H({},e._zod.def.shape);for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return K_(this,`shape`,r),r},checks:[]}))}function cv(e,t){if(!$_(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return rv(e,q_(e._zod.def,{get shape(){let n=H(H({},e._zod.def.shape),t);return K_(this,`shape`,n),n}}))}function lv(e,t){if(!$_(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return rv(e,q_(e._zod.def,{get shape(){let n=H(H({},e._zod.def.shape),t);return K_(this,`shape`,n),n}}))}function uv(e,t){var n,r;if((n=e._zod.def.checks)!=null&&n.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return rv(e,q_(e._zod.def,{get shape(){let n=H(H({},e._zod.def.shape),t._zod.def.shape);return K_(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:(r=t._zod.def.checks)==null?[]:r}))}function dv(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return rv(t,q_(t._zod.def,{get shape(){let r=t._zod.def.shape,i=H({},r);if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return K_(this,`shape`,i),i},checks:[]}))}function fv(e,t,n){return rv(t,q_(t._zod.def,{get shape(){let r=t._zod.def.shape,i=H({},r);if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return K_(this,`shape`,i),i}}))}function pv(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++){var n;if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0}return!1}function mv(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++){var n;if(((n=e.issues[r])==null?void 0:n.continue)===!1)return!0}return!1}function hv(e,t){return t.map(t=>{var n;return(n=t).path!=null||(n.path=[]),t.path.unshift(e),t})}function gv(e){return typeof e==`string`?e:e==null?void 0:e.message}function _v(e,t,n){var r,i,a,o,s,c,l,u,d;let f=e.message?e.message:(r=(i=(a=(o=gv((s=e.inst)==null||(s=s._zod.def)==null||(c=s.error)==null?void 0:c.call(s,e)))==null?gv(t==null||(l=t.error)==null?void 0:l.call(t,e)):o)==null?gv((u=n.customError)==null?void 0:u.call(n,e)):a)==null?gv((d=n.localeError)==null?void 0:d.call(n,e)):i)==null?`Invalid input`:r,{inst:p,continue:m,input:h}=e,g=yr(e,L_);return g.path!=null||(g.path=[]),g.message=f,t!=null&&t.reportInput&&(g.input=h),g}function vv(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function yv(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:H({},t)}let bv=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,z_,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},xv=K(`$ZodError`,bv),Sv=K(`$ZodError`,bv,{Parent:Error});function Cv(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function wv(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}let Tv=e=>(t,n,r,i)=>{let a=r?H(H({},r),{},{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new N_;if(o.issues.length){var s;let t=new((s=i==null?void 0:i.Err)==null?e:s)(o.issues.map(e=>_v(e,a,I_())));throw X_(t,i==null?void 0:i.callee),t}return o.value},Ev=e=>async(t,n,r,i)=>{let a=r?H(H({},r),{},{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){var s;let t=new((s=i==null?void 0:i.Err)==null?e:s)(o.issues.map(e=>_v(e,a,I_())));throw X_(t,i==null?void 0:i.callee),t}return o.value},Dv=e=>(t,n,r)=>{let i=r?H(H({},r),{},{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new N_;return a.issues.length?{success:!1,error:new(e==null?xv:e)(a.issues.map(e=>_v(e,i,I_())))}:{success:!0,data:a.value}},Ov=Dv(Sv),kv=e=>async(t,n,r)=>{let i=r?H(H({},r),{},{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>_v(e,i,I_())))}:{success:!0,data:a.value}},Av=kv(Sv),jv=e=>(t,n,r)=>{let i=r?H(H({},r),{},{direction:`backward`}):{direction:`backward`};return Tv(e)(t,n,i)},Mv=e=>(t,n,r)=>Tv(e)(t,n,r),Nv=e=>async(t,n,r)=>{let i=r?H(H({},r),{},{direction:`backward`}):{direction:`backward`};return Ev(e)(t,n,i)},Pv=e=>async(t,n,r)=>Ev(e)(t,n,r),Fv=e=>(t,n,r)=>{let i=r?H(H({},r),{},{direction:`backward`}):{direction:`backward`};return Dv(e)(t,n,i)},Iv=e=>(t,n,r)=>Dv(e)(t,n,r),Lv=e=>async(t,n,r)=>{let i=r?H(H({},r),{},{direction:`backward`}):{direction:`backward`};return kv(e)(t,n,i)},Rv=e=>async(t,n,r)=>kv(e)(t,n,r),zv=/^[cC][0-9a-z]{6,}$/,Bv=/^[0-9a-z]+$/,Vv=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Hv=/^[0-9a-vA-V]{20}$/,Uv=/^[A-Za-z0-9]{27}$/,Wv=/^[a-zA-Z0-9_-]{21}$/,Gv=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Kv=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,qv=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Jv=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function Yv(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}let Xv=/^(?:(?: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])$/,Zv=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,Qv=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,$v=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ey=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ty=/^[A-Za-z0-9_-]*$/,ny=/^https?$/,ry=/^\+[1-9]\d{6,14}$/,iy=`(?:(?:\\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])))`,ay=RegExp(`^${iy}$`);function oy(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function sy(e){return RegExp(`^${oy(e)}$`)}function cy(e){let t=oy({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${iy}T(?:${r})$`)}let ly=e=>{var t,n;let r=e?`[\\s\\S]{${(t=e==null?void 0:e.minimum)==null?0:t},${(n=e==null?void 0:e.maximum)==null?``:n}}`:`[\\s\\S]*`;return RegExp(`^${r}$`)},uy=/^-?\d+$/,dy=/^-?\d+(?:\.\d+)?$/,fy=/^(?:true|false)$/i,py=/^null$/i,my=/^[^A-Z]*$/,hy=/^[^a-z]*$/,gy=K(`$ZodCheck`,(e,t)=>{var n;e._zod!=null||(e._zod={}),e._zod.def=t,(n=e._zod).onattach!=null||(n.onattach=[])}),_y={number:`number`,bigint:`bigint`,object:`date`},vy=K(`$ZodCheckLessThan`,(e,t)=>{gy.init(e,t);let n=_y[typeof t.value];e._zod.onattach.push(e=>{var n;let r=e._zod.bag,i=(n=t.inclusive?r.maximum:r.exclusiveMaximum)==null?1/0:n;t.value<i&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),yy=K(`$ZodCheckGreaterThan`,(e,t)=>{gy.init(e,t);let n=_y[typeof t.value];e._zod.onattach.push(e=>{var n;let r=e._zod.bag,i=(n=t.inclusive?r.minimum:r.exclusiveMinimum)==null?-1/0:n;t.value>i&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),by=K(`$ZodCheckMultipleOf`,(e,t)=>{gy.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf!=null||(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):U_(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),xy=K(`$ZodCheckNumberFormat`,(e,t)=>{var n;gy.init(e,t),t.format=t.format||`float64`;let r=(n=t.format)==null?void 0:n.includes(`int`),i=r?`int`:`number`,[a,o]=av[t.format];e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,n.minimum=a,n.maximum=o,r&&(n.pattern=uy)}),e._zod.check=n=>{let s=n.value;if(r){if(!Number.isInteger(s)){n.issues.push({expected:i,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?n.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:i,inclusive:!0,continue:!t.abort}):n.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}s<a&&n.issues.push({origin:`number`,input:s,code:`too_small`,minimum:a,inclusive:!0,inst:e,continue:!t.abort}),s>o&&n.issues.push({origin:`number`,input:s,code:`too_big`,maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Sy=K(`$ZodCheckMaxLength`,(e,t)=>{var n;gy.init(e,t),(n=e._zod.def).when!=null||(n.when=e=>{let t=e.value;return!V_(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{var n;let r=(n=e._zod.bag.maximum)==null?1/0:n;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=vv(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Cy=K(`$ZodCheckMinLength`,(e,t)=>{var n;gy.init(e,t),(n=e._zod.def).when!=null||(n.when=e=>{let t=e.value;return!V_(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{var n;let r=(n=e._zod.bag.minimum)==null?-1/0:n;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=vv(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),wy=K(`$ZodCheckLengthEquals`,(e,t)=>{var n;gy.init(e,t),(n=e._zod.def).when!=null||(n.when=e=>{let t=e.value;return!V_(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=vv(r),o=i>t.length;n.issues.push(H(H({origin:a},o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length}),{},{inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort}))}}),Ty=K(`$ZodCheckStringFormat`,(e,t)=>{var n,r;gy.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns!=null||(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check!=null||(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push(H(H({origin:`string`,code:`invalid_format`,format:t.format,input:n.value},t.pattern?{pattern:t.pattern.toString()}:{}),{},{inst:e,continue:!t.abort}))}):(r=e._zod).check!=null||(r.check=()=>{})}),Ey=K(`$ZodCheckRegex`,(e,t)=>{Ty.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Dy=K(`$ZodCheckLowerCase`,(e,t)=>{t.pattern!=null||(t.pattern=my),Ty.init(e,t)}),Oy=K(`$ZodCheckUpperCase`,(e,t)=>{t.pattern!=null||(t.pattern=hy),Ty.init(e,t)}),ky=K(`$ZodCheckIncludes`,(e,t)=>{gy.init(e,t);let n=nv(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns!=null||(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Ay=K(`$ZodCheckStartsWith`,(e,t)=>{gy.init(e,t);let n=RegExp(`^${nv(t.prefix)}.*`);t.pattern!=null||(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns!=null||(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),jy=K(`$ZodCheckEndsWith`,(e,t)=>{gy.init(e,t);let n=RegExp(`.*${nv(t.suffix)}$`);t.pattern!=null||(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns!=null||(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),My=K(`$ZodCheckOverwrite`,(e,t)=>{gy.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Ny=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
97
+ `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){var e,t,n;let r=Function,i=(e=this)==null?void 0:e.args,a=[...((t=(n=this)==null?void 0:n.content)==null?[``]:t).map(e=>` ${e}`)];return new r(...i,a.join(`
98
+ `))}};let Py={major:4,minor:4,patch:3},Fy=K(`$ZodType`,(e,t)=>{var n,r;e!=null||(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Py;let i=[...(n=e._zod.def.checks)==null?[]:n];e._zod.traits.has(`$ZodCheck`)&&i.unshift(e);for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0){var a;(r=e._zod).deferred!=null||(r.deferred=[]),(a=e._zod.deferred)==null||a.push(()=>{e._zod.run=e._zod.parse})}else{let t=(e,t,n)=>{let r=pv(e),i;for(let o of t){if(o._zod.def.when){if(mv(e)||!o._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&(n==null?void 0:n.async)===!1)throw new N_;if(i||s instanceof Promise){var a;i=((a=i)==null?Promise.resolve():a).then(async()=>{await s,e.issues.length!==t&&(r||(r=pv(e,t)))})}else{if(e.issues.length===t)continue;r||(r=pv(e,t))}}return i?i.then(()=>e):e},n=(n,r,a)=>{if(pv(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new N_;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},H(H({},a),{},{skipChecks:!0}));return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new N_;return o.then(e=>t(e,i,a))}return t(o,i,a)}}G_(e,`~standard`,()=>({validate:t=>{try{var n;let r=Ov(e,t);return r.success?{value:r.data}:{issues:(n=r.error)==null?void 0:n.issues}}catch(n){return Av(e,t).then(e=>{var t;return e.success?{value:e.data}:{issues:(t=e.error)==null?void 0:t.issues}})}},vendor:`zod`,version:1}))}),Iy=K(`$ZodString`,(e,t)=>{var n,r,i;Fy.init(e,t),e._zod.pattern=(n=[...(r=e==null||(i=e._zod.bag)==null?void 0:i.patterns)==null?[]:r].pop())==null?ly(e._zod.bag):n,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(e){}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Ly=K(`$ZodStringFormat`,(e,t)=>{Ty.init(e,t),Iy.init(e,t)}),Ry=K(`$ZodGUID`,(e,t)=>{t.pattern!=null||(t.pattern=Kv),Ly.init(e,t)}),zy=K(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern!=null||(t.pattern=qv(e))}else t.pattern!=null||(t.pattern=qv());Ly.init(e,t)}),By=K(`$ZodEmail`,(e,t)=>{t.pattern!=null||(t.pattern=Jv),Ly.init(e,t)}),Vy=K(`$ZodURL`,(e,t)=>{Ly.init(e,t),e._zod.check=n=>{try{var r;let i=n.value.trim();if(!t.normalize&&((r=t.protocol)==null?void 0:r.source)===ny.source&&!/^https?:\/\//i.test(i)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let a=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(`:`)?a.protocol.slice(0,-1):a.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=a.href:n.value=i;return}catch(r){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Hy=K(`$ZodEmoji`,(e,t)=>{t.pattern!=null||(t.pattern=Yv()),Ly.init(e,t)}),Uy=K(`$ZodNanoID`,(e,t)=>{t.pattern!=null||(t.pattern=Wv),Ly.init(e,t)}),Wy=K(`$ZodCUID`,(e,t)=>{t.pattern!=null||(t.pattern=zv),Ly.init(e,t)}),Gy=K(`$ZodCUID2`,(e,t)=>{t.pattern!=null||(t.pattern=Bv),Ly.init(e,t)}),Ky=K(`$ZodULID`,(e,t)=>{t.pattern!=null||(t.pattern=Vv),Ly.init(e,t)}),qy=K(`$ZodXID`,(e,t)=>{t.pattern!=null||(t.pattern=Hv),Ly.init(e,t)}),Jy=K(`$ZodKSUID`,(e,t)=>{t.pattern!=null||(t.pattern=Uv),Ly.init(e,t)}),Yy=K(`$ZodISODateTime`,(e,t)=>{t.pattern!=null||(t.pattern=cy(t)),Ly.init(e,t)}),Xy=K(`$ZodISODate`,(e,t)=>{t.pattern!=null||(t.pattern=ay),Ly.init(e,t)}),Zy=K(`$ZodISOTime`,(e,t)=>{t.pattern!=null||(t.pattern=sy(t)),Ly.init(e,t)}),Qy=K(`$ZodISODuration`,(e,t)=>{t.pattern!=null||(t.pattern=Gv),Ly.init(e,t)}),$y=K(`$ZodIPv4`,(e,t)=>{t.pattern!=null||(t.pattern=Xv),Ly.init(e,t),e._zod.bag.format=`ipv4`}),eb=K(`$ZodIPv6`,(e,t)=>{t.pattern!=null||(t.pattern=Zv),Ly.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch(r){n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),tb=K(`$ZodCIDRv4`,(e,t)=>{t.pattern!=null||(t.pattern=Qv),Ly.init(e,t)}),nb=K(`$ZodCIDRv6`,(e,t)=>{t.pattern!=null||(t.pattern=$v),Ly.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch(r){n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function rb(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch(e){return!1}}let ib=K(`$ZodBase64`,(e,t)=>{t.pattern!=null||(t.pattern=ey),Ly.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{rb(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function ab(e){if(!ty.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return rb(t.padEnd(Math.ceil(t.length/4)*4,`=`))}let ob=K(`$ZodBase64URL`,(e,t)=>{t.pattern!=null||(t.pattern=ty),Ly.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{ab(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),sb=K(`$ZodE164`,(e,t)=>{t.pattern!=null||(t.pattern=ry),Ly.init(e,t)});function cb(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&(i==null?void 0:i.typ)!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch(e){return!1}}let lb=K(`$ZodJWT`,(e,t)=>{Ly.init(e,t),e._zod.check=n=>{cb(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),ub=K(`$ZodNumber`,(e,t)=>{var n;Fy.init(e,t),e._zod.pattern=(n=e._zod.bag.pattern)==null?dy:n,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push(H({expected:`number`,code:`invalid_type`,input:i,inst:e},a?{received:a}:{})),n}}),db=K(`$ZodNumberFormat`,(e,t)=>{xy.init(e,t),ub.init(e,t)}),fb=K(`$ZodBoolean`,(e,t)=>{Fy.init(e,t),e._zod.pattern=fy,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch(e){}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),pb=K(`$ZodNull`,(e,t)=>{Fy.init(e,t),e._zod.pattern=py,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),mb=K(`$ZodUnknown`,(e,t)=>{Fy.init(e,t),e._zod.parse=e=>e}),hb=K(`$ZodNever`,(e,t)=>{Fy.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function gb(e,t,n){e.issues.length&&t.issues.push(...hv(n,e.issues)),t.value[n]=e.value}let _b=K(`$ZodArray`,(e,t)=>{Fy.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>gb(t,n,e))):gb(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function vb(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...hv(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function yb(e){let t=Object.keys(e.shape);for(let r of t){var n;if(!(!((n=e.shape)==null||(n=n[r])==null||(n=n._zod)==null||(n=n.traits)==null)&&n.has(`$ZodType`)))throw Error(`Invalid element at key "${r}": expected a Zod schema`)}let r=iv(e.shape);return H(H({},e),{},{keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)})}function bb(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>vb(e,n,i,t,u,d))):vb(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}let xb=K(`$ZodObject`,(e,t)=>{Fy.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`);if(!(n!=null&&n.get)){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n=H({},e);return Object.defineProperty(t,"shape",{value:n}),n}})}let r=B_(()=>yb(t));G_(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]!=null||(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let i=Z_,a=t.catchall,o;e._zod.parse=(t,n)=>{o!=null||(o=r.value);let s=t.value;if(!i(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=o.shape;for(let e of o.keys){let r=l[e],i=r._zod.optin===`optional`,a=r._zod.optout===`optional`,o=r._zod.run({value:s[e],issues:[]},n);o instanceof Promise?c.push(o.then(n=>vb(n,t,e,s,i,a))):vb(o,t,e,s,i,a)}return a?bb(c,s,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),Sb=K(`$ZodObjectJIT`,(e,t)=>{xb.init(e,t);let n=e._zod.parse,r=B_(()=>yb(t)),i=e=>{let t=new Ny([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=J_(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){var s,c;let n=a[r],o=J_(r),l=e[r],u=(l==null||(s=l._zod)==null?void 0:s.optin)===`optional`,d=(l==null||(c=l._zod)==null?void 0:c.optout)===`optional`;t.write(`const ${n} = ${i(r)};`),u&&d?t.write(`
99
+ if (${n}.issues.length) {
100
+ if (${o} in input) {
101
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
102
+ ...iss,
103
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
104
+ })));
105
+ }
106
+ }
107
+
108
+ if (${n}.value === undefined) {
109
+ if (${o} in input) {
110
+ newResult[${o}] = undefined;
111
+ }
112
+ } else {
113
+ newResult[${o}] = ${n}.value;
114
+ }
115
+
116
+ `):u?t.write(`
117
+ if (${n}.issues.length) {
118
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
119
+ ...iss,
120
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
121
+ })));
122
+ }
123
+
124
+ if (${n}.value === undefined) {
125
+ if (${o} in input) {
126
+ newResult[${o}] = undefined;
127
+ }
128
+ } else {
129
+ newResult[${o}] = ${n}.value;
130
+ }
131
+
132
+ `):t.write(`
133
+ const ${n}_present = ${o} in input;
134
+ if (${n}.issues.length) {
135
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
136
+ ...iss,
137
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
138
+ })));
139
+ }
140
+ if (!${n}_present && !${n}.issues.length) {
141
+ payload.issues.push({
142
+ code: "invalid_type",
143
+ expected: "nonoptional",
144
+ input: undefined,
145
+ path: [${o}]
146
+ });
147
+ }
148
+
149
+ if (${n}_present) {
150
+ if (${n}.value === undefined) {
151
+ newResult[${o}] = undefined;
152
+ } else {
153
+ newResult[${o}] = ${n}.value;
154
+ }
155
+ }
156
+
157
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let l=t.compile();return(t,n)=>l(e,t,n)},a,o=Z_,s=!F_.jitless,c=s&&Q_.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u!=null||(u=r.value);let p=d.value;return o(p)?s&&c&&(f==null?void 0:f.async)===!1&&f.jitless!==!0?(a||(a=i(t.shape)),d=a(d,f),l?bb([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Cb(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!pv(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>_v(e,r,I_())))}),t)}let wb=K(`$ZodUnion`,(e,t)=>{Fy.init(e,t),G_(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),G_(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),G_(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),G_(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>H_(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Cb(t,r,e,i)):Cb(o,r,e,i)}}),Tb=K(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,wb.init(e,t);let n=e._zod.parse;G_(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=B_(()=>{let e=t.options,n=new Map;for(let i of e){var r;let e=(r=i._zod.propValues)==null?void 0:r[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,i)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!Z_(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o==null?void 0:o[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Eb=K(`$ZodIntersection`,(e,t)=>{Fy.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Ob(e,t,n)):Ob(e,i,a)}});function Db(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if($_(e)&&$_(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i=H(H({},e),t);for(let n of r){let r=Db(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Db(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ob(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i!=null||(i=n);for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push(H(H({},i),{},{keys:a})),pv(e))return e;let o=Db(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}let kb=K(`$ZodRecord`,(e,t)=>{Fy.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!$_(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let c=new Set;for(let s of o)if(typeof s==`string`||typeof s==`number`||typeof s==`symbol`){c.add(typeof s==`number`?s.toString():s);let o=t.keyType._zod.run({value:s,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>_v(e,r,I_())),input:s,path:[s],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[s],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...hv(s,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...hv(s,u.issues)),n.value[l]=u.value)}let l;for(let e in i)if(!c.has(e)){var s;l=(s=l)==null?[]:s,l.push(e)}l&&l.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:l})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&dy.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>_v(e,r,I_())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...hv(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...hv(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Ab=K(`$ZodEnum`,(e,t)=>{Fy.init(e,t);let n=R_(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>tv.has(typeof e)).map(e=>typeof e==`string`?nv(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),jb=K(`$ZodLiteral`,(e,t)=>{if(Fy.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?nv(e):e?nv(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Mb=K(`$ZodTransform`,(e,t)=>{Fy.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new P_(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new N_;return n.value=i,n.fallback=!0,n}});function Nb(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let Pb=K(`$ZodOptional`,(e,t)=>{Fy.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,G_(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),G_(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${H_(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Nb(e,r)):Nb(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Fb=K(`$ZodExactOptional`,(e,t)=>{Pb.init(e,t),G_(e._zod,`values`,()=>t.innerType._zod.values),G_(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Ib=K(`$ZodNullable`,(e,t)=>{Fy.init(e,t),G_(e._zod,`optin`,()=>t.innerType._zod.optin),G_(e._zod,`optout`,()=>t.innerType._zod.optout),G_(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${H_(e.source)}|null)$`):void 0}),G_(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Lb=K(`$ZodDefault`,(e,t)=>{Fy.init(e,t),e._zod.optin=`optional`,G_(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Rb(e,t)):Rb(r,t)}});function Rb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}let zb=K(`$ZodPrefault`,(e,t)=>{Fy.init(e,t),e._zod.optin=`optional`,G_(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Bb=K(`$ZodNonOptional`,(e,t)=>{Fy.init(e,t),G_(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Vb(t,e)):Vb(i,e)}});function Vb(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}let Hb=K(`$ZodCatch`,(e,t)=>{Fy.init(e,t),e._zod.optin=`optional`,G_(e._zod,`optout`,()=>t.innerType._zod.optout),G_(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue(H(H({},e),{},{error:{issues:r.issues.map(e=>_v(e,n,I_()))},input:e.value})),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue(H(H({},e),{},{error:{issues:r.issues.map(e=>_v(e,n,I_()))},input:e.value})),e.issues=[],e.fallback=!0),e)}}),Ub=K(`$ZodPipe`,(e,t)=>{Fy.init(e,t),G_(e._zod,`values`,()=>t.in._zod.values),G_(e._zod,`optin`,()=>t.in._zod.optin),G_(e._zod,`optout`,()=>t.out._zod.optout),G_(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Wb(e,t.in,n)):Wb(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Wb(e,t.out,n)):Wb(r,t.out,n)}});function Wb(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}let Gb=K(`$ZodReadonly`,(e,t)=>{Fy.init(e,t),G_(e._zod,`propValues`,()=>t.innerType._zod.propValues),G_(e._zod,`values`,()=>t.innerType._zod.values),G_(e._zod,`optin`,()=>{var e;return(e=t.innerType)==null||(e=e._zod)==null?void 0:e.optin}),G_(e._zod,`optout`,()=>{var e;return(e=t.innerType)==null||(e=e._zod)==null?void 0:e.optout}),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Kb):Kb(r)}});function Kb(e){return e.value=Object.freeze(e.value),e}let qb=K(`$ZodLazy`,(e,t)=>{Fy.init(e,t),G_(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||(e._cachedInner=t.getter()),e._cachedInner}),G_(e._zod,`pattern`,()=>{var t;return(t=e._zod.innerType)==null||(t=t._zod)==null?void 0:t.pattern}),G_(e._zod,`propValues`,()=>{var t;return(t=e._zod.innerType)==null||(t=t._zod)==null?void 0:t.propValues}),G_(e._zod,`optin`,()=>{var t,n;return(t=(n=e._zod.innerType)==null||(n=n._zod)==null?void 0:n.optin)==null?void 0:t}),G_(e._zod,`optout`,()=>{var t,n;return(t=(n=e._zod.innerType)==null||(n=n._zod)==null?void 0:n.optout)==null?void 0:t}),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Jb=K(`$ZodCustom`,(e,t)=>{gy.init(e,t),Fy.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Yb(t,n,r,e));Yb(i,n,r,e)}});function Yb(e,t,n,r){if(!e){var i;let e={code:`custom`,input:n,inst:r,path:[...(i=r._zod.def.path)==null?[]:i],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(yv(e))}}var Xb,Zb=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){var n;let r=H({},(n=this.get(t))==null?{}:n);delete r.id;let i=H(H({},r),this._map.get(e));return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Qb(){return new Zb}(Xb=globalThis).__zod_globalRegistry!=null||(Xb.__zod_globalRegistry=Qb());let $b=globalThis.__zod_globalRegistry;function ex(e,t){return new e(H({type:`string`},q(t)))}function tx(e,t){return new e(H({type:`string`,format:`email`,check:`string_format`,abort:!1},q(t)))}function nx(e,t){return new e(H({type:`string`,format:`guid`,check:`string_format`,abort:!1},q(t)))}function rx(e,t){return new e(H({type:`string`,format:`uuid`,check:`string_format`,abort:!1},q(t)))}function ix(e,t){return new e(H({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`},q(t)))}function ax(e,t){return new e(H({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`},q(t)))}function ox(e,t){return new e(H({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`},q(t)))}function sx(e,t){return new e(H({type:`string`,format:`url`,check:`string_format`,abort:!1},q(t)))}function cx(e,t){return new e(H({type:`string`,format:`emoji`,check:`string_format`,abort:!1},q(t)))}function lx(e,t){return new e(H({type:`string`,format:`nanoid`,check:`string_format`,abort:!1},q(t)))}function ux(e,t){return new e(H({type:`string`,format:`cuid`,check:`string_format`,abort:!1},q(t)))}function dx(e,t){return new e(H({type:`string`,format:`cuid2`,check:`string_format`,abort:!1},q(t)))}function fx(e,t){return new e(H({type:`string`,format:`ulid`,check:`string_format`,abort:!1},q(t)))}function px(e,t){return new e(H({type:`string`,format:`xid`,check:`string_format`,abort:!1},q(t)))}function mx(e,t){return new e(H({type:`string`,format:`ksuid`,check:`string_format`,abort:!1},q(t)))}function hx(e,t){return new e(H({type:`string`,format:`ipv4`,check:`string_format`,abort:!1},q(t)))}function gx(e,t){return new e(H({type:`string`,format:`ipv6`,check:`string_format`,abort:!1},q(t)))}function _x(e,t){return new e(H({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1},q(t)))}function vx(e,t){return new e(H({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1},q(t)))}function yx(e,t){return new e(H({type:`string`,format:`base64`,check:`string_format`,abort:!1},q(t)))}function bx(e,t){return new e(H({type:`string`,format:`base64url`,check:`string_format`,abort:!1},q(t)))}function xx(e,t){return new e(H({type:`string`,format:`e164`,check:`string_format`,abort:!1},q(t)))}function Sx(e,t){return new e(H({type:`string`,format:`jwt`,check:`string_format`,abort:!1},q(t)))}function Cx(e,t){return new e(H({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null},q(t)))}function wx(e,t){return new e(H({type:`string`,format:`date`,check:`string_format`},q(t)))}function Tx(e,t){return new e(H({type:`string`,format:`time`,check:`string_format`,precision:null},q(t)))}function Ex(e,t){return new e(H({type:`string`,format:`duration`,check:`string_format`},q(t)))}function Dx(e,t){return new e(H({type:`number`,checks:[]},q(t)))}function Ox(e,t){return new e(H({type:`number`,check:`number_format`,abort:!1,format:`safeint`},q(t)))}function kx(e,t){return new e(H({type:`boolean`},q(t)))}function Ax(e,t){return new e(H({type:`null`},q(t)))}function jx(e){return new e({type:`unknown`})}function Mx(e,t){return new e(H({type:`never`},q(t)))}function Nx(e,t){return new vy(H(H({check:`less_than`},q(t)),{},{value:e,inclusive:!1}))}function Px(e,t){return new vy(H(H({check:`less_than`},q(t)),{},{value:e,inclusive:!0}))}function Fx(e,t){return new yy(H(H({check:`greater_than`},q(t)),{},{value:e,inclusive:!1}))}function Ix(e,t){return new yy(H(H({check:`greater_than`},q(t)),{},{value:e,inclusive:!0}))}function Lx(e,t){return new by(H(H({check:`multiple_of`},q(t)),{},{value:e}))}function Rx(e,t){return new Sy(H(H({check:`max_length`},q(t)),{},{maximum:e}))}function zx(e,t){return new Cy(H(H({check:`min_length`},q(t)),{},{minimum:e}))}function Bx(e,t){return new wy(H(H({check:`length_equals`},q(t)),{},{length:e}))}function Vx(e,t){return new Ey(H(H({check:`string_format`,format:`regex`},q(t)),{},{pattern:e}))}function Hx(e){return new Dy(H({check:`string_format`,format:`lowercase`},q(e)))}function Ux(e){return new Oy(H({check:`string_format`,format:`uppercase`},q(e)))}function Wx(e,t){return new ky(H(H({check:`string_format`,format:`includes`},q(t)),{},{includes:e}))}function Gx(e,t){return new Ay(H(H({check:`string_format`,format:`starts_with`},q(t)),{},{prefix:e}))}function Kx(e,t){return new jy(H(H({check:`string_format`,format:`ends_with`},q(t)),{},{suffix:e}))}function qx(e){return new My({check:`overwrite`,tx:e})}function Jx(e){return qx(t=>t.normalize(e))}function Yx(){return qx(e=>e.trim())}function Xx(){return qx(e=>e.toLowerCase())}function Zx(){return qx(e=>e.toUpperCase())}function Qx(){return qx(e=>Y_(e))}function $x(e,t,n){return new e(H({type:`array`,element:t},q(n)))}function eS(e,t,n){let r=q(n);return r.abort!=null||(r.abort=!0),new e(H({type:`custom`,check:`custom`,fn:t},r))}function tS(e,t,n){return new e(H({type:`custom`,check:`custom`,fn:t},q(n)))}function nS(e,t){let n=rS(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(yv(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code!=null||(r.code=`custom`),r.input!=null||(r.input=t.value),r.inst!=null||(r.inst=n),r.continue!=null||(r.continue=!n._zod.def.abort),t.issues.push(yv(r))}},e(t.value,t)),t);return n}function rS(e,t){let n=new gy(H({check:`custom`},q(t)));return n._zod.check=e,n}function iS(e){var t,n,r,i,a,o,s,c,l;let u=(t=e==null?void 0:e.target)==null?`draft-2020-12`:t;return u===`draft-4`&&(u=`draft-04`),u===`draft-7`&&(u=`draft-07`),{processors:(n=e.processors)==null?{}:n,metadataRegistry:(r=e==null?void 0:e.metadata)==null?$b:r,target:u,unrepresentable:(i=e==null?void 0:e.unrepresentable)==null?`throw`:i,override:(a=e==null?void 0:e.override)==null?(()=>{}):a,io:(o=e==null?void 0:e.io)==null?`output`:o,counter:0,seen:new Map,cycles:(s=e==null?void 0:e.cycles)==null?`ref`:s,reused:(c=e==null?void 0:e.reused)==null?`inline`:c,external:(l=e==null?void 0:e.external)==null?void 0:l}}function aS(e,t,n={path:[],schemaPath:[]}){var r,i,a;let o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;let c={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,c);let l=(r=(i=e._zod).toJSONSchema)==null?void 0:r.call(i);if(l)c.schema=l;else{let r=H(H({},n),{},{schemaPath:[...n.schemaPath,e],path:n.path});if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,r);else{let n=c.schema,i=t.processors[o.type];if(!i)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);i(e,t,n,r)}let i=e._zod.parent;i&&(c.ref||(c.ref=i),aS(i,t,r),t.seen.get(i).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&Object.assign(c.schema,u),t.io===`input`&&cS(e)&&(delete c.schema.examples,delete c.schema.default),t.io===`input`&&`_prefault`in c.schema&&((a=c.schema).default!=null||(a.default=c.schema._prefault)),delete c.schema._prefault,t.seen.get(e).schema}function oS(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){var i;let n=(i=e.metadataRegistry.get(t[0]))==null?void 0:i.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let a=t=>{var r;let i=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){var a,o,s,c;let n=(a=e.external.registry.get(t[0]))==null?void 0:a.id,r=(o=e.external.uri)==null?(e=>e):o;if(n)return{ref:r(n)};let l=(s=(c=t[1].defId)==null?t[1].schema.id:c)==null?`schema${e.counter++}`:s;return t[1].defId=l,{defId:l,ref:`${r(`__shared`)}#/${i}/${l}`}}if(t[1]===n)return{ref:`#`};let l=`#/${i}/`,u=(r=t[1].schema.id)==null?`__schema${e.counter++}`:r;return{defId:u,ref:l+u}},o=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=a(e);t.def=H({},t.schema),r&&(t.defId=r);let i=t.schema;for(let e in i)delete i[e];i.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle){var s;throw Error(`Cycle detected: #/${(s=e.cycle)==null?void 0:s.join(`/`)}/<root>
158
+
159
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}}for(let n of e.seen.entries()){var c;let r=n[1];if(t===n[0]){o(n);continue}if(e.external){var l;let r=(l=e.external.registry.get(n[0]))==null?void 0:l.id;if(t!==n[0]&&r){o(n);continue}}if((c=e.metadataRegistry.get(n[0]))!=null&&c.id){o(n);continue}if(r.cycle){o(n);continue}if(r.count>1&&e.reused===`ref`){o(n);continue}}}function sS(e,t){var n,r,i,a,o;let s=e.seen.get(t);if(!s)throw Error(`Unprocessed schema. This is a bug in Zod.`);let c=t=>{var n,r;let i=e.seen.get(t);if(i.ref===null)return;let a=(n=i.def)==null?i.schema:n,o=H({},a),s=i.ref;if(i.ref=null,s){c(s);let n=e.seen.get(s),r=n.schema;if(r.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)){var l;a.allOf=(l=a.allOf)==null?[]:l,a.allOf.push(r)}else Object.assign(a,r);if(Object.assign(a,o),t._zod.parent===s)for(let e in a)e===`$ref`||e===`allOf`||e in o||delete a[e];if(r.$ref&&n.def)for(let e in a)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(a[e])===JSON.stringify(n.def[e])&&delete a[e]}let u=t._zod.parent;if(u&&u!==s){c(u);let t=e.seen.get(u);if(t!=null&&t.schema.$ref&&(a.$ref=t.schema.$ref,t.def))for(let e in a)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(a[e])===JSON.stringify(t.def[e])&&delete a[e]}e.override({zodSchema:t,jsonSchema:a,path:(r=i.path)==null?[]:r})};for(let t of[...e.seen.entries()].reverse())c(t[0]);let l={};if(e.target===`draft-2020-12`?l.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?l.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?l.$schema=`http://json-schema.org/draft-04/schema#`:e.target,(n=e.external)!=null&&n.uri){var u;let n=(u=e.external.registry.get(t))==null?void 0:u.id;if(!n)throw Error("Schema is missing an `id` property");l.$id=e.external.uri(n)}Object.assign(l,(r=s.def)==null?s.schema:r);let d=(i=e.metadataRegistry.get(t))==null?void 0:i.id;d!==void 0&&l.id===d&&delete l.id;let f=(a=(o=e.external)==null?void 0:o.defs)==null?{}:a;for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,f[e.defId]=e.def)}e.external||Object.keys(f).length>0&&(e.target===`draft-2020-12`?l.$defs=f:l.definitions=f);try{let n=JSON.parse(JSON.stringify(l));return Object.defineProperty(n,"~standard",{value:H(H({},t[`~standard`]),{},{jsonSchema:{input:uS(t,`input`,e.processors),output:uS(t,`output`,e.processors)}}),enumerable:!1,writable:!1}),n}catch(e){throw Error(`Error converting schema to JSON.`)}}function cS(e,t){let n=t==null?{seen:new Set}:t;if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return cS(r.element,n);if(r.type===`set`)return cS(r.valueType,n);if(r.type===`lazy`)return cS(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return cS(r.innerType,n);if(r.type===`intersection`)return cS(r.left,n)||cS(r.right,n);if(r.type===`record`||r.type===`map`)return cS(r.keyType,n)||cS(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:cS(r.in,n)||cS(r.out,n);if(r.type===`object`){for(let e in r.shape)if(cS(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(cS(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(cS(e,n))return!0;return!!(r.rest&&cS(r.rest,n))}return!1}let lS=(e,t={})=>n=>{let r=iS(H(H({},n),{},{processors:t}));return aS(e,r),oS(r,e),sS(r,e)},uS=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r==null?{}:r,o=iS(H(H({},i==null?{}:i),{},{target:a,io:t,processors:n}));return aS(e,o),oS(o,e),sS(o,e)},dS={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},fS=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s){var u;i.format=(u=dS[s])==null?s:u,i.format===``&&delete i.format,s===`time`&&delete i.format}if(l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>H(H({},t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{}),{},{pattern:e.source}))])}},pS=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a==null?-1/0:a),f=typeof l==`number`&&l<=(o==null?1/0:o),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},mS=(e,t,n,r)=>{n.type=`boolean`},hS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},gS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},_S=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},vS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},yS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},bS=(e,t,n,r)=>{n.not={}},xS=(e,t,n,r)=>{},SS=(e,t,n,r)=>{},CS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},wS=(e,t,n,r)=>{let i=e._zod.def,a=R_(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},TS=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},ES=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},DS=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},OS=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},kS=(e,t,n,r)=>{n.type=`boolean`},AS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},jS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},MS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},NS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},PS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},FS=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=aS(a.element,t,H(H({},r),{},{path:[...r.path,`items`]}))},IS=(e,t,n,r)=>{var i;let a=n,o=e._zod.def;a.type=`object`,a.properties={};let s=o.shape;for(let e in s)a.properties[e]=aS(s[e],t,H(H({},r),{},{path:[...r.path,`properties`,e]}));let c=new Set(Object.keys(s)),l=new Set([...c].filter(e=>{let n=o.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));l.size>0&&(a.required=Array.from(l)),((i=o.catchall)==null?void 0:i._zod.def.type)===`never`?a.additionalProperties=!1:o.catchall?o.catchall&&(a.additionalProperties=aS(o.catchall,t,H(H({},r),{},{path:[...r.path,`additionalProperties`]}))):t.io===`output`&&(a.additionalProperties=!1)},LS=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>aS(e,t,H(H({},r),{},{path:[...r.path,a?`oneOf`:`anyOf`,n]})));a?n.oneOf=o:n.anyOf=o},RS=(e,t,n,r)=>{let i=e._zod.def,a=aS(i.left,t,H(H({},r),{},{path:[...r.path,`allOf`,0]})),o=aS(i.right,t,H(H({},r),{},{path:[...r.path,`allOf`,1]})),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},zS=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>aS(e,t,H(H({},r),{},{path:[...r.path,o,n]}))),l=a.rest?aS(a.rest,t,H(H({},r),{},{path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]})):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},BS=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag,c=s==null?void 0:s.patterns;if(a.mode===`loose`&&c&&c.size>0){let e=aS(a.valueType,t,H(H({},r),{},{path:[...r.path,`patternProperties`,`*`]}));i.patternProperties={};for(let t of c)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=aS(a.keyType,t,H(H({},r),{},{path:[...r.path,`propertyNames`]}))),i.additionalProperties=aS(a.valueType,t,H(H({},r),{},{path:[...r.path,`additionalProperties`]}));let l=o._zod.values;if(l){let e=[...l].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},VS=(e,t,n,r)=>{let i=e._zod.def,a=aS(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},HS=(e,t,n,r)=>{let i=e._zod.def;aS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},US=(e,t,n,r)=>{let i=e._zod.def;aS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},WS=(e,t,n,r)=>{let i=e._zod.def;aS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},GS=(e,t,n,r)=>{let i=e._zod.def;aS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch(e){throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},KS=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;aS(o,t,r);let s=t.seen.get(e);s.ref=o},qS=(e,t,n,r)=>{let i=e._zod.def;aS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},JS=(e,t,n,r)=>{let i=e._zod.def;aS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},YS=(e,t,n,r)=>{let i=e._zod.def;aS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},XS=(e,t,n,r)=>{let i=e._zod.innerType;aS(i,t,r);let a=t.seen.get(e);a.ref=i},ZS={string:fS,number:pS,boolean:mS,bigint:hS,symbol:gS,null:_S,undefined:vS,void:yS,never:bS,any:xS,unknown:SS,date:CS,enum:wS,literal:TS,nan:ES,template_literal:DS,file:OS,success:kS,custom:AS,function:jS,transform:MS,map:NS,set:PS,array:FS,object:IS,union:LS,intersection:RS,tuple:zS,record:BS,nullable:VS,nonoptional:HS,default:US,prefault:WS,catch:GS,pipe:KS,readonly:qS,promise:JS,optional:YS,lazy:XS};function QS(e,t){if(`_idmap`in e){let n=e,r=iS(H(H({},t),{},{processors:ZS})),i={};for(let e of n._idmap.entries()){let[t,n]=e;aS(n,r)}let a={};r.external={registry:n,uri:t==null?void 0:t.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;oS(r,n),a[t]=sS(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=iS(H(H({},t),{},{processors:ZS}));return aS(e,n),oS(n,e),sS(n,e)}let $S=K(`ZodISODateTime`,(e,t)=>{Yy.init(e,t),TC.init(e,t)});function eC(e){return Cx($S,e)}let tC=K(`ZodISODate`,(e,t)=>{Xy.init(e,t),TC.init(e,t)});function nC(e){return wx(tC,e)}let rC=K(`ZodISOTime`,(e,t)=>{Zy.init(e,t),TC.init(e,t)});function iC(e){return Tx(rC,e)}let aC=K(`ZodISODuration`,(e,t)=>{Qy.init(e,t),TC.init(e,t)});function oC(e){return Ex(aC,e)}let sC=K(`ZodError`,(e,t)=>{xv.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>wv(e,t)},flatten:{value:t=>Cv(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,z_,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,z_,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),cC=Tv(sC),lC=Ev(sC),uC=Dv(sC),dC=kv(sC),fC=jv(sC),pC=Mv(sC),mC=Nv(sC),hC=Pv(sC),gC=Fv(sC),_C=Iv(sC),vC=Lv(sC),yC=Rv(sC),bC=new WeakMap;function xC(e,t,n){let r=Object.getPrototypeOf(e),i=bC.get(r);if(i||(i=new Set,bC.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}let SC=K(`ZodType`,(e,t)=>(Fy.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:uS(e,`input`),output:uS(e,`output`)}}),e.toJSONSchema=lS(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>cC(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>uC(e,t,n),e.parseAsync=async(t,n)=>lC(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>dC(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>fC(e,t,n),e.decode=(t,n)=>pC(e,t,n),e.encodeAsync=async(t,n)=>mC(e,t,n),e.decodeAsync=async(t,n)=>hC(e,t,n),e.safeEncode=(t,n)=>gC(e,t,n),e.safeDecode=(t,n)=>_C(e,t,n),e.safeEncodeAsync=async(t,n)=>vC(e,t,n),e.safeDecodeAsync=async(t,n)=>yC(e,t,n),xC(e,`ZodType`,{check(...e){var t;let n=this.def;return this.clone(q_(n,{checks:[...(t=n.checks)==null?[]:t,...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return rv(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ww(e,t))},superRefine(e,t){return this.check(Gw(e,t))},overwrite(e){return this.check(qx(e))},optional(){return Cw(this)},exactOptional(){return Tw(this)},nullable(){return Dw(this)},nullish(){return Cw(Dw(this))},nonoptional(e){return Nw(this,e)},array(){return iw(this)},or(e){return lw([this,e])},and(e){return pw(this,e)},transform(e){return Lw(this,xw(e))},default(e){return kw(this,e)},prefault(e){return jw(this,e)},catch(e){return Fw(this,e)},pipe(e){return Lw(this,e)},readonly(){return zw(this)},describe(e){let t=this.clone();return $b.add(t,{description:e}),t},meta(...e){if(e.length===0)return $b.get(this);let t=this.clone();return $b.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){var t;return(t=$b.get(e))==null?void 0:t.description},configurable:!0}),e)),CC=K(`_ZodString`,(e,t)=>{var n,r,i;Iy.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fS(e,t,n,r);let a=e._zod.bag;e.format=(n=a.format)==null?null:n,e.minLength=(r=a.minimum)==null?null:r,e.maxLength=(i=a.maximum)==null?null:i,xC(e,`_ZodString`,{regex(...e){return this.check(Vx(...e))},includes(...e){return this.check(Wx(...e))},startsWith(...e){return this.check(Gx(...e))},endsWith(...e){return this.check(Kx(...e))},min(...e){return this.check(zx(...e))},max(...e){return this.check(Rx(...e))},length(...e){return this.check(Bx(...e))},nonempty(...e){return this.check(zx(1,...e))},lowercase(e){return this.check(Hx(e))},uppercase(e){return this.check(Ux(e))},trim(){return this.check(Yx())},normalize(...e){return this.check(Jx(...e))},toLowerCase(){return this.check(Xx())},toUpperCase(){return this.check(Zx())},slugify(){return this.check(Qx())}})}),wC=K(`ZodString`,(e,t)=>{Iy.init(e,t),CC.init(e,t),e.email=t=>e.check(tx(EC,t)),e.url=t=>e.check(sx(kC,t)),e.jwt=t=>e.check(Sx(WC,t)),e.emoji=t=>e.check(cx(AC,t)),e.guid=t=>e.check(nx(DC,t)),e.uuid=t=>e.check(rx(OC,t)),e.uuidv4=t=>e.check(ix(OC,t)),e.uuidv6=t=>e.check(ax(OC,t)),e.uuidv7=t=>e.check(ox(OC,t)),e.nanoid=t=>e.check(lx(jC,t)),e.guid=t=>e.check(nx(DC,t)),e.cuid=t=>e.check(ux(MC,t)),e.cuid2=t=>e.check(dx(NC,t)),e.ulid=t=>e.check(fx(PC,t)),e.base64=t=>e.check(yx(VC,t)),e.base64url=t=>e.check(bx(HC,t)),e.xid=t=>e.check(px(FC,t)),e.ksuid=t=>e.check(mx(IC,t)),e.ipv4=t=>e.check(hx(LC,t)),e.ipv6=t=>e.check(gx(RC,t)),e.cidrv4=t=>e.check(_x(zC,t)),e.cidrv6=t=>e.check(vx(BC,t)),e.e164=t=>e.check(xx(UC,t)),e.datetime=t=>e.check(eC(t)),e.date=t=>e.check(nC(t)),e.time=t=>e.check(iC(t)),e.duration=t=>e.check(oC(t))});function J(e){return ex(wC,e)}let TC=K(`ZodStringFormat`,(e,t)=>{Ly.init(e,t),CC.init(e,t)}),EC=K(`ZodEmail`,(e,t)=>{By.init(e,t),TC.init(e,t)}),DC=K(`ZodGUID`,(e,t)=>{Ry.init(e,t),TC.init(e,t)}),OC=K(`ZodUUID`,(e,t)=>{zy.init(e,t),TC.init(e,t)}),kC=K(`ZodURL`,(e,t)=>{Vy.init(e,t),TC.init(e,t)}),AC=K(`ZodEmoji`,(e,t)=>{Hy.init(e,t),TC.init(e,t)}),jC=K(`ZodNanoID`,(e,t)=>{Uy.init(e,t),TC.init(e,t)}),MC=K(`ZodCUID`,(e,t)=>{Wy.init(e,t),TC.init(e,t)}),NC=K(`ZodCUID2`,(e,t)=>{Gy.init(e,t),TC.init(e,t)}),PC=K(`ZodULID`,(e,t)=>{Ky.init(e,t),TC.init(e,t)}),FC=K(`ZodXID`,(e,t)=>{qy.init(e,t),TC.init(e,t)}),IC=K(`ZodKSUID`,(e,t)=>{Jy.init(e,t),TC.init(e,t)}),LC=K(`ZodIPv4`,(e,t)=>{$y.init(e,t),TC.init(e,t)}),RC=K(`ZodIPv6`,(e,t)=>{eb.init(e,t),TC.init(e,t)}),zC=K(`ZodCIDRv4`,(e,t)=>{tb.init(e,t),TC.init(e,t)}),BC=K(`ZodCIDRv6`,(e,t)=>{nb.init(e,t),TC.init(e,t)}),VC=K(`ZodBase64`,(e,t)=>{ib.init(e,t),TC.init(e,t)}),HC=K(`ZodBase64URL`,(e,t)=>{ob.init(e,t),TC.init(e,t)}),UC=K(`ZodE164`,(e,t)=>{sb.init(e,t),TC.init(e,t)}),WC=K(`ZodJWT`,(e,t)=>{lb.init(e,t),TC.init(e,t)}),GC=K(`ZodNumber`,(e,t)=>{var n,r,i,a,o,s,c,l,u;ub.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pS(e,t,n,r),xC(e,`ZodNumber`,{gt(e,t){return this.check(Fx(e,t))},gte(e,t){return this.check(Ix(e,t))},min(e,t){return this.check(Ix(e,t))},lt(e,t){return this.check(Nx(e,t))},lte(e,t){return this.check(Px(e,t))},max(e,t){return this.check(Px(e,t))},int(e){return this.check(JC(e))},safe(e){return this.check(JC(e))},positive(e){return this.check(Fx(0,e))},nonnegative(e){return this.check(Ix(0,e))},negative(e){return this.check(Nx(0,e))},nonpositive(e){return this.check(Px(0,e))},multipleOf(e,t){return this.check(Lx(e,t))},step(e,t){return this.check(Lx(e,t))},finite(){return this}});let d=e._zod.bag;e.minValue=(n=Math.max((r=d.minimum)==null?-1/0:r,(i=d.exclusiveMinimum)==null?-1/0:i))==null?null:n,e.maxValue=(a=Math.min((o=d.maximum)==null?1/0:o,(s=d.exclusiveMaximum)==null?1/0:s))==null?null:a,e.isInt=((c=d.format)==null?``:c).includes(`int`)||Number.isSafeInteger((l=d.multipleOf)==null?.5:l),e.isFinite=!0,e.format=(u=d.format)==null?null:u});function KC(e){return Dx(GC,e)}let qC=K(`ZodNumberFormat`,(e,t)=>{db.init(e,t),GC.init(e,t)});function JC(e){return Ox(qC,e)}let YC=K(`ZodBoolean`,(e,t)=>{fb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mS(e,t,n,r)});function XC(e){return kx(YC,e)}let ZC=K(`ZodNull`,(e,t)=>{pb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_S(e,t,n,r)});function QC(e){return Ax(ZC,e)}let $C=K(`ZodUnknown`,(e,t)=>{mb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ew(){return jx($C)}let tw=K(`ZodNever`,(e,t)=>{hb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bS(e,t,n,r)});function nw(e){return Mx(tw,e)}let rw=K(`ZodArray`,(e,t)=>{_b.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>FS(e,t,n,r),e.element=t.element,xC(e,`ZodArray`,{min(e,t){return this.check(zx(e,t))},nonempty(e){return this.check(zx(1,e))},max(e,t){return this.check(Rx(e,t))},length(e,t){return this.check(Bx(e,t))},unwrap(){return this.element}})});function iw(e,t){return $x(rw,e,t)}let aw=K(`ZodObject`,(e,t)=>{Sb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>IS(e,t,n,r),G_(e,`shape`,()=>t.shape),xC(e,`ZodObject`,{keyof(){return _w(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(H(H({},this._zod.def),{},{catchall:e}))},passthrough(){return this.clone(H(H({},this._zod.def),{},{catchall:ew()}))},loose(){return this.clone(H(H({},this._zod.def),{},{catchall:ew()}))},strict(){return this.clone(H(H({},this._zod.def),{},{catchall:nw()}))},strip(){return this.clone(H(H({},this._zod.def),{},{catchall:void 0}))},extend(e){return cv(this,e)},safeExtend(e){return lv(this,e)},merge(e){return uv(this,e)},pick(e){return ov(this,e)},omit(e){return sv(this,e)},partial(...e){return dv(Sw,this,e[0])},required(...e){return fv(Mw,this,e[0])}})});function ow(e,t){let n=H({type:`object`,shape:e==null?{}:e},q(t));return new aw(n)}function sw(e,t){return new aw(H({type:`object`,shape:e,catchall:nw()},q(t)))}let cw=K(`ZodUnion`,(e,t)=>{wb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>LS(e,t,n,r),e.options=t.options});function lw(e,t){return new cw(H({type:`union`,options:e},q(t)))}let uw=K(`ZodDiscriminatedUnion`,(e,t)=>{cw.init(e,t),Tb.init(e,t)});function dw(e,t,n){return new uw(H({type:`union`,options:t,discriminator:e},q(n)))}let fw=K(`ZodIntersection`,(e,t)=>{Eb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>RS(e,t,n,r)});function pw(e,t){return new fw({type:`intersection`,left:e,right:t})}let mw=K(`ZodRecord`,(e,t)=>{kb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>BS(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function hw(e,t,n){return!t||!t._zod?new mw(H({type:`record`,keyType:J(),valueType:e},q(t))):new mw(H({type:`record`,keyType:e,valueType:t},q(n)))}let gw=K(`ZodEnum`,(e,t)=>{Ab.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wS(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new gw(H(H(H({},t),{},{checks:[]},q(r)),{},{entries:i}))},e.exclude=(e,r)=>{let i=H({},t.entries);for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new gw(H(H(H({},t),{},{checks:[]},q(r)),{},{entries:i}))}});function _w(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new gw(H({type:`enum`,entries:n},q(t)))}let vw=K(`ZodLiteral`,(e,t)=>{jb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>TS(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function yw(e,t){return new vw(H({type:`literal`,values:Array.isArray(e)?e:[e]},q(t)))}let bw=K(`ZodTransform`,(e,t)=>{Mb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>MS(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new P_(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(yv(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code!=null||(t.code=`custom`),t.input!=null||(t.input=n.value),t.inst!=null||(t.inst=e),n.issues.push(yv(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function xw(e){return new bw({type:`transform`,transform:e})}let Sw=K(`ZodOptional`,(e,t)=>{Pb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>YS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cw(e){return new Sw({type:`optional`,innerType:e})}let ww=K(`ZodExactOptional`,(e,t)=>{Fb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>YS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tw(e){return new ww({type:`optional`,innerType:e})}let Ew=K(`ZodNullable`,(e,t)=>{Ib.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>VS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Dw(e){return new Ew({type:`nullable`,innerType:e})}let Ow=K(`ZodDefault`,(e,t)=>{Lb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>US(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function kw(e,t){return new Ow({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ev(t)}})}let Aw=K(`ZodPrefault`,(e,t)=>{zb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>WS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function jw(e,t){return new Aw({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ev(t)}})}let Mw=K(`ZodNonOptional`,(e,t)=>{Bb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>HS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Nw(e,t){return new Mw(H({type:`nonoptional`,innerType:e},q(t)))}let Pw=K(`ZodCatch`,(e,t)=>{Hb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>GS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Fw(e,t){return new Pw({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}let Iw=K(`ZodPipe`,(e,t)=>{Ub.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>KS(e,t,n,r),e.in=t.in,e.out=t.out});function Lw(e,t){return new Iw({type:`pipe`,in:e,out:t})}let Rw=K(`ZodReadonly`,(e,t)=>{Gb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zw(e){return new Rw({type:`readonly`,innerType:e})}let Bw=K(`ZodLazy`,(e,t)=>{qb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>XS(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Vw(e){return new Bw({type:`lazy`,getter:e})}let Hw=K(`ZodCustom`,(e,t)=>{Jb.init(e,t),SC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>AS(e,t,n,r)});function Uw(e,t){return eS(Hw,e==null?(()=>!0):e,t)}function Ww(e,t={}){return tS(Hw,e,t)}function Gw(e,t){return nS(e,t)}function Kw(e,t={}){let n=new Hw(H({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0},q(t)));return n._zod.bag.Class=e,n._zod.check=t=>{if(!(t.value instanceof e)){var r;t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...(r=n._zod.def.path)==null?[]:r]})}},n}var qw;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(qw||(qw={}));var Jw;(function(e){e.mergeShapes=(e,t)=>H(H({},e),t)})(Jw||(Jw={}));let Y=qw.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),Yw=e=>{switch(typeof e){case`undefined`:return Y.undefined;case`string`:return Y.string;case`number`:return Number.isNaN(e)?Y.nan:Y.number;case`boolean`:return Y.boolean;case`function`:return Y.function;case`bigint`:return Y.bigint;case`symbol`:return Y.symbol;case`object`:return Array.isArray(e)?Y.array:e===null?Y.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?Y.promise:typeof Map<`u`&&e instanceof Map?Y.map:typeof Set<`u`&&e instanceof Set?Y.set:typeof Date<`u`&&e instanceof Date?Y.date:Y.object;default:return Y.unknown}},X=qw.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`]);var Xw=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,qw.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t=Object.create(null),n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};Xw.create=e=>new Xw(e);let Zw=(e,t)=>{let n;switch(e.code){case X.invalid_type:n=e.received===Y.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case X.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,qw.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:n=`Unrecognized key(s) in object: ${qw.joinValues(e.keys,`, `)}`;break;case X.invalid_union:n=`Invalid input`;break;case X.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${qw.joinValues(e.options)}`;break;case X.invalid_enum_value:n=`Invalid enum value. Expected ${qw.joinValues(e.options)}, received '${e.received}'`;break;case X.invalid_arguments:n=`Invalid function arguments`;break;case X.invalid_return_type:n=`Invalid function return type`;break;case X.invalid_date:n=`Invalid date`;break;case X.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:qw.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case X.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case X.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case X.custom:n=`Invalid input`;break;case X.invalid_intersection_types:n=`Intersection results could not be merged`;break;case X.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case X.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,qw.assertNever(e)}return{message:n}},Qw=Zw;function $w(){return Qw}let eT=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o=H(H({},i),{},{path:a});if(i.message!==void 0)return H(H({},i),{},{path:a,message:i.message});let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return H(H({},i),{},{path:a,message:s})};function Z(e,t){let n=$w(),r=eT({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Zw?void 0:Zw].filter(e=>!!e)});e.common.issues.push(r)}var tT=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return nT;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return nT;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}};let nT=Object.freeze({status:`aborted`}),rT=e=>({status:`dirty`,value:e}),iT=e=>({status:`valid`,value:e}),aT=e=>e.status===`aborted`,oT=e=>e.status===`dirty`,sT=e=>e.status===`valid`,cT=e=>typeof Promise<`u`&&e instanceof Promise;var Q;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e==null?void 0:e.message})(Q||(Q={}));var lT=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}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}};let uT=(e,t)=>{if(sT(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new Xw(e.common.issues);return this._error=t,this._error}}};function dT(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{var a;let{message:o}=e;if(t.code===`invalid_enum_value`)return{message:o==null?i.defaultError:o};if(i.data===void 0){var s;return{message:(s=o==null?r:o)==null?i.defaultError:s}}return t.code===`invalid_type`?{message:(a=o==null?n:o)==null?i.defaultError:a}:{message:i.defaultError}},description:i}}var fT=class{get description(){return this._def.description}_getType(e){return Yw(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Yw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new tT,ctx:{common:e.parent.common,data:e.data,parsedType:Yw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(cT(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;let r={common:{issues:[],async:(n=t==null?void 0:t.async)!=null&&n,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Yw(e)},i=this._parseSync({data:e,path:r.path,parent:r});return uT(r,i)}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Yw(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return sT(n)?{value:n.value}:{issues:t.common.issues}}catch(e){var n;!(e==null||(n=e.message)==null||(n=n.toLowerCase())==null)&&n.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>sT(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){var n=this;let r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:n._def.errorMap,parent:null,data:e,parsedType:Yw(e)},i=n._parse({data:e,path:r.path,parent:r}),a=await(cT(i)?i:Promise.resolve(i));return uT(r,a)}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue(H({code:X.custom},n(t)));return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new mE({schema:this,typeName:$.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,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:e=>this[`~validate`](e)}}optional(){return hE.create(this,this._def)}nullable(){return gE.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return YT.create(this)}promise(){return pE.create(this,this._def)}or(e){return QT.create([this,e],this._def)}and(e){return nE.create(this,e,this._def)}transform(e){return new mE(H(H({},dT(this._def)),{},{schema:this,typeName:$.ZodEffects,effect:{type:`transform`,transform:e}}))}default(e){let t=typeof e==`function`?e:()=>e;return new _E(H(H({},dT(this._def)),{},{innerType:this,defaultValue:t,typeName:$.ZodDefault}))}brand(){return new bE(H({typeName:$.ZodBranded,type:this},dT(this._def)))}catch(e){let t=typeof e==`function`?e:()=>e;return new vE(H(H({},dT(this._def)),{},{innerType:this,catchValue:t,typeName:$.ZodCatch}))}describe(e){let t=this.constructor;return new t(H(H({},this._def),{},{description:e}))}pipe(e){return xE.create(this,e)}readonly(){return SE.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};let pT=/^c[^\s-]{8,}$/i,mT=/^[0-9a-z]+$/,hT=/^[0-9A-HJKMNP-TV-Z]{26}$/i,gT=/^[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,_T=/^[a-z0-9_-]{21}$/i,vT=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,yT=/^[-+]?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)?)??$/,bT=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,xT,ST=/^(?:(?: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])$/,CT=/^(?:(?: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])$/,wT=/^(([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]))$/,TT=/^(([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])$/,ET=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,DT=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,OT=`((\\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])))`,kT=RegExp(`^${OT}$`);function AT(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function jT(e){return RegExp(`^${AT(e)}$`)}function MT(e){let t=`${OT}T${AT(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function NT(e,t){return!!((t===`v4`||!t)&&ST.test(e)||(t===`v6`||!t)&&wT.test(e))}function PT(e,t){if(!vT.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&(i==null?void 0:i.typ)!==`JWT`||!i.alg||t&&i.alg!==t)}catch(e){return!1}}function FT(e,t){return!!((t===`v4`||!t)&&CT.test(e)||(t===`v6`||!t)&&TT.test(e))}var IT=class e extends fT{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Y.string){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.string,received:t.parsedType}),nT}let t=new tT,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),Z(n,{code:X.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),Z(n,{code:X.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?Z(n,{code:X.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&Z(n,{code:X.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)bT.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`email`,code:X.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)xT||(xT=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),xT.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`emoji`,code:X.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)gT.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`uuid`,code:X.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)_T.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`nanoid`,code:X.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)pT.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`cuid`,code:X.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)mT.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`cuid2`,code:X.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)hT.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`ulid`,code:X.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch(i){n=this._getOrReturnCtx(e,n),Z(n,{validation:`url`,code:X.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`regex`,code:X.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),Z(n,{code:X.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),Z(n,{code:X.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),Z(n,{code:X.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?MT(r).test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{code:X.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?kT.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{code:X.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?jT(r).test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{code:X.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?yT.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`duration`,code:X.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?NT(e.data,r.version)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`ip`,code:X.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?PT(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`jwt`,code:X.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?FT(e.data,r.version)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`cidr`,code:X.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?ET.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`base64`,code:X.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?DT.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`base64url`,code:X.invalid_string,message:r.message}),t.dirty()):qw.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),H({validation:t,code:X.invalid_string},Q.errToObj(n)))}_addCheck(t){return new e(H(H({},this._def),{},{checks:[...this._def.checks,t]}))}email(e){return this._addCheck(H({kind:`email`},Q.errToObj(e)))}url(e){return this._addCheck(H({kind:`url`},Q.errToObj(e)))}emoji(e){return this._addCheck(H({kind:`emoji`},Q.errToObj(e)))}uuid(e){return this._addCheck(H({kind:`uuid`},Q.errToObj(e)))}nanoid(e){return this._addCheck(H({kind:`nanoid`},Q.errToObj(e)))}cuid(e){return this._addCheck(H({kind:`cuid`},Q.errToObj(e)))}cuid2(e){return this._addCheck(H({kind:`cuid2`},Q.errToObj(e)))}ulid(e){return this._addCheck(H({kind:`ulid`},Q.errToObj(e)))}base64(e){return this._addCheck(H({kind:`base64`},Q.errToObj(e)))}base64url(e){return this._addCheck(H({kind:`base64url`},Q.errToObj(e)))}jwt(e){return this._addCheck(H({kind:`jwt`},Q.errToObj(e)))}ip(e){return this._addCheck(H({kind:`ip`},Q.errToObj(e)))}cidr(e){return this._addCheck(H({kind:`cidr`},Q.errToObj(e)))}datetime(e){var t,n;return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck(H({kind:`datetime`,precision:(e==null?void 0:e.precision)===void 0?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!=null&&t,local:(n=e==null?void 0:e.local)!=null&&n},Q.errToObj(e==null?void 0:e.message)))}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck(H({kind:`time`,precision:(e==null?void 0:e.precision)===void 0?null:e==null?void 0:e.precision},Q.errToObj(e==null?void 0:e.message)))}duration(e){return this._addCheck(H({kind:`duration`},Q.errToObj(e)))}regex(e,t){return this._addCheck(H({kind:`regex`,regex:e},Q.errToObj(t)))}includes(e,t){return this._addCheck(H({kind:`includes`,value:e,position:t==null?void 0:t.position},Q.errToObj(t==null?void 0:t.message)))}startsWith(e,t){return this._addCheck(H({kind:`startsWith`,value:e},Q.errToObj(t)))}endsWith(e,t){return this._addCheck(H({kind:`endsWith`,value:e},Q.errToObj(t)))}min(e,t){return this._addCheck(H({kind:`min`,value:e},Q.errToObj(t)))}max(e,t){return this._addCheck(H({kind:`max`,value:e},Q.errToObj(t)))}length(e,t){return this._addCheck(H({kind:`length`,value:e},Q.errToObj(t)))}nonempty(e){return this.min(1,Q.errToObj(e))}trim(){return new e(H(H({},this._def),{},{checks:[...this._def.checks,{kind:`trim`}]}))}toLowerCase(){return new e(H(H({},this._def),{},{checks:[...this._def.checks,{kind:`toLowerCase`}]}))}toUpperCase(){return new e(H(H({},this._def),{},{checks:[...this._def.checks,{kind:`toUpperCase`}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};IT.create=e=>{var t;return new IT(H({checks:[],typeName:$.ZodString,coerce:(t=e==null?void 0:e.coerce)!=null&&t},dT(e)))};function LT(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var RT=class e extends fT{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Y.number){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.number,received:t.parsedType}),nT}let t,n=new tT;for(let r of this._def.checks)r.kind===`int`?qw.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Z(t,{code:X.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Z(t,{code:X.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Z(t,{code:X.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?LT(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),Z(t,{code:X.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Z(t,{code:X.not_finite,message:r.message}),n.dirty()):qw.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,Q.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,Q.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,Q.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,Q.toString(t))}setLimit(t,n,r,i){return new e(H(H({},this._def),{},{checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Q.toString(i)}]}))}_addCheck(t){return new e(H(H({},this._def),{},{checks:[...this._def.checks,t]}))}int(e){return this._addCheck({kind:`int`,message:Q.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:Q.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:Q.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:Q.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:Q.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:Q.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&qw.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};RT.create=e=>new RT(H({checks:[],typeName:$.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1},dT(e)));var zT=class e extends fT{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==Y.bigint)return this._getInvalidInput(e);let t,n=new tT;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Z(t,{code:X.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Z(t,{code:X.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),Z(t,{code:X.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):qw.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.bigint,received:t.parsedType}),nT}gte(e,t){return this.setLimit(`min`,e,!0,Q.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,Q.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,Q.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,Q.toString(t))}setLimit(t,n,r,i){return new e(H(H({},this._def),{},{checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Q.toString(i)}]}))}_addCheck(t){return new e(H(H({},this._def),{},{checks:[...this._def.checks,t]}))}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:Q.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:Q.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};zT.create=e=>{var t;return new zT(H({checks:[],typeName:$.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!=null&&t},dT(e)))};var BT=class extends fT{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Y.boolean){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.boolean,received:t.parsedType}),nT}return iT(e.data)}};BT.create=e=>new BT(H({typeName:$.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1},dT(e)));var VT=class e extends fT{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Y.date){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.date,received:t.parsedType}),nT}if(Number.isNaN(e.data.getTime()))return Z(this._getOrReturnCtx(e),{code:X.invalid_date}),nT;let t=new tT,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Z(n,{code:X.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),Z(n,{code:X.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):qw.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e(H(H({},this._def),{},{checks:[...this._def.checks,t]}))}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:Q.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:Q.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};VT.create=e=>new VT(H({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:$.ZodDate},dT(e)));var HT=class extends fT{_parse(e){if(this._getType(e)!==Y.symbol){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.symbol,received:t.parsedType}),nT}return iT(e.data)}};HT.create=e=>new HT(H({typeName:$.ZodSymbol},dT(e)));var UT=class extends fT{_parse(e){if(this._getType(e)!==Y.undefined){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.undefined,received:t.parsedType}),nT}return iT(e.data)}};UT.create=e=>new UT(H({typeName:$.ZodUndefined},dT(e)));var WT=class extends fT{_parse(e){if(this._getType(e)!==Y.null){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.null,received:t.parsedType}),nT}return iT(e.data)}};WT.create=e=>new WT(H({typeName:$.ZodNull},dT(e)));var GT=class extends fT{constructor(){super(...arguments),this._any=!0}_parse(e){return iT(e.data)}};GT.create=e=>new GT(H({typeName:$.ZodAny},dT(e)));var KT=class extends fT{constructor(){super(...arguments),this._unknown=!0}_parse(e){return iT(e.data)}};KT.create=e=>new KT(H({typeName:$.ZodUnknown},dT(e)));var qT=class extends fT{_parse(e){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.never,received:t.parsedType}),nT}};qT.create=e=>new qT(H({typeName:$.ZodNever},dT(e)));var JT=class extends fT{_parse(e){if(this._getType(e)!==Y.undefined){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.void,received:t.parsedType}),nT}return iT(e.data)}};JT.create=e=>new JT(H({typeName:$.ZodVoid},dT(e)));var YT=class e extends fT{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Y.array)return Z(t,{code:X.invalid_type,expected:Y.array,received:t.parsedType}),nT;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Z(t,{code:e?X.too_big:X.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(Z(t,{code:X.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(Z(t,{code:X.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new lT(t,e,t.path,n)))).then(e=>tT.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new lT(t,e,t.path,n)));return tT.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e(H(H({},this._def),{},{minLength:{value:t,message:Q.toString(n)}}))}max(t,n){return new e(H(H({},this._def),{},{maxLength:{value:t,message:Q.toString(n)}}))}length(t,n){return new e(H(H({},this._def),{},{exactLength:{value:t,message:Q.toString(n)}}))}nonempty(e){return this.min(1,e)}};YT.create=(e,t)=>new YT(H({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$.ZodArray},dT(t)));function XT(e){if(e instanceof ZT){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=hE.create(XT(r))}return new ZT(H(H({},e._def),{},{shape:()=>t}))}else if(e instanceof YT)return new YT(H(H({},e._def),{},{type:XT(e.element)}));else if(e instanceof hE)return hE.create(XT(e.unwrap()));else if(e instanceof gE)return gE.create(XT(e.unwrap()));else if(e instanceof rE)return rE.create(e.items.map(e=>XT(e)));else return e}var ZT=class e extends fT{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=qw.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==Y.object){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.object,received:t.parsedType}),nT}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof qT&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new lT(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof qT){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(Z(n,{code:X.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new lT(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>tT.mergeObjectSync(t,e)):tT.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return Q.errToObj,new e(H(H({},this._def),{},{unknownKeys:`strict`},t===void 0?{}:{errorMap:(e,n)=>{var r,i,a,o;let s=(r=(i=(a=this._def).errorMap)==null?void 0:i.call(a,e,n).message)==null?n.defaultError:r;return e.code===`unrecognized_keys`?{message:(o=Q.errToObj(t).message)==null?s:o}:{message:s}}}))}strip(){return new e(H(H({},this._def),{},{unknownKeys:`strip`}))}passthrough(){return new e(H(H({},this._def),{},{unknownKeys:`passthrough`}))}extend(t){return new e(H(H({},this._def),{},{shape:()=>H(H({},this._def.shape()),t)}))}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>H(H({},this._def.shape()),t._def.shape()),typeName:$.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e(H(H({},this._def),{},{catchall:t}))}pick(t){let n={};for(let e of qw.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e(H(H({},this._def),{},{shape:()=>n}))}omit(t){let n={};for(let e of qw.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e(H(H({},this._def),{},{shape:()=>n}))}deepPartial(){return XT(this)}partial(t){let n={};for(let e of qw.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e(H(H({},this._def),{},{shape:()=>n}))}required(t){let n={};for(let e of qw.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof hE;)t=t._def.innerType;n[e]=t}return new e(H(H({},this._def),{},{shape:()=>n}))}keyof(){return uE(qw.objectKeys(this.shape))}};ZT.create=(e,t)=>new ZT(H({shape:()=>e,unknownKeys:`strip`,catchall:qT.create(),typeName:$.ZodObject},dT(t))),ZT.strictCreate=(e,t)=>new ZT(H({shape:()=>e,unknownKeys:`strict`,catchall:qT.create(),typeName:$.ZodObject},dT(t))),ZT.lazycreate=(e,t)=>new ZT(H({shape:e,unknownKeys:`strip`,catchall:qT.create(),typeName:$.ZodObject},dT(t)));var QT=class extends fT{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new Xw(e.ctx.common.issues));return Z(t,{code:X.invalid_union,unionErrors:n}),nT}if(t.common.async)return Promise.all(n.map(async e=>{let n=H(H({},t),{},{common:H(H({},t.common),{},{issues:[]}),parent:null});return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n=H(H({},t),{},{common:H(H({},t.common),{},{issues:[]}),parent:null}),a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new Xw(e));return Z(t,{code:X.invalid_union,unionErrors:i}),nT}}get options(){return this._def.options}};QT.create=(e,t)=>new QT(H({options:e,typeName:$.ZodUnion},dT(t)));let $T=e=>e instanceof cE?$T(e.schema):e instanceof mE?$T(e.innerType()):e instanceof lE?[e.value]:e instanceof dE?e.options:e instanceof fE?qw.objectValues(e.enum):e instanceof _E?$T(e._def.innerType):e instanceof UT?[void 0]:e instanceof WT?[null]:e instanceof hE?[void 0,...$T(e.unwrap())]:e instanceof gE?[null,...$T(e.unwrap())]:e instanceof bE||e instanceof SE?$T(e.unwrap()):e instanceof vE?$T(e._def.innerType):[];var eE=class e extends fT{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Y.object)return Z(t,{code:X.invalid_type,expected:Y.object,received:t.parsedType}),nT;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(Z(t,{code:X.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),nT)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=$T(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e(H({typeName:$.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i},dT(r)))}};function tE(e,t){let n=Yw(e),r=Yw(t);if(e===t)return{valid:!0,data:e};if(n===Y.object&&r===Y.object){let n=qw.objectKeys(t),r=qw.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i=H(H({},e),t);for(let n of r){let r=tE(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===Y.array&&r===Y.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=tE(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===Y.date&&r===Y.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var nE=class extends fT{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(aT(e)||aT(r))return nT;let i=tE(e.value,r.value);return i.valid?((oT(e)||oT(r))&&t.dirty(),{status:t.value,value:i.data}):(Z(n,{code:X.invalid_intersection_types}),nT)};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(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};nE.create=(e,t,n)=>new nE(H({left:e,right:t,typeName:$.ZodIntersection},dT(n)));var rE=class e extends fT{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.array)return Z(n,{code:X.invalid_type,expected:Y.array,received:n.parsedType}),nT;if(n.data.length<this._def.items.length)return Z(n,{code:X.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),nT;!this._def.rest&&n.data.length>this._def.items.length&&(Z(n,{code:X.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new lT(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>tT.mergeArray(t,e)):tT.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e(H(H({},this._def),{},{rest:t}))}};rE.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new rE(H({items:e,typeName:$.ZodTuple,rest:null},dT(t)))};var iE=class e extends fT{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.object)return Z(n,{code:X.invalid_type,expected:Y.object,received:n.parsedType}),nT;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new lT(n,e,n.path,e)),value:a._parse(new lT(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?tT.mergeObjectAsync(t,r):tT.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof fT?new e(H({keyType:t,valueType:n,typeName:$.ZodRecord},dT(r))):new e(H({keyType:IT.create(),valueType:t,typeName:$.ZodRecord},dT(n)))}},aE=class extends fT{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.map)return Z(n,{code:X.invalid_type,expected:Y.map,received:n.parsedType}),nT;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new lT(n,e,n.path,[a,`key`])),value:i._parse(new lT(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return nT;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return nT;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};aE.create=(e,t,n)=>new aE(H({valueType:t,keyType:e,typeName:$.ZodMap},dT(n)));var oE=class e extends fT{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.set)return Z(n,{code:X.invalid_type,expected:Y.set,received:n.parsedType}),nT;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(Z(n,{code:X.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(Z(n,{code:X.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return nT;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new lT(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e(H(H({},this._def),{},{minSize:{value:t,message:Q.toString(n)}}))}max(t,n){return new e(H(H({},this._def),{},{maxSize:{value:t,message:Q.toString(n)}}))}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};oE.create=(e,t)=>new oE(H({valueType:e,minSize:null,maxSize:null,typeName:$.ZodSet},dT(t)));var sE=class e extends fT{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==Y.function)return Z(t,{code:X.invalid_type,expected:Y.function,received:t.parsedType}),nT;function n(e,n){return eT({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,$w(),Zw].filter(e=>!!e),issueData:{code:X.invalid_arguments,argumentsError:n}})}function r(e,n){return eT({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,$w(),Zw].filter(e=>!!e),issueData:{code:X.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof pE){let e=this;return iT(async function(...t){let o=new Xw([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return iT(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new Xw([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new Xw([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e(H(H({},this._def),{},{args:rE.create(t).rest(KT.create())}))}returns(t){return new e(H(H({},this._def),{},{returns:t}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e(H({args:t||rE.create([]).rest(KT.create()),returns:n||KT.create(),typeName:$.ZodFunction},dT(r)))}},cE=class extends fT{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};cE.create=(e,t)=>new cE(H({getter:e,typeName:$.ZodLazy},dT(t)));var lE=class extends fT{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Z(t,{received:t.data,code:X.invalid_literal,expected:this._def.value}),nT}return{status:`valid`,value:e.data}}get value(){return this._def.value}};lE.create=(e,t)=>new lE(H({value:e,typeName:$.ZodLiteral},dT(t)));function uE(e,t){return new dE(H({values:e,typeName:$.ZodEnum},dT(t)))}var dE=class e extends fT{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return Z(t,{expected:qw.joinValues(n),received:t.parsedType,code:X.invalid_type}),nT}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return Z(t,{received:t.data,code:X.invalid_enum_value,options:n}),nT}return iT(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,H(H({},this._def),n))}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),H(H({},this._def),n))}};dE.create=uE;var fE=class extends fT{_parse(e){let t=qw.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Y.string&&n.parsedType!==Y.number){let e=qw.objectValues(t);return Z(n,{expected:qw.joinValues(e),received:n.parsedType,code:X.invalid_type}),nT}if(this._cache||(this._cache=new Set(qw.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=qw.objectValues(t);return Z(n,{received:n.data,code:X.invalid_enum_value,options:e}),nT}return iT(e.data)}get enum(){return this._def.values}};fE.create=(e,t)=>new fE(H({values:e,typeName:$.ZodNativeEnum},dT(t)));var pE=class extends fT{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==Y.promise&&t.common.async===!1?(Z(t,{code:X.invalid_type,expected:Y.promise,received:t.parsedType}),nT):iT((t.parsedType===Y.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};pE.create=(e,t)=>new pE(H({type:e,typeName:$.ZodPromise},dT(t)));var mE=class extends fT{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){var t=this;let{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:e=>{Z(r,e),e.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type===`preprocess`){let e=i.transform(r.data,a);if(r.common.async)return Promise.resolve(e).then(async e=>{if(n.value===`aborted`)return nT;let i=await t._def.schema._parseAsync({data:e,path:r.path,parent:r});return i.status===`aborted`?nT:i.status===`dirty`||n.value===`dirty`?rT(i.value):i});{if(n.value===`aborted`)return nT;let t=this._def.schema._parseSync({data:e,path:r.path,parent:r});return t.status===`aborted`?nT:t.status===`dirty`||n.value===`dirty`?rT(t.value):t}}if(i.type===`refinement`){let e=e=>{let t=i.refinement(e,a);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(r.common.async===!1){let t=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return t.status===`aborted`?nT:(t.status===`dirty`&&n.dirty(),e(t.value),{status:n.value,value:t.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(t=>t.status===`aborted`?nT:(t.status===`dirty`&&n.dirty(),e(t.value).then(()=>({status:n.value,value:t.value}))))}if(i.type===`transform`)if(r.common.async===!1){let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!sT(e))return nT;let t=i.transform(e.value,a);if(t instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:n.value,value:t}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>sT(e)?Promise.resolve(i.transform(e.value,a)).then(e=>({status:n.value,value:e})):nT);qw.assertNever(i)}};mE.create=(e,t,n)=>new mE(H({schema:e,typeName:$.ZodEffects,effect:t},dT(n))),mE.createWithPreprocess=(e,t,n)=>new mE(H({schema:t,effect:{type:`preprocess`,transform:e},typeName:$.ZodEffects},dT(n)));var hE=class extends fT{_parse(e){return this._getType(e)===Y.undefined?iT(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};hE.create=(e,t)=>new hE(H({innerType:e,typeName:$.ZodOptional},dT(t)));var gE=class extends fT{_parse(e){return this._getType(e)===Y.null?iT(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};gE.create=(e,t)=>new gE(H({innerType:e,typeName:$.ZodNullable},dT(t)));var _E=class extends fT{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===Y.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};_E.create=(e,t)=>new _E(H({innerType:e,typeName:$.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default},dT(t)));var vE=class extends fT{_parse(e){let{ctx:t}=this._processInputParams(e),n=H(H({},t),{},{common:H(H({},t.common),{},{issues:[]})}),r=this._def.innerType._parse({data:n.data,path:n.path,parent:H({},n)});return cT(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new Xw(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new Xw(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};vE.create=(e,t)=>new vE(H({innerType:e,typeName:$.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch},dT(t)));var yE=class extends fT{_parse(e){if(this._getType(e)!==Y.nan){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.nan,received:t.parsedType}),nT}return{status:`valid`,value:e.data}}};yE.create=e=>new yE(H({typeName:$.ZodNaN},dT(e)));var bE=class extends fT{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},xE=class e extends fT{_parse(e){var t=this;let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await t._def.in._parseAsync({data:r.data,path:r.path,parent:r});return e.status===`aborted`?nT:e.status===`dirty`?(n.dirty(),rT(e.value)):t._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return e.status===`aborted`?nT:e.status===`dirty`?(n.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(t,n){return new e({in:t,out:n,typeName:$.ZodPipeline})}},SE=class extends fT{_parse(e){let t=this._def.innerType._parse(e),n=e=>(sT(e)&&(e.value=Object.freeze(e.value)),e);return cT(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};SE.create=(e,t)=>new SE(H({innerType:e,typeName:$.ZodReadonly},dT(t))),ZT.lazycreate;var $;(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`})($||($={})),IT.create,RT.create,yE.create,zT.create,BT.create,VT.create,HT.create,UT.create,WT.create,GT.create,KT.create,qT.create,JT.create,YT.create,ZT.create,ZT.strictCreate,QT.create,eE.create,nE.create,rE.create,iE.create,aE.create,oE.create,sE.create,cE.create,lE.create,dE.create,fE.create,pE.create,mE.create,hE.create,gE.create,mE.createWithPreprocess,xE.create;let CE=[`additionalProperties`],wE=[`type`],TE=[`type`];var EE=({prefix:e,size:t=16,alphabet:n=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,separator:r=`-`}={})=>{let i=()=>{let e=n.length,r=Array(t);for(let i=0;i<t;i++)r[i]=n[Math.random()*e|0];return r.join(``)};if(e==null)return i;if(n.includes(r))throw new p_({argument:`separator`,message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${i()}`},DE=EE();function OE(e){if(e==null)return{};let t={};if(e instanceof Headers)e.forEach((e,n)=>{t[n.toLowerCase()]=e});else{Array.isArray(e)||(e=Object.entries(e));for(let[n,r]of e)r!=null&&(t[n.toLowerCase()]=r)}return t}var kE=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,AE=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function jE(e){let t=JSON.parse(e);return typeof t!=`object`||!t||kE.test(e)===!1&&AE.test(e)===!1?t:ME(t)}function ME(e){let t=[e];for(;t.length;){let e=t;t=[];for(let n of e){if(Object.prototype.hasOwnProperty.call(n,`__proto__`)||Object.prototype.hasOwnProperty.call(n,`constructor`)&&n.constructor!==null&&typeof n.constructor==`object`&&Object.prototype.hasOwnProperty.call(n.constructor,`prototype`))throw SyntaxError(`Object contains forbidden prototype property`);for(let e in n){let r=n[e];r&&typeof r==`object`&&t.push(r)}}}return e}function NE(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch(t){return jE(e)}try{return jE(e)}finally{Error.stackTraceLimit=t}}var PE=Symbol.for(`vercel.ai.validator`);function FE(e){return{[PE]:!0,validate:e}}function IE(e){return typeof e==`object`&&!!e&&PE in e&&e[PE]===!0&&`validate`in e}function LE(e){let t;return()=>(t==null&&(t=e()),t)}function RE(e){return IE(e)?e:`~standard`in e?zE(e):e()}function zE(e){return FE(async t=>{let n=await e[`~standard`].validate(t);return n.issues==null?{success:!0,value:n.value}:{success:!1,error:new T_({value:t,cause:n.issues})}})}async function BE({value:e,schema:t}){let n=await VE({value:e,schema:t});if(!n.success)throw T_.wrap({value:e,cause:n.error});return n.value}async function VE({value:e,schema:t}){let n=RE(t);try{if(n.validate==null)return{success:!0,value:e,rawValue:e};let t=await n.validate(e);return t.success?{success:!0,value:t.value,rawValue:e}:{success:!1,error:T_.wrap({value:e,cause:t.error}),rawValue:e}}catch(t){return{success:!1,error:T_.wrap({value:e,cause:t}),rawValue:e}}}async function HE({text:e,schema:t}){try{let n=NE(e);return t==null?{success:!0,value:n,rawValue:n}:await VE({value:n,schema:t})}catch(t){return{success:!1,error:y_.isInstance(t)?t:new y_({text:e,cause:t}),rawValue:void 0}}}function UE({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new j_).pipeThrough(new TransformStream({async transform({data:e},n){e!==`[DONE]`&&n.enqueue(await HE({text:e,schema:t}))}}))}async function WE(e){return typeof e==`function`&&(e=e()),Promise.resolve(e)}new TextDecoder;var GE=Symbol.for(`vercel.ai.schema`);function KE(e,{validate:t}={}){return{[GE]:!0,_type:void 0,[PE]:!0,get jsonSchema(){return typeof e==`function`&&(e=e()),e},validate:t}}function qE(e){if(e.type===`object`){e.additionalProperties=!1;let t=e.properties;if(t!=null)for(let e in t)t[e]=qE(t[e])}return e.type===`array`&&e.items!=null&&(Array.isArray(e.items)?e.items=e.items.map(e=>qE(e)):e.items=qE(e.items)),e}var JE=Symbol(`Let zodToJsonSchema decide on which parser to use`),YE={name:void 0,$refStrategy:`root`,basePath:[`#`],effectStrategy:`input`,pipeStrategy:`all`,dateStrategy:`format:date-time`,mapStrategy:`entries`,removeAdditionalStrategy:`passthrough`,allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:`definitions`,strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:`escape`,applyRegexFlags:!1,emailStrategy:`format:email`,base64Strategy:`contentEncoding:base64`,nameStrategy:`ref`},XE=e=>typeof e==`string`?H(H({},YE),{},{name:e}):H(H({},YE),e);function ZE(){return{}}function QE(e,t){var n,r,i;let a={type:`array`};return(n=e.type)!=null&&n._def&&((i=(r=e.type)==null?void 0:r._def)==null?void 0:i.typeName)!==$.ZodAny&&(a.items=UD(e.type._def,H(H({},t),{},{currentPath:[...t.currentPath,`items`]}))),e.minLength&&(a.minItems=e.minLength.value),e.maxLength&&(a.maxItems=e.maxLength.value),e.exactLength&&(a.minItems=e.exactLength.value,a.maxItems=e.exactLength.value),a}function $E(e){let t={type:`integer`,format:`int64`};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case`min`:n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case`max`:n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case`multipleOf`:t.multipleOf=n.value;break}return t}function eD(){return{type:`boolean`}}function tD(e,t){return UD(e.type._def,t)}var nD=(e,t)=>UD(e.innerType._def,t);function rD(e,t,n){let r=n==null?t.dateStrategy:n;if(Array.isArray(r))return{anyOf:r.map((n,r)=>rD(e,t,n))};switch(r){case`string`:case`format:date-time`:return{type:`string`,format:`date-time`};case`format:date`:return{type:`string`,format:`date`};case`integer`:return iD(e)}}var iD=e=>{let t={type:`integer`,format:`unix-time`};for(let n of e.checks)switch(n.kind){case`min`:t.minimum=n.value;break;case`max`:t.maximum=n.value;break}return t};function aD(e,t){return H(H({},UD(e.innerType._def,t)),{},{default:e.defaultValue()})}function oD(e,t){return t.effectStrategy===`input`?UD(e.schema._def,t):ZE()}function sD(e){return{type:`string`,enum:Array.from(e.values)}}var cD=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function lD(e,t){let n=[UD(e.left._def,H(H({},t),{},{currentPath:[...t.currentPath,`allOf`,`0`]})),UD(e.right._def,H(H({},t),{},{currentPath:[...t.currentPath,`allOf`,`1`]}))].filter(e=>!!e),r=[];return n.forEach(e=>{if(cD(e))r.push(...e.allOf);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n}=e;t=yr(e,CE)}r.push(t)}}),r.length?{allOf:r}:void 0}function uD(e){let t=typeof e.value;return t!==`bigint`&&t!==`number`&&t!==`boolean`&&t!==`string`?{type:Array.isArray(e.value)?`array`:`object`}:{type:t===`bigint`?`integer`:t,const:e.value}}var dD=void 0,fD={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(dD===void 0&&(dD=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),dD),uuid:/^[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}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([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])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function pD(e,t){let n={type:`string`};if(e.checks)for(let r of e.checks)switch(r.kind){case`min`:n.minLength=typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value;break;case`max`:n.maxLength=typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value;break;case`email`:switch(t.emailStrategy){case`format:email`:_D(n,`email`,r.message,t);break;case`format:idn-email`:_D(n,`idn-email`,r.message,t);break;case`pattern:zod`:vD(n,fD.email,r.message,t);break}break;case`url`:_D(n,`uri`,r.message,t);break;case`uuid`:_D(n,`uuid`,r.message,t);break;case`regex`:vD(n,r.regex,r.message,t);break;case`cuid`:vD(n,fD.cuid,r.message,t);break;case`cuid2`:vD(n,fD.cuid2,r.message,t);break;case`startsWith`:vD(n,RegExp(`^${mD(r.value,t)}`),r.message,t);break;case`endsWith`:vD(n,RegExp(`${mD(r.value,t)}$`),r.message,t);break;case`datetime`:_D(n,`date-time`,r.message,t);break;case`date`:_D(n,`date`,r.message,t);break;case`time`:_D(n,`time`,r.message,t);break;case`duration`:_D(n,`duration`,r.message,t);break;case`length`:n.minLength=typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value;break;case`includes`:vD(n,RegExp(mD(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&_D(n,`ipv4`,r.message,t),r.version!==`v4`&&_D(n,`ipv6`,r.message,t);break;case`base64url`:vD(n,fD.base64url,r.message,t);break;case`jwt`:vD(n,fD.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&&vD(n,fD.ipv4Cidr,r.message,t),r.version!==`v4`&&vD(n,fD.ipv6Cidr,r.message,t);break;case`emoji`:vD(n,fD.emoji(),r.message,t);break;case`ulid`:vD(n,fD.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:_D(n,`binary`,r.message,t);break;case`contentEncoding:base64`:n.contentEncoding=`base64`;break;case`pattern:zod`:vD(n,fD.base64,r.message,t);break}break;case`nanoid`:vD(n,fD.nanoid,r.message,t);case`toLowerCase`:case`toUpperCase`:case`trim`:break;default:}return n}function mD(e,t){return t.patternStrategy===`escape`?gD(e):e}var hD=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function gD(e){let t=``;for(let n=0;n<e.length;n++)hD.has(e[n])||(t+=`\\`),t+=e[n];return t}function _D(e,t,n,r){var i;e.format||(i=e.anyOf)!=null&&i.some(e=>e.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push(H({format:t},n&&r.errorMessages&&{errorMessage:{format:n}}))):e.format=t}function vD(e,t,n,r){var i;e.pattern||(i=e.allOf)!=null&&i.some(e=>e.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push(H({pattern:yD(t,r)},n&&r.errorMessages&&{errorMessage:{pattern:n}}))):e.pattern=yD(t,r)}function yD(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes(`i`),m:e.flags.includes(`m`),s:e.flags.includes(`s`)},i=r.i?e.source.toLowerCase():e.source,a=``,o=!1,s=!1,c=!1;for(let e=0;e<i.length;e++){if(o){a+=i[e],o=!1;continue}if(r.i){if(s){if(i[e].match(/[a-z]/)){c?(a+=i[e],a+=`${i[e-2]}-${i[e]}`.toUpperCase(),c=!1):i[e+1]===`-`&&(n=i[e+2])!=null&&n.match(/[a-z]/)?(a+=i[e],c=!0):a+=`${i[e]}${i[e].toUpperCase()}`;continue}}else if(i[e].match(/[a-z]/)){a+=`[${i[e]}${i[e].toUpperCase()}]`;continue}}if(r.m){if(i[e]===`^`){a+=`(^|(?<=[\r
160
+ ]))`;continue}else if(i[e]===`$`){a+=`($|(?=[\r
161
+ ]))`;continue}}if(r.s&&i[e]===`.`){a+=s?`${i[e]}\r
162
+ `:`[${i[e]}\r
163
+ ]`;continue}a+=i[e],i[e]===`\\`?o=!0:s&&i[e]===`]`?s=!1:!s&&i[e]===`[`&&(s=!0)}try{new RegExp(a)}catch(n){return console.warn(`Could not convert regex pattern at ${t.currentPath.join(`/`)} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return a}function bD(e,t){var n,r,i,a,o,s;let c={type:`object`,additionalProperties:(n=UD(e.valueType._def,H(H({},t),{},{currentPath:[...t.currentPath,`additionalProperties`]})))==null?t.allowedAdditionalProperties:n};if(((r=e.keyType)==null?void 0:r._def.typeName)===$.ZodString&&(i=e.keyType._def.checks)!=null&&i.length){let n=pD(e.keyType._def,t),{type:r}=n,i=yr(n,wE);return H(H({},c),{},{propertyNames:i})}else if(((a=e.keyType)==null?void 0:a._def.typeName)===$.ZodEnum)return H(H({},c),{},{propertyNames:{enum:e.keyType._def.values}});else if(((o=e.keyType)==null?void 0:o._def.typeName)===$.ZodBranded&&e.keyType._def.type._def.typeName===$.ZodString&&(s=e.keyType._def.type._def.checks)!=null&&s.length){let n=tD(e.keyType._def,t),{type:r}=n,i=yr(n,TE);return H(H({},c),{},{propertyNames:i})}return c}function xD(e,t){return t.mapStrategy===`record`?bD(e,t):{type:`array`,maxItems:125,items:{type:`array`,items:[UD(e.keyType._def,H(H({},t),{},{currentPath:[...t.currentPath,`items`,`items`,`0`]}))||ZE(),UD(e.valueType._def,H(H({},t),{},{currentPath:[...t.currentPath,`items`,`items`,`1`]}))||ZE()],minItems:2,maxItems:2}}}function SD(e){let t=e.values,n=Object.keys(e.values).filter(e=>typeof t[t[e]]!=`number`).map(e=>t[e]),r=Array.from(new Set(n.map(e=>typeof e)));return{type:r.length===1?r[0]===`string`?`string`:`number`:[`string`,`number`],enum:n}}function CD(){return{not:ZE()}}function wD(){return{type:`null`}}var TD={ZodString:`string`,ZodNumber:`number`,ZodBigInt:`integer`,ZodBoolean:`boolean`,ZodNull:`null`};function ED(e,t){let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in TD&&(!e._def.checks||!e._def.checks.length))){let e=n.reduce((e,t)=>{let n=TD[t._def.typeName];return n&&!e.includes(n)?[...e,n]:e},[]);return{type:e.length>1?e:e[0]}}else if(n.every(e=>e._def.typeName===`ZodLiteral`&&!e.description)){let e=n.reduce((e,t)=>{let n=typeof t._def.value;switch(n){case`string`:case`number`:case`boolean`:return[...e,n];case`bigint`:return[...e,`integer`];case`object`:if(t._def.value===null)return[...e,`null`];default:return e}},[]);if(e.length===n.length){let t=e.filter((e,t,n)=>n.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:n.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(n.every(e=>e._def.typeName===`ZodEnum`))return{type:`string`,enum:n.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return DD(e,t)}var DD=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>UD(e._def,H(H({},t),{},{currentPath:[...t.currentPath,`anyOf`,`${n}`]}))).filter(e=>!!e&&(!t.strictUnions||typeof e==`object`&&Object.keys(e).length>0));return n.length?{anyOf:n}:void 0};function OD(e,t){if([`ZodString`,`ZodNumber`,`ZodBigInt`,`ZodBoolean`,`ZodNull`].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[TD[e.innerType._def.typeName],`null`]};let n=UD(e.innerType._def,H(H({},t),{},{currentPath:[...t.currentPath,`anyOf`,`0`]}));return n&&{anyOf:[n,{type:`null`}]}}function kD(e){let t={type:`number`};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case`int`:t.type=`integer`;break;case`min`:n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case`max`:n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case`multipleOf`:t.multipleOf=n.value;break}return t}function AD(e,t){let n={type:`object`,properties:{}},r=[],i=e.shape();for(let e in i){let a=i[e];if(a===void 0||a._def===void 0)continue;let o=MD(a),s=UD(a._def,H(H({},t),{},{currentPath:[...t.currentPath,`properties`,e],propertyPath:[...t.currentPath,`properties`,e]}));s!==void 0&&(n.properties[e]=s,o||r.push(e))}r.length&&(n.required=r);let a=jD(e,t);return a!==void 0&&(n.additionalProperties=a),n}function jD(e,t){if(e.catchall._def.typeName!==`ZodNever`)return UD(e.catchall._def,H(H({},t),{},{currentPath:[...t.currentPath,`additionalProperties`]}));switch(e.unknownKeys){case`passthrough`:return t.allowedAdditionalProperties;case`strict`:return t.rejectedAdditionalProperties;case`strip`:return t.removeAdditionalStrategy===`strict`?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function MD(e){try{return e.isOptional()}catch(e){return!0}}var ND=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return UD(e.innerType._def,t);let r=UD(e.innerType._def,H(H({},t),{},{currentPath:[...t.currentPath,`anyOf`,`1`]}));return r?{anyOf:[{not:ZE()},r]}:ZE()},PD=(e,t)=>{if(t.pipeStrategy===`input`)return UD(e.in._def,t);if(t.pipeStrategy===`output`)return UD(e.out._def,t);let n=UD(e.in._def,H(H({},t),{},{currentPath:[...t.currentPath,`allOf`,`0`]}));return{allOf:[n,UD(e.out._def,H(H({},t),{},{currentPath:[...t.currentPath,`allOf`,n?`1`:`0`]}))].filter(e=>e!==void 0)}};function FD(e,t){return UD(e.type._def,t)}function ID(e,t){let n={type:`array`,uniqueItems:!0,items:UD(e.valueType._def,H(H({},t),{},{currentPath:[...t.currentPath,`items`]}))};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}function LD(e,t){return e.rest?{type:`array`,minItems:e.items.length,items:e.items.map((e,n)=>UD(e._def,H(H({},t),{},{currentPath:[...t.currentPath,`items`,`${n}`]}))).reduce((e,t)=>t===void 0?e:[...e,t],[]),additionalItems:UD(e.rest._def,H(H({},t),{},{currentPath:[...t.currentPath,`additionalItems`]}))}:{type:`array`,minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,n)=>UD(e._def,H(H({},t),{},{currentPath:[...t.currentPath,`items`,`${n}`]}))).reduce((e,t)=>t===void 0?e:[...e,t],[])}}function RD(){return{not:ZE()}}function zD(){return ZE()}var BD=(e,t)=>UD(e.innerType._def,t),VD=(e,t,n)=>{switch(t){case $.ZodString:return pD(e,n);case $.ZodNumber:return kD(e);case $.ZodObject:return AD(e,n);case $.ZodBigInt:return $E(e);case $.ZodBoolean:return eD();case $.ZodDate:return rD(e,n);case $.ZodUndefined:return RD();case $.ZodNull:return wD();case $.ZodArray:return QE(e,n);case $.ZodUnion:case $.ZodDiscriminatedUnion:return ED(e,n);case $.ZodIntersection:return lD(e,n);case $.ZodTuple:return LD(e,n);case $.ZodRecord:return bD(e,n);case $.ZodLiteral:return uD(e);case $.ZodEnum:return sD(e);case $.ZodNativeEnum:return SD(e);case $.ZodNullable:return OD(e,n);case $.ZodOptional:return ND(e,n);case $.ZodMap:return xD(e,n);case $.ZodSet:return ID(e,n);case $.ZodLazy:return()=>e.getter()._def;case $.ZodPromise:return FD(e,n);case $.ZodNaN:case $.ZodNever:return CD();case $.ZodEffects:return oD(e,n);case $.ZodAny:return ZE();case $.ZodUnknown:return zD();case $.ZodDefault:return aD(e,n);case $.ZodBranded:return tD(e,n);case $.ZodReadonly:return BD(e,n);case $.ZodCatch:return nD(e,n);case $.ZodPipeline:return PD(e,n);case $.ZodFunction:case $.ZodVoid:case $.ZodSymbol:return;default:return(e=>void 0)(t)}},HD=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join(`/`)};function UD(e,t,n=!1){var r;let i=t.seen.get(e);if(t.override){let a=(r=t.override)==null?void 0:r.call(t,e,t,i,n);if(a!==JE)return a}if(i&&!n){let e=WD(i,t);if(e!==void 0)return e}let a={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,a);let o=VD(e,e.typeName,t),s=typeof o==`function`?UD(o(),t):o;if(s&&GD(e,t,s),t.postProcess){let n=t.postProcess(s,e,t);return a.jsonSchema=s,n}return a.jsonSchema=s,s}var WD=(e,t)=>{switch(t.$refStrategy){case`root`:return{$ref:e.path.join(`/`)};case`relative`:return{$ref:HD(t.currentPath,e.path)};case`none`:case`seen`:return e.path.length<t.currentPath.length&&e.path.every((e,n)=>t.currentPath[n]===e)?(console.warn(`Recursive reference detected at ${t.currentPath.join(`/`)}! Defaulting to any`),ZE()):t.$refStrategy===`seen`?ZE():void 0}},GD=(e,t,n)=>(e.description&&(n.description=e.description),n),KD=e=>{let t=XE(e),n=t.name===void 0?t.basePath:[...t.basePath,t.definitionPath,t.name];return H(H({},t),{},{currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))})},qD=(e,t)=>{var n;let r=KD(t),i=typeof t==`object`&&t.definitions?Object.entries(t.definitions).reduce((e,[t,n])=>{var i;return H(H({},e),{},{[t]:(i=UD(n._def,H(H({},r),{},{currentPath:[...r.basePath,r.definitionPath,t]}),!0))==null?ZE():i})},{}):void 0,a=typeof t==`string`?t:(t==null?void 0:t.nameStrategy)===`title`||t==null?void 0:t.name,o=(n=UD(e._def,a===void 0?r:H(H({},r),{},{currentPath:[...r.basePath,r.definitionPath,a]}),!1))==null?ZE():n,s=typeof t==`object`&&t.name!==void 0&&t.nameStrategy===`title`?t.name:void 0;s!==void 0&&(o.title=s);let c=a===void 0?i?H(H({},o),{},{[r.definitionPath]:i}):o:{$ref:[...r.$refStrategy===`relative`?[]:r.basePath,r.definitionPath,a].join(`/`),[r.definitionPath]:H(H({},i),{},{[a]:o})};return c.$schema=`http://json-schema.org/draft-07/schema#`,c};function JD(e,t){var n;let r=(n=t==null?void 0:t.useReferences)!=null&&n;return KE(()=>qD(e,{$refStrategy:r?`root`:`none`}),{validate:async t=>{let n=await e.safeParseAsync(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function YD(e,t){var n;let r=(n=t==null?void 0:t.useReferences)!=null&&n;return KE(()=>qE(QS(e,{target:`draft-7`,io:`input`,reused:r?`ref`:`inline`})),{validate:async t=>{let n=await dC(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function XD(e){return`_zod`in e}function ZD(e,t){return XD(e)?YD(e,t):JD(e,t)}function QD(e){return typeof e==`object`&&!!e&&GE in e&&e[GE]===!0&&`jsonSchema`in e&&`validate`in e}function $D(e){return e==null?KE({properties:{},additionalProperties:!1}):QD(e)?e:typeof e==`function`?e():ZD(e)}var{btoa:eO,atob:tO}=globalThis;let nO=[`abortSignal`],rO=[`messageId`];var iO=Object.defineProperty,aO=(e,t)=>{for(var n in t)iO(e,n,{get:t[n],enumerable:!0})},oO=`AI_NoObjectGeneratedError`,sO=`vercel.ai.error.${oO}`,cO=Symbol.for(sO),lO,uO=class extends o_{constructor({message:e=`No object generated.`,cause:t,text:n,response:r,usage:i,finishReason:a}){super({name:oO,message:e,cause:t}),this[lO]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=a}static isInstance(e){return o_.hasMarker(e,sO)}};lO=cO;var dO=lw([J(),Kw(Uint8Array),Kw(ArrayBuffer),Uw(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null&&n},{message:`Must be a Buffer`})]),fO=Vw(()=>lw([QC(),J(),KC(),XC(),hw(J(),fO),iw(fO)])),pO=hw(J(),hw(J(),fO)),mO=ow({type:yw(`text`),text:J(),providerOptions:pO.optional()}),hO=ow({type:yw(`image`),image:lw([dO,Kw(URL)]),mediaType:J().optional(),providerOptions:pO.optional()}),gO=ow({type:yw(`file`),data:lw([dO,Kw(URL)]),filename:J().optional(),mediaType:J(),providerOptions:pO.optional()}),_O=ow({type:yw(`reasoning`),text:J(),providerOptions:pO.optional()}),vO=ow({type:yw(`tool-call`),toolCallId:J(),toolName:J(),input:ew(),providerOptions:pO.optional(),providerExecuted:XC().optional()}),yO=dw(`type`,[ow({type:yw(`text`),value:J()}),ow({type:yw(`json`),value:fO}),ow({type:yw(`error-text`),value:J()}),ow({type:yw(`error-json`),value:fO}),ow({type:yw(`content`),value:iw(lw([ow({type:yw(`text`),text:J()}),ow({type:yw(`media`),data:J(),mediaType:J()})]))})]),bO=ow({type:yw(`tool-result`),toolCallId:J(),toolName:J(),output:yO,providerOptions:pO.optional()});lw([ow({role:yw(`system`),content:J(),providerOptions:pO.optional()}),ow({role:yw(`user`),content:lw([J(),iw(lw([mO,hO,gO]))]),providerOptions:pO.optional()}),ow({role:yw(`assistant`),content:lw([J(),iw(lw([mO,gO,_O,vO,bO]))]),providerOptions:pO.optional()}),ow({role:yw(`tool`),content:iw(bO),providerOptions:pO.optional()})]),EE({prefix:`aitxt`,size:24}),TransformStream;var xO=LE(()=>ZD(lw([sw({type:yw(`text-start`),id:J(),providerMetadata:pO.optional()}),sw({type:yw(`text-delta`),id:J(),delta:J(),providerMetadata:pO.optional()}),sw({type:yw(`text-end`),id:J(),providerMetadata:pO.optional()}),sw({type:yw(`error`),errorText:J()}),sw({type:yw(`tool-input-start`),toolCallId:J(),toolName:J(),providerExecuted:XC().optional(),dynamic:XC().optional()}),sw({type:yw(`tool-input-delta`),toolCallId:J(),inputTextDelta:J()}),sw({type:yw(`tool-input-available`),toolCallId:J(),toolName:J(),input:ew(),providerExecuted:XC().optional(),providerMetadata:pO.optional(),dynamic:XC().optional()}),sw({type:yw(`tool-input-error`),toolCallId:J(),toolName:J(),input:ew(),providerExecuted:XC().optional(),providerMetadata:pO.optional(),dynamic:XC().optional(),errorText:J()}),sw({type:yw(`tool-output-available`),toolCallId:J(),output:ew(),providerExecuted:XC().optional(),dynamic:XC().optional(),preliminary:XC().optional()}),sw({type:yw(`tool-output-error`),toolCallId:J(),errorText:J(),providerExecuted:XC().optional(),dynamic:XC().optional()}),sw({type:yw(`reasoning-start`),id:J(),providerMetadata:pO.optional()}),sw({type:yw(`reasoning-delta`),id:J(),delta:J(),providerMetadata:pO.optional()}),sw({type:yw(`reasoning-end`),id:J(),providerMetadata:pO.optional()}),sw({type:yw(`source-url`),sourceId:J(),url:J(),title:J().optional(),providerMetadata:pO.optional()}),sw({type:yw(`source-document`),sourceId:J(),mediaType:J(),title:J(),filename:J().optional(),providerMetadata:pO.optional()}),sw({type:yw(`file`),url:J(),mediaType:J(),providerMetadata:pO.optional()}),sw({type:Uw(e=>typeof e==`string`&&e.startsWith(`data-`),{message:`Type must start with "data-"`}),id:J().optional(),data:ew(),transient:XC().optional()}),sw({type:yw(`start-step`)}),sw({type:yw(`finish-step`)}),sw({type:yw(`start`),messageId:J().optional(),messageMetadata:ew().optional()}),sw({type:yw(`finish`),finishReason:_w([`stop`,`length`,`content-filter`,`tool-calls`,`error`,`other`,`unknown`]).optional(),messageMetadata:ew().optional()}),sw({type:yw(`abort`)}),sw({type:yw(`message-metadata`),messageMetadata:ew()})])));function SO(e){return e.type.startsWith(`data-`)}function CO(){return Object.create(null)}function wO(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;let n=H({},e);for(let r in t)if(!(r===`__proto__`||r===`constructor`||r===`prototype`)&&Object.prototype.hasOwnProperty.call(t,r)){let i=t[r];if(i===void 0)continue;let a=r in e?e[r]:void 0,o=typeof i==`object`&&!!i&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),s=typeof a==`object`&&!!a&&!Array.isArray(a)&&!(a instanceof Date)&&!(a instanceof RegExp);o&&s?n[r]=wO(a,i):n[r]=i}return n}function TO(e){let t=[`ROOT`],n=-1,r=null;function i(e,i,a){switch(e){case`"`:n=i,t.pop(),t.push(a),t.push(`INSIDE_STRING`);break;case`f`:case`t`:case`n`:n=i,r=i,t.pop(),t.push(a),t.push(`INSIDE_LITERAL`);break;case`-`:t.pop(),t.push(a),t.push(`INSIDE_NUMBER`);break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=i,t.pop(),t.push(a),t.push(`INSIDE_NUMBER`);break;case`{`:n=i,t.pop(),t.push(a),t.push(`INSIDE_OBJECT_START`);break;case`[`:n=i,t.pop(),t.push(a),t.push(`INSIDE_ARRAY_START`);break}}function a(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_COMMA`);break;case`}`:n=r,t.pop();break}}function o(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=r,t.pop();break}}for(let s=0;s<e.length;s++){let c=e[s];switch(t[t.length-1]){case`ROOT`:i(c,s,`FINISH`);break;case`INSIDE_OBJECT_START`:switch(c){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`);break;case`}`:n=s,t.pop();break}break;case`INSIDE_OBJECT_AFTER_COMMA`:switch(c){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`);break}break;case`INSIDE_OBJECT_KEY`:switch(c){case`"`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_KEY`);break}break;case`INSIDE_OBJECT_AFTER_KEY`:switch(c){case`:`:t.pop(),t.push(`INSIDE_OBJECT_BEFORE_VALUE`);break}break;case`INSIDE_OBJECT_BEFORE_VALUE`:i(c,s,`INSIDE_OBJECT_AFTER_VALUE`);break;case`INSIDE_OBJECT_AFTER_VALUE`:a(c,s);break;case`INSIDE_STRING`:switch(c){case`"`:t.pop(),n=s;break;case`\\`:t.push(`INSIDE_STRING_ESCAPE`);break;default:n=s}break;case`INSIDE_ARRAY_START`:switch(c){case`]`:n=s,t.pop();break;default:n=s,i(c,s,`INSIDE_ARRAY_AFTER_VALUE`);break}break;case`INSIDE_ARRAY_AFTER_VALUE`:switch(c){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=s,t.pop();break;default:n=s;break}break;case`INSIDE_ARRAY_AFTER_COMMA`:i(c,s,`INSIDE_ARRAY_AFTER_VALUE`);break;case`INSIDE_STRING_ESCAPE`:t.pop(),n=s;break;case`INSIDE_NUMBER`:switch(c){case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=s;break;case`e`:case`E`:case`-`:case`.`:break;case`,`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&o(c,s),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&a(c,s);break;case`}`:t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&a(c,s);break;case`]`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&o(c,s);break;default:t.pop();break}break;case`INSIDE_LITERAL`:{let i=e.substring(r,s+1);!`false`.startsWith(i)&&!`true`.startsWith(i)&&!`null`.startsWith(i)?(t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`?a(c,s):t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&o(c,s)):n=s;break}}}let s=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--)switch(t[n]){case`INSIDE_STRING`:s+=`"`;break;case`INSIDE_OBJECT_KEY`:case`INSIDE_OBJECT_AFTER_KEY`:case`INSIDE_OBJECT_AFTER_COMMA`:case`INSIDE_OBJECT_START`:case`INSIDE_OBJECT_BEFORE_VALUE`:case`INSIDE_OBJECT_AFTER_VALUE`:s+=`}`;break;case`INSIDE_ARRAY_START`:case`INSIDE_ARRAY_AFTER_COMMA`:case`INSIDE_ARRAY_AFTER_VALUE`:s+=`]`;break;case`INSIDE_LITERAL`:{let t=e.substring(r,e.length);`true`.startsWith(t)?s+=`true`.slice(t.length):`false`.startsWith(t)?s+=`false`.slice(t.length):`null`.startsWith(t)&&(s+=`null`.slice(t.length))}}return s}async function EO(e){if(e===void 0)return{value:void 0,state:`undefined-input`};let t=await HE({text:e});return t.success?{value:t.value,state:`successful-parse`}:(t=await HE({text:TO(e)}),t.success?{value:t.value,state:`repaired-parse`}:{value:void 0,state:`failed-parse`})}function DO(e){return e.type.startsWith(`tool-`)}function OO(e){return e.type===`dynamic-tool`}function kO(e){return DO(e)||OO(e)}function AO(e){return e.type.split(`-`).slice(1).join(`-`)}function jO({lastMessage:e,messageId:t}){return{message:(e==null?void 0:e.role)===`assistant`?e:{id:t,metadata:void 0,role:`assistant`,parts:[]},activeTextParts:CO(),activeReasoningParts:CO(),partialToolCalls:CO()}}function MO({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:a,onData:o}){return e.pipeThrough(new TransformStream({async transform(e,s){await r(async({state:r,write:c})=>{var l,u,d,f;function p(e){let t=r.message.parts.filter(DO).find(t=>t.toolCallId===e);if(t==null)throw Error(`tool-output-error must be preceded by a tool-input-available`);return t}function m(e){let t=r.message.parts.filter(e=>e.type===`dynamic-tool`).find(t=>t.toolCallId===e);if(t==null)throw Error(`tool-output-error must be preceded by a tool-input-available`);return t}function h(e){var t;let n=r.message.parts.find(t=>DO(t)&&t.toolCallId===e.toolCallId),i=e,a=n;n==null?r.message.parts.push(H({type:`tool-${e.toolName}`,toolCallId:e.toolCallId,state:e.state,input:i.input,output:i.output,rawInput:i.rawInput,errorText:i.errorText,providerExecuted:i.providerExecuted,preliminary:i.preliminary},i.providerMetadata==null?{}:{callProviderMetadata:i.providerMetadata})):(n.state=e.state,a.input=i.input,a.output=i.output,a.errorText=i.errorText,a.rawInput=i.rawInput,a.preliminary=i.preliminary,a.providerExecuted=(t=i.providerExecuted)==null?n.providerExecuted:t,i.providerMetadata!=null&&n.state===`input-available`&&(n.callProviderMetadata=i.providerMetadata))}function g(e){var t,n;let i=r.message.parts.find(t=>t.type===`dynamic-tool`&&t.toolCallId===e.toolCallId),a=e,o=i;i==null?r.message.parts.push(H({type:`dynamic-tool`,toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:a.input,output:a.output,errorText:a.errorText,preliminary:a.preliminary,providerExecuted:a.providerExecuted},a.providerMetadata==null?{}:{callProviderMetadata:a.providerMetadata})):(i.state=e.state,o.toolName=e.toolName,o.input=a.input,o.output=a.output,o.errorText=a.errorText,o.rawInput=(t=a.rawInput)==null?o.rawInput:t,o.preliminary=a.preliminary,o.providerExecuted=(n=a.providerExecuted)==null?i.providerExecuted:n,a.providerMetadata!=null&&i.state===`input-available`&&(i.callProviderMetadata=a.providerMetadata))}async function _(e){if(e!=null){let n=r.message.metadata==null?e:wO(r.message.metadata,e);t!=null&&await BE({value:n,schema:t}),r.message.metadata=n}}switch(e.type){case`text-start`:{let t={type:`text`,text:``,providerMetadata:e.providerMetadata,state:`streaming`};r.activeTextParts[e.id]=t,r.message.parts.push(t),c();break}case`text-delta`:{let t=r.activeTextParts[e.id];t.text+=e.delta,t.providerMetadata=(l=e.providerMetadata)==null?t.providerMetadata:l,c();break}case`text-end`:{let t=r.activeTextParts[e.id];t.state=`done`,t.providerMetadata=(u=e.providerMetadata)==null?t.providerMetadata:u,delete r.activeTextParts[e.id],c();break}case`reasoning-start`:{let t={type:`reasoning`,text:``,providerMetadata:e.providerMetadata,state:`streaming`};r.activeReasoningParts[e.id]=t,r.message.parts.push(t),c();break}case`reasoning-delta`:{let t=r.activeReasoningParts[e.id];t.text+=e.delta,t.providerMetadata=(d=e.providerMetadata)==null?t.providerMetadata:d,c();break}case`reasoning-end`:{let t=r.activeReasoningParts[e.id];t.providerMetadata=(f=e.providerMetadata)==null?t.providerMetadata:f,t.state=`done`,delete r.activeReasoningParts[e.id],c();break}case`file`:r.message.parts.push({type:`file`,mediaType:e.mediaType,url:e.url}),c();break;case`source-url`:r.message.parts.push({type:`source-url`,sourceId:e.sourceId,url:e.url,title:e.title,providerMetadata:e.providerMetadata}),c();break;case`source-document`:r.message.parts.push({type:`source-document`,sourceId:e.sourceId,mediaType:e.mediaType,title:e.title,filename:e.filename,providerMetadata:e.providerMetadata}),c();break;case`tool-input-start`:{let t=r.message.parts.filter(DO);r.partialToolCalls[e.toolCallId]={text:``,toolName:e.toolName,index:t.length,dynamic:e.dynamic},e.dynamic?g({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-streaming`,input:void 0,providerExecuted:e.providerExecuted}):h({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-streaming`,input:void 0,providerExecuted:e.providerExecuted}),c();break}case`tool-input-delta`:{let t=r.partialToolCalls[e.toolCallId];t.text+=e.inputTextDelta;let{value:n}=await EO(t.text);t.dynamic?g({toolCallId:e.toolCallId,toolName:t.toolName,state:`input-streaming`,input:n}):h({toolCallId:e.toolCallId,toolName:t.toolName,state:`input-streaming`,input:n}),c();break}case`tool-input-available`:e.dynamic?g({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-available`,input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}):h({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-available`,input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),c(),a&&!e.providerExecuted&&await a({toolCall:e});break;case`tool-input-error`:e.dynamic?g({toolCallId:e.toolCallId,toolName:e.toolName,state:`output-error`,input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}):h({toolCallId:e.toolCallId,toolName:e.toolName,state:`output-error`,input:void 0,rawInput:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),c();break;case`tool-output-available`:if(e.dynamic){let t=m(e.toolCallId);g({toolCallId:e.toolCallId,toolName:t.toolName,state:`output-available`,input:t.input,output:e.output,preliminary:e.preliminary})}else{let t=p(e.toolCallId);h({toolCallId:e.toolCallId,toolName:AO(t),state:`output-available`,input:t.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary})}c();break;case`tool-output-error`:if(e.dynamic){let t=m(e.toolCallId);g({toolCallId:e.toolCallId,toolName:t.toolName,state:`output-error`,input:t.input,errorText:e.errorText,providerExecuted:e.providerExecuted})}else{let t=p(e.toolCallId);h({toolCallId:e.toolCallId,toolName:AO(t),state:`output-error`,input:t.input,rawInput:t.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted})}c();break;case`start-step`:r.message.parts.push({type:`step-start`});break;case`finish-step`:r.activeTextParts=CO(),r.activeReasoningParts=CO();break;case`start`:e.messageId!=null&&(r.message.id=e.messageId),await _(e.messageMetadata),(e.messageId!=null||e.messageMetadata!=null)&&c();break;case`finish`:e.finishReason!=null&&(r.finishReason=e.finishReason),await _(e.messageMetadata),e.messageMetadata!=null&&c();break;case`message-metadata`:await _(e.messageMetadata),e.messageMetadata!=null&&c();break;case`error`:i==null||i(Error(e.errorText));break;default:if(SO(e)){(n==null?void 0:n[e.type])!=null&&await BE({value:e.data,schema:n[e.type]});let t=e;if(t.transient){o==null||o(t);break}let i=t.id==null?void 0:r.message.parts.find(e=>t.type===e.type&&t.id===e.id);i==null?r.message.parts.push(t):i.data=t.data,o==null||o(t),c()}}s.enqueue(e)})}}))}async function NO({stream:e,onError:t}){let n=e.getReader();try{for(;;){let{done:e}=await n.read();if(e)break}}catch(e){t==null||t(e)}finally{n.releaseLock()}}EE({prefix:`aitxt`,size:24}),EE({prefix:`aiobj`,size:24});var PO=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){var e=this;if(!e.isProcessing){for(e.isProcessing=!0;e.queue.length>0;)await e.queue[0](),e.queue.shift();e.isProcessing=!1}}async run(e){var t=this;return new Promise((n,r)=>{t.queue.push(async()=>{try{await e(),n()}catch(e){r(e)}}),t.processQueue()})}};EE({prefix:`aiobj`,size:24}),aO({},{object:()=>IO,text:()=>FO});var FO=()=>({type:`text`,responseFormat:{type:`text`},async parsePartial({text:e}){return{partial:e}},async parseOutput({text:e}){return e}}),IO=({schema:e})=>{let t=$D(e);return{type:`object`,responseFormat:{type:`json`,schema:t.jsonSchema},async parsePartial({text:e}){let t=await EO(e);switch(t.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:return{partial:t.value};default:{let e=t.state;throw Error(`Unsupported parse state: ${e}`)}}},async parseOutput({text:e},n){let r=await HE({text:e});if(!r.success)throw new uO({message:`No object generated: could not parse the response.`,cause:r.error,text:e,response:n.response,usage:n.usage,finishReason:n.finishReason});let i=await VE({value:r.value,schema:t});if(!i.success)throw new uO({message:`No object generated: response did not match schema.`,cause:i.error,text:e,response:n.response,usage:n.usage,finishReason:n.finishReason});return i.value}}};async function LO(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw Error(`FileList is not supported in the current environment`);return Promise.all(Array.from(e).map(async e=>{let{name:t,type:n}=e;return{type:`file`,mediaType:n,filename:t,url:await new Promise((t,n)=>{let r=new FileReader;r.onload=e=>{var n;t((n=e.target)==null?void 0:n.result)},r.onerror=e=>n(e),r.readAsDataURL(e)})}}))}var RO=class{constructor({api:e=`/api/chat`,credentials:t,headers:n,body:r,fetch:i,prepareSendMessagesRequest:a,prepareReconnectToStreamRequest:o}){this.api=e,this.credentials=t,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=a,this.prepareReconnectToStreamRequest=o}async sendMessages(e){var t=this;let{abortSignal:n}=e,r=yr(e,nO);var i,a,o,s,c;let l=await WE(t.body),u=await WE(t.headers),d=await WE(t.credentials),f=H(H({},OE(u)),OE(r.headers)),p=await((i=t.prepareSendMessagesRequest)==null?void 0:i.call(t,{api:t.api,id:r.chatId,messages:r.messages,body:H(H({},l),r.body),headers:f,credentials:d,requestMetadata:r.metadata,trigger:r.trigger,messageId:r.messageId})),m=(a=p==null?void 0:p.api)==null?t.api:a,h=(p==null?void 0:p.headers)===void 0?f:OE(p.headers),g=(p==null?void 0:p.body)===void 0?H(H(H({},l),r.body),{},{id:r.chatId,messages:r.messages,trigger:r.trigger,messageId:r.messageId}):p.body,_=(o=p==null?void 0:p.credentials)==null?d:o,v=await((s=t.fetch)==null?globalThis.fetch:s)(m,{method:`POST`,headers:H({"Content-Type":`application/json`},h),body:JSON.stringify(g),credentials:_,signal:n});if(!v.ok)throw Error((c=await v.text())==null?`Failed to fetch the chat response.`:c);if(!v.body)throw Error(`The response body is empty.`);return t.processResponseStream(v.body)}async reconnectToStream(e){var t=this,n,r,i,a,o;let s=await WE(t.body),c=await WE(t.headers),l=await WE(t.credentials),u=H(H({},OE(c)),OE(e.headers)),d=await((n=t.prepareReconnectToStreamRequest)==null?void 0:n.call(t,{api:t.api,id:e.chatId,body:H(H({},s),e.body),headers:u,credentials:l,requestMetadata:e.metadata})),f=(r=d==null?void 0:d.api)==null?`${t.api}/${e.chatId}/stream`:r,p=(d==null?void 0:d.headers)===void 0?u:OE(d.headers),m=(i=d==null?void 0:d.credentials)==null?l:i,h=await((a=t.fetch)==null?globalThis.fetch:a)(f,{method:`GET`,headers:p,credentials:m});if(h.status===204)return null;if(!h.ok)throw Error((o=await h.text())==null?`Failed to fetch the chat response.`:o);if(!h.body)throw Error(`The response body is empty.`);return t.processResponseStream(h.body)}},zO=class extends RO{constructor(e={}){super(e)}processResponseStream(e){return UE({stream:e,schema:xO}).pipeThrough(new TransformStream({async transform(e,t){if(!e.success)throw e.error;t.enqueue(e.value)}}))}},BO=class{constructor({generateId:e=DE,id:t=e(),transport:n=new zO,messageMetadataSchema:r,dataPartSchemas:i,state:a,onError:o,onToolCall:s,onFinish:c,onData:l,sendAutomaticallyWhen:u}){var d=this;this.activeResponse=void 0,this.jobExecutor=new PO,this.sendMessage=async(e,t)=>{var n,r,i,a;if(e==null){await d.makeRequest(H({trigger:`submit-message`,messageId:(n=d.lastMessage)==null?void 0:n.id},t));return}let o;if(o=`text`in e||`files`in e?{parts:[...Array.isArray(e.files)?e.files:await LO(e.files),...`text`in e&&e.text!=null?[{type:`text`,text:e.text}]:[]]}:e,e.messageId!=null){let t=d.state.messages.findIndex(t=>t.id===e.messageId);if(t===-1)throw Error(`message with id ${e.messageId} not found`);if(d.state.messages[t].role!==`user`)throw Error(`message with id ${e.messageId} is not a user message`);d.state.messages=d.state.messages.slice(0,t+1),d.state.replaceMessage(t,H(H({},o),{},{id:e.messageId,role:(r=o.role)==null?`user`:r,metadata:e.metadata}))}else d.state.pushMessage(H(H({},o),{},{id:(i=o.id)==null?d.generateId():i,role:(a=o.role)==null?`user`:a,metadata:e.metadata}));await d.makeRequest(H({trigger:`submit-message`,messageId:e.messageId},t))},this.regenerate=async(e={})=>{let{messageId:t}=e,n=yr(e,rO),r=t==null?d.state.messages.length-1:d.state.messages.findIndex(e=>e.id===t);if(r===-1)throw Error(`message ${t} not found`);d.state.messages=d.state.messages.slice(0,d.messages[r].role===`assistant`?r:r+1),await d.makeRequest(H({trigger:`regenerate-message`,messageId:t},n))},this.resumeStream=async(e={})=>{await d.makeRequest(H({trigger:`resume-stream`},e))},this.clearError=()=>{this.status===`error`&&(this.state.error=void 0,this.setStatus({status:`ready`}))},this.addToolOutput=async({state:e=`output-available`,tool:t,toolCallId:n,output:r,errorText:i})=>d.jobExecutor.run(async()=>{var t,a;let o=d.state.messages,s=o[o.length-1];d.state.replaceMessage(o.length-1,H(H({},s),{},{parts:s.parts.map(t=>kO(t)&&t.toolCallId===n?H(H({},t),{},{state:e,output:r,errorText:i}):t)})),d.activeResponse&&(d.activeResponse.state.message.parts=d.activeResponse.state.message.parts.map(t=>kO(t)&&t.toolCallId===n?H(H({},t),{},{state:e,output:r,errorText:i}):t)),d.status!==`streaming`&&d.status!==`submitted`&&(t=d.sendAutomaticallyWhen)!=null&&t.call(d,{messages:d.state.messages})&&d.makeRequest({trigger:`submit-message`,messageId:(a=d.lastMessage)==null?void 0:a.id})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var e;d.status!==`streaming`&&d.status!==`submitted`||(e=d.activeResponse)!=null&&e.abortController&&d.activeResponse.abortController.abort()},this.id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=a,this.onError=o,this.onToolCall=s,this.onFinish=c,this.onData=l,this.sendAutomaticallyWhen=u}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async makeRequest({trigger:e,metadata:t,headers:n,body:r,messageId:i}){var a=this,o,s,c,l;a.setStatus({status:`submitted`,error:void 0});let u=a.lastMessage,d=!1,f=!1,p=!1;try{let o={state:jO({lastMessage:a.state.snapshot(u),messageId:a.generateId()}),abortController:new AbortController};o.abortController.signal.addEventListener(`abort`,()=>{d=!0}),a.activeResponse=o;let s;if(e===`resume-stream`){let e=await a.transport.reconnectToStream({chatId:a.id,metadata:t,headers:n,body:r});if(e==null){a.setStatus({status:`ready`});return}s=e}else s=await a.transport.sendMessages({chatId:a.id,messages:a.state.messages,abortSignal:o.abortController.signal,metadata:t,headers:n,body:r,trigger:e,messageId:i});await NO({stream:MO({stream:s,onToolCall:a.onToolCall,onData:a.onData,messageMetadataSchema:a.messageMetadataSchema,dataPartSchemas:a.dataPartSchemas,runUpdateMessageJob:e=>a.jobExecutor.run(()=>e({state:o.state,write:()=>{var e;a.setStatus({status:`streaming`}),o.state.message.id===((e=a.lastMessage)==null?void 0:e.id)?a.state.replaceMessage(a.state.messages.length-1,o.state.message):a.state.pushMessage(o.state.message)}})),onError:e=>{throw e}}),onError:e=>{throw e}}),a.setStatus({status:`ready`})}catch(e){if(d||e.name===`AbortError`)return d=!0,a.setStatus({status:`ready`}),null;p=!0,e instanceof TypeError&&(e.message.toLowerCase().includes(`fetch`)||e.message.toLowerCase().includes(`network`))&&(f=!0),a.onError&&e instanceof Error&&a.onError(e),a.setStatus({status:`error`,error:e})}finally{try{(s=a.onFinish)==null||s.call(a,{message:a.activeResponse.state.message,messages:a.state.messages,isAbort:d,isDisconnect:f,isError:p,finishReason:(o=a.activeResponse)==null?void 0:o.state.finishReason})}catch(e){console.error(e)}a.activeResponse=void 0}(c=a.sendAutomaticallyWhen)!=null&&c.call(a,{messages:a.state.messages})&&!p&&await a.makeRequest({trigger:`submit-message`,messageId:(l=a.lastMessage)==null?void 0:l.id,metadata:t,headers:n,body:r})}};function VO({messages:e}){let t=e[e.length-1];if(!t||t.role!==`assistant`)return!1;let n=t.parts.reduce((e,t,n)=>t.type===`step-start`?n:e,-1),r=t.parts.slice(n+1).filter(kO).filter(e=>!e.providerExecuted);return r.length>0&&r.every(e=>e.state===`output-available`||e.state===`output-error`)}var HO=s(((e,t)=>{function n(e,t){if(typeof e!=`function`)throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...i){clearTimeout(n);let a=Date.now(),o=t-(a-r);o<=0?(r=a,e.apply(this,i)):n=setTimeout(()=>{r=Date.now(),e.apply(this,i)},o)}}t.exports=n}));B();var UO=u(HO(),1);let WO=[`messages`],GO=[`experimental_throttle`,`resume`];var KO=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},qO=(e,t,n)=>(KO(e,t,`read from private field`),n?n.call(e):t.get(e)),JO=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},YO=(e,t,n,r)=>(KO(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n);function XO(e,t){return t==null?e:(0,UO.default)(e,t)}var ZO,QO,$O,ek,tk,nk,rk,ik,ak,ok=class{constructor(e=[]){JO(this,ZO,void 0),JO(this,QO,`ready`),JO(this,$O,void 0),JO(this,ek,new Set),JO(this,tk,new Set),JO(this,nk,new Set),this.pushMessage=e=>{YO(this,ZO,qO(this,ZO).concat(e)),qO(this,rk).call(this)},this.popMessage=()=>{YO(this,ZO,qO(this,ZO).slice(0,-1)),qO(this,rk).call(this)},this.replaceMessage=(e,t)=>{YO(this,ZO,[...qO(this,ZO).slice(0,e),this.snapshot(t),...qO(this,ZO).slice(e+1)]),qO(this,rk).call(this)},this.snapshot=e=>structuredClone(e),this[`~registerMessagesCallback`]=(e,t)=>{let n=t?XO(e,t):e;return qO(this,ek).add(n),()=>{qO(this,ek).delete(n)}},this[`~registerStatusCallback`]=e=>(qO(this,tk).add(e),()=>{qO(this,tk).delete(e)}),this[`~registerErrorCallback`]=e=>(qO(this,nk).add(e),()=>{qO(this,nk).delete(e)}),JO(this,rk,()=>{qO(this,ek).forEach(e=>e())}),JO(this,ik,()=>{qO(this,tk).forEach(e=>e())}),JO(this,ak,()=>{qO(this,nk).forEach(e=>e())}),YO(this,ZO,e)}get status(){return qO(this,QO)}set status(e){YO(this,QO,e),qO(this,ik).call(this)}get error(){return qO(this,$O)}set error(e){YO(this,$O,e),qO(this,ak).call(this)}get messages(){return qO(this,ZO)}set messages(e){YO(this,ZO,[...e]),qO(this,rk).call(this)}};ZO=new WeakMap,QO=new WeakMap,$O=new WeakMap,ek=new WeakMap,tk=new WeakMap,nk=new WeakMap,rk=new WeakMap,ik=new WeakMap,ak=new WeakMap;var sk,ck=class extends BO{constructor(e){let{messages:t}=e,n=yr(e,WO),r=new ok(t);super(H(H({},n),{},{state:r})),JO(this,sk,void 0),this[`~registerMessagesCallback`]=(e,t)=>qO(this,sk)[`~registerMessagesCallback`](e,t),this[`~registerStatusCallback`]=e=>qO(this,sk)[`~registerStatusCallback`](e),this[`~registerErrorCallback`]=e=>qO(this,sk)[`~registerErrorCallback`](e),YO(this,sk,r)}};sk=new WeakMap;function lk(e={}){let{experimental_throttle:t,resume:n=!1}=e,r=yr(e,GO),i=L(`chat`in r?r.chat:new ck(r));(`chat`in r&&r.chat!==i.current||`id`in r&&i.current.id!==r.id)&&(i.current=`chat`in r?r.chat:new ck(r));let a=ft(Re(e=>i.current[`~registerMessagesCallback`](e,t),[t,i.current.id]),()=>i.current.messages,()=>i.current.messages),o=ft(i.current[`~registerStatusCallback`],()=>i.current.status,()=>i.current.status),s=ft(i.current[`~registerErrorCallback`],()=>i.current.error,()=>i.current.error),c=Re(e=>{typeof e==`function`&&(e=e(i.current.messages)),i.current.messages=e},[i]);return Fe(()=>{n&&i.current.resumeStream()},[n,i]),{id:i.current.id,messages:a,setMessages:c,sendMessage:i.current.sendMessage,regenerate:i.current.regenerate,clearError:i.current.clearError,stop:i.current.stop,error:s,resumeStream:i.current.resumeStream,status:o,addToolResult:i.current.addToolOutput,addToolOutput:i.current.addToolOutput}}B();function uk(e){return z.createElement(`svg`,_({width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,fillRule:`evenodd`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`},e),z.createElement(`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}),z.createElement(`path`,{d:`M12 9v4`}),z.createElement(`path`,{d:`M12 17h.01`}))}function dk(){return z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:18,height:18,viewBox:`0 0 18 18`,fill:`none`},z.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8.99984 1.29102C4.74264 1.29102 1.2915 4.74215 1.2915 8.99935C1.2915 13.2565 4.74264 16.7077 8.99984 16.7077C13.257 16.7077 16.7082 13.2565 16.7082 8.99935C16.7082 4.74215 13.257 1.29102 8.99984 1.29102ZM0.0415039 8.99935C0.0415039 4.0518 4.05229 0.0410156 8.99984 0.0410156C13.9474 0.0410156 17.9582 4.0518 17.9582 8.99935C17.9582 13.9469 13.9474 17.9577 8.99984 17.9577C4.05229 17.9577 0.0415039 13.9469 0.0415039 8.99935ZM5.87484 6.49935C5.87484 6.15417 6.15466 5.87435 6.49984 5.87435H11.4998C11.845 5.87435 12.1248 6.15417 12.1248 6.49935V11.4993C12.1248 11.8445 11.845 12.1243 11.4998 12.1243H6.49984C6.15466 12.1243 5.87484 11.8445 5.87484 11.4993V6.49935ZM7.12484 7.12435V10.8743H10.8748V7.12435H7.12484Z`,fill:`currentcolor`}))}function fk(){return z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:4,height:16,viewBox:`0 0 4 16`,fill:`none`},z.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M1.99984 1.95898C1.88478 1.95898 1.7915 2.05226 1.7915 2.16732C1.7915 2.28238 1.88478 2.37565 1.99984 2.37565C2.1149 2.37565 2.20817 2.28238 2.20817 2.16732C2.20817 2.05226 2.1149 1.95898 1.99984 1.95898ZM0.541504 2.16732C0.541504 1.3619 1.19442 0.708984 1.99984 0.708984C2.80525 0.708984 3.45817 1.3619 3.45817 2.16732C3.45817 2.97273 2.80525 3.62565 1.99984 3.62565C1.19442 3.62565 0.541504 2.97273 0.541504 2.16732ZM1.99984 7.79232C1.88478 7.79232 1.7915 7.88559 1.7915 8.00065C1.7915 8.11571 1.88478 8.20898 1.99984 8.20898C2.1149 8.20898 2.20817 8.11571 2.20817 8.00065C2.20817 7.88559 2.1149 7.79232 1.99984 7.79232ZM0.541504 8.00065C0.541504 7.19524 1.19442 6.54232 1.99984 6.54232C2.80525 6.54232 3.45817 7.19524 3.45817 8.00065C3.45817 8.80607 2.80525 9.45898 1.99984 9.45898C1.19442 9.45898 0.541504 8.80607 0.541504 8.00065ZM1.99984 13.6257C1.88478 13.6257 1.7915 13.7189 1.7915 13.834C1.7915 13.949 1.88478 14.0423 1.99984 14.0423C2.1149 14.0423 2.20817 13.949 2.20817 13.834C2.20817 13.7189 2.1149 13.6257 1.99984 13.6257ZM0.541504 13.834C0.541504 13.0286 1.19442 12.3757 1.99984 12.3757C2.80525 12.3757 3.45817 13.0286 3.45817 13.834C3.45817 14.6394 2.80525 15.2923 1.99984 15.2923C1.19442 15.2923 0.541504 14.6394 0.541504 13.834Z`,fill:`currentcolor`}))}function pk(){return z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`18`,height:`18`,viewBox:`0 0 18 18`,fill:`none`},z.createElement(`path`,{d:`M9 0.875C10.6068 0.875 12.1776 1.35149 13.5137 2.24414C14.8498 3.13693 15.8919 4.40598 16.5068 5.89062C17.1218 7.37522 17.2822 9.00892 16.9688 10.585C16.6552 12.1611 15.8814 13.6088 14.7451 14.7451C13.6088 15.8814 12.1611 16.6552 10.585 16.9688C9.00892 17.2822 7.37523 17.1218 5.89062 16.5068C4.40598 15.8919 3.13693 14.8498 2.24414 13.5137C1.35149 12.1776 0.875 10.6068 0.875 9C0.875 8.65482 1.15482 8.375 1.5 8.375C1.84518 8.375 2.125 8.65482 2.125 9C2.125 10.3596 2.52792 11.6888 3.2832 12.8193C4.03864 13.9499 5.1129 14.8312 6.36914 15.3516C7.62523 15.8718 9.00736 16.0083 10.3408 15.7432C11.6744 15.4779 12.8998 14.8228 13.8613 13.8613C14.8228 12.8998 15.4779 11.6744 15.7432 10.3408C16.0083 9.00736 15.8718 7.62523 15.3516 6.36914C14.8312 5.1129 13.9499 4.03864 12.8193 3.2832C11.6888 2.52792 10.3596 2.125 9 2.125C7.06829 2.125 5.21604 2.89096 3.82129 4.22949L3.00879 5.04199H5.66699C6.01202 5.04217 6.29199 5.32192 6.29199 5.66699C6.29182 6.01191 6.01191 6.29182 5.66699 6.29199H1.5C1.45939 6.29199 1.41889 6.28716 1.37891 6.2793C1.36148 6.27587 1.345 6.26949 1.32812 6.26465C1.267 6.24714 1.20782 6.22205 1.15332 6.18555C1.08536 6.14005 1.02604 6.08256 0.980469 6.01465C0.970244 5.99942 0.962841 5.98268 0.954102 5.9668C0.904937 5.87756 0.875056 5.77606 0.875 5.66699V1.5C0.875 1.15482 1.15482 0.875002 1.5 0.875C1.84518 0.875 2.125 1.15482 2.125 1.5V4.15723L2.94141 3.3418L2.9502 3.33301C4.57158 1.77433 6.73388 0.875 9 0.875ZM9.33301 4.20801C9.67808 4.20801 9.95783 4.48798 9.95801 4.83301V9.44727L12.9463 10.9414C13.2548 11.0958 13.3798 11.4707 13.2256 11.7793C13.0712 12.088 12.6955 12.213 12.3867 12.0586L9.05371 10.3926C8.84198 10.2867 8.70801 10.0697 8.70801 9.83301V4.83301C8.70818 4.48809 8.98809 4.20819 9.33301 4.20801Z`,fill:`currentcolor`}))}function mk(){return z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`19`,height:`19`,viewBox:`0 0 19 19`,fill:`none`},z.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M0.712717 3.38039C1.14249 2.95062 1.72538 2.70917 2.33317 2.70917H8.1665C8.51168 2.70917 8.7915 2.989 8.7915 3.33417C8.7915 3.67935 8.51168 3.95917 8.1665 3.95917H2.33317C2.0569 3.95917 1.79195 4.06892 1.5966 4.26427C1.40125 4.45962 1.2915 4.72457 1.2915 5.00084V16.6675C1.2915 16.9438 1.40125 17.2087 1.5966 17.4041C1.79195 17.5994 2.0569 17.7092 2.33317 17.7092H13.9998C14.2761 17.7092 14.5411 17.5994 14.7364 17.4041C14.9318 17.2087 15.0415 16.9438 15.0415 16.6675V10.8342C15.0415 10.489 15.3213 10.2092 15.6665 10.2092C16.0117 10.2092 16.2915 10.489 16.2915 10.8342V16.6675C16.2915 17.2753 16.0501 17.8582 15.6203 18.288C15.1905 18.7177 14.6076 18.9592 13.9998 18.9592H2.33317C1.72538 18.9592 1.14249 18.7177 0.712717 18.288C0.282947 17.8582 0.0415039 17.2753 0.0415039 16.6675V5.00084C0.0415039 4.39305 0.282947 3.81016 0.712717 3.38039Z`,fill:`currentcolor`}),z.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M15.6665 2.19141C15.3634 2.19141 15.0728 2.3118 14.8584 2.52611L7.06419 10.3204L6.52548 12.4752L8.68031 11.9365L16.4746 4.14223C16.6889 3.92792 16.8093 3.63725 16.8093 3.33417C16.8093 3.03109 16.6889 2.74043 16.4746 2.52611C16.2603 2.3118 15.9696 2.19141 15.6665 2.19141ZM13.9746 1.64223C14.4233 1.1935 15.0319 0.941406 15.6665 0.941406C16.3011 0.941406 16.9097 1.1935 17.3584 1.64223C17.8072 2.09096 18.0593 2.69957 18.0593 3.33417C18.0593 3.96877 17.8072 4.57738 17.3584 5.02611L9.44178 12.9428C9.36168 13.0229 9.26132 13.0797 9.15142 13.1072L5.81809 13.9405C5.6051 13.9938 5.3798 13.9314 5.22456 13.7761C5.06932 13.6209 5.00692 13.3956 5.06016 13.1826L5.8935 9.84925C5.92097 9.73936 5.9778 9.639 6.0579 9.5589L13.9746 1.64223Z`,fill:`currentcolor`}))}function hk({size:e=20}){return z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`DocSearch-Search-Icon`},z.createElement(`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`}))}function gk(){return z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`path`,{d:`M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z`}),z.createElement(`path`,{d:`M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z`}))}function _k({size:e=20,color:t=`currentColor`}){return z.createElement(`svg`,{width:e,height:e,className:`DocSearch-Back-Icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:t,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},z.createElement(`path`,{d:`m12 19-7-7 7-7`}),z.createElement(`path`,{d:`M19 12H5`}))}let vk=z.memo(function({title:e,suggestions:t,onSelectPromptSuggestion:n}){let r=z.useId(),i=z.useCallback(e=>{n(e.currentTarget.value)},[n]);return z.createElement(`section`,{className:`DocSearch-PromptSuggestions`,"aria-labelledby":r},z.createElement(`h3`,{className:`DocSearch-PromptSuggestions-Title`,id:r},e),z.createElement(`div`,{className:`DocSearch-PromptSuggestions-Content`},t.map(e=>z.createElement(`button`,{key:e,type:`button`,className:`DocSearch-PromptSuggestions-Action`,value:e,onClick:i},e))))}),yk=[{value:`incorrect`,translationKey:`feedbackTagIncorrect`,defaultLabel:`Incorrect or incomplete`},{value:`not_what_i_asked`,translationKey:`feedbackTagNotWhatIAsked`,defaultLabel:`Not what I asked for`},{value:`slow_or_buggy`,translationKey:`feedbackTagSlowOrBuggy`,defaultLabel:`Slow or buggy`},{value:`style_or_tone`,translationKey:`feedbackTagStyleOrTone`,defaultLabel:`Style or tone`},{value:`safety_or_legal`,translationKey:`feedbackTagSafetyOrLegal`,defaultLabel:`Safety or legal concern`},{value:`other`,translationKey:`feedbackTagOther`,defaultLabel:`Other`}],bk=1e3;function xk({id:e,showActions:t,latestAssistantMessageContent:n,translations:r,conversations:i,onFeedback:a,isSidepanel:o=!1}){let[s,c]=Ne(()=>{var t;let n=(t=i.getOne)==null?void 0:t.call(i,e);return n!=null&&n.feedback?`thanks`:`actions`}),[l,u]=Ne([]),[d,f]=Ne(``),[p,m]=Ne(!1),[h,g]=Ne(null),{likeButtonTitle:_=`Like`,dislikeButtonTitle:v=`Dislike`,thanksForFeedbackText:y=`Thanks for your feedback!`}=r,b=async()=>{if(!p){g(null),m(!0);try{await(a==null?void 0:a(e,{thumbs:1})),c(`thanks`)}catch(e){g(e)}finally{m(!1)}}},x=()=>{g(null),c(`note`)},S=e=>{u(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},C=async()=>{if(!p){g(null),m(!0);try{await(a==null?void 0:a(e,{thumbs:0,tags:l.length>0?l:void 0,notes:d.trim()||void 0})),c(`thanks`)}catch(e){g(e)}finally{m(!1)}}},w=()=>{u([]),f(``),g(null),c(`actions`)};if(!t||!n)return null;let T=z.createElement(Ck,{translations:r,onClick:()=>navigator.clipboard.writeText(n)});return z.createElement(`div`,{className:`DocSearch-AskAiScreen-Actions`},z.createElement(`div`,{className:`DocSearch-AskAiScreen-Actions-Controls`},o?T:null,s===`thanks`?z.createElement(`p`,{className:`DocSearch-AskAiScreen-FeedbackText DocSearch-AskAiScreen-FeedbackText--visible`},y):z.createElement(z.Fragment,null,p&&s===`actions`?z.createElement(Dr,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}):z.createElement(z.Fragment,null,z.createElement(wk,{title:_,onClick:b}),z.createElement(Tk,{title:v,onClick:x})),h&&s===`actions`?z.createElement(`p`,{className:`DocSearch-AskAiScreen-FeedbackText`},h.message||`An error occured`):null),o?null:T),s===`note`?z.createElement(Sk,{translations:r,tags:l,notes:d,saving:p,savingError:h,onToggleTag:S,onNotesChange:f,onSubmit:C,onClose:w}):null)}function Sk({translations:e,tags:t,notes:n,saving:r,savingError:i,onToggleTag:a,onNotesChange:o,onSubmit:s,onClose:c}){let{feedbackPanelTitle:l=`What went wrong? (optional)`,feedbackDetailsPlaceholder:u=`Share some details...`,feedbackSubmitButtonText:d=`Submit`,feedbackCancelButtonText:f=`Cancel`}=e;return z.createElement(`div`,{className:`DocSearch-Feedback-Panel`,role:`group`,"aria-label":l},z.createElement(`div`,{className:`DocSearch-Feedback-Panel-Header`},z.createElement(`p`,{className:`DocSearch-Feedback-Panel-Title`},l)),z.createElement(`div`,{className:`DocSearch-Feedback-Panel-Reasons`},yk.map(n=>{var r;let i=t.includes(n.value);return z.createElement(`button`,{key:n.value,type:`button`,className:`DocSearch-Feedback-Panel-Reason${i?` DocSearch-Feedback-Panel-Reason--selected`:``}`,"aria-pressed":i,onClick:()=>a(n.value)},z.createElement(`span`,null,(r=e[n.translationKey])==null?n.defaultLabel:r))})),z.createElement(`textarea`,{className:`DocSearch-Feedback-Panel-Textarea`,placeholder:u,value:n,rows:3,maxLength:bk,onChange:e=>o(e.target.value.slice(0,bk))}),z.createElement(`p`,{className:`DocSearch-Feedback-Panel-CharCount`,"aria-live":`polite`},n.length,`/`,bk),i?z.createElement(`p`,{className:`DocSearch-Feedback-Panel-Error`},i.message||`An error occured`):null,z.createElement(`div`,{className:`DocSearch-Feedback-Panel-Actions`},z.createElement(`button`,{type:`button`,className:`DocSearch-Feedback-Panel-Cancel`,onClick:c},f),z.createElement(`button`,{type:`button`,className:`DocSearch-Feedback-Panel-Submit`,disabled:r,onClick:s},r?z.createElement(Dr,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}):d)))}function Ck({onClick:e,translations:t}){let{copyButtonTitle:n=`Copy`,copyButtonCopiedText:r=`Copied!`}=t,[i,a]=Ne(!1);return Fe(()=>{if(i){let e=setTimeout(()=>{a(!1)},1500);return()=>clearTimeout(e)}},[i]),z.createElement(`button`,{type:`button`,className:`DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-CopyButton ${i?`DocSearch-AskAiScreen-CopyButton--copied`:``}`,disabled:i,title:i?r:n,onClick:()=>{e(),a(!0)}},i?z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`path`,{d:`M20 6 9 17l-5-5`})):z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),z.createElement(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})))}function wk({title:e,onClick:t}){return z.createElement(`button`,{type:`button`,className:`DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-LikeButton`,title:e,onClick:t},z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`path`,{d:`M7 10v12`}),z.createElement(`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`})))}function Tk({title:e,onClick:t}){return z.createElement(`button`,{type:`button`,className:`DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-DislikeButton`,title:e,onClick:t},z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`path`,{d:`M17 14V2`}),z.createElement(`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`})))}let Ek=[`className`],Dk=[`align`,`alignOffset`,`side`,`sideOffset`,`collisionBoundary`,`container`,`children`];function Ok(e){let t=jr({},(Ar(e),e));return z.createElement(rh,t)}function kk(e){let{className:t}=e,n=mn(e,Ek),r=`DocSearch-Popover-Trigger${t?` ${t}`:``}`;return z.createElement(oh,_({className:r},n))}Ok.Trigger=kk;function Ak(e){let{align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,collisionBoundary:a=`clipping-ancestors`,container:o,children:s}=e,c=mn(e,Dk);return z.createElement(uh,{container:o},z.createElement(mh,{className:`DocSearch-Popover-Positioner`,align:t,alignOffset:n,side:r,sideOffset:i,collisionBoundary:a},z.createElement(xh,_({className:`DocSearch-Popover-Popup`},c),z.createElement(Ch,{className:`DocSearch-Popover-Arrow`}),z.createElement(Dh,{className:`DocSearch-Popover-Close`},z.createElement(Mr,null)),s)))}Ok.Popup=Ak;function jk(e){let t=jr({},(Ar(e),e));return z.createElement(Th,_({className:`DocSearch-Popover-Title`},t))}Ok.Title=jk;function Mk({links:e,titleText:t=`Sources`}){let[n,r]=z.useState(!1),i=z.useRef(null),[a,o]=z.useState(null);return Fe(()=>{var e,t;if(!n)return;let a=i.current,s=(e=(t=a==null?void 0:a.closest(`.DocSearch-Sidepanel-Content`))==null?a==null?void 0:a.closest(`.DocSearch-Dropdown`):t)==null?null:e;if(o(s),!s)return;let c=()=>{if(!i.current)return;let e=i.current.getBoundingClientRect(),t=s.getBoundingClientRect();(e.bottom<=t.top||e.top>=t.bottom)&&r(!1)};return s.addEventListener(`scroll`,c,{passive:!0}),()=>{s.removeEventListener(`scroll`,c)}},[n]),e.length===0?null:z.createElement(Ok,{open:n,modal:`trap-focus`,onOpenChange:r},z.createElement(Ok.Trigger,{ref:i,className:`DocSearch-AskAiScreen-Sources-Action`},z.createElement(`span`,{className:`DocSearch-AskAiScreen-Sources-Action-icon`},z.createElement(Ir,null)),z.createElement(`span`,{className:`DocSearch-AskAiScreen-Sources-Action-text`},e.length,` sources`)),z.createElement(Ok.Popup,{container:a,sideOffset:10,align:`start`,alignOffset:-16,collisionBoundary:a==null?`clipping-ancestors`:a},z.createElement(Ok.Title,null,t),z.createElement(`ul`,{className:`DocSearch-AskAiScreen-Sources`},e.map(e=>z.createElement(`li`,{key:e.url,className:`DocSearch-AskAiScreen-Sources-source`},z.createElement(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`},z.createElement(Ir,null),z.createElement(`span`,{className:`DocSearch-AskAiScreen-Sources-source-title`},e.title||e.url)))))))}function Nk(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#039;`)}function Pk(e){return Nk(e.replace(/<[^>]*>/g,``))}function Fk(e){let t=[],n=new Set;return e?(e.parts.forEach(e=>{if(e.type!==`text`||e.text.length===0)return;let r=/\[([^\]]*)\]\(([^)]+)\)/g,i=RegExp('(?<!\\]\\()https?:\\/\\/[^\\s<>"{}|\\\\^`[\\]]+',`g`),a=e.text.replace(/```[\s\S]*?```/g,``).replace(/`[^`]*`/g,``),o=a.matchAll(r);for(let e of o){let r=e[1].trim(),i=e[2];n.has(i)||(n.add(i),t.push({url:i,title:r||void 0}))}let s=a.matchAll(i);for(let e of s){let r=e[0].replace(/[.,;:!?]+$/,``);n.has(r)||(n.add(r),t.push({url:r}))}}),t):[]}let Ik=(e,t,n)=>{let r=t[0].parts.find(e=>e.type===`text`),i=r!=null&&r.text?Pk(r.text):``;return{query:e,objectID:i,chatId:n,messages:t,type:`askAI`,anchor:`stored`,content:null,hierarchy:{lvl0:`askAI`,lvl1:i,lvl2:new Date().toISOString(),lvl3:null,lvl4:null,lvl5:null,lvl6:null},url:``,url_without_anchor:``}},Lk=e=>e==null?void 0:e.parts.find(e=>e.type===`text`);function Rk(e){var t;return e&&((t=e.message)==null?void 0:t.includes(`AI-217`))||!1}let zk=Object.freeze({});function Bk(e){return e.type.startsWith(`tool-`)}function Vk(e){return e.type===`tool-searchIndex`||e.type===`tool-algolia_search_index`||e.type.startsWith(`tool-algolia_search_index_`)}function Hk(e){return e.type===`tool-searchIndex`&&e.state===`output-available`}function Uk(e){return Bk(e)&&Vk(e)&&e.state===`output-available`}function Wk(e){var t;let n;return e.forEach((t,r)=>{let i=t.parts.filter(e=>!e.type.startsWith(`data-`));if(i.length===t.parts.length){n==null||n.push(t);return}n||(n=e.slice(0,r)),n.push(_(_({},t),{},{parts:i}))}),(t=n)==null?e:t}function Gk(e){let t=e.find(e=>e.type===`data-suggestions`);return t?t.data.suggestions:[]}function Kk({icon:e,shimmer:t=!1,children:n,variant:r}){let i=`DocSearch-AskAiScreen-MessageContent-Tool Tool--${r}${t?` shimmer`:``}`;return z.createElement(`div`,{className:i},e,n)}function qk({part:e,translations:t,onSearchQueryClick:n}){let{searchingText:r,preToolCallText:i,toolCallResultText:a}=t;switch(e.state){case`input-streaming`:return z.createElement(Kk,{shimmer:!0,icon:z.createElement(Dr,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}),variant:`PartialCall`},z.createElement(`span`,null,r));case`input-available`:return z.createElement(Kk,{shimmer:!0,icon:z.createElement(Dr,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}),variant:`Call`},z.createElement(`span`,null,i,` `,`"${e.input.query||``}" ...`));case`output-available`:{let t=e.type===`tool-searchIndex`?e.output.query:e.input.query;return z.createElement(Kk,{icon:z.createElement(fn,null),variant:`Result`},z.createElement(`span`,null,a,` `,n?z.createElement(`span`,{role:`button`,tabIndex:0,className:`DocSearch-AskAiScreen-MessageContent-Tool-Query`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n(t||``))},onClick:()=>n(t||``)},` `,`"`,t||``,`"`):z.createElement(`span`,{className:`DocSearch-AskAiScreen-MessageContent-Tool-Query`},` `,`"`,t||``,`"`)))}default:return null}}function Jk({tool:e,part:t}){let n=R(()=>t.state===`output-available`?e.render({message:{input:t.input,output:t.output}}):null,[t.input,t.output,e,t.state]);if(t.state===`output-error`)return null;if(t.state!==`output-available`){let{callingToolText:t=`Loading tool`}=e.translations||{};return z.createElement(Kk,{shimmer:!0,variant:`PartialCall`,icon:z.createElement(hk,null)},z.createElement(`span`,null,t))}return n?z.createElement(Kk,{icon:z.createElement(hk,null),variant:`Result`},z.createElement(`span`,null,n)):null}function Yk({part:e,translations:t}){let{savedMemoryToolResultText:n,memoryToolResultText:r}=t;return e.state===`output-error`?null:e.type===`tool-algolia_memorize`?z.createElement(Kk,{variant:`Result`,icon:z.createElement(gk,null)},n):z.createElement(Kk,{variant:`Result`,icon:z.createElement(gk,null)},r)}function Xk(e){return e.type===`tool-algolia_ponder`||e.type===`tool-algolia_memorize`||e.type===`tool-algolia_memory_search`}function Zk({part:e,translations:t,tools:n,onSearchQueryClick:r,memoryEnabled:i=!1}){let a=n[e.type.replace(`tool-`,``)];return a?z.createElement(Jk,{tool:a,part:e}):i&&Xk(e)?z.createElement(Yk,{part:e,translations:t}):Vk(e)?z.createElement(qk,{part:e,translations:t,onSearchQueryClick:r}):null}function Qk(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}let $k=new t_.Renderer;$k.code=({text:e,lang:t=``,escaped:n})=>{let r=t?`language-${t}`:``,i=n?e:Qk(e);return`
164
+ <div class="DocSearch-CodeSnippet">
165
+ <button class="DocSearch-CodeSnippet-CopyButton" data-code="${encodeURIComponent(e)}" aria-label="copy code"><svg class="DocSearch-CodeSnippet-CopyIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" /></svg><svg class="DocSearch-CodeSnippet-CheckIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5" /></svg><span class="DocSearch-CodeSnippet-CopyButton-Label"></span></button>
166
+ <pre><code class="${r}">${i}</code></pre>
167
+ </div>
168
+ `},$k.link=({href:e,title:t,text:n})=>{let r=t?` title="${Qk(t)}"`:``;return`<a href="${e?Qk(e):``}"${r} target="_blank" rel="noopener noreferrer">${Qk(n)}</a>`};let eA=yt(({content:e,copyButtonText:t,copyButtonCopiedText:n,isStreaming:r})=>{let i=R(()=>t_.parse(e,{gfm:!0,breaks:!0,renderer:$k}),[e]),a=L(null);return Fe(()=>{let e=a.current;if(!e)return;Array.from(e.querySelectorAll(`.DocSearch-CodeSnippet-CopyButton`)).forEach(e=>{let n=e.querySelector(`.DocSearch-CodeSnippet-CopyButton-Label`);n&&(n.textContent=t),e.classList.remove(`DocSearch-CodeSnippet-CopyButton--copied`)});function r(e){var r;let i=e.target.closest(`.DocSearch-CodeSnippet-CopyButton`);if(!i)return;let a=(r=i.getAttribute(`data-code`))==null?``:r;navigator.clipboard.writeText(decodeURIComponent(a)).catch(()=>{});let o=i.querySelector(`.DocSearch-CodeSnippet-CopyButton-Label`);if(!o)return;i.classList.add(`DocSearch-CodeSnippet-CopyButton--copied`);let s=t;o.textContent=n,setTimeout(()=>{i.classList.remove(`DocSearch-CodeSnippet-CopyButton--copied`),o.textContent=s},1500)}return e.addEventListener(`click`,r),()=>{e.removeEventListener(`click`,r)}},[i,t,n]),z.createElement(`div`,{ref:a,className:`DocSearch-Markdown-Content ${r?`DocSearch-Markdown-Content--streaming`:``}`,dangerouslySetInnerHTML:{__html:i}})});eA.displayName=`MemoizedMarkdown`;function tA(e){var t,n;let r=Hk(e)?(t=e.output)==null?void 0:t.query:(n=e.input)==null?void 0:n.query;return(r==null?``:r).trim()}function nA(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(Uk(r)){let r=[],i,a=n;for(;a<e.length;){let t=e[a];if(Uk(t)){let e=tA(t);e&&e.length>0&&(r.push(e),i=t),a++}else break}r.length>1?t.push({type:`aggregated-tool-call`,queries:r}):r.length===1&&i&&t.push(i),n=a-1}else t.push(r)}return t}let rA=[`children`,`className`,`onClick`],iA=z.createContext({open:!1,setOpen:e=>{}});function aA({children:e}){let[t,n]=z.useState(!1),r=z.useRef(null);return z.useEffect(()=>{function e(e){var t;(t=r.current)!=null&&t.contains(e.target)||n(!1)}return t&&window.addEventListener(`click`,e),function(){window.removeEventListener(`click`,e)}},[t]),z.createElement(iA.Provider,{value:{open:t,setOpen:n}},z.createElement(`div`,{ref:r,className:`DocSearch-Menu`},e))}function oA({children:e,className:t=``,disabled:n}){let{open:r,setOpen:i}=z.useContext(iA);function a(){n||i(!r)}return z.createElement(`button`,{type:`button`,className:`DocSearch-Menu-trigger ${t}${n?` disabled`:``}`,"aria-disabled":n,onClick:()=>a()},e)}aA.Trigger=oA;function sA({children:e}){let{open:t}=z.useContext(iA);return z.createElement(`div`,{className:`DocSearch-Menu-content${t?` open`:``}`},e)}aA.Content=sA;function cA(e){let{children:t,className:n=``,onClick:r}=e,i=mn(e,rA),{setOpen:a}=z.useContext(iA);return z.createElement(`button`,_({type:`button`,className:`DocSearch-Menu-item ${n}`,onClick:e=>{r&&(r(e),a(!1))}},i),t)}aA.Item=cA;let lA=e=>`https://${e}.algolia.net/agent-studio/1`,uA=e=>{let t=e.message;try{let n=JSON.parse(e.message);if(n.name===`ValidationError`){let e=n;if(e.detail&&e.detail.length>0){let{msg:n,loc:r}=e.detail[0];t=`${n}: ${r.at(-1)}`}}else t=n.message}catch(e){}return Error(t)},dA=({agentId:e,vote:t,messageId:n,appId:r,apiKey:i,abortSignal:a,notes:o,tags:s})=>{let c=new Headers;c.set(`x-algolia-application-id`,r),c.set(`x-algolia-api-key`,i),c.set(`content-type`,`application/json`);let l=`${lA(r)}/feedback`;return fetch(l,{method:`POST`,body:JSON.stringify(_(_({messageId:n,agentId:e,vote:t},o?{notes:o}:{}),s&&s.length>0?{tags:s}:{})),headers:c,signal:a})},fA=[`id`,`messages`,`body`],pA=({appId:e,apiKey:t,assistantId:n,searchParameters:r,userToken:i,indices:a})=>{let o={};return r&&(o.searchParameters=r),a&&a.length>0&&(o.indices=a),new zO({api:`${lA(e)}/agents/${n}/completions?stream=true&compatibilityMode=ai-sdk-5`,headers:_({"x-algolia-application-id":e,"x-algolia-api-key":t},i?{"x-algolia-secure-user-token":i}:{}),body:{algolia:o},prepareSendMessagesRequest(e){let{id:t,messages:n,body:r}=e,i=mn(e,fA),a=Wk(n);return _(_({},i),{},{body:_({id:t,messages:a},r)})}})},mA=({assistantId:e,apiKey:t,appId:n,indexName:r,tools:i=zk,searchParameters:a,memory:o,indices:s})=>{let c=L(new AbortController),l=R(()=>pA({apiKey:t,appId:n,assistantId:e,searchParameters:a,userToken:o==null?void 0:o.userToken,indices:s}),[t,n,e,a,o==null?void 0:o.userToken,s]),u=L(l);u.current=l;let d=L(i);d.current=i;let f=L(null),p=Re(({toolCall:e})=>{let t=d.current[e.toolName];t!=null&&t.onToolCall&&t.onToolCall(_(_({},e),{},{addToolOutput:async({output:t})=>{f.current&&await f.current({output:t,tool:e.toolName,toolCallId:e.toolCallId})}}))},[]),m=Re((e,t=DE())=>new ck({id:t,messages:e,sendAutomaticallyWhen:VO,transport:u.current,onToolCall:p}),[p]),[h,g]=Ne(()=>m()),v=L(h);v.current=h;let{messages:y,status:b,setMessages:x,error:S,stop:C,addToolOutput:w}=lk({chat:h});Fe(()=>{f.current=w},[w]);let T=L(Kr({key:`__DOCSEARCH_ASKAI_CONVERSATIONS__${r}`,limit:10})).current,E=Re(async(r,{thumbs:i,tags:a,notes:o})=>{var s;if(e){if((await dA({agentId:e,vote:i,messageId:r,appId:n,apiKey:t,abortSignal:c.current.signal,notes:o,tags:a})).status>=300)throw Error(`Failed, try again later.`);(s=T.addFeedback)==null||s.call(T,r,i===1?`like`:`dislike`,{tags:a,notes:o})}},[e,n,t,T]),D=Re(async()=>{c.current.abort(),await C()},[C]),O=R(()=>{let e=[];for(let n=0;n<y.length;n++)if(y[n].role===`user`){var t;let r=y[n],i=((t=y[n+1])==null?void 0:t.role)===`assistant`?y[n+1]:null;e.push({id:r.id,userMessage:r,assistantMessage:i}),i&&n++}return e},[y]),k=b===`streaming`||b===`submitted`,A=R(()=>{if(S)return uA(S)},[S]),j=Re((e,t)=>{let n=m(e,t);v.current=n,g(n)},[m]),M=Re(()=>{j()},[j]),ee=Re((e,t)=>{j(e,t)},[j]),N=Re((...e)=>v.current.sendMessage(...e),[]);return{chatId:h.id,messages:y,sendMessage:N,status:b,setMessages:x,askAiError:A,stopAskAiStreaming:D,isStreaming:k,exchanges:O,conversations:T,sendFeedback:E,startNewConversation:M,restoreConversation:ee}},hA=({assistantId:e,searchClient:t,suggestedQuestionsEnabled:n=!1})=>{let[r,i]=Ne([]);return Fe(()=>{n&&e&&e!==``&&(async()=>{let{results:n}=await t.search({requests:[{indexName:`algolia_ask_ai_suggested_questions`,filters:`state:published AND assistantId:${e}`,hitsPerPage:3}]}),r=n[0];i(r.hits)})()},[n,e,t]),r};function gA(e){return{current:e}}function _A(e,t){var n=void 0;return function(){for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];n&&clearTimeout(n),n=setTimeout(function(){return e.apply(void 0,i)},t)}}function vA(e){return e.reduce(function(e,t){return e.concat(t)},[])}var yA=0;function bA(){return`autocomplete-${yA++}`}function xA(e){return e.collections.length===0?0:e.collections.reduce(function(e,t){return e+t.items.length},0)}function SA(e){return e!==Object(e)}function CA(e,t){if(e===t)return!0;if(SA(e)||SA(t)||typeof e==`function`||typeof t==`function`)return e===t;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(!(i in t)||!CA(e[i],t[i]))return!1}return!0}var wA=function(){};function TA(e){if(typeof window<`u`)return e({window})}var EA=[{segment:`autocomplete-core`,version:`1.19.2`}];function DA(e){var t=e.item,n=e.items,r=n===void 0?[]:n;return{index:t.__autocomplete_indexName,items:[t],positions:[1+r.findIndex(function(e){return e.objectID===t.objectID})],queryID:t.__autocomplete_queryID,algoliaSource:[`autocomplete`]}}function OA(e,t){return NA(e)||MA(e,t)||AA(e,t)||kA()}function kA(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
169
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AA(e,t){if(e){if(typeof e==`string`)return jA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jA(e,t)}}function jA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function MA(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function NA(e){if(Array.isArray(e))return e}function PA(e){var t=OA((e.version||``).split(`.`).map(Number),2),n=t[0],r=t[1];return n>=3||n===2&&r>=4||n===1&&r>=10}var FA=[`items`],IA=[`items`];function LA(e){"@babel/helpers - typeof";return LA=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},LA(e)}function RA(e){return HA(e)||VA(e)||BA(e)||zA()}function zA(){throw TypeError(`Invalid attempt to spread non-iterable instance.
170
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BA(e,t){if(e){if(typeof e==`string`)return UA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return UA(e,t)}}function VA(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function HA(e){if(Array.isArray(e))return UA(e)}function UA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function WA(e,t){if(e==null)return{};var n=GA(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function GA(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function KA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?KA(Object(n),!0).forEach(function(t){JA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function JA(e,t,n){return t=YA(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YA(e){var t=XA(e,`string`);return LA(t)===`symbol`?t:String(t)}function XA(e,t){if(LA(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(LA(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ZA(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:20,n=[],r=0;r<e.objectIDs.length;r+=t)n.push(qA(qA({},e),{},{objectIDs:e.objectIDs.slice(r,r+t)}));return n}function QA(e){return e.map(function(e){var t=e.items,n=WA(e,FA);return qA(qA({},n),{},{objectIDs:(t==null?void 0:t.map(function(e){return e.objectID}))||n.objectIDs})})}function $A(e){var t=PA(e);function n(n,r,i){if(t&&i!==void 0){var a=i[0].__autocomplete_algoliaCredentials,o={"X-Algolia-Application-Id":a.appId,"X-Algolia-API-Key":a.apiKey};e.apply(void 0,[n].concat(RA(r),[{headers:o}]))}else e.apply(void 0,[n].concat(RA(r)))}return{init:function(t,n){e(`init`,{appId:t,apiKey:n})},setAuthenticatedUserToken:function(t){e(`setAuthenticatedUserToken`,t)},setUserToken:function(t){e(`setUserToken`,t)},clickedObjectIDsAfterSearch:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];t.length>0&&n(`clickedObjectIDsAfterSearch`,QA(t),t[0].items)},clickedObjectIDs:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];t.length>0&&n(`clickedObjectIDs`,QA(t),t[0].items)},clickedFilters:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];n.length>0&&e.apply(void 0,[`clickedFilters`].concat(n))},convertedObjectIDsAfterSearch:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];t.length>0&&n(`convertedObjectIDsAfterSearch`,QA(t),t[0].items)},convertedObjectIDs:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];t.length>0&&n(`convertedObjectIDs`,QA(t),t[0].items)},convertedFilters:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];n.length>0&&e.apply(void 0,[`convertedFilters`].concat(n))},viewedObjectIDs:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];t.length>0&&t.reduce(function(e,t){var n=t.items,r=WA(t,IA);return[].concat(RA(e),RA(ZA(qA(qA({},r),{},{objectIDs:(n==null?void 0:n.map(function(e){return e.objectID}))||r.objectIDs})).map(function(e){return{items:n,payload:e}})))},[]).forEach(function(e){var t=e.items,r=e.payload;return n(`viewedObjectIDs`,[r],t)})},viewedFilters:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];n.length>0&&e.apply(void 0,[`viewedFilters`].concat(n))}}}function ej(e){var t=e.items.reduce(function(e,t){var n;return e[t.__autocomplete_indexName]=((n=e[t.__autocomplete_indexName])==null?[]:n).concat(t),e},{});return Object.keys(t).map(function(e){return{index:e,items:t[e],algoliaSource:[`autocomplete`]}})}function tj(e){return e.objectID&&e.__autocomplete_indexName&&e.__autocomplete_queryID}function nj(e){"@babel/helpers - typeof";return nj=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},nj(e)}function rj(e){return sj(e)||oj(e)||aj(e)||ij()}function ij(){throw TypeError(`Invalid attempt to spread non-iterable instance.
171
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aj(e,t){if(e){if(typeof e==`string`)return cj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cj(e,t)}}function oj(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function sj(e){if(Array.isArray(e))return cj(e)}function cj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lj(Object(n),!0).forEach(function(t){dj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dj(e,t,n){return t=fj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fj(e){var t=pj(e,`string`);return nj(t)===`symbol`?t:String(t)}function pj(e,t){if(nj(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(nj(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var mj=400,hj=`2.15.0`,gj=`https://cdn.jsdelivr.net/npm/search-insights@${hj}/dist/search-insights.min.js`,_j=_A(function(e){var t=e.onItemsChange,n=e.items,r=e.insights,i=e.state;t({insights:r,insightsEvents:ej({items:n}).map(function(e){return uj({eventName:`Items Viewed`},e)}),state:i})},mj);function vj(e){var t=bj(e),n=t.insightsClient,r=t.insightsInitParams,i=t.onItemsChange,a=t.onSelect,o=t.onActive,s=t.__autocomplete_clickAnalytics,c=n;if(n||TA(function(e){var t=e.window,n=t.AlgoliaAnalyticsObject||`aa`;typeof n==`string`&&(c=t[n]),c||(t.AlgoliaAnalyticsObject=n,t[n]||(t[n]=function(){t[n].queue||(t[n].queue=[]);for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];t[n].queue.push(r)}),t[n].version=hj,c=t[n],xj(t))}),!c)return{};r&&c(`init`,uj({partial:!0},r));var l=$A(c),u=gA([]),d=_A(function(e){var t=e.state;if(t.isOpen){var n=t.collections.reduce(function(e,t){return[].concat(rj(e),rj(t.items))},[]).filter(tj);CA(u.current.map(function(e){return e.objectID}),n.map(function(e){return e.objectID}))||(u.current=n,n.length>0&&_j({onItemsChange:i,items:n,insights:l,state:t}))}},0);return{name:`aa.algoliaInsightsPlugin`,subscribe:function(e){var t=e.setContext,n=e.onSelect,r=e.onActive;function i(e){t({algoliaInsightsPlugin:{__algoliaSearchParameters:uj(uj({},s?{clickAnalytics:!0}:{}),e?{userToken:Sj(e)}:{}),insights:l}})}c(`addAlgoliaAgent`,`insights-plugin`),i(),c(`onUserTokenChange`,function(e){i(e)}),c(`getUserToken`,null,function(e,t){i(t)}),n(function(e){var t=e.item,n=e.state,r=e.event,i=e.source;tj(t)&&a({state:n,event:r,insights:l,item:t,insightsEvents:[uj({eventName:`Item Selected`},DA({item:t,items:i.getItems().filter(tj)}))]})}),r(function(e){var t=e.item,n=e.source,r=e.state,i=e.event;tj(t)&&o({state:r,event:i,insights:l,item:t,insightsEvents:[uj({eventName:`Item Active`},DA({item:t,items:n.getItems().filter(tj)}))]})})},onStateChange:function(e){var t=e.state;d({state:t})},__autocomplete_pluginOptions:e}}function yj(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;return[].concat(rj(t),[`autocomplete-internal`],rj((e=n.algoliaInsightsPlugin)!=null&&e.__automaticInsights?[`autocomplete-automatic`]:[]))}function bj(e){return uj({onItemsChange:function(e){var t=e.insights,n=e.insightsEvents,r=e.state;t.viewedObjectIDs.apply(t,rj(n.map(function(e){return uj(uj({},e),{},{algoliaSource:yj(e.algoliaSource,r.context)})})))},onSelect:function(e){var t=e.insights,n=e.insightsEvents,r=e.state;t.clickedObjectIDsAfterSearch.apply(t,rj(n.map(function(e){return uj(uj({},e),{},{algoliaSource:yj(e.algoliaSource,r.context)})})))},onActive:wA,__autocomplete_clickAnalytics:!0},e)}function xj(e){var t=`[Autocomplete]: Could not load search-insights.js. Please load it manually following https://alg.li/insights-autocomplete`;try{var n=e.document.createElement(`script`);n.async=!0,n.src=gj,n.onerror=function(){console.error(t)},document.body.appendChild(n)}catch(e){console.error(t)}}function Sj(e){return typeof e==`number`?e.toString():e}function Cj(e,t){var n=t;return{then:function(t,r){return Cj(e.then(Ej(t,n,e),Ej(r,n,e)),n)},catch:function(t){return Cj(e.catch(Ej(t,n,e)),n)},finally:function(t){return t&&n.onCancelList.push(t),Cj(e.finally(Ej(t&&function(){return n.onCancelList=[],t()},n,e)),n)},cancel:function(){n.isCanceled=!0;var e=n.onCancelList;n.onCancelList=[],e.forEach(function(e){e()})},isCanceled:function(){return n.isCanceled===!0}}}function wj(e){return Cj(new Promise(function(t,n){return e(t,n)}),{isCanceled:!1,onCancelList:[]})}wj.resolve=function(e){return Tj(Promise.resolve(e))},wj.reject=function(e){return Tj(Promise.reject(e))};function Tj(e){return Cj(e,{isCanceled:!1,onCancelList:[]})}function Ej(e,t,n){return e?function(n){return t.isCanceled?n:e(n)}:n}var Dj=!0,Oj;function kj(){var e=[];return{add:function(t){return e.push(t),t.finally(function(){e=e.filter(function(e){return e!==t})})},cancelAll:function(){e.forEach(function(e){return e.cancel()})},isEmpty:function(){return e.length===0},wait:function(t){return Dj?(Dj=!1,Oj=t?Promise.race([Promise.all(e),new Promise(function(e){return setTimeout(e,t)})]):Promise.all(e),Oj.then(function(){Dj=!0})):Oj}}}function Aj(){var e=-1,t=-1,n=void 0;return function(r){e++;var i=e;return Promise.resolve(r).then(function(e){return n&&i<t?n:(t=i,n=e,e)})}}function jj(e,t,n,r){if(!n)return null;if(e<0&&(t===null||r!==null&&t===0))return n+e;var i=(t===null?-1:t)+e;return i<=-1||i>=n?r===null?null:0:i}function Mj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Nj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Mj(Object(n),!0).forEach(function(t){Pj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Pj(e,t,n){return t=Fj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fj(e){var t=Ij(e,`string`);return Lj(t)===`symbol`?t:String(t)}function Ij(e,t){if(Lj(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Lj(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Lj(e){"@babel/helpers - typeof";return Lj=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Lj(e)}function Rj(e,t){var n=[];return Promise.resolve(e(t)).then(function(e){return Promise.all(e.filter(function(e){return!!e}).map(function(e){if(e.sourceId,n.includes(e.sourceId))throw Error(`[Autocomplete] The \`sourceId\` ${JSON.stringify(e.sourceId)} is not unique.`);n.push(e.sourceId);var t={getItemInputValue:function(e){return e.state.query},getItemUrl:function(){},onSelect:function(e){var t=e.setIsOpen;t(!1)},onActive:wA,onResolve:wA};Object.keys(t).forEach(function(e){t[e].__default=!0});var r=Nj(Nj({},t),e);return Promise.resolve(r)}))})}function zj(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=Bj(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
172
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,s=e},f:function(){try{!a&&n.return!=null&&n.return()}finally{if(o)throw s}}}}function Bj(e,t){if(e){if(typeof e==`string`)return Vj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vj(e,t)}}function Vj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Hj=function(e,t){var n=!1,r=[],i=zj(e),a;try{for(i.s();!(a=i.n()).done;){var o,s,c,l=(o=a.value.__autocomplete_pluginOptions)==null||(s=(c=o).awaitSubmit)==null?void 0:s.call(c);if(typeof l==`number`)r.push(l);else if(l===!0){n=!0;break}}}catch(e){i.e(e)}finally{i.f()}if(n)return t.wait();if(r.length>0)return t.wait(Math.max.apply(Math,r))};function Uj(e){var t=e.collections.map(function(e){return e.items.length}).reduce(function(e,t,n){var r=(e[n-1]||0)+t;return e.push(r),e},[]).reduce(function(t,n){return n<=e.activeItemId?t+1:t},0);return e.collections[t]}function Wj(e){for(var t=e.state,n=e.collection,r=!1,i=0,a=0;r===!1;){var o=t.collections[i];if(o===n){r=!0;break}a+=o.items.length,i++}return t.activeItemId-a}function Gj(e){var t=Uj(e);if(!t)return null;var n=t.items[Wj({state:e,collection:t})],r=t.source;return{item:n,itemInputValue:r.getItemInputValue({item:n,state:e}),itemUrl:r.getItemUrl({item:n,state:e}),source:r}}function Kj(e,t,n){return[e,n==null?void 0:n.sourceId,t].filter(Boolean).join(`-`).replace(/\s/g,``)}function qj(e,t){return e===t||e.contains(t)}var Jj=/((gt|sm)-|galaxy nexus)|samsung[- ]|samsungbrowser/i;function Yj(e){return!!(e&&e.match(Jj))}function Xj(e){return{results:e,hits:e.map(function(e){return e.hits}).filter(Boolean),facetHits:e.map(function(e){var t;return(t=e.facetHits)==null?void 0:t.map(function(e){return{label:e.value,count:e.count,_highlightResult:{label:{value:e.highlighted}}}})}).filter(Boolean)}}function Zj(e){return e.nativeEvent||e}function Qj(e){"@babel/helpers - typeof";return Qj=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Qj(e)}function $j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?$j(Object(n),!0).forEach(function(t){tM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$j(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tM(e,t,n){return t=nM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nM(e){var t=rM(e,`string`);return Qj(t)===`symbol`?t:String(t)}function rM(e,t){if(Qj(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Qj(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function iM(e,t,n){var r=t.initialState;return{getState:function(){return r},dispatch:function(i,a){var o=eM({},r);r=e(r,{type:i,props:t,payload:a}),n({state:r,prevState:o})},pendingRequests:kj()}}function aM(e){"@babel/helpers - typeof";return aM=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},aM(e)}function oM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?oM(Object(n),!0).forEach(function(t){cM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cM(e,t,n){return t=lM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lM(e){var t=uM(e,`string`);return aM(t)===`symbol`?t:String(t)}function uM(e,t){if(aM(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(aM(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function dM(e){var t=e.store;return{setActiveItemId:function(e){t.dispatch(`setActiveItemId`,e)},setQuery:function(e){t.dispatch(`setQuery`,e)},setCollections:function(e){var n=0,r=e.map(function(e){return sM(sM({},e),{},{items:vA(e.items).map(function(e){return sM(sM({},e),{},{__autocomplete_id:n++})})})});t.dispatch(`setCollections`,r)},setIsOpen:function(e){t.dispatch(`setIsOpen`,e)},setStatus:function(e){t.dispatch(`setStatus`,e)},setContext:function(e){t.dispatch(`setContext`,e)}}}function fM(e){"@babel/helpers - typeof";return fM=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},fM(e)}function pM(e){return _M(e)||gM(e)||hM(e)||mM()}function mM(){throw TypeError(`Invalid attempt to spread non-iterable instance.
173
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hM(e,t){if(e){if(typeof e==`string`)return vM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vM(e,t)}}function gM(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function _M(e){if(Array.isArray(e))return vM(e)}function vM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?yM(Object(n),!0).forEach(function(t){xM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xM(e,t,n){return t=SM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SM(e){var t=CM(e,`string`);return fM(t)===`symbol`?t:String(t)}function CM(e,t){if(fM(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(fM(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function wM(e,t){var n,r=typeof window<`u`?window:{},i=e.plugins||[];return bM(bM({debug:!1,openOnFocus:!1,enterKeyHint:void 0,ignoreCompositionEvents:!1,placeholder:``,autoFocus:!1,defaultActiveItemId:null,stallThreshold:300,insights:void 0,environment:r,shouldPanelOpen:function(e){var t=e.state;return xA(t)>0},reshape:function(e){return e.sources}},e),{},{id:(n=e.id)==null?bA():n,plugins:i,initialState:bM({activeItemId:null,query:``,completion:null,collections:[],isOpen:!1,status:`idle`,context:{}},e.initialState),onStateChange:function(t){var n;(n=e.onStateChange)==null||n.call(e,t),i.forEach(function(e){var n;return(n=e.onStateChange)==null?void 0:n.call(e,t)})},onSubmit:function(t){var n;(n=e.onSubmit)==null||n.call(e,t),i.forEach(function(e){var n;return(n=e.onSubmit)==null?void 0:n.call(e,t)})},onReset:function(t){var n;(n=e.onReset)==null||n.call(e,t),i.forEach(function(e){var n;return(n=e.onReset)==null?void 0:n.call(e,t)})},getSources:function(n){return Promise.all([].concat(pM(i.map(function(e){return e.getSources})),[e.getSources]).filter(Boolean).map(function(e){return Rj(e,n)})).then(function(e){return vA(e)}).then(function(e){return e.map(function(e){return bM(bM({},e),{},{onSelect:function(n){e.onSelect(n),t.forEach(function(e){var t;return(t=e.onSelect)==null?void 0:t.call(e,n)})},onActive:function(n){e.onActive(n),t.forEach(function(e){var t;return(t=e.onActive)==null?void 0:t.call(e,n)})},onResolve:function(n){e.onResolve(n),t.forEach(function(e){var t;return(t=e.onResolve)==null?void 0:t.call(e,n)})}})})})},navigator:bM({navigate:function(e){var t=e.itemUrl;r.location.assign(t)},navigateNewTab:function(e){var t=e.itemUrl,n=r.open(t,`_blank`,`noopener`);n==null||n.focus()},navigateNewWindow:function(e){var t=e.itemUrl;r.open(t,`_blank`,`noopener`)}},e.navigator)})}function TM(e){"@babel/helpers - typeof";return TM=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},TM(e)}function EM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function DM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?EM(Object(n),!0).forEach(function(t){OM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function OM(e,t,n){return t=kM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kM(e){var t=AM(e,`string`);return TM(t)===`symbol`?t:String(t)}function AM(e,t){if(TM(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(TM(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function jM(e){var t=e.collections,n=e.props,r=e.state,i=t.reduce(function(e,t){return DM(DM({},e),{},OM({},t.source.sourceId,DM(DM({},t.source),{},{getItems:function(){return vA(t.items)}})))},{}),a=n.plugins.reduce(function(e,t){return t.reshape?t.reshape(e):e},{sourcesBySourceId:i,state:r}).sourcesBySourceId;return vA(n.reshape({sourcesBySourceId:a,sources:Object.values(a),state:r})).filter(Boolean).map(function(e){return{source:e,items:e.getItems()}})}function MM(e){"@babel/helpers - typeof";return MM=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},MM(e)}function NM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function PM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?NM(Object(n),!0).forEach(function(t){FM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function FM(e,t,n){return t=IM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IM(e){var t=LM(e,`string`);return MM(t)===`symbol`?t:String(t)}function LM(e,t){if(MM(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(MM(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function RM(e){return HM(e)||VM(e)||BM(e)||zM()}function zM(){throw TypeError(`Invalid attempt to spread non-iterable instance.
174
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BM(e,t){if(e){if(typeof e==`string`)return UM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return UM(e,t)}}function VM(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function HM(e){if(Array.isArray(e))return UM(e)}function UM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function WM(e){return!!e.execute}function GM(e){return!!(e!=null&&e.execute)}function KM(e,t,n){if(GM(e)){var r=e.requesterId===`algolia`?Object.assign.apply(Object,[{}].concat(RM(Object.keys(n.context).map(function(e){var t;return(t=n.context[e])==null?void 0:t.__algoliaSearchParameters})))):{};return PM(PM({},e),{},{requests:e.queries.map(function(n){return{query:e.requesterId===`algolia`?PM(PM({},n),{},{params:PM(PM({},r),n.params)}):n,sourceId:t,transformResponse:e.transformResponse}})})}return{items:e,sourceId:t}}function qM(e){var t=e.reduce(function(e,t){if(!WM(t))return e.push(t),e;var n=t.searchClient,r=t.execute,i=t.requesterId,a=t.requests,o=e.find(function(e){return WM(t)&&WM(e)&&e.searchClient===n&&!!i&&e.requesterId===i});if(o){var s;(s=o.items).push.apply(s,RM(a))}else{var c={execute:r,requesterId:i,items:a,searchClient:n};e.push(c)}return e},[]).map(function(e){if(!WM(e))return Promise.resolve(e);var t=e,n=t.execute,r=t.items,i=t.searchClient;return n({searchClient:i,requests:r})});return Promise.all(t).then(function(e){return vA(e)})}function JM(e,t,n){return t.map(function(t){var r=e.filter(function(e){return e.sourceId===t.sourceId}),i=r.map(function(e){return e.items}),a=r[0].transformResponse,o=a?a(Xj(i)):i;return t.onResolve({source:t,results:i,items:o,state:n.getState()}),o.every(Boolean),`${t.sourceId}${JSON.stringify(void 0)}`,{source:t,items:o}})}function YM(e){"@babel/helpers - typeof";return YM=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},YM(e)}var XM=[`event`,`nextState`,`props`,`query`,`refresh`,`store`];function ZM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function QM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ZM(Object(n),!0).forEach(function(t){$M(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function $M(e,t,n){return t=eN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eN(e){var t=tN(e,`string`);return YM(t)===`symbol`?t:String(t)}function tN(e,t){if(YM(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(YM(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function nN(e,t){if(e==null)return{};var n=rN(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function rN(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var iN=null,aN=Aj();function oN(e){var t=e.event,n=e.nextState,r=n===void 0?{}:n,i=e.props,a=e.query,o=e.refresh,s=e.store,c=nN(e,XM);iN&&i.environment.clearTimeout(iN);var l=c.setCollections,u=c.setIsOpen,d=c.setQuery,f=c.setActiveItemId,p=c.setStatus,m=c.setContext;if(d(a),f(i.defaultActiveItemId),!a&&i.openOnFocus===!1){var h,g=s.getState().collections.map(function(e){return QM(QM({},e),{},{items:[]})});p(`idle`),l(g),u((h=r.isOpen)==null?i.shouldPanelOpen({state:s.getState()}):h);var _=Tj(aN(g).then(function(){return Promise.resolve()}));return s.pendingRequests.add(_)}p(`loading`),iN=i.environment.setTimeout(function(){p(`stalled`)},i.stallThreshold);var v=Tj(aN(i.getSources(QM({query:a,refresh:o,state:s.getState()},c)).then(function(e){return Promise.all(e.map(function(e){return Promise.resolve(e.getItems(QM({query:a,refresh:o,state:s.getState()},c))).then(function(t){return KM(t,e.sourceId,s.getState())})})).then(qM).then(function(t){var n=t.some(function(e){var t=e.items;return sN(t)});if(n){var r;m({algoliaInsightsPlugin:QM(QM({},((r=s.getState().context)==null?void 0:r.algoliaInsightsPlugin)||{}),{},{__automaticInsights:n})})}return JM(t,e,s)}).then(function(e){return jM({collections:e,props:i,state:s.getState()})})}))).then(function(e){var n;p(`idle`),l(e);var d=i.shouldPanelOpen({state:s.getState()});u((n=r.isOpen)==null?i.openOnFocus&&!a&&d||d:n);var f=Gj(s.getState());if(s.getState().activeItemId!==null&&f){var m=f.item,h=f.itemInputValue,g=f.itemUrl,_=f.source;_.onActive(QM({event:t,item:m,itemInputValue:h,itemUrl:g,refresh:o,source:_,state:s.getState()},c))}}).finally(function(){p(`idle`),iN&&i.environment.clearTimeout(iN)});return s.pendingRequests.add(v)}function sN(e){return!Array.isArray(e)&&!!(e!=null&&e._automaticInsights)}function cN(e){"@babel/helpers - typeof";return cN=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},cN(e)}var lN=[`event`,`props`,`refresh`,`store`];function uN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?uN(Object(n),!0).forEach(function(t){fN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fN(e,t,n){return t=pN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pN(e){var t=mN(e,`string`);return cN(t)===`symbol`?t:String(t)}function mN(e,t){if(cN(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(cN(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function hN(e,t){if(e==null)return{};var n=gN(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gN(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function _N(e){var t=e.event,n=e.props,r=e.refresh,i=e.store,a=hN(e,lN);if(t.key===`ArrowUp`||t.key===`ArrowDown`){var o=function(){var e=Gj(i.getState()),t=n.environment.document.getElementById(Kj(n.id,`item-${i.getState().activeItemId}`,e==null?void 0:e.source));t&&(t.scrollIntoViewIfNeeded?t.scrollIntoViewIfNeeded(!1):t.scrollIntoView(!1))},s=function(){var e=Gj(i.getState());if(i.getState().activeItemId!==null&&e){var n=e.item,o=e.itemInputValue,s=e.itemUrl,c=e.source;c.onActive(dN({event:t,item:n,itemInputValue:o,itemUrl:s,refresh:r,source:c,state:i.getState()},a))}};t.preventDefault(),i.getState().isOpen===!1&&(n.openOnFocus||i.getState().query)?oN(dN({event:t,props:n,query:i.getState().query,refresh:r,store:i},a)).then(function(){i.dispatch(t.key,{nextActiveItemId:n.defaultActiveItemId}),s(),setTimeout(o,0)}):(i.dispatch(t.key,{}),s(),o())}else if(t.key===`Escape`)t.preventDefault(),i.dispatch(t.key,null),i.pendingRequests.cancelAll();else if(t.key===`Tab`)i.dispatch(`blur`,null),i.pendingRequests.cancelAll();else if(t.key===`Enter`){if(i.getState().activeItemId===null||i.getState().collections.every(function(e){return e.items.length===0})){var c=Hj(n.plugins,i.pendingRequests);c===void 0?n.debug||i.pendingRequests.cancelAll():c.then(i.pendingRequests.cancelAll);return}t.preventDefault();var l=Gj(i.getState()),u=l.item,d=l.itemInputValue,f=l.itemUrl,p=l.source;if(t.metaKey||t.ctrlKey)f!==void 0&&(p.onSelect(dN({event:t,item:u,itemInputValue:d,itemUrl:f,refresh:r,source:p,state:i.getState()},a)),n.navigator.navigateNewTab({itemUrl:f,item:u,state:i.getState()}));else if(t.shiftKey)f!==void 0&&(p.onSelect(dN({event:t,item:u,itemInputValue:d,itemUrl:f,refresh:r,source:p,state:i.getState()},a)),n.navigator.navigateNewWindow({itemUrl:f,item:u,state:i.getState()}));else if(!t.altKey){if(f!==void 0){p.onSelect(dN({event:t,item:u,itemInputValue:d,itemUrl:f,refresh:r,source:p,state:i.getState()},a)),n.navigator.navigate({itemUrl:f,item:u,state:i.getState()});return}oN(dN({event:t,nextState:{isOpen:!1},props:n,query:d,refresh:r,store:i},a)).then(function(){p.onSelect(dN({event:t,item:u,itemInputValue:d,itemUrl:f,refresh:r,source:p,state:i.getState()},a))})}}}function vN(e){"@babel/helpers - typeof";return vN=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},vN(e)}var yN=[`props`,`refresh`,`store`],bN=[`inputElement`,`formElement`,`panelElement`],xN=[`inputElement`],SN=[`inputElement`,`maxLength`],CN=[`source`],wN=[`item`,`source`];function TN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function EN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?TN(Object(n),!0).forEach(function(t){DN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function DN(e,t,n){return t=ON(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ON(e){var t=kN(e,`string`);return vN(t)===`symbol`?t:String(t)}function kN(e,t){if(vN(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(vN(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function AN(e,t){if(e==null)return{};var n=jN(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function jN(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function MN(e){var t=e.props,n=e.refresh,r=e.store,i=AN(e,yN);return{getEnvironmentProps:function(e){var n=e.inputElement,i=e.formElement,a=e.panelElement,o=AN(e,bN);function s(e){!(r.getState().isOpen||!r.pendingRequests.isEmpty())||e.target===n||[i,a].some(function(t){return qj(t,e.target)})===!1&&(r.dispatch(`blur`,null),t.debug||r.pendingRequests.cancelAll())}return EN({onTouchStart:s,onMouseDown:s,onTouchMove:function(e){r.getState().isOpen===!1||n!==t.environment.document.activeElement||e.target===n||n.blur()}},o)},getRootProps:function(e){return EN({role:`combobox`,"aria-expanded":r.getState().isOpen,"aria-haspopup":`listbox`,"aria-controls":r.getState().isOpen?r.getState().collections.map(function(e){var n=e.source;return Kj(t.id,`list`,n)}).join(` `):void 0,"aria-labelledby":Kj(t.id,`label`)},e)},getFormProps:function(e){e.inputElement;var a=AN(e,xN),o=function(a){var o;t.onSubmit(EN({event:a,refresh:n,state:r.getState()},i)),r.dispatch(`submit`,null),(o=e.inputElement)==null||o.blur()};return EN({action:``,noValidate:!0,role:`search`,onSubmit:function(e){e.preventDefault();var n=Hj(t.plugins,r.pendingRequests);n===void 0?o(e):n.then(function(){return o(e)})},onReset:function(a){var o;a.preventDefault(),t.onReset(EN({event:a,refresh:n,state:r.getState()},i)),r.dispatch(`reset`,null),(o=e.inputElement)==null||o.focus()}},a)},getLabelProps:function(e){return EN({htmlFor:Kj(t.id,`input`),id:Kj(t.id,`label`)},e)},getInputProps:function(e){var a;function o(e){(t.openOnFocus||r.getState().query)&&oN(EN({event:e,props:t,query:r.getState().completion||r.getState().query,refresh:n,store:r},i)),r.dispatch(`focus`,null)}var s=e||{};s.inputElement;var c=s.maxLength,l=c===void 0?512:c,u=AN(s,SN),d=Gj(r.getState()),f=Yj(((a=t.environment.navigator)==null?void 0:a.userAgent)||``),p=t.enterKeyHint||(d!=null&&d.itemUrl&&!f?`go`:`search`);return EN({"aria-autocomplete":`both`,"aria-activedescendant":r.getState().isOpen&&r.getState().activeItemId!==null?Kj(t.id,`item-${r.getState().activeItemId}`,d==null?void 0:d.source):void 0,"aria-controls":r.getState().isOpen?r.getState().collections.filter(function(e){return e.items.length>0}).map(function(e){var n=e.source;return Kj(t.id,`list`,n)}).join(` `):void 0,"aria-labelledby":Kj(t.id,`label`),value:r.getState().completion||r.getState().query,id:Kj(t.id,`input`),autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,enterKeyHint:p,spellCheck:`false`,autoFocus:t.autoFocus,placeholder:t.placeholder,maxLength:l,type:`search`,onChange:function(e){var a=e.currentTarget.value;if(t.ignoreCompositionEvents&&Zj(e).isComposing){i.setQuery(a);return}oN(EN({event:e,props:t,query:a.slice(0,l),refresh:n,store:r},i))},onCompositionEnd:function(e){oN(EN({event:e,props:t,query:e.currentTarget.value.slice(0,l),refresh:n,store:r},i))},onKeyDown:function(e){Zj(e).isComposing||_N(EN({event:e,props:t,refresh:n,store:r},i))},onFocus:o,onBlur:wA,onClick:function(n){e.inputElement===t.environment.document.activeElement&&!r.getState().isOpen&&o(n)}},u)},getPanelProps:function(e){return EN({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){r.dispatch(`mouseleave`,null)}},e)},getListProps:function(e){var n=e||{},r=n.source,i=AN(n,CN);return EN({role:`listbox`,"aria-labelledby":Kj(t.id,`label`),id:Kj(t.id,`list`,r)},i)},getItemProps:function(e){var a=e.item,o=e.source,s=AN(e,wN);return EN({id:Kj(t.id,`item-${a.__autocomplete_id}`,o),role:`option`,"aria-selected":r.getState().activeItemId===a.__autocomplete_id,onMouseMove:function(e){if(a.__autocomplete_id!==r.getState().activeItemId){r.dispatch(`mousemove`,a.__autocomplete_id);var t=Gj(r.getState());if(r.getState().activeItemId!==null&&t){var o=t.item,s=t.itemInputValue,c=t.itemUrl,l=t.source;l.onActive(EN({event:e,item:o,itemInputValue:s,itemUrl:c,refresh:n,source:l,state:r.getState()},i))}}},onMouseDown:function(e){e.preventDefault()},onClick:function(e){var s=o.getItemInputValue({item:a,state:r.getState()}),c=o.getItemUrl({item:a,state:r.getState()});(c?Promise.resolve():oN(EN({event:e,nextState:{isOpen:!1},props:t,query:s,refresh:n,store:r},i))).then(function(){o.onSelect(EN({event:e,item:a,itemInputValue:s,itemUrl:c,refresh:n,source:o,state:r.getState()},i))})}},s)}}}function NN(e){"@babel/helpers - typeof";return NN=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},NN(e)}function PN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function FN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?PN(Object(n),!0).forEach(function(t){IN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function IN(e,t,n){return t=LN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LN(e){var t=RN(e,`string`);return NN(t)===`symbol`?t:String(t)}function RN(e,t){if(NN(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(NN(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function zN(e){var t,n,r,i,a=e.plugins,o=e.options,s=(t=(((n=o.__autocomplete_metadata)==null?void 0:n.userAgents)||[])[0])==null?void 0:t.segment,c=s?IN({},s,Object.keys(((r=o.__autocomplete_metadata)==null?void 0:r.options)||{})):{};return{plugins:a.map(function(e){return{name:e.name,options:Object.keys(e.__autocomplete_pluginOptions||[])}}),options:FN({"autocomplete-core":Object.keys(o)},c),ua:EA.concat(((i=o.__autocomplete_metadata)==null?void 0:i.userAgents)||[])}}function BN(e){var t,n,r=e.metadata,i=e.environment;if(!((t=i.navigator)==null||(n=t.userAgent)==null)&&n.includes(`Algolia Crawler`)){var a=i.document.createElement(`meta`),o=i.document.querySelector(`head`);a.name=`algolia:metadata`,setTimeout(function(){a.content=JSON.stringify(r),o.appendChild(a)},0)}}function VN(e){var t,n=e.state;return n.isOpen===!1||n.activeItemId===null?null:((t=Gj(n))==null?void 0:t.itemInputValue)||null}function HN(e){"@babel/helpers - typeof";return HN=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},HN(e)}function UN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function WN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?UN(Object(n),!0).forEach(function(t){GN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function GN(e,t,n){return t=KN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KN(e){var t=qN(e,`string`);return HN(t)===`symbol`?t:String(t)}function qN(e,t){if(HN(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(HN(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var JN=function(e,t){switch(t.type){case`setActiveItemId`:return WN(WN({},e),{},{activeItemId:t.payload});case`setQuery`:return WN(WN({},e),{},{query:t.payload,completion:null});case`setCollections`:return WN(WN({},e),{},{collections:t.payload});case`setIsOpen`:return WN(WN({},e),{},{isOpen:t.payload});case`setStatus`:return WN(WN({},e),{},{status:t.payload});case`setContext`:return WN(WN({},e),{},{context:WN(WN({},e.context),t.payload)});case`ArrowDown`:var n=WN(WN({},e),{},{activeItemId:t.payload.hasOwnProperty(`nextActiveItemId`)?t.payload.nextActiveItemId:jj(1,e.activeItemId,xA(e),t.props.defaultActiveItemId)});return WN(WN({},n),{},{completion:VN({state:n})});case`ArrowUp`:var r=WN(WN({},e),{},{activeItemId:jj(-1,e.activeItemId,xA(e),t.props.defaultActiveItemId)});return WN(WN({},r),{},{completion:VN({state:r})});case`Escape`:return e.isOpen?WN(WN({},e),{},{activeItemId:null,isOpen:!1,completion:null}):WN(WN({},e),{},{activeItemId:null,query:``,status:`idle`,collections:[]});case`submit`:return WN(WN({},e),{},{activeItemId:null,isOpen:!1,status:`idle`});case`reset`:return WN(WN({},e),{},{activeItemId:t.props.openOnFocus===!0?t.props.defaultActiveItemId:null,status:`idle`,completion:null,query:``});case`focus`:return WN(WN({},e),{},{activeItemId:t.props.defaultActiveItemId,isOpen:(t.props.openOnFocus||!!e.query)&&t.props.shouldPanelOpen({state:e})});case`blur`:return t.props.debug?e:WN(WN({},e),{},{isOpen:!1,activeItemId:null});case`mousemove`:return WN(WN({},e),{},{activeItemId:t.payload});case`mouseleave`:return WN(WN({},e),{},{activeItemId:t.props.defaultActiveItemId});default:return`${JSON.stringify(t.type)}`,e}};function YN(e){"@babel/helpers - typeof";return YN=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},YN(e)}function XN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ZN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?XN(Object(n),!0).forEach(function(t){QN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function QN(e,t,n){return t=$N(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $N(e){var t=eP(e,`string`);return YN(t)===`symbol`?t:String(t)}function eP(e,t){if(YN(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(YN(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function tP(e){var t=[],n=wM(e,t),r=iM(JN,n,o),i=dM({store:r}),a=MN(ZN({props:n,refresh:s,store:r,navigator:n.navigator},i));function o(e){var t,r,a=e.prevState,o=e.state;if(n.onStateChange(ZN({prevState:a,state:o,refresh:s,navigator:n.navigator},i)),!l()&&(t=o.context)!=null&&(r=t.algoliaInsightsPlugin)!=null&&r.__automaticInsights&&n.insights!==!1){var u=vj({__autocomplete_clickAnalytics:!1});n.plugins.push(u),c([u])}}function s(){return oN(ZN({event:new Event(`input`),nextState:{isOpen:r.getState().isOpen},props:n,navigator:n.navigator,query:r.getState().query,refresh:s,store:r},i))}function c(e){e.forEach(function(e){var r;return(r=e.subscribe)==null?void 0:r.call(e,ZN(ZN({},i),{},{navigator:n.navigator,refresh:s,onSelect:function(e){t.push({onSelect:e})},onActive:function(e){t.push({onActive:e})},onResolve:function(e){t.push({onResolve:e})}}))})}function l(){return n.plugins.some(function(e){return e.name===`aa.algoliaInsightsPlugin`})}if(n.insights&&!l()){var u=typeof n.insights==`boolean`?{}:n.insights;n.plugins.push(vj(u))}return c(n.plugins),BN({metadata:zN({plugins:n.plugins,options:e}),environment:n.environment}),ZN(ZN({refresh:s,navigator:n.navigator},a),i)}B();function nP(){return z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`}))}let rP={before:`Searched for `,separator:`, `,lastSeparator:` and `,after:``};function iP({queries:e,translations:t,onSearchQueryClick:n}){if(e.length===0)return null;if(typeof t.aggregatedToolCallNode==`function`)return z.createElement(z.Fragment,null,t.aggregatedToolCallNode(e,n));let{before:r=``,separator:i=`, `,lastSeparator:a=` and `,after:o=``}=(t.aggregatedToolCallText?t.aggregatedToolCallText(e):rP)||{};return z.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent-Tool Tool--AggregatedResult`},z.createElement(fn,{size:18}),z.createElement(`span`,null,r&&z.createElement(`span`,null,r),e.map((t,r)=>z.createElement(E,{key:t+r},z.createElement(`span`,{role:`button`,tabIndex:0,className:`DocSearch-AskAiScreen-MessageContent-Tool-Query`,onKeyDown:e=>{(e.key===`enter`||e.key===` `)&&(e.preventDefault(),n(t))},onClick:()=>n(t)},`"`,t,`"`),r<e.length-2&&i,r===e.length-2&&a)),o&&z.createElement(`span`,null,o)))}let aP=[`translations`];function oP(e){let{preToolCallText:t=`Searching...`,duringToolCallText:n=`Searching...`,afterToolCallText:r=`Searched for`,savedMemoryToolResultText:i=`Saved to memory`,memoryToolResultText:a=`Used memory to enhance results`}=e;return{preToolCallText:t,searchingText:n,toolCallResultText:r,savedMemoryToolResultText:i,memoryToolResultText:a}}function sP({disclaimerText:e}){return z.createElement(`p`,{className:`DocSearch-AskAiScreen-Disclaimer`},z.createElement(Or,null),` `,e)}function cP({exchange:e,askAiError:t,isLastExchange:n,loadingStatus:r,onSearchQueryClick:i,translations:a,tools:o,conversations:s,onFeedback:c,memoryEnabled:l,onSelectPromptSuggestion:u}){var d,f,p;let{userMessage:m,assistantMessage:h}=e,{stoppedStreamingText:g=`You stopped this response`,errorTitleText:_=`Chat error`,relatedSourcesText:v,suggestedPromptsTitleText:y=`Suggested prompts`}=a,b=R(()=>oP(a),[a]),x=Rk(t),S=R(()=>Lk(h),[h]),C=R(()=>Lk(m),[m]),w=z.useMemo(()=>Fk(h),[h]),T=z.useMemo(()=>nA((h==null?void 0:h.parts)||[]),[h]),E=R(()=>n?Gk((h==null?void 0:h.parts)||[]):[],[h,n]),D=((d=m.metadata)==null?void 0:d.stopped)||(h==null||(f=h.metadata)==null?void 0:f.stopped),O=!D&&(!n||n&&r===`ready`&&!!h),k=[`submitted`,`streaming`].includes(r)&&n&&!T.some(e=>e.type!==`step-start`),A=(h==null?void 0:h.id)||e.id;return z.createElement(`div`,{className:`DocSearch-AskAiScreen-Response-Container`},z.createElement(`div`,{className:`DocSearch-AskAiScreen-Response`},z.createElement(`div`,{className:`DocSearch-AskAiScreen-Message DocSearch-AskAiScreen-Message--user`},z.createElement(`p`,{className:`DocSearch-AskAiScreen-Query`},(p=C==null?void 0:C.text)==null?``:p)),z.createElement(`div`,{className:`DocSearch-AskAiScreen-Message DocSearch-AskAiScreen-Message--assistant`},z.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent`},r===`error`&&t&&n&&!x&&z.createElement(`div`,{className:`DocSearch-AskAiScreen-Error`,role:`alert`},z.createElement(uk,{"aria-hidden":`true`}),z.createElement(`div`,{className:`DocSearch-AskAiScreen-Error-Content`},z.createElement(`h4`,{className:`DocSearch-AskAiScreen-Error-Title`},_),z.createElement(eA,{content:t.message,copyButtonText:``,copyButtonCopiedText:``,isStreaming:!1}))),k&&z.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent-Thinking`,role:`status`},z.createElement(`span`,{className:`shimmer`},a.thinkingText||`Thinking...`),z.createElement(`span`,{className:`DocSearch-AskAi-Thinking-Skeleton shimmer`}),z.createElement(`span`,{className:`DocSearch-AskAi-Thinking-Skeleton DocSearch-AskAi-Thinking-Skeleton--short shimmer`})),T.map((e,t)=>{let n=t;return typeof e==`string`?z.createElement(eA,{key:n,content:e,copyButtonText:a.copyButtonText||`Copy`,copyButtonCopiedText:a.copyButtonCopiedText||`Copied!`,isStreaming:r===`streaming`}):Bk(e)?z.createElement(Zk,{key:n,translations:b,part:e,tools:o,memoryEnabled:l,onSearchQueryClick:i}):e.type===`aggregated-tool-call`?z.createElement(iP,{key:n,queries:e.queries,translations:a,onSearchQueryClick:i}):e.type===`reasoning`&&e.state===`streaming`?z.createElement(`div`,{key:n,className:`DocSearch-AskAiScreen-MessageContent-Reasoning shimmer`},z.createElement(Dr,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}),z.createElement(`span`,{className:`shimmer`},`Reasoning...`)):e.type===`text`?z.createElement(eA,{key:n,content:e.text,copyButtonText:a.copyButtonText||`Copy`,copyButtonCopiedText:a.copyButtonCopiedText||`Copied!`,isStreaming:e.state===`streaming`}):null})),D&&z.createElement(`p`,{className:`DocSearck-AskAiScreen-MessageContent-Stopped`},g)),z.createElement(`div`,{className:`DocSearch-AskAiScreen-Answer-Footer`},z.createElement(Mk,{links:w,titleText:v}),z.createElement(xk,{id:A,showActions:O,latestAssistantMessageContent:(S==null?void 0:S.text)||null,translations:a,conversations:s,onFeedback:c})),E.length>0&&z.createElement(vk,{title:y,suggestions:E,onSelectPromptSuggestion:u})))}function lP(e){let{translations:t={}}=e,n=mn(e,aP),{disclaimerText:r=`Answers are generated with AI which can make mistakes.`,threadDepthExceededMessage:i=`This conversation is now closed to keep responses accurate.`,startNewConversationButtonText:a=`Start a new conversation`}=t,{messages:o,tools:s,askAiError:c,status:l,memoryEnabled:u}=n,d=R(()=>l===`error`&&Rk(c),[l,c]),f=R(()=>{let e=[];for(let n=0;n<o.length;n++)if(o[n].role===`user`){var t;let r=o[n],i=((t=o[n+1])==null?void 0:t.role)===`assistant`?o[n+1]:null;e.push({id:r.id,userMessage:r,assistantMessage:i}),i&&n++}return d&&e.length>0&&(e[e.length-1].assistantMessage||e.pop()),e},[o,d]),p=e=>{n.onAskAiToggle(!1),n.setQuery(e)},m=d&&o.some(e=>e.role===`assistant`);return z.createElement(`div`,{className:`DocSearch-AskAiScreen DocSearch-AskAiScreen-Container`},m&&z.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent DocSearch-AskAiScreen-Error DocSearch-AskAiScreen-Error--ThreadDepth`},z.createElement(`div`,{className:`DocSearch-AskAiScreen-Error-Content`},z.createElement(`p`,null,i,` `,z.createElement(`button`,{type:`button`,className:`DocSearch-ThreadDepthError-Link`,onClick:n.onNewConversation},a),` `,`to continue.`))),z.createElement(sP,{disclaimerText:r}),z.createElement(`div`,{className:`DocSearch-AskAiScreen-Body`},z.createElement(`div`,{className:`DocSearch-AskAiScreen-ExchangesList`},f.slice().reverse().map((e,r)=>z.createElement(cP,{key:e.id,exchange:e,askAiError:n.askAiError,isLastExchange:r===0,loadingStatus:n.status,translations:t,tools:s,conversations:n.conversations,memoryEnabled:u,onSearchQueryClick:p,onFeedback:n.onFeedback,onSelectPromptSuggestion:n.onSelectPromptSuggestion})))))}let uP=[`translations`];function dP(e){let{translations:t={}}=e,n=mn(e,uP),{recentConversationsTitle:r=`Resume AI conversations`,removeRecentConversationButtonTitle:i=`Remove this conversation from history`}=t,a=xp(n.state,`recentConversations`);return a?z.createElement(Pm,_(_({},n),{},{title:r,collection:a,renderIcon:()=>z.createElement(`div`,{className:`DocSearch-Hit-icon DocSearch-Hit-icon--small`},z.createElement(nP,null)),renderAction:({item:e})=>z.createElement(`div`,{className:`DocSearch-Hit-action`},z.createElement(`button`,{className:`DocSearch-Hit-action-button`,title:i,type:`submit`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.conversations.remove(e),n.refresh()}},z.createElement(Mr,null)))})):null}let fP=[`translations`];function pP(e){let{translations:t={}}=e,n=mn(e,fP);return z.createElement(`div`,{className:`DocSearch-Dropdown-Container`},z.createElement(dP,_(_({},n),{},{translations:t})),z.createElement(zm,_(_({},n),{},{translations:t})))}let mP=[`onAskAiToggle`];function hP(e){let{onAskAiToggle:t}=e,n=mn(e,mP),r=z.useMemo(()=>xp(n.state,`recentConversations`),[n.state]);return z.useEffect(()=>{(!r||r.items.length===0)&&t(!0)},[r,t]),r?z.createElement(`div`,{className:`DocSearch-Dropdown-Container DocSearch-Conversation-History`},z.createElement(Pm,_(_({},n),{},{key:r.source.sourceId,title:``,translations:n.translations,collection:r,renderIcon:()=>z.createElement(`div`,{className:`DocSearch-Hit-icon`},z.createElement(Or,null)),renderAction:({item:e})=>z.createElement(`div`,{className:`DocSearch-Hit-action`},z.createElement(`button`,{type:`button`,className:`DocSearch-Hit-action-button`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.conversations.remove(e),n.refresh()}},z.createElement(Mr,null)))}))):null}function gP({translations:e={},suggestedQuestions:t=[],selectSuggestedQuestion:n}){let{newConversationTitle:r=`How can I help you today?`,newConversationDescription:i=`I search through your documentation to help you find setup guides, feature details and troubleshooting tips, fast.`}=e;return z.createElement(`div`,{className:`DocSearch-NewConversationScreen`},z.createElement(`h3`,{className:`DocSearch-NewConversationScreen-Title`},r),z.createElement(`p`,{className:`DocSearch-NewConversationScreen-Description`},i),z.createElement(`div`,{className:`DocSearch-NewConversationScreen-SuggestedQuestions`},t.map(e=>z.createElement(`button`,{key:e.objectID,type:`button`,className:`DocSearch-NewConversationScreen-SuggestedQuestion`,onClick:()=>n(e)},e.question))))}let _P=[`translations`,`selectAskAiQuestion`],vP=z.memo(e=>{var t;let{translations:n={},selectAskAiQuestion:r}=e,i=mn(e,_P),a=z.useCallback(e=>{r(!0,e)},[r]);return i.canHandleAskAi&&i.isAskAiActive&&i.askAiState===`conversation-history`?z.createElement(hP,_({selectAskAiQuestion:r},i)):i.canHandleAskAi&&i.isAskAiActive&&i.askAiState===`new-conversation`?z.createElement(gP,{translations:n==null?void 0:n.newConversation,selectSuggestedQuestion:i.selectSuggestedQuestion,suggestedQuestions:i.suggestedQuestions}):i.isAskAiActive&&i.canHandleAskAi?z.createElement(lP,_(_({},i),{},{messages:i.messages,tools:i.tools,status:i.status,askAiError:i.askAiError,translations:n==null?void 0:n.askAiScreen,memoryEnabled:i.memoryEnabled,selectAskAiQuestion:r,onSelectPromptSuggestion:a})):((t=i.state)==null?void 0:t.status)===`error`?z.createElement(Bm,{translations:n==null?void 0:n.errorScreen}):i.state.query?!i.hasCollections&&!i.canHandleAskAi?z.createElement(Hm,_(_({},i),{},{translations:n==null?void 0:n.noResultsScreen})):z.createElement(z.Fragment,null,z.createElement(Km,_(_({},i),{},{translations:n==null?void 0:n.resultsScreen})),i.canHandleAskAi&&!i.hasCollections&&z.createElement(Hm,_(_({},i),{},{translations:n==null?void 0:n.noResultsScreen}))):z.createElement(pP,_(_({},i),{},{hasCollections:i.hasCollections,translations:n==null?void 0:n.startScreen,selectAskAiQuestion:r}))},function(e,t){return t.state.status===`loading`||t.state.status===`stalled`});function yP({heading:e,shimmer:t=!1}){return z.createElement(`span`,{className:`DocSearch-Modal-heading${t?` shimmer`:``}`},e)}let bP=[`translations`,`askAiState`,`onAskAiToggle`,`setAskAiState`];function xP(e){let{translations:t={},askAiState:n,onAskAiToggle:r,setAskAiState:i}=e,a=mn(e,bP),{clearButtonTitle:o=`Clear`,clearButtonAriaLabel:s=`Clear the query`,closeButtonText:c=`Close`,closeButtonAriaLabel:l=`Close`,searchInputLabel:u=`Search`,backToKeywordSearchButtonText:d=`Back to keyword search`,backToKeywordSearchButtonAriaLabel:f=`Back to keyword search`,placeholderTextAskAiStreaming:p=`Answering...`,newConversationPlaceholder:m=`Ask a question`,conversationHistoryTitle:h=`My conversation history`,startNewConversationText:g=`Start a new conversation`,viewConversationHistoryText:v=`Conversation history`,threadDepthErrorPlaceholder:y=`Conversation limit reached`}=t,b=z.useMemo(()=>{let e=xp(a.state,`recentConversations`);return e?e.items.length>0:!1},[a.state]),x=a.getInputProps({inputElement:a.inputRef.current,autoFocus:a.autoFocus}),S=new Set([`ArrowUp`,`ArrowDown`,`Enter`]),C=x.onKeyDown,w=x.onChange,T=a.askAiStatus===`streaming`||a.askAiStatus===`submitted`,E=a.isAskAiActive&&n!==`conversation-history`,D=a.isThreadDepthError||!1,O=a.placeholder;n===`new-conversation`&&(O=m),D&&a.isAskAiActive&&(O=y);let k=null;T&&(k=p),n===`conversation-history`&&(k=h),z.useEffect(()=>{a.askAiStatus!==`streaming`&&a.askAiStatus!==`submitted`&&a.inputRef.current&&a.inputRef.current.focus()},[a.askAiStatus,a.inputRef]);let A={enterKeyHint:a.isAskAiActive?`enter`:`search`,onKeyDown:e=>{let t=!1;if(a.isAskAiActive&&S.has(e.key)&&(e.key===`Enter`&&!T&&a.state.query&&a.onAskAgain(a.state.query),t=!0),t){e.preventDefault(),e.stopPropagation();return}C==null||C(e)},onChange:e=>{if(a.isAskAiActive){a.setQuery(e.currentTarget.value),e.preventDefault(),e.stopPropagation();return}w==null||w(e)},disabled:T||D&&a.isAskAiActive},j=z.useCallback(()=>{if(D){a.onNewConversation();return}if(n===`conversation-history`){r(!0),i(`initial`);return}r(!1)},[n,D,r,i,a]),M=a.isAskAiActive?z.createElement(`button`,{type:`button`,tabIndex:0,className:`DocSearch-Action DocSearch-AskAi-Return`,title:d,"aria-label":f,onClick:j},z.createElement(_k,null)):void 0,ee=k?z.createElement(yP,{heading:k,shimmer:T}):null,N=z.createElement(z.Fragment,null,!a.isAskAiActive&&z.createElement(z.Fragment,null,z.createElement(`button`,{className:`DocSearch-Clear`,type:`reset`,"aria-label":s,hidden:!a.state.query,tabIndex:a.state.query?0:-1,"aria-hidden":a.state.query?`false`:`true`},o),a.state.query&&z.createElement(`div`,{className:`DocSearch-Divider`})),T&&z.createElement(z.Fragment,null,z.createElement(`button`,{type:`button`,className:`DocSearch-Action DocSearch-StopStreaming`,onClick:a.onStopAskAiStreaming},z.createElement(dk,null)),z.createElement(`div`,{className:`DocSearch-Divider`})),E&&z.createElement(z.Fragment,null,z.createElement(aA,null,z.createElement(aA.Trigger,{className:`DocSearch-Action`},z.createElement(fk,null)),z.createElement(aA.Content,null,z.createElement(aA.Item,{onClick:a.onNewConversation},z.createElement(mk,null),g),b&&z.createElement(aA.Item,{onClick:a.onViewConversationHistory},z.createElement(pk,null),v))),z.createElement(`div`,{className:`DocSearch-Divider`})));return z.createElement(sm,_(_({},a),{},{placeholder:O,clearButtonTitle:o,clearButtonAriaLabel:s,closeButtonText:c,closeButtonAriaLabel:l,searchInputLabel:u,leadingElement:M,inputOverlay:ee,hideInput:!!k,actionsBeforeClose:N,inputProps:A}))}let SP={value:``,matchLevel:`none`,matchedWords:[]},CP={lvl0:SP,lvl1:SP,lvl2:SP,lvl3:SP,lvl4:SP,lvl5:SP,lvl6:SP},wP={content:SP,hierarchy:CP,hierarchy_camel:[]},TP={content:SP,hierarchy:CP,hierarchy_camel:[]};function EP({conversations:e,disableUserPersonalization:t,setMessages:n,onAskAiToggle:r}){return[{sourceId:bp.recentConversations,getItems(){return t?[]:e.getAll().slice(0,3)},onSelect({item:e}){e.messages&&(n(e.messages),r(!0))}}]}function DP({query:e,objectID:t,lvl0:n}){return{type:`askAI`,query:e,url_without_anchor:``,objectID:t,content:null,url:``,anchor:null,hierarchy:{lvl0:n,lvl1:e,lvl2:null,lvl3:null,lvl4:null,lvl5:null,lvl6:null},_highlightResult:wP,_snippetResult:TP,__docsearch_parent:null}}async function OP({query:e,indexName:t,searchClient:n,hitsPerPage:r=3}){try{let{results:i}=await n.search({requests:[{query:e,indexName:t,hitsPerPage:r,attributesToRetrieve:[`prompt`]}]});return i[0].hits.map(e=>DP({query:e.prompt,objectID:e.objectID,lvl0:`Prompt Suggestions`}))}catch(e){return[]}}async function kP({query:e,handleSelectAskAiQuestion:t,promptSuggestionsOptions:n,searchClient:r}){let i=n?await OP({query:e,indexName:n.indexName,hitsPerPage:n.hitsPerPage,searchClient:r}):[];return[{sourceId:bp.askAI,getItems(){return[DP({query:e,objectID:`ask-ai-button`,lvl0:`Ask AI`}),...i]},onSelect({item:e}){e.type===`askAI`&&e.query&&t(!0,e.query)}}]}let AP=`appId.apiKey.askAi.maxResultsPerGroup.theme.onClose.transformItems.hitComponent.resultsFooterComponent.navigator.initialScrollY.transformSearchClient.disableUserPersonalization.initialQuery.translations.getMissingResultsUrl.insights.onAskAiToggle.interceptAskAiEvent.isAskAiActive.recentSearchesLimit.recentSearchesWithFavoritesLimit.indices.indexName.searchParameters.facets.isHybridModeSupported`.split(`.`),jP=[`footer`,`searchBox`,`facets`];function MP(e){var t,n,r,i;let{appId:a,apiKey:o,askAi:s,maxResultsPerGroup:c,theme:l,onClose:u=jp,transformItems:d=kp,hitComponent:f=dm,resultsFooterComponent:p=()=>null,navigator:m,initialScrollY:h=0,transformSearchClient:g=kp,disableUserPersonalization:v=!1,initialQuery:y=``,translations:b={},getMissingResultsUrl:x,insights:S=!1,onAskAiToggle:C,interceptAskAiEvent:w,isAskAiActive:T=!1,recentSearchesLimit:E=7,recentSearchesWithFavoritesLimit:D=4,indices:O=[],indexName:k,searchParameters:A,facets:j,isHybridModeSupported:M=!1}=e,ee=mn(e,AP),{footer:N,searchBox:te,facets:ne}=b,P=mn(b,jP),[re,ie]=z.useState({query:``,collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:`idle`}),ae=!!s,oe=(b==null||(t=b.searchBox)==null?void 0:t.placeholderText)||ee.placeholder||`Search docs`;if(ae){var se;oe=(b==null||(se=b.searchBox)==null?void 0:se.placeholderText)||`Search docs or ask AI a question`}if(T){var ce;oe=(b==null||(ce=b.searchBox)==null?void 0:ce.placeholderTextAskAi)||`Ask another question...`}let{containerRef:le,modalRef:F,formElementRef:ue,dropdownRef:de,inputRef:fe,snippetLength:pe}=bm(),{initialQuery:me,initialQueryFromSelection:he}=hm(y),I=qr(a,o,g),ge=typeof s==`object`?s:null,_e=ge?ge.assistantId:s,ve=ge==null?void 0:ge.searchParameters,[ye,be]=z.useState(`initial`),xe=hA({assistantId:_e,searchClient:I,suggestedQuestionsEnabled:ge==null?void 0:ge.suggestedQuestions}),Se=(n=ge==null||(r=ge.memory)==null?void 0:r.enabled)!=null&&n,Ce=(i=ge==null?void 0:ge.tools)==null?zk:i,we=z.useMemo(()=>Xm({indexName:k,indices:O,searchParameters:A}),[k,O,A]),Te=we[0].name,Ee=z.useRef(void 0),{visibleFacets:De,facetSelections:Oe,facetSelectionsRef:ke,handleFacetSelectionChange:Ae,clearFacetSelections:je}=pm({facets:j,indexes:we,searchClient:I,onSelectionsChange:()=>{var e;return(e=Ee.current)==null?void 0:e.refresh()}}),{favoriteSearches:Me,recentSearches:Ne}=wm({defaultIndexName:Te,recentSearchesLimit:E,recentSearchesWithFavoritesLimit:D}),[Pe,Fe]=z.useState(!1),{chatId:Ie,messages:L,status:Le,setMessages:R,sendMessage:Re,stopAskAiStreaming:ze,askAiError:Be,sendFeedback:Ve,conversations:He,startNewConversation:Ue,restoreConversation:We}=mA({assistantId:_e,apiKey:(ge==null?void 0:ge.apiKey)||o,appId:(ge==null?void 0:ge.appId)||a,indexName:(ge==null?void 0:ge.indexName)||Te,searchParameters:ve,tools:Ce,memory:ge==null?void 0:ge.memory,indices:ge==null?void 0:ge.indices}),Ge=z.useRef(Le);z.useEffect(()=>{if(!v){if(Ge.current===`streaming`&&Le===`ready`){Pe&&L.at(-1)&&(L.at(-1).metadata={stopped:!0});for(let e of L[0].parts)e.type===`text`&&He.add(Ik(e.text,L,Ie))}Ge.current=Le}},[Le,L,He,v,Pe,Ie]);let Ke=z.useMemo(()=>Le===`error`&&Rk(Be),[Le,Be]),qe=Cm({favoriteSearches:Me,recentSearches:Ne,disableUserPersonalization:v}),Je=mm(re),Ye=z.useCallback((e,t,n=void 0)=>{if(e){let e={query:t,suggestedQuestionId:n==null?void 0:n.objectID};if(w!=null&&w(e)){Ee.current&&Ee.current.setQuery(``);return}}if(e&&ye===`new-conversation`&&be(`initial`),C(e,{query:t,suggestedQuestionId:n==null?void 0:n.objectID}),M)return;Fe(!1);let r={};if(n&&(r.body={suggestedQuestionId:n.objectID}),Re({role:`user`,parts:[{type:`text`,text:t}]},r),de.current){let e=de.current;typeof e.scrollTo==`function`?e.scrollTo({top:0,behavior:`smooth`}):e.scrollTop=0}Ee.current&&Ee.current.setQuery(``)},[ye,C,M,Re,de,w]),Xe=z.useCallback(async(e,t)=>{!_e||!a||await Ve(e,t)},[_e,a,Ve]);Ee.current||(Ee.current=tP({id:`docsearch`,defaultActiveItemId:0,openOnFocus:!0,initialState:{query:me,context:{searchSuggestions:[]}},insights:!!S,navigator:m,onStateChange(e){ie(e.state)},async getSources({query:e,state:t,setContext:n,setStatus:r}){if(!e){let e=Jm({recentSearches:Ne,favoriteSearches:Me,saveRecentSearch:qe,onClose:u,disableUserPersonalization:v});return[...ae?EP({conversations:He,disableUserPersonalization:v,setMessages:R,onAskAiToggle:C}):[],...e]}let i=Ym({query:e,state:{context:t.context},setContext:n,setStatus:r,searchClient:I,indexes:we,snippetLength:pe,insights:!!S,appId:a,apiKey:o,maxResultsPerGroup:c,transformItems:d,saveRecentSearch:qe,onClose:u,facetSelections:ke}),s=ae?kP({query:e,handleSelectAskAiQuestion:Ye,promptSuggestionsOptions:ge==null?void 0:ge.promptSuggestions,searchClient:I}):Promise.resolve([]),[l,f]=await Promise.all([s,i]);return[...l,...f]}}));let Ze=Ee.current,{getEnvironmentProps:Qe,getRootProps:$e,refresh:et}=Ze;ym({getEnvironmentProps:Qe,containerRef:le,dropdownRef:de,formElementRef:ue,inputRef:fe,initialScrollY:h,modalRef:F,snippetLength:pe,theme:l}),z.useEffect(()=>{de.current&&!T&&Fp(de.current)},[re.query,T,de]),xm({initialQuery:me,inputRef:fe,refresh:et});let tt=L.length>0;z.useEffect(()=>{T||(Ze.refresh(),tt&&Ue())},[T,Ze,Ue,tt]),z.useEffect(()=>{be(`initial`)},[T,be]);let nt=async()=>{Fe(!0),await ze()},rt=()=>{Ue(),be(`new-conversation`)},it=()=>{be(`conversation-history`)},at=e=>{Ye(!0,e.question,e)},ot=!0,st=re.collections.some(e=>e.source.sourceId!==bp.askAI&&e.items.length>0);return re.status===`idle`&&st===!1&&re.query.length===0&&!T&&(ot=!1),z.createElement(cm,{state:re,containerRef:le,modalRef:F,formElementRef:ue,dropdownRef:de,getRootProps:$e,showDropdown:ot,searchBox:z.createElement(xP,_(_({},Ze),{},{state:re,placeholder:oe||`Search docs`,autoFocus:me.length===0,inputRef:fe,isFromSelection:!!me&&me===he,translations:te,isAskAiActive:T,askAiStatus:Le,askAiError:Be,askAiState:ye,setAskAiState:be,isThreadDepthError:Ke&&ye!==`new-conversation`,onClose:u,onAskAiToggle:C,onAskAgain:e=>{Ye(!0,e)},onStopAskAiStreaming:nt,onNewConversation:rt,onViewConversationHistory:it})),filterBar:!T&&re.query!==``?z.createElement(am,{facets:De,selections:Oe,translations:ne,clearSelections:je,onSelectionChange:Ae}):null,screenState:z.createElement(vP,_(_({},Ze),{},{indexName:Te,state:re,hitComponent:f,resultsFooterComponent:p,disableUserPersonalization:v,recentSearches:Ne,favoriteSearches:Me,conversations:He,inputRef:fe,translations:P,getMissingResultsUrl:x,isAskAiActive:T,canHandleAskAi:ae,messages:L,tools:Ce,askAiError:Be,status:Le,hasCollections:st,askAiState:ye,selectAskAiQuestion:Ye,suggestedQuestions:xe,selectSuggestedQuestion:at,memoryEnabled:Se,resultBadgeKey:ee.resultBadgeKey,onAskAiToggle:C,onNewConversation:rt,onItemClick:(e,t)=>{if(e.type===`askAI`&&e.query){if(e.anchor===`stored`&&`messages`in e){let n=e.messages;We(n,e.chatId);let r={query:e.query,messageId:n[0].id};if(w!=null&&w(r)){Ee.current&&Ee.current.setQuery(``),t.preventDefault();return}C(!0,r)}else Ye(!0,e.query);be(`initial`),t.preventDefault();return}Je(e),qe(e),Ap(t)||u()},onFeedback:Xe})),footer:z.createElement(um,{translations:N,isAskAiActive:T}),onClose:u})}function NP(e){"@babel/helpers - typeof";return NP=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},NP(e)}function PP(e,t){if(NP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(NP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function FP(e){var t=PP(e,`string`);return NP(t)==`symbol`?t:t+``}function IP(e,t,n){return(t=FP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function RP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?LP(Object(n),!0).forEach(function(t){IP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let zP={"Ctrl/Cmd+K":!0,"/":!0,"Ctrl/Cmd+I":!0};function BP(e){return RP(RP({},zP),e)}B();function VP(e){let t=e.composedPath()[0],n=t.tagName;return t.isContentEditable||n===`INPUT`||n===`SELECT`||n===`TEXTAREA`}function HP({isOpen:e,isAskAiActive:t,onAskAiToggle:n,onClose:r,onOpen:i,keyboardShortcuts:a=zP}){z.useEffect(()=>{function o(o){var s;if(e&&o.code===`Escape`&&t){n(!1);return}let c=a[`Ctrl/Cmd+K`]&&((s=o.key)==null?void 0:s.toLowerCase())===`k`&&(o.metaKey||o.ctrlKey),l=a[`/`]&&o.key===`/`;(o.code===`Escape`&&e||c||!VP(o)&&l&&!e)&&(o.preventDefault(),e?r():document.body.classList.contains(`DocSearch--active`)||i())}return window.addEventListener(`keydown`,o),()=>{window.removeEventListener(`keydown`,o)}},[e,t,a,i,r,n])}B();let UP=()=>{let[e,t]=z.useState(!1);return z.useEffect(()=>{let e=()=>{let e=window.matchMedia(`(max-width: 768px)`);t(e.matches)};return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]),e};function WP(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function GP(e,t){if(e==null)return{};var n,r,i=WP(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}let KP=[`children`,`theme`,`onReady`,`onOpen`,`onClose`,`onSidepanelOpen`,`onSidepanelClose`],qP=z.createContext(void 0);qP.displayName=`DocSearchContext`;function JP(e,t){let{children:n,theme:r,onReady:i,onOpen:a,onClose:o,onSidepanelOpen:s,onSidepanelClose:c}=e,l=GP(e,KP),[u,d]=z.useState(`ready`),[f,p]=z.useState(l.initialQuery||``),m=z.useRef(null),h=BP(l.keyboardShortcuts),[g,_]=z.useState(),[v,y]=z.useState(()=>new Set),b=UP(),x=z.useRef(`ready`),S=[`modal-search`,`modal-askai`].includes(u),C=u===`modal-askai`,w=!b&&v.has(`sidepanel`),T=u===`sidepanel`;z.useEffect(()=>{i==null||i()},[i]),z.useEffect(()=>{let e=x.current,t=u;(t===`modal-search`||t===`modal-askai`)&&e!==`modal-search`&&e!==`modal-askai`&&(a==null||a()),t===`ready`&&(e===`modal-search`||e===`modal-askai`)&&(o==null||o()),t===`sidepanel`&&e!==`sidepanel`&&(s==null||s()),t!==`sidepanel`&&e===`sidepanel`&&(c==null||c()),x.current=t},[u,a,o,s,c]);let E=z.useCallback(()=>{d(`modal-search`)},[]),D=z.useCallback(()=>{var e,t;d(`ready`),(e=m.current)==null||e.focus(),p((t=l.initialQuery)==null?``:t)},[d,l.initialQuery]),O=z.useCallback((e,t)=>{if(!b&&e&&w){_(t),d(`sidepanel`);return}d(e?`modal-askai`:`modal-search`)},[d,b,w]),k=z.useCallback(e=>{v.has(`sidepanel`)&&(_(e),d(`sidepanel`))},[d,v]),A=z.useCallback(e=>{d(`modal-search`),p(e.key)},[d,p]),j=z.useCallback(e=>{v.has(e)||y(t=>{let n=new Set(t);return n.add(e),n})},[v]);z.useImperativeHandle(t,()=>({open:E,close:D,openAskAi:e=>O(!0,e),openSidepanel:k,get isReady(){return!0},get isOpen(){return S},get isSidepanelOpen(){return T},get isSidepanelSupported(){return w}}),[E,D,O,k,S,T,w]),hn({theme:r}),HP({isOpen:S,onOpen:E,onClose:D,onAskAiToggle:O,onInput:A,isAskAiActive:C,searchButtonRef:m,keyboardShortcuts:h});let M=z.useMemo(()=>({docsearchState:u,setDocsearchState:d,searchButtonRef:m,initialQuery:f,keyboardShortcuts:h,openModal:E,closeModal:D,isAskAiActive:C,isModalActive:S,onAskAiToggle:O,initialAskAiMessage:g,registerView:j,isHybridModeSupported:w}),[u,m,f,h,E,D,C,S,O,g,j,w]);return z.createElement(qP.Provider,{value:M},n)}let YP=z.forwardRef(JP);YP.displayName=`DocSearch`;function XP(){let e=z.useContext(qP);if(e===void 0)throw Error("`useDocSearch` must be used within the `DocSearch` provider");return e}B();function ZP(e,t){return z.createElement(YP,_(_({},e),{},{ref:t}),z.createElement($P,e))}let QP=z.forwardRef(ZP);function $P(e){var t,n,r;let{searchButtonRef:i,keyboardShortcuts:a,isModalActive:o,isAskAiActive:s,initialQuery:c,onAskAiToggle:l,openModal:u,closeModal:d,isHybridModeSupported:f}=XP();return z.createElement(z.Fragment,null,z.createElement(vn,{keyboardShortcuts:a,ref:i,translations:(t=e.translations)==null?void 0:t.button,onClick:u}),o&&Dt(z.createElement(MP,_(_({},e),{},{initialScrollY:window.scrollY,initialQuery:c,translations:e==null||(n=e.translations)==null?void 0:n.modal,isAskAiActive:s,isHybridModeSupported:f,onAskAiToggle:l,onClose:d})),(r=e.portalContainer)==null?document.body:r))}var eF=function(e,t,n,r){var i;t[0]=0;for(var a=1;a<t.length;a++){var o=t[a++],s=t[a]?(t[0]|=o?1:2,n[t[a++]]):t[++a];o===3?r[0]=s:o===4?r[1]=Object.assign(r[1]||{},s):o===5?(r[1]=r[1]||{})[t[++a]]=s:o===6?r[1][t[++a]]+=s+``:o?(i=e.apply(s,eF(e,s,n,[``,null])),r.push(i),s[0]?t[0]|=2:(t[a-2]=0,t[a]=i)):r.push(s)}return r},tF=new Map;function nF(e){var t=tF.get(this);return t||(t=new Map,tF.set(this,t)),(t=eF(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,r=1,i=``,a=``,o=[0],s=function(e){r===1&&(e||(i=i.replace(/^\s*\n\s*|\s*\n\s*$/g,``)))?o.push(0,e,i):r===3&&(e||i)?(o.push(3,e,i),r=2):r===2&&i===`...`&&e?o.push(4,e,0):r===2&&i&&!e?o.push(5,0,!0,i):r>=5&&((i||!e&&r===5)&&(o.push(r,0,i,n),r=6),e&&(o.push(r,e,0,n),r=6)),i=``},c=0;c<e.length;c++){c&&(r===1&&s(),s(c));for(var l=0;l<e[c].length;l++)t=e[c][l],r===1?t===`<`?(s(),o=[o],r=3):i+=t:r===4?i===`--`&&t===`>`?(r=1,i=``):i=t+i[0]:a?t===a?a=``:i+=t:t===`"`||t===`'`?a=t:t===`>`?(s(),r=1):r&&(t===`=`?(r=5,n=i,i=``):t===`/`&&(r<5||e[c][l+1]===`>`)?(s(),r===3&&(o=o[0]),r=o,(o=o[0]).push(2,0,r),r=0):t===` `||t===` `||t===`
175
+ `||t===`\r`?(s(),r=2):i+=t),r===3&&i===`!--`&&(r=4,o=o[0])}return s(),o}(e)),t),arguments,[])).length>1?t:t[0]}B();let rF=[`container`,`environment`,`transformSearchClient`,`hitComponent`,`resultsFooterComponent`];function iF(e,t){if(typeof e!=`string`)return e;if(!t)throw Error(`Cannot resolve a selector without a browser environment.`);let n=t.document.querySelector(e);if(!n)throw Error(`Container selector did not match any element: "${e}"`);return n}let aF=nF.bind(C);function oF(e){if(e)return t=>{let n=e(t,{html:aF});return Pt(n)?n:typeof n==`function`?n(t):typeof n==`string`?C(`span`,null,n):n}}function sF(e,t){return n=>{let r=n,{container:i,environment:a,transformSearchClient:o,hitComponent:s,resultsFooterComponent:c}=r,l=yr(r,rF),u=iF(i,a||(typeof window<`u`?window:void 0)),d=T(),f=!1;return Ot(C(e,H(H({},l),{},{ref:d,hitComponent:oF(s),resultsFooterComponent:oF(c),transformSearchClient:e=>(typeof e==`object`&&e&&`addAlgoliaAgent`in e&&typeof e.addAlgoliaAgent==`function`&&e.addAlgoliaAgent(`docsearch.js`,t),typeof o==`function`?o(e):e)})),u),f=!0,{open(){var e;(e=d.current)==null||e.open()},close(){var e;(e=d.current)==null||e.close()},openAskAi(e){var t;(t=d.current)==null||t.openAskAi(e)},get isReady(){return f},get isOpen(){var e,t;return(e=(t=d.current)==null?void 0:t.isOpen)!=null&&e},destroy(){Rt(u),f=!1}}}}return sF(QP,bn)});
176
+ //# sourceMappingURL=index.js.map