@docsearch/js 5.0.0-beta.0 → 5.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/umd/index.js CHANGED
@@ -1,9 +1,9 @@
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]===`
1
+ /*! @docsearch/js 5.0.0-beta.2 (UNRELEASED c7e1a88) | 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?Oe.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?++he:i,__i:-1,__u:0};return i==null&&L.vnode!=null&&L.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)||!ge.push(e)||ve++)&&_e==L.debounceRendering||((_e=L.debounceRendering)||queueMicrotask)(j)}function j(){for(var e,t,n,r,i,a,o,s,c=1;ge.length;)ge.length>c&&ge.sort(ye),e=ge.shift(),c=ge.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=ke({},r)).__v=r.__v+1,L.vnode&&L.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)));ve=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||Ee,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?Te:y[m.__i]||Te,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):De(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`||(De(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(be,`$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=xe,e.addEventListener(t,a?Ce:Se,a)):e.removeEventListener(t,a?Ce:Se,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=xe++;else if(t.u<n.l)return;return n(L.event?L.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=L.__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=ke({},f.__s)),ke(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=L.__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=ke({},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,De(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);L.__e(e,t,n)}else s=t.__e=le(n.__e,t,n,r,i,a,o,c,l,u);return(d=L.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]);L.__c&&L.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){L.__e(e,t.__v)}})}function ce(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:De(e)?e.map(ce):ke({},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&&(L.__m&&L.__m(t,a),s=!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a=a&&Oe.call(e.childNodes),v=n.props||Te,!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,De(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){L.__e(e,n)}}function ue(e,t,n){var r,i;if(L.unmount&&L.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){L.__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),L.__&&L.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=C(E,null,[e]),i=[],a=[],ae(t,e,r||Te,Te,t.namespaceURI,r?null:t.firstChild?Oe.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=ke({},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?Oe.call(arguments,2):n),w(e.type,o,r||e.key,i||e.ref,null)}function I(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`+we++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}var L,he,ge,_e,ve,ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae=o((()=>{Te={},Ee=[],De=Array.isArray,Oe=Ee.slice,ke=Object.assign,L={__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 ve=0,e}},he=0,D.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ke({},this.state);typeof e==`function`&&(e=e(ke({},n),this.props)),e&&ke(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,ge=[],ve=0,ye=function(e,t){return e.__v.__b-t.__v.__b},be=/(PointerCapture)$|Capture$/i,xe=0,Se=ie(!1),Ce=ie(!0),we=0}));function je(e,t){tt.__h&&tt.__h(Ye,e,$e||t),$e=0;var n=Ye.__H||(Ye.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Me(e){return $e=1,Ne(qe,e)}function Ne(e,t,n){var r=je(Je++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):qe(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);Qe(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Ye,!Ye.__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,Qe(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};Ye.__f=!0;var a=Ye.shouldComponentUpdate,o=Ye.componentWillUpdate;Ye.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)},Ye.shouldComponentUpdate=i}return r.__N||r.__}function Pe(e,t){var n=je(Je++,3);!tt.__s&&Ke(n.__H,t)&&(n.__=e,n.u=t,Ye.__H.__h.push(n))}function Fe(e,t){var n=je(Je++,4);!tt.__s&&Ke(n.__H,t)&&(n.__=e,n.u=t,Ye.__h.push(n))}function R(e){return $e=5,z(function(){return{current:e}},[])}function Ie(e,t,n){$e=6,Fe(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 z(e,t){var n=je(Je++,7);return Ke(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Le(e,t){return $e=8,z(function(){return e},t)}function Re(e){var t=Ye.context[e.__c],n=je(Je++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(Ye)),t.props.value):e.__}function ze(e,t){tt.useDebugValue&&tt.useDebugValue(t?t(e):e)}function Be(e){var t=je(Je++,10),n=Me();return t.__=e,Ye.componentDidCatch||(Ye.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function Ve(){var e=je(Je++,11);if(!e.__){for(var t=Ye.__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 He(){for(var e;e=et.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(We),e.__H.__h.forEach(Ge),e.__H.__h=[]}catch(t){e.__H.__h=[],tt.__e(t,e.__v)}}function Ue(e){var t,n=function(){clearTimeout(r),ct&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);ct&&(t=requestAnimationFrame(n))}function We(e){var t=Ye,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),Ye=t}function Ge(e){var t=Ye;e.__c=e.__(),Ye=t}function Ke(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!Qe(t,e[n])})}function qe(e,t){return typeof t==`function`?t(e):t}var Je,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,ot,st,ct,lt=o((()=>{Ae(),Qe=Object.is,$e=0,et=[],tt=L,nt=tt.__b,rt=tt.__r,it=tt.diffed,at=tt.__c,ot=tt.unmount,st=tt.__,tt.__b=function(e){Ye=null,nt&&nt(e)},tt.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),st&&st(e,t)},tt.__r=function(e){rt&&rt(e),Je=0;var t=(Ye=e.__c).__H;t&&(Xe===Ye?(t.__h=[],Ye.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(We),t.__h.forEach(Ge),t.__h=[],Je=0)),Xe=Ye},tt.diffed=function(e){it&&it(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(et.push(t)!==1&&Ze===tt.requestAnimationFrame||((Ze=tt.requestAnimationFrame)||Ue)(He)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Xe=Ye=null},tt.__c=function(e,t){t.some(function(e){try{e.__h.forEach(We),e.__h=e.__h.filter(function(e){return!e.__||Ge(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],tt.__e(n,e.__v)}}),at&&at(e,t)},tt.unmount=function(e){ot&&ot(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{We(e)}catch(e){t=e}}),n.__H=void 0,t&&tt.__e(t,n.__v))},ct=typeof requestAnimationFrame==`function`})),ut=c({Children:()=>Gt,Component:()=>D,Fragment:()=>E,PureComponent:()=>_t,StrictMode:()=>ln,Suspense:()=>St,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>on,cloneElement:()=>It,createContext:()=>I,createElement:()=>C,createFactory:()=>Mt,createPortal:()=>Et,createRef:()=>T,default:()=>B,findDOMNode:()=>Rt,flushSync:()=>cn,forwardRef:()=>yt,hydrate:()=>Ot,isElement:()=>un,isFragment:()=>Pt,isMemo:()=>Ft,isValidElement:()=>Nt,lazy:()=>Ct,memo:()=>vt,render:()=>Dt,startTransition:()=>pt,unmountComponentAtNode:()=>Lt,unstable_batchedUpdates:()=>zt,useCallback:()=>Le,useContext:()=>Re,useDebugValue:()=>ze,useDeferredValue:()=>mt,useEffect:()=>Pe,useErrorBoundary:()=>Be,useId:()=>Ve,useImperativeHandle:()=>Ie,useInsertionEffect:()=>Bt,useLayoutEffect:()=>Fe,useMemo:()=>z,useReducer:()=>Ne,useRef:()=>R,useState:()=>Me,useSyncExternalStore:()=>dt,useTransition:()=>ht,version:()=>sn});function dt(e,t){var n=t(),r=Me({t:{__:n,u:t}}),i=r[0].t,a=r[1];return Fe(function(){i.__=n,i.u=t,ft(i)&&a({t:i})},[e,n,t]),Pe(function(){return ft(i)&&a({t:i}),e(function(){ft(i)&&a({t:i})})},[e]),n}function ft(e){var t=e.u,n=e.__;try{var r=t();return!Object.is(n,r)}catch(e){return!0}}function pt(e){e()}function mt(e){return e}function ht(){return[!1,pt]}function gt(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 _t(e,t){this.props=e,this.context=t}function vt(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:gt(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 yt(e){function t(t){var n=Vt({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=Ut,t.render=e,t.prototype.isReactComponent=!0,t.displayName=`ForwardRef(`+(e.displayName||e.name)+`)`,t}function bt(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=Vt({},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 bt(e,t,n)})),e}function xt(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 xt(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 St(){this.__u=0,this.o=null,this.__b=null}function Ct(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 wt(e){return this.getChildContext=function(){return e.context},e.children}function Tt(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(wt,{context:t.context},e.__v),t.l)}function Et(e,t){var n=C(Tt,{__v:e,i:t});return n.containerInfo=t,n}function Dt(e,t,n){return t.__k==null&&(t.textContent=``),fe(e,t),typeof n==`function`&&n(),e?e.__c:null}function Ot(e,t,n){return pe(e,t),typeof n==`function`&&n(),e?e.__c:null}function kt(){}function At(){return this.cancelBubble}function jt(){return this.defaultPrevented}function Mt(e){return C.bind(null,e)}function Nt(e){return!!e&&e.$$typeof===Jt}function Pt(e){return Nt(e)&&e.type===E}function Ft(e){return!!e&&!!e.displayName&&(typeof e.displayName==`string`||e.displayName instanceof String)&&e.displayName.startsWith(`Memo(`)}function It(e){return Nt(e)?me.apply(null,arguments):e}function Lt(e){return!!e.__k&&(fe(null,e),!0)}function Rt(e){return e&&(e.__v&&e.__v.__e||e.nodeType===1&&e)||null}function zt(e,t){return e(t)}var Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,on,sn,cn,ln,un,B,V=o((()=>{Ae(),lt(),lt(),Bt=Fe,Vt=Object.assign,Ht=/^(-|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)/,(_t.prototype=new D).isPureReactComponent=!0,_t.prototype.shouldComponentUpdate=function(e,t){return gt(this.props,e)||gt(this.state,t)},Ut=Symbol.for(`react.forward_ref`),Wt=function(e,t,n){return e==null?null:te(te(e).map(t.bind(n)))},Gt={map:Wt,forEach:Wt,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},Kt=L.__e,L.__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)}Kt(e,t,n,r)},qt=L.unmount,L.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),qt&&qt(e)},(St.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]=xt(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)},St.prototype.componentWillUnmount=function(){this.o=[]},St.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]=bt(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)]},Jt=Symbol.for(`react.element`),Yt=/^(?: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]/,Xt=/[A-Z0-9]/g,Zt=typeof document<`u`,Qt=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})}})}),$t=L.event,L.event=function(e){return $t&&(e=$t(e)),e.persist=kt,e.isPropagationStopped=At,e.isDefaultPrevented=jt,e.nativeEvent=e},tn={enumerable:!1,configurable:!0,get:function(){return this.class}},nn=L.vnode,L.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||Zt&&a===`children`&&n===`noscript`||a===`class`||a===`className`)){if(a===`style`&&typeof o==`object`)for(var s in o)typeof o[s]!=`number`||Ht.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`||Qt(t.type)?c===`onfocus`?a=`onfocusin`:c===`onblur`&&(a=`onfocusout`):c=a=`oninput`,c===`oninput`&&r[a=c]&&(a=`oninputCapture`)}else i&&Yt.test(a)?a=a.replace(Xt,`-$&`).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",tn)):(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=Vt({},e.props);for(var n in e.type.defaultProps)t[n]===void 0&&(t[n]=e.type.defaultProps[n]);e.props=t}e.$$typeof=Jt,nn&&nn(e)},rn=L.__r,L.__r=function(e){rn&&rn(e),en=e.__c},an=L.diffed,L.diffed=function(e){an&&an(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),en=null},on={ReactCurrentDispatcher:{current:{readContext:function(e){return en.__n[e.__c].props.value},useCallback:Le,useContext:Re,useDebugValue:ze,useDeferredValue:mt,useEffect:Pe,useId:Ve,useImperativeHandle:Ie,useInsertionEffect:Bt,useLayoutEffect:Fe,useMemo:z,useReducer:Ne,useRef:R,useState:Me,useSyncExternalStore:dt,useTransition:ht}}},sn=`18.3.1`,cn=function(e,t){return e(t)},ln=E,un=Nt,B={useState:Me,useId:Ve,useReducer:Ne,useEffect:Pe,useLayoutEffect:Fe,useInsertionEffect:Bt,useTransition:ht,useDeferredValue:mt,useSyncExternalStore:dt,startTransition:pt,useRef:R,useImperativeHandle:Ie,useMemo:z,useCallback:Le,useContext:Re,useDebugValue:ze,version:`18.3.1`,Children:Gt,render:Dt,hydrate:Ot,unmountComponentAtNode:Lt,createPortal:Et,createElement:C,createContext:I,createFactory:Mt,cloneElement:It,createRef:T,Fragment:E,isValidElement:Nt,isElement:un,isFragment:Pt,isMemo:Ft,findDOMNode:Rt,Component:D,PureComponent:_t,memo:vt,forwardRef:yt,flushSync:cn,unstable_batchedUpdates:zt,StrictMode:ln,Suspense:St,lazy:Ct,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:on}}));V();function dn({size:e=20,color:t=`currentColor`}){return B.createElement(`svg`,{width:e,height:e,className:`DocSearch-Search-Icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`},B.createElement(`circle`,{cx:`11`,cy:`11`,r:`8`,stroke:t,fill:`none`,strokeWidth:`1.4`}),B.createElement(`path`,{d:`m21 21-4.3-4.3`,stroke:t,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`}))}function fn(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 pn(e,t){if(e==null)return{};var n,r,i=fn(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}V();let mn=({theme:e})=>{Pe(()=>{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])};V();function hn(){let[e,t]=Me(null);Pe(()=>{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 gn=[`translations`,`keyboardShortcuts`],_n=B.forwardRef((e,t)=>{let{translations:n={},keyboardShortcuts:r}=e,i=pn(e,gn),{buttonText:a=`Search`,buttonAriaLabel:o=`Search`}=n,s=y(r),{actionKeyReactsTo:c,actionKeyAltText:l,actionKeyLabel:u,key:d}=hn();mn({theme:i.theme});let f=s[`Ctrl/Cmd+K`],p=`${l}+k`;return B.createElement(`button`,_(_({type:`button`,className:`DocSearch DocSearch-Button`,"aria-label":f?`${o} (${p})`:o,"aria-keyshortcuts":f?p:void 0},i),{},{ref:t}),B.createElement(`span`,{className:`DocSearch-Button-Container`},B.createElement(dn,null),B.createElement(`span`,{className:`DocSearch-Button-Placeholder`},a)),B.createElement(`span`,{className:`DocSearch-Button-Keys`},d!==null&&f&&B.createElement(B.Fragment,null,B.createElement(vn,{reactsToKey:c},u),B.createElement(vn,{reactsToKey:`k`},`K`))))});function vn({reactsToKey:e,children:t}){let[n,r]=Me(!1);return Pe(()=>{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]),B.createElement(`kbd`,{className:n?`DocSearch-Button-Key DocSearch-Button-Key--pressed`:`DocSearch-Button-Key`+(e===`Ctrl`?` DocSearch-Button-Key--ctrl`:``)},t)}let yn=`5.0.0-beta.2`;function bn(e,t){this.v=e,this.k=t}function xn(e){return new bn(e,0)}function Sn(e){return function(){return new Cn(e.apply(this,arguments))}}function Cn(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof bn;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)}Cn.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},Cn.prototype.next=function(e){return this._invoke(`next`,e)},Cn.prototype.throw=function(e){return this._invoke(`throw`,e)},Cn.prototype.return=function(e){return this._invoke(`return`,e)};function wn(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 Tn(t.call(e));n=`@@asyncIterator`,r=`@@iterator`}throw TypeError(`Object is not async iterable`)}function Tn(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 Tn=function(e){this.s=e,this.n=e.next},Tn.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 Tn(e)}function En(e){"@babel/helpers - typeof";return En=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},En(e)}function Dn(e,t){if(En(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(En(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function On(e){var t=Dn(e,`string`);return En(t)==`symbol`?t:t+``}function H(e,t,n){return(t=On(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kn(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 U(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?kn(Object(n),!0).forEach(function(t){H(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function An(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 bn(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 jn(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 Mn(){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 Nn(e){let t=[...e.caches],n=t.shift();return n===void 0?Mn():{get(e,r,i={miss:()=>Promise.resolve()}){return n.get(e,r,i).catch(()=>Nn({caches:t}).get(e,r,i))},set(e,r){return n.set(e,r).catch(()=>Nn({caches:t}).set(e,r))},delete(e){return n.delete(e).catch(()=>Nn({caches:t}).delete(e))},clear(){return n.clear().catch(()=>Nn({caches:t}).clear())}}}function Pn(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 Fn(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 In(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 Ln({algoliaAgents:e,client:t,version:n}){let r=Fn(n).add({segment:t,version:n});return e.forEach(e=>r.add(e)),r}function Rn(){return{debug(e,t){return Promise.resolve()},info(e,t){return Promise.resolve()},error(e,t){return Promise.resolve()}}}var zn=10*1024*1024;function Bn(e){return Vn.apply(this,arguments)}function Vn(){return Vn=Sn(function*(e){let t=e.getReader();try{for(;;){let{done:e,value:n}=yield xn(t.read());if(e)return;yield n}}finally{t.releaseLock()}}),Vn.apply(this,arguments)}function Hn(e){return Symbol.asyncIterator in e?e:Bn(e)}function Un(e){return Wn.apply(this,arguments)}function Wn(){return Wn=Sn(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=wn(Hn(e)),u;o=!(u=yield xn(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
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};
4
+ `,s);if(e===-1&&t===-1){let e=o.slice(s);if(n.push(e),r+=e.length,r>zn)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 xn(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}}),Wn.apply(this,arguments)}var Gn=class{constructor(){H(this,`data`,[]),H(this,`eventType`,``),H(this,`lastEventId`,null),H(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 Kn(e){return qn.apply(this,arguments)}function qn(){return qn=Sn(function*(e){let t=new Gn;var n=!1,r=!1,i;try{for(var a=wn(Un(e)),o;n=!(o=yield xn(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 xn(a.return()))}finally{if(r)throw i}}}),qn.apply(this,arguments)}var Jn=120*1e3;function Yn(e,t=`up`){let n=Date.now();function r(){return t===`up`||Date.now()-n>Jn}function i(){return t===`timed out`&&Date.now()-n<=Jn}return U(U({},e),{},{status:t,lastUpdate:n,isUp:r,isTimedOut:i})}var Xn=class extends Error{constructor(e,t){super(e),H(this,`name`,`AlgoliaError`),t&&(this.name=t)}},Zn=class extends Xn{constructor(e,t,n){super(e,n),H(this,`stackTrace`,void 0),this.stackTrace=t}},Qn=class extends Zn{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`)}},$n=class extends Zn{constructor(e,t,n,r=`ApiError`){super(e,n,r),H(this,`status`,void 0),this.status=t}},er=class extends Xn{constructor(e,t){super(e,`DeserializationError`),H(this,`response`,void 0),this.response=t}},tr=class extends $n{constructor(e,t,n,r){super(e,t,r,`DetailedApiError`),H(this,`error`,void 0),this.error=n}};function nr(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 rr(e,t,n){let r=ir(n),i=`${e.protocol}://${e.url}${e.port?`:${e.port}`:``}/${t.charAt(0)===`/`?t.substring(1):t}`;return r.length&&(i+=`?${r}`),i}function ir(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 ar(e,t){if(e.method===`GET`||e.data===void 0&&t.data===void 0)return;let n=Array.isArray(e.data)?e.data:U(U({},e.data),t.data);return JSON.stringify(n)}function or(e,t,n){let r=U(U(U({Accept:`application/json`},e),t),n),i={};return Object.keys(r).forEach(e=>{let t=r[e];i[e.toLowerCase()]=t}),i}function sr(e){if(!(e.status===204||e.content.length===0))try{return JSON.parse(e.content)}catch(t){throw new er(t.message,e)}}function cr({content:e,status:t},n){try{let r=JSON.parse(e);return`error`in r?new tr(r.message,t,r.error,n):new $n(r.message,t,n)}catch(e){}return new $n(e,t,n)}function lr({isTimedOut:e,status:t}){return!e&&~~t===0}function ur({isTimedOut:e,status:t}){return e||lr({isTimedOut:e,status:t})||~~(t/100)!=2&&~~(t/100)!=4}function dr({status:e}){return~~(e/100)==2}function fr(e){return e.map(e=>pr(e))}function pr(e){let t=e.request.headers[`x-algolia-api-key`]?{"x-algolia-api-key":`*****`}:{};return U(U({},e),{},{request:U(U({},e.request),{},{headers:U(U({},e.request.headers),t)})})}function mr({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(Yn(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=ar(c,l),g=or(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`?U(U({},c.data),l.data):{},x=U(U(U({},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 Qn(fr(m));let a=U(U({},o),l.timeouts),u={data:y,headers:g,method:c.method,url:rr(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(ur(f)){let a=d(f);return f.isTimedOut&&S++,r.info(`Retryable failure`,pr(a)),await t.set(i,Yn(i,f.isTimedOut?`timed out`:`down`)),C(e,n)}if(dr(f))return sr(f);throw d(f),cr(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=Sn(function*(t,r={}){if(!s.sendStream)throw Error(`This requester does not support streaming`);let c=ar(t,r),l=or(n,t.headers,r.headers);l.accept=`text/event-stream`;let u=t.method===`GET`?U(U({},t.data),r.data):{},d=U(U(U({},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 xn(f(e.filter(e=>e.accept===`readWrite`||(p?e.accept===`read`:e.accept===`write`))))).hosts[0];if(!m)throw new Qn([]);let h=U(U({},o),r.timeouts),g={data:c,headers:l,method:t.method,url:rr(m,t.path,d),connectTimeout:h.connect,responseTimeout:p?h.read:h.write};yield*An(wn(Kn(yield xn(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 hr(e,t,n){if(n==null||typeof n==`string`&&n.length===0)throw Error(`Parameter \`${e}\` is required when calling \`${t}\`.`)}function gr(){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 _r(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 vr(e,t){if(e==null)return{};var n,r,i=_r(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 yr=[`appId`,`apiKey`,`authMode`,`algoliaAgents`],br=[`params`],xr=[`compression`];var Sr=`5.55.2`;function Cr(e){return[{url:`${e}-dsn.algolia.net`,accept:`read`,protocol:`https`},{url:`${e}.algolia.net`,accept:`write`,protocol:`https`}].concat(nr([{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 wr(e){let{appId:t,apiKey:n,authMode:r,algoliaAgents:i}=e,a=vr(e,yr),o=In(t,n,r),s=mr(U(U({hosts:Cr(t)},a),{},{algoliaAgent:Ln({algoliaAgents:i,client:`Lite`,version:Sr}),baseHeaders:U(U({"content-type":`text/plain`},o.headers()),a.baseHeaders),baseQueryParameters:U(U({},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){hr(`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}),hr(`getRecommendationsParams`,`getRecommendations`,e),hr(`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=vr(e,br);return n.type===`facet`?U(U(U({},n),t),{},{type:`facet`}):U(U(U({},n),t),{},{facet:void 0,maxFacetHits:void 0,facetQuery:void 0})})}),hr(`searchMethodParams`,`search`,e),hr(`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 Tr(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=vr(r,xr);return wr(U({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:Rn(),requester:gr(),algoliaAgents:[{segment:`Browser`}],authMode:`WithinQueryParameters`,responsesCache:Pn(),requestsCache:Pn({serializable:!1}),hostsCache:Nn({caches:[jn({key:`${Sr}-${e}`}),Pn()]})},a))}V();function Er({className:e}){return B.createElement(`svg`,{viewBox:`0 0 38 38`,className:e,stroke:`currentColor`,strokeOpacity:`.5`},B.createElement(`g`,{fill:`none`,fillRule:`evenodd`},B.createElement(`g`,{transform:`translate(1 1)`,strokeWidth:`2`},B.createElement(`circle`,{strokeOpacity:`.3`,cx:`18`,cy:`18`,r:`18`}),B.createElement(`path`,{d:`M36 18c0-9.94-8.06-18-18-18`},B.createElement(`animateTransform`,{attributeName:`transform`,type:`rotate`,from:`0 18 18`,to:`360 18 18`,dur:`1s`,repeatCount:`indefinite`})))))}function Dr({className:e=``}){return B.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`},B.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`}),B.createElement(`path`,{d:`M20 3v4`}),B.createElement(`path`,{d:`M22 5h-4`}),B.createElement(`path`,{d:`M4 17v2`}),B.createElement(`path`,{d:`M5 18H3`}))}function Or(){return B.createElement(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`},B.createElement(`g`,{stroke:`currentColor`,fill:`none`,fillRule:`evenodd`,strokeLinecap:`round`,strokeLinejoin:`round`},B.createElement(`path`,{d:`M3.18 6.6a8.23 8.23 0 1112.93 9.94h0a8.23 8.23 0 01-11.63 0`}),B.createElement(`path`,{d:`M6.44 7.25H2.55V3.36M10.45 6v5.6M10.45 11.6L13 13`})))}function kr(e){if(e==null)throw TypeError(`Cannot destructure `+e)}function Ar(){return Ar=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},Ar.apply(null,arguments)}function jr(e){let t=Ar({},(kr(e),e));return B.createElement(`svg`,_({width:`20`,height:`20`,viewBox:`0 0 20 20`},t),B.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 Mr=()=>B.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`},B.createElement(`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`}),B.createElement(`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`}),B.createElement(`path`,{d:`M10 9H8`}),B.createElement(`path`,{d:`M16 13H8`}),B.createElement(`path`,{d:`M16 17H8`}));function Nr(e){switch(e.type){case`lvl1`:return B.createElement(Mr,null);case`content`:return B.createElement(Fr,null);default:return B.createElement(Pr,null)}}function Pr(){return B.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`},B.createElement(`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`}),B.createElement(`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`}),B.createElement(`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`}),B.createElement(`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`}))}function Fr(){return B.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`},B.createElement(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),B.createElement(`polyline`,{points:`14 2 14 8 20 8`}),B.createElement(`line`,{x1:`16`,y1:`13`,x2:`8`,y2:`13`}),B.createElement(`line`,{x1:`16`,y1:`17`,x2:`8`,y2:`17`}),B.createElement(`polyline`,{points:`10 9 9 9 8 9`}))}function Ir({translations:e={}}){let{poweredByText:t=`Powered by`}=e;return B.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`},B.createElement(`span`,{className:`DocSearch-Label`},t),B.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`},B.createElement(`defs`,null,B.createElement(`style`,null,`.cls-1,.cls-2{fill:#003dff;}.cls-2{fill-rule:evenodd;}`)),B.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`}),B.createElement(`rect`,{className:`cls-1`,x:`1845.88`,y:`104.73`,width:`62.58`,height:`277.9`,rx:`5.9`,ry:`5.9`}),B.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`}),B.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`}),B.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`}),B.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`}),B.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`}),B.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`}),B.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 Lr(){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 Rr(){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 zr(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(n){if(n instanceof DOMException&&n.name===`QuotaExceededError`)try{Rr(),window.localStorage.setItem(e,JSON.stringify(t))}catch(e){}}}function Br(){typeof window>`u`||!window.localStorage||Lr()>4*1024*1024&&Rr()}function Vr(){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 Hr(e){return Vr()===!1?{setItem(){},getItem(){return[]}}:{setItem(t){zr(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 Ur=[`_highlightResult`,`_snippetResult`];function Wr({key:e,limit:t=5}){let n=Hr(e),r=n.getItem().slice(0,t);return{add(e){let i=e,{_highlightResult:a,_snippetResult:o}=i,s=pn(i,Ur),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 Gr({key:e,limit:t=5}){let n=Hr(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 Kr(e,t,n){return B.useMemo(()=>{let r=Tr(e,t);return r.addAlgoliaAgent(`docsearch`,yn),/docsearch.js \(.*\)/.test(r.transporter.algoliaAgent.value)===!1&&r.addAlgoliaAgent(`docsearch-react`,yn),n(r)},[e,t,n])}function qr(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 Jr=qr(`https://base-ui.com/production-error`,`Base UI`);V();let Yr=I(void 0);function Xr(e){let t=Re(Yr);if(t===void 0&&!e)throw Error(Jr(33));return t}V();let Zr=I(void 0);function Qr(e){let t=Re(Zr);if(t===void 0&&!e)throw Error(Jr(36));return t}V();let $r={};function ei(e,t){let n=R($r);return n.current===$r&&(n.current=e(t)),n}function ti(e,t,n,r){let i=ei(ri).current;return ii(i,e,t,n,r)&&oi(i,[e,t,n,r]),i.callback}function ni(e){let t=ei(ri).current;return ai(t,e)&&oi(t,e),t.callback}function ri(){return{callback:null,cleanup:null,refs:[]}}function ii(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function ai(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function oi(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:}}}}}}V();let si=parseInt(sn,10);function ci(e){return si>=e}V();function li(e){var t;if(!Nt(e))return null;let n=e,r=n.props;return(t=ci(19)?r==null?void 0:r.ref:n.ref)==null?null:t}function ui(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return U(U({},e),t)}function di(){}let fi=Object.freeze([]),pi=Object.freeze({});function mi(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 hi(e,t){return typeof e==`function`?e(t):e}function gi(e,t){return typeof e==`function`?e(t):e}let _i={};function vi(e,t,n,r,i){if(!n&&!r&&!i&&!e)return bi(t);let a=bi(e);return t&&(a=xi(a,t)),n&&(a=xi(a,n)),r&&(a=xi(a,r)),i&&(a=xi(a,i)),a}function yi(e){if(e.length===0)return _i;if(e.length===1)return bi(e[0]);let t=bi(e[0]);for(let n=1;n<e.length;n+=1)t=xi(t,e[n]);return t}function bi(e){return Ti(e)?U({},Ei(e,_i)):Si(e)}function xi(e,t){return Ti(t)?Ei(t,e):Ci(e,t)}function Si(e){let t=U({},e);for(let e in t){let n=t[e];wi(e,n)&&(t[e]=Oi(n))}return t}function Ci(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=ui(e.style,r);break;case`className`:e[n]=Ai(e.className,r);break;default:wi(n,r)?e[n]=Di(e[n],r):e[n]=r}}return e}function wi(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 Ti(e){return typeof e==`function`}function Ei(e,t){return Ti(e)?e(t):e==null?_i:e}function Di(e,t){return t?e?(...n)=>{let r=n[0];if(ji(r)){let i=r;ki(i);let a=t(...n);return i.baseUIHandlerPrevented||e==null||e(...n),a}let i=t(...n);return e==null||e(...n),i}:Oi(t):e}function Oi(e){return e&&((...t)=>{let n=t[0];return ji(n)&&ki(n),e(...t)})}function ki(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Ai(e,t){return t?e?t+` `+e:t:e}function ji(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}V();function Mi(e,t,n={}){var r;let i=t.render,a=Ni(t,n);return n.enabled===!1?null:Ii(e,i,a,(r=n.state)==null?pi:r)}function Ni(e,t={}){var n;let{className:r,style:i,render:a}=e,{state:o=pi,ref:s,props:c,stateAttributesMapping:l,enabled:u=!0}=t,d=u?hi(r,o):void 0,f=u?gi(i,o):void 0,p=u?mi(o,l):pi,m=u&&c?Pi(c):void 0,h=u?(n=ui(p,m))==null?{}:n:pi;return typeof document<`u`&&(u?Array.isArray(s)?h.ref=ni([h.ref,li(a),...s]):h.ref=ti(h.ref,li(a),s):ti(null,null)),u?(d!==void 0&&(h.className=Ai(h.className,d)),f!==void 0&&(h.style=ui(h.style,f)),h):pi}function Pi(e){return Array.isArray(e)?yi(e):vi(void 0,e)}let Fi=Symbol.for(`react.lazy`);function Ii(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=vi(n,t.props);e.ref=n.ref;let i=t;return(i==null?void 0:i.$$typeof)===Fi&&(i=Gt.toArray(t)[0]),It(i,e)}if(e&&typeof e==`string`)return Li(e,n);throw Error(Jr(8))}function Li(e,t){return e===`button`?C(`button`,U(U({type:`button`},t),{},{key:t.key})):e===`img`?C(`img`,U(U({alt:``},t),{},{key:t.key})):C(e,t)}let Ri=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),zi={[Ri.startingStyle]:``},Bi={[Ri.endingStyle]:``},Vi={transitionStatus(e){return e===`starting`?zi:e===`ending`?Bi:null}},Hi=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=Ri.startingStyle]=`startingStyle`,e[e.endingStyle=Ri.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),Ui=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),Wi={[Ui.popupOpen]:``},Gi={[Ui.popupOpen]:``,[Ui.pressed]:``},Ki={[Hi.open]:``},qi={[Hi.closed]:``},Ji={[Hi.anchorHidden]:``},Yi={open(e){return e?Wi:null}},Xi={open(e){return e?Gi:null}},Zi={open(e){return e?Ki:qi},anchorHidden(e){return e?Ji:null}};V();let Qi=I(void 0);function $i(e=!0){let t=Re(Qi);if(t===void 0&&!e)throw Error(Jr(25));return t}let ea=`trigger-press`,ta=`trigger-hover`,na=`trigger-focus`,ra=`item-press`,ia=`focus-out`,aa=`list-navigation`,oa=`sibling-open`,sa=`imperative-action`;V();function ca({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=R(e!==void 0),[a,o]=Me(t);return[i?e:a,Le(e=>{i||o(e)},[])]}function la(){return typeof window<`u`}function ua(e){return pa(e)?(e.nodeName||``).toLowerCase():`#document`}function da(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fa(e){var t;return(t=(pa(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pa(e){return la()?e instanceof Node||e instanceof da(e).Node:!1}function ma(e){return la()?e instanceof Element||e instanceof da(e).Element:!1}function ha(e){return la()?e instanceof HTMLElement||e instanceof da(e).HTMLElement:!1}function ga(e){return!la()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof da(e).ShadowRoot}function _a(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Oa(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function va(e){return/^(table|td|th)$/.test(ua(e))}function ya(e){try{if(e.matches(`:popover-open`))return!0}catch(e){}try{return e.matches(`:modal`)}catch(e){return!1}}let ba=/transform|translate|scale|rotate|perspective|filter/,xa=/paint|layout|strict|content/,Sa=e=>!!e&&e!==`none`,Ca;function wa(e){let t=ma(e)?Oa(e):e;return Sa(t.transform)||Sa(t.translate)||Sa(t.scale)||Sa(t.rotate)||Sa(t.perspective)||!Ea()&&(Sa(t.backdropFilter)||Sa(t.filter))||ba.test(t.willChange||``)||xa.test(t.contain||``)}function Ta(e){let t=Aa(e);for(;ha(t)&&!Da(t);){if(wa(t))return t;if(ya(t))return null;t=Aa(t)}return null}function Ea(){return Ca==null&&(Ca=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`)),Ca}function Da(e){return/^(html|body|#document)$/.test(ua(e))}function Oa(e){return da(e).getComputedStyle(e)}function ka(e){return ma(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Aa(e){if(ua(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ga(e)&&e.host||fa(e);return ga(t)?t.host:t}function ja(e){let t=Aa(e);return Da(t)?(e.ownerDocument||e).body:ha(t)&&_a(t)?t:ja(t)}function Ma(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);let i=ja(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=da(i);if(a){let e=Na(o);return t.concat(o,o.visualViewport||[],_a(i)?i:[],e&&n?Ma(e):[])}else return t.concat(i,Ma(i,[],n))}function Na(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}V();let Pa=U({},ut),Fa=Pa.useInsertionEffect,Ia=Fa&&Fa!==Pa.useLayoutEffect?Fa:e=>e();function La(e){let t=ei(Ra).current;return t.next=e,Ia(t.effect),t.trampoline}function Ra(){let e={next:void 0,callback:za,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function za(){}V();let W=typeof document<`u`?Fe:()=>{};V();let Ba=I(void 0);function Va(e=!1){let t=Re(Ba);if(t===void 0&&!e)throw Error(Jr(16));return t}V();function Ha(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:z(()=>{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])}}V();let Ua=[`onClick`,`onMouseDown`,`onKeyUp`,`onKeyDown`,`onPointerDown`];function Wa(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=R(null),s=Va(!0),c=a==null?s!==void 0:a,{props:l}=Ha({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=Le(()=>{let e=o.current;Ga(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return W(u,[u]),{getButtonProps:Le((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s}=e,u=vr(e,Ua);return vi({onClick(e){if(t){e.preventDefault();return}n==null||n(e)},onMouseDown(e){t||r==null||r(e)},onKeyDown(e){if(t||(ki(e),o==null||o(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,a=e.currentTarget,s=Ga(a),l=!i&&Ka(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(ki(e),a==null||a(e),e.target===e.currentTarget&&i&&c&&Ga(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:La(e=>{o.current=e,u()})}}function Ga(e){return ha(e)&&e.tagName===`BUTTON`}function Ka(e){return!!((e==null?void 0:e.tagName)===`A`&&e!=null&&e.href)}function qa(){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:Ja,platform:Ya,maxTouchPoints:Xa}=qa(),Za=Ja.toLowerCase(),Qa=Ya.toLowerCase(),$a=/^i(os$|p)/.test(Qa)||Qa===`macintel`&&Xa>1,eo=`android`,to=Qa===eo||Za.includes(eo),no=!$a&&Qa.startsWith(`mac`);Qa.startsWith(`win`),!to&&/^(linux|chrome os)/.test(Qa);let ro=no||$a;var io,ao;let oo=typeof CSS<`u`&&!!((io=(ao=CSS).supports)!=null&&io.call(ao,`-webkit-backdrop-filter:none`));!oo&&Za.includes(`firefox`),!oo&&Za.includes(`chrom`);let so=ro,co=/jsdom|happydom/.test(Za);V();function lo(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=$i(!0),f=d!==void 0;return z(()=>({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:ra})},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&&!no&&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])}V();let uo={type:`regular-item`};function fo(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=R(null),{getButtonProps:p,buttonRef:m}=Wa({disabled:d,focusableWhenDisabled:!0,native:s,composite:!0}),h=lo({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:f,itemMetadata:c}),g=Le(e=>vi(h,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,p),[h,p,c]),_=ti(f,m);return z(()=>({getItemProps:g,itemRef:_}),[g,_])}V();let po=I({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function mo(){return Re(po)}V();let ho=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function go(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}=mo(),f=R(-1),[p,m]=Me(a==null?i===ho.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1:a),h=R(null),g=Le(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 W(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),W(()=>{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}}V();let _o=0;function vo(e,t=`mui`){let[n,r]=Me(e),i=e||n;return Pe(()=>{n==null&&(_o+=1,r(`${t}-${_o}`))},[n,t]),i}let yo=Pa.useId;function bo(e,t){if(yo!==void 0){let n=yo();return e==null?t?`${t}-${n}`:n:e}return vo(e,t)}function xo(e){return bo(e,`base-ui`)}let So=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.highlighted=`data-highlighted`,e}({}),Co=U({checked(e){return e?{[So.checked]:``}:{[So.unchecked]:``}}},Vi);function wo(e,t,n,r){let i=!1,a=!1,o=r==null?pi:r;return U({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)}Ae();var To=0;Array.isArray;function Eo(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:--To,__i:-1,__u:0,__source:i,__self:a};return L.vnode&&L.vnode(l),l}V(),V();let Do=[];function Oo(e){Pe(e,Do)}globalThis.requestAnimationFrame;let ko=new class{constructor(){H(this,`callbacks`,[]),H(this,`callbacksCount`,0),H(this,`nextId`,1),H(this,`startId`,1),H(this,`isScheduled`,!1),H(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(){H(this,`currentId`,null),H(this,`cancel`,()=>{this.currentId!==null&&(ko.cancel(this.currentId),this.currentId=null)}),H(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=ei(Ao.create).current;return Oo(e.disposeEffect),e}V();function Mo(e,t=!1,n=!1){let[r,i]=Me(e&&t?`idle`:void 0),[a,o]=Me(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),W(()=>{if(!e&&a&&r!==`ending`&&n){let e=Ao.request(()=>{i(`ending`)});return()=>{Ao.cancel(e)}}},[e,a,r,n]),W(()=>{if(!e||t)return;let n=Ao.request(()=>{i(void 0)});return()=>{Ao.cancel(n)}},[t,e]),W(()=>{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}V();function Po(e,t=!1,n=!0){let r=jo();return La((i,a=null)=>{r.cancel();let o=No(e);if(o==null)return;let s=o,c=()=>{cn(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=Ri.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)})}V();function Fo(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=La(i),o=Po(r,n,!1);Pe(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}V();let Io=I(void 0);function Lo(){let e=Re(Io);if(e===void 0)throw Error(Jr(31));return e}V();let Ro=[`render`,`className`,`style`,`id`],zo=yt(function(e,t){let{render:n,className:r,style:i,id:a}=e,o=vr(e,Ro),s=xo(a),c=Lo();return W(()=>(c(s),()=>{c(void 0)}),[c,s]),Mi(`div`,e,{ref:t,props:U({id:s,role:`presentation`},o)})});var Bo=class e{constructor(){H(this,`currentId`,0),H(this,`clear`,()=>{this.currentId!==0&&(clearTimeout(this.currentId),this.currentId=0)}),H(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=ei(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:to&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Go(e){return co?!1:!to&&e.width===0&&e.height===0||to&&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&&ga(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(!ma(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 ha(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||co)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=ei(hs,e).current;return t.next=e,W(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=U(U({},_s),{},{position:`fixed`,top:0,left:0});U(U({},_s),{},{position:`absolute`}),V();let ys=yt(function(e,t){let[n,r]=Me();W(()=>{so&&oo&&r(`button`)},[]);let i={tabIndex:0,role:n};return Eo(`span`,U(U(U({},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?Oa(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 ga(n)?n.host:null}function nc(e){for(let t of Array.from(e.children))if(ua(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?ua(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&&ua(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=ua(t)===`slot`;if(t.hasAttribute(`inert`)||n&&ua(t)===`details`&&!t.open&&!rc(e,t)||t.hasAttribute(`hidden`)||!r&&!oc(t,n))return!1}return!0}function oc(e,t){let n=Oa(e);return t?n.display!==`none`:ec(e,n)}function sc(e){let t=e.tabIndex;if(t<0){let t=ua(e);if(t===`details`||t===`audio`||t===`video`||ha(e)&&e.isContentEditable)return 0}return t}function cc(e){if(ua(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(ha(e)&&ua(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return ha(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=>{ha(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(),di;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?ga(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=>{ua(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};V();let Kc=[`render`,`className`,`style`,`children`,`container`,`renderGuards`],qc=I(null),Jc=()=>Re(qc),Yc=Dc(`portal`);function Xc(e={}){let{ref:t,container:n,componentProps:r=pi,elementProps:i}=e,a=bo(),o=Jc(),s=o==null?void 0:o.portalNode,[c,l]=Me(null),[u,d]=Me(null),f=La(e=>{e!==null&&d(e)}),p=R(null);W(()=>{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&&(pa(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=Mi(`div`,r,{ref:[t,f],props:[{id:a,[Yc]:``},i]});return{portalNode:u,portalSubtree:c&&m?Et(m,c):null}}let Zc=yt(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:vr(e,Kc)}),u=R(null),d=R(null),f=R(null),p=R(null),[m,h]=Me(null),g=R(!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;Pe(()=>{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,_]),W(()=>{!c||v!==!0||!g.current||(wc(c),g.current=!1)},[v,c]);let b=z(()=>({beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:f,afterInsideRef:p,portalNode:c,setFocusManagerState:h}),[c]);return Eo(E,{children:[l,Eo(qc.Provider,{value:b,children:[y&&c&&Eo(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&&Eo(`span`,{"aria-owns":c.id,style:Gc}),c&&Et(a,c),y&&c&&Eo(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,wo(`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(){H(this,`nodesRef`,{current:[]}),H(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)}};V();let el=I(null),tl=I(null),nl=()=>{var e;return((e=Re(el))==null?void 0:e.id)||null},rl=e=>{let t=Re(tl);return e==null?t:e};function il(e){let t=bo(),n=rl(e),r=nl();return W(()=>{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 Eo(el.Provider,{value:z(()=>({id:n,parentId:r}),[n,r]),children:t})}function ol(e){let{children:t,externalTree:n}=e,r=ei(()=>n==null?new $c:n).current;return Eo(tl.Provider,{value:r,children:t})}V();function sl(e,t){let n=da(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&&ua(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=La(()=>{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=R(!1),M=R(!1),ee=R(!1),N=R(null),te=R(``),ne=R(``),P=R(null),re=R(null),ie=ti(P,f,A==null?void 0:A.beforeInsideRef),ae=ti(re,A==null?void 0:A.afterInsideRef),oe=Vo(),se=Vo(),ce=jo(),le=A!=null,F=os(v),ue=La((e=F)=>e?hc(e):[]),de=La(()=>{var e;return(e=m==null?void 0:m().filter(e=>e!=null))==null?[]:e});Pe(()=>{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]),Pe(()=>{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]),Pe(()=>{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(ha(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;ha(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,wo(ia,t)))})}function a(){ee.current||(b.current.insideReactTree=!0,oe.start(0,()=>{b.current.insideReactTree=!1}))}let l=ha(_)?_: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]),Pe(()=>{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]),W(()=>{if(!g||r||!ha(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]),W(()=>{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&&ua(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&&ha(n)&&(!(!i&&n!==t&&t!==e.body)||r)&&n.focus({preventScroll:!0}),j.current=!1})}},[r,v,F,T,D,y,k,_,x,de]),W(()=>{if(!oo||g||!v)return;let e=Xo(gs(v));!ha(e)||!ns(e)||Zo(v,e)&&e.blur()},[g,v]),W(()=>{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,_]),W(()=>{if(!(r||!F))return pl(F),()=>{queueMicrotask(ll)}},[r,F]);let fe=!r&&(!s||!C)&&(le||s);return Eo(E,{children:[fe&&Eo(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&&Eo(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()}}})]})}V();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=ea}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=R(void 0),f=jo(),p=Vo(),m=z(()=>{function e(e,t,n,r){let i=wo(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 z(()=>n?{reference:m}:pi,[n,m])}V();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=La(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=La(()=>a),{escapeKey:v,outsidePress:y}=_l(s),b=R(!1),x=R(!1),S=R(!1),C=R(!1),w=R(``),T=R(null),E=Vo(),D=Vo(),O=La(()=>{D.clear(),f.current.insideReactTree=!1}),k=La(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=La(e=>es(e,l.select(`floatingElement`))||es(e,l.select(`domReferenceElement`))),j=La(e=>{o()&&l.setOpen(!1,wo(ea,e.nativeEvent))}),M=La(e=>{if(!u||!n||!r||e.key!==`Escape`||C.current||!v&&k(`__escapeKeyBubbles`))return;let t=wo(`escape-key`,Uo(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!v&&!t.isPropagationAllowed&&e.stopPropagation()}),ee=La(()=>{f.current.insideReactTree=!0,D.start(0,O)}),N=La(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=La(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});Pe(()=>{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(oo?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=ma(n)?n.getRootNode():null,a=Array.from((ga(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=ma(n)?n:null;for(;s&&!Da(s);){let e=Aa(s);if(Da(e)||!ma(e))break;s=e}if(!(a.length&&ma(n)&&!ts(n)&&!Zo(n,l.select(`floatingElement`))&&a.every(e=>!Zo(s,e)))){if(ha(n)&&!(`touches`in e)){let t=Da(n),r=Oa(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,wo(`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]),Pe(O,[h,O]);let ne=z(()=>({onKeyDown:M,onPointerDown:j,onClick:j}),[M,j]),P=z(()=>({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 z(()=>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:U(U({},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]=U(U({},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,_=vr(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=vr(i,bl);switch(a){case`referenceHidden`:{let e=Dl(await r.detectOverflow(t,U(U({},o),{},{elementContext:`reference`})),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ol(e)}}}case`escaped`:{let e=Dl(await r.detectOverflow(t,U(U({},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:U(U({},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=vr(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(U(U({},t),{},{[m]:h,[p]:g}));return U(U({},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=vr(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(U(U({},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=Oa(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ha(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 ma(e)?e:e.contextElement}function Rl(e){let t=Ll(e);if(!ha(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=da(e);return!Ea()||!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===da(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?ma(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=da(a),t=ma(r)?da(r):r,n=e,i=Na(n);for(;i&&t!==n;){let e=Rl(i),t=i.getBoundingClientRect(),r=Oa(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=da(i),i=Na(n)}}return qs({width:u,height:d,x:c,y:l})}function Ul(e,t){let n=ka(e).scrollLeft;return t?t.left+n:Hl(fa(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=fa(r),s=t?ya(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ts(1),u=Ts(0),d=ha(r);if((d||!a)&&((ua(r)!==`body`||_a(o))&&(c=ka(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=ka(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 Oa(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=da(e),a=fa(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ea()||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(fa(e));else if(ma(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=Ma(e,[],!1).filter(e=>ma(e)&&ua(e)!==`body`),i=null,a=Oa(e).position===`fixed`,o=a?Aa(e):e;for(;ma(o)&&!Da(o);){let e=Oa(o),t=wa(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Aa(o)}return t.set(e,r),r}function Ql(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ya(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=ha(t),i=fa(t),a=n===`fixed`,o=Hl(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ts(0);if((r||!a)&&((ua(t)!==`body`||_a(i))&&(s=ka(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 Oa(e).position===`static`}function nu(e,t){if(!ha(e)||Oa(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return fa(e)===n&&(n=n.ownerDocument.body),n}function ru(e,t){let n=da(e);if(ya(e))return n;if(!ha(e)){let t=Aa(e);for(;t&&!Da(t);){if(ma(t)&&!tu(t))return t;t=Aa(t)}return n}let r=nu(e,t);for(;r&&va(r)&&tu(r);)r=nu(r,t);return r&&Da(r)&&tu(r)&&!wa(r)?n:r||Ta(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 Oa(e).direction===`rtl`}let ou={convertOffsetParentRelativeRectToViewportRelativeRect:Gl,getDocumentElement:fa,getClippingRect:Ql,getOffsetParent:ru,getElementRects:iu,getClientRects:Kl,getDimensions:$l,getScale:Rl,isElement:ma,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=fa(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,U(U({},v),{},{root:a.ownerDocument}))}catch(e){r=new IntersectionObserver(b,v)}r.observe(e)}let c=da(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?Ma(l):[],...t?Ma(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=U(U(U({},ou),i.platform),{},{_c:r});return Tl(e,t,U(U({},i),{},{platform:a}))};V();var _u=typeof document<`u`?Fe: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=R(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]=Me({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=Me(r);vu(f,r)||p(r);let[m,h]=Me(null),[g,_]=Me(null),v=Le(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=Le(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=R(null),C=R(null),w=R(u),T=c!=null,E=xu(c),D=xu(i),O=xu(l),k=Le(()=>{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=U(U({},e),{},{isPositioned:O.current!==!1});A.current&&!vu(w.current,t)&&(w.current=t,cn(()=>{d(t)}))})},[f,t,n,D,O]);_u(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>U(U({},e),{},{isPositioned:!1})))},[l]);let A=R(!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=z(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=z(()=>({reference:b,floating:x}),[b,x]),ee=z(()=>{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?U(U({},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 z(()=>U(U({},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]}};V();function ku(e){let t=R(!0);t.current&&(t.current=!1,e())}let G=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(Jr(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
7
  /**
8
8
  * @license React
9
9
  * use-sync-external-store-shim.production.js
@@ -13,7 +13,7 @@
13
13
  * This source code is licensed under the MIT license found in the
14
14
  * LICENSE file in the root directory of this source tree.
15
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=>{
16
+ var Au=s((e=>{var t=(V(),d(ut));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
17
  /**
18
18
  * @license React
19
19
  * use-sync-external-store-shim/with-selector.production.js
@@ -23,12 +23,12 @@ var Au=s((e=>{var t=(B(),d(dt));function n(e,t){return e===t&&(e!==0||1/e==1/t)|
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
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(`
26
+ var t=(V(),d(ut)),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()}));V();let Pu=[],Fu;function Iu(){return Fu}function Lu(e){Pu.push(e)}function Ru(e){let t=(t,n)=>{let r=ei(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 yt(Ru(e))}function Bu(){return{didInitialize:!1}}V();var Vu=ju(),Hu=Nu();let Uu=ci(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=Le(()=>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){H(this,`subscribe`,e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})),H(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(U(U({},this.state),e));return}}set(e,t){Object.is(this.state[e],t)||this.setState(U(U({},this.state),{},{[e]:t}))}notifyAll(){let e=U({},this.state);this.setState(e)}use(e,t,n,r){return Wu(this,e,t,n,r)}};V();var Yu=class extends Ju{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){ze(e);let n=this;W(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;W(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;W(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){ze(e);let n=this,r=t!==void 0;W(()=>{r&&!Object.is(n.state[e],t)&&n.setState(U(U({},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 ze(e),Wu(this,this.selectors[e],t,n,r)}useContextCallback(e,t){ze(e);let n=La(t==null?di:t);this.context[e]=n}useStateSetter(e){let t=R(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=vr(e,Xu);super(U(U({},a),{},{positionReference:a.referenceElement,domReferenceElement:a.referenceElement}),{onOpenChange:r,dataRef:{current:{}},events:Qc(),nested:n,triggerElements:i},Zu),H(this,`syncOpenEvent`,(e,t)=>{(!e||!this.state.open||t!=null&&qo(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)}),H(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)}),H(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}};V();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=R(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),W(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};ma(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}V();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=bo(),i=nl()!=null,a=R(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=R(null),r=R(null);return Le(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=U(U({},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=La(t=>{if(a(t),!t)return;let i=n.select(`open`),o=n.select(`activeTriggerId`);if(o===e){n.update(U({activeTriggerElement:t},i?r:null));return}o==null&&i&&n.update(U({activeTriggerId:e,activeTriggerElement:t},r))});return W(()=>{i&&n.update(U({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`);W(()=>{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=wo(`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=La(()=>{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),W(()=>()=>{e.update({activeTriggerProps:pi,inactiveTriggerProps:pi,popupProps:pi})},[e])}function dd(e,t){W(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),W(()=>()=>{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:pi,inactiveTriggerProps:pi,popupProps:pi}}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=bo(),a=nl()!=null,o=ei(()=>{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 W(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=ma(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}V();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]=Me(null),[f,p]=Me(void 0),[m,h]=Me(void 0),g=R(null),_=rl(n),v=z(()=>({reference:a,floating:o,domReference:s}),[a,o,s]),y=Su(U(U({},e),{},{elements:U(U({},v),u&&{reference:u})})),b=ma(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=Le(e=>{let t=ma(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),y.refs.setReference(t)},[y.refs]),C=Le(e=>{(ma(e)||e===null)&&(g.current=e,p(e)),(ma(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!ma(e))&&y.refs.setReference(e)},[y.refs,p]),w=Le(e=>{h(e),y.refs.setFloating(e)},[y.refs]),T=z(()=>U(U({},y.refs),{},{setReference:C,setFloating:w,setPositionReference:S,domReference:g}),[y.refs,C,w,S]),E=z(()=>U(U({},y.elements),{},{domReference:s}),[y.elements,s]),D=z(()=>U(U({},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 W(()=>{s&&(g.current=s)},[s]),W(()=>{i.context.dataRef.current.floatingContext=D;let e=_==null?void 0:_.nodesRef.current.find(e=>e.id===t);e&&(e.context=D)}),z(()=>U(U({},y),{},{context:D,refs:T,elements:E,rootStore:i}),[y,T,E,D,i])}V();let wd=no&&oo;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=R(!1),c=R(null),l=R(!0),u=Vo();Pe(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=da(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&ha(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]),Pe(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);ma(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=z(()=>{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(ma(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,wo(na,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,wo(na,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=ma(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,wo(na,r))})}}},[o,r,i,u]);return z(()=>n?{reference:d,trigger:d}:{},[n,d])}var Ed=class e{constructor(){H(this,`dispose`,()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()}),H(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=ei(()=>{var e;return(e=t.hoverInteractionState)==null?Ed.create():e}).current;return t.hoverInteractionState||(t.hoverInteractionState=n),Oo(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}V();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=La(()=>{var e;return us((e=l.current.openEvent)==null?void 0:e.type,f.interactedInside)}),h=La(()=>{var e;return ds((e=l.current.openEvent)==null?void 0:e.type)}),g=La(()=>{Od(f)});W(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),Pe(()=>g,[g]),W(()=>{var e;if(n&&o&&(e=f.handleCloseOptions)!=null&&e.blockPointerEvents&&h()&&ma(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]),Pe(()=>{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,wo(ta,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&&ma(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,wo(ta,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])}V();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=R(!1),b=ms(i),x=ms(r),S=ms(o),C=ms(n),w=ms(p),T=ms(f),E=La(()=>{var e;return us((e=h.current.openEvent)==null?void 0:e.type,v.interactedInside)}),D=La(()=>{var e;return((e=w.current)==null?void 0:e.call(w))!==!1}),O=La((e,t,n)=>{let r=m.context.triggerElements;if(r.hasElement(t))return!e||!Zo(e,t);if(!ma(n))return!1;let i=n;return r.hasMatchingElement(e=>Zo(e,i))&&(!e||!Zo(e,i))}),k=La(()=>{v.handler&&(gs(m.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),v.handler=void 0)}),A=La(()=>{Od(v)});if(u){var j;v.handleCloseOptions=(j=b.current)==null?void 0:j.__options}return Pe(()=>k,[k]),Pe(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===ta,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]),Pe(()=>{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,wo(ta,e)),_==null||_.events.emit(`floating.closed`,e)}):t&&(v.openChangeTimeout.clear(),m.setOpen(!1,wo(ta,e)),_==null||_.events.emit(`floating.closed`,e))}let r=(e=c.current)==null?u?m.select(`domReferenceElement`):null:e;if(!ma(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(ma(s)&&!m.context.triggerElements.hasElement(s)){for(let e of m.context.triggerElements.elements())if(Zo(e,s)){u=e;break}}ma(c)&&ma(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&&ma(u)&&ma(l)&&Zo(l,u)&&h,_=i>0&&!o,b=d&&(f||h)||g,C=!f||d;if(b){D()&&m.setOpen(!0,wo(ta,e,u));return}_||(o?v.openChangeTimeout.start(o,()=>{C&&D()&&m.setOpen(!0,wo(ta,e,u))}):C&&D()&&m.setOpen(!0,wo(ta,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(U(U({},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]),z(()=>{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,wo(ta,n,r))}v.pointerType===`touch`?cn(()=>{f()}):s&&o?f():(v.restTimeoutPending=!0,v.restTimeout.start(d,f))}}},[n,v,E,O,a,m,S,D])}V();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=R(f),N=R(o==null?-1:o),te=R(null),ne=R(!0),P=La(e=>{i(N.current===-1?null:N.current,e)}),re=R(!!T),ie=R(w),ae=R(!1),oe=R(!1),se=R(null),ce=ms(h),le=ms(w),F=ms(o),ue=ms(y),de=jo(),fe=jo(),pe=La(()=>{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),_e&&(r||!ne.current))){var a;(a=i.scrollIntoView)==null||a.call(i,{block:`nearest`,inline:`nearest`})}})});W(()=>{D.current.orientation=g},[D,g]),W(()=>{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]),W(()=>{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]),W(()=>{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]),W(()=>{ie.current=w,re.current=!!T}),W(()=>{w||(te.current=null,ee.current=f)},[w,f]);let me=r!=null,I=La(e=>{if(!le.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(N.current!==t||r!==t)&&(N.current=t,P(e))}),L=La(()=>{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:_}),he=La(()=>Ys(n,ce.current)),ge=La(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,L())||Ho(e),C.setOpen(!1,wo(aa,e.nativeEvent)),ha(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)}}),_e=z(()=>({onFocus(e){ae.current=!0,I(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){ae.current=!0,oe.current=!1,p&&I(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})}}}),[I,le,A,p,n,P,ue,d]),ve=z(()=>d&&w&&me&&{"aria-activedescendant":`${v}-${r}`},[d,w,me,v,r]),ye=z(()=>U(U({"aria-orientation":g===`both`?void 0:g},k?{}:ve),{},{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,wo(ia,e.nativeEvent)),ha(E)&&E.focus();return}ge(e)},onPointerMove(){ne.current=!0}}),[ve,ge,A,g,k,C,w,d,E]),be=z(()=>{function e(e){C.setOpen(!0,wo(aa,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,L(),u),a=Fd(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return ge(t);if(!(!n&&!m&&r)){if(o){let e=Fd(t.key,L());te.current=l&&e?null:t.key}if(l){i&&(Ho(t),n?(N.current=he(),P(t)):e(t));return}a&&(F.current!=null&&(N.current=F.current),Ho(t),!n&&m?e(t):ge(t),n&&P(t))}},onFocus(e){C.select(`open`)&&!d&&(N.current=-1,P(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[ge,f,he,l,P,C,m,g,L,u,F,d]),xe=z(()=>U(U({},ve),be),[ve,be]);return z(()=>a?{reference:xe,floating:ye,item:_e,trigger:be}:{},[a,xe,ye,be,_e])}V();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=R(``),g=R((n=d==null?a:d)==null?-1:n),_=R(null),v=La(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(fi,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=La(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))});W(()=>{!p&&d!==null||(m.clear(),_.current=null,h.current!==``&&(h.current=``))},[p,d,m]),W(()=>{if(p&&h.current===``){var e;g.current=(e=d==null?a:d)==null?-1:e}},[p,d,a]);let b=z(()=>({onKeyDown:v,onBlur:y}),[v,y]);return z(()=>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&&ma(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=U(U({},e),{},{blockPointerEvents:t}),r}V();let qd=I(void 0);function Jd(e){let t=Re(qd);if(t===void 0&&!e)throw Error(Jr(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:pi}V();let ef=[`render`,`className`,`style`,`finalFocus`],tf=U(U({},Zi),Vi),nf=yt(function(e,t){let{render:n,className:r,style:i,finalFocus:a}=e,o=vr(e,ef),{store:s}=Qr(),{side:c,align:l}=Xr(),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)}}}),Pe(()=>{function e(e){s.setOpen(!1,wo(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=Le(e=>{s.set(`popupElement`,e)},[s]),k=Mi(`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),Eo(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})});V();let rf=I(void 0);function af(){let e=Re(rf);if(e===void 0)throw Error(Jr(32));return e}V();let of=[`keepMounted`],sf=yt(function(e,t){let{keepMounted:n=!1}=e,r=vr(e,of),{store:i}=Qr();return i.useState(`mounted`)||n?Eo(rf.Provider,{value:n,children:Eo(Zc,U({ref:t},r))}):null});function cf(e){return ci(19)?e:e?`true`:void 0}V();let lf=I(void 0);function uf(){var e;let t=Re(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:U({[g]:N,centerOffset:ee-N-ne},te&&{alignmentOffset:ne}),reset:te}}}),ff=(e,t)=>U(U({},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=da(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}}}};V();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]=Me(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=La(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=R(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`),I=E===`none`?null:Eu(U(U({},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})),L=pe?null:wu(e=>{let t=gs(e.elements.floating).documentElement;return U(U({},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(L,I):fe.push(I,L),fe.push(Du(U(U({},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=da(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),W(()=>{!_&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,g]);let he=z(()=>({elementResize:!p&&typeof ResizeObserver<`u`,layoutShift:!p&&typeof IntersectionObserver<`u`}),[p]),{refs:ge,elements:_e,x:ve,y:ye,middlewareData:be,update:xe,placement:Se,context:Ce,isPositioned:we,floatingStyles:Te}=Cd({rootContext:g,open:h?_:void 0,placement:ne,middleware:fe,strategy:i,whileElementsMounted:h?void 0:(...e)=>lu(...e,he),nodeId:b,externalTree:C}),{sideX:Ee,sideY:De}=be.adaptiveOrigin||hf,Oe=we?i:`fixed`,ke=z(()=>{let e=x?{position:Oe,[Ee]:ve,[De]:ye}:U({position:Oe},Te);return we||(e.opacity=0),e},[x,Oe,Ee,ve,De,ye,Te,we]),Ae=R(null);W(()=>{if(!_)return;let e=M.current,t=typeof e==`function`?e():e,n=(bf(t)?t.current:t)||null;n!==Ae.current&&(ge.setPositionReference(n),Ae.current=n)},[_,ge,j,M]),Pe(()=>{if(!_)return;let e=M.current;typeof e!=`function`&&bf(e)&&e.current!==Ae.current&&(ge.setPositionReference(e.current),Ae.current=e.current)},[_,ge,j,M]),Pe(()=>{if(h&&_&&_e.reference&&_e.floating)return lu(_e.reference,_e.floating,xe,he)},[h,_,_e,xe,he]);let je=ks(Se),Ne=_f(a,je,N),Fe=As(Se)||`center`,Ie=!!((t=be.hide)!=null&&t.referenceHidden);W(()=>{S&&_&&we&&T(je)},[S,_,we,je]);let Le=z(()=>{var e,t;return{position:`absolute`,top:(e=be.arrow)==null?void 0:e.y,left:(t=be.arrow)==null?void 0:t.x}},[be.arrow]),Re=((n=be.arrow)==null?void 0:n.centerOffset)!==0;return z(()=>({positionerStyles:ke,arrowStyles:Le,arrowRef:ce,arrowUncentered:Re,side:Ne,align:Fe,physicalSide:je,anchorHidden:Ie,refs:ge,context:Ce,isPositioned:we,update:xe}),[ke,Le,ce,Re,Ne,Fe,je,Ie,ge,Ce,we,xe])}function bf(e){return e!=null&&`current`in e}V();function xf(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=La(i),o=R(0),s=ei(Cf).current,c=ei(Sf).current,[l,u]=Me(0),d=R(l),f=La((e,t)=>{c.set(e,t==null?null:t),d.current+=1,u(d.current)}),p=La(e=>{c.delete(e),d.current+=1,u(d.current)}),m=z(()=>{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,U(U({},i),{},{index:n}))}),e},[c,l]);W(()=>{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]),W(()=>{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]),W(()=>()=>{n.current=[]},[n]),W(()=>()=>{r&&(r.current=[])},[r]);let h=La(e=>(s.add(e),()=>{s.delete(e)}));W(()=>{s.forEach(e=>e(m))},[s,m]);let g=z(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return Eo(po.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}V();let Tf=[`cutout`],Ef=yt(function(e,t){let{cutout:n}=e,r=vr(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 Eo(`div`,U(U({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=U({},n);return s&&(c.pointerEvents=`none`),Mi(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},$d(r),i],stateAttributesMapping:Zi})}let Of={},kf={},Af=``;function jf(e){if(typeof document>`u`)return!1;let t=gs(e);return da(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=_a(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=_a(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=da(i),s=0,c=0,l=!1,u=Ao.create();if(oo&&((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=_a(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(){H(this,`lockCount`,0),H(this,`restore`,null),H(this,`timeoutLock`,Bo.create()),H(this,`timeoutUnlock`,Bo.create()),H(this,`release`,()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)}),H(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=da(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=di;return}let r=$a||!jf(e);this.restore=r?Nf(e):Pf(e)}};function If(e=!0,t=null){W(()=>{if(e)return Ff.acquire(t)},[e,t])}V();function Lf(e,t,n,r){let[i,a]=Me(!1);W(()=>{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)}V();let Rf=[`anchor`,`positionMethod`,`className`,`render`,`side`,`align`,`sideOffset`,`alignOffset`,`collisionBoundary`,`collisionPadding`,`arrowPadding`,`sticky`,`disableAnchorTracking`,`collisionAvoidance`,`style`],zf=yt(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,_=vr(e,Rf),{store:v}=Qr(),y=af(),b=$i(!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=R(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,I,L;fe=(me=fe)==null?`inline-end`:me,pe=(I=pe)==null?`start`:I,ce=(L=e.collisionAvoidance)==null?Wc:L}else if(x.type===`menubar`){var he,ge;fe=(he=fe)==null?x.context.orientation===`vertical`?`inline-end`:`bottom`:he,pe=(ge=pe)==null?`start`:ge}let _e=x.type===`context-menu`,ve=yf({anchor:ie,floatingRootContext:S,positionMethod:b?`fixed`:r,mounted:w,side:fe,sideOffset:ae,align:pe,alignOffset:oe,arrowPadding:_e?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:N,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:ce,shiftCrossAxis:_e&&!(`side`in ce&&ce.side===`flip`),externalTree:C,adaptiveOrigin:M?gf:void 0});Pe(()=>{function e(e){e.open&&(e.parentNodeId===N&&v.set(`hoverEnabled`,!1),e.nodeId!==N&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,wo(oa)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,N]),Pe(()=>{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?oa:t;v.setOpen(!1,wo(n))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let ye=Vo();Pe(()=>{T||ye.clear()},[T,ye]),Pe(()=>{function e(e){if(!(!T||e.nodeId!==v.select(`floatingParentNodeId`)))if(e.target&&O&&O!==e.target){let e=v.select(`closeDelay`);e>0?ye.isStarted()||ye.start(e,()=>{v.setOpen(!1,wo(oa))}):v.setOpen(!1,wo(oa))}else ye.clear()}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,T,O,v,ye]),Pe(()=>{let e={open:T,nodeId:N,parentNodeId:te,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,T,v,N,te]),W(()=>{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 be={open:T,side:ve.side,align:ve.align,anchorHidden:ve.anchorHidden,nested:x.type===`menu`,instant:j},xe=x.type===`menubar`&&x.context.modal;Lf(T&&(xe||E&&ee!==`trigger-hover`),D===`touch`,A,O);let Se=Df(e,be,{styles:ve.positionerStyles,transitionStatus:k,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!T}),Ce=w&&x.type!==`menu`&&(x.type!==`menubar`&&E&&ee!==`trigger-hover`||x.type===`menubar`&&x.context.modal),we=null;return x.type===`menubar`?we=x.context.contentElement:x.type===void 0&&(we=O),Eo(Yr.Provider,{value:ve,children:[Ce&&Eo(Ef,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:cf(!T),cutout:we}),Eo(al,{id:N,children:Eo(xf,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:Se})})]})});V();let Bf=I(void 0);function Vf(){let e=Re(Bf);if(e===void 0)throw Error(Jr(34));return e}V();let Hf=[`render`,`className`,`value`,`defaultValue`,`onValueChange`,`disabled`,`style`,`aria-labelledby`],Uf=vt(yt(function(e,t){let{render:n,className:r,value:i,defaultValue:a,onValueChange:o,disabled:s=!1,style:c,"aria-labelledby":l}=e,u=vr(e,Hf),[d,f]=Me(void 0),[p,m]=ca({controlled:i,default:a,name:`MenuRadioGroup`}),h=La((e,t)=>{o==null||o(e,t),!t.isCanceled&&m(e)}),g=Mi(`div`,e,{state:{disabled:s},ref:t,props:U({role:`group`,"aria-labelledby":l==null?d:l,"aria-disabled":s||void 0},u)}),_=z(()=>({value:p,setValue:h,disabled:s}),[p,h,s]);return Eo(Io.Provider,{value:f,children:Eo(Bf.Provider,{value:_,children:g})})}));V();let Wf=I(void 0);function Gf(){let e=Re(Wf);if(e===void 0)throw Error(Jr(35));return e}V();let Kf=[`render`,`className`,`id`,`label`,`nativeButton`,`disabled`,`closeOnClick`,`value`,`style`],qf=yt(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=vr(e,Kf),f=go({label:a}),p=Xr(!0),m=xo(i),{store:h}=Qr(),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}=fo({closeOnClick:c,disabled:x,highlighted:g,id:m,store:h,nativeButton:o,nodeId:p==null?void 0:p.context.nodeId,itemMetadata:uo}),T=z(()=>({disabled:x,highlighted:g,checked:S}),[x,g,S]);function E(e){let t=wo(ra,e.nativeEvent,void 0,{preventUnmountOnClose(){}});y(l,t)}let D=Mi(`div`,e,{state:T,stateAttributesMapping:Co,props:[_,{role:`menuitemradio`,"aria-checked":S,onClick:E},d,C],ref:[w,t,f.ref]});return Eo(Wf.Provider,{value:T,children:D})});V();let Jf=[`render`,`className`,`style`,`keepMounted`],Yf=yt(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1}=e,o=vr(e,Jf),s=Gf(),c=R(null),{transitionStatus:l,setMounted:u}=Mo(s.checked);return Fo({open:s.checked,ref:c,onComplete(){s.checked||u(!1)}}),Mi(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},stateAttributesMapping:Co,ref:[t,c],props:U({"aria-hidden":!0},o),enabled:a||s.checked})});V();let Xf=I(null);function Zf(e){let t=Re(Xf);if(t===null&&!e)throw Error(Jr(5));return t}V();function Qf(e){let t=R(``),n=Le(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:Le(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}}V();function $f(e,t){let n=R(e),r=La(t);W(()=>{n.current!==e&&r(n.current)},[e,r]),W(()=>{n.current=e},[e])}V();function ep(e,t){let{onClick:n,onPointerDown:r}=Qf(La((n,r)=>{(typeof e==`function`?e():e)||t(r||($a?`touch`:``))}));return z(()=>({onClick:n,onPointerDown:r}),[n,r])}function tp(e){let[t,n]=Me(null),r=ep(e,n);return $f(e,t=>{t&&!e&&n(null)}),z(()=>({openMethod:t,triggerProps:r}),[t,r])}V();let np=U(U({},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(U(U({},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),H(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=ei(()=>new e(n)).current;return t==null?r:t}};function ip(){return U(U({},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:pi,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1})}V();let ap=I(void 0);function op(){return Re(ap)}V();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,_=$i(!0),v=Qr(!0),y=Zf(!0),b=op(),x=z(()=>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=bo(),w=bo(),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=R(null),ie=R(N.type!==`context-menu`),ae=Vo(),oe=R(!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})});W(()=>{_&&!v?S.update({parent:{type:`context-menu`,context:_},floatingNodeId:E,floatingParentNodeId:D}):v&&S.update({floatingNodeId:E,floatingParentNodeId:D})},[_,v,E,D,S]),Pe(()=>{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]),W(()=>{!O&&!j&&S.set(`hoverEnabled`,!0)},[O,j,S]);let de=La((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;Pe(()=>{let e=({open:e,eventDetails:t})=>de(e,t);return pe.on(`setOpen`,e),()=>{pe==null||pe.off(`setOpen`,e)}},[pe,de]);let me=Le(()=>{S.setOpen(!1,wo(sa))},[S]);Ie(d,()=>({unmount:ue,close:me}),[ue,me]);let I;N.type===`context-menu`&&(I=N.context),Ie(I==null?void 0:I.positionerRef,()=>A,[A]),Ie(I==null?void 0:I.actionsRef,()=>({setOpen:de}),[de]);let L=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}),he=uf(),ge=Le(e=>{S.select(`activeIndex`)!==e&&S.set(`activeIndex`,e)},[S]),_e=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:he===`rtl`,disabledIndices:fi,onNavigate:ge,openOnArrowKeyDown:N.type!==`context-menu`,externalTree:ce?T:void 0,focusItemOnHover:g}),ve=Le(e=>{S.context.typingRef.current=e},[S]),ye=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:ve});ud(S,{floatingRootContext:fe,activeTriggerProps:z(()=>{let e=vi(ye.reference,_e.reference,L.reference,{onMouseMove(){S.set(`allowMouseEnter`,!0)}},F);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=O,e},[S,ye.reference,_e.reference,L.reference,F,O]),inactiveTriggerProps:z(()=>{let e=vi(_e.trigger,L.trigger,F);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[_e.trigger,L.trigger,F]),popupProps:z(()=>vi(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)}},ye.floating,_e.floating,L.floating),[k,w,N.type,S,ye.floating,_e.floating,L.floating]),itemProps:(t=_e.item)==null?pi:t});let be=z(()=>({store:S,parent:x}),[S,x]),xe=Eo(Zr.Provider,{value:be,children:typeof n==`function`?n({payload:ne}):n});return N.type===void 0||N.type===`context-menu`?Eo(ol,{externalTree:T,children:xe}):xe});function cp(e){let t=e.getBoundingClientRect(),n=da(e);if(co)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}}V();function lp(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Va(),{ref:i,index:a}=go(e),o=n===a,s=R(null),c=ti(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=pi,props:a=fi,refs:o=fi,metadata:s,stateAttributesMapping:c,tag:l=`div`}=e,u=vr(e,up),{compositeProps:d,compositeRef:f}=lp({metadata:s});return Mi(l,e,{state:i,ref:[...o,f],props:[d,...a,u],stateAttributesMapping:c})}function fp(e){if(ha(e)&&e.hasAttribute(`data-rootownerid`)){var t;return(t=e.getAttribute(`data-rootownerid`))==null?void 0:t}if(!Da(e))return fp(Aa(e))}V();function pp(e,t){let n=R(null);function r(t){cn(()=>{e.setOpen(!1,wo(ia,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{cn(()=>{e.setOpen(!1,wo(ia,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}}V();function mp(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=R(!1);return z(()=>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())}}:pi,[t,n,r])}V();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=vr(e,hp),h=Qr(!0),g=(n=f==null?void 0:f.store)==null?h==null?void 0:h.store:n;if(!g)throw Error(Jr(85));let _=xo(c),v=g.useState(`isTriggerActive`,_),y=g.useState(`floatingRootContext`),b=g.useState(`isOpenedByTrigger`,_),x=g.useState(`triggerPopupId`,_),S=R(null),C=vp(),w=Va(!0),T=rl(),D=z(()=>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}=Wa({disabled:M,native:s});Pe(()=>{!b&&C.type===void 0&&(g.context.allowMouseUpTriggerRef.current=!1)},[g,b,C.type]);let te=R(null),ne=Vo(),P=La(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`})});Pe(()=>{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=z(()=>vi(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],I=[le,ie==null?pi: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],L=Mi(`button`,e,{enabled:!A,stateAttributesMapping:Xi,state:pe,ref:me,props:I});return A?Eo(dp,{tag:`button`,render:r,className:i,style:a,state:pe,refs:me,props:I,stateAttributesMapping:Xi}):b?Eo(E,{children:[Eo(ys,{ref:ue,onFocus:de},`${_}-pre-focus-guard`),Eo(E,{children:L},_),Eo(ys,{ref:g.context.triggerFocusTargetRef,onFocus:fe},`${_}-post-focus-guard`)]}):Eo(E,{children:L},_)});function _p(e,t){let n=Vo(),[r,i]=Me(!1);return W(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function vp(){let e=$i(!0),t=Qr(!0),n=Zf(!0);return z(()=>n?{type:`menubar`,context:n}:e&&!t?{type:`context-menu`,context:e}:{type:void 0},[e,t,n])}V();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){return!e||e.trim().length===0}function Mp(...e){}let Np=/(<mark>|<\/mark>)/g,Pp=RegExp(Np.source);function Fp(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&&Pp.test(i.value)?i.value.replace(Np,``):i.value:e.hierarchy.lvl0}function Ip(e){typeof e.scrollTo==`function`?e.scrollTo({top:0,behavior:`smooth`}):e.scrollTop=0}function Lp(){return B.createElement(`svg`,{className:`DocSearch-Hit-Select-Icon`,width:`20`,height:`20`,viewBox:`0 0 20 20`},B.createElement(`g`,{stroke:`currentColor`,fill:`none`,fillRule:`evenodd`,strokeLinecap:`round`,strokeLinejoin:`round`},B.createElement(`path`,{d:`M18 3v4c0 2-2 4-4 4H2`}),B.createElement(`path`,{d:`M8 17l-6-6 6-6`})))}function Rp(){return B.createElement(`svg`,{width:`40`,height:`40`,viewBox:`0 0 20 20`,fill:`none`,fillRule:`evenodd`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`},B.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 zp(){return B.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`},B.createElement(`path`,{d:`m13.5 8.5-5 5`}),B.createElement(`path`,{d:`m8.5 8.5 5 5`}),B.createElement(`circle`,{cx:`11`,cy:`11`,r:`8`}),B.createElement(`path`,{d:`m21 21-4.3-4.3`}))}function Bp(){return B.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`},B.createElement(`path`,{d:`M12 17v5`}),B.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 Vp(){return B.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`},B.createElement(`polyline`,{points:`6 9 12 15 18 9`}))}function Hp(){return B.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`},B.createElement(`polyline`,{points:`20 6 9 17 4 12`}))}function Up(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 Wp(e){return e.label?e.label:e.key.replace(/[._-]+/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function Gp(e){let t={};for(let r of e){var n;let e=(n=r.searchParameters)==null?void 0:n.facetFilters;for(let n of Array.isArray(e)?e:[e]){if(typeof n!=`string`)continue;let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e),i=n.slice(e+1);r&&i&&(t[r]=i)}}return t}let Kp=[`className`,`type`];function qp({children:e}){return B.createElement(`div`,{className:`DocSearch-Chip`},e)}function Jp(e){let{className:t,type:n=`button`}=e,r=pn(e,Kp),i=`DocSearch-Chip-Dismiss${t?` ${t}`:``}`;return B.createElement(`button`,_({type:n,className:i,tabIndex:0},r),B.createElement(jr,{"aria-hidden":`true`}))}qp.Dismiss=Jp;let Yp=[`className`],Xp=[`align`,`alignOffset`,`side`,`sideOffset`,`collisionBoundary`,`container`],Zp=[`className`,`children`],Qp=[`className`];function $p(e){let t=Ar({},(kr(e),e));return B.createElement(sp,t)}$p.Trigger=B.forwardRef((e,t)=>{let{className:n}=e,r=pn(e,Yp),i=`DocSearch-Menu-Trigger${n?` ${n}`:``}`;return B.createElement(gp,_({className:i,ref:t},r))});function em(e){let{align:t=`start`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,collisionBoundary:a=`clipping-ancestors`,container:o}=e,s=pn(e,Xp);return B.createElement(sf,{container:o},B.createElement(zf,{className:`DocSearch-Menu-Positioner`,align:t,alignOffset:n,side:r,sideOffset:i,collisionBoundary:a},B.createElement(nf,_({className:`DocSearch-Menu-Popup`},s))))}$p.Popup=em;function tm(e){let t=Ar({},(kr(e),e));return B.createElement(Uf,t)}$p.RadioGroup=tm;function nm(e){let{className:t,children:n}=e,r=pn(e,Zp),i=`DocSearch-Menu-Item DocSearch-Menu-RadioItem${t?` ${t}`:``}`;return B.createElement(qf,_({className:i,closeOnClick:!0},r),B.createElement(`span`,{className:`DocSearch-Menu-RadioItem-Indicator`},B.createElement(Yf,null,B.createElement(Hp,null))),n)}$p.RadioItem=nm;function rm(e){let{className:t}=e,n=pn(e,Qp),r=`DocSearch-Menu-GroupLabel${t?` ${t}`:``}`;return B.createElement(zo,_({className:r},n))}$p.GroupLabel=rm;let im=B.memo(function({facet:e,selectedValue:t,defaultValueLabel:n,onSelectionChange:r,registerTrigger:i,menuTriggerSelectedAriaLabel:a}){let o=Wp(e),s=B.useCallback(t=>{r(e.key,t)},[e.key,r]),c=B.useCallback(t=>{i(e.key,t)},[e.key,i]);return B.createElement($p,null,B.createElement($p.Trigger,{ref:c,"data-has-selection":!!t,"aria-label":t?`${o}, ${t} ${a}`:o},B.createElement(`span`,null,yp(o)),B.createElement(Vp,null)),B.createElement($p.Popup,null,B.createElement($p.RadioGroup,{value:t,onValueChange:s},B.createElement($p.RadioItem,{value:``,label:`${n} ${o}`},n),e.values.map(e=>B.createElement($p.RadioItem,{key:e,value:e,label:e},yp(e))))))}),am=B.memo(function({facetKey:e,facetLabel:t,value:n,dismissAriaLabel:r,onDismiss:i}){let a=B.useCallback(t=>{i(e,t)},[e,i]);return B.createElement(qp,null,yp(n),B.createElement(qp.Dismiss,{"aria-label":`${r} ${yp(n)} (${t})`,onClick:a}))}),om=B.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=B.useMemo(()=>new Set(e.map(e=>e.key)),[e]),f=B.useMemo(()=>Object.entries(t).filter(([e,t])=>!!t&&d.has(e)),[t,d]),p=B.useRef(new Map),m=B.useCallback((e,t)=>{t?p.current.set(e,t):p.current.delete(e)},[]),h=B.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?p.current.get(e):a;s==null||s.focus()}n(e,``)},[n]),g=B.useCallback(()=>{var e;(e=p.current.values().next().value)==null||e.focus(),r()},[r]),_=B.useMemo(()=>new Map(e.map(e=>[e.key,Wp(e)])),[e]);return e.length===0?null:B.createElement(B.Fragment,null,B.createElement(`div`,{className:`DocSearch-FacetBar`,role:`group`,"aria-label":c},e.map(e=>{var r;let i=(r=t[e.key])==null?``:r;return B.createElement(im,{key:e.key,facet:e,selectedValue:i,defaultValueLabel:a,registerTrigger:m,menuTriggerSelectedAriaLabel:o,onSelectionChange:n})})),f.length>0&&B.createElement(`div`,{className:`DocSearch-FacetSelectionBar`,role:`group`,"aria-label":l},f.map(([e,t])=>{var n;return B.createElement(am,{key:e,facetKey:e,facetLabel:(n=_.get(e))==null?e:n,value:t,dismissAriaLabel:u,onDismiss:h})}),B.createElement(`button`,{type:`button`,className:`DocSearch-FacetSelectionBar-Action`,onClick:g},s)))}),sm=[`actionsBeforeClose`,`autoFocus`,`clearButtonAriaLabel`,`clearButtonTitle`,`closeButtonAriaLabel`,`closeButtonText`,`hideInput`,`inputOverlay`,`inputProps`,`inputRef`,`isFromSelection`,`leadingElement`,`onClose`,`placeholder`,`searchInputLabel`,`state`];function cm(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=pn(e,sm),{onReset:y}=v.getFormProps({inputElement:u.current});B.useEffect(()=>{n&&u.current&&u.current.focus()},[n,u]),B.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 B.createElement(`form`,{className:`DocSearch-Form`,onSubmit:e=>{e.preventDefault()},onReset:y},f||(x?B.createElement(`div`,{className:`DocSearch-LoadingIndicator`},B.createElement(Er,null)):B.createElement(`label`,_({className:`DocSearch-MagnifierLabel`},v.getLabelProps()),B.createElement(dn,null),B.createElement(`span`,{className:`DocSearch-VisuallyHiddenForAccessibility`},h))),c,B.createElement(`input`,_(_(_({className:`DocSearch-Input`,ref:u},b),l),{},{placeholder:m,hidden:s})),B.createElement(`div`,{className:`DocSearch-Actions`},t,B.createElement(`button`,{type:`button`,title:o,className:`DocSearch-Action DocSearch-Close`,"aria-label":a,onClick:p},B.createElement(jr,null))))}function lm({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 B.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()}}),B.createElement(`div`,{className:`DocSearch-Modal`,ref:n},B.createElement(`header`,{className:`DocSearch-SearchBar`,ref:r},c),l,s&&B.createElement(`div`,{className:`DocSearch-Dropdown`,ref:i},u),B.createElement(`footer`,{className:`DocSearch-Footer`},d)))}function um(e){return B.createElement(`svg`,{width:`20`,height:`20`,"aria-label":e.ariaLabel,viewBox:`0 0 24 24`,role:`img`},B.createElement(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.4`},e.children))}function dm({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 B.createElement(B.Fragment,null,B.createElement(`div`,{className:`DocSearch-Logo`},B.createElement(Ir,{translations:{poweredByText:d}})),B.createElement(`ul`,{className:`DocSearch-Commands`},B.createElement(`li`,null,B.createElement(`kbd`,{className:`DocSearch-Commands-Key`},B.createElement(um,{ariaLabel:s},B.createElement(`path`,{d:`M12 5v14`}),B.createElement(`path`,{d:`m19 12-7 7-7-7`}))),B.createElement(`kbd`,{className:`DocSearch-Commands-Key`},B.createElement(um,{ariaLabel:o},B.createElement(`path`,{d:`m5 12 7-7 7 7`}),B.createElement(`path`,{d:`M12 19V5`}))),B.createElement(`span`,{className:`DocSearch-Label`},a)),B.createElement(`li`,null,B.createElement(`kbd`,{className:`DocSearch-Commands-Key`},B.createElement(um,{ariaLabel:r},B.createElement(`polyline`,{points:`9 10 4 15 9 20`}),B.createElement(`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`}))),B.createElement(`span`,{className:`DocSearch-Label`},t?i:n)),B.createElement(`li`,null,B.createElement(`kbd`,{className:`DocSearch-Commands-Key`},B.createElement(`span`,{className:`DocSearch-Escape-Key`},`ESC`)),B.createElement(`span`,{className:`DocSearch-Label`,"aria-label":u},t?l:c))))}function fm({hit:e,children:t}){return B.createElement(`a`,{href:e.url},t)}function pm({facets:e,indexes:t,searchClient:n}){let[r,i]=B.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 B.useEffect(()=>{let e=!0,r=a?a.split(`,`):[];return r.length===0||t.length===0||n.search({requests:t.map(e=>({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 mm({facets:e,indexes:t,searchClient:n,onSelectionsChange:r}){let i=B.useMemo(()=>Up(e),[e]),a=B.useRef(i),o=pm({facets:i,indexes:t,searchClient:n}),[s,c]=B.useState(()=>Gp(t)),l=B.useRef(s),u=B.useRef(r),d=B.useMemo(()=>i.map(e=>{var t;return _(_({},e),{},{values:(t=o[e.key])==null?[]:t})}).filter(e=>e.values.length>0),[o,i]);B.useLayoutEffect(()=>{a.current=i,u.current=r});let f=B.useCallback(e=>{var t;l.current=e,c(e),(t=u.current)==null||t.call(u)},[]);return{visibleFacets:d,facetSelections:s,facetSelectionsRef:l,handleFacetSelectionChange:B.useCallback((e,t)=>{if(l.current[e]===t)return;let n=_({},l.current);n[e]=t,f(n)},[f]),clearFacetSelections:B.useCallback(()=>{if(Object.keys(l.current).length===0)return;let e={};for(let t of a.current)l.current[t.key]&&(e[t.key]=``);f(e)},[f])}}function hm(e){return B.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 gm(e){let t=B.useRef(typeof window<`u`?window.getSelection().toString().slice(0,512):``).current;return{initialQuery:B.useRef(e||t).current,initialQueryFromSelection:t}}function _m({getEnvironmentProps:e,panelElement:t,formElement:n,inputElement:r}){B.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 vm({container:e}){B.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 ym({initialScrollY:e,modalRef:t,snippetLength:n,theme:r}){mn({theme:r}),B.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]),B.useEffect(()=>{Br()},[]),B.useLayoutEffect(()=>{let e=window.innerWidth-document.body.clientWidth;return document.body.style.marginInlineEnd=`${e}px`,()=>{document.body.style.marginInlineEnd=`0px`}},[]),B.useEffect(()=>{window.matchMedia(`(max-width: 768px)`).matches&&(n.current=5)},[n]),B.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 bm({getEnvironmentProps:e,containerRef:t,dropdownRef:n,formElementRef:r,inputRef:i,initialScrollY:a,modalRef:o,snippetLength:s,theme:c}){_m({getEnvironmentProps:e,panelElement:n.current,formElement:r.current,inputElement:i.current}),vm({container:t.current}),ym({initialScrollY:a,modalRef:o,snippetLength:s,theme:c})}function xm(){return{containerRef:B.useRef(null),modalRef:B.useRef(null),formElementRef:B.useRef(null),dropdownRef:B.useRef(null),inputRef:B.useRef(null),snippetLength:B.useRef(15)}}function Sm({initialQuery:e,inputRef:t,refresh:n}){B.useEffect(()=>{e.length>0&&(n(),t.current&&t.current.focus())},[e,t,n])}function Cm(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 wm({favoriteSearches:e,recentSearches:t,disableUserPersonalization:n}){return B.useCallback(function(r){if(n)return;let i=r.type===`content`?r.__docsearch_parent||Cm(r):r;i&&e.getAll().findIndex(e=>e.objectID===i.objectID)===-1&&t.add(i)},[e,t,n])}function Tm({defaultIndexName:e,recentSearchesLimit:t,recentSearchesWithFavoritesLimit:n}){let r=B.useRef(Wr({key:`__DOCSEARCH_FAVORITE_SEARCHES__${e}`,limit:10})).current;return{favoriteSearches:r,recentSearches:B.useRef(Wr({key:`__DOCSEARCH_RECENT_SEARCHES__${e}`,limit:r.getAll().length===0?t:n})).current}}function Em({title:e,subText:t}){return B.createElement(`div`,{className:`DocSearch-Hit-content-wrapper`},B.createElement(`span`,{className:`DocSearch-Hit-title`},e),B.createElement(`span`,{className:`DocSearch-Hit-path`},t))}let Dm=1e3,Om=Dm*60,km=Om*60,Am=[[km*24,`day`],[km,`hour`],[Om,`minute`],[Dm,`second`]];function jm(e,t=Date.now()){let[n]=Me(()=>{var n;let r=Math.abs(Number(t)-Number(e)),[i,a]=(n=Am.find(([e])=>r>=e))==null?Am[Am.length-1]:n;return[Math.floor(r/i),a]}),r=z(()=>{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 Mm=[`hit`,`attribute`,`tagName`];function Nm(e,t){return t.split(`.`).reduce((e,t)=>e!=null&&e[t]?e[t]:null,e)}function Pm(e){let{hit:t,attribute:n,tagName:r=`span`}=e;return C(r,_(_({},pn(e,Mm)),{},{dangerouslySetInnerHTML:{__html:Nm(t,`_snippetResult.${n}.value`)||Nm(t,n)}}))}function Fm(e){var t;let{askAiResultsTitle:n=`Ask AI Assistant`}=e.translations||{},r=B.useId(),i=B.useMemo(()=>e.title?Sp(e.title):null,[e.title]);return!e.collection||e.collection.items.length===0?null:e.collection.source.sourceId===bp.askAI?B.createElement(`section`,{className:`DocSearch-Hits`},B.createElement(`h2`,{id:r,className:`DocSearch-Hit-source`},n),B.createElement(`ul`,_(_({className:`DocSearch-Hits-padded`},e.getListProps({source:e.collection.source})),{},{"aria-labelledby":r}),e.collection.items.map(t=>B.createElement(Rm,_({key:t.objectID,item:t,translations:e.translations},e))))):e.collection.source.sourceId===bp.recentConversations?B.createElement(`section`,{className:`DocSearch-Hits`},B.createElement(`div`,{className:`DocSearch-Hit-source`},B.createElement(Dr,null),i),B.createElement(`ul`,_({className:`DocSearch-Hits-padded`},e.getListProps({source:e.collection.source})),e.collection.items.map((t,n)=>B.createElement(Im,_({key:[e.title,t.objectID].join(`:`),item:t,index:n},e))))):B.createElement(`section`,{className:`DocSearch-Hits`},B.createElement(`div`,{className:`DocSearch-Hit-source`},(t=e.sourceIcon)==null?null:t,i),B.createElement(`ul`,_({className:`DocSearch-Hits-padded`},e.getListProps({source:e.collection.source})),e.collection.items.map((t,n)=>B.createElement(Im,_({key:[e.title,t.objectID].join(`:`),item:t,index:n},e)))))}function Im({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 B.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)}})),B.createElement(u,{hit:e},B.createElement(`div`,{className:`DocSearch-Hit-Container`},n({item:e,index:t}),e.type===`lvl0`&&B.createElement(Em,{title:B.createElement(Pm,{hit:e,attribute:`hierarchy.lvl0`}),subText:B.createElement(Pm,{hit:e,attribute:`content`})}),e.type===`askAI`?B.createElement(Lm,{item:e,relativeDateFallbackText:d}):B.createElement(Em,{title:B.createElement(Pm,{hit:e,attribute:f}),subText:p}),l==null?void 0:l({item:e}),r({item:e}))))}function Lm({item:e,relativeDateFallbackText:t}){let n=jm(e.hierarchy.lvl2?new Date(e.hierarchy.lvl2):null);return B.createElement(Em,{title:Sp(e.hierarchy.lvl1||``),subText:n||t})}function Rm({item:e,getItemProps:t,onItemClick:n,collection:r}){return e.query?B.createElement(`li`,_({className:`DocSearch-Hit`},t({item:e,source:r.source,onClick(t){n(e,t)}})),B.createElement(`div`,{className:`DocSearch-Hit--AskAI`},B.createElement(`div`,{className:`DocSearch-Hit-AskAIButton DocSearch-Hit-Container`},B.createElement(`div`,{className:` DocSearch-Hit-AskAIButton-icon DocSearch-Hit-icon`},B.createElement(Dr,null)),B.createElement(`div`,{className:`DocSearch-Hit-AskAIButton-title`},B.createElement(`span`,{className:`DocSearch-Hit-AskAIButton-title-query`},e.query))))):null}let zm=[`translations`];function Bm(e){let{translations:t={}}=e,n=pn(e,zm),{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 B.createElement(B.Fragment,null,c&&B.createElement(Fm,_(_({},n),{},{title:o,collection:c,sourceIcon:B.createElement(Bp,null),renderIcon:({item:e})=>B.createElement(`div`,{className:`DocSearch-Hit-icon`},B.createElement(Nr,{type:e.type})),renderAction:({item:e})=>B.createElement(`div`,{className:`DocSearch-Hit-action`},B.createElement(`button`,{className:`DocSearch-Hit-action-button`,title:s,type:`submit`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.favoriteSearches.remove(e),n.refresh()}},B.createElement(jr,null)))})),l&&B.createElement(Fm,_(_({},n),{},{title:r,collection:l,sourceIcon:B.createElement(Or,null),renderIcon:({item:e})=>B.createElement(`div`,{className:`DocSearch-Hit-icon`},B.createElement(Nr,{type:e.type})),renderAction:({item:e})=>B.createElement(B.Fragment,null,B.createElement(`div`,{className:`DocSearch-Hit-action`},B.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()}},B.createElement(Bp,null))),B.createElement(`div`,{className:`DocSearch-Hit-action`},B.createElement(`button`,{className:`DocSearch-Hit-action-button`,title:a,type:`submit`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.recentSearches.remove(e),n.refresh()}},B.createElement(jr,null))))})))}function Vm({translations:e={}}){let{titleText:t=`Unable to fetch results`,helpText:n=`You might want to check your network connection.`}=e;return B.createElement(`div`,{className:`DocSearch-ErrorScreen`},B.createElement(`div`,{className:`DocSearch-Screen-Icon`},B.createElement(Rp,null)),B.createElement(`p`,{className:`DocSearch-Title`},t),B.createElement(`p`,{className:`DocSearch-Help`},n))}let Hm=[`translations`];function Um(e){let{translations:t={}}=e,n=pn(e,Hm),{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 B.createElement(`div`,{className:`DocSearch-NoResults ${n.canHandleAskAi?`DocSearch-NoResults--withAskAi`:``}`},B.createElement(`div`,{className:`DocSearch-Screen-Icon`},B.createElement(zp,null)),B.createElement(`p`,{className:`DocSearch-Title`},r,` "`,B.createElement(`strong`,null,n.state.query),`"`),s&&s.length>0&&B.createElement(`div`,{className:`DocSearch-NoResults-Prefill-List`},B.createElement(`p`,{className:`DocSearch-Help`},i,`:`),B.createElement(`div`,{className:`DocSearch-NoResults-Prefill-List-Items`},s.slice(0,3).reduce((e,t)=>[...e,B.createElement(`p`,{key:t},B.createElement(dn,{size:16}),B.createElement(`button`,{className:`DocSearch-Prefill`,key:t,type:`button`,onClick:()=>{n.setQuery(t.toLowerCase()+` `),n.refresh(),n.inputRef.current.focus()}},t))],[]))),n.getMissingResultsUrl&&B.createElement(`p`,{className:`DocSearch-Help`},`${a} `,B.createElement(`a`,{href:n.getMissingResultsUrl({query:n.state.query}),target:`_blank`,rel:`noopener noreferrer`},o)))}function Wm(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function Gm({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(Wm(r))a=String(r).trim();else if(Array.isArray(r)){let e=r.filter(Wm).map(e=>String(e).trim());a=e.length>0?e.join(`, `):null}return a===null||a.length===0?null:B.createElement(`div`,{className:`DocSearch-Hit-badge`},B.createElement(`span`,{className:`DocSearch-VisuallyHiddenForAccessibility`},`${i}: ${a}`),B.createElement(`span`,{"aria-hidden":`true`},a))}let Km=[`translations`,`resultBadgeKey`];function qm(e){let{translations:t={},resultBadgeKey:n}=e,r=pn(e,Km),i=B.useCallback(()=>B.createElement(`div`,{className:`DocSearch-Hit-action`},B.createElement(Lp,null)),[]),a=B.useCallback(({item:e})=>B.createElement(Gm,{item:e,resultBadgeKey:n,translations:{resultBadgeLabelText:t.resultBadgeLabelText}}),[n,t.resultBadgeLabelText]);return B.createElement(`div`,{className:`DocSearch-Dropdown-Container`},r.state.collections.map(e=>{if(e.items.length===0)return null;let n=Fp(e.items[0]);return B.createElement(Fm,_(_({},r),{},{key:e.source.sourceId,translations:t,title:n,collection:e,renderIcon:({item:t,index:n})=>{var r;return B.createElement(B.Fragment,null,t.__docsearch_parent&&B.createElement(`svg`,{className:`DocSearch-Hit-Tree`,viewBox:`0 0 24 54`},B.createElement(`g`,{stroke:`currentColor`,fill:`none`,fillRule:`evenodd`,strokeLinecap:`round`,strokeLinejoin:`round`},t.__docsearch_parent===((r=e.items[n+1])==null?void 0:r.__docsearch_parent)?B.createElement(`path`,{d:`M8 6v42M20 27H8.3`}):B.createElement(`path`,{d:`M8 6v21M20 27H8.3`}))),B.createElement(`div`,{className:`DocSearch-Hit-icon`},B.createElement(Nr,{type:t.type})))},renderAction:i,renderResultBadge:a}))}),r.resultsFooterComponent&&B.createElement(`section`,{className:`DocSearch-HitsFooter`},B.createElement(r.resultsFooterComponent,{state:r.state})))}function Jm(e,t){let n=Object.entries(t),r=new Set(n.map(([e])=>e)),i=[];for(let[e,t]of n)t!==``&&i.push(`${e}:${t}`);if(r.size===0)return e;let a=[];return e&&Array.isArray(e)?a=e:e&&(a=[e]),[...a.filter(e=>{if(typeof e!=`string`)return!0;let t=e.indexOf(`:`),n=e.slice(0,t);return t<=0||!r.has(n)}),...i]}function Ym({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 Xm({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=Jm(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),f?{facetFilters:f}:{})})});return r.flatMap(e=>{let r=e,{hits:i,nbHits:a}=r,o=Op(d(i),e=>Fp(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={};return h&&(m={__autocomplete_indexName:r.index,__autocomplete_queryID:r.queryID,__autocomplete_algoliaCredentials:{appId:c,apiKey:l}}),Object.values(o).map((e,t)=>({sourceId:`hits_${r.index}_${t}`,onSelect({item:e,event:t}){f(e),Ap(t)||p()},getItemUrl({item:e}){return e.url},getItems(){return Object.values(Op(e,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()}}))})}catch(e){throw e.name===`RetryError`&&r(`error`),e}}function Zm({indices:e}){if(!Array.isArray(e)||e.length<1)throw Error("Must supply at least one `indices` entry for DocSearch");return e.map(e=>typeof e==`string`?{name:e}:e)}V();let Qm=I(void 0);function $m(e){let t=Re(Qm);if(t===void 0&&!e)throw Error(Jr(47));return t}V();function eh(){return U(U({},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 th=U(U({},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 nh=class e extends Yu{constructor(e,t,n=!1){let r=U(U({},eh()),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},th),H(this,`setOpen`,(e,t)=>{var n,r;let i=t.reason===ta,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)}),cn(d)):d(),a||o?this.set(`instantType`,a?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)}),H(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 Pe(()=>i==null?void 0:i.disposeEffect(),[i]),r}};V();function rh({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=nh.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}),Pe(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let g=Le(()=>{u.setOpen(!1,wo(sa))},[u]);Ie(e.actionsRef,()=>({unmount:h,close:g}),[h,g]);let _=d||f,v=z(()=>({store:u}),[u]);return Eo(Qm.Provider,{value:v,children:[_&&Eo(ah,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})}function ih(e){return $m(!0)?Eo(rh,{props:e}):Eo(ol,{children:Eo(rh,{props:e})})}function ah({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?pi:n,inactiveTriggerProps:(r=i.trigger)==null?pi:r,popupProps:z(()=>vi(ed,i.floating),[i.floating])}),null}V();let oh=[`render`,`className`,`style`,`disabled`,`nativeButton`,`handle`,`payload`,`openOnHover`,`delay`,`closeDelay`,`id`],sh=yt(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=vr(e,oh),h=$m(!0),g=(n=c==null?void 0:c.store)==null?h==null?void 0:h.store:n;if(!g)throw Error(Jr(74));let _=xo(p),v=g.useState(`isTriggerActive`,_),y=g.useState(`floatingRootContext`),b=g.useState(`isOpenedByTrigger`,_),x=g.useState(`triggerPopupId`,_),S=R(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}=Wa({disabled:o,native:s}),ne={open(e){return e&&T===`trigger-press`?Xi.open(e):Yi.open(e)}},{preFocusGuardRef:P,handlePreFocusGuardFocus:re,handleFocusTargetFocus:ie}=pp(g,S),ae=Mi(`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?Eo(E,{children:[Eo(ys,{ref:P,onFocus:re}),Eo(E,{children:ae},_),Eo(ys,{ref:g.context.triggerFocusTargetRef,onFocus:ie})]}):Eo(E,{children:ae},_)});V();let ch=I(void 0);function lh(){let e=Re(ch);if(e===void 0)throw Error(Jr(45));return e}V();let uh=[`keepMounted`],dh=yt(function(e,t){let{keepMounted:n=!1}=e,r=vr(e,uh),{store:i}=$m();return i.useState(`mounted`)||n?Eo(ch.Provider,{value:n,children:Eo(Zc,U({ref:t},r))}):null});V();let fh=I(void 0);function ph(){let e=Re(fh);if(!e)throw Error(Jr(46));return e}V();let mh=[`render`,`className`,`style`,`anchor`,`positionMethod`,`side`,`align`,`sideOffset`,`alignOffset`,`collisionBoundary`,`collisionPadding`,`arrowPadding`,`sticky`,`disableAnchorTracking`,`collisionAvoidance`],hh=yt(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,_=vr(e,mh),{store:v}=$m(),y=lh(),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=R(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`);W(()=>{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=Le(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 Eo(fh.Provider,{value:N,children:[S&&E===!0&&w!==`trigger-hover`&&Eo(Ef,{ref:v.context.internalBackdropRef,inert:cf(!C),cutout:T}),Eo(al,{id:b,children:P})]})});V();let gh=I(void 0);function _h(){let[e,t]=Me(0),n=La(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:z(()=>({register:n}),[n]),hasClosePart:e>0}}function vh(e){let{value:t,children:n}=e;return Eo(gh.Provider,{value:t,children:n})}function yh(){let e=Re(gh);W(()=>e==null?void 0:e.register(),[e])}V();let bh=[`render`,`className`,`style`,`initialFocus`,`finalFocus`],xh=U(U({},Zi),Vi),Sh=yt(function(e,t){var n;let{render:r,className:i,style:a,initialFocus:o,finalFocus:s}=e,c=vr(e,bh),{store:l}=$m(),u=ph(),d=Jd(!0)!=null,{context:f,hasClosePart:p}=_h(),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=Le(e=>{l.set(`popupElement`,e)},[l]),N=Mi(`div`,e,{state:{open:m,side:u.side,align:u.align,instant:g,transitionStatus:_},ref:[t,l.context.popupRef,ee],props:[v,U(U({id:A,role:`dialog`},ed),{},{"aria-labelledby":y,"aria-describedby":b,onKeyDown(e){d&&Qd.has(e.key)&&e.stopPropagation()}}),$d(_),c],stateAttributesMapping:xh});return Eo(ml,{context:T,openInteractionType:h,modal:M,disabled:!S||C===`trigger-hover`,initialFocus:j,returnFocus:s,restoreFocus:`popup`,previousFocusableElement:ha(w)?w:void 0,nextFocusableElement:l.context.triggerFocusTargetRef,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:Eo(vh,{value:f,children:N})})});V();let Ch=[`render`,`className`,`style`],wh=yt(function(e,t){let{render:n,className:r,style:i}=e,a=vr(e,Ch),{store:o}=$m(),s=o.useState(`open`),{arrowRef:c,side:l,align:u,arrowUncentered:d,arrowStyles:f}=ph();return Mi(`div`,e,{state:{open:s,side:l,align:u,uncentered:d},ref:[t,c],props:[{style:f,"aria-hidden":!0},a],stateAttributesMapping:Zi})});V();let Th=[`render`,`className`,`style`],Eh=yt(function(e,t){let{render:n,className:r,style:i}=e,a=vr(e,Th),{store:o}=$m(),s=xo(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),Mi(`h2`,e,{ref:t,props:[{id:s},a]})});V();let Dh=[`render`,`className`,`style`,`disabled`,`nativeButton`],Oh=yt(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0}=e,s=vr(e,Dh),{buttonRef:c,getButtonProps:l}=Wa({disabled:a,focusableWhenDisabled:!1,native:o}),{store:u}=$m();return yh(),Mi(`button`,e,{ref:[t,c],props:[{onClick(e){u.setOpen(!1,wo(`close-press`,e.nativeEvent))}},s,l]})});var kh;function Ah(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var jh=Ah();function Mh(e){jh=e}var Nh={exec:()=>null};function Ph(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(Ih.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Fh=(()=>{try{return!0}catch(e){return!1}})(),Ih={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`)},Lh=/^(?:[ \t]*(?:\n|$))+/,Rh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,zh=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Bh=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Vh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Hh=/(?:[*+-]|\d{1,9}[.)])/,Uh=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Wh=Ph(Uh).replace(/bull/g,Hh).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(),Gh=Ph(Uh).replace(/bull/g,Hh).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(),Kh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,qh=/^[^\n]+/,Jh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Yh=Ph(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Jh).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Xh=Ph(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Hh).getRegex(),Zh=`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`,Qh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$h=Ph(`^ {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`,Qh).replace(`tag`,Zh).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),eg=Ph(Kh).replace(`hr`,Bh).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`,Zh).getRegex(),tg={blockquote:Ph(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,eg).getRegex(),code:Rh,def:Yh,fences:zh,heading:Vh,hr:Bh,html:$h,lheading:Wh,list:Xh,newline:Lh,paragraph:eg,table:Nh,text:qh},ng=Ph(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Bh).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`,Zh).getRegex(),rg=U(U({},tg),{},{lheading:Gh,table:ng,paragraph:Ph(Kh).replace(`hr`,Bh).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,ng).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`,Zh).getRegex()}),ig=U(U({},tg),{},{html:Ph(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Qh).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:Nh,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ph(Kh).replace(`hr`,Bh).replace(`heading`,` *#{1,6} *[^
27
+ ]`).replace(`lheading`,Wh).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()}),ag=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,og=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,sg=/^( {2,}|\\)\n(?!\s*$)/,cg=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,lg=RegExp(`[\\p{P}\\p{S}]`,`u`),ug=RegExp(`[\\s\\p{P}\\p{S}]`,`u`),dg=RegExp(`[^\\s\\p{P}\\p{S}]`,`u`),fg=Ph(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,ug).getRegex(),pg=RegExp(`(?!~)[\\p{P}\\p{S}]`,`u`),mg=RegExp(`(?!~)[\\s\\p{P}\\p{S}]`,`u`),hg=RegExp(`(?:[^\\s\\p{P}\\p{S}]|~)`,`u`),gg=Ph(/link|precode-code|html/,`g`).replace(`link`,RegExp("\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)",``)).replace(`precode-`,Fh?"(?<!`)()":"(^^|[^`])").replace(`code`,RegExp("(?<b>`+)[^`]+\\k<b>(?!`)",``)).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),_g=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,vg=Ph(_g,`u`).replace(/punct/g,lg).getRegex(),yg=Ph(_g,`u`).replace(/punct/g,pg).getRegex(),bg=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,xg=Ph(bg,`gu`).replace(/notPunctSpace/g,dg).replace(/punctSpace/g,ug).replace(/punct/g,lg).getRegex(),Sg=Ph(bg,`gu`).replace(/notPunctSpace/g,hg).replace(/punctSpace/g,mg).replace(/punct/g,pg).getRegex(),Cg=Ph(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,dg).replace(/punctSpace/g,ug).replace(/punct/g,lg).getRegex(),wg=Ph(/\\(punct)/,`gu`).replace(/punct/g,lg).getRegex(),Tg=Ph(/^<(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(),Eg=Ph(Qh).replace(`(?:-->|$)`,`-->`).getRegex(),Dg=Ph(`^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`,Eg).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Og=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,kg=Ph(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,Og).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ag=Ph(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Og).replace(`ref`,Jh).getRegex(),jg=Ph(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Jh).getRegex(),Mg=Ph(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Ag).replace(`nolink`,jg).getRegex(),Ng=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Pg={_backpedal:Nh,anyPunctuation:wg,autolink:Tg,blockSkip:gg,br:sg,code:og,del:Nh,emStrongLDelim:vg,emStrongRDelimAst:xg,emStrongRDelimUnd:Cg,escape:ag,link:kg,nolink:jg,punctuation:fg,reflink:Ag,reflinkSearch:Mg,tag:Dg,text:cg,url:Nh},Fg=U(U({},Pg),{},{link:Ph(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Og).getRegex(),reflink:Ph(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Og).getRegex()}),Ig=U(U({},Pg),{},{emStrongRDelimAst:Sg,emStrongLDelim:yg,url:Ph(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Ng).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:Ph(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Ng).getRegex()}),Lg=U(U({},Ig),{},{br:Ph(sg).replace(`{2,}`,`*`).getRegex(),text:Ph(Ig.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()}),Rg={normal:tg,gfm:rg,pedantic:ig},zg={normal:Pg,gfm:Ig,breaks:Lg,pedantic:Fg},Bg={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},Vg=e=>Bg[e];function Hg(e,t){if(t){if(Ih.escapeTest.test(e))return e.replace(Ih.escapeReplace,Vg)}else if(Ih.escapeTestNoEncode.test(e))return e.replace(Ih.escapeReplaceNoEncode,Vg);return e}function Ug(e){try{e=encodeURI(e).replace(Ih.percentDecode,`%`)}catch(e){return null}return e}function Wg(e,t){var n;let r=e.replace(Ih.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Ih.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(Ih.slashPipe,`|`);return r}function Gg(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 Kg(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 qg(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 Jg(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
28
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],`
29
+ `)}var Yg=class{constructor(e){H(this,`options`,void 0),H(this,`rules`,void 0),H(this,`lexer`,void 0),this.options=e||jh}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:Gg(e,`
30
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Jg(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=Gg(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:Gg(t[0],`
31
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Gg(t[0],`
32
32
  `).split(`
33
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
34
  `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
@@ -46,10 +46,10 @@ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
46
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
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
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+=`
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=Wg(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(Wg(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=Gg(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Kg(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)),qg(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 qg(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}}}},Xg=class e{constructor(e){H(this,`tokens`,void 0),H(this,`options`,void 0),H(this,`state`,void 0),H(this,`tokenizer`,void 0),H(this,`inlineQueue`,void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||jh,this.options.tokenizer=this.options.tokenizer||new Yg,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:Ih,block:Rg.normal,inline:zg.normal};this.options.pedantic?(t.block=Rg.pedantic,t.inline=zg.pedantic):this.options.gfm&&(t.block=Rg.gfm,this.options.breaks?t.inline=zg.breaks:t.inline=zg.gfm),this.tokenizer.rules=t}static get rules(){return{block:Rg,inline:zg}}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(Ih.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(Ih.tabCharGlobal,` `).replace(Ih.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
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
54
  `)?``:`
55
55
  `)+a.raw,n.text+=`
@@ -62,16 +62,16 @@ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
62
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
63
  `)?``:`
64
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>
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}},Zg=class{constructor(e){H(this,`options`,void 0),H(this,`parser`,void 0),this.options=e||jh}space(e){return``}code({text:e,lang:t,escaped:n}){var r;let i=(r=(t||``).match(Ih.notSpaceStart))==null?void 0:r[0],a=e.replace(Ih.endingNewline,``)+`
66
+ `;return i?`<pre><code class="language-`+Hg(i)+`">`+(n?a:Hg(a,!0))+`</code></pre>
67
+ `:`<pre><code>`+(n?a:Hg(a,!0))+`</code></pre>
68
68
  `}blockquote({tokens:e}){return`<blockquote>
69
69
  ${this.parser.parse(e)}</blockquote>
70
70
  `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
71
71
  `}hr(e){return`<hr>
72
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
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>
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+` `+Hg(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
75
  `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox">`}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
76
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
77
  <thead>
@@ -80,22 +80,22 @@ ${this.parser.parse(e)}</blockquote>
80
80
  `}tablerow({text:e}){return`<tr>
81
81
  ${e}</tr>
82
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(`
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>${Hg(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=Ug(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+Hg(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=Ug(e);if(i===null)return Hg(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${Hg(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Hg(e.text)}},Qg=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``}},$g=class e{constructor(e){H(this,`options`,void 0),H(this,`renderer`,void 0),H(this,`textRenderer`,void 0),this.options=e||jh,this.options.renderer=this.options.renderer||new Zg,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Qg}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}},e_=(kh=class{constructor(e){H(this,`options`,void 0),H(this,`block`,void 0),this.options=e||jh}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Xg.lex:Xg.lexInline}provideParser(){return this.block?$g.parse:$g.parseInline}},H(kh,`passThroughHooks`,new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`])),H(kh,`passThroughHooksRespectAsync`,new Set([`preprocess`,`postprocess`,`processAllTokens`])),kh),t_=new class{constructor(...e){H(this,`defaults`,Ah()),H(this,`options`,this.setOptions),H(this,`parse`,this.parseMarkdown(!0)),H(this,`parseInline`,this.parseMarkdown(!1)),H(this,`Parser`,$g),H(this,`Renderer`,Zg),H(this,`TextRenderer`,Qg),H(this,`Lexer`,Xg),H(this,`Tokenizer`,Yg),H(this,`Hooks`,e_),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=U({},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 Zg(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 Yg(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 e_;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];e_.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&e_.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=U(U({},this.defaults),n)}),this}setOptions(e){return this.defaults=U(U({},this.defaults),e),this}lexer(e,t){return Xg.lex(e,t==null?this.defaults:t)}parser(e,t){return $g.parse(e,t==null?this.defaults:t)}parseMarkdown(e){var t=this;return(n,r)=>{let i=U({},r),a=U(U({},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?Xg.lex:Xg.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?$g.parse:$g.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?Xg.lex:Xg.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?$g.parse:$g.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>`+Hg(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function n_(e,t){return t_.parse(e,t)}n_.options=n_.setOptions=function(e){return t_.setOptions(e),n_.defaults=t_.defaults,Mh(n_.defaults),n_},n_.getDefaults=Ah,n_.defaults=jh,n_.use=function(...e){return t_.use(...e),n_.defaults=t_.defaults,Mh(n_.defaults),n_},n_.walkTokens=function(e,t){return t_.walkTokens(e,t)},n_.parseInline=t_.parseInline,n_.Parser=$g,n_.parser=$g.parse,n_.Renderer=Zg,n_.TextRenderer=Qg,n_.Lexer=Xg,n_.lexer=Xg.lex,n_.Tokenizer=Yg,n_.Hooks=e_,n_.parse=n_,n_.options,n_.setOptions,n_.use,n_.walkTokens,n_.parseInline,$g.parse,Xg.lex;var r_=`vercel.ai.error`,i_=Symbol.for(r_),a_,o_,s_=class e extends (o_=Error,a_=i_,o_){constructor({name:e,message:t,cause:n}){super(t),this[a_]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,r_)}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 c_(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.message:JSON.stringify(e)}var l_=`AI_InvalidArgumentError`,u_=`vercel.ai.error.${l_}`,d_=Symbol.for(u_),f_,p_,m_=class extends (p_=s_,f_=d_,p_){constructor({message:e,cause:t,argument:n}){super({name:l_,message:e,cause:t}),this[f_]=!0,this.argument=n}static isInstance(e){return s_.hasMarker(e,u_)}},h_=`AI_JSONParseError`,g_=`vercel.ai.error.${h_}`,__=Symbol.for(g_),v_,y_,b_=class extends (y_=s_,v_=__,y_){constructor({text:e,cause:t}){super({name:h_,message:`JSON parsing failed: Text: ${e}.
86
+ Error message: ${c_(t)}`,cause:t}),this[v_]=!0,this.text=e}static isInstance(e){return s_.hasMarker(e,g_)}},x_=`AI_TypeValidationError`,S_=`vercel.ai.error.${x_}`,C_=Symbol.for(S_),w_,T_,E_=class e extends (T_=s_,w_=C_,T_){constructor({value:e,cause:t}){super({name:x_,message:`Type validation failed: Value: ${JSON.stringify(e)}.
87
+ Error message: ${c_(t)}`,cause:t}),this[w_]=!0,this.value=e}static isInstance(e){return s_.hasMarker(e,S_)}static wrap({value:t,cause:n}){return e.isInstance(n)&&n.value===t?n:new e({value:t,cause:n})}},D_=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 O_(e){}function k_(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=O_,onError:n=O_,onRetry:r=O_,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 D_(`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
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(`
90
+ `,n);continue}let i=e.charCodeAt(n);if(A_(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
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(`
92
+ ${a}`,d++}else j_(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
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(`
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(A_(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(j_(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 D_(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:i}));break;default:n(new D_(`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 A_(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 j_(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 M_=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n,maxBufferSize:r}={}){let i;super({start(a){i=k_({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)}})}},N_;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 P_=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},F_=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(N_=globalThis).__zod_globalConfig!=null||(N_.__zod_globalConfig={});let I_=globalThis.__zod_globalConfig;function L_(e){return e&&Object.assign(I_,e),I_}let R_=[`inst`,`continue`,`input`];function z_(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 B_(e,t){return typeof t==`bigint`?t.toString():t}function V_(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function H_(e){return e==null}function U_(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function W_(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 G_=Symbol(`evaluating`);function K_(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==G_)return r===void 0&&(r=G_,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function q_(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function J_(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Y_(e){return JSON.stringify(e)}function X_(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}let Z_=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Q_(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}let $_=V_(()=>{var e;if(I_.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 ev(e){if(Q_(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Q_(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function tv(e){return ev(e)?U({},e):Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let nv=new Set([`string`,`number`,`symbol`]);function rv(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function iv(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`?U(U({},t),{},{error:()=>t.error}):t}function av(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}let ov={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function sv(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 iv(e,J_(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 q_(this,`shape`,e),e},checks:[]}))}function cv(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 iv(e,J_(e._zod.def,{get shape(){let r=U({},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 q_(this,`shape`,r),r},checks:[]}))}function lv(e,t){if(!ev(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 iv(e,J_(e._zod.def,{get shape(){let n=U(U({},e._zod.def.shape),t);return q_(this,`shape`,n),n}}))}function uv(e,t){if(!ev(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return iv(e,J_(e._zod.def,{get shape(){let n=U(U({},e._zod.def.shape),t);return q_(this,`shape`,n),n}}))}function dv(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 iv(e,J_(e._zod.def,{get shape(){let n=U(U({},e._zod.def.shape),t._zod.def.shape);return q_(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:(r=t._zod.def.checks)==null?[]:r}))}function fv(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 iv(t,J_(t._zod.def,{get shape(){let r=t._zod.def.shape,i=U({},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 q_(this,`shape`,i),i},checks:[]}))}function pv(e,t,n){return iv(t,J_(t._zod.def,{get shape(){let r=t._zod.def.shape,i=U({},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 q_(this,`shape`,i),i}}))}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)!==!0)return!0}return!1}function hv(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 gv(e,t){return t.map(t=>{var n;return(n=t).path!=null||(n.path=[]),t.path.unshift(e),t})}function _v(e){return typeof e==`string`?e:e==null?void 0:e.message}function vv(e,t,n){var r,i,a,o,s,c,l,u,d;let f=e.message?e.message:(r=(i=(a=(o=_v((s=e.inst)==null||(s=s._zod.def)==null||(c=s.error)==null?void 0:c.call(s,e)))==null?_v(t==null||(l=t.error)==null?void 0:l.call(t,e)):o)==null?_v((u=n.customError)==null?void 0:u.call(n,e)):a)==null?_v((d=n.localeError)==null?void 0:d.call(n,e)):i)==null?`Invalid input`:r,{inst:p,continue:m,input:h}=e,g=vr(e,R_);return g.path!=null||(g.path=[]),g.message=f,t!=null&&t.reportInput&&(g.input=h),g}function yv(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function bv(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:U({},t)}let xv=(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,B_,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Sv=K(`$ZodError`,xv),Cv=K(`$ZodError`,xv,{Parent:Error});function wv(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 Tv(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 Ev=e=>(t,n,r,i)=>{let a=r?U(U({},r),{},{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new P_;if(o.issues.length){var s;let t=new((s=i==null?void 0:i.Err)==null?e:s)(o.issues.map(e=>vv(e,a,L_())));throw Z_(t,i==null?void 0:i.callee),t}return o.value},Dv=e=>async(t,n,r,i)=>{let a=r?U(U({},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=>vv(e,a,L_())));throw Z_(t,i==null?void 0:i.callee),t}return o.value},Ov=e=>(t,n,r)=>{let i=r?U(U({},r),{},{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new P_;return a.issues.length?{success:!1,error:new(e==null?Sv:e)(a.issues.map(e=>vv(e,i,L_())))}:{success:!0,data:a.value}},kv=Ov(Cv),Av=e=>async(t,n,r)=>{let i=r?U(U({},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=>vv(e,i,L_())))}:{success:!0,data:a.value}},jv=Av(Cv),Mv=e=>(t,n,r)=>{let i=r?U(U({},r),{},{direction:`backward`}):{direction:`backward`};return Ev(e)(t,n,i)},Nv=e=>(t,n,r)=>Ev(e)(t,n,r),Pv=e=>async(t,n,r)=>{let i=r?U(U({},r),{},{direction:`backward`}):{direction:`backward`};return Dv(e)(t,n,i)},Fv=e=>async(t,n,r)=>Dv(e)(t,n,r),Iv=e=>(t,n,r)=>{let i=r?U(U({},r),{},{direction:`backward`}):{direction:`backward`};return Ov(e)(t,n,i)},Lv=e=>(t,n,r)=>Ov(e)(t,n,r),Rv=e=>async(t,n,r)=>{let i=r?U(U({},r),{},{direction:`backward`}):{direction:`backward`};return Av(e)(t,n,i)},zv=e=>async(t,n,r)=>Av(e)(t,n,r),Bv=/^[cC][0-9a-z]{6,}$/,Vv=/^[0-9a-z]+$/,Hv=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Uv=/^[0-9a-vA-V]{20}$/,Wv=/^[A-Za-z0-9]{27}$/,Gv=/^[a-zA-Z0-9_-]{21}$/,Kv=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,qv=/^([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})$/,Jv=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)$/,Yv=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function Xv(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}let Zv=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Qv=/^(([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}|:))$/,$v=/^((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])$/,ey=/^(([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])$/,ty=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ny=/^[A-Za-z0-9_-]*$/,ry=/^https?$/,iy=/^\+[1-9]\d{6,14}$/,ay=`(?:(?:\\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])))`,oy=RegExp(`^${ay}$`);function sy(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 cy(e){return RegExp(`^${sy(e)}$`)}function ly(e){let t=sy({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(`^${ay}T(?:${r})$`)}let uy=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}$`)},dy=/^-?\d+$/,fy=/^-?\d+(?:\.\d+)?$/,py=/^(?:true|false)$/i,my=/^null$/i,hy=/^[^A-Z]*$/,gy=/^[^a-z]*$/,_y=K(`$ZodCheck`,(e,t)=>{var n;e._zod!=null||(e._zod={}),e._zod.def=t,(n=e._zod).onattach!=null||(n.onattach=[])}),vy={number:`number`,bigint:`bigint`,object:`date`},yy=K(`$ZodCheckLessThan`,(e,t)=>{_y.init(e,t);let n=vy[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})}}),by=K(`$ZodCheckGreaterThan`,(e,t)=>{_y.init(e,t);let n=vy[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})}}),xy=K(`$ZodCheckMultipleOf`,(e,t)=>{_y.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):W_(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})}}),Sy=K(`$ZodCheckNumberFormat`,(e,t)=>{var n;_y.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]=ov[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=dy)}),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})}}),Cy=K(`$ZodCheckMaxLength`,(e,t)=>{var n;_y.init(e,t),(n=e._zod.def).when!=null||(n.when=e=>{let t=e.value;return!H_(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=yv(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),wy=K(`$ZodCheckMinLength`,(e,t)=>{var n;_y.init(e,t),(n=e._zod.def).when!=null||(n.when=e=>{let t=e.value;return!H_(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=yv(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ty=K(`$ZodCheckLengthEquals`,(e,t)=>{var n;_y.init(e,t),(n=e._zod.def).when!=null||(n.when=e=>{let t=e.value;return!H_(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=yv(r),o=i>t.length;n.issues.push(U(U({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}))}}),Ey=K(`$ZodCheckStringFormat`,(e,t)=>{var n,r;_y.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(U(U({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=()=>{})}),Dy=K(`$ZodCheckRegex`,(e,t)=>{Ey.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})}}),Oy=K(`$ZodCheckLowerCase`,(e,t)=>{t.pattern!=null||(t.pattern=hy),Ey.init(e,t)}),ky=K(`$ZodCheckUpperCase`,(e,t)=>{t.pattern!=null||(t.pattern=gy),Ey.init(e,t)}),Ay=K(`$ZodCheckIncludes`,(e,t)=>{_y.init(e,t);let n=rv(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})}}),jy=K(`$ZodCheckStartsWith`,(e,t)=>{_y.init(e,t);let n=RegExp(`^${rv(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})}}),My=K(`$ZodCheckEndsWith`,(e,t)=>{_y.init(e,t);let n=RegExp(`.*${rv(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})}}),Ny=K(`$ZodCheckOverwrite`,(e,t)=>{_y.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Py=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
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(`
98
+ `))}};let Fy={major:4,minor:4,patch:3},Iy=K(`$ZodType`,(e,t)=>{var n,r;e!=null||(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Fy;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=mv(e),i;for(let o of t){if(o._zod.def.when){if(hv(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 P_;if(i||s instanceof Promise){var a;i=((a=i)==null?Promise.resolve():a).then(async()=>{await s,e.issues.length!==t&&(r||(r=mv(e,t)))})}else{if(e.issues.length===t)continue;r||(r=mv(e,t))}}return i?i.then(()=>e):e},n=(n,r,a)=>{if(mv(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new P_;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:[]},U(U({},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 P_;return o.then(e=>t(e,i,a))}return t(o,i,a)}}K_(e,`~standard`,()=>({validate:t=>{try{var n;let r=kv(e,t);return r.success?{value:r.data}:{issues:(n=r.error)==null?void 0:n.issues}}catch(n){return jv(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}))}),Ly=K(`$ZodString`,(e,t)=>{var n,r,i;Iy.init(e,t),e._zod.pattern=(n=[...(r=e==null||(i=e._zod.bag)==null?void 0:i.patterns)==null?[]:r].pop())==null?uy(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}}),Ry=K(`$ZodStringFormat`,(e,t)=>{Ey.init(e,t),Ly.init(e,t)}),zy=K(`$ZodGUID`,(e,t)=>{t.pattern!=null||(t.pattern=qv),Ry.init(e,t)}),By=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=Jv(e))}else t.pattern!=null||(t.pattern=Jv());Ry.init(e,t)}),Vy=K(`$ZodEmail`,(e,t)=>{t.pattern!=null||(t.pattern=Yv),Ry.init(e,t)}),Hy=K(`$ZodURL`,(e,t)=>{Ry.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)===ry.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})}}}),Uy=K(`$ZodEmoji`,(e,t)=>{t.pattern!=null||(t.pattern=Xv()),Ry.init(e,t)}),Wy=K(`$ZodNanoID`,(e,t)=>{t.pattern!=null||(t.pattern=Gv),Ry.init(e,t)}),Gy=K(`$ZodCUID`,(e,t)=>{t.pattern!=null||(t.pattern=Bv),Ry.init(e,t)}),Ky=K(`$ZodCUID2`,(e,t)=>{t.pattern!=null||(t.pattern=Vv),Ry.init(e,t)}),qy=K(`$ZodULID`,(e,t)=>{t.pattern!=null||(t.pattern=Hv),Ry.init(e,t)}),Jy=K(`$ZodXID`,(e,t)=>{t.pattern!=null||(t.pattern=Uv),Ry.init(e,t)}),Yy=K(`$ZodKSUID`,(e,t)=>{t.pattern!=null||(t.pattern=Wv),Ry.init(e,t)}),Xy=K(`$ZodISODateTime`,(e,t)=>{t.pattern!=null||(t.pattern=ly(t)),Ry.init(e,t)}),Zy=K(`$ZodISODate`,(e,t)=>{t.pattern!=null||(t.pattern=oy),Ry.init(e,t)}),Qy=K(`$ZodISOTime`,(e,t)=>{t.pattern!=null||(t.pattern=cy(t)),Ry.init(e,t)}),$y=K(`$ZodISODuration`,(e,t)=>{t.pattern!=null||(t.pattern=Kv),Ry.init(e,t)}),eb=K(`$ZodIPv4`,(e,t)=>{t.pattern!=null||(t.pattern=Zv),Ry.init(e,t),e._zod.bag.format=`ipv4`}),tb=K(`$ZodIPv6`,(e,t)=>{t.pattern!=null||(t.pattern=Qv),Ry.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})}}}),nb=K(`$ZodCIDRv4`,(e,t)=>{t.pattern!=null||(t.pattern=$v),Ry.init(e,t)}),rb=K(`$ZodCIDRv6`,(e,t)=>{t.pattern!=null||(t.pattern=ey),Ry.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 ib(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 ab=K(`$ZodBase64`,(e,t)=>{t.pattern!=null||(t.pattern=ty),Ry.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{ib(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function ob(e){if(!ny.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return ib(t.padEnd(Math.ceil(t.length/4)*4,`=`))}let sb=K(`$ZodBase64URL`,(e,t)=>{t.pattern!=null||(t.pattern=ny),Ry.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{ob(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),cb=K(`$ZodE164`,(e,t)=>{t.pattern!=null||(t.pattern=iy),Ry.init(e,t)});function lb(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 ub=K(`$ZodJWT`,(e,t)=>{Ry.init(e,t),e._zod.check=n=>{lb(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),db=K(`$ZodNumber`,(e,t)=>{var n;Iy.init(e,t),e._zod.pattern=(n=e._zod.bag.pattern)==null?fy: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(U({expected:`number`,code:`invalid_type`,input:i,inst:e},a?{received:a}:{})),n}}),fb=K(`$ZodNumberFormat`,(e,t)=>{Sy.init(e,t),db.init(e,t)}),pb=K(`$ZodBoolean`,(e,t)=>{Iy.init(e,t),e._zod.pattern=py,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}}),mb=K(`$ZodNull`,(e,t)=>{Iy.init(e,t),e._zod.pattern=my,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}}),hb=K(`$ZodUnknown`,(e,t)=>{Iy.init(e,t),e._zod.parse=e=>e}),gb=K(`$ZodNever`,(e,t)=>{Iy.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function _b(e,t,n){e.issues.length&&t.issues.push(...gv(n,e.issues)),t.value[n]=e.value}let vb=K(`$ZodArray`,(e,t)=>{Iy.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=>_b(t,n,e))):_b(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function yb(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...gv(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 bb(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=av(e.shape);return U(U({},e),{},{keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)})}function xb(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=>yb(e,n,i,t,u,d))):yb(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 Sb=K(`$ZodObject`,(e,t)=>{Iy.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=U({},e);return Object.defineProperty(t,"shape",{value:n}),n}})}let r=V_(()=>bb(t));K_(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=Q_,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=>yb(n,t,e,s,i,a))):yb(o,t,e,s,i,a)}return a?xb(c,s,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),Cb=K(`$ZodObjectJIT`,(e,t)=>{Sb.init(e,t);let n=e._zod.parse,r=V_(()=>bb(t)),i=e=>{let t=new Py([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Y_(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=Y_(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
99
  if (${n}.issues.length) {
100
100
  if (${o} in input) {
101
101
  payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
@@ -154,23 +154,25 @@ ${t}`,d++;break;case`id`:l=t.includes(`\0`)?void 0:t;break;case`retry`:/^\d+$/.t
154
154
  }
155
155
  }
156
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>
157
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let l=t.compile();return(t,n)=>l(e,t,n)},a,o=Q_,s=!I_.jitless,c=s&&$_.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?xb([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function wb(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=>!mv(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=>vv(e,r,L_())))}),t)}let Tb=K(`$ZodUnion`,(e,t)=>{Iy.init(e,t),K_(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),K_(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),K_(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),K_(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=>U_(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=>wb(t,r,e,i)):wb(o,r,e,i)}}),Eb=K(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Tb.init(e,t);let n=e._zod.parse;K_(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=V_(()=>{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(!Q_(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)}}),Db=K(`$ZodIntersection`,(e,t)=>{Iy.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])=>kb(e,t,n)):kb(e,i,a)}});function Ob(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ev(e)&&ev(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i=U(U({},e),t);for(let n of r){let r=Ob(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=Ob(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 kb(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(U(U({},i),{},{keys:a})),mv(e))return e;let o=Ob(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}let Ab=K(`$ZodRecord`,(e,t)=>{Iy.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!ev(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=>vv(e,r,L_())),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(...gv(s,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...gv(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`&&fy.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=>vv(e,r,L_())),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(...gv(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...gv(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),jb=K(`$ZodEnum`,(e,t)=>{Iy.init(e,t);let n=z_(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>nv.has(typeof e)).map(e=>typeof e==`string`?rv(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}}),Mb=K(`$ZodLiteral`,(e,t)=>{if(Iy.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`?rv(e):e?rv(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}}),Nb=K(`$ZodTransform`,(e,t)=>{Iy.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new F_(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 P_;return n.value=i,n.fallback=!0,n}});function Pb(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let Fb=K(`$ZodOptional`,(e,t)=>{Iy.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,K_(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),K_(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${U_(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=>Pb(e,r)):Pb(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Ib=K(`$ZodExactOptional`,(e,t)=>{Fb.init(e,t),K_(e._zod,`values`,()=>t.innerType._zod.values),K_(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Lb=K(`$ZodNullable`,(e,t)=>{Iy.init(e,t),K_(e._zod,`optin`,()=>t.innerType._zod.optin),K_(e._zod,`optout`,()=>t.innerType._zod.optout),K_(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${U_(e.source)}|null)$`):void 0}),K_(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)}),Rb=K(`$ZodDefault`,(e,t)=>{Iy.init(e,t),e._zod.optin=`optional`,K_(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=>zb(e,t)):zb(r,t)}});function zb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}let Bb=K(`$ZodPrefault`,(e,t)=>{Iy.init(e,t),e._zod.optin=`optional`,K_(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))}),Vb=K(`$ZodNonOptional`,(e,t)=>{Iy.init(e,t),K_(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=>Hb(t,e)):Hb(i,e)}});function Hb(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 Ub=K(`$ZodCatch`,(e,t)=>{Iy.init(e,t),e._zod.optin=`optional`,K_(e._zod,`optout`,()=>t.innerType._zod.optout),K_(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(U(U({},e),{},{error:{issues:r.issues.map(e=>vv(e,n,L_()))},input:e.value})),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue(U(U({},e),{},{error:{issues:r.issues.map(e=>vv(e,n,L_()))},input:e.value})),e.issues=[],e.fallback=!0),e)}}),Wb=K(`$ZodPipe`,(e,t)=>{Iy.init(e,t),K_(e._zod,`values`,()=>t.in._zod.values),K_(e._zod,`optin`,()=>t.in._zod.optin),K_(e._zod,`optout`,()=>t.out._zod.optout),K_(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=>Gb(e,t.in,n)):Gb(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Gb(e,t.out,n)):Gb(r,t.out,n)}});function Gb(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 Kb=K(`$ZodReadonly`,(e,t)=>{Iy.init(e,t),K_(e._zod,`propValues`,()=>t.innerType._zod.propValues),K_(e._zod,`values`,()=>t.innerType._zod.values),K_(e._zod,`optin`,()=>{var e;return(e=t.innerType)==null||(e=e._zod)==null?void 0:e.optin}),K_(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(qb):qb(r)}});function qb(e){return e.value=Object.freeze(e.value),e}let Jb=K(`$ZodLazy`,(e,t)=>{Iy.init(e,t),K_(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||(e._cachedInner=t.getter()),e._cachedInner}),K_(e._zod,`pattern`,()=>{var t;return(t=e._zod.innerType)==null||(t=t._zod)==null?void 0:t.pattern}),K_(e._zod,`propValues`,()=>{var t;return(t=e._zod.innerType)==null||(t=t._zod)==null?void 0:t.propValues}),K_(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}),K_(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)}),Yb=K(`$ZodCustom`,(e,t)=>{_y.init(e,t),Iy.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=>Xb(t,n,r,e));Xb(i,n,r,e)}});function Xb(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(bv(e))}}var Zb,Qb=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=U({},(n=this.get(t))==null?{}:n);delete r.id;let i=U(U({},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 $b(){return new Qb}(Zb=globalThis).__zod_globalRegistry!=null||(Zb.__zod_globalRegistry=$b());let ex=globalThis.__zod_globalRegistry;function tx(e,t){return new e(U({type:`string`},q(t)))}function nx(e,t){return new e(U({type:`string`,format:`email`,check:`string_format`,abort:!1},q(t)))}function rx(e,t){return new e(U({type:`string`,format:`guid`,check:`string_format`,abort:!1},q(t)))}function ix(e,t){return new e(U({type:`string`,format:`uuid`,check:`string_format`,abort:!1},q(t)))}function ax(e,t){return new e(U({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`},q(t)))}function ox(e,t){return new e(U({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`},q(t)))}function sx(e,t){return new e(U({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`},q(t)))}function cx(e,t){return new e(U({type:`string`,format:`url`,check:`string_format`,abort:!1},q(t)))}function lx(e,t){return new e(U({type:`string`,format:`emoji`,check:`string_format`,abort:!1},q(t)))}function ux(e,t){return new e(U({type:`string`,format:`nanoid`,check:`string_format`,abort:!1},q(t)))}function dx(e,t){return new e(U({type:`string`,format:`cuid`,check:`string_format`,abort:!1},q(t)))}function fx(e,t){return new e(U({type:`string`,format:`cuid2`,check:`string_format`,abort:!1},q(t)))}function px(e,t){return new e(U({type:`string`,format:`ulid`,check:`string_format`,abort:!1},q(t)))}function mx(e,t){return new e(U({type:`string`,format:`xid`,check:`string_format`,abort:!1},q(t)))}function hx(e,t){return new e(U({type:`string`,format:`ksuid`,check:`string_format`,abort:!1},q(t)))}function gx(e,t){return new e(U({type:`string`,format:`ipv4`,check:`string_format`,abort:!1},q(t)))}function _x(e,t){return new e(U({type:`string`,format:`ipv6`,check:`string_format`,abort:!1},q(t)))}function vx(e,t){return new e(U({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1},q(t)))}function yx(e,t){return new e(U({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1},q(t)))}function bx(e,t){return new e(U({type:`string`,format:`base64`,check:`string_format`,abort:!1},q(t)))}function xx(e,t){return new e(U({type:`string`,format:`base64url`,check:`string_format`,abort:!1},q(t)))}function Sx(e,t){return new e(U({type:`string`,format:`e164`,check:`string_format`,abort:!1},q(t)))}function Cx(e,t){return new e(U({type:`string`,format:`jwt`,check:`string_format`,abort:!1},q(t)))}function wx(e,t){return new e(U({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null},q(t)))}function Tx(e,t){return new e(U({type:`string`,format:`date`,check:`string_format`},q(t)))}function Ex(e,t){return new e(U({type:`string`,format:`time`,check:`string_format`,precision:null},q(t)))}function Dx(e,t){return new e(U({type:`string`,format:`duration`,check:`string_format`},q(t)))}function Ox(e,t){return new e(U({type:`number`,checks:[]},q(t)))}function kx(e,t){return new e(U({type:`number`,check:`number_format`,abort:!1,format:`safeint`},q(t)))}function Ax(e,t){return new e(U({type:`boolean`},q(t)))}function jx(e,t){return new e(U({type:`null`},q(t)))}function Mx(e){return new e({type:`unknown`})}function Nx(e,t){return new e(U({type:`never`},q(t)))}function Px(e,t){return new yy(U(U({check:`less_than`},q(t)),{},{value:e,inclusive:!1}))}function Fx(e,t){return new yy(U(U({check:`less_than`},q(t)),{},{value:e,inclusive:!0}))}function Ix(e,t){return new by(U(U({check:`greater_than`},q(t)),{},{value:e,inclusive:!1}))}function Lx(e,t){return new by(U(U({check:`greater_than`},q(t)),{},{value:e,inclusive:!0}))}function Rx(e,t){return new xy(U(U({check:`multiple_of`},q(t)),{},{value:e}))}function zx(e,t){return new Cy(U(U({check:`max_length`},q(t)),{},{maximum:e}))}function Bx(e,t){return new wy(U(U({check:`min_length`},q(t)),{},{minimum:e}))}function Vx(e,t){return new Ty(U(U({check:`length_equals`},q(t)),{},{length:e}))}function Hx(e,t){return new Dy(U(U({check:`string_format`,format:`regex`},q(t)),{},{pattern:e}))}function Ux(e){return new Oy(U({check:`string_format`,format:`lowercase`},q(e)))}function Wx(e){return new ky(U({check:`string_format`,format:`uppercase`},q(e)))}function Gx(e,t){return new Ay(U(U({check:`string_format`,format:`includes`},q(t)),{},{includes:e}))}function Kx(e,t){return new jy(U(U({check:`string_format`,format:`starts_with`},q(t)),{},{prefix:e}))}function qx(e,t){return new My(U(U({check:`string_format`,format:`ends_with`},q(t)),{},{suffix:e}))}function Jx(e){return new Ny({check:`overwrite`,tx:e})}function Yx(e){return Jx(t=>t.normalize(e))}function Xx(){return Jx(e=>e.trim())}function Zx(){return Jx(e=>e.toLowerCase())}function Qx(){return Jx(e=>e.toUpperCase())}function $x(){return Jx(e=>X_(e))}function eS(e,t,n){return new e(U({type:`array`,element:t},q(n)))}function tS(e,t,n){let r=q(n);return r.abort!=null||(r.abort=!0),new e(U({type:`custom`,check:`custom`,fn:t},r))}function nS(e,t,n){return new e(U({type:`custom`,check:`custom`,fn:t},q(n)))}function rS(e,t){let n=iS(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(bv(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(bv(r))}},e(t.value,t)),t);return n}function iS(e,t){let n=new _y(U({check:`custom`},q(t)));return n._zod.check=e,n}function aS(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?ex: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 oS(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=U(U({},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),oS(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`&&lS(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 sS(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=U({},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
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
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 cS(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=U({},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:U(U({},t[`~standard`]),{},{jsonSchema:{input:dS(t,`input`,e.processors),output:dS(t,`output`,e.processors)}}),enumerable:!1,writable:!1}),n}catch(e){throw Error(`Error converting schema to JSON.`)}}function lS(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 lS(r.element,n);if(r.type===`set`)return lS(r.valueType,n);if(r.type===`lazy`)return lS(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 lS(r.innerType,n);if(r.type===`intersection`)return lS(r.left,n)||lS(r.right,n);if(r.type===`record`||r.type===`map`)return lS(r.keyType,n)||lS(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:lS(r.in,n)||lS(r.out,n);if(r.type===`object`){for(let e in r.shape)if(lS(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(lS(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(lS(e,n))return!0;return!!(r.rest&&lS(r.rest,n))}return!1}let uS=(e,t={})=>n=>{let r=aS(U(U({},n),{},{processors:t}));return oS(e,r),sS(r,e),cS(r,e)},dS=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r==null?{}:r,o=aS(U(U({},i==null?{}:i),{},{target:a,io:t,processors:n}));return oS(e,o),sS(o,e),cS(o,e)},fS={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},pS=(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=fS[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=>U(U({},t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{}),{},{pattern:e.source}))])}},mS=(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)},hS=(e,t,n,r)=>{n.type=`boolean`},gS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},_S=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},vS=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},yS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},bS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},xS=(e,t,n,r)=>{n.not={}},SS=(e,t,n,r)=>{},CS=(e,t,n,r)=>{},wS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},TS=(e,t,n,r)=>{let i=e._zod.def,a=z_(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},ES=(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},DS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},OS=(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},kS=(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)},AS=(e,t,n,r)=>{n.type=`boolean`},jS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},MS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},NS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},PS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},FS=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},IS=(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=oS(a.element,t,U(U({},r),{},{path:[...r.path,`items`]}))},LS=(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]=oS(s[e],t,U(U({},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=oS(o.catchall,t,U(U({},r),{},{path:[...r.path,`additionalProperties`]}))):t.io===`output`&&(a.additionalProperties=!1)},RS=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>oS(e,t,U(U({},r),{},{path:[...r.path,a?`oneOf`:`anyOf`,n]})));a?n.oneOf=o:n.anyOf=o},zS=(e,t,n,r)=>{let i=e._zod.def,a=oS(i.left,t,U(U({},r),{},{path:[...r.path,`allOf`,0]})),o=oS(i.right,t,U(U({},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]]},BS=(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)=>oS(e,t,U(U({},r),{},{path:[...r.path,o,n]}))),l=a.rest?oS(a.rest,t,U(U({},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)},VS=(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=oS(a.valueType,t,U(U({},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=oS(a.keyType,t,U(U({},r),{},{path:[...r.path,`propertyNames`]}))),i.additionalProperties=oS(a.valueType,t,U(U({},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)}},HS=(e,t,n,r)=>{let i=e._zod.def,a=oS(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`}]},US=(e,t,n,r)=>{let i=e._zod.def;oS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},WS=(e,t,n,r)=>{let i=e._zod.def;oS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},GS=(e,t,n,r)=>{let i=e._zod.def;oS(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)))},KS=(e,t,n,r)=>{let i=e._zod.def;oS(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},qS=(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;oS(o,t,r);let s=t.seen.get(e);s.ref=o},JS=(e,t,n,r)=>{let i=e._zod.def;oS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},YS=(e,t,n,r)=>{let i=e._zod.def;oS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},XS=(e,t,n,r)=>{let i=e._zod.def;oS(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ZS=(e,t,n,r)=>{let i=e._zod.innerType;oS(i,t,r);let a=t.seen.get(e);a.ref=i},QS={string:pS,number:mS,boolean:hS,bigint:gS,symbol:_S,null:vS,undefined:yS,void:bS,never:xS,any:SS,unknown:CS,date:wS,enum:TS,literal:ES,nan:DS,template_literal:OS,file:kS,success:AS,custom:jS,function:MS,transform:NS,map:PS,set:FS,array:IS,object:LS,union:RS,intersection:zS,tuple:BS,record:VS,nullable:HS,nonoptional:US,default:WS,prefault:GS,catch:KS,pipe:qS,readonly:JS,promise:YS,optional:XS,lazy:ZS};function $S(e,t){if(`_idmap`in e){let n=e,r=aS(U(U({},t),{},{processors:QS})),i={};for(let e of n._idmap.entries()){let[t,n]=e;oS(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;sS(r,n),a[t]=cS(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=aS(U(U({},t),{},{processors:QS}));return oS(e,n),sS(n,e),cS(n,e)}let eC=K(`ZodISODateTime`,(e,t)=>{Xy.init(e,t),EC.init(e,t)});function tC(e){return wx(eC,e)}let nC=K(`ZodISODate`,(e,t)=>{Zy.init(e,t),EC.init(e,t)});function rC(e){return Tx(nC,e)}let iC=K(`ZodISOTime`,(e,t)=>{Qy.init(e,t),EC.init(e,t)});function aC(e){return Ex(iC,e)}let oC=K(`ZodISODuration`,(e,t)=>{$y.init(e,t),EC.init(e,t)});function sC(e){return Dx(oC,e)}let cC=K(`ZodError`,(e,t)=>{Sv.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Tv(e,t)},flatten:{value:t=>wv(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,B_,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,B_,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),lC=Ev(cC),uC=Dv(cC),dC=Ov(cC),fC=Av(cC),pC=Mv(cC),mC=Nv(cC),hC=Pv(cC),gC=Fv(cC),_C=Iv(cC),vC=Lv(cC),yC=Rv(cC),bC=zv(cC),xC=new WeakMap;function SC(e,t,n){let r=Object.getPrototypeOf(e),i=xC.get(r);if(i||(i=new Set,xC.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 CC=K(`ZodType`,(e,t)=>(Iy.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:dS(e,`input`),output:dS(e,`output`)}}),e.toJSONSchema=uS(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>lC(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>dC(e,t,n),e.parseAsync=async(t,n)=>uC(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>fC(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>pC(e,t,n),e.decode=(t,n)=>mC(e,t,n),e.encodeAsync=async(t,n)=>hC(e,t,n),e.decodeAsync=async(t,n)=>gC(e,t,n),e.safeEncode=(t,n)=>_C(e,t,n),e.safeDecode=(t,n)=>vC(e,t,n),e.safeEncodeAsync=async(t,n)=>yC(e,t,n),e.safeDecodeAsync=async(t,n)=>bC(e,t,n),SC(e,`ZodType`,{check(...e){var t;let n=this.def;return this.clone(J_(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 iv(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Gw(e,t))},superRefine(e,t){return this.check(Kw(e,t))},overwrite(e){return this.check(Jx(e))},optional(){return ww(this)},exactOptional(){return Ew(this)},nullable(){return Ow(this)},nullish(){return ww(Ow(this))},nonoptional(e){return Pw(this,e)},array(){return aw(this)},or(e){return uw([this,e])},and(e){return mw(this,e)},transform(e){return Rw(this,Sw(e))},default(e){return Aw(this,e)},prefault(e){return Mw(this,e)},catch(e){return Iw(this,e)},pipe(e){return Rw(this,e)},readonly(){return Bw(this)},describe(e){let t=this.clone();return ex.add(t,{description:e}),t},meta(...e){if(e.length===0)return ex.get(this);let t=this.clone();return ex.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=ex.get(e))==null?void 0:t.description},configurable:!0}),e)),wC=K(`_ZodString`,(e,t)=>{var n,r,i;Ly.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pS(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,SC(e,`_ZodString`,{regex(...e){return this.check(Hx(...e))},includes(...e){return this.check(Gx(...e))},startsWith(...e){return this.check(Kx(...e))},endsWith(...e){return this.check(qx(...e))},min(...e){return this.check(Bx(...e))},max(...e){return this.check(zx(...e))},length(...e){return this.check(Vx(...e))},nonempty(...e){return this.check(Bx(1,...e))},lowercase(e){return this.check(Ux(e))},uppercase(e){return this.check(Wx(e))},trim(){return this.check(Xx())},normalize(...e){return this.check(Yx(...e))},toLowerCase(){return this.check(Zx())},toUpperCase(){return this.check(Qx())},slugify(){return this.check($x())}})}),TC=K(`ZodString`,(e,t)=>{Ly.init(e,t),wC.init(e,t),e.email=t=>e.check(nx(DC,t)),e.url=t=>e.check(cx(AC,t)),e.jwt=t=>e.check(Cx(GC,t)),e.emoji=t=>e.check(lx(jC,t)),e.guid=t=>e.check(rx(OC,t)),e.uuid=t=>e.check(ix(kC,t)),e.uuidv4=t=>e.check(ax(kC,t)),e.uuidv6=t=>e.check(ox(kC,t)),e.uuidv7=t=>e.check(sx(kC,t)),e.nanoid=t=>e.check(ux(MC,t)),e.guid=t=>e.check(rx(OC,t)),e.cuid=t=>e.check(dx(NC,t)),e.cuid2=t=>e.check(fx(PC,t)),e.ulid=t=>e.check(px(FC,t)),e.base64=t=>e.check(bx(HC,t)),e.base64url=t=>e.check(xx(UC,t)),e.xid=t=>e.check(mx(IC,t)),e.ksuid=t=>e.check(hx(LC,t)),e.ipv4=t=>e.check(gx(RC,t)),e.ipv6=t=>e.check(_x(zC,t)),e.cidrv4=t=>e.check(vx(BC,t)),e.cidrv6=t=>e.check(yx(VC,t)),e.e164=t=>e.check(Sx(WC,t)),e.datetime=t=>e.check(tC(t)),e.date=t=>e.check(rC(t)),e.time=t=>e.check(aC(t)),e.duration=t=>e.check(sC(t))});function J(e){return tx(TC,e)}let EC=K(`ZodStringFormat`,(e,t)=>{Ry.init(e,t),wC.init(e,t)}),DC=K(`ZodEmail`,(e,t)=>{Vy.init(e,t),EC.init(e,t)}),OC=K(`ZodGUID`,(e,t)=>{zy.init(e,t),EC.init(e,t)}),kC=K(`ZodUUID`,(e,t)=>{By.init(e,t),EC.init(e,t)}),AC=K(`ZodURL`,(e,t)=>{Hy.init(e,t),EC.init(e,t)}),jC=K(`ZodEmoji`,(e,t)=>{Uy.init(e,t),EC.init(e,t)}),MC=K(`ZodNanoID`,(e,t)=>{Wy.init(e,t),EC.init(e,t)}),NC=K(`ZodCUID`,(e,t)=>{Gy.init(e,t),EC.init(e,t)}),PC=K(`ZodCUID2`,(e,t)=>{Ky.init(e,t),EC.init(e,t)}),FC=K(`ZodULID`,(e,t)=>{qy.init(e,t),EC.init(e,t)}),IC=K(`ZodXID`,(e,t)=>{Jy.init(e,t),EC.init(e,t)}),LC=K(`ZodKSUID`,(e,t)=>{Yy.init(e,t),EC.init(e,t)}),RC=K(`ZodIPv4`,(e,t)=>{eb.init(e,t),EC.init(e,t)}),zC=K(`ZodIPv6`,(e,t)=>{tb.init(e,t),EC.init(e,t)}),BC=K(`ZodCIDRv4`,(e,t)=>{nb.init(e,t),EC.init(e,t)}),VC=K(`ZodCIDRv6`,(e,t)=>{rb.init(e,t),EC.init(e,t)}),HC=K(`ZodBase64`,(e,t)=>{ab.init(e,t),EC.init(e,t)}),UC=K(`ZodBase64URL`,(e,t)=>{sb.init(e,t),EC.init(e,t)}),WC=K(`ZodE164`,(e,t)=>{cb.init(e,t),EC.init(e,t)}),GC=K(`ZodJWT`,(e,t)=>{ub.init(e,t),EC.init(e,t)}),KC=K(`ZodNumber`,(e,t)=>{var n,r,i,a,o,s,c,l,u;db.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mS(e,t,n,r),SC(e,`ZodNumber`,{gt(e,t){return this.check(Ix(e,t))},gte(e,t){return this.check(Lx(e,t))},min(e,t){return this.check(Lx(e,t))},lt(e,t){return this.check(Px(e,t))},lte(e,t){return this.check(Fx(e,t))},max(e,t){return this.check(Fx(e,t))},int(e){return this.check(YC(e))},safe(e){return this.check(YC(e))},positive(e){return this.check(Ix(0,e))},nonnegative(e){return this.check(Lx(0,e))},negative(e){return this.check(Px(0,e))},nonpositive(e){return this.check(Fx(0,e))},multipleOf(e,t){return this.check(Rx(e,t))},step(e,t){return this.check(Rx(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 qC(e){return Ox(KC,e)}let JC=K(`ZodNumberFormat`,(e,t)=>{fb.init(e,t),KC.init(e,t)});function YC(e){return kx(JC,e)}let XC=K(`ZodBoolean`,(e,t)=>{pb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hS(e,t,n,r)});function ZC(e){return Ax(XC,e)}let QC=K(`ZodNull`,(e,t)=>{mb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vS(e,t,n,r)});function $C(e){return jx(QC,e)}let ew=K(`ZodUnknown`,(e,t)=>{hb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function tw(){return Mx(ew)}let nw=K(`ZodNever`,(e,t)=>{gb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xS(e,t,n,r)});function rw(e){return Nx(nw,e)}let iw=K(`ZodArray`,(e,t)=>{vb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>IS(e,t,n,r),e.element=t.element,SC(e,`ZodArray`,{min(e,t){return this.check(Bx(e,t))},nonempty(e){return this.check(Bx(1,e))},max(e,t){return this.check(zx(e,t))},length(e,t){return this.check(Vx(e,t))},unwrap(){return this.element}})});function aw(e,t){return eS(iw,e,t)}let ow=K(`ZodObject`,(e,t)=>{Cb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>LS(e,t,n,r),K_(e,`shape`,()=>t.shape),SC(e,`ZodObject`,{keyof(){return vw(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(U(U({},this._zod.def),{},{catchall:e}))},passthrough(){return this.clone(U(U({},this._zod.def),{},{catchall:tw()}))},loose(){return this.clone(U(U({},this._zod.def),{},{catchall:tw()}))},strict(){return this.clone(U(U({},this._zod.def),{},{catchall:rw()}))},strip(){return this.clone(U(U({},this._zod.def),{},{catchall:void 0}))},extend(e){return lv(this,e)},safeExtend(e){return uv(this,e)},merge(e){return dv(this,e)},pick(e){return sv(this,e)},omit(e){return cv(this,e)},partial(...e){return fv(Cw,this,e[0])},required(...e){return pv(Nw,this,e[0])}})});function sw(e,t){let n=U({type:`object`,shape:e==null?{}:e},q(t));return new ow(n)}function cw(e,t){return new ow(U({type:`object`,shape:e,catchall:rw()},q(t)))}let lw=K(`ZodUnion`,(e,t)=>{Tb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>RS(e,t,n,r),e.options=t.options});function uw(e,t){return new lw(U({type:`union`,options:e},q(t)))}let dw=K(`ZodDiscriminatedUnion`,(e,t)=>{lw.init(e,t),Eb.init(e,t)});function fw(e,t,n){return new dw(U({type:`union`,options:t,discriminator:e},q(n)))}let pw=K(`ZodIntersection`,(e,t)=>{Db.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zS(e,t,n,r)});function mw(e,t){return new pw({type:`intersection`,left:e,right:t})}let hw=K(`ZodRecord`,(e,t)=>{Ab.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>VS(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function gw(e,t,n){return!t||!t._zod?new hw(U({type:`record`,keyType:J(),valueType:e},q(t))):new hw(U({type:`record`,keyType:e,valueType:t},q(n)))}let _w=K(`ZodEnum`,(e,t)=>{jb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>TS(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 _w(U(U(U({},t),{},{checks:[]},q(r)),{},{entries:i}))},e.exclude=(e,r)=>{let i=U({},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 _w(U(U(U({},t),{},{checks:[]},q(r)),{},{entries:i}))}});function vw(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new _w(U({type:`enum`,entries:n},q(t)))}let yw=K(`ZodLiteral`,(e,t)=>{Mb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ES(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 bw(e,t){return new yw(U({type:`literal`,values:Array.isArray(e)?e:[e]},q(t)))}let xw=K(`ZodTransform`,(e,t)=>{Nb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>NS(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new F_(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(bv(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(bv(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 Sw(e){return new xw({type:`transform`,transform:e})}let Cw=K(`ZodOptional`,(e,t)=>{Fb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>XS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ww(e){return new Cw({type:`optional`,innerType:e})}let Tw=K(`ZodExactOptional`,(e,t)=>{Ib.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>XS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ew(e){return new Tw({type:`optional`,innerType:e})}let Dw=K(`ZodNullable`,(e,t)=>{Lb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>HS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ow(e){return new Dw({type:`nullable`,innerType:e})}let kw=K(`ZodDefault`,(e,t)=>{Rb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>WS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Aw(e,t){return new kw({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():tv(t)}})}let jw=K(`ZodPrefault`,(e,t)=>{Bb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>GS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Mw(e,t){return new jw({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():tv(t)}})}let Nw=K(`ZodNonOptional`,(e,t)=>{Vb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>US(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Pw(e,t){return new Nw(U({type:`nonoptional`,innerType:e},q(t)))}let Fw=K(`ZodCatch`,(e,t)=>{Ub.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>KS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Iw(e,t){return new Fw({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}let Lw=K(`ZodPipe`,(e,t)=>{Wb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qS(e,t,n,r),e.in=t.in,e.out=t.out});function Rw(e,t){return new Lw({type:`pipe`,in:e,out:t})}let zw=K(`ZodReadonly`,(e,t)=>{Kb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>JS(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bw(e){return new zw({type:`readonly`,innerType:e})}let Vw=K(`ZodLazy`,(e,t)=>{Jb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ZS(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Hw(e){return new Vw({type:`lazy`,getter:e})}let Uw=K(`ZodCustom`,(e,t)=>{Yb.init(e,t),CC.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jS(e,t,n,r)});function Ww(e,t){return tS(Uw,e==null?(()=>!0):e,t)}function Gw(e,t={}){return nS(Uw,e,t)}function Kw(e,t){return rS(e,t)}function qw(e,t={}){let n=new Uw(U({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 Jw;(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})(Jw||(Jw={}));var Yw;(function(e){e.mergeShapes=(e,t)=>U(U({},e),t)})(Yw||(Yw={}));let Y=Jw.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),Xw=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=Jw.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 Zw=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,Jw.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()}};Zw.create=e=>new Zw(e);let Qw=(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,Jw.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:n=`Unrecognized key(s) in object: ${Jw.joinValues(e.keys,`, `)}`;break;case X.invalid_union:n=`Invalid input`;break;case X.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Jw.joinValues(e.options)}`;break;case X.invalid_enum_value:n=`Invalid enum value. Expected ${Jw.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}"`:Jw.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,Jw.assertNever(e)}return{message:n}},$w=Qw;function eT(){return $w}let tT=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o=U(U({},i),{},{path:a});if(i.message!==void 0)return U(U({},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 U(U({},i),{},{path:a,message:s})};function Z(e,t){let n=eT(),r=tT({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Qw?void 0:Qw].filter(e=>!!e)});e.common.issues.push(r)}var nT=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 rT;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 rT;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 rT=Object.freeze({status:`aborted`}),iT=e=>({status:`dirty`,value:e}),aT=e=>({status:`valid`,value:e}),oT=e=>e.status===`aborted`,sT=e=>e.status===`dirty`,cT=e=>e.status===`valid`,lT=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 uT=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 dT=(e,t)=>{if(cT(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 Zw(e.common.issues);return this._error=t,this._error}}};function fT(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 pT=class{get description(){return this._def.description}_getType(e){return Xw(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Xw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new nT,ctx:{common:e.parent.common,data:e.data,parsedType:Xw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(lT(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:Xw(e)},i=this._parseSync({data:e,path:r.path,parent:r});return dT(r,i)}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xw(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return cT(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=>cT(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:Xw(e)},i=n._parse({data:e,path:r.path,parent:r}),a=await(lT(i)?i:Promise.resolve(i));return dT(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(U({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 hE({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 gE.create(this,this._def)}nullable(){return _E.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return XT.create(this)}promise(){return mE.create(this,this._def)}or(e){return $T.create([this,e],this._def)}and(e){return rE.create(this,e,this._def)}transform(e){return new hE(U(U({},fT(this._def)),{},{schema:this,typeName:$.ZodEffects,effect:{type:`transform`,transform:e}}))}default(e){let t=typeof e==`function`?e:()=>e;return new vE(U(U({},fT(this._def)),{},{innerType:this,defaultValue:t,typeName:$.ZodDefault}))}brand(){return new xE(U({typeName:$.ZodBranded,type:this},fT(this._def)))}catch(e){let t=typeof e==`function`?e:()=>e;return new yE(U(U({},fT(this._def)),{},{innerType:this,catchValue:t,typeName:$.ZodCatch}))}describe(e){let t=this.constructor;return new t(U(U({},this._def),{},{description:e}))}pipe(e){return SE.create(this,e)}readonly(){return CE.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};let mT=/^c[^\s-]{8,}$/i,hT=/^[0-9a-z]+$/,gT=/^[0-9A-HJKMNP-TV-Z]{26}$/i,_T=/^[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,vT=/^[a-z0-9_-]{21}$/i,yT=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,bT=/^[-+]?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)?)??$/,xT=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ST,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])$/,wT=/^(?:(?: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])$/,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]))$/,ET=/^(([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])$/,DT=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,OT=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,kT=`((\\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])))`,AT=RegExp(`^${kT}$`);function jT(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 MT(e){return RegExp(`^${jT(e)}$`)}function NT(e){let t=`${kT}T${jT(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function PT(e,t){return!!((t===`v4`||!t)&&CT.test(e)||(t===`v6`||!t)&&TT.test(e))}function FT(e,t){if(!yT.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 IT(e,t){return!!((t===`v4`||!t)&&wT.test(e)||(t===`v6`||!t)&&ET.test(e))}var LT=class e extends pT{_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}),rT}let t=new nT,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`)xT.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`)ST||(ST=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),ST.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`)_T.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`)vT.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`)mT.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`)hT.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`)gT.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`?NT(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`?AT.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{code:X.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?MT(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`?bT.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`duration`,code:X.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?PT(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`?FT(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`?IT(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`?DT.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`base64`,code:X.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?OT.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`base64url`,code:X.invalid_string,message:r.message}),t.dirty()):Jw.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),U({validation:t,code:X.invalid_string},Q.errToObj(n)))}_addCheck(t){return new e(U(U({},this._def),{},{checks:[...this._def.checks,t]}))}email(e){return this._addCheck(U({kind:`email`},Q.errToObj(e)))}url(e){return this._addCheck(U({kind:`url`},Q.errToObj(e)))}emoji(e){return this._addCheck(U({kind:`emoji`},Q.errToObj(e)))}uuid(e){return this._addCheck(U({kind:`uuid`},Q.errToObj(e)))}nanoid(e){return this._addCheck(U({kind:`nanoid`},Q.errToObj(e)))}cuid(e){return this._addCheck(U({kind:`cuid`},Q.errToObj(e)))}cuid2(e){return this._addCheck(U({kind:`cuid2`},Q.errToObj(e)))}ulid(e){return this._addCheck(U({kind:`ulid`},Q.errToObj(e)))}base64(e){return this._addCheck(U({kind:`base64`},Q.errToObj(e)))}base64url(e){return this._addCheck(U({kind:`base64url`},Q.errToObj(e)))}jwt(e){return this._addCheck(U({kind:`jwt`},Q.errToObj(e)))}ip(e){return this._addCheck(U({kind:`ip`},Q.errToObj(e)))}cidr(e){return this._addCheck(U({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(U({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(U({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(U({kind:`duration`},Q.errToObj(e)))}regex(e,t){return this._addCheck(U({kind:`regex`,regex:e},Q.errToObj(t)))}includes(e,t){return this._addCheck(U({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(U({kind:`startsWith`,value:e},Q.errToObj(t)))}endsWith(e,t){return this._addCheck(U({kind:`endsWith`,value:e},Q.errToObj(t)))}min(e,t){return this._addCheck(U({kind:`min`,value:e},Q.errToObj(t)))}max(e,t){return this._addCheck(U({kind:`max`,value:e},Q.errToObj(t)))}length(e,t){return this._addCheck(U({kind:`length`,value:e},Q.errToObj(t)))}nonempty(e){return this.min(1,Q.errToObj(e))}trim(){return new e(U(U({},this._def),{},{checks:[...this._def.checks,{kind:`trim`}]}))}toLowerCase(){return new e(U(U({},this._def),{},{checks:[...this._def.checks,{kind:`toLowerCase`}]}))}toUpperCase(){return new e(U(U({},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}};LT.create=e=>{var t;return new LT(U({checks:[],typeName:$.ZodString,coerce:(t=e==null?void 0:e.coerce)!=null&&t},fT(e)))};function RT(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 zT=class e extends pT{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}),rT}let t,n=new nT;for(let r of this._def.checks)r.kind===`int`?Jw.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`?RT(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()):Jw.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(U(U({},this._def),{},{checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Q.toString(i)}]}))}_addCheck(t){return new e(U(U({},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`&&Jw.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)}};zT.create=e=>new zT(U({checks:[],typeName:$.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1},fT(e)));var BT=class e extends pT{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 nT;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()):Jw.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}),rT}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(U(U({},this._def),{},{checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Q.toString(i)}]}))}_addCheck(t){return new e(U(U({},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}};BT.create=e=>{var t;return new BT(U({checks:[],typeName:$.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!=null&&t},fT(e)))};var VT=class extends pT{_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}),rT}return aT(e.data)}};VT.create=e=>new VT(U({typeName:$.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1},fT(e)));var HT=class e extends pT{_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}),rT}if(Number.isNaN(e.data.getTime()))return Z(this._getOrReturnCtx(e),{code:X.invalid_date}),rT;let t=new nT,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()):Jw.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e(U(U({},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)}};HT.create=e=>new HT(U({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:$.ZodDate},fT(e)));var UT=class extends pT{_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}),rT}return aT(e.data)}};UT.create=e=>new UT(U({typeName:$.ZodSymbol},fT(e)));var WT=class extends pT{_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}),rT}return aT(e.data)}};WT.create=e=>new WT(U({typeName:$.ZodUndefined},fT(e)));var GT=class extends pT{_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}),rT}return aT(e.data)}};GT.create=e=>new GT(U({typeName:$.ZodNull},fT(e)));var KT=class extends pT{constructor(){super(...arguments),this._any=!0}_parse(e){return aT(e.data)}};KT.create=e=>new KT(U({typeName:$.ZodAny},fT(e)));var qT=class extends pT{constructor(){super(...arguments),this._unknown=!0}_parse(e){return aT(e.data)}};qT.create=e=>new qT(U({typeName:$.ZodUnknown},fT(e)));var JT=class extends pT{_parse(e){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.never,received:t.parsedType}),rT}};JT.create=e=>new JT(U({typeName:$.ZodNever},fT(e)));var YT=class extends pT{_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}),rT}return aT(e.data)}};YT.create=e=>new YT(U({typeName:$.ZodVoid},fT(e)));var XT=class e extends pT{_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}),rT;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 uT(t,e,t.path,n)))).then(e=>nT.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new uT(t,e,t.path,n)));return nT.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e(U(U({},this._def),{},{minLength:{value:t,message:Q.toString(n)}}))}max(t,n){return new e(U(U({},this._def),{},{maxLength:{value:t,message:Q.toString(n)}}))}length(t,n){return new e(U(U({},this._def),{},{exactLength:{value:t,message:Q.toString(n)}}))}nonempty(e){return this.min(1,e)}};XT.create=(e,t)=>new XT(U({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$.ZodArray},fT(t)));function ZT(e){if(e instanceof QT){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=gE.create(ZT(r))}return new QT(U(U({},e._def),{},{shape:()=>t}))}else if(e instanceof XT)return new XT(U(U({},e._def),{},{type:ZT(e.element)}));else if(e instanceof gE)return gE.create(ZT(e.unwrap()));else if(e instanceof _E)return _E.create(ZT(e.unwrap()));else if(e instanceof iE)return iE.create(e.items.map(e=>ZT(e)));else return e}var QT=class e extends pT{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=Jw.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}),rT}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof JT&&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 uT(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof JT){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 uT(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=>nT.mergeObjectSync(t,e)):nT.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return Q.errToObj,new e(U(U({},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(U(U({},this._def),{},{unknownKeys:`strip`}))}passthrough(){return new e(U(U({},this._def),{},{unknownKeys:`passthrough`}))}extend(t){return new e(U(U({},this._def),{},{shape:()=>U(U({},this._def.shape()),t)}))}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>U(U({},this._def.shape()),t._def.shape()),typeName:$.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e(U(U({},this._def),{},{catchall:t}))}pick(t){let n={};for(let e of Jw.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e(U(U({},this._def),{},{shape:()=>n}))}omit(t){let n={};for(let e of Jw.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e(U(U({},this._def),{},{shape:()=>n}))}deepPartial(){return ZT(this)}partial(t){let n={};for(let e of Jw.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e(U(U({},this._def),{},{shape:()=>n}))}required(t){let n={};for(let e of Jw.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof gE;)t=t._def.innerType;n[e]=t}return new e(U(U({},this._def),{},{shape:()=>n}))}keyof(){return dE(Jw.objectKeys(this.shape))}};QT.create=(e,t)=>new QT(U({shape:()=>e,unknownKeys:`strip`,catchall:JT.create(),typeName:$.ZodObject},fT(t))),QT.strictCreate=(e,t)=>new QT(U({shape:()=>e,unknownKeys:`strict`,catchall:JT.create(),typeName:$.ZodObject},fT(t))),QT.lazycreate=(e,t)=>new QT(U({shape:e,unknownKeys:`strip`,catchall:JT.create(),typeName:$.ZodObject},fT(t)));var $T=class extends pT{_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 Zw(e.ctx.common.issues));return Z(t,{code:X.invalid_union,unionErrors:n}),rT}if(t.common.async)return Promise.all(n.map(async e=>{let n=U(U({},t),{},{common:U(U({},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=U(U({},t),{},{common:U(U({},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 Zw(e));return Z(t,{code:X.invalid_union,unionErrors:i}),rT}}get options(){return this._def.options}};$T.create=(e,t)=>new $T(U({options:e,typeName:$.ZodUnion},fT(t)));let eE=e=>e instanceof lE?eE(e.schema):e instanceof hE?eE(e.innerType()):e instanceof uE?[e.value]:e instanceof fE?e.options:e instanceof pE?Jw.objectValues(e.enum):e instanceof vE?eE(e._def.innerType):e instanceof WT?[void 0]:e instanceof GT?[null]:e instanceof gE?[void 0,...eE(e.unwrap())]:e instanceof _E?[null,...eE(e.unwrap())]:e instanceof xE||e instanceof CE?eE(e.unwrap()):e instanceof yE?eE(e._def.innerType):[];var tE=class e extends pT{_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}),rT;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]}),rT)}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=eE(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(U({typeName:$.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i},fT(r)))}};function nE(e,t){let n=Xw(e),r=Xw(t);if(e===t)return{valid:!0,data:e};if(n===Y.object&&r===Y.object){let n=Jw.objectKeys(t),r=Jw.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i=U(U({},e),t);for(let n of r){let r=nE(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=nE(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 rE=class extends pT{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(oT(e)||oT(r))return rT;let i=nE(e.value,r.value);return i.valid?((sT(e)||sT(r))&&t.dirty(),{status:t.value,value:i.data}):(Z(n,{code:X.invalid_intersection_types}),rT)};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}))}};rE.create=(e,t,n)=>new rE(U({left:e,right:t,typeName:$.ZodIntersection},fT(n)));var iE=class e extends pT{_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}),rT;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`}),rT;!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 uT(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>nT.mergeArray(t,e)):nT.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e(U(U({},this._def),{},{rest:t}))}};iE.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new iE(U({items:e,typeName:$.ZodTuple,rest:null},fT(t)))};var aE=class e extends pT{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}),rT;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new uT(n,e,n.path,e)),value:a._parse(new uT(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?nT.mergeObjectAsync(t,r):nT.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof pT?new e(U({keyType:t,valueType:n,typeName:$.ZodRecord},fT(r))):new e(U({keyType:LT.create(),valueType:t,typeName:$.ZodRecord},fT(n)))}},oE=class extends pT{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}),rT;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new uT(n,e,n.path,[a,`key`])),value:i._parse(new uT(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 rT;(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 rT;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};oE.create=(e,t,n)=>new oE(U({valueType:t,keyType:e,typeName:$.ZodMap},fT(n)));var sE=class e extends pT{_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}),rT;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 rT;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 uT(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e(U(U({},this._def),{},{minSize:{value:t,message:Q.toString(n)}}))}max(t,n){return new e(U(U({},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)}};sE.create=(e,t)=>new sE(U({valueType:e,minSize:null,maxSize:null,typeName:$.ZodSet},fT(t)));var cE=class e extends pT{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}),rT;function n(e,n){return tT({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,eT(),Qw].filter(e=>!!e),issueData:{code:X.invalid_arguments,argumentsError:n}})}function r(e,n){return tT({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,eT(),Qw].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 mE){let e=this;return aT(async function(...t){let o=new Zw([]),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 aT(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new Zw([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new Zw([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e(U(U({},this._def),{},{args:iE.create(t).rest(qT.create())}))}returns(t){return new e(U(U({},this._def),{},{returns:t}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e(U({args:t||iE.create([]).rest(qT.create()),returns:n||qT.create(),typeName:$.ZodFunction},fT(r)))}},lE=class extends pT{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})}};lE.create=(e,t)=>new lE(U({getter:e,typeName:$.ZodLazy},fT(t)));var uE=class extends pT{_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}),rT}return{status:`valid`,value:e.data}}get value(){return this._def.value}};uE.create=(e,t)=>new uE(U({value:e,typeName:$.ZodLiteral},fT(t)));function dE(e,t){return new fE(U({values:e,typeName:$.ZodEnum},fT(t)))}var fE=class e extends pT{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return Z(t,{expected:Jw.joinValues(n),received:t.parsedType,code:X.invalid_type}),rT}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}),rT}return aT(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,U(U({},this._def),n))}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),U(U({},this._def),n))}};fE.create=dE;var pE=class extends pT{_parse(e){let t=Jw.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Y.string&&n.parsedType!==Y.number){let e=Jw.objectValues(t);return Z(n,{expected:Jw.joinValues(e),received:n.parsedType,code:X.invalid_type}),rT}if(this._cache||(this._cache=new Set(Jw.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=Jw.objectValues(t);return Z(n,{received:n.data,code:X.invalid_enum_value,options:e}),rT}return aT(e.data)}get enum(){return this._def.values}};pE.create=(e,t)=>new pE(U({values:e,typeName:$.ZodNativeEnum},fT(t)));var mE=class extends pT{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}),rT):aT((t.parsedType===Y.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};mE.create=(e,t)=>new mE(U({type:e,typeName:$.ZodPromise},fT(t)));var hE=class extends pT{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 rT;let i=await t._def.schema._parseAsync({data:e,path:r.path,parent:r});return i.status===`aborted`?rT:i.status===`dirty`||n.value===`dirty`?iT(i.value):i});{if(n.value===`aborted`)return rT;let t=this._def.schema._parseSync({data:e,path:r.path,parent:r});return t.status===`aborted`?rT:t.status===`dirty`||n.value===`dirty`?iT(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`?rT:(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`?rT:(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(!cT(e))return rT;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=>cT(e)?Promise.resolve(i.transform(e.value,a)).then(e=>({status:n.value,value:e})):rT);Jw.assertNever(i)}};hE.create=(e,t,n)=>new hE(U({schema:e,typeName:$.ZodEffects,effect:t},fT(n))),hE.createWithPreprocess=(e,t,n)=>new hE(U({schema:t,effect:{type:`preprocess`,transform:e},typeName:$.ZodEffects},fT(n)));var gE=class extends pT{_parse(e){return this._getType(e)===Y.undefined?aT(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};gE.create=(e,t)=>new gE(U({innerType:e,typeName:$.ZodOptional},fT(t)));var _E=class extends pT{_parse(e){return this._getType(e)===Y.null?aT(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};_E.create=(e,t)=>new _E(U({innerType:e,typeName:$.ZodNullable},fT(t)));var vE=class extends pT{_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}};vE.create=(e,t)=>new vE(U({innerType:e,typeName:$.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default},fT(t)));var yE=class extends pT{_parse(e){let{ctx:t}=this._processInputParams(e),n=U(U({},t),{},{common:U(U({},t.common),{},{issues:[]})}),r=this._def.innerType._parse({data:n.data,path:n.path,parent:U({},n)});return lT(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new Zw(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new Zw(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};yE.create=(e,t)=>new yE(U({innerType:e,typeName:$.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch},fT(t)));var bE=class extends pT{_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}),rT}return{status:`valid`,value:e.data}}};bE.create=e=>new bE(U({typeName:$.ZodNaN},fT(e)));var xE=class extends pT{_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}},SE=class e extends pT{_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`?rT:e.status===`dirty`?(n.dirty(),iT(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`?rT: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})}},CE=class extends pT{_parse(e){let t=this._def.innerType._parse(e),n=e=>(cT(e)&&(e.value=Object.freeze(e.value)),e);return lT(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};CE.create=(e,t)=>new CE(U({innerType:e,typeName:$.ZodReadonly},fT(t))),QT.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`})($||($={})),LT.create,zT.create,bE.create,BT.create,VT.create,HT.create,UT.create,WT.create,GT.create,KT.create,qT.create,JT.create,YT.create,XT.create,QT.create,QT.strictCreate,$T.create,tE.create,rE.create,iE.create,aE.create,oE.create,sE.create,cE.create,lE.create,uE.create,fE.create,pE.create,mE.create,hE.create,gE.create,_E.create,hE.createWithPreprocess,SE.create;let wE=[`additionalProperties`],TE=[`type`],EE=[`type`];var DE=({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 m_({argument:`separator`,message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${i()}`},OE=DE();function kE(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 AE=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,jE=/"(?: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 ME(e){let t=JSON.parse(e);return typeof t!=`object`||!t||AE.test(e)===!1&&jE.test(e)===!1?t:NE(t)}function NE(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 PE(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch(t){return ME(e)}try{return ME(e)}finally{Error.stackTraceLimit=t}}var FE=Symbol.for(`vercel.ai.validator`);function IE(e){return{[FE]:!0,validate:e}}function LE(e){return typeof e==`object`&&!!e&&FE in e&&e[FE]===!0&&`validate`in e}function RE(e){let t;return()=>(t==null&&(t=e()),t)}function zE(e){return LE(e)?e:`~standard`in e?BE(e):e()}function BE(e){return IE(async t=>{let n=await e[`~standard`].validate(t);return n.issues==null?{success:!0,value:n.value}:{success:!1,error:new E_({value:t,cause:n.issues})}})}async function VE({value:e,schema:t}){let n=await HE({value:e,schema:t});if(!n.success)throw E_.wrap({value:e,cause:n.error});return n.value}async function HE({value:e,schema:t}){let n=zE(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:E_.wrap({value:e,cause:t.error}),rawValue:e}}catch(t){return{success:!1,error:E_.wrap({value:e,cause:t}),rawValue:e}}}async function UE({text:e,schema:t}){try{let n=PE(e);return t==null?{success:!0,value:n,rawValue:n}:await HE({value:n,schema:t})}catch(t){return{success:!1,error:b_.isInstance(t)?t:new b_({text:e,cause:t}),rawValue:void 0}}}function WE({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new M_).pipeThrough(new TransformStream({async transform({data:e},n){e!==`[DONE]`&&n.enqueue(await UE({text:e,schema:t}))}}))}async function GE(e){return typeof e==`function`&&(e=e()),Promise.resolve(e)}new TextDecoder;var KE=Symbol.for(`vercel.ai.schema`);function qE(e,{validate:t}={}){return{[KE]:!0,_type:void 0,[FE]:!0,get jsonSchema(){return typeof e==`function`&&(e=e()),e},validate:t}}function JE(e){if(e.type===`object`){e.additionalProperties=!1;let t=e.properties;if(t!=null)for(let e in t)t[e]=JE(t[e])}return e.type===`array`&&e.items!=null&&(Array.isArray(e.items)?e.items=e.items.map(e=>JE(e)):e.items=JE(e.items)),e}var YE=Symbol(`Let zodToJsonSchema decide on which parser to use`),XE={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`},ZE=e=>typeof e==`string`?U(U({},XE),{},{name:e}):U(U({},XE),e);function QE(){return{}}function $E(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=WD(e.type._def,U(U({},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 eD(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 tD(){return{type:`boolean`}}function nD(e,t){return WD(e.type._def,t)}var rD=(e,t)=>WD(e.innerType._def,t);function iD(e,t,n){let r=n==null?t.dateStrategy:n;if(Array.isArray(r))return{anyOf:r.map((n,r)=>iD(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 aD(e)}}var aD=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 oD(e,t){return U(U({},WD(e.innerType._def,t)),{},{default:e.defaultValue()})}function sD(e,t){return t.effectStrategy===`input`?WD(e.schema._def,t):QE()}function cD(e){return{type:`string`,enum:Array.from(e.values)}}var lD=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function uD(e,t){let n=[WD(e.left._def,U(U({},t),{},{currentPath:[...t.currentPath,`allOf`,`0`]})),WD(e.right._def,U(U({},t),{},{currentPath:[...t.currentPath,`allOf`,`1`]}))].filter(e=>!!e),r=[];return n.forEach(e=>{if(lD(e))r.push(...e.allOf);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n}=e;t=vr(e,wE)}r.push(t)}}),r.length?{allOf:r}:void 0}function dD(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 fD=void 0,pD={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:()=>(fD===void 0&&(fD=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),fD),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 mD(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`:vD(n,`email`,r.message,t);break;case`format:idn-email`:vD(n,`idn-email`,r.message,t);break;case`pattern:zod`:yD(n,pD.email,r.message,t);break}break;case`url`:vD(n,`uri`,r.message,t);break;case`uuid`:vD(n,`uuid`,r.message,t);break;case`regex`:yD(n,r.regex,r.message,t);break;case`cuid`:yD(n,pD.cuid,r.message,t);break;case`cuid2`:yD(n,pD.cuid2,r.message,t);break;case`startsWith`:yD(n,RegExp(`^${hD(r.value,t)}`),r.message,t);break;case`endsWith`:yD(n,RegExp(`${hD(r.value,t)}$`),r.message,t);break;case`datetime`:vD(n,`date-time`,r.message,t);break;case`date`:vD(n,`date`,r.message,t);break;case`time`:vD(n,`time`,r.message,t);break;case`duration`:vD(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`:yD(n,RegExp(hD(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&vD(n,`ipv4`,r.message,t),r.version!==`v4`&&vD(n,`ipv6`,r.message,t);break;case`base64url`:yD(n,pD.base64url,r.message,t);break;case`jwt`:yD(n,pD.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&&yD(n,pD.ipv4Cidr,r.message,t),r.version!==`v4`&&yD(n,pD.ipv6Cidr,r.message,t);break;case`emoji`:yD(n,pD.emoji(),r.message,t);break;case`ulid`:yD(n,pD.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:vD(n,`binary`,r.message,t);break;case`contentEncoding:base64`:n.contentEncoding=`base64`;break;case`pattern:zod`:yD(n,pD.base64,r.message,t);break}break;case`nanoid`:yD(n,pD.nanoid,r.message,t);case`toLowerCase`:case`toUpperCase`:case`trim`:break;default:}return n}function hD(e,t){return t.patternStrategy===`escape`?_D(e):e}var gD=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function _D(e){let t=``;for(let n=0;n<e.length;n++)gD.has(e[n])||(t+=`\\`),t+=e[n];return t}function vD(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(U({format:t},n&&r.errorMessages&&{errorMessage:{format:n}}))):e.format=t}function yD(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(U({pattern:bD(t,r)},n&&r.errorMessages&&{errorMessage:{pattern:n}}))):e.pattern=bD(t,r)}function bD(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
160
  ]))`;continue}else if(i[e]===`$`){a+=`($|(?=[\r
161
161
  ]))`;continue}}if(r.s&&i[e]===`.`){a+=s?`${i[e]}\r
162
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`
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 xD(e,t){var n,r,i,a,o,s;let c={type:`object`,additionalProperties:(n=WD(e.valueType._def,U(U({},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=mD(e.keyType._def,t),{type:r}=n,i=vr(n,TE);return U(U({},c),{},{propertyNames:i})}else if(((a=e.keyType)==null?void 0:a._def.typeName)===$.ZodEnum)return U(U({},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=nD(e.keyType._def,t),{type:r}=n,i=vr(n,EE);return U(U({},c),{},{propertyNames:i})}return c}function SD(e,t){return t.mapStrategy===`record`?xD(e,t):{type:`array`,maxItems:125,items:{type:`array`,items:[WD(e.keyType._def,U(U({},t),{},{currentPath:[...t.currentPath,`items`,`items`,`0`]}))||QE(),WD(e.valueType._def,U(U({},t),{},{currentPath:[...t.currentPath,`items`,`items`,`1`]}))||QE()],minItems:2,maxItems:2}}}function CD(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 wD(){return{not:QE()}}function TD(){return{type:`null`}}var ED={ZodString:`string`,ZodNumber:`number`,ZodBigInt:`integer`,ZodBoolean:`boolean`,ZodNull:`null`};function DD(e,t){let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in ED&&(!e._def.checks||!e._def.checks.length))){let e=n.reduce((e,t)=>{let n=ED[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 OD(e,t)}var OD=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>WD(e._def,U(U({},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 kD(e,t){if([`ZodString`,`ZodNumber`,`ZodBigInt`,`ZodBoolean`,`ZodNull`].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[ED[e.innerType._def.typeName],`null`]};let n=WD(e.innerType._def,U(U({},t),{},{currentPath:[...t.currentPath,`anyOf`,`0`]}));return n&&{anyOf:[n,{type:`null`}]}}function AD(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 jD(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=ND(a),s=WD(a._def,U(U({},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=MD(e,t);return a!==void 0&&(n.additionalProperties=a),n}function MD(e,t){if(e.catchall._def.typeName!==`ZodNever`)return WD(e.catchall._def,U(U({},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 ND(e){try{return e.isOptional()}catch(e){return!0}}var PD=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return WD(e.innerType._def,t);let r=WD(e.innerType._def,U(U({},t),{},{currentPath:[...t.currentPath,`anyOf`,`1`]}));return r?{anyOf:[{not:QE()},r]}:QE()},FD=(e,t)=>{if(t.pipeStrategy===`input`)return WD(e.in._def,t);if(t.pipeStrategy===`output`)return WD(e.out._def,t);let n=WD(e.in._def,U(U({},t),{},{currentPath:[...t.currentPath,`allOf`,`0`]}));return{allOf:[n,WD(e.out._def,U(U({},t),{},{currentPath:[...t.currentPath,`allOf`,n?`1`:`0`]}))].filter(e=>e!==void 0)}};function ID(e,t){return WD(e.type._def,t)}function LD(e,t){let n={type:`array`,uniqueItems:!0,items:WD(e.valueType._def,U(U({},t),{},{currentPath:[...t.currentPath,`items`]}))};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}function RD(e,t){return e.rest?{type:`array`,minItems:e.items.length,items:e.items.map((e,n)=>WD(e._def,U(U({},t),{},{currentPath:[...t.currentPath,`items`,`${n}`]}))).reduce((e,t)=>t===void 0?e:[...e,t],[]),additionalItems:WD(e.rest._def,U(U({},t),{},{currentPath:[...t.currentPath,`additionalItems`]}))}:{type:`array`,minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,n)=>WD(e._def,U(U({},t),{},{currentPath:[...t.currentPath,`items`,`${n}`]}))).reduce((e,t)=>t===void 0?e:[...e,t],[])}}function zD(){return{not:QE()}}function BD(){return QE()}var VD=(e,t)=>WD(e.innerType._def,t),HD=(e,t,n)=>{switch(t){case $.ZodString:return mD(e,n);case $.ZodNumber:return AD(e);case $.ZodObject:return jD(e,n);case $.ZodBigInt:return eD(e);case $.ZodBoolean:return tD();case $.ZodDate:return iD(e,n);case $.ZodUndefined:return zD();case $.ZodNull:return TD();case $.ZodArray:return $E(e,n);case $.ZodUnion:case $.ZodDiscriminatedUnion:return DD(e,n);case $.ZodIntersection:return uD(e,n);case $.ZodTuple:return RD(e,n);case $.ZodRecord:return xD(e,n);case $.ZodLiteral:return dD(e);case $.ZodEnum:return cD(e);case $.ZodNativeEnum:return CD(e);case $.ZodNullable:return kD(e,n);case $.ZodOptional:return PD(e,n);case $.ZodMap:return SD(e,n);case $.ZodSet:return LD(e,n);case $.ZodLazy:return()=>e.getter()._def;case $.ZodPromise:return ID(e,n);case $.ZodNaN:case $.ZodNever:return wD();case $.ZodEffects:return sD(e,n);case $.ZodAny:return QE();case $.ZodUnknown:return BD();case $.ZodDefault:return oD(e,n);case $.ZodBranded:return nD(e,n);case $.ZodReadonly:return VD(e,n);case $.ZodCatch:return rD(e,n);case $.ZodPipeline:return FD(e,n);case $.ZodFunction:case $.ZodVoid:case $.ZodSymbol:return;default:return(e=>void 0)(t)}},UD=(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 WD(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!==YE)return a}if(i&&!n){let e=GD(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=HD(e,e.typeName,t),s=typeof o==`function`?WD(o(),t):o;if(s&&KD(e,t,s),t.postProcess){let n=t.postProcess(s,e,t);return a.jsonSchema=s,n}return a.jsonSchema=s,s}var GD=(e,t)=>{switch(t.$refStrategy){case`root`:return{$ref:e.path.join(`/`)};case`relative`:return{$ref:UD(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`),QE()):t.$refStrategy===`seen`?QE():void 0}},KD=(e,t,n)=>(e.description&&(n.description=e.description),n),qD=e=>{let t=ZE(e),n=t.name===void 0?t.basePath:[...t.basePath,t.definitionPath,t.name];return U(U({},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}]))})},JD=(e,t)=>{var n;let r=qD(t),i=typeof t==`object`&&t.definitions?Object.entries(t.definitions).reduce((e,[t,n])=>{var i;return U(U({},e),{},{[t]:(i=WD(n._def,U(U({},r),{},{currentPath:[...r.basePath,r.definitionPath,t]}),!0))==null?QE():i})},{}):void 0,a=typeof t==`string`?t:(t==null?void 0:t.nameStrategy)===`title`||t==null?void 0:t.name,o=(n=WD(e._def,a===void 0?r:U(U({},r),{},{currentPath:[...r.basePath,r.definitionPath,a]}),!1))==null?QE():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?U(U({},o),{},{[r.definitionPath]:i}):o:{$ref:[...r.$refStrategy===`relative`?[]:r.basePath,r.definitionPath,a].join(`/`),[r.definitionPath]:U(U({},i),{},{[a]:o})};return c.$schema=`http://json-schema.org/draft-07/schema#`,c};function YD(e,t){var n;let r=(n=t==null?void 0:t.useReferences)!=null&&n;return qE(()=>JD(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 XD(e,t){var n;let r=(n=t==null?void 0:t.useReferences)!=null&&n;return qE(()=>JE($S(e,{target:`draft-7`,io:`input`,reused:r?`ref`:`inline`})),{validate:async t=>{let n=await fC(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function ZD(e){return`_zod`in e}function QD(e,t){return ZD(e)?XD(e,t):YD(e,t)}function $D(e){return typeof e==`object`&&!!e&&KE in e&&e[KE]===!0&&`jsonSchema`in e&&`validate`in e}function eO(e){return e==null?qE({properties:{},additionalProperties:!1}):$D(e)?e:typeof e==`function`?e():QD(e)}var{btoa:tO,atob:nO}=globalThis;let rO=[`abortSignal`],iO=[`messageId`];var aO=Object.defineProperty,oO=(e,t)=>{for(var n in t)aO(e,n,{get:t[n],enumerable:!0})},sO=`AI_NoObjectGeneratedError`,cO=`vercel.ai.error.${sO}`,lO=Symbol.for(cO),uO,dO=class extends s_{constructor({message:e=`No object generated.`,cause:t,text:n,response:r,usage:i,finishReason:a}){super({name:sO,message:e,cause:t}),this[uO]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=a}static isInstance(e){return s_.hasMarker(e,cO)}};uO=lO;var fO=uw([J(),qw(Uint8Array),qw(ArrayBuffer),Ww(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null&&n},{message:`Must be a Buffer`})]),pO=Hw(()=>uw([$C(),J(),qC(),ZC(),gw(J(),pO),aw(pO)])),mO=gw(J(),gw(J(),pO)),hO=sw({type:bw(`text`),text:J(),providerOptions:mO.optional()}),gO=sw({type:bw(`image`),image:uw([fO,qw(URL)]),mediaType:J().optional(),providerOptions:mO.optional()}),_O=sw({type:bw(`file`),data:uw([fO,qw(URL)]),filename:J().optional(),mediaType:J(),providerOptions:mO.optional()}),vO=sw({type:bw(`reasoning`),text:J(),providerOptions:mO.optional()}),yO=sw({type:bw(`tool-call`),toolCallId:J(),toolName:J(),input:tw(),providerOptions:mO.optional(),providerExecuted:ZC().optional()}),bO=fw(`type`,[sw({type:bw(`text`),value:J()}),sw({type:bw(`json`),value:pO}),sw({type:bw(`error-text`),value:J()}),sw({type:bw(`error-json`),value:pO}),sw({type:bw(`content`),value:aw(uw([sw({type:bw(`text`),text:J()}),sw({type:bw(`media`),data:J(),mediaType:J()})]))})]),xO=sw({type:bw(`tool-result`),toolCallId:J(),toolName:J(),output:bO,providerOptions:mO.optional()});uw([sw({role:bw(`system`),content:J(),providerOptions:mO.optional()}),sw({role:bw(`user`),content:uw([J(),aw(uw([hO,gO,_O]))]),providerOptions:mO.optional()}),sw({role:bw(`assistant`),content:uw([J(),aw(uw([hO,_O,vO,yO,xO]))]),providerOptions:mO.optional()}),sw({role:bw(`tool`),content:aw(xO),providerOptions:mO.optional()})]),DE({prefix:`aitxt`,size:24}),TransformStream;var SO=RE(()=>QD(uw([cw({type:bw(`text-start`),id:J(),providerMetadata:mO.optional()}),cw({type:bw(`text-delta`),id:J(),delta:J(),providerMetadata:mO.optional()}),cw({type:bw(`text-end`),id:J(),providerMetadata:mO.optional()}),cw({type:bw(`error`),errorText:J()}),cw({type:bw(`tool-input-start`),toolCallId:J(),toolName:J(),providerExecuted:ZC().optional(),dynamic:ZC().optional()}),cw({type:bw(`tool-input-delta`),toolCallId:J(),inputTextDelta:J()}),cw({type:bw(`tool-input-available`),toolCallId:J(),toolName:J(),input:tw(),providerExecuted:ZC().optional(),providerMetadata:mO.optional(),dynamic:ZC().optional()}),cw({type:bw(`tool-input-error`),toolCallId:J(),toolName:J(),input:tw(),providerExecuted:ZC().optional(),providerMetadata:mO.optional(),dynamic:ZC().optional(),errorText:J()}),cw({type:bw(`tool-output-available`),toolCallId:J(),output:tw(),providerExecuted:ZC().optional(),dynamic:ZC().optional(),preliminary:ZC().optional()}),cw({type:bw(`tool-output-error`),toolCallId:J(),errorText:J(),providerExecuted:ZC().optional(),dynamic:ZC().optional()}),cw({type:bw(`reasoning-start`),id:J(),providerMetadata:mO.optional()}),cw({type:bw(`reasoning-delta`),id:J(),delta:J(),providerMetadata:mO.optional()}),cw({type:bw(`reasoning-end`),id:J(),providerMetadata:mO.optional()}),cw({type:bw(`source-url`),sourceId:J(),url:J(),title:J().optional(),providerMetadata:mO.optional()}),cw({type:bw(`source-document`),sourceId:J(),mediaType:J(),title:J(),filename:J().optional(),providerMetadata:mO.optional()}),cw({type:bw(`file`),url:J(),mediaType:J(),providerMetadata:mO.optional()}),cw({type:Ww(e=>typeof e==`string`&&e.startsWith(`data-`),{message:`Type must start with "data-"`}),id:J().optional(),data:tw(),transient:ZC().optional()}),cw({type:bw(`start-step`)}),cw({type:bw(`finish-step`)}),cw({type:bw(`start`),messageId:J().optional(),messageMetadata:tw().optional()}),cw({type:bw(`finish`),finishReason:vw([`stop`,`length`,`content-filter`,`tool-calls`,`error`,`other`,`unknown`]).optional(),messageMetadata:tw().optional()}),cw({type:bw(`abort`)}),cw({type:bw(`message-metadata`),messageMetadata:tw()})])));function CO(e){return e.type.startsWith(`data-`)}function wO(){return Object.create(null)}function TO(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;let n=U({},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]=TO(a,i):n[r]=i}return n}function EO(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 DO(e){if(e===void 0)return{value:void 0,state:`undefined-input`};let t=await UE({text:e});return t.success?{value:t.value,state:`successful-parse`}:(t=await UE({text:EO(e)}),t.success?{value:t.value,state:`repaired-parse`}:{value:void 0,state:`failed-parse`})}function OO(e){return e.type.startsWith(`tool-`)}function kO(e){return e.type===`dynamic-tool`}function AO(e){return OO(e)||kO(e)}function jO(e){return e.type.split(`-`).slice(1).join(`-`)}function MO({lastMessage:e,messageId:t}){return{message:(e==null?void 0:e.role)===`assistant`?e:{id:t,metadata:void 0,role:`assistant`,parts:[]},activeTextParts:wO(),activeReasoningParts:wO(),partialToolCalls:wO()}}function NO({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(OO).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=>OO(t)&&t.toolCallId===e.toolCallId),i=e,a=n;n==null?r.message.parts.push(U({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(U({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:TO(r.message.metadata,e);t!=null&&await VE({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(OO);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 DO(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:jO(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:jO(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=wO(),r.activeReasoningParts=wO();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(CO(e)){(n==null?void 0:n[e.type])!=null&&await VE({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 PO({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()}}DE({prefix:`aitxt`,size:24}),DE({prefix:`aiobj`,size:24});var FO=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()})}};DE({prefix:`aiobj`,size:24}),oO({},{object:()=>LO,text:()=>IO});var IO=()=>({type:`text`,responseFormat:{type:`text`},async parsePartial({text:e}){return{partial:e}},async parseOutput({text:e}){return e}}),LO=({schema:e})=>{let t=eO(e);return{type:`object`,responseFormat:{type:`json`,schema:t.jsonSchema},async parsePartial({text:e}){let t=await DO(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 UE({text:e});if(!r.success)throw new dO({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 HE({value:r.value,schema:t});if(!i.success)throw new dO({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 RO(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 zO=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=vr(e,rO);var i,a,o,s,c;let l=await GE(t.body),u=await GE(t.headers),d=await GE(t.credentials),f=U(U({},kE(u)),kE(r.headers)),p=await((i=t.prepareSendMessagesRequest)==null?void 0:i.call(t,{api:t.api,id:r.chatId,messages:r.messages,body:U(U({},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:kE(p.headers),g=(p==null?void 0:p.body)===void 0?U(U(U({},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:U({"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 GE(t.body),c=await GE(t.headers),l=await GE(t.credentials),u=U(U({},kE(c)),kE(e.headers)),d=await((n=t.prepareReconnectToStreamRequest)==null?void 0:n.call(t,{api:t.api,id:e.chatId,body:U(U({},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:kE(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)}},BO=class extends zO{constructor(e={}){super(e)}processResponseStream(e){return WE({stream:e,schema:SO}).pipeThrough(new TransformStream({async transform(e,t){if(!e.success)throw e.error;t.enqueue(e.value)}}))}},VO=class{constructor({generateId:e=OE,id:t=e(),transport:n=new BO,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 FO,this.sendMessage=async(e,t)=>{var n,r,i,a;if(e==null){await d.makeRequest(U({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 RO(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,U(U({},o),{},{id:e.messageId,role:(r=o.role)==null?`user`:r,metadata:e.metadata}))}else d.state.pushMessage(U(U({},o),{},{id:(i=o.id)==null?d.generateId():i,role:(a=o.role)==null?`user`:a,metadata:e.metadata}));await d.makeRequest(U({trigger:`submit-message`,messageId:e.messageId},t))},this.regenerate=async(e={})=>{let{messageId:t}=e,n=vr(e,iO),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(U({trigger:`regenerate-message`,messageId:t},n))},this.resumeStream=async(e={})=>{await d.makeRequest(U({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,U(U({},s),{},{parts:s.parts.map(t=>AO(t)&&t.toolCallId===n?U(U({},t),{},{state:e,output:r,errorText:i}):t)})),d.activeResponse&&(d.activeResponse.state.message.parts=d.activeResponse.state.message.parts.map(t=>AO(t)&&t.toolCallId===n?U(U({},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:MO({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 PO({stream:NO({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 HO({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(AO).filter(e=>!e.providerExecuted);return r.length>0&&r.every(e=>e.state===`output-available`||e.state===`output-error`)}var UO=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}));V();var WO=u(UO(),1);let GO=[`messages`],KO=[`experimental_throttle`,`resume`];var qO=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},JO=(e,t,n)=>(qO(e,t,`read from private field`),n?n.call(e):t.get(e)),YO=(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)},XO=(e,t,n,r)=>(qO(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n);function ZO(e,t){return t==null?e:(0,WO.default)(e,t)}var QO,$O,ek,tk,nk,rk,ik,ak,ok,sk=class{constructor(e=[]){YO(this,QO,void 0),YO(this,$O,`ready`),YO(this,ek,void 0),YO(this,tk,new Set),YO(this,nk,new Set),YO(this,rk,new Set),this.pushMessage=e=>{XO(this,QO,JO(this,QO).concat(e)),JO(this,ik).call(this)},this.popMessage=()=>{XO(this,QO,JO(this,QO).slice(0,-1)),JO(this,ik).call(this)},this.replaceMessage=(e,t)=>{XO(this,QO,[...JO(this,QO).slice(0,e),this.snapshot(t),...JO(this,QO).slice(e+1)]),JO(this,ik).call(this)},this.snapshot=e=>structuredClone(e),this[`~registerMessagesCallback`]=(e,t)=>{let n=t?ZO(e,t):e;return JO(this,tk).add(n),()=>{JO(this,tk).delete(n)}},this[`~registerStatusCallback`]=e=>(JO(this,nk).add(e),()=>{JO(this,nk).delete(e)}),this[`~registerErrorCallback`]=e=>(JO(this,rk).add(e),()=>{JO(this,rk).delete(e)}),YO(this,ik,()=>{JO(this,tk).forEach(e=>e())}),YO(this,ak,()=>{JO(this,nk).forEach(e=>e())}),YO(this,ok,()=>{JO(this,rk).forEach(e=>e())}),XO(this,QO,e)}get status(){return JO(this,$O)}set status(e){XO(this,$O,e),JO(this,ak).call(this)}get error(){return JO(this,ek)}set error(e){XO(this,ek,e),JO(this,ok).call(this)}get messages(){return JO(this,QO)}set messages(e){XO(this,QO,[...e]),JO(this,ik).call(this)}};QO=new WeakMap,$O=new WeakMap,ek=new WeakMap,tk=new WeakMap,nk=new WeakMap,rk=new WeakMap,ik=new WeakMap,ak=new WeakMap,ok=new WeakMap;var ck,lk=class extends VO{constructor(e){let{messages:t}=e,n=vr(e,GO),r=new sk(t);super(U(U({},n),{},{state:r})),YO(this,ck,void 0),this[`~registerMessagesCallback`]=(e,t)=>JO(this,ck)[`~registerMessagesCallback`](e,t),this[`~registerStatusCallback`]=e=>JO(this,ck)[`~registerStatusCallback`](e),this[`~registerErrorCallback`]=e=>JO(this,ck)[`~registerErrorCallback`](e),XO(this,ck,r)}};ck=new WeakMap;function uk(e={}){let{experimental_throttle:t,resume:n=!1}=e,r=vr(e,KO),i=R(`chat`in r?r.chat:new lk(r));(`chat`in r&&r.chat!==i.current||`id`in r&&i.current.id!==r.id)&&(i.current=`chat`in r?r.chat:new lk(r));let a=dt(Le(e=>i.current[`~registerMessagesCallback`](e,t),[t,i.current.id]),()=>i.current.messages,()=>i.current.messages),o=dt(i.current[`~registerStatusCallback`],()=>i.current.status,()=>i.current.status),s=dt(i.current[`~registerErrorCallback`],()=>i.current.error,()=>i.current.error),c=Le(e=>{typeof e==`function`&&(e=e(i.current.messages)),i.current.messages=e},[i]);return Pe(()=>{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}}V();function dk(e){return B.createElement(`svg`,_({width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,fillRule:`evenodd`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`},e),B.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`}),B.createElement(`path`,{d:`M12 9v4`}),B.createElement(`path`,{d:`M12 17h.01`}))}function fk(){return B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:18,height:18,viewBox:`0 0 18 18`,fill:`none`},B.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 pk(){return B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:4,height:16,viewBox:`0 0 4 16`,fill:`none`},B.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 mk(){return B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`18`,height:`18`,viewBox:`0 0 18 18`,fill:`none`},B.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 hk(){return B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`19`,height:`19`,viewBox:`0 0 19 19`,fill:`none`},B.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`}),B.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 gk({size:e=20}){return B.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`},B.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 _k(){return B.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`},B.createElement(`path`,{d:`M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z`}),B.createElement(`path`,{d:`M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z`}))}function vk({size:e=20,color:t=`currentColor`}){return B.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`},B.createElement(`path`,{d:`m12 19-7-7 7-7`}),B.createElement(`path`,{d:`M19 12H5`}))}let yk=B.memo(function({title:e,suggestions:t,onSelectPromptSuggestion:n}){let r=B.useId(),i=B.useCallback(e=>{n(e.currentTarget.value)},[n]);return B.createElement(`section`,{className:`DocSearch-PromptSuggestions`,"aria-labelledby":r},B.createElement(`h3`,{className:`DocSearch-PromptSuggestions-Title`,id:r},e),B.createElement(`div`,{className:`DocSearch-PromptSuggestions-Content`},t.map(e=>B.createElement(`button`,{key:e,type:`button`,className:`DocSearch-PromptSuggestions-Action`,value:e,onClick:i},e))))}),bk=[{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`}],xk=1e3;function Sk({id:e,showActions:t,latestAssistantMessageContent:n,translations:r,conversations:i,onFeedback:a,isSidepanel:o=!1}){let[s,c]=Me(()=>{var t;let n=(t=i.getOne)==null?void 0:t.call(i,e);return n!=null&&n.feedback?`thanks`:`actions`}),[l,u]=Me([]),[d,f]=Me(``),[p,m]=Me(!1),[h,g]=Me(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=B.createElement(wk,{translations:r,onClick:()=>navigator.clipboard.writeText(n)});return B.createElement(B.Fragment,null,B.createElement(`div`,{className:`DocSearch-AskAiScreen-Actions-Controls`},o?T:null,s===`thanks`?B.createElement(`p`,{className:`DocSearch-AskAiScreen-FeedbackText DocSearch-AskAiScreen-FeedbackText--visible`},y):B.createElement(B.Fragment,null,p&&s===`actions`?B.createElement(Er,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}):B.createElement(B.Fragment,null,B.createElement(Tk,{title:_,onClick:b}),B.createElement(Ek,{title:v,onClick:x})),h&&s===`actions`?B.createElement(`p`,{className:`DocSearch-AskAiScreen-FeedbackText`},h.message||`An error occured`):null),o?null:T),s===`note`?B.createElement(Ck,{translations:r,tags:l,notes:d,saving:p,savingError:h,onToggleTag:S,onNotesChange:f,onSubmit:C,onClose:w}):null)}function Ck({translations:e,tags:t,notes:n,saving:r,savingError:i,onToggleTag:a,onNotesChange:o,onSubmit:s,onClose:c}){let l=B.useId(),{feedbackPanelTitle:u=`What went wrong? (optional)`,feedbackDetailsPlaceholder:d=`Share some details...`,feedbackSubmitButtonText:f=`Submit`,feedbackCancelButtonText:p=`Cancel`}=e;return B.createElement(`div`,{className:`DocSearch-Feedback-Panel`,role:`group`,"aria-labelledby":l},B.createElement(`div`,{className:`DocSearch-Feedback-Panel-Header`},B.createElement(`p`,{className:`DocSearch-Feedback-Panel-Title`,id:l},u)),B.createElement(`div`,{className:`DocSearch-Feedback-Panel-Reasons`},bk.map(n=>{var r;let i=t.includes(n.value);return B.createElement(`button`,{key:n.value,type:`button`,className:`DocSearch-Feedback-Panel-Reason`,"aria-pressed":i,onClick:()=>a(n.value)},B.createElement(`span`,null,(r=e[n.translationKey])==null?n.defaultLabel:r))})),B.createElement(`textarea`,{className:`DocSearch-Feedback-Panel-Textarea`,placeholder:d,value:n,rows:3,maxLength:xk,onChange:e=>o(e.target.value.slice(0,xk))}),B.createElement(`p`,{className:`DocSearch-Feedback-Panel-CharCount`,"aria-live":`polite`},n.length,`/`,xk),i?B.createElement(`p`,{className:`DocSearch-Feedback-Panel-Error`},i.message||`An error occured`):null,B.createElement(`div`,{className:`DocSearch-Feedback-Panel-Actions`},B.createElement(`button`,{type:`button`,className:`DocSearch-Feedback-Panel-Cancel`,onClick:c},p),B.createElement(`button`,{type:`button`,className:`DocSearch-Feedback-Panel-Submit`,disabled:r,onClick:s},r?B.createElement(Er,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}):f)))}function wk({onClick:e,translations:t}){let{copyButtonTitle:n=`Copy`,copyButtonCopiedText:r=`Copied!`}=t,[i,a]=Me(!1);return Pe(()=>{if(i){let e=setTimeout(()=>{a(!1)},1500);return()=>clearTimeout(e)}},[i]),B.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?B.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`},B.createElement(`path`,{d:`M20 6 9 17l-5-5`})):B.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`},B.createElement(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),B.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 Tk({title:e,onClick:t}){return B.createElement(`button`,{type:`button`,className:`DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-LikeButton`,title:e,onClick:t},B.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`},B.createElement(`path`,{d:`M7 10v12`}),B.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 Ek({title:e,onClick:t}){return B.createElement(`button`,{type:`button`,className:`DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-DislikeButton`,title:e,onClick:t},B.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`},B.createElement(`path`,{d:`M17 14V2`}),B.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 Dk=[`className`],Ok=[`align`,`alignOffset`,`side`,`sideOffset`,`collisionBoundary`,`container`,`children`];function kk(e){let t=Ar({},(kr(e),e));return B.createElement(ih,t)}kk.Trigger=B.forwardRef((e,t)=>{let{className:n}=e,r=pn(e,Dk),i=`DocSearch-Popover-Trigger${n?` ${n}`:``}`;return B.createElement(sh,_({className:i,ref:t},r))});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=pn(e,Ok);return B.createElement(dh,{container:o},B.createElement(hh,{className:`DocSearch-Popover-Positioner`,align:t,alignOffset:n,side:r,sideOffset:i,collisionBoundary:a},B.createElement(Sh,_({className:`DocSearch-Popover-Popup`},c),B.createElement(wh,{className:`DocSearch-Popover-Arrow`}),B.createElement(Oh,{className:`DocSearch-Popover-Close`},B.createElement(jr,null)),s)))}kk.Popup=Ak;function jk(e){let t=Ar({},(kr(e),e));return B.createElement(Eh,_({className:`DocSearch-Popover-Title`},t))}kk.Title=jk;function Mk({links:e,titleText:t=`Source`,pluralTitleText:n=`Sources`}){let[r,i]=B.useState(!1),a=B.useRef(null),[o,s]=B.useState(null),c=e.length>1?n:t;return Pe(()=>{var e,t;if(!r)return;let n=a.current,o=(e=(t=n==null?void 0:n.closest(`.DocSearch-Sidepanel-Content`))==null?n==null?void 0:n.closest(`.DocSearch-Dropdown`):t)==null?null:e;if(s(o),!o)return;let c=()=>{if(!a.current)return;let e=a.current.getBoundingClientRect(),t=o.getBoundingClientRect();(e.bottom<=t.top||e.top>=t.bottom)&&i(!1)};return o.addEventListener(`scroll`,c,{passive:!0}),()=>{o.removeEventListener(`scroll`,c)}},[r]),e.length===0?null:B.createElement(kk,{open:r,modal:`trap-focus`,onOpenChange:i},B.createElement(kk.Trigger,{ref:a,className:`DocSearch-AskAiScreen-Sources-Action`},B.createElement(`span`,{className:`DocSearch-AskAiScreen-Sources-Action-icon`},B.createElement(Fr,null)),B.createElement(`span`,{className:`DocSearch-AskAiScreen-Sources-Action-text`},e.length,` `,c)),B.createElement(kk.Popup,{container:o,sideOffset:10,align:`start`,alignOffset:-16,collisionBoundary:o==null?`clipping-ancestors`:o},B.createElement(kk.Title,null,c),B.createElement(`ul`,{className:`DocSearch-AskAiScreen-Sources`},e.map(e=>B.createElement(`li`,{key:e.url,className:`DocSearch-AskAiScreen-Sources-source`},B.createElement(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`},B.createElement(Fr,null),B.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=>{var t;return((t=e==null?void 0:e.parts)==null?[]:t).filter(e=>e.type===`text`).map(e=>e.text).join(`
164
+
165
+ `)};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 Bk(e)&&Vk(e)&&e.state===`output-available`}function Uk(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 Wk(e){let t=e.find(e=>e.type===`data-suggestions`);return t?t.data.suggestions:[]}function Gk(e){if(e.state!==`input-available`&&e.state!==`output-available`)return[];if(e.type===`tool-searchIndex`){var t,n,r,i;let a=((t=(n=(r=e.output)==null?void 0:r.query)==null?(i=e.input)==null?void 0:i.query:n)==null?``:t).trim();return a?[a]:[]}if(`queries`in e.input&&Array.isArray(e.input.queries))return e.input.queries.map(({query:e})=>e.trim()).filter(Boolean);if(`query`in e.input&&typeof e.input.query==`string`){let t=e.input.query.trim();return t?[t]:[]}return[]}function Kk({icon:e,shimmer:t=!1,children:n,variant:r}){let i=`DocSearch-AskAiScreen-MessageContent-Tool Tool--${r}${t?` DocSearch-shimmer`:``}`;return B.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 B.createElement(Kk,{shimmer:!0,icon:B.createElement(Er,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}),variant:`PartialCall`},B.createElement(`span`,null,r));case`input-available`:{let t=Gk(e);return B.createElement(B.Fragment,null,t.map((t,n)=>B.createElement(Kk,{key:`${e.toolCallId}-call-${n}`,shimmer:!0,icon:B.createElement(Er,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}),variant:`Call`},B.createElement(`span`,null,i,` `,`"${t}" ...`))))}case`output-available`:{let t=Gk(e);return B.createElement(B.Fragment,null,t.map((t,r)=>B.createElement(Kk,{key:`${e.toolCallId}-result-${r}`,icon:B.createElement(dn,null),variant:`Result`},B.createElement(`span`,null,a,` `,n?B.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,`"`):B.createElement(`span`,{className:`DocSearch-AskAiScreen-MessageContent-Tool-Query`},` `,`"`,t,`"`)))))}default:return null}}function Jk({tool:e,part:t}){let n=z(()=>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 B.createElement(Kk,{shimmer:!0,variant:`PartialCall`,icon:B.createElement(gk,null)},B.createElement(`span`,null,t))}return n?B.createElement(Kk,{icon:B.createElement(gk,null),variant:`Result`},B.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`?B.createElement(Kk,{variant:`Result`,icon:B.createElement(_k,null)},n):B.createElement(Kk,{variant:`Result`,icon:B.createElement(_k,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?B.createElement(Jk,{tool:a,part:e}):i&&Xk(e)?B.createElement(Yk,{part:e,translations:t}):Vk(e)?B.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 n_.Renderer;$k.code=({text:e,lang:t=``,escaped:n})=>{let r=t?`language-${t}`:``,i=n?e:Qk(e);return`
164
166
  <div class="DocSearch-CodeSnippet">
165
167
  <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
168
  <pre><code class="${r}">${i}</code></pre>
167
169
  </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)});
170
+ `},$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=vt(({content:e,copyButtonText:t,copyButtonCopiedText:n,isStreaming:r})=>{let i=z(()=>n_.parse(e,{gfm:!0,breaks:!0,renderer:$k}),[e]),a=R(null);return Pe(()=>{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]),B.createElement(`div`,{ref:a,className:`DocSearch-Markdown-Content ${r?`DocSearch-Markdown-Content--streaming`:``}`,dangerouslySetInnerHTML:{__html:i}})});eA.displayName=`MemoizedMarkdown`;function tA(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(Hk(r)){let r=[],i,a=n;for(;a<e.length;){let t=e[a];if(Hk(t)){let e=Gk(t);r.push(...e),e.length>0&&(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 nA=[`children`,`className`,`onClick`],rA=B.createContext({open:!1,setOpen:e=>{}});function iA({children:e}){let[t,n]=B.useState(!1),r=B.useRef(null);return B.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]),B.createElement(rA.Provider,{value:{open:t,setOpen:n}},B.createElement(`div`,{ref:r,className:`DocSearch-Menu`},e))}function aA({children:e,className:t=``,disabled:n}){let{open:r,setOpen:i}=B.useContext(rA);function a(){n||i(!r)}return B.createElement(`button`,{type:`button`,className:`DocSearch-Menu-trigger ${t}${n?` disabled`:``}`,"aria-disabled":n,onClick:()=>a()},e)}iA.Trigger=aA;function oA({children:e}){let{open:t}=B.useContext(rA);return B.createElement(`div`,{className:`DocSearch-Menu-content${t?` open`:``}`},e)}iA.Content=oA;function sA(e){let{children:t,className:n=``,onClick:r}=e,i=pn(e,nA),{setOpen:a}=B.useContext(rA);return B.createElement(`button`,_({type:`button`,className:`DocSearch-Menu-item ${n}`,onClick:e=>{r&&(r(e),a(!1))}},i),t)}iA.Item=sA;let cA=e=>`https://${e}.algolia.net/agent-studio/1`,lA=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)},uA=({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=`${cA(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})},dA=[`id`,`messages`,`body`],fA=({appId:e,apiKey:t,agentId:n,searchParameters:r,userToken:i,indices:a})=>{let o={};return r&&(o.searchParameters=r),a&&a.length>0&&(o.indices=a),new BO({api:`${cA(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=pn(e,dA),a=Uk(n);return _(_({},i),{},{body:_({id:t,messages:a},r)})}})},pA=({agentId:e,apiKey:t,appId:n,tools:r=zk,searchParameters:i,memory:a,indices:o})=>{let s=R(new AbortController),c=z(()=>fA({apiKey:t,appId:n,agentId:e,searchParameters:i,userToken:a==null?void 0:a.userToken,indices:o}),[t,n,e,i,a==null?void 0:a.userToken,o]),l=R(c);l.current=c;let u=R(r);u.current=r;let d=R(null),f=Le(({toolCall:e})=>{let t=u.current[e.toolName];t!=null&&t.onToolCall&&t.onToolCall(_(_({},e),{},{addToolOutput:async({output:t})=>{d.current&&await d.current({output:t,tool:e.toolName,toolCallId:e.toolCallId})}}))},[]),p=Le((e,t=OE())=>new lk({id:t,messages:e,sendAutomaticallyWhen:HO,transport:l.current,onToolCall:f}),[f]),[m,h]=Me(()=>p()),g=R(m);g.current=m;let{messages:v,status:y,setMessages:b,error:x,stop:S,addToolOutput:C}=uk({chat:m});Pe(()=>{d.current=C},[C]);let w=R(Gr({key:`__DOCSEARCH_ASKAI_CONVERSATIONS__${n}`,limit:10})).current,T=Le(async(r,{thumbs:i,tags:a,notes:o})=>{var c;if(e){if((await uA({agentId:e,vote:i,messageId:r,appId:n,apiKey:t,abortSignal:s.current.signal,notes:o,tags:a})).status>=300)throw Error(`Failed, try again later.`);(c=w.addFeedback)==null||c.call(w,r,i===1?`like`:`dislike`,{tags:a,notes:o})}},[e,n,t,w]),E=Le(async()=>{s.current.abort(),await S()},[S]),D=z(()=>{let e=[];for(let n=0;n<v.length;n++)if(v[n].role===`user`){var t;let r=v[n],i=((t=v[n+1])==null?void 0:t.role)===`assistant`?v[n+1]:null;e.push({id:r.id,userMessage:r,assistantMessage:i}),i&&n++}return e},[v]),O=y===`streaming`||y===`submitted`,k=z(()=>{if(x)return lA(x)},[x]),A=Le((e,t)=>{let n=p(e,t);g.current=n,h(n)},[p]),j=Le(()=>{A()},[A]),M=Le((e,t)=>{A(e,t)},[A]),ee=Le((...e)=>g.current.sendMessage(...e),[]);return{chatId:m.id,messages:v,sendMessage:ee,status:y,setMessages:b,askAiError:k,stopAskAiStreaming:E,isStreaming:O,exchanges:D,conversations:w,sendFeedback:T,startNewConversation:j,restoreConversation:M}},mA=({agentId:e,searchClient:t,suggestedQuestionsEnabled:n=!1})=>{let[r,i]=Me([]);return Pe(()=>{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 hA(e){return{current:e}}function gA(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 _A(e){return e.reduce(function(e,t){return e.concat(t)},[])}var vA=0;function yA(){return`autocomplete-${vA++}`}function bA(e){return e.collections.length===0?0:e.collections.reduce(function(e,t){return e+t.items.length},0)}function xA(e){return e!==Object(e)}function SA(e,t){if(e===t)return!0;if(xA(e)||xA(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)||!SA(e[i],t[i]))return!1}return!0}var CA=function(){};function wA(e){if(typeof window<`u`)return e({window})}var TA=[{segment:`autocomplete-core`,version:`1.19.2`}];function EA(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 DA(e,t){return MA(e)||jA(e,t)||kA(e,t)||OA()}function OA(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
171
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kA(e,t){if(e){if(typeof e==`string`)return AA(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 AA(e,t)}}function AA(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 jA(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 MA(e){if(Array.isArray(e))return e}function NA(e){var t=DA((e.version||``).split(`.`).map(Number),2),n=t[0],r=t[1];return n>=3||n===2&&r>=4||n===1&&r>=10}var PA=[`items`],FA=[`items`];function IA(e){"@babel/helpers - typeof";return IA=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},IA(e)}function LA(e){return VA(e)||BA(e)||zA(e)||RA()}function RA(){throw TypeError(`Invalid attempt to spread non-iterable instance.
172
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zA(e,t){if(e){if(typeof e==`string`)return HA(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 HA(e,t)}}function BA(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function VA(e){if(Array.isArray(e))return HA(e)}function HA(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 UA(e,t){if(e==null)return{};var n=WA(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 WA(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 GA(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 KA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?GA(Object(n),!0).forEach(function(t){qA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qA(e,t,n){return t=JA(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JA(e){var t=YA(e,`string`);return IA(t)===`symbol`?t:String(t)}function YA(e,t){if(IA(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(IA(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function XA(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(KA(KA({},e),{},{objectIDs:e.objectIDs.slice(r,r+t)}));return n}function ZA(e){return e.map(function(e){var t=e.items,n=UA(e,PA);return KA(KA({},n),{},{objectIDs:(t==null?void 0:t.map(function(e){return e.objectID}))||n.objectIDs})})}function QA(e){var t=NA(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(LA(r),[{headers:o}]))}else e.apply(void 0,[n].concat(LA(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`,ZA(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`,ZA(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`,ZA(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`,ZA(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=UA(t,FA);return[].concat(LA(e),LA(XA(KA(KA({},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 $A(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 ej(e){return e.objectID&&e.__autocomplete_indexName&&e.__autocomplete_queryID}function tj(e){"@babel/helpers - typeof";return tj=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},tj(e)}function nj(e){return oj(e)||aj(e)||ij(e)||rj()}function rj(){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 ij(e,t){if(e){if(typeof e==`string`)return sj(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 sj(e,t)}}function aj(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function oj(e){if(Array.isArray(e))return sj(e)}function sj(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 cj(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 lj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?cj(Object(n),!0).forEach(function(t){uj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uj(e,t,n){return t=dj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dj(e){var t=fj(e,`string`);return tj(t)===`symbol`?t:String(t)}function fj(e,t){if(tj(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(tj(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var pj=400,mj=`2.15.0`,hj=`https://cdn.jsdelivr.net/npm/search-insights@${mj}/dist/search-insights.min.js`,gj=gA(function(e){var t=e.onItemsChange,n=e.items,r=e.insights,i=e.state;t({insights:r,insightsEvents:$A({items:n}).map(function(e){return lj({eventName:`Items Viewed`},e)}),state:i})},pj);function _j(e){var t=yj(e),n=t.insightsClient,r=t.insightsInitParams,i=t.onItemsChange,a=t.onSelect,o=t.onActive,s=t.__autocomplete_clickAnalytics,c=n;if(n||wA(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=mj,c=t[n],bj(t))}),!c)return{};r&&c(`init`,lj({partial:!0},r));var l=QA(c),u=hA([]),d=gA(function(e){var t=e.state;if(t.isOpen){var n=t.collections.reduce(function(e,t){return[].concat(nj(e),nj(t.items))},[]).filter(ej);SA(u.current.map(function(e){return e.objectID}),n.map(function(e){return e.objectID}))||(u.current=n,n.length>0&&gj({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:lj(lj({},s?{clickAnalytics:!0}:{}),e?{userToken:xj(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;ej(t)&&a({state:n,event:r,insights:l,item:t,insightsEvents:[lj({eventName:`Item Selected`},EA({item:t,items:i.getItems().filter(ej)}))]})}),r(function(e){var t=e.item,n=e.source,r=e.state,i=e.event;ej(t)&&o({state:r,event:i,insights:l,item:t,insightsEvents:[lj({eventName:`Item Active`},EA({item:t,items:n.getItems().filter(ej)}))]})})},onStateChange:function(e){var t=e.state;d({state:t})},__autocomplete_pluginOptions:e}}function vj(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;return[].concat(nj(t),[`autocomplete-internal`],nj((e=n.algoliaInsightsPlugin)!=null&&e.__automaticInsights?[`autocomplete-automatic`]:[]))}function yj(e){return lj({onItemsChange:function(e){var t=e.insights,n=e.insightsEvents,r=e.state;t.viewedObjectIDs.apply(t,nj(n.map(function(e){return lj(lj({},e),{},{algoliaSource:vj(e.algoliaSource,r.context)})})))},onSelect:function(e){var t=e.insights,n=e.insightsEvents,r=e.state;t.clickedObjectIDsAfterSearch.apply(t,nj(n.map(function(e){return lj(lj({},e),{},{algoliaSource:vj(e.algoliaSource,r.context)})})))},onActive:CA,__autocomplete_clickAnalytics:!0},e)}function bj(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=hj,n.onerror=function(){console.error(t)},document.body.appendChild(n)}catch(e){console.error(t)}}function xj(e){return typeof e==`number`?e.toString():e}function Sj(e,t){var n=t;return{then:function(t,r){return Sj(e.then(Tj(t,n,e),Tj(r,n,e)),n)},catch:function(t){return Sj(e.catch(Tj(t,n,e)),n)},finally:function(t){return t&&n.onCancelList.push(t),Sj(e.finally(Tj(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 Cj(e){return Sj(new Promise(function(t,n){return e(t,n)}),{isCanceled:!1,onCancelList:[]})}Cj.resolve=function(e){return wj(Promise.resolve(e))},Cj.reject=function(e){return wj(Promise.reject(e))};function wj(e){return Sj(e,{isCanceled:!1,onCancelList:[]})}function Tj(e,t,n){return e?function(n){return t.isCanceled?n:e(n)}:n}var Ej=!0,Dj;function Oj(){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 Ej?(Ej=!1,Dj=t?Promise.race([Promise.all(e),new Promise(function(e){return setTimeout(e,t)})]):Promise.all(e),Dj.then(function(){Ej=!0})):Dj}}}function kj(){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 Aj(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 jj(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 Mj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jj(Object(n),!0).forEach(function(t){Nj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Nj(e,t,n){return t=Pj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pj(e){var t=Fj(e,`string`);return Ij(t)===`symbol`?t:String(t)}function Fj(e,t){if(Ij(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Ij(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ij(e){"@babel/helpers - typeof";return Ij=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},Ij(e)}function Lj(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:CA,onResolve:CA};Object.keys(t).forEach(function(e){t[e].__default=!0});var r=Mj(Mj({},t),e);return Promise.resolve(r)}))})}function Rj(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=zj(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.
174
+ 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 zj(e,t){if(e){if(typeof e==`string`)return Bj(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 Bj(e,t)}}function Bj(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 Vj=function(e,t){var n=!1,r=[],i=Rj(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 Hj(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 Uj(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 Wj(e){var t=Hj(e);if(!t)return null;var n=t.items[Uj({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 Gj(e,t,n){return[e,n==null?void 0:n.sourceId,t].filter(Boolean).join(`-`).replace(/\s/g,``)}function Kj(e,t){return e===t||e.contains(t)}var qj=/((gt|sm)-|galaxy nexus)|samsung[- ]|samsungbrowser/i;function Jj(e){return!!(e&&e.match(qj))}function Yj(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 Xj(e){return e.nativeEvent||e}function Zj(e){"@babel/helpers - typeof";return Zj=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},Zj(e)}function Qj(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 $j(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Qj(Object(n),!0).forEach(function(t){eM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eM(e,t,n){return t=tM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tM(e){var t=nM(e,`string`);return Zj(t)===`symbol`?t:String(t)}function nM(e,t){if(Zj(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Zj(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function rM(e,t,n){var r=t.initialState;return{getState:function(){return r},dispatch:function(i,a){var o=$j({},r);r=e(r,{type:i,props:t,payload:a}),n({state:r,prevState:o})},pendingRequests:Oj()}}function iM(e){"@babel/helpers - typeof";return iM=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},iM(e)}function aM(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 oM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?aM(Object(n),!0).forEach(function(t){sM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function sM(e,t,n){return t=cM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cM(e){var t=lM(e,`string`);return iM(t)===`symbol`?t:String(t)}function lM(e,t){if(iM(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(iM(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function uM(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 oM(oM({},e),{},{items:_A(e.items).map(function(e){return oM(oM({},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 dM(e){"@babel/helpers - typeof";return dM=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},dM(e)}function fM(e){return gM(e)||hM(e)||mM(e)||pM()}function pM(){throw TypeError(`Invalid attempt to spread non-iterable instance.
175
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mM(e,t){if(e){if(typeof e==`string`)return _M(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 _M(e,t)}}function hM(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function gM(e){if(Array.isArray(e))return _M(e)}function _M(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 vM(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 yM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?vM(Object(n),!0).forEach(function(t){bM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bM(e,t,n){return t=xM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xM(e){var t=SM(e,`string`);return dM(t)===`symbol`?t:String(t)}function SM(e,t){if(dM(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(dM(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function CM(e,t){var n,r=typeof window<`u`?window:{},i=e.plugins||[];return yM(yM({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 bA(t)>0},reshape:function(e){return e.sources}},e),{},{id:(n=e.id)==null?yA():n,plugins:i,initialState:yM({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(fM(i.map(function(e){return e.getSources})),[e.getSources]).filter(Boolean).map(function(e){return Lj(e,n)})).then(function(e){return _A(e)}).then(function(e){return e.map(function(e){return yM(yM({},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:yM({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 wM(e){"@babel/helpers - typeof";return wM=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},wM(e)}function TM(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?TM(Object(n),!0).forEach(function(t){DM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function DM(e,t,n){return t=OM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OM(e){var t=kM(e,`string`);return wM(t)===`symbol`?t:String(t)}function kM(e,t){if(wM(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(wM(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function AM(e){var t=e.collections,n=e.props,r=e.state,i=t.reduce(function(e,t){return EM(EM({},e),{},DM({},t.source.sourceId,EM(EM({},t.source),{},{getItems:function(){return _A(t.items)}})))},{}),a=n.plugins.reduce(function(e,t){return t.reshape?t.reshape(e):e},{sourcesBySourceId:i,state:r}).sourcesBySourceId;return _A(n.reshape({sourcesBySourceId:a,sources:Object.values(a),state:r})).filter(Boolean).map(function(e){return{source:e,items:e.getItems()}})}function jM(e){"@babel/helpers - typeof";return jM=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},jM(e)}function MM(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 NM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?MM(Object(n),!0).forEach(function(t){PM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function PM(e,t,n){return t=FM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FM(e){var t=IM(e,`string`);return jM(t)===`symbol`?t:String(t)}function IM(e,t){if(jM(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(jM(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function LM(e){return VM(e)||BM(e)||zM(e)||RM()}function RM(){throw TypeError(`Invalid attempt to spread non-iterable instance.
176
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zM(e,t){if(e){if(typeof e==`string`)return HM(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 HM(e,t)}}function BM(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function VM(e){if(Array.isArray(e))return HM(e)}function HM(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 UM(e){return!!e.execute}function WM(e){return!!(e!=null&&e.execute)}function GM(e,t,n){if(WM(e)){var r=e.requesterId===`algolia`?Object.assign.apply(Object,[{}].concat(LM(Object.keys(n.context).map(function(e){var t;return(t=n.context[e])==null?void 0:t.__algoliaSearchParameters})))):{};return NM(NM({},e),{},{requests:e.queries.map(function(n){return{query:e.requesterId===`algolia`?NM(NM({},n),{},{params:NM(NM({},r),n.params)}):n,sourceId:t,transformResponse:e.transformResponse}})})}return{items:e,sourceId:t}}function KM(e){var t=e.reduce(function(e,t){if(!UM(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 UM(t)&&UM(e)&&e.searchClient===n&&!!i&&e.requesterId===i});if(o){var s;(s=o.items).push.apply(s,LM(a))}else{var c={execute:r,requesterId:i,items:a,searchClient:n};e.push(c)}return e},[]).map(function(e){if(!UM(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 _A(e)})}function qM(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(Yj(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 JM(e){"@babel/helpers - typeof";return JM=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},JM(e)}var YM=[`event`,`nextState`,`props`,`query`,`refresh`,`store`];function XM(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 ZM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?XM(Object(n),!0).forEach(function(t){QM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function QM(e,t,n){return t=$M(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $M(e){var t=eN(e,`string`);return JM(t)===`symbol`?t:String(t)}function eN(e,t){if(JM(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(JM(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function tN(e,t){if(e==null)return{};var n=nN(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 nN(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 rN=null,iN=kj();function aN(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=tN(e,YM);rN&&i.environment.clearTimeout(rN);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 ZM(ZM({},e),{},{items:[]})});p(`idle`),l(g),u((h=r.isOpen)==null?i.shouldPanelOpen({state:s.getState()}):h);var _=wj(iN(g).then(function(){return Promise.resolve()}));return s.pendingRequests.add(_)}p(`loading`),rN=i.environment.setTimeout(function(){p(`stalled`)},i.stallThreshold);var v=wj(iN(i.getSources(ZM({query:a,refresh:o,state:s.getState()},c)).then(function(e){return Promise.all(e.map(function(e){return Promise.resolve(e.getItems(ZM({query:a,refresh:o,state:s.getState()},c))).then(function(t){return GM(t,e.sourceId,s.getState())})})).then(KM).then(function(t){var n=t.some(function(e){var t=e.items;return oN(t)});if(n){var r;m({algoliaInsightsPlugin:ZM(ZM({},((r=s.getState().context)==null?void 0:r.algoliaInsightsPlugin)||{}),{},{__automaticInsights:n})})}return qM(t,e,s)}).then(function(e){return AM({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=Wj(s.getState());if(s.getState().activeItemId!==null&&f){var m=f.item,h=f.itemInputValue,g=f.itemUrl,_=f.source;_.onActive(ZM({event:t,item:m,itemInputValue:h,itemUrl:g,refresh:o,source:_,state:s.getState()},c))}}).finally(function(){p(`idle`),rN&&i.environment.clearTimeout(rN)});return s.pendingRequests.add(v)}function oN(e){return!Array.isArray(e)&&!!(e!=null&&e._automaticInsights)}function sN(e){"@babel/helpers - typeof";return sN=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},sN(e)}var cN=[`event`,`props`,`refresh`,`store`];function lN(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 uN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lN(Object(n),!0).forEach(function(t){dN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dN(e,t,n){return t=fN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fN(e){var t=pN(e,`string`);return sN(t)===`symbol`?t:String(t)}function pN(e,t){if(sN(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(sN(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function mN(e,t){if(e==null)return{};var n=hN(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 hN(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 gN(e){var t=e.event,n=e.props,r=e.refresh,i=e.store,a=mN(e,cN);if(t.key===`ArrowUp`||t.key===`ArrowDown`){var o=function(){var e=Wj(i.getState()),t=n.environment.document.getElementById(Gj(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=Wj(i.getState());if(i.getState().activeItemId!==null&&e){var n=e.item,o=e.itemInputValue,s=e.itemUrl,c=e.source;c.onActive(uN({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)?aN(uN({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=Vj(n.plugins,i.pendingRequests);c===void 0?n.debug||i.pendingRequests.cancelAll():c.then(i.pendingRequests.cancelAll);return}t.preventDefault();var l=Wj(i.getState()),u=l.item,d=l.itemInputValue,f=l.itemUrl,p=l.source;if(t.metaKey||t.ctrlKey)f!==void 0&&(p.onSelect(uN({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(uN({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(uN({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}aN(uN({event:t,nextState:{isOpen:!1},props:n,query:d,refresh:r,store:i},a)).then(function(){p.onSelect(uN({event:t,item:u,itemInputValue:d,itemUrl:f,refresh:r,source:p,state:i.getState()},a))})}}}function _N(e){"@babel/helpers - typeof";return _N=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},_N(e)}var vN=[`props`,`refresh`,`store`],yN=[`inputElement`,`formElement`,`panelElement`],bN=[`inputElement`],xN=[`inputElement`,`maxLength`],SN=[`source`],CN=[`item`,`source`];function wN(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 TN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?wN(Object(n),!0).forEach(function(t){EN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function EN(e,t,n){return t=DN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DN(e){var t=ON(e,`string`);return _N(t)===`symbol`?t:String(t)}function ON(e,t){if(_N(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(_N(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function kN(e,t){if(e==null)return{};var n=AN(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 AN(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 jN(e){var t=e.props,n=e.refresh,r=e.store,i=kN(e,vN);return{getEnvironmentProps:function(e){var n=e.inputElement,i=e.formElement,a=e.panelElement,o=kN(e,yN);function s(e){!(r.getState().isOpen||!r.pendingRequests.isEmpty())||e.target===n||[i,a].some(function(t){return Kj(t,e.target)})===!1&&(r.dispatch(`blur`,null),t.debug||r.pendingRequests.cancelAll())}return TN({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 TN({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 Gj(t.id,`list`,n)}).join(` `):void 0,"aria-labelledby":Gj(t.id,`label`)},e)},getFormProps:function(e){e.inputElement;var a=kN(e,bN),o=function(a){var o;t.onSubmit(TN({event:a,refresh:n,state:r.getState()},i)),r.dispatch(`submit`,null),(o=e.inputElement)==null||o.blur()};return TN({action:``,noValidate:!0,role:`search`,onSubmit:function(e){e.preventDefault();var n=Vj(t.plugins,r.pendingRequests);n===void 0?o(e):n.then(function(){return o(e)})},onReset:function(a){var o;a.preventDefault(),t.onReset(TN({event:a,refresh:n,state:r.getState()},i)),r.dispatch(`reset`,null),(o=e.inputElement)==null||o.focus()}},a)},getLabelProps:function(e){return TN({htmlFor:Gj(t.id,`input`),id:Gj(t.id,`label`)},e)},getInputProps:function(e){var a;function o(e){(t.openOnFocus||r.getState().query)&&aN(TN({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=kN(s,xN),d=Wj(r.getState()),f=Jj(((a=t.environment.navigator)==null?void 0:a.userAgent)||``),p=t.enterKeyHint||(d!=null&&d.itemUrl&&!f?`go`:`search`);return TN({"aria-autocomplete":`both`,"aria-activedescendant":r.getState().isOpen&&r.getState().activeItemId!==null?Gj(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 Gj(t.id,`list`,n)}).join(` `):void 0,"aria-labelledby":Gj(t.id,`label`),value:r.getState().completion||r.getState().query,id:Gj(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&&Xj(e).isComposing){i.setQuery(a);return}aN(TN({event:e,props:t,query:a.slice(0,l),refresh:n,store:r},i))},onCompositionEnd:function(e){aN(TN({event:e,props:t,query:e.currentTarget.value.slice(0,l),refresh:n,store:r},i))},onKeyDown:function(e){Xj(e).isComposing||gN(TN({event:e,props:t,refresh:n,store:r},i))},onFocus:o,onBlur:CA,onClick:function(n){e.inputElement===t.environment.document.activeElement&&!r.getState().isOpen&&o(n)}},u)},getPanelProps:function(e){return TN({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){r.dispatch(`mouseleave`,null)}},e)},getListProps:function(e){var n=e||{},r=n.source,i=kN(n,SN);return TN({role:`listbox`,"aria-labelledby":Gj(t.id,`label`),id:Gj(t.id,`list`,r)},i)},getItemProps:function(e){var a=e.item,o=e.source,s=kN(e,CN);return TN({id:Gj(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=Wj(r.getState());if(r.getState().activeItemId!==null&&t){var o=t.item,s=t.itemInputValue,c=t.itemUrl,l=t.source;l.onActive(TN({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():aN(TN({event:e,nextState:{isOpen:!1},props:t,query:s,refresh:n,store:r},i))).then(function(){o.onSelect(TN({event:e,item:a,itemInputValue:s,itemUrl:c,refresh:n,source:o,state:r.getState()},i))})}},s)}}}function MN(e){"@babel/helpers - typeof";return MN=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},MN(e)}function NN(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=arguments[t]==null?{}:arguments[t];t%2?NN(Object(n),!0).forEach(function(t){FN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function FN(e,t,n){return t=IN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IN(e){var t=LN(e,`string`);return MN(t)===`symbol`?t:String(t)}function LN(e,t){if(MN(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(MN(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function RN(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?FN({},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:PN({"autocomplete-core":Object.keys(o)},c),ua:TA.concat(((i=o.__autocomplete_metadata)==null?void 0:i.userAgents)||[])}}function zN(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 BN(e){var t,n=e.state;return n.isOpen===!1||n.activeItemId===null?null:((t=Wj(n))==null?void 0:t.itemInputValue)||null}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)}function HN(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 UN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?HN(Object(n),!0).forEach(function(t){WN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function WN(e,t,n){return t=GN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GN(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)}var qN=function(e,t){switch(t.type){case`setActiveItemId`:return UN(UN({},e),{},{activeItemId:t.payload});case`setQuery`:return UN(UN({},e),{},{query:t.payload,completion:null});case`setCollections`:return UN(UN({},e),{},{collections:t.payload});case`setIsOpen`:return UN(UN({},e),{},{isOpen:t.payload});case`setStatus`:return UN(UN({},e),{},{status:t.payload});case`setContext`:return UN(UN({},e),{},{context:UN(UN({},e.context),t.payload)});case`ArrowDown`:var n=UN(UN({},e),{},{activeItemId:t.payload.hasOwnProperty(`nextActiveItemId`)?t.payload.nextActiveItemId:Aj(1,e.activeItemId,bA(e),t.props.defaultActiveItemId)});return UN(UN({},n),{},{completion:BN({state:n})});case`ArrowUp`:var r=UN(UN({},e),{},{activeItemId:Aj(-1,e.activeItemId,bA(e),t.props.defaultActiveItemId)});return UN(UN({},r),{},{completion:BN({state:r})});case`Escape`:return e.isOpen?UN(UN({},e),{},{activeItemId:null,isOpen:!1,completion:null}):UN(UN({},e),{},{activeItemId:null,query:``,status:`idle`,collections:[]});case`submit`:return UN(UN({},e),{},{activeItemId:null,isOpen:!1,status:`idle`});case`reset`:return UN(UN({},e),{},{activeItemId:t.props.openOnFocus===!0?t.props.defaultActiveItemId:null,status:`idle`,completion:null,query:``});case`focus`:return UN(UN({},e),{},{activeItemId:t.props.defaultActiveItemId,isOpen:(t.props.openOnFocus||!!e.query)&&t.props.shouldPanelOpen({state:e})});case`blur`:return t.props.debug?e:UN(UN({},e),{},{isOpen:!1,activeItemId:null});case`mousemove`:return UN(UN({},e),{},{activeItemId:t.payload});case`mouseleave`:return UN(UN({},e),{},{activeItemId:t.props.defaultActiveItemId});default:return`${JSON.stringify(t.type)}`,e}};function JN(e){"@babel/helpers - typeof";return JN=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},JN(e)}function YN(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 XN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?YN(Object(n),!0).forEach(function(t){ZN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ZN(e,t,n){return t=QN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QN(e){var t=$N(e,`string`);return JN(t)===`symbol`?t:String(t)}function $N(e,t){if(JN(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(JN(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function eP(e){var t=[],n=CM(e,t),r=rM(qN,n,o),i=uM({store:r}),a=jN(XN({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(XN({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=_j({__autocomplete_clickAnalytics:!1});n.plugins.push(u),c([u])}}function s(){return aN(XN({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,XN(XN({},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(_j(u))}return c(n.plugins),zN({metadata:RN({plugins:n.plugins,options:e}),environment:n.environment}),XN(XN({refresh:s,navigator:n.navigator},a),i)}V();function tP(){return B.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`},B.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 nP={before:`Searched for `,separator:`, `,lastSeparator:` and `,after:``};function rP({queries:e,translations:t,onSearchQueryClick:n}){if(e.length===0)return null;if(typeof t.aggregatedToolCallNode==`function`)return B.createElement(B.Fragment,null,t.aggregatedToolCallNode(e,n));let{before:r=``,separator:i=`, `,lastSeparator:a=` and `,after:o=``}=(t.aggregatedToolCallText?t.aggregatedToolCallText(e):nP)||{};return B.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent-Tool Tool--AggregatedResult`},B.createElement(dn,{size:18}),B.createElement(`span`,null,r&&B.createElement(`span`,null,r),e.map((t,r)=>B.createElement(E,{key:t+r},B.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&&B.createElement(`span`,null,o)))}let iP=[`translations`];function aP(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 oP({disclaimerText:e}){return B.createElement(`p`,{className:`DocSearch-AskAiScreen-Disclaimer`},B.createElement(Dr,null),` `,e)}function sP({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;let{userMessage:p,assistantMessage:m}=e,{stoppedStreamingText:h=`You stopped this response`,errorTitleText:g=`Chat error`,relatedSourcesText:_,relatedSourcesTextPlural:v,suggestedPromptsTitleText:y=`Suggested prompts`}=a,b=z(()=>aP(a),[a]),x=Rk(t),S=z(()=>Lk(m),[m]),C=z(()=>Lk(p),[p]),w=B.useMemo(()=>Fk(m),[m]),T=B.useMemo(()=>tA((m==null?void 0:m.parts)||[]),[m]),E=z(()=>n?Wk((m==null?void 0:m.parts)||[]):[],[m,n]),D=((d=p.metadata)==null?void 0:d.stopped)||(m==null||(f=m.metadata)==null?void 0:f.stopped),O=!D&&(!n||n&&r===`ready`&&!!m),k=[`submitted`,`streaming`].includes(r)&&n&&!T.some(e=>e.type!==`step-start`),A=(m==null?void 0:m.id)||e.id;return B.createElement(`div`,{className:`DocSearch-AskAiScreen-Response-Container`},B.createElement(`div`,{className:`DocSearch-AskAiScreen-Response`},B.createElement(`div`,{className:`DocSearch-AskAiScreen-Message DocSearch-AskAiScreen-Message--user`},B.createElement(`p`,{className:`DocSearch-AskAiScreen-Query`},C==null?``:C)),B.createElement(`div`,{className:`DocSearch-AskAiScreen-Message DocSearch-AskAiScreen-Message--assistant`},B.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent`},r===`error`&&t&&n&&!x&&B.createElement(`div`,{className:`DocSearch-AskAiScreen-Error`,role:`alert`},B.createElement(dk,{"aria-hidden":`true`}),B.createElement(`div`,{className:`DocSearch-AskAiScreen-Error-Content`},B.createElement(`h4`,{className:`DocSearch-AskAiScreen-Error-Title`},g),B.createElement(eA,{content:t.message,copyButtonText:``,copyButtonCopiedText:``,isStreaming:!1}))),k&&B.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent-Thinking`,role:`status`},B.createElement(`span`,{className:`DocSearch-shimmer`},a.thinkingText||`Thinking...`),B.createElement(`span`,{className:`DocSearch-AskAi-Thinking-Skeleton DocSearch-shimmer`}),B.createElement(`span`,{className:`DocSearch-AskAi-Thinking-Skeleton DocSearch-AskAi-Thinking-Skeleton--short DocSearch-shimmer`})),T.map((e,t)=>{let n=t;return typeof e==`string`?B.createElement(eA,{key:n,content:e,copyButtonText:a.copyButtonText||`Copy`,copyButtonCopiedText:a.copyButtonCopiedText||`Copied!`,isStreaming:r===`streaming`}):Bk(e)?B.createElement(Zk,{key:n,translations:b,part:e,tools:o,memoryEnabled:l,onSearchQueryClick:i}):e.type===`aggregated-tool-call`?B.createElement(rP,{key:n,queries:e.queries,translations:a,onSearchQueryClick:i}):e.type===`reasoning`&&e.state===`streaming`?B.createElement(`div`,{key:n,className:`DocSearch-AskAiScreen-MessageContent-Reasoning DocSearch-shimmer`},B.createElement(Er,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}),B.createElement(`span`,{className:`DocSearch-shimmer`},`Reasoning...`)):e.type===`text`?B.createElement(eA,{key:n,content:e.text,copyButtonText:a.copyButtonText||`Copy`,copyButtonCopiedText:a.copyButtonCopiedText||`Copied!`,isStreaming:e.state===`streaming`}):null})),D&&B.createElement(`p`,{className:`DocSearch-AskAiScreen-MessageContent-Stopped`},h)),B.createElement(`div`,{className:`DocSearch-AskAiScreen-Answer-Footer`},B.createElement(Mk,{links:w,titleText:_,pluralTitleText:v}),B.createElement(Sk,{id:A,showActions:O,latestAssistantMessageContent:S||null,translations:a,conversations:s,onFeedback:c})),E.length>0&&B.createElement(yk,{title:y,suggestions:E,onSelectPromptSuggestion:u})))}function cP(e){let{translations:t={}}=e,n=pn(e,iP),{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=z(()=>l===`error`&&Rk(c),[l,c]),f=z(()=>{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 B.createElement(`div`,{className:`DocSearch-AskAiScreen DocSearch-AskAiScreen-Container`},m&&B.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent DocSearch-AskAiScreen-Error DocSearch-AskAiScreen-Error--ThreadDepth`},B.createElement(`div`,{className:`DocSearch-AskAiScreen-Error-Content`},B.createElement(`p`,null,i,` `,B.createElement(`button`,{type:`button`,className:`DocSearch-ThreadDepthError-Link`,onClick:n.onNewConversation},a),` `,`to continue.`))),B.createElement(oP,{disclaimerText:r}),B.createElement(`div`,{className:`DocSearch-AskAiScreen-Body`},B.createElement(`div`,{className:`DocSearch-AskAiScreen-ExchangesList`},f.slice().reverse().map((e,r)=>B.createElement(sP,{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 lP=[`translations`];function uP(e){let{translations:t={}}=e,n=pn(e,lP),{recentConversationsTitle:r=`Resume AI conversations`,removeRecentConversationButtonTitle:i=`Remove this conversation from history`}=t,a=xp(n.state,`recentConversations`);return a?B.createElement(Fm,_(_({},n),{},{title:r,collection:a,renderIcon:()=>B.createElement(`div`,{className:`DocSearch-Hit-icon DocSearch-Hit-icon--start`},B.createElement(tP,null)),renderAction:({item:e})=>B.createElement(`div`,{className:`DocSearch-Hit-action`},B.createElement(`button`,{className:`DocSearch-Hit-action-button`,title:i,type:`submit`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.conversations.remove(e),n.refresh()}},B.createElement(jr,null)))})):null}let dP=[`translations`];function fP(e){let{translations:t={}}=e,n=pn(e,dP);return B.createElement(`div`,{className:`DocSearch-Dropdown-Container`},B.createElement(uP,_(_({},n),{},{translations:t})),B.createElement(Bm,_(_({},n),{},{translations:t})))}let pP=[`onAskAiToggle`];function mP(e){let{onAskAiToggle:t}=e,n=pn(e,pP),r=B.useMemo(()=>xp(n.state,`recentConversations`),[n.state]);return B.useEffect(()=>{(!r||r.items.length===0)&&t(!0)},[r,t]),r?B.createElement(`div`,{className:`DocSearch-Dropdown-Container DocSearch-Conversation-History`},B.createElement(Fm,_(_({},n),{},{key:r.source.sourceId,title:``,translations:n.translations,collection:r,renderIcon:()=>B.createElement(`div`,{className:`DocSearch-Hit-icon`},B.createElement(Dr,null)),renderAction:({item:e})=>B.createElement(`div`,{className:`DocSearch-Hit-action`},B.createElement(`button`,{type:`button`,className:`DocSearch-Hit-action-button`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.conversations.remove(e),n.refresh()}},B.createElement(jr,null)))}))):null}function hP({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 B.createElement(`div`,{className:`DocSearch-NewConversationScreen`},B.createElement(`h3`,{className:`DocSearch-NewConversationScreen-Title`},r),B.createElement(`p`,{className:`DocSearch-NewConversationScreen-Description`},i),B.createElement(`div`,{className:`DocSearch-NewConversationScreen-SuggestedQuestions`},t.map(e=>B.createElement(`button`,{key:e.objectID,type:`button`,className:`DocSearch-NewConversationScreen-SuggestedQuestion`,onClick:()=>n(e)},e.question))))}let gP=[`translations`,`selectAskAiQuestion`],_P=B.memo(e=>{var t;let{translations:n={},selectAskAiQuestion:r}=e,i=pn(e,gP),a=B.useCallback(e=>{r(!0,e)},[r]);return i.canHandleAskAi&&i.isAskAiActive&&i.askAiState===`conversation-history`?B.createElement(mP,_({selectAskAiQuestion:r},i)):i.canHandleAskAi&&i.isAskAiActive&&i.askAiState===`new-conversation`?B.createElement(hP,{translations:n==null?void 0:n.newConversation,selectSuggestedQuestion:i.selectSuggestedQuestion,suggestedQuestions:i.suggestedQuestions}):i.isAskAiActive&&i.canHandleAskAi?B.createElement(cP,_(_({},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`?B.createElement(Vm,{translations:n==null?void 0:n.errorScreen}):jp(i.state.query)?B.createElement(fP,_(_({},i),{},{hasCollections:i.hasCollections,translations:n==null?void 0:n.startScreen,selectAskAiQuestion:r})):!i.hasCollections&&!i.canHandleAskAi?B.createElement(Um,_(_({},i),{},{translations:n==null?void 0:n.noResultsScreen})):B.createElement(B.Fragment,null,B.createElement(qm,_(_({},i),{},{translations:n==null?void 0:n.resultsScreen})),i.canHandleAskAi&&!i.hasCollections&&B.createElement(Um,_(_({},i),{},{translations:n==null?void 0:n.noResultsScreen})))},function(e,t){if(e.isAskAiActive!==t.isAskAiActive||e.askAiState!==t.askAiState||e.canHandleAskAi!==t.canHandleAskAi)return!1;let n=t.state.status===`loading`||t.state.status===`stalled`,r=t.state.status===`idle`&&!jp(t.state.query)&&e.state.query!==t.state.query&&e.state.collections===t.state.collections;return n||r});function vP({heading:e,shimmer:t=!1}){return B.createElement(`span`,{className:`DocSearch-Modal-heading${t?` DocSearch-shimmer`:``}`},e)}let yP=[`translations`,`askAiState`,`onAskAiToggle`,`setAskAiState`];function bP(e){let{translations:t={},askAiState:n,onAskAiToggle:r,setAskAiState:i}=e,a=pn(e,yP),{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=B.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),B.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&&!jp(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=B.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?B.createElement(`button`,{type:`button`,tabIndex:0,className:`DocSearch-Action DocSearch-AskAi-Return`,title:d,"aria-label":f,onClick:j},B.createElement(vk,null)):void 0,ee=k?B.createElement(vP,{heading:k,shimmer:T}):null,N=B.createElement(B.Fragment,null,!a.isAskAiActive&&B.createElement(B.Fragment,null,B.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&&B.createElement(`div`,{className:`DocSearch-Divider`})),T&&B.createElement(B.Fragment,null,B.createElement(`button`,{type:`button`,className:`DocSearch-Action DocSearch-StopStreaming`,onClick:a.onStopAskAiStreaming},B.createElement(fk,null)),B.createElement(`div`,{className:`DocSearch-Divider`})),E&&B.createElement(B.Fragment,null,B.createElement(iA,null,B.createElement(iA.Trigger,{className:`DocSearch-Action`},B.createElement(pk,null)),B.createElement(iA.Content,null,B.createElement(iA.Item,{onClick:a.onNewConversation},B.createElement(hk,null),g),b&&B.createElement(iA.Item,{onClick:a.onViewConversationHistory},B.createElement(mk,null),v))),B.createElement(`div`,{className:`DocSearch-Divider`})));return B.createElement(cm,_(_({},a),{},{placeholder:O,clearButtonTitle:o,clearButtonAriaLabel:s,closeButtonText:c,closeButtonAriaLabel:l,searchInputLabel:u,leadingElement:M,inputOverlay:ee,hideInput:!!k,actionsBeforeClose:N,inputProps:A}))}let xP={value:``,matchLevel:`none`,matchedWords:[]},SP={lvl0:xP,lvl1:xP,lvl2:xP,lvl3:xP,lvl4:xP,lvl5:xP,lvl6:xP},CP={content:xP,hierarchy:SP,hierarchy_camel:[]},wP={content:xP,hierarchy:SP,hierarchy_camel:[]};function TP({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 EP({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:CP,_snippetResult:wP,__docsearch_parent:null}}async function DP({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=>EP({query:e.prompt,objectID:e.objectID,lvl0:`Prompt Suggestions`}))}catch(e){return[]}}async function OP({query:e,handleSelectAskAiQuestion:t,promptSuggestionsOptions:n,searchClient:r}){let i=n?await DP({query:e,indexName:n.indexName,hitsPerPage:n.hitsPerPage,searchClient:r}):[];return[{sourceId:bp.askAI,getItems(){return[EP({query:e,objectID:`ask-ai-button`,lvl0:`Ask AI`}),...i]},onSelect({item:e}){e.type===`askAI`&&e.query&&t(!0,e.query)}}]}let kP=[`appId`,`apiKey`,`askAi`,`maxResultsPerGroup`,`theme`,`onClose`,`transformItems`,`hitComponent`,`resultsFooterComponent`,`navigator`,`initialScrollY`,`transformSearchClient`,`disableUserPersonalization`,`initialQuery`,`translations`,`getMissingResultsUrl`,`insights`,`onAskAiToggle`,`interceptAskAiEvent`,`isAskAiActive`,`recentSearchesLimit`,`recentSearchesWithFavoritesLimit`,`indices`,`facets`,`isHybridModeSupported`],AP=[`footer`,`searchBox`,`facets`];function jP(e){var t,n,r,i;let{appId:a,apiKey:o,askAi:s,maxResultsPerGroup:c,theme:l,onClose:u=Mp,transformItems:d=kp,hitComponent:f=fm,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,facets:k,isHybridModeSupported:A=!1}=e,j=pn(e,kP),{footer:M,searchBox:ee,facets:N}=b,te=pn(b,AP),[ne,P]=B.useState({query:``,collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:`idle`}),re=!!s,ie=(b==null||(t=b.searchBox)==null?void 0:t.placeholderText)||j.placeholder||`Search docs`;if(re){var ae;ie=(b==null||(ae=b.searchBox)==null?void 0:ae.placeholderText)||`Search docs or ask AI a question`}if(T){var oe;ie=(b==null||(oe=b.searchBox)==null?void 0:oe.placeholderTextAskAi)||`Ask another question...`}let{containerRef:se,modalRef:ce,formElementRef:le,dropdownRef:F,inputRef:ue,snippetLength:de}=xm(),{initialQuery:fe,initialQueryFromSelection:pe}=gm(y),me=Kr(a,o,g),I=typeof s==`object`?s:null,L=I?I.agentId:s,he=I==null?void 0:I.searchParameters,[ge,_e]=B.useState(`initial`),ve=mA({agentId:L,searchClient:me,suggestedQuestionsEnabled:I==null?void 0:I.suggestedQuestions}),ye=(n=I==null||(r=I.memory)==null?void 0:r.enabled)!=null&&n,be=(i=I==null?void 0:I.tools)==null?zk:i,xe=B.useMemo(()=>Zm({indices:O}),[O]),Se=xe[0].name,Ce=B.useRef(void 0),{visibleFacets:we,facetSelections:Te,facetSelectionsRef:Ee,handleFacetSelectionChange:De,clearFacetSelections:Oe}=mm({facets:k,indexes:xe,searchClient:me,onSelectionsChange:()=>{var e;return(e=Ce.current)==null?void 0:e.refresh()}}),{favoriteSearches:ke,recentSearches:Ae}=Tm({defaultIndexName:Se,recentSearchesLimit:E,recentSearchesWithFavoritesLimit:D}),[je,Me]=B.useState(!1),{chatId:Ne,messages:Pe,status:Fe,setMessages:R,sendMessage:Ie,stopAskAiStreaming:z,askAiError:Le,sendFeedback:Re,conversations:ze,startNewConversation:Be,restoreConversation:Ve}=pA({agentId:L,apiKey:(I==null?void 0:I.apiKey)||o,appId:(I==null?void 0:I.appId)||a,searchParameters:he,tools:be,memory:I==null?void 0:I.memory,indices:I==null?void 0:I.indices}),He=B.useRef(Fe);B.useEffect(()=>{if(!v){if(He.current===`streaming`&&Fe===`ready`){je&&Pe.at(-1)&&(Pe.at(-1).metadata={stopped:!0});for(let e of Pe[0].parts)e.type===`text`&&ze.add(Ik(e.text,Pe,Ne))}He.current=Fe}},[Fe,Pe,ze,v,je,Ne]);let Ue=B.useMemo(()=>Fe===`error`&&Rk(Le),[Fe,Le]),We=wm({favoriteSearches:ke,recentSearches:Ae,disableUserPersonalization:v}),Ge=hm(ne),Ke=B.useCallback((e,t,n=void 0)=>{if(e){let e={query:t,suggestedQuestionId:n==null?void 0:n.objectID};if(w!=null&&w(e)){Ce.current&&Ce.current.setQuery(``);return}}if(e&&ge===`new-conversation`&&_e(`initial`),C(e,{query:t,suggestedQuestionId:n==null?void 0:n.objectID}),A)return;Me(!1);let r={};if(n&&(r.body={suggestedQuestionId:n.objectID}),Ie({role:`user`,parts:[{type:`text`,text:t}]},r),F.current){let e=F.current;typeof e.scrollTo==`function`?e.scrollTo({top:0,behavior:`smooth`}):e.scrollTop=0}Ce.current&&Ce.current.setQuery(``)},[ge,C,A,Ie,F,w]),qe=B.useCallback(async(e,t)=>{!L||!a||await Re(e,t)},[L,a,Re]);Ce.current||(Ce.current=eP({id:`docsearch`,defaultActiveItemId:0,openOnFocus:!0,initialState:{query:fe,context:{searchSuggestions:[]}},insights:!!S,navigator:m,onStateChange(e){P(e.state)},async getSources({query:e,state:t,setContext:n,setStatus:r}){if(jp(e)){let e=Ym({recentSearches:Ae,favoriteSearches:ke,saveRecentSearch:We,onClose:u,disableUserPersonalization:v});return[...re?TP({conversations:ze,disableUserPersonalization:v,setMessages:R,onAskAiToggle:C}):[],...e]}let i=Xm({query:e,state:{context:t.context},setContext:n,setStatus:r,searchClient:me,indexes:xe,snippetLength:de,insights:!!S,appId:a,apiKey:o,maxResultsPerGroup:c,transformItems:d,saveRecentSearch:We,onClose:u,facetSelections:Ee}),s=re?OP({query:e,handleSelectAskAiQuestion:Ke,promptSuggestionsOptions:I==null?void 0:I.promptSuggestions,searchClient:me}):Promise.resolve([]),[l,f]=await Promise.all([s,i]);return[...l,...f]}}));let Je=Ce.current,{getEnvironmentProps:Ye,getRootProps:Xe,refresh:Ze}=Je;bm({getEnvironmentProps:Ye,containerRef:se,dropdownRef:F,formElementRef:le,inputRef:ue,initialScrollY:h,modalRef:ce,snippetLength:de,theme:l}),B.useEffect(()=>{F.current&&!T&&Ip(F.current)},[ne.query,T,F]),Sm({initialQuery:fe,inputRef:ue,refresh:Ze});let Qe=Pe.length>0;B.useEffect(()=>{T||(Je.refresh(),Qe&&Be())},[T,Je,Be,Qe]),B.useEffect(()=>{_e(`initial`)},[T,_e]);let $e=async()=>{Me(!0),await z()},et=()=>{Be(),_e(`new-conversation`)},tt=()=>{_e(`conversation-history`)},nt=e=>{Ke(!0,e.question,e)},rt=!0,it=ne.collections.some(e=>e.source.sourceId!==bp.askAI&&e.items.length>0);return ne.status===`idle`&&it===!1&&jp(ne.query)&&!T&&(rt=!1),B.createElement(lm,{state:ne,containerRef:se,modalRef:ce,formElementRef:le,dropdownRef:F,getRootProps:Xe,showDropdown:rt,searchBox:B.createElement(bP,_(_({},Je),{},{state:ne,placeholder:ie||`Search docs`,autoFocus:jp(fe),inputRef:ue,isFromSelection:!!fe&&fe===pe,translations:ee,isAskAiActive:T,askAiStatus:Fe,askAiError:Le,askAiState:ge,setAskAiState:_e,isThreadDepthError:Ue&&ge!==`new-conversation`,onClose:u,onAskAiToggle:C,onAskAgain:e=>{Ke(!0,e)},onStopAskAiStreaming:$e,onNewConversation:et,onViewConversationHistory:tt})),filterBar:!T&&!jp(ne.query)?B.createElement(om,{facets:we,selections:Te,translations:N,clearSelections:Oe,onSelectionChange:De}):null,screenState:B.createElement(_P,_(_({},Je),{},{indexName:Se,state:ne,hitComponent:f,resultsFooterComponent:p,disableUserPersonalization:v,recentSearches:Ae,favoriteSearches:ke,conversations:ze,inputRef:ue,translations:te,getMissingResultsUrl:x,isAskAiActive:T,canHandleAskAi:re,messages:Pe,tools:be,askAiError:Le,status:Fe,hasCollections:it,askAiState:ge,selectAskAiQuestion:Ke,suggestedQuestions:ve,selectSuggestedQuestion:nt,memoryEnabled:ye,resultBadgeKey:j.resultBadgeKey,onAskAiToggle:C,onNewConversation:et,onItemClick:(e,t)=>{if(e.type===`askAI`&&e.query){if(e.anchor===`stored`&&`messages`in e){let n=e.messages;Ve(n,e.chatId);let r={query:e.query,messageId:n[0].id};if(w!=null&&w(r)){Ce.current&&Ce.current.setQuery(``),t.preventDefault();return}C(!0,r)}else Ke(!0,e.query);_e(`initial`),t.preventDefault();return}Ge(e),We(e),Ap(t)||u()},onFeedback:qe})),footer:B.createElement(dm,{translations:M,isAskAiActive:T}),onClose:u})}function MP(e){"@babel/helpers - typeof";return MP=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},MP(e)}function NP(e,t){if(MP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(MP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function PP(e){var t=NP(e,`string`);return MP(t)==`symbol`?t:t+``}function FP(e,t,n){return(t=PP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IP(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 LP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?IP(Object(n),!0).forEach(function(t){FP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let RP={"Ctrl/Cmd+K":!0,"/":!0,"Ctrl/Cmd+I":!0};function zP(e){return LP(LP({},RP),e)}V();function BP(e){let t=e.composedPath()[0],n=t.tagName;return t.isContentEditable||n===`INPUT`||n===`SELECT`||n===`TEXTAREA`}function VP({isOpen:e,isAskAiActive:t,onAskAiToggle:n,onClose:r,onOpen:i,keyboardShortcuts:a=RP}){B.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||!BP(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])}V();let HP=()=>{let[e,t]=B.useState(!1);return B.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 UP(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 WP(e,t){if(e==null)return{};var n,r,i=UP(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 GP=[`children`,`appId`,`apiKey`,`theme`,`onReady`,`onOpen`,`onClose`,`onSidepanelOpen`,`onSidepanelClose`],KP=B.createContext(void 0);KP.displayName=`DocSearchContext`;function qP(e,t){let{children:n,appId:r,apiKey:i,theme:a,onReady:o,onOpen:s,onClose:c,onSidepanelOpen:l,onSidepanelClose:u}=e,d=WP(e,GP),[f,p]=B.useState(`ready`),[m,h]=B.useState(d.initialQuery||``),g=B.useRef(null),_=zP(d.keyboardShortcuts),[v,y]=B.useState(),[b,x]=B.useState(()=>new Set),S=HP(),C=B.useRef(`ready`),w=[`modal-search`,`modal-askai`].includes(f),T=f===`modal-askai`,E=!S&&b.has(`sidepanel`),D=f===`sidepanel`;B.useEffect(()=>{o==null||o()},[o]),B.useEffect(()=>{let e=C.current,t=f;(t===`modal-search`||t===`modal-askai`)&&e!==`modal-search`&&e!==`modal-askai`&&(s==null||s()),t===`ready`&&(e===`modal-search`||e===`modal-askai`)&&(c==null||c()),t===`sidepanel`&&e!==`sidepanel`&&(l==null||l()),t!==`sidepanel`&&e===`sidepanel`&&(u==null||u()),C.current=t},[f,s,c,l,u]);let O=B.useCallback(()=>{p(`modal-search`)},[]),k=B.useCallback(()=>{var e,t;p(`ready`),(e=g.current)==null||e.focus(),h((t=d.initialQuery)==null?``:t)},[p,d.initialQuery]),A=B.useCallback((e,t)=>{if(!S&&e&&E){y(t),p(`sidepanel`);return}p(e?`modal-askai`:`modal-search`)},[p,S,E]),j=B.useCallback(e=>{b.has(`sidepanel`)&&(y(e),p(`sidepanel`))},[p,b]),M=B.useCallback(e=>{p(`modal-search`),h(e.key)},[p,h]),ee=B.useCallback(e=>{b.has(e)||x(t=>{let n=new Set(t);return n.add(e),n})},[b]);B.useImperativeHandle(t,()=>({open:O,close:k,openAskAi:e=>A(!0,e),openSidepanel:j,get isReady(){return!0},get isOpen(){return w},get isSidepanelOpen(){return D},get isSidepanelSupported(){return E}}),[O,k,A,j,w,D,E]),mn({theme:a}),VP({isOpen:w,onOpen:O,onClose:k,onAskAiToggle:A,onInput:M,isAskAiActive:T,searchButtonRef:g,keyboardShortcuts:_});let N=B.useMemo(()=>({appId:r,apiKey:i,docsearchState:f,setDocsearchState:p,searchButtonRef:g,initialQuery:m,keyboardShortcuts:_,openModal:O,closeModal:k,isAskAiActive:T,isModalActive:w,onAskAiToggle:A,initialAskAiMessage:v,registerView:ee,isHybridModeSupported:E}),[r,i,f,g,m,_,O,k,T,w,A,v,ee,E]);return B.createElement(KP.Provider,{value:N},n)}let JP=B.forwardRef(qP);JP.displayName=`DocSearch`;function YP(){let e=B.useContext(KP);if(e===void 0)throw Error("`useDocSearch` must be used within the `DocSearch` provider");return e}V();let XP=[`appId`,`apiKey`];function ZP(e,t){let{appId:n,apiKey:r}=e,i=pn(e,XP);return B.createElement(JP,_(_({},i),{},{appId:n,apiKey:r,ref:t}),B.createElement($P,i))}let QP=B.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,appId:p,apiKey:m}=YP();if(!p||!m)throw Error("`DocSearchAI` requires `appId` and `apiKey` props.");return B.createElement(B.Fragment,null,B.createElement(_n,{keyboardShortcuts:a,ref:i,translations:(t=e.translations)==null?void 0:t.button,onClick:u}),o&&Et(B.createElement(jP,_(_({},e),{},{appId:p,apiKey:m,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===`
177
+ `||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]}V();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 Nt(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=vr(r,rF),u=iF(i,a||(typeof window<`u`?window:void 0)),d=T(),f=!1;return Dt(C(e,U(U({},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(){Lt(u),f=!1}}}}return sF(QP,yn)});
176
178
  //# sourceMappingURL=index.js.map