@docsearch/js 5.0.5 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/docsearch.d.ts +4054 -749
- package/dist/esm/docsearch.js +377 -67
- package/dist/esm/docsearch.js.map +1 -1
- package/dist/esm/index.d.ts +4055 -750
- package/dist/esm/index.js +2450 -1324
- package/dist/esm/index.js.map +1 -1
- package/dist/umd/docsearch.js +12 -12
- package/dist/umd/docsearch.js.map +1 -1
- package/dist/umd/index.js +46 -46
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -3
package/dist/umd/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*! @docsearch/js 5.0
|
|
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),ie(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,oe(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=N(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,_=ie(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&I(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=P(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function N(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=te(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)),le(s,s));return r}function P(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=P(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 ee(e,t){return t=t||[],e==null||typeof e==`boolean`||(De(e)?e.some(function(e){ee(e,t)}):t.push(e)),t}function te(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 F(e,t,n){t[0]==`-`?e.setProperty(t,n==null?``:n):e[t]=n==null?``:n}function ne(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||F(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||F(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 re(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 ie(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,N,P,ee,te=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 te==`function`)try{if(v=t.props,y=`prototype`in te&&te.prototype.render,b=(d=te.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 te(v,x):(t.__c=f=new D(v,x),f.constructor=te,f.render=ue),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&&te.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=ke({},f.__s)),ke(f.__s,te.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&te.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&te.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=se(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=[],N=0;N<a.length;N++)(P=a[N])==null||j||(P.nodeType==8&&P.data==`$s`?(A>0&&t.__c.__z.push(P),A++,a[N]=null):P.nodeType==8&&P.data==`/$s`?(--A>0&&t.__c.__z.push(P),j=A===0,s=a[N],a[N]=null):A>0&&(t.__c.__z.push(P),a[N]=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(ee=a.length;ee--;)S(a[ee]);ae(t)}else t.__e=n.__e,t.__k=n.__k,e.then||ae(t);L.__e(e,t,n)}else s=t.__e=ce(n.__e,t,n,r,i,a,o,c,l,u);return(d=L.diffed)&&d(t),128&t.__u?void 0:s}function ae(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(ae)}function oe(e,t,n){for(var r=0;r<n.length;r++)I(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 se(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:De(e)?e.map(se):ke({},e)}function ce(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;ne(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&&!_||ne(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)||ne(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&ne(e,u,g,v[u],i))}return e}function I(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 le(e,t,n){var r,i;if(L.unmount&&L.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||I(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]&&le(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 ue(e,t,n){return this.constructor(e,n)}function de(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=[],ie(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),oe(i,e,a)}function fe(e,t){e.__u|=32,de(e,t)}function pe(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 me(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=re(!1),Ce=re(!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:()=>me,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(){de(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)}}}de(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=``),de(e,t),typeof n==`function`&&n(),e?e.__c:null}function Ot(e,t,n){return fe(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)?pe.apply(null,arguments):e}function Lt(e){return!!e.__k&&(de(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:ee(ee(e).map(t.bind(n)))},Gt={map:Wt,forEach:Wt,count:function(e){return e?ee(e).length:0},only:function(e){var t=ee(e);if(t.length!==1)throw`Children.only`;return t[0]},toArray:ee},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=ee(t.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),n==`select`&&r.defaultValue!=null&&(r.value=ee(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:me,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.5`;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]===`
|
|
1
|
+
/*! @docsearch/js 5.1.0 (UNRELEASED 189dcc9) | 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.1.0`;function xn(e,t){this.v=e,this.k=t}function Sn(e){return new xn(e,0)}function Cn(e){return function(){return new wn(e.apply(this,arguments))}}function wn(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof xn;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`?`return`:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(a.done?`return`:`normal`,n)},function(e){r(`throw`,e)})}catch(e){i(`throw`,e)}}function i(e,i){switch(e){case`return`:t.resolve({value:i,done:!0});break;case`throw`:t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}wn.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},wn.prototype.next=function(e){return this._invoke(`next`,e)},wn.prototype.throw=function(e){return this._invoke(`throw`,e)},wn.prototype.return=function(e){return this._invoke(`return`,e)};function Tn(e){var t,n,r,i=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new En(t.call(e));n=`@@asyncIterator`,r=`@@iterator`}throw TypeError(`Object is not async iterable`)}function En(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return En=function(e){this.s=e,this.n=e.next},En.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new En(e)}function Dn(e){"@babel/helpers - typeof";return Dn=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Dn(e)}function On(e,t){if(Dn(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Dn(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function kn(e){var t=On(e,`string`);return Dn(t)==`symbol`?t:t+``}function V(e,t,n){return(t=kn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function An(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?An(Object(n),!0).forEach(function(t){V(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):An(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function jn(e){var t={},n=!1;function r(t,r){return n=!0,r=new Promise(function(n){n(e[t](r))}),{done:!1,value:new xn(r,1)}}return t[typeof Symbol<`u`&&Symbol.iterator||`@@iterator`]=function(){return this},t.next=function(e){return n?(n=!1,e):r(`next`,e)},typeof e.throw==`function`&&(t.throw=function(e){if(n)throw n=!1,e;return r(`throw`,e)}),typeof e.return==`function`&&(t.return=function(e){return n?(n=!1,e):r(`return`,e)}),t}function Mn(e){let t,n=`algolia-client-js-${e.key}`;function r(){return t===void 0&&(t=e.localStorage||window.localStorage),t}function i(){return JSON.parse(r().getItem(n)||`{}`)}function a(e){r().setItem(n,JSON.stringify(e))}function o(){return new Promise(e=>setTimeout(e,0))}function s(){let t=e.timeToLive?e.timeToLive*1e3:null,n=i(),r=new Date().getTime(),a=!1;return{namespace:Object.fromEntries(Object.entries(n).filter(([,e])=>!e||e.timestamp===void 0||t&&e.timestamp+t<r?(a=!0,!1):!0)),changed:a}}return{get(e,t,n={miss:()=>Promise.resolve()}){return o().then(()=>{let{namespace:r,changed:i}=s(),o=r[JSON.stringify(e)];return i&&a(r),o?o.value:t().then(e=>n.miss(e).then(()=>e))})},set(e,t){return o().then(()=>{let a=i();return a[JSON.stringify(e)]={timestamp:new Date().getTime(),value:t},r().setItem(n,JSON.stringify(a)),t})},delete(e){return o().then(()=>{let t=i();delete t[JSON.stringify(e)],r().setItem(n,JSON.stringify(t))})},clear(){return Promise.resolve().then(()=>{r().removeItem(n)})}}}function Nn(){return{get(e,t,n={miss:()=>Promise.resolve()}){return t().then(e=>Promise.all([e,n.miss(e)])).then(([e])=>e)},set(e,t){return Promise.resolve(t)},delete(e){return Promise.resolve()},clear(){return Promise.resolve()}}}function Pn(e){let t=[...e.caches],n=t.shift();return n===void 0?Nn():{get(e,r,i={miss:()=>Promise.resolve()}){return n.get(e,r,i).catch(()=>Pn({caches:t}).get(e,r,i))},set(e,r){return n.set(e,r).catch(()=>Pn({caches:t}).set(e,r))},delete(e){return n.delete(e).catch(()=>Pn({caches:t}).delete(e))},clear(){return n.clear().catch(()=>Pn({caches:t}).clear())}}}function Fn(e={serializable:!0}){let t={};return{get(n,r,i={miss:()=>Promise.resolve()}){let a=JSON.stringify(n);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);let o=r();return o.then(e=>i.miss(e)).then(()=>o)},set(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear(){return t={},Promise.resolve()}}}function In(e){let t={value:`Algolia for JavaScript (${e})`,add(e){let n=`; ${e.segment}${e.version===void 0?``:` (${e.version})`}`;return t.value.indexOf(n)===-1&&(t.value=`${t.value}${n}`),t}};return t}function Ln(e,t,n=`WithinHeaders`){let r={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers(){return n===`WithinHeaders`?r:{}},queryParameters(){return n===`WithinQueryParameters`?r:{}}}}function Rn({algoliaAgents:e,client:t,version:n}){let r=In(n).add({segment:t,version:n});return e.forEach(e=>r.add(e)),r}function zn(){return{debug(e,t){return Promise.resolve()},info(e,t){return Promise.resolve()},error(e,t){return Promise.resolve()}}}var Bn=10*1024*1024;function Vn(e){return Hn.apply(this,arguments)}function Hn(){return Hn=Cn(function*(e){let t=e.getReader();try{for(;;){let{done:e,value:n}=yield Sn(t.read());if(e)return;yield n}}finally{t.releaseLock()}}),Hn.apply(this,arguments)}function Un(e){return Symbol.asyncIterator in e?e:Vn(e)}function Wn(e){return Gn.apply(this,arguments)}function Gn(){return Gn=Cn(function*(e){let t=new TextDecoder(`utf-8`),n=[],r=0,i=!1,a=!0;var o=!1,s=!1,c;try{for(var l=Tn(Un(e)),u;o=!(u=yield Sn(l.next())).done;o=!1){let e=u.value;{let o=t.decode(e,{stream:!0}),s=0;for(i&&(i=!1,o.length>0&&o[0]===`
|
|
3
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>
|
|
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
|
|
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=me(void 0);function Xr(e){let t=Re(Yr);if(t===void 0&&!e)throw Error(Jr(33));return t}V();let Zr=me(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=me(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=me(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=me({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=me(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=me(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=me(null),tl=me(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),N=R(!1),P=R(null),ee=R(``),te=R(``),F=R(null),ne=R(null),re=ti(F,f,A==null?void 0:A.beforeInsideRef),ie=ti(ne,A==null?void 0:A.afterInsideRef),ae=Vo(),oe=Vo(),se=jo(),ce=A!=null,I=os(v),le=La((e=I)=>e?hc(e):[]),ue=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(I,Xo(gs(I)))&&le().length===0&&!C&&Ho(e)}return fs(gs(I),`keydown`,e)},[r,I,s,C,le]),Pe(()=>{if(r||!g)return;let e=gs(I);function t(){N.current=!1}function n(e){let t=Qo(e),n=ue(),r=Zo(v,t)||Zo(_,t)||Zo(A==null?void 0:A.portalNode,t)||n.some(e=>e===t||Zo(e,t));N.current=!r,te.current=e.pointerType||`keyboard`,t!=null&&t.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,oe.start(0,()=>{M.current=!1}))}function i(){te.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,_,I,g,A,oe,ue]),Pe(()=>{if(r||!c)return;let e=gs(I);function t(){M.current=!0,oe.start(0,()=>{M.current=!1})}function n(e){let t=Qo(e);pc(t)&&(P.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=ue(),f=(n==null?void 0:n.hasAttribute(Dc(`focus-guard`)))&&[F.current,ne.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===_&&I&&pl(I),o&&r!==_&&!ec(i)&&Xo(e)===e.body){if(ha(I)&&(I.focus(),o===`popup`)){se.request(()=>{I.focus()});return}let e=le(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||I;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(){N.current||(b.current.insideReactTree=!0,ae.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,I,s,k,A,h,c,o,le,C,x,b,ae,oe,se,u,d,ue]),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,F.current,ne.current,A==null?void 0:A.beforeOutsideRef.current,A==null?void 0:A.afterOutsideRef.current,...ue(),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,ue]),W(()=>{if(!g||r||!ha(I))return;let e=gs(I),t=Xo(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||Zo(I,t))return;let i=null,a=()=>(i==null&&(i=le(I)),i[0]||I),o;o=r===!0||r===null?a():No(r),o=o||a();let s=Zo(I,Xo(e));kc(o,{preventScroll:o===I,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=Xo(e);return!(t!==o&&Zo(I,t))}})})},[r,g,I,le,w,D,O]),W(()=>{if(r||!I)return;let e=gs(I),t=Xo(e),n=D.current==null;ul(t);function i(e){if(e.open||(ee.current=sl(e.nativeEvent,te.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(I).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(ee.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=ue(),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,I,T,D,y,k,_,x,ue]),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||!I))return pl(I),()=>{queueMicrotask(ll)}},[r,I]);let de=!r&&(!s||!C)&&(ce||s);return Eo(E,{children:[de&&Eo(ys,{"data-type":`inside`,ref:re,onFocus:e=>{if(s){let e=le();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,de&&Eo(ys,{"data-type":`inside`,ref:ie,onFocus:e=>{if(s)kc(le()[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()}),N=La(()=>{f.current.insideReactTree=!0,D.start(0,O)}),P=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))}),ee=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 N(e){c()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||A(e)||j(e)}function P(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 ee(e,t){let n=Qo(e);if(!n)return;let r=fs(n,e.type,()=>{t(e),r()})}function te(e){w.current=`touch`,ee(e,P)}function F(e){E.clear(),e.type===`pointerdown`&&(w.current=e.pointerType),!(e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)&&ee(e,e=>{e.type===`pointerdown`?N(e):j(e)})}function ne(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 re(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 ie(e){ee(e,re)}function ae(e){c()!==`sloppy`||!T.current||A(e)||(T.current.dismissOnTouchEnd&&j(e),E.clear(),T.current=null)}function oe(e){ee(e,ae)}let se=gs(d),ce=ps(r&&ps(fs(se,`keydown`,M),fs(se,`compositionstart`,i),fs(se,`compositionend`,a)),g&&ps(fs(se,`click`,F,!0),fs(se,`pointerdown`,F,!0),fs(se,`pointerup`,ne,!0),fs(se,`pointercancel`,ne,!0),fs(se,`mousedown`,F,!0),fs(se,`mouseup`,ne,!0),fs(se,`touchstart`,te,!0),fs(se,`touchmove`,ie,!0),fs(se,`touchend`,oe,!0)));return()=>{ce(),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 te=z(()=>({onKeyDown:M,onPointerDown:j,onClick:j}),[M,j]),F=z(()=>({onKeyDown:M,onPointerDown:ee,onMouseDown:ee,onClickCapture:N,onMouseDownCapture(e){N(),P(e)},onPointerDownCapture(e){N(),P(e)},onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[M,N,P,ee]);return z(()=>n?{reference:te,floating:F,trigger:te}:{},[n,te,F])}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]),N=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:N}),[u,k,j,M,N])}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};
|
|
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)},[])]}B();let ua=he(void 0);function da(){let e=ze(ua);if(e===void 0)throw Error(Yr(30));return e}function fa(){return typeof window<`u`}function pa(e){return ga(e)?(e.nodeName||``).toLowerCase():`#document`}function ma(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ha(e){var t;return(t=(ga(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ga(e){return fa()?e instanceof Node||e instanceof ma(e).Node:!1}function _a(e){return fa()?e instanceof Element||e instanceof ma(e).Element:!1}function va(e){return fa()?e instanceof HTMLElement||e instanceof ma(e).HTMLElement:!1}function ya(e){return!fa()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ma(e).ShadowRoot}function ba(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ja(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function xa(e){return/^(table|td|th)$/.test(pa(e))}function Sa(e){try{if(e.matches(`:popover-open`))return!0}catch(e){}try{return e.matches(`:modal`)}catch(e){return!1}}let Ca=/transform|translate|scale|rotate|perspective|filter/,wa=/paint|layout|strict|content/,Ta=e=>!!e&&e!==`none`,Ea;function Da(e){let t=_a(e)?ja(e):e;return Ta(t.transform)||Ta(t.translate)||Ta(t.scale)||Ta(t.rotate)||Ta(t.perspective)||!ka()&&(Ta(t.backdropFilter)||Ta(t.filter))||Ca.test(t.willChange||``)||wa.test(t.contain||``)}function Oa(e){let t=Na(e);for(;va(t)&&!Aa(t);){if(Da(t))return t;if(Sa(t))return null;t=Na(t)}return null}function ka(){return Ea==null&&(Ea=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`)),Ea}function Aa(e){return/^(html|body|#document)$/.test(pa(e))}function ja(e){return ma(e).getComputedStyle(e)}function Ma(e){return _a(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Na(e){if(pa(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ya(e)&&e.host||ha(e);return ya(t)?t.host:t}function Pa(e){let t=Na(e);return Aa(t)?(e.ownerDocument||e).body:va(t)&&ba(t)?t:Pa(t)}function Fa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);let i=Pa(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=ma(i);if(a){let e=Ia(o);return t.concat(o,o.visualViewport||[],ba(i)?i:[],e&&n?Fa(e):[])}else return t.concat(i,Fa(i,[],n))}function Ia(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}B();let La=H({},dt),Ra=La.useInsertionEffect,za=Ra&&Ra!==La.useLayoutEffect?Ra:e=>e();function Ba(e){let t=ti(Va).current;return t.next=e,za(t.effect),t.trampoline}function Va(){let e={next:void 0,callback:Ha,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function Ha(){}B();let U=typeof document<`u`?Ie:()=>{};B();let Ua=he(void 0);function Wa(e=!1){let t=ze(Ua);if(t===void 0&&!e)throw Error(Yr(16));return t}B();function Ga(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 Ka=[`onClick`,`onMouseDown`,`onKeyUp`,`onKeyDown`,`onPointerDown`];function qa(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=L(null),s=Wa(!0),c=a==null?s!==void 0:a,{props:l}=Ga({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=Re(()=>{let e=o.current;Ja(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,Ka);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=Ja(a),l=!i&&Ya(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&&Ja(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:Ba(e=>{o.current=e,u()})}}function Ja(e){return va(e)&&e.tagName===`BUTTON`}function Ya(e){return!!((e==null?void 0:e.tagName)===`A`&&e!=null&&e.href)}function Xa(){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:Za,platform:Qa,maxTouchPoints:$a}=Xa(),eo=Za.toLowerCase(),to=Qa.toLowerCase(),no=/^i(os$|p)/.test(to)||to===`macintel`&&$a>1,ro=`android`,io=to===ro||eo.includes(ro),ao=!no&&to.startsWith(`mac`);to.startsWith(`win`),!io&&/^(linux|chrome os)/.test(to);let oo=ao||no;var so,co;let lo=typeof CSS<`u`&&!!((so=(co=CSS).supports)!=null&&so.call(co,`-webkit-backdrop-filter:none`));!lo&&eo.includes(`firefox`),!lo&&eo.includes(`chrom`);let uo=oo,fo=/jsdom|happydom/.test(eo);B();function po(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&&!ao&&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 mo={type:`regular-item`};function ho(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}=qa({disabled:d,focusableWhenDisabled:!0,native:s,composite:!0}),h=po({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 go=he({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function _o(){return ze(go)}B();let vo=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function yo(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}=_o(),f=L(-1),[p,m]=Ne(a==null?i===vo.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 bo=0;function xo(e,t=`mui`){let[n,r]=Ne(e),i=e||n;return Fe(()=>{n==null&&(bo+=1,r(`${t}-${bo}`))},[n,t]),i}let So=La.useId;function Co(e,t){if(So!==void 0){let n=So();return e==null?t?`${t}-${n}`:n:e}return xo(e,t)}function wo(e){return Co(e,`base-ui`)}let To=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.highlighted=`data-highlighted`,e}({}),Eo=H({checked(e){return e?{[To.checked]:``}:{[To.unchecked]:``}}},Hi);function Do(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 Oo=0;Array.isArray;function ko(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:--Oo,__i:-1,__u:0,__source:i,__self:a};return I.vnode&&I.vnode(l),l}B(),B();let Ao=[`render`,`className`,`id`,`label`,`nativeButton`,`disabled`,`closeOnClick`,`checked`,`defaultChecked`,`onCheckedChange`,`style`],jo=bt(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,checked:l,defaultChecked:u,onCheckedChange:d,style:f}=e,p=yr(e,Ao),m=yo({label:a}),h=Zr(!0),g=wo(i),{store:_}=$r(),v=_.useState(`isActive`,m.index),y=_.useState(`itemProps`),[b,x]=la({controlled:l,default:u!=null&&u,name:`MenuCheckboxItem`,state:`checked`}),{getItemProps:S,itemRef:C}=ho({closeOnClick:c,disabled:s,highlighted:v,id:g,store:_,nativeButton:o,nodeId:h==null?void 0:h.context.nodeId,itemMetadata:mo}),w=R(()=>({disabled:s,highlighted:v,checked:b}),[s,v,b]);function T(e){let t=Do(ia,e.nativeEvent,void 0,{preventUnmountOnClose(){}});d==null||d(!b,t),!t.isCanceled&&x(e=>!e)}let E=Ni(`div`,e,{state:w,stateAttributesMapping:Eo,props:[y,{role:`menuitemcheckbox`,"aria-checked":b,onClick:T},p,S],ref:[C,t,m.ref]});return ko(ua.Provider,{value:w,children:E})});B();let Mo=[];function No(e){Fe(e,Mo)}globalThis.requestAnimationFrame;let Po=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 Fo=class e{constructor(){V(this,`currentId`,null),V(this,`cancel`,()=>{this.currentId!==null&&(Po.cancel(this.currentId),this.currentId=null)}),V(this,`disposeEffect`,()=>this.cancel)}static create(){return new e}static request(e){return Po.request(e)}static cancel(e){return Po.cancel(e)}request(e){this.cancel(),this.currentId=Po.request(()=>{this.currentId=null,e()})}};function Io(){let e=ti(Fo.create).current;return No(e.disposeEffect),e}B();function Lo(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=Fo.request(()=>{i(`ending`)});return()=>{Fo.cancel(e)}}},[e,a,r,n]),U(()=>{if(!e||t)return;let n=Fo.request(()=>{i(void 0)});return()=>{Fo.cancel(n)}},[t,e]),U(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Fo.request(()=>{i(`idle`)});return()=>{Fo.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function Ro(e){return e==null?e:`current`in e?e.current:e}B();function zo(e,t=!1,n=!0){let r=Io();return Ba((i,a=null)=>{r.cancel();let o=Ro(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 Bo(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=Ba(i),o=zo(r,n,!1);Fe(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}B();let Vo=[`render`,`className`,`style`,`keepMounted`],Ho=bt(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1}=e,o=yr(e,Vo),s=da(),c=L(null),{transitionStatus:l,setMounted:u}=Lo(s.checked);return Bo({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},ref:[t,c],stateAttributesMapping:Eo,props:H({"aria-hidden":!0},o),enabled:a||s.checked})});B();let Uo=he(void 0);function Wo(){let e=ze(Uo);if(e===void 0)throw Error(Yr(31));return e}B();let Go=[`render`,`className`,`style`,`id`],Ko=bt(function(e,t){let{render:n,className:r,style:i,id:a}=e,o=yr(e,Go),s=wo(a),c=Wo();return U(()=>(c(s),()=>{c(void 0)}),[c,s]),Ni(`div`,e,{ref:t,props:H({id:s,role:`presentation`},o)})});B();let qo=[`render`,`className`,`id`,`label`,`nativeButton`,`disabled`,`closeOnClick`,`style`],Jo=bt(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l}=e,u=yr(e,qo),d=yo({label:a}),f=Zr(!0),p=wo(i),{store:m}=$r(),h=m.useState(`isActive`,d.index),g=m.useState(`itemProps`),{getItemProps:_,itemRef:v}=ho({closeOnClick:c,disabled:s,highlighted:h,id:p,store:m,nativeButton:o,nodeId:f==null?void 0:f.context.nodeId,itemMetadata:mo});return Ni(`div`,e,{state:{disabled:s,highlighted:h},props:[g,u,_],ref:[v,t,d.ref]})});var Yo=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 Xo(){let e=ti(Yo.create).current;return No(e.disposeEffect),e}function Zo(e){e.preventDefault(),e.stopPropagation()}function Qo(e){return`nativeEvent`in e}function $o(e){return e.pointerType===``&&e.isTrusted?!0:io&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function es(e){return fo?!1:!io&&e.width===0&&e.height===0||io&&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 ts(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function ns(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}let rs=`ArrowLeft`,is=`ArrowRight`;function as(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 os(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&&ya(r)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function ss(e){return`composedPath`in e?e.composedPath()[0]:e.target}function cs(e,t){if(!_a(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(os(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function ls(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 us(e){return e.matches(`html,body`)}function ds(e){return va(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function fs(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 ps(e){return e?e.getAttribute(`role`)===`combobox`&&ds(e):!1}function ms(e){if(!e||fo)return!0;try{return e.matches(`:focus-visible`)}catch(e){return!0}}function hs(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function gs(e,t){return t!=null&&!ts(t)?0:typeof e==`function`?e():e}function _s(e,t,n){let r=gs(e,n);return typeof r==`number`?r:r==null?void 0:r[t]}function vs(e){return typeof e==`function`?e():e}function ys(e,t){return t||e===`click`||e===`mousedown`}function bs(e){return(e==null?void 0:e.includes(`mouse`))&&e!==`mousedown`}function xs(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ss(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Cs(e){let t=ti(ws,e).current;return t.next=e,U(t.effect),t}function ws(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Ts(e){return(e==null?void 0:e.ownerDocument)||document}let Es={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Ds=H(H({},Es),{},{position:`fixed`,top:0,left:0});H(H({},Es),{},{position:`absolute`}),B();let Os=bt(function(e,t){let[n,r]=Ne();U(()=>{uo&&lo&&r(`button`)},[]);let i={tabIndex:0,role:n};return ko(`span`,H(H(H({},e),{},{ref:t,style:Ds,"aria-hidden":!n||void 0},i),{},{"data-base-ui-focus-guard":``}))}),ks=[`top`,`right`,`bottom`,`left`],As=Math.min,js=Math.max,Ms=Math.round,Ns=Math.floor,Ps=e=>({x:e,y:e}),Fs={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Is(e,t,n){return js(e,As(t,n))}function Ls(e,t){return typeof e==`function`?e(t):e}function Rs(e){return e.split(`-`)[0]}function zs(e){return e.split(`-`)[1]}function Bs(e){return e===`x`?`y`:`x`}function Vs(e){return e===`y`?`height`:`width`}function Hs(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Us(e){return Bs(Hs(e))}function Ws(e,t,n){n===void 0&&(n=!1);let r=zs(e),i=Us(e),a=Vs(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=$s(o)),[o,$s(o)]}function Gs(e){let t=$s(e);return[Ks(e),t,Ks(t)]}function Ks(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}let qs=[`left`,`right`],Js=[`right`,`left`],Ys=[`top`,`bottom`],Xs=[`bottom`,`top`];function Zs(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Js:qs:t?qs:Js;case`left`:case`right`:return t?Ys:Xs;default:return[]}}function Qs(e,t,n,r){let i=zs(e),a=Zs(Rs(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ks)))),a}function $s(e){let t=Rs(e);return Fs[t]+e.slice(t.length)}function ec(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 tc(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ec(e)}function nc(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 rc(e,t){return t<0||t>=e.length}function ic(e,t){return oc(e.current,{disabledIndices:t})}function ac(e,t){return oc(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function oc(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&&sc(e,a,r));return a}function sc(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?!lc(i)||!n&&(i.hasAttribute(`disabled`)||i.getAttribute(`aria-disabled`)===`true`):!1}function cc(e){return e.visibility===`hidden`||e.visibility===`collapse`}function lc(e,t=e?ja(e):null){return!e||!e.isConnected||!t||cc(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}function uc(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return ya(n)?n.host:null}function dc(e){for(let t of Array.from(e.children))if(pa(t)===`summary`)return t;return null}function fc(e,t){let n=dc(t);return!!n&&(e===n||os(n,e))}function pc(e){let t=e?pa(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&&pa(e.parentElement)===`details`&&dc(e.parentElement)===e)&&(t!==`details`||dc(e)==null)&&(t!==`input`||e.type!==`hidden`)}function mc(e){if(!pc(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=uc(t)){let n=t!==e,r=pa(t)===`slot`;if(t.hasAttribute(`inert`)||n&&pa(t)===`details`&&!t.open&&!fc(e,t)||t.hasAttribute(`hidden`)||!r&&!hc(t,n))return!1}return!0}function hc(e,t){let n=ja(e);return t?n.display!==`none`:lc(e,n)}function gc(e){let t=e.tabIndex;if(t<0){let t=pa(e);if(t===`details`||t===`audio`||t===`video`||va(e)&&e.isContentEditable)return 0}return t}function _c(e){if(pa(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function vc(e,t){let n=_c(e);if(!n)return!0;let r=t.find(e=>{let t=_c(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=_c(e);return(t==null?void 0:t.name)===n.name&&t.form===n.form})===n}function yc(e){if(va(e)&&pa(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return va(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function bc(e,t){yc(e).forEach(e=>{pc(e)&&t.push(e),bc(e,t)})}function xc(e,t,n){yc(e).forEach(e=>{va(e)&&e.matches(t)&&n.push(e),xc(e,t,n)})}function Sc(e){return mc(e)&&gc(e)>=0}function Cc(e){let t=[];return bc(e,t),t.filter(mc)}function wc(e){let t=Cc(e);return t.filter(e=>gc(e)>=0&&vc(e,t))}function Tc(e,t){let n=wc(e),r=n.length;if(r===0)return;let i=as(Ts(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Ec(e){return Tc(Ts(e).body,1)||e}function Dc(e){return Tc(Ts(e).body,-1)||e}function Oc(e,t){if(!e)return null;let n=wc(Ts(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 kc(e){return Oc(e,1)}function Ac(e){return Oc(e,-1)}function jc(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!os(n,r)}function Mc(e){wc(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Nc(e){let t=[];xc(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 Pc(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>{var r;return[...!n||(r=t.context)!=null&&r.open?[t]:[],...Pc(e,t.id,n)]})}function Fc(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 Ic(e){return`data-base-ui-${e}`}let Lc=0;function Rc(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Lc);function a(){i&&!i()||e==null||e.focus({preventScroll:n})}if(r)return a(),fi;let o=requestAnimationFrame(a);return Lc=o,()=>{Lc===o&&(cancelAnimationFrame(o),Lc=0)}}let zc={inert:new WeakMap,"aria-hidden":new WeakMap},Bc=`data-base-ui-inert`,Vc={inert:new WeakSet,"aria-hidden":new WeakSet},Hc=new WeakMap,Uc=0;function Wc(e){return Vc[e]}function Gc(e){return e?ya(e)?e.host:Gc(e.parentNode):null}let Kc=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Gc(t);return e.contains(n)?n:null}).filter(e=>e!=null),qc=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Jc=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{pa(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Yc(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=Kc(t,e),l=i?Jc(t,qc(c),new Set(c)):[],u=[],d=[];if(a){let e=zc[a],n=Wc(a);s=n,o=e;let r=Kc(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);Jc(t,qc(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=(Hc.get(e)||0)+1;Hc.set(e,t),d.push(e),t===1&&e.setAttribute(Bc,``)}),Uc+=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=(Hc.get(e)||0)-1;Hc.set(e,t),t||e.removeAttribute(Bc)}),--Uc,Uc||(zc.inert=new WeakMap,zc[`aria-hidden`]=new WeakMap,Vc.inert=new WeakSet,Vc[`aria-hidden`]=new WeakSet,Hc=new WeakMap)}}function Xc(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=Ts(e[0]).body;return Yc(e,a,n,r,{mark:i})}let Zc={style:{transition:`none`}},Qc={fallbackAxisSide:`none`},$c={fallbackAxisSide:`end`},el={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};B();let tl=[`render`,`className`,`style`,`children`,`container`,`renderGuards`],nl=he(null),rl=()=>ze(nl),il=Ic(`portal`);function al(e={}){let{ref:t,container:n,componentProps:r=mi,elementProps:i}=e,a=Co(),o=rl(),s=o==null?void 0:o.portalNode,[c,l]=Ne(null),[u,d]=Ne(null),f=Ba(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&&(ga(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,[il]:``},i]});return{portalNode:u,portalSubtree:c&&m?Dt(m,c):null}}let ol=bt(function(e,t){let{render:n,className:r,style:i,children:a,container:o,renderGuards:s}=e,{portalNode:c,portalSubtree:l}=al({container:o,ref:t,componentProps:e,elementProps:yr(e,tl)}),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&&jc(e)&&(e.type===`focusin`?g.current&&(Nc(c),g.current=!1):(Mc(c),g.current=!0))}return Ss(xs(c,`focusin`,e,!0),xs(c,`focusout`,e,!0))},[c,_]),U(()=>{!c||v!==!0||!g.current||(Nc(c),g.current=!1)},[v,c]);let b=R(()=>({beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:f,afterInsideRef:p,portalNode:c,setFocusManagerState:h}),[c]);return ko(E,{children:[l,ko(nl.Provider,{value:b,children:[y&&c&&ko(Os,{"data-type":`outside`,ref:u,onFocus:e=>{if(jc(e,c)){var t;(t=f.current)==null||t.focus()}else{let e=Dc(m?m.domReference:null);e==null||e.focus()}}}),y&&c&&ko(`span`,{"aria-owns":c.id,style:el}),c&&Dt(a,c),y&&c&&ko(Os,{"data-type":`outside`,ref:d,onFocus:e=>{if(jc(e,c)){var t;(t=p.current)==null||t.focus()}else{let t=Ec(m?m.domReference:null);t==null||t.focus(),m!=null&&m.closeOnFocusOut&&(m==null||m.onOpenChange(!1,Do(`focus-out`,e.nativeEvent)))}}})]})]})});function sl(){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 cl=class{constructor(){V(this,`nodesRef`,{current:[]}),V(this,`events`,sl())}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 ll=he(null),ul=he(null),dl=()=>{var e;return((e=ze(ll))==null?void 0:e.id)||null},fl=e=>{let t=ze(ul);return e==null?t:e};function pl(e){let t=Co(),n=fl(e),r=dl();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 ml(e){let{children:t,id:n}=e,r=dl();return ko(ll.Provider,{value:R(()=>({id:n,parentId:r}),[n,r]),children:t})}function hl(e){let{children:t,externalTree:n}=e,r=ti(()=>n==null?new cl:n).current;return ko(ul.Provider,{value:r,children:t})}B();function gl(e,t){let n=ma(ss(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 _l=[];function vl(){_l=_l.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function yl(e){vl(),e&&pa(e)!==`body`&&(_l.push(new WeakRef(e)),_l.length>20&&(_l=_l.slice(-20)))}function bl(){var e;return vl(),(e=_l[_l.length-1])==null?void 0:e.deref()}function xl(e){return e?Sc(e)?e:wc(e)[0]||e:null}function Sl(e){var t;if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!((t=e.getAttribute(`role`))!=null&&t.includes(`dialog`)))return;let n=Cc(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Sc(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 Cl(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=Ba(()=>{var e;return(e=b.current.floatingContext)==null?void 0:e.nodeId}),S=i===!1,C=ps(_)&&S,w=Cs(i),T=Cs(a),D=Cs(l),O=Cs(g),k=fl(p),A=rl(),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=Xo(),se=Xo(),ce=Io(),le=A!=null,F=hs(v),ue=Ba((e=F)=>e?wc(e):[]),de=Ba(()=>{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`&&os(F,as(Ts(F)))&&ue().length===0&&!C&&Zo(e)}return xs(Ts(F),`keydown`,e)},[r,F,s,C,ue]),Fe(()=>{if(r||!g)return;let e=Ts(F);function t(){ee.current=!1}function n(e){let t=ss(e),n=de(),r=os(v,t)||os(_,t)||os(A==null?void 0:A.portalNode,t)||n.some(e=>e===t||os(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 Ss(xs(e,`pointerdown`,n,!0),xs(e,`pointerup`,t,!0),xs(e,`pointercancel`,t,!0),xs(e,`keydown`,i,!0),t)},[r,v,_,F,g,A,se,de]),Fe(()=>{if(r||!c)return;let e=Ts(F);function t(){M.current=!0,se.start(0,()=>{M.current=!1})}function n(e){let t=ss(e);Sc(t)&&(N.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=ss(t);s&&n==null&&i!=null&&os(v,i)&&yl(i),queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=de(),f=(n==null?void 0:n.hasAttribute(Ic(`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,Ro(d),Ro(u)].includes(n),p=!(os(_,n)||os(v,n)||os(n,v)||os(A==null?void 0:A.portalNode,n)||l.some(e=>e===n||os(e,n))||n!=null&&c.hasElement(n)||c.hasMatchingElement(e=>os(e,n))||f||k&&(Pc(k.nodesRef.current,a).find(e=>{var t,r;return os((t=e.context)==null?void 0:t.elements.floating,n)||os((r=e.context)==null?void 0:r.elements.domReference,n)})||Fc(k.nodesRef.current,a).find(e=>{var t,r,i;return[(t=e.context)==null?void 0:t.elements.floating,hs((r=e.context)==null?void 0:r.elements.floating)].includes(n)||((i=e.context)==null?void 0:i.elements.domReference)===n})));if(r===_&&F&&Sl(F),o&&r!==_&&!lc(i)&&as(e)===e.body){if(va(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;va(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!M.current&&(C||n!==bl())&&(j.current=!0,h.setOpen(!1,Do(aa,t)))})}function a(){ee.current||(b.current.insideReactTree=!0,oe.start(0,()=>{b.current.insideReactTree=!1}))}let l=va(_)?_:null;if(!(!v&&!l))return Ss(l&&xs(l,`focusout`,i),l&&xs(l,`pointerdown`,t),v&&xs(v,`focusin`,n),v&&xs(v,`focusout`,i),v&&A&&xs(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(`[${Ic(`portal`)}]`))||[]),i=(t=(k?Fc(k.nodesRef.current,x()):[]).find(e=>{var t;return ps(((t=e.context)==null?void 0:t.elements.domReference)||null)}))==null||(t=t.context)==null?void 0:t.elements.domReference,a=Xc([v,...n,P.current,re.current,A==null?void 0:A.beforeOutsideRef.current,A==null?void 0:A.afterOutsideRef.current,...de(),i,Ro(d),Ro(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),o=Xc([v,...n].filter(e=>e!=null));return()=>{o(),a()}},[g,r,_,v,s,A,C,k,x,u,d,de]),U(()=>{if(!g||r||!va(F))return;let e=Ts(F),t=as(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||os(F,t))return;let i=null,a=()=>(i==null&&(i=ue(F)),i[0]||F),o;o=r===!0||r===null?a():Ro(r),o=o||a();let s=os(F,as(e));Rc(o,{preventScroll:o===F,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=as(e);return!(t!==o&&os(F,t))}})})},[r,g,F,ue,w,D,O]),U(()=>{if(r||!F)return;let e=Ts(F),t=as(e),n=D.current==null;yl(t);function i(e){if(e.open||(te.current=gl(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($o(e.nativeEvent)||es(e.nativeEvent))j.current=!1;else{let e=!1;Ts(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&&pa(t)!==`body`?t:null,o=n?a||i:i||a;return o||(o=bl()||null),typeof r==`boolean`?o:Ro(r)||o||null}return()=>{y.off(`openchange`,i);let t=as(e),n=de(),r=os(v,t)||n.some(e=>e===t||os(e,t))||k&&Pc(k.nodesRef.current,x(),!1).some(e=>{var n;return os((n=e.context)==null?void 0:n.elements.floating,t)}),o=T.current,s=a();queueMicrotask(()=>{let n=xl(s),i=typeof o!=`boolean`;o&&!j.current&&va(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(!lo||g||!v)return;let e=as(Ts(v));!va(e)||!ds(e)||os(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 Sl(F),()=>{queueMicrotask(vl)}},[r,F]);let fe=!r&&(!s||!C)&&(le||s);return ko(E,{children:[fe&&ko(Os,{"data-type":`inside`,ref:ie,onFocus:e=>{if(s){let e=ue();Rc(e[e.length-1])}else if(A!=null&&A.portalNode)if(j.current=!1,jc(e,A.portalNode)){let e=Ec(_);e==null||e.focus()}else{var t;(t=Ro(d==null?A.beforeOutsideRef:d))==null||t.focus()}}}),n,fe&&ko(Os,{"data-type":`inside`,ref:ae,onFocus:e=>{if(s)Rc(ue()[0]);else if(A!=null&&A.portalNode)if(c&&(j.current=!0),jc(e,A.portalNode)){let e=Dc(_);e==null||e.focus()}else{var t;(t=Ro(u==null?A.afterOutsideRef:u))==null||t.focus()}}})]})}B();function wl(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=Io(),p=Xo(),m=R(()=>{function e(e,t,n,r){let i=Do(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`||ts(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=ss(o);if(ds(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}ts(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 Tl(){return!1}function El(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 Dl(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=Tl,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=fl(c),m=Ba(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=Ba(()=>a),{escapeKey:v,outsidePress:y}=El(s),b=L(!1),x=L(!1),S=L(!1),C=L(!1),w=L(``),T=L(null),E=Xo(),D=Xo(),O=Ba(()=>{D.clear(),f.current.insideReactTree=!1}),k=Ba(e=>{var t;let n=(t=f.current.floatingContext)==null?void 0:t.nodeId;return(p?Pc(p.nodesRef.current,n):[]).some(t=>{var n;return((n=t.context)==null?void 0:n.open)&&!t.context.dataRef.current[e]})}),A=Ba(e=>ls(e,l.select(`floatingElement`))||ls(e,l.select(`domReferenceElement`))),j=Ba(e=>{o()&&l.setOpen(!1,Do(ta,e.nativeEvent))}),M=Ba(e=>{if(!u||!n||!r||e.key!==`Escape`||C.current||!v&&k(`__escapeKeyBubbles`))return;let t=Do(`escape-key`,Qo(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!v&&!t.isPropagationAllowed&&e.stopPropagation()}),ee=Ba(()=>{f.current.insideReactTree=!0,D.start(0,O)}),N=Ba(e=>{if(!u||!n||e.button!==0)return;let t=ss(e.nativeEvent);os(l.select(`floatingElement`),t)&&(b.current||(b.current=!0,x.current=!1))}),te=Ba(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 Yo,t=new Yo;function i(){e.clear(),C.current=!0}function a(){e.start(lo?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&&Pc(p.nodesRef.current,n).some(t=>{var n;return ls(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=ss(e),r=`[${Ic(`inert`)}]`,i=_a(n)?n.getRootNode():null,a=Array.from((ya(i)?i:Ts(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>os(e,n))))return;let s=_a(n)?n:null;for(;s&&!Aa(s);){let e=Na(s);if(Aa(e)||!_a(e))break;s=e}if(!(a.length&&_a(n)&&!us(n)&&!os(n,l.select(`floatingElement`))&&a.every(e=>!os(s,e)))){if(va(n)&&!(`touches`in e)){let t=Aa(n),r=ja(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,Do(`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=ss(e);if(!n)return;let r=xs(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=Ts(d),le=Ss(r&&Ss(xs(ce,`keydown`,M),xs(ce,`compositionstart`,i),xs(ce,`compositionend`,a)),g&&Ss(xs(ce,`click`,P,!0),xs(ce,`pointerdown`,P,!0),xs(ce,`pointerup`,re,!0),xs(ce,`pointercancel`,re,!0),xs(ce,`mousedown`,P,!0),xs(ce,`mouseup`,re,!0),xs(ce,`touchstart`,ne,!0),xs(ce,`touchmove`,ae,!0),xs(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 Ol=[`mainAxis`,`crossAxis`,`fallbackPlacements`,`fallbackStrategy`,`fallbackAxisSideDirection`,`flipAlignment`],kl=[`strategy`],Al=[`mainAxis`,`crossAxis`,`limiter`],jl=[`apply`];function Ml(e,t,n){let{reference:r,floating:i}=e,a=Hs(t),o=Us(t),s=Vs(o),c=Rs(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=zs(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Nl(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}=Ls(t,e),m=tc(p),h=s[f?d===`floating`?`reference`:`floating`:d],g=nc(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=nc(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 Pl=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:H(H({},o),{},{detectOverflow:Nl}),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ml(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}=Ml(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Fl=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=Ls(e,t),{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m=`bestFit`,fallbackAxisSideDirection:h=`none`,flipAlignment:g=!0}=u,_=yr(u,Ol);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let v=Rs(i),y=Hs(s),b=Rs(s)===s,x=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=p||(b||!g?[$s(s)]:Gs(s)),C=h!==`none`;!p&&C&&S.push(...Qs(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=Ws(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!==Hs(t))||D.every(e=>Hs(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=Hs(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 Il(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ll(e){return ks.some(t=>e[t]>=0)}let Rl=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,i=Ls(e,t),{strategy:a=`referenceHidden`}=i,o=yr(i,kl);switch(a){case`referenceHidden`:{let e=Il(await r.detectOverflow(t,H(H({},o),{},{elementContext:`reference`})),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ll(e)}}}case`escaped`:{let e=Il(await r.detectOverflow(t,H(H({},o),{},{altBoundary:!0})),n.floating);return{data:{escapedOffsets:e,escaped:Ll(e)}}}default:return{}}}}},zl=new Set([`left`,`top`]);async function Bl(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Rs(n),s=zs(n),c=Hs(n)===`y`,l=zl.has(o)?-1:1,u=a&&c?-1:1,d=Ls(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 Vl=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 Bl(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})}}}},Hl=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=Ls(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,Al),d={x:n,y:r},f=await a.detectOverflow(t,u),p=Hs(i),m=Bs(p),h=d[m],g=d[p],_=(e,t)=>Is(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}}})}}},Ul=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}=Ls(e,t),f={x:i,y:a},p=Hs(o),m=Bs(p),h=f[m],g=f[p],_=Ls(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=zl.has(Rs(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}}}},Wl=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=Ls(e,t),{apply:s=()=>{}}=o,c=yr(o,jl),l=await i.detectOverflow(t,c),u=Rs(n),d=zs(n),f=Hs(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=As(m-l[h],_),b=As(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*js(l.left,l.right):C=m-2*js(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 Gl(e){let t=ja(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=va(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ms(n)!==a||Ms(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Kl(e){return _a(e)?e:e.contextElement}function ql(e){let t=Kl(e);if(!va(t))return Ps(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Gl(t),o=(a?Ms(n.width):n.width)/r,s=(a?Ms(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}let Jl=Ps(0);function Yl(e){let t=ma(e);return!ka()||!t.visualViewport?Jl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xl(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ma(e)}function Zl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Kl(e),o=Ps(1);t&&(r?_a(r)&&(o=ql(r)):o=ql(e));let s=Xl(a,n,r)?Yl(a):Ps(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=ma(a),t=_a(r)?ma(r):r,n=e,i=Ia(n);for(;i&&t!==n;){let e=ql(i),t=i.getBoundingClientRect(),r=ja(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=ma(i),i=Ia(n)}}return nc({width:u,height:d,x:c,y:l})}function Ql(e,t){let n=Ma(e).scrollLeft;return t?t.left+n:Zl(ha(e)).left+n}function $l(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ql(e,n),y:n.top+t.scrollTop}}function eu(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ha(r),s=t?Sa(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ps(1),u=Ps(0),d=va(r);if((d||!a)&&((pa(r)!==`body`||ba(o))&&(c=Ma(r)),d)){let e=Zl(r);l=ql(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?$l(o,c):Ps(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 tu(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function nu(e){let t=Ma(e),n=e.ownerDocument.body,r=js(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=js(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Ql(e),o=-t.scrollTop;return ja(n).direction===`rtl`&&(a+=js(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}function ru(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=ma(e),a=ha(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!ka()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Ql(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 iu(e,t){let n=Zl(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ql(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function au(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ru(e,n,t);else if(t===`document`)r=nu(ha(e));else if(_a(t))r=iu(t,n);else{let n=Yl(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return nc(r)}function ou(e,t){let n=t.get(e);if(n)return n;let r=Fa(e,[],!1).filter(e=>_a(e)&&pa(e)!==`body`),i=null,a=ja(e).position===`fixed`,o=a?Na(e):e;for(;_a(o)&&!Aa(o);){let e=ja(o),t=Da(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Na(o)}return t.set(e,r),r}function su(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Sa(t)?[]:ou(t,this._c):[].concat(n),r],o=au(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=au(t,a[e],i);s=js(n.top,s),c=As(n.right,c),l=As(n.bottom,l),u=js(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function cu(e){let{width:t,height:n}=Gl(e);return{width:t,height:n}}function lu(e,t,n){let r=va(t),i=ha(t),a=n===`fixed`,o=Zl(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ps(0);if((r||!a)&&((pa(t)!==`body`||ba(i))&&(s=Ma(t)),r)){let e=Zl(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Ql(i));let l=i&&!r&&!a?$l(i,s):Ps(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 uu(e){return ja(e).position===`static`}function du(e,t){if(!va(e)||ja(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ha(e)===n&&(n=n.ownerDocument.body),n}function fu(e,t){let n=ma(e);if(Sa(e))return n;if(!va(e)){let t=Na(e);for(;t&&!Aa(t);){if(_a(t)&&!uu(t))return t;t=Na(t)}return n}let r=du(e,t);for(;r&&xa(r)&&uu(r);)r=du(r,t);return r&&Aa(r)&&uu(r)&&!Da(r)?n:r||Oa(e)||n}let pu=async function(e){let t=this.getOffsetParent||fu,n=this.getDimensions,r=await n(e.floating);return{reference:lu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mu(e){return ja(e).direction===`rtl`}let hu={convertOffsetParentRelativeRectToViewportRelativeRect:eu,getDocumentElement:ha,getClippingRect:su,getOffsetParent:fu,getElementRects:pu,getClientRects:tu,getDimensions:cu,getScale:ql,isElement:_a,isRTL:mu};function gu(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _u(e,t,n){let r=null,i,a=ha(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=Ns(d),h=Ns(a.clientWidth-(u+f)),g=Ns(a.clientHeight-(d+p)),_=Ns(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:js(0,As(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!gu(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=ma(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function vu(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=Kl(e),u=i||a?[...l?Fa(l):[],...t?Fa(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?_u(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?Zl(e):null;c&&g();function g(){let t=Zl(e);h&&!gu(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 yu=Vl,bu=Hl,xu=Fl,Su=Wl,Cu=Rl,wu=Ul,Tu=(e,t,n)=>{let r=new Map,i=n==null?{}:n,a=H(H(H({},hu),i.platform),{},{_c:r});return Pl(e,t,H(H({},i),{},{platform:a}))};B();var Eu=typeof document<`u`?Ie:function(){};function Du(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(!Du(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)&&!Du(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ou(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ku(e,t){let n=Ou(e);return Math.round(t*n)/n}function Au(e){let t=L(e);return Eu(()=>{t.current=e}),t}function ju(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);Du(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=Au(c),D=Au(i),O=Au(l),k=Re(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Tu(S.current,C.current,e).then(e=>{let t=H(H({},e),{},{isPositioned:O.current!==!1});A.current&&!Du(w.current,t)&&(w.current=t,ln(()=>{d(t)}))})},[f,t,n,D,O]);Eu(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>H(H({},e),{},{isPositioned:!1})))},[l]);let A=L(!1);Eu(()=>(A.current=!0,()=>{A.current=!1}),[]),Eu(()=>{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=ku(M.floating,u.x),r=ku(M.floating,u.y);return s?H(H({},e),{},{transform:`translate(`+t+`px, `+r+`px)`},Ou(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 Mu=(e,t)=>{let n=yu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nu=(e,t)=>{let n=bu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pu=(e,t)=>({fn:wu(e).fn,options:[e,t]}),Fu=(e,t)=>{let n=xu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Iu=(e,t)=>{let n=Su(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lu=(e,t)=>{let n=Cu(e);return{name:n.name,fn:n.fn,options:[e,t]}};B();function Ru(e){let t=L(!0);t.current&&(t.current=!1,e())}let W=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(Yr(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s};
|
|
7
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
|
|
16
|
+
var zu=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})),Bu=s(((e,t)=>{t.exports=zu()})),Vu=s((e=>{
|
|
17
17
|
/**
|
|
18
18
|
* @license React
|
|
19
19
|
* use-sync-external-store-shim/with-selector.production.js
|
|
@@ -23,20 +23,11 @@ var Au=s((e=>{var t=(V(),d(ut));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=(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),N=R(f),P=R(o==null?-1:o),ee=R(null),te=R(!0),F=La(e=>{i(P.current===-1?null:P.current,e)}),ne=R(!!T),re=R(w),ie=R(!1),ae=R(!1),oe=R(null),se=ms(h),ce=ms(w),I=ms(o),le=ms(y),ue=jo(),de=jo(),fe=La(()=>{function e(e){d?M==null||M.events.emit(`virtualfocus`,e):oe.current=kc(e,{sync:ie.current,preventScroll:!0})}let t=n.current[P.current],r=ae.current;t&&e(t),(ie.current?e=>e():e=>ue.request(e))(()=>{let i=n.current[P.current]||t;if(i&&(t||e(i),_e&&(r||!te.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?(P.current=o==null?-1:o,N.current&&o!=null&&(ae.current=!0,F())):ne.current&&(P.current=-1,F()))},[a,w,T,o,F]),W(()=>{if(a){if(!w){ie.current=!1;return}if(T)if(r==null){if(ie.current=!1,I.current!=null)return;if(ne.current&&(P.current=-1,fe()),(!re.current||!ne.current)&&N.current&&(ee.current!=null||N.current===!0&&ee.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>de.request(e):queueMicrotask)(t),e+=1):(P.current=ee.current==null||Id(ee.current,g,u)||l?Ys(n):Xs(n),ee.current=null,F())};t()}}else Js(n.current,r)||(P.current=r,fe(),ae.current=!1)}},[a,w,T,r,I,l,n,g,u,F,fe,de]),W(()=>{var e,t;if(!a||T||!M||d||!ne.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&&te.current&&r.focus({preventScroll:!0})},[a,T,E,M,j,d]),W(()=>{re.current=w,ne.current=!!T}),W(()=>{w||(ee.current=null,N.current=f)},[w,f]);let pe=r!=null,me=La(e=>{if(!ce.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(P.current!==t||r!==t)&&(P.current=t,F(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,se.current)),ge=La(e=>{if(te.current=!1,ie.current=!0,e.which===229||!ce.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=P.current,r=Ys(n,h),i=Xs(n,h);if(k||(e.key===`Home`&&(Ho(e),P.current=r,F(e)),e.key===`End`&&(Ho(e),P.current=i,F(e))),x!=null){let t=x(e,P.current,n,g,c,u,h,r,i);if(t!=null&&(P.current=t,F(e)),g===`both`)return}if(Fd(e.key,g)){if(Ho(e),w&&!d&&Xo(e.currentTarget.ownerDocument)===e.currentTarget){P.current=Id(e.key,g,u)?r:i,F(e);return}Id(e.key,g,u)?c?t>=i?s&&t!==n.current.length?P.current=-1:(ie.current=!1,P.current=r):P.current=Zs(n.current,{startingIndex:t,disabledIndices:h}):P.current=Math.min(i,Zs(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?P.current=n.current.length:(ie.current=!1,P.current=i):P.current=Zs(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):P.current=Math.max(r,Zs(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),Js(n.current,P.current)&&(P.current=-1),F(e)}}),_e=z(()=>({onFocus(e){ie.current=!0,me(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){ie.current=!0,ae.current=!1,p&&me(e)},onPointerLeave(e){var t;if(!ce.current||!te.current||e.pointerType===`touch`)return;ie.current=!0;let r=e.relatedTarget;if(!(!p||n.current.includes(r))&&le.current&&((t=oe.current)==null||t.call(oe),oe.current=null,P.current=-1,F(e),!d)){let e=A.current,t=Xo(gs(e));e&&Zo(e,t)&&e.focus({preventScroll:!0})}}}),[me,ce,A,p,n,F,le,d]),ve=z(()=>d&&w&&pe&&{"aria-activedescendant":`${v}-${r}`},[d,w,pe,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(){te.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)&&(N.current=!d)}function n(e){N.current=f,f===`auto`&&Go(e.nativeEvent)&&(N.current=!0)}return{onKeyDown(t){let n=C.select(`open`);te.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());ee.current=l&&e?null:t.key}if(l){i&&(Ho(t),n?(P.current=he(),F(t)):e(t));return}a&&(I.current!=null&&(P.current=I.current),Ho(t),!n&&m?e(t):ge(t),n&&F(t))}},onFocus(e){C.select(`open`)&&!d&&(P.current=-1,F(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[ge,f,he,l,F,C,m,g,L,u,I,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=me(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=me(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=me(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,N=E/2-v[_]/2+D,P=Ds(j,N,M),ee=!u.arrow&&As(o)!=null&&N!==P&&s.reference[_]/2-(N<j?k:A)-v[_]/2<0,te=ee?N<j?N-j:N-M:0;return{[g]:h[g]+te,data:U({[g]:P,centerOffset:N-P-te},ee&&{alignmentOffset:te}),reset:ee}}}),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),N=ms(_),P=uf()===`rtl`,ee=w||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[a],te=s===`center`?ee:`${ee}-${s}`,F=u,ne=+(a===`bottom`),re=+(a===`top`),ie=+(a===`right`),ae=+(a===`left`);typeof F==`number`?F={top:F+ne,right:F+ae,bottom:F+re,left:F+ie}:F&&(F={top:(F.top||0)+ne,right:(F.right||0)+ae,bottom:(F.bottom||0)+re,left:(F.left||0)+ie});let oe={boundary:l===`clipping-ancestors`?`clippingAncestors`:l,padding:F},se=R(null),ce=ms(o),I=ms(c),le=typeof o==`function`?0:o,ue=typeof c==`function`?0:c,de=[];m&&de.push(m),de.push(Cu(e=>{let t=vf(e,a,P),n=typeof ce.current==`function`?ce.current(t):ce.current,r=typeof I.current==`function`?I.current(t):I.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[le,ue,P,a]));let fe=D===`none`&&E!==`shift`,pe=!fe&&(d||y||E===`shift`),me=E===`none`?null:Eu(U(U({},oe),{},{padding:{top:F.top+1,right:F.right+1,bottom:F.bottom+1,left:F.left+1},mainAxis:!y&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:O})),L=fe?null:wu(e=>{let t=gs(e.elements.floating).documentElement;return U(U({},oe),{},{rootBoundary:y?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:D!==`none`,crossAxis:pe,limiter:d||y?void 0:Tu(e=>{if(!se.current)return{};let{width:t,height:n}=se.current.getBoundingClientRect(),r=Ns(ks(e.placement)),i=r===`y`?t:n,a=r===`y`?F.left+F.right:F.top+F.bottom;return{offset:i/2+a/2}})})},[oe,d,y,F,D]);E===`shift`||D===`shift`||s===`center`?de.push(L,me):de.push(me,L),de.push(Du(U(U({},oe),{},{apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.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:se.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=se.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,P)):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`,pe&&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:te,middleware:de,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,P),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:se,arrowUncentered:Re,side:Ne,align:Fe,physicalSide:je,anchorHidden:Ie,refs:ge,context:Ce,isPositioned:we,update:xe}),[ke,Le,se,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`),N=v.useState(`lastOpenChangeReason`),P=v.useState(`floatingNodeId`),ee=v.useState(`floatingParentNodeId`),te=S.useState(`domReferenceElement`),F=R(null),ne=Po(A,!1,!1),re=n,ie=c,ae=l,oe=s,se=h;if(x.type===`context-menu`){var ce,I;if(re=n==null?(ce=x.context)==null?void 0:ce.anchor:n,oe=(I=oe)==null?`start`:I,!o&&oe!==`center`){var le,ue;ae=(le=e.alignOffset)==null?2:le,ie=(ue=e.sideOffset)==null?-5:ue}}let de=o,fe=oe;if(x.type===`menu`){var pe,me,L;de=(pe=de)==null?`inline-end`:pe,fe=(me=fe)==null?`start`:me,se=(L=e.collisionAvoidance)==null?Wc:L}else if(x.type===`menubar`){var he,ge;de=(he=de)==null?x.context.orientation===`vertical`?`inline-end`:`bottom`:he,fe=(ge=fe)==null?`start`:ge}let _e=x.type===`context-menu`,ve=yf({anchor:re,floatingRootContext:S,positionMethod:b?`fixed`:r,mounted:w,side:de,sideOffset:ie,align:fe,alignOffset:ae,arrowPadding:_e?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:P,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:se,shiftCrossAxis:_e&&!(`side`in se&&se.side===`flip`),externalTree:C,adaptiveOrigin:M?gf:void 0});Pe(()=>{function e(e){e.open&&(e.parentNodeId===P&&v.set(`hoverEnabled`,!1),e.nodeId!==P&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,wo(oa)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,P]),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:P,parentNodeId:ee,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,T,v,P,ee]),W(()=>{let e=te,t=F.current;if(e&&(F.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return ne(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[te,ne,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&&N!==`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&&N!==`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:P,children:Eo(xf,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:Se})})]})});V();let Bf=me(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=me(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=me(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=me(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`),N=S.useState(`lastOpenChangeReason`),P=S.useState(`parent`),ee=S.useState(`activeIndex`),te=S.useState(`payload`),F=S.useState(`floatingParentNodeId`),ne=R(null),re=R(P.type!==`context-menu`),ie=Vo(),ae=R(!0),oe=Vo(),se=F!=null,{openMethod:ce,triggerProps:I}=tp(O);S.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:P.type===void 0?c:void 0,openMethod:ce,rootId:C}),cd(S);let{forceUnmount:le}=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||(ne.current=null),P.type===`context-menu`){if(!O){ie.clear(),re.current=!1;return}ie.start(500,()=>{re.current=!0})}},[ie,O,P.type]),W(()=>{!O&&!j&&S.set(`hoverEnabled`,!0)},[O,j,S]);let ue=La((e,t)=>{var n;let r=t.reason;if(O===e&&t.trigger===k&&N===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`&&!ae.current)return;e&&r===`trigger-focus`?(ae.current=!1,oe.start(300,()=>{ae.current=!0})):(ae.current=!0,oe.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};ne.current=(n=t.event)==null?null:n,id(l,e,t.trigger,a()),S.update(l),P.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)}),de=$u({popupStore:S,floatingId:w,nested:D!=null,onOpenChange:ue}),fe=de.context.events;Pe(()=>{let e=({open:e,eventDetails:t})=>ue(e,t);return fe.on(`setOpen`,e),()=>{fe==null||fe.off(`setOpen`,e)}},[fe,ue]);let pe=Le(()=>{S.setOpen(!1,wo(sa))},[S]);Ie(d,()=>({unmount:le,close:pe}),[le,pe]);let me;P.type===`context-menu`&&(me=P.context),Ie(me==null?void 0:me.positionerRef,()=>A,[A]),Ie(me==null?void 0:me.actionsRef,()=>({setOpen:ue}),[ue]);let L=vl(de,{enabled:!M,bubbles:{escapeKey:f&&P.type===`menu`},outsidePress(){var e;return P.type!==`context-menu`||((e=ne.current)==null?void 0:e.type)===`contextmenu`||re.current},externalTree:se?T:void 0}),he=uf(),ge=Le(e=>{S.select(`activeIndex`)!==e&&S.set(`activeIndex`,e)},[S]),_e=zd(de,{enabled:!M,listRef:S.context.itemDomElements,activeIndex:ee,nested:P.type!==void 0,loopFocus:l,orientation:u,parentOrientation:P.type===`menubar`?P.context.orientation:void 0,rtl:he===`rtl`,disabledIndices:fi,onNavigate:ge,openOnArrowKeyDown:P.type!==`context-menu`,externalTree:se?T:void 0,focusItemOnHover:g}),ve=Le(e=>{S.context.typingRef.current=e},[S]),ye=Bd(de,{enabled:!M,listRef:S.context.itemLabels,elementsRef:S.context.itemDomElements,activeIndex:ee,resetMs:500,onMatch:e=>{O&&e!==ee&&S.set(`activeIndex`,e)},onTyping:ve});ud(S,{floatingRootContext:de,activeTriggerProps:z(()=>{let e=vi(ye.reference,_e.reference,L.reference,{onMouseMove(){S.set(`allowMouseEnter`,!0)}},I);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=O,e},[S,ye.reference,_e.reference,L.reference,I,O]),inactiveTriggerProps:z(()=>{let e=vi(_e.trigger,L.trigger,I);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[_e.trigger,L.trigger,I]),popupProps:z(()=>vi(ed,{id:w,role:`menu`,"aria-labelledby":k==null?void 0:k.id,onMouseMove(){S.set(`allowMouseEnter`,!0),P.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,P.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:te}):n});return P.type===void 0||P.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:N,buttonRef:P}=Wa({disabled:M,native:s});Pe(()=>{!b&&C.type===void 0&&(g.context.allowMouseUpTriggerRef.current=!1)},[g,b,C.type]);let ee=R(null),te=Vo(),F=La(e=>{if(!ee.current)return;te.clear(),g.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if(Zo(ee.current,t)||Zo(g.select(`positionerElement`),t)||t===ee.current||t!=null&&fp(t)===g.select(`rootId`))return;let n=cp(ee.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(ee.current).addEventListener(`mouseup`,F,{once:!0})},[b,F,g]);let ne=A&&C.context.hasSubmenuOpen,re=Nd(y,{enabled:(l==null?ne:l)&&!M&&C.type!==`context-menu`&&(!A||ne&&!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`}),ie=_p(b,g.select(`lastOpenChangeReason`)),ae=hl(y,{enabled:!M&&C.type!==`context-menu`,event:b&&A?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0&&ie}),oe=Td(y,{enabled:!M&&ne}),se=mp({open:b,enabled:A,mouseDownAction:`open`}),ce=z(()=>vi(oe.reference,ae.reference),[oe.reference,ae.reference]),I=g.useState(`triggerProps`,k),{preFocusGuardRef:le,handlePreFocusGuardFocus:ue,handleFocusTargetFocus:de}=pp(g,S),fe={disabled:M,open:b},pe=[ee,t,P,O,S],me=[ce,re==null?pi:re,I,{"aria-haspopup":`menu`,"aria-controls":x,id:_,onMouseDown:e=>{g.select(`open`)||(te.start(200,()=>{g.context.allowMouseUpTriggerRef.current=!0}),gs(e.currentTarget).addEventListener(`mouseup`,F,{once:!0}))}},A?{role:`menuitem`}:{},se,m,N],L=Mi(`button`,e,{enabled:!A,stateAttributesMapping:Xi,state:fe,ref:pe,props:me});return A?Eo(dp,{tag:`button`,render:r,className:i,style:a,state:fe,refs:pe,props:me,stateAttributesMapping:Xi}):b?Eo(E,{children:[Eo(ys,{ref:le,onFocus:ue},`${_}-pre-focus-guard`),Eo(E,{children:L},_),Eo(ys,{ref:g.context.triggerFocusTargetRef,onFocus:de},`${_}-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(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/&/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,footerAction:n}){let{selectText:r=`Select`,selectKeyAriaLabel:i=`Enter key`,submitQuestionText:a=`Submit question`,navigateText:o=`Navigate`,navigateUpKeyAriaLabel:s=`Arrow up`,navigateDownKeyAriaLabel:c=`Arrow down`,closeText:l=`Close`,backToSearchText:u=`Back to search`,closeKeyAriaLabel:d=`Escape key`,poweredByText:f=`Powered by`}=e,p=n!=null&&typeof n!=`boolean`;return B.createElement(B.Fragment,null,B.createElement(`ul`,{className:`DocSearch-Commands`},B.createElement(`li`,null,B.createElement(`kbd`,{className:`DocSearch-Commands-Key`},B.createElement(um,{ariaLabel:c},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:s},B.createElement(`path`,{d:`m5 12 7-7 7 7`}),B.createElement(`path`,{d:`M12 19V5`}))),B.createElement(`span`,{className:`DocSearch-Label`},o)),B.createElement(`li`,null,B.createElement(`kbd`,{className:`DocSearch-Commands-Key`},B.createElement(um,{ariaLabel:i},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?a:r)),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":d},t?u:l))),B.createElement(`div`,{className:`DocSearch-Footer-Actions`},p&&B.createElement(`div`,{className:`DocSearch-Footer-Action`},n),B.createElement(`div`,{className:`DocSearch-Logo`},B.createElement(Ir,{translations:{poweredByText:f}}))))}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((e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`})))})}),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,theme:n}){mn({theme:n}),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(()=>{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,theme:s}){_m({getEnvironmentProps:e,panelElement:n.current,formElement:r.current,inputElement:i.current}),vm({container:t.current}),ym({initialScrollY:a,modalRef:o,theme:s})}function xm(){return{containerRef:B.useRef(null),modalRef:B.useRef(null),formElementRef:B.useRef(null),dropdownRef:B.useRef(null),inputRef:B.useRef(null)}}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,insights:o,appId:s,apiKey:c,maxResultsPerGroup:l,transformItems:u=kp,saveRecentSearch:d,onClose:f,facetSelections:p}){let m=o;try{let{results:r}=await i.search({requests:a.map(t=>{var n,r,i,a,o,s,c;let l=t.name,u=t.searchParameters,d=Jm(u==null?void 0:u.facetFilters,p.current);return _(_({query:e,indexName:l,attributesToRetrieve:(n=u==null?void 0:u.attributesToRetrieve)==null?[`hierarchy.lvl0`,`hierarchy.lvl1`,`hierarchy.lvl2`,`hierarchy.lvl3`,`hierarchy.lvl4`,`hierarchy.lvl5`,`hierarchy.lvl6`,`content`,`type`,`url`]:n,attributesToSnippet:(r=u==null?void 0:u.attributesToSnippet)==null?[`hierarchy.lvl1:15`,`hierarchy.lvl2:15`,`hierarchy.lvl3:15`,`hierarchy.lvl4:15`,`hierarchy.lvl5:15`,`hierarchy.lvl6:15`,`content:15`]:r,snippetEllipsisText:(i=u==null?void 0:u.snippetEllipsisText)==null?`…`:i,highlightPreTag:(a=u==null?void 0:u.highlightPreTag)==null?`<mark>`:a,highlightPostTag:(o=u==null?void 0:u.highlightPostTag)==null?`</mark>`:o,hitsPerPage:(s=u==null?void 0:u.hitsPerPage)==null?20:s,clickAnalytics:(c=u==null?void 0:u.clickAnalytics)==null?m:c},u),d?{facetFilters:d}:{})})});return r.flatMap(e=>{let r=e,{hits:i,nbHits:a}=r,o=Op(u(i),e=>Fp(e),l);if(t.context.searchSuggestions.length<Object.keys(o).length){var p;n({searchSuggestions:_(_({},(p=t.context.searchSuggestions)==null?[]:p),Object.keys(o))})}if(a){let e=t.context.nbHits;n({nbHits:(e==null?0:e)+a})}let h={};return m&&(h={__autocomplete_indexName:r.index,__autocomplete_queryID:r.queryID,__autocomplete_algoliaCredentials:{appId:s,apiKey:c}}),Object.values(o).map((e,t)=>({sourceId:`hits_${r.index}_${t}`,onSelect({item:e,event:t}){d(e),Ap(t)||f()},getItemUrl({item:e}){return e.url},getItems(){return Object.values(Op(e,e=>e.hierarchy.lvl1,l)).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},h)})).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=me(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)}),N=g.useState(`triggerProps`,w),{getButtonProps:P,buttonRef:ee}=Wa({disabled:o,native:s}),te={open(e){return e&&T===`trigger-press`?Xi.open(e):Yi.open(e)}},{preFocusGuardRef:F,handlePreFocusGuardFocus:ne,handleFocusTargetFocus:re}=pp(g,S),ie=Mi(`button`,e,{state:{disabled:o,open:b},ref:[ee,t,C,S],props:[j.reference,A,N,M,{"data-base-ui-click-trigger":``,id:_,"aria-haspopup":`dialog`,"aria-expanded":b,"aria-controls":x},m,P],stateAttributesMapping:te});return w&&!k?Eo(E,{children:[Eo(ys,{ref:F,onFocus:ne}),Eo(E,{children:ie},_),Eo(ys,{ref:g.context.triggerFocusTargetRef,onFocus:re})]}):Eo(E,{children:ie},_)});V();let ch=me(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=me(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),N=Po(O,!1,!1),P=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}),ee=x.useState(`domReferenceElement`);W(()=>{let e=ee,t=M.current;if(e&&(M.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return N(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[ee,N,v]),Lf(C&&E===!0&&w!==`trigger-hover`,D===`touch`,O,T);let te=Le(e=>{v.set(`positionerElement`,e)},[v]),F=Df(e,{open:C,side:P.side,align:P.align,anchorHidden:P.anchorHidden,instant:k},{styles:P.positionerStyles,transitionStatus:A,props:_,refs:[t,te],hidden:!S,inert:!C});return Eo(fh.Provider,{value:P,children:[S&&E===!0&&w!==`trigger-hover`&&Eo(Ef,{ref:v.context.internalBackdropRef,inert:cf(!C),cutout:T}),Eo(al,{id:b,children:F})]})});V();let gh=me(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 N=Le(e=>{l.set(`popupElement`,e)},[l]),P=Mi(`div`,e,{state:{open:m,side:u.side,align:u.align,instant:g,transitionStatus:_},ref:[t,l.context.popupRef,N],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:P})})});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=`vercel.ai.error`,Ah=Symbol.for(kh),jh,Mh,Nh=class e extends (Mh=Error,jh=Ah,Mh){constructor({name:e,message:t,cause:n}){super(t),this[jh]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,kh)}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 Ph(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.message:JSON.stringify(e)}var Fh=`AI_InvalidArgumentError`,Ih=`vercel.ai.error.${Fh}`,Lh=Symbol.for(Ih),Rh,zh,Bh=class extends (zh=Nh,Rh=Lh,zh){constructor({message:e,cause:t,argument:n}){super({name:Fh,message:e,cause:t}),this[Rh]=!0,this.argument=n}static isInstance(e){return Nh.hasMarker(e,Ih)}},Vh=`AI_JSONParseError`,Hh=`vercel.ai.error.${Vh}`,Uh=Symbol.for(Hh),Wh,Gh,Kh=class extends (Gh=Nh,Wh=Uh,Gh){constructor({text:e,cause:t}){super({name:Vh,message:`JSON parsing failed: Text: ${e}.
|
|
27
|
-
Error message: ${
|
|
28
|
-
Error message: ${Ph(t)}`,cause:t}),this[Xh]=!0,this.value=e}static isInstance(e){return Nh.hasMarker(e,Jh)}static wrap({value:t,cause:n}){return e.isInstance(n)&&n.value===t?n:new e({value:t,cause:n})}},$h=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 eg(e){}function tg(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=eg,onError:n=eg,onRetry:r=eg,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(`
|
|
29
|
-
`)===-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 $h(`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(`
|
|
30
|
-
`,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(`
|
|
31
|
-
`,n);continue}let i=e.charCodeAt(n);if(ng(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(`
|
|
32
|
-
`,n);continue}u=d===0?a:`${u}
|
|
33
|
-
${a}`,d++}else rg(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(`
|
|
34
|
-
`,n)}return e.slice(n)}for(;n<e.length;){let t=e.indexOf(`\r`,n),r=e.indexOf(`
|
|
35
|
-
`,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(ng(e,t,r)){let r=e.charCodeAt(t+5)===32?t+6:t+5,i=e.slice(r,n);u=d===0?i:`${u}
|
|
36
|
-
${i}`,d++;return}if(rg(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}
|
|
37
|
-
${t}`,d++;break;case`id`:l=t.includes(`\0`)?void 0:t;break;case`retry`:/^\d+$/.test(t)?r(parseInt(t,10)):n(new $h(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:i}));break;default:n(new $h(`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 ng(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 rg(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 ig=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n,maxBufferSize:r}={}){let i;super({start(a){i=tg({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)}})}},ag;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 og=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},sg=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ag=globalThis).__zod_globalConfig!=null||(ag.__zod_globalConfig={});let cg=globalThis.__zod_globalConfig;function lg(e){return e&&Object.assign(cg,e),cg}let ug=[`inst`,`continue`,`input`];function dg(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 fg(e,t){return typeof t==`bigint`?t.toString():t}function pg(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function mg(e){return e==null}function hg(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function gg(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 vg(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 yg(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function bg(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function xg(e){return JSON.stringify(e)}function Sg(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}let Cg=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function wg(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}let Tg=pg(()=>{var e;if(cg.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 Eg(e){if(wg(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(wg(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Dg(e){return Eg(e)?U({},e):Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let Og=new Set([`string`,`number`,`symbol`]);function kg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ag(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 jg(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}let Mg={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ng(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 Ag(e,bg(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 yg(this,`shape`,e),e},checks:[]}))}function Pg(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 Ag(e,bg(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 yg(this,`shape`,r),r},checks:[]}))}function Fg(e,t){if(!Eg(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 Ag(e,bg(e._zod.def,{get shape(){let n=U(U({},e._zod.def.shape),t);return yg(this,`shape`,n),n}}))}function Ig(e,t){if(!Eg(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ag(e,bg(e._zod.def,{get shape(){let n=U(U({},e._zod.def.shape),t);return yg(this,`shape`,n),n}}))}function Lg(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 Ag(e,bg(e._zod.def,{get shape(){let n=U(U({},e._zod.def.shape),t._zod.def.shape);return yg(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:(r=t._zod.def.checks)==null?[]:r}))}function Rg(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 Ag(t,bg(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 yg(this,`shape`,i),i},checks:[]}))}function zg(e,t,n){return Ag(t,bg(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 yg(this,`shape`,i),i}}))}function Bg(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 Vg(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 Hg(e,t){return t.map(t=>{var n;return(n=t).path!=null||(n.path=[]),t.path.unshift(e),t})}function Ug(e){return typeof e==`string`?e:e==null?void 0:e.message}function Wg(e,t,n){var r,i,a,o,s,c,l,u,d;let f=e.message?e.message:(r=(i=(a=(o=Ug((s=e.inst)==null||(s=s._zod.def)==null||(c=s.error)==null?void 0:c.call(s,e)))==null?Ug(t==null||(l=t.error)==null?void 0:l.call(t,e)):o)==null?Ug((u=n.customError)==null?void 0:u.call(n,e)):a)==null?Ug((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,ug);return g.path!=null||(g.path=[]),g.message=f,t!=null&&t.reportInput&&(g.input=h),g}function Gg(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Kg(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:U({},t)}let qg=(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,fg,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Jg=K(`$ZodError`,qg),Yg=K(`$ZodError`,qg,{Parent:Error});function Xg(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 Zg(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 Qg=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 og;if(o.issues.length){var s;let t=new((s=i==null?void 0:i.Err)==null?e:s)(o.issues.map(e=>Wg(e,a,lg())));throw Cg(t,i==null?void 0:i.callee),t}return o.value},$g=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=>Wg(e,a,lg())));throw Cg(t,i==null?void 0:i.callee),t}return o.value},e_=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 og;return a.issues.length?{success:!1,error:new(e==null?Jg:e)(a.issues.map(e=>Wg(e,i,lg())))}:{success:!0,data:a.value}},t_=e_(Yg),n_=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=>Wg(e,i,lg())))}:{success:!0,data:a.value}},r_=n_(Yg),i_=e=>(t,n,r)=>{let i=r?U(U({},r),{},{direction:`backward`}):{direction:`backward`};return Qg(e)(t,n,i)},a_=e=>(t,n,r)=>Qg(e)(t,n,r),o_=e=>async(t,n,r)=>{let i=r?U(U({},r),{},{direction:`backward`}):{direction:`backward`};return $g(e)(t,n,i)},s_=e=>async(t,n,r)=>$g(e)(t,n,r),c_=e=>(t,n,r)=>{let i=r?U(U({},r),{},{direction:`backward`}):{direction:`backward`};return e_(e)(t,n,i)},l_=e=>(t,n,r)=>e_(e)(t,n,r),u_=e=>async(t,n,r)=>{let i=r?U(U({},r),{},{direction:`backward`}):{direction:`backward`};return n_(e)(t,n,i)},d_=e=>async(t,n,r)=>n_(e)(t,n,r),f_=/^[cC][0-9a-z]{6,}$/,p_=/^[0-9a-z]+$/,m_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,h_=/^[0-9a-vA-V]{20}$/,g_=/^[A-Za-z0-9]{27}$/,__=/^[a-zA-Z0-9_-]{21}$/,v_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,y_=/^([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})$/,b_=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)$/,x_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function S_(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}let C_=/^(?:(?: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])$/,w_=/^(([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}|:))$/,T_=/^((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])$/,E_=/^(([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])$/,D_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,O_=/^[A-Za-z0-9_-]*$/,k_=/^https?$/,A_=/^\+[1-9]\d{6,14}$/,j_=`(?:(?:\\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])))`,M_=RegExp(`^${j_}$`);function N_(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 P_(e){return RegExp(`^${N_(e)}$`)}function F_(e){let t=N_({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(`^${j_}T(?:${r})$`)}let I_=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}$`)},L_=/^-?\d+$/,R_=/^-?\d+(?:\.\d+)?$/,z_=/^(?:true|false)$/i,B_=/^null$/i,V_=/^[^A-Z]*$/,H_=/^[^a-z]*$/,U_=K(`$ZodCheck`,(e,t)=>{var n;e._zod!=null||(e._zod={}),e._zod.def=t,(n=e._zod).onattach!=null||(n.onattach=[])}),W_={number:`number`,bigint:`bigint`,object:`date`},G_=K(`$ZodCheckLessThan`,(e,t)=>{U_.init(e,t);let n=W_[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})}}),K_=K(`$ZodCheckGreaterThan`,(e,t)=>{U_.init(e,t);let n=W_[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})}}),q_=K(`$ZodCheckMultipleOf`,(e,t)=>{U_.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):gg(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})}}),J_=K(`$ZodCheckNumberFormat`,(e,t)=>{var n;U_.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]=Mg[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=L_)}),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})}}),Y_=K(`$ZodCheckMaxLength`,(e,t)=>{var n;U_.init(e,t),(n=e._zod.def).when!=null||(n.when=e=>{let t=e.value;return!mg(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=Gg(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),X_=K(`$ZodCheckMinLength`,(e,t)=>{var n;U_.init(e,t),(n=e._zod.def).when!=null||(n.when=e=>{let t=e.value;return!mg(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=Gg(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Z_=K(`$ZodCheckLengthEquals`,(e,t)=>{var n;U_.init(e,t),(n=e._zod.def).when!=null||(n.when=e=>{let t=e.value;return!mg(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=Gg(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}))}}),Q_=K(`$ZodCheckStringFormat`,(e,t)=>{var n,r;U_.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=()=>{})}),$_=K(`$ZodCheckRegex`,(e,t)=>{Q_.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})}}),ev=K(`$ZodCheckLowerCase`,(e,t)=>{t.pattern!=null||(t.pattern=V_),Q_.init(e,t)}),tv=K(`$ZodCheckUpperCase`,(e,t)=>{t.pattern!=null||(t.pattern=H_),Q_.init(e,t)}),nv=K(`$ZodCheckIncludes`,(e,t)=>{U_.init(e,t);let n=kg(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})}}),rv=K(`$ZodCheckStartsWith`,(e,t)=>{U_.init(e,t);let n=RegExp(`^${kg(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})}}),iv=K(`$ZodCheckEndsWith`,(e,t)=>{U_.init(e,t);let n=RegExp(`.*${kg(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})}}),av=K(`$ZodCheckOverwrite`,(e,t)=>{U_.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var ov=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(`
|
|
26
|
+
var t=(B(),d(dt)),n=Bu();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}})),Hu=s(((e,t)=>{t.exports=Vu()}));B();let Uu=[],Wu;function Gu(){return Wu}function Ku(e){Uu.push(e)}function qu(e){let t=(t,n)=>{let r=ti(Yu).current,i;try{Wu=r;for(let e of Uu)e.before(r);i=e(t,n);for(let e of Uu)e.after(r);r.didInitialize=!0}finally{Wu=void 0}return i};return t.displayName=e.displayName||e.name,t}function Ju(e){return bt(qu(e))}function Yu(){return{didInitialize:!1}}B();var Xu=Bu(),Zu=Hu();let Qu=li(19)?td:nd;function $u(e,t,n,r,i){return Qu(e,t,n,r,i)}function ed(e,t,n,r,i){let a=Re(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Xu.useSyncExternalStore)(e.subscribe,a,a)}Ku({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,Xu.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function td(e,t,n,r,i){let a=Gu();if(!a)return ed(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 nd(e,t,n,r,i){return(0,Zu.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var rd=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 $u(this,e,t,n,r)}};B();var id=class extends rd{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),$u(this,this.selectors[e],t,n,r)}useContextCallback(e,t){Be(e);let n=Ba(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 ad=[`syncOnly`,`nested`,`onOpenChange`,`triggerElements`],od={open:W(e=>e.open),transitionStatus:W(e=>e.transitionStatus),domReferenceElement:W(e=>e.domReferenceElement),referenceElement:W(e=>{var t;return(t=e.positionReference)==null?e.referenceElement:t}),floatingElement:W(e=>e.floatingElement),floatingId:W(e=>e.floatingId)};var sd=class extends id{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i}=e,a=yr(e,ad);super(H(H({},a),{},{positionReference:a.referenceElement,domReferenceElement:a.referenceElement}),{onOpenChange:r,dataRef:{current:{}},events:sl(),nested:n,triggerElements:i},od),V(this,`syncOpenEvent`,(e,t)=>{(!e||!this.state.open||t!=null&&ns(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 cd(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 sd({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};_a(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 ld={tabIndex:-1,"data-base-ui-focusable":``};function ud(e){return t=>t!==`touch`||e.current}function dd(e,t,n=!1){let r=Co(),i=dl()!=null,a=L(null);e===void 0&&a.current===null&&(a.current=t(r,i));let o=e==null?a.current:e;return cd({popupStore:o,treatPopupAsFloatingElement:n,floatingRootContext:o.state.floatingRootContext,floatingId:r,nested:i,onOpenChange:o.setOpen}),{store:o,internalStore:a.current}}function fd(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 pd(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 md(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function hd(e,t,n,r){Ru(()=>{t===void 0&&e.state.open===!1&&n&&(e.state=H(H({},e.state),{},{open:!0,activeTriggerId:r,preventUnmountingOnClose:!1}))})}function gd(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=fd(e,n),o=Ba(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 _d(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=Do(`none`);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,e.useState(`triggerCount`),n])}function vd(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=Lo(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=Ba(()=>{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 Bo({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function yd(e,t){e.useSyncedValues(t),U(()=>()=>{e.update({activeTriggerProps:mi,inactiveTriggerProps:mi,popupProps:mi})},[e])}function bd(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 xd=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 Sd(){return new sd({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new xd,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Cd(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Sd(),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 wd(e,t,n=!1){return new sd({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}let Td=W(e=>{var t;return(t=e.triggerIdProp)==null?e.activeTriggerId:t}),Ed=W(e=>{var t;return(t=e.openProp)==null?e.open:t}),Dd=W(e=>{var t,n;return((t=(n=e.popupElement)==null?void 0:n.id)==null?e.floatingId:t)||void 0});function Od(e,t){return t!==void 0&&Ed(e)&&Td(e)===t}function kd(e,t){return Od(e,t)?!0:t!==void 0&&Ed(e)&&Td(e)==null&&e.triggerCount===1}let Ad={open:Ed,mounted:W(e=>e.mounted),transitionStatus:W(e=>e.transitionStatus),floatingRootContext:W(e=>e.floatingRootContext),triggerCount:W(e=>e.triggerCount),preventUnmountingOnClose:W(e=>e.preventUnmountingOnClose),payload:W(e=>e.payload),activeTriggerId:Td,activeTriggerElement:W(e=>e.mounted?e.activeTriggerElement:null),popupId:Dd,isTriggerActive:W((e,t)=>t!==void 0&&Td(e)===t),isOpenedByTrigger:W((e,t)=>Od(e,t)),isMountedByTrigger:W((e,t)=>t!==void 0&&Td(e)===t&&e.mounted),triggerProps:W((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:W((e,t)=>kd(e,t)?Dd(e):void 0),popupProps:W(e=>e.popupProps),popupElement:W(e=>e.popupElement),positionerElement:W(e=>e.positionerElement)};function jd(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Co(),a=dl()!=null,o=ti(()=>{var e,o;return new sd({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:(e=r.reference)==null?null:e,floatingElement:(o=r.floating)==null?null:o,triggerElements:new xd,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=_a(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 Md(e={}){let{nodeId:t,externalTree:n}=e,r=jd(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),_=fl(n),v=R(()=>({reference:a,floating:o,domReference:s}),[a,o,s]),y=ju(H(H({},e),{},{elements:H(H({},v),u&&{reference:u})})),b=_a(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=_a(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),y.refs.setReference(t)},[y.refs]),C=Re(e=>{(_a(e)||e===null)&&(g.current=e,p(e)),(_a(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!_a(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 Nd=ao&&lo;function Pd(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=Xo();Fe(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=ma(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&va(e)&&e===as(Ts(e))&&(s.current=!0)}function a(){l.current=!0}function o(){l.current=!1}return Ss(xs(t,`blur`,r),Nd&&xs(t,`keydown`,a,!0),Nd&&xs(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`);_a(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=ss(t.nativeEvent);if(_a(a)){if(Nd&&!t.relatedTarget){if(!l.current&&!ds(a))return}else if(!ms(a))return}let o=cs(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,Do(ra,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,Do(ra,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=_a(n)&&n.hasAttribute(Ic(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{var e;let t=i.select(`domReferenceElement`),s=as(Ts(t));!n&&s===t||os((e=o.current.floatingContext)==null?void 0:e.refs.floating.current,s)||os(t,s)||a||cs(n==null?s:n,i.context.triggerElements)||i.setOpen(!1,Do(ra,r))})}}},[o,r,i,u]);return R(()=>n?{reference:d,trigger:d}:{},[n,d])}var Fd=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 Yo,this.restTimeout=new Yo,this.handleCloseOptions=void 0}static create(){return new e}};let Id=new WeakMap;function Ld(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;if(t&&Id.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`),Id.delete(t)}e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Rd(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Id.get(n);a&&a!==e&&Ld(a),Ld(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Id.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function zd(e){let t=e.context.dataRef.current,n=ti(()=>{var e;return(e=t.hoverInteractionState)==null?Fd.create():e}).current;return t.hoverInteractionState||(t.hoverInteractionState=n),No(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}B();function Bd(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=fl(),d=dl(),f=zd(a),p=Xo(),m=Ba(()=>{var e;return ys((e=l.current.openEvent)==null?void 0:e.type,f.interactedInside)}),h=Ba(()=>{var e;return bs((e=l.current.openEvent)==null?void 0:e.type)}),g=Ba(()=>{Ld(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()&&_a(c)&&s){var t,r,i,a,l,p,m;let e=c,n=s,o=Ts(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 Rd(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&&Pc(u.nodesRef.current,d).length>0)}function t(e){let t=_s(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,Do(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=ss(e);if(!fs(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(cs(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&&_a(c)&&Pc(u.nodesRef.current,s,!1).some(e=>{var t;return os((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,Do(na,t)),u.events.emit(`floating.closed`,t)})}let y=s;return Ss(y&&xs(y,`mouseenter`,c),y&&xs(y,`mouseleave`,_),y&&xs(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 Vd={current:null};function Hd(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Vd,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,_=fl(l),v=zd(m),y=L(!1),b=Cs(i),x=Cs(r),S=Cs(o),C=Cs(n),w=Cs(p),T=Cs(f),E=Ba(()=>{var e;return ys((e=h.current.openEvent)==null?void 0:e.type,v.interactedInside)}),D=Ba(()=>{var e;return((e=w.current)==null?void 0:e.call(w))!==!1}),O=Ba((e,t,n)=>{let r=m.context.triggerElements;if(r.hasElement(t))return!e||!os(e,t);if(!_a(n))return!1;let i=n;return r.hasMatchingElement(e=>os(e,i))&&(!e||!os(e,i))}),k=Ba(()=>{v.handler&&(Ts(m.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),v.handler=void 0)}),A=Ba(()=>{Ld(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=_s(x.current,`close`,v.pointerType);n?v.openChangeTimeout.start(n,()=>{m.setOpen(!1,Do(na,e)),_==null||_.events.emit(`floating.closed`,e)}):t&&(v.openChangeTimeout.clear(),m.setOpen(!1,Do(na,e)),_==null||_.events.emit(`floating.closed`,e))}let r=(e=c.current)==null?u?m.select(`domReferenceElement`):null:e;if(!_a(r))return;function i(e){var t,n,r;if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!ts(v.pointerType))return;let i=vs(S.current),o=_s(x.current,`open`,v.pointerType),s=ss(e),c=(t=e.currentTarget)==null?null:t,l=m.select(`domReferenceElement`),u=c;if(_a(s)&&!m.context.triggerElements.hasElement(s)){for(let e of m.context.triggerElements.elements())if(os(e,s)){u=e;break}}_a(c)&&_a(l)&&!m.context.triggerElements.hasElement(c)&&os(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&&_a(u)&&_a(l)&&os(l,u)&&h,_=i>0&&!o,b=d&&(f||h)||g,C=!f||d;if(b){D()&&m.setOpen(!0,Do(na,e,u));return}_||(o?v.openChangeTimeout.start(o,()=>{C&&D()&&m.setOpen(!0,Do(na,e,u))}):C&&D()&&m.setOpen(!0,Do(na,e,u)))}function o(e){var n;if(E()){A();return}k();let r=Ts(m.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=(n=h.current.floatingContext)==null?d==null?void 0:d():n;if(!cs(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`||!os(m.select(`floatingElement`),e.relatedTarget))&&t(e)}}return s?Ss(xs(r,`mousemove`,i,{once:!0}),xs(r,`mouseenter`,i),xs(r,`mouseleave`,o)):Ss(xs(r,`mouseenter`,i),xs(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&&!ts(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;Rd(v,{scopeElement:t,referenceElement:r,floatingElement:e})}}let d=vs(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,Do(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 Ud(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Wd(e,t){return Ud(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Gd(e,t,n){return Ud(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Kd(e,t,n){return Ud(t,n?e===rs:e===is,e===`ArrowDown`)}function qd(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:Ud(t,n?e===is:e===rs,e===`ArrowUp`)}function Jd(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=hs(T),k=ps(E),A=Cs(O),j=dl(),M=fl(b),ee=L(f),N=L(o==null?-1:o),te=L(null),ne=L(!0),P=Ba(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=Cs(h),le=Cs(w),F=Cs(o),ue=Cs(y),de=Io(),fe=Io(),pe=Ba(()=>{function e(e){d?M==null||M.events.emit(`virtualfocus`,e):se.current=Rc(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||Gd(te.current,g,u)||l?ic(n):ac(n),te.current=null,P())};t()}}else rc(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=as(Ts((t=E==null?r:E)==null?null:t)),o=n.some(e=>e.context&&os(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=Ba(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=Ba(()=>{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=Ba(()=>ic(n,ce.current)),_e=Ba(e=>{if(ne.current=!1,ae.current=!0,e.which===229||!le.current&&e.currentTarget===A.current)return;if(l&&qd(e.key,g,u,S)){Wd(e.key,I())||Zo(e),C.setOpen(!1,Do(oa,e.nativeEvent)),va(E)&&(d?M==null||M.events.emit(`virtualfocus`,E):E.focus());return}let t=N.current,r=ic(n,h),i=ac(n,h);if(k||(e.key===`Home`&&(Zo(e),N.current=r,P(e)),e.key===`End`&&(Zo(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(Wd(e.key,g)){if(Zo(e),w&&!d&&as(e.currentTarget.ownerDocument)===e.currentTarget){N.current=Gd(e.key,g,u)?r:i,P(e);return}Gd(e.key,g,u)?c?t>=i?s&&t!==n.current.length?N.current=-1:(ae.current=!1,N.current=r):N.current=oc(n.current,{startingIndex:t,disabledIndices:h}):N.current=Math.min(i,oc(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=oc(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):N.current=Math.max(r,oc(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),rc(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=as(Ts(e));e&&os(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=ss(e.nativeEvent);if(t&&!os(A.current,t))return;Zo(e),C.setOpen(!1,Do(aa,e.nativeEvent)),va(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,Do(oa,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&$o(e.nativeEvent)&&(ee.current=!d)}function n(e){ee.current=f,f===`auto`&&es(e.nativeEvent)&&(ee.current=!0)}return{onKeyDown(t){let n=C.select(`open`);ne.current=!1;let r=t.key.startsWith(`Arrow`),i=Kd(t.key,I(),u),a=Wd(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=Wd(t.key,I());te.current=l&&e?null:t.key}if(l){i&&(Zo(t),n?(N.current=ge(),P(t)):e(t));return}a&&(F.current!=null&&(N.current=F.current),Zo(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 Yd(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=Xo(),h=L(``),g=L((n=d==null?a:d)==null?-1:n),_=L(null),v=Ba(e=>{var t;function n(e){let t=i==null?void 0:i.current[e];return!t||lc(t)}function l(e){return n(e)?s==null||!sc(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===` `&&(Zo(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!==` `&&(Zo(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=Ba(e=>{let t=e.relatedTarget,n=f.select(`domReferenceElement`),r=f.select(`floatingElement`);os(n,t)||os(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 Xd=.5;function Zd(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Qd(e,t,n,r,i,a,o,s,c,l){let u=!1;return Zd(e,t,n,r,i,a)&&(u=!u),Zd(e,t,i,a,o,s)&&(u=!u),Zd(e,t,o,s,c,l)&&(u=!u),Zd(e,t,c,l,n,r)&&(u=!u),u}function $d(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function ef(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 tf(e={}){let{blockPointerEvents:t=!1}=e,n=new Yo,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=ss(r),g=r.type===`mouseleave`,_=os(u,h),v=os(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&_a(r.relatedTarget)&&os(u,r.relatedTarget))return;function y(){return!!(s&&Pc(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=ef(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=ef(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=ef(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=ef(d,f,x.right-1,A,S.left+1,k);break;default:}if(j)return;if(l&&!$d(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Xd/2:Xd*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Xd+1,o=C||T?S.bottom-Xd:S.top,s=C?T?S.bottom-Xd:S.top:S.bottom-Xd;M=Qd(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Xd/2:Xd*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Xd,o=C||T?S.top+Xd:S.bottom,s=C?T?S.top+Xd:S.bottom:S.top+Xd;M=Qd(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Xd/2:Xd*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Xd+1,o=w||E?S.right-Xd:S.left,s=w?E?S.right-Xd:S.left:S.right-Xd;M=Qd(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Xd/2:Xd*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Xd,o=w||E?S.left+Xd:S.right,s=w?E?S.left+Xd:S.right:S.left+Xd;M=Qd(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 nf=he(void 0);function rf(e){let t=ze(nf);if(t===void 0&&!e)throw Error(Yr(69));return t}let af=new Set([`ArrowLeft`,`ArrowRight`]),of=new Set([`ArrowUp`,`ArrowDown`]),sf=new Set([...af,...of]),cf=new Set([...sf,`Home`,`End`]);function lf(e){return e===`starting`?Zc:mi}B();let uf=[`render`,`className`,`style`,`finalFocus`],df=H(H({},Qi),Hi),ff=bt(function(e,t){let{render:n,className:r,style:i,finalFocus:a}=e,o=yr(e,uf),{store:s}=$r(),{side:c,align:l}=Zr(),u=rf(!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`;Bo({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,Do(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]),Bd(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:df,props:[p,{onKeyDown(e){u&&cf.has(e.key)&&e.stopPropagation()}},lf(f),o,{"data-rootownerid":y}]}),A=_.type===void 0||D;return(g||_.type===`menubar`&&v!==`outside-press`)&&(A=!0),ko(Cl,{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 pf=he(void 0);function mf(){let e=ze(pf);if(e===void 0)throw Error(Yr(32));return e}B();let hf=[`keepMounted`],gf=bt(function(e,t){let{keepMounted:n=!1}=e,r=yr(e,hf),{store:i}=$r();return i.useState(`mounted`)||n?ko(pf.Provider,{value:n,children:ko(ol,H({ref:t},r))}):null});function _f(e){return li(19)?e:e?`true`:void 0}B();let vf=he(void 0);function yf(){var e;let t=ze(vf);return(e=t==null?void 0:t.direction)==null?`ltr`:e}let bf=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`}=Ls(e,t)||{};if(d==null)return{};let m=tc(f),h={x:i,y:a},g=Us(o),_=Vs(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=Is(j,ee,M),te=!u.arrow&&zs(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}}}),xf=(e,t)=>H(H({},bf(e)),{},{options:[e,t]}),Sf=Lu().fn,Cf={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 Sf(e)).data)==null?void 0:t.referenceHidden)||o}}}},wf={sideX:`left`,sideY:`top`},Tf={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=ma(o),d=u.getComputedStyle(o);if(!(d.transitionDuration!==`0s`&&d.transitionDuration!==``))return{x:r,y:i,data:wf};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=Ts(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=Rs(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`:wf.sideX,v=m===`top`?`bottom`:wf.sideY;return{x:h,y:g,data:{sideX:_,sideY:v}}}};B();function Ef(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 Df(e,t,n){let{rects:r,placement:i}=e;return{side:Ef(t,Rs(i),n),align:zs(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Of(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=Ba(k),j=k?A:r,M=Cs(r),ee=Cs(_),N=yf()===`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=Cs(o),F=Cs(c),ue=typeof o==`function`?0:o,de=typeof c==`function`?0:c,fe=[];m&&fe.push(m),fe.push(Mu(e=>{let t=Df(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:Fu(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:Nu(e=>{let t=Ts(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:Pu(e=>{if(!ce.current)return{};let{width:t,height:n}=ce.current.getBoundingClientRect(),r=Hs(Rs(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(Iu(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=ma(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`)}})),xf(e=>({element:ce.current||Ts(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=Rs(c),f=Hs(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(Df(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),{}}},Cf,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}=Md({rootContext:g,open:h?_:void 0,placement:ne,middleware:fe,strategy:i,whileElementsMounted:h?void 0:(...e)=>vu(...e,ge),nodeId:b,externalTree:C}),{sideX:De,sideY:Oe}=xe.adaptiveOrigin||wf,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=(kf(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`&&kf(e)&&e.current!==je.current&&(_e.setPositionReference(e.current),je.current=e.current)},[_,_e,j,M]),Fe(()=>{if(h&&_&&ve.reference&&ve.floating)return vu(ve.reference,ve.floating,Se,ge)},[h,_,ve,Se,ge]);let Me=Rs(Ce),Pe=Ef(a,Me,N),Ie=zs(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 kf(e){return e!=null&&`current`in e}B();function Af(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Ba(i),o=L(0),s=ti(Mf).current,c=ti(jf).current,[l,u]=Ne(0),d=L(l),f=Ba((e,t)=>{c.set(e,t==null?null:t),d.current+=1,u(d.current)}),p=Ba(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(Nf).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=Ba(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 ko(go.Provider,{value:g,children:t})}function jf(){return new Map}function Mf(){return new Set}function Nf(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 Pf=[`cutout`],Ff=bt(function(e,t){let{cutout:n}=e,r=yr(e,Pf),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 ko(`div`,H(H({ref:t,role:`presentation`,"data-base-ui-inert":``},r),{},{style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}}))});function If(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},lf(r),i],stateAttributesMapping:Qi})}let Lf={},Rf={},zf=``;function Bf(e){if(typeof document>`u`)return!1;let t=Ts(e);return ma(t).innerWidth-t.documentElement.clientWidth>0}function Vf(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Ts(e),n=t.documentElement,r=t.body,i=ba(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 Hf(e){let t=Ts(e),n=t.documentElement,r=t.body,i=ba(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 Uf(e){var t,n;let r=Ts(e),i=r.documentElement,a=r.body,o=ma(i),s=0,c=0,l=!1,u=Fo.create();if(lo&&((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,Lf={scrollbarGutter:i.style.scrollbarGutter,overflowY:i.style.overflowY,overflowX:i.style.overflowX},zf=i.style.scrollBehavior,Rf={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=ba(i)?i:a;if(l=Vf(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,Lf),Object.assign(a.style,Rf),l||(i.scrollTop=s,i.scrollLeft=c,i.removeAttribute(`data-base-ui-scroll-locked`),i.style.scrollBehavior=zf)}function p(){f(),u.request(d)}d();let m=xs(o,`resize`,p);return()=>{u.cancel(),f(),typeof o.removeEventListener==`function`&&m()}}let Wf=new class{constructor(){V(this,`lockCount`,0),V(this,`restore`,null),V(this,`timeoutLock`,Yo.create()),V(this,`timeoutUnlock`,Yo.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=Ts(e).documentElement,n=ma(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=fi;return}let r=no||!Bf(e);this.restore=r?Hf(e):Uf(e)}};function Gf(e=!0,t=null){U(()=>{if(e)return Wf.acquire(t)},[e,t])}B();function Kf(e,t,n,r){let[i,a]=Ne(!1);U(()=>{if(!e||!t||n==null){a(!1);return}let r=Ts(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-20)},[e,t,n]),Gf(e&&(!t||i),r)}B();let qf=[`anchor`,`positionMethod`,`className`,`render`,`side`,`align`,`sideOffset`,`alignOffset`,`collisionBoundary`,`collisionPadding`,`arrowPadding`,`sticky`,`disableAnchorTracking`,`collisionAvoidance`,`style`],Jf=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=Qc,style:g}=e,_=yr(e,qf),{store:v}=$r(),y=mf(),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=zo(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?$c: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=Of({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?Tf: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,Do(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,Do(n))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let be=Xo();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,Do(sa))}):v.setOpen(!1,Do(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;Kf(T&&(Se||E&&ee!==`trigger-hover`),D===`touch`,A,O);let Ce=If(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),ko(Xr.Provider,{value:ye,children:[we&&ko(Ff,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:_f(!T),cutout:Te}),ko(ml,{id:N,children:ko(Af,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:Ce})})]})});B();let Yf=he(void 0);function Xf(){let e=ze(Yf);if(e===void 0)throw Error(Yr(34));return e}B();let Zf=[`render`,`className`,`value`,`defaultValue`,`onValueChange`,`disabled`,`style`,`aria-labelledby`],Qf=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,Zf),[d,f]=Ne(void 0),[p,m]=la({controlled:i,default:a,name:`MenuRadioGroup`}),h=Ba((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 ko(Uo.Provider,{value:f,children:ko(Yf.Provider,{value:_,children:g})})}));B();let $f=he(void 0);function ep(){let e=ze($f);if(e===void 0)throw Error(Yr(35));return e}B();let tp=[`render`,`className`,`id`,`label`,`nativeButton`,`disabled`,`closeOnClick`,`value`,`style`],np=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,tp),f=yo({label:a}),p=Zr(!0),m=wo(i),{store:h}=$r(),g=h.useState(`isActive`,f.index),_=h.useState(`itemProps`),{value:v,setValue:y,disabled:b}=Xf(),x=b||s,S=v===l,{getItemProps:C,itemRef:w}=ho({closeOnClick:c,disabled:x,highlighted:g,id:m,store:h,nativeButton:o,nodeId:p==null?void 0:p.context.nodeId,itemMetadata:mo}),T=R(()=>({disabled:x,highlighted:g,checked:S}),[x,g,S]);function E(e){let t=Do(ia,e.nativeEvent,void 0,{preventUnmountOnClose(){}});y(l,t)}let D=Ni(`div`,e,{state:T,stateAttributesMapping:Eo,props:[_,{role:`menuitemradio`,"aria-checked":S,onClick:E},d,C],ref:[w,t,f.ref]});return ko($f.Provider,{value:T,children:D})});B();let rp=[`render`,`className`,`style`,`keepMounted`],ip=bt(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1}=e,o=yr(e,rp),s=ep(),c=L(null),{transitionStatus:l,setMounted:u}=Lo(s.checked);return Bo({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:Eo,ref:[t,c],props:H({"aria-hidden":!0},o),enabled:a||s.checked})});B();let ap=he(null);function op(e){let t=ze(ap);if(t===null&&!e)throw Error(Yr(5));return t}B();function sp(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 cp(e,t){let n=L(e),r=Ba(t);U(()=>{n.current!==e&&r(n.current)},[e,r]),U(()=>{n.current=e},[e])}B();function lp(e,t){let{onClick:n,onPointerDown:r}=sp(Ba((n,r)=>{(typeof e==`function`?e():e)||t(r||(no?`touch`:``))}));return R(()=>({onClick:n,onPointerDown:r}),[n,r])}function up(e){let[t,n]=Ne(null),r=lp(e,n);return cp(e,t=>{t&&!e&&n(null)}),R(()=>({openMethod:t,triggerProps:r}),[t,r])}B();let dp=H(H({},Ad),{},{disabled:W(e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled),modal:W(e=>{var t;return(e.parent.type===void 0||e.parent.type===`context-menu`)&&((t=e.modal)==null||t)}),openMethod:W(e=>e.openMethod),allowMouseEnter:W(e=>e.allowMouseEnter),highlightItemOnHover:W(e=>e.highlightItemOnHover),stickIfOpen:W(e=>e.stickIfOpen),parent:W(e=>e.parent),rootId:W(e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId),activeIndex:W(e=>e.activeIndex),isActive:W((e,t)=>e.activeIndex===t),hoverEnabled:W(e=>e.hoverEnabled),instantType:W(e=>e.instantType),lastOpenChangeReason:W(e=>e.openChangeReason),floatingTreeRoot:W(e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot),floatingNodeId:W(e=>e.floatingNodeId),floatingParentNodeId:W(e=>e.floatingParentNodeId),itemProps:W(e=>e.itemProps),closeDelay:W(e=>e.closeDelay),hasViewport:W(e=>e.hasViewport),keyboardEventRelay:W(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)})});var fp=class e extends id{constructor(e){super(H(H({},pp()),e),{positionerRef:T(),popupRef:T(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:T(),beforeContentFocusGuardRef:T(),onOpenChangeComplete:void 0,triggerElements:new xd},dp),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 pp(){return H(H({},Cd()),{},{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 cl,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:mi,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1})}B();let mp=he(void 0);function hp(){return ze(mp)}B();let gp=qu(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=op(!0),b=hp(),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=fp.useStore(p==null?void 0:p.store,{open:o,openProp:r,activeTriggerId:h,triggerIdProp:m,parent:x});hd(S,r,o,h),S.useControlledProp(`openProp`,r),S.useControlledProp(`triggerIdProp`,m),S.useContextCallback(`onOpenChangeComplete`,a);let C=Co(),w=Co(),T=S.useState(`floatingTreeRoot`),E=pl(T),D=dl(),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=Xo(),oe=L(!0),se=Xo(),ce=P!=null,{openMethod:le,triggerProps:F}=up(O);S.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:N.type===void 0?c:void 0,openMethod:le,rootId:C}),_d(S);let{forceUnmount:ue}=vd(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=Ba((e,t)=>{var n;let r=t.reason;if(O===e&&t.trigger===k&&ee===r)return;let a=md(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,pd(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=cd({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,Do(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=Dl(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=yf(),_e=Re(e=>{S.select(`activeIndex`)!==e&&S.set(`activeIndex`,e)},[S]),ve=Jd(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=Yd(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});yd(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(ld,{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=ko(Qr.Provider,{value:xe,children:typeof n==`function`?n({payload:ne}):n});return N.type===void 0||N.type===`context-menu`?ko(hl,{externalTree:T,children:Se}):Se});function _p(e){let t=e.getBoundingClientRect(),n=ma(e);if(fo)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 vp(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Wa(),{ref:i,index:a}=yo(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 yp=[`render`,`className`,`style`,`state`,`props`,`refs`,`metadata`,`stateAttributesMapping`,`tag`];function bp(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,yp),{compositeProps:d,compositeRef:f}=vp({metadata:s});return Ni(l,e,{state:i,ref:[...o,f],props:[d,...a,u],stateAttributesMapping:c})}function xp(e){if(va(e)&&e.hasAttribute(`data-rootownerid`)){var t;return(t=e.getAttribute(`data-rootownerid`))==null?void 0:t}if(!Aa(e))return xp(Na(e))}B();function Sp(e,t){let n=L(null);function r(t){ln(()=>{e.setOpen(!1,Do(aa,t.nativeEvent,t.currentTarget))});let r=Ac(n.current);r==null||r.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&jc(n,r)){var i;(i=e.context.beforeContentFocusGuardRef.current)==null||i.focus()}else{ln(()=>{e.setOpen(!1,Do(aa,n.nativeEvent,n.currentTarget))});let i=kc(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&os(r,i);){let e=i;if(i=Ec(i),i===e)break}i==null||i.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}B();function Cp(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,Ts(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:mi,[t,n,r])}B();let wp=[`render`,`className`,`style`,`disabled`,`nativeButton`,`id`,`openOnHover`,`delay`,`closeDelay`,`handle`,`payload`],Tp=Ju(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,wp),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 _=wo(c),v=g.useState(`isTriggerActive`,_),y=g.useState(`floatingRootContext`),b=g.useState(`isOpenedByTrigger`,_),x=g.useState(`triggerPopupId`,_),S=L(null),C=Dp(),w=Wa(!0),T=fl(),D=R(()=>T==null?new cl:T,[T]),{registerTrigger:O,isMountedByThisTrigger:k}=gd(_,S,g,{payload:p,closeDelay:d,parent:C,floatingTreeRoot:D,floatingNodeId:pl(D),floatingParentNodeId:dl(),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}=qa({disabled:M,native:s});Fe(()=>{!b&&C.type===void 0&&(g.context.allowMouseUpTriggerRef.current=!1)},[g,b,C.type]);let te=L(null),ne=Xo(),P=Ba(e=>{if(!te.current)return;ne.clear(),g.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if(os(te.current,t)||os(g.select(`positionerElement`),t)||t===te.current||t!=null&&xp(t)===g.select(`rootId`))return;let n=_p(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`&&Ts(te.current).addEventListener(`mouseup`,P,{once:!0})},[b,P,g]);let re=A&&C.context.hasSubmenuOpen,ie=Hd(y,{enabled:(l==null?re:l)&&!M&&C.type!==`context-menu`&&(!A||re&&!k),handleClose:tf({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=Ep(b,g.select(`lastOpenChangeReason`)),oe=wl(y,{enabled:!M&&C.type!==`context-menu`,event:b&&A?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0&&ae}),se=Pd(y,{enabled:!M&&re}),ce=Cp({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}=Sp(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}),Ts(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?ko(bp,{tag:`button`,render:r,className:i,style:a,state:pe,refs:me,props:he,stateAttributesMapping:Zi}):b?ko(E,{children:[ko(Os,{ref:ue,onFocus:de},`${_}-pre-focus-guard`),ko(E,{children:I},_),ko(Os,{ref:g.context.triggerFocusTargetRef,onFocus:fe},`${_}-post-focus-guard`)]}):ko(E,{children:I},_)});function Ep(e,t){let n=Xo(),[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 Dp(){let e=ea(!0),t=$r(!0),n=op(!0);return R(()=>n?{type:`menubar`,context:n}:e&&!t?{type:`context-menu`,context:e}:{type:void 0},[e,t,n])}B();function Op(e){return`${e.charAt(0).toLocaleUpperCase()}${e.substring(1)}`}let kp={askAI:`askAI`,favoriteSearches:`favoriteSearches`,recentConversations:`recentConversations`,recentSearches:`recentSearches`};function Ap(e,t){return e.collections.find(e=>(e==null?void 0:e.source.sourceId)===t)}function jp(e){return e.replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/&/g,`&`)}let Mp=[`lvl0`,`lvl1`,`lvl2`,`lvl3`,`lvl4`,`lvl5`,`lvl6`];function Np(e){let t=e.type===`content`||e.type===`askAI`?Mp.length:Mp.indexOf(e.type);return Mp.slice(0,t).map(t=>e.hierarchy[t]?jp(e.hierarchy[t]):null).filter(Boolean).join(` > `)}let Pp=new Map;function Fp(e){let t=Pp.get(e);if(t)return t;let n=e.replace(/\[(\w+)\]/g,`.$1`).replace(/^\/./,``).split(`.`);return Pp.set(e,n),n}function Ip(e,t){return Fp(t).reduce((e,t)=>{if(e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,t))return e[t]},e)}function Lp(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 Rp(e){return e}function zp(e){return e.button===1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function Bp(e){return!e||e.trim().length===0}function Vp(...e){}let Hp=/(<mark>|<\/mark>)/g,Up=RegExp(Hp.source);function Wp(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&&Up.test(i.value)?i.value.replace(Hp,``):i.value:e.hierarchy.lvl0}function Gp(e){typeof e.scrollTo==`function`?e.scrollTo({top:0,behavior:`smooth`}):e.scrollTop=0}function Kp(){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 qp(){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 Jp(){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 Yp(){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 Xp(){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 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`,"aria-hidden":`true`},z.createElement(`polyline`,{points:`20 6 9 17 4 12`}))}function Qp(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 $p(e){return e.label?e.label:e.key.replace(/[._-]+/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function em(e){let t=e.indexOf(`:`);return t<=0?null:e.slice(0,t)}function tm(e){let t=em(e);if(t===null)return null;let n=e.slice(t.length+1);return n?{key:t,value:n}:null}function nm(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`){let e=tm(n);e&&(t[e.key]=[e.value]);continue}if(!Array.isArray(n)||n.length===0)continue;let e=null,r=[];for(let t of n){let n=typeof t==`string`?tm(t):null;if(!n||e!==null&&n.key!==e){e=null;break}e=n.key,r.push(n.value)}e!==null&&(t[e]=r)}}return t}let rm=[`className`,`type`];function im({children:e}){return z.createElement(`div`,{className:`DocSearch-Chip`},e)}function am(e){let{className:t,type:n=`button`}=e,r=mn(e,rm),i=`DocSearch-Chip-Dismiss${t?` ${t}`:``}`;return z.createElement(`button`,_({type:n,className:i,tabIndex:0},r),z.createElement(Mr,{"aria-hidden":`true`}))}im.Dismiss=am;let om=[`className`],sm=[`align`,`alignOffset`,`side`,`sideOffset`,`collisionBoundary`,`container`],cm=[`className`],lm=[`className`,`children`],um=[`className`,`children`],dm=[`className`];function fm(e){let t=jr({},(Ar(e),e));return z.createElement(gp,t)}fm.Trigger=z.forwardRef((e,t)=>{let{className:n}=e,r=mn(e,om),i=`DocSearch-Menu-Trigger${n?` ${n}`:``}`;return z.createElement(Tp,_({className:i,ref:t},r))});function pm(e){let{align:t=`start`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,collisionBoundary:a=`clipping-ancestors`,container:o}=e,s=mn(e,sm);return z.createElement(gf,{container:o},z.createElement(Jf,{className:`DocSearch-Menu-Positioner`,align:t,alignOffset:n,side:r,sideOffset:i,collisionBoundary:a},z.createElement(ff,_({className:`DocSearch-Menu-Popup`},s))))}fm.Popup=pm;function mm(e){let{className:t}=e,n=mn(e,cm),r=`DocSearch-Menu-Item${t?` ${t}`:``}`;return z.createElement(Jo,_({className:r},n))}fm.Item=mm;function hm(e){let t=jr({},(Ar(e),e));return z.createElement(Qf,t)}fm.RadioGroup=hm;function gm(e){let{className:t,children:n}=e,r=mn(e,lm),i=`DocSearch-Menu-Item DocSearch-Menu-RadioItem${t?` ${t}`:``}`;return z.createElement(np,_({className:i,closeOnClick:!0},r),z.createElement(`span`,{className:`DocSearch-Menu-RadioItem-Indicator`},z.createElement(ip,null,z.createElement(Zp,null))),n)}fm.RadioItem=gm;function _m(e){let{className:t,children:n}=e,r=mn(e,um),i=`DocSearch-Menu-Item DocSearch-Menu-CheckboxItem${t?` ${t}`:``}`;return z.createElement(jo,_({className:i},r),z.createElement(`span`,{className:`DocSearch-Menu-CheckboxItem-Indicator`},z.createElement(Ho,null,z.createElement(Zp,null))),n)}fm.CheckboxItem=_m;function vm(e){let{className:t}=e,n=mn(e,dm),r=`DocSearch-Menu-GroupLabel${t?` ${t}`:``}`;return z.createElement(Ko,_({className:r},n))}fm.GroupLabel=vm;let ym=[],bm=z.memo(function({facetKey:e,value:t,checked:n,onToggle:r}){let i=z.useCallback(()=>{r(e,t)},[e,r,t]);return z.createElement(fm.CheckboxItem,{checked:n,label:t,onCheckedChange:i},Op(t))});function xm(e){return t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]}function Sm(e){return t=>t.filter(t=>t!==e)}let Cm=z.memo(function({facet:e,selectedValues:t,defaultValueLabel:n,onSelectionChange:r,registerTrigger:i,menuTriggerSelectedAriaLabel:a}){let o=$p(e),s=t.length>0,c=z.useMemo(()=>new Set(t),[t]),l=z.useCallback((e,t)=>{r(e,xm(t))},[r]),u=z.useCallback(()=>{r(e.key,ym)},[e.key,r]),d=z.useCallback(t=>{i(e.key,t)},[e.key,i]);return z.createElement(fm,null,z.createElement(fm.Trigger,{ref:d,"data-has-selection":s,"aria-label":s?`${o}, ${t.join(`, `)} ${a}`:o},z.createElement(`span`,null,Op(o)),z.createElement(Xp,null)),z.createElement(fm.Popup,null,z.createElement(fm.Item,{className:`DocSearch-Menu-ResetItem`,label:`${n} ${o}`,onClick:u},n),e.values.map(t=>z.createElement(bm,{key:t,facetKey:e.key,value:t,checked:c.has(t),onToggle:l}))))}),wm=z.memo(function({facetKey:e,facetLabel:t,value:n,dismissAriaLabel:r,onDismiss:i}){let a=z.useCallback(t=>{i(e,n,t)},[e,i,n]);return z.createElement(im,null,Op(n),z.createElement(im.Dismiss,{"aria-label":`${r} ${Op(n)} (${t})`,onClick:a}))}),Tm=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(()=>new Set(e.map(e=>e.key)),[e]),f=z.useMemo(()=>{let e=[];for(let[n,r]of Object.entries(t))if(d.has(n))for(let t of r)e.push([n,t]);return e},[t,d]),p=z.useRef(new Map),m=z.useCallback((e,t)=>{t?p.current.set(e,t):p.current.delete(e)},[]),h=z.useCallback((e,t,r)=>{let i=r.currentTarget,a=i.closest(`.DocSearch-FacetSelectionBar`);if(a){var o,s;let t=Array.from(a.querySelectorAll(`.DocSearch-Chip-Dismiss`)),n=t.indexOf(i),r=(o=(s=t[n+1])==null?t[n-1]:s)==null?p.current.get(e):o;r==null||r.focus()}n(e,Sm(t))},[n]),g=z.useCallback(()=>{var e;(e=p.current.values().next().value)==null||e.focus(),r()},[r]),_=z.useMemo(()=>new Map(e.map(e=>[e.key,$p(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;return z.createElement(Cm,{key:e.key,facet:e,selectedValues:(r=t[e.key])==null?ym:r,defaultValueLabel:a,registerTrigger:m,menuTriggerSelectedAriaLabel:o,onSelectionChange:n})})),f.length>0&&z.createElement(`div`,{className:`DocSearch-FacetSelectionBar`,role:`group`,"aria-label":l},f.map(([e,t])=>{var n;return z.createElement(wm,{key:`${e}:${t}`,facetKey:e,facetLabel:(n=_.get(e))==null?e:n,value:t,dismissAriaLabel:u,onDismiss:h})}),z.createElement(`button`,{type:`button`,className:`DocSearch-FacetSelectionBar-Action`,onClick:g},s)))}),Em=[`actionsBeforeClose`,`autoFocus`,`clearButtonAriaLabel`,`clearButtonTitle`,`closeButtonAriaLabel`,`closeButtonText`,`hideInput`,`inputOverlay`,`inputProps`,`inputRef`,`isFromSelection`,`leadingElement`,`onClose`,`placeholder`,`searchInputLabel`,`state`];function Dm(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,Em),{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 Om({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 km(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 Am({translations:e={},isAskAiActive:t=!1,footerAction:n}){let{selectText:r=`Select`,selectKeyAriaLabel:i=`Enter key`,submitQuestionText:a=`Submit question`,navigateText:o=`Navigate`,navigateUpKeyAriaLabel:s=`Arrow up`,navigateDownKeyAriaLabel:c=`Arrow down`,closeText:l=`Close`,backToSearchText:u=`Back to search`,closeKeyAriaLabel:d=`Escape key`,poweredByText:f=`Powered by`}=e,p=n!=null&&typeof n!=`boolean`;return z.createElement(z.Fragment,null,z.createElement(`ul`,{className:`DocSearch-Commands`},z.createElement(`li`,null,z.createElement(`kbd`,{className:`DocSearch-Commands-Key`},z.createElement(km,{ariaLabel:c},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(km,{ariaLabel:s},z.createElement(`path`,{d:`m5 12 7-7 7 7`}),z.createElement(`path`,{d:`M12 19V5`}))),z.createElement(`span`,{className:`DocSearch-Label`},o)),z.createElement(`li`,null,z.createElement(`kbd`,{className:`DocSearch-Commands-Key`},z.createElement(km,{ariaLabel:i},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?a:r)),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":d},t?u:l))),z.createElement(`div`,{className:`DocSearch-Footer-Actions`},p&&z.createElement(`div`,{className:`DocSearch-Footer-Action`},n),z.createElement(`div`,{className:`DocSearch-Logo`},z.createElement(Lr,{translations:{poweredByText:f}}))))}function jm({hit:e,children:t}){return z.createElement(`a`,{href:e.url},t)}function Mm({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||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((e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`})))})}),i(n)}).catch(()=>{e&&i({})}),()=>{e=!1}},[a,o,n]),r}let Nm=[];function Pm(e,t){let n=e==null?Nm:e,r=t==null?Nm:t;return n===r||n.length===r.length&&n.every((e,t)=>e===r[t])}function Fm({facets:e,indexes:t,searchClient:n,onSelectionsChange:r}){let i=z.useMemo(()=>Qp(e),[e]),a=z.useRef(i),o=Mm({facets:i,indexes:t,searchClient:n}),[s,c]=z.useState(()=>nm(t)),l=z.useRef(s),u=z.useRef(r),d=z.useMemo(()=>i.map(e=>{var t;return _(_({},e),{},{values:(t=o[e.key])==null?[]:t})}).filter(e=>e.values.length>0),[o,i]);z.useLayoutEffect(()=>{a.current=i,u.current=r});let f=z.useCallback(e=>{var t;l.current=e,c(e),(t=u.current)==null||t.call(u)},[]);return{visibleFacets:d,facetSelections:s,facetSelectionsRef:l,handleFacetSelectionChange:z.useCallback((e,t)=>{let n=l.current[e],r=typeof t==`function`?t(n==null?Nm:n):t;Pm(n,r)||f(_(_({},l.current),{},{[e]:r}))},[f]),clearFacetSelections:z.useCallback(()=>{let e=l.current,t={},n=!1;for(let r of a.current){let i=e[r.key];i!==void 0&&(i.length>0&&(n=!0),t[r.key]=Nm)}n&&f(t)},[f])}}function Im(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 Lm(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 Rm({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 zm({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 Bm({initialScrollY:e,modalRef:t,theme:n}){hn({theme:n}),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(()=>{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 Vm({getEnvironmentProps:e,containerRef:t,dropdownRef:n,formElementRef:r,inputRef:i,initialScrollY:a,modalRef:o,theme:s}){Rm({getEnvironmentProps:e,panelElement:n.current,formElement:r.current,inputElement:i.current}),zm({container:t.current}),Bm({initialScrollY:a,modalRef:o,theme:s})}function Hm(){return{containerRef:z.useRef(null),modalRef:z.useRef(null),formElementRef:z.useRef(null),dropdownRef:z.useRef(null),inputRef:z.useRef(null)}}function Um({initialQuery:e,inputRef:t,refresh:n}){z.useEffect(()=>{e.length>0&&(n(),t.current&&t.current.focus())},[e,t,n])}function Wm(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 Gm({favoriteSearches:e,recentSearches:t,disableUserPersonalization:n}){return z.useCallback(function(r){if(n)return;let i=r.type===`content`?r.__docsearch_parent||Wm(r):r;i&&e.getAll().findIndex(e=>e.objectID===i.objectID)===-1&&t.add(i)},[e,t,n])}function Km({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 qm({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 Jm=1e3,Ym=Jm*60,Xm=Ym*60,Zm=[[Xm*24,`day`],[Xm,`hour`],[Ym,`minute`],[Jm,`second`]];function Qm(e,t=Date.now()){let[n]=Ne(()=>{var n;let r=Math.abs(Number(t)-Number(e)),[i,a]=(n=Zm.find(([e])=>r>=e))==null?Zm[Zm.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 $m=[`hit`,`attribute`,`tagName`];function eh(e,t){return t.split(`.`).reduce((e,t)=>e!=null&&e[t]?e[t]:null,e)}function th(e){let{hit:t,attribute:n,tagName:r=`span`}=e;return C(r,_(_({},mn(e,$m)),{},{dangerouslySetInnerHTML:{__html:eh(t,`_snippetResult.${n}.value`)||eh(t,n)}}))}function nh(e){var t;let{askAiResultsTitle:n=`Ask AI Assistant`}=e.translations||{},r=z.useId(),i=z.useMemo(()=>e.title?jp(e.title):null,[e.title]);return!e.collection||e.collection.items.length===0?null:e.collection.source.sourceId===kp.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(ah,_({key:t.objectID,item:t,translations:e.translations},e))))):e.collection.source.sourceId===kp.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(rh,_({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(rh,_({key:[e.title,t.objectID].join(`:`),item:t,index:n},e)))))}function rh({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=Np(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(qm,{title:z.createElement(th,{hit:e,attribute:`hierarchy.lvl0`}),subText:z.createElement(th,{hit:e,attribute:`content`})}),e.type===`askAI`?z.createElement(ih,{item:e,relativeDateFallbackText:d}):z.createElement(qm,{title:z.createElement(th,{hit:e,attribute:f}),subText:p}),l==null?void 0:l({item:e}),r({item:e}))))}function ih({item:e,relativeDateFallbackText:t}){let n=Qm(e.hierarchy.lvl2?new Date(e.hierarchy.lvl2):null);return z.createElement(qm,{title:jp(e.hierarchy.lvl1||``),subText:n||t})}function ah({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 oh=[`translations`];function sh(e){let{translations:t={}}=e,n=mn(e,oh),{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=Ap(n.state,`favoriteSearches`),l=Ap(n.state,`recentSearches`);return z.createElement(z.Fragment,null,c&&z.createElement(nh,_(_({},n),{},{title:o,collection:c,sourceIcon:z.createElement(Yp,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(nh,_(_({},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(Yp,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 ch({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(qp,null)),z.createElement(`p`,{className:`DocSearch-Title`},t),z.createElement(`p`,{className:`DocSearch-Help`},n))}let lh=[`translations`];function uh(e){let{translations:t={}}=e,n=mn(e,lh),{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(Jp,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 dh(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function fh({item:e,resultBadgeKey:t,translations:n={}}){if(!t)return null;let r=Ip(e,t);if(r==null)return null;let{resultBadgeLabelText:i=`Category`}=n,a=null;if(dh(r))a=String(r).trim();else if(Array.isArray(r)){let e=r.filter(dh).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 ph=[`translations`,`resultBadgeKey`];function mh(e){let{translations:t={},resultBadgeKey:n}=e,r=mn(e,ph),i=z.useCallback(()=>z.createElement(`div`,{className:`DocSearch-Hit-action`},z.createElement(Kp,null)),[]),a=z.useCallback(({item:e})=>z.createElement(fh,{item:e,resultBadgeKey:n,translations:{resultBadgeLabelText:t.resultBadgeLabelText}}),[n,t.resultBadgeLabelText]);return z.createElement(`div`,{className:`DocSearch-Dropdown-Container`},r.state.collections.map(e=>{if(e.items.length===0)return null;let n=Wp(e.items[0]);return z.createElement(nh,_(_({},r),{},{key:e.source.sourceId,translations:t,title:n,collection:e,renderIcon:({item:t,index:n})=>{var r;return z.createElement(z.Fragment,null,t.__docsearch_parent&&z.createElement(`svg`,{className:`DocSearch-Hit-Tree`,viewBox:`0 0 24 54`},z.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)?z.createElement(`path`,{d:`M8 6v42M20 27H8.3`}):z.createElement(`path`,{d:`M8 6v21M20 27H8.3`}))),z.createElement(`div`,{className:`DocSearch-Hit-icon`},z.createElement(Pr,{type:t.type})))},renderAction:i,renderResultBadge:a}))}),r.resultsFooterComponent&&z.createElement(`section`,{className:`DocSearch-HitsFooter`},z.createElement(r.resultsFooterComponent,{state:r.state})))}function hh(e,t){if(typeof e==`string`){let n=em(e);return n!==null&&t.has(n)}return e.length>0&&e.every(e=>hh(e,t))}function gh(e,t){let n=Object.entries(t);if(n.length===0)return e;let r=new Set(n.map(([e])=>e)),i=[];for(let[e,t]of n)t.length===1?i.push(`${e}:${t[0]}`):t.length>1&&i.push(t.map(t=>`${e}:${t}`));let a=[];return e&&Array.isArray(e)?a=e:e&&(a=[e]),[...a.filter(e=>!hh(e,r)),...i]}function _h({recentSearches:e,favoriteSearches:t,saveRecentSearch:n,onClose:r,disableUserPersonalization:i}){return i?[]:[{sourceId:kp.favoriteSearches,onSelect({item:e,event:t}){n(e),zp(t)||r()},getItemUrl({item:e}){return e.url},getItems(){return t.getAll()}},{sourceId:kp.recentSearches,onSelect({item:e,event:t}){n(e),zp(t)||r()},getItemUrl({item:e}){return e.url},getItems(){return e.getAll()}}]}async function vh({query:e,state:t,setContext:n,setStatus:r,searchClient:i,indexes:a,insights:o,appId:s,apiKey:c,maxResultsPerGroup:l,transformItems:u=Rp,saveRecentSearch:d,onClose:f,facetSelections:p}){let m=o;try{let{results:r}=await i.search({requests:a.map(t=>{var n,r,i,a,o,s,c;let l=t.name,u=t.searchParameters,d=gh(u==null?void 0:u.facetFilters,p.current);return _(_({query:e,indexName:l,attributesToRetrieve:(n=u==null?void 0:u.attributesToRetrieve)==null?[`hierarchy.lvl0`,`hierarchy.lvl1`,`hierarchy.lvl2`,`hierarchy.lvl3`,`hierarchy.lvl4`,`hierarchy.lvl5`,`hierarchy.lvl6`,`content`,`type`,`url`]:n,attributesToSnippet:(r=u==null?void 0:u.attributesToSnippet)==null?[`hierarchy.lvl1:15`,`hierarchy.lvl2:15`,`hierarchy.lvl3:15`,`hierarchy.lvl4:15`,`hierarchy.lvl5:15`,`hierarchy.lvl6:15`,`content:15`]:r,snippetEllipsisText:(i=u==null?void 0:u.snippetEllipsisText)==null?`…`:i,highlightPreTag:(a=u==null?void 0:u.highlightPreTag)==null?`<mark>`:a,highlightPostTag:(o=u==null?void 0:u.highlightPostTag)==null?`</mark>`:o,hitsPerPage:(s=u==null?void 0:u.hitsPerPage)==null?20:s,clickAnalytics:(c=u==null?void 0:u.clickAnalytics)==null?m:c},u),d?{facetFilters:d}:{})})});return r.flatMap(e=>{let r=e,{hits:i,nbHits:a}=r,o=Lp(u(i),e=>Wp(e),l);if(t.context.searchSuggestions.length<Object.keys(o).length){var p;n({searchSuggestions:_(_({},(p=t.context.searchSuggestions)==null?[]:p),Object.keys(o))})}if(a){let e=t.context.nbHits;n({nbHits:(e==null?0:e)+a})}let h={};return m&&(h={__autocomplete_indexName:r.index,__autocomplete_queryID:r.queryID,__autocomplete_algoliaCredentials:{appId:s,apiKey:c}}),Object.values(o).map((e,t)=>({sourceId:`hits_${r.index}_${t}`,onSelect({item:e,event:t}){d(e),zp(t)||f()},getItemUrl({item:e}){return e.url},getItems(){return Object.values(Lp(e,e=>e.hierarchy.lvl1,l)).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},h)})).flat()}}))})}catch(e){throw e.name===`RetryError`&&r(`error`),e}}function yh({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)}B();let bh=he(void 0);function xh(e){let t=ze(bh);if(t===void 0&&!e)throw Error(Yr(47));return t}B();function Sh(){return H(H({},Cd()),{},{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 Ch=H(H({},Ad),{},{disabled:W(e=>e.disabled),instantType:W(e=>e.instantType),openMethod:W(e=>e.openMethod),openChangeReason:W(e=>e.openChangeReason),modal:W(e=>e.modal),focusManagerModal:W(e=>e.focusManagerModal),stickIfOpen:W(e=>e.stickIfOpen),titleElementId:W(e=>e.titleElementId),descriptionElementId:W(e=>e.descriptionElementId),openOnHover:W(e=>e.openOnHover),closeDelay:W(e=>e.closeDelay),hasViewport:W(e=>e.hasViewport)});var wh=class e extends id{constructor(e,t,n=!1){let r=H(H({},Sh()),e),i=new xd;r.open&&(e==null?void 0:e.mounted)===void 0&&(r.mounted=!0),r.floatingRootContext=wd(i,t,n),super(r,{popupRef:T(),backdropRef:T(),internalBackdropRef:T(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:T(),beforeContentFocusGuardRef:T(),stickIfOpenTimeout:new Yo,triggerElements:i},Ch),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=md(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};pd(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}=dd(t,(t,r)=>new e(n,t,r));return Fe(()=>i==null?void 0:i.disposeEffect(),[i]),r}};B();function Th({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=wh.useStore(s==null?void 0:s.store,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});hd(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=dl()!=null;u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),bd(u,d),_d(u);let{forceUnmount:h}=vd(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,Do(ca))},[u]);Le(e.actionsRef,()=>({unmount:h,close:g}),[h,g]);let _=d||f,v=R(()=>({store:u}),[u]);return ko(bh.Provider,{value:v,children:[_&&ko(Dh,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})}function Eh(e){return xh(!0)?ko(Th,{props:e}):ko(hl,{children:ko(Th,{props:e})})}function Dh({store:e,modal:t}){var n,r;let i=Dl(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}});return yd(e,{activeTriggerProps:(n=i.reference)==null?mi:n,inactiveTriggerProps:(r=i.trigger)==null?mi:r,popupProps:R(()=>yi(ld,i.floating),[i.floating])}),null}B();let Oh=[`render`,`className`,`style`,`disabled`,`nativeButton`,`handle`,`payload`,`openOnHover`,`delay`,`closeDelay`,`id`],kh=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,Oh),h=xh(!0),g=(n=c==null?void 0:c.store)==null?h==null?void 0:h.store:n;if(!g)throw Error(Yr(74));let _=wo(p),v=g.useState(`isTriggerActive`,_),y=g.useState(`floatingRootContext`),b=g.useState(`isOpenedByTrigger`,_),x=g.useState(`triggerPopupId`,_),S=L(null),{registerTrigger:C,isMountedByThisTrigger:w}=gd(_,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=Hd(y,{enabled:!o&&y!=null&&u&&(O!==`touch`||T!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:tf(),restMs:d,delay:{close:f},triggerElementRef:S,isActiveTrigger:v,isClosing:()=>g.select(`transitionStatus`)===`ending`}),j=wl(y,{enabled:y!=null,stickIfOpen:D}),M=lp(()=>g.select(`open`),e=>{g.set(`openMethod`,e)}),ee=g.useState(`triggerProps`,w),{getButtonProps:N,buttonRef:te}=qa({disabled:o,native:s}),ne={open(e){return e&&T===`trigger-press`?Zi.open(e):Xi.open(e)}},{preFocusGuardRef:P,handlePreFocusGuardFocus:re,handleFocusTargetFocus:ie}=Sp(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?ko(E,{children:[ko(Os,{ref:P,onFocus:re}),ko(E,{children:ae},_),ko(Os,{ref:g.context.triggerFocusTargetRef,onFocus:ie})]}):ko(E,{children:ae},_)});B();let Ah=he(void 0);function jh(){let e=ze(Ah);if(e===void 0)throw Error(Yr(45));return e}B();let Mh=[`keepMounted`],Nh=bt(function(e,t){let{keepMounted:n=!1}=e,r=yr(e,Mh),{store:i}=xh();return i.useState(`mounted`)||n?ko(Ah.Provider,{value:n,children:ko(ol,H({ref:t},r))}):null});B();let Ph=he(void 0);function Fh(){let e=ze(Ph);if(!e)throw Error(Yr(46));return e}B();let Ih=[`render`,`className`,`style`,`anchor`,`positionMethod`,`side`,`align`,`sideOffset`,`alignOffset`,`collisionBoundary`,`collisionPadding`,`arrowPadding`,`sticky`,`disableAnchorTracking`,`collisionAvoidance`],Lh=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=$c}=e,_=yr(e,Ih),{store:v}=xh(),y=jh(),b=pl(),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=zo(O,!1,!1),N=Of({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?Tf: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]),Kf(C&&E===!0&&w!==`trigger-hover`,D===`touch`,O,T);let ne=Re(e=>{v.set(`positionerElement`,e)},[v]),P=If(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 ko(Ph.Provider,{value:N,children:[S&&E===!0&&w!==`trigger-hover`&&ko(Ff,{ref:v.context.internalBackdropRef,inert:_f(!C),cutout:T}),ko(ml,{id:b,children:P})]})});B();let Rh=he(void 0);function zh(){let[e,t]=Ne(0),n=Ba(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:R(()=>({register:n}),[n]),hasClosePart:e>0}}function Bh(e){let{value:t,children:n}=e;return ko(Rh.Provider,{value:t,children:n})}function Vh(){let e=ze(Rh);U(()=>e==null?void 0:e.register(),[e])}B();let Hh=[`render`,`className`,`style`,`initialFocus`,`finalFocus`],Uh=H(H({},Qi),Hi),Wh=bt(function(e,t){var n;let{render:r,className:i,style:a,initialFocus:o,finalFocus:s}=e,c=yr(e,Hh),{store:l}=xh(),u=Fh(),d=rf(!0)!=null,{context:f,hasClosePart:p}=zh(),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;Bo({open:m,ref:l.context.popupRef,onComplete(){if(m){var e,t;(e=(t=l.context).onOpenChangeComplete)==null||e.call(t,!0)}}}),Bd(T,{enabled:O&&!D,closeDelay:k});let j=o===void 0?ud(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`},ld),{},{"aria-labelledby":y,"aria-describedby":b,onKeyDown(e){d&&cf.has(e.key)&&e.stopPropagation()}}),lf(_),c],stateAttributesMapping:Uh});return ko(Cl,{context:T,openInteractionType:h,modal:M,disabled:!S||C===`trigger-hover`,initialFocus:j,returnFocus:s,restoreFocus:`popup`,previousFocusableElement:va(w)?w:void 0,nextFocusableElement:l.context.triggerFocusTargetRef,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:ko(Bh,{value:f,children:N})})});B();let Gh=[`render`,`className`,`style`],Kh=bt(function(e,t){let{render:n,className:r,style:i}=e,a=yr(e,Gh),{store:o}=xh(),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 qh=[`render`,`className`,`style`],Jh=bt(function(e,t){let{render:n,className:r,style:i}=e,a=yr(e,qh),{store:o}=xh(),s=wo(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),Ni(`h2`,e,{ref:t,props:[{id:s},a]})});B();let Yh=[`render`,`className`,`style`,`disabled`,`nativeButton`],Xh=bt(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0}=e,s=yr(e,Yh),{buttonRef:c,getButtonProps:l}=qa({disabled:a,focusableWhenDisabled:!1,native:o}),{store:u}=xh();return Vh(),Ni(`button`,e,{ref:[t,c],props:[{onClick(e){u.setOpen(!1,Do(`close-press`,e.nativeEvent))}},s,l]})});var Zh=`vercel.ai.error`,Qh=Symbol.for(Zh),$h,eg,tg=class e extends (eg=Error,$h=Qh,eg){constructor({name:e,message:t,cause:n}){super(t),this[$h]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,Zh)}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 ng(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.message:JSON.stringify(e)}var rg=`AI_InvalidArgumentError`,ig=`vercel.ai.error.${rg}`,ag=Symbol.for(ig),og,sg,cg=class extends (sg=tg,og=ag,sg){constructor({message:e,cause:t,argument:n}){super({name:rg,message:e,cause:t}),this[og]=!0,this.argument=n}static isInstance(e){return tg.hasMarker(e,ig)}},lg=`AI_JSONParseError`,ug=`vercel.ai.error.${lg}`,dg=Symbol.for(ug),fg,pg,mg=class extends (pg=tg,fg=dg,pg){constructor({text:e,cause:t}){super({name:lg,message:`JSON parsing failed: Text: ${e}.
|
|
27
|
+
Error message: ${ng(t)}`,cause:t}),this[fg]=!0,this.text=e}static isInstance(e){return tg.hasMarker(e,ug)}},hg=`AI_TypeValidationError`,gg=`vercel.ai.error.${hg}`,_g=Symbol.for(gg),vg,yg,bg=class e extends (yg=tg,vg=_g,yg){constructor({value:e,cause:t,context:n}){let r=`Type validation failed`;if(n!=null&&n.field&&(r+=` for ${n.field}`),n!=null&&n.entityName||n!=null&&n.entityId){r+=` (`;let e=[];n.entityName&&e.push(n.entityName),n.entityId&&e.push(`id: "${n.entityId}"`),r+=e.join(`, `),r+=`)`}super({name:hg,message:`${r}: Value: ${JSON.stringify(e)}.
|
|
28
|
+
Error message: ${ng(t)}`,cause:t}),this[vg]=!0,this.value=e,this.context=n}static isInstance(e){return tg.hasMarker(e,gg)}static wrap({value:t,cause:n,context:r}){var i,a,o;return e.isInstance(n)&&n.value===t&&((i=n.context)==null?void 0:i.field)===(r==null?void 0:r.field)&&((a=n.context)==null?void 0:a.entityName)===(r==null?void 0:r.entityName)&&((o=n.context)==null?void 0:o.entityId)===(r==null?void 0:r.entityId)?n:new e({value:t,cause:n,context:r})}},xg;function G(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 Sg=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Cg=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(xg=globalThis).__zod_globalConfig!=null||(xg.__zod_globalConfig={});let wg=globalThis.__zod_globalConfig;function Tg(e){return e&&Object.assign(wg,e),wg}let Eg=[`inst`,`continue`,`input`];function Dg(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 Og(e,t){return typeof t==`bigint`?t.toString():t}function kg(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function Ag(e){return e==null}function jg(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Mg(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 Ng=Symbol(`evaluating`);function Pg(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ng)return r===void 0&&(r=Ng,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Fg(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ig(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Lg(e){return JSON.stringify(e)}function Rg(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}let zg=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Bg(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}let Vg=kg(()=>{var e;if(wg.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 Hg(e){if(Bg(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Bg(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Ug(e){return Hg(e)?H({},e):Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let Wg=new Set([`string`,`number`,`symbol`]);function Gg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Kg(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 K(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 qg(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}let Jg={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Yg(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 Kg(e,Ig(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 Fg(this,`shape`,e),e},checks:[]}))}function Xg(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 Kg(e,Ig(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 Fg(this,`shape`,r),r},checks:[]}))}function Zg(e,t){if(!Hg(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 Kg(e,Ig(e._zod.def,{get shape(){let n=H(H({},e._zod.def.shape),t);return Fg(this,`shape`,n),n}}))}function Qg(e,t){if(!Hg(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Kg(e,Ig(e._zod.def,{get shape(){let n=H(H({},e._zod.def.shape),t);return Fg(this,`shape`,n),n}}))}function $g(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 Kg(e,Ig(e._zod.def,{get shape(){let n=H(H({},e._zod.def.shape),t._zod.def.shape);return Fg(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:(r=t._zod.def.checks)==null?[]:r}))}function e_(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 Kg(t,Ig(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 Fg(this,`shape`,i),i},checks:[]}))}function t_(e,t,n){return Kg(t,Ig(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 Fg(this,`shape`,i),i}}))}function n_(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 r_(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 i_(e,t){return t.map(t=>{var n;return(n=t).path!=null||(n.path=[]),t.path.unshift(e),t})}function a_(e){return typeof e==`string`?e:e==null?void 0:e.message}function o_(e,t,n){var r,i,a,o,s,c,l,u,d;let f=e.message?e.message:(r=(i=(a=(o=a_((s=e.inst)==null||(s=s._zod.def)==null||(c=s.error)==null?void 0:c.call(s,e)))==null?a_(t==null||(l=t.error)==null?void 0:l.call(t,e)):o)==null?a_((u=n.customError)==null?void 0:u.call(n,e)):a)==null?a_((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,Eg);return g.path!=null||(g.path=[]),g.message=f,t!=null&&t.reportInput&&(g.input=h),g}function s_(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function c_(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:H({},t)}let l_=(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,Og,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},u_=G(`$ZodError`,l_),d_=G(`$ZodError`,l_,{Parent:Error});function f_(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 p_(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 m_=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 Sg;if(o.issues.length){var s;let t=new((s=i==null?void 0:i.Err)==null?e:s)(o.issues.map(e=>o_(e,a,Tg())));throw zg(t,i==null?void 0:i.callee),t}return o.value},h_=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=>o_(e,a,Tg())));throw zg(t,i==null?void 0:i.callee),t}return o.value},g_=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 Sg;return a.issues.length?{success:!1,error:new(e==null?u_:e)(a.issues.map(e=>o_(e,i,Tg())))}:{success:!0,data:a.value}},__=g_(d_),v_=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=>o_(e,i,Tg())))}:{success:!0,data:a.value}},y_=v_(d_),b_=e=>(t,n,r)=>{let i=r?H(H({},r),{},{direction:`backward`}):{direction:`backward`};return m_(e)(t,n,i)},x_=e=>(t,n,r)=>m_(e)(t,n,r),S_=e=>async(t,n,r)=>{let i=r?H(H({},r),{},{direction:`backward`}):{direction:`backward`};return h_(e)(t,n,i)},C_=e=>async(t,n,r)=>h_(e)(t,n,r),w_=e=>(t,n,r)=>{let i=r?H(H({},r),{},{direction:`backward`}):{direction:`backward`};return g_(e)(t,n,i)},T_=e=>(t,n,r)=>g_(e)(t,n,r),E_=e=>async(t,n,r)=>{let i=r?H(H({},r),{},{direction:`backward`}):{direction:`backward`};return v_(e)(t,n,i)},D_=e=>async(t,n,r)=>v_(e)(t,n,r),O_=/^[cC][0-9a-z]{6,}$/,k_=/^[0-9a-z]+$/,A_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,j_=/^[0-9a-vA-V]{20}$/,M_=/^[A-Za-z0-9]{27}$/,N_=/^[a-zA-Z0-9_-]{21}$/,P_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,F_=/^([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})$/,I_=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)$/,L_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function R_(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}let z_=/^(?:(?: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])$/,B_=/^(([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])$/,H_=/^(([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])$/,U_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,W_=/^[A-Za-z0-9_-]*$/,G_=/^https?$/,K_=/^\+[1-9]\d{6,14}$/,q_=`(?:(?:\\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])))`,J_=RegExp(`^${q_}$`);function Y_(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 X_(e){return RegExp(`^${Y_(e)}$`)}function Z_(e){let t=Y_({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(`^${q_}T(?:${r})$`)}let Q_=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}$`)},$_=/^-?\d+$/,ev=/^-?\d+(?:\.\d+)?$/,tv=/^(?:true|false)$/i,nv=/^null$/i,rv=/^[^A-Z]*$/,iv=/^[^a-z]*$/,av=G(`$ZodCheck`,(e,t)=>{var n;e._zod!=null||(e._zod={}),e._zod.def=t,(n=e._zod).onattach!=null||(n.onattach=[])}),ov={number:`number`,bigint:`bigint`,object:`date`},sv=G(`$ZodCheckLessThan`,(e,t)=>{av.init(e,t);let n=ov[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})}}),cv=G(`$ZodCheckGreaterThan`,(e,t)=>{av.init(e,t);let n=ov[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})}}),lv=G(`$ZodCheckMultipleOf`,(e,t)=>{av.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):Mg(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})}}),uv=G(`$ZodCheckNumberFormat`,(e,t)=>{var n;av.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]=Jg[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=$_)}),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})}}),dv=G(`$ZodCheckMaxLength`,(e,t)=>{var n;av.init(e,t),(n=e._zod.def).when!=null||(n.when=e=>{let t=e.value;return!Ag(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=s_(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fv=G(`$ZodCheckMinLength`,(e,t)=>{var n;av.init(e,t),(n=e._zod.def).when!=null||(n.when=e=>{let t=e.value;return!Ag(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=s_(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),pv=G(`$ZodCheckLengthEquals`,(e,t)=>{var n;av.init(e,t),(n=e._zod.def).when!=null||(n.when=e=>{let t=e.value;return!Ag(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=s_(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}))}}),mv=G(`$ZodCheckStringFormat`,(e,t)=>{var n,r;av.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=()=>{})}),hv=G(`$ZodCheckRegex`,(e,t)=>{mv.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})}}),gv=G(`$ZodCheckLowerCase`,(e,t)=>{t.pattern!=null||(t.pattern=rv),mv.init(e,t)}),_v=G(`$ZodCheckUpperCase`,(e,t)=>{t.pattern!=null||(t.pattern=iv),mv.init(e,t)}),vv=G(`$ZodCheckIncludes`,(e,t)=>{av.init(e,t);let n=Gg(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})}}),yv=G(`$ZodCheckStartsWith`,(e,t)=>{av.init(e,t);let n=RegExp(`^${Gg(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})}}),bv=G(`$ZodCheckEndsWith`,(e,t)=>{av.init(e,t);let n=RegExp(`.*${Gg(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})}}),xv=G(`$ZodCheckOverwrite`,(e,t)=>{av.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Sv=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(`
|
|
38
29
|
`).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(`
|
|
39
|
-
`))}};let sv={major:4,minor:4,patch:3},cv=K(`$ZodType`,(e,t)=>{var n,r;e!=null||(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=sv;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=Bg(e),i;for(let o of t){if(o._zod.def.when){if(Vg(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 og;if(i||s instanceof Promise){var a;i=((a=i)==null?Promise.resolve():a).then(async()=>{await s,e.issues.length!==t&&(r||(r=Bg(e,t)))})}else{if(e.issues.length===t)continue;r||(r=Bg(e,t))}}return i?i.then(()=>e):e},n=(n,r,a)=>{if(Bg(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new og;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 og;return o.then(e=>t(e,i,a))}return t(o,i,a)}}vg(e,`~standard`,()=>({validate:t=>{try{var n;let r=t_(e,t);return r.success?{value:r.data}:{issues:(n=r.error)==null?void 0:n.issues}}catch(n){return r_(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}))}),lv=K(`$ZodString`,(e,t)=>{var n,r,i;cv.init(e,t),e._zod.pattern=(n=[...(r=e==null||(i=e._zod.bag)==null?void 0:i.patterns)==null?[]:r].pop())==null?I_(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}}),uv=K(`$ZodStringFormat`,(e,t)=>{Q_.init(e,t),lv.init(e,t)}),dv=K(`$ZodGUID`,(e,t)=>{t.pattern!=null||(t.pattern=y_),uv.init(e,t)}),fv=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=b_(e))}else t.pattern!=null||(t.pattern=b_());uv.init(e,t)}),pv=K(`$ZodEmail`,(e,t)=>{t.pattern!=null||(t.pattern=x_),uv.init(e,t)}),mv=K(`$ZodURL`,(e,t)=>{uv.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)===k_.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})}}}),hv=K(`$ZodEmoji`,(e,t)=>{t.pattern!=null||(t.pattern=S_()),uv.init(e,t)}),gv=K(`$ZodNanoID`,(e,t)=>{t.pattern!=null||(t.pattern=__),uv.init(e,t)}),_v=K(`$ZodCUID`,(e,t)=>{t.pattern!=null||(t.pattern=f_),uv.init(e,t)}),vv=K(`$ZodCUID2`,(e,t)=>{t.pattern!=null||(t.pattern=p_),uv.init(e,t)}),yv=K(`$ZodULID`,(e,t)=>{t.pattern!=null||(t.pattern=m_),uv.init(e,t)}),bv=K(`$ZodXID`,(e,t)=>{t.pattern!=null||(t.pattern=h_),uv.init(e,t)}),xv=K(`$ZodKSUID`,(e,t)=>{t.pattern!=null||(t.pattern=g_),uv.init(e,t)}),Sv=K(`$ZodISODateTime`,(e,t)=>{t.pattern!=null||(t.pattern=F_(t)),uv.init(e,t)}),Cv=K(`$ZodISODate`,(e,t)=>{t.pattern!=null||(t.pattern=M_),uv.init(e,t)}),wv=K(`$ZodISOTime`,(e,t)=>{t.pattern!=null||(t.pattern=P_(t)),uv.init(e,t)}),Tv=K(`$ZodISODuration`,(e,t)=>{t.pattern!=null||(t.pattern=v_),uv.init(e,t)}),Ev=K(`$ZodIPv4`,(e,t)=>{t.pattern!=null||(t.pattern=C_),uv.init(e,t),e._zod.bag.format=`ipv4`}),Dv=K(`$ZodIPv6`,(e,t)=>{t.pattern!=null||(t.pattern=w_),uv.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})}}}),Ov=K(`$ZodCIDRv4`,(e,t)=>{t.pattern!=null||(t.pattern=T_),uv.init(e,t)}),kv=K(`$ZodCIDRv6`,(e,t)=>{t.pattern!=null||(t.pattern=E_),uv.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 Av(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 jv=K(`$ZodBase64`,(e,t)=>{t.pattern!=null||(t.pattern=D_),uv.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Av(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Mv(e){if(!O_.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Av(t.padEnd(Math.ceil(t.length/4)*4,`=`))}let Nv=K(`$ZodBase64URL`,(e,t)=>{t.pattern!=null||(t.pattern=O_),uv.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Mv(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Pv=K(`$ZodE164`,(e,t)=>{t.pattern!=null||(t.pattern=A_),uv.init(e,t)});function Fv(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 Iv=K(`$ZodJWT`,(e,t)=>{uv.init(e,t),e._zod.check=n=>{Fv(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Lv=K(`$ZodNumber`,(e,t)=>{var n;cv.init(e,t),e._zod.pattern=(n=e._zod.bag.pattern)==null?R_: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}}),Rv=K(`$ZodNumberFormat`,(e,t)=>{J_.init(e,t),Lv.init(e,t)}),zv=K(`$ZodBoolean`,(e,t)=>{cv.init(e,t),e._zod.pattern=z_,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}}),Bv=K(`$ZodNull`,(e,t)=>{cv.init(e,t),e._zod.pattern=B_,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}}),Vv=K(`$ZodUnknown`,(e,t)=>{cv.init(e,t),e._zod.parse=e=>e}),Hv=K(`$ZodNever`,(e,t)=>{cv.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Uv(e,t,n){e.issues.length&&t.issues.push(...Hg(n,e.issues)),t.value[n]=e.value}let Wv=K(`$ZodArray`,(e,t)=>{cv.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=>Uv(t,n,e))):Uv(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Gv(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...Hg(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 Kv(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=jg(e.shape);return U(U({},e),{},{keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)})}function qv(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=>Gv(e,n,i,t,u,d))):Gv(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 Jv=K(`$ZodObject`,(e,t)=>{cv.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=pg(()=>Kv(t));vg(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=wg,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=>Gv(n,t,e,s,i,a))):Gv(o,t,e,s,i,a)}return a?qv(c,s,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),Yv=K(`$ZodObjectJIT`,(e,t)=>{Jv.init(e,t);let n=e._zod.parse,r=pg(()=>Kv(t)),i=e=>{let t=new ov([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=xg(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=xg(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(`
|
|
30
|
+
`))}};let Cv={major:4,minor:4,patch:3},wv=G(`$ZodType`,(e,t)=>{var n,r;e!=null||(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Cv;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=n_(e),i;for(let o of t){if(o._zod.def.when){if(r_(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 Sg;if(i||s instanceof Promise){var a;i=((a=i)==null?Promise.resolve():a).then(async()=>{await s,e.issues.length!==t&&(r||(r=n_(e,t)))})}else{if(e.issues.length===t)continue;r||(r=n_(e,t))}}return i?i.then(()=>e):e},n=(n,r,a)=>{if(n_(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Sg;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 Sg;return o.then(e=>t(e,i,a))}return t(o,i,a)}}Pg(e,`~standard`,()=>({validate:t=>{try{var n;let r=__(e,t);return r.success?{value:r.data}:{issues:(n=r.error)==null?void 0:n.issues}}catch(n){return y_(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}))}),Tv=G(`$ZodString`,(e,t)=>{var n,r,i;wv.init(e,t),e._zod.pattern=(n=[...(r=e==null||(i=e._zod.bag)==null?void 0:i.patterns)==null?[]:r].pop())==null?Q_(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}}),Ev=G(`$ZodStringFormat`,(e,t)=>{mv.init(e,t),Tv.init(e,t)}),Dv=G(`$ZodGUID`,(e,t)=>{t.pattern!=null||(t.pattern=F_),Ev.init(e,t)}),Ov=G(`$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=I_(e))}else t.pattern!=null||(t.pattern=I_());Ev.init(e,t)}),kv=G(`$ZodEmail`,(e,t)=>{t.pattern!=null||(t.pattern=L_),Ev.init(e,t)}),Av=G(`$ZodURL`,(e,t)=>{Ev.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)===G_.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})}}}),jv=G(`$ZodEmoji`,(e,t)=>{t.pattern!=null||(t.pattern=R_()),Ev.init(e,t)}),Mv=G(`$ZodNanoID`,(e,t)=>{t.pattern!=null||(t.pattern=N_),Ev.init(e,t)}),Nv=G(`$ZodCUID`,(e,t)=>{t.pattern!=null||(t.pattern=O_),Ev.init(e,t)}),Pv=G(`$ZodCUID2`,(e,t)=>{t.pattern!=null||(t.pattern=k_),Ev.init(e,t)}),Fv=G(`$ZodULID`,(e,t)=>{t.pattern!=null||(t.pattern=A_),Ev.init(e,t)}),Iv=G(`$ZodXID`,(e,t)=>{t.pattern!=null||(t.pattern=j_),Ev.init(e,t)}),Lv=G(`$ZodKSUID`,(e,t)=>{t.pattern!=null||(t.pattern=M_),Ev.init(e,t)}),Rv=G(`$ZodISODateTime`,(e,t)=>{t.pattern!=null||(t.pattern=Z_(t)),Ev.init(e,t)}),zv=G(`$ZodISODate`,(e,t)=>{t.pattern!=null||(t.pattern=J_),Ev.init(e,t)}),Bv=G(`$ZodISOTime`,(e,t)=>{t.pattern!=null||(t.pattern=X_(t)),Ev.init(e,t)}),Vv=G(`$ZodISODuration`,(e,t)=>{t.pattern!=null||(t.pattern=P_),Ev.init(e,t)}),Hv=G(`$ZodIPv4`,(e,t)=>{t.pattern!=null||(t.pattern=z_),Ev.init(e,t),e._zod.bag.format=`ipv4`}),Uv=G(`$ZodIPv6`,(e,t)=>{t.pattern!=null||(t.pattern=B_),Ev.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})}}}),Wv=G(`$ZodCIDRv4`,(e,t)=>{t.pattern!=null||(t.pattern=V_),Ev.init(e,t)}),Gv=G(`$ZodCIDRv6`,(e,t)=>{t.pattern!=null||(t.pattern=H_),Ev.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 Kv(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 qv=G(`$ZodBase64`,(e,t)=>{t.pattern!=null||(t.pattern=U_),Ev.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Kv(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Jv(e){if(!W_.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Kv(t.padEnd(Math.ceil(t.length/4)*4,`=`))}let Yv=G(`$ZodBase64URL`,(e,t)=>{t.pattern!=null||(t.pattern=W_),Ev.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Jv(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Xv=G(`$ZodE164`,(e,t)=>{t.pattern!=null||(t.pattern=K_),Ev.init(e,t)});function Zv(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 Qv=G(`$ZodJWT`,(e,t)=>{Ev.init(e,t),e._zod.check=n=>{Zv(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),$v=G(`$ZodNumber`,(e,t)=>{var n;wv.init(e,t),e._zod.pattern=(n=e._zod.bag.pattern)==null?ev: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}}),ey=G(`$ZodNumberFormat`,(e,t)=>{uv.init(e,t),$v.init(e,t)}),ty=G(`$ZodBoolean`,(e,t)=>{wv.init(e,t),e._zod.pattern=tv,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}}),ny=G(`$ZodNull`,(e,t)=>{wv.init(e,t),e._zod.pattern=nv,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}}),ry=G(`$ZodUnknown`,(e,t)=>{wv.init(e,t),e._zod.parse=e=>e}),iy=G(`$ZodNever`,(e,t)=>{wv.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function ay(e,t,n){e.issues.length&&t.issues.push(...i_(n,e.issues)),t.value[n]=e.value}let oy=G(`$ZodArray`,(e,t)=>{wv.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=>ay(t,n,e))):ay(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function sy(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...i_(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 cy(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=qg(e.shape);return H(H({},e),{},{keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)})}function ly(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=>sy(e,n,i,t,u,d))):sy(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 uy=G(`$ZodObject`,(e,t)=>{wv.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=kg(()=>cy(t));Pg(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=Bg,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=>sy(n,t,e,s,i,a))):sy(o,t,e,s,i,a)}return a?ly(c,s,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),dy=G(`$ZodObjectJIT`,(e,t)=>{uy.init(e,t);let n=e._zod.parse,r=kg(()=>cy(t)),i=e=>{let t=new Sv([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Lg(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=Lg(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(`
|
|
40
31
|
if (${n}.issues.length) {
|
|
41
32
|
if (${o} in input) {
|
|
42
33
|
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
@@ -95,18 +86,27 @@ ${t}`,d++;break;case`id`:l=t.includes(`\0`)?void 0:t;break;case`retry`:/^\d+$/.t
|
|
|
95
86
|
}
|
|
96
87
|
}
|
|
97
88
|
|
|
98
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let l=t.compile();return(t,n)=>l(e,t,n)},a,o=wg,s=!cg.jitless,c=s&&Tg.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?qv([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Xv(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=>!Bg(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=>Wg(e,r,lg())))}),t)}let Zv=K(`$ZodUnion`,(e,t)=>{cv.init(e,t),vg(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),vg(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),vg(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),vg(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=>hg(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=>Xv(t,r,e,i)):Xv(o,r,e,i)}}),Qv=K(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Zv.init(e,t);let n=e._zod.parse;vg(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=pg(()=>{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(!wg(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)}}),$v=K(`$ZodIntersection`,(e,t)=>{cv.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])=>ty(e,t,n)):ty(e,i,a)}});function ey(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Eg(e)&&Eg(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=ey(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=ey(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 ty(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})),Bg(e))return e;let o=ey(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}let ny=K(`$ZodRecord`,(e,t)=>{cv.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Eg(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=>Wg(e,r,lg())),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(...Hg(s,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...Hg(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`&&R_.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=>Wg(e,r,lg())),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(...Hg(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Hg(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),ry=K(`$ZodEnum`,(e,t)=>{cv.init(e,t);let n=dg(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Og.has(typeof e)).map(e=>typeof e==`string`?kg(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}}),iy=K(`$ZodLiteral`,(e,t)=>{if(cv.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`?kg(e):e?kg(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}}),ay=K(`$ZodTransform`,(e,t)=>{cv.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new sg(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 og;return n.value=i,n.fallback=!0,n}});function oy(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let sy=K(`$ZodOptional`,(e,t)=>{cv.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,vg(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),vg(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${hg(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=>oy(e,r)):oy(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),cy=K(`$ZodExactOptional`,(e,t)=>{sy.init(e,t),vg(e._zod,`values`,()=>t.innerType._zod.values),vg(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ly=K(`$ZodNullable`,(e,t)=>{cv.init(e,t),vg(e._zod,`optin`,()=>t.innerType._zod.optin),vg(e._zod,`optout`,()=>t.innerType._zod.optout),vg(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${hg(e.source)}|null)$`):void 0}),vg(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)}),uy=K(`$ZodDefault`,(e,t)=>{cv.init(e,t),e._zod.optin=`optional`,vg(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=>dy(e,t)):dy(r,t)}});function dy(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}let fy=K(`$ZodPrefault`,(e,t)=>{cv.init(e,t),e._zod.optin=`optional`,vg(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))}),py=K(`$ZodNonOptional`,(e,t)=>{cv.init(e,t),vg(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=>my(t,e)):my(i,e)}});function my(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 hy=K(`$ZodCatch`,(e,t)=>{cv.init(e,t),e._zod.optin=`optional`,vg(e._zod,`optout`,()=>t.innerType._zod.optout),vg(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=>Wg(e,n,lg()))},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=>Wg(e,n,lg()))},input:e.value})),e.issues=[],e.fallback=!0),e)}}),gy=K(`$ZodPipe`,(e,t)=>{cv.init(e,t),vg(e._zod,`values`,()=>t.in._zod.values),vg(e._zod,`optin`,()=>t.in._zod.optin),vg(e._zod,`optout`,()=>t.out._zod.optout),vg(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=>_y(e,t.in,n)):_y(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>_y(e,t.out,n)):_y(r,t.out,n)}});function _y(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 vy=K(`$ZodReadonly`,(e,t)=>{cv.init(e,t),vg(e._zod,`propValues`,()=>t.innerType._zod.propValues),vg(e._zod,`values`,()=>t.innerType._zod.values),vg(e._zod,`optin`,()=>{var e;return(e=t.innerType)==null||(e=e._zod)==null?void 0:e.optin}),vg(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(yy):yy(r)}});function yy(e){return e.value=Object.freeze(e.value),e}let by=K(`$ZodLazy`,(e,t)=>{cv.init(e,t),vg(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||(e._cachedInner=t.getter()),e._cachedInner}),vg(e._zod,`pattern`,()=>{var t;return(t=e._zod.innerType)==null||(t=t._zod)==null?void 0:t.pattern}),vg(e._zod,`propValues`,()=>{var t;return(t=e._zod.innerType)==null||(t=t._zod)==null?void 0:t.propValues}),vg(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}),vg(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)}),xy=K(`$ZodCustom`,(e,t)=>{U_.init(e,t),cv.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=>Sy(t,n,r,e));Sy(i,n,r,e)}});function Sy(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(Kg(e))}}var Cy,wy=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 Ty(){return new wy}(Cy=globalThis).__zod_globalRegistry!=null||(Cy.__zod_globalRegistry=Ty());let Ey=globalThis.__zod_globalRegistry;function Dy(e,t){return new e(U({type:`string`},q(t)))}function Oy(e,t){return new e(U({type:`string`,format:`email`,check:`string_format`,abort:!1},q(t)))}function ky(e,t){return new e(U({type:`string`,format:`guid`,check:`string_format`,abort:!1},q(t)))}function Ay(e,t){return new e(U({type:`string`,format:`uuid`,check:`string_format`,abort:!1},q(t)))}function jy(e,t){return new e(U({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`},q(t)))}function My(e,t){return new e(U({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`},q(t)))}function Ny(e,t){return new e(U({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`},q(t)))}function Py(e,t){return new e(U({type:`string`,format:`url`,check:`string_format`,abort:!1},q(t)))}function Fy(e,t){return new e(U({type:`string`,format:`emoji`,check:`string_format`,abort:!1},q(t)))}function Iy(e,t){return new e(U({type:`string`,format:`nanoid`,check:`string_format`,abort:!1},q(t)))}function Ly(e,t){return new e(U({type:`string`,format:`cuid`,check:`string_format`,abort:!1},q(t)))}function Ry(e,t){return new e(U({type:`string`,format:`cuid2`,check:`string_format`,abort:!1},q(t)))}function zy(e,t){return new e(U({type:`string`,format:`ulid`,check:`string_format`,abort:!1},q(t)))}function By(e,t){return new e(U({type:`string`,format:`xid`,check:`string_format`,abort:!1},q(t)))}function Vy(e,t){return new e(U({type:`string`,format:`ksuid`,check:`string_format`,abort:!1},q(t)))}function Hy(e,t){return new e(U({type:`string`,format:`ipv4`,check:`string_format`,abort:!1},q(t)))}function Uy(e,t){return new e(U({type:`string`,format:`ipv6`,check:`string_format`,abort:!1},q(t)))}function Wy(e,t){return new e(U({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1},q(t)))}function Gy(e,t){return new e(U({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1},q(t)))}function Ky(e,t){return new e(U({type:`string`,format:`base64`,check:`string_format`,abort:!1},q(t)))}function qy(e,t){return new e(U({type:`string`,format:`base64url`,check:`string_format`,abort:!1},q(t)))}function Jy(e,t){return new e(U({type:`string`,format:`e164`,check:`string_format`,abort:!1},q(t)))}function Yy(e,t){return new e(U({type:`string`,format:`jwt`,check:`string_format`,abort:!1},q(t)))}function Xy(e,t){return new e(U({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null},q(t)))}function Zy(e,t){return new e(U({type:`string`,format:`date`,check:`string_format`},q(t)))}function Qy(e,t){return new e(U({type:`string`,format:`time`,check:`string_format`,precision:null},q(t)))}function $y(e,t){return new e(U({type:`string`,format:`duration`,check:`string_format`},q(t)))}function eb(e,t){return new e(U({type:`number`,checks:[]},q(t)))}function tb(e,t){return new e(U({type:`number`,check:`number_format`,abort:!1,format:`safeint`},q(t)))}function nb(e,t){return new e(U({type:`boolean`},q(t)))}function rb(e,t){return new e(U({type:`null`},q(t)))}function ib(e){return new e({type:`unknown`})}function ab(e,t){return new e(U({type:`never`},q(t)))}function ob(e,t){return new G_(U(U({check:`less_than`},q(t)),{},{value:e,inclusive:!1}))}function sb(e,t){return new G_(U(U({check:`less_than`},q(t)),{},{value:e,inclusive:!0}))}function cb(e,t){return new K_(U(U({check:`greater_than`},q(t)),{},{value:e,inclusive:!1}))}function lb(e,t){return new K_(U(U({check:`greater_than`},q(t)),{},{value:e,inclusive:!0}))}function ub(e,t){return new q_(U(U({check:`multiple_of`},q(t)),{},{value:e}))}function db(e,t){return new Y_(U(U({check:`max_length`},q(t)),{},{maximum:e}))}function fb(e,t){return new X_(U(U({check:`min_length`},q(t)),{},{minimum:e}))}function pb(e,t){return new Z_(U(U({check:`length_equals`},q(t)),{},{length:e}))}function mb(e,t){return new $_(U(U({check:`string_format`,format:`regex`},q(t)),{},{pattern:e}))}function hb(e){return new ev(U({check:`string_format`,format:`lowercase`},q(e)))}function gb(e){return new tv(U({check:`string_format`,format:`uppercase`},q(e)))}function _b(e,t){return new nv(U(U({check:`string_format`,format:`includes`},q(t)),{},{includes:e}))}function vb(e,t){return new rv(U(U({check:`string_format`,format:`starts_with`},q(t)),{},{prefix:e}))}function yb(e,t){return new iv(U(U({check:`string_format`,format:`ends_with`},q(t)),{},{suffix:e}))}function bb(e){return new av({check:`overwrite`,tx:e})}function xb(e){return bb(t=>t.normalize(e))}function Sb(){return bb(e=>e.trim())}function Cb(){return bb(e=>e.toLowerCase())}function wb(){return bb(e=>e.toUpperCase())}function Tb(){return bb(e=>Sg(e))}function Eb(e,t,n){return new e(U({type:`array`,element:t},q(n)))}function Db(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 Ob(e,t,n){return new e(U({type:`custom`,check:`custom`,fn:t},q(n)))}function kb(e,t){let n=Ab(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Kg(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(Kg(r))}},e(t.value,t)),t);return n}function Ab(e,t){let n=new U_(U({check:`custom`},q(t)));return n._zod.check=e,n}function jb(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?Ey: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 Mb(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),Mb(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`&&Fb(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 Nb(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>
|
|
89
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let l=t.compile();return(t,n)=>l(e,t,n)},a,o=Bg,s=!wg.jitless,c=s&&Vg.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?ly([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function fy(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=>!n_(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=>o_(e,r,Tg())))}),t)}let py=G(`$ZodUnion`,(e,t)=>{wv.init(e,t),Pg(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),Pg(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Pg(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Pg(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=>jg(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=>fy(t,r,e,i)):fy(o,r,e,i)}}),my=G(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,py.init(e,t);let n=e._zod.parse;Pg(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=kg(()=>{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(!Bg(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)}}),hy=G(`$ZodIntersection`,(e,t)=>{wv.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])=>_y(e,t,n)):_y(e,i,a)}});function gy(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Hg(e)&&Hg(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=gy(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=gy(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 _y(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})),n_(e))return e;let o=gy(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}let vy=G(`$ZodRecord`,(e,t)=>{wv.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Hg(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=>o_(e,r,Tg())),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(...i_(s,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...i_(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`&&ev.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=>o_(e,r,Tg())),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(...i_(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...i_(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),yy=G(`$ZodEnum`,(e,t)=>{wv.init(e,t);let n=Dg(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Wg.has(typeof e)).map(e=>typeof e==`string`?Gg(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}}),by=G(`$ZodLiteral`,(e,t)=>{if(wv.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`?Gg(e):e?Gg(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}}),xy=G(`$ZodTransform`,(e,t)=>{wv.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Cg(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 Sg;return n.value=i,n.fallback=!0,n}});function Sy(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let Cy=G(`$ZodOptional`,(e,t)=>{wv.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,Pg(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Pg(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${jg(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=>Sy(e,r)):Sy(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),wy=G(`$ZodExactOptional`,(e,t)=>{Cy.init(e,t),Pg(e._zod,`values`,()=>t.innerType._zod.values),Pg(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Ty=G(`$ZodNullable`,(e,t)=>{wv.init(e,t),Pg(e._zod,`optin`,()=>t.innerType._zod.optin),Pg(e._zod,`optout`,()=>t.innerType._zod.optout),Pg(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${jg(e.source)}|null)$`):void 0}),Pg(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)}),Ey=G(`$ZodDefault`,(e,t)=>{wv.init(e,t),e._zod.optin=`optional`,Pg(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=>Dy(e,t)):Dy(r,t)}});function Dy(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}let Oy=G(`$ZodPrefault`,(e,t)=>{wv.init(e,t),e._zod.optin=`optional`,Pg(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))}),ky=G(`$ZodNonOptional`,(e,t)=>{wv.init(e,t),Pg(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=>Ay(t,e)):Ay(i,e)}});function Ay(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 jy=G(`$ZodCatch`,(e,t)=>{wv.init(e,t),e._zod.optin=`optional`,Pg(e._zod,`optout`,()=>t.innerType._zod.optout),Pg(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=>o_(e,n,Tg()))},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=>o_(e,n,Tg()))},input:e.value})),e.issues=[],e.fallback=!0),e)}}),My=G(`$ZodPipe`,(e,t)=>{wv.init(e,t),Pg(e._zod,`values`,()=>t.in._zod.values),Pg(e._zod,`optin`,()=>t.in._zod.optin),Pg(e._zod,`optout`,()=>t.out._zod.optout),Pg(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=>Ny(e,t.in,n)):Ny(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ny(e,t.out,n)):Ny(r,t.out,n)}});function Ny(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 Py=G(`$ZodReadonly`,(e,t)=>{wv.init(e,t),Pg(e._zod,`propValues`,()=>t.innerType._zod.propValues),Pg(e._zod,`values`,()=>t.innerType._zod.values),Pg(e._zod,`optin`,()=>{var e;return(e=t.innerType)==null||(e=e._zod)==null?void 0:e.optin}),Pg(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(Fy):Fy(r)}});function Fy(e){return e.value=Object.freeze(e.value),e}let Iy=G(`$ZodLazy`,(e,t)=>{wv.init(e,t),Pg(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||(e._cachedInner=t.getter()),e._cachedInner}),Pg(e._zod,`pattern`,()=>{var t;return(t=e._zod.innerType)==null||(t=t._zod)==null?void 0:t.pattern}),Pg(e._zod,`propValues`,()=>{var t;return(t=e._zod.innerType)==null||(t=t._zod)==null?void 0:t.propValues}),Pg(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}),Pg(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)}),Ly=G(`$ZodCustom`,(e,t)=>{av.init(e,t),wv.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=>Ry(t,n,r,e));Ry(i,n,r,e)}});function Ry(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(c_(e))}}var zy,By=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 Vy(){return new By}(zy=globalThis).__zod_globalRegistry!=null||(zy.__zod_globalRegistry=Vy());let Hy=globalThis.__zod_globalRegistry;function Uy(e,t){return new e(H({type:`string`},K(t)))}function Wy(e,t){return new e(H({type:`string`,format:`email`,check:`string_format`,abort:!1},K(t)))}function Gy(e,t){return new e(H({type:`string`,format:`guid`,check:`string_format`,abort:!1},K(t)))}function Ky(e,t){return new e(H({type:`string`,format:`uuid`,check:`string_format`,abort:!1},K(t)))}function qy(e,t){return new e(H({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`},K(t)))}function Jy(e,t){return new e(H({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`},K(t)))}function Yy(e,t){return new e(H({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`},K(t)))}function Xy(e,t){return new e(H({type:`string`,format:`url`,check:`string_format`,abort:!1},K(t)))}function Zy(e,t){return new e(H({type:`string`,format:`emoji`,check:`string_format`,abort:!1},K(t)))}function Qy(e,t){return new e(H({type:`string`,format:`nanoid`,check:`string_format`,abort:!1},K(t)))}function $y(e,t){return new e(H({type:`string`,format:`cuid`,check:`string_format`,abort:!1},K(t)))}function eb(e,t){return new e(H({type:`string`,format:`cuid2`,check:`string_format`,abort:!1},K(t)))}function tb(e,t){return new e(H({type:`string`,format:`ulid`,check:`string_format`,abort:!1},K(t)))}function nb(e,t){return new e(H({type:`string`,format:`xid`,check:`string_format`,abort:!1},K(t)))}function rb(e,t){return new e(H({type:`string`,format:`ksuid`,check:`string_format`,abort:!1},K(t)))}function ib(e,t){return new e(H({type:`string`,format:`ipv4`,check:`string_format`,abort:!1},K(t)))}function ab(e,t){return new e(H({type:`string`,format:`ipv6`,check:`string_format`,abort:!1},K(t)))}function ob(e,t){return new e(H({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1},K(t)))}function sb(e,t){return new e(H({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1},K(t)))}function cb(e,t){return new e(H({type:`string`,format:`base64`,check:`string_format`,abort:!1},K(t)))}function lb(e,t){return new e(H({type:`string`,format:`base64url`,check:`string_format`,abort:!1},K(t)))}function ub(e,t){return new e(H({type:`string`,format:`e164`,check:`string_format`,abort:!1},K(t)))}function db(e,t){return new e(H({type:`string`,format:`jwt`,check:`string_format`,abort:!1},K(t)))}function fb(e,t){return new e(H({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null},K(t)))}function pb(e,t){return new e(H({type:`string`,format:`date`,check:`string_format`},K(t)))}function mb(e,t){return new e(H({type:`string`,format:`time`,check:`string_format`,precision:null},K(t)))}function hb(e,t){return new e(H({type:`string`,format:`duration`,check:`string_format`},K(t)))}function gb(e,t){return new e(H({type:`number`,checks:[]},K(t)))}function _b(e,t){return new e(H({type:`number`,check:`number_format`,abort:!1,format:`safeint`},K(t)))}function vb(e,t){return new e(H({type:`boolean`},K(t)))}function yb(e,t){return new e(H({type:`null`},K(t)))}function bb(e){return new e({type:`unknown`})}function xb(e,t){return new e(H({type:`never`},K(t)))}function Sb(e,t){return new sv(H(H({check:`less_than`},K(t)),{},{value:e,inclusive:!1}))}function Cb(e,t){return new sv(H(H({check:`less_than`},K(t)),{},{value:e,inclusive:!0}))}function wb(e,t){return new cv(H(H({check:`greater_than`},K(t)),{},{value:e,inclusive:!1}))}function Tb(e,t){return new cv(H(H({check:`greater_than`},K(t)),{},{value:e,inclusive:!0}))}function Eb(e,t){return new lv(H(H({check:`multiple_of`},K(t)),{},{value:e}))}function Db(e,t){return new dv(H(H({check:`max_length`},K(t)),{},{maximum:e}))}function Ob(e,t){return new fv(H(H({check:`min_length`},K(t)),{},{minimum:e}))}function kb(e,t){return new pv(H(H({check:`length_equals`},K(t)),{},{length:e}))}function Ab(e,t){return new hv(H(H({check:`string_format`,format:`regex`},K(t)),{},{pattern:e}))}function jb(e){return new gv(H({check:`string_format`,format:`lowercase`},K(e)))}function Mb(e){return new _v(H({check:`string_format`,format:`uppercase`},K(e)))}function Nb(e,t){return new vv(H(H({check:`string_format`,format:`includes`},K(t)),{},{includes:e}))}function Pb(e,t){return new yv(H(H({check:`string_format`,format:`starts_with`},K(t)),{},{prefix:e}))}function Fb(e,t){return new bv(H(H({check:`string_format`,format:`ends_with`},K(t)),{},{suffix:e}))}function Ib(e){return new xv({check:`overwrite`,tx:e})}function Lb(e){return Ib(t=>t.normalize(e))}function Rb(){return Ib(e=>e.trim())}function zb(){return Ib(e=>e.toLowerCase())}function Bb(){return Ib(e=>e.toUpperCase())}function Vb(){return Ib(e=>Rg(e))}function Hb(e,t,n){return new e(H({type:`array`,element:t},K(n)))}function Ub(e,t,n){let r=K(n);return r.abort!=null||(r.abort=!0),new e(H({type:`custom`,check:`custom`,fn:t},r))}function Wb(e,t,n){return new e(H({type:`custom`,check:`custom`,fn:t},K(n)))}function Gb(e,t){let n=Kb(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(c_(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(c_(r))}},e(t.value,t)),t);return n}function Kb(e,t){let n=new av(H({check:`custom`},K(t)));return n._zod.check=e,n}function qb(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?Hy: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 Jb(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),Jb(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`&&Zb(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 Yb(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>
|
|
99
90
|
|
|
100
|
-
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 Pb(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:Lb(t,`input`,e.processors),output:Lb(t,`output`,e.processors)}}),enumerable:!1,writable:!1}),n}catch(e){throw Error(`Error converting schema to JSON.`)}}function Fb(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 Fb(r.element,n);if(r.type===`set`)return Fb(r.valueType,n);if(r.type===`lazy`)return Fb(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 Fb(r.innerType,n);if(r.type===`intersection`)return Fb(r.left,n)||Fb(r.right,n);if(r.type===`record`||r.type===`map`)return Fb(r.keyType,n)||Fb(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Fb(r.in,n)||Fb(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Fb(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Fb(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Fb(e,n))return!0;return!!(r.rest&&Fb(r.rest,n))}return!1}let Ib=(e,t={})=>n=>{let r=jb(U(U({},n),{},{processors:t}));return Mb(e,r),Nb(r,e),Pb(r,e)},Lb=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r==null?{}:r,o=jb(U(U({},i==null?{}:i),{},{target:a,io:t,processors:n}));return Mb(e,o),Nb(o,e),Pb(o,e)},Rb={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},zb=(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=Rb[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}))])}},Bb=(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)},Vb=(e,t,n,r)=>{n.type=`boolean`},Hb=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},Ub=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},Wb=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Gb=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},Kb=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},qb=(e,t,n,r)=>{n.not={}},Jb=(e,t,n,r)=>{},Yb=(e,t,n,r)=>{},Xb=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},Zb=(e,t,n,r)=>{let i=e._zod.def,a=dg(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Qb=(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},$b=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},ex=(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},tx=(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)},nx=(e,t,n,r)=>{n.type=`boolean`},rx=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},ix=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},ax=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},ox=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},sx=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},cx=(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=Mb(a.element,t,U(U({},r),{},{path:[...r.path,`items`]}))},lx=(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]=Mb(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=Mb(o.catchall,t,U(U({},r),{},{path:[...r.path,`additionalProperties`]}))):t.io===`output`&&(a.additionalProperties=!1)},ux=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Mb(e,t,U(U({},r),{},{path:[...r.path,a?`oneOf`:`anyOf`,n]})));a?n.oneOf=o:n.anyOf=o},dx=(e,t,n,r)=>{let i=e._zod.def,a=Mb(i.left,t,U(U({},r),{},{path:[...r.path,`allOf`,0]})),o=Mb(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]]},fx=(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)=>Mb(e,t,U(U({},r),{},{path:[...r.path,o,n]}))),l=a.rest?Mb(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)},px=(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=Mb(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=Mb(a.keyType,t,U(U({},r),{},{path:[...r.path,`propertyNames`]}))),i.additionalProperties=Mb(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)}},mx=(e,t,n,r)=>{let i=e._zod.def,a=Mb(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`}]},hx=(e,t,n,r)=>{let i=e._zod.def;Mb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},gx=(e,t,n,r)=>{let i=e._zod.def;Mb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},_x=(e,t,n,r)=>{let i=e._zod.def;Mb(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)))},vx=(e,t,n,r)=>{let i=e._zod.def;Mb(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},yx=(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;Mb(o,t,r);let s=t.seen.get(e);s.ref=o},bx=(e,t,n,r)=>{let i=e._zod.def;Mb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},xx=(e,t,n,r)=>{let i=e._zod.def;Mb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Sx=(e,t,n,r)=>{let i=e._zod.def;Mb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Cx=(e,t,n,r)=>{let i=e._zod.innerType;Mb(i,t,r);let a=t.seen.get(e);a.ref=i},wx={string:zb,number:Bb,boolean:Vb,bigint:Hb,symbol:Ub,null:Wb,undefined:Gb,void:Kb,never:qb,any:Jb,unknown:Yb,date:Xb,enum:Zb,literal:Qb,nan:$b,template_literal:ex,file:tx,success:nx,custom:rx,function:ix,transform:ax,map:ox,set:sx,array:cx,object:lx,union:ux,intersection:dx,tuple:fx,record:px,nullable:mx,nonoptional:hx,default:gx,prefault:_x,catch:vx,pipe:yx,readonly:bx,promise:xx,optional:Sx,lazy:Cx};function Tx(e,t){if(`_idmap`in e){let n=e,r=jb(U(U({},t),{},{processors:wx})),i={};for(let e of n._idmap.entries()){let[t,n]=e;Mb(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;Nb(r,n),a[t]=Pb(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=jb(U(U({},t),{},{processors:wx}));return Mb(e,n),Nb(n,e),Pb(n,e)}let Ex=K(`ZodISODateTime`,(e,t)=>{Sv.init(e,t),Qx.init(e,t)});function Dx(e){return Xy(Ex,e)}let Ox=K(`ZodISODate`,(e,t)=>{Cv.init(e,t),Qx.init(e,t)});function kx(e){return Zy(Ox,e)}let Ax=K(`ZodISOTime`,(e,t)=>{wv.init(e,t),Qx.init(e,t)});function jx(e){return Qy(Ax,e)}let Mx=K(`ZodISODuration`,(e,t)=>{Tv.init(e,t),Qx.init(e,t)});function Nx(e){return $y(Mx,e)}let Px=K(`ZodError`,(e,t)=>{Jg.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Zg(e,t)},flatten:{value:t=>Xg(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,fg,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,fg,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Fx=Qg(Px),Ix=$g(Px),Lx=e_(Px),Rx=n_(Px),zx=i_(Px),Bx=a_(Px),Vx=o_(Px),Hx=s_(Px),Ux=c_(Px),Wx=l_(Px),Gx=u_(Px),Kx=d_(Px),qx=new WeakMap;function Jx(e,t,n){let r=Object.getPrototypeOf(e),i=qx.get(r);if(i||(i=new Set,qx.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 Yx=K(`ZodType`,(e,t)=>(cv.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Lb(e,`input`),output:Lb(e,`output`)}}),e.toJSONSchema=Ib(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Fx(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Lx(e,t,n),e.parseAsync=async(t,n)=>Ix(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Rx(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>zx(e,t,n),e.decode=(t,n)=>Bx(e,t,n),e.encodeAsync=async(t,n)=>Vx(e,t,n),e.decodeAsync=async(t,n)=>Hx(e,t,n),e.safeEncode=(t,n)=>Ux(e,t,n),e.safeDecode=(t,n)=>Wx(e,t,n),e.safeEncodeAsync=async(t,n)=>Gx(e,t,n),e.safeDecodeAsync=async(t,n)=>Kx(e,t,n),Jx(e,`ZodType`,{check(...e){var t;let n=this.def;return this.clone(bg(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 Ag(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(_C(e,t))},superRefine(e,t){return this.check(vC(e,t))},overwrite(e){return this.check(bb(e))},optional(){return XS(this)},exactOptional(){return QS(this)},nullable(){return eC(this)},nullish(){return XS(eC(this))},nonoptional(e){return oC(this,e)},array(){return jS(this)},or(e){return IS([this,e])},and(e){return BS(this,e)},transform(e){return uC(this,JS(e))},default(e){return nC(this,e)},prefault(e){return iC(this,e)},catch(e){return cC(this,e)},pipe(e){return uC(this,e)},readonly(){return fC(this)},describe(e){let t=this.clone();return Ey.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ey.get(this);let t=this.clone();return Ey.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=Ey.get(e))==null?void 0:t.description},configurable:!0}),e)),Xx=K(`_ZodString`,(e,t)=>{var n,r,i;lv.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zb(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,Jx(e,`_ZodString`,{regex(...e){return this.check(mb(...e))},includes(...e){return this.check(_b(...e))},startsWith(...e){return this.check(vb(...e))},endsWith(...e){return this.check(yb(...e))},min(...e){return this.check(fb(...e))},max(...e){return this.check(db(...e))},length(...e){return this.check(pb(...e))},nonempty(...e){return this.check(fb(1,...e))},lowercase(e){return this.check(hb(e))},uppercase(e){return this.check(gb(e))},trim(){return this.check(Sb())},normalize(...e){return this.check(xb(...e))},toLowerCase(){return this.check(Cb())},toUpperCase(){return this.check(wb())},slugify(){return this.check(Tb())}})}),Zx=K(`ZodString`,(e,t)=>{lv.init(e,t),Xx.init(e,t),e.email=t=>e.check(Oy($x,t)),e.url=t=>e.check(Py(nS,t)),e.jwt=t=>e.check(Yy(_S,t)),e.emoji=t=>e.check(Fy(rS,t)),e.guid=t=>e.check(ky(eS,t)),e.uuid=t=>e.check(Ay(tS,t)),e.uuidv4=t=>e.check(jy(tS,t)),e.uuidv6=t=>e.check(My(tS,t)),e.uuidv7=t=>e.check(Ny(tS,t)),e.nanoid=t=>e.check(Iy(iS,t)),e.guid=t=>e.check(ky(eS,t)),e.cuid=t=>e.check(Ly(aS,t)),e.cuid2=t=>e.check(Ry(oS,t)),e.ulid=t=>e.check(zy(sS,t)),e.base64=t=>e.check(Ky(mS,t)),e.base64url=t=>e.check(qy(hS,t)),e.xid=t=>e.check(By(cS,t)),e.ksuid=t=>e.check(Vy(lS,t)),e.ipv4=t=>e.check(Hy(uS,t)),e.ipv6=t=>e.check(Uy(dS,t)),e.cidrv4=t=>e.check(Wy(fS,t)),e.cidrv6=t=>e.check(Gy(pS,t)),e.e164=t=>e.check(Jy(gS,t)),e.datetime=t=>e.check(Dx(t)),e.date=t=>e.check(kx(t)),e.time=t=>e.check(jx(t)),e.duration=t=>e.check(Nx(t))});function J(e){return Dy(Zx,e)}let Qx=K(`ZodStringFormat`,(e,t)=>{uv.init(e,t),Xx.init(e,t)}),$x=K(`ZodEmail`,(e,t)=>{pv.init(e,t),Qx.init(e,t)}),eS=K(`ZodGUID`,(e,t)=>{dv.init(e,t),Qx.init(e,t)}),tS=K(`ZodUUID`,(e,t)=>{fv.init(e,t),Qx.init(e,t)}),nS=K(`ZodURL`,(e,t)=>{mv.init(e,t),Qx.init(e,t)}),rS=K(`ZodEmoji`,(e,t)=>{hv.init(e,t),Qx.init(e,t)}),iS=K(`ZodNanoID`,(e,t)=>{gv.init(e,t),Qx.init(e,t)}),aS=K(`ZodCUID`,(e,t)=>{_v.init(e,t),Qx.init(e,t)}),oS=K(`ZodCUID2`,(e,t)=>{vv.init(e,t),Qx.init(e,t)}),sS=K(`ZodULID`,(e,t)=>{yv.init(e,t),Qx.init(e,t)}),cS=K(`ZodXID`,(e,t)=>{bv.init(e,t),Qx.init(e,t)}),lS=K(`ZodKSUID`,(e,t)=>{xv.init(e,t),Qx.init(e,t)}),uS=K(`ZodIPv4`,(e,t)=>{Ev.init(e,t),Qx.init(e,t)}),dS=K(`ZodIPv6`,(e,t)=>{Dv.init(e,t),Qx.init(e,t)}),fS=K(`ZodCIDRv4`,(e,t)=>{Ov.init(e,t),Qx.init(e,t)}),pS=K(`ZodCIDRv6`,(e,t)=>{kv.init(e,t),Qx.init(e,t)}),mS=K(`ZodBase64`,(e,t)=>{jv.init(e,t),Qx.init(e,t)}),hS=K(`ZodBase64URL`,(e,t)=>{Nv.init(e,t),Qx.init(e,t)}),gS=K(`ZodE164`,(e,t)=>{Pv.init(e,t),Qx.init(e,t)}),_S=K(`ZodJWT`,(e,t)=>{Iv.init(e,t),Qx.init(e,t)}),vS=K(`ZodNumber`,(e,t)=>{var n,r,i,a,o,s,c,l,u;Lv.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bb(e,t,n,r),Jx(e,`ZodNumber`,{gt(e,t){return this.check(cb(e,t))},gte(e,t){return this.check(lb(e,t))},min(e,t){return this.check(lb(e,t))},lt(e,t){return this.check(ob(e,t))},lte(e,t){return this.check(sb(e,t))},max(e,t){return this.check(sb(e,t))},int(e){return this.check(xS(e))},safe(e){return this.check(xS(e))},positive(e){return this.check(cb(0,e))},nonnegative(e){return this.check(lb(0,e))},negative(e){return this.check(ob(0,e))},nonpositive(e){return this.check(sb(0,e))},multipleOf(e,t){return this.check(ub(e,t))},step(e,t){return this.check(ub(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 yS(e){return eb(vS,e)}let bS=K(`ZodNumberFormat`,(e,t)=>{Rv.init(e,t),vS.init(e,t)});function xS(e){return tb(bS,e)}let SS=K(`ZodBoolean`,(e,t)=>{zv.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vb(e,t,n,r)});function CS(e){return nb(SS,e)}let wS=K(`ZodNull`,(e,t)=>{Bv.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wb(e,t,n,r)});function TS(e){return rb(wS,e)}let ES=K(`ZodUnknown`,(e,t)=>{Vv.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function DS(){return ib(ES)}let OS=K(`ZodNever`,(e,t)=>{Hv.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qb(e,t,n,r)});function kS(e){return ab(OS,e)}let AS=K(`ZodArray`,(e,t)=>{Wv.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cx(e,t,n,r),e.element=t.element,Jx(e,`ZodArray`,{min(e,t){return this.check(fb(e,t))},nonempty(e){return this.check(fb(1,e))},max(e,t){return this.check(db(e,t))},length(e,t){return this.check(pb(e,t))},unwrap(){return this.element}})});function jS(e,t){return Eb(AS,e,t)}let MS=K(`ZodObject`,(e,t)=>{Yv.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lx(e,t,n,r),vg(e,`shape`,()=>t.shape),Jx(e,`ZodObject`,{keyof(){return WS(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:DS()}))},loose(){return this.clone(U(U({},this._zod.def),{},{catchall:DS()}))},strict(){return this.clone(U(U({},this._zod.def),{},{catchall:kS()}))},strip(){return this.clone(U(U({},this._zod.def),{},{catchall:void 0}))},extend(e){return Fg(this,e)},safeExtend(e){return Ig(this,e)},merge(e){return Lg(this,e)},pick(e){return Ng(this,e)},omit(e){return Pg(this,e)},partial(...e){return Rg(YS,this,e[0])},required(...e){return zg(aC,this,e[0])}})});function NS(e,t){let n=U({type:`object`,shape:e==null?{}:e},q(t));return new MS(n)}function PS(e,t){return new MS(U({type:`object`,shape:e,catchall:kS()},q(t)))}let FS=K(`ZodUnion`,(e,t)=>{Zv.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ux(e,t,n,r),e.options=t.options});function IS(e,t){return new FS(U({type:`union`,options:e},q(t)))}let LS=K(`ZodDiscriminatedUnion`,(e,t)=>{FS.init(e,t),Qv.init(e,t)});function RS(e,t,n){return new LS(U({type:`union`,options:t,discriminator:e},q(n)))}let zS=K(`ZodIntersection`,(e,t)=>{$v.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dx(e,t,n,r)});function BS(e,t){return new zS({type:`intersection`,left:e,right:t})}let VS=K(`ZodRecord`,(e,t)=>{ny.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>px(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function HS(e,t,n){return!t||!t._zod?new VS(U({type:`record`,keyType:J(),valueType:e},q(t))):new VS(U({type:`record`,keyType:e,valueType:t},q(n)))}let US=K(`ZodEnum`,(e,t)=>{ry.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zb(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 US(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 US(U(U(U({},t),{},{checks:[]},q(r)),{},{entries:i}))}});function WS(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new US(U({type:`enum`,entries:n},q(t)))}let GS=K(`ZodLiteral`,(e,t)=>{iy.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qb(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 KS(e,t){return new GS(U({type:`literal`,values:Array.isArray(e)?e:[e]},q(t)))}let qS=K(`ZodTransform`,(e,t)=>{ay.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ax(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new sg(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Kg(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(Kg(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 JS(e){return new qS({type:`transform`,transform:e})}let YS=K(`ZodOptional`,(e,t)=>{sy.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function XS(e){return new YS({type:`optional`,innerType:e})}let ZS=K(`ZodExactOptional`,(e,t)=>{cy.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function QS(e){return new ZS({type:`optional`,innerType:e})}let $S=K(`ZodNullable`,(e,t)=>{ly.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function eC(e){return new $S({type:`nullable`,innerType:e})}let tC=K(`ZodDefault`,(e,t)=>{uy.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function nC(e,t){return new tC({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Dg(t)}})}let rC=K(`ZodPrefault`,(e,t)=>{fy.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_x(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function iC(e,t){return new rC({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Dg(t)}})}let aC=K(`ZodNonOptional`,(e,t)=>{py.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function oC(e,t){return new aC(U({type:`nonoptional`,innerType:e},q(t)))}let sC=K(`ZodCatch`,(e,t)=>{hy.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function cC(e,t){return new sC({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}let lC=K(`ZodPipe`,(e,t)=>{gy.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yx(e,t,n,r),e.in=t.in,e.out=t.out});function uC(e,t){return new lC({type:`pipe`,in:e,out:t})}let dC=K(`ZodReadonly`,(e,t)=>{vy.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fC(e){return new dC({type:`readonly`,innerType:e})}let pC=K(`ZodLazy`,(e,t)=>{by.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cx(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function mC(e){return new pC({type:`lazy`,getter:e})}let hC=K(`ZodCustom`,(e,t)=>{xy.init(e,t),Yx.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rx(e,t,n,r)});function gC(e,t){return Db(hC,e==null?(()=>!0):e,t)}function _C(e,t={}){return Ob(hC,e,t)}function vC(e,t){return kb(e,t)}function yC(e,t={}){let n=new hC(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 bC;(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})(bC||(bC={}));var xC;(function(e){e.mergeShapes=(e,t)=>U(U({},e),t)})(xC||(xC={}));let Y=bC.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),SC=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=bC.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 CC=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,bC.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()}};CC.create=e=>new CC(e);let wC=(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,bC.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:n=`Unrecognized key(s) in object: ${bC.joinValues(e.keys,`, `)}`;break;case X.invalid_union:n=`Invalid input`;break;case X.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${bC.joinValues(e.options)}`;break;case X.invalid_enum_value:n=`Invalid enum value. Expected ${bC.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}"`:bC.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,bC.assertNever(e)}return{message:n}},TC=wC;function EC(){return TC}let DC=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=EC(),r=DC({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===wC?void 0:wC].filter(e=>!!e)});e.common.issues.push(r)}var OC=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 kC;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 kC;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 kC=Object.freeze({status:`aborted`}),AC=e=>({status:`dirty`,value:e}),jC=e=>({status:`valid`,value:e}),MC=e=>e.status===`aborted`,NC=e=>e.status===`dirty`,PC=e=>e.status===`valid`,FC=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 IC=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 LC=(e,t)=>{if(PC(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 CC(e.common.issues);return this._error=t,this._error}}};function RC(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 zC=class{get description(){return this._def.description}_getType(e){return SC(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:SC(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new OC,ctx:{common:e.parent.common,data:e.data,parsedType:SC(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(FC(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:SC(e)},i=this._parseSync({data:e,path:r.path,parent:r});return LC(r,i)}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:SC(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return PC(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=>PC(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:SC(e)},i=n._parse({data:e,path:r.path,parent:r}),a=await(FC(i)?i:Promise.resolve(i));return LC(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 Vw({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 Hw.create(this,this._def)}nullable(){return Uw.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Sw.create(this)}promise(){return Bw.create(this,this._def)}or(e){return Tw.create([this,e],this._def)}and(e){return kw.create(this,e,this._def)}transform(e){return new Vw(U(U({},RC(this._def)),{},{schema:this,typeName:$.ZodEffects,effect:{type:`transform`,transform:e}}))}default(e){let t=typeof e==`function`?e:()=>e;return new Ww(U(U({},RC(this._def)),{},{innerType:this,defaultValue:t,typeName:$.ZodDefault}))}brand(){return new qw(U({typeName:$.ZodBranded,type:this},RC(this._def)))}catch(e){let t=typeof e==`function`?e:()=>e;return new Gw(U(U({},RC(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 Jw.create(this,e)}readonly(){return Yw.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};let BC=/^c[^\s-]{8,}$/i,VC=/^[0-9a-z]+$/,HC=/^[0-9A-HJKMNP-TV-Z]{26}$/i,UC=/^[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,WC=/^[a-z0-9_-]{21}$/i,GC=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,KC=/^[-+]?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)?)??$/,qC=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,JC,YC=/^(?:(?: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])$/,XC=/^(?:(?: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])$/,ZC=/^(([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]))$/,QC=/^(([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])$/,$C=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ew=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,tw=`((\\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])))`,nw=RegExp(`^${tw}$`);function rw(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 iw(e){return RegExp(`^${rw(e)}$`)}function aw(e){let t=`${tw}T${rw(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function ow(e,t){return!!((t===`v4`||!t)&&YC.test(e)||(t===`v6`||!t)&&ZC.test(e))}function sw(e,t){if(!GC.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 cw(e,t){return!!((t===`v4`||!t)&&XC.test(e)||(t===`v6`||!t)&&QC.test(e))}var lw=class e extends zC{_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}),kC}let t=new OC,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`)qC.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`)JC||(JC=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),JC.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`)UC.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`)WC.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`)BC.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`)VC.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`)HC.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`?aw(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`?nw.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{code:X.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?iw(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`?KC.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`duration`,code:X.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?ow(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`?sw(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`?cw(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`?$C.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`base64`,code:X.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?ew.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`base64url`,code:X.invalid_string,message:r.message}),t.dirty()):bC.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}};lw.create=e=>{var t;return new lw(U({checks:[],typeName:$.ZodString,coerce:(t=e==null?void 0:e.coerce)!=null&&t},RC(e)))};function uw(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 dw=class e extends zC{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}),kC}let t,n=new OC;for(let r of this._def.checks)r.kind===`int`?bC.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`?uw(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()):bC.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`&&bC.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)}};dw.create=e=>new dw(U({checks:[],typeName:$.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1},RC(e)));var fw=class e extends zC{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 OC;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()):bC.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}),kC}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}};fw.create=e=>{var t;return new fw(U({checks:[],typeName:$.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!=null&&t},RC(e)))};var pw=class extends zC{_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}),kC}return jC(e.data)}};pw.create=e=>new pw(U({typeName:$.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1},RC(e)));var mw=class e extends zC{_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}),kC}if(Number.isNaN(e.data.getTime()))return Z(this._getOrReturnCtx(e),{code:X.invalid_date}),kC;let t=new OC,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()):bC.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)}};mw.create=e=>new mw(U({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:$.ZodDate},RC(e)));var hw=class extends zC{_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}),kC}return jC(e.data)}};hw.create=e=>new hw(U({typeName:$.ZodSymbol},RC(e)));var gw=class extends zC{_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}),kC}return jC(e.data)}};gw.create=e=>new gw(U({typeName:$.ZodUndefined},RC(e)));var _w=class extends zC{_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}),kC}return jC(e.data)}};_w.create=e=>new _w(U({typeName:$.ZodNull},RC(e)));var vw=class extends zC{constructor(){super(...arguments),this._any=!0}_parse(e){return jC(e.data)}};vw.create=e=>new vw(U({typeName:$.ZodAny},RC(e)));var yw=class extends zC{constructor(){super(...arguments),this._unknown=!0}_parse(e){return jC(e.data)}};yw.create=e=>new yw(U({typeName:$.ZodUnknown},RC(e)));var bw=class extends zC{_parse(e){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.never,received:t.parsedType}),kC}};bw.create=e=>new bw(U({typeName:$.ZodNever},RC(e)));var xw=class extends zC{_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}),kC}return jC(e.data)}};xw.create=e=>new xw(U({typeName:$.ZodVoid},RC(e)));var Sw=class e extends zC{_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}),kC;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 IC(t,e,t.path,n)))).then(e=>OC.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new IC(t,e,t.path,n)));return OC.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)}};Sw.create=(e,t)=>new Sw(U({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$.ZodArray},RC(t)));function Cw(e){if(e instanceof ww){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Hw.create(Cw(r))}return new ww(U(U({},e._def),{},{shape:()=>t}))}else if(e instanceof Sw)return new Sw(U(U({},e._def),{},{type:Cw(e.element)}));else if(e instanceof Hw)return Hw.create(Cw(e.unwrap()));else if(e instanceof Uw)return Uw.create(Cw(e.unwrap()));else if(e instanceof Aw)return Aw.create(e.items.map(e=>Cw(e)));else return e}var ww=class e extends zC{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=bC.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}),kC}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof bw&&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 IC(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof bw){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 IC(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=>OC.mergeObjectSync(t,e)):OC.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 bC.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 bC.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e(U(U({},this._def),{},{shape:()=>n}))}deepPartial(){return Cw(this)}partial(t){let n={};for(let e of bC.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 bC.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Hw;)t=t._def.innerType;n[e]=t}return new e(U(U({},this._def),{},{shape:()=>n}))}keyof(){return Lw(bC.objectKeys(this.shape))}};ww.create=(e,t)=>new ww(U({shape:()=>e,unknownKeys:`strip`,catchall:bw.create(),typeName:$.ZodObject},RC(t))),ww.strictCreate=(e,t)=>new ww(U({shape:()=>e,unknownKeys:`strict`,catchall:bw.create(),typeName:$.ZodObject},RC(t))),ww.lazycreate=(e,t)=>new ww(U({shape:e,unknownKeys:`strip`,catchall:bw.create(),typeName:$.ZodObject},RC(t)));var Tw=class extends zC{_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 CC(e.ctx.common.issues));return Z(t,{code:X.invalid_union,unionErrors:n}),kC}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 CC(e));return Z(t,{code:X.invalid_union,unionErrors:i}),kC}}get options(){return this._def.options}};Tw.create=(e,t)=>new Tw(U({options:e,typeName:$.ZodUnion},RC(t)));let Ew=e=>e instanceof Fw?Ew(e.schema):e instanceof Vw?Ew(e.innerType()):e instanceof Iw?[e.value]:e instanceof Rw?e.options:e instanceof zw?bC.objectValues(e.enum):e instanceof Ww?Ew(e._def.innerType):e instanceof gw?[void 0]:e instanceof _w?[null]:e instanceof Hw?[void 0,...Ew(e.unwrap())]:e instanceof Uw?[null,...Ew(e.unwrap())]:e instanceof qw||e instanceof Yw?Ew(e.unwrap()):e instanceof Gw?Ew(e._def.innerType):[];var Dw=class e extends zC{_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}),kC;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]}),kC)}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=Ew(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},RC(r)))}};function Ow(e,t){let n=SC(e),r=SC(t);if(e===t)return{valid:!0,data:e};if(n===Y.object&&r===Y.object){let n=bC.objectKeys(t),r=bC.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i=U(U({},e),t);for(let n of r){let r=Ow(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=Ow(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 kw=class extends zC{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(MC(e)||MC(r))return kC;let i=Ow(e.value,r.value);return i.valid?((NC(e)||NC(r))&&t.dirty(),{status:t.value,value:i.data}):(Z(n,{code:X.invalid_intersection_types}),kC)};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}))}};kw.create=(e,t,n)=>new kw(U({left:e,right:t,typeName:$.ZodIntersection},RC(n)));var Aw=class e extends zC{_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}),kC;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`}),kC;!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 IC(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>OC.mergeArray(t,e)):OC.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e(U(U({},this._def),{},{rest:t}))}};Aw.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new Aw(U({items:e,typeName:$.ZodTuple,rest:null},RC(t)))};var jw=class e extends zC{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}),kC;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new IC(n,e,n.path,e)),value:a._parse(new IC(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?OC.mergeObjectAsync(t,r):OC.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof zC?new e(U({keyType:t,valueType:n,typeName:$.ZodRecord},RC(r))):new e(U({keyType:lw.create(),valueType:t,typeName:$.ZodRecord},RC(n)))}},Mw=class extends zC{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}),kC;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new IC(n,e,n.path,[a,`key`])),value:i._parse(new IC(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 kC;(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 kC;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};Mw.create=(e,t,n)=>new Mw(U({valueType:t,keyType:e,typeName:$.ZodMap},RC(n)));var Nw=class e extends zC{_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}),kC;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 kC;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 IC(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)}};Nw.create=(e,t)=>new Nw(U({valueType:e,minSize:null,maxSize:null,typeName:$.ZodSet},RC(t)));var Pw=class e extends zC{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}),kC;function n(e,n){return DC({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,EC(),wC].filter(e=>!!e),issueData:{code:X.invalid_arguments,argumentsError:n}})}function r(e,n){return DC({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,EC(),wC].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 Bw){let e=this;return jC(async function(...t){let o=new CC([]),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 jC(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new CC([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new CC([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:Aw.create(t).rest(yw.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||Aw.create([]).rest(yw.create()),returns:n||yw.create(),typeName:$.ZodFunction},RC(r)))}},Fw=class extends zC{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})}};Fw.create=(e,t)=>new Fw(U({getter:e,typeName:$.ZodLazy},RC(t)));var Iw=class extends zC{_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}),kC}return{status:`valid`,value:e.data}}get value(){return this._def.value}};Iw.create=(e,t)=>new Iw(U({value:e,typeName:$.ZodLiteral},RC(t)));function Lw(e,t){return new Rw(U({values:e,typeName:$.ZodEnum},RC(t)))}var Rw=class e extends zC{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return Z(t,{expected:bC.joinValues(n),received:t.parsedType,code:X.invalid_type}),kC}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}),kC}return jC(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))}};Rw.create=Lw;var zw=class extends zC{_parse(e){let t=bC.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Y.string&&n.parsedType!==Y.number){let e=bC.objectValues(t);return Z(n,{expected:bC.joinValues(e),received:n.parsedType,code:X.invalid_type}),kC}if(this._cache||(this._cache=new Set(bC.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=bC.objectValues(t);return Z(n,{received:n.data,code:X.invalid_enum_value,options:e}),kC}return jC(e.data)}get enum(){return this._def.values}};zw.create=(e,t)=>new zw(U({values:e,typeName:$.ZodNativeEnum},RC(t)));var Bw=class extends zC{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}),kC):jC((t.parsedType===Y.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Bw.create=(e,t)=>new Bw(U({type:e,typeName:$.ZodPromise},RC(t)));var Vw=class extends zC{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 kC;let i=await t._def.schema._parseAsync({data:e,path:r.path,parent:r});return i.status===`aborted`?kC:i.status===`dirty`||n.value===`dirty`?AC(i.value):i});{if(n.value===`aborted`)return kC;let t=this._def.schema._parseSync({data:e,path:r.path,parent:r});return t.status===`aborted`?kC:t.status===`dirty`||n.value===`dirty`?AC(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`?kC:(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`?kC:(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(!PC(e))return kC;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=>PC(e)?Promise.resolve(i.transform(e.value,a)).then(e=>({status:n.value,value:e})):kC);bC.assertNever(i)}};Vw.create=(e,t,n)=>new Vw(U({schema:e,typeName:$.ZodEffects,effect:t},RC(n))),Vw.createWithPreprocess=(e,t,n)=>new Vw(U({schema:t,effect:{type:`preprocess`,transform:e},typeName:$.ZodEffects},RC(n)));var Hw=class extends zC{_parse(e){return this._getType(e)===Y.undefined?jC(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Hw.create=(e,t)=>new Hw(U({innerType:e,typeName:$.ZodOptional},RC(t)));var Uw=class extends zC{_parse(e){return this._getType(e)===Y.null?jC(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Uw.create=(e,t)=>new Uw(U({innerType:e,typeName:$.ZodNullable},RC(t)));var Ww=class extends zC{_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}};Ww.create=(e,t)=>new Ww(U({innerType:e,typeName:$.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default},RC(t)));var Gw=class extends zC{_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 FC(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new CC(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new CC(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Gw.create=(e,t)=>new Gw(U({innerType:e,typeName:$.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch},RC(t)));var Kw=class extends zC{_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}),kC}return{status:`valid`,value:e.data}}};Kw.create=e=>new Kw(U({typeName:$.ZodNaN},RC(e)));var qw=class extends zC{_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}},Jw=class e extends zC{_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`?kC:e.status===`dirty`?(n.dirty(),AC(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`?kC: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})}},Yw=class extends zC{_parse(e){let t=this._def.innerType._parse(e),n=e=>(PC(e)&&(e.value=Object.freeze(e.value)),e);return FC(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};Yw.create=(e,t)=>new Yw(U({innerType:e,typeName:$.ZodReadonly},RC(t))),ww.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`})($||($={})),lw.create,dw.create,Kw.create,fw.create,pw.create,mw.create,hw.create,gw.create,_w.create,vw.create,yw.create,bw.create,xw.create,Sw.create,ww.create,ww.strictCreate,Tw.create,Dw.create,kw.create,Aw.create,jw.create,Mw.create,Nw.create,Pw.create,Fw.create,Iw.create,Rw.create,zw.create,Bw.create,Vw.create,Hw.create,Uw.create,Vw.createWithPreprocess,Jw.create;let Xw=[`additionalProperties`],Zw=[`type`],Qw=[`type`];var $w=({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 Bh({argument:`separator`,message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${i()}`},eT=$w();function tT(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 nT=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,rT=/"(?: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 iT(e){let t=JSON.parse(e);return typeof t!=`object`||!t||nT.test(e)===!1&&rT.test(e)===!1?t:aT(t)}function aT(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 oT(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch(t){return iT(e)}try{return iT(e)}finally{Error.stackTraceLimit=t}}var sT=Symbol.for(`vercel.ai.validator`);function cT(e){return{[sT]:!0,validate:e}}function lT(e){return typeof e==`object`&&!!e&&sT in e&&e[sT]===!0&&`validate`in e}function uT(e){let t;return()=>(t==null&&(t=e()),t)}function dT(e){return lT(e)?e:`~standard`in e?fT(e):e()}function fT(e){return cT(async t=>{let n=await e[`~standard`].validate(t);return n.issues==null?{success:!0,value:n.value}:{success:!1,error:new Qh({value:t,cause:n.issues})}})}async function pT({value:e,schema:t}){let n=await mT({value:e,schema:t});if(!n.success)throw Qh.wrap({value:e,cause:n.error});return n.value}async function mT({value:e,schema:t}){let n=dT(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:Qh.wrap({value:e,cause:t.error}),rawValue:e}}catch(t){return{success:!1,error:Qh.wrap({value:e,cause:t}),rawValue:e}}}async function hT({text:e,schema:t}){try{let n=oT(e);return t==null?{success:!0,value:n,rawValue:n}:await mT({value:n,schema:t})}catch(t){return{success:!1,error:Kh.isInstance(t)?t:new Kh({text:e,cause:t}),rawValue:void 0}}}function gT({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new ig).pipeThrough(new TransformStream({async transform({data:e},n){e!==`[DONE]`&&n.enqueue(await hT({text:e,schema:t}))}}))}async function _T(e){return typeof e==`function`&&(e=e()),Promise.resolve(e)}new TextDecoder;var vT=Symbol.for(`vercel.ai.schema`);function yT(e,{validate:t}={}){return{[vT]:!0,_type:void 0,[sT]:!0,get jsonSchema(){return typeof e==`function`&&(e=e()),e},validate:t}}function bT(e){if(e.type===`object`){e.additionalProperties=!1;let t=e.properties;if(t!=null)for(let e in t)t[e]=bT(t[e])}return e.type===`array`&&e.items!=null&&(Array.isArray(e.items)?e.items=e.items.map(e=>bT(e)):e.items=bT(e.items)),e}var xT=Symbol(`Let zodToJsonSchema decide on which parser to use`),ST={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`},CT=e=>typeof e==`string`?U(U({},ST),{},{name:e}):U(U({},ST),e);function wT(){return{}}function TT(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=gE(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 ET(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 DT(){return{type:`boolean`}}function OT(e,t){return gE(e.type._def,t)}var kT=(e,t)=>gE(e.innerType._def,t);function AT(e,t,n){let r=n==null?t.dateStrategy:n;if(Array.isArray(r))return{anyOf:r.map((n,r)=>AT(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 jT(e)}}var jT=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 MT(e,t){return U(U({},gE(e.innerType._def,t)),{},{default:e.defaultValue()})}function NT(e,t){return t.effectStrategy===`input`?gE(e.schema._def,t):wT()}function PT(e){return{type:`string`,enum:Array.from(e.values)}}var FT=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function IT(e,t){let n=[gE(e.left._def,U(U({},t),{},{currentPath:[...t.currentPath,`allOf`,`0`]})),gE(e.right._def,U(U({},t),{},{currentPath:[...t.currentPath,`allOf`,`1`]}))].filter(e=>!!e),r=[];return n.forEach(e=>{if(FT(e))r.push(...e.allOf);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n}=e;t=vr(e,Xw)}r.push(t)}}),r.length?{allOf:r}:void 0}function LT(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 RT=void 0,zT={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:()=>(RT===void 0&&(RT=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),RT),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 BT(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`:WT(n,`email`,r.message,t);break;case`format:idn-email`:WT(n,`idn-email`,r.message,t);break;case`pattern:zod`:GT(n,zT.email,r.message,t);break}break;case`url`:WT(n,`uri`,r.message,t);break;case`uuid`:WT(n,`uuid`,r.message,t);break;case`regex`:GT(n,r.regex,r.message,t);break;case`cuid`:GT(n,zT.cuid,r.message,t);break;case`cuid2`:GT(n,zT.cuid2,r.message,t);break;case`startsWith`:GT(n,RegExp(`^${VT(r.value,t)}`),r.message,t);break;case`endsWith`:GT(n,RegExp(`${VT(r.value,t)}$`),r.message,t);break;case`datetime`:WT(n,`date-time`,r.message,t);break;case`date`:WT(n,`date`,r.message,t);break;case`time`:WT(n,`time`,r.message,t);break;case`duration`:WT(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`:GT(n,RegExp(VT(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&WT(n,`ipv4`,r.message,t),r.version!==`v4`&&WT(n,`ipv6`,r.message,t);break;case`base64url`:GT(n,zT.base64url,r.message,t);break;case`jwt`:GT(n,zT.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&>(n,zT.ipv4Cidr,r.message,t),r.version!==`v4`&>(n,zT.ipv6Cidr,r.message,t);break;case`emoji`:GT(n,zT.emoji(),r.message,t);break;case`ulid`:GT(n,zT.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:WT(n,`binary`,r.message,t);break;case`contentEncoding:base64`:n.contentEncoding=`base64`;break;case`pattern:zod`:GT(n,zT.base64,r.message,t);break}break;case`nanoid`:GT(n,zT.nanoid,r.message,t);case`toLowerCase`:case`toUpperCase`:case`trim`:break;default:}return n}function VT(e,t){return t.patternStrategy===`escape`?UT(e):e}var HT=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function UT(e){let t=``;for(let n=0;n<e.length;n++)HT.has(e[n])||(t+=`\\`),t+=e[n];return t}function WT(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 GT(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:KT(t,r)},n&&r.errorMessages&&{errorMessage:{pattern:n}}))):e.pattern=KT(t,r)}function KT(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
|
|
91
|
+
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 Xb(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:$b(t,`input`,e.processors),output:$b(t,`output`,e.processors)}}),enumerable:!1,writable:!1}),n}catch(e){throw Error(`Error converting schema to JSON.`)}}function Zb(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 Zb(r.element,n);if(r.type===`set`)return Zb(r.valueType,n);if(r.type===`lazy`)return Zb(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 Zb(r.innerType,n);if(r.type===`intersection`)return Zb(r.left,n)||Zb(r.right,n);if(r.type===`record`||r.type===`map`)return Zb(r.keyType,n)||Zb(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Zb(r.in,n)||Zb(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Zb(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Zb(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Zb(e,n))return!0;return!!(r.rest&&Zb(r.rest,n))}return!1}let Qb=(e,t={})=>n=>{let r=qb(H(H({},n),{},{processors:t}));return Jb(e,r),Yb(r,e),Xb(r,e)},$b=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r==null?{}:r,o=qb(H(H({},i==null?{}:i),{},{target:a,io:t,processors:n}));return Jb(e,o),Yb(o,e),Xb(o,e)},ex={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},tx=(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=ex[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}))])}},nx=(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)},rx=(e,t,n,r)=>{n.type=`boolean`},ix=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},ax=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},ox=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},sx=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},cx=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},lx=(e,t,n,r)=>{n.not={}},ux=(e,t,n,r)=>{},dx=(e,t,n,r)=>{},fx=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},px=(e,t,n,r)=>{let i=e._zod.def,a=Dg(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},mx=(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},hx=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},gx=(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},_x=(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)},vx=(e,t,n,r)=>{n.type=`boolean`},yx=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},bx=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},xx=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Sx=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},Cx=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},wx=(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=Jb(a.element,t,H(H({},r),{},{path:[...r.path,`items`]}))},Tx=(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]=Jb(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=Jb(o.catchall,t,H(H({},r),{},{path:[...r.path,`additionalProperties`]}))):t.io===`output`&&(a.additionalProperties=!1)},Ex=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Jb(e,t,H(H({},r),{},{path:[...r.path,a?`oneOf`:`anyOf`,n]})));a?n.oneOf=o:n.anyOf=o},Dx=(e,t,n,r)=>{let i=e._zod.def,a=Jb(i.left,t,H(H({},r),{},{path:[...r.path,`allOf`,0]})),o=Jb(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]]},Ox=(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)=>Jb(e,t,H(H({},r),{},{path:[...r.path,o,n]}))),l=a.rest?Jb(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)},kx=(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=Jb(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=Jb(a.keyType,t,H(H({},r),{},{path:[...r.path,`propertyNames`]}))),i.additionalProperties=Jb(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)}},Ax=(e,t,n,r)=>{let i=e._zod.def,a=Jb(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`}]},jx=(e,t,n,r)=>{let i=e._zod.def;Jb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Mx=(e,t,n,r)=>{let i=e._zod.def;Jb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Nx=(e,t,n,r)=>{let i=e._zod.def;Jb(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)))},Px=(e,t,n,r)=>{let i=e._zod.def;Jb(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},Fx=(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;Jb(o,t,r);let s=t.seen.get(e);s.ref=o},Ix=(e,t,n,r)=>{let i=e._zod.def;Jb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Lx=(e,t,n,r)=>{let i=e._zod.def;Jb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Rx=(e,t,n,r)=>{let i=e._zod.def;Jb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},zx=(e,t,n,r)=>{let i=e._zod.innerType;Jb(i,t,r);let a=t.seen.get(e);a.ref=i},Bx={string:tx,number:nx,boolean:rx,bigint:ix,symbol:ax,null:ox,undefined:sx,void:cx,never:lx,any:ux,unknown:dx,date:fx,enum:px,literal:mx,nan:hx,template_literal:gx,file:_x,success:vx,custom:yx,function:bx,transform:xx,map:Sx,set:Cx,array:wx,object:Tx,union:Ex,intersection:Dx,tuple:Ox,record:kx,nullable:Ax,nonoptional:jx,default:Mx,prefault:Nx,catch:Px,pipe:Fx,readonly:Ix,promise:Lx,optional:Rx,lazy:zx};function Vx(e,t){if(`_idmap`in e){let n=e,r=qb(H(H({},t),{},{processors:Bx})),i={};for(let e of n._idmap.entries()){let[t,n]=e;Jb(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;Yb(r,n),a[t]=Xb(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=qb(H(H({},t),{},{processors:Bx}));return Jb(e,n),Yb(n,e),Xb(n,e)}let Hx=G(`ZodISODateTime`,(e,t)=>{Rv.init(e,t),mS.init(e,t)});function Ux(e){return fb(Hx,e)}let Wx=G(`ZodISODate`,(e,t)=>{zv.init(e,t),mS.init(e,t)});function Gx(e){return pb(Wx,e)}let Kx=G(`ZodISOTime`,(e,t)=>{Bv.init(e,t),mS.init(e,t)});function qx(e){return mb(Kx,e)}let Jx=G(`ZodISODuration`,(e,t)=>{Vv.init(e,t),mS.init(e,t)});function Yx(e){return hb(Jx,e)}let Xx=G(`ZodError`,(e,t)=>{u_.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>p_(e,t)},flatten:{value:t=>f_(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Og,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Og,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Zx=m_(Xx),Qx=h_(Xx),$x=g_(Xx),eS=v_(Xx),tS=b_(Xx),nS=x_(Xx),rS=S_(Xx),iS=C_(Xx),aS=w_(Xx),oS=T_(Xx),sS=E_(Xx),cS=D_(Xx),lS=new WeakMap;function uS(e,t,n){let r=Object.getPrototypeOf(e),i=lS.get(r);if(i||(i=new Set,lS.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 dS=G(`ZodType`,(e,t)=>(wv.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:$b(e,`input`),output:$b(e,`output`)}}),e.toJSONSchema=Qb(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Zx(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>$x(e,t,n),e.parseAsync=async(t,n)=>Qx(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>eS(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>tS(e,t,n),e.decode=(t,n)=>nS(e,t,n),e.encodeAsync=async(t,n)=>rS(e,t,n),e.decodeAsync=async(t,n)=>iS(e,t,n),e.safeEncode=(t,n)=>aS(e,t,n),e.safeDecode=(t,n)=>oS(e,t,n),e.safeEncodeAsync=async(t,n)=>sS(e,t,n),e.safeDecodeAsync=async(t,n)=>cS(e,t,n),uS(e,`ZodType`,{check(...e){var t;let n=this.def;return this.clone(Ig(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 Kg(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(MC(e,t))},superRefine(e,t){return this.check(NC(e,t))},overwrite(e){return this.check(Ib(e))},optional(){return dC(this)},exactOptional(){return pC(this)},nullable(){return hC(this)},nullish(){return dC(hC(this))},nonoptional(e){return xC(this,e)},array(){return qS(this)},or(e){return QS([this,e])},and(e){return nC(this,e)},transform(e){return TC(this,lC(e))},default(e){return _C(this,e)},prefault(e){return yC(this,e)},catch(e){return CC(this,e)},pipe(e){return TC(this,e)},readonly(){return DC(this)},describe(e){let t=this.clone();return Hy.add(t,{description:e}),t},meta(...e){if(e.length===0)return Hy.get(this);let t=this.clone();return Hy.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=Hy.get(e))==null?void 0:t.description},configurable:!0}),e)),fS=G(`_ZodString`,(e,t)=>{var n,r,i;Tv.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tx(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,uS(e,`_ZodString`,{regex(...e){return this.check(Ab(...e))},includes(...e){return this.check(Nb(...e))},startsWith(...e){return this.check(Pb(...e))},endsWith(...e){return this.check(Fb(...e))},min(...e){return this.check(Ob(...e))},max(...e){return this.check(Db(...e))},length(...e){return this.check(kb(...e))},nonempty(...e){return this.check(Ob(1,...e))},lowercase(e){return this.check(jb(e))},uppercase(e){return this.check(Mb(e))},trim(){return this.check(Rb())},normalize(...e){return this.check(Lb(...e))},toLowerCase(){return this.check(zb())},toUpperCase(){return this.check(Bb())},slugify(){return this.check(Vb())}})}),pS=G(`ZodString`,(e,t)=>{Tv.init(e,t),fS.init(e,t),e.email=t=>e.check(Wy(hS,t)),e.url=t=>e.check(Xy(vS,t)),e.jwt=t=>e.check(db(NS,t)),e.emoji=t=>e.check(Zy(yS,t)),e.guid=t=>e.check(Gy(gS,t)),e.uuid=t=>e.check(Ky(_S,t)),e.uuidv4=t=>e.check(qy(_S,t)),e.uuidv6=t=>e.check(Jy(_S,t)),e.uuidv7=t=>e.check(Yy(_S,t)),e.nanoid=t=>e.check(Qy(bS,t)),e.guid=t=>e.check(Gy(gS,t)),e.cuid=t=>e.check($y(xS,t)),e.cuid2=t=>e.check(eb(SS,t)),e.ulid=t=>e.check(tb(CS,t)),e.base64=t=>e.check(cb(AS,t)),e.base64url=t=>e.check(lb(jS,t)),e.xid=t=>e.check(nb(wS,t)),e.ksuid=t=>e.check(rb(TS,t)),e.ipv4=t=>e.check(ib(ES,t)),e.ipv6=t=>e.check(ab(DS,t)),e.cidrv4=t=>e.check(ob(OS,t)),e.cidrv6=t=>e.check(sb(kS,t)),e.e164=t=>e.check(ub(MS,t)),e.datetime=t=>e.check(Ux(t)),e.date=t=>e.check(Gx(t)),e.time=t=>e.check(qx(t)),e.duration=t=>e.check(Yx(t))});function q(e){return Uy(pS,e)}let mS=G(`ZodStringFormat`,(e,t)=>{Ev.init(e,t),fS.init(e,t)}),hS=G(`ZodEmail`,(e,t)=>{kv.init(e,t),mS.init(e,t)}),gS=G(`ZodGUID`,(e,t)=>{Dv.init(e,t),mS.init(e,t)}),_S=G(`ZodUUID`,(e,t)=>{Ov.init(e,t),mS.init(e,t)}),vS=G(`ZodURL`,(e,t)=>{Av.init(e,t),mS.init(e,t)}),yS=G(`ZodEmoji`,(e,t)=>{jv.init(e,t),mS.init(e,t)}),bS=G(`ZodNanoID`,(e,t)=>{Mv.init(e,t),mS.init(e,t)}),xS=G(`ZodCUID`,(e,t)=>{Nv.init(e,t),mS.init(e,t)}),SS=G(`ZodCUID2`,(e,t)=>{Pv.init(e,t),mS.init(e,t)}),CS=G(`ZodULID`,(e,t)=>{Fv.init(e,t),mS.init(e,t)}),wS=G(`ZodXID`,(e,t)=>{Iv.init(e,t),mS.init(e,t)}),TS=G(`ZodKSUID`,(e,t)=>{Lv.init(e,t),mS.init(e,t)}),ES=G(`ZodIPv4`,(e,t)=>{Hv.init(e,t),mS.init(e,t)}),DS=G(`ZodIPv6`,(e,t)=>{Uv.init(e,t),mS.init(e,t)}),OS=G(`ZodCIDRv4`,(e,t)=>{Wv.init(e,t),mS.init(e,t)}),kS=G(`ZodCIDRv6`,(e,t)=>{Gv.init(e,t),mS.init(e,t)}),AS=G(`ZodBase64`,(e,t)=>{qv.init(e,t),mS.init(e,t)}),jS=G(`ZodBase64URL`,(e,t)=>{Yv.init(e,t),mS.init(e,t)}),MS=G(`ZodE164`,(e,t)=>{Xv.init(e,t),mS.init(e,t)}),NS=G(`ZodJWT`,(e,t)=>{Qv.init(e,t),mS.init(e,t)}),PS=G(`ZodNumber`,(e,t)=>{var n,r,i,a,o,s,c,l,u;$v.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nx(e,t,n,r),uS(e,`ZodNumber`,{gt(e,t){return this.check(wb(e,t))},gte(e,t){return this.check(Tb(e,t))},min(e,t){return this.check(Tb(e,t))},lt(e,t){return this.check(Sb(e,t))},lte(e,t){return this.check(Cb(e,t))},max(e,t){return this.check(Cb(e,t))},int(e){return this.check(LS(e))},safe(e){return this.check(LS(e))},positive(e){return this.check(wb(0,e))},nonnegative(e){return this.check(Tb(0,e))},negative(e){return this.check(Sb(0,e))},nonpositive(e){return this.check(Cb(0,e))},multipleOf(e,t){return this.check(Eb(e,t))},step(e,t){return this.check(Eb(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 FS(e){return gb(PS,e)}let IS=G(`ZodNumberFormat`,(e,t)=>{ey.init(e,t),PS.init(e,t)});function LS(e){return _b(IS,e)}let RS=G(`ZodBoolean`,(e,t)=>{ty.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rx(e,t,n,r)});function zS(e){return vb(RS,e)}let BS=G(`ZodNull`,(e,t)=>{ny.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ox(e,t,n,r)});function VS(e){return yb(BS,e)}let HS=G(`ZodUnknown`,(e,t)=>{ry.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function US(){return bb(HS)}let WS=G(`ZodNever`,(e,t)=>{iy.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lx(e,t,n,r)});function GS(e){return xb(WS,e)}let KS=G(`ZodArray`,(e,t)=>{oy.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wx(e,t,n,r),e.element=t.element,uS(e,`ZodArray`,{min(e,t){return this.check(Ob(e,t))},nonempty(e){return this.check(Ob(1,e))},max(e,t){return this.check(Db(e,t))},length(e,t){return this.check(kb(e,t))},unwrap(){return this.element}})});function qS(e,t){return Hb(KS,e,t)}let JS=G(`ZodObject`,(e,t)=>{dy.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tx(e,t,n,r),Pg(e,`shape`,()=>t.shape),uS(e,`ZodObject`,{keyof(){return oC(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:US()}))},loose(){return this.clone(H(H({},this._zod.def),{},{catchall:US()}))},strict(){return this.clone(H(H({},this._zod.def),{},{catchall:GS()}))},strip(){return this.clone(H(H({},this._zod.def),{},{catchall:void 0}))},extend(e){return Zg(this,e)},safeExtend(e){return Qg(this,e)},merge(e){return $g(this,e)},pick(e){return Yg(this,e)},omit(e){return Xg(this,e)},partial(...e){return e_(uC,this,e[0])},required(...e){return t_(bC,this,e[0])}})});function YS(e,t){let n=H({type:`object`,shape:e==null?{}:e},K(t));return new JS(n)}function XS(e,t){return new JS(H({type:`object`,shape:e,catchall:US()},K(t)))}let ZS=G(`ZodUnion`,(e,t)=>{py.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ex(e,t,n,r),e.options=t.options});function QS(e,t){return new ZS(H({type:`union`,options:e},K(t)))}let $S=G(`ZodDiscriminatedUnion`,(e,t)=>{ZS.init(e,t),my.init(e,t)});function eC(e,t,n){return new $S(H({type:`union`,options:t,discriminator:e},K(n)))}let tC=G(`ZodIntersection`,(e,t)=>{hy.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dx(e,t,n,r)});function nC(e,t){return new tC({type:`intersection`,left:e,right:t})}let rC=G(`ZodRecord`,(e,t)=>{vy.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kx(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function iC(e,t,n){return!t||!t._zod?new rC(H({type:`record`,keyType:q(),valueType:e},K(t))):new rC(H({type:`record`,keyType:e,valueType:t},K(n)))}let aC=G(`ZodEnum`,(e,t)=>{yy.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>px(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 aC(H(H(H({},t),{},{checks:[]},K(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 aC(H(H(H({},t),{},{checks:[]},K(r)),{},{entries:i}))}});function oC(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new aC(H({type:`enum`,entries:n},K(t)))}let sC=G(`ZodLiteral`,(e,t)=>{by.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mx(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 J(e,t){return new sC(H({type:`literal`,values:Array.isArray(e)?e:[e]},K(t)))}let cC=G(`ZodTransform`,(e,t)=>{xy.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xx(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Cg(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(c_(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(c_(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 lC(e){return new cC({type:`transform`,transform:e})}let uC=G(`ZodOptional`,(e,t)=>{Cy.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function dC(e){return new uC({type:`optional`,innerType:e})}let fC=G(`ZodExactOptional`,(e,t)=>{wy.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pC(e){return new fC({type:`optional`,innerType:e})}let mC=G(`ZodNullable`,(e,t)=>{Ty.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ax(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hC(e){return new mC({type:`nullable`,innerType:e})}let gC=G(`ZodDefault`,(e,t)=>{Ey.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function _C(e,t){return new gC({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ug(t)}})}let vC=G(`ZodPrefault`,(e,t)=>{Oy.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yC(e,t){return new vC({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ug(t)}})}let bC=G(`ZodNonOptional`,(e,t)=>{ky.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xC(e,t){return new bC(H({type:`nonoptional`,innerType:e},K(t)))}let SC=G(`ZodCatch`,(e,t)=>{jy.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Px(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function CC(e,t){return new SC({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}let wC=G(`ZodPipe`,(e,t)=>{My.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fx(e,t,n,r),e.in=t.in,e.out=t.out});function TC(e,t){return new wC({type:`pipe`,in:e,out:t})}let EC=G(`ZodReadonly`,(e,t)=>{Py.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ix(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function DC(e){return new EC({type:`readonly`,innerType:e})}let OC=G(`ZodLazy`,(e,t)=>{Iy.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zx(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function kC(e){return new OC({type:`lazy`,getter:e})}let AC=G(`ZodCustom`,(e,t)=>{Ly.init(e,t),dS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yx(e,t,n,r)});function jC(e,t){return Ub(AC,e==null?(()=>!0):e,t)}function MC(e,t={}){return Wb(AC,e,t)}function NC(e,t){return Gb(e,t)}function PC(e,t={}){let n=new AC(H({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0},K(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 FC;(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})(FC||(FC={}));var IC;(function(e){e.mergeShapes=(e,t)=>H(H({},e),t)})(IC||(IC={}));let Y=FC.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),LC=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=FC.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 RC=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,FC.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()}};RC.create=e=>new RC(e);let zC=(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,FC.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:n=`Unrecognized key(s) in object: ${FC.joinValues(e.keys,`, `)}`;break;case X.invalid_union:n=`Invalid input`;break;case X.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${FC.joinValues(e.options)}`;break;case X.invalid_enum_value:n=`Invalid enum value. Expected ${FC.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}"`:FC.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,FC.assertNever(e)}return{message:n}},BC=zC;function VC(){return BC}let HC=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=VC(),r=HC({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===zC?void 0:zC].filter(e=>!!e)});e.common.issues.push(r)}var UC=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 WC;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 WC;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 WC=Object.freeze({status:`aborted`}),GC=e=>({status:`dirty`,value:e}),KC=e=>({status:`valid`,value:e}),qC=e=>e.status===`aborted`,JC=e=>e.status===`dirty`,YC=e=>e.status===`valid`,XC=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 ZC=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 QC=(e,t)=>{if(YC(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 RC(e.common.issues);return this._error=t,this._error}}};function $C(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 ew=class{get description(){return this._def.description}_getType(e){return LC(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:LC(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new UC,ctx:{common:e.parent.common,data:e.data,parsedType:LC(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(XC(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:LC(e)},i=this._parseSync({data:e,path:r.path,parent:r});return QC(r,i)}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:LC(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return YC(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=>YC(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:LC(e)},i=n._parse({data:e,path:r.path,parent:r}),a=await(XC(i)?i:Promise.resolve(i));return QC(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 nT({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 rT.create(this,this._def)}nullable(){return iT.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Lw.create(this)}promise(){return tT.create(this,this._def)}or(e){return Bw.create([this,e],this._def)}and(e){return Ww.create(this,e,this._def)}transform(e){return new nT(H(H({},$C(this._def)),{},{schema:this,typeName:$.ZodEffects,effect:{type:`transform`,transform:e}}))}default(e){let t=typeof e==`function`?e:()=>e;return new aT(H(H({},$C(this._def)),{},{innerType:this,defaultValue:t,typeName:$.ZodDefault}))}brand(){return new cT(H({typeName:$.ZodBranded,type:this},$C(this._def)))}catch(e){let t=typeof e==`function`?e:()=>e;return new oT(H(H({},$C(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 lT.create(this,e)}readonly(){return uT.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};let tw=/^c[^\s-]{8,}$/i,nw=/^[0-9a-z]+$/,rw=/^[0-9A-HJKMNP-TV-Z]{26}$/i,iw=/^[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,aw=/^[a-z0-9_-]{21}$/i,ow=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,sw=/^[-+]?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)?)??$/,cw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,lw,uw=/^(?:(?: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])$/,dw=/^(?:(?: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])$/,fw=/^(([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]))$/,pw=/^(([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])$/,mw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,hw=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,gw=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,_w=RegExp(`^${gw}$`);function vw(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 yw(e){return RegExp(`^${vw(e)}$`)}function bw(e){let t=`${gw}T${vw(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function xw(e,t){return!!((t===`v4`||!t)&&uw.test(e)||(t===`v6`||!t)&&fw.test(e))}function Sw(e,t){if(!ow.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 Cw(e,t){return!!((t===`v4`||!t)&&dw.test(e)||(t===`v6`||!t)&&pw.test(e))}var ww=class e extends ew{_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}),WC}let t=new UC,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`)cw.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`)lw||(lw=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),lw.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`)iw.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`)aw.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`)tw.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`)nw.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`)rw.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`?bw(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`?_w.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{code:X.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?yw(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`?sw.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`duration`,code:X.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?xw(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`?Sw(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`?Cw(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`?mw.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`base64`,code:X.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?hw.test(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{validation:`base64url`,code:X.invalid_string,message:r.message}),t.dirty()):FC.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}};ww.create=e=>{var t;return new ww(H({checks:[],typeName:$.ZodString,coerce:(t=e==null?void 0:e.coerce)!=null&&t},$C(e)))};function Tw(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 Ew=class e extends ew{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}),WC}let t,n=new UC;for(let r of this._def.checks)r.kind===`int`?FC.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`?Tw(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()):FC.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`&&FC.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)}};Ew.create=e=>new Ew(H({checks:[],typeName:$.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1},$C(e)));var Dw=class e extends ew{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 UC;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()):FC.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}),WC}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}};Dw.create=e=>{var t;return new Dw(H({checks:[],typeName:$.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!=null&&t},$C(e)))};var Ow=class extends ew{_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}),WC}return KC(e.data)}};Ow.create=e=>new Ow(H({typeName:$.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1},$C(e)));var kw=class e extends ew{_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}),WC}if(Number.isNaN(e.data.getTime()))return Z(this._getOrReturnCtx(e),{code:X.invalid_date}),WC;let t=new UC,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()):FC.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)}};kw.create=e=>new kw(H({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:$.ZodDate},$C(e)));var Aw=class extends ew{_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}),WC}return KC(e.data)}};Aw.create=e=>new Aw(H({typeName:$.ZodSymbol},$C(e)));var jw=class extends ew{_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}),WC}return KC(e.data)}};jw.create=e=>new jw(H({typeName:$.ZodUndefined},$C(e)));var Mw=class extends ew{_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}),WC}return KC(e.data)}};Mw.create=e=>new Mw(H({typeName:$.ZodNull},$C(e)));var Nw=class extends ew{constructor(){super(...arguments),this._any=!0}_parse(e){return KC(e.data)}};Nw.create=e=>new Nw(H({typeName:$.ZodAny},$C(e)));var Pw=class extends ew{constructor(){super(...arguments),this._unknown=!0}_parse(e){return KC(e.data)}};Pw.create=e=>new Pw(H({typeName:$.ZodUnknown},$C(e)));var Fw=class extends ew{_parse(e){let t=this._getOrReturnCtx(e);return Z(t,{code:X.invalid_type,expected:Y.never,received:t.parsedType}),WC}};Fw.create=e=>new Fw(H({typeName:$.ZodNever},$C(e)));var Iw=class extends ew{_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}),WC}return KC(e.data)}};Iw.create=e=>new Iw(H({typeName:$.ZodVoid},$C(e)));var Lw=class e extends ew{_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}),WC;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 ZC(t,e,t.path,n)))).then(e=>UC.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new ZC(t,e,t.path,n)));return UC.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)}};Lw.create=(e,t)=>new Lw(H({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$.ZodArray},$C(t)));function Rw(e){if(e instanceof zw){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=rT.create(Rw(r))}return new zw(H(H({},e._def),{},{shape:()=>t}))}else if(e instanceof Lw)return new Lw(H(H({},e._def),{},{type:Rw(e.element)}));else if(e instanceof rT)return rT.create(Rw(e.unwrap()));else if(e instanceof iT)return iT.create(Rw(e.unwrap()));else if(e instanceof Gw)return Gw.create(e.items.map(e=>Rw(e)));else return e}var zw=class e extends ew{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=FC.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}),WC}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Fw&&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 ZC(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Fw){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 ZC(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=>UC.mergeObjectSync(t,e)):UC.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 FC.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 FC.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e(H(H({},this._def),{},{shape:()=>n}))}deepPartial(){return Rw(this)}partial(t){let n={};for(let e of FC.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 FC.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof rT;)t=t._def.innerType;n[e]=t}return new e(H(H({},this._def),{},{shape:()=>n}))}keyof(){return Qw(FC.objectKeys(this.shape))}};zw.create=(e,t)=>new zw(H({shape:()=>e,unknownKeys:`strip`,catchall:Fw.create(),typeName:$.ZodObject},$C(t))),zw.strictCreate=(e,t)=>new zw(H({shape:()=>e,unknownKeys:`strict`,catchall:Fw.create(),typeName:$.ZodObject},$C(t))),zw.lazycreate=(e,t)=>new zw(H({shape:e,unknownKeys:`strip`,catchall:Fw.create(),typeName:$.ZodObject},$C(t)));var Bw=class extends ew{_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 RC(e.ctx.common.issues));return Z(t,{code:X.invalid_union,unionErrors:n}),WC}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 RC(e));return Z(t,{code:X.invalid_union,unionErrors:i}),WC}}get options(){return this._def.options}};Bw.create=(e,t)=>new Bw(H({options:e,typeName:$.ZodUnion},$C(t)));let Vw=e=>e instanceof Xw?Vw(e.schema):e instanceof nT?Vw(e.innerType()):e instanceof Zw?[e.value]:e instanceof $w?e.options:e instanceof eT?FC.objectValues(e.enum):e instanceof aT?Vw(e._def.innerType):e instanceof jw?[void 0]:e instanceof Mw?[null]:e instanceof rT?[void 0,...Vw(e.unwrap())]:e instanceof iT?[null,...Vw(e.unwrap())]:e instanceof cT||e instanceof uT?Vw(e.unwrap()):e instanceof oT?Vw(e._def.innerType):[];var Hw=class e extends ew{_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}),WC;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]}),WC)}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=Vw(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},$C(r)))}};function Uw(e,t){let n=LC(e),r=LC(t);if(e===t)return{valid:!0,data:e};if(n===Y.object&&r===Y.object){let n=FC.objectKeys(t),r=FC.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i=H(H({},e),t);for(let n of r){let r=Uw(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=Uw(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 Ww=class extends ew{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(qC(e)||qC(r))return WC;let i=Uw(e.value,r.value);return i.valid?((JC(e)||JC(r))&&t.dirty(),{status:t.value,value:i.data}):(Z(n,{code:X.invalid_intersection_types}),WC)};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}))}};Ww.create=(e,t,n)=>new Ww(H({left:e,right:t,typeName:$.ZodIntersection},$C(n)));var Gw=class e extends ew{_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}),WC;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`}),WC;!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 ZC(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>UC.mergeArray(t,e)):UC.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e(H(H({},this._def),{},{rest:t}))}};Gw.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new Gw(H({items:e,typeName:$.ZodTuple,rest:null},$C(t)))};var Kw=class e extends ew{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}),WC;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new ZC(n,e,n.path,e)),value:a._parse(new ZC(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?UC.mergeObjectAsync(t,r):UC.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof ew?new e(H({keyType:t,valueType:n,typeName:$.ZodRecord},$C(r))):new e(H({keyType:ww.create(),valueType:t,typeName:$.ZodRecord},$C(n)))}},qw=class extends ew{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}),WC;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new ZC(n,e,n.path,[a,`key`])),value:i._parse(new ZC(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 WC;(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 WC;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};qw.create=(e,t,n)=>new qw(H({valueType:t,keyType:e,typeName:$.ZodMap},$C(n)));var Jw=class e extends ew{_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}),WC;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 WC;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 ZC(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)}};Jw.create=(e,t)=>new Jw(H({valueType:e,minSize:null,maxSize:null,typeName:$.ZodSet},$C(t)));var Yw=class e extends ew{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}),WC;function n(e,n){return HC({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,VC(),zC].filter(e=>!!e),issueData:{code:X.invalid_arguments,argumentsError:n}})}function r(e,n){return HC({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,VC(),zC].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 tT){let e=this;return KC(async function(...t){let o=new RC([]),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 KC(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new RC([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new RC([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:Gw.create(t).rest(Pw.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||Gw.create([]).rest(Pw.create()),returns:n||Pw.create(),typeName:$.ZodFunction},$C(r)))}},Xw=class extends ew{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})}};Xw.create=(e,t)=>new Xw(H({getter:e,typeName:$.ZodLazy},$C(t)));var Zw=class extends ew{_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}),WC}return{status:`valid`,value:e.data}}get value(){return this._def.value}};Zw.create=(e,t)=>new Zw(H({value:e,typeName:$.ZodLiteral},$C(t)));function Qw(e,t){return new $w(H({values:e,typeName:$.ZodEnum},$C(t)))}var $w=class e extends ew{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return Z(t,{expected:FC.joinValues(n),received:t.parsedType,code:X.invalid_type}),WC}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}),WC}return KC(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))}};$w.create=Qw;var eT=class extends ew{_parse(e){let t=FC.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Y.string&&n.parsedType!==Y.number){let e=FC.objectValues(t);return Z(n,{expected:FC.joinValues(e),received:n.parsedType,code:X.invalid_type}),WC}if(this._cache||(this._cache=new Set(FC.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=FC.objectValues(t);return Z(n,{received:n.data,code:X.invalid_enum_value,options:e}),WC}return KC(e.data)}get enum(){return this._def.values}};eT.create=(e,t)=>new eT(H({values:e,typeName:$.ZodNativeEnum},$C(t)));var tT=class extends ew{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}),WC):KC((t.parsedType===Y.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};tT.create=(e,t)=>new tT(H({type:e,typeName:$.ZodPromise},$C(t)));var nT=class extends ew{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 WC;let i=await t._def.schema._parseAsync({data:e,path:r.path,parent:r});return i.status===`aborted`?WC:i.status===`dirty`||n.value===`dirty`?GC(i.value):i});{if(n.value===`aborted`)return WC;let t=this._def.schema._parseSync({data:e,path:r.path,parent:r});return t.status===`aborted`?WC:t.status===`dirty`||n.value===`dirty`?GC(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`?WC:(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`?WC:(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(!YC(e))return WC;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=>YC(e)?Promise.resolve(i.transform(e.value,a)).then(e=>({status:n.value,value:e})):WC);FC.assertNever(i)}};nT.create=(e,t,n)=>new nT(H({schema:e,typeName:$.ZodEffects,effect:t},$C(n))),nT.createWithPreprocess=(e,t,n)=>new nT(H({schema:t,effect:{type:`preprocess`,transform:e},typeName:$.ZodEffects},$C(n)));var rT=class extends ew{_parse(e){return this._getType(e)===Y.undefined?KC(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};rT.create=(e,t)=>new rT(H({innerType:e,typeName:$.ZodOptional},$C(t)));var iT=class extends ew{_parse(e){return this._getType(e)===Y.null?KC(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};iT.create=(e,t)=>new iT(H({innerType:e,typeName:$.ZodNullable},$C(t)));var aT=class extends ew{_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}};aT.create=(e,t)=>new aT(H({innerType:e,typeName:$.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default},$C(t)));var oT=class extends ew{_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 XC(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new RC(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new RC(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};oT.create=(e,t)=>new oT(H({innerType:e,typeName:$.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch},$C(t)));var sT=class extends ew{_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}),WC}return{status:`valid`,value:e.data}}};sT.create=e=>new sT(H({typeName:$.ZodNaN},$C(e)));var cT=class extends ew{_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}},lT=class e extends ew{_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`?WC:e.status===`dirty`?(n.dirty(),GC(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`?WC: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})}},uT=class extends ew{_parse(e){let t=this._def.innerType._parse(e),n=e=>(YC(e)&&(e.value=Object.freeze(e.value)),e);return XC(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};uT.create=(e,t)=>new uT(H({innerType:e,typeName:$.ZodReadonly},$C(t))),zw.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`})($||($={})),ww.create,Ew.create,sT.create,Dw.create,Ow.create,kw.create,Aw.create,jw.create,Mw.create,Nw.create,Pw.create,Fw.create,Iw.create,Lw.create,zw.create,zw.strictCreate,Bw.create,Hw.create,Ww.create,Gw.create,Kw.create,qw.create,Jw.create,Yw.create,Xw.create,Zw.create,$w.create,eT.create,tT.create,nT.create,rT.create,iT.create,nT.createWithPreprocess,lT.create;var dT=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 fT(e){}function pT(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=fT,onError:n=fT,onRetry:r=fT,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(`
|
|
92
|
+
`)===-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 dT(`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(`
|
|
93
|
+
`,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(`
|
|
94
|
+
`,n);continue}let i=e.charCodeAt(n);if(mT(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(`
|
|
95
|
+
`,n);continue}u=d===0?a:`${u}
|
|
96
|
+
${a}`,d++}else hT(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(`
|
|
97
|
+
`,n)}return e.slice(n)}for(;n<e.length;){let t=e.indexOf(`\r`,n),r=e.indexOf(`
|
|
98
|
+
`,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(mT(e,t,r)){let r=e.charCodeAt(t+5)===32?t+6:t+5,i=e.slice(r,n);u=d===0?i:`${u}
|
|
99
|
+
${i}`,d++;return}if(hT(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}
|
|
100
|
+
${t}`,d++;break;case`id`:l=t.includes(`\0`)?void 0:t;break;case`retry`:/^\d+$/.test(t)?r(parseInt(t,10)):n(new dT(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:i}));break;default:n(new dT(`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 mT(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 hT(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 gT=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n,maxBufferSize:r}={}){let i;super({start(a){i=pT({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)}})}};let _T=[`additionalProperties`],vT=[`type`],yT=[`type`];var{btoa:bT,atob:xT}=globalThis,ST=globalThis.fetch;CT(ST);function CT(e){if(typeof e!=`function`)return!1;let t=Function.prototype.toString.call(e);return t.includes(`internal/deps/undici`)||t.includes(`lazy loading of undici`)}function wT(){let e=Error.prepareStackTrace;try{Error.prepareStackTrace=(e,t)=>t;let e=Error(`Capture current module path`);Error.captureStackTrace(e,wT);let[t]=e.stack,n=t==null?void 0:t.getFileName();if(n==null)throw Error(`Unable to determine the current module path`);return n}finally{Error.prepareStackTrace=e}}var TT=({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 cg({argument:`separator`,message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${i()}`},ET=TT();function DT(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 OT=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,kT=/"(?: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 AT(e){let t=JSON.parse(e);return typeof t!=`object`||!t||OT.test(e)===!1&&kT.test(e)===!1?t:jT(t)}function jT(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 MT(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch(t){return AT(e)}try{return AT(e)}finally{Error.stackTraceLimit=t}}function NT(e){if(e.type===`object`||Array.isArray(e.type)&&e.type.includes(`object`)){let{additionalProperties:t}=e;e.additionalProperties=t!=null&&typeof t!=`boolean`&&PT(t);let{properties:n}=e;if(n!=null)for(let e of Object.keys(n))n[e]=PT(n[e])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(PT):PT(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(PT)),e.allOf!=null&&(e.allOf=e.allOf.map(PT)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(PT));let{definitions:t}=e;if(t!=null)for(let e of Object.keys(t))t[e]=PT(t[e]);return e}function PT(e){return typeof e==`boolean`?e:NT(e)}var FT=Symbol(`Let zodToJsonSchema decide on which parser to use`),IT={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`},LT=e=>typeof e==`string`?H(H({},IT),{},{name:e}):H(H({},IT),e);function RT(){return{}}function zT(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=AE(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 BT(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 VT(){return{type:`boolean`}}function HT(e,t){return AE(e.type._def,t)}var UT=(e,t)=>AE(e.innerType._def,t);function WT(e,t,n){let r=n==null?t.dateStrategy:n;if(Array.isArray(r))return{anyOf:r.map((n,r)=>WT(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 GT(e)}}var GT=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 KT(e,t){return H(H({},AE(e.innerType._def,t)),{},{default:e.defaultValue()})}function qT(e,t){return t.effectStrategy===`input`?AE(e.schema._def,t):RT()}function JT(e){return{type:`string`,enum:Array.from(e.values)}}var YT=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function XT(e,t){let n=[AE(e.left._def,H(H({},t),{},{currentPath:[...t.currentPath,`allOf`,`0`]})),AE(e.right._def,H(H({},t),{},{currentPath:[...t.currentPath,`allOf`,`1`]}))].filter(e=>!!e),r=[];return n.forEach(e=>{if(YT(e))r.push(...e.allOf);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n}=e;t=yr(e,_T)}r.push(t)}}),r.length?{allOf:r}:void 0}function ZT(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 QT=void 0,$T={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:()=>(QT===void 0&&(QT=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),QT),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 eE(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`:iE(n,`email`,r.message,t);break;case`format:idn-email`:iE(n,`idn-email`,r.message,t);break;case`pattern:zod`:aE(n,$T.email,r.message,t);break}break;case`url`:iE(n,`uri`,r.message,t);break;case`uuid`:iE(n,`uuid`,r.message,t);break;case`regex`:aE(n,r.regex,r.message,t);break;case`cuid`:aE(n,$T.cuid,r.message,t);break;case`cuid2`:aE(n,$T.cuid2,r.message,t);break;case`startsWith`:aE(n,RegExp(`^${tE(r.value,t)}`),r.message,t);break;case`endsWith`:aE(n,RegExp(`${tE(r.value,t)}$`),r.message,t);break;case`datetime`:iE(n,`date-time`,r.message,t);break;case`date`:iE(n,`date`,r.message,t);break;case`time`:iE(n,`time`,r.message,t);break;case`duration`:iE(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`:aE(n,RegExp(tE(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&iE(n,`ipv4`,r.message,t),r.version!==`v4`&&iE(n,`ipv6`,r.message,t);break;case`base64url`:aE(n,$T.base64url,r.message,t);break;case`jwt`:aE(n,$T.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&&aE(n,$T.ipv4Cidr,r.message,t),r.version!==`v4`&&aE(n,$T.ipv6Cidr,r.message,t);break;case`emoji`:aE(n,$T.emoji(),r.message,t);break;case`ulid`:aE(n,$T.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:iE(n,`binary`,r.message,t);break;case`contentEncoding:base64`:n.contentEncoding=`base64`;break;case`pattern:zod`:aE(n,$T.base64,r.message,t);break}break;case`nanoid`:aE(n,$T.nanoid,r.message,t);case`toLowerCase`:case`toUpperCase`:case`trim`:break;default:}return n}function tE(e,t){return t.patternStrategy===`escape`?rE(e):e}var nE=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function rE(e){let t=``;for(let n=0;n<e.length;n++)nE.has(e[n])||(t+=`\\`),t+=e[n];return t}function iE(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 aE(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:oE(t,r)},n&&r.errorMessages&&{errorMessage:{pattern:n}}))):e.pattern=oE(t,r)}function oE(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
|
|
101
101
|
]))`;continue}else if(i[e]===`$`){a+=`($|(?=[\r
|
|
102
102
|
]))`;continue}}if(r.s&&i[e]===`.`){a+=s?`${i[e]}\r
|
|
103
103
|
`:`[${i[e]}\r
|
|
104
|
-
]`;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 qT(e,t){var n,r,i,a,o,s;let c={type:`object`,additionalProperties:(n=gE(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=BT(e.keyType._def,t),{type:r}=n,i=vr(n,Zw);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=OT(e.keyType._def,t),{type:r}=n,i=vr(n,Qw);return U(U({},c),{},{propertyNames:i})}return c}function JT(e,t){return t.mapStrategy===`record`?qT(e,t):{type:`array`,maxItems:125,items:{type:`array`,items:[gE(e.keyType._def,U(U({},t),{},{currentPath:[...t.currentPath,`items`,`items`,`0`]}))||wT(),gE(e.valueType._def,U(U({},t),{},{currentPath:[...t.currentPath,`items`,`items`,`1`]}))||wT()],minItems:2,maxItems:2}}}function YT(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 XT(){return{not:wT()}}function ZT(){return{type:`null`}}var QT={ZodString:`string`,ZodNumber:`number`,ZodBigInt:`integer`,ZodBoolean:`boolean`,ZodNull:`null`};function $T(e,t){let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in QT&&(!e._def.checks||!e._def.checks.length))){let e=n.reduce((e,t)=>{let n=QT[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 eE(e,t)}var eE=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>gE(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 tE(e,t){if([`ZodString`,`ZodNumber`,`ZodBigInt`,`ZodBoolean`,`ZodNull`].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[QT[e.innerType._def.typeName],`null`]};let n=gE(e.innerType._def,U(U({},t),{},{currentPath:[...t.currentPath,`anyOf`,`0`]}));return n&&{anyOf:[n,{type:`null`}]}}function nE(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 rE(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=aE(a),s=gE(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=iE(e,t);return a!==void 0&&(n.additionalProperties=a),n}function iE(e,t){if(e.catchall._def.typeName!==`ZodNever`)return gE(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 aE(e){try{return e.isOptional()}catch(e){return!0}}var oE=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return gE(e.innerType._def,t);let r=gE(e.innerType._def,U(U({},t),{},{currentPath:[...t.currentPath,`anyOf`,`1`]}));return r?{anyOf:[{not:wT()},r]}:wT()},sE=(e,t)=>{if(t.pipeStrategy===`input`)return gE(e.in._def,t);if(t.pipeStrategy===`output`)return gE(e.out._def,t);let n=gE(e.in._def,U(U({},t),{},{currentPath:[...t.currentPath,`allOf`,`0`]}));return{allOf:[n,gE(e.out._def,U(U({},t),{},{currentPath:[...t.currentPath,`allOf`,n?`1`:`0`]}))].filter(e=>e!==void 0)}};function cE(e,t){return gE(e.type._def,t)}function lE(e,t){let n={type:`array`,uniqueItems:!0,items:gE(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 uE(e,t){return e.rest?{type:`array`,minItems:e.items.length,items:e.items.map((e,n)=>gE(e._def,U(U({},t),{},{currentPath:[...t.currentPath,`items`,`${n}`]}))).reduce((e,t)=>t===void 0?e:[...e,t],[]),additionalItems:gE(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)=>gE(e._def,U(U({},t),{},{currentPath:[...t.currentPath,`items`,`${n}`]}))).reduce((e,t)=>t===void 0?e:[...e,t],[])}}function dE(){return{not:wT()}}function fE(){return wT()}var pE=(e,t)=>gE(e.innerType._def,t),mE=(e,t,n)=>{switch(t){case $.ZodString:return BT(e,n);case $.ZodNumber:return nE(e);case $.ZodObject:return rE(e,n);case $.ZodBigInt:return ET(e);case $.ZodBoolean:return DT();case $.ZodDate:return AT(e,n);case $.ZodUndefined:return dE();case $.ZodNull:return ZT();case $.ZodArray:return TT(e,n);case $.ZodUnion:case $.ZodDiscriminatedUnion:return $T(e,n);case $.ZodIntersection:return IT(e,n);case $.ZodTuple:return uE(e,n);case $.ZodRecord:return qT(e,n);case $.ZodLiteral:return LT(e);case $.ZodEnum:return PT(e);case $.ZodNativeEnum:return YT(e);case $.ZodNullable:return tE(e,n);case $.ZodOptional:return oE(e,n);case $.ZodMap:return JT(e,n);case $.ZodSet:return lE(e,n);case $.ZodLazy:return()=>e.getter()._def;case $.ZodPromise:return cE(e,n);case $.ZodNaN:case $.ZodNever:return XT();case $.ZodEffects:return NT(e,n);case $.ZodAny:return wT();case $.ZodUnknown:return fE();case $.ZodDefault:return MT(e,n);case $.ZodBranded:return OT(e,n);case $.ZodReadonly:return pE(e,n);case $.ZodCatch:return kT(e,n);case $.ZodPipeline:return sE(e,n);case $.ZodFunction:case $.ZodVoid:case $.ZodSymbol:return;default:return(e=>void 0)(t)}},hE=(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 gE(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!==xT)return a}if(i&&!n){let e=_E(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=mE(e,e.typeName,t),s=typeof o==`function`?gE(o(),t):o;if(s&&vE(e,t,s),t.postProcess){let n=t.postProcess(s,e,t);return a.jsonSchema=s,n}return a.jsonSchema=s,s}var _E=(e,t)=>{switch(t.$refStrategy){case`root`:return{$ref:e.path.join(`/`)};case`relative`:return{$ref:hE(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`),wT()):t.$refStrategy===`seen`?wT():void 0}},vE=(e,t,n)=>(e.description&&(n.description=e.description),n),yE=e=>{let t=CT(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}]))})},bE=(e,t)=>{var n;let r=yE(t),i=typeof t==`object`&&t.definitions?Object.entries(t.definitions).reduce((e,[t,n])=>{var i;return U(U({},e),{},{[t]:(i=gE(n._def,U(U({},r),{},{currentPath:[...r.basePath,r.definitionPath,t]}),!0))==null?wT():i})},{}):void 0,a=typeof t==`string`?t:(t==null?void 0:t.nameStrategy)===`title`||t==null?void 0:t.name,o=(n=gE(e._def,a===void 0?r:U(U({},r),{},{currentPath:[...r.basePath,r.definitionPath,a]}),!1))==null?wT():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 xE(e,t){var n;let r=(n=t==null?void 0:t.useReferences)!=null&&n;return yT(()=>bE(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 SE(e,t){var n;let r=(n=t==null?void 0:t.useReferences)!=null&&n;return yT(()=>bT(Tx(e,{target:`draft-7`,io:`input`,reused:r?`ref`:`inline`})),{validate:async t=>{let n=await Rx(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function CE(e){return`_zod`in e}function wE(e,t){return CE(e)?SE(e,t):xE(e,t)}function TE(e){return typeof e==`object`&&!!e&&vT in e&&e[vT]===!0&&`jsonSchema`in e&&`validate`in e}function EE(e){return e==null?yT({properties:{},additionalProperties:!1}):TE(e)?e:typeof e==`function`?e():wE(e)}var{btoa:DE,atob:OE}=globalThis;let kE=[`abortSignal`],AE=[`messageId`];var jE=Object.defineProperty,ME=(e,t)=>{for(var n in t)jE(e,n,{get:t[n],enumerable:!0})},NE=`AI_NoObjectGeneratedError`,PE=`vercel.ai.error.${NE}`,FE=Symbol.for(PE),IE,LE=class extends Nh{constructor({message:e=`No object generated.`,cause:t,text:n,response:r,usage:i,finishReason:a}){super({name:NE,message:e,cause:t}),this[IE]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=a}static isInstance(e){return Nh.hasMarker(e,PE)}};IE=FE;var RE=IS([J(),yC(Uint8Array),yC(ArrayBuffer),gC(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null&&n},{message:`Must be a Buffer`})]),zE=mC(()=>IS([TS(),J(),yS(),CS(),HS(J(),zE),jS(zE)])),BE=HS(J(),HS(J(),zE)),VE=NS({type:KS(`text`),text:J(),providerOptions:BE.optional()}),HE=NS({type:KS(`image`),image:IS([RE,yC(URL)]),mediaType:J().optional(),providerOptions:BE.optional()}),UE=NS({type:KS(`file`),data:IS([RE,yC(URL)]),filename:J().optional(),mediaType:J(),providerOptions:BE.optional()}),WE=NS({type:KS(`reasoning`),text:J(),providerOptions:BE.optional()}),GE=NS({type:KS(`tool-call`),toolCallId:J(),toolName:J(),input:DS(),providerOptions:BE.optional(),providerExecuted:CS().optional()}),KE=RS(`type`,[NS({type:KS(`text`),value:J()}),NS({type:KS(`json`),value:zE}),NS({type:KS(`error-text`),value:J()}),NS({type:KS(`error-json`),value:zE}),NS({type:KS(`content`),value:jS(IS([NS({type:KS(`text`),text:J()}),NS({type:KS(`media`),data:J(),mediaType:J()})]))})]),qE=NS({type:KS(`tool-result`),toolCallId:J(),toolName:J(),output:KE,providerOptions:BE.optional()});IS([NS({role:KS(`system`),content:J(),providerOptions:BE.optional()}),NS({role:KS(`user`),content:IS([J(),jS(IS([VE,HE,UE]))]),providerOptions:BE.optional()}),NS({role:KS(`assistant`),content:IS([J(),jS(IS([VE,UE,WE,GE,qE]))]),providerOptions:BE.optional()}),NS({role:KS(`tool`),content:jS(qE),providerOptions:BE.optional()})]),$w({prefix:`aitxt`,size:24}),TransformStream;var JE=uT(()=>wE(IS([PS({type:KS(`text-start`),id:J(),providerMetadata:BE.optional()}),PS({type:KS(`text-delta`),id:J(),delta:J(),providerMetadata:BE.optional()}),PS({type:KS(`text-end`),id:J(),providerMetadata:BE.optional()}),PS({type:KS(`error`),errorText:J()}),PS({type:KS(`tool-input-start`),toolCallId:J(),toolName:J(),providerExecuted:CS().optional(),dynamic:CS().optional()}),PS({type:KS(`tool-input-delta`),toolCallId:J(),inputTextDelta:J()}),PS({type:KS(`tool-input-available`),toolCallId:J(),toolName:J(),input:DS(),providerExecuted:CS().optional(),providerMetadata:BE.optional(),dynamic:CS().optional()}),PS({type:KS(`tool-input-error`),toolCallId:J(),toolName:J(),input:DS(),providerExecuted:CS().optional(),providerMetadata:BE.optional(),dynamic:CS().optional(),errorText:J()}),PS({type:KS(`tool-output-available`),toolCallId:J(),output:DS(),providerExecuted:CS().optional(),dynamic:CS().optional(),preliminary:CS().optional()}),PS({type:KS(`tool-output-error`),toolCallId:J(),errorText:J(),providerExecuted:CS().optional(),dynamic:CS().optional()}),PS({type:KS(`reasoning-start`),id:J(),providerMetadata:BE.optional()}),PS({type:KS(`reasoning-delta`),id:J(),delta:J(),providerMetadata:BE.optional()}),PS({type:KS(`reasoning-end`),id:J(),providerMetadata:BE.optional()}),PS({type:KS(`source-url`),sourceId:J(),url:J(),title:J().optional(),providerMetadata:BE.optional()}),PS({type:KS(`source-document`),sourceId:J(),mediaType:J(),title:J(),filename:J().optional(),providerMetadata:BE.optional()}),PS({type:KS(`file`),url:J(),mediaType:J(),providerMetadata:BE.optional()}),PS({type:gC(e=>typeof e==`string`&&e.startsWith(`data-`),{message:`Type must start with "data-"`}),id:J().optional(),data:DS(),transient:CS().optional()}),PS({type:KS(`start-step`)}),PS({type:KS(`finish-step`)}),PS({type:KS(`start`),messageId:J().optional(),messageMetadata:DS().optional()}),PS({type:KS(`finish`),finishReason:WS([`stop`,`length`,`content-filter`,`tool-calls`,`error`,`other`,`unknown`]).optional(),messageMetadata:DS().optional()}),PS({type:KS(`abort`)}),PS({type:KS(`message-metadata`),messageMetadata:DS()})])));function YE(e){return e.type.startsWith(`data-`)}function XE(){return Object.create(null)}function ZE(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]=ZE(a,i):n[r]=i}return n}function QE(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 $E(e){if(e===void 0)return{value:void 0,state:`undefined-input`};let t=await hT({text:e});return t.success?{value:t.value,state:`successful-parse`}:(t=await hT({text:QE(e)}),t.success?{value:t.value,state:`repaired-parse`}:{value:void 0,state:`failed-parse`})}function eD(e){return e.type.startsWith(`data-`)}function tD(e){return e.type.startsWith(`tool-`)}function nD(e){return e.type===`dynamic-tool`}function rD(e){return tD(e)||nD(e)}function iD(e){return e.type.split(`-`).slice(1).join(`-`)}function aD({lastMessage:e,messageId:t}){return{message:(e==null?void 0:e.role)===`assistant`?e:{id:t,metadata:void 0,role:`assistant`,parts:[]},activeTextParts:XE(),activeReasoningParts:XE(),partialToolCalls:XE()}}function oD({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(tD).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=>tD(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:ZE(r.message.metadata,e);t!=null&&await pT({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(tD);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 $E(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:iD(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:iD(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=XE(),r.activeReasoningParts=XE();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(YE(e)){(n==null?void 0:n[e.type])!=null&&await pT({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 sD({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()}}$w({prefix:`aitxt`,size:24}),$w({prefix:`aiobj`,size:24});var cD=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()})}};$w({prefix:`aiobj`,size:24}),ME({},{object:()=>uD,text:()=>lD});var lD=()=>({type:`text`,responseFormat:{type:`text`},async parsePartial({text:e}){return{partial:e}},async parseOutput({text:e}){return e}}),uD=({schema:e})=>{let t=EE(e);return{type:`object`,responseFormat:{type:`json`,schema:t.jsonSchema},async parsePartial({text:e}){let t=await $E(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 hT({text:e});if(!r.success)throw new LE({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 mT({value:r.value,schema:t});if(!i.success)throw new LE({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 dD(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 fD=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,kE);var i,a,o,s,c;let l=await _T(t.body),u=await _T(t.headers),d=await _T(t.credentials),f=U(U({},tT(u)),tT(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:tT(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 _T(t.body),c=await _T(t.headers),l=await _T(t.credentials),u=U(U({},tT(c)),tT(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:tT(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)}},pD=class extends fD{constructor(e={}){super(e)}processResponseStream(e){return gT({stream:e,schema:JE}).pipeThrough(new TransformStream({async transform(e,t){if(!e.success)throw e.error;t.enqueue(e.value)}}))}},mD=class{constructor({generateId:e=eT,id:t=e(),transport:n=new pD,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 cD,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 dD(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,AE),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=>rD(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=>rD(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:aD({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 sD({stream:oD({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 hD({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(rD).filter(e=>!e.providerExecuted);return r.length>0&&r.every(e=>e.state===`output-available`||e.state===`output-error`)}var gD;function _D(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var vD=_D();function yD(e){vD=e}var bD={exec:()=>null};function xD(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(CD.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var SD=(()=>{try{return!0}catch(e){return!1}})(),CD={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`)},wD=/^(?:[ \t]*(?:\n|$))+/,TD=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ED=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,DD=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,OD=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,kD=/(?:[*+-]|\d{1,9}[.)])/,AD=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,jD=xD(AD).replace(/bull/g,kD).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(),MD=xD(AD).replace(/bull/g,kD).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(),ND=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,PD=/^[^\n]+/,FD=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ID=xD(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,FD).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),LD=xD(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,kD).getRegex(),RD=`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`,zD=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,BD=xD(`^ {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`,zD).replace(`tag`,RD).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),VD=xD(ND).replace(`hr`,DD).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`,RD).getRegex(),HD={blockquote:xD(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,VD).getRegex(),code:TD,def:ID,fences:ED,heading:OD,hr:DD,html:BD,lheading:jD,list:LD,newline:wD,paragraph:VD,table:bD,text:PD},UD=xD(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,DD).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`,RD).getRegex(),WD=U(U({},HD),{},{lheading:MD,table:UD,paragraph:xD(ND).replace(`hr`,DD).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,UD).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`,RD).getRegex()}),GD=U(U({},HD),{},{html:xD(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,zD).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:bD,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:xD(ND).replace(`hr`,DD).replace(`heading`,` *#{1,6} *[^
|
|
105
|
-
]`).replace(`lheading`,
|
|
104
|
+
]`;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 sE(e,t){var n,r,i,a,o,s;let c={type:`object`,additionalProperties:(n=AE(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=eE(e.keyType._def,t),{type:r}=n,i=yr(n,vT);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=HT(e.keyType._def,t),{type:r}=n,i=yr(n,yT);return H(H({},c),{},{propertyNames:i})}return c}function cE(e,t){return t.mapStrategy===`record`?sE(e,t):{type:`array`,maxItems:125,items:{type:`array`,items:[AE(e.keyType._def,H(H({},t),{},{currentPath:[...t.currentPath,`items`,`items`,`0`]}))||RT(),AE(e.valueType._def,H(H({},t),{},{currentPath:[...t.currentPath,`items`,`items`,`1`]}))||RT()],minItems:2,maxItems:2}}}function lE(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 uE(){return{not:RT()}}function dE(){return{type:`null`}}var fE={ZodString:`string`,ZodNumber:`number`,ZodBigInt:`integer`,ZodBoolean:`boolean`,ZodNull:`null`};function pE(e,t){let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in fE&&(!e._def.checks||!e._def.checks.length))){let e=n.reduce((e,t)=>{let n=fE[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 mE(e,t)}var mE=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>AE(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 hE(e,t){if([`ZodString`,`ZodNumber`,`ZodBigInt`,`ZodBoolean`,`ZodNull`].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[fE[e.innerType._def.typeName],`null`]};let n=AE(e.innerType._def,H(H({},t),{},{currentPath:[...t.currentPath,`anyOf`,`0`]}));return n&&{anyOf:[n,{type:`null`}]}}function gE(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 _E(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=yE(a),s=AE(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=vE(e,t);return a!==void 0&&(n.additionalProperties=a),n}function vE(e,t){if(e.catchall._def.typeName!==`ZodNever`)return AE(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 yE(e){try{return e.isOptional()}catch(e){return!0}}var bE=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return AE(e.innerType._def,t);let r=AE(e.innerType._def,H(H({},t),{},{currentPath:[...t.currentPath,`anyOf`,`1`]}));return r?{anyOf:[{not:RT()},r]}:RT()},xE=(e,t)=>{if(t.pipeStrategy===`input`)return AE(e.in._def,t);if(t.pipeStrategy===`output`)return AE(e.out._def,t);let n=AE(e.in._def,H(H({},t),{},{currentPath:[...t.currentPath,`allOf`,`0`]}));return{allOf:[n,AE(e.out._def,H(H({},t),{},{currentPath:[...t.currentPath,`allOf`,n?`1`:`0`]}))].filter(e=>e!==void 0)}};function SE(e,t){return AE(e.type._def,t)}function CE(e,t){let n={type:`array`,uniqueItems:!0,items:AE(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 wE(e,t){return e.rest?{type:`array`,minItems:e.items.length,items:e.items.map((e,n)=>AE(e._def,H(H({},t),{},{currentPath:[...t.currentPath,`items`,`${n}`]}))).reduce((e,t)=>t===void 0?e:[...e,t],[]),additionalItems:AE(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)=>AE(e._def,H(H({},t),{},{currentPath:[...t.currentPath,`items`,`${n}`]}))).reduce((e,t)=>t===void 0?e:[...e,t],[])}}function TE(){return{not:RT()}}function EE(){return RT()}var DE=(e,t)=>AE(e.innerType._def,t),OE=(e,t,n)=>{switch(t){case $.ZodString:return eE(e,n);case $.ZodNumber:return gE(e);case $.ZodObject:return _E(e,n);case $.ZodBigInt:return BT(e);case $.ZodBoolean:return VT();case $.ZodDate:return WT(e,n);case $.ZodUndefined:return TE();case $.ZodNull:return dE();case $.ZodArray:return zT(e,n);case $.ZodUnion:case $.ZodDiscriminatedUnion:return pE(e,n);case $.ZodIntersection:return XT(e,n);case $.ZodTuple:return wE(e,n);case $.ZodRecord:return sE(e,n);case $.ZodLiteral:return ZT(e);case $.ZodEnum:return JT(e);case $.ZodNativeEnum:return lE(e);case $.ZodNullable:return hE(e,n);case $.ZodOptional:return bE(e,n);case $.ZodMap:return cE(e,n);case $.ZodSet:return CE(e,n);case $.ZodLazy:return()=>e.getter()._def;case $.ZodPromise:return SE(e,n);case $.ZodNaN:case $.ZodNever:return uE();case $.ZodEffects:return qT(e,n);case $.ZodAny:return RT();case $.ZodUnknown:return EE();case $.ZodDefault:return KT(e,n);case $.ZodBranded:return HT(e,n);case $.ZodReadonly:return DE(e,n);case $.ZodCatch:return UT(e,n);case $.ZodPipeline:return xE(e,n);case $.ZodFunction:case $.ZodVoid:case $.ZodSymbol:return;default:return(e=>void 0)(t)}},kE=(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 AE(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!==FT)return a}if(i&&!n){let e=jE(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=OE(e,e.typeName,t),s=typeof o==`function`?AE(o(),t):o;if(s&&ME(e,t,s),t.postProcess){let n=t.postProcess(s,e,t);return a.jsonSchema=s,n}return a.jsonSchema=s,s}var jE=(e,t)=>{switch(t.$refStrategy){case`root`:return{$ref:e.path.join(`/`)};case`relative`:return{$ref:kE(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`),RT()):t.$refStrategy===`seen`?RT():void 0}},ME=(e,t,n)=>(e.description&&(n.description=e.description),n),NE=e=>{let t=LT(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}]))})},PE=(e,t)=>{var n;let r=NE(t),i=typeof t==`object`&&t.definitions?Object.entries(t.definitions).reduce((e,[t,n])=>{var i;return H(H({},e),{},{[t]:(i=AE(n._def,H(H({},r),{},{currentPath:[...r.basePath,r.definitionPath,t]}),!0))==null?RT():i})},{}):void 0,a=typeof t==`string`?t:(t==null?void 0:t.nameStrategy)===`title`||t==null?void 0:t.name,o=(n=AE(e._def,a===void 0?r:H(H({},r),{},{currentPath:[...r.basePath,r.definitionPath,a]}),!1))==null?RT():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},FE=Symbol.for(`vercel.ai.schema`);function IE(e){let t;return()=>(t==null&&(t=e()),t)}function LE(e,{validate:t}={}){return{[FE]:!0,_type:void 0,get jsonSchema(){return typeof e==`function`&&(e=e()),e},validate:t}}function RE(e){return typeof e==`object`&&!!e&&FE in e&&e[FE]===!0&&`jsonSchema`in e&&`validate`in e}function zE(e){return e==null?LE({type:`object`,properties:{},additionalProperties:!1}):RE(e)?e:`~standard`in e?e[`~standard`].vendor===`zod`?GE(e):BE(e):e()}function BE(e){return LE(()=>{if(!VE(e))throw Error(`Standard schema vendor '${e[`~standard`].vendor}' does not support JSON Schema conversion.`);return NT(e[`~standard`].jsonSchema.input({target:`draft-07`}))},{validate:async t=>{let n=await e[`~standard`].validate(t);return`value`in n?{success:!0,value:n.value}:{success:!1,error:new bg({value:t,cause:n.issues})}}})}function VE(e){return e[`~standard`].jsonSchema!=null}function HE(e,t){var n;let r=(n=t==null?void 0:t.useReferences)!=null&&n;return LE(()=>PE(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 UE(e,t){var n;let r=(n=t==null?void 0:t.useReferences)!=null&&n;return LE(()=>NT(Vx(e,{target:`draft-7`,io:`input`,reused:r?`ref`:`inline`})),{validate:async t=>{let n=await eS(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function WE(e){return`_zod`in e}function GE(e,t){return WE(e)?UE(e,t):HE(e,t)}async function KE({value:e,schema:t,context:n}){let r=await qE({value:e,schema:t,context:n});if(!r.success)throw bg.wrap({value:e,cause:r.error,context:n});return r.value}async function qE({value:e,schema:t,context:n}){let r=zE(t);try{if(r.validate==null)return{success:!0,value:e,rawValue:e};let t=await r.validate(e);return t.success?{success:!0,value:t.value,rawValue:e}:{success:!1,error:bg.wrap({value:e,cause:t.error,context:n}),rawValue:e}}catch(t){return{success:!1,error:bg.wrap({value:e,cause:t,context:n}),rawValue:e}}}async function JE({text:e,schema:t}){try{let n=MT(e);return t==null?{success:!0,value:n,rawValue:n}:await qE({value:n,schema:t})}catch(t){return{success:!1,error:mg.isInstance(t)?t:new mg({text:e,cause:t}),rawValue:void 0}}}function YE({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new gT).pipeThrough(new TransformStream({async transform({data:e},n){e!==`[DONE]`&&n.enqueue(await JE({text:e,schema:t}))}}))}async function XE(e){return typeof e==`function`&&(e=e()),Promise.resolve(e)}new TextDecoder;let ZE=[`$schema`],QE=[`abortSignal`],$E=[`messageId`];var eD=Object.defineProperty,tD=(e,t)=>{for(var n in t)eD(e,n,{get:t[n],enumerable:!0})},nD=`AI_NoObjectGeneratedError`,rD=`vercel.ai.error.${nD}`,iD=Symbol.for(rD),aD,oD=class extends tg{constructor({message:e=`No object generated.`,cause:t,text:n,response:r,usage:i,finishReason:a}){super({name:nD,message:e,cause:t}),this[aD]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=a}static isInstance(e){return tg.hasMarker(e,rD)}};aD=iD;var sD=`AI_UIMessageStreamError`,cD=`vercel.ai.error.${sD}`,lD=Symbol.for(cD),uD,dD=class extends tg{constructor({chunkType:e,chunkId:t,message:n}){super({name:sD,message:n}),this[uD]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return tg.hasMarker(e,cD)}};uD=lD;function fD(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]=fD(a,i):n[r]=i}return n}var pD=QS([q(),PC(Uint8Array),PC(ArrayBuffer),jC(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null&&n},{message:`Must be a Buffer`})]),mD=kC(()=>QS([VS(),q(),FS(),zS(),iC(q(),mD.optional()),qS(mD)])),hD=iC(q(),iC(q(),mD.optional())),gD=YS({type:J(`text`),text:q(),providerOptions:hD.optional()}),_D=YS({type:J(`image`),image:QS([pD,PC(URL)]),mediaType:q().optional(),providerOptions:hD.optional()}),vD=YS({type:J(`file`),data:QS([pD,PC(URL)]),filename:q().optional(),mediaType:q(),providerOptions:hD.optional()}),yD=YS({type:J(`reasoning`),text:q(),providerOptions:hD.optional()}),bD=YS({type:J(`tool-call`),toolCallId:q(),toolName:q(),input:US(),providerOptions:hD.optional(),providerExecuted:zS().optional()}),xD=eC(`type`,[YS({type:J(`text`),value:q(),providerOptions:hD.optional()}),YS({type:J(`json`),value:mD,providerOptions:hD.optional()}),YS({type:J(`execution-denied`),reason:q().optional(),providerOptions:hD.optional()}),YS({type:J(`error-text`),value:q(),providerOptions:hD.optional()}),YS({type:J(`error-json`),value:mD,providerOptions:hD.optional()}),YS({type:J(`content`),value:qS(QS([YS({type:J(`text`),text:q(),providerOptions:hD.optional()}),YS({type:J(`media`),data:q(),mediaType:q()}),YS({type:J(`file-data`),data:q(),mediaType:q(),filename:q().optional(),providerOptions:hD.optional()}),YS({type:J(`file-url`),url:q(),providerOptions:hD.optional()}),YS({type:J(`file-id`),fileId:QS([q(),iC(q(),q())]),providerOptions:hD.optional()}),YS({type:J(`image-data`),data:q(),mediaType:q(),providerOptions:hD.optional()}),YS({type:J(`image-url`),url:q(),providerOptions:hD.optional()}),YS({type:J(`image-file-id`),fileId:QS([q(),iC(q(),q())]),providerOptions:hD.optional()}),YS({type:J(`custom`),providerOptions:hD.optional()})]))})]),SD=YS({type:J(`tool-result`),toolCallId:q(),toolName:q(),output:xD,providerOptions:hD.optional()}),CD=YS({type:J(`tool-approval-request`),approvalId:q(),toolCallId:q()}),wD=YS({type:J(`tool-approval-response`),approvalId:q(),approved:zS(),reason:q().optional()});QS([YS({role:J(`system`),content:q(),providerOptions:hD.optional()}),YS({role:J(`user`),content:QS([q(),qS(QS([gD,_D,vD]))]),providerOptions:hD.optional()}),YS({role:J(`assistant`),content:QS([q(),qS(QS([gD,vD,yD,bD,SD,CD]))]),providerOptions:hD.optional()}),YS({role:J(`tool`),content:qS(QS([SD,wD])),providerOptions:hD.optional()})]),new TextEncoder,tD({},{array:()=>kD,choice:()=>AD,json:()=>jD,object:()=>OD,text:()=>DD});function TD(e){let t=[`ROOT`],n=-1,r=null,i=0;function a(e){return e>=`0`&&e<=`9`||e>=`A`&&e<=`F`||e>=`a`&&e<=`f`}function o(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 s(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_COMMA`);break;case`}`:n=r,t.pop();break}}function c(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=r,t.pop();break}}for(let l=0;l<e.length;l++){let u=e[l];switch(t[t.length-1]){case`ROOT`:o(u,l,`FINISH`);break;case`INSIDE_OBJECT_START`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`);break;case`}`:n=l,t.pop();break}break;case`INSIDE_OBJECT_AFTER_COMMA`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`);break}break;case`INSIDE_OBJECT_KEY`:switch(u){case`"`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_KEY`);break}break;case`INSIDE_OBJECT_AFTER_KEY`:switch(u){case`:`:t.pop(),t.push(`INSIDE_OBJECT_BEFORE_VALUE`);break}break;case`INSIDE_OBJECT_BEFORE_VALUE`:o(u,l,`INSIDE_OBJECT_AFTER_VALUE`);break;case`INSIDE_OBJECT_AFTER_VALUE`:s(u,l);break;case`INSIDE_STRING`:switch(u){case`"`:t.pop(),n=l;break;case`\\`:t.push(`INSIDE_STRING_ESCAPE`);break;default:n=l}break;case`INSIDE_ARRAY_START`:switch(u){case`]`:n=l,t.pop();break;default:n=l,o(u,l,`INSIDE_ARRAY_AFTER_VALUE`);break}break;case`INSIDE_ARRAY_AFTER_VALUE`:switch(u){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=l,t.pop();break;default:n=l;break}break;case`INSIDE_ARRAY_AFTER_COMMA`:o(u,l,`INSIDE_ARRAY_AFTER_VALUE`);break;case`INSIDE_STRING_ESCAPE`:t.pop(),u===`u`?(i=0,t.push(`INSIDE_STRING_UNICODE_ESCAPE`)):n=l;break;case`INSIDE_STRING_UNICODE_ESCAPE`:a(u)&&(i++,i===4&&(t.pop(),n=l));break;case`INSIDE_NUMBER`:switch(u){case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=l;break;case`e`:case`E`:case`-`:case`.`:break;case`,`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&s(u,l);break;case`}`:t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&s(u,l);break;case`]`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l);break;default:t.pop();break}break;case`INSIDE_LITERAL`:{let i=e.substring(r,l+1);!`false`.startsWith(i)&&!`true`.startsWith(i)&&!`null`.startsWith(i)?(t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`?s(u,l):t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&c(u,l)):n=l;break}}}let l=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--)switch(t[n]){case`INSIDE_STRING`:l+=`"`;break;case`INSIDE_OBJECT_KEY`:case`INSIDE_OBJECT_AFTER_KEY`:case`INSIDE_OBJECT_AFTER_COMMA`:case`INSIDE_OBJECT_START`:case`INSIDE_OBJECT_BEFORE_VALUE`:case`INSIDE_OBJECT_AFTER_VALUE`:l+=`}`;break;case`INSIDE_ARRAY_START`:case`INSIDE_ARRAY_AFTER_COMMA`:case`INSIDE_ARRAY_AFTER_VALUE`:l+=`]`;break;case`INSIDE_LITERAL`:{let t=e.substring(r,e.length);`true`.startsWith(t)?l+=`true`.slice(t.length):`false`.startsWith(t)?l+=`false`.slice(t.length):`null`.startsWith(t)&&(l+=`null`.slice(t.length))}}return l}async function ED(e){if(e===void 0)return{value:void 0,state:`undefined-input`};let t=await JE({text:e});return t.success?{value:t.value,state:`successful-parse`}:(t=await JE({text:TD(e)}),t.success?{value:t.value,state:`repaired-parse`}:{value:void 0,state:`failed-parse`})}var DD=()=>({name:`text`,responseFormat:Promise.resolve({type:`text`}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),OD=({schema:e,name:t,description:n})=>{let r=zE(e);return{name:`object`,responseFormat:XE(r.jsonSchema).then(e=>H(H({type:`json`,schema:e},t!=null&&{name:t}),n!=null&&{description:n})),async parseCompleteOutput({text:e},t){let n=await JE({text:e});if(!n.success)throw new oD({message:`No object generated: could not parse the response.`,cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let i=await qE({value:n.value,schema:r});if(!i.success)throw new oD({message:`No object generated: response did not match schema.`,cause:i.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return i.value},async parsePartialOutput({text:e}){let t=await ED(e);switch(t.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:return{partial:t.value}}},createElementStreamTransform(){}}},kD=({element:e,name:t,description:n})=>{let r=zE(e);return{name:`array`,responseFormat:XE(r.jsonSchema).then(e=>{let{$schema:r}=e;return H(H({type:`json`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{elements:{type:`array`,items:yr(e,ZE)}},required:[`elements`],additionalProperties:!1}},t!=null&&{name:t}),n!=null&&{description:n})}),async parseCompleteOutput({text:e},t){let n=await JE({text:e});if(!n.success)throw new oD({message:`No object generated: could not parse the response.`,cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let i=n.value;if(typeof i!=`object`||!i||!(`elements`in i)||!Array.isArray(i.elements))throw new oD({message:`No object generated: response did not match schema.`,cause:new bg({value:i,cause:`response must be an object with an elements array`}),text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let a=[];for(let n of i.elements){let i=await qE({value:n,schema:r});if(!i.success)throw new oD({message:`No object generated: response did not match schema.`,cause:i.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});a.push(i.value)}return a},async parsePartialOutput({text:e}){let t=await ED(e);switch(t.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:{let e=t.value;if(typeof e!=`object`||!e||!(`elements`in e)||!Array.isArray(e.elements))return;let n=t.state===`repaired-parse`&&e.elements.length>0?e.elements.slice(0,-1):e.elements,i=[];for(let e of n){let t=await qE({value:e,schema:r});t.success&&i.push(t.value)}return{partial:i}}}},createElementStreamTransform(){let e=0;return new TransformStream({transform({partialOutput:t},n){if(t!=null)for(;e<t.length;e++)n.enqueue(t[e])}})}}},AD=({options:e,name:t,description:n})=>({name:`choice`,responseFormat:Promise.resolve(H(H({type:`json`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{result:{type:`string`,enum:e}},required:[`result`],additionalProperties:!1}},t!=null&&{name:t}),n!=null&&{description:n})),async parseCompleteOutput({text:t},n){let r=await JE({text:t});if(!r.success)throw new oD({message:`No object generated: could not parse the response.`,cause:r.error,text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});let i=r.value;if(typeof i!=`object`||!i||!(`result`in i)||typeof i.result!=`string`||!e.includes(i.result))throw new oD({message:`No object generated: response did not match schema.`,cause:new bg({value:i,cause:`response must be an object that contains a choice value.`}),text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});return i.result},async parsePartialOutput({text:t}){let n=await ED(t);switch(n.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:{let t=n.value;if(typeof t!=`object`||!t||!(`result`in t)||typeof t.result!=`string`)return;let r=e.filter(e=>e.startsWith(t.result));return n.state===`successful-parse`?r.includes(t.result)?{partial:t.result}:void 0:r.length===1?{partial:r[0]}:void 0}}},createElementStreamTransform(){}}),jD=({name:e,description:t}={})=>({name:`json`,responseFormat:Promise.resolve(H(H({type:`json`},e!=null&&{name:e}),t!=null&&{description:t})),async parseCompleteOutput({text:e},t){let n=await JE({text:e});if(!n.success)throw new oD({message:`No object generated: could not parse the response.`,cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return n.value},async parsePartialOutput({text:e}){let t=await ED(e);switch(t.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:return t.value===void 0?void 0:{partial:t.value}}},createElementStreamTransform(){}});TT({prefix:`aitxt`,size:24}),TransformStream;var MD=iC(q(),mD.optional()),ND=IE(()=>GE(QS([XS({type:J(`text-start`),id:q(),providerMetadata:hD.optional()}),XS({type:J(`text-delta`),id:q(),delta:q(),providerMetadata:hD.optional()}),XS({type:J(`text-end`),id:q(),providerMetadata:hD.optional()}),XS({type:J(`error`),errorText:q()}),XS({type:J(`tool-input-start`),toolCallId:q(),toolName:q(),providerExecuted:zS().optional(),providerMetadata:hD.optional(),toolMetadata:MD.optional(),dynamic:zS().optional(),title:q().optional()}),XS({type:J(`tool-input-delta`),toolCallId:q(),inputTextDelta:q()}),XS({type:J(`tool-input-available`),toolCallId:q(),toolName:q(),input:US(),providerExecuted:zS().optional(),providerMetadata:hD.optional(),toolMetadata:MD.optional(),dynamic:zS().optional(),title:q().optional()}),XS({type:J(`tool-input-error`),toolCallId:q(),toolName:q(),input:US(),providerExecuted:zS().optional(),providerMetadata:hD.optional(),toolMetadata:MD.optional(),dynamic:zS().optional(),errorText:q(),title:q().optional()}),XS({type:J(`tool-approval-request`),approvalId:q(),toolCallId:q(),approvalDescriptor:US().optional(),signature:q().optional()}),XS({type:J(`tool-output-available`),toolCallId:q(),output:US(),providerExecuted:zS().optional(),providerMetadata:hD.optional(),toolMetadata:MD.optional(),dynamic:zS().optional(),preliminary:zS().optional()}),XS({type:J(`tool-output-error`),toolCallId:q(),errorText:q(),providerExecuted:zS().optional(),providerMetadata:hD.optional(),toolMetadata:MD.optional(),dynamic:zS().optional()}),XS({type:J(`tool-output-denied`),toolCallId:q()}),XS({type:J(`reasoning-start`),id:q(),providerMetadata:hD.optional()}),XS({type:J(`reasoning-delta`),id:q(),delta:q(),providerMetadata:hD.optional()}),XS({type:J(`reasoning-end`),id:q(),providerMetadata:hD.optional()}),XS({type:J(`source-url`),sourceId:q(),url:q(),title:q().optional(),providerMetadata:hD.optional()}),XS({type:J(`source-document`),sourceId:q(),mediaType:q(),title:q(),filename:q().optional(),providerMetadata:hD.optional()}),XS({type:J(`file`),url:q(),mediaType:q(),providerMetadata:hD.optional()}),XS({type:jC(e=>typeof e==`string`&&e.startsWith(`data-`),{message:`Type must start with "data-"`}),id:q().optional(),data:US(),transient:zS().optional()}),XS({type:J(`start-step`)}),XS({type:J(`finish-step`)}),XS({type:J(`start`),messageId:q().optional(),messageMetadata:US().optional()}),XS({type:J(`finish`),finishReason:oC([`stop`,`length`,`content-filter`,`tool-calls`,`error`,`other`]).optional(),messageMetadata:US().optional()}),XS({type:J(`abort`),reason:q().optional()}),XS({type:J(`message-metadata`),messageMetadata:US()})])));function PD(e){return e.type.startsWith(`data-`)}function FD(){return Object.create(null)}function ID(e){return e.type.startsWith(`data-`)}function LD(e){return e.type.startsWith(`tool-`)}function RD(e){return e.type===`dynamic-tool`}function zD(e){return LD(e)||RD(e)}function BD(e){return e.type.split(`-`).slice(1).join(`-`)}function VD({lastMessage:e,messageId:t}){return{message:(e==null?void 0:e.role)===`assistant`?e:{id:t,metadata:void 0,role:`assistant`,parts:[]},activeTextParts:FD(),activeReasoningParts:FD(),partialToolCalls:FD()}}function HD({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(){let e=r.message.parts,t=e.length-1;for(;t>=0&&e[t].type!==`step-start`;)t--;return e.slice(t+1)}function m(){return p().filter(zD)}function h(e){let t=m().find(t=>t.toolCallId===e);if(t==null){let n=r.message.parts;for(let r=n.length-1;r>=0;r--){let i=n[r];if(zD(i)&&i.toolCallId===e){t=i;break}}}if(t==null)throw new dD({chunkType:`tool-invocation`,chunkId:e,message:`No tool invocation found for tool call ID "${e}".`});return t}function g(e,t){var n;let i=t==null?p().find(t=>LD(t)&&t.toolCallId===e.toolCallId):t,a=e,o=i;if(i!=null){i.state=e.state,o.input=a.input,o.output=a.output,o.errorText=a.errorText,o.rawInput=a.rawInput,o.preliminary=a.preliminary,e.title!==void 0&&(o.title=e.title),e.toolMetadata!==void 0&&(o.toolMetadata=e.toolMetadata),o.providerExecuted=(n=a.providerExecuted)==null?i.providerExecuted:n;let t=a.providerMetadata;if(t!=null)if(e.state===`output-available`||e.state===`output-error`){let e=i;e.resultProviderMetadata=t}else i.callProviderMetadata=t}else r.message.parts.push(H(H(H({type:`tool-${e.toolName}`,toolCallId:e.toolCallId,state:e.state,title:e.title},e.toolMetadata===void 0?{}:{toolMetadata:e.toolMetadata}),{},{input:a.input,output:a.output,rawInput:a.rawInput,errorText:a.errorText,providerExecuted:a.providerExecuted,preliminary:a.preliminary},a.providerMetadata!=null&&(e.state===`output-available`||e.state===`output-error`)?{resultProviderMetadata:a.providerMetadata}:{}),a.providerMetadata!=null&&!(e.state===`output-available`||e.state===`output-error`)?{callProviderMetadata:a.providerMetadata}:{}))}function _(e,t){var n,i;let a=t==null?p().find(t=>t.type===`dynamic-tool`&&t.toolCallId===e.toolCallId):t,o=e,s=a;if(a!=null){a.state=e.state,s.toolName=e.toolName,s.input=o.input,s.output=o.output,s.errorText=o.errorText,s.rawInput=(n=o.rawInput)==null?s.rawInput:n,s.preliminary=o.preliminary,e.title!==void 0&&(s.title=e.title),e.toolMetadata!==void 0&&(s.toolMetadata=e.toolMetadata),s.providerExecuted=(i=o.providerExecuted)==null?a.providerExecuted:i;let t=o.providerMetadata;if(t!=null)if(e.state===`output-available`||e.state===`output-error`){let e=a;e.resultProviderMetadata=t}else a.callProviderMetadata=t}else r.message.parts.push(H(H(H({type:`dynamic-tool`,toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:o.input,output:o.output,errorText:o.errorText,preliminary:o.preliminary,providerExecuted:o.providerExecuted,title:e.title},e.toolMetadata===void 0?{}:{toolMetadata:e.toolMetadata}),o.providerMetadata!=null&&(e.state===`output-available`||e.state===`output-error`)?{resultProviderMetadata:o.providerMetadata}:{}),o.providerMetadata!=null&&!(e.state===`output-available`||e.state===`output-error`)?{callProviderMetadata:o.providerMetadata}:{}))}async function v(e){if(e!=null){let n=r.message.metadata==null?e:fD(r.message.metadata,e);t!=null&&await KE({value:n,schema:t,context:{field:`message.metadata`,entityId:r.message.id}}),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];if(t==null)throw new dD({chunkType:`text-delta`,chunkId:e.id,message:`Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});t.text+=e.delta,t.providerMetadata=(l=e.providerMetadata)==null?t.providerMetadata:l,c();break}case`text-end`:{let t=r.activeTextParts[e.id];if(t==null)throw new dD({chunkType:`text-end`,chunkId:e.id,message:`Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});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`,id:e.id,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];if(t==null)throw new dD({chunkType:`reasoning-delta`,chunkId:e.id,message:`Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});t.text+=e.delta,t.providerMetadata=(d=e.providerMetadata)==null?t.providerMetadata:d,c();break}case`reasoning-end`:{let t=r.activeReasoningParts[e.id];if(t==null)throw new dD({chunkType:`reasoning-end`,chunkId:e.id,message:`Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});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(H({type:`file`,mediaType:e.mediaType,url:e.url},e.providerMetadata==null?{}:{providerMetadata:e.providerMetadata})),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=p().filter(LD);r.partialToolCalls[e.toolCallId]={text:``,toolName:e.toolName,index:t.length,dynamic:e.dynamic,title:e.title,toolMetadata:e.toolMetadata},e.dynamic?_({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-streaming`,input:void 0,providerExecuted:e.providerExecuted,title:e.title,toolMetadata:e.toolMetadata,providerMetadata:e.providerMetadata}):g({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-streaming`,input:void 0,providerExecuted:e.providerExecuted,title:e.title,toolMetadata:e.toolMetadata,providerMetadata:e.providerMetadata}),c();break}case`tool-input-delta`:{let t=r.partialToolCalls[e.toolCallId];if(t==null)throw new dD({chunkType:`tool-input-delta`,chunkId:e.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});t.text+=e.inputTextDelta;let{value:n}=await ED(t.text);t.dynamic?_({toolCallId:e.toolCallId,toolName:t.toolName,state:`input-streaming`,input:n,title:t.title,toolMetadata:t.toolMetadata}):g({toolCallId:e.toolCallId,toolName:t.toolName,state:`input-streaming`,input:n,title:t.title,toolMetadata:t.toolMetadata}),c();break}case`tool-input-available`:e.dynamic?_({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-available`,input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title,toolMetadata:e.toolMetadata}):g({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-available`,input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title,toolMetadata:e.toolMetadata}),c(),a&&!e.providerExecuted&&await a({toolCall:e});break;case`tool-input-error`:{let t=p().filter(zD).find(t=>t.toolCallId===e.toolCallId);(t==null?e.dynamic:t.type===`dynamic-tool`)?_({toolCallId:e.toolCallId,toolName:e.toolName,state:`output-error`,input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,toolMetadata:e.toolMetadata}):g({toolCallId:e.toolCallId,toolName:e.toolName,state:`output-error`,input:void 0,rawInput:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,toolMetadata:e.toolMetadata}),c();break}case`tool-approval-request`:{let t=h(e.toolCallId);t.state=`approval-requested`,t.approval=H(H({id:e.approvalId},e.approvalDescriptor==null?{}:{descriptor:e.approvalDescriptor}),e.signature==null?{}:{signature:e.signature}),c();break}case`tool-output-denied`:{let t=h(e.toolCallId);t.state=`output-denied`,c();break}case`tool-output-available`:{let t=h(e.toolCallId);t.type===`dynamic-tool`?_({toolCallId:e.toolCallId,toolName:t.toolName,state:`output-available`,input:t.input,output:e.output,preliminary:e.preliminary,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:t.toolMetadata},t):g({toolCallId:e.toolCallId,toolName:BD(t),state:`output-available`,input:t.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:t.toolMetadata},t),c();break}case`tool-output-error`:{let t=h(e.toolCallId);t.type===`dynamic-tool`?_({toolCallId:e.toolCallId,toolName:t.toolName,state:`output-error`,input:t.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:t.toolMetadata},t):g({toolCallId:e.toolCallId,toolName:BD(t),state:`output-error`,input:t.input,rawInput:t.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:t.toolMetadata},t),c();break}case`start-step`:r.message.parts.push({type:`step-start`});break;case`finish-step`:r.activeTextParts=FD(),r.activeReasoningParts=FD();break;case`start`:e.messageId!=null&&(r.message.id=e.messageId),await v(e.messageMetadata),(e.messageId!=null||e.messageMetadata!=null)&&c({updateStatus:!1});break;case`finish`:e.finishReason!=null&&(r.finishReason=e.finishReason),await v(e.messageMetadata),e.messageMetadata!=null&&c();break;case`message-metadata`:await v(e.messageMetadata),e.messageMetadata!=null&&c();break;case`error`:i==null||i(Error(e.errorText));break;default:if(PD(e)){if((n==null?void 0:n[e.type])!=null){let t=r.message.parts.findIndex(t=>`id`in t&&`data`in t&&t.id===e.id&&t.type===e.type),i=t>=0?t:r.message.parts.length;await KE({value:e.data,schema:n[e.type],context:{field:`message.parts[${i}].data`,entityName:e.type,entityId:e.id}})}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 UD({stream:e,onError:t,abortSignal:n}){let r=e.getReader(),i=()=>{r.cancel().catch(()=>{})};n!=null&&n.aborted?i():n==null||n.addEventListener(`abort`,i,{once:!0});try{for(;;){let{done:e}=await r.read();if(e)break}}catch(e){t==null||t(e)}finally{n==null||n.removeEventListener(`abort`,i),r.releaseLock()}}TT({prefix:`aitxt`,size:24}),iC(q(),mD.optional()),new TextEncoder,TT({prefix:`aiobj`,size:24});var WD=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()})}};TT({prefix:`aiobj`,size:24});async function GD(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 KD=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,QE);var i,a,o,s,c;let l=await XE(t.body),u=await XE(t.headers),d=await XE(t.credentials),f=H(H({},DT(u)),DT(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:DT(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 XE(t.body),c=await XE(t.headers),l=await XE(t.credentials),u=H(H({},DT(c)),DT(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:DT(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,signal:e.abortSignal});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)}},qD=class extends KD{constructor(e={}){super(e)}processResponseStream(e){return YE({stream:e,schema:ND}).pipeThrough(new TransformStream({async transform(e,t){if(!e.success)throw e.error;t.enqueue(e.value)}}))}},JD=class{constructor({generateId:e=ET,id:t=e(),transport:n=new qD,messageMetadataSchema:r,dataPartSchemas:i,state:a,onError:o,onToolCall:s,onFinish:c,onData:l,sendAutomaticallyWhen:u}){var d=this;this.activeResponse=void 0,this.activeResumeRequest=void 0,this.jobExecutor=new WD,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 GD(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,$E),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.addToolApprovalResponse=async({id:e,approved:t,reason:n,options:r})=>d.jobExecutor.run(async()=>{let i=d.state.messages,a=i[i.length-1],o=r=>zD(r)&&r.state===`approval-requested`&&r.approval.id===e?H(H({},r),{},{state:`approval-responded`,approval:H(H({},r.approval),{},{id:e,approved:t,reason:n})}):r;d.state.replaceMessage(i.length-1,H(H({},a),{},{parts:a.parts.map(o)})),d.activeResponse&&(d.activeResponse.state.message.parts=d.activeResponse.state.message.parts.map(o)),d.status!==`streaming`&&d.status!==`submitted`&&d.sendAutomaticallyWhen&&d.shouldSendAutomatically().then(e=>{var t;e&&d.makeRequest(H({trigger:`submit-message`,messageId:(t=d.lastMessage)==null?void 0:t.id},r))})}),this.addToolOutput=async({state:e=`output-available`,toolCallId:t,output:n,errorText:r,options:i})=>d.jobExecutor.run(async()=>{let a=d.state.messages,o=a[a.length-1],s=i=>zD(i)&&i.toolCallId===t?H(H({},i),{},{state:e,output:n,errorText:r}):i;d.state.replaceMessage(a.length-1,H(H({},o),{},{parts:o.parts.map(s)})),d.activeResponse&&(d.activeResponse.state.message.parts=d.activeResponse.state.message.parts.map(s)),d.status!==`streaming`&&d.status!==`submitted`&&d.sendAutomaticallyWhen&&d.shouldSendAutomatically().then(e=>{var t;e&&d.makeRequest(H({trigger:`submit-message`,messageId:(t=d.lastMessage)==null?void 0:t.id},i))})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var e,t;(e=d.activeResumeRequest)==null||e.abortController.abort(),(t=d.activeResponse)==null||t.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 shouldSendAutomatically(){var e=this;if(!e.sendAutomaticallyWhen)return!1;let t=e.sendAutomaticallyWhen({messages:e.state.messages});return t&&typeof t==`object`&&`then`in t?await t:t}async makeRequest({trigger:e,metadata:t,headers:n,body:r,messageId:i}){var a=this,o,s,c;let l=new AbortController,u=e===`resume-stream`?{abortController:l}:void 0;u&&((o=a.activeResumeRequest)==null||o.abortController.abort(),a.activeResumeRequest=u);let d=()=>u==null||a.activeResumeRequest===u,f=()=>{a.activeResumeRequest===u&&(a.activeResumeRequest=void 0)},p;if(e===`resume-stream`)try{let e=await a.transport.reconnectToStream({chatId:a.id,abortSignal:l.signal,metadata:t,headers:n,body:r});if(l.signal.aborted||!d()){await(e==null?void 0:e.cancel().catch(()=>{})),d()&&a.setStatus({status:`ready`}),f();return}if(e==null){a.setStatus({status:`ready`}),f();return}p=e}catch(e){if(l.signal.aborted||e.name===`AbortError`){d()&&a.setStatus({status:`ready`}),f();return}if(!d())return;a.onError&&e instanceof Error&&a.onError(e),a.setStatus({status:`error`,error:e}),f();return}a.setStatus({status:`submitted`,error:void 0});let m=a.lastMessage,h=!1,g=!1,_=!1,v;try{let o={state:VD({lastMessage:e===`resume-stream`||e===`regenerate-message`?void 0:a.state.snapshot(m),messageId:a.generateId()}),abortController:l};v=o,o.abortController.signal.addEventListener(`abort`,()=>{h=!0}),a.activeResponse=o;let s;if(s=e===`resume-stream`?p: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 UD({stream:HD({stream:s,onToolCall:a.onToolCall,onData:a.onData,messageMetadataSchema:a.messageMetadataSchema,dataPartSchemas:a.dataPartSchemas,runUpdateMessageJob:e=>a.jobExecutor.run(()=>o.abortController.signal.aborted?Promise.resolve():e({state:o.state,write:({updateStatus:e=!0}={})=>{var t;o.abortController.signal.aborted||(e&&a.setStatus({status:`streaming`}),o.state.message.id===((t=a.lastMessage)==null?void 0:t.id)?a.state.replaceMessage(a.state.messages.length-1,o.state.message):a.state.pushMessage(o.state.message))}})),onError:e=>{throw e}}),abortSignal:o.abortController.signal,onError:e=>{throw e}}),h)return d()&&a.setStatus({status:`ready`}),null;d()&&a.setStatus({status:`ready`})}catch(e){if(h||e.name===`AbortError`)return h=!0,d()&&a.setStatus({status:`ready`}),null;if(!d())return null;_=!0,e instanceof TypeError&&(e.message.toLowerCase().includes(`fetch`)||e.message.toLowerCase().includes(`network`))&&(g=!0),a.onError&&e instanceof Error&&a.onError(e),a.setStatus({status:`error`,error:e})}finally{try{v&&((s=a.onFinish)==null||s.call(a,{message:v.state.message,messages:a.state.messages,isAbort:h,isDisconnect:g,isError:_,finishReason:v.state.finishReason}))}finally{a.activeResponse===v&&(a.activeResponse=void 0),f()}}!_&&await a.shouldSendAutomatically()&&await a.makeRequest({trigger:`submit-message`,messageId:(c=a.lastMessage)==null?void 0:c.id,metadata:t,headers:n,body:r})}};function YD({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(zD).filter(e=>!e.providerExecuted);return r.length>0&&r.every(e=>e.state===`output-available`||e.state===`output-error`)}var XD;function ZD(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var QD=ZD();function $D(e){QD=e}var eO={exec:()=>null};function tO(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(rO.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var nO=(()=>{try{return!0}catch(e){return!1}})(),rO={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`)},iO=/^(?:[ \t]*(?:\n|$))+/,aO=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,oO=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,sO=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,cO=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,lO=/(?:[*+-]|\d{1,9}[.)])/,uO=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,dO=tO(uO).replace(/bull/g,lO).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(),fO=tO(uO).replace(/bull/g,lO).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(),pO=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,mO=/^[^\n]+/,hO=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,gO=tO(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,hO).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_O=tO(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,lO).getRegex(),vO=`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`,yO=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,bO=tO(`^ {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`,yO).replace(`tag`,vO).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),xO=tO(pO).replace(`hr`,sO).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`,vO).getRegex(),SO={blockquote:tO(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,xO).getRegex(),code:aO,def:gO,fences:oO,heading:cO,hr:sO,html:bO,lheading:dO,list:_O,newline:iO,paragraph:xO,table:eO,text:mO},CO=tO(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,sO).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`,vO).getRegex(),wO=H(H({},SO),{},{lheading:fO,table:CO,paragraph:tO(pO).replace(`hr`,sO).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,CO).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`,vO).getRegex()}),TO=H(H({},SO),{},{html:tO(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,yO).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:eO,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:tO(pO).replace(`hr`,sO).replace(`heading`,` *#{1,6} *[^
|
|
105
|
+
]`).replace(`lheading`,dO).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()}),EO=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,DO=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,OO=/^( {2,}|\\)\n(?!\s*$)/,kO=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,AO=RegExp(`[\\p{P}\\p{S}]`,`u`),jO=RegExp(`[\\s\\p{P}\\p{S}]`,`u`),MO=RegExp(`[^\\s\\p{P}\\p{S}]`,`u`),NO=tO(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,jO).getRegex(),PO=RegExp(`(?!~)[\\p{P}\\p{S}]`,`u`),FO=RegExp(`(?!~)[\\s\\p{P}\\p{S}]`,`u`),IO=RegExp(`(?:[^\\s\\p{P}\\p{S}]|~)`,`u`),LO=tO(/link|precode-code|html/,`g`).replace(`link`,RegExp("\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)",``)).replace(`precode-`,nO?"(?<!`)()":"(^^|[^`])").replace(`code`,RegExp("(?<b>`+)[^`]+\\k<b>(?!`)",``)).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),RO=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,zO=tO(RO,`u`).replace(/punct/g,AO).getRegex(),BO=tO(RO,`u`).replace(/punct/g,PO).getRegex(),VO=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,HO=tO(VO,`gu`).replace(/notPunctSpace/g,MO).replace(/punctSpace/g,jO).replace(/punct/g,AO).getRegex(),UO=tO(VO,`gu`).replace(/notPunctSpace/g,IO).replace(/punctSpace/g,FO).replace(/punct/g,PO).getRegex(),WO=tO(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,MO).replace(/punctSpace/g,jO).replace(/punct/g,AO).getRegex(),GO=tO(/\\(punct)/,`gu`).replace(/punct/g,AO).getRegex(),KO=tO(/^<(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(),qO=tO(yO).replace(`(?:-->|$)`,`-->`).getRegex(),JO=tO(`^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`,qO).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),YO=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,XO=tO(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,YO).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ZO=tO(/^!?\[(label)\]\[(ref)\]/).replace(`label`,YO).replace(`ref`,hO).getRegex(),QO=tO(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,hO).getRegex(),$O=tO(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,ZO).replace(`nolink`,QO).getRegex(),ek=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,tk={_backpedal:eO,anyPunctuation:GO,autolink:KO,blockSkip:LO,br:OO,code:DO,del:eO,emStrongLDelim:zO,emStrongRDelimAst:HO,emStrongRDelimUnd:WO,escape:EO,link:XO,nolink:QO,punctuation:NO,reflink:ZO,reflinkSearch:$O,tag:JO,text:kO,url:eO},nk=H(H({},tk),{},{link:tO(/^!?\[(label)\]\((.*?)\)/).replace(`label`,YO).getRegex(),reflink:tO(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,YO).getRegex()}),rk=H(H({},tk),{},{emStrongRDelimAst:UO,emStrongLDelim:BO,url:tO(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,ek).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:tO(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,ek).getRegex()}),ik=H(H({},rk),{},{br:tO(OO).replace(`{2,}`,`*`).getRegex(),text:tO(rk.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()}),ak={normal:SO,gfm:wO,pedantic:TO},ok={normal:tk,gfm:rk,breaks:ik,pedantic:nk},sk={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},ck=e=>sk[e];function lk(e,t){if(t){if(rO.escapeTest.test(e))return e.replace(rO.escapeReplace,ck)}else if(rO.escapeTestNoEncode.test(e))return e.replace(rO.escapeReplaceNoEncode,ck);return e}function uk(e){try{e=encodeURI(e).replace(rO.percentDecode,`%`)}catch(e){return null}return e}function dk(e,t){var n;let r=e.replace(rO.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(rO.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(rO.slashPipe,`|`);return r}function fk(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 pk(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 mk(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 hk(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
106
106
|
`).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(`
|
|
107
|
-
`)}var
|
|
108
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=
|
|
109
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=
|
|
107
|
+
`)}var gk=class{constructor(e){V(this,`options`,void 0),V(this,`rules`,void 0),V(this,`lexer`,void 0),this.options=e||QD}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:fk(e,`
|
|
108
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=hk(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=fk(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:fk(t[0],`
|
|
109
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=fk(t[0],`
|
|
110
110
|
`).split(`
|
|
111
111
|
`),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(`
|
|
112
112
|
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
@@ -124,10 +124,10 @@ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
124
124
|
`,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+=`
|
|
125
125
|
`+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+=`
|
|
126
126
|
`+l}!u&&!l.trim()&&(u=!0),r+=f+`
|
|
127
|
-
`,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=
|
|
128
|
-
`):[],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(
|
|
129
|
-
`?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=
|
|
130
|
-
`),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(
|
|
127
|
+
`,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=dk(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(`
|
|
128
|
+
`):[],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(dk(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)===`
|
|
129
|
+
`?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=fk(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=pk(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)),mk(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 mk(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}}}},_k=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||QD,this.options.tokenizer=this.options.tokenizer||new gk,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:rO,block:ak.normal,inline:ok.normal};this.options.pedantic?(t.block=ak.pedantic,t.inline=ok.pedantic):this.options.gfm&&(t.block=ak.gfm,this.options.breaks?t.inline=ok.breaks:t.inline=ok.gfm),this.tokenizer.rules=t}static get rules(){return{block:ak,inline:ok}}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(rO.carriageReturn,`
|
|
130
|
+
`),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(rO.tabCharGlobal,` `).replace(rO.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+=`
|
|
131
131
|
`: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(`
|
|
132
132
|
`)?``:`
|
|
133
133
|
`)+a.raw,n.text+=`
|
|
@@ -140,16 +140,16 @@ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
140
140
|
`+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(`
|
|
141
141
|
`)?``:`
|
|
142
142
|
`)+a.raw,n.text+=`
|
|
143
|
-
`+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}},
|
|
144
|
-
`;return i?`<pre><code class="language-`+
|
|
145
|
-
`:`<pre><code>`+(n?a:
|
|
143
|
+
`+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}},vk=class{constructor(e){V(this,`options`,void 0),V(this,`parser`,void 0),this.options=e||QD}space(e){return``}code({text:e,lang:t,escaped:n}){var r;let i=(r=(t||``).match(rO.notSpaceStart))==null?void 0:r[0],a=e.replace(rO.endingNewline,``)+`
|
|
144
|
+
`;return i?`<pre><code class="language-`+lk(i)+`">`+(n?a:lk(a,!0))+`</code></pre>
|
|
145
|
+
`:`<pre><code>`+(n?a:lk(a,!0))+`</code></pre>
|
|
146
146
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
147
147
|
${this.parser.parse(e)}</blockquote>
|
|
148
148
|
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
149
149
|
`}hr(e){return`<hr>
|
|
150
150
|
`}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+`>
|
|
151
151
|
`+r+`</`+i+`>
|
|
152
|
-
`}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+` `+
|
|
152
|
+
`}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+` `+lk(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>
|
|
153
153
|
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox">`}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
154
154
|
`}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>
|
|
155
155
|
<thead>
|
|
@@ -158,21 +158,21 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
158
158
|
`}tablerow({text:e}){return`<tr>
|
|
159
159
|
${e}</tr>
|
|
160
160
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
161
|
-
`}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>${
|
|
162
|
-
`+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}},
|
|
163
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+kO(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function UO(e,t){return HO.parse(e,t)}UO.options=UO.setOptions=function(e){return HO.setOptions(e),UO.defaults=HO.defaults,yD(UO.defaults),UO},UO.getDefaults=_D,UO.defaults=vD,UO.use=function(...e){return HO.use(...e),UO.defaults=HO.defaults,yD(UO.defaults),UO},UO.walkTokens=function(e,t){return HO.walkTokens(e,t)},UO.parseInline=HO.parseInline,UO.Parser=BO,UO.parser=BO.parse,UO.Renderer=RO,UO.TextRenderer=zO,UO.Lexer=LO,UO.lexer=LO.lex,UO.Tokenizer=IO,UO.Hooks=VO,UO.parse=UO,UO.options,UO.setOptions,UO.use,UO.walkTokens,UO.parseInline,BO.parse,LO.lex;var WO=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 GO=u(WO(),1);let KO=[`messages`],qO=[`experimental_throttle`,`resume`];var JO=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},YO=(e,t,n)=>(JO(e,t,`read from private field`),n?n.call(e):t.get(e)),XO=(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)},ZO=(e,t,n,r)=>(JO(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n);function QO(e,t){return t==null?e:(0,GO.default)(e,t)}var $O,ek,tk,nk,rk,ik,ak,ok,sk,ck=class{constructor(e=[]){XO(this,$O,void 0),XO(this,ek,`ready`),XO(this,tk,void 0),XO(this,nk,new Set),XO(this,rk,new Set),XO(this,ik,new Set),this.pushMessage=e=>{ZO(this,$O,YO(this,$O).concat(e)),YO(this,ak).call(this)},this.popMessage=()=>{ZO(this,$O,YO(this,$O).slice(0,-1)),YO(this,ak).call(this)},this.replaceMessage=(e,t)=>{ZO(this,$O,[...YO(this,$O).slice(0,e),this.snapshot(t),...YO(this,$O).slice(e+1)]),YO(this,ak).call(this)},this.snapshot=e=>structuredClone(e),this[`~registerMessagesCallback`]=(e,t)=>{let n=t?QO(e,t):e;return YO(this,nk).add(n),()=>{YO(this,nk).delete(n)}},this[`~registerStatusCallback`]=e=>(YO(this,rk).add(e),()=>{YO(this,rk).delete(e)}),this[`~registerErrorCallback`]=e=>(YO(this,ik).add(e),()=>{YO(this,ik).delete(e)}),XO(this,ak,()=>{YO(this,nk).forEach(e=>e())}),XO(this,ok,()=>{YO(this,rk).forEach(e=>e())}),XO(this,sk,()=>{YO(this,ik).forEach(e=>e())}),ZO(this,$O,e)}get status(){return YO(this,ek)}set status(e){ZO(this,ek,e),YO(this,ok).call(this)}get error(){return YO(this,tk)}set error(e){ZO(this,tk,e),YO(this,sk).call(this)}get messages(){return YO(this,$O)}set messages(e){ZO(this,$O,[...e]),YO(this,ak).call(this)}};$O=new WeakMap,ek=new WeakMap,tk=new WeakMap,nk=new WeakMap,rk=new WeakMap,ik=new WeakMap,ak=new WeakMap,ok=new WeakMap,sk=new WeakMap;var lk,uk=class extends mD{constructor(e){let{messages:t}=e,n=vr(e,KO),r=new ck(t);super(U(U({},n),{},{state:r})),XO(this,lk,void 0),this[`~registerMessagesCallback`]=(e,t)=>YO(this,lk)[`~registerMessagesCallback`](e,t),this[`~registerStatusCallback`]=e=>YO(this,lk)[`~registerStatusCallback`](e),this[`~registerErrorCallback`]=e=>YO(this,lk)[`~registerErrorCallback`](e),ZO(this,lk,r)}};lk=new WeakMap;function dk(e={}){let{experimental_throttle:t,resume:n=!1}=e,r=vr(e,qO),i=R(`chat`in r?r.chat:new uk(r));(`chat`in r&&r.chat!==i.current||`id`in r&&i.current.id!==r.id)&&(i.current=`chat`in r?r.chat:new uk(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 fk(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 pk(){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 mk(){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 hk(){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 gk(){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 _k({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 vk(){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 yk({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 bk=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))))}),xk=[{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`}],Sk=1e3;function Ck({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(Tk,{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(Ek,{title:_,onClick:b}),B.createElement(Dk,{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(wk,{translations:r,tags:l,notes:d,saving:p,savingError:h,onToggleTag:S,onNotesChange:f,onSubmit:C,onClose:w}):null)}function wk({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`},xk.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:Sk,onChange:e=>o(e.target.value.slice(0,Sk))}),B.createElement(`p`,{className:`DocSearch-Feedback-Panel-CharCount`,"aria-live":`polite`},n.length,`/`,Sk),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 Tk({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 Ek({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 Dk({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 Ok=[`className`],kk=[`align`,`alignOffset`,`side`,`sideOffset`,`collisionBoundary`,`container`,`children`];function Ak(e){let t=Ar({},(kr(e),e));return B.createElement(ih,t)}Ak.Trigger=B.forwardRef((e,t)=>{let{className:n}=e,r=pn(e,Ok),i=`DocSearch-Popover-Trigger${n?` ${n}`:``}`;return B.createElement(sh,_({className:i,ref:t},r))});function jk(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,kk);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)))}Ak.Popup=jk;function Mk(e){let t=Ar({},(kr(e),e));return B.createElement(Eh,_({className:`DocSearch-Popover-Title`},t))}Ak.Title=Mk;function Nk({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(Ak,{open:r,modal:`trap-focus`,onOpenChange:i},B.createElement(Ak.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(Ak.Popup,{container:o,sideOffset:10,align:`start`,alignOffset:-16,collisionBoundary:o==null?`clipping-ancestors`:o},B.createElement(Ak.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)))))))}let Pk=new Set([`AI-203`,`AI-205`,`AI-224`,`AI-225`]);function Fk(e,t){for(let[n,r]of Object.entries(e))if(n.toLowerCase()===t.toLowerCase()&&typeof r==`string`&&r.trim()!==``)return r.trim()}function Ik(e){let t=/\b(AI-\d{3})\b/i.exec(e);if(t)return t[1].toUpperCase()}function Lk(e){try{let t=JSON.parse(e);if(t&&typeof t==`object`&&!Array.isArray(t))return t}catch(e){}return null}function Rk(e){return/\brequest blocked for this domain\b/.test(e)||/\bblocked for this domain\b/.test(e)}function zk(e){return/\b429\b/.test(e)||/\brate\s*limit/.test(e)||/\bretry\s+after\s+\d+/.test(e)||/\btoo\s+many\s+attempts\b/.test(e)||/\btoo_many_requests\b/.test(e)}function Bk(e){return/\btokenoutputlimiterror\b/.test(e)||/could not complete response due to token output limits/.test(e)}function Vk(e){return/\bwhitelist(?:ed)?\b/.test(e)||/\bnot\s+allowed\s+for\s+this\s+domain\b/.test(e)||/\bcontext\s+length\b/.test(e)||/\b(?:max|maximum)\s+tokens?\b/.test(e)||/\btoken\s+limit\b/.test(e)||/\btoken\s+output\b/.test(e)||/\boutput\s+limits?\b/.test(e)||/\bstep\s+limit\b/.test(e)||/\b(?:max|maximum)(?:\s+agent)?\s+steps?\b/.test(e)}function Hk(e){var t,n,r;let i=(t=Fk(e,`type`))==null?``:t,a=(n=Fk(e,`error`))==null?``:n,o=(r=Fk(e,`message`))==null?``:r;return/tokenoutput|outputlimit|steplimit|maxstep|ratelimit|domainnotallowed/i.test(i)||a.toUpperCase()===`TOO_MANY_REQUESTS`||zk(`${a} ${o}`.toLowerCase())||Vk(`${a} ${o}`.toLowerCase())}let Uk=[{matches:({code:e})=>!!(e&&Pk.has(e))},{matches:({parsedJson:e})=>{var t;return!!(e&&Rk(((t=Fk(e,`message`))==null?``:t).toLowerCase()))},showNewConversationLink:!1},{matches:({parsedJson:e})=>!!(e&&Hk(e))},{matches:({messageLower:e})=>Bk(e),showNewConversationLink:!1},{matches:({messageLower:e})=>zk(e)},{matches:({messageLower:e})=>Rk(e),showNewConversationLink:!1},{matches:({messageLower:e})=>Vk(e)}];function Wk(e){var t;let n=(t=e.message)==null?``:t,r={message:n,messageLower:n.toLowerCase(),parsedJson:Lk(n),code:Ik(n)},i=Uk.filter(e=>e.matches(r));return{blocking:i.length>0,showNewConversationLink:i.every(e=>e.showNewConversationLink!==!1)}}function Gk(e){var t;return!!(e&&Bk(((t=e.message)==null?``:t).toLowerCase()))}function Kk(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function qk(e){return Kk(e.replace(/<[^>]*>/g,``))}function Jk(e){let t=e;for(let e=0;e<3;e+=1)try{let e=decodeURIComponent(t);if(e===t)break;t=e}catch(e){break}return t}function Yk(e){let t=``;for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);r>32&&r!==127&&(t+=e[n])}return t}function Xk(e){if(!e)return``;let t=e.trim();if(!t)return``;let n=Yk(Jk(t));if(!n||n.startsWith(`//`))return``;if(!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(n))return t;try{let e=new URL(n);if(e.protocol===`http:`||e.protocol===`https:`||e.protocol===`mailto:`)return n}catch(e){return``}return``}function Zk(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=Xk(e[2]);i&&!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=Xk(e[0].replace(/[.,;:!?]+$/,``));r&&!n.has(r)&&(n.add(r),t.push({url:r}))}}),t):[]}let Qk=(e,t,n)=>{let r=t[0].parts.find(e=>e.type===`text`),i=r!=null&&r.text?qk(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:``}},$k=e=>{var t;return((t=e==null?void 0:e.parts)==null?[]:t).filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
161
|
+
`}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>${lk(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=uk(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+lk(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=uk(e);if(i===null)return lk(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${lk(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:lk(e.text)}},yk=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``}},bk=class e{constructor(e){V(this,`options`,void 0),V(this,`renderer`,void 0),V(this,`textRenderer`,void 0),this.options=e||QD,this.options.renderer=this.options.renderer||new vk,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new yk}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+=`
|
|
162
|
+
`+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}},xk=(XD=class{constructor(e){V(this,`options`,void 0),V(this,`block`,void 0),this.options=e||QD}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?_k.lex:_k.lexInline}provideParser(){return this.block?bk.parse:bk.parseInline}},V(XD,`passThroughHooks`,new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`])),V(XD,`passThroughHooksRespectAsync`,new Set([`preprocess`,`postprocess`,`processAllTokens`])),XD),Sk=new class{constructor(...e){V(this,`defaults`,ZD()),V(this,`options`,this.setOptions),V(this,`parse`,this.parseMarkdown(!0)),V(this,`parseInline`,this.parseMarkdown(!1)),V(this,`Parser`,bk),V(this,`Renderer`,vk),V(this,`TextRenderer`,yk),V(this,`Lexer`,_k),V(this,`Tokenizer`,gk),V(this,`Hooks`,xk),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 vk(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 gk(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 xk;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];xk.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&xk.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 _k.lex(e,t==null?this.defaults:t)}parser(e,t){return bk.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?_k.lex:_k.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?bk.parse:bk.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?_k.lex:_k.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?bk.parse:bk.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+=`
|
|
163
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+lk(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Ck(e,t){return Sk.parse(e,t)}Ck.options=Ck.setOptions=function(e){return Sk.setOptions(e),Ck.defaults=Sk.defaults,$D(Ck.defaults),Ck},Ck.getDefaults=ZD,Ck.defaults=QD,Ck.use=function(...e){return Sk.use(...e),Ck.defaults=Sk.defaults,$D(Ck.defaults),Ck},Ck.walkTokens=function(e,t){return Sk.walkTokens(e,t)},Ck.parseInline=Sk.parseInline,Ck.Parser=bk,Ck.parser=bk.parse,Ck.Renderer=vk,Ck.TextRenderer=yk,Ck.Lexer=_k,Ck.lexer=_k.lex,Ck.Tokenizer=gk,Ck.Hooks=xk,Ck.parse=Ck,Ck.options,Ck.setOptions,Ck.use,Ck.walkTokens,Ck.parseInline,bk.parse,_k.lex;var wk=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 Tk=u(wk(),1);let Ek=[`messages`],Dk=[`experimental_throttle`,`resume`];var Ok=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},kk=(e,t,n)=>(Ok(e,t,`read from private field`),n?n.call(e):t.get(e)),Ak=(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)},jk=(e,t,n,r)=>(Ok(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n);function Mk(e,t){return t==null?e:(0,Tk.default)(e,t)}function Nk(e){return Array.isArray(e)?[...e]:typeof e==`object`&&e&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)?H({},e):e}var Pk,Fk,Ik,Lk,Rk,zk,Bk,Vk,Hk,Uk=class{constructor(e=[]){Ak(this,Pk,void 0),Ak(this,Fk,`ready`),Ak(this,Ik,void 0),Ak(this,Lk,new Set),Ak(this,Rk,new Set),Ak(this,zk,new Set),this.pushMessage=e=>{jk(this,Pk,kk(this,Pk).concat(e)),kk(this,Bk).call(this)},this.popMessage=()=>{jk(this,Pk,kk(this,Pk).slice(0,-1)),kk(this,Bk).call(this)},this.replaceMessage=(e,t)=>{jk(this,Pk,[...kk(this,Pk).slice(0,e),this.snapshot(t),...kk(this,Pk).slice(e+1)]),kk(this,Bk).call(this)},this.snapshot=e=>{if(typeof e!=`object`||!e||!(`parts`in e)||!Array.isArray(e.parts))return e;let t=e,n=H(H({},t),{},{parts:t.parts.map(e=>H({},e))});return`metadata`in t&&(n.metadata=Nk(t.metadata)),n},this[`~registerMessagesCallback`]=(e,t)=>{let n=t?Mk(e,t):e;return kk(this,Lk).add(n),()=>{kk(this,Lk).delete(n)}},this[`~registerStatusCallback`]=e=>(kk(this,Rk).add(e),()=>{kk(this,Rk).delete(e)}),this[`~registerErrorCallback`]=e=>(kk(this,zk).add(e),()=>{kk(this,zk).delete(e)}),Ak(this,Bk,()=>{kk(this,Lk).forEach(e=>e())}),Ak(this,Vk,()=>{kk(this,Rk).forEach(e=>e())}),Ak(this,Hk,()=>{kk(this,zk).forEach(e=>e())}),jk(this,Pk,e)}get status(){return kk(this,Fk)}set status(e){jk(this,Fk,e),kk(this,Vk).call(this)}get error(){return kk(this,Ik)}set error(e){jk(this,Ik,e),kk(this,Hk).call(this)}get messages(){return kk(this,Pk)}set messages(e){jk(this,Pk,[...e]),kk(this,Bk).call(this)}};Pk=new WeakMap,Fk=new WeakMap,Ik=new WeakMap,Lk=new WeakMap,Rk=new WeakMap,zk=new WeakMap,Bk=new WeakMap,Vk=new WeakMap,Hk=new WeakMap;var Wk,Gk=class extends JD{constructor(e){let{messages:t}=e,n=yr(e,Ek),r=new Uk(t);super(H(H({},n),{},{state:r})),Ak(this,Wk,void 0),this[`~registerMessagesCallback`]=(e,t)=>kk(this,Wk)[`~registerMessagesCallback`](e,t),this[`~registerStatusCallback`]=e=>kk(this,Wk)[`~registerStatusCallback`](e),this[`~registerErrorCallback`]=e=>kk(this,Wk)[`~registerErrorCallback`](e),jk(this,Wk,r)}};Wk=new WeakMap;function Kk(e={}){let{experimental_throttle:t,resume:n=!1}=e,r=yr(e,Dk),i=L({});`chat`in r||(i.current={onToolCall:r.onToolCall,onData:r.onData,onFinish:r.onFinish,onError:r.onError,sendAutomaticallyWhen:r.sendAutomaticallyWhen,transport:r.transport});let a,o=()=>{var e;return(e=i.current.transport)==null?a==null?a=new qD:a:e},s=H(H({},r),{},{transport:{sendMessages:e=>o().sendMessages(e),reconnectToStream:e=>o().reconnectToStream(e)},onToolCall:e=>{var t,n;return(n=(t=i.current).onToolCall)==null?void 0:n.call(t,e)},onData:e=>{var t,n;return(n=(t=i.current).onData)==null?void 0:n.call(t,e)},onFinish:e=>{var t,n;return(n=(t=i.current).onFinish)==null?void 0:n.call(t,e)},onError:e=>{var t,n;return(n=(t=i.current).onError)==null?void 0:n.call(t,e)},sendAutomaticallyWhen:e=>{var t,n,r;return(r=(n=(t=i.current).sendAutomaticallyWhen)==null?void 0:n.call(t,e))!=null&&r}}),c=L(`chat`in r?r.chat:new Gk(s));(`chat`in r&&r.chat!==c.current||`id`in r&&r.id!=null&&c.current.id!==r.id)&&(c.current=`chat`in r?r.chat:new Gk(s));let l=c.current,u=L({chat:l,messages:l.messages});u.current.chat!==l&&(u.current={chat:l,messages:l.messages});let d=Re(e=>{let n=!0,r=l[`~registerMessagesCallback`](()=>{!n||u.current.chat!==l||(u.current={chat:l,messages:l.messages},e())},t);return u.current={chat:l,messages:l.messages},()=>{n=!1,r()}},[l,t]),f=Re(()=>u.current.messages,[]),p=ft(d,f,f),m=Re(e=>l[`~registerStatusCallback`](()=>{u.current.chat===l&&((l.status===`ready`||l.status===`error`)&&(u.current={chat:l,messages:l.messages}),e())}),[l]),h=Re(()=>l.status,[l]),g=ft(m,h,h),_=ft(c.current[`~registerErrorCallback`],()=>c.current.error,()=>c.current.error),v=Re(e=>{typeof e==`function`&&(e=e(c.current.messages)),c.current.messages=e},[c]);return Fe(()=>{n&&c.current.resumeStream()},[n,c]),{id:c.current.id,messages:p,setMessages:v,sendMessage:c.current.sendMessage,regenerate:c.current.regenerate,clearError:c.current.clearError,stop:c.current.stop,error:_,resumeStream:c.current.resumeStream,status:g,addToolResult:c.current.addToolOutput,addToolOutput:c.current.addToolOutput,addToolApprovalResponse:c.current.addToolApprovalResponse}}B();function qk(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 Jk(){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 Yk(){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 Xk(){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 Zk(){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 Qk({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 $k(){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 eA({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 tA=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))))}),nA=[{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`}],rA=1e3;function iA({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(oA,{translations:r,onClick:()=>navigator.clipboard.writeText(n)});return z.createElement(z.Fragment,null,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(sA,{title:_,onClick:b}),z.createElement(cA,{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(aA,{translations:r,tags:l,notes:d,saving:p,savingError:h,onToggleTag:S,onNotesChange:f,onSubmit:C,onClose:w}):null)}function aA({translations:e,tags:t,notes:n,saving:r,savingError:i,onToggleTag:a,onNotesChange:o,onSubmit:s,onClose:c}){let l=z.useId(),{feedbackPanelTitle:u=`What went wrong? (optional)`,feedbackDetailsPlaceholder:d=`Share some details...`,feedbackSubmitButtonText:f=`Submit`,feedbackCancelButtonText:p=`Cancel`}=e;return z.createElement(`div`,{className:`DocSearch-Feedback-Panel`,role:`group`,"aria-labelledby":l},z.createElement(`div`,{className:`DocSearch-Feedback-Panel-Header`},z.createElement(`p`,{className:`DocSearch-Feedback-Panel-Title`,id:l},u)),z.createElement(`div`,{className:`DocSearch-Feedback-Panel-Reasons`},nA.map(n=>{var r;let i=t.includes(n.value);return z.createElement(`button`,{key:n.value,type:`button`,className:`DocSearch-Feedback-Panel-Reason`,"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:d,value:n,rows:3,maxLength:rA,onChange:e=>o(e.target.value.slice(0,rA))}),z.createElement(`p`,{className:`DocSearch-Feedback-Panel-CharCount`,"aria-live":`polite`},n.length,`/`,rA),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},p),z.createElement(`button`,{type:`button`,className:`DocSearch-Feedback-Panel-Submit`,disabled:r,onClick:s},r?z.createElement(Dr,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}):f)))}function oA({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 sA({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 cA({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 lA=[`className`],uA=[`align`,`alignOffset`,`side`,`sideOffset`,`collisionBoundary`,`container`,`children`];function dA(e){let t=jr({},(Ar(e),e));return z.createElement(Eh,t)}dA.Trigger=z.forwardRef((e,t)=>{let{className:n}=e,r=mn(e,lA),i=`DocSearch-Popover-Trigger${n?` ${n}`:``}`;return z.createElement(kh,_({className:i,ref:t},r))});function fA(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,uA);return z.createElement(Nh,{container:o},z.createElement(Lh,{className:`DocSearch-Popover-Positioner`,align:t,alignOffset:n,side:r,sideOffset:i,collisionBoundary:a},z.createElement(Wh,_({className:`DocSearch-Popover-Popup`},c),z.createElement(Kh,{className:`DocSearch-Popover-Arrow`}),z.createElement(Xh,{className:`DocSearch-Popover-Close`},z.createElement(Mr,null)),s)))}dA.Popup=fA;function pA(e){let t=jr({},(Ar(e),e));return z.createElement(Jh,_({className:`DocSearch-Popover-Title`},t))}dA.Title=pA;function mA({links:e,titleText:t=`Source`,pluralTitleText:n=`Sources`}){let[r,i]=z.useState(!1),a=z.useRef(null),[o,s]=z.useState(null),c=e.length>1?n:t;return Fe(()=>{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:z.createElement(dA,{open:r,modal:`trap-focus`,onOpenChange:i},z.createElement(dA.Trigger,{ref:a,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,` `,c)),z.createElement(dA.Popup,{container:o,sideOffset:10,align:`start`,alignOffset:-16,collisionBoundary:o==null?`clipping-ancestors`:o},z.createElement(dA.Title,null,c),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)))))))}let hA=new Set([`AI-203`,`AI-205`,`AI-224`,`AI-225`]);function gA(e,t){for(let[n,r]of Object.entries(e))if(n.toLowerCase()===t.toLowerCase()&&typeof r==`string`&&r.trim()!==``)return r.trim()}function _A(e){let t=/\b(AI-\d{3})\b/i.exec(e);if(t)return t[1].toUpperCase()}function vA(e){try{let t=JSON.parse(e);if(t&&typeof t==`object`&&!Array.isArray(t))return t}catch(e){}return null}function yA(e){return/\brequest blocked for this domain\b/.test(e)||/\bblocked for this domain\b/.test(e)}function bA(e){return/\b429\b/.test(e)||/\brate\s*limit/.test(e)||/\bretry\s+after\s+\d+/.test(e)||/\btoo\s+many\s+attempts\b/.test(e)||/\btoo_many_requests\b/.test(e)}function xA(e){return/\btokenoutputlimiterror\b/.test(e)||/could not complete response due to token output limits/.test(e)}function SA(e){return/\bwhitelist(?:ed)?\b/.test(e)||/\bnot\s+allowed\s+for\s+this\s+domain\b/.test(e)||/\bcontext\s+length\b/.test(e)||/\b(?:max|maximum)\s+tokens?\b/.test(e)||/\btoken\s+limit\b/.test(e)||/\btoken\s+output\b/.test(e)||/\boutput\s+limits?\b/.test(e)||/\bstep\s+limit\b/.test(e)||/\b(?:max|maximum)(?:\s+agent)?\s+steps?\b/.test(e)}function CA(e){var t,n,r;let i=(t=gA(e,`type`))==null?``:t,a=(n=gA(e,`error`))==null?``:n,o=(r=gA(e,`message`))==null?``:r;return/tokenoutput|outputlimit|steplimit|maxstep|ratelimit|domainnotallowed/i.test(i)||a.toUpperCase()===`TOO_MANY_REQUESTS`||bA(`${a} ${o}`.toLowerCase())||SA(`${a} ${o}`.toLowerCase())}let wA=[{matches:({code:e})=>!!(e&&hA.has(e))},{matches:({parsedJson:e})=>{var t;return!!(e&&yA(((t=gA(e,`message`))==null?``:t).toLowerCase()))},showNewConversationLink:!1},{matches:({parsedJson:e})=>!!(e&&CA(e))},{matches:({messageLower:e})=>xA(e),showNewConversationLink:!1},{matches:({messageLower:e})=>bA(e)},{matches:({messageLower:e})=>yA(e),showNewConversationLink:!1},{matches:({messageLower:e})=>SA(e)}];function TA(e){var t;let n=(t=e.message)==null?``:t,r={message:n,messageLower:n.toLowerCase(),parsedJson:vA(n),code:_A(n)},i=wA.filter(e=>e.matches(r));return{blocking:i.length>0,showNewConversationLink:i.every(e=>e.showNewConversationLink!==!1)}}function EA(e){var t;return!!(e&&xA(((t=e.message)==null?``:t).toLowerCase()))}function DA(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function OA(e){return DA(e.replace(/<[^>]*>/g,``))}function kA(e){let t=e;for(let e=0;e<3;e+=1)try{let e=decodeURIComponent(t);if(e===t)break;t=e}catch(e){break}return t}function AA(e){let t=``;for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);r>32&&r!==127&&(t+=e[n])}return t}function jA(e){if(!e)return``;let t=e.trim();if(!t)return``;let n=AA(kA(t));if(!n||n.startsWith(`//`))return``;if(!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(n))return t;try{let e=new URL(n);if(e.protocol===`http:`||e.protocol===`https:`||e.protocol===`mailto:`)return n}catch(e){return``}return``}function MA(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=jA(e[2]);i&&!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=jA(e[0].replace(/[.,;:!?]+$/,``));r&&!n.has(r)&&(n.add(r),t.push({url:r}))}}),t):[]}let NA=(e,t,n)=>{let r=t[0].parts.find(e=>e.type===`text`),i=r!=null&&r.text?OA(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:``}},PA=e=>{var t;return((t=e==null?void 0:e.parts)==null?[]:t).filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
164
164
|
|
|
165
|
-
`)};function
|
|
165
|
+
`)};function FA(e){var t;return e?/(?:ai-217|conversation\s+depth)/i.test((t=e.message)==null?``:t):!1}function IA(e){return!!(e&&(FA(e)||TA(e).blocking))}function LA(e){return EA(e)}function RA(e){return!e||FA(e)?!0:TA(e).showNewConversationLink}function zA(e){let t=e.trim();for(let e=0;e<10&&t;e++)try{var n,r;let e=JSON.parse(t);if(typeof e==`string`){t=e.trim();continue}if(e&&typeof e==`object`&&!Array.isArray(e)){let t=e,n=gA(t,`message`),r=gA(t,`error`);if(n)return n;if(r)return r}let i=(n=/"message"\s*:\s*"((?:[^"\\]|\\.)*)"/.exec(t))==null?/"error"\s*:\s*"((?:[^"\\]|\\.)*)"/.exec(t):n;return i==null||(r=i[1])==null?void 0:r.replace(/\\"/g,`"`).replace(/\\\\/g,`\\`).trim()}catch(e){if(t.includes(`\\"`)){t=t.replace(/\\"/g,`"`).replace(/\\\\/g,`\\`).trim();continue}return}}function BA(e){var t;if(!e)return;let n=zA((t=e.message)==null?``:t);if(FA(e)&&(/^\s*AI-217\s*$/i.test(e.message)||/^\s*\{.*\}\s*$/.test(e.message)&&!n))return;let r=(n==null?e.message.replace(/\s*\(AI-\d{3}\)\s*$/i,``):n).trim();if(r&&!(r.startsWith(`{`)&&r.endsWith(`}`)))return r;if(LA(e))return`Could not complete response due to token output limits`}let VA=Object.freeze({});function HA(e){return e.type.startsWith(`tool-`)}function UA(e){return e.type===`tool-searchIndex`||e.type===`tool-algolia_search_index`||e.type.startsWith(`tool-algolia_search_index_`)}function WA(e){return HA(e)&&UA(e)&&e.state===`output-available`}function GA(e){var t;let n;return e.forEach((t,r)=>{let i=t.parts.filter(e=>!(ID(e)||zD(e)&&e.state.startsWith(`input-`)));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 KA(e){let t=e.find(e=>e.type===`data-suggestions`);return t?t.data.suggestions:[]}function qA(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 JA({icon:e,shimmer:t=!1,children:n,variant:r}){let i=`DocSearch-AskAiScreen-MessageContent-Tool Tool--${r}${t?` DocSearch-shimmer`:``}`;return z.createElement(`div`,{className:i},e,n)}function YA({part:e,translations:t,onSearchQueryClick:n}){let{searchingText:r,preToolCallText:i,toolCallResultText:a}=t;switch(e.state){case`input-streaming`:return z.createElement(JA,{shimmer:!0,icon:z.createElement(Dr,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}),variant:`PartialCall`},z.createElement(`span`,null,r));case`input-available`:{let t=qA(e);return z.createElement(z.Fragment,null,t.map((t,n)=>z.createElement(JA,{key:`${e.toolCallId}-call-${n}`,shimmer:!0,icon:z.createElement(Dr,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}),variant:`Call`},z.createElement(`span`,null,i,` `,`"${t}" ...`))))}case`output-available`:{let t=qA(e);return z.createElement(z.Fragment,null,t.map((t,r)=>z.createElement(JA,{key:`${e.toolCallId}-result-${r}`,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 XA({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(JA,{shimmer:!0,variant:`PartialCall`,icon:z.createElement(Qk,null)},z.createElement(`span`,null,t))}return n?z.createElement(JA,{icon:z.createElement(Qk,null),variant:`Result`},z.createElement(`span`,null,n)):null}function ZA({part:e,translations:t}){let{savedMemoryToolResultText:n,memoryToolResultText:r}=t;return e.state===`output-error`?null:e.type===`tool-algolia_memorize`?z.createElement(JA,{variant:`Result`,icon:z.createElement($k,null)},n):z.createElement(JA,{variant:`Result`,icon:z.createElement($k,null)},r)}function QA(e){return e.type===`tool-algolia_ponder`||e.type===`tool-algolia_memorize`||e.type===`tool-algolia_memory_search`}function $A({part:e,translations:t,tools:n,onSearchQueryClick:r,memoryEnabled:i=!1}){let a=n[e.type.replace(`tool-`,``)];return a?z.createElement(XA,{tool:a,part:e}):i&&QA(e)?z.createElement(ZA,{part:e,translations:t}):UA(e)?z.createElement(YA,{part:e,translations:t,onSearchQueryClick:r}):null}let ej=new Ck.Renderer;ej.code=({text:e,lang:t=``,escaped:n})=>{let r=/^[a-zA-Z0-9_-]+$/.test(t)?t:``,i=r?`language-${r}`:``,a=n?e:DA(e);return`
|
|
166
166
|
<div class="DocSearch-CodeSnippet">
|
|
167
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>
|
|
168
168
|
<pre><code class="${i}">${a}</code></pre>
|
|
169
169
|
</div>
|
|
170
|
-
`},
|
|
171
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
172
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
173
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
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
|
|
175
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
176
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oN(e,t){if(e){if(typeof e==`string`)return lN(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 lN(e,t)}}function sN(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function cN(e){if(Array.isArray(e))return lN(e)}function lN(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 uN(e){return!!e.execute}function dN(e){return!!(e!=null&&e.execute)}function fN(e,t,n){if(dN(e)){var r=e.requesterId===`algolia`?Object.assign.apply(Object,[{}].concat(iN(Object.keys(n.context).map(function(e){var t;return(t=n.context[e])==null?void 0:t.__algoliaSearchParameters})))):{};return eN(eN({},e),{},{requests:e.queries.map(function(n){return{query:e.requesterId===`algolia`?eN(eN({},n),{},{params:eN(eN({},r),n.params)}):n,sourceId:t,transformResponse:e.transformResponse}})})}return{items:e,sourceId:t}}function pN(e){var t=e.reduce(function(e,t){if(!uN(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 uN(t)&&uN(e)&&e.searchClient===n&&!!i&&e.requesterId===i});if(o){var s;(s=o.items).push.apply(s,iN(a))}else{var c={execute:r,requesterId:i,items:a,searchClient:n};e.push(c)}return e},[]).map(function(e){if(!uN(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 RA(e)})}function mN(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(gM(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 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)}var gN=[`event`,`nextState`,`props`,`query`,`refresh`,`store`];function _N(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 vN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?_N(Object(n),!0).forEach(function(t){yN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_N(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yN(e,t,n){return t=bN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bN(e){var t=xN(e,`string`);return hN(t)===`symbol`?t:String(t)}function xN(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)}function SN(e,t){if(e==null)return{};var n=CN(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 CN(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 wN=null,TN=Xj();function EN(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=SN(e,gN);wN&&i.environment.clearTimeout(wN);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 vN(vN({},e),{},{items:[]})});p(`idle`),l(g),u((h=r.isOpen)==null?i.shouldPanelOpen({state:s.getState()}):h);var _=Gj(TN(g).then(function(){return Promise.resolve()}));return s.pendingRequests.add(_)}p(`loading`),wN=i.environment.setTimeout(function(){p(`stalled`)},i.stallThreshold);var v=Gj(TN(i.getSources(vN({query:a,refresh:o,state:s.getState()},c)).then(function(e){return Promise.all(e.map(function(e){return Promise.resolve(e.getItems(vN({query:a,refresh:o,state:s.getState()},c))).then(function(t){return fN(t,e.sourceId,s.getState())})})).then(pN).then(function(t){var n=t.some(function(e){var t=e.items;return DN(t)});if(n){var r;m({algoliaInsightsPlugin:vN(vN({},((r=s.getState().context)==null?void 0:r.algoliaInsightsPlugin)||{}),{},{__automaticInsights:n})})}return mN(t,e,s)}).then(function(e){return ZM({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=dM(s.getState());if(s.getState().activeItemId!==null&&f){var m=f.item,h=f.itemInputValue,g=f.itemUrl,_=f.source;_.onActive(vN({event:t,item:m,itemInputValue:h,itemUrl:g,refresh:o,source:_,state:s.getState()},c))}}).finally(function(){p(`idle`),wN&&i.environment.clearTimeout(wN)});return s.pendingRequests.add(v)}function DN(e){return!Array.isArray(e)&&!!(e!=null&&e._automaticInsights)}function ON(e){"@babel/helpers - typeof";return ON=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},ON(e)}var kN=[`event`,`props`,`refresh`,`store`];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 jN(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){MN(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 MN(e,t,n){return t=NN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NN(e){var t=PN(e,`string`);return ON(t)===`symbol`?t:String(t)}function PN(e,t){if(ON(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ON(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function FN(e,t){if(e==null)return{};var n=IN(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 IN(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 LN(e){var t=e.event,n=e.props,r=e.refresh,i=e.store,a=FN(e,kN);if(t.key===`ArrowUp`||t.key===`ArrowDown`){var o=function(){var e=dM(i.getState()),t=n.environment.document.getElementById(fM(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=dM(i.getState());if(i.getState().activeItemId!==null&&e){var n=e.item,o=e.itemInputValue,s=e.itemUrl,c=e.source;c.onActive(jN({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)?EN(jN({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=cM(n.plugins,i.pendingRequests);c===void 0?n.debug||i.pendingRequests.cancelAll():c.then(i.pendingRequests.cancelAll);return}t.preventDefault();var l=dM(i.getState()),u=l.item,d=l.itemInputValue,f=l.itemUrl,p=l.source;if(t.metaKey||t.ctrlKey)f!==void 0&&(p.onSelect(jN({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(jN({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(jN({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}EN(jN({event:t,nextState:{isOpen:!1},props:n,query:d,refresh:r,store:i},a)).then(function(){p.onSelect(jN({event:t,item:u,itemInputValue:d,itemUrl:f,refresh:r,source:p,state:i.getState()},a))})}}}function RN(e){"@babel/helpers - typeof";return RN=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},RN(e)}var zN=[`props`,`refresh`,`store`],BN=[`inputElement`,`formElement`,`panelElement`],VN=[`inputElement`],HN=[`inputElement`,`maxLength`],UN=[`source`],WN=[`item`,`source`];function GN(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 KN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?GN(Object(n),!0).forEach(function(t){qN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qN(e,t,n){return t=JN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JN(e){var t=YN(e,`string`);return RN(t)===`symbol`?t:String(t)}function YN(e,t){if(RN(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(RN(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function XN(e,t){if(e==null)return{};var n=ZN(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 ZN(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 QN(e){var t=e.props,n=e.refresh,r=e.store,i=XN(e,zN);return{getEnvironmentProps:function(e){var n=e.inputElement,i=e.formElement,a=e.panelElement,o=XN(e,BN);function s(e){!(r.getState().isOpen||!r.pendingRequests.isEmpty())||e.target===n||[i,a].some(function(t){return pM(t,e.target)})===!1&&(r.dispatch(`blur`,null),t.debug||r.pendingRequests.cancelAll())}return KN({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 KN({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 fM(t.id,`list`,n)}).join(` `):void 0,"aria-labelledby":fM(t.id,`label`)},e)},getFormProps:function(e){e.inputElement;var a=XN(e,VN),o=function(a){var o;t.onSubmit(KN({event:a,refresh:n,state:r.getState()},i)),r.dispatch(`submit`,null),(o=e.inputElement)==null||o.blur()};return KN({action:``,noValidate:!0,role:`search`,onSubmit:function(e){e.preventDefault();var n=cM(t.plugins,r.pendingRequests);n===void 0?o(e):n.then(function(){return o(e)})},onReset:function(a){var o;a.preventDefault(),t.onReset(KN({event:a,refresh:n,state:r.getState()},i)),r.dispatch(`reset`,null),(o=e.inputElement)==null||o.focus()}},a)},getLabelProps:function(e){return KN({htmlFor:fM(t.id,`input`),id:fM(t.id,`label`)},e)},getInputProps:function(e){var a;function o(e){(t.openOnFocus||r.getState().query)&&EN(KN({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=XN(s,HN),d=dM(r.getState()),f=hM(((a=t.environment.navigator)==null?void 0:a.userAgent)||``),p=t.enterKeyHint||(d!=null&&d.itemUrl&&!f?`go`:`search`);return KN({"aria-autocomplete":`both`,"aria-activedescendant":r.getState().isOpen&&r.getState().activeItemId!==null?fM(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 fM(t.id,`list`,n)}).join(` `):void 0,"aria-labelledby":fM(t.id,`label`),value:r.getState().completion||r.getState().query,id:fM(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&&_M(e).isComposing){i.setQuery(a);return}EN(KN({event:e,props:t,query:a.slice(0,l),refresh:n,store:r},i))},onCompositionEnd:function(e){EN(KN({event:e,props:t,query:e.currentTarget.value.slice(0,l),refresh:n,store:r},i))},onKeyDown:function(e){_M(e).isComposing||LN(KN({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 KN({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){r.dispatch(`mouseleave`,null)}},e)},getListProps:function(e){var n=e||{},r=n.source,i=XN(n,UN);return KN({role:`listbox`,"aria-labelledby":fM(t.id,`label`),id:fM(t.id,`list`,r)},i)},getItemProps:function(e){var a=e.item,o=e.source,s=XN(e,WN);return KN({id:fM(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=dM(r.getState());if(r.getState().activeItemId!==null&&t){var o=t.item,s=t.itemInputValue,c=t.itemUrl,l=t.source;l.onActive(KN({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():EN(KN({event:e,nextState:{isOpen:!1},props:t,query:s,refresh:n,store:r},i))).then(function(){o.onSelect(KN({event:e,item:a,itemInputValue:s,itemUrl:c,refresh:n,source:o,state:r.getState()},i))})}},s)}}}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)}function eP(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 tP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?eP(Object(n),!0).forEach(function(t){nP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nP(e,t,n){return t=rP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rP(e){var t=iP(e,`string`);return $N(t)===`symbol`?t:String(t)}function iP(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 aP(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?nP({},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:tP({"autocomplete-core":Object.keys(o)},c),ua:KA.concat(((i=o.__autocomplete_metadata)==null?void 0:i.userAgents)||[])}}function oP(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 sP(e){var t,n=e.state;return n.isOpen===!1||n.activeItemId===null?null:((t=dM(n))==null?void 0:t.itemInputValue)||null}function cP(e){"@babel/helpers - typeof";return cP=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},cP(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 uP(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){dP(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}function dP(e,t,n){return t=fP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fP(e){var t=pP(e,`string`);return cP(t)===`symbol`?t:String(t)}function pP(e,t){if(cP(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(cP(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var mP=function(e,t){switch(t.type){case`setActiveItemId`:return uP(uP({},e),{},{activeItemId:t.payload});case`setQuery`:return uP(uP({},e),{},{query:t.payload,completion:null});case`setCollections`:return uP(uP({},e),{},{collections:t.payload});case`setIsOpen`:return uP(uP({},e),{},{isOpen:t.payload});case`setStatus`:return uP(uP({},e),{},{status:t.payload});case`setContext`:return uP(uP({},e),{},{context:uP(uP({},e.context),t.payload)});case`ArrowDown`:var n=uP(uP({},e),{},{activeItemId:t.payload.hasOwnProperty(`nextActiveItemId`)?t.payload.nextActiveItemId:Zj(1,e.activeItemId,VA(e),t.props.defaultActiveItemId)});return uP(uP({},n),{},{completion:sP({state:n})});case`ArrowUp`:var r=uP(uP({},e),{},{activeItemId:Zj(-1,e.activeItemId,VA(e),t.props.defaultActiveItemId)});return uP(uP({},r),{},{completion:sP({state:r})});case`Escape`:return e.isOpen?uP(uP({},e),{},{activeItemId:null,isOpen:!1,completion:null}):uP(uP({},e),{},{activeItemId:null,query:``,status:`idle`,collections:[]});case`submit`:return uP(uP({},e),{},{activeItemId:null,isOpen:!1,status:`idle`});case`reset`:return uP(uP({},e),{},{activeItemId:t.props.openOnFocus===!0?t.props.defaultActiveItemId:null,status:`idle`,completion:null,query:``});case`focus`:return uP(uP({},e),{},{activeItemId:t.props.defaultActiveItemId,isOpen:(t.props.openOnFocus||!!e.query)&&t.props.shouldPanelOpen({state:e})});case`blur`:return t.props.debug?e:uP(uP({},e),{},{isOpen:!1,activeItemId:null});case`mousemove`:return uP(uP({},e),{},{activeItemId:t.payload});case`mouseleave`:return uP(uP({},e),{},{activeItemId:t.props.defaultActiveItemId});default:return`${JSON.stringify(t.type)}`,e}};function hP(e){"@babel/helpers - typeof";return hP=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},hP(e)}function gP(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 _P(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?gP(Object(n),!0).forEach(function(t){vP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vP(e,t,n){return t=yP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yP(e){var t=bP(e,`string`);return hP(t)===`symbol`?t:String(t)}function bP(e,t){if(hP(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(hP(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function xP(e){var t=[],n=WM(e,t),r=wM(mP,n,o),i=jM({store:r}),a=QN(_P({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(_P({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=Rj({__autocomplete_clickAnalytics:!1});n.plugins.push(u),c([u])}}function s(){return EN(_P({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,_P(_P({},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(Rj(u))}return c(n.plugins),oP({metadata:aP({plugins:n.plugins,options:e}),environment:n.environment}),_P(_P({refresh:s,navigator:n.navigator},a),i)}V();function SP(){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 CP={before:`Searched for `,separator:`, `,lastSeparator:` and `,after:``};function wP({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):CP)||{};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 TP=[`translations`];function EP(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 DP({disclaimerText:e}){return B.createElement(`p`,{className:`DocSearch-AskAiScreen-Disclaimer`},B.createElement(Dr,null),` `,e)}function OP({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(()=>EP(a),[a]),x=tA(t),S=z(()=>$k(m),[m]),C=z(()=>$k(p),[p]),w=B.useMemo(()=>Zk(m),[m]),T=B.useMemo(()=>SA((m==null?void 0:m.parts)||[]),[m]),E=z(()=>n?dA((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(fk,{"aria-hidden":`true`}),B.createElement(`div`,{className:`DocSearch-AskAiScreen-Error-Content`},B.createElement(`h4`,{className:`DocSearch-AskAiScreen-Error-Title`},g),B.createElement(xA,{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(xA,{key:n,content:e,copyButtonText:a.copyButtonText||`Copy`,copyButtonCopiedText:a.copyButtonCopiedText||`Copied!`,isStreaming:r===`streaming`}):sA(e)?B.createElement(vA,{key:n,translations:b,part:e,tools:o,memoryEnabled:l,onSearchQueryClick:i}):e.type===`aggregated-tool-call`?B.createElement(wP,{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(xA,{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(Nk,{links:w,titleText:_,pluralTitleText:v}),B.createElement(Ck,{id:A,showActions:O,latestAssistantMessageContent:S||null,translations:a,conversations:s,onFeedback:c})),E.length>0&&B.createElement(bk,{title:y,suggestions:E,onSelectPromptSuggestion:u})))}function kP(e){let{translations:t={}}=e,n=pn(e,TP),{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`&&tA(c),[l,c]),f=z(()=>aA(c),[c]),p=rA(c),m=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 e},[o]),h=e=>{n.onAskAiToggle(!1),n.setQuery(e)},g=d&&(!eA(c)||o.some(e=>e.role===`assistant`));return B.createElement(`div`,{className:`DocSearch-AskAiScreen DocSearch-AskAiScreen-Container`},B.createElement(`div`,{id:n.promptBlockingErrorId,role:`alert`},g&&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`,{className:`DocSearch-AskAiScreen-Error-Title`},f==null?eA(c)?i:`This conversation cannot continue.`:f),p&&B.createElement(`p`,null,B.createElement(`button`,{type:`button`,className:`DocSearch-ThreadDepthError-Link`,onClick:n.onNewConversation},a),` `,`to continue.`)))),B.createElement(DP,{disclaimerText:r}),B.createElement(`div`,{className:`DocSearch-AskAiScreen-Body`},B.createElement(`div`,{className:`DocSearch-AskAiScreen-ExchangesList`},m.slice().reverse().map((e,r)=>B.createElement(OP,{key:e.id,exchange:e,askAiError:n.askAiError,isLastExchange:r===0,loadingStatus:n.status,translations:t,tools:s,conversations:n.conversations,memoryEnabled:u,onSearchQueryClick:h,onFeedback:n.onFeedback,onSelectPromptSuggestion:n.onSelectPromptSuggestion})))))}let AP=[`translations`];function jP(e){let{translations:t={}}=e,n=pn(e,AP),{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(SP,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 MP=[`translations`];function NP(e){let{translations:t={}}=e,n=pn(e,MP);return B.createElement(`div`,{className:`DocSearch-Dropdown-Container`},B.createElement(jP,_(_({},n),{},{translations:t})),B.createElement(Bm,_(_({},n),{},{translations:t})))}let PP=[`onAskAiToggle`];function FP(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 IP({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 LP=[`translations`,`selectAskAiQuestion`],RP=B.memo(e=>{var t;let{translations:n={},selectAskAiQuestion:r}=e,i=pn(e,LP),a=B.useCallback(e=>{r(!0,e)},[r]);return i.canHandleAskAi&&i.isAskAiActive&&i.askAiState===`conversation-history`?B.createElement(FP,_({selectAskAiQuestion:r},i)):i.canHandleAskAi&&i.isAskAiActive&&i.askAiState===`new-conversation`?B.createElement(IP,{translations:n==null?void 0:n.newConversation,selectSuggestedQuestion:i.selectSuggestedQuestion,suggestedQuestions:i.suggestedQuestions}):i.isAskAiActive&&i.canHandleAskAi?B.createElement(kP,_(_({},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(NP,_(_({},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 zP({heading:e,shimmer:t=!1}){return B.createElement(`span`,{className:`DocSearch-Modal-heading${t?` DocSearch-shimmer`:``}`},e)}let BP=[`translations`,`askAiState`,`onAskAiToggle`,`setAskAiState`];function VP(e){let{translations:t={},askAiState:n,onAskAiToggle:r,setAskAiState:i}=e,a=pn(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=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.promptBlockingChrome,O=a.placeholder;n===`new-conversation`&&(O=m),a.promptBlockingChrome===`full`&&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=>{if(D&&a.isAskAiActive&&S.has(e.key)){e.preventDefault(),e.stopPropagation();return}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(D&&a.isAskAiActive){e.preventDefault();return}if(a.isAskAiActive){a.setQuery(e.currentTarget.value),e.preventDefault(),e.stopPropagation();return}w==null||w(e)},disabled:T,readOnly:D&&a.isAskAiActive,"aria-disabled":D&&a.isAskAiActive,"aria-describedby":D&&a.isAskAiActive?a.promptBlockingErrorId:void 0},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?g:d,"aria-label":D?g:f,onClick:j},B.createElement(yk,null)):void 0,N=k?B.createElement(zP,{heading:k,shimmer:T}):null,P=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(pk,null)),B.createElement(`div`,{className:`DocSearch-Divider`})),E&&B.createElement(B.Fragment,null,B.createElement(TA,null,B.createElement(TA.Trigger,{className:`DocSearch-Action`},B.createElement(mk,null)),B.createElement(TA.Content,null,B.createElement(TA.Item,{onClick:a.onNewConversation},B.createElement(gk,null),g),b&&B.createElement(TA.Item,{onClick:a.onViewConversationHistory},B.createElement(hk,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:N,hideInput:!!k,actionsBeforeClose:P,inputProps:A}))}let HP={value:``,matchLevel:`none`,matchedWords:[]},UP={lvl0:HP,lvl1:HP,lvl2:HP,lvl3:HP,lvl4:HP,lvl5:HP,lvl6:HP},WP={content:HP,hierarchy:UP,hierarchy_camel:[]},GP={content:HP,hierarchy:UP,hierarchy_camel:[]};function KP({conversations:e,disableUserPersonalization:t,handleSelectStoredConversation:n}){return[{sourceId:bp.recentConversations,getItems(){return t?[]:e.getAll().slice(0,3)},onSelect({item:e,event:t}){e.type===`askAI`&&n(e,t)}}]}function qP({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:GP,__docsearch_parent:null}}async function JP({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=>qP({query:e.prompt,objectID:e.objectID,lvl0:`Prompt Suggestions`}))}catch(e){return[]}}async function YP({query:e,handleSelectAskAiQuestion:t,promptSuggestionsOptions:n,searchClient:r}){let i=n?await JP({query:e,indexName:n.indexName,hitsPerPage:n.hitsPerPage,searchClient:r}):[];return[{sourceId:bp.askAI,getItems(){return[qP({query:e,objectID:`ask-ai-button`,lvl0:`Ask AI`}),...i]},onSelect({item:e}){e.type===`askAI`&&e.query&&t(!0,e.query)}}]}let XP=`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.footerAction`.split(`.`),ZP=[`footer`,`searchBox`,`facets`];function QP(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,footerAction:j}=e,M=pn(e,XP),{footer:N,searchBox:P,facets:ee}=b,te=pn(b,ZP),[F,ne]=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)||M.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:I,dropdownRef:le,inputRef:ue}=xm(),de=B.useId(),{initialQuery:fe,initialQueryFromSelection:pe}=gm(y),me=Kr(a,o,g),L=typeof s==`object`?s:null,he=L?L.agentId:s,ge=L==null?void 0:L.searchParameters,[_e,ve]=B.useState(`initial`),ye=FA({agentId:he,searchClient:me,suggestedQuestionsEnabled:L==null?void 0:L.suggestedQuestions}),be=(n=L==null||(r=L.memory)==null?void 0:r.enabled)!=null&&n,xe=(i=L==null?void 0:L.tools)==null?oA:i,Se=B.useMemo(()=>Zm({indices:O}),[O]),Ce=Se[0].name,we=B.useRef(void 0),{visibleFacets:Te,facetSelections:Ee,facetSelectionsRef:De,handleFacetSelectionChange:Oe,clearFacetSelections:ke}=mm({facets:k,indexes:Se,searchClient:me,onSelectionsChange:()=>{var e;return(e=we.current)==null?void 0:e.refresh()}}),{favoriteSearches:Ae,recentSearches:je}=Tm({defaultIndexName:Ce,recentSearchesLimit:E,recentSearchesWithFavoritesLimit:D}),[Me,Ne]=B.useState(!1),{chatId:Pe,messages:Fe,status:R,sendMessage:Ie,stopAskAiStreaming:z,askAiError:Le,sendFeedback:Re,conversations:ze,startNewConversation:Be,restoreConversation:Ve}=PA({agentId:he,apiKey:(L==null?void 0:L.apiKey)||o,appId:(L==null?void 0:L.appId)||a,searchParameters:ge,tools:xe,memory:L==null?void 0:L.memory,indices:L==null?void 0:L.indices}),He=B.useRef(R);B.useEffect(()=>{if(!v){if(He.current===`streaming`&&R===`ready`){Me&&Fe.at(-1)&&(Fe.at(-1).metadata={stopped:!0});for(let e of Fe[0].parts)e.type===`text`&&ze.add(Qk(e.text,Fe,Pe))}He.current=R}},[R,Fe,ze,v,Me,Pe]);let Ue=B.useMemo(()=>R===`error`&&tA(Le),[R,Le])&&(!eA(Le)||Fe.some(e=>e.role===`assistant`)),We=B.useMemo(()=>{if(!(!Ue||_e===`new-conversation`||_e===`conversation-history`))return nA(Le)?`minimal`:`full`},[Le,_e,Ue]),Ge=wm({favoriteSearches:Ae,recentSearches:je,disableUserPersonalization:v}),Ke=hm(F),qe=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)){we.current&&we.current.setQuery(``);return}}if(e&&_e===`new-conversation`&&ve(`initial`),C(e,{query:t,suggestedQuestionId:n==null?void 0:n.objectID}),A)return;Ne(!1);let r={};if(n&&(r.body={suggestedQuestionId:n.objectID}),Ie({role:`user`,parts:[{type:`text`,text:t}]},r),le.current){let e=le.current;typeof e.scrollTo==`function`?e.scrollTo({top:0,behavior:`smooth`}):e.scrollTop=0}we.current&&we.current.setQuery(``)},[_e,C,A,Ie,le,w]),Je=B.useCallback(async(e,t)=>{!he||!a||await Re(e,t)},[he,a,Re]),Ye=B.useCallback((e,t)=>{if(jp(e.query)||!e.messages||e.messages.length<1)return;let n=e.messages,r={query:e.query,messageId:n[0].id};if(Ve(n,e.chatId),w!=null&&w(r)){we.current&&we.current.setQuery(``),t.preventDefault();return}C(!0,r)},[w,Ve,C]);we.current||(we.current=xP({id:`docsearch`,defaultActiveItemId:0,openOnFocus:!0,initialState:{query:fe,context:{searchSuggestions:[]}},insights:!!S,navigator:m,onStateChange(e){ne(e.state)},async getSources({query:e,state:t,setContext:n,setStatus:r}){if(jp(e)){let e=Ym({recentSearches:je,favoriteSearches:Ae,saveRecentSearch:Ge,onClose:u,disableUserPersonalization:v});return[...re?KP({conversations:ze,disableUserPersonalization:v,handleSelectStoredConversation:Ye}):[],...e]}let i=Xm({query:e,state:{context:t.context},setContext:n,setStatus:r,searchClient:me,indexes:Se,insights:!!S,appId:a,apiKey:o,maxResultsPerGroup:c,transformItems:d,saveRecentSearch:Ge,onClose:u,facetSelections:De}),s=re?YP({query:e,handleSelectAskAiQuestion:qe,promptSuggestionsOptions:L==null?void 0:L.promptSuggestions,searchClient:me}):Promise.resolve([]),[l,f]=await Promise.all([s,i]);return[...l,...f]}}));let Xe=we.current,{getEnvironmentProps:Ze,getRootProps:Qe,refresh:$e}=Xe;bm({getEnvironmentProps:Ze,containerRef:se,dropdownRef:le,formElementRef:I,inputRef:ue,initialScrollY:h,modalRef:ce,theme:l}),B.useEffect(()=>{le.current&&!T&&Ip(le.current)},[F.query,T,le]),Sm({initialQuery:fe,inputRef:ue,refresh:$e});let et=Fe.length>0,tt=B.useRef(T);B.useEffect(()=>{let e=tt.current;tt.current=T,T||(Xe.refresh(),e&&et&&Be())},[T,Xe,Be,et]),B.useEffect(()=>{ve(`initial`)},[T,ve]);let nt=async()=>{Ne(!0),await z()},rt=()=>{Be(),ve(`new-conversation`)},it=()=>{ve(`conversation-history`)},at=e=>{qe(!0,e.question,e)},ot=!0,st=F.collections.some(e=>e.source.sourceId!==bp.askAI&&e.items.length>0);return F.status===`idle`&&st===!1&&jp(F.query)&&!T&&(ot=!1),B.createElement(lm,{state:F,containerRef:se,modalRef:ce,formElementRef:I,dropdownRef:le,getRootProps:Qe,showDropdown:ot,searchBox:B.createElement(VP,_(_({},Xe),{},{state:F,placeholder:ie||`Search docs`,autoFocus:jp(fe),inputRef:ue,isFromSelection:!!fe&&fe===pe,translations:P,isAskAiActive:T,askAiStatus:R,askAiError:Le,askAiState:_e,setAskAiState:ve,promptBlockingChrome:We,promptBlockingErrorId:de,onClose:u,onAskAiToggle:C,onAskAgain:e=>{qe(!0,e)},onStopAskAiStreaming:nt,onNewConversation:rt,onViewConversationHistory:it})),filterBar:!T&&!jp(F.query)?B.createElement(om,{facets:Te,selections:Ee,translations:ee,clearSelections:ke,onSelectionChange:Oe}):null,screenState:B.createElement(RP,_(_({},Xe),{},{indexName:Ce,state:F,hitComponent:f,resultsFooterComponent:p,disableUserPersonalization:v,recentSearches:je,favoriteSearches:Ae,conversations:ze,inputRef:ue,translations:te,getMissingResultsUrl:x,isAskAiActive:T,canHandleAskAi:re,messages:Fe,tools:xe,askAiError:Le,status:R,hasCollections:st,askAiState:_e,selectAskAiQuestion:qe,suggestedQuestions:ye,selectSuggestedQuestion:at,memoryEnabled:be,resultBadgeKey:M.resultBadgeKey,promptBlockingErrorId:de,onAskAiToggle:C,onNewConversation:rt,onItemClick:(e,t)=>{if(e.type===`askAI`&&e.query){e.anchor===`stored`?Ye(e,t):qe(!0,e.query),ve(`initial`),t.preventDefault();return}Ke(e),Ge(e),Ap(t)||u()},onFeedback:Je})),footer:B.createElement(dm,{translations:N,isAskAiActive:T,footerAction:j}),onClose:u})}function $P(e){"@babel/helpers - typeof";return $P=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},$P(e)}function eF(e,t){if($P(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if($P(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function tF(e){var t=eF(e,`string`);return $P(t)==`symbol`?t:t+``}function nF(e,t,n){return(t=tF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rF(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 iF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?rF(Object(n),!0).forEach(function(t){nF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let aF={"Ctrl/Cmd+K":!0,"/":!0,"Ctrl/Cmd+I":!0};function oF(e){return iF(iF({},aF),e)}V();function sF(e){let t=e.composedPath()[0],n=t.tagName;return t.isContentEditable||n===`INPUT`||n===`SELECT`||n===`TEXTAREA`||n===`BUTTON`}function cF({isOpen:e,isAskAiActive:t,onAskAiToggle:n,onClose:r,onOpen:i,keyboardShortcuts:a=aF}){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||!sF(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 lF=()=>{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 uF(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 dF(e,t){if(e==null)return{};var n,r,i=uF(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 fF=[`children`,`appId`,`apiKey`,`theme`,`onReady`,`onOpen`,`onClose`,`onSidepanelOpen`,`onSidepanelClose`],pF=B.createContext(void 0);pF.displayName=`DocSearchContext`;function mF(e,t){let{children:n,appId:r,apiKey:i,theme:a,onReady:o,onOpen:s,onClose:c,onSidepanelOpen:l,onSidepanelClose:u}=e,d=dF(e,fF),[f,p]=B.useState(`ready`),[m,h]=B.useState(d.initialQuery||``),g=B.useRef(null),_=oF(d.keyboardShortcuts),[v,y]=B.useState(),[b,x]=B.useState(()=>new Set),S=lF(),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]),N=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}),cF({isOpen:w,onOpen:O,onClose:k,onAskAiToggle:A,onInput:M,isAskAiActive:T,searchButtonRef:g,keyboardShortcuts:_});let P=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:N,isHybridModeSupported:E}),[r,i,f,g,m,_,O,k,T,w,A,v,N,E]);return B.createElement(pF.Provider,{value:P},n)}let hF=B.forwardRef(mF);hF.displayName=`DocSearch`;function gF(){let e=B.useContext(pF);if(e===void 0)throw Error("`useDocSearch` must be used within the `DocSearch` provider");return e}V();let _F=[`appId`,`apiKey`];function vF(e,t){let{appId:n,apiKey:r}=e,i=pn(e,_F);return B.createElement(hF,_(_({},i),{},{appId:n,apiKey:r,ref:t}),B.createElement(bF,i))}let yF=B.forwardRef(vF);function bF(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}=gF();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(QP,_(_({},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 xF=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,xF(e,s,n,[``,null])),r.push(i),s[0]?t[0]|=2:(t[a-2]=0,t[a]=i)):r.push(s)}return r},SF=new Map;function CF(e){var t=SF.get(this);return t||(t=new Map,SF.set(this,t)),(t=xF(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]}
|
|
170
|
+
`},ej.link=({href:e,title:t,text:n})=>{let r=DA(jA(e)),i=DA(n);return r?`<a href="${r}"${t?` title="${DA(t)}"`:``} target="_blank" rel="noopener noreferrer">${i}</a>`:i},ej.image=({href:e,title:t,text:n})=>{let r=DA(jA(e));if(!r)return DA(n);let i=t?` title="${DA(t)}"`:``;return`<img src="${r}" alt="${DA(n)}"${i} />`},ej.html=({text:e})=>DA(e);function tj(e){return Ck.parse(e,{gfm:!0,breaks:!0,renderer:ej})}let nj=yt(({content:e,copyButtonText:t,copyButtonCopiedText:n,isStreaming:r})=>{let i=R(()=>tj(e),[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}})});nj.displayName=`MemoizedMarkdown`;function rj(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(WA(r)){let r=[],i,a=n;for(;a<e.length;){let t=e[a];if(WA(t)){let e=qA(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 ij=[`children`,`className`,`onClick`],aj=z.createContext({open:!1,setOpen:e=>{}});function oj({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(aj.Provider,{value:{open:t,setOpen:n}},z.createElement(`div`,{ref:r,className:`DocSearch-Menu`},e))}function sj({children:e,className:t=``,disabled:n}){let{open:r,setOpen:i}=z.useContext(aj);function a(){n||i(!r)}return z.createElement(`button`,{type:`button`,className:`DocSearch-Menu-trigger ${t}${n?` disabled`:``}`,"aria-disabled":n,onClick:()=>a()},e)}oj.Trigger=sj;function cj({children:e}){let{open:t}=z.useContext(aj);return z.createElement(`div`,{className:`DocSearch-Menu-content${t?` open`:``}`},e)}oj.Content=cj;function lj(e){let{children:t,className:n=``,onClick:r}=e,i=mn(e,ij),{setOpen:a}=z.useContext(aj);return z.createElement(`button`,_({type:`button`,className:`DocSearch-Menu-item ${n}`,onClick:e=>{r&&(r(e),a(!1))}},i),t)}oj.Item=lj;let uj=e=>`https://${e}.algolia.net/agent-studio/1`,dj=e=>{var t;let n=e.message,r;try{r=JSON.parse(n)}catch(e){return Error(n)}let i=0;for(;typeof r==`string`&&i<10;){i+=1;let e=r.trim();try{r=JSON.parse(e)}catch(t){return Error(e)}}if(!r||typeof r!=`object`||Array.isArray(r))return Error(n);let a=r,o=r,s=n;if(o.name===`ValidationError`){let e=o;if(e.detail&&e.detail.length>0){let{msg:t,loc:n}=e.detail[0];s=`${t}: ${n.at(-1)}`}}else{var c,l;s=(c=(l=gA(a,`message`))==null?gA(a,`error`):l)==null?n:c}let u=(t=o.code)==null?o.errorCode:t;return typeof u==`string`&&u.trim()&&!s.toUpperCase().includes(u.trim().toUpperCase())&&(s=`${s} (${u.trim()})`),Error(s)},fj=({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=`${uj(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})},pj=[`id`,`messages`,`body`],mj=({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 qD({api:`${uj(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,pj),a=GA(n);return _(_({},i),{},{body:_({id:t,messages:a},r)})}})},hj=({agentId:e,apiKey:t,appId:n,tools:r=VA,searchParameters:i,memory:a,indices:o})=>{let s=L(new AbortController),c=R(()=>mj({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=L(c);l.current=c;let u=L(r);u.current=r;let d=L(null),f=Re(({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=Re((e,t=ET())=>new Gk({id:t,messages:e,sendAutomaticallyWhen:YD,transport:l.current,onToolCall:f}),[f]),[m,h]=Ne(()=>p()),g=L(m);g.current=m;let{messages:v,status:y,setMessages:b,error:x,stop:S,addToolOutput:C}=Kk({chat:m});Fe(()=>{d.current=C},[C]);let w=L(Kr({key:`__DOCSEARCH_ASKAI_CONVERSATIONS__${n}`,limit:10})).current,T=Re(async(r,{thumbs:i,tags:a,notes:o})=>{var c;if(e){if((await fj({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=Re(async()=>{s.current.abort(),await S()},[S]),D=R(()=>{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=R(()=>{if(x)return dj(x)},[x]),A=Re((e,t)=>{let n=p(e,t);g.current=n,h(n)},[p]),j=Re(()=>{A()},[A]),M=Re((e,t)=>{A(e,t)},[A]),ee=Re((...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}},gj=({agentId: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 _j(e){return{current:e}}function vj(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 yj(e){return e.reduce(function(e,t){return e.concat(t)},[])}var bj=0;function xj(){return`autocomplete-${bj++}`}function Sj(e){return e.collections.length===0?0:e.collections.reduce(function(e,t){return e+t.items.length},0)}function Cj(e){return e!==Object(e)}function wj(e,t){if(e===t)return!0;if(Cj(e)||Cj(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)||!wj(e[i],t[i]))return!1}return!0}var Tj=function(){};function Ej(e){if(typeof window<`u`)return e({window})}var Dj=[{segment:`autocomplete-core`,version:`1.19.2`}];function Oj(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 kj(e,t){return Pj(e)||Nj(e,t)||jj(e,t)||Aj()}function Aj(){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 jj(e,t){if(e){if(typeof e==`string`)return Mj(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 Mj(e,t)}}function Mj(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 Nj(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 Pj(e){if(Array.isArray(e))return e}function Fj(e){var t=kj((e.version||``).split(`.`).map(Number),2),n=t[0],r=t[1];return n>=3||n===2&&r>=4||n===1&&r>=10}var Ij=[`items`],Lj=[`items`];function Rj(e){"@babel/helpers - typeof";return Rj=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},Rj(e)}function zj(e){return Uj(e)||Hj(e)||Vj(e)||Bj()}function Bj(){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 Vj(e,t){if(e){if(typeof e==`string`)return Wj(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 Wj(e,t)}}function Hj(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Uj(e){if(Array.isArray(e))return Wj(e)}function Wj(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 Gj(e,t){if(e==null)return{};var n=Kj(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 Kj(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 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 Jj(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){Yj(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 Yj(e,t,n){return t=Xj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xj(e){var t=Zj(e,`string`);return Rj(t)===`symbol`?t:String(t)}function Zj(e,t){if(Rj(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Rj(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Qj(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(Jj(Jj({},e),{},{objectIDs:e.objectIDs.slice(r,r+t)}));return n}function $j(e){return e.map(function(e){var t=e.items,n=Gj(e,Ij);return Jj(Jj({},n),{},{objectIDs:(t==null?void 0:t.map(function(e){return e.objectID}))||n.objectIDs})})}function eM(e){var t=Fj(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(zj(r),[{headers:o}]))}else e.apply(void 0,[n].concat(zj(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`,$j(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`,$j(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`,$j(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`,$j(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=Gj(t,Lj);return[].concat(zj(e),zj(Qj(Jj(Jj({},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 tM(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 nM(e){return e.objectID&&e.__autocomplete_indexName&&e.__autocomplete_queryID}function rM(e){"@babel/helpers - typeof";return rM=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},rM(e)}function iM(e){return cM(e)||sM(e)||oM(e)||aM()}function aM(){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 oM(e,t){if(e){if(typeof e==`string`)return lM(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 lM(e,t)}}function sM(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function cM(e){if(Array.isArray(e))return lM(e)}function lM(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,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?uM(Object(n),!0).forEach(function(t){fM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fM(e,t,n){return t=pM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pM(e){var t=mM(e,`string`);return rM(t)===`symbol`?t:String(t)}function mM(e,t){if(rM(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(rM(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var hM=400,gM=`2.15.0`,_M=`https://cdn.jsdelivr.net/npm/search-insights@${gM}/dist/search-insights.min.js`,vM=vj(function(e){var t=e.onItemsChange,n=e.items,r=e.insights,i=e.state;t({insights:r,insightsEvents:tM({items:n}).map(function(e){return dM({eventName:`Items Viewed`},e)}),state:i})},hM);function yM(e){var t=xM(e),n=t.insightsClient,r=t.insightsInitParams,i=t.onItemsChange,a=t.onSelect,o=t.onActive,s=t.__autocomplete_clickAnalytics,c=n;if(n||Ej(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=gM,c=t[n],SM(t))}),!c)return{};r&&c(`init`,dM({partial:!0},r));var l=eM(c),u=_j([]),d=vj(function(e){var t=e.state;if(t.isOpen){var n=t.collections.reduce(function(e,t){return[].concat(iM(e),iM(t.items))},[]).filter(nM);wj(u.current.map(function(e){return e.objectID}),n.map(function(e){return e.objectID}))||(u.current=n,n.length>0&&vM({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:dM(dM({},s?{clickAnalytics:!0}:{}),e?{userToken:CM(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;nM(t)&&a({state:n,event:r,insights:l,item:t,insightsEvents:[dM({eventName:`Item Selected`},Oj({item:t,items:i.getItems().filter(nM)}))]})}),r(function(e){var t=e.item,n=e.source,r=e.state,i=e.event;nM(t)&&o({state:r,event:i,insights:l,item:t,insightsEvents:[dM({eventName:`Item Active`},Oj({item:t,items:n.getItems().filter(nM)}))]})})},onStateChange:function(e){var t=e.state;d({state:t})},__autocomplete_pluginOptions:e}}function bM(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;return[].concat(iM(t),[`autocomplete-internal`],iM((e=n.algoliaInsightsPlugin)!=null&&e.__automaticInsights?[`autocomplete-automatic`]:[]))}function xM(e){return dM({onItemsChange:function(e){var t=e.insights,n=e.insightsEvents,r=e.state;t.viewedObjectIDs.apply(t,iM(n.map(function(e){return dM(dM({},e),{},{algoliaSource:bM(e.algoliaSource,r.context)})})))},onSelect:function(e){var t=e.insights,n=e.insightsEvents,r=e.state;t.clickedObjectIDsAfterSearch.apply(t,iM(n.map(function(e){return dM(dM({},e),{},{algoliaSource:bM(e.algoliaSource,r.context)})})))},onActive:Tj,__autocomplete_clickAnalytics:!0},e)}function SM(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=_M,n.onerror=function(){console.error(t)},document.body.appendChild(n)}catch(e){console.error(t)}}function CM(e){return typeof e==`number`?e.toString():e}function wM(e,t){var n=t;return{then:function(t,r){return wM(e.then(DM(t,n,e),DM(r,n,e)),n)},catch:function(t){return wM(e.catch(DM(t,n,e)),n)},finally:function(t){return t&&n.onCancelList.push(t),wM(e.finally(DM(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 TM(e){return wM(new Promise(function(t,n){return e(t,n)}),{isCanceled:!1,onCancelList:[]})}TM.resolve=function(e){return EM(Promise.resolve(e))},TM.reject=function(e){return EM(Promise.reject(e))};function EM(e){return wM(e,{isCanceled:!1,onCancelList:[]})}function DM(e,t,n){return e?function(n){return t.isCanceled?n:e(n)}:n}var OM=!0,kM;function AM(){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 OM?(OM=!1,kM=t?Promise.race([Promise.all(e),new Promise(function(e){return setTimeout(e,t)})]):Promise.all(e),kM.then(function(){OM=!0})):kM}}}function jM(){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 MM(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 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 RM(t)===`symbol`?t:String(t)}function LM(e,t){if(RM(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(RM(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function RM(e){"@babel/helpers - typeof";return RM=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},RM(e)}function zM(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:Tj,onResolve:Tj};Object.keys(t).forEach(function(e){t[e].__default=!0});var r=PM(PM({},t),e);return Promise.resolve(r)}))})}function BM(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=VM(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 VM(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 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}var UM=function(e,t){var n=!1,r=[],i=BM(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 WM(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 GM(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 KM(e){var t=WM(e);if(!t)return null;var n=t.items[GM({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 qM(e,t,n){return[e,n==null?void 0:n.sourceId,t].filter(Boolean).join(`-`).replace(/\s/g,``)}function JM(e,t){return e===t||e.contains(t)}var YM=/((gt|sm)-|galaxy nexus)|samsung[- ]|samsungbrowser/i;function XM(e){return!!(e&&e.match(YM))}function ZM(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 QM(e){return e.nativeEvent||e}function $M(e){"@babel/helpers - typeof";return $M=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},$M(e)}function eN(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?eN(Object(n),!0).forEach(function(t){nN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nN(e,t,n){return t=rN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rN(e){var t=iN(e,`string`);return $M(t)===`symbol`?t:String(t)}function iN(e,t){if($M(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if($M(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function aN(e,t,n){var r=t.initialState;return{getState:function(){return r},dispatch:function(i,a){var o=tN({},r);r=e(r,{type:i,props:t,payload:a}),n({state:r,prevState:o})},pendingRequests:AM()}}function oN(e){"@babel/helpers - typeof";return oN=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},oN(e)}function sN(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 cN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?sN(Object(n),!0).forEach(function(t){lN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lN(e,t,n){return t=uN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uN(e){var t=dN(e,`string`);return oN(t)===`symbol`?t:String(t)}function dN(e,t){if(oN(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(oN(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function fN(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 cN(cN({},e),{},{items:yj(e.items).map(function(e){return cN(cN({},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 pN(e){"@babel/helpers - typeof";return pN=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},pN(e)}function mN(e){return vN(e)||_N(e)||gN(e)||hN()}function hN(){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 gN(e,t){if(e){if(typeof e==`string`)return yN(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 yN(e,t)}}function _N(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function vN(e){if(Array.isArray(e))return yN(e)}function yN(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 bN(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?bN(Object(n),!0).forEach(function(t){SN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function SN(e,t,n){return t=CN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CN(e){var t=wN(e,`string`);return pN(t)===`symbol`?t:String(t)}function wN(e,t){if(pN(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(pN(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function TN(e,t){var n,r=typeof window<`u`?window:{},i=e.plugins||[];return xN(xN({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 Sj(t)>0},reshape:function(e){return e.sources}},e),{},{id:(n=e.id)==null?xj():n,plugins:i,initialState:xN({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(mN(i.map(function(e){return e.getSources})),[e.getSources]).filter(Boolean).map(function(e){return zM(e,n)})).then(function(e){return yj(e)}).then(function(e){return e.map(function(e){return xN(xN({},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:xN({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 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){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 ON(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?DN(Object(n),!0).forEach(function(t){kN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kN(e,t,n){return t=AN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AN(e){var t=jN(e,`string`);return EN(t)===`symbol`?t:String(t)}function jN(e,t){if(EN(e)!==`object`||e===null)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 MN(e){var t=e.collections,n=e.props,r=e.state,i=t.reduce(function(e,t){return ON(ON({},e),{},kN({},t.source.sourceId,ON(ON({},t.source),{},{getItems:function(){return yj(t.items)}})))},{}),a=n.plugins.reduce(function(e,t){return t.reshape?t.reshape(e):e},{sourcesBySourceId:i,state:r}).sourcesBySourceId;return yj(n.reshape({sourcesBySourceId:a,sources:Object.values(a),state:r})).filter(Boolean).map(function(e){return{source:e,items:e.getItems()}})}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){return UN(e)||HN(e)||VN(e)||BN()}function BN(){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 VN(e,t){if(e){if(typeof e==`string`)return WN(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 WN(e,t)}}function HN(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function UN(e){if(Array.isArray(e))return WN(e)}function WN(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 GN(e){return!!e.execute}function KN(e){return!!(e!=null&&e.execute)}function qN(e,t,n){if(KN(e)){var r=e.requesterId===`algolia`?Object.assign.apply(Object,[{}].concat(zN(Object.keys(n.context).map(function(e){var t;return(t=n.context[e])==null?void 0:t.__algoliaSearchParameters})))):{};return FN(FN({},e),{},{requests:e.queries.map(function(n){return{query:e.requesterId===`algolia`?FN(FN({},n),{},{params:FN(FN({},r),n.params)}):n,sourceId:t,transformResponse:e.transformResponse}})})}return{items:e,sourceId:t}}function JN(e){var t=e.reduce(function(e,t){if(!GN(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 GN(t)&&GN(e)&&e.searchClient===n&&!!i&&e.requesterId===i});if(o){var s;(s=o.items).push.apply(s,zN(a))}else{var c={execute:r,requesterId:i,items:a,searchClient:n};e.push(c)}return e},[]).map(function(e){if(!GN(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 yj(e)})}function YN(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(ZM(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 XN(e){"@babel/helpers - typeof";return XN=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},XN(e)}var ZN=[`event`,`nextState`,`props`,`query`,`refresh`,`store`];function QN(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 $N(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?QN(Object(n),!0).forEach(function(t){eP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eP(e,t,n){return t=tP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tP(e){var t=nP(e,`string`);return XN(t)===`symbol`?t:String(t)}function nP(e,t){if(XN(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(XN(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function rP(e,t){if(e==null)return{};var n=iP(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 iP(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 aP=null,oP=jM();function sP(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=rP(e,ZN);aP&&i.environment.clearTimeout(aP);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 $N($N({},e),{},{items:[]})});p(`idle`),l(g),u((h=r.isOpen)==null?i.shouldPanelOpen({state:s.getState()}):h);var _=EM(oP(g).then(function(){return Promise.resolve()}));return s.pendingRequests.add(_)}p(`loading`),aP=i.environment.setTimeout(function(){p(`stalled`)},i.stallThreshold);var v=EM(oP(i.getSources($N({query:a,refresh:o,state:s.getState()},c)).then(function(e){return Promise.all(e.map(function(e){return Promise.resolve(e.getItems($N({query:a,refresh:o,state:s.getState()},c))).then(function(t){return qN(t,e.sourceId,s.getState())})})).then(JN).then(function(t){var n=t.some(function(e){var t=e.items;return cP(t)});if(n){var r;m({algoliaInsightsPlugin:$N($N({},((r=s.getState().context)==null?void 0:r.algoliaInsightsPlugin)||{}),{},{__automaticInsights:n})})}return YN(t,e,s)}).then(function(e){return MN({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=KM(s.getState());if(s.getState().activeItemId!==null&&f){var m=f.item,h=f.itemInputValue,g=f.itemUrl,_=f.source;_.onActive($N({event:t,item:m,itemInputValue:h,itemUrl:g,refresh:o,source:_,state:s.getState()},c))}}).finally(function(){p(`idle`),aP&&i.environment.clearTimeout(aP)});return s.pendingRequests.add(v)}function cP(e){return!Array.isArray(e)&&!!(e!=null&&e._automaticInsights)}function lP(e){"@babel/helpers - typeof";return lP=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},lP(e)}var uP=[`event`,`props`,`refresh`,`store`];function dP(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 fP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dP(Object(n),!0).forEach(function(t){pP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pP(e,t,n){return t=mP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mP(e){var t=hP(e,`string`);return lP(t)===`symbol`?t:String(t)}function hP(e,t){if(lP(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(lP(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function gP(e,t){if(e==null)return{};var n=_P(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 _P(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 vP(e){var t=e.event,n=e.props,r=e.refresh,i=e.store,a=gP(e,uP);if(t.key===`ArrowUp`||t.key===`ArrowDown`){var o=function(){var e=KM(i.getState()),t=n.environment.document.getElementById(qM(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=KM(i.getState());if(i.getState().activeItemId!==null&&e){var n=e.item,o=e.itemInputValue,s=e.itemUrl,c=e.source;c.onActive(fP({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)?sP(fP({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=UM(n.plugins,i.pendingRequests);c===void 0?n.debug||i.pendingRequests.cancelAll():c.then(i.pendingRequests.cancelAll);return}t.preventDefault();var l=KM(i.getState()),u=l.item,d=l.itemInputValue,f=l.itemUrl,p=l.source;if(t.metaKey||t.ctrlKey)f!==void 0&&(p.onSelect(fP({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(fP({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(fP({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}sP(fP({event:t,nextState:{isOpen:!1},props:n,query:d,refresh:r,store:i},a)).then(function(){p.onSelect(fP({event:t,item:u,itemInputValue:d,itemUrl:f,refresh:r,source:p,state:i.getState()},a))})}}}function yP(e){"@babel/helpers - typeof";return yP=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},yP(e)}var bP=[`props`,`refresh`,`store`],xP=[`inputElement`,`formElement`,`panelElement`],SP=[`inputElement`],CP=[`inputElement`,`maxLength`],wP=[`source`],TP=[`item`,`source`];function EP(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 DP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?EP(Object(n),!0).forEach(function(t){OP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function OP(e,t,n){return t=kP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kP(e){var t=AP(e,`string`);return yP(t)===`symbol`?t:String(t)}function AP(e,t){if(yP(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(yP(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function jP(e,t){if(e==null)return{};var n=MP(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 MP(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 NP(e){var t=e.props,n=e.refresh,r=e.store,i=jP(e,bP);return{getEnvironmentProps:function(e){var n=e.inputElement,i=e.formElement,a=e.panelElement,o=jP(e,xP);function s(e){!(r.getState().isOpen||!r.pendingRequests.isEmpty())||e.target===n||[i,a].some(function(t){return JM(t,e.target)})===!1&&(r.dispatch(`blur`,null),t.debug||r.pendingRequests.cancelAll())}return DP({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 DP({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 qM(t.id,`list`,n)}).join(` `):void 0,"aria-labelledby":qM(t.id,`label`)},e)},getFormProps:function(e){e.inputElement;var a=jP(e,SP),o=function(a){var o;t.onSubmit(DP({event:a,refresh:n,state:r.getState()},i)),r.dispatch(`submit`,null),(o=e.inputElement)==null||o.blur()};return DP({action:``,noValidate:!0,role:`search`,onSubmit:function(e){e.preventDefault();var n=UM(t.plugins,r.pendingRequests);n===void 0?o(e):n.then(function(){return o(e)})},onReset:function(a){var o;a.preventDefault(),t.onReset(DP({event:a,refresh:n,state:r.getState()},i)),r.dispatch(`reset`,null),(o=e.inputElement)==null||o.focus()}},a)},getLabelProps:function(e){return DP({htmlFor:qM(t.id,`input`),id:qM(t.id,`label`)},e)},getInputProps:function(e){var a;function o(e){(t.openOnFocus||r.getState().query)&&sP(DP({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=jP(s,CP),d=KM(r.getState()),f=XM(((a=t.environment.navigator)==null?void 0:a.userAgent)||``),p=t.enterKeyHint||(d!=null&&d.itemUrl&&!f?`go`:`search`);return DP({"aria-autocomplete":`both`,"aria-activedescendant":r.getState().isOpen&&r.getState().activeItemId!==null?qM(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 qM(t.id,`list`,n)}).join(` `):void 0,"aria-labelledby":qM(t.id,`label`),value:r.getState().completion||r.getState().query,id:qM(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&&QM(e).isComposing){i.setQuery(a);return}sP(DP({event:e,props:t,query:a.slice(0,l),refresh:n,store:r},i))},onCompositionEnd:function(e){sP(DP({event:e,props:t,query:e.currentTarget.value.slice(0,l),refresh:n,store:r},i))},onKeyDown:function(e){QM(e).isComposing||vP(DP({event:e,props:t,refresh:n,store:r},i))},onFocus:o,onBlur:Tj,onClick:function(n){e.inputElement===t.environment.document.activeElement&&!r.getState().isOpen&&o(n)}},u)},getPanelProps:function(e){return DP({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){r.dispatch(`mouseleave`,null)}},e)},getListProps:function(e){var n=e||{},r=n.source,i=jP(n,wP);return DP({role:`listbox`,"aria-labelledby":qM(t.id,`label`),id:qM(t.id,`list`,r)},i)},getItemProps:function(e){var a=e.item,o=e.source,s=jP(e,TP);return DP({id:qM(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=KM(r.getState());if(r.getState().activeItemId!==null&&t){var o=t.item,s=t.itemInputValue,c=t.itemUrl,l=t.source;l.onActive(DP({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():sP(DP({event:e,nextState:{isOpen:!1},props:t,query:s,refresh:n,store:r},i))).then(function(){o.onSelect(DP({event:e,item:a,itemInputValue:s,itemUrl:c,refresh:n,source:o,state:r.getState()},i))})}},s)}}}function PP(e){"@babel/helpers - typeof";return PP=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},PP(e)}function FP(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 IP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?FP(Object(n),!0).forEach(function(t){LP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function LP(e,t,n){return t=RP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RP(e){var t=zP(e,`string`);return PP(t)===`symbol`?t:String(t)}function zP(e,t){if(PP(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(PP(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function BP(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?LP({},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:IP({"autocomplete-core":Object.keys(o)},c),ua:Dj.concat(((i=o.__autocomplete_metadata)==null?void 0:i.userAgents)||[])}}function VP(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 HP(e){var t,n=e.state;return n.isOpen===!1||n.activeItemId===null?null:((t=KM(n))==null?void 0:t.itemInputValue)||null}function UP(e){"@babel/helpers - typeof";return UP=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},UP(e)}function WP(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 GP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?WP(Object(n),!0).forEach(function(t){KP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function KP(e,t,n){return t=qP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qP(e){var t=JP(e,`string`);return UP(t)===`symbol`?t:String(t)}function JP(e,t){if(UP(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(UP(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var YP=function(e,t){switch(t.type){case`setActiveItemId`:return GP(GP({},e),{},{activeItemId:t.payload});case`setQuery`:return GP(GP({},e),{},{query:t.payload,completion:null});case`setCollections`:return GP(GP({},e),{},{collections:t.payload});case`setIsOpen`:return GP(GP({},e),{},{isOpen:t.payload});case`setStatus`:return GP(GP({},e),{},{status:t.payload});case`setContext`:return GP(GP({},e),{},{context:GP(GP({},e.context),t.payload)});case`ArrowDown`:var n=GP(GP({},e),{},{activeItemId:t.payload.hasOwnProperty(`nextActiveItemId`)?t.payload.nextActiveItemId:MM(1,e.activeItemId,Sj(e),t.props.defaultActiveItemId)});return GP(GP({},n),{},{completion:HP({state:n})});case`ArrowUp`:var r=GP(GP({},e),{},{activeItemId:MM(-1,e.activeItemId,Sj(e),t.props.defaultActiveItemId)});return GP(GP({},r),{},{completion:HP({state:r})});case`Escape`:return e.isOpen?GP(GP({},e),{},{activeItemId:null,isOpen:!1,completion:null}):GP(GP({},e),{},{activeItemId:null,query:``,status:`idle`,collections:[]});case`submit`:return GP(GP({},e),{},{activeItemId:null,isOpen:!1,status:`idle`});case`reset`:return GP(GP({},e),{},{activeItemId:t.props.openOnFocus===!0?t.props.defaultActiveItemId:null,status:`idle`,completion:null,query:``});case`focus`:return GP(GP({},e),{},{activeItemId:t.props.defaultActiveItemId,isOpen:(t.props.openOnFocus||!!e.query)&&t.props.shouldPanelOpen({state:e})});case`blur`:return t.props.debug?e:GP(GP({},e),{},{isOpen:!1,activeItemId:null});case`mousemove`:return GP(GP({},e),{},{activeItemId:t.payload});case`mouseleave`:return GP(GP({},e),{},{activeItemId:t.props.defaultActiveItemId});default:return`${JSON.stringify(t.type)}`,e}};function XP(e){"@babel/helpers - typeof";return XP=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},XP(e)}function ZP(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 QP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ZP(Object(n),!0).forEach(function(t){$P(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function $P(e,t,n){return t=eF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eF(e){var t=tF(e,`string`);return XP(t)===`symbol`?t:String(t)}function tF(e,t){if(XP(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(XP(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function nF(e){var t=[],n=TN(e,t),r=aN(YP,n,o),i=fN({store:r}),a=NP(QP({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(QP({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=yM({__autocomplete_clickAnalytics:!1});n.plugins.push(u),c([u])}}function s(){return sP(QP({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,QP(QP({},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(yM(u))}return c(n.plugins),VP({metadata:BP({plugins:n.plugins,options:e}),environment:n.environment}),QP(QP({refresh:s,navigator:n.navigator},a),i)}B();function rF(){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 iF={before:`Searched for `,separator:`, `,lastSeparator:` and `,after:``};function aF({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):iF)||{};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 oF=[`translations`];function sF(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 cF({disclaimerText:e}){return z.createElement(`p`,{className:`DocSearch-AskAiScreen-Disclaimer`},z.createElement(Or,null),` `,e)}function lF({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=R(()=>sF(a),[a]),x=IA(t),S=R(()=>PA(m),[m]),C=R(()=>PA(p),[p]),w=z.useMemo(()=>MA(m),[m]),T=z.useMemo(()=>rj((m==null?void 0:m.parts)||[]),[m]),E=R(()=>n?KA((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 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`},C==null?``:C)),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(qk,{"aria-hidden":`true`}),z.createElement(`div`,{className:`DocSearch-AskAiScreen-Error-Content`},z.createElement(`h4`,{className:`DocSearch-AskAiScreen-Error-Title`},g),z.createElement(nj,{content:t.message,copyButtonText:``,copyButtonCopiedText:``,isStreaming:!1}))),k&&z.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent-Thinking`,role:`status`},z.createElement(`span`,{className:`DocSearch-shimmer`},a.thinkingText||`Thinking...`),z.createElement(`span`,{className:`DocSearch-AskAi-Thinking-Skeleton DocSearch-shimmer`}),z.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`?z.createElement(nj,{key:n,content:e,copyButtonText:a.copyButtonText||`Copy`,copyButtonCopiedText:a.copyButtonCopiedText||`Copied!`,isStreaming:r===`streaming`}):HA(e)?z.createElement($A,{key:n,translations:b,part:e,tools:o,memoryEnabled:l,onSearchQueryClick:i}):e.type===`aggregated-tool-call`?z.createElement(aF,{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 DocSearch-shimmer`},z.createElement(Dr,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}),z.createElement(`span`,{className:`DocSearch-shimmer`},`Reasoning...`)):e.type===`text`?z.createElement(nj,{key:n,content:e.text,copyButtonText:a.copyButtonText||`Copy`,copyButtonCopiedText:a.copyButtonCopiedText||`Copied!`,isStreaming:e.state===`streaming`}):null})),D&&z.createElement(`p`,{className:`DocSearch-AskAiScreen-MessageContent-Stopped`},h)),z.createElement(`div`,{className:`DocSearch-AskAiScreen-Answer-Footer`},z.createElement(mA,{links:w,titleText:_,pluralTitleText:v}),z.createElement(iA,{id:A,showActions:O,latestAssistantMessageContent:S||null,translations:a,conversations:s,onFeedback:c})),E.length>0&&z.createElement(tA,{title:y,suggestions:E,onSelectPromptSuggestion:u})))}function uF(e){let{translations:t={}}=e,n=mn(e,oF),{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`&&IA(c),[l,c]),f=R(()=>BA(c),[c]),p=RA(c),m=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 e},[o]),h=e=>{n.onAskAiToggle(!1),n.setQuery(e)},g=d&&(!FA(c)||o.some(e=>e.role===`assistant`));return z.createElement(`div`,{className:`DocSearch-AskAiScreen DocSearch-AskAiScreen-Container`},z.createElement(`div`,{id:n.promptBlockingErrorId,role:`alert`},g&&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`,{className:`DocSearch-AskAiScreen-Error-Title`},f==null?FA(c)?i:`This conversation cannot continue.`:f),p&&z.createElement(`p`,null,z.createElement(`button`,{type:`button`,className:`DocSearch-ThreadDepthError-Link`,onClick:n.onNewConversation},a),` `,`to continue.`)))),z.createElement(cF,{disclaimerText:r}),z.createElement(`div`,{className:`DocSearch-AskAiScreen-Body`},z.createElement(`div`,{className:`DocSearch-AskAiScreen-ExchangesList`},m.slice().reverse().map((e,r)=>z.createElement(lF,{key:e.id,exchange:e,askAiError:n.askAiError,isLastExchange:r===0,loadingStatus:n.status,translations:t,tools:s,conversations:n.conversations,memoryEnabled:u,onSearchQueryClick:h,onFeedback:n.onFeedback,onSelectPromptSuggestion:n.onSelectPromptSuggestion})))))}let dF=[`translations`];function fF(e){let{translations:t={}}=e,n=mn(e,dF),{recentConversationsTitle:r=`Resume AI conversations`,removeRecentConversationButtonTitle:i=`Remove this conversation from history`}=t,a=Ap(n.state,`recentConversations`);return a?z.createElement(nh,_(_({},n),{},{title:r,collection:a,renderIcon:()=>z.createElement(`div`,{className:`DocSearch-Hit-icon DocSearch-Hit-icon--start`},z.createElement(rF,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 pF=[`translations`];function mF(e){let{translations:t={}}=e,n=mn(e,pF);return z.createElement(`div`,{className:`DocSearch-Dropdown-Container`},z.createElement(fF,_(_({},n),{},{translations:t})),z.createElement(sh,_(_({},n),{},{translations:t})))}let hF=[`onAskAiToggle`];function gF(e){let{onAskAiToggle:t}=e,n=mn(e,hF),r=z.useMemo(()=>Ap(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(nh,_(_({},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 _F({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 vF=[`translations`,`selectAskAiQuestion`],yF=z.memo(e=>{var t;let{translations:n={},selectAskAiQuestion:r}=e,i=mn(e,vF),a=z.useCallback(e=>{r(!0,e)},[r]);return i.canHandleAskAi&&i.isAskAiActive&&i.askAiState===`conversation-history`?z.createElement(gF,_({selectAskAiQuestion:r},i)):i.canHandleAskAi&&i.isAskAiActive&&i.askAiState===`new-conversation`?z.createElement(_F,{translations:n==null?void 0:n.newConversation,selectSuggestedQuestion:i.selectSuggestedQuestion,suggestedQuestions:i.suggestedQuestions}):i.isAskAiActive&&i.canHandleAskAi?z.createElement(uF,_(_({},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(ch,{translations:n==null?void 0:n.errorScreen}):Bp(i.state.query)?z.createElement(mF,_(_({},i),{},{hasCollections:i.hasCollections,translations:n==null?void 0:n.startScreen,selectAskAiQuestion:r})):!i.hasCollections&&!i.canHandleAskAi?z.createElement(uh,_(_({},i),{},{translations:n==null?void 0:n.noResultsScreen})):z.createElement(z.Fragment,null,z.createElement(mh,_(_({},i),{},{translations:n==null?void 0:n.resultsScreen})),i.canHandleAskAi&&!i.hasCollections&&z.createElement(uh,_(_({},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`&&!Bp(t.state.query)&&e.state.query!==t.state.query&&e.state.collections===t.state.collections;return n||r});function bF({heading:e,shimmer:t=!1}){return z.createElement(`span`,{className:`DocSearch-Modal-heading${t?` DocSearch-shimmer`:``}`},e)}let xF=[`translations`,`askAiState`,`onAskAiToggle`,`setAskAiState`];function SF(e){let{translations:t={},askAiState:n,onAskAiToggle:r,setAskAiState:i}=e,a=mn(e,xF),{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=Ap(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.promptBlockingChrome,O=a.placeholder;n===`new-conversation`&&(O=m),a.promptBlockingChrome===`full`&&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=>{if(D&&a.isAskAiActive&&S.has(e.key)){e.preventDefault(),e.stopPropagation();return}let t=!1;if(a.isAskAiActive&&S.has(e.key)&&(e.key===`Enter`&&!T&&!Bp(a.state.query)&&a.onAskAgain(a.state.query),t=!0),t){e.preventDefault(),e.stopPropagation();return}C==null||C(e)},onChange:e=>{if(D&&a.isAskAiActive){e.preventDefault();return}if(a.isAskAiActive){a.setQuery(e.currentTarget.value),e.preventDefault(),e.stopPropagation();return}w==null||w(e)},disabled:T,readOnly:D&&a.isAskAiActive,"aria-disabled":D&&a.isAskAiActive,"aria-describedby":D&&a.isAskAiActive?a.promptBlockingErrorId:void 0},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?g:d,"aria-label":D?g:f,onClick:j},z.createElement(eA,null)):void 0,ee=k?z.createElement(bF,{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(Jk,null)),z.createElement(`div`,{className:`DocSearch-Divider`})),E&&z.createElement(z.Fragment,null,z.createElement(oj,null,z.createElement(oj.Trigger,{className:`DocSearch-Action`},z.createElement(Yk,null)),z.createElement(oj.Content,null,z.createElement(oj.Item,{onClick:a.onNewConversation},z.createElement(Zk,null),g),b&&z.createElement(oj.Item,{onClick:a.onViewConversationHistory},z.createElement(Xk,null),v))),z.createElement(`div`,{className:`DocSearch-Divider`})));return z.createElement(Dm,_(_({},a),{},{placeholder:O,clearButtonTitle:o,clearButtonAriaLabel:s,closeButtonText:c,closeButtonAriaLabel:l,searchInputLabel:u,leadingElement:M,inputOverlay:ee,hideInput:!!k,actionsBeforeClose:N,inputProps:A}))}let CF={value:``,matchLevel:`none`,matchedWords:[]},wF={lvl0:CF,lvl1:CF,lvl2:CF,lvl3:CF,lvl4:CF,lvl5:CF,lvl6:CF},TF={content:CF,hierarchy:wF,hierarchy_camel:[]},EF={content:CF,hierarchy:wF,hierarchy_camel:[]};function DF({conversations:e,disableUserPersonalization:t,handleSelectStoredConversation:n}){return[{sourceId:kp.recentConversations,getItems(){return t?[]:e.getAll().slice(0,3)},onSelect({item:e,event:t}){e.type===`askAI`&&n(e,t)}}]}function OF({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:TF,_snippetResult:EF,__docsearch_parent:null}}async function kF({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=>OF({query:e.prompt,objectID:e.objectID,lvl0:`Prompt Suggestions`}))}catch(e){return[]}}async function AF({query:e,handleSelectAskAiQuestion:t,promptSuggestionsOptions:n,searchClient:r}){let i=n?await kF({query:e,indexName:n.indexName,hitsPerPage:n.hitsPerPage,searchClient:r}):[];return[{sourceId:kp.askAI,getItems(){return[OF({query:e,objectID:`ask-ai-button`,lvl0:`Ask AI`}),...i]},onSelect({item:e}){e.type===`askAI`&&e.query&&t(!0,e.query)}}]}let jF=`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.footerAction`.split(`.`),MF=[`footer`,`searchBox`,`facets`];function NF(e){var t,n,r,i;let{appId:a,apiKey:o,askAi:s,maxResultsPerGroup:c,theme:l,onClose:u=Vp,transformItems:d=Rp,hitComponent:f=jm,resultsFooterComponent:p=()=>null,navigator:m,initialScrollY:h=0,transformSearchClient:g=Rp,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,footerAction:j}=e,M=mn(e,jF),{footer:ee,searchBox:N,facets:te}=b,ne=mn(b,MF),[P,re]=z.useState({query:``,collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:`idle`}),ie=!!s,ae=(b==null||(t=b.searchBox)==null?void 0:t.placeholderText)||M.placeholder||`Search docs`;if(ie){var oe;ae=(b==null||(oe=b.searchBox)==null?void 0:oe.placeholderText)||`Search docs or ask AI a question`}if(T){var se;ae=(b==null||(se=b.searchBox)==null?void 0:se.placeholderTextAskAi)||`Ask another question...`}let{containerRef:ce,modalRef:le,formElementRef:F,dropdownRef:ue,inputRef:de}=Hm(),fe=z.useId(),{initialQuery:pe,initialQueryFromSelection:me}=Lm(y),he=qr(a,o,g),I=typeof s==`object`?s:null,ge=I?I.agentId:s,_e=I==null?void 0:I.searchParameters,[ve,ye]=z.useState(`initial`),be=gj({agentId:ge,searchClient:he,suggestedQuestionsEnabled:I==null?void 0:I.suggestedQuestions}),xe=(n=I==null||(r=I.memory)==null?void 0:r.enabled)!=null&&n,Se=(i=I==null?void 0:I.tools)==null?VA:i,Ce=z.useMemo(()=>yh({indices:O}),[O]),we=Ce[0].name,Te=z.useRef(void 0),{visibleFacets:Ee,facetSelections:De,facetSelectionsRef:Oe,handleFacetSelectionChange:ke,clearFacetSelections:Ae}=Fm({facets:k,indexes:Ce,searchClient:he,onSelectionsChange:()=>{var e;return(e=Te.current)==null?void 0:e.refresh()}}),{favoriteSearches:je,recentSearches:Me}=Km({defaultIndexName:we,recentSearchesLimit:E,recentSearchesWithFavoritesLimit:D}),[Ne,Pe]=z.useState(!1),{chatId:Fe,messages:Ie,status:L,sendMessage:Le,stopAskAiStreaming:R,askAiError:Re,sendFeedback:ze,conversations:Be,startNewConversation:Ve,restoreConversation:He}=hj({agentId:ge,apiKey:(I==null?void 0:I.apiKey)||o,appId:(I==null?void 0:I.appId)||a,searchParameters:_e,tools:Se,memory:I==null?void 0:I.memory,indices:I==null?void 0:I.indices}),Ue=z.useRef(L);z.useEffect(()=>{if(!v){if(Ue.current===`streaming`&&L===`ready`){Ne&&Ie.at(-1)&&(Ie.at(-1).metadata={stopped:!0});for(let e of Ie[0].parts)e.type===`text`&&Be.add(NA(e.text,Ie,Fe))}Ue.current=L}},[L,Ie,Be,v,Ne,Fe]);let We=z.useMemo(()=>L===`error`&&IA(Re),[L,Re])&&(!FA(Re)||Ie.some(e=>e.role===`assistant`)),Ge=z.useMemo(()=>{if(!(!We||ve===`new-conversation`||ve===`conversation-history`))return LA(Re)?`minimal`:`full`},[Re,ve,We]),Ke=Gm({favoriteSearches:je,recentSearches:Me,disableUserPersonalization:v}),qe=Im(P),Je=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)){Te.current&&Te.current.setQuery(``);return}}if(e&&ve===`new-conversation`&&ye(`initial`),C(e,{query:t,suggestedQuestionId:n==null?void 0:n.objectID}),A)return;Pe(!1);let r={};if(n&&(r.body={suggestedQuestionId:n.objectID}),Le({role:`user`,parts:[{type:`text`,text:t}]},r),ue.current){let e=ue.current;typeof e.scrollTo==`function`?e.scrollTo({top:0,behavior:`smooth`}):e.scrollTop=0}Te.current&&Te.current.setQuery(``)},[ve,C,A,Le,ue,w]),Ye=z.useCallback(async(e,t)=>{!ge||!a||await ze(e,t)},[ge,a,ze]),Xe=z.useCallback((e,t)=>{if(Bp(e.query)||!e.messages||e.messages.length<1)return;let n=e.messages,r={query:e.query,messageId:n[0].id};if(He(n,e.chatId),w!=null&&w(r)){Te.current&&Te.current.setQuery(``),t.preventDefault();return}C(!0,r)},[w,He,C]);Te.current||(Te.current=nF({id:`docsearch`,defaultActiveItemId:0,openOnFocus:!0,initialState:{query:pe,context:{searchSuggestions:[]}},insights:!!S,navigator:m,onStateChange(e){re(e.state)},async getSources({query:e,state:t,setContext:n,setStatus:r}){if(Bp(e)){let e=_h({recentSearches:Me,favoriteSearches:je,saveRecentSearch:Ke,onClose:u,disableUserPersonalization:v});return[...ie?DF({conversations:Be,disableUserPersonalization:v,handleSelectStoredConversation:Xe}):[],...e]}let i=vh({query:e,state:{context:t.context},setContext:n,setStatus:r,searchClient:he,indexes:Ce,insights:!!S,appId:a,apiKey:o,maxResultsPerGroup:c,transformItems:d,saveRecentSearch:Ke,onClose:u,facetSelections:Oe}),s=ie?AF({query:e,handleSelectAskAiQuestion:Je,promptSuggestionsOptions:I==null?void 0:I.promptSuggestions,searchClient:he}):Promise.resolve([]),[l,f]=await Promise.all([s,i]);return[...l,...f]}}));let Ze=Te.current,{getEnvironmentProps:Qe,getRootProps:$e,refresh:et}=Ze;Vm({getEnvironmentProps:Qe,containerRef:ce,dropdownRef:ue,formElementRef:F,inputRef:de,initialScrollY:h,modalRef:le,theme:l}),z.useEffect(()=>{ue.current&&!T&&Gp(ue.current)},[P.query,T,ue]),Um({initialQuery:pe,inputRef:de,refresh:et});let tt=Ie.length>0,nt=z.useRef(T);z.useEffect(()=>{let e=nt.current;nt.current=T,T||(Ze.refresh(),e&&tt&&Ve())},[T,Ze,Ve,tt]),z.useEffect(()=>{ye(`initial`)},[T,ye]);let rt=async()=>{Pe(!0),await R()},it=()=>{Ve(),ye(`new-conversation`)},at=()=>{ye(`conversation-history`)},ot=e=>{Je(!0,e.question,e)},st=!0,ct=P.collections.some(e=>e.source.sourceId!==kp.askAI&&e.items.length>0);return P.status===`idle`&&ct===!1&&Bp(P.query)&&!T&&(st=!1),z.createElement(Om,{state:P,containerRef:ce,modalRef:le,formElementRef:F,dropdownRef:ue,getRootProps:$e,showDropdown:st,searchBox:z.createElement(SF,_(_({},Ze),{},{state:P,placeholder:ae||`Search docs`,autoFocus:Bp(pe),inputRef:de,isFromSelection:!!pe&&pe===me,translations:N,isAskAiActive:T,askAiStatus:L,askAiError:Re,askAiState:ve,setAskAiState:ye,promptBlockingChrome:Ge,promptBlockingErrorId:fe,onClose:u,onAskAiToggle:C,onAskAgain:e=>{Je(!0,e)},onStopAskAiStreaming:rt,onNewConversation:it,onViewConversationHistory:at})),filterBar:!T&&!Bp(P.query)?z.createElement(Tm,{facets:Ee,selections:De,translations:te,clearSelections:Ae,onSelectionChange:ke}):null,screenState:z.createElement(yF,_(_({},Ze),{},{indexName:we,state:P,hitComponent:f,resultsFooterComponent:p,disableUserPersonalization:v,recentSearches:Me,favoriteSearches:je,conversations:Be,inputRef:de,translations:ne,getMissingResultsUrl:x,isAskAiActive:T,canHandleAskAi:ie,messages:Ie,tools:Se,askAiError:Re,status:L,hasCollections:ct,askAiState:ve,selectAskAiQuestion:Je,suggestedQuestions:be,selectSuggestedQuestion:ot,memoryEnabled:xe,resultBadgeKey:M.resultBadgeKey,promptBlockingErrorId:fe,onAskAiToggle:C,onNewConversation:it,onItemClick:(e,t)=>{if(e.type===`askAI`&&e.query){e.anchor===`stored`?Xe(e,t):Je(!0,e.query),ye(`initial`),t.preventDefault();return}qe(e),Ke(e),zp(t)||u()},onFeedback:Ye})),footer:z.createElement(Am,{translations:ee,isAskAiActive:T,footerAction:j}),onClose:u})}function PF(e){"@babel/helpers - typeof";return PF=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},PF(e)}function FF(e,t){if(PF(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(PF(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function IF(e){var t=FF(e,`string`);return PF(t)==`symbol`?t:t+``}function LF(e,t,n){return(t=IF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RF(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 zF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?RF(Object(n),!0).forEach(function(t){LF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let BF={"Ctrl/Cmd+K":!0,"/":!0,"Ctrl/Cmd+I":!0};function VF(e){return zF(zF({},BF),e)}B();function HF(e){let t=e.composedPath()[0],n=t.tagName;return t.isContentEditable||n===`INPUT`||n===`SELECT`||n===`TEXTAREA`||n===`BUTTON`}function UF({isOpen:e,isAskAiActive:t,onAskAiToggle:n,onClose:r,onOpen:i,keyboardShortcuts:a=BF}){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||!HF(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 WF=()=>{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 GF(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 KF(e,t){if(e==null)return{};var n,r,i=GF(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 qF=[`children`,`appId`,`apiKey`,`theme`,`onReady`,`onOpen`,`onClose`,`onSidepanelOpen`,`onSidepanelClose`],JF=z.createContext(void 0);JF.displayName=`DocSearchContext`;function YF(e,t){let{children:n,appId:r,apiKey:i,theme:a,onReady:o,onOpen:s,onClose:c,onSidepanelOpen:l,onSidepanelClose:u}=e,d=KF(e,qF),[f,p]=z.useState(`ready`),[m,h]=z.useState(d.initialQuery||``),g=z.useRef(null),_=VF(d.keyboardShortcuts),[v,y]=z.useState(),[b,x]=z.useState(()=>new Set),S=WF(),C=z.useRef(`ready`),w=[`modal-search`,`modal-askai`].includes(f),T=f===`modal-askai`,E=!S&&b.has(`sidepanel`),D=f===`sidepanel`;z.useEffect(()=>{o==null||o()},[o]),z.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=z.useCallback(()=>{p(`modal-search`)},[]),k=z.useCallback(()=>{var e,t;p(`ready`),(e=g.current)==null||e.focus(),h((t=d.initialQuery)==null?``:t)},[p,d.initialQuery]),A=z.useCallback((e,t)=>{if(!S&&e&&E){y(t),p(`sidepanel`);return}p(e?`modal-askai`:`modal-search`)},[p,S,E]),j=z.useCallback(e=>{b.has(`sidepanel`)&&(y(e),p(`sidepanel`))},[p,b]),M=z.useCallback(e=>{p(`modal-search`),h(e.key)},[p,h]),ee=z.useCallback(e=>{b.has(e)||x(t=>{let n=new Set(t);return n.add(e),n})},[b]);z.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]),hn({theme:a}),UF({isOpen:w,onOpen:O,onClose:k,onAskAiToggle:A,onInput:M,isAskAiActive:T,searchButtonRef:g,keyboardShortcuts:_});let N=z.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 z.createElement(JF.Provider,{value:N},n)}let XF=z.forwardRef(YF);XF.displayName=`DocSearch`;function ZF(){let e=z.useContext(JF);if(e===void 0)throw Error("`useDocSearch` must be used within the `DocSearch` provider");return e}B();let QF=[`appId`,`apiKey`];function $F(e,t){let{appId:n,apiKey:r}=e,i=mn(e,QF);return z.createElement(XF,_(_({},i),{},{appId:n,apiKey:r,ref:t}),z.createElement(tI,i))}let eI=z.forwardRef($F);function tI(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}=ZF();if(!p||!m)throw Error("`DocSearchAI` requires `appId` and `apiKey` props.");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(NF,_(_({},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 nI=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,nI(e,s,n,[``,null])),r.push(i),s[0]?t[0]|=2:(t[a-2]=0,t[a]=i)):r.push(s)}return r},rI=new Map;function iI(e){var t=rI.get(this);return t||(t=new Map,rI.set(this,t)),(t=nI(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]}B();let aI=[`container`,`environment`,`transformSearchClient`,`hitComponent`,`resultsFooterComponent`,`footerAction`];function oI(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 sI=iI.bind(C);function cI(e){if(e)return t=>{let n=e(t,{html:sI});return Pt(n)?n:typeof n==`function`?n(t):typeof n==`string`?C(`span`,null,n):n}}function lI(e,t){return n=>{let r=n,{container:i,environment:a,transformSearchClient:o,hitComponent:s,resultsFooterComponent:c,footerAction:l}=r,u=yr(r,aI),d=oI(i,a||(typeof window<`u`?window:void 0)),f=T(),p=!1,m=cI(l);return Ot(C(e,H(H({},u),{},{ref:f,hitComponent:cI(s),resultsFooterComponent:cI(c),footerAction:m?C(m,null):void 0,transformSearchClient:e=>(typeof e==`object`&&e&&`addAlgoliaAgent`in e&&typeof e.addAlgoliaAgent==`function`&&e.addAlgoliaAgent(`docsearch.js`,t),typeof o==`function`?o(e):e)})),d),p=!0,{open(){var e;(e=f.current)==null||e.open()},close(){var e;(e=f.current)==null||e.close()},openAskAi(e){var t;(t=f.current)==null||t.openAskAi(e)},get isReady(){return p},get isOpen(){var e,t;return(e=(t=f.current)==null?void 0:t.isOpen)!=null&&e},destroy(){Rt(d),p=!1}}}}return lI(eI,bn)});
|
|
178
178
|
//# sourceMappingURL=index.js.map
|