(()=>{"use strict";var e,t,n,r,o,i,l,s,a,u,c,d,f,h,p,g,m,v,y,b,w,_,S,x,C,E,I,R,k,P,O,M,T,A,F,N,z,D,L,V,$,j,W,H,B,U,q,G,Z,K,J,X,Y,Q,ee;function te(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ne(e,t){oe(e,t),t.add(e)}function re(e,t,n){oe(e,t),t.set(e,n)}function oe(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ie(e,t){return e.get(se(e,t))}function le(e,t,n){return e.set(se(e,t),n),n}function se(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var ae,ue,ce,de,fe,he,pe,ge,me,ve,ye,be,we,_e,Se,xe,Ce={},Ee=[],Ie=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Re=Array.isArray;function ke(e,t){for(var n in t)e[n]=t[n];return e}function Pe(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Oe(e,t,n){var r,o,i,l={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?ae.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===l[i]&&(l[i]=e.defaultProps[i]);return Me(e,l,r,o,null)}function Me(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++ce:o,__i:-1,__u:0};return null==o&&null!=ue.vnode&&ue.vnode(i),i}function Te(){return{current:null}}function Ae(e){return e.children}function Fe(e,t){this.props=e,this.context=t}function Ne(e,t){if(null==t)return e.__?Ne(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Ne(e):null}function ze(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],o=[],i=ke({},t);i.__v=t.__v+1,ue.vnode&&ue.vnode(i),Ge(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,null==n?Ne(t):n,!!(32&t.__u),o),i.__v=t.__v,i.__.__k[i.__i]=i,Ke(r,i,o),t.__e=t.__=null,i.__e!=n&&De(i)}}function De(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),De(e)}function Le(e){(!e.__d&&(e.__d=!0)&&fe.push(e)&&!Ve.__r++||he!=ue.debounceRendering)&&((he=ue.debounceRendering)||pe)(Ve)}function Ve(){try{for(var e,t=1;fe.length;)fe.length>t&&fe.sort(ge),e=fe.shift(),t=fe.length,ze(e)}finally{fe.length=Ve.__r=0}}function $e(e,t,n,r,o,i,l,s,a,u,c){var d,f,h,p,g,m,v,y=r&&r.__k||Ee,b=t.length;for(a=function(e,t,n,r,o){var i,l,s,a,u,c=n.length,d=c,f=0;for(e.__k=new Array(o),i=0;i<o;i++)null!=(l=t[i])&&"boolean"!=typeof l&&"function"!=typeof l?("string"==typeof l||"number"==typeof l||"bigint"==typeof l||l.constructor==String?l=e.__k[i]=Me(null,l,null,null,null):Re(l)?l=e.__k[i]=Me(Ae,{children:l},null,null,null):void 0===l.constructor&&l.__b>0?l=e.__k[i]=Me(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[i]=l,a=i+f,l.__=e,l.__b=e.__b+1,s=null,-1!=(u=l.__i=He(l,n,a,d))&&(d--,(s=n[u])&&(s.__u|=2)),null==s||null==s.__v?(-1==u&&(o>c?f--:o<c&&f++),"function"!=typeof l.type&&(l.__u|=4)):u!=a&&(u==a-1?f--:u==a+1?f++:(u>a?f--:f++,l.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<c;i++)null!=(s=n[i])&&!(2&s.__u)&&(s.__e==r&&(r=Ne(s)),Ye(s,s));return r}(n,t,y,a,b),d=0;d<b;d++)null!=(h=n.__k[d])&&(f=-1!=h.__i&&y[h.__i]||Ce,h.__i=d,m=Ge(e,h,f,o,i,l,s,a,u,c),p=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&Xe(f.ref,null,h),c.push(h.ref,h.__c||p,h)),null==g&&null!=p&&(g=p),(v=!!(4&h.__u))||f.__k===h.__k?(a=je(h,a,e,v),v&&f.__e&&(f.__e=null)):"function"==typeof h.type&&void 0!==m?a=m:p&&(a=p.nextSibling),h.__u&=-7);return n.__e=g,a}function je(e,t,n,r){var o,i;if("function"==typeof e.type){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=je(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=Ne(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function We(e,t){return t=t||[],null==e||"boolean"==typeof e||(Re(e)?e.some(function(e){We(e,t)}):t.push(e)),t}function He(e,t,n,r){var o,i,l,s=e.key,a=e.type,u=t[n],c=null!=u&&!(2&u.__u);if(null===u&&null==s||c&&s==u.key&&a==u.type)return n;if(r>(c?1:0))for(o=n-1,i=n+1;o>=0||i<t.length;)if(null!=(u=t[l=o>=0?o--:i++])&&!(2&u.__u)&&s==u.key&&a==u.type)return l;return-1}function Be(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Ie.test(t)?n:n+"px"}function Ue(e,t,n,r,o){var i,l;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Be(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||Be(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(be,"$1")),l=t.toLowerCase(),t=l in e||"onFocusOut"==t||"onFocusIn"==t?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n[ye]=r[ye]:(n[ye]=we,e.addEventListener(t,i?Se:_e,i)):e.removeEventListener(t,i?Se:_e,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function qe(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[ve])t[ve]=we++;else if(t[ve]<n[ye])return;return n(ue.event?ue.event(t):t)}}}function Ge(e,t,n,r,o,i,l,s,a,u){var c,d,f,h,p,g,m,v,y,b,w,_,S,x,C,E,I=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(a=!!(32&n.__u),i=[s=t.__e=n.__e]),(c=ue.__b)&&c(t);e:if("function"==typeof I){d=l.length;try{if(y=t.props,b=I.prototype&&I.prototype.render,w=(c=I.contextType)&&r[c.__c],_=c?w?w.props.value:c.__:r,n.__c?v=(f=t.__c=n.__c).__=f.__E:(b?t.__c=f=new I(y,_):(t.__c=f=new Fe(y,_),f.constructor=I,f.render=Qe),w&&w.sub(f),f.state||(f.state={}),f.__n=r,h=f.__d=!0,f.__h=[],f._sb=[]),b&&null==f.__s&&(f.__s=f.state),b&&null!=I.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=ke({},f.__s)),ke(f.__s,I.getDerivedStateFromProps(y,f.__s))),p=f.props,g=f.state,f.__v=t,h)b&&null==I.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),b&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(b&&null==I.getDerivedStateFromProps&&y!==p&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(y,_),t.__v==n.__v||!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(y,f.__s,_)){t.__v!=n.__v&&(f.props=y,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),Ee.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&l.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(y,f.__s,_),b&&null!=f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(p,g,m)})}if(f.context=_,f.props=y,f.__P=e,f.__e=!1,S=ue.__r,x=0,b)f.state=f.__s,f.__d=!1,S&&S(t),c=f.render(f.props,f.state,f.context),Ee.push.apply(f.__h,f._sb),f._sb=[];else do{f.__d=!1,S&&S(t),c=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++x<25);f.state=f.__s,null!=f.getChildContext&&(r=ke(ke({},r),f.getChildContext())),b&&!h&&null!=f.getSnapshotBeforeUpdate&&(m=f.getSnapshotBeforeUpdate(p,g)),C=null!=c&&c.type===Ae&&null==c.key?Je(c.props.children):c,s=$e(e,Re(C)?C:[C],t,n,r,o,i,l,s,a,u),f.base=t.__e,t.__u&=-161,f.__h.length&&l.push(f),v&&(f.__E=f.__=null)}catch(e){if(l.length=d,t.__v=null,a||null!=i)if(e.then){for(t.__u|=a?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;null!=i&&(i[i.indexOf(s)]=null),t.__e=s}else{if(null!=i)for(E=i.length;E--;)Pe(i[E]);Ze(t)}else t.__e=n.__e,!t.__k&&n.__k&&(t.__k=n.__k),e.then||Ze(t);ue.__e(e,t,n)}}else null==i&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=function(e,t,n,r,o,i,l,s,a){var u,c,d,f,h,p,g,m=n.props||Ce,v=t.props,y=t.type;if("svg"==y?o="http://www.w3.org/2000/svg":"math"==y?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=i)for(u=0;u<i.length;u++)if((h=i[u])&&"setAttribute"in h==!!y&&(y?h.localName==y:3==h.nodeType)){e=h,i[u]=null;break}if(null==e){if(null==y)return document.createTextNode(v);e=document.createElementNS(o,y,v.is&&v),s&&(ue.__m&&ue.__m(t,i),s=!1),i=null}if(null==y)m===v||s&&e.data==v||(e.data=v);else{if(i="textarea"==y&&null!=v.defaultValue?null:i&&ae.call(e.childNodes),!s&&null!=i)for(m={},u=0;u<e.attributes.length;u++)m[(h=e.attributes[u]).name]=h.value;for(u in m)h=m[u],"dangerouslySetInnerHTML"==u?d=h:"children"==u||u in v||"value"==u&&"defaultValue"in v||"checked"==u&&"defaultChecked"in v||Ue(e,u,null,h,o);for(u in v)h=v[u],"children"==u?f=h:"dangerouslySetInnerHTML"==u?c=h:"value"==u?p=h:"checked"==u?g=h:s&&"function"!=typeof h||m[u]===h||Ue(e,u,h,m[u],o);if(c)s||d&&(c.__html==d.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),$e("template"==t.type?e.content:e,Re(f)?f:[f],t,n,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":o,i,l,i?i[0]:n.__k&&Ne(n,0),s,a),null!=i)for(u=i.length;u--;)Pe(i[u]);s&&"textarea"!=y||(u="value","progress"==y&&null==p?e.removeAttribute("value"):null!=p&&(p!==e[u]||"progress"==y&&!p||"option"==y&&p!=m[u])&&Ue(e,u,p,m[u],o),u="checked",null!=g&&g!=e[u]&&Ue(e,u,g,m[u],o))}return e}(n.__e,t,n,r,o,i,l,a,u);return(c=ue.diffed)&&c(t),128&t.__u?void 0:s}function Ze(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Ze))}function Ke(e,t,n){for(var r=0;r<n.length;r++)Xe(n[r],n[++r],n[++r]);ue.__c&&ue.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){ue.__e(e,t.__v)}})}function Je(e){return"object"!=typeof e||null==e||e.__b>0?e:Re(e)?e.map(Je):void 0!==e.constructor?null:ke({},e)}function Xe(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){ue.__e(e,n)}}function Ye(e,t,n){var r,o;if(ue.unmount&&ue.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Xe(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){ue.__e(e,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Ye(r[o],t,n||"function"!=typeof e.type);n||Pe(e.__e),e.__c=e.__=e.__e=void 0}function Qe(e,t,n){return this.constructor(e,n)}function et(e,t,n){var r,o,i,l;t==document&&(t=document.documentElement),ue.__&&ue.__(e,t),o=(r="function"==typeof n)?null:n&&n.__k||t.__k,i=[],l=[],Ge(t,e=(!r&&n||t).__k=Oe(Ae,null,[e]),o||Ce,Ce,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?ae.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,l),Ke(i,e,l),e.props.children=null}function tt(e,t){et(e,t,tt)}function nt(e,t,n){var r,o,i,l,s=ke({},e.props);for(i in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)"key"==i?r=t[i]:"ref"==i?o=t[i]:s[i]=void 0===t[i]&&null!=l?l[i]:t[i];return arguments.length>2&&(s.children=arguments.length>3?ae.call(arguments,2):n),Me(e.type,s,r||e.key,o||e.ref,null)}function rt(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.__e=!0,Le(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"+xe++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}ae=Ee.slice,ue={__e:function(e,t,n,r){for(var o,i,l;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),l=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),l=o.__d),l)return o.__E=o}catch(t){e=t}throw e}},ce=0,de=function(e){return null!=e&&void 0===e.constructor},Fe.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=ke({},this.state),"function"==typeof e&&(e=e(ke({},n),this.props)),e&&ke(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Le(this))},Fe.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Le(this))},Fe.prototype.render=Ae,fe=[],pe="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ge=function(e,t){return e.__v.__b-t.__v.__b},Ve.__r=0,me=Math.random().toString(8),ve="__d"+me,ye="__a"+me,be=/(PointerCapture)$|Capture$/i,we=0,_e=qe(!1),Se=qe(!0),xe=0;var ot,it,lt,st,at=0,ut=[],ct=ue,dt=ct.__b,ft=ct.__r,ht=ct.diffed,pt=ct.__c,gt=ct.unmount,mt=ct.__;function vt(e,t){ct.__h&&ct.__h(it,e,at||t),at=0;var n=it.__H||(it.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function yt(e){return at=1,bt(Nt,e)}function bt(e,t,n){var r=vt(ot++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Nt(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=it,!it.__f)){var o=function(e,t,n){if(!r.__c.__H)return!0;var o=!1,l=r.__c.props!==e;if(r.__c.__H.__.some(function(e){if(e.__N){o=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(l=!0)}}),i){var s=i.call(this,e,t,n);return o?s||l:s}return!o||l};it.__f=!0;var i=it.shouldComponentUpdate,l=it.componentWillUpdate;it.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,o(e,t,n),i=r}l&&l.call(this,e,t,n)},it.shouldComponentUpdate=o}return r.__N||r.__}function wt(e,t){var n=vt(ot++,3);!ct.__s&&Ft(n.__H,t)&&(n.__=e,n.u=t,it.__H.__h.push(n))}function _t(e,t){var n=vt(ot++,4);!ct.__s&&Ft(n.__H,t)&&(n.__=e,n.u=t,it.__h.push(n))}function St(e){return at=5,Ct(function(){return{current:e}},[])}function xt(e,t,n){at=6,_t(function(){if("function"==typeof e){var n=e(t());return function(){e(null),n&&"function"==typeof n&&n()}}if(e)return e.current=t(),function(){return e.current=null}},null==n?n:n.concat(e))}function Ct(e,t){var n=vt(ot++,7);return Ft(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Et(e,t){return at=8,Ct(function(){return e},t)}function It(e){var t=it.context[e.__c],n=vt(ot++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(it)),t.props.value):e.__}function Rt(e,t){ct.useDebugValue&&ct.useDebugValue(t?t(e):e)}function kt(){var e=vt(ot++,11);if(!e.__){for(var t=it.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Pt(){for(var e;e=ut.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Tt),t.__h.some(At),t.__h=[]}catch(n){t.__h=[],ct.__e(n,e.__v)}}}ct.__b=function(e){it=null,dt&&dt(e)},ct.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),mt&&mt(e,t)},ct.__r=function(e){ft&&ft(e),ot=0;var t=(it=e.__c).__H;t&&(lt===it?(t.__h=[],it.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.length&&Pt(),ot=0)),lt=it},ct.diffed=function(e){ht&&ht(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ut.push(t)&&st===ct.requestAnimationFrame||((st=ct.requestAnimationFrame)||Mt)(Pt)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),lt=it=null},ct.__c=function(e,t){t.some(function(e){try{e.__h.some(Tt),e.__h=e.__h.filter(function(e){return!e.__||At(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],ct.__e(n,e.__v)}}),pt&&pt(e,t)},ct.unmount=function(e){gt&&gt(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Tt(e)}catch(e){t=e}}),n.__H=void 0,t&&ct.__e(t,n.__v))};var Ot="function"==typeof requestAnimationFrame;function Mt(e){var t,n=function(){clearTimeout(r),Ot&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ot&&(t=requestAnimationFrame(n))}function Tt(e){var t=it,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),it=t}function At(e){var t=it;e.__c=e.__(),it=t}function Ft(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Nt(e,t){return"function"==typeof t?t(e):t}function zt(e,t){for(var n in t)e[n]=t[n];return e}function Dt(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function Lt(e,t){var n=t(),r=yt({t:{__:n,u:t}}),o=r[0].t,i=r[1];return _t(function(){o.__=n,o.u=t,Vt(o)&&i({t:o})},[e,n,t]),wt(function(){return Vt(o)&&i({t:o}),e(function(){Vt(o)&&i({t:o})})},[e]),n}function Vt(e){try{return!((t=e.__)===(n=e.u())&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}var t,n}function $t(e){e()}function jt(e){return e}function Wt(){return[!1,$t]}var Ht=_t;function Bt(e,t){this.props=e,this.context=t}function Ut(e,t){function n(e){var n=this.props.ref;return n!=e.ref&&n&&("function"==typeof n?n(null):n.current=null),t?!t(this.props,e)||n!=e.ref:Dt(this.props,e)}function r(t){return this.shouldComponentUpdate=n,Oe(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.__f=r.prototype.isReactComponent=!0,r.type=e,r}(Bt.prototype=new Fe).isPureReactComponent=!0,Bt.prototype.shouldComponentUpdate=function(e,t){return Dt(this.props,e)||Dt(this.state,t)};var qt=ue.__b;ue.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),qt&&qt(e)};var Gt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Zt(e){function t(t){var n=zt({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=Gt,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Kt=function(e,t){return null==e?null:We(We(e).map(t))},Jt={map:Kt,forEach:Kt,count:function(e){return e?We(e).length:0},only:function(e){var t=We(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:We},Xt=ue.__e;ue.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);Xt(e,t,n,r)};var Yt=ue.unmount;function Qt(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=zt({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Qt(e,t,n)})),e}function en(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return en(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function tn(){this.__u=0,this.o=null,this.__b=null}function nn(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function rn(e){var t,n,r,o=null;function i(i){if(t||(t=e()).then(function(e){e&&(o=e.default||e),r=!0},function(e){n=e,r=!0}),n)throw n;if(!r)throw t;return o?Oe(o,i):null}return i.displayName="Lazy",i.__f=!0,i}function on(){this.i=null,this.l=null}ue.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Yt&&Yt(e)},(tn.prototype=new Fe).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var o=nn(r.__v),i=!1,l=function(){i||r.__z||(i=!0,n.__R=null,o?o(a):a())};n.__R=l;var s=n.__P;n.__P=null;var a=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=en(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=s,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(l,l)},tn.prototype.componentWillUnmount=function(){this.o=[]},tn.prototype.render=function(e,t){var n=this.__v;if(!n.__m){for(var r=n;r.__;)r=r.__;r=r.__m||(r.__m=[0,0]),n.__m=[r[1]++,0]}if(this.__b){if(n.__k){var o=document.createElement("div"),i=n.__k[0].__c;n.__k[0]=Qt(this.__b,o,i.__O=i.__P)}this.__b=null}var l=t.__a&&Oe(Ae,null,e.fallback);return l&&(l.__u&=-33),[Oe(Ae,null,t.__a?null:e.children),l]};var ln=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function sn(e){return this.getChildContext=function(){return e.context},e.children}function an(e){var t=this,n=e.v;if(t.componentWillUnmount=function(){et(null,t.h),t.h=null,t.v=null},t.v&&t.v!==n&&t.componentWillUnmount(),!t.h){for(var r=t.__v;null!==r&&!r.__m&&null!==r.__;)r=r.__;t.v=n,t.h={nodeType:1,parentNode:n,childNodes:[],__k:{__m:r.__m},contains:function(){return!0},namespaceURI:n.namespaceURI,insertBefore:function(e,n){this.childNodes.push(e),t.v.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.v.removeChild(e)}}}et(Oe(sn,{context:t.context},e.__v),t.h)}function un(e,t){var n=Oe(an,{__v:e,v:t});return n.containerInfo=t,n}(on.prototype=new Fe).__a=function(e){var t=this,n=nn(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),ln(t,e,r)):o()};n?n(i):i()}},on.prototype.render=function(e){this.i=null,this.l=new Map;var t=We(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},on.prototype.componentDidUpdate=on.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){ln(e,n,t)})};var cn="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,dn=/^(?: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]/,fn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,hn=/[A-Z0-9]/g,pn="undefined"!=typeof document,gn=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function mn(e,t,n){return null==t.__k&&(t.textContent=""),et(e,t),"function"==typeof n&&n(),e?e.__c:null}function vn(e,t,n){return tt(e,t),"function"==typeof n&&n(),e?e.__c:null}Fe.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Fe.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var yn=ue.event;ue.event=function(e){return yn&&(e=yn(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var bn,wn={configurable:!0,get:function(){return this.class}},Sn=ue.vnode;ue.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={},o=-1==n.indexOf("-");for(var i in t){var l=t[i];if(!("value"===i&&"defaultValue"in t&&null==l||pn&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var s=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===l?l="":"translate"===s&&"no"===l?l=!1:"o"===s[0]&&"n"===s[1]?"ondoubleclick"===s?i="ondblclick":"onchange"!==s||"input"!==n&&"textarea"!==n||gn(t.type)?"onfocus"===s?i="onfocusin":"onblur"===s?i="onfocusout":fn.test(i)&&(i=s):s=i="oninput":o&&dn.test(i)?i=i.replace(hn,"-$&").toLowerCase():null===l&&(l=void 0),"oninput"===s&&r[i=s]&&(i="oninputCapture"),r[i]=l}}"select"==n&&(r.multiple&&Array.isArray(r.value)&&(r.value=We(t.children).forEach(function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)})),null!=r.defaultValue&&(r.value=We(t.children).forEach(function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",wn)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=cn,Sn&&Sn(e)};var xn=ue.__r;ue.__r=function(e){xn&&xn(e),bn=e.__c};var Cn=ue.diffed;ue.diffed=function(e){Cn&&Cn(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),bn=null};var En={ReactCurrentDispatcher:{current:{readContext:function(e){return bn.__n[e.__c].props.value},useCallback:Et,useContext:It,useDebugValue:Rt,useDeferredValue:jt,useEffect:wt,useId:kt,useImperativeHandle:xt,useInsertionEffect:Ht,useLayoutEffect:_t,useMemo:Ct,useReducer:bt,useRef:St,useState:yt,useSyncExternalStore:Lt,useTransition:Wt}}},In="18.3.1";function Rn(e){return Oe.bind(null,e)}function kn(e){return!!e&&e.$$typeof===cn}function Pn(e){return kn(e)&&e.type===Ae}function On(e){return!!e&&"string"==typeof e.displayName&&0==e.displayName.indexOf("Memo(")}function Mn(e){return kn(e)?nt.apply(null,arguments):e}function Tn(e){return!!e.__k&&(et(null,e),!0)}function An(e){return e&&(e.base||1===e.nodeType&&e)||null}var _n=function(e,t){return e(t)},Fn=function(e,t){var n=ue.debounceRendering;ue.debounceRendering=function(e){return e()};var r=e(t);return ue.debounceRendering=n,r},Nn=kn,zn={useState:yt,useId:kt,useReducer:bt,useEffect:wt,useLayoutEffect:_t,useInsertionEffect:Ht,useTransition:Wt,useDeferredValue:jt,useSyncExternalStore:Lt,startTransition:$t,useRef:St,useImperativeHandle:xt,useMemo:Ct,useCallback:Et,useContext:It,useDebugValue:Rt,version:"18.3.1",Children:Jt,render:mn,hydrate:vn,unmountComponentAtNode:Tn,createPortal:un,createElement:Oe,createContext:rt,createFactory:Rn,cloneElement:Mn,createRef:Te,Fragment:Ae,isValidElement:kn,isElement:Nn,isFragment:Pn,isMemo:On,findDOMNode:An,Component:Fe,PureComponent:Bt,memo:Ut,forwardRef:Zt,flushSync:Fn,unstable_batchedUpdates:_n,StrictMode:Ae,Suspense:tn,SuspenseList:on,lazy:rn,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:En},Dn=Object.freeze({__proto__:null,Children:Jt,Component:Fe,Fragment:Ae,PureComponent:Bt,StrictMode:Ae,Suspense:tn,SuspenseList:on,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:En,cloneElement:Mn,createContext:rt,createElement:Oe,createFactory:Rn,createPortal:un,createRef:Te,default:zn,findDOMNode:An,flushSync:Fn,forwardRef:Zt,hydrate:vn,isElement:Nn,isFragment:Pn,isMemo:On,isValidElement:kn,lazy:rn,memo:Ut,render:mn,startTransition:$t,unmountComponentAtNode:Tn,unstable_batchedUpdates:_n,useCallback:Et,useContext:It,useDebugValue:Rt,useDeferredValue:jt,useEffect:wt,useErrorBoundary:function(e){var t=vt(ot++,10),n=yt();return t.__=e,it.componentDidCatch||(it.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]},useId:kt,useImperativeHandle:xt,useInsertionEffect:Ht,useLayoutEffect:_t,useMemo:Ct,useReducer:bt,useRef:St,useState:yt,useSyncExternalStore:Lt,useTransition:Wt,version:In}),Ln=Symbol.for("preact-signals");function Vn(){if(Hn>1)Hn--;else{var e,t=!1;for(function(){var e=Gn;for(Gn=void 0;void 0!==e;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();void 0!==Wn;){var n=Wn;for(Wn=void 0,Bn++;void 0!==n;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Yn(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(Bn=0,Hn--,t)throw e}}var $n=void 0;function jn(e){var t=$n;$n=void 0;try{return e()}finally{$n=t}}var Wn=void 0,Hn=0,Bn=0,Un=0,qn=0,Gn=void 0,Zn=0;function Kn(e){if(void 0!==$n){var t=e.n;if(void 0===t||t.t!==$n)return t={i:0,S:e,p:$n.s,n:void 0,t:$n,e:void 0,x:void 0,r:t},void 0!==$n.s&&($n.s.n=t),$n.s=t,e.n=t,32&$n.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=$n.s,t.n=void 0,$n.s.n=t,$n.s=t),t}}function Jn(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function Xn(e,t){return new Jn(e,t)}function Yn(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Qn(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function er(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function tr(e,t){Jn.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Zn-1,this.f=4}function nr(e,t){return new tr(e,t)}function rr(e){var t=e.m;if(e.m=void 0,"function"==typeof t){Hn++;var n=$n;$n=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,or(e),t}finally{$n=n,Vn()}}}function or(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,rr(e)}function ir(e){if($n!==this)throw new Error("Out-of-order effect");er(this),$n=e,this.f&=-2,8&this.f&&or(this),Vn()}function lr(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=null==t?void 0:t.name}function sr(e,t){var n=new lr(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}Jn.prototype.brand=Ln,Jn.prototype.h=function(){return!0},Jn.prototype.S=function(e){var t=this,n=this.t;n!==e&&void 0===e.e&&(e.x=n,this.t=e,void 0!==n?n.e=e:jn(function(){var e;null==(e=t.W)||e.call(t)}))},Jn.prototype.U=function(e){var t=this;if(void 0!==this.t){var n=e.e,r=e.x;void 0!==n&&(n.x=r,e.e=void 0),void 0!==r&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,void 0===r&&jn(function(){var e;null==(e=t.Z)||e.call(t)}))}},Jn.prototype.subscribe=function(e){var t=this;return sr(function(){var n=t.value;jn(function(){return e(n)})},{name:"sub"})},Jn.prototype.valueOf=function(){return this.value},Jn.prototype.toString=function(){return this.value+""},Jn.prototype.toJSON=function(){return this.value},Jn.prototype.peek=function(){var e=this;return jn(function(){return e.value})},Object.defineProperty(Jn.prototype,"value",{get:function(){var e=Kn(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Bn>100)throw new Error("Cycle detected");!function(e){0!==Hn&&0===Bn&&e.l!==qn&&(e.l=qn,Gn={S:e,v:e.v,i:e.i,o:Gn})}(this),this.v=e,this.i++,Zn++,Hn++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{Vn()}}}}),tr.prototype=new Jn,tr.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===Zn)return!0;if(this.g=Zn,this.f|=1,this.i>0&&!Yn(this))return this.f&=-2,!0;var e=$n;try{Qn(this),$n=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return $n=e,er(this),this.f&=-2,!0},tr.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}Jn.prototype.S.call(this,e)},tr.prototype.U=function(e){if(void 0!==this.t&&(Jn.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},tr.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(tr.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Kn(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),lr.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.m=t)}finally{e()}},lr.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,rr(this),Qn(this),Hn++;var e=$n;return $n=this,ir.bind(this,e)},lr.prototype.N=function(){2&this.f||(this.f|=2,this.u=Wn,Wn=this)},lr.prototype.d=function(){this.f|=8,1&this.f||or(this)},lr.prototype.dispose=function(){this.d()};var ar,ur,cr="undefined"!=typeof window&&!!window.__PREACT_SIGNALS_DEVTOOLS__,dr=[];function fr(e,t){ue[e]=t.bind(null,ue[e]||function(){})}function hr(e){if(ur){var t=ur;ur=void 0,t()}ur=e&&e.S()}function pr(e){var t=this,n=e.data,r=function(e){return Ct(function(){return Xn(e,undefined)},[])}(n);r.value=n;var o=Ct(function(){for(var e=t,n=t.__v;n=n.__;)if(n.__c){n.__c.__$f|=4;break}var o=nr(function(){var e=r.value.value;return 0===e?0:!0===e?"":e||""}),i=nr(function(){return!Array.isArray(o.value)&&!de(o.value)}),l=sr(function(){if(this.N=yr,i.value){var t=o.value;e.__v&&e.__v.__e&&3===e.__v.__e.nodeType&&(e.__v.__e.data=t)}}),s=t.__$u.d;return t.__$u.d=function(){l(),s.call(this)},[i,o]},[]),i=o[0],l=o[1];return i.value?l.peek():l.value}function gr(e,t,n,r){var o=t in e&&void 0===e.ownerSVGElement,i=Xn(n);return{o:function(e,t){i.value=e,r=t},d:sr(function(){this.N=yr;var n=i.value.value;r[t]!==n&&(r[t]=n,o?e[t]=n:null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))})}}sr(function(){ar=this.N})(),pr.displayName="ReactiveTextNode",Object.defineProperties(Jn.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:pr},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}}),fr("__b",function(e,t){if("string"==typeof t.type){var n,r=t.props;for(var o in r)if("children"!==o){var i=r[o];i instanceof Jn&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)}),fr("__r",function(e,t){if(e(t),t.type!==Ae){hr();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(e,t){var n;return sr(function(){n=this},{name:t}),n.c=e,n}(function(){var e;cr&&(null==(e=n.y)||e.call(n)),r.__$f|=1,r.setState({})},"function"==typeof t.type?t.type.displayName||t.type.name:""))),hr(n)}}),fr("__e",function(e,t,n,r){hr(),e(t,n,r)}),fr("diffed",function(e,t){var n;if(hr(),"string"==typeof t.type&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var i=n.U;if(i)for(var l in i){var s=i[l];void 0===s||l in r||(s.d(),i[l]=void 0)}else i={},n.U=i;for(var a in r){var u=i[a],c=r[a];void 0===u?(u=gr(n,a,c,o),i[a]=u):u.o(c,o)}}}e(t)}),fr("unmount",function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var o in n.U=void 0,r){var i=r[o];i&&i.d()}}var l=t.__np;if(l){var s=t.props;for(var a in l)s[a]=l[a]}t.__np=void 0}else{var u=t.__c;if(u){var c=u.__$u;c&&(u.__$u=void 0,c.d())}}e(t)}),fr("__h",function(e,t,n,r){(r<3||9===r)&&(t.__$f|=2),e(t,n,r)}),Fe.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,r=n&&void 0!==n.s;for(var o in t)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){var i=2&this.__$f;if(!(r||i||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(r||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var l in e)if("__source"!==l&&e[l]!==this.props[l])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};var mr=function(e){queueMicrotask(function(){queueMicrotask(e)})};function vr(){!function(e){if(Hn>0)return e();qn=++Un,Hn++;try{return e()}finally{Vn()}}(function(){for(var e;e=dr.shift();)ar.call(e)})}function yr(){1===dr.push(this)&&(ue.requestAnimationFrame||mr)(vr)}var br=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},wr=new(e=new WeakMap,t=new WeakMap,n=new WeakMap,class extends br{constructor(){super(),re(this,e,void 0),re(this,t,void 0),re(this,n,void 0),le(n,this,e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){ie(t,this)||this.setEventListener(ie(n,this))}onUnsubscribe(){var e;this.hasListeners()||(null===(e=ie(t,this))||void 0===e||e.call(this),le(t,this,void 0))}setEventListener(e){var r;le(n,this,e),null===(r=ie(t,this))||void 0===r||r.call(this),le(t,this,e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()}))}setFocused(t){ie(e,this)!==t&&(le(e,this,t),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){var t;return"boolean"==typeof ie(e,this)?ie(e,this):"hidden"!==(null===(t=globalThis.document)||void 0===t?void 0:t.visibilityState)}}),_r={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Sr=new(r=new WeakMap,o=new WeakMap,class{constructor(){re(this,r,_r),re(this,o,!1)}setTimeoutProvider(e){le(r,this,e)}setTimeout(e,t){return ie(r,this).setTimeout(e,t)}clearTimeout(e){ie(r,this).clearTimeout(e)}setInterval(e,t){return ie(r,this).setInterval(e,t)}clearInterval(e){ie(r,this).clearInterval(e)}}),xr="undefined"==typeof window||"Deno"in globalThis;function Cr(){}function Er(e){return"number"==typeof e&&e>=0&&e!==1/0}function Ir(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Rr(e,t){return"function"==typeof e?e(t):e}function kr(e,t){return"function"==typeof e?e(t):e}function Pr(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:l,stale:s}=e;if(l)if(r){if(t.queryHash!==Mr(l,t.options))return!1}else if(!Ar(t.queryKey,l))return!1;if("all"!==n){const e=t.isActive();if("active"===n&&!e)return!1;if("inactive"===n&&e)return!1}return!("boolean"==typeof s&&t.isStale()!==s||o&&o!==t.state.fetchStatus||i&&!i(t))}function Or(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Tr(t.options.mutationKey)!==Tr(i))return!1}else if(!Ar(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Mr(e,t){return((null==t?void 0:t.queryKeyHashFn)||Tr)(e)}function Tr(e){return JSON.stringify(e,(e,t)=>Lr(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Ar(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(n=>Ar(e[n],t[n]))}var Fr=Object.prototype.hasOwnProperty;function Nr(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Dr(e)&&Dr(t);if(!(r||Lr(e)&&Lr(t)))return t;const o=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),l=i.length,s=r?new Array(l):{};let a=0;for(let u=0;u<l;u++){const l=r?u:i[u],c=e[l],d=t[l];if(c===d){s[l]=c,(r?u<o:Fr.call(e,l))&&a++;continue}if(null===c||null===d||"object"!=typeof c||"object"!=typeof d){s[l]=d;continue}const f=Nr(c,d,n+1);s[l]=f,f===c&&a++}return o===l&&a===o?e:s}function zr(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Dr(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Lr(e){if(!Vr(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!Vr(n)&&!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function Vr(e){return"[object Object]"===Object.prototype.toString.call(e)}function $r(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?Nr(e,t):t}function jr(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Wr(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Hr=Symbol();function Br(e,t){return!e.queryFn&&null!=t&&t.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==Hr?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}function Ur(e,t){return"function"==typeof e?e(...t):!!e}var qr=(()=>{let e=()=>xr;return{isServer:()=>e(),setIsServer(t){e=t}}})();function Gr(){let e,t;const n=new Promise((n,r)=>{e=n,t=r});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch(()=>{}),n.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},n.reject=e=>{r({status:"rejected",reason:e}),t(e)},n}var Zr=function(e){setTimeout(e,0)},Kr=function(){let e=[],t=0,n=e=>{e()},r=e=>{e()},o=Zr;const i=r=>{t?e.push(r):o(()=>{n(r)})};return{batch:i=>{let l;t++;try{l=i()}finally{t--,t||(()=>{const t=e;e=[],t.length&&o(()=>{r(()=>{t.forEach(e=>{n(e)})})})})()}return l},batchCalls:e=>(...t)=>{i(()=>{e(...t)})},schedule:i,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{o=e}}}(),Jr=new(i=new WeakMap,l=new WeakMap,s=new WeakMap,class extends br{constructor(){super(),re(this,i,!0),re(this,l,void 0),re(this,s,void 0),le(s,this,e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}})}onSubscribe(){ie(l,this)||this.setEventListener(ie(s,this))}onUnsubscribe(){var e;this.hasListeners()||(null===(e=ie(l,this))||void 0===e||e.call(this),le(l,this,void 0))}setEventListener(e){var t;le(s,this,e),null===(t=ie(l,this))||void 0===t||t.call(this),le(l,this,e(this.setOnline.bind(this)))}setOnline(e){ie(i,this)!==e&&(le(i,this,e),this.listeners.forEach(t=>{t(e)}))}isOnline(){return ie(i,this)}});function Xr(e){return Math.min(1e3*2**e,3e4)}function Yr(e){return"online"!==(null!=e?e:"online")||Jr.isOnline()}var Qr=class extends Error{constructor(e){super("CancelledError"),this.revert=null==e?void 0:e.revert,this.silent=null==e?void 0:e.silent}};function eo(e){let t,n=!1,r=0;const o=Gr(),i=()=>"pending"!==o.status,l=()=>wr.isFocused()&&("always"===e.networkMode||Jr.isOnline())&&e.canRun(),s=()=>Yr(e.networkMode)&&e.canRun(),a=e=>{var n;i()||(null===(n=t)||void 0===n||n(),o.resolve(e))},u=e=>{var n;i()||(null===(n=t)||void 0===n||n(),o.reject(e))},c=()=>new Promise(n=>{var r;t=e=>{(i()||l())&&n(e)},null===(r=e.onPause)||void 0===r||r.call(e)}).then(()=>{var n;t=void 0,i()||null===(n=e.onContinue)||void 0===n||n.call(e)}),d=()=>{if(i())return;let t;const o=0===r?e.initialPromise:void 0;try{t=null!=o?o:e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(a).catch(t=>{var o,s,a;if(i())return;const f=null!==(o=e.retry)&&void 0!==o?o:qr.isServer()?0:3,h=null!==(s=e.retryDelay)&&void 0!==s?s:Xr,p="function"==typeof h?h(r,t):h,g=!0===f||"number"==typeof f&&r<f||"function"==typeof f&&f(r,t);var m;!n&&g?(r++,null===(a=e.onFail)||void 0===a||a.call(e,r,t),(m=p,new Promise(e=>{Sr.setTimeout(e,m)})).then(()=>l()?void 0:c()).then(()=>{n?u(t):d()})):u(t)})};return{promise:o,status:()=>o.status,cancel:t=>{if(!i()){var n;const r=new Qr(t);u(r),null===(n=e.onCancel)||void 0===n||n.call(e,r)}},continue:()=>{var e;return null===(e=t)||void 0===e||e(),o},cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:s,start:()=>(s()?d():c().then(d),o)}}var to=(a=new WeakMap,class{constructor(){re(this,a,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Er(this.gcTime)&&le(a,this,Sr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,null!=e?e:qr.isServer()?1/0:3e5)}clearGcTimeout(){void 0!==ie(a,this)&&(Sr.clearTimeout(ie(a,this)),le(a,this,void 0))}});function no(e){return{onFetch:(t,n)=>{var r,o,i;const l=t.options,s=null===(r=t.fetchOptions)||void 0===r||null===(r=r.meta)||void 0===r||null===(r=r.fetchMore)||void 0===r?void 0:r.direction,a=(null===(o=t.state.data)||void 0===o?void 0:o.pages)||[],u=(null===(i=t.state.data)||void 0===i?void 0:i.pageParams)||[];let c={pages:[],pageParams:[]},d=0;const f=async()=>{let n=!1;const r=e=>{!function(e,n,r){let o,i=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(null!=o||(o=t.signal),i||(i=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)})}(e,0,()=>n=!0)},o=Br(t.options,t.fetchOptions),i=async(e,i,l)=>{if(n)return Promise.reject(t.signal.reason);if(null==i&&e.pages.length)return Promise.resolve(e);const s=(()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:i,direction:l?"backward":"forward",meta:t.options.meta};return r(e),e})(),a=await o(s),{maxPages:u}=t.options,c=l?Wr:jr;return{pages:c(e.pages,a,u),pageParams:c(e.pageParams,i,u)}};if(s&&a.length){const e="backward"===s,t={pages:a,pageParams:u},n=(e?oo:ro)(l,t);c=await i(t,n,e)}else{const t=null!=e?e:a.length;do{var f;const e=0===d?null!==(f=u[0])&&void 0!==f?f:l.initialPageParam:ro(l,c);if(d>0&&null==e)break;c=await i(c,e),d++}while(d<t)}return c};t.options.persister?t.fetchFn=()=>{var e,r;return null===(e=(r=t.options).persister)||void 0===e?void 0:e.call(r,f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=f}}}function ro(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function oo(e,{pages:t,pageParams:n}){var r;return t.length>0?null===(r=e.getPreviousPageParam)||void 0===r?void 0:r.call(e,t[0],t,n[0],n):void 0}function io(e,t){return!!t&&null!=ro(e,t)}function lo(e,t){return!(!t||!e.getPreviousPageParam)&&null!=oo(e,t)}var so=(u=new WeakMap,c=new WeakMap,d=new WeakMap,f=new WeakMap,h=new WeakMap,p=new WeakMap,g=new WeakMap,m=new WeakMap,v=new WeakSet,class extends to{constructor(e){var t;super(),ne(this,v),re(this,u,void 0),re(this,c,void 0),re(this,d,void 0),re(this,f,void 0),re(this,h,void 0),re(this,p,void 0),re(this,g,void 0),re(this,m,void 0),le(m,this,!1),le(g,this,e.defaultOptions),this.setOptions(e.options),this.observers=[],le(h,this,e.client),le(f,this,ie(h,this).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,le(c,this,ho(this.options)),this.state=null!==(t=e.state)&&void 0!==t?t:ie(c,this),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return ie(u,this)}get promise(){var e;return null===(e=ie(p,this))||void 0===e?void 0:e.promise}setOptions(e){if(this.options={...ie(g,this),...e},null!=e&&e._type&&le(u,this,e._type),this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=ho(this.options);void 0!==e.data&&(this.setState(fo(e.data,e.dataUpdatedAt)),le(c,this,e))}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||ie(f,this).remove(this)}setData(e,t){const n=$r(this.state.data,e,this.options);return se(v,this,uo).call(this,{data:n,type:"success",dataUpdatedAt:null==t?void 0:t.updatedAt,manual:null==t?void 0:t.manual}),n}setState(e){se(v,this,uo).call(this,{type:"setState",state:e})}cancel(e){var t,n;const r=null===(t=ie(p,this))||void 0===t?void 0:t.promise;return null===(n=ie(p,this))||void 0===n||n.cancel(e),r?r.then(Cr).catch(Cr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return ie(c,this)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==kr(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Hr||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===Rr(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!Ir(this.state.dataUpdatedAt,e))}onFocus(){var e;const t=this.observers.find(e=>e.shouldFetchOnWindowFocus());null==t||t.refetch({cancelRefetch:!1}),null===(e=ie(p,this))||void 0===e||e.continue()}onOnline(){var e;const t=this.observers.find(e=>e.shouldFetchOnReconnect());null==t||t.refetch({cancelRefetch:!1}),null===(e=ie(p,this))||void 0===e||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),ie(f,this).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(ie(p,this)&&(ie(m,this)||se(v,this,ao).call(this)?ie(p,this).cancel({revert:!0}):ie(p,this).cancelRetry()),this.scheduleGc()),ie(f,this).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||se(v,this,uo).call(this,{type:"invalidate"})}async fetch(e,t){var n,r;if("idle"!==this.state.fetchStatus&&"rejected"!==(null===(n=ie(p,this))||void 0===n?void 0:n.status()))if(void 0!==this.state.data&&null!=t&&t.cancelRefetch)this.cancel({silent:!0});else if(ie(p,this))return ie(p,this).continueRetry(),ie(p,this).promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const o=new AbortController,i=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(le(m,this,!0),o.signal)})},l=()=>{const e=Br(this.options,t),n=(()=>{const e={client:ie(h,this),queryKey:this.queryKey,meta:this.meta};return i(e),e})();return le(m,this,!1),this.options.persister?this.options.persister(e,n,this):e(n)},s=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:ie(h,this),state:this.state,fetchFn:l};return i(e),e})(),a="infinite"===ie(u,this)?no(this.options.pages):this.options.behavior;var c;null==a||a.onFetch(s,this),le(d,this,this.state),("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null===(r=s.fetchOptions)||void 0===r?void 0:r.meta))&&se(v,this,uo).call(this,{type:"fetch",meta:null===(c=s.fetchOptions)||void 0===c?void 0:c.meta}),le(p,this,eo({initialPromise:null==t?void 0:t.initialPromise,fn:s.fetchFn,onCancel:e=>{e instanceof Qr&&e.revert&&this.setState({...ie(d,this),fetchStatus:"idle"}),o.abort()},onFail:(e,t)=>{se(v,this,uo).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{se(v,this,uo).call(this,{type:"pause"})},onContinue:()=>{se(v,this,uo).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}));try{var g,y,b,w;const e=await ie(p,this).start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),null===(g=(y=ie(f,this).config).onSuccess)||void 0===g||g.call(y,e,this),null===(b=(w=ie(f,this).config).onSettled)||void 0===b||b.call(w,e,this.state.error,this),e}catch(e){var _,S,x,C;if(e instanceof Qr){if(e.silent)return ie(p,this).promise;if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw se(v,this,uo).call(this,{type:"error",error:e}),null===(_=(S=ie(f,this).config).onError)||void 0===_||_.call(S,e,this),null===(x=(C=ie(f,this).config).onSettled)||void 0===x||x.call(C,this.state.data,e,this),e}finally{this.scheduleGc()}}});function ao(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}function uo(e){this.state=(t=>{var n;switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...co(t.data,this.options),fetchMeta:null!==(n=e.meta)&&void 0!==n?n:null};case"success":const r={...t,...fo(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return le(d,this,e.manual?r:void 0),r;case"error":const o=e.error;return{...t,error:o,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),Kr.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),ie(f,this).notify({query:this,type:"updated",action:e})})}function co(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Yr(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function fo(e,t){return{data:e,dataUpdatedAt:null!=t?t:Date.now(),error:null,isInvalidated:!1,status:"success"}}function ho(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?null!=r?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var po=(y=new WeakMap,b=new WeakMap,w=new WeakMap,_=new WeakMap,S=new WeakMap,x=new WeakMap,C=new WeakMap,E=new WeakMap,I=new WeakMap,R=new WeakMap,k=new WeakMap,P=new WeakMap,O=new WeakMap,M=new WeakMap,T=new WeakMap,A=new WeakSet,class extends br{constructor(e,t){super(),ne(this,A),re(this,y,void 0),re(this,b,void 0),re(this,w,void 0),re(this,_,void 0),re(this,S,void 0),re(this,x,void 0),re(this,C,void 0),re(this,E,void 0),re(this,I,void 0),re(this,R,void 0),re(this,k,void 0),re(this,P,void 0),re(this,O,void 0),re(this,M,void 0),re(this,T,new Set),this.options=t,le(y,this,e),le(E,this,null),le(C,this,Gr()),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(ie(b,this).addObserver(this),Co(ie(b,this),this.options)?se(A,this,go).call(this):this.updateResult(),se(A,this,bo).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Eo(ie(b,this),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Eo(ie(b,this),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,se(A,this,wo).call(this),se(A,this,_o).call(this),ie(b,this).removeObserver(this)}setOptions(e){const t=this.options,n=ie(b,this);if(this.options=ie(y,this).defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof kr(this.options.enabled,ie(b,this)))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");se(A,this,So).call(this),ie(b,this).setOptions(this.options),t._defaulted&&!zr(this.options,t)&&ie(y,this).getQueryCache().notify({type:"observerOptionsUpdated",query:ie(b,this),observer:this});const r=this.hasListeners();r&&Io(ie(b,this),n,this.options,t)&&se(A,this,go).call(this),this.updateResult(),!r||ie(b,this)===n&&kr(this.options.enabled,ie(b,this))===kr(t.enabled,ie(b,this))&&Rr(this.options.staleTime,ie(b,this))===Rr(t.staleTime,ie(b,this))||se(A,this,mo).call(this);const o=se(A,this,vo).call(this);!r||ie(b,this)===n&&kr(this.options.enabled,ie(b,this))===kr(t.enabled,ie(b,this))&&o===ie(M,this)||se(A,this,yo).call(this,o)}getOptimisticResult(e){const t=ie(y,this).getQueryCache().build(ie(y,this),e),n=this.createResult(t,e);return r=n,!zr(this.getCurrentResult(),r)&&(le(_,this,n),le(x,this,this.options),le(S,this,ie(b,this).state)),n;var r}getCurrentResult(){return ie(_,this)}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),null==t||t(n),"promise"===n&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==ie(C,this).status||ie(C,this).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,n))})}trackProp(e){ie(T,this).add(e)}getCurrentQuery(){return ie(b,this)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=ie(y,this).defaultQueryOptions(e),n=ie(y,this).getQueryCache().build(ie(y,this),t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){var t;return se(A,this,go).call(this,{...e,cancelRefetch:null===(t=e.cancelRefetch)||void 0===t||t}).then(()=>(this.updateResult(),ie(_,this)))}createResult(e,t){const n=ie(b,this),r=this.options,o=ie(_,this),i=ie(S,this),l=ie(x,this),s=e!==n?e.state:ie(w,this),{state:a}=e;let u,c={...a},d=!1;if(t._optimisticResults){const o=this.hasListeners(),i=!o&&Co(e,t),l=o&&Io(e,n,t,r);(i||l)&&(c={...c,...co(a.data,e.options)}),"isRestoring"===t._optimisticResults&&(c.fetchStatus="idle")}let{error:f,errorUpdatedAt:h,status:p}=c;u=c.data;let g=!1;if(void 0!==t.placeholderData&&void 0===u&&"pending"===p){let e;var m;null!=o&&o.isPlaceholderData&&t.placeholderData===(null==l?void 0:l.placeholderData)?(e=o.data,g=!0):e="function"==typeof t.placeholderData?t.placeholderData(null===(m=ie(k,this))||void 0===m?void 0:m.state.data,ie(k,this)):t.placeholderData,void 0!==e&&(p="success",u=$r(null==o?void 0:o.data,e,t),d=!0)}if(t.select&&void 0!==u&&!g)if(o&&u===(null==i?void 0:i.data)&&t.select===ie(I,this))u=ie(R,this);else try{le(I,this,t.select),u=t.select(u),u=$r(null==o?void 0:o.data,u,t),le(R,this,u),le(E,this,null)}catch(e){le(E,this,e)}ie(E,this)&&(f=ie(E,this),u=ie(R,this),h=Date.now(),p="error");const v="fetching"===c.fetchStatus,y="pending"===p,P="error"===p,O=y&&v,M=void 0!==u,T={status:p,fetchStatus:c.fetchStatus,isPending:y,isSuccess:"success"===p,isError:P,isInitialLoading:O,isLoading:O,data:u,dataUpdatedAt:c.dataUpdatedAt,error:f,errorUpdatedAt:h,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:c.dataUpdateCount>s.dataUpdateCount||c.errorUpdateCount>s.errorUpdateCount,isFetching:v,isRefetching:v&&!y,isLoadingError:P&&!M,isPaused:"paused"===c.fetchStatus,isPlaceholderData:d,isRefetchError:P&&M,isStale:Ro(e,t),refetch:this.refetch,promise:ie(C,this),isEnabled:!1!==kr(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==T.data,r="error"===T.status&&!t,o=e=>{r?e.reject(T.error):t&&e.resolve(T.data)},i=()=>{const e=le(C,this,T.promise=Gr());o(e)},l=ie(C,this);switch(l.status){case"pending":e.queryHash===n.queryHash&&o(l);break;case"fulfilled":(r||T.data!==l.value)&&i();break;case"rejected":r&&T.error===l.reason||i()}}return T}updateResult(){const e=ie(_,this),t=this.createResult(ie(b,this),this.options);le(S,this,ie(b,this).state),le(x,this,this.options),void 0!==ie(S,this).data&&le(k,this,ie(b,this)),zr(t,e)||(le(_,this,t),se(A,this,xo).call(this,{listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,n="function"==typeof t?t():t;if("all"===n||!n&&!ie(T,this).size)return!0;const r=new Set(null!=n?n:ie(T,this));return this.options.throwOnError&&r.add("error"),Object.keys(ie(_,this)).some(t=>{const n=t;return ie(_,this)[n]!==e[n]&&r.has(n)})})()}))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&se(A,this,bo).call(this)}});function go(e){se(A,this,So).call(this);let t=ie(b,this).fetch(this.options,e);return null!=e&&e.throwOnError||(t=t.catch(Cr)),t}function mo(){se(A,this,wo).call(this);const e=Rr(this.options.staleTime,ie(b,this));if(qr.isServer()||ie(_,this).isStale||!Er(e))return;const t=Ir(ie(_,this).dataUpdatedAt,e)+1;le(P,this,Sr.setTimeout(()=>{ie(_,this).isStale||this.updateResult()},t))}function vo(){var e;return null!==(e="function"==typeof this.options.refetchInterval?this.options.refetchInterval(ie(b,this)):this.options.refetchInterval)&&void 0!==e&&e}function yo(e){se(A,this,_o).call(this),le(M,this,e),!qr.isServer()&&!1!==kr(this.options.enabled,ie(b,this))&&Er(ie(M,this))&&0!==ie(M,this)&&le(O,this,Sr.setInterval(()=>{(this.options.refetchIntervalInBackground||wr.isFocused())&&se(A,this,go).call(this)},ie(M,this)))}function bo(){se(A,this,mo).call(this),se(A,this,yo).call(this,se(A,this,vo).call(this))}function wo(){void 0!==ie(P,this)&&(Sr.clearTimeout(ie(P,this)),le(P,this,void 0))}function _o(){void 0!==ie(O,this)&&(Sr.clearInterval(ie(O,this)),le(O,this,void 0))}function So(){const e=ie(y,this).getQueryCache().build(ie(y,this),this.options);if(e===ie(b,this))return;const t=ie(b,this);le(b,this,e),le(w,this,e.state),this.hasListeners()&&(null==t||t.removeObserver(this),e.addObserver(this))}function xo(e){Kr.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(ie(_,this))}),ie(y,this).getQueryCache().notify({query:ie(b,this),type:"observerResultsUpdated"})})}function Co(e,t){return function(e,t){return!1!==kr(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===kr(t.retryOnMount,e))}(e,t)||void 0!==e.state.data&&Eo(e,t,t.refetchOnMount)}function Eo(e,t,n){if(!1!==kr(t.enabled,e)&&"static"!==Rr(t.staleTime,e)){const r="function"==typeof n?n(e):n;return"always"===r||!1!==r&&Ro(e,t)}return!1}function Io(e,t,n,r){return(e!==t||!1===kr(r.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&Ro(e,n)}function Ro(e,t){return!1!==kr(t.enabled,e)&&e.isStaleByTime(Rr(t.staleTime,e))}var ko=class extends po{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var n;const{state:r}=e,o=super.createResult(e,t),{isFetching:i,isRefetching:l,isError:s,isRefetchError:a}=o,u=null===(n=r.fetchMeta)||void 0===n||null===(n=n.fetchMore)||void 0===n?void 0:n.direction,c=s&&"forward"===u,d=i&&"forward"===u,f=s&&"backward"===u,h=i&&"backward"===u;return{...o,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:io(t,r.data),hasPreviousPage:lo(t,r.data),isFetchNextPageError:c,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:h,isRefetchError:a&&!c&&!f,isRefetching:l&&!d&&!h}}},Po=(F=new WeakMap,N=new WeakMap,z=new WeakMap,D=new WeakMap,L=new WeakSet,class extends to{constructor(e){super(),ne(this,L),re(this,F,void 0),re(this,N,void 0),re(this,z,void 0),re(this,D,void 0),le(F,this,e.client),this.mutationId=e.mutationId,le(z,this,e.mutationCache),le(N,this,[]),this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){ie(N,this).includes(e)||(ie(N,this).push(e),this.clearGcTimeout(),ie(z,this).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){le(N,this,ie(N,this).filter(t=>t!==e)),this.scheduleGc(),ie(z,this).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){ie(N,this).length||("pending"===this.state.status?this.scheduleGc():ie(z,this).remove(this))}continue(){var e,t;return null!==(e=null===(t=ie(D,this))||void 0===t?void 0:t.continue())&&void 0!==e?e:this.execute(this.state.variables)}async execute(e){var t;const n=()=>{se(L,this,Oo).call(this,{type:"continue"})},r={client:ie(F,this),meta:this.options.meta,mutationKey:this.options.mutationKey};le(D,this,eo({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{se(L,this,Oo).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{se(L,this,Oo).call(this,{type:"pause"})},onContinue:n,retry:null!==(t=this.options.retry)&&void 0!==t?t:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ie(z,this).canRun(this)}));const o="pending"===this.state.status,i=!ie(D,this).canStart();try{var l,s,a,u,c,d,f,h;if(o)n();else{var p,g;se(L,this,Oo).call(this,{type:"pending",variables:e,isPaused:i}),ie(z,this).config.onMutate&&await ie(z,this).config.onMutate(e,this,r);const t=await(null===(p=(g=this.options).onMutate)||void 0===p?void 0:p.call(g,e,r));t!==this.state.context&&se(L,this,Oo).call(this,{type:"pending",context:t,variables:e,isPaused:i})}const t=await ie(D,this).start();return await(null===(l=(s=ie(z,this).config).onSuccess)||void 0===l?void 0:l.call(s,t,e,this.state.context,this,r)),await(null===(a=(u=this.options).onSuccess)||void 0===a?void 0:a.call(u,t,e,this.state.context,r)),await(null===(c=(d=ie(z,this).config).onSettled)||void 0===c?void 0:c.call(d,t,null,this.state.variables,this.state.context,this,r)),await(null===(f=(h=this.options).onSettled)||void 0===f?void 0:f.call(h,t,null,e,this.state.context,r)),se(L,this,Oo).call(this,{type:"success",data:t}),t}catch(t){try{var m,v;await(null===(m=(v=ie(z,this).config).onError)||void 0===m?void 0:m.call(v,t,e,this.state.context,this,r))}catch(e){Promise.reject(e)}try{var y,b;await(null===(y=(b=this.options).onError)||void 0===y?void 0:y.call(b,t,e,this.state.context,r))}catch(e){Promise.reject(e)}try{var w,_;await(null===(w=(_=ie(z,this).config).onSettled)||void 0===w?void 0:w.call(_,void 0,t,this.state.variables,this.state.context,this,r))}catch(e){Promise.reject(e)}try{var S,x;await(null===(S=(x=this.options).onSettled)||void 0===S?void 0:S.call(x,void 0,t,e,this.state.context,r))}catch(e){Promise.reject(e)}throw se(L,this,Oo).call(this,{type:"error",error:t}),t}finally{ie(z,this).runNext(this)}}});function Oo(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),Kr.batch(()=>{ie(N,this).forEach(t=>{t.onMutationUpdate(e)}),ie(z,this).notify({mutation:this,type:"updated",action:e})})}var Mo=(V=new WeakMap,$=new WeakMap,j=new WeakMap,class extends br{constructor(e={}){super(),re(this,V,void 0),re(this,$,void 0),re(this,j,void 0),this.config=e,le(V,this,new Set),le($,this,new Map),le(j,this,0)}build(e,t,n){var r;const o=new Po({client:e,mutationCache:this,mutationId:le(j,this,(r=ie(j,this),++r)),options:e.defaultMutationOptions(t),state:n});return this.add(o),o}add(e){ie(V,this).add(e);const t=To(e);if("string"==typeof t){const n=ie($,this).get(t);n?n.push(e):ie($,this).set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(ie(V,this).delete(e)){const t=To(e);if("string"==typeof t){const n=ie($,this).get(t);if(n)if(n.length>1){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}else n[0]===e&&ie($,this).delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=To(e);if("string"==typeof t){const n=ie($,this).get(t),r=null==n?void 0:n.find(e=>"pending"===e.state.status);return!r||r===e}return!0}runNext(e){const t=To(e);if("string"==typeof t){var n,r;const o=null===(n=ie($,this).get(t))||void 0===n?void 0:n.find(t=>t!==e&&t.state.isPaused);return null!==(r=null==o?void 0:o.continue())&&void 0!==r?r:Promise.resolve()}return Promise.resolve()}clear(){Kr.batch(()=>{ie(V,this).forEach(e=>{this.notify({type:"removed",mutation:e})}),ie(V,this).clear(),ie($,this).clear()})}getAll(){return Array.from(ie(V,this))}find(e){const t={exact:!0,...e};return this.getAll().find(e=>Or(t,e))}findAll(e={}){return this.getAll().filter(t=>Or(e,t))}notify(e){Kr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(e=>e.state.isPaused);return Kr.batch(()=>Promise.all(e.map(e=>e.continue().catch(Cr))))}});function To(e){var t;return null===(t=e.options.scope)||void 0===t?void 0:t.id}var Ao=(W=new WeakMap,class extends br{constructor(e={}){super(),re(this,W,void 0),this.config=e,le(W,this,new Map)}build(e,t,n){var r;const o=t.queryKey,i=null!==(r=t.queryHash)&&void 0!==r?r:Mr(o,t);let l=this.get(i);return l||(l=new so({client:e,queryKey:o,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(o)}),this.add(l)),l}add(e){ie(W,this).has(e.queryHash)||(ie(W,this).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=ie(W,this).get(e.queryHash);t&&(e.destroy(),t===e&&ie(W,this).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Kr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return ie(W,this).get(e)}getAll(){return[...ie(W,this).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(e=>Pr(t,e))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Pr(e,t)):t}notify(e){Kr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Kr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Kr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}}),Fo=(H=new WeakMap,B=new WeakMap,U=new WeakMap,q=new WeakMap,G=new WeakMap,Z=new WeakMap,K=new WeakMap,J=new WeakMap,class{constructor(e={}){re(this,H,void 0),re(this,B,void 0),re(this,U,void 0),re(this,q,void 0),re(this,G,void 0),re(this,Z,void 0),re(this,K,void 0),re(this,J,void 0),le(H,this,e.queryCache||new Ao),le(B,this,e.mutationCache||new Mo),le(U,this,e.defaultOptions||{}),le(q,this,new Map),le(G,this,new Map),le(Z,this,0)}mount(){var e;le(Z,this,(e=ie(Z,this),++e)),1===ie(Z,this)&&(le(K,this,wr.subscribe(async e=>{e&&(await this.resumePausedMutations(),ie(H,this).onFocus())})),le(J,this,Jr.subscribe(async e=>{e&&(await this.resumePausedMutations(),ie(H,this).onOnline())})))}unmount(){var e,t,n;le(Z,this,(e=ie(Z,this),--e)),0===ie(Z,this)&&(null===(t=ie(K,this))||void 0===t||t.call(this),le(K,this,void 0),null===(n=ie(J,this))||void 0===n||n.call(this),le(J,this,void 0))}isFetching(e){return ie(H,this).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ie(B,this).findAll({...e,status:"pending"}).length}getQueryData(e){var t;const n=this.defaultQueryOptions({queryKey:e});return null===(t=ie(H,this).get(n.queryHash))||void 0===t?void 0:t.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=ie(H,this).build(this,t),r=n.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Rr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return ie(H,this).findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=ie(H,this).get(r.queryHash),i=function(e,t){return"function"==typeof e?e(t):e}(t,null==o?void 0:o.state.data);if(void 0!==i)return ie(H,this).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Kr.batch(()=>ie(H,this).findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){var t;const n=this.defaultQueryOptions({queryKey:e});return null===(t=ie(H,this).get(n.queryHash))||void 0===t?void 0:t.state}removeQueries(e){const t=ie(H,this);Kr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){const n=ie(H,this);return Kr.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Kr.batch(()=>ie(H,this).findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Cr).catch(Cr)}invalidateQueries(e,t={}){return Kr.batch(()=>{var n,r;return ie(H,this).findAll(e).forEach(e=>{e.invalidate()}),"none"===(null==e?void 0:e.refetchType)?Promise.resolve():this.refetchQueries({...e,type:null!==(n=null!==(r=null==e?void 0:e.refetchType)&&void 0!==r?r:null==e?void 0:e.type)&&void 0!==n?n:"active"},t)})}refetchQueries(e,t={}){var n;const r={...t,cancelRefetch:null===(n=t.cancelRefetch)||void 0===n||n},o=Kr.batch(()=>ie(H,this).findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(Cr)),"paused"===e.state.fetchStatus?Promise.resolve():t}));return Promise.all(o).then(Cr)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const n=ie(H,this).build(this,t);return n.isStaleByTime(Rr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Cr).catch(Cr)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Cr).catch(Cr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Jr.isOnline()?ie(B,this).resumePausedMutations():Promise.resolve()}getQueryCache(){return ie(H,this)}getMutationCache(){return ie(B,this)}getDefaultOptions(){return ie(U,this)}setDefaultOptions(e){le(U,this,e)}setQueryDefaults(e,t){ie(q,this).set(Tr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ie(q,this).values()],n={};return t.forEach(t=>{Ar(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){ie(G,this).set(Tr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ie(G,this).values()],n={};return t.forEach(t=>{Ar(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ie(U,this).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Mr(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Hr&&(t.enabled=!1),t}defaultMutationOptions(e){return null!=e&&e._defaulted?e:{...ie(U,this).mutations,...(null==e?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ie(H,this).clear(),ie(B,this).clear()}});function No(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch(e){}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var zo=No(Dn),Do=/["&<]/;function Lo(e){if(0===e.length||!1===Do.test(e))return e;for(var t=0,n=0,r="",o="";n<e.length;n++){switch(e.charCodeAt(n)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 60:o="&lt;";break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=o,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var Vo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,$o=0,jo=Array.isArray;function Wo(e,t,n,r,o,i){t||(t={});var l,s,a=t;if("ref"in a)for(s in a={},t)"ref"==s?l=t[s]:a[s]=t[s];var u={type:e,props:a,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--$o,__i:-1,__u:0,__source:o,__self:i};if("function"==typeof e&&(l=e.defaultProps))for(s in l)void 0===a[s]&&(a[s]=l[s]);return ue.vnode&&ue.vnode(u),u}var Ho,Bo,Uo={},qo=/[A-Z]/g,Go=Object.freeze({__proto__:null,Fragment:Ae,jsx:Wo,jsxAttr:function(e,t){if(ue.attr){var n=ue.attr(e,t);if("string"==typeof n)return n}if(t=function(e){return null!==e&&"object"==typeof e&&"function"==typeof e.valueOf?e.valueOf():e}(t),"ref"===e||"key"===e)return"";if("style"===e&&"object"==typeof t){var r="";for(var o in t){var i=t[o];if(null!=i&&""!==i){var l="-"==o[0]?o:Uo[o]||(Uo[o]=o.replace(qo,"-$&").toLowerCase()),s=";";"number"!=typeof i||l.startsWith("--")||Vo.test(l)||(s="px;"),r=r+l+":"+i+s}}return e+'="'+Lo(r)+'"'}return null==t||!1===t||"function"==typeof t||"object"==typeof t?"":!0===t?e:e+'="'+Lo(""+t)+'"'},jsxDEV:Wo,jsxEscape:function e(t){if(null==t||"boolean"==typeof t||"function"==typeof t)return null;if("object"==typeof t){if(void 0===t.constructor)return t;if(jo(t)){for(var n=0;n<t.length;n++)t[n]=e(t[n]);return t}}return Lo(""+t)},jsxTemplate:function(e){var t=Wo(Ae,{tpl:e,exprs:[].slice.call(arguments,1)});return t.key=t.__v,t},jsxs:Wo}),Zo=Bo?Ho:(Bo=1,Ho=No(Go)),Ko=rt(void 0),Jo=e=>{const t=It(Ko);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Xo=({client:e,children:t})=>(wt(()=>(e.mount(),()=>{e.unmount()}),[e]),Zo.jsx(Ko.Provider,{value:e,children:t})),Yo=rt(!1);Yo.Provider;var Qo=rt(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),ei=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ti(e,t,n){var r,o,i,l;const s=It(Yo),a=It(Qo),u=Jo(),c=u.defaultQueryOptions(e);null===(r=u.getDefaultOptions().queries)||void 0===r||null===(o=r._experimental_beforeQuery)||void 0===o||o.call(r,c);const d=u.getQueryCache().get(c.queryHash),f=!1!==e.subscribed;c._optimisticResults=s?"isRestoring":f?"optimistic":void 0,(e=>{if(e.suspense){const t=1e3,n=e=>"static"===e?e:Math.max(null!=e?e:t,t),r=e.staleTime;e.staleTime="function"==typeof r?(...e)=>n(r(...e)):n(r),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(c),((e,t,n)=>{const r=null!=n&&n.state.error&&"function"==typeof e.throwOnError?Ur(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))})(c,a,d),(e=>{wt(()=>{e.clearReset()},[e])})(a);const h=!u.getQueryCache().get(c.queryHash),[p]=yt(()=>new t(u,c)),g=p.getOptimisticResult(c),m=!s&&f;if(Lt(Et(e=>{const t=m?p.subscribe(Kr.batchCalls(e)):Cr;return p.updateResult(),t},[p,m]),()=>p.getCurrentResult()),wt(()=>{p.setOptions(c)},[c,p]),((e,t)=>(null==e?void 0:e.suspense)&&t.isPending)(c,g))throw ei(c,p,a);if((({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&void 0===e.data||Ur(n,[e.error,r])))({result:g,errorResetBoundary:a,throwOnError:c.throwOnError,query:d,suspense:c.suspense}))throw g.error;if(null===(i=u.getDefaultOptions().queries)||void 0===i||null===(l=i._experimental_afterQuery)||void 0===l||l.call(i,c,g),c.experimental_prefetchInRender&&!qr.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(g,s)){const e=h?ei(c,p,a):null==d?void 0:d.promise;null==e||e.catch(Cr).finally(()=>{p.updateResult()})}return c.notifyOnChangeProps?g:p.trackResult(g)}function ni(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=ni(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ri(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=ni(e))&&(r&&(r+=" "),r+=t);return r}const oi={show:"Show",perPage:"per page",all:"All",showingRangeOfTotal:({start:e,end:t,total:n})=>`Showing ${e}-${t} of ${n}`,showingRangeToTotal:({start:e,end:t,total:n})=>`Showing ${e} to ${t} of ${n}`,itemsPerPageOption:({count:e})=>`${e} / page`,firstPage:"First page",previousPage:"Previous page",page:({page:e})=>`Page ${e}`,nextPage:"Next page",lastPage:"Last page",tableView:"Table view",gridView:"Grid view",selectAll:"Select all",resetFilters:"Reset Filters",reset:"Reset",searchPlaceholder:"Search...",searchTableData:"Search table data",clearSearch:"Clear search",selectFilter:({filterName:e})=>`Select ${e}`,clearSelection:"Clear selection",clearAllSelections:"Clear all selections",searchFilter:({filterName:e})=>`Search ${e}`,searchFilterPlaceholder:({filterName:e})=>`Search ${e}...`,noResultsFound:"No results found",activeSearch:({query:e})=>`Search: ${e}`,removeActiveItem:({label:e})=>`Remove ${e}`,filterBy:({filterName:e})=>`Filter by ${e}`,clear:"Clear",sort:"Sort",sortByColumn:({columnName:e})=>`Sort by ${e}`,columnOptionsFor:({columnName:e})=>`Column options for ${e}`,sortAscending:"Sort ascending",sortDescending:"Sort descending",switchToPrimarySort:"Switch to primary sort",switchToSecondarySort:"Switch to secondary sort",setAsPrimarySort:"Set as primary sort",setAsSecondarySort:"Set as secondary sort",replacePrimarySort:({columnName:e})=>`Replace ${e} as primary sort`,replaceSecondarySort:({columnName:e})=>`Replace ${e} as secondary sort`,loadingMore:"Loading more...",loadingMoreItems:"Loading more items...",noMoreItemsToLoad:"No more items to load",allItemsLoaded:"All items loaded",noDataAvailable:"No data available",noItemsFound:"No items found",adjustFiltersOrSearch:"Try adjusting your filters or search criteria",details:"Details",close:"Close",additionalRowDetails:"Additional row details",expandRowDetails:"Expand row details",collapseRowDetails:"Collapse row details",openLightboxFor:({label:e})=>`Open lightbox for ${e}`,image:"image",filterByTerm:({term:e})=>`Filter by ${e}`},ii=rt({displayMode:"table",i18n:oi}),li=ii.Provider,si=()=>It(ii),ai=rt({selectedItems:new Map,selectItem:()=>{},deselectItem:()=>{},selectAll:()=>{},deselectAll:()=>{},containerRef:null,selectedCount:0,isActionLoading:!1}),ui=ai.Provider;var ci;function di(e,t,n){var r;function o(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);const o=s.prototype,i=Object.keys(o);for(let e=0;e<i.length;e++){const t=i[e];t in n||(n[t]=o[t].bind(n))}}const i=null!==(r=null==n?void 0:n.Parent)&&void 0!==r?r:Object;class l extends i{}function s(e){var t,r;const i=null!=n&&n.Parent?new l:this;o(i,e),null!==(t=(r=i._zod).deferred)&&void 0!==t||(r.deferred=[]);for(const e of i._zod.deferred)e();return i}return Object.defineProperty(l,"name",{value:e}),Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>{var r;return!!(null!=n&&n.Parent&&t instanceof n.Parent)||(null==t||null===(r=t._zod)||void 0===r||null===(r=r.traits)||void 0===r?void 0:r.has(e))}}),Object.defineProperty(s,"name",{value:e}),s}class fi extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class hi extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}null!==(X=(ci=globalThis).__zod_globalConfig)&&void 0!==X||(ci.__zod_globalConfig={});const pi=globalThis.__zod_globalConfig;function gi(e){return pi}function mi(e){const t=Object.values(e).filter(e=>"number"==typeof e),n=Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t);return n}function vi(e,t){return"bigint"==typeof t?t.toString():t}function yi(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function bi(e){return null==e}function wi(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const _i=Symbol("evaluating");function Si(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==_i)return void 0===r&&(r=_i,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function xi(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ci(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ei(e){return JSON.stringify(e)}const Ii="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ri(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const ki=yi(()=>{var e;if(pi.jitless)return!1;if("undefined"!=typeof navigator&&null!==(e=navigator)&&void 0!==e&&null!==(e=e.userAgent)&&void 0!==e&&e.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Pi(e){if(!1===Ri(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==Ri(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Oi(e){return Pi(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Mi=new Set(["string","number","symbol"]);function Ti(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ai(e,t,n){const r=new e._zod.constr(null!=t?t:e._zod.def);return(!t||null!=n&&n.parent)&&(r._zod.parent=e),r}function Fi(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==(null==t?void 0:t.message)){if(void 0!==(null==t?void 0:t.error))throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const Ni={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function zi(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++){var n;if(!0!==(null===(n=e.issues[r])||void 0===n?void 0:n.continue))return!0}return!1}function Di(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++){var n;if(!1===(null===(n=e.issues[r])||void 0===n?void 0:n.continue))return!0}return!1}function Li(e,t){return t.map(t=>{var n,r;return null!==(n=(r=t).path)&&void 0!==n||(r.path=[]),t.path.unshift(e),t})}function Vi(e){return"string"==typeof e?e:null==e?void 0:e.message}function $i(e,t,n){var r,o,i,l,s,a,u,c,d,f;const h=e.message?e.message:null!==(r=null!==(o=null!==(i=null!==(l=Vi(null===(s=e.inst)||void 0===s||null===(s=s._zod.def)||void 0===s||null===(a=s.error)||void 0===a?void 0:a.call(s,e)))&&void 0!==l?l:Vi(null==t||null===(u=t.error)||void 0===u?void 0:u.call(t,e)))&&void 0!==i?i:Vi(null===(c=n.customError)||void 0===c?void 0:c.call(n,e)))&&void 0!==o?o:Vi(null===(d=n.localeError)||void 0===d?void 0:d.call(n,e)))&&void 0!==r?r:"Invalid input",{inst:p,continue:g,input:m,...v}=e;return null!==(f=v.path)&&void 0!==f||(v.path=[]),v.message=h,null!=t&&t.reportInput&&(v.input=m),v}function ji(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Wi(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const Hi=(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,vi,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Bi=di("$ZodError",Hi),Ui=di("$ZodError",Hi,{Parent:Error}),qi=e=>(t,n,r,o)=>{const i=r?{...r,async:!1}:{async:!1},l=t._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw new fi;if(l.issues.length){var s;const t=new(null!==(s=null==o?void 0:o.Err)&&void 0!==s?s:e)(l.issues.map(e=>$i(e,i,gi())));throw Ii(t,null==o?void 0:o.callee),t}return l.value},Gi=e=>async(t,n,r,o)=>{const i=r?{...r,async:!0}:{async:!0};let l=t._zod.run({value:n,issues:[]},i);if(l instanceof Promise&&(l=await l),l.issues.length){var s;const t=new(null!==(s=null==o?void 0:o.Err)&&void 0!==s?s:e)(l.issues.map(e=>$i(e,i,gi())));throw Ii(t,null==o?void 0:o.callee),t}return l.value},Zi=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new fi;return i.issues.length?{success:!1,error:new(null!=e?e:Bi)(i.issues.map(e=>$i(e,o,gi())))}:{success:!0,data:i.value}},Ki=Zi(Ui),Ji=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>$i(e,o,gi())))}:{success:!0,data:i.value}},Xi=Ji(Ui),Yi=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return qi(e)(t,n,o)},Qi=e=>(t,n,r)=>qi(e)(t,n,r),el=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Gi(e)(t,n,o)},tl=e=>async(t,n,r)=>Gi(e)(t,n,r),nl=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Zi(e)(t,n,o)},rl=e=>(t,n,r)=>Zi(e)(t,n,r),ol=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Ji(e)(t,n,o)},il=e=>async(t,n,r)=>Ji(e)(t,n,r),ll=/^[cC][0-9a-z]{6,}$/,sl=/^[0-9a-z]+$/,al=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ul=/^[0-9a-vA-V]{20}$/,cl=/^[A-Za-z0-9]{27}$/,dl=/^[a-zA-Z0-9_-]{21}$/,fl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,hl=/^([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})$/,pl=e=>e?new 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)$/,gl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ml=/^(?:(?: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])$/,vl=/^(([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}|:))$/,yl=/^((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])$/,bl=/^(([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])$/,wl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_l=/^[A-Za-z0-9_-]*$/,Sl=/^https?$/,xl=/^\+[1-9]\d{6,14}$/,Cl="(?:(?:\\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])))",El=new RegExp(`^${Cl}$`);function Il(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const Rl=/^-?\d+$/,kl=/^-?\d+(?:\.\d+)?$/,Pl=/^(?:true|false)$/i,Ol=/^[^A-Z]*$/,Ml=/^[^a-z]*$/,Tl=di("$ZodCheck",(e,t)=>{var n,r,o;null!==(n=e._zod)&&void 0!==n||(e._zod={}),e._zod.def=t,null!==(r=(o=e._zod).onattach)&&void 0!==r||(o.onattach=[])}),Al={number:"number",bigint:"bigint",object:"date"},Fl=di("$ZodCheckLessThan",(e,t)=>{Tl.init(e,t);const n=Al[typeof t.value];e._zod.onattach.push(e=>{var n;const r=e._zod.bag,o=null!==(n=t.inclusive?r.maximum:r.exclusiveMaximum)&&void 0!==n?n:Number.POSITIVE_INFINITY;t.value<o&&(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:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Nl=di("$ZodCheckGreaterThan",(e,t)=>{Tl.init(e,t);const n=Al[typeof t.value];e._zod.onattach.push(e=>{var n;const r=e._zod.bag,o=null!==(n=t.inclusive?r.minimum:r.exclusiveMinimum)&&void 0!==n?n:Number.NEGATIVE_INFINITY;t.value>o&&(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:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zl=di("$ZodCheckMultipleOf",(e,t)=>{Tl.init(e,t),e._zod.onattach.push(e=>{var n,r;null!==(n=(r=e._zod.bag).multipleOf)&&void 0!==n||(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=e/t,r=Math.round(n),o=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Dl=di("$ZodCheckNumberFormat",(e,t)=>{var n;Tl.init(e,t),t.format=t.format||"float64";const r=null===(n=t.format)||void 0===n?void 0:n.includes("int"),o=r?"int":"number",[i,l]=Ni[t.format];e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,n.minimum=i,n.maximum=l,r&&(n.pattern=Rl)}),e._zod.check=n=>{const s=n.value;if(r){if(!Number.isInteger(s))return void n.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?n.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):n.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}))}s<i&&n.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>l&&n.issues.push({origin:"number",input:s,code:"too_big",maximum:l,inclusive:!0,inst:e,continue:!t.abort})}}),Ll=di("$ZodCheckMaxLength",(e,t)=>{var n,r;Tl.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=e=>{const t=e.value;return!bi(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{var n;const r=null!==(n=e._zod.bag.maximum)&&void 0!==n?n:Number.POSITIVE_INFINITY;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const o=ji(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Vl=di("$ZodCheckMinLength",(e,t)=>{var n,r;Tl.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=e=>{const t=e.value;return!bi(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{var n;const r=null!==(n=e._zod.bag.minimum)&&void 0!==n?n:Number.NEGATIVE_INFINITY;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const o=ji(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),$l=di("$ZodCheckLengthEquals",(e,t)=>{var n,r;Tl.init(e,t),null!==(n=(r=e._zod.def).when)&&void 0!==n||(r.when=e=>{const t=e.value;return!bi(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,o=r.length;if(o===t.length)return;const i=ji(r),l=o>t.length;n.issues.push({origin:i,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),jl=di("$ZodCheckStringFormat",(e,t)=>{var n,r,o,i;Tl.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;var r;n.format=t.format,t.pattern&&(null!==(r=n.patterns)&&void 0!==r||(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?null!==(n=(o=e._zod).check)&&void 0!==n||(o.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):null!==(r=(i=e._zod).check)&&void 0!==r||(i.check=()=>{})}),Wl=di("$ZodCheckRegex",(e,t)=>{jl.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})}}),Hl=di("$ZodCheckLowerCase",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Ol),jl.init(e,t)}),Bl=di("$ZodCheckUpperCase",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=Ml),jl.init(e,t)}),Ul=di("$ZodCheckIncludes",(e,t)=>{Tl.init(e,t);const n=Ti(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{var t;const n=e._zod.bag;null!==(t=n.patterns)&&void 0!==t||(n.patterns=new Set),n.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})}}),ql=di("$ZodCheckStartsWith",(e,t)=>{var n;Tl.init(e,t);const r=new RegExp(`^${Ti(t.prefix)}.*`);null!==(n=t.pattern)&&void 0!==n||(t.pattern=r),e._zod.onattach.push(e=>{var t;const n=e._zod.bag;null!==(t=n.patterns)&&void 0!==t||(n.patterns=new Set),n.patterns.add(r)}),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})}}),Gl=di("$ZodCheckEndsWith",(e,t)=>{var n;Tl.init(e,t);const r=new RegExp(`.*${Ti(t.suffix)}$`);null!==(n=t.pattern)&&void 0!==n||(t.pattern=r),e._zod.onattach.push(e=>{var t;const n=e._zod.bag;null!==(t=n.patterns)&&void 0!==t||(n.patterns=new Set),n.patterns.add(r)}),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})}}),Zl=di("$ZodCheckOverwrite",(e,t)=>{Tl.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Kl{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e)}compile(){var e;const t=Function,n=null==this?void 0:this.args,r=[...(null!==(e=null==this?void 0:this.content)&&void 0!==e?e:[""]).map(e=>`  ${e}`)];return new t(...n,r.join("\n"))}}const Jl={major:4,minor:4,patch:3},Xl=di("$ZodType",(e,t)=>{var n,r;null!=e||(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Jl;const o=[...null!==(n=e._zod.def.checks)&&void 0!==n?n:[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const t of o)for(const n of t._zod.onattach)n(e);if(0===o.length){var i,l;null!==(i=(r=e._zod).deferred)&&void 0!==i||(r.deferred=[]),null===(l=e._zod.deferred)||void 0===l||l.push(()=>{e._zod.run=e._zod.parse})}else{const t=(e,t,n)=>{let r,o=zi(e);for(const i of t){if(i._zod.def.when){if(Di(e))continue;if(!i._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,l=i._zod.check(e);if(l instanceof Promise&&!1===(null==n?void 0:n.async))throw new fi;if(r||l instanceof Promise)r=(null!=r?r:Promise.resolve()).then(async()=>{await l,e.issues.length!==t&&(o||(o=zi(e,t)))});else{if(e.issues.length===t)continue;o||(o=zi(e,t))}}return r?r.then(()=>e):e},n=(n,r,i)=>{if(zi(n))return n.aborted=!0,n;const l=t(r,o,i);if(l instanceof Promise){if(!1===i.async)throw new fi;return l.then(t=>e._zod.parse(t,i))}return e._zod.parse(l,i)};e._zod.run=(r,i)=>{if(i.skipChecks)return e._zod.parse(r,i);if("backward"===i.direction){const t=e._zod.parse({value:r.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,i)):n(t,r,i)}const l=e._zod.parse(r,i);if(l instanceof Promise){if(!1===i.async)throw new fi;return l.then(e=>t(e,o,i))}return t(l,o,i)}}Si(e,"~standard",()=>({validate:t=>{try{var n;const r=Ki(e,t);return r.success?{value:r.data}:{issues:null===(n=r.error)||void 0===n?void 0:n.issues}}catch(n){return Xi(e,t).then(e=>{var t;return e.success?{value:e.data}:{issues:null===(t=e.error)||void 0===t?void 0:t.issues}})}},vendor:"zod",version:1}))}),Yl=di("$ZodString",(e,t)=>{var n,r,o;Xl.init(e,t),e._zod.pattern=null!==(n=[...null!==(r=null==e||null===(o=e._zod.bag)||void 0===o?void 0:o.patterns)&&void 0!==r?r:[]].pop())&&void 0!==n?n:(e=>{var t,n;const r=e?`[\\s\\S]{${null!==(t=null==e?void 0:e.minimum)&&void 0!==t?t:0},${null!==(n=null==e?void 0:e.maximum)&&void 0!==n?n:""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)})(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ql=di("$ZodStringFormat",(e,t)=>{jl.init(e,t),Yl.init(e,t)}),es=di("$ZodGUID",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=hl),Ql.init(e,t)}),ts=di("$ZodUUID",(e,t)=>{var n;if(t.version){var r;const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);null!==(r=t.pattern)&&void 0!==r||(t.pattern=pl(e))}else null!==(n=t.pattern)&&void 0!==n||(t.pattern=pl());Ql.init(e,t)}),ns=di("$ZodEmail",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=gl),Ql.init(e,t)}),rs=di("$ZodURL",(e,t)=>{Ql.init(e,t),e._zod.check=n=>{try{var r;const o=n.value.trim();if(!t.normalize&&(null===(r=t.protocol)||void 0===r?void 0:r.source)===Sl.source&&!/^https?:\/\//i.test(o))return void n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});const i=new URL(o);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=i.href:n.value=o)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),os=di("$ZodEmoji",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Ql.init(e,t)}),is=di("$ZodNanoID",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=dl),Ql.init(e,t)}),ls=di("$ZodCUID",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=ll),Ql.init(e,t)}),ss=di("$ZodCUID2",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=sl),Ql.init(e,t)}),as=di("$ZodULID",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=al),Ql.init(e,t)}),us=di("$ZodXID",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=ul),Ql.init(e,t)}),cs=di("$ZodKSUID",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=cl),Ql.init(e,t)}),ds=di("$ZodISODateTime",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=function(e){const t=Il({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Cl}T(?:${r})$`)}(t)),Ql.init(e,t)}),fs=di("$ZodISODate",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=El),Ql.init(e,t)}),hs=di("$ZodISOTime",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=new RegExp(`^${Il(t)}$`)),Ql.init(e,t)}),ps=di("$ZodISODuration",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=fl),Ql.init(e,t)}),gs=di("$ZodIPv4",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=ml),Ql.init(e,t),e._zod.bag.format="ipv4"}),ms=di("$ZodIPv6",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=vl),Ql.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),vs=di("$ZodCIDRv4",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=yl),Ql.init(e,t)}),ys=di("$ZodCIDRv6",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=bl),Ql.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function bs(e){if(""===e)return!0;if(/\s/.test(e))return!1;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const ws=di("$ZodBase64",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=wl),Ql.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{bs(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),_s=di("$ZodBase64URL",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=_l),Ql.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!_l.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return bs(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Ss=di("$ZodE164",(e,t)=>{var n;null!==(n=t.pattern)&&void 0!==n||(t.pattern=xl),Ql.init(e,t)}),xs=di("$ZodJWT",(e,t)=>{Ql.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&"JWT"!==(null==o?void 0:o.typ)||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Cs=di("$ZodNumber",(e,t)=>{var n;Xl.init(e,t),e._zod.pattern=null!==(n=e._zod.bag.pattern)&&void 0!==n?n:kl,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),Es=di("$ZodNumberFormat",(e,t)=>{Dl.init(e,t),Cs.init(e,t)}),Is=di("$ZodBoolean",(e,t)=>{Xl.init(e,t),e._zod.pattern=Pl,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Rs=di("$ZodUnknown",(e,t)=>{Xl.init(e,t),e._zod.parse=e=>e}),ks=di("$ZodNever",(e,t)=>{Xl.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function Ps(e,t,n){e.issues.length&&t.issues.push(...Li(n,e.issues)),t.value[n]=e.value}const Os=di("$ZodArray",(e,t)=>{Xl.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let e=0;e<o.length;e++){const l=o[e],s=t.element._zod.run({value:l,issues:[]},r);s instanceof Promise?i.push(s.then(t=>Ps(t,n,e))):Ps(s,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function Ms(e,t,n,r,o,i){const l=n in r;if(e.issues.length){if(o&&i&&!l)return;t.issues.push(...Li(n,e.issues))}l||o?void 0===e.value?l&&(t.value[n]=void 0):t.value[n]=e.value:e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]})}function Ts(e){const t=Object.keys(e.shape);for(const r of t){var n;if(null===(n=e.shape)||void 0===n||null===(n=n[r])||void 0===n||null===(n=n._zod)||void 0===n||null===(n=n.traits)||void 0===n||!n.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`)}const r=(o=e.shape,Object.keys(o).filter(e=>"optional"===o[e]._zod.optin&&"optional"===o[e]._zod.optout));var o;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function As(e,t,n,r,o,i){const l=[],s=o.keySet,a=o.catchall._zod,u=a.def.type,c="optional"===a.optin,d="optional"===a.optout;for(const o in t){if("__proto__"===o)continue;if(s.has(o))continue;if("never"===u){l.push(o);continue}const i=a.run({value:t[o],issues:[]},r);i instanceof Promise?e.push(i.then(e=>Ms(e,n,o,t,c,d))):Ms(i,n,o,t,c,d)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const Fs=di("$ZodObject",(e,t)=>{Xl.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(null==n||!n.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=yi(()=>Ts(t));Si(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const o=e[t]._zod;if(o.values){var r;null!==(r=n[t])&&void 0!==r||(n[t]=new Set);for(const e of o.values)n[t].add(e)}}return n});const o=Ri,i=t.catchall;let l;e._zod.parse=(t,n)=>{null!=l||(l=r.value);const s=t.value;if(!o(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};const a=[],u=l.shape;for(const e of l.keys){const r=u[e],o="optional"===r._zod.optin,i="optional"===r._zod.optout,l=r._zod.run({value:s[e],issues:[]},n);l instanceof Promise?a.push(l.then(n=>Ms(n,t,e,s,o,i))):Ms(l,t,e,s,o,i)}return i?As(a,s,t,n,r.value,e):a.length?Promise.all(a).then(()=>t):t}}),Ns=di("$ZodObjectJIT",(e,t)=>{Fs.init(e,t);const n=e._zod.parse,r=yi(()=>Ts(t));let o;const i=Ri,l=!pi.jitless,s=l&&ki.value,a=t.catchall;let u;e._zod.parse=(c,d)=>{null!=u||(u=r.value);const f=c.value;return i(f)?l&&s&&!1===(null==d?void 0:d.async)&&!0!==d.jitless?(o||(o=(e=>{const t=new Kl(["shape","payload","ctx"]),n=r.value,o=e=>{const t=Ei(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input=payload.value;");const i=Object.create(null);let l=0;for(const e of n.keys)i[e]="key_"+l++;t.write("const newResult={};");for(const r of n.keys){var s,a;const n=i[r],l=Ei(r),u=e[r],c="optional"===(null==u||null===(s=u._zod)||void 0===s?void 0:s.optin),d="optional"===(null==u||null===(a=u._zod)||void 0===a?void 0:a.optout);t.write(`const ${n}=${o(r)};`),c&&d?t.write(`\n        if(${n}.issues.length){\n          if(${l} in input){\n            payload.issues=payload.issues.concat(${n}.issues.map(iss=> ({\n              ...iss,\n              path: iss.path ? [${l}, ...iss.path]:[${l}]\n            })));\n          }\n        }\n        \n        if(${n}.value===undefined){\n          if(${l} in input){\n            newResult[${l}]=undefined;\n          }\n        }else{\n          newResult[${l}]=${n}.value;\n        }\n        \n      `):c?t.write(`\n        if(${n}.issues.length){\n          payload.issues=payload.issues.concat(${n}.issues.map(iss=> ({\n            ...iss,\n            path: iss.path ? [${l}, ...iss.path]:[${l}]\n          })));\n        }\n        \n        if(${n}.value===undefined){\n          if(${l} in input){\n            newResult[${l}]=undefined;\n          }\n        }else{\n          newResult[${l}]=${n}.value;\n        }\n        \n      `):t.write(`\n        const ${n}_present=${l} in input;\n        if(${n}.issues.length){\n          payload.issues=payload.issues.concat(${n}.issues.map(iss=> ({\n            ...iss,\n            path: iss.path ? [${l}, ...iss.path]:[${l}]\n          })));\n        }\n        if(!${n}_present&&!${n}.issues.length){\n          payload.issues.push({\n            code: "invalid_type",\n            expected: "nonoptional",\n            input: undefined,\n            path: [${l}]\n          });\n        }\n\n        if(${n}_present){\n          if(${n}.value===undefined){\n            newResult[${l}]=undefined;\n          }else{\n            newResult[${l}]=${n}.value;\n          }\n        }\n\n      `)}t.write("payload.value=newResult;"),t.write("return payload;");const u=t.compile();return(t,n)=>u(e,t,n)})(t.shape)),c=o(c,d),a?As([],f,c,d,u,e):c):n(c,d):(c.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),c)}});function zs(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter(e=>!zi(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>$i(e,r,gi())))}),t)}const Ds=di("$ZodUnion",(e,t)=>{Xl.init(e,t),Si(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Si(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Si(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Si(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>wi(e.source)).join("|")})$`)}});const n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let i=!1;const l=[];for(const e of t.options){const t=e._zod.run({value:r.value,issues:[]},o);if(t instanceof Promise)l.push(t),i=!0;else{if(0===t.issues.length)return t;l.push(t)}}return i?Promise.all(l).then(t=>zs(t,r,e,o)):zs(l,r,e,o)}}),Ls=di("$ZodIntersection",(e,t)=>{Xl.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,o=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([t,n])=>$s(e,t,n)):$s(e,o,i)}});function Vs(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Pi(e)&&Pi(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),o={...e,...t};for(const n of r){const r=Vs(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};o[n]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=Vs(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function $s(e,t,n){const r=new Map;let o;for(const n of t.issues)if("unrecognized_keys"===n.code){null!=o||(o=n);for(const e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(const t of n.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);const i=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&o&&e.issues.push({...o,keys:i}),zi(e))return e;const l=Vs(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const js=di("$ZodEnum",(e,t)=>{Xl.init(e,t);const n=mi(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>Mi.has(typeof e)).map(e=>"string"==typeof e?Ti(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),Ws=di("$ZodLiteral",(e,t)=>{if(Xl.init(e,t),0===t.values.length)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(e=>"string"==typeof e?Ti(e):e?Ti(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),Hs=di("$ZodTransform",(e,t)=>{Xl.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new hi(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n.fallback=!0,n));if(o instanceof Promise)throw new fi;return n.value=o,n.fallback=!0,n}});function Bs(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Us=di("$ZodOptional",(e,t)=>{Xl.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Si(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Si(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${wi(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=e.value,o=t.innerType._zod.run(e,n);return o instanceof Promise?o.then(e=>Bs(e,r)):Bs(o,r)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),qs=di("$ZodExactOptional",(e,t)=>{Us.init(e,t),Si(e._zod,"values",()=>t.innerType._zod.values),Si(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Gs=di("$ZodNullable",(e,t)=>{Xl.init(e,t),Si(e._zod,"optin",()=>t.innerType._zod.optin),Si(e._zod,"optout",()=>t.innerType._zod.optout),Si(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${wi(e.source)}|null)$`):void 0}),Si(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),Zs=di("$ZodDefault",(e,t)=>{Xl.init(e,t),e._zod.optin="optional",Si(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ks(e,t)):Ks(r,t)}});function Ks(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Js=di("$ZodPrefault",(e,t)=>{Xl.init(e,t),e._zod.optin="optional",Si(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Xs=di("$ZodNonOptional",(e,t)=>{Xl.init(e,t),Si(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(t=>Ys(t,e)):Ys(o,e)}});function Ys(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Qs=di("$ZodCatch",(e,t)=>{Xl.init(e,t),e._zod.optin="optional",Si(e._zod,"optout",()=>t.innerType._zod.optout),Si(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const 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({...e,error:{issues:r.issues.map(e=>$i(e,n,gi()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>$i(e,n,gi()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),ea=di("$ZodPipe",(e,t)=>{Xl.init(e,t),Si(e._zod,"values",()=>t.in._zod.values),Si(e._zod,"optin",()=>t.in._zod.optin),Si(e._zod,"optout",()=>t.out._zod.optout),Si(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ta(e,t.in,n)):ta(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ta(e,t.out,n)):ta(r,t.out,n)}});function ta(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const na=di("$ZodReadonly",(e,t)=>{Xl.init(e,t),Si(e._zod,"propValues",()=>t.innerType._zod.propValues),Si(e._zod,"values",()=>t.innerType._zod.values),Si(e._zod,"optin",()=>{var e;return null===(e=t.innerType)||void 0===e||null===(e=e._zod)||void 0===e?void 0:e.optin}),Si(e._zod,"optout",()=>{var e;return null===(e=t.innerType)||void 0===e||null===(e=e._zod)||void 0===e?void 0:e.optout}),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(ra):ra(r)}});function ra(e){return e.value=Object.freeze(e.value),e}const oa=di("$ZodCustom",(e,t)=>{Tl.init(e,t),Xl.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>ia(t,n,r,e));ia(o,n,r,e)}});function ia(e,t,n,r){if(!e){var o;const e={code:"custom",input:n,inst:r,path:[...null!==(o=r._zod.def.path)&&void 0!==o?o:[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Wi(e))}}var la;null!==(Y=(la=globalThis).__zod_globalRegistry)&&void 0!==Y||(la.__zod_globalRegistry=new class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){var n;const r={...null!==(n=this.get(t))&&void 0!==n?n:{}};delete r.id;const o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});const sa=globalThis.__zod_globalRegistry;function aa(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Fi(t)})}function ua(e,t){return new Fl({check:"less_than",...Fi(t),value:e,inclusive:!1})}function ca(e,t){return new Fl({check:"less_than",...Fi(t),value:e,inclusive:!0})}function da(e,t){return new Nl({check:"greater_than",...Fi(t),value:e,inclusive:!1})}function fa(e,t){return new Nl({check:"greater_than",...Fi(t),value:e,inclusive:!0})}function ha(e,t){return new zl({check:"multiple_of",...Fi(t),value:e})}function pa(e,t){return new Ll({check:"max_length",...Fi(t),maximum:e})}function ga(e,t){return new Vl({check:"min_length",...Fi(t),minimum:e})}function ma(e,t){return new $l({check:"length_equals",...Fi(t),length:e})}function va(e){return new Zl({check:"overwrite",tx:e})}function ya(e){var t,n,r,o,i,l,s,a,u;let c=null!==(t=null==e?void 0:e.target)&&void 0!==t?t:"draft-2020-12";return"draft-4"===c&&(c="draft-04"),"draft-7"===c&&(c="draft-07"),{processors:null!==(n=e.processors)&&void 0!==n?n:{},metadataRegistry:null!==(r=null==e?void 0:e.metadata)&&void 0!==r?r:sa,target:c,unrepresentable:null!==(o=null==e?void 0:e.unrepresentable)&&void 0!==o?o:"throw",override:null!==(i=null==e?void 0:e.override)&&void 0!==i?i:()=>{},io:null!==(l=null==e?void 0:e.io)&&void 0!==l?l:"output",counter:0,seen:new Map,cycles:null!==(s=null==e?void 0:e.cycles)&&void 0!==s?s:"ref",reused:null!==(a=null==e?void 0:e.reused)&&void 0!==a?a:"inline",external:null!==(u=null==e?void 0:e.external)&&void 0!==u?u:void 0}}function ba(e,t,n={path:[],schemaPath:[]}){var r,o,i,l;const s=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const u={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,u);const c=null===(r=(o=e._zod).toJSONSchema)||void 0===r?void 0:r.call(o);if(c)u.schema=c;else{const r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,u.schema,r);else{const n=u.schema,o=t.processors[s.type];if(!o)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);o(e,t,n,r)}const o=e._zod.parent;o&&(u.ref||(u.ref=o),ba(o,t,r),t.seen.get(o).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(u.schema,d),"input"===t.io&&Sa(e)&&(delete u.schema.examples,delete u.schema.default),"input"===t.io&&"_prefault"in u.schema&&(null!==(i=(l=u.schema).default)&&void 0!==i||(l.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function wa(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const t of e.seen.entries()){var o;const n=null===(o=e.metadataRegistry.get(t[0]))||void 0===o?void 0:o.id;if(n){const e=r.get(n);if(e&&e!==t[0])throw new 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])}}const i=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:o,defId:i}=(t=>{var r;const o="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){var i,l,s,a;const n=null===(i=e.external.registry.get(t[0]))||void 0===i?void 0:i.id,r=null!==(l=e.external.uri)&&void 0!==l?l:e=>e;if(n)return{ref:r(n)};const u=null!==(s=null!==(a=t[1].defId)&&void 0!==a?a:t[1].schema.id)&&void 0!==s?s:"schema"+e.counter++;return t[1].defId=u,{defId:u,ref:`${r("__shared")}#/${o}/${u}`}}if(t[1]===n)return{ref:"#"};const u=`#/${o}/`,c=null!==(r=t[1].schema.id)&&void 0!==r?r:"__schema"+e.counter++;return{defId:c,ref:u+c}})(t);r.def={...r.schema},i&&(r.defId=i);const l=r.schema;for(const e in l)delete l[e];l.$ref=o};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];var l;if(e.cycle)throw new Error(`Cycle detected: #/${null===(l=e.cycle)||void 0===l?void 0:l.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const n of e.seen.entries()){var s;const r=n[1];if(t!==n[0]){if(e.external){var a;const r=null===(a=e.external.registry.get(n[0]))||void 0===a?void 0:a.id;if(t!==n[0]&&r){i(n);continue}}((null===(s=e.metadataRegistry.get(n[0]))||void 0===s?void 0:s.id)||r.cycle||r.count>1&&"ref"===e.reused)&&i(n)}else i(n)}}function _a(e,t){var n,r,o,i,l;const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=t=>{var n,r;const o=e.seen.get(t);if(null===o.ref)return;const i=null!==(n=o.def)&&void 0!==n?n:o.schema,l={...i},s=o.ref;if(o.ref=null,s){a(s);const n=e.seen.get(s),r=n.schema;var u;if(!r.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(i,r):(i.allOf=null!==(u=i.allOf)&&void 0!==u?u:[],i.allOf.push(r)),Object.assign(i,l),t._zod.parent===s)for(const e in i)"$ref"!==e&&"allOf"!==e&&(e in l||delete i[e]);if(r.$ref&&n.def)for(const e in i)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}const c=t._zod.parent;if(c&&c!==s){a(c);const t=e.seen.get(c);if(null!=t&&t.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(const e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:null!==(r=o.path)&&void 0!==r?r:[]})};for(const t of[...e.seen.entries()].reverse())a(t[0]);const u={};if("draft-2020-12"===e.target?u.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?u.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?u.$schema="http://json-schema.org/draft-04/schema#":e.target,null!==(n=e.external)&&void 0!==n&&n.uri){var c;const n=null===(c=e.external.registry.get(t))||void 0===c?void 0:c.id;if(!n)throw new Error("Schema is missing an `id` property");u.$id=e.external.uri(n)}Object.assign(u,null!==(r=s.def)&&void 0!==r?r:s.schema);const d=null===(o=e.metadataRegistry.get(t))||void 0===o?void 0:o.id;void 0!==d&&u.id===d&&delete u.id;const f=null!==(i=null===(l=e.external)||void 0===l?void 0:l.defs)&&void 0!==i?i:{};for(const t of e.seen.entries()){const 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&&("draft-2020-12"===e.target?u.$defs=f:u.definitions=f);try{const n=JSON.parse(JSON.stringify(u));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:xa(t,"input",e.processors),output:xa(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function Sa(e,t){const n=null!=t?t:{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return Sa(r.element,n);if("set"===r.type)return Sa(r.valueType,n);if("lazy"===r.type)return Sa(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return Sa(r.innerType,n);if("intersection"===r.type)return Sa(r.left,n)||Sa(r.right,n);if("record"===r.type||"map"===r.type)return Sa(r.keyType,n)||Sa(r.valueType,n);if("pipe"===r.type)return!!e._zod.traits.has("$ZodCodec")||Sa(r.in,n)||Sa(r.out,n);if("object"===r.type){for(const e in r.shape)if(Sa(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(Sa(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(Sa(e,n))return!0;return!(!r.rest||!Sa(r.rest,n))}return!1}const xa=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=null!=r?r:{},l=ya({...null!=o?o:{},target:i,io:t,processors:n});return ba(e,l),wa(l,e),_a(l,e)},Ca={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ea=(e,t,n,r)=>{const o=e._zod.def;ba(o.innerType,t,r),t.seen.get(e).ref=o.innerType},Ia=di("ZodISODateTime",(e,t)=>{ds.init(e,t),Ja.init(e,t)});const Ra=di("ZodISODate",(e,t)=>{fs.init(e,t),Ja.init(e,t)});const ka=di("ZodISOTime",(e,t)=>{hs.init(e,t),Ja.init(e,t)});const Pa=di("ZodISODuration",(e,t)=>{ps.init(e,t),Ja.init(e,t)});const Oa=(e,t)=>{Bi.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=(e,o=[])=>{for(const i of e.issues)if("invalid_union"===i.code&&i.errors.length)i.errors.map(e=>r({issues:e},[...o,...i.path]));else if("invalid_key"===i.code)r({issues:i.issues},[...o,...i.path]);else if("invalid_element"===i.code)r({issues:i.issues},[...o,...i.path]);else{const e=[...o,...i.path];if(0===e.length)n._errors.push(t(i));else{let r=n,o=0;for(;o<e.length;){const n=e[o];o===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(i))):r[n]=r[n]||{_errors:[]},r=r[n],o++}}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,vi,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,vi,2)}},isEmpty:{get:()=>0===e.issues.length}})},Ma=di("ZodError",Oa,{Parent:Error}),Ta=qi(Ma),Aa=Gi(Ma),Fa=Zi(Ma),Na=Ji(Ma),za=Yi(Ma),Da=Qi(Ma),La=el(Ma),Va=tl(Ma),$a=nl(Ma),ja=rl(Ma),Wa=ol(Ma),Ha=il(Ma),Ba=new WeakMap;function Ua(e,t,n){const r=Object.getPrototypeOf(e);let o=Ba.get(r);if(o||(o=new Set,Ba.set(r,o)),!o.has(t)){o.add(t);for(const e in n){const t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){const 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})}})}}}const qa=di("ZodType",(e,t)=>(Xl.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:xa(e,"input"),output:xa(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=ya({...n,processors:t});return ba(e,r),wa(r,e),_a(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Ta(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Fa(e,t,n),e.parseAsync=async(t,n)=>Aa(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Na(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>za(e,t,n),e.decode=(t,n)=>Da(e,t,n),e.encodeAsync=async(t,n)=>La(e,t,n),e.decodeAsync=async(t,n)=>Va(e,t,n),e.safeEncode=(t,n)=>$a(e,t,n),e.safeDecode=(t,n)=>ja(e,t,n),e.safeEncodeAsync=async(t,n)=>Wa(e,t,n),e.safeDecodeAsync=async(t,n)=>Ha(e,t,n),Ua(e,"ZodType",{check(...e){var t;const n=this.def;return this.clone(Ci(n,{checks:[...null!==(t=n.checks)&&void 0!==t?t:[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ai(this,e,t)},brand (){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Fi(n)})}(Zu,e,t)}(e,t))},superRefine(e,t){return this.check(function(e,t){return function(e,t){const n=function(e,t){const n=new Tl({check:"custom",...Fi(t)});return n._zod.check=e,n}(t=>(t.addIssue=e=>{if("string"==typeof e)t.issues.push(Wi(e,t.value,n._zod.def));else{var r,o,i,l;const s=e;s.fatal&&(s.continue=!1),null!==(r=s.code)&&void 0!==r||(s.code="custom"),null!==(o=s.input)&&void 0!==o||(s.input=t.value),null!==(i=s.inst)&&void 0!==i||(s.inst=n),null!==(l=s.continue)&&void 0!==l||(s.continue=!n._zod.def.abort),t.issues.push(Wi(s))}},e(t.value,t)),t);return n}(e,t)}(e,t))},overwrite(e){return this.check(va(e))},optional(){return Du(this)},exactOptional(){return new Lu({type:"optional",innerType:this})},nullable(){return $u(this)},nullish(){return Du($u(this))},nonoptional(e){return function(e,t){return new Hu({type:"nonoptional",innerType:e,...Fi(t)})}(this,e)},array(){return Iu(this)},or(e){return Ou([this,e])},and (e){return new Mu({type:"intersection",left:this,right:e})},transform(e){return qu(this,function(e){return new Nu({type:"transform",transform:e})}(e))},default(e){return t=e,new ju({type:"default",innerType:this,get defaultValue(){return"function"==typeof t?t():Oi(t)}});var t},prefault(e){return t=e,new Wu({type:"prefault",innerType:this,get defaultValue(){return"function"==typeof t?t():Oi(t)}});var t},catch(e){return new Bu({type:"catch",innerType:this,catchValue:"function"==typeof(t=e)?t:()=>t});var t},pipe(e){return qu(this,e)},readonly(){return new Gu({type:"readonly",innerType:this})},describe(e){const t=this.clone();return sa.add(t,{description:e}),t},meta(...e){if(0===e.length)return sa.get(this);const t=this.clone();return sa.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 null===(t=sa.get(e))||void 0===t?void 0:t.description},configurable:!0}),e)),Ga=di("_ZodString",(e,t)=>{var n,r,o;Yl.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:o,maximum:i,format:l,patterns:s,contentEncoding:a}=e._zod.bag;var u;if("number"==typeof o&&(r.minLength=o),"number"==typeof i&&(r.maxLength=i),l&&(r.format=null!==(u=Ca[l])&&void 0!==u?u:l,""===r.format&&delete r.format,"time"===l&&delete r.format),a&&(r.contentEncoding=a),s&&s.size>0){const e=[...s];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n);const i=e._zod.bag;e.format=null!==(n=i.format)&&void 0!==n?n:null,e.minLength=null!==(r=i.minimum)&&void 0!==r?r:null,e.maxLength=null!==(o=i.maximum)&&void 0!==o?o:null,Ua(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new Wl({check:"string_format",format:"regex",...Fi(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new Ul({check:"string_format",format:"includes",...Fi(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new ql({check:"string_format",format:"starts_with",...Fi(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new Gl({check:"string_format",format:"ends_with",...Fi(t),suffix:e})}(...e))},min(...e){return this.check(ga(...e))},max(...e){return this.check(pa(...e))},length(...e){return this.check(ma(...e))},nonempty(...e){return this.check(ga(1,...e))},lowercase(e){return this.check(function(e){return new Hl({check:"string_format",format:"lowercase",...Fi(e)})}(e))},uppercase(e){return this.check(function(e){return new Bl({check:"string_format",format:"uppercase",...Fi(e)})}(e))},trim(){return this.check(va(e=>e.trim()))},normalize(...e){return this.check(function(e){return va(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(va(e=>e.toLowerCase()))},toUpperCase(){return this.check(va(e=>e.toUpperCase()))},slugify(){return this.check(va(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}})}),Za=di("ZodString",(e,t)=>{Yl.init(e,t),Ga.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Fi(t)})}(Xa,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Fi(t)})}(eu,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Fi(t)})}(gu,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Fi(t)})}(tu,t)),e.guid=t=>e.check(aa(Ya,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Fi(t)})}(Qa,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Fi(t)})}(Qa,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Fi(t)})}(Qa,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Fi(t)})}(Qa,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Fi(t)})}(nu,t)),e.guid=t=>e.check(aa(Ya,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Fi(t)})}(ru,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Fi(t)})}(ou,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Fi(t)})}(iu,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Fi(t)})}(fu,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Fi(t)})}(hu,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Fi(t)})}(lu,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Fi(t)})}(su,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Fi(t)})}(au,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Fi(t)})}(uu,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Fi(t)})}(cu,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Fi(t)})}(du,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Fi(t)})}(pu,t)),e.datetime=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Fi(t)})}(Ia,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Fi(t)})}(Ra,e)}(t)),e.time=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Fi(t)})}(ka,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Fi(t)})}(Pa,e)}(t))});function Ka(e){return function(e,t){return new e({type:"string",...Fi(t)})}(Za,e)}const Ja=di("ZodStringFormat",(e,t)=>{Ql.init(e,t),Ga.init(e,t)}),Xa=di("ZodEmail",(e,t)=>{ns.init(e,t),Ja.init(e,t)}),Ya=di("ZodGUID",(e,t)=>{es.init(e,t),Ja.init(e,t)}),Qa=di("ZodUUID",(e,t)=>{ts.init(e,t),Ja.init(e,t)}),eu=di("ZodURL",(e,t)=>{rs.init(e,t),Ja.init(e,t)}),tu=di("ZodEmoji",(e,t)=>{os.init(e,t),Ja.init(e,t)}),nu=di("ZodNanoID",(e,t)=>{is.init(e,t),Ja.init(e,t)}),ru=di("ZodCUID",(e,t)=>{ls.init(e,t),Ja.init(e,t)}),ou=di("ZodCUID2",(e,t)=>{ss.init(e,t),Ja.init(e,t)}),iu=di("ZodULID",(e,t)=>{as.init(e,t),Ja.init(e,t)}),lu=di("ZodXID",(e,t)=>{us.init(e,t),Ja.init(e,t)}),su=di("ZodKSUID",(e,t)=>{cs.init(e,t),Ja.init(e,t)}),au=di("ZodIPv4",(e,t)=>{gs.init(e,t),Ja.init(e,t)}),uu=di("ZodIPv6",(e,t)=>{ms.init(e,t),Ja.init(e,t)}),cu=di("ZodCIDRv4",(e,t)=>{vs.init(e,t),Ja.init(e,t)}),du=di("ZodCIDRv6",(e,t)=>{ys.init(e,t),Ja.init(e,t)}),fu=di("ZodBase64",(e,t)=>{ws.init(e,t),Ja.init(e,t)}),hu=di("ZodBase64URL",(e,t)=>{_s.init(e,t),Ja.init(e,t)}),pu=di("ZodE164",(e,t)=>{Ss.init(e,t),Ja.init(e,t)}),gu=di("ZodJWT",(e,t)=>{xs.init(e,t),Ja.init(e,t)}),mu=di("ZodNumber",(e,t)=>{var n,r,o,i,l,s,a,u,c;Cs.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:o,maximum:i,format:l,multipleOf:s,exclusiveMaximum:a,exclusiveMinimum:u}=e._zod.bag;"string"==typeof l&&l.includes("int")?r.type="integer":r.type="number";const c="number"==typeof u&&u>=(null!=o?o:Number.NEGATIVE_INFINITY),d="number"==typeof a&&a<=(null!=i?i:Number.POSITIVE_INFINITY),f="draft-04"===t.target||"openapi-3.0"===t.target;c?f?(r.minimum=u,r.exclusiveMinimum=!0):r.exclusiveMinimum=u:"number"==typeof o&&(r.minimum=o),d?f?(r.maximum=a,r.exclusiveMaximum=!0):r.exclusiveMaximum=a:"number"==typeof i&&(r.maximum=i),"number"==typeof s&&(r.multipleOf=s)})(e,t,n),Ua(e,"ZodNumber",{gt(e,t){return this.check(da(e,t))},gte(e,t){return this.check(fa(e,t))},min(e,t){return this.check(fa(e,t))},lt(e,t){return this.check(ua(e,t))},lte(e,t){return this.check(ca(e,t))},max(e,t){return this.check(ca(e,t))},int(e){return this.check(bu(e))},safe(e){return this.check(bu(e))},positive(e){return this.check(da(0,e))},nonnegative(e){return this.check(fa(0,e))},negative(e){return this.check(ua(0,e))},nonpositive(e){return this.check(ca(0,e))},multipleOf(e,t){return this.check(ha(e,t))},step(e,t){return this.check(ha(e,t))},finite(){return this}});const d=e._zod.bag;e.minValue=null!==(n=Math.max(null!==(r=d.minimum)&&void 0!==r?r:Number.NEGATIVE_INFINITY,null!==(o=d.exclusiveMinimum)&&void 0!==o?o:Number.NEGATIVE_INFINITY))&&void 0!==n?n:null,e.maxValue=null!==(i=Math.min(null!==(l=d.maximum)&&void 0!==l?l:Number.POSITIVE_INFINITY,null!==(s=d.exclusiveMaximum)&&void 0!==s?s:Number.POSITIVE_INFINITY))&&void 0!==i?i:null,e.isInt=(null!==(a=d.format)&&void 0!==a?a:"").includes("int")||Number.isSafeInteger(null!==(u=d.multipleOf)&&void 0!==u?u:.5),e.isFinite=!0,e.format=null!==(c=d.format)&&void 0!==c?c:null});function vu(e){return function(e,t){return new e({type:"number",checks:[],...Fi(t)})}(mu,e)}const yu=di("ZodNumberFormat",(e,t)=>{Es.init(e,t),mu.init(e,t)});function bu(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Fi(t)})}(yu,e)}const wu=di("ZodBoolean",(e,t)=>{Is.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t)});function _u(e){return function(e,t){return new e({type:"boolean",...Fi(t)})}(wu,e)}const Su=di("ZodUnknown",(e,t)=>{Rs.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function xu(){return new Su({type:"unknown"})}const Cu=di("ZodNever",(e,t)=>{ks.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)});const Eu=di("ZodArray",(e,t)=>{Os.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:l,maximum:s}=e._zod.bag;"number"==typeof l&&(o.minItems=l),"number"==typeof s&&(o.maxItems=s),o.type="array",o.items=ba(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,Ua(e,"ZodArray",{min(e,t){return this.check(ga(e,t))},nonempty(e){return this.check(ga(1,e))},max(e,t){return this.check(pa(e,t))},length(e,t){return this.check(ma(e,t))},unwrap(){return this.element}})});function Iu(e,t){return function(e,t,n){return new e({type:"array",element:t,...Fi(n)})}(Eu,e,t)}const Ru=di("ZodObject",(e,t)=>{Ns.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{var o;const i=n,l=e._zod.def;i.type="object",i.properties={};const s=l.shape;for(const e in s)i.properties[e]=ba(s[e],t,{...r,path:[...r.path,"properties",e]});const a=new Set(Object.keys(s)),u=new Set([...a].filter(e=>{const n=l.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));u.size>0&&(i.required=Array.from(u)),"never"===(null===(o=l.catchall)||void 0===o?void 0:o._zod.def.type)?i.additionalProperties=!1:l.catchall?l.catchall&&(i.additionalProperties=ba(l.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(i.additionalProperties=!1)})(e,t,n,r),Si(e,"shape",()=>t.shape),Ua(e,"ZodObject",{keyof(){return function(e){const t=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Tu({type:"enum",entries:t,...Fi(void 0)})}(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:xu()})},loose(){return this.clone({...this._zod.def,catchall:xu()})},strict(){return this.clone({...this._zod.def,catchall:function(e,t){return new e({type:"never",...Fi(t)})}(Cu,e)});var e},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return function(e,t){if(!Pi(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=Ci(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return xi(this,"shape",n),n}});return Ai(e,r)}(this,e)},safeExtend(e){return function(e,t){if(!Pi(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ci(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return xi(this,"shape",n),n}});return Ai(e,n)}(this,e)},merge(e){return function(e,t){var n,r;if(null!==(n=e._zod.def.checks)&&void 0!==n&&n.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const o=Ci(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return xi(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:null!==(r=t._zod.def.checks)&&void 0!==r?r:[]});return Ai(e,o)}(this,e)},pick(e){return function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return Ai(e,Ci(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return xi(this,"shape",e),e},checks:[]}))}(this,e)},omit(e){return function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Ci(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return xi(this,"shape",r),r},checks:[]});return Ai(e,o)}(this,e)},partial(...e){return function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=Ci(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return xi(this,"shape",o),o},checks:[]});return Ai(t,o)}(zu,this,e[0])},required(...e){return function(e,t,n){const r=Ci(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)o[t]=new e({type:"nonoptional",innerType:r[t]});return xi(this,"shape",o),o}});return Ai(t,r)}(Hu,this,e[0])}})});function ku(e,t){const n={type:"object",shape:null!=e?e:{},...Fi(t)};return new Ru(n)}const Pu=di("ZodUnion",(e,t)=>{Ds.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=!1===o.inclusive,l=o.options.map((e,n)=>ba(e,t,{...r,path:[...r.path,i?"oneOf":"anyOf",n]}));i?n.oneOf=l:n.anyOf=l})(e,t,n,r),e.options=t.options});function Ou(e,t){return new Pu({type:"union",options:e,...Fi(t)})}const Mu=di("ZodIntersection",(e,t)=>{Ls.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=ba(o.left,t,{...r,path:[...r.path,"allOf",0]}),l=ba(o.right,t,{...r,path:[...r.path,"allOf",1]}),s=e=>"allOf"in e&&1===Object.keys(e).length,a=[...s(i)?i.allOf:[i],...s(l)?l.allOf:[l]];n.allOf=a})(e,t,n,r)}),Tu=di("ZodEnum",(e,t)=>{js.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=mi(e._zod.def.entries);r.every(e=>"number"==typeof e)&&(n.type="number"),r.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=r})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const o={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);o[r]=t.entries[r]}return new Tu({...t,checks:[],...Fi(r),entries:o})},e.exclude=(e,r)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new Tu({...t,checks:[],...Fi(r),entries:o})}}),Au=di("ZodLiteral",(e,t)=>{Ws.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=e._zod.def,o=[];for(const e of r.values)if(void 0===e){if("throw"===t.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e){if("throw"===t.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(e))}else o.push(e);if(0===o.length);else if(1===o.length){const e=o[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else o.every(e=>"number"==typeof e)&&(n.type="number"),o.every(e=>"string"==typeof e)&&(n.type="string"),o.every(e=>"boolean"==typeof e)&&(n.type="boolean"),o.every(e=>null===e)&&(n.type="null"),n.enum=o})(e,t,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Fu(e,t){return new Au({type:"literal",values:Array.isArray(e)?e:[e],...Fi(t)})}const Nu=di("ZodTransform",(e,t)=>{Hs.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new hi(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(Wi(r,n.value,t));else{var o,i,l;const t=r;t.fatal&&(t.continue=!1),null!==(o=t.code)&&void 0!==o||(t.code="custom"),null!==(i=t.input)&&void 0!==i||(t.input=n.value),null!==(l=t.inst)&&void 0!==l||(t.inst=e),n.issues.push(Wi(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=o,n.fallback=!0,n)}}),zu=di("ZodOptional",(e,t)=>{Us.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ea(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function Du(e){return new zu({type:"optional",innerType:e})}const Lu=di("ZodExactOptional",(e,t)=>{qs.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ea(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}),Vu=di("ZodNullable",(e,t)=>{Gs.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=ba(o.innerType,t,r),l=t.seen.get(e);"openapi-3.0"===t.target?(l.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $u(e){return new Vu({type:"nullable",innerType:e})}const ju=di("ZodDefault",(e,t)=>{Zs.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;ba(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),Wu=di("ZodPrefault",(e,t)=>{Js.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;ba(o.innerType,t,r),t.seen.get(e).ref=o.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Hu=di("ZodNonOptional",(e,t)=>{Xs.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;ba(o.innerType,t,r),t.seen.get(e).ref=o.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType}),Bu=di("ZodCatch",(e,t)=>{Qs.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;let i;ba(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),Uu=di("ZodPipe",(e,t)=>{ea.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),l="input"===t.io?i?o.out:o.in:o.out;ba(l,t,r),t.seen.get(e).ref=l})(e,t,0,r),e.in=t.in,e.out=t.out});function qu(e,t){return new Uu({type:"pipe",in:e,out:t})}const Gu=di("ZodReadonly",(e,t)=>{na.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;ba(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),Zu=di("ZodCustom",(e,t)=>{oa.init(e,t),qa.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)}),Ku=500,Ju=100,Xu=ku({pageIndex:vu().int().min(0).max(1e4).catch(0),pageSize:Ou([Fu(-1),vu().int().positive()]).catch(10)}).catch({pageIndex:0,pageSize:10}),Yu=Iu(ku({id:Ka().max(Ku).catch(""),desc:_u().catch(!1)})).max(Ju).catch([]),Qu=Ou([Ka().max(200),vu(),_u()]).catch(""),ec=Ou([Qu,Iu(Qu).max(Ju)]).catch([]),tc=Iu(ku({id:Ka().max(Ku).catch(""),value:ec}).catch({id:"",value:""})).max(Ju).catch([]),nc=ku({query:Ka().max(Ku).catch("")}).catch({query:""});ku({pagination:Xu,sorting:Yu,filters:tc,search:nc}),ku({page:Ka().regex(/^\d+$/).transform(e=>parseInt(e,10)).pipe(vu().int().min(1).max(1e4)).catch(1),per_page:Ka().regex(/^-?\d+$/).transform(e=>parseInt(e,10)).pipe(Ou([Fu(-1),vu().int().positive()])).catch(10),search:Ka().max(Ku).catch("").optional(),sort:Ka().max(5e3).catch("").optional()}).catchall(Ka().max(200).catch(""));const rc=new class{get(){return window.location.hash.substring(1)}set(e){const t=e?`#${e}`:window.location.pathname+window.location.search;window.history.replaceState(null,"",t)}subscribe(e){return window.addEventListener("hashchange",e),()=>{window.removeEventListener("hashchange",e)}}},oc=(e,t,n)=>{const r=e.startsWith("#")?e.substring(1):e;if(!r)return{};const o=new URLSearchParams(r),i={sorting:n.sorting||[]};let l;if(t.includes("page")){const e=o.get("page");if(e)try{const t=parseInt(e,10);!isNaN(t)&&t>=1&&t<=1e4&&(l={...l,pageIndex:t-1})}catch{console.warn(`Invalid page parameter: ${e}`)}}if(t.includes("pageSize")){const e=o.get("per_page");if(e)try{const t=parseInt(e,10);!isNaN(t)&&(-1===t||t>0)&&(l={...l,pageSize:t})}catch{console.warn(`Invalid per_page parameter: ${e}`)}}if(l&&(i.pagination={...n.pagination,...l}),t.includes("filters")){const e=(e=>{const t=[];return e.forEach((e,n)=>{if(n.startsWith("_")){const r=n.substring(1);try{const n=(e=>{const t=e=>{const t=e.trim().slice(0,200);if(/^-?\d+$/.test(t)){const e=parseInt(t,10);if(!isNaN(e)&&e>=Number.MIN_SAFE_INTEGER&&e<=Number.MAX_SAFE_INTEGER)return e}return t};return e.includes(",")?e.split(",").slice(0,Ju).map(t).filter(e=>""!==e):t(e)})(e);""===n||null==n||Array.isArray(n)&&0===n.length||t.push({id:r,value:n})}catch(t){console.warn(`Invalid filter value for "${r}":`,e,t)}}}),t})(o);i.filters=e.length>0?e:[]}if(t.includes("search")){const e=o.get("search");if(e)try{const t=e.substring(0,500);i.search={query:t}}catch(e){console.warn("Invalid search parameters:",e),i.search={query:""}}else i.search={query:""}}if(t.includes("sorting"))if(o.has("sort")){const e=(e=>{if(!e||""===e.trim())return[];try{const t=e.split(",").slice(0,Ju),n=[];for(const e of t){const t=e.trim();if(!t)continue;const[r,o]=t.split(":");r&&o&&(r.length>Ku||"asc"!==o&&"desc"!==o||n.push({id:r,desc:"desc"===o}))}return n}catch(t){return console.warn(`Invalid sorting parameter: ${e}`,t),[]}})(o.get("sort")||"");i.sorting=e}else i.sorting=n.sorting||[];return i},ic=()=>rc.get(),lc=(e,t,n,r)=>{const{enabled:o,syncParams:i=["page","pageSize","filters","search","sorting"]}=n,l=Ct(()=>i,[JSON.stringify(i)]),s=St(""),a=St(!1);wt(()=>{o&&(s.current=ic())},[]),wt(()=>{if(!o)return;if(a.current)return;const t=setTimeout(()=>{const t=((e,t,n)=>{var r,o;const i=new URLSearchParams,l=ic(),s=new URLSearchParams(l),a=null!==(r=null==n?void 0:n.pagination.pageSize)&&void 0!==r?r:10,u=null!==(o=null==n?void 0:n.sorting)&&void 0!==o?o:[];if(t.includes("page")){const t=e.pagination.pageIndex+1;(t>1||s.has("page"))&&i.set("page",String(t))}if(t.includes("pageSize")&&e.pagination.pageSize!==a&&i.set("per_page",String(e.pagination.pageSize)),t.includes("filters")&&e.filters.length>0){const t=(e=>{const t={};return e.forEach(e=>{if(null===e.value||void 0===e.value)return;const n=`_${e.id}`,r=Array.isArray(e.value)?e.value.join(","):String(e.value);r&&""!==r&&(t[n]=r)}),t})(e.filters);Object.entries(t).forEach(([e,t])=>{i.set(e,t)})}if(t.includes("search")&&e.search.query&&i.set("search",e.search.query),t.includes("sorting")&&!((e,t)=>e.length===t.length&&e.every((e,n)=>{const r=t[n];return e.id===r.id&&e.desc===r.desc}))(e.sorting,u)){const t=e.sorting.map(e=>`${e.id}:${e.desc?"desc":"asc"}`).join(",");i.set("sort",t)}return i.toString()})(e,l,r);var n;t!==s.current&&(n=t,rc.set(n),s.current=t)},150);return()=>clearTimeout(t)},[e,o,l,r]),wt(()=>{if(!o)return;const e=rc.subscribe(()=>{const e=ic();if(e===s.current)return;const n=oc(e,l,r);Object.keys(n).length>0&&(a.current=!0,t(e=>({...e,...n,pagination:n.pagination?{...e.pagination,...n.pagination}:e.pagination,sorting:void 0!==n.sorting?n.sorting:e.sorting})),queueMicrotask(()=>{a.current=!1})),s.current=e});return()=>{e()}},[o,l,r])},sc=e=>Object.keys(e).sort().reduce((t,n)=>(t[n]=e[n],t),{}),ac=(e,t,n,r,o)=>{const i={filters:n.filters.map(e=>sc(e)),pageSize:n.pagination.pageSize,search:sc(n.search),sorting:n.sorting.map(e=>sc(e))};return["serverData","infinite",e,t,i,r||"table",o]},uc=e=>{const{serverUrl:t,fetchData:n,viewId:r,state:o,enabled:i=!0,urlSync:l,displayMode:s,extraRequestData:a}=e,u=Jo(),[c,d]=yt(0),f=St(n);wt(()=>{f.current!==n&&(f.current=n,d(e=>e+1))},[n]);const h=n?"fetchData":t||"missing-data-source",p=St(o||{pagination:{pageIndex:0,pageSize:25},sorting:[],filters:[],search:{query:""}}),g=Ct(()=>{var e;const t=p.current;if(null==l||!l.enabled)return t;const n=ic();if(!n)return t;const r=l.syncParams||["pageSize","filters","search","sorting"],o=oc(n,r,t);return{...t,...o,pagination:{pageIndex:0,pageSize:(null===(e=o.pagination)||void 0===e?void 0:e.pageSize)||t.pagination.pageSize},sorting:void 0!==o.sorting?o.sorting:t.sorting}},[]),[m,v]=yt(g);lc(m,v,l||{enabled:!1,syncParams:[]},p.current);const y=Et(e=>{v(t=>{var n;return{...t,...e,pagination:{pageIndex:0,pageSize:(null===(n=e.pagination)||void 0===n?void 0:n.pageSize)||t.pagination.pageSize}}})},[]),{data:b,isLoading:w,isFetching:_,error:S,fetchNextPage:x,hasNextPage:C,isFetchingNextPage:E,refetch:I}=function(e){return ti(e,ko)}({queryKey:ac(h,c,m,s,r),queryFn:({pageParam:e})=>(async(e,t,n,r)=>{const o=r?{...e,...r}:e;if(t)return t(o);if(n)return(async(e,t)=>{const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(`Server error: ${n.status} ${n.statusText}`);return n.json()})(n,o);throw new Error("DataView configuration error: provide fetchData or serverUrl.")})(((e,t,n,r)=>({viewId:r,pagination:{pageIndex:t,pageSize:e.pagination.pageSize},sorting:e.sorting,filters:e.filters,search:e.search,displayMode:n}))(m,e,s,r),n,t,a),initialPageParam:0,getNextPageParam:(e,t,n)=>{if(e.currentPage+1<e.totalPages)return n+1},enabled:i,placeholderData:e=>e,refetchOnWindowFocus:!0,staleTime:6e4,gcTime:3e5}),R=Ct(()=>null!=b&&b.pages?b.pages.flatMap(e=>e.data):[],[null==b?void 0:b.pages]),k=Ct(()=>null!=b&&b.pages?b.pages.flatMap(e=>e.cardHtml||[]):[],[null==b?void 0:b.pages]),P=Ct(()=>null!=b&&b.pages&&0!==b.pages.length?b.pages[b.pages.length-1].totalRows:0,[null==b?void 0:b.pages]),O=Ct(()=>null!=b&&b.pages&&0!==b.pages.length?b.pages[b.pages.length-1].totalPages:0,[null==b?void 0:b.pages]),M=Ct(()=>{if(null!=b&&b.pages&&0!==b.pages.length)return b.pages[b.pages.length-1].filterCounts},[null==b?void 0:b.pages]);return wt(()=>{u.invalidateQueries({queryKey:ac(h,c,m,s,r)})},[m.filters,m.search,m.sorting,h,c,u,m,s,r]),Ct(()=>({data:R,cardHtml:k.length>0?k:void 0,loading:w,isFetching:_,isPlaceholderData:!1,error:S,totalRows:P,totalPages:O,state:m,setState:y,refetch:I,hasNextPage:C,fetchNextPage:x,isFetchingNextPage:E,filterCounts:M}),[R,k,w,_,S,P,O,m,y,I,C,x,E,M])},cc=e=>Object.keys(e).sort().reduce((t,n)=>(t[n]=e[n],t),{}),dc=(e,t,n,r,o)=>{const i={filters:n.filters.map(e=>cc(e)),pagination:cc(n.pagination),search:cc(n.search),sorting:n.sorting.map(e=>cc(e))};return["serverData",e,t,i,r||"table",o]},fc=(e,t,n)=>({viewId:n,pagination:e.pagination,sorting:e.sorting,filters:e.filters,search:e.search,displayMode:t}),hc=async(e,t,n,r)=>{const o=r?{...e,...r}:e;if(t)return t(o);if(n)return(async(e,t)=>{const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(`Server error: ${n.status} ${n.statusText}`);return n.json()})(n,o);throw new Error("DataView configuration error: provide fetchData or serverUrl.")},pc=({left:e,center:t,right:n})=>{if(t)return e&&!n?"pagination-layout-left-center":!e&&n?"pagination-layout-center-right":void 0},gc=({config:e,children:t,componentProps:n={},hideControls:r=!1})=>{var o,i;const l=Ct(()=>{const t={top:[],bottom:[],left:[],right:[]};return e.components.forEach(e=>{t[e.position].push(e)}),Object.keys(t).forEach(e=>{t[e].sort((e,t)=>(e.order||0)-(t.order||0))}),t},[e.components]),s=e=>{const t=e.component,r={...n,...e.props};return Wo("div",{className:`layout-component layout-component-${e.id}`,children:Wo(t,{...r})},e.id)},a=Ct(()=>{const e={search:[],filters:[],reset:[],active:[],actions:[]},t=l.top.filter(e=>!e.id.startsWith("per-page-selector-top")&&!e.id.startsWith("document-count-top")&&!e.id.startsWith("page-navigation-top"));return t.forEach(t=>{t.slot&&e[t.slot].push(t)}),Object.keys(e).forEach(t=>{e[t].sort((e,t)=>(e.order||0)-(t.order||0))}),e},[l.top]),u=Ct(()=>l.top.filter(e=>e.id.startsWith("per-page-selector-top")||e.id.startsWith("document-count-top")||e.id.startsWith("page-navigation-top")),[l.top]),c=u.length>0,d=!c&&a.actions.length>0,f=Ct(()=>a.search.length>0||a.filters.length>0||a.reset.length>0||a.active.length>0||d,[a,d]),h=Ct(()=>u.filter(e=>e.id.startsWith("per-page-selector")),[u]),p=Ct(()=>u.filter(e=>e.id.startsWith("document-count")),[u]),g=Ct(()=>u.filter(e=>e.id.startsWith("page-navigation")),[u]),m=Ct(()=>l.bottom.filter(e=>e.id.includes("action-button")),[l.bottom]),v=Ct(()=>l.bottom.filter(e=>"table-info"===e.id||e.id.startsWith("per-page-selector")),[l.bottom]),y=Ct(()=>l.bottom.filter(e=>e.id.startsWith("document-count")),[l.bottom]),b=Ct(()=>l.bottom.filter(e=>"pagination"===e.id||e.id.startsWith("page-navigation")),[l.bottom]),w=pc({left:h.length>0,center:p.length>0,right:g.length>0||a.actions.length>0}),_=pc({left:v.length>0,center:y.length>0,right:b.length>0||m.length>0}),S=a.active.length>0,x=a.search.length>0||a.filters.length>0||!S&&a.reset.length>0;return Wo(Ae,{children:[!r&&(null===(o=e.header)||void 0===o?void 0:o.show)&&f&&Wo("div",{className:ri("layout-header",e.header.sticky&&"header-sticky",d&&"layout-header--inline-actions",d&&S&&"layout-header--has-active",d&&x&&"layout-header--has-controls"),children:[x&&Wo("div",{className:"header-filters",children:[a.search.map(s),a.filters.map(s),!S&&a.reset.map(s)]}),S&&Wo("div",{className:"header-active",children:[a.active.map(s),a.reset.map(s)]}),d&&Wo("div",{className:"header-actions",children:a.actions.map(s)})]}),!r&&c&&Wo("div",{className:ri("header-controls",w),children:[Wo("div",{className:"pagination-left",children:h.map(s)}),Wo("div",{className:"pagination-center",children:p.map(s)}),Wo("div",{className:"pagination-right",children:[g.map(s),a.actions.map(s)]})]}),t,!r&&(null===(i=e.footer)||void 0===i?void 0:i.show)&&Wo("div",{className:ri("footer-controls",e.footer.sticky&&"footer-controls-sticky",_),children:[Wo("div",{className:"pagination-left",children:v.map(s)}),Wo("div",{className:"pagination-center",children:y.map(s)}),Wo("div",{className:"pagination-right",children:[b.map(s),m.map(s)]})]})]})},mc={components:[],header:{show:!0,sticky:!1},footer:{show:!0,sticky:!1}},vc=(e,t,n="top",r=0,o)=>({id:e,component:t,position:n,order:r,slot:null==o?void 0:o.slot,props:o});let yc=null;const bc=({value:e,onChange:t,onSearch:n,placeholder:r,debounceMs:o=300,className:i,disabled:l=!1})=>{const{i18n:s}=si(),[a,u]=yt(e),c=null!=r?r:s.searchPlaceholder;wt(()=>{u(e)},[e]);const d=Et(e=>{const r=e.target.value;u(r),yc&&clearTimeout(yc),yc=setTimeout(()=>{t(r),n()},o)},[t,n,o]),f=Et(e=>{"Enter"===e.key&&(yc&&clearTimeout(yc),t(a),n())},[a,t,n]),h=Et(()=>{u(""),t(""),n()},[t,n]);return Wo("div",{className:ri("search-input-wrapper",i),style:l?{pointerEvents:"none"}:void 0,children:Wo("div",{className:"search-input-container",children:[Wo("svg",{className:"search-icon",width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:Wo("path",{d:"M9 17A8 8 0 109 1a8 8 0 000 16zM19 19l-4.35-4.35",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),Wo("input",{type:"text",value:a,onInput:d,onKeyDown:f,placeholder:c,className:"search-input","aria-label":s.searchTableData}),a&&Wo("button",{type:"button",onClick:h,className:"search-clear-btn","aria-label":s.clearSearch,title:s.clearSearch,children:Wo("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:Wo("path",{d:"M12 4L4 12M4 4l8 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})})};function wc({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=St(void 0!==e),[i,l]=yt(t);return[o?e:i,Et(e=>{o||l(e)},[])]}const _c="undefined"!=typeof document?_t:()=>{};function Sc(e){const t=St(!0);t.current&&(t.current=!1,e())}const xc={...Dn},Cc={};function Ec(e,t){const n=St(Cc);return n.current===Cc&&(n.current=e(t)),n}const Ic=xc.useInsertionEffect,Rc=Ic&&Ic!==xc.useLayoutEffect?Ic:e=>e();function kc(e){const t=Ec(Pc).current;return t.next=e,Rc(t.effect),t.trampoline}function Pc(){const e={next:void 0,callback:Oc,trampoline:(...t)=>{var n;return null===(n=e.callback)||void 0===n?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function Oc(){}function Mc(e,t,n,r){const o=Ec(Tc).current;return function(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}(o,e,t,n,r)&&Ac(o,[e,t,n,r]),o.callback}function Tc(){return{callback:null,cleanup:null,refs:[]}}function Ac(e,t){e.refs=t,t.every(e=>null==e)?e.callback=null:e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),null!=n){const r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){const o=t[e];if(null!=o)switch(typeof o){case"function":{const t=o(n);"function"==typeof t&&(r[e]=t);break}case"object":o.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){const n=t[e];if(null!=n)switch(typeof n){case"function":{const t=r[e];"function"==typeof t?t():n(null);break}case"object":n.current=null}}}}}}function Fc(e){const t=Ec(Nc,e).current;return t.next=e,_c(t.effect),t}function Nc(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const zc={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Dc={...zc,position:"fixed",top:0,left:0},Lc={...zc,position:"absolute"},Vc=function(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(e=>n.searchParams.append("args[]",e)),`Base UI error #${e}; visit ${n} for the full message.`};const $c=(e,t,n,r,o,i,...l)=>{if(l.length>0)throw new Error(Vc(1));let s;if(!e)throw new Error("Missing arguments");return s=e,s};var jc,Wc,Hc={exports:{}},Bc={};function Uc(){return Wc||(Wc=1,Hc.exports=function(){if(jc)return Bc;jc=1;var e=zo,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,r=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function l(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!t(e,r)}catch(e){return!0}}var s="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var s=t(),a=n({inst:{value:s,getSnapshot:t}}),u=a[0].inst,c=a[1];return o(function(){u.value=s,u.getSnapshot=t,l(u)&&c({inst:u})},[e,s,t]),r(function(){return l(u)&&c({inst:u}),e(function(){l(u)&&c({inst:u})})},[e]),i(s),s};return Bc.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:s,Bc}()),Hc.exports}var qc,Gc,Zc=Uc(),Kc={exports:{}},Jc={},Xc=(Gc||(Gc=1,Kc.exports=function(){if(qc)return Jc;qc=1;var e=zo,t=Uc(),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,l=e.useMemo,s=e.useDebugValue;return Jc.useSyncExternalStoreWithSelector=function(e,t,a,u,c){var d=o(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!i){if(i=!0,r=e,e=u(e),void 0!==c&&f.hasValue){var t=f.value;if(c(t,e))return o=t}return o=e}if(t=o,n(r,e))return t;var l=u(e);return void 0!==c&&c(t,l)?(r=e,t):(r=e,o=l)}var r,o,i=!1,l=void 0===a?null:a;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,a,u,c]);var h=r(e,d[0],d[1]);return i(function(){f.hasValue=!0,f.value=h},[h]),s(h),h},Jc}()),Kc.exports);const Yc=parseInt(In,10);function Qc(e){return Yc>=e}const ed=[];let td;function nd(e){const t=(t,n)=>{const r=Ec(rd).current;let o;try{td=r;for(const e of ed)e.before(r);o=e(t,n);for(const e of ed)e.after(r);r.didInitialize=!0}finally{td=void 0}return o};return t.displayName=e.displayName||e.name,t}function rd(){return{didInitialize:!1}}const od=Qc(19)?function(e,t,n,r,o){const i=td;if(!i)return function(e,t,n,r,o){const i=Et(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return Zc.useSyncExternalStore(e.subscribe,i,i)}(e,t,n,r,o);const l=i.syncIndex;let s;return i.syncIndex+=1,i.didInitialize?(s=i.syncHooks[l],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,o)||(s.store!==e&&(i.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=o,s.value=t(e.getSnapshot(),n,r,o))):(s={store:e,selector:t,a1:n,a2:r,a3:o,value:t(e.getSnapshot(),n,r,o)},i.syncHooks.push(s)),s.value}:function(e,t,n,r,o){return Xc.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,o))};function id(e,t,n,r,o){return od(e,t,n,r,o)}var ld;ld={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){const r=e.syncHooks[n],o=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,o)||(t=!0,r.value=o)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const t of e.syncHooks)n.add(t.store);const r=[];for(const e of n)r.push(e.subscribe(t));return()=>{for(const e of r)e()}}),Zc.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}},ed.push(ld);class sd{constructor(e){te(this,"subscribe",e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})),te(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;const t=this.updateTick;for(const n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(const t in e)if(!Object.is(this.state[t],e[t]))return void this.setState({...this.state,...e})}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){const e={...this.state};this.setState(e)}use(e,t,n,r){return id(this,e,t,n,r)}}function ad(){}const ud=Object.freeze([]),cd=Object.freeze({});class dd extends sd{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){Rt(e);const n=this;_c(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){const n=this;_c(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){const t=this,n=Object.values(e);_c(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){Rt(e);const n=this,r=void 0!==t;_c(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){return(0,this.selectors[e])(this.state,t,n,r)}useState(e,t,n,r){return Rt(e),id(this,this.selectors[e],t,n,r)}useContextCallback(e,t){Rt(e);const n=kc(null!=t?t:ad);this.context[e]=n}useStateSetter(e){const t=St(void 0);return void 0===t.current&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n="function"==typeof e?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{const o=n(e);if(!Object.is(r,o)){const e=r;r=o,t(o,e,this)}})}}function fd(){return"undefined"!=typeof window}function hd(e){return md(e)?(e.nodeName||"").toLowerCase():"#document"}function pd(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function gd(e){var t;return null==(t=(md(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function md(e){return!!fd()&&(e instanceof Node||e instanceof pd(e).Node)}function vd(e){return!!fd()&&(e instanceof Element||e instanceof pd(e).Element)}function yd(e){return!!fd()&&(e instanceof HTMLElement||e instanceof pd(e).HTMLElement)}function bd(e){return!(!fd()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof pd(e).ShadowRoot)}function wd(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Od(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function _d(e){return/^(table|td|th)$/.test(hd(e))}function Sd(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const xd=/transform|translate|scale|rotate|perspective|filter/,Cd=/paint|layout|strict|content/,Ed=e=>!!e&&"none"!==e;let Id;function Rd(e){const t=vd(e)?Od(e):e;return Ed(t.transform)||Ed(t.translate)||Ed(t.scale)||Ed(t.rotate)||Ed(t.perspective)||!kd()&&(Ed(t.backdropFilter)||Ed(t.filter))||xd.test(t.willChange||"")||Cd.test(t.contain||"")}function kd(){return null==Id&&(Id="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Id}function Pd(e){return/^(html|body|#document)$/.test(hd(e))}function Od(e){return pd(e).getComputedStyle(e)}function Md(e){return vd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Td(e){if("html"===hd(e))return e;const t=e.assignedSlot||e.parentNode||bd(e)&&e.host||gd(e);return bd(t)?t.host:t}function Ad(e){const t=Td(e);return Pd(t)?e.ownerDocument?e.ownerDocument.body:e.body:yd(t)&&wd(t)?t:Ad(t)}function Fd(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Ad(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=pd(o);if(i){const e=Nd(l);return t.concat(l,l.visualViewport||[],wd(o)?o:[],e&&n?Fd(e):[])}return t.concat(o,Fd(o,[],n))}function Nd(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function zd(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Dd(e){return(null==e?void 0:e.ownerDocument)||document}function Ld(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}const Vd=[];function $d(e){wt(e,Vd)}const jd=null,Wd=new class{constructor(){te(this,"callbacks",[]),te(this,"callbacksCount",0),te(this,"nextId",1),te(this,"startId",1),te(this,"isScheduled",!1),te(this,"tick",e=>{this.isScheduled=!1;const 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;null===(r=t[n])||void 0===r||r.call(t,e)}})}request(e){const 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){const t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,this.callbacksCount-=1)}};class Hd{constructor(){te(this,"currentId",jd),te(this,"cancel",()=>{this.currentId!==jd&&(Wd.cancel(this.currentId),this.currentId=jd)}),te(this,"disposeEffect",()=>this.cancel)}static create(){return new Hd}static request(e){return Wd.request(e)}static cancel(e){return Wd.cancel(e)}request(e){this.cancel(),this.currentId=Wd.request(()=>{this.currentId=jd,e()})}}function Bd(){const e=Ec(Hd.create).current;return $d(e.disposeEffect),e}class Ud{constructor(){te(this,"currentId",0),te(this,"clear",()=>{0!==this.currentId&&(clearTimeout(this.currentId),this.currentId=0)}),te(this,"disposeEffect",()=>this.clear)}static create(){return new Ud}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=0,t()},e)}isStarted(){return 0!==this.currentId}}function qd(){const e=Ec(Ud.create).current;return $d(e.disposeEffect),e}const{userAgent:Gd,platform:Zd,maxTouchPoints:Kd}="undefined"==typeof navigator?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:null!==(Jd=navigator.platform)&&void 0!==Jd?Jd:"",maxTouchPoints:null!==(Xd=navigator.maxTouchPoints)&&void 0!==Xd?Xd:0};var Jd,Xd;const Yd=Gd.toLowerCase(),Qd=Zd.toLowerCase(),ef=/^i(os$|p)/.test(Qd)||"macintel"===Qd&&Kd>1,tf="android",nf=Qd===tf||Yd.includes(tf),rf=!ef&&Qd.startsWith("mac");Qd.startsWith("win");const of=rf||ef,lf="undefined"!=typeof CSS&&!(null===(Q=(ee=CSS).supports)||void 0===Q||!Q.call(ee,"-webkit-backdrop-filter:none")),sf=!lf&&Yd.includes("firefox");!lf&&Yd.includes("chrom");const af=of,uf=/jsdom|happydom/.test(Yd);function cf(e){e.preventDefault(),e.stopPropagation()}function df(e){return!(""!==e.pointerType||!e.isTrusted)||(nf&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function ff(e){return!uf&&(!nf&&0===e.width&&0===e.height||nf&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function hf(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}const pf="data-base-ui-focusable",gf="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",mf="ArrowLeft",vf="ArrowRight",yf="ArrowUp",bf="ArrowDown";function wf(e){let t=e.activeElement;for(;null!=(null===(n=t)||void 0===n||null===(n=n.shadowRoot)||void 0===n?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function _f(e,t){var n;if(!e||!t)return!1;const r=null===(n=t.getRootNode)||void 0===n?void 0:n.call(t);if(e.contains(t))return!0;if(r&&bd(r)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Sf(e){return"composedPath"in e?e.composedPath()[0]:e.target}function xf(e,t){if(!vd(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,e]of t.entries())if(_f(e,n))return!e.hasAttribute("data-trigger-disabled");return!1}function Cf(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function Ef(e){return yd(e)&&e.matches(gf)}function If(e){return!!e&&"combobox"===e.getAttribute("role")&&Ef(e)}function Rf(e){return e?e.hasAttribute(pf)?e:e.querySelector(`[${pf}]`)||e:null}function kf(e,t,n){const r=function(e,t){return null==t||hf(t)?"function"==typeof e?e():e:0}(e,n);return"number"==typeof r?r:null==r?void 0:r[t]}function Pf(e){return"function"==typeof e?e():e}function Of(e,t){return t||"click"===e||"mousedown"===e}const Mf="none",Tf="trigger-press",Af="trigger-hover",Ff="trigger-focus",Nf="outside-press",zf="item-press",Df="close-press",Lf="clear-press",Vf="input-change",$f="input-clear",jf="focus-out",Wf="escape-key",Hf="list-navigation",Bf="cancel-open",Uf="sibling-open",qf="imperative-action";function Gf(e,t,n,r){let o=!1,i=!1;const l=cd;return{reason:e,event:null!=t?t:new Event("base-ui"),cancel(){o=!0},allowPropagation(){i=!0},get isCanceled(){return o},get isPropagationAllowed(){return i},trigger:n,...l}}function Zf(e,t,n){const r=null!=n?n:cd;return{reason:e,event:null!=t?t:new Event("base-ui"),...r}}const Kf=Zt(function(e,t){const[n,r]=yt();_c(()=>{af&&lf&&r("button")},[]);const o={tabIndex:0,role:n};return Zo.jsx("span",{...e,ref:t,style:Dc,"aria-hidden":!n||void 0,...o,"data-base-ui-focus-guard":""})}),Jf=["top","right","bottom","left"],Xf=Math.min,Yf=Math.max,Qf=Math.round,eh=Math.floor,th=e=>({x:e,y:e}),nh={left:"right",right:"left",bottom:"top",top:"bottom"};function rh(e,t,n){return Yf(e,Xf(t,n))}function oh(e,t){return"function"==typeof e?e(t):e}function ih(e){return e.split("-")[0]}function lh(e){return e.split("-")[1]}function sh(e){return"x"===e?"y":"x"}function ah(e){return"y"===e?"height":"width"}function uh(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function ch(e){return sh(uh(e))}function dh(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const fh=["left","right"],hh=["right","left"],ph=["top","bottom"],gh=["bottom","top"];function mh(e){const t=ih(e);return nh[t]+e.slice(t.length)}function vh(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function yh(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function bh(e,t,n){return Math.floor(e/t)!==n}function wh(e,t){return t<0||t>=e.length}function _h(e,t){return xh(e.current,{disabledIndices:t})}function Sh(e,t){return xh(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function xh(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let i=t;do{i+=n?-o:o}while(i>=0&&i<=e.length-1&&Ch(e,i,r));return i}function Ch(e,t,n){var r;if("function"==typeof n?n(t):null!==(r=null==n?void 0:n.includes(t))&&void 0!==r&&r)return!0;const o=e[t];return!!o&&(!Eh(o)||!n&&(o.hasAttribute("disabled")||"true"===o.getAttribute("aria-disabled")))}function Eh(e,t=(e?Od(e):null)){return!(!(e&&e.isConnected&&t)||function(e){return"hidden"===e.visibility||"collapse"===e.visibility}(t))&&("function"==typeof e.checkVisibility?e.checkVisibility():"none"!==t.display&&"contents"!==t.display)}function Ih(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return bd(n)?n.host:null}function Rh(e){for(const t of Array.from(e.children))if("summary"===hd(t))return t;return null}function kh(e,t){const n=Rh(t);return!!n&&(e===n||_f(n,e))}function Ph(e){const t=e?hd(e):"";return null!=e&&e.matches('a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]')&&("summary"!==t||null!=e.parentElement&&"details"===hd(e.parentElement)&&Rh(e.parentElement)===e)&&("details"!==t||null==Rh(e))&&("input"!==t||"hidden"!==e.type)}function Oh(e){if(!Ph(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Ih(t)){const n=t!==e,r="slot"===hd(t);if(t.hasAttribute("inert"))return!1;if(n&&"details"===hd(t)&&!t.open&&!kh(e,t)||t.hasAttribute("hidden")||!r&&!Mh(t,n))return!1}return!0}function Mh(e,t){const n=Od(e);return t?"none"!==n.display:Eh(e,n)}function Th(e){const t=e.tabIndex;if(t<0){const t=hd(e);if("details"===t||"audio"===t||"video"===t||yd(e)&&e.isContentEditable)return 0}return t}function Ah(e){if("input"!==hd(e))return null;const t=e;return"radio"===t.type&&""!==t.name?t:null}function Fh(e){if(yd(e)&&"slot"===hd(e)){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return yd(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Nh(e,t){Fh(e).forEach(e=>{Ph(e)&&t.push(e),Nh(e,t)})}function zh(e,t,n){Fh(e).forEach(e=>{yd(e)&&e.matches(t)&&n.push(e),zh(e,t,n)})}function Dh(e){return Oh(e)&&Th(e)>=0}function Lh(e){const t=[];return Nh(e,t),t.filter(Oh)}function Vh(e){const t=Lh(e);return t.filter(e=>Th(e)>=0&&function(e,t){const n=Ah(e);if(!n)return!0;const r=t.find(e=>{const t=Ah(e);return(null==t?void 0:t.name)===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{const t=Ah(e);return(null==t?void 0:t.name)===n.name&&t.form===n.form})===n}(e,t))}function $h(e,t){const n=Vh(e),r=n.length;if(0===r)return;const o=wf(Dd(e)),i=n.indexOf(o);return n[-1===i?1===t?0:r-1:i+t]}function jh(e){return $h(Dd(e).body,1)||e}function Wh(e){return $h(Dd(e).body,-1)||e}function Hh(e,t){if(!e)return null;const n=Vh(Dd(e).body),r=n.length;if(0===r)return null;const o=n.indexOf(e);return-1===o?null:n[(o+t+r)%r]}function Bh(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!_f(n,r)}function Uh(e){const t=[];zh(e,"[data-tabindex]",t),t.forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}function qh(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>{var r;return[...!n||null!==(r=t.context)&&void 0!==r&&r.open?[t]:[],...qh(e,t.id,n)]})}function Gh(e,t){var n;let r=[],o=null===(n=e.find(e=>e.id===t))||void 0===n?void 0:n.parentId;for(;o;){const t=e.find(e=>e.id===o);o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function Zh(e){return`data-base-ui-${e}`}let Kh=0;function Jh(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:o}=t;function i(){o&&!o()||null==e||e.focus({preventScroll:n})}if(cancelAnimationFrame(Kh),r)return i(),ad;const l=requestAnimationFrame(i);return Kh=l,()=>{Kh===l&&(cancelAnimationFrame(l),Kh=0)}}const Xh={inert:new WeakMap,"aria-hidden":new WeakMap},Yh="data-base-ui-inert",Qh={inert:new WeakSet,"aria-hidden":new WeakSet};let ep=new WeakMap,tp=0;function np(e){return e?bd(e)?e.host:np(e.parentNode):null}const rp=(e,t)=>t.map(t=>{if(e.contains(t))return t;const n=np(t);return e.contains(n)?n:null}).filter(e=>null!=e),op=e=>{const t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},ip=(e,t,n)=>{const r=[],o=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{"script"!==hd(e)&&(t.has(e)?o(e):r.push(e))})};return o(e),r};function lp(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0}=t;return function(e,t,n,r,{mark:o=!0}){let i=null;r?i="inert":n&&(i="aria-hidden");let l=null,s=null;const a=rp(t,e),u=o?ip(t,op(a),new Set(a)):[],c=[],d=[];if(i){const e=Xh[i],n=function(e){return Qh[e]}(i);s=n,l=e;const r=rp(t,Array.from(t.querySelectorAll("[aria-live]"))),o=a.concat(r);ip(t,op(o),new Set(o)).forEach(t=>{const r=t.getAttribute(i),o=null!==r&&"false"!==r,l=(e.get(t)||0)+1;e.set(t,l),c.push(t),1===l&&o&&n.add(t),o||t.setAttribute(i,"inert"===i?"":"true")})}return o&&u.forEach(e=>{const t=(ep.get(e)||0)+1;ep.set(e,t),d.push(e),1===t&&e.setAttribute(Yh,"")}),tp+=1,()=>{l&&c.forEach(e=>{const t=(l.get(e)||0)-1;var n,r;l.set(e,t),t||(null!==(n=s)&&void 0!==n&&n.has(e)||!i||e.removeAttribute(i),null===(r=s)||void 0===r||r.delete(e))}),o&&d.forEach(e=>{const t=(ep.get(e)||0)-1;ep.set(e,t),t||e.removeAttribute(Yh)}),tp-=1,tp||(Xh.inert=new WeakMap,Xh["aria-hidden"]=new WeakMap,Qh.inert=new WeakSet,Qh["aria-hidden"]=new WeakSet,ep=new WeakMap)}}(e,Dd(e[0]).body,n,r,{mark:o})}let sp=0;const ap=xc.useId;function up(e,t){if(void 0!==ap){const n=ap();return null!=e?e:t?`${t}-${n}`:n}return function(e,t="mui"){const[n,r]=yt(e),o=e||n;return wt(()=>{null==n&&(sp+=1,r(`${t}-${sp}`))},[n,t]),o}(e,t)}function cp(e){var t;if(!kn(e))return null;const n=e,r=n.props;return null!==(t=Qc(19)?null==r?void 0:r.ref:n.ref)&&void 0!==t?t:null}function dp(e,t){return e&&!t?e:!e&&t?t:e||t?{...e,...t}:void 0}const fp={};function hp(e,t,n,r,o){if(!(n||r||o||e))return pp(t);let i=pp(e);return t&&(i=gp(i,t)),n&&(i=gp(i,n)),r&&(i=gp(i,r)),o&&(i=gp(i,o)),i}function pp(e){return vp(e)?{...yp(e,fp)}:function(e){const t={...e};for(const e in t){const n=t[e];mp(e,n)&&(t[e]=wp(n))}return t}(e)}function gp(e,t){return vp(t)?yp(t,e):function(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":e[n]=dp(e.style,r);break;case"className":e[n]=Sp(e.className,r);break;default:mp(n,r)?e[n]=bp(e[n],r):e[n]=r}}return e}(e,t)}function mp(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2);return 111===n&&110===r&&o>=65&&o<=90&&("function"==typeof t||void 0===t)}function vp(e){return"function"==typeof e}function yp(e,t){return vp(e)?e(t):null!=e?e:fp}function bp(e,t){return t?e?(...n)=>{const r=n[0];if(xp(r)){const o=r;_p(o);const i=t(...n);return o.baseUIHandlerPrevented||null==e||e(...n),i}const o=t(...n);return null==e||e(...n),o}:wp(t):e}function wp(e){return e?(...t)=>{const n=t[0];return xp(n)&&_p(n),e(...t)}:e}function _p(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Sp(e,t){return t?e?t+" "+e:t:e}function xp(e){return null!=e&&"object"==typeof e&&"nativeEvent"in e}function Cp(e,t,n={}){var r;const o=t.render,i=function(e,t={}){var n;const{className:r,style:o,render:i}=e,{state:l=cd,ref:s,props:a,stateAttributesMapping:u,enabled:c=!0}=t,d=c?function(e,t){return"function"==typeof e?e(t):e}(r,l):void 0,f=c?function(e,t){return"function"==typeof e?e(t):e}(o,l):void 0,h=c?function(e,t){const n={};for(const r in e){const o=e[r];if(null!=t&&t.hasOwnProperty(r)){const e=t[r](o);null!=e&&Object.assign(n,e);continue}!0===o?n[`data-${r.toLowerCase()}`]="":o&&(n[`data-${r.toLowerCase()}`]=o.toString())}return n}(l,u):cd,p=c&&a?function(e){return Array.isArray(e)?function(e){if(0===e.length)return fp;if(1===e.length)return pp(e[0]);let t=pp(e[0]);for(let n=1;n<e.length;n+=1)t=gp(t,e[n]);return t}(e):hp(void 0,e)}(a):void 0,g=c?null!==(n=dp(h,p))&&void 0!==n?n:{}:cd;return"undefined"!=typeof document&&(c?Array.isArray(s)?g.ref=function(e){const t=Ec(Tc).current;return function(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}(t,e)&&Ac(t,e),t.callback}([g.ref,cp(i),...s]):g.ref=Mc(g.ref,cp(i),s):Mc(null,null)),c?(void 0!==d&&(g.className=Sp(g.className,d)),void 0!==f&&(g.style=dp(g.style,f)),g):cd}(t,n);return!1===n.enabled?null:function(e,t,n,r){if(t){var o;if("function"==typeof t)return t(n,r);const e=hp(n,t.props);e.ref=n.ref;let i=t;return(null===(o=i)||void 0===o?void 0:o.$$typeof)===Ep&&(i=Jt.toArray(t)[0]),Mn(i,e)}if(e&&"string"==typeof e)return function(e,t){return"button"===e?Oe("button",{type:"button",...t,key:t.key}):"img"===e?Oe("img",{alt:"",...t,key:t.key}):Oe(e,t)}(e,n);throw new Error(Vc(8))}(e,o,i,null!==(r=n.state)&&void 0!==r?r:cd)}const Ep=Symbol.for("react.lazy"),Ip={style:{transition:"none"}},Rp={fallbackAxisSide:"none"},kp={fallbackAxisSide:"end"},Pp={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Op=rt(null),Mp=()=>It(Op),Tp=Zh("portal"),Ap=Zt(function(e,t){const{render:n,className:r,style:o,children:i,container:l,renderGuards:s,...a}=e,{portalNode:u,portalSubtree:c}=function(e={}){const{ref:t,container:n,componentProps:r=cd,elementProps:o}=e,i=up(),l=Mp(),s=null==l?void 0:l.portalNode,[a,u]=yt(null),[c,d]=yt(null),f=kc(e=>{null!==e&&d(e)}),h=St(null);_c(()=>{var e,t;if(null===n)return void(h.current&&(h.current=null,d(null),u(null)));if(null==i)return;const r=null!==(e=null!==(t=n&&(md(n)?n:n.current))&&void 0!==t?t:s)&&void 0!==e?e:document.body;null!=r?h.current!==r&&(h.current=r,d(null),u(r)):h.current&&(h.current=null,d(null),u(null))},[n,s,i]);const p=Cp("div",r,{ref:[t,f],props:[{id:i,[Tp]:""},o]});return{portalNode:c,portalSubtree:a&&p?un(p,a):null}}({container:l,ref:t,componentProps:e,elementProps:a}),d=St(null),f=St(null),h=St(null),p=St(null),[g,m]=yt(null),v=St(!1),y=null==g?void 0:g.modal,b=null==g?void 0:g.open,w="boolean"==typeof s?s:!!g&&!g.modal&&g.open&&!!u;wt(()=>{if(u&&!y)return zd(Ld(u,"focusin",e,!0),Ld(u,"focusout",e,!0));function e(e){u&&e.relatedTarget&&Bh(e)&&("focusin"===e.type?v.current&&(Uh(u),v.current=!1):(function(e){Vh(e).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}(u),v.current=!0))}},[u,y]),_c(()=>{u&&!0===b&&v.current&&(Uh(u),v.current=!1)},[b,u]);const _=Ct(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:h,afterInsideRef:p,portalNode:u,setFocusManagerState:m}),[u]);return Zo.jsxs(Ae,{children:[c,Zo.jsxs(Op.Provider,{value:_,children:[w&&u&&Zo.jsx(Kf,{"data-type":"outside",ref:d,onFocus:e=>{if(Bh(e,u)){var t;null===(t=h.current)||void 0===t||t.focus()}else{const e=Wh(g?g.domReference:null);null==e||e.focus()}}}),w&&u&&Zo.jsx("span",{"aria-owns":u.id,style:Pp}),u&&un(i,u),w&&u&&Zo.jsx(Kf,{"data-type":"outside",ref:f,onFocus:e=>{if(Bh(e,u)){var t;null===(t=p.current)||void 0===t||t.focus()}else{const t=jh(g?g.domReference:null);null==t||t.focus(),null!=g&&g.closeOnFocusOut&&(null==g||g.onOpenChange(!1,Gf(jf,e.nativeEvent)))}}})]})]})});function Fp(){const e=new Map;return{emit(t,n){var r;null===(r=e.get(t))||void 0===r||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;null===(r=e.get(t))||void 0===r||r.delete(n)}}}class Np{constructor(){te(this,"nodesRef",{current:[]}),te(this,"events",Fp())}addNode(e){this.nodesRef.current.push(e)}removeNode(e){const t=this.nodesRef.current.findIndex(t=>t===e);-1!==t&&this.nodesRef.current.splice(t,1)}}const zp=rt(null),Dp=rt(null),Lp=()=>{var e;return(null===(e=It(zp))||void 0===e?void 0:e.id)||null},Vp=e=>{const t=It(Dp);return null!=e?e:t};function $p(e){const t=up(),n=Vp(e),r=Lp();return _c(()=>{if(!t)return;const e={id:t,parentId:r};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}},[n,t,r]),t}function jp(e){const{children:t,id:n}=e,r=Lp();return Zo.jsx(zp.Provider,{value:Ct(()=>({id:n,parentId:r}),[n,r]),children:t})}function Wp(e){const{children:t,externalTree:n}=e,r=Ec(()=>null!=n?n:new Np).current;return Zo.jsx(Dp.Provider,{value:r,children:t})}function Hp(e){return null==e?e:"current"in e?e.current:e}let Bp=[];function Up(){Bp=Bp.filter(e=>{var t;return null===(t=e.deref())||void 0===t?void 0:t.isConnected})}function qp(e){Up(),e&&"body"!==hd(e)&&(Bp.push(new WeakRef(e)),Bp.length>20&&(Bp=Bp.slice(-20)))}function Gp(){var e;return Up(),null===(e=Bp[Bp.length-1])||void 0===e?void 0:e.deref()}function Zp(e){var t;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex"))return;if(null===(t=e.getAttribute("role"))||void 0===t||!t.includes("dialog"))return;const n=Lh(e).filter(e=>{const t=e.getAttribute("data-tabindex")||"";return Dh(e)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),r=e.getAttribute("tabindex");0===n.length?"0"!==r&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):("-1"!==r||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Kp(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:i=!0,restoreFocus:l=!1,modal:s=!0,closeOnFocusOut:a=!0,openInteractionType:u="",nextFocusableElement:c,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:h,getInsideElements:p}=e,g="rootStore"in t?t.rootStore:t,m=g.useState("open"),v=g.useState("domReferenceElement"),y=g.useState("floatingElement"),{events:b,dataRef:w}=g.context,_=kc(()=>{var e;return null===(e=w.current.floatingContext)||void 0===e?void 0:e.nodeId}),S=!1===o,x=If(v)&&S,C=Fc(o),E=Fc(i),I=Fc(u),R=Fc(m),k=Vp(h),P=Mp(),O=St(!1),M=St(!1),T=St(!1),A=St(null),F=St(""),N=St(""),z=St(null),D=St(null),L=Mc(z,f,null==P?void 0:P.beforeInsideRef),V=Mc(D,null==P?void 0:P.afterInsideRef),$=qd(),j=qd(),W=Bd(),H=null!=P,B=Rf(y),U=kc((e=B)=>e?Vh(e):[]),q=kc(()=>{var e;return null!==(e=null==p?void 0:p().filter(e=>null!=e))&&void 0!==e?e:[]});wt(()=>{if(!r&&s)return Ld(Dd(B),"keydown",function(e){"Tab"===e.key&&_f(B,wf(Dd(B)))&&0===U().length&&!x&&cf(e)})},[r,B,s,x,U]),wt(()=>{if(r||!m)return;const e=Dd(B);function t(){T.current=!1}return zd(Ld(e,"pointerdown",function(e){const t=Sf(e),n=q(),r=_f(y,t)||_f(v,t)||_f(null==P?void 0:P.portalNode,t)||n.some(e=>e===t||_f(e,t));T.current=!r,N.current=e.pointerType||"keyboard",null!=t&&t.closest("[data-base-ui-click-trigger]")&&(M.current=!0,j.start(0,()=>{M.current=!1}))},!0),Ld(e,"pointerup",t,!0),Ld(e,"pointercancel",t,!0),Ld(e,"keydown",function(){N.current="keyboard"},!0),t)},[r,y,v,B,m,P,j,q]),wt(()=>{if(r||!a)return;const e=Dd(B);function t(t){const n=t.relatedTarget,r=t.currentTarget,o=Sf(t);s&&null==n&&null!=o&&_f(y,o)&&qp(o),queueMicrotask(()=>{const i=_(),a=g.context.triggerElements,u=q(),f=(null==n?void 0:n.hasAttribute(Zh("focus-guard")))&&[z.current,D.current,null==P?void 0:P.beforeInsideRef.current,null==P?void 0:P.afterInsideRef.current,null==P?void 0:P.beforeOutsideRef.current,null==P?void 0:P.afterOutsideRef.current,Hp(d),Hp(c)].includes(n),h=!(_f(v,n)||_f(y,n)||_f(n,y)||_f(null==P?void 0:P.portalNode,n)||u.some(e=>e===n||_f(e,n))||null!=n&&a.hasElement(n)||a.hasMatchingElement(e=>_f(e,n))||f||k&&(qh(k.nodesRef.current,i).find(e=>{var t,r;return _f(null===(t=e.context)||void 0===t?void 0:t.elements.floating,n)||_f(null===(r=e.context)||void 0===r?void 0:r.elements.domReference,n)})||Gh(k.nodesRef.current,i).find(e=>{var t,r,o;return[null===(t=e.context)||void 0===t?void 0:t.elements.floating,Rf(null===(r=e.context)||void 0===r?void 0:r.elements.floating)].includes(n)||(null===(o=e.context)||void 0===o?void 0:o.elements.domReference)===n})));if(r===v&&B&&Zp(B),l&&r!==v&&!Eh(o)&&wf(e)===e.body){if(yd(B)&&(B.focus(),"popup"===l))return void W.request(()=>{B.focus()});const e=U(),t=A.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||B;yd(n)&&n.focus()}w.current.insideReactTree?w.current.insideReactTree=!1:!x&&s||!n||!h||M.current||!x&&n===Gp()||(O.current=!0,g.setOpen(!1,Gf(jf,t)))})}const n=yd(v)?v:null;return y||n?zd(n&&Ld(n,"focusout",t),n&&Ld(n,"pointerdown",function(){M.current=!0,j.start(0,()=>{M.current=!1})}),y&&Ld(y,"focusin",function(e){const t=Sf(e);Dh(t)&&(A.current=t)}),y&&Ld(y,"focusout",t),y&&P&&Ld(y,"focusout",function(){T.current||(w.current.insideReactTree=!0,$.start(0,()=>{w.current.insideReactTree=!1}))},!0)):void 0},[r,v,y,B,s,k,P,g,a,l,U,x,_,w,$,j,W,c,d,q]),wt(()=>{var e,t;if(r||!y||!m)return;const n=Array.from((null==P||null===(e=P.portalNode)||void 0===e?void 0:e.querySelectorAll(`[${Zh("portal")}]`))||[]),o=null===(t=(k?Gh(k.nodesRef.current,_()):[]).find(e=>{var t;return If((null===(t=e.context)||void 0===t?void 0:t.elements.domReference)||null)}))||void 0===t||null===(t=t.context)||void 0===t?void 0:t.elements.domReference,i=[y,...n,z.current,D.current,null==P?void 0:P.beforeOutsideRef.current,null==P?void 0:P.afterOutsideRef.current,...q(),o,Hp(d),Hp(c),x?v:null].filter(e=>null!=e),l=lp(i,{ariaHidden:s||x,mark:!1}),a=[y,...n].filter(e=>null!=e),u=lp(a);return()=>{u(),l()}},[m,r,v,y,s,P,x,k,_,c,d,q]),_c(()=>{if(!m||r||!yd(B))return;const e=Dd(B),t=wf(e);queueMicrotask(()=>{const n=C.current,r="function"==typeof n?n(I.current||""):n;if(void 0===r||!1===r)return;if(_f(B,t))return;let o=null;const i=()=>(null==o&&(o=U(B)),o[0]||B);let l;l=!0===r||null===r?i():Hp(r),l=l||i();const s=_f(B,wf(e));Jh(l,{preventScroll:l===B,shouldFocus(){if(!R.current)return!1;if(s)return!0;const t=wf(e);return!(t!==l&&_f(B,t))}})})},[r,m,B,U,C,I,R]),_c(()=>{if(r||!B)return;const e=Dd(B),t=wf(e),n=null==I.current;function o(e){if(e.open||(F.current=function(e,t){const n=pd(Sf(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||(0===e.detail?"keyboard":"mouse"):""}(e.nativeEvent,N.current)),e.reason===Af&&"mouseleave"===e.nativeEvent.type&&(O.current=!0),e.reason===Nf)if(e.nested)O.current=!1;else if(df(e.nativeEvent)||ff(e.nativeEvent))O.current=!1;else{let e=!1;Dd(B).createElement("div").focus({get preventScroll(){return e=!0,!1}}),O.current=!e}}return qp(t),b.on("openchange",o),()=>{b.off("openchange",o);const r=wf(e),i=q(),l=_f(y,r)||i.some(e=>e===r||_f(e,r))||k&&qh(k.nodesRef.current,_(),!1).some(e=>{var t;return _f(null===(t=e.context)||void 0===t?void 0:t.elements.floating,r)}),s=E.current,a=function(){const e=E.current;let r="function"==typeof e?e(F.current):e;if(void 0===r||!1===r)return null;null===r&&(r=!0);const o=null!=v&&v.isConnected?v:null,i=null!=t&&t.isConnected&&"body"!==hd(t)?t:null;let l=n?i||o:o||i;return l||(l=Gp()||null),"boolean"==typeof r?l:Hp(r)||l||null}();queueMicrotask(()=>{const t=(n=a)?Dh(n)?n:Vh(n)[0]||n:null;var n;const o="boolean"!=typeof s;s&&!O.current&&yd(t)&&(o||t===r||r===e.body||l)&&t.focus({preventScroll:!0}),O.current=!1})}},[r,y,B,E,I,b,k,v,_,q]),_c(()=>{if(!lf||m||!y)return;const e=wf(Dd(y));yd(e)&&Ef(e)&&_f(y,e)&&e.blur()},[m,y]),_c(()=>{if(!r&&P)return P.setFocusManagerState({modal:s,closeOnFocusOut:a,open:m,onOpenChange:g.setOpen,domReference:v}),()=>{P.setFocusManagerState(null)}},[r,P,s,m,g,a,v]),_c(()=>{if(!r&&B)return Zp(B),()=>{queueMicrotask(Up)}},[r,B]);const G=!r&&(!s||!x)&&(H||s);return Zo.jsxs(Ae,{children:[G&&Zo.jsx(Kf,{"data-type":"inside",ref:L,onFocus:e=>{if(s){const e=U();Jh(e[e.length-1])}else if(null!=P&&P.portalNode)if(O.current=!1,Bh(e,P.portalNode)){const e=jh(v);null==e||e.focus()}else{var t;null===(t=Hp(null!=d?d:P.beforeOutsideRef))||void 0===t||t.focus()}}}),n,G&&Zo.jsx(Kf,{"data-type":"inside",ref:V,onFocus:e=>{if(s)Jh(U()[0]);else if(null!=P&&P.portalNode)if(a&&(O.current=!0),Bh(e,P.portalNode)){const e=Wh(v);null==e||e.focus()}else{var t;null===(t=Hp(null!=c?c:P.afterOutsideRef))||void 0===t||t.focus()}}})]})}function Jp(e,t={}){const{enabled:n=!0,event:r="click",toggle:o=!0,ignoreMouse:i=!1,stickIfOpen:l=!0,touchOpenDelay:s=0,reason:a=Tf}=t,u="rootStore"in e?e.rootStore:e,c=u.context.dataRef,d=St(void 0),f=Bd(),h=qd(),p=Ct(()=>{function e(e,t,n,r){const o=Gf(a,t,n);e&&"touch"===r&&s>0?h.start(s,()=>{u.setOpen(!0,o)}):u.setOpen(e,o)}function t(e,t,n){const r=c.current.openEvent,i=u.select("domReferenceElement")!==t;return!((!e||!i)&&e&&o&&(!r||!l||n(r.type)))}return{onPointerDown(e){d.current=e.pointerType},onMouseDown(n){const o=d.current,l=n.nativeEvent,s=u.select("open");if(0!==n.button||"click"===r||hf(o,!0)&&i)return;const a=t(s,n.currentTarget,e=>"click"===e||"mousedown"===e),c=Sf(l);if(Ef(c))return void e(a,l,c,o);const h=n.currentTarget;f.request(()=>{e(a,l,h,o)})},onClick(n){if("mousedown-only"===r)return;const o=d.current;"mousedown"===r&&o?d.current=void 0:hf(o,!0)&&i||e(t(u.select("open"),n.currentTarget,e=>"click"===e||"mousedown"===e||"keydown"===e||"keyup"===e),n.nativeEvent,n.currentTarget,o)},onKeyDown(){d.current=void 0}}},[c,r,i,a,u,l,o,f,h,s]);return Ct(()=>n?{reference:p}:cd,[n,p])}function Xp(){return!1}function Yp(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:o=!0,outsidePressEvent:i="sloppy",referencePress:l=Xp,bubbles:s,externalTree:a}=t,u="rootStore"in e?e.rootStore:e,c=u.useState("open"),d=u.useState("floatingElement"),{dataRef:f}=u.context,h=Vp(a),p=kc("function"==typeof o?o:()=>!1),g="function"==typeof o?p:o,m=!1!==g,v=kc(()=>i),{escapeKey:y,outsidePress:b}={escapeKey:"boolean"==typeof(w=s)?w:null!==(_=null==w?void 0:w.escapeKey)&&void 0!==_&&_,outsidePress:"boolean"==typeof w?w:null===(S=null==w?void 0:w.outsidePress)||void 0===S||S};var w,_,S;const x=St(!1),C=St(!1),E=St(!1),I=St(!1),R=St(""),k=St(null),P=qd(),O=qd(),M=kc(()=>{O.clear(),f.current.insideReactTree=!1}),T=kc(e=>{var t;const n=null===(t=f.current.floatingContext)||void 0===t?void 0:t.nodeId;return(h?qh(h.nodesRef.current,n):[]).some(t=>{var n;return(null===(n=t.context)||void 0===n?void 0:n.open)&&!t.context.dataRef.current[e]})}),A=kc(e=>Cf(e,u.select("floatingElement"))||Cf(e,u.select("domReferenceElement"))),F=kc(e=>{l()&&u.setOpen(!1,Gf(Tf,e.nativeEvent))}),N=kc(e=>{if(!c||!n||!r||"Escape"!==e.key)return;if(I.current)return;if(!y&&T("__escapeKeyBubbles"))return;const t=function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,o=Gf(Wf,t);u.setOpen(!1,o),o.isCanceled||e.preventDefault(),y||o.isPropagationAllowed||e.stopPropagation()}),z=kc(()=>{f.current.insideReactTree=!0,O.start(0,M)}),D=kc(e=>{if(!c||!n||0!==e.button)return;const t=Sf(e.nativeEvent);_f(u.select("floatingElement"),t)&&(x.current||(x.current=!0,C.current=!1))}),L=kc(e=>{c&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(C.current=!0)});wt(()=>{if(!c||!n)return;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;const e=new Ud,t=new Ud;function o(){E.current=!0,t.start(0,()=>{E.current=!1})}function i(){x.current=!1,C.current=!1}function l(){const e=R.current,t="pen"!==e&&e?e:"mouse",n=v(),r="function"==typeof n?n():n;return"string"==typeof r?r:r[t]}function s(e){var t;const n=null===(t=f.current.floatingContext)||void 0===t?void 0:t.nodeId,r=h&&qh(h.nodesRef.current,n).some(t=>{var n;return Cf(e,null===(n=t.context)||void 0===n?void 0:n.elements.floating)});return A(e)||r}function a(e){if(function(e){const t=l();return"intentional"===t&&"click"!==e.type||"sloppy"===t&&"click"===e.type}(e))return"click"===e.type||A(e)||(t.clear(),E.current=!1),void M();if(f.current.insideReactTree)return void M();const n=Sf(e),r=`[${Zh("inert")}]`,o=vd(n)?n.getRootNode():null,i=Array.from((bd(o)?o:Dd(u.select("floatingElement"))).querySelectorAll(r)),a=u.context.triggerElements;if(n&&(a.hasElement(n)||a.hasMatchingElement(e=>_f(e,n))))return;let c=vd(n)?n:null;for(;c&&!Pd(c);){const e=Td(c);if(Pd(e)||!vd(e))break;c=e}if(!i.length||!vd(n)||n.matches("html,body")||_f(n,u.select("floatingElement"))||!i.every(e=>!_f(c,e))){if(yd(n)&&!("touches"in e)){const t=Pd(n),r=Od(n),o=/auto|scroll/,i=t||o.test(r.overflowX),l=t||o.test(r.overflowY),s=i&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,a=l&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,u="rtl"===r.direction,c=a&&(u?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(c||d)return}if(!s(e))return"intentional"===l()&&E.current?(t.clear(),void(E.current=!1)):void(("function"!=typeof g||g(e))&&(T("__outsidePressBubbles")||(u.setOpen(!1,Gf(Nf,e)),M())))}}function p(e){if("sloppy"!==l()||!u.select("open")||!n||A(e))return;const t=e.touches[0];t&&(k.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},P.start(1e3,()=>{k.current&&(k.current.dismissOnTouchEnd=!1,k.current.dismissOnMouseDown=!1)}))}function w(e,t){const n=Sf(e);if(!n)return;const r=Ld(n,e.type,()=>{t(e),r()})}function _(e){P.clear(),"pointerdown"===e.type&&(R.current=e.pointerType),"mousedown"===e.type&&k.current&&!k.current.dismissOnMouseDown||w(e,e=>{"pointerdown"===e.type?function(e){"sloppy"===l()&&"touch"!==e.pointerType&&u.select("open")&&n&&!A(e)&&a(e)}(e):a(e)})}function S(e){if(!x.current)return;const n=C.current;i(),"intentional"===l()&&("pointercancel"!==e.type?s(e)||(n?o():("function"!=typeof g||g(e))&&(t.clear(),E.current=!0,M())):n&&o())}function O(e){if("sloppy"!==l()||!k.current||A(e))return;const t=e.touches[0];if(!t)return;const n=Math.abs(t.clientX-k.current.startX),r=Math.abs(t.clientY-k.current.startY),o=Math.sqrt(n*n+r*r);o>5&&(k.current.dismissOnTouchEnd=!0),o>10&&(a(e),P.clear(),k.current=null)}function F(e){"sloppy"===l()&&k.current&&!A(e)&&(k.current.dismissOnTouchEnd&&a(e),P.clear(),k.current=null)}const z=Dd(d),D=zd(r&&zd(Ld(z,"keydown",N),Ld(z,"compositionstart",function(){e.clear(),I.current=!0}),Ld(z,"compositionend",function(){e.start(lf?5:0,()=>{I.current=!1})})),m&&zd(Ld(z,"click",_,!0),Ld(z,"pointerdown",_,!0),Ld(z,"pointerup",S,!0),Ld(z,"pointercancel",S,!0),Ld(z,"mousedown",_,!0),Ld(z,"mouseup",S,!0),Ld(z,"touchstart",function(e){R.current="touch",w(e,p)},!0),Ld(z,"touchmove",function(e){w(e,O)},!0),Ld(z,"touchend",function(e){w(e,F)},!0)));return()=>{D(),e.clear(),t.clear(),i(),E.current=!1}},[f,d,r,m,g,c,n,y,b,N,M,v,T,A,h,u,P]),wt(M,[g,M]);const V=Ct(()=>({onKeyDown:N,onPointerDown:F,onClick:F}),[N,F]),$=Ct(()=>({onKeyDown:N,onPointerDown:L,onMouseDown:L,onClickCapture:z,onMouseDownCapture(e){z(),D(e)},onPointerDownCapture(e){z(),D(e)},onMouseUpCapture:z,onTouchEndCapture:z,onTouchMoveCapture:z}),[N,z,D,L]);return Ct(()=>n?{reference:V,floating:$,trigger:V}:{},[n,V,$])}function Qp(e,t,n){let{reference:r,floating:o}=e;const i=uh(t),l=ch(t),s=ah(l),a=ih(t),u="y"===i,c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let h;switch(a){case"top":h={x:c,y:r.y-o.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(lh(t)){case"start":h[l]-=f*(n&&u?-1:1);break;case"end":h[l]+=f*(n&&u?-1:1)}return h}async function eg(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:s,strategy:a}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=oh(t,e),p=vh(h),g=s[f?"floating"===d?"reference":"floating":d],m=yh(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:a})),v="floating"===d?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=yh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:a}):v);return{top:(m.top-w.top+p.top)/b.y,bottom:(w.bottom-m.bottom+p.bottom)/b.y,left:(m.left-w.left+p.left)/b.x,right:(w.right-m.right+p.right)/b.x}}function tg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ng(e){return Jf.some(t=>e[t]>=0)}const rg=new Set(["left","top"]);function og(e){const t=Od(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=yd(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,s=Qf(n)!==i||Qf(r)!==l;return s&&(n=i,r=l),{width:n,height:r,$:s}}function ig(e){return vd(e)?e:e.contextElement}function lg(e){const t=ig(e);if(!yd(t))return th(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=og(t);let l=(i?Qf(n.width):n.width)/r,s=(i?Qf(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),s&&Number.isFinite(s)||(s=1),{x:l,y:s}}const sg=th(0);function ag(e){const t=pd(e);return kd()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:sg}function ug(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=ig(e);let l=th(1);t&&(r?vd(r)&&(l=lg(r)):l=lg(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==pd(e))&&t}(i,n,r)?ag(i):th(0);let a=(o.left+s.x)/l.x,u=(o.top+s.y)/l.y,c=o.width/l.x,d=o.height/l.y;if(i){const e=pd(i),t=r&&vd(r)?pd(r):r;let n=e,o=Nd(n);for(;o&&r&&t!==n;){const e=lg(o),t=o.getBoundingClientRect(),r=Od(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;a*=e.x,u*=e.y,c*=e.x,d*=e.y,a+=i,u+=l,n=pd(o),o=Nd(n)}}return yh({width:c,height:d,x:a,y:u})}function cg(e,t){const n=Md(e).scrollLeft;return t?t.left+n:ug(gd(e)).left+n}function dg(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-cg(e,n),y:n.top+t.scrollTop}}function fg(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=pd(e),r=gd(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,s=0,a=0;if(o){i=o.width,l=o.height;const e=kd();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,a=o.offsetTop)}const u=cg(r);if(u<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(r.clientWidth-t.clientWidth-o);l<=25&&(i-=l)}else u<=25&&(i+=u);return{width:i,height:l,x:s,y:a}}(e,n);else if("document"===t)r=function(e){const t=gd(e),n=Md(e),r=e.ownerDocument.body,o=Yf(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Yf(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+cg(e);const s=-n.scrollTop;return"rtl"===Od(r).direction&&(l+=Yf(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:s}}(gd(e));else if(vd(t))r=function(e,t){const n=ug(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=yd(e)?lg(e):th(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=ag(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return yh(r)}function hg(e,t){const n=Td(e);return!(n===t||!vd(n)||Pd(n))&&("fixed"===Od(n).position||hg(n,t))}function pg(e,t,n){const r=yd(t),o=gd(t),i="fixed"===n,l=ug(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=th(0);function u(){a.x=cg(o)}if(r||!r&&!i)if(("body"!==hd(t)||wd(o))&&(s=Md(t)),r){const e=ug(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&u();i&&!r&&o&&u();const c=!o||r||i?th(0):dg(o,s);return{x:l.left+s.scrollLeft-a.x-c.x,y:l.top+s.scrollTop-a.y-c.y,width:l.width,height:l.height}}function gg(e){return"static"===Od(e).position}function mg(e,t){if(!yd(e)||"fixed"===Od(e).position)return null;if(t)return t(e);let n=e.offsetParent;return gd(e)===n&&(n=n.ownerDocument.body),n}function vg(e,t){const n=pd(e);if(Sd(e))return n;if(!yd(e)){let t=Td(e);for(;t&&!Pd(t);){if(vd(t)&&!gg(t))return t;t=Td(t)}return n}let r=mg(e,t);for(;r&&_d(r)&&gg(r);)r=mg(r,t);return r&&Pd(r)&&gg(r)&&!Rd(r)?n:r||function(e){let t=Td(e);for(;yd(t)&&!Pd(t);){if(Rd(t))return t;if(Sd(t))return null;t=Td(t)}return null}(e)||n}const yg={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=gd(r),s=!!t&&Sd(t.floating);if(r===l||s&&i)return n;let a={scrollLeft:0,scrollTop:0},u=th(1);const c=th(0),d=yd(r);if((d||!d&&!i)&&(("body"!==hd(r)||wd(l))&&(a=Md(r)),d)){const e=ug(r);u=lg(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}const f=!l||d||i?th(0):dg(l,a);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-a.scrollTop*u.y+c.y+f.y}},getDocumentElement:gd,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?Sd(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Fd(e,[],!1).filter(e=>vd(e)&&"body"!==hd(e)),o=null;const i="fixed"===Od(e).position;let l=i?Td(e):e;for(;vd(l)&&!Pd(l);){const t=Od(l),n=Rd(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||wd(l)&&!n&&hg(e,l))?r=r.filter(e=>e!==l):o=t,l=Td(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=fg(t,i[0],o);let s=l.top,a=l.right,u=l.bottom,c=l.left;for(let e=1;e<i.length;e++){const n=fg(t,i[e],o);s=Yf(n.top,s),a=Xf(n.right,a),u=Xf(n.bottom,u),c=Yf(n.left,c)}return{width:a-c,height:u-s,x:c,y:s}},getOffsetParent:vg,getElementRects:async function(e){const t=this.getOffsetParent||vg,n=this.getDimensions,r=await n(e.floating);return{reference:pg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=og(e);return{width:t,height:n}},getScale:lg,isElement:vd,isRTL:function(e){return"rtl"===Od(e).direction}};function bg(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function wg(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:a=!1}=r,u=ig(e),c=o||i?[...u?Fd(u):[],...t?Fd(t):[]]:[];c.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=u&&s?function(e,t){let n,r=null;const o=gd(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(s,a){void 0===s&&(s=!1),void 0===a&&(a=1),i();const u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:h}=u;if(s||t(),!f||!h)return;const p={rootMargin:-eh(d)+"px "+-eh(o.clientWidth-(c+f))+"px "+-eh(o.clientHeight-(d+h))+"px "+-eh(c)+"px",threshold:Yf(0,Xf(1,a))||1};let g=!0;function m(t){const r=t[0].intersectionRatio;if(r!==a){if(!g)return l();r?l(!1,r):n=setTimeout(()=>{l(!1,1e-7)},1e3)}1!==r||bg(u,e.getBoundingClientRect())||l(),g=!1}try{r=new IntersectionObserver(m,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,p)}r.observe(e)}(!0),i}(u,n):null;let f,h=-1,p=null;l&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),n()}),u&&!a&&p.observe(u),t&&p.observe(t));let g=a?ug(e):null;return a&&function t(){const r=ug(e);g&&!bg(g,r)&&n(),g=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=p)||e.disconnect(),p=null,a&&cancelAnimationFrame(f)}}const _g=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:s,platform:a,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...m}=oh(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=ih(o),y=uh(s),b=ih(s)===s,w=await(null==a.isRTL?void 0:a.isRTL(u.floating)),_=f||(b||!g?[mh(s)]:function(e){const t=mh(e);return[dh(e),t,dh(t)]}(s)),S="none"!==p;!f&&S&&_.push(...function(e,t,n,r){const o=lh(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?hh:fh:t?fh:hh;case"left":case"right":return t?ph:gh;default:return[]}}(ih(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(dh)))),i}(s,g,p,w));const x=[s,..._],C=await a.detectOverflow(t,m),E=[];let I=(null==(r=i.flip)?void 0:r.overflows)||[];if(c&&E.push(C[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=lh(e),o=ch(e),i=ah(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=mh(l)),[l,mh(l)]}(o,l,w);E.push(C[e[0]],C[e[1]])}if(I=[...I,{placement:o,overflows:E}],!E.every(e=>e<=0)){var R,k;const e=((null==(R=i.flip)?void 0:R.index)||0)+1,t=x[e];if(t&&("alignment"!==d||y===uh(t)||I.every(e=>uh(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:I},reset:{placement:t}};let n=null==(k=I.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:k.placement;if(!n)switch(h){case"bestFit":{var P;const e=null==(P=I.filter(e=>{if(S){const t=uh(e.placement);return t===y||"y"===t}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])?void 0:P[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Sg=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:l}=t,{offset:s=0,mainAxis:a=!0,crossAxis:u=!0}=oh(e,t),c={x:n,y:r},d=uh(o),f=sh(d);let h=c[f],p=c[d];const g=oh(s,t),m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(a){const e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+m.mainAxis,n=i.reference[f]+i.reference[e]-m.mainAxis;h<t?h=t:h>n&&(h=n)}if(u){var v,y;const e="y"===f?"width":"height",t=rg.has(ih(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=l.offset)?void 0:v[d])||0)+(t?0:m.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=l.offset)?void 0:y[d])||0)-(t?m.crossAxis:0);p<n?p=n:p>r&&(p=r)}return{[f]:h,[d]:p}}}},xg=(e,t,n)=>{const r=new Map,o={platform:yg,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,s=l.detectOverflow?l:{...l,detectOverflow:eg},a=await(null==l.isRTL?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Qp(u,r,a),f=r,h=0;const p={};for(let n=0;n<i.length;n++){const g=i[n];if(!g)continue;const{name:m,fn:v}=g,{x:y,y:b,data:w,reset:_}=await v({x:c,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:u,platform:s,elements:{reference:e,floating:t}});c=null!=y?y:c,d=null!=b?b:d,p[m]={...p[m],...w},_&&h<50&&(h++,"object"==typeof _&&(_.placement&&(f=_.placement),_.rects&&(u=!0===_.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):_.rects),({x:c,y:d}=Qp(u,f,a))),n=-1)}return{x:c,y:d,placement:f,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Cg="undefined"!=typeof document?_t:function(){};function Eg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!Eg(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(!("_owner"===n&&e.$$typeof||Eg(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function Ig(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Rg(e,t){const n=Ig(e);return Math.round(t*n)/n}function kg(e){const t=St(e);return Cg(()=>{t.current=e}),t}const Pg={open:$c(e=>e.open),transitionStatus:$c(e=>e.transitionStatus),domReferenceElement:$c(e=>e.domReferenceElement),referenceElement:$c(e=>{var t;return null!==(t=e.positionReference)&&void 0!==t?t:e.referenceElement}),floatingElement:$c(e=>e.floatingElement),floatingId:$c(e=>e.floatingId)};class Og extends dd{constructor(e){const{syncOnly:t,nested:n,onOpenChange:r,triggerElements:o,...i}=e;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Fp(),nested:n,triggerElements:o},Pg),te(this,"syncOpenEvent",(e,t)=>{(!e||!this.state.open||null!=t&&function(e){const t=e.type;return"click"===t||"mousedown"===t||"keydown"===t||"keyup"===t}(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)}),te(this,"dispatchOpenChange",(e,t)=>{this.syncOpenEvent(e,t.event);const n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit("openchange",n)}),te(this,"setOpen",(e,t)=>{var n,r,o,i;this.syncOnly?null===(o=(i=this.context).onOpenChange)||void 0===o||o.call(i,e,t):(this.dispatchOpenChange(e,t),null===(n=(r=this.context).onOpenChange)||void 0===n||n.call(r,e,t))}),this.syncOnly=t}}function Mg(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:o,nested:i,onOpenChange:l}=e,s=t.useState("open"),a=t.useState("activeTriggerElement"),u=t.useState(n?"popupElement":"positionerElement"),c=t.context.triggerElements,d=l,f=St(null);void 0===r&&null===f.current&&(f.current=new Og({open:s,transitionStatus:void 0,referenceElement:a,floatingElement:u,triggerElements:c,onOpenChange:d,floatingId:o,syncOnly:!0,nested:i}));const h=null!=r?r:f.current;return t.useSyncedValue("floatingId",o),_c(()=>{const e={open:s,floatingId:o,referenceElement:a,floatingElement:u};vd(a)&&(e.domReferenceElement=a),h.state.positionReference===h.state.referenceElement&&(e.positionReference=a),h.update(e)},[s,o,a,u,h]),h.context.onOpenChange=d,h.context.nested=i,h}function Tg(e,t=!1,n=!1){const[r,o]=yt(e&&t?"idle":void 0),[i,l]=yt(e);return e&&!i&&(l(!0),o("starting")),e||!i||"ending"===r||n||o("ending"),e||i||"ending"!==r||o(void 0),_c(()=>{if(!e&&i&&"ending"!==r&&n){const e=Hd.request(()=>{o("ending")});return()=>{Hd.cancel(e)}}},[e,i,r,n]),_c(()=>{if(!e||t)return;const n=Hd.request(()=>{o(void 0)});return()=>{Hd.cancel(n)}},[t,e]),_c(()=>{if(!e||!t)return;e&&i&&"idle"!==r&&o("starting");const n=Hd.request(()=>{o("idle")});return()=>{Hd.cancel(n)}},[t,e,i,r]),{mounted:i,setMounted:l,transitionStatus:r}}let Ag=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const Fg={[Ag.startingStyle]:""},Ng={[Ag.endingStyle]:""},zg={transitionStatus:e=>"starting"===e?Fg:"ending"===e?Ng:null};function Dg(e,t=!1,n=!0){const r=Bd();return kc((o,i=null)=>{r.cancel();const l=Hp(e);if(null==l)return;const s=l,a=()=>{Fn(o)};if("function"!=typeof s.getAnimations||globalThis.BASE_UI_ANIMATIONS_DISABLED)o();else{if(t){const e=Ag.startingStyle;if(!s.hasAttribute(e))return void r.request(u);const t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),u())});return t.observe(s,{attributes:!0,attributeFilter:[e]}),void(null==i||i.addEventListener("abort",()=>t.disconnect(),{once:!0}))}r.request(u)}function u(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{null!=i&&i.aborted||a()}).catch(()=>{if(n)return void(null!=i&&i.aborted||a());const e=s.getAnimations();(null==i||!i.aborted)&&e.length>0&&e.some(e=>e.pending||"finished"!==e.playState)&&u()})}})}function Lg(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,i=kc(o),l=Dg(r,n,!1);wt(()=>{if(!t)return;const e=new AbortController;return l(i,e.signal),()=>{e.abort()}},[t,n,i,l])}const Vg={tabIndex:-1,[pf]:""};function $g(e,t,n,r=!1){var o;t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const i=null!==(o=null==n?void 0:n.id)&&void 0!==o?o:null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=null!=n?n:null)}function jg(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=e.useState("open"),o=e.useState("triggerCount");_c(()=>{if(!r)return void(0!==e.state.triggerCount&&e.set("triggerCount",0));const t=e.context.triggerElements.size,o={};e.state.triggerCount!==t&&(o.triggerCount=t);const i=e.select("activeTriggerId");let l=null;if(i){const t=e.context.triggerElements.getById(i);t?t!==e.state.activeTriggerElement&&(o.activeTriggerElement=t):l=i}if(!l&&!i&&1===t){const t=e.context.triggerElements.entries().next();if(!t.done){const[e,n]=t.value;o.activeTriggerId=e,o.activeTriggerElement=n}}void 0===o.triggerCount&&void 0===o.activeTriggerId&&void 0===o.activeTriggerElement||e.update(o),l&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===l&&!e.context.triggerElements.getById(l)){const t=Gf(Mf);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,o,n])}function Wg(e,t,n){const{mounted:r,setMounted:o,transitionStatus:i}=Tg(e),l=t.useState("preventUnmountingOnClose"),s=!e&&l;t.useSyncedValues({mounted:r,transitionStatus:i,preventUnmountingOnClose:s});const a=kc(()=>{var e,r;o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),null==n||n(),null===(e=(r=t.context).onOpenChangeComplete)||void 0===e||e.call(r,!1)});return Lg({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||a()}}),{forceUnmount:a,transitionStatus:i}}function Hg(e,t){e.useSyncedValues(t),_c(()=>()=>{e.update({activeTriggerProps:cd,inactiveTriggerProps:cd,popupProps:cd})},[e])}class Bg{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){const n=this.idMap.get(e);n!==t&&(void 0!==n&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){const t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(const 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 Ug(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Og({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Bg,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0}),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:cd,inactiveTriggerProps:cd,popupProps:cd}}const qg=$c(e=>{var t;return null!==(t=e.triggerIdProp)&&void 0!==t?t:e.activeTriggerId}),Gg=$c(e=>{var t;return null!==(t=e.openProp)&&void 0!==t?t:e.open}),Zg=$c(e=>{var t,n;return(null!==(t=null===(n=e.popupElement)||void 0===n?void 0:n.id)&&void 0!==t?t:e.floatingId)||void 0});function Kg(e,t){return void 0!==t&&Gg(e)&&qg(e)===t}const Jg={open:Gg,mounted:$c(e=>e.mounted),transitionStatus:$c(e=>e.transitionStatus),floatingRootContext:$c(e=>e.floatingRootContext),triggerCount:$c(e=>e.triggerCount),preventUnmountingOnClose:$c(e=>e.preventUnmountingOnClose),payload:$c(e=>e.payload),activeTriggerId:qg,activeTriggerElement:$c(e=>e.mounted?e.activeTriggerElement:null),popupId:Zg,isTriggerActive:$c((e,t)=>void 0!==t&&qg(e)===t),isOpenedByTrigger:$c((e,t)=>Kg(e,t)),isMountedByTrigger:$c((e,t)=>void 0!==t&&qg(e)===t&&e.mounted),triggerProps:$c((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:$c((e,t)=>function(e,t){return!!Kg(e,t)||void 0!==t&&Gg(e)&&null==qg(e)&&1===e.triggerCount}(e,t)?Zg(e):void 0),popupProps:$c(e=>e.popupProps),popupElement:$c(e=>e.popupElement),positionerElement:$c(e=>e.positionerElement)};function Xg(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,o=up(),i=null!=Lp(),l=Ec(()=>{var e,l;return new Og({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:null!==(e=r.reference)&&void 0!==e?e:null,floatingElement:null!==(l=r.floating)&&void 0!==l?l:null,triggerElements:new Bg,floatingId:o,syncOnly:!1,nested:i})}).current;return _c(()=>{const e={open:t,floatingId:o};void 0!==r.reference&&(e.referenceElement=r.reference,e.domReferenceElement=vd(r.reference)?r.reference:null),void 0!==r.floating&&(e.floatingElement=r.floating),l.update(e)},[t,o,r.reference,r.floating,l]),l.context.onOpenChange=n,l.context.nested=i,l}const Yg=rf&&lf;class Qg{constructor(){te(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()}),te(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 Ud,this.restTimeout=new Ud,this.handleCloseOptions=void 0}static create(){return new Qg}}const em=new WeakMap;function tm(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;var n,r,o;t&&em.get(t)===e&&(null===(n=e.pointerEventsScopeElement)||void 0===n||n.style.removeProperty("pointer-events"),null===(r=e.pointerEventsReferenceElement)||void 0===r||r.style.removeProperty("pointer-events"),null===(o=e.pointerEventsFloatingElement)||void 0===o||o.style.removeProperty("pointer-events"),em.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function nm(e,t){const{scopeElement:n,referenceElement:r,floatingElement:o}=t,i=em.get(n);i&&i!==e&&tm(i),tm(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=o,em.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",o.style.pointerEvents="auto"}function rm(e){const t=e.context.dataRef.current,n=Ec(()=>{var e;return null!==(e=t.hoverInteractionState)&&void 0!==e?e:Qg.create()}).current;return t.hoverInteractionState||(t.hoverInteractionState=n),$d(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}const om={current:null};function im(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function lm(e,t){return im(t,e===yf||e===bf,e===mf||e===vf)}function sm(e,t,n){return im(t,e===bf,n?e===mf:e===vf)||"Enter"===e||" "===e||""===e}function am(e,t){const{listRef:n,activeIndex:r,onNavigate:o=()=>{},enabled:i=!0,selectedIndex:l=null,allowEscape:s=!1,loopFocus:a=!1,nested:u=!1,rtl:c=!1,virtual:d=!1,focusItemOnOpen:f="auto",focusItemOnHover:h=!0,openOnArrowKeyDown:p=!0,disabledIndices:g,orientation:m="vertical",parentOrientation:v,id:y,resetOnPointerLeave:b=!0,externalTree:w,grid:_}=t,S=null!=_,x="rootStore"in e?e.rootStore:e,C=x.useState("open"),E=x.useState("floatingElement"),I=x.useState("domReferenceElement"),R=x.context.dataRef,k=Rf(E),P=If(I),O=Fc(k),M=Lp(),T=Vp(w),A=St(f),F=St(null!=l?l:-1),N=St(null),z=St(!0),D=kc(e=>{o(-1===F.current?null:F.current,e)}),L=St(!!E),V=St(C),$=St(!1),j=St(!1),W=St(null),H=Fc(g),B=Fc(C),U=Fc(l),q=Fc(b),G=Bd(),Z=Bd(),K=kc(()=>{function e(e){d?null==T||T.events.emit("virtualfocus",e):W.current=Jh(e,{sync:$.current,preventScroll:!0})}const t=n.current[F.current],r=j.current;t&&e(t),($.current?e=>e():e=>G.request(e))(()=>{const o=n.current[F.current]||t;var i;o&&(t||e(o),!te||!r&&z.current||null===(i=o.scrollIntoView)||void 0===i||i.call(o,{block:"nearest",inline:"nearest"}))})});_c(()=>{R.current.orientation=m},[R,m]),_c(()=>{i&&(C&&E?(F.current=null!=l?l:-1,A.current&&null!=l&&(j.current=!0,D())):L.current&&(F.current=-1,D()))},[i,C,E,l,D]),_c(()=>{if(i)if(C){if(E)if(null==r){if($.current=!1,null!=U.current)return;if(L.current&&(F.current=-1,K()),(!V.current||!L.current)&&A.current&&(null!=N.current||!0===A.current&&null==N.current)){let e=0;const t=()=>{null==n.current[0]?(e<2&&(e?e=>Z.request(e):queueMicrotask)(t),e+=1):(F.current=null==N.current||sm(N.current,m,c)||u?_h(n):Sh(n),N.current=null,D())};t()}}else wh(n.current,r)||(F.current=r,K(),j.current=!1)}else $.current=!1},[i,C,E,r,U,u,n,m,c,D,K,Z]),_c(()=>{var e,t;if(!i||E||!T||d||!L.current)return;const n=T.nodesRef.current,r=null===(e=n.find(e=>e.id===M))||void 0===e||null===(e=e.context)||void 0===e?void 0:e.elements.floating,o=wf(Dd(null!==(t=null!=I?I:r)&&void 0!==t?t:null)),l=n.some(e=>e.context&&_f(e.context.elements.floating,o));r&&!l&&z.current&&r.focus({preventScroll:!0})},[i,E,I,T,M,d]),_c(()=>{V.current=C,L.current=!!E}),_c(()=>{C||(N.current=null,A.current=f)},[C,f]);const J=null!=r,X=kc(e=>{if(!B.current)return;const t=n.current.indexOf(e.currentTarget);-1===t||F.current===t&&r===t||(F.current=t,D(e))}),Y=kc(()=>{var e;return null!=v?v:null==T||null===(e=T.nodesRef.current.find(e=>e.id===M))||void 0===e||null===(e=e.context)||void 0===e||null===(e=e.dataRef)||void 0===e?void 0:e.current.orientation}),Q=kc(()=>_h(n,H.current)),ee=kc(e=>{if(z.current=!1,$.current=!0,229===e.which)return;if(!B.current&&e.currentTarget===O.current)return;if(u&&function(e,t,n,r){return"both"===t||"horizontal"===t&&r?"Escape"===e:im(t,n?e===vf:e===mf,e===yf)}(e.key,m,c,S))return lm(e.key,Y())||cf(e),x.setOpen(!1,Gf(Hf,e.nativeEvent)),void(yd(I)&&(d?null==T||T.events.emit("virtualfocus",I):I.focus()));const t=F.current,r=_h(n,g),o=Sh(n,g);if(P||("Home"===e.key&&(cf(e),F.current=r,D(e)),"End"===e.key&&(cf(e),F.current=o,D(e))),null!=_){const t=_(e,F.current,n,m,a,c,g,r,o);if(null!=t&&(F.current=t,D(e)),"both"===m)return}if(lm(e.key,m)){if(cf(e),C&&!d&&wf(e.currentTarget.ownerDocument)===e.currentTarget)return F.current=sm(e.key,m,c)?r:o,void D(e);sm(e.key,m,c)?a?t>=o?s&&t!==n.current.length?F.current=-1:($.current=!1,F.current=r):F.current=xh(n.current,{startingIndex:t,disabledIndices:g}):F.current=Math.min(o,xh(n.current,{startingIndex:t,disabledIndices:g})):a?t<=r?s&&-1!==t?F.current=n.current.length:($.current=!1,F.current=o):F.current=xh(n.current,{startingIndex:t,decrement:!0,disabledIndices:g}):F.current=Math.max(r,xh(n.current,{startingIndex:t,decrement:!0,disabledIndices:g})),wh(n.current,F.current)&&(F.current=-1),D(e)}}),te=Ct(()=>({onFocus(e){$.current=!0,X(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){$.current=!0,j.current=!1,h&&X(e)},onPointerLeave(e){var t;if(!B.current||!z.current||"touch"===e.pointerType)return;$.current=!0;const r=e.relatedTarget;if(h&&!n.current.includes(r)&&q.current&&(null===(t=W.current)||void 0===t||t.call(W),W.current=null,F.current=-1,D(e),!d)){const e=O.current,t=wf(Dd(e));e&&_f(e,t)&&e.focus({preventScroll:!0})}}}),[X,B,O,h,n,D,q,d]),ne=Ct(()=>d&&C&&J&&{"aria-activedescendant":`${y}-${r}`},[d,C,J,y,r]),re=Ct(()=>({"aria-orientation":"both"===m?void 0:m,...P?{}:ne,onKeyDown(e){if("Tab"===e.key&&e.shiftKey&&C&&!d){const t=Sf(e.nativeEvent);if(t&&!_f(O.current,t))return;return cf(e),x.setOpen(!1,Gf(jf,e.nativeEvent)),void(yd(I)&&I.focus())}ee(e)},onPointerMove(){z.current=!0}}),[ne,ee,O,m,P,x,C,d,I]),oe=Ct(()=>{function e(e){x.setOpen(!0,Gf(Hf,e.nativeEvent,e.currentTarget))}function t(e){"auto"===f&&df(e.nativeEvent)&&(A.current=!d)}function n(e){A.current=f,"auto"===f&&ff(e.nativeEvent)&&(A.current=!0)}return{onKeyDown(t){const n=x.select("open");z.current=!1;const r=t.key.startsWith("Arrow"),o=function(e,t,n){return im(t,n?e===mf:e===vf,e===bf)}(t.key,Y(),c),i=lm(t.key,m),l=(u?o:i)||"Enter"===t.key||""===t.key.trim();if(d&&n)return ee(t);if(n||p||!r){if(l){const e=lm(t.key,Y());N.current=u&&e?null:t.key}u?o&&(cf(t),n?(F.current=Q(),D(t)):e(t)):i&&(null!=U.current&&(F.current=U.current),cf(t),!n&&p?e(t):ee(t),n&&D(t))}},onFocus(e){x.select("open")&&!d&&(F.current=-1,D(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[ee,f,Q,u,D,x,p,m,Y,c,U,d]),ie=Ct(()=>({...ne,...oe}),[ne,oe]);return Ct(()=>i?{reference:ie,floating:re,item:te,trigger:oe}:{},[i,ie,re,oe,te])}function um(e,t){var n;const{listRef:r,elementsRef:o,activeIndex:i,onMatch:l,disabledIndices:s,onTyping:a,enabled:u=!0,resetMs:c=750,selectedIndex:d=null}=t,f="rootStore"in e?e.rootStore:e,h=f.useState("open"),p=qd(),g=St(""),m=St(null!==(n=null!=d?d:i)&&void 0!==n?n:-1),v=St(null),y=kc(e=>{var t;function n(e){return!(!function(e){const t=null==o?void 0:o.current[e];return!t||Eh(t)}(e)||null!=s&&Ch(ud,e,s))}function u(e,t,r=0){if(0===e.length)return-1;const o=(r%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){const r=(o+t)%e.length,l=e[r];if(null!=l&&l.toLowerCase().startsWith(i)&&n(r))return r}return-1}const f=r.current;if(g.current.length>0&&" "===e.key&&(cf(e),null==a||a(!0)),g.current.length>0&&" "!==g.current[0]&&-1===u(f,g.current)&&" "!==e.key&&(null==a||a(!1)),null==f||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;h&&" "!==e.key&&(cf(e),null==a||a(!0));const y=""===g.current;var b;y&&(m.current=null!==(b=null!=d?d:i)&&void 0!==b?b:-1);const w=f.every((e,t)=>{var r,o;return!e||!n(t)||(null===(r=e[0])||void 0===r?void 0:r.toLowerCase())!==(null===(o=e[1])||void 0===o?void 0:o.toLowerCase())});w&&g.current===e.key&&(g.current="",m.current=v.current),g.current+=e.key,p.start(c,()=>{g.current="",m.current=v.current,null==a||a(!1)});const _=y?null!==(t=null!=d?d:i)&&void 0!==t?t:-1:m.current,S=(null!=_?_:0)+1,x=u(f,g.current,S);-1!==x?(null==l||l(x),v.current=x):" "!==e.key&&(g.current="",null==a||a(!1))}),b=kc(e=>{const t=e.relatedTarget,n=f.select("domReferenceElement"),r=f.select("floatingElement");_f(n,t)||_f(r,t)||(p.clear(),g.current="",m.current=v.current,null==a||a(!1))});_c(()=>{(h||null===d)&&(p.clear(),v.current=null,""!==g.current&&(g.current=""))},[h,d,p]),_c(()=>{var e;h&&""===g.current&&(m.current=null!==(e=null!=d?d:i)&&void 0!==e?e:-1)},[h,d,i]);const w=Ct(()=>({onKeyDown:y,onBlur:b}),[y,b]);return Ct(()=>u?{reference:w,floating:w}:{},[u,w])}const cm=.1*.1,dm=.5;function fm(e,t,n,r,o,i){return r>=t!=i>=t&&e<=(o-n)*(t-r)/(i-r)+n}function hm(e,t,n,r,o,i,l,s,a,u){let c=!1;return fm(e,t,n,r,o,i)&&(c=!c),fm(e,t,o,i,l,s)&&(c=!c),fm(e,t,l,s,a,u)&&(c=!c),fm(e,t,a,u,n,r)&&(c=!c),c}function pm(e,t,n,r,o,i){const l=Math.min(n,o),s=Math.max(n,o),a=Math.min(r,i),u=Math.max(r,i);return e>=l&&e<=s&&t>=a&&t<=u}function gm(e={}){const{blockPointerEvents:t=!1}=e,n=new Ud,r=({x:e,y:t,placement:r,elements:o,onClose:i,nodeId:l,tree:s})=>{const a=null==r?void 0:r.split("-")[0];let u=!1,c=null,d=null,f="undefined"!=typeof performance?performance.now():0;return function(r){n.clear();const h=o.domReference,p=o.floating;if(!h||!p||null==a||null==e||null==t)return;const{clientX:g,clientY:m}=r,v=Sf(r),y="mouseleave"===r.type,b=_f(p,v),w=_f(h,v);if(b&&(u=!0,!y))return;if(w&&(u=!1,!y))return void(u=!0);if(y&&vd(r.relatedTarget)&&_f(p,r.relatedTarget))return;function _(){return Boolean(s&&qh(s.nodesRef.current,l).length>0)}function S(){_()||(n.clear(),i())}if(_())return;const x=h.getBoundingClientRect(),C=p.getBoundingClientRect(),E=e>C.right-C.width/2,I=t>C.bottom-C.height/2,R=C.width>x.width,k=C.height>x.height,P=(R?x:C).left,O=(R?x:C).right,M=(k?x:C).top,T=(k?x:C).bottom;if("top"===a&&t>=x.bottom-1||"bottom"===a&&t<=x.top+1||"left"===a&&e>=x.right-1||"right"===a&&e<=x.left+1)return void S();let A=!1;switch(a){case"top":A=pm(g,m,P,x.top+1,O,C.bottom-1);break;case"bottom":A=pm(g,m,P,C.top+1,O,x.bottom-1);break;case"left":A=pm(g,m,C.right-1,T,x.left+1,M);break;case"right":A=pm(g,m,x.right-1,T,C.left+1,M)}if(A)return;if(u&&!function(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}(g,m,x))return void S();if(!y&&function(e,t){const n=performance.now(),r=n-f;if(null===c||null===d||0===r)return c=e,d=t,f=n,!1;const o=e-c,i=t-d;return c=e,d=t,f=n,o*o+i*i<r*r*cm}(g,m))return void S();let F=!1;switch(a){case"top":{const n=R?.25:2,r=R||E?e+n:e-n,o=R?e-n:E?e+n:e-n,i=t+dm+1,l=E||R?C.bottom-dm:C.top,s=E?R?C.bottom-dm:C.top:C.bottom-dm;F=hm(g,m,r,i,o,i,C.left,l,C.right,s);break}case"bottom":{const n=R?.25:2,r=R||E?e+n:e-n,o=R?e-n:E?e+n:e-n,i=t-dm,l=E||R?C.top+dm:C.bottom,s=E?R?C.top+dm:C.bottom:C.top+dm;F=hm(g,m,r,i,o,i,C.left,l,C.right,s);break}case"left":{const n=k?.25:2,r=k||I?t+n:t-n,o=k?t-n:I?t+n:t-n,i=e+dm+1,l=I||k?C.right-dm:C.left,s=I?k?C.right-dm:C.left:C.right-dm;F=hm(g,m,l,C.top,s,C.bottom,i,r,i,o);break}case"right":{const n=k?.25:2,r=k||I?t+n:t-n,o=k?t-n:I?t+n:t-n,i=e-dm,l=I||k?C.left+dm:C.right,s=I?k?C.left+dm:C.right:C.left+dm;F=hm(g,m,i,r,i,o,l,C.top,s,C.bottom);break}}F?u||n.start(40,S):S()}};return r.__options={...e,blockPointerEvents:t},r}function mm(e,t,n,r,o,i,l,s,a,u=2){const c=function(e,{event:t,orientation:n,loopFocus:r,onLoop:o,rtl:i,cols:l,disabledIndices:s,minIndex:a,maxIndex:u,prevIndex:c,stopEvent:d=!1}){let f,h=c;if(t.key===yf?f="up":t.key===bf&&(f="down"),f){var p;const n=[],i=[];let g=!1,m=0;{let t=null,r=-1;e.forEach((e,o)=>{if(null==e)return;m+=1;const l=e.closest('[role="row"]');l&&(g=!0),l===t&&-1!==r||(t=l,r+=1,n[r]=[]),n[r].push(o),i[o]=r})}let v=!1,y=0;if(g)for(const e of n){const t=e.length;t>y&&(y=t),t!==l&&(v=!0)}const b=v&&m<e.length,w=y||l,_=l=>{if(!v||-1===c)return;const a=i[c];if(null==a)return;const u=n[a].indexOf(c),d="up"===l?-1:1;for(let l=a+d,p=0;p<n.length;p+=1,l+=d){if(l<0||l>=n.length){if(!r||b)return;if(l=l<0?n.length-1:0,o){var f,h;const e=Math.min(u,n[l].length-1),r=null!==(f=n[l][e])&&void 0!==f?f:n[l][0],s=o(t,c,r);l=null!==(h=i[s])&&void 0!==h?h:l}}const a=n[l];for(let t=Math.min(u,a.length-1);t>=0;t-=1){const n=a[t];if(!Ch(e,n,s))return n}}},S=t=>{if(!b||-1===c)return;const n=c%w,o="up"===t?-w:w,i=u-u%w,l=eh(u/w)+1;for(let t=c-n+o,a=0;a<l;a+=1,t+=o){if(t<0||t>u){if(!r)return;t=t<0?i:0}const o=Math.min(t+w-1,u);for(let r=Math.min(t+n,o);r>=t;r-=1)if(!Ch(e,r,s))return r}};d&&cf(t);const x=null!==(p=_(f))&&void 0!==p?p:S(f);if(void 0!==x)h=x;else if(-1===c)h="up"===f?u:a;else if(h=xh(e,{startingIndex:c,amount:w,decrement:"up"===f,disabledIndices:s}),r){if("up"===f&&(c-w<a||h<0)){const e=c%w,n=u%w,r=u-(n-e);h=n===e?u:n>e?r:r-w,o&&(h=o(t,c,h))}"down"===f&&c+w>u&&(h=xh(e,{startingIndex:c%w-w,amount:w,disabledIndices:s}),o&&(h=o(t,c,h)))}wh(e,h)&&(h=c)}if("both"===n){const n=eh(c/l);t.key===(i?mf:vf)&&(d&&cf(t),c%l!==l-1?(h=xh(e,{startingIndex:c,disabledIndices:s}),r&&bh(h,l,n)&&(h=xh(e,{startingIndex:c-c%l-1,disabledIndices:s}),o&&(h=o(t,c,h)))):r&&(h=xh(e,{startingIndex:c-c%l-1,disabledIndices:s}),o&&(h=o(t,c,h))),bh(h,l,n)&&(h=c)),t.key===(i?vf:mf)&&(d&&cf(t),c%l!==0?(h=xh(e,{startingIndex:c,decrement:!0,disabledIndices:s}),r&&bh(h,l,n)&&(h=xh(e,{startingIndex:c+(l-c%l),decrement:!0,disabledIndices:s}),o&&(h=o(t,c,h)))):r&&(h=xh(e,{startingIndex:c+(l-c%l),decrement:!0,disabledIndices:s}),o&&(h=o(t,c,h))),bh(h,l,n)&&(h=c));const a=eh(u/l)===n;wh(e,h)&&(r&&a?(h=t.key===(i?vf:mf)?u:xh(e,{startingIndex:c-c%l-1,disabledIndices:s}),o&&(h=o(t,c,h))):h=c)}return h}(n.current,{event:e,orientation:r,loopFocus:o,rtl:i,cols:u,disabledIndices:l,minIndex:s,maxIndex:a,prevIndex:t>a?s:t,stopEvent:!0});return wh(n.current,c)?void 0:c}const vm=rt(void 0),ym=rt(void 0),bm=rt(void 0),wm=rt(!1),_m=rt("");function Sm(){const e=It(vm);if(!e)throw new Error(Vc(22));return e}function xm(){const e=It(ym);if(!e)throw new Error(Vc(23));return e}function Cm(){const e=It(bm);if(!e)throw new Error(Vc(24));return e}function Em(){return It(_m)}const Im=(e,t)=>Object.is(e,t);function Rm(e,t,n){return null==e||null==t?Object.is(e,t):n(e,t)}function km(e,t,n){return!(!e||0===e.length)&&e.some(e=>void 0!==e&&Rm(t,e,n))}function Pm(e,t,n){return e&&0!==e.length?e.findIndex(e=>void 0!==e&&Rm(e,t,n)):-1}function Om(e,t,n){return e.filter(e=>!Rm(t,e,n))}function Mm(e){if(null==e)return"";if("string"==typeof e)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Tm(e){return null!=e&&e.length>0&&"object"==typeof e[0]&&null!=e[0]&&"items"in e[0]}function Am(e){if(!Array.isArray(e))return null!=e&&"null"in e;const t=e;if(Tm(t)){for(const e of t)for(const t of e.items)if(t&&null==t.value&&null!=t.label)return!0;return!1}for(const e of t)if(e&&null==e.value&&null!=e.label)return!0;return!1}function Fm(e,t){var n;if(t&&null!=e)return null!==(n=t(e))&&void 0!==n?n:"";if(e&&"object"==typeof e){if("label"in e&&null!=e.label)return String(e.label);if("value"in e)return String(e.value)}return Mm(e)}function Nm(e,t){var n;return t&&null!=e?null!==(n=t(e))&&void 0!==n?n:"":Mm(e&&"object"==typeof e&&"value"in e&&"label"in e?e.value:e)}function zm(e,t,n){function r(){return Fm(e,n)}if(n&&null!=e)return n(e);if(e&&"object"==typeof e&&"label"in e&&null!=e.label)return e.label;var o;if(t&&!Array.isArray(t))return null!==(o=t[e])&&void 0!==o?o:r();if(Array.isArray(t)){const n=t,o=Tm(n)?n.flatMap(e=>e.items):n;if(null==e||"object"!=typeof e){const t=o.find(t=>t.value===e);return t&&null!=t.label?t.label:r()}if("value"in e){const t=o.find(t=>t&&t.value===e.value);if(t&&null!=t.label)return t.label}}return r()}const Dm={id:$c(e=>e.id),labelId:$c(e=>e.labelId),items:$c(e=>e.items),selectedValue:$c(e=>e.selectedValue),hasSelectionChips:$c(e=>{const t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:$c(e=>{const{selectedValue:t,selectionMode:n}=e;return null!=t&&("multiple"!==n||!Array.isArray(t)||t.length>0)}),hasNullItemLabel:$c((e,t)=>!!t&&Am(e.items)),open:$c(e=>e.open),mounted:$c(e=>e.mounted),forceMounted:$c(e=>e.forceMounted),inline:$c(e=>e.inline),activeIndex:$c(e=>e.activeIndex),selectedIndex:$c(e=>e.selectedIndex),isActive:$c((e,t)=>e.activeIndex===t),isSelected:$c((e,t)=>{const n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>Rm(t,e,n)):Rm(t,r,n)}),transitionStatus:$c(e=>e.transitionStatus),popupProps:$c(e=>e.popupProps),inputProps:$c(e=>e.inputProps),triggerProps:$c(e=>e.triggerProps),itemProps:$c(e=>e.itemProps),positionerElement:$c(e=>e.positionerElement),listElement:$c(e=>e.listElement),popupId:$c(e=>e.popupId),triggerElement:$c(e=>e.triggerElement),inputElement:$c(e=>e.inputElement),inputGroupElement:$c(e=>e.inputGroupElement),popupSide:$c(e=>e.popupSide),openMethod:$c(e=>e.openMethod),inputInsidePopup:$c(e=>e.inputInsidePopup),inputOwnsFormValue:$c(e=>e.inputOwnsFormValue),selectionMode:$c(e=>e.selectionMode),name:$c(e=>e.name),form:$c(e=>e.form),disabled:$c(e=>e.disabled),readOnly:$c(e=>e.readOnly),required:$c(e=>e.required),grid:$c(e=>e.grid),virtualized:$c(e=>e.virtualized),itemToStringLabel:$c(e=>e.itemToStringLabel),isItemEqualToValue:$c(e=>e.isItemEqualToValue),modal:$c(e=>e.modal),autoHighlight:$c(e=>e.autoHighlight),submitOnItemClick:$c(e=>e.submitOnItemClick)};let Lm=function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e}({});const Vm={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},$m={disabled:!1,...Vm},jm={valid:e=>null===e?null:e?{[Lm.valid]:""}:{[Lm.invalid]:""}},Wm={invalid:void 0,name:void 0,validityData:{state:{badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},errors:[],error:"",value:"",initialValue:null},setValidityData:ad,disabled:void 0,touched:Vm.touched,setTouched:ad,dirty:Vm.dirty,setDirty:ad,filled:Vm.filled,setFilled:ad,focused:Vm.focused,setFocused:ad,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:$m,markedDirtyRef:{current:!1},registerFieldControl:ad,validation:{getValidationProps:(e,t=cd)=>t,inputRef:{current:null},registerInput:ad,commit:async()=>{},change:ad}},Hm=rt(Wm);function Bm(e=!0){const t=It(Hm);if(t.setValidityData===ad&&!e)throw new Error(Vc(28));return t}function Um(e,t,n,r,o=!0,i){const{registerFieldControl:l}=Bm(),s=St(null);s.current||(s.current=Symbol()),_c(()=>{const a=s.current;if(a&&o)return l(a,{controlRef:e,getValue:r,id:t,name:i,value:n}),()=>{l(a,void 0)}},[e,o,r,t,i,l,n])}const qm=rt({formRef:{current:{fields:new Map}},errors:{},clearErrors:ad,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Gm(){return It(qm)}function Zm(e){return up(e,"base-ui")}const Km=rt({controlId:void 0,registerControlId:ad,labelId:void 0,setLabelId:ad,messageIds:[],setMessageIds:ad,getDescriptionProps:e=>e});function Jm(){return It(Km)}function Xm(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:i}=Jm(),l=Zm(t),s=n?o:void 0,a=Ec(()=>Symbol("labelable-control")),u=St(!1),c=St(null!=t),d=kc(()=>{u.current&&i!==ad&&(u.current=!1,i(a.current,void 0))});return _c(()=>{if(i===ad)return;let e;if(n){const n=null==r?void 0:r.current;e=vd(n)&&null!=n.closest("label")?null!=t?t:null:null!=s?s:l}else if(null!=t)c.current=!0,e=t;else{if(!c.current)return void d();e=l}void 0!==e?(u.current=!0,i(a.current,e)):d()},[t,r,s,i,n,l,a,d]),wt(()=>d,[d]),null!=o?o:l}function Ym(e){return null==e?void 0:`${e}-popup`}function Qm(e){return Array.isArray(e)?e.map(e=>Qm(e)).join(","):null==e?"":String(e)}const ev=new Map,tv=function(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${Qm(e.locale)}|${JSON.stringify(t)}`,r=ev.get(n);if(r)return r;const o=new Intl.Collator(e.locale,t),i={contains(e,t,n){if(!t)return!0;const r=Fm(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(0===o.compare(r.slice(e,e+t.length),t))return!0;return!1},startsWith(e,t,n){if(!t)return!0;const r=Fm(e,n);return 0===o.compare(r.slice(0,t.length),t)},endsWith(e,t,n){if(!t)return!0;const r=Fm(e,n),i=t.length;return r.length>=i&&0===o.compare(r.slice(r.length-i),t)}};return ev.set(n,i),i};function nv(e,t){const n=St(e),r=kc(t);_c(()=>{n.current!==e&&r(n.current)},[e,r]),_c(()=>{n.current=e},[e])}function rv(e){const[t,n]=yt(null),r=function(e,t){const n=kc((n,r)=>{("function"==typeof e?e():e)||t(r||(ef?"touch":""))}),{onClick:r,onPointerDown:o}=function(e){const t=St(""),n=Et(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:Et(n=>{0!==n.detail?(e(n,"pointerType"in n?n.pointerType:t.current),t.current=""):e(n,"keyboard")},[e]),onPointerDown:n}}(n);return Ct(()=>({onClick:r,onPointerDown:o}),[r,o])}(e,n);return nv(e,t=>{t&&!e&&n(null)}),Ct(()=>({openMethod:t,triggerProps:r}),[t,r])}function ov(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}const iv=Symbol("none"),lv={value:iv,index:-1},sv=rt(void 0);function av(){var e;const t=It(sv);return null!==(e=null==t?void 0:t.direction)&&void 0!==e?e:"ltr"}function uv(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:o,onSelectedValueChange:i,defaultInputValue:l,inputValue:s,open:a,defaultOpen:u=!1,selectionMode:c="none",onItemHighlighted:d,name:f,form:h,disabled:p=!1,readOnly:g=!1,required:m=!1,inputRef:v,grid:y=!1,items:b,filteredItems:w,filter:_,openOnInputClick:S=!0,autoHighlight:x=!1,keepHighlight:C=!1,highlightItemOnHover:E=!0,loopFocus:I=!0,itemToStringLabel:R,itemToStringValue:k,isItemEqualToValue:P=Im,virtualized:O=!1,inline:M=!1,fillInputOnItemPress:T=!0,modal:A=!1,limit:F=-1,autoComplete:N="list",formAutoComplete:z,locale:D,submitOnItemClick:L=!1}=e,{clearErrors:V}=Gm(),{setDirty:$,validityData:j,setFilled:W,name:H,disabled:B,setTouched:U,setFocused:q,validationMode:G,validation:Z}=Bm(),K=av(),J=Xm({id:t}),X=tv({locale:D}),[Y,Q]=yt(!1),[ee,te]=yt(null),ne=St([]),re=St([]),oe=St(null),ie=St(null),le=St(null),se=St(null),ae=St(null),ue=St(!0),ce=St(!1),de=St(null),fe=St(null),he=St(null),pe=St(lv),ge=St(null),me=St([]),ve=St([]),ye=B||p,be=null!=H?H:f,we="multiple"===c,_e="single"===c,Se=void 0!==s||void 0!==l,xe=void 0!==b,Ce=void 0!==w;let Ee;Ee="always"===x?"always":!!x&&"input-change";const[Ie,Re]=wc({controlled:o,default:we?null!=r?r:ud:r,name:"Combobox",state:"selectedValue"}),ke=Ct(()=>null===_?()=>!0:void 0!==_?_:_e&&!Y?function(e,t,n){return(r,o)=>{if(null==r)return!1;if(!o)return!0;const i=Fm(r,t),l=null!=n?Fm(n,t):"";return!(!l||!e.contains(l,o)||l.length!==o.length)||e.contains(i,o)}}(X,R,Ie):function(e,t){return(n,r)=>{if(null==n)return!1;const o=Fm(n,t);return e.contains(o,r)}}(X,R),[_,_e,Ie,Y,X,R]),Pe=Ec(()=>Se?null!=l?l:"":_e?Fm(Ie,R):"").current,[Oe,Me]=wc({controlled:s,default:Pe,name:"Combobox",state:"inputValue"}),[Te,Fe]=wc({controlled:a,default:u,name:"Combobox",state:"open"}),Ne=Tm(b),ze=null!=ee?ee:""===Oe?"":String(Oe).trim(),De=_e?Fm(Ie,R):"",Le=_e&&!Y&&""!==ze&&""!==De&&De.length===ze.length&&X.contains(De,ze),Ve=Le?"":ze,$e=xe&&Ce&&Le,je=Ct(()=>b?Ne?b.flatMap(e=>e.items):b:ud,[b,Ne]),We=Ct(()=>{if(w&&!$e)return w;if(!b)return ud;if(Ne){const e=b,t=[];let n=0;for(const r of e){if(F>-1&&n>=F)break;const e=""===Ve?r.items:r.items.filter(e=>ke(e,Ve,R));if(0===e.length)continue;const o=F>-1?F-n:1/0,i=e.slice(0,o);if(i.length>0){const e={...r,items:i};t.push(e),n+=i.length}}return t}if(""===Ve)return F>-1?je.slice(0,F):je;const e=[];for(const t of je){if(F>-1&&e.length>=F)break;ke(t,Ve,R)&&e.push(t)}return e},[w,$e,b,Ne,Ve,F,ke,R,je]),He=Ct(()=>Ne?We.flatMap(e=>e.items):We,[We,Ne]),Be=Ec(()=>new sd({id:J,labelId:void 0,selectedValue:Ie,open:Te,filter:ke,query:ze,items:b,selectionMode:c,listRef:ne,labelsRef:re,popupRef:oe,emptyRef:ae,inputRef:ie,startDismissRef:le,endDismissRef:se,keyboardActiveRef:ue,chipsContainerRef:de,clearRef:fe,valuesRef:me,allValuesRef:ve,selectionEventRef:he,name:be,form:h,disabled:ye,readOnly:g,required:m,grid:y,isGrouped:Ne,virtualized:O,openOnInputClick:S,itemToStringLabel:R,isItemEqualToValue:P,modal:A,autoHighlight:Ee,submitOnItemClick:L,hasInputValue:Se,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:M,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},itemProps:cd,positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:"none"===c,onOpenChangeComplete:n||ad,setOpen:ad,setInputValue:ad,setSelectedValue:ad,setIndices:ad,onItemHighlighted:ad,handleSelection:ad,forceMount:ad,requestSubmit:ad})).current,Ue="none"===c?Oe:Ie,qe=Ct(()=>"none"===c?Ue:Array.isArray(Ie)?Ie.map(e=>Nm(e,k)):Nm(Ie,k),[Ue,k,c,Ie]),Ge=kc(d),Ze=kc(n),Ke=id(Be,Dm.activeIndex),Je=id(Be,Dm.selectedIndex),Xe=id(Be,Dm.positionerElement),Ye=id(Be,Dm.listElement),Qe=id(Be,Dm.triggerElement),et=id(Be,Dm.inputElement),tt=id(Be,Dm.inputGroupElement),nt=id(Be,Dm.inline),rt=id(Be,Dm.inputInsidePopup),ot=id(Be,Dm.inputOwnsFormValue),it=Fc(Qe),{mounted:lt,setMounted:st,transitionStatus:at}=Tg(Te),{openMethod:ut,triggerProps:ct}=rv(Te),dt=kc(()=>qe);Um(rt?it:ie,J,Ue,dt,!ye,f);const ft=kc(()=>{b?re.current=He.map(e=>Fm(e,R)):Be.set("forceMounted",!0)}),ht=St(Ie);_c(()=>{Ie!==ht.current&&ft()},[ft,Ie]);const pt=kc(e=>{Be.update(e);const t=e.type||"none";if(void 0!==e.activeIndex)if(null===e.activeIndex)pe.current!==lv&&(pe.current=lv,Ge(void 0,Zf(t,void 0,{index:-1})));else{const n=me.current[e.activeIndex];pe.current={value:n,index:e.activeIndex},Ge(n,Zf(t,void 0,{index:e.activeIndex}))}}),gt=kc((t,n)=>{var r;if(ce.current=n.reason===$f,null===(r=e.onInputValueChange)||void 0===r||r.call(e,t,n),!n.isCanceled){if(n.reason===Vf){const e=n.event,r=e.inputType;if("compositionend"===e.type||null!=r&&""!==r&&"insertReplacementText"!==r){const e=""!==t.trim();e&&Q(!0),ge.current={hasQuery:e},e&&Ee&&null==Be.state.activeIndex&&Be.set("activeIndex",0)}}Me(t)}}),mt=kc((t,n)=>{var r;if(Te!==t&&("escape-key"===n.reason&&xe&&0===He.length&&!Be.state.emptyRef.current&&n.allowPropagation(),null===(r=e.onOpenChange)||void 0===r||r.call(e,t,n),!n.isCanceled&&(t&&we&&rt&&!nt&&null!==ee&&(Q(!1),te(null),""!==Oe&&gt("",Gf($f,n.event))),!t&&Y&&(_e?(nt||te(ze),""===ze&&Q(!1)):we&&(nt||te(ze),rt&&pt({activeIndex:null}),rt&&!nt||gt("",Gf($f,n.event)))),Fe(t),!t&&rt&&(n.reason===jf||n.reason===Nf)&&(U(!0),q(!1),"onBlur"===G)))){const e="none"===c?Oe:Ie;Z.commit(e)}}),vt=kc((e,t)=>{null==i||i(e,t),t.isCanceled||(Re(e),("none"===c&&oe.current&&T||_e&&!Be.state.inputInsidePopup)&&gt(Fm(e,R),Gf(t.reason,t.event)),_e&&null!=e&&t.reason!==Vf&&Y&&!nt&&te(ze))}),bt=kc((e,t)=>{var n,r;let o=t;if(void 0===o){if(null===Ke)return;o=me.current[Ke]}const i=Sf(e),l=null!==(n=he.current)&&void 0!==n?n:e;he.current=null;const s=Gf(zf,l),a=null==i||null===(r=i.closest("a"))||void 0===r?void 0:r.getAttribute("href");if(a)a.startsWith("#")&&mt(!1,s);else if(we){const e=Array.isArray(Ie)?Ie:[],t=km(e,o,Be.state.isItemEqualToValue)?Om(e,o,Be.state.isItemEqualToValue):[...e,o];if(vt(t,s),s.isCanceled)return;if(!ie.current||""===ie.current.value.trim())return;Be.state.inputInsidePopup?gt("",Gf($f,s.event)):mt(!1,s)}else{if(vt(o,s),s.isCanceled)return;mt(!1,s)}}),_t=kc(()=>{var e,t,n;if(!Be.state.submitOnItemClick)return;const r=null!==(e=null===(t=Z.inputRef.current)||void 0===t?void 0:t.form)&&void 0!==e?e:null===(n=Be.state.inputElement)||void 0===n?void 0:n.form;r&&"function"==typeof r.requestSubmit&&r.requestSubmit()}),Et=kc(()=>{if(st(!1),null==Ze||Ze(!1),Q(!1),te(null),pt("none"===c?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),we&&ie.current&&""!==ie.current.value&&!ce.current&&gt("",Gf($f)),_e)if(Be.state.inputInsidePopup)ie.current&&""!==ie.current.value&&gt("",Gf($f));else{const e=Fm(Ie,R);ie.current&&ie.current.value!==e&&gt(e,Gf(""===e?$f:Mf))}}),It=Ct(()=>nt&&Xe?{current:Xe.closest('[role="dialog"]')}:oe,[nt,Xe]);Lg({enabled:!e.actionsRef,open:Te,ref:It,onComplete(){Te||Et()}}),xt(e.actionsRef,()=>({unmount:Et}),[Et]),_c(function(){if(Te||"none"===c)return;const e=b?je:ve.current;if(we){const t=Array.isArray(Ie)?Ie:[],n=Pm(e,t[t.length-1],P);pt({selectedIndex:-1===n?null:n})}else{const t=Pm(e,Ie,P);pt({selectedIndex:-1===t?null:t})}},[Te,Ie,b,c,je,we,P,pt]),_c(()=>{b&&(me.current=He,ne.current.length=He.length)},[b,He]),_c(()=>{const e=ge.current;if(e&&(e.hasQuery?Ee&&Be.set("activeIndex",0):"always"===Ee&&Be.set("activeIndex",0),ge.current=null),!Te&&!nt)return;const t=xe||Ce?He:me.current,n=Be.state.activeIndex;if(null==n)return"always"===Ee&&t.length>0?void Be.set("activeIndex",0):void(pe.current!==lv&&(pe.current=lv,Be.state.onItemHighlighted(void 0,Zf(Mf,void 0,{index:-1}))));if(n>=t.length)return pe.current!==lv&&(pe.current=lv,Be.state.onItemHighlighted(void 0,Zf(Mf,void 0,{index:-1}))),void Be.set("activeIndex",null);const r=t[n],o=pe.current.value,i=o!==iv&&Rm(r,o,Be.state.isItemEqualToValue);pe.current.index===n&&i||(pe.current={value:r,index:n},Be.state.onItemHighlighted(r,Zf(Mf,void 0,{index:n})))},[Ke,Ee,Ce,xe,He,nt,Te,Be]),_c(()=>{W("none"!==c?we?Array.isArray(Ie)&&Ie.length>0:null!=Ie:""!==String(Oe))},[W,c,Oe,Ie,we]),wt(()=>{xe&&Ee&&0===He.length&&pt({activeIndex:null})},[xe,Ee,He.length,pt]),nv(ze,()=>{Te&&""!==ze&&ze!==String(Pe)&&Q(!0)}),nv(Ie,()=>{if("none"!==c&&(V(be),$(function(e){const t=j.initialValue;return Array.isArray(e)&&Array.isArray(t)?!ov(e,t,(e,t)=>Rm(e,t,P)):e!==t}(Ie)),Z.change(Ie),_e&&!Se&&!rt)){const e=Fm(Ie,R);Oe!==e&&gt(e,Gf(Mf))}}),nv(Oe,()=>{"none"===c&&(V(be),$(Oe!==j.initialValue),Z.change(Oe))}),nv(b,()=>{if(!_e||Se||rt||Y)return;const e=Fm(Ie,R);Oe!==e&&gt(e,Gf(Mf))});const Rt=Xg({open:!!nt||Te,onOpenChange:mt,elements:{reference:rt?Qe:et,floating:Xe}});let kt,Pt;nt||(kt=y?"grid":"listbox",Pt=Te?"true":"false");const Ot=Ct(()=>{const e="INPUT"===(null==et?void 0:et.tagName),t=null==et||e,n=t?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return(t||Te)&&(n.role="combobox",n["aria-expanded"]=Pt,n["aria-haspopup"]=kt,n["aria-controls"]=Te?null==Ye?void 0:Ye.id:void 0,n["aria-autocomplete"]=N),{reference:n,floating:{role:"presentation"}}},[et,Te,Pt,kt,null==Ye?void 0:Ye.id,N]),Mt=Jp(Rt,{enabled:!g&&!ye&&S,event:"mousedown-only",toggle:!1,touchOpenDelay:rt?0:100,reason:"input-press"}),Tt=Yp(Rt,{enabled:!g&&!ye&&!nt,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:!!nt||void 0,outsidePress(e){const t=Sf(e);return!(_f(Qe,t)||_f(fe.current,t)||_f(de.current,t)||_f(tt,t))}}),At=am(Rt,{enabled:!g&&!ye,id:J,listRef:ne,activeIndex:Ke,selectedIndex:Je,virtual:!0,loopFocus:I,allowEscape:I&&!Ee,focusItemOnOpen:!(Y||"none"===c&&!Ee)&&"auto",focusItemOnHover:E,resetOnPointerLeave:!C,orientation:y?"horizontal":void 0,rtl:"rtl"===K,disabledIndices:ud,grid:y?mm:void 0,onNavigate(e,t){(t||Te)&&"ending"!==at&&pt(t?{activeIndex:e,type:ue.current?"keyboard":"pointer"}:{activeIndex:e})}}),Ft=Ct(()=>hp(At.reference,{onKeyDown(e){!y||null!=Be.state.activeIndex||"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.preventBaseUIHandler()}},Tt.reference,Mt.reference,Ot.reference),[At.reference,Tt.reference,Mt.reference,Ot.reference,y,Be]),Nt=Ct(()=>hp(Vg,At.floating,Tt.floating,Ot.floating),[At.floating,Tt.floating,Ot.floating]),zt=Ct(()=>{const e=At.item;return e?{...e,onFocus:void 0}:cd},[At.item]);Sc(()=>{Be.update({inline:M,popupProps:Nt,inputProps:Ft,triggerProps:ct,itemProps:zt,setOpen:mt,setInputValue:gt,setSelectedValue:vt,setIndices:pt,onItemHighlighted:Ge,handleSelection:bt,forceMount:ft,requestSubmit:_t})}),_c(()=>{Be.update({id:J,selectedValue:Ie,open:Te,mounted:lt,transitionStatus:at,items:b,inline:M,popupProps:Nt,inputProps:Ft,triggerProps:ct,openMethod:ut,itemProps:zt,selectionMode:c,name:be,form:h,disabled:ye,readOnly:g,required:m,grid:y,isGrouped:Ne,virtualized:O,onOpenChangeComplete:Ze,openOnInputClick:S,itemToStringLabel:R,modal:A,autoHighlight:Ee,isItemEqualToValue:P,submitOnItemClick:L,hasInputValue:Se,requestSubmit:_t,inputOwnsFormValue:"none"===c&&(M||!Be.state.inputInsidePopup)})},[Be,J,Ie,Te,lt,at,b,Nt,Ft,zt,ut,ct,c,be,ye,g,m,Z,y,Ne,O,Ze,S,R,A,P,L,Se,M,_t,Ee,h]);const Dt=Mc(v,Z.inputRef),Lt=Ct(()=>({query:ze,hasItems:xe,filteredItems:We,flatFilteredItems:He}),[ze,xe,We,He]),Vt=Ct(()=>Array.isArray(Ue)?"":Nm(Ue,k),[Ue,k]),$t=we&&Array.isArray(Ie)&&Ie.length>0,jt=we||"none"===c&&ot?void 0:be,Wt=Ct(()=>we&&Array.isArray(Ie)&&be?Ie.map(e=>{const t=Nm(e,k);return Zo.jsx("input",{type:"hidden",form:h,name:be,value:t,disabled:ye},t)}):null,[we,Ie,h,be,k,ye]),Ht=Zo.jsxs(Ae,{children:[e.children,Zo.jsx("input",{...Z.getValidationProps(ye,{onFocus(){var e;rt?null==Qe||Qe.focus():null===(e=ie.current||Qe)||void 0===e||e.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||ye||g)return;const t=e.currentTarget.value,n=t.toLowerCase(),r=Gf(Mf,e.nativeEvent),o=()=>me.current.findIndex(e=>Nm(e,k).toLowerCase()===n||Fm(e,R).toLowerCase()===n);_e&&(ft(),b&&-1===o()&&Be.set("forceMounted",!0)),queueMicrotask(function(){if(we)return;if("none"===c)return void gt(t,r);let e=o();-1===e&&(e=me.current.findIndex((e,t)=>{const r=re.current[t];return null!=r&&r.toLowerCase()===n}));const i=-1===e?void 0:me.current[e];null!=i&&(null==vt||vt(i,r))})}}),id:J&&null==jt?`${J}-hidden-input`:void 0,form:h,name:jt,autoComplete:z,disabled:ye,required:m&&!$t,readOnly:g,value:Vt,ref:Dt,style:jt?Lc:Dc,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Wt]});return Zo.jsx(vm.Provider,{value:Be,children:Zo.jsx(ym.Provider,{value:Rt,children:Zo.jsx(wm.Provider,{value:xe,children:Zo.jsx(bm.Provider,{value:Lt,children:Zo.jsx(_m.Provider,{value:Oe,children:Ht})})})})})}function cv(e){const{multiple:t=!1,defaultValue:n,value:r,onValueChange:o,autoComplete:i,...l}=e;return Zo.jsx(uv,{...l,selectionMode:t?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:o,formAutoComplete:i})}function dv(e,t){return null!=e?e:t}let fv=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Ag.startingStyle]="startingStyle",e[e.endingStyle=Ag.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e}({}),hv=function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e}({});const pv={[hv.popupOpen]:""},gv={[hv.popupOpen]:"",[hv.pressed]:""},mv={[fv.open]:""},vv={[fv.closed]:""},yv={[fv.anchorHidden]:""},bv={open:e=>e?pv:null},wv={open:e=>e?gv:null},_v={open:e=>e?mv:vv,anchorHidden:e=>e?yv:null},Sv={...wv,...jm,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null},xv=rt(void 0),Cv=rt(void 0);function Ev(e){const t=It(Cv);if(void 0===t&&!e)throw new Error(Vc(21));return t}const Iv=rt(void 0);function Rv(e=!1){const t=It(Iv);if(void 0===t&&!e)throw new Error(Vc(16));return t}function kv(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0,composite:i}=e,l=St(null),s=Rv(!0),a=null!=i?i:void 0!==s,{props:u}=function(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:i}=e,l=r&&!1!==t,s=r&&!1===t;return{props:Ct(()=>{const e={onKeyDown(e){n&&t&&"Tab"!==e.key&&e.preventDefault()}};return r||(e.tabIndex=o,!i&&n&&(e.tabIndex=t?o:-1)),(i&&(t||l)||!i&&n)&&(e["aria-disabled"]=n),!i||t&&!s||(e.disabled=n),e},[r,n,t,l,s,i,o])}}({focusableWhenDisabled:n,disabled:t,composite:a,tabIndex:r,isNativeButton:o}),c=Et(()=>{const e=l.current;Pv(e)&&a&&t&&void 0===u.disabled&&e.disabled&&(e.disabled=!1)},[t,u.disabled,a]);return _c(c,[c]),{getButtonProps:Et((e={})=>{const{onClick:n,onMouseDown:r,onKeyUp:i,onKeyDown:l,onPointerDown:s,...c}=e;return hp({onClick(e){t?e.preventDefault():null==n||n(e)},onMouseDown(e){t||null==r||r(e)},onKeyDown(e){if(t)return;if(_p(e),null==l||l(e),e.baseUIHandlerPrevented)return;const r=e.target===e.currentTarget,i=e.currentTarget,s=Pv(i),u=!o&&(c=i,Boolean("A"===(null==c?void 0:c.tagName)&&(null==c?void 0:c.href)));var c;const d=r&&(o?s:!u),f="Enter"===e.key,h=" "===e.key,p=i.getAttribute("role"),g=(null==p?void 0:p.startsWith("menuitem"))||"option"===p||"gridcell"===p;if(r&&a&&h){if(e.defaultPrevented&&g)return;return e.preventDefault(),void(u||o&&s?(i.click(),e.preventBaseUIHandler()):d&&(null==n||n(e),e.preventBaseUIHandler()))}d&&(o||!h&&!f||e.preventDefault(),!o&&f&&(null==n||n(e)))},onKeyUp(e){t||(_p(e),null==i||i(e),e.target===e.currentTarget&&o&&a&&Pv(e.currentTarget)&&" "===e.key?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||o||a||" "!==e.key||null==n||n(e))},onPointerDown(e){t?e.preventDefault():null==s||s(e)}},o?{type:"button"}:{role:"button"},u,c)},[t,u,a,o]),buttonRef:kc(e=>{l.current=e,c()})}}function Pv(e){return yd(e)&&"BUTTON"===e.tagName}const Ov=Zt(function(e,t){const n=Sm(),{buttonRef:r,getButtonProps:o}=kv({native:!1}),i=Mc(t,r),l=o({onClick:function(e){n.state.setOpen(!1,Gf(Df,e.nativeEvent,e.currentTarget))}});return Zo.jsx("span",{ref:i,...l,"aria-label":"Dismiss",tabIndex:void 0,style:Lc})}),Mv=Zt(function(e,t){var n,r;const{render:o,className:i,disabled:l=!1,id:s,style:a,...u}=e,{state:c,disabled:d,setTouched:f,setFocused:h,validationMode:p,validation:g}=Bm(),{labelId:m}=Jm(),v=It(xv),y=Ev(!0),b=Boolean(y),w=Sm(),{filteredItems:_}=Cm(),S=Em(),x=av(),C=id(w,Dm.required),E=id(w,Dm.disabled),I=id(w,Dm.readOnly),R=id(w,Dm.name),k=id(w,Dm.form),P=id(w,Dm.selectionMode),O=id(w,Dm.autoHighlight),M=id(w,Dm.inputProps),T=id(w,Dm.triggerProps),A=id(w,Dm.open),F=id(w,Dm.mounted),N=id(w,Dm.selectedValue),z=id(w,Dm.popupSide),D=id(w,Dm.positionerElement),L=id(w,Dm.id),V=id(w,Dm.inline),$=id(w,Dm.modal),j=Boolean(O),W=F&&D?z:null,H=d||E||l,B=0===_.length,U=b||V,q=!U||$,G=Zm(null!=s?s:U?void 0:L),Z=dv(m,void 0),K=b?Vm:c,[J,X]=yt(null),Y=St(!1),Q=St(null),ee=St(!1),te="none"===P&&!b,ne=kc(e=>{const t=b||w.state.inline;t&&!w.state.hasInputValue&&w.state.setInputValue("",Gf(Mf)),w.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:te})}),re=b||!g?u:g.getValidationProps(H,u),oe=Cp("input",e,{state:{...K,open:A,disabled:H,readOnly:I,popupSide:W,listEmpty:B},ref:[t,w.state.inputRef,ne],props:[M,T,{type:"text",value:null!==(n=null!==(r=e.value)&&void 0!==r?r:J)&&void 0!==n?n:S,"aria-readonly":I||void 0,"aria-required":C||void 0,"aria-labelledby":Z,disabled:H,readOnly:I,required:"none"===P?C:void 0,form:k,...te&&R&&{name:R},id:G,onFocus(){if(h(!0),!V||!ee.current)return;ee.current=!1;const e=Q.current;null!=e&&Object.hasOwn(w.state.valuesRef.current,e)&&w.state.setIndices({activeIndex:e})},onBlur(){f(!0),h(!1);const e=w.state.activeIndex;if(V&&null!==e&&"always"!==O&&(Q.current=e,ee.current=!0,w.state.setIndices({activeIndex:null})),"onBlur"===p){const e="none"===P?S:N;g.commit(e)}},onCompositionStart(e){nf||(Y.current=!0,X(e.currentTarget.value))},onCompositionEnd(e){Y.current=!1;const t=e.currentTarget.value;X(null),w.state.setInputValue(t,Gf(Vf,e.nativeEvent))},onChange(e){const t=e.nativeEvent.inputType,n=!t||"insertReplacementText"===t,r=Y.current||!n;if(Y.current){const t=e.currentTarget.value;X(t),""!==t||w.state.openOnInputClick||w.state.inputInsidePopup||w.state.setOpen(!1,Gf($f,e.nativeEvent));const n=t.trim(),o=j&&""!==n;return I||H||!n||r&&(w.state.setOpen(!0,Gf(Vf,e.nativeEvent)),j||w.state.setIndices({activeIndex:null,selectedIndex:null,type:w.state.keyboardActiveRef.current?"keyboard":"pointer"})),void(A&&null!==w.state.activeIndex&&!o&&w.state.setIndices({activeIndex:null,selectedIndex:null,type:w.state.keyboardActiveRef.current?"keyboard":"pointer"}))}const o=Gf(Vf,e.nativeEvent);if(w.state.setInputValue(e.currentTarget.value,o),o.isCanceled)return;const i=""===e.currentTarget.value,l=Gf($f,e.nativeEvent);i&&!w.state.inputInsidePopup&&("single"===P&&w.state.setSelectedValue(null,l),w.state.openOnInputClick||w.state.setOpen(!1,l));const s=e.currentTarget.value.trim();I||H||!s||r&&(w.state.setOpen(!0,Gf(Vf,e.nativeEvent)),j||w.state.setIndices({activeIndex:null,selectedIndex:null,type:w.state.keyboardActiveRef.current?"keyboard":"pointer"})),A&&null!==w.state.activeIndex&&!j&&w.state.setIndices({activeIndex:null,selectedIndex:null,type:w.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(e){if(H||I)return;if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;w.state.keyboardActiveRef.current=!0;const t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r="rtl"===x;if("Home"===e.key){cf(e);const n=sf&&r?t.value.length:0;return t.setSelectionRange(n,n),void(t.scrollLeft=0)}if("End"===e.key){cf(e);const o=sf&&r?0:t.value.length;return t.setSelectionRange(o,o),void(t.scrollLeft=r?-n:n)}if(!F&&"Escape"===e.key){const t="multiple"===P&&Array.isArray(N)?0===N.length:null===N,n=Gf(Wf,e.nativeEvent),r="multiple"===P?[]:null;return w.state.setInputValue("",n),w.state.setSelectedValue(r,n),void(t||w.state.inline||n.isPropagationAllowed||e.stopPropagation())}if(v&&"Backspace"===e.key&&""===t.value&&void 0===v.highlightedChipIndex&&Array.isArray(N)&&N.length>0){const t=v.chipsRef.current.length,n=t>0?t-1:N.length-1,r=N.filter((e,t)=>t!==n);return w.state.setIndices({activeIndex:null,selectedIndex:null,type:w.state.keyboardActiveRef.current?"keyboard":"pointer"}),void w.state.setSelectedValue(r,Gf(Mf,e.nativeEvent))}const o=void 0!==(null==v?void 0:v.highlightedChipIndex),i=function(e){var t;if(!v)return;let n;const{highlightedChipIndex:r}=v,o=v.chipsRef.current.length,i="rtl"===x,l=i?"ArrowRight":"ArrowLeft",s=i?"ArrowLeft":"ArrowRight";if(void 0!==r){if(e.key===l)e.preventDefault(),n=r>0?r-1:void 0;else if(e.key===s)e.preventDefault(),n=r<o-1?r+1:void 0;else if("Backspace"===e.key||"Delete"===e.key){e.preventDefault();const t=r>=N.length-1?N.length-2:r;n=t>=0?t:void 0,w.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return n}return e.key===l&&0===(null!==(t=e.currentTarget.selectionStart)&&void 0!==t?t:0)&&N.length>0?(e.preventDefault(),n=o>0?o-1:void 0):"Backspace"===e.key&&""===e.currentTarget.value&&N.length>0&&(w.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),e.preventDefault()),n}(e);var l;if(null==v||v.setHighlightedChipIndex(i),void 0!==i)null==v||null===(l=v.chipsRef.current[i])||void 0===l||l.focus();else if(o){var s;null===(s=w.state.inputRef.current)||void 0===s||s.focus()}if(229!==e.which&&"Enter"===e.key&&A){const t=w.state.activeIndex,n=e.nativeEvent;if(null===t){if(V)return;return void w.state.setOpen(!1,Gf(Mf,n))}cf(e);const r=w.state.listRef.current[t];r&&(w.state.selectionEventRef.current=n,r.click(),w.state.selectionEventRef.current=null)}},onPointerMove(){w.state.keyboardActiveRef.current=!1},onPointerDown(){w.state.keyboardActiveRef.current=!1}},re],stateAttributesMapping:Sv}),ie=b?Zo.jsx(Hm.Provider,{value:Wm,children:oe}):oe;return Zo.jsxs(Ae,{children:[A&&q&&Zo.jsx(Ov,{ref:w.state.startDismissRef}),ie]})});function Tv(e){const t=e.getBoundingClientRect(),n=pd(e);if(uf)return t;const r=n.getComputedStyle(e,"::before"),o=n.getComputedStyle(e,"::after");if("none"===r.content&&"none"===o.content)return t;const i=parseFloat(r.width)||0,l=parseFloat(r.height)||0,s=parseFloat(o.width)||0,a=parseFloat(o.height)||0,u=Math.max(t.width,i,s),c=Math.max(t.height,l,a),d=u-t.width,f=c-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}const Av=Zt(function(e,t){const{render:n,className:r,nativeButton:o=!0,disabled:i=!1,id:l,style:s,...a}=e,{state:u,disabled:c,setTouched:d,setFocused:f,validationMode:h,validation:p}=Bm(),{labelId:g}=Jm(),m=Sm(),{filteredItems:v}=Cm(),y=id(m,Dm.selectionMode),b=id(m,Dm.disabled),w=id(m,Dm.readOnly),_=id(m,Dm.required),S=id(m,Dm.mounted),x=id(m,Dm.popupSide),C=id(m,Dm.positionerElement),E=id(m,Dm.listElement),I=id(m,Dm.popupId),R=id(m,Dm.triggerProps),k=id(m,Dm.triggerElement),P=id(m,Dm.inputInsidePopup),O=id(m,Dm.id),M=id(m,Dm.labelId),T=id(m,Dm.open),A=id(m,Dm.selectedValue),F=id(m,Dm.activeIndex),N=id(m,Dm.selectedIndex),z=id(m,Dm.hasSelectedValue),D=xm(),L=Em(),V=qd(),$=c||b||i,j=0===v.length,W=S&&C?x:null;Xm({id:P?l:void 0});const H=P?null!=l?l:O:l,B=dv(g,M);let U;T&&P?U=null!=I?I:Ym(O):T&&(U=null==E?void 0:E.id);const q=St("");function G(e){q.current=e.pointerType}const Z=D.useState("domReferenceElement");wt(()=>{P&&k&&k!==Z&&D.set("domReferenceElement",k)},[k,Z,D,P]);const{reference:K}=um(D,{enabled:!T&&!w&&!b&&"single"===y,listRef:m.state.labelsRef,activeIndex:F,selectedIndex:N,onMatch(e){const t=m.state.valuesRef.current[e];void 0!==t&&m.state.setSelectedValue(t,Gf("none"))}}),{reference:J}=Jp(D,{enabled:!w&&!b,event:"mousedown"}),{buttonRef:X,getButtonProps:Y}=kv({native:o,disabled:$}),Q={...u,open:T,disabled:$,popupSide:W,listEmpty:j,placeholder:"none"!==y&&!z};return Cp("button",e,{ref:[t,X,kc(e=>{m.set("triggerElement",e)})],state:Q,props:[R,J,K,{id:H,tabIndex:P?0:-1,role:P?"combobox":void 0,"aria-expanded":T?"true":"false","aria-haspopup":P?"dialog":"listbox","aria-controls":U,"aria-required":P&&_||void 0,"aria-labelledby":B,onPointerDown:G,onPointerEnter:G,onFocus(){f(!0),$||w||V.start(0,m.state.forceMount)},onBlur(e){if(!_f(C,e.relatedTarget)&&(d(!0),f(!1),"onBlur"===h)){const e="none"===y?L:A;p.commit(e)}},onMouseDown(e){if($||w)return;var t;if(P||D.set("domReferenceElement",e.currentTarget),m.state.forceMount(),"touch"!==q.current&&(null===(t=m.state.inputRef.current)||void 0===t||t.focus(),P||e.preventDefault()),T)return;const n=Dd(e.currentTarget);P&&n.addEventListener("mouseup",function(e){if(!k)return;const t=Sf(e),n=m.state.positionerElement,r=m.state.listElement;if(_f(k,t)||_f(n,t)||_f(r,t)||t===k)return;const o=Tv(k),i=e.clientX>=o.left-2&&e.clientX<=o.right+2,l=e.clientY>=o.top-2&&e.clientY<=o.bottom+2;i&&l||m.state.setOpen(!1,Gf("cancel-open",e))},{once:!0})},onKeyDown(e){var t;$||w||"ArrowDown"!==e.key&&"ArrowUp"!==e.key||(cf(e),m.state.setOpen(!0,Gf(Hf,e.nativeEvent)),null===(t=m.state.inputRef.current)||void 0===t||t.focus())}},p?p.getValidationProps($,a):a,Y],stateAttributesMapping:Sv})}),Fv=rt(null);function Nv(e){const{children:t}=e,{filteredItems:n}=Cm(),r=It(Fv),o=r?r.items:n;return o?Zo.jsx(Ae,{children:o.map(t)}):null}const zv=rt({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function Dv(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,i=kc(o),l=St(0),s=Ec(Vv).current,a=Ec(Lv).current,[u,c]=yt(0),d=St(u),f=kc((e,t)=>{a.set(e,null!=t?t:null),d.current+=1,c(d.current)}),h=kc(e=>{a.delete(e),d.current+=1,c(d.current)}),p=Ct(()=>{const e=new Map;return Array.from(a.keys()).filter(e=>e.isConnected).sort($v).forEach((t,n)=>{var r;const o=null!==(r=a.get(t))&&void 0!==r?r:{};e.set(t,{...o,index:n})}),e},[a,u]);_c(()=>{if("function"!=typeof MutationObserver||0===p.size)return;const e=new MutationObserver(e=>{const 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)}),0===t.size&&(d.current+=1,c(d.current))});return p.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[p]),_c(()=>{d.current===u&&(n.current.length!==p.size&&(n.current.length=p.size),r&&r.current.length!==p.size&&(r.current.length=p.size),l.current=p.size),i(p)},[i,p,n,r,u]),_c(()=>()=>{n.current=[]},[n]),_c(()=>()=>{r&&(r.current=[])},[r]);const g=kc(e=>(s.add(e),()=>{s.delete(e)}));_c(()=>{s.forEach(e=>e(p))},[s,p]);const m=Ct(()=>({register:f,unregister:h,subscribeMapChange:g,elementsRef:n,labelsRef:r,nextIndexRef:l}),[f,h,g,n,r,l]);return Zo.jsx(zv.Provider,{value:m,children:t})}function Lv(){return new Map}function Vv(){return new Set}function $v(e,t){const 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}const jv=Zt(function(e,t){var n;const{render:r,className:o,style:i,children:l,...s}=e,a=Sm(),u=xm(),c=Boolean(Ev(!0)),{filteredItems:d,hasItems:f}=Cm(),h=id(a,Dm.selectionMode),p=id(a,Dm.grid),g=id(a,Dm.popupProps),m=id(a,Dm.virtualized),v=id(a,Dm.forceMounted),y="multiple"===h,b=0===d.length,w=kc(e=>{a.set("positionerElement",e)}),_=kc(e=>{a.set("listElement",e)}),S=Cp("div",e,{state:{empty:b},ref:[t,_,c?null:w],props:[g,{children:Ct(()=>"function"==typeof l?n||(n=Zo.jsx(Nv,{children:l})):l,[l]),tabIndex:-1,id:u.useState("floatingId"),role:p?"grid":"listbox","aria-multiselectable":y?"true":void 0,onKeyDown(e){if(!a.state.disabled&&!a.state.readOnly&&"Enter"===e.key){const t=a.state.activeIndex;if(null==t)return;cf(e);const n=e.nativeEvent,r=a.state.listRef.current[t];r&&(a.state.selectionEventRef.current=n,r.click(),a.state.selectionEventRef.current=null)}},onKeyDownCapture(){a.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){a.state.keyboardActiveRef.current=!1}},s]});if(m)return S;const x=f&&!v?void 0:a.state.labelsRef;return Zo.jsx(Dv,{elementsRef:a.state.listRef,labelsRef:x,children:S})});const Wv=rt(void 0),Hv=Zt(function(e,t){const{keepMounted:n=!1,...r}=e,o=Sm(),i=id(o,Dm.mounted),l=id(o,Dm.forceMounted);return i||n||l?Zo.jsx(Wv.Provider,{value:n,children:Zo.jsx(Ap,{ref:t,...r})}):null});function Bv(e){return Qc(19)?e:e?"true":void 0}const Uv=e=>({name:"arrow",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,rects:s,platform:a,elements:u,middlewareData:c}=t,{element:d,padding:f=0,offsetParent:h="real"}=oh(e,t)||{};if(null==d)return{};const p=vh(f),g={x:o,y:i},m=ch(l),v=ah(m),y=await a.getDimensions(d),b="y"===m,w=b?"top":"left",_=b?"bottom":"right",S=b?"clientHeight":"clientWidth",x=s.reference[v]+s.reference[m]-g[m]-s.floating[v],C=g[m]-s.reference[m],E="real"===h?await(null===(n=a.getOffsetParent)||void 0===n?void 0:n.call(a,d)):u.floating;let I=u.floating[S]||s.floating[v];I&&await(null===(r=a.isElement)||void 0===r?void 0:r.call(a,E))||(I=u.floating[S]||s.floating[v]);const R=x/2-C/2,k=I/2-y[v]/2-1,P=Math.min(p[w],k),O=Math.min(p[_],k),M=P,T=I-y[v]-O,A=I/2-y[v]/2+R,F=rh(M,A,T),N=!c.arrow&&null!=lh(l)&&A!==F&&s.reference[v]/2-(A<M?P:O)-y[v]/2<0,z=N?A<M?A-M:A-T:0;return{[m]:g[m]+z,data:{[m]:F,centerOffset:A-F-z,...N&&{alignmentOffset:z}},reset:N}}}),qv=(e=>{const t=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=oh(e,t);switch(o){case"referenceHidden":{const e=tg(await r.detectOverflow(t,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ng(e)}}}case"escaped":{const e=tg(await r.detectOverflow(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ng(e)}}}default:return{}}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})().fn,Gv={name:"hide",async fn(e){var t;const{width:n,height:r,x:o,y:i}=e.rects.reference,l=0===n&&0===r&&0===o&&0===i;return{data:{referenceHidden:(null===(t=(await qv(e)).data)||void 0===t?void 0:t.referenceHidden)||l}}}},Zv={sideX:"left",sideY:"top"},Kv={name:"adaptiveOrigin",async fn(e){var t,n;const{x:r,y:o,rects:{floating:i},elements:{floating:l},platform:s,strategy:a,placement:u}=e,c=pd(l),d=c.getComputedStyle(l);if("0s"===d.transitionDuration||""===d.transitionDuration)return{x:r,y:o,data:Zv};const f=await(null===(t=s.getOffsetParent)||void 0===t?void 0:t.call(s,l));let h={width:0,height:0};if("fixed"===a&&null!=c&&c.visualViewport)h={width:c.visualViewport.width,height:c.visualViewport.height};else if(f===c){const e=Dd(l);h={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await(null===(n=s.isElement)||void 0===n?void 0:n.call(s,f))&&(h=await s.getDimensions(f));const p=ih(u);let g=r,m=o;return"left"===p&&(g=h.width-(r+i.width)),"top"===p&&(m=h.height-(o+i.height)),{x:g,y:m,data:{sideX:"left"===p?"right":Zv.sideX,sideY:"top"===p?"bottom":Zv.sideY}}}};function Jv(e,t,n){const r="inline-start"===e||"inline-end"===e;return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function Xv(e,t,n){const{rects:r,placement:o}=e;return{side:Jv(t,ih(o),n),align:lh(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Yv(e){var t,n;const{anchor:r,positionMethod:o="absolute",side:i="bottom",sideOffset:l=0,align:s="center",alignOffset:a=0,collisionBoundary:u,collisionPadding:c=5,sticky:d=!1,arrowPadding:f=5,disableAnchorTracking:h=!1,inline:p,keepMounted:g=!1,floatingRootContext:m,mounted:v,collisionAvoidance:y,shiftCrossAxis:b=!1,nodeId:w,adaptiveOrigin:_,lazyFlip:S=!1,externalTree:x}=e,[C,E]=yt(null);v||null===C||E(null);const I=y.side||"flip",R=y.align||"flip",k=y.fallbackAxisSide||"end",P="function"==typeof r?r:void 0,O=kc(P),M=P?O:r,T=Fc(r),A=Fc(v),F="rtl"===av(),N=C||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":F?"left":"right","inline-start":F?"right":"left"}[i],z="center"===s?N:`${N}-${s}`;let D=c;const L="bottom"===i?1:0,V="top"===i?1:0,$="right"===i?1:0,j="left"===i?1:0;"number"==typeof D?D={top:D+L,right:D+j,bottom:D+V,left:D+$}:D&&(D={top:(D.top||0)+L,right:(D.right||0)+j,bottom:(D.bottom||0)+V,left:(D.left||0)+$});const W={boundary:"clipping-ancestors"===u?"clippingAncestors":u,padding:D},H=St(null),B=Fc(l),U=Fc(a),q="function"!=typeof l?l:0,G="function"!=typeof a?a:0,Z=[];p&&Z.push(p),Z.push(((e,t)=>{const n=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:s}=t,a=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=ih(n),s=lh(n),a="y"===uh(n),u=rg.has(l)?-1:1,c=i&&a?-1:1,d=oh(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof p&&(h="end"===s?-1*p:p),a?{x:h*c,y:f*u}:{x:f*u,y:h*c}}(t,e);return l===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:l}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}})(e=>{const t=Xv(e,i,F),n="function"==typeof B.current?B.current(t):B.current,r="function"==typeof U.current?U.current(t):U.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[q,G,F,i]));const K="none"===R&&"shift"!==I,J=!K&&(d||b||"shift"===I),X="none"===I?null:(e=>{const t=_g(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({...W,padding:{top:D.top+1,right:D.right+1,bottom:D.bottom+1,left:D.left+1},mainAxis:!b&&"flip"===I,crossAxis:"flip"===R&&"alignment",fallbackAxisSideDirection:k}),Y=K?null:((e,t)=>{const n=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:l=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=oh(e,t),c={x:n,y:r},d=await i.detectOverflow(t,u),f=uh(ih(o)),h=sh(f);let p=c[h],g=c[f];if(l){const e="y"===h?"bottom":"right";p=rh(p+d["y"===h?"top":"left"],p,p-d[e])}if(s){const e="y"===f?"bottom":"right";g=rh(g+d["y"===f?"top":"left"],g,g-d[e])}const m=a.fn({...t,[h]:p,[f]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:l,[f]:s}}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}})(e=>{const t=Dd(e.elements.floating).documentElement;return{...W,rootBoundary:b?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:"none"!==R,crossAxis:J,limiter:d||b?void 0:(n=e=>{if(!H.current)return{};const{width:t,height:n}=H.current.getBoundingClientRect(),r=uh(ih(e.placement));return{offset:("y"===r?t:n)/2+("y"===r?D.left+D.right:D.top+D.bottom)/2}},{fn:Sg(n).fn,options:[n,undefined]})};var n},[W,d,b,D,R]);var Q,ee;"shift"===I||"shift"===R||"center"===s?Z.push(Y,X):Z.push(X,Y),Z.push((e=>{const t=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:l,elements:s}=t,{apply:a=()=>{},...u}=oh(e,t),c=await l.detectOverflow(t,u),d=ih(o),f=lh(o),h="y"===uh(o),{width:p,height:g}=i.floating;let m,v;"top"===d||"bottom"===d?(m=d,v=f===(await(null==l.isRTL?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,m="end"===f?"top":"bottom");const y=g-c.top-c.bottom,b=p-c.left-c.right,w=Xf(g-c[m],y),_=Xf(p-c[v],b),S=!t.middlewareData.shift;let x=w,C=_;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(C=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(x=y),S&&!f){const e=Yf(c.left,0),t=Yf(c.right,0),n=Yf(c.top,0),r=Yf(c.bottom,0);h?C=p-2*(0!==e||0!==t?e+t:Yf(c.left,c.right)):x=g-2*(0!==n||0!==r?n+r:Yf(c.top,c.bottom))}await a({...t,availableWidth:C,availableHeight:x});const E=await l.getDimensions(s.floating);return p!==E.width||g!==E.height?{reset:{rects:!0}}:{}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({...W,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!A.current)return;const o=e.style;o.setProperty("--available-width",`${t}px`),o.setProperty("--available-height",`${n}px`);const i=pd(e).devicePixelRatio||1,{x:l,y:s,width:a,height:u}=r.reference,c=(Math.round((l+a)*i)-Math.round(l*i))/i,d=(Math.round((s+u)*i)-Math.round(s*i))/i;o.setProperty("--anchor-width",`${c}px`),o.setProperty("--anchor-height",`${d}px`)}}),(ee=[f],{...Uv(Q=e=>({element:H.current||Dd(e.elements.floating).createElement("div"),padding:f,offsetParent:"floating"})),options:[Q,ee]}),{name:"transformOrigin",fn(e){var t,n,r;const{elements:o,middlewareData:s,placement:a,rects:u,y:c}=e,d=ih(a),f=uh(d),h=H.current,p=(null===(t=s.arrow)||void 0===t?void 0:t.x)||0,g=(null===(n=s.arrow)||void 0===n?void 0:n.y)||0,m=p+((null==h?void 0:h.clientWidth)||0)/2,v=g+((null==h?void 0:h.clientHeight)||0)/2,y=Math.abs((null===(r=s.shift)||void 0===r?void 0:r.y)||0),b=u.reference.height/2,w="function"==typeof l?l(Xv(e,i,F)):l,_=y>w,S={top:`${m}px calc(100% + ${w}px)`,bottom:`${m}px ${-w}px`,left:`calc(100% + ${w}px) ${v}px`,right:`${-w}px ${v}px`}[d],x=`${m}px ${u.reference.y+b-c}px`;return o.floating.style.setProperty("--transform-origin",J&&"y"===f&&_?x:S),{}}},Gv,_),_c(()=>{!v&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,m]);const te=Ct(()=>({elementResize:!h&&"undefined"!=typeof ResizeObserver,layoutShift:!h&&"undefined"!=typeof IntersectionObserver}),[h]),{refs:ne,elements:re,x:oe,y:ie,middlewareData:le,update:se,placement:ae,context:ue,isPositioned:ce,floatingStyles:de}=function(e={}){const{nodeId:t,externalTree:n}=e,r=Xg(e),o=e.rootContext||r,i=o.useState("referenceElement"),l=o.useState("floatingElement"),s=o.useState("domReferenceElement"),a=o.useState("open"),u=o.useState("floatingId"),[c,d]=yt(null),[f,h]=yt(void 0),[p,g]=yt(void 0),m=St(null),v=Vp(n),y=Ct(()=>({reference:i,floating:l,domReference:s}),[i,l,s]),b=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:l}={},transform:s=!0,whileElementsMounted:a,open:u}=e,[c,d]=yt({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=yt(r);Eg(f,r)||h(r);const[p,g]=yt(null),[m,v]=yt(null),y=Et(e=>{e!==S.current&&(S.current=e,g(e))},[]),b=Et(e=>{e!==x.current&&(x.current=e,v(e))},[]),w=i||p,_=l||m,S=St(null),x=St(null),C=St(c),E=null!=a,I=kg(a),R=kg(o),k=kg(u),P=Et(()=>{if(!S.current||!x.current)return;const e={placement:t,strategy:n,middleware:f};R.current&&(e.platform=R.current),xg(S.current,x.current,e).then(e=>{const t={...e,isPositioned:!1!==k.current};O.current&&!Eg(C.current,t)&&(C.current=t,Fn(()=>{d(t)}))})},[f,t,n,R,k]);Cg(()=>{!1===u&&C.current.isPositioned&&(C.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[u]);const O=St(!1);Cg(()=>(O.current=!0,()=>{O.current=!1}),[]),Cg(()=>{if(w&&(S.current=w),_&&(x.current=_),w&&_){if(I.current)return I.current(w,_,P);P()}},[w,_,P,I,E]);const M=Ct(()=>({reference:S,floating:x,setReference:y,setFloating:b}),[y,b]),T=Ct(()=>({reference:w,floating:_}),[w,_]),A=Ct(()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=Rg(T.floating,c.x),r=Rg(T.floating,c.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...Ig(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,s,T.floating,c.x,c.y]);return Ct(()=>({...c,update:P,refs:M,elements:T,floatingStyles:A}),[c,P,M,T,A])}({...e,elements:{...y,...c&&{reference:c}}}),w=vd(f)?f:null,_=void 0===p?o.state.floatingElement:p;o.useSyncedValue("referenceElement",null!=f?f:null),o.useSyncedValue("domReferenceElement",void 0===f?s:w),o.useSyncedValue("floatingElement",_);const S=Et(e=>{const t=vd(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),b.refs.setReference(t)},[b.refs]),x=Et(e=>{(vd(e)||null===e)&&(m.current=e,h(e)),(vd(b.refs.reference.current)||null===b.refs.reference.current||null!==e&&!vd(e))&&b.refs.setReference(e)},[b.refs,h]),C=Et(e=>{g(e),b.refs.setFloating(e)},[b.refs]),E=Ct(()=>({...b.refs,setReference:x,setFloating:C,setPositionReference:S,domReference:m}),[b.refs,x,C,S]),I=Ct(()=>({...b.elements,domReference:s}),[b.elements,s]),R=Ct(()=>({...b,dataRef:o.context.dataRef,open:a,onOpenChange:o.setOpen,events:o.context.events,floatingId:u,refs:E,elements:I,nodeId:t,rootStore:o}),[b,E,I,t,o,a,u]);return _c(()=>{s&&(m.current=s)},[s]),_c(()=>{o.context.dataRef.current.floatingContext=R;const e=null==v?void 0:v.nodesRef.current.find(e=>e.id===t);e&&(e.context=R)}),Ct(()=>({...b,context:R,refs:E,elements:I,rootStore:o}),[b,E,I,R,o])}({rootContext:m,open:g?v:void 0,placement:z,middleware:Z,strategy:o,whileElementsMounted:g?void 0:(...e)=>wg(...e,te),nodeId:w,externalTree:x}),{sideX:fe,sideY:he}=le.adaptiveOrigin||Zv,pe=ce?o:"fixed",ge=Ct(()=>{const e=_?{position:pe,[fe]:oe,[he]:ie}:{position:pe,...de};return ce||(e.opacity=0),e},[_,pe,fe,oe,he,ie,de,ce]),me=St(null);_c(()=>{if(!v)return;const e=T.current,t="function"==typeof e?e():e,n=(Qv(t)?t.current:t)||null;n!==me.current&&(ne.setPositionReference(n),me.current=n)},[v,ne,M,T]),wt(()=>{if(!v)return;const e=T.current;"function"!=typeof e&&Qv(e)&&e.current!==me.current&&(ne.setPositionReference(e.current),me.current=e.current)},[v,ne,M,T]),wt(()=>{if(g&&v&&re.reference&&re.floating)return wg(re.reference,re.floating,se,te)},[g,v,re,se,te]);const ve=ih(ae),ye=Jv(i,ve,F),be=lh(ae)||"center",we=Boolean(null===(t=le.hide)||void 0===t?void 0:t.referenceHidden);_c(()=>{S&&v&&ce&&E(ve)},[S,v,ce,ve]);const _e=Ct(()=>{var e,t;return{position:"absolute",top:null===(e=le.arrow)||void 0===e?void 0:e.y,left:null===(t=le.arrow)||void 0===t?void 0:t.x}},[le.arrow]),Se=0!==(null===(n=le.arrow)||void 0===n?void 0:n.centerOffset);return Ct(()=>({positionerStyles:ge,arrowStyles:_e,arrowRef:H,arrowUncentered:Se,side:ye,align:be,physicalSide:ve,anchorHidden:we,refs:ne,context:ue,isPositioned:ce,update:se}),[ge,_e,H,Se,ye,be,ve,we,ne,ue,ce,se])}function Qv(e){return null!=e&&"current"in e}const ey=Zt(function(e,t){const{cutout:n,...r}=e;let o;if(n){const e=n.getBoundingClientRect();o=`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 Zo.jsx("div",{ref:t,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});function ty(e){return"starting"===e?Ip:cd}function ny(e,t,{styles:n,transitionStatus:r,props:o,refs:i,hidden:l,inert:s=!1}){const a={...n};return s&&(a.pointerEvents="none"),Cp("div",e,{state:t,ref:i,props:[{role:"presentation",hidden:l,style:a},ty(r),o],stateAttributesMapping:_v})}let ry={},oy={},iy="";const ly=new class{constructor(){te(this,"lockCount",0),te(this,"restore",null),te(this,"timeoutLock",Ud.create()),te(this,"timeoutUnlock",Ud.create()),te(this,"release",()=>{this.lockCount-=1,0===this.lockCount&&this.restore&&this.timeoutUnlock.start(0,this.unlock)}),te(this,"unlock",()=>{var e;0===this.lockCount&&this.restore&&(null===(e=this.restore)||void 0===e||e.call(this),this.restore=null)})}acquire(e){return this.lockCount+=1,1===this.lockCount&&null===this.restore&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}lock(e){if(0===this.lockCount||null!==this.restore)return;const t=Dd(e).documentElement,n=pd(t).getComputedStyle(t).overflowY;if("hidden"===n||"clip"===n)return void(this.restore=ad);const r=ef||!function(e){if("undefined"==typeof document)return!1;const t=Dd(e);return pd(t).innerWidth-t.documentElement.clientWidth>0}(e);this.restore=r?function(e){const t=Dd(e),n=t.documentElement,r=t.body,o=wd(n)?n:r,i={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,i)}}(e):function(e){var t,n;const r=Dd(e),o=r.documentElement,i=r.body,l=pd(o);let s=0,a=0,u=!1;const c=Hd.create();if(lf&&1!==(null!==(t=null===(n=l.visualViewport)||void 0===n?void 0:n.scale)&&void 0!==t?t:1))return()=>{};function d(){const t=l.getComputedStyle(o),n=l.getComputedStyle(i),r=(t.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=o.scrollTop,a=o.scrollLeft,ry={scrollbarGutter:o.style.scrollbarGutter,overflowY:o.style.overflowY,overflowX:o.style.overflowX},iy=o.style.scrollBehavior,oy={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const c=o.scrollHeight>o.clientHeight,d=o.scrollWidth>o.clientWidth,f="scroll"===t.overflowY||"scroll"===n.overflowY,h="scroll"===t.overflowX||"scroll"===n.overflowX,p=Math.max(0,l.innerWidth-i.clientWidth),g=Math.max(0,l.innerHeight-i.clientHeight),m=parseFloat(n.marginTop)+parseFloat(n.marginBottom),v=parseFloat(n.marginLeft)+parseFloat(n.marginRight),y=wd(o)?o:i;if(u=function(e){if("undefined"==typeof CSS||!CSS.supports||!CSS.supports("scrollbar-gutter","stable")||"undefined"==typeof document)return!1;const t=Dd(e),n=t.documentElement,r=t.body,o=wd(n)?n:r,i=o.style.overflowY,l=n.style.scrollbarGutter;n.style.scrollbarGutter="stable",o.style.overflowY="scroll";const s=o.offsetWidth;o.style.overflowY="hidden";const a=o.offsetWidth;return o.style.overflowY=i,n.style.scrollbarGutter=l,s===a}(e),u)return o.style.scrollbarGutter=r,y.style.overflowY="hidden",void(y.style.overflowX="hidden");Object.assign(o.style,{scrollbarGutter:r,overflowY:"hidden",overflowX:"hidden"}),(c||f)&&(o.style.overflowY="scroll"),(d||h)&&(o.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:m||g?`calc(100dvh - ${m+g}px)`:"100dvh",width:v||p?`calc(100vw - ${v+p}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),i.scrollTop=s,i.scrollLeft=a,o.setAttribute("data-base-ui-scroll-locked",""),o.style.scrollBehavior="unset"}function f(){Object.assign(o.style,ry),Object.assign(i.style,oy),u||(o.scrollTop=s,o.scrollLeft=a,o.removeAttribute("data-base-ui-scroll-locked"),o.style.scrollBehavior=iy)}d();const h=Ld(l,"resize",function(){f(),c.request(d)});return()=>{c.cancel(),f(),"function"==typeof l.removeEventListener&&h()}}(e)}};function sy(e=!0,t=null){_c(()=>{if(e)return ly.acquire(t)},[e,t])}function ay(e,t,n,r){const[o,i]=yt(!1);_c(()=>{if(!e||!t||null==n)return void i(!1);const r=Dd(n).documentElement.clientWidth,o=n.offsetWidth;i(r>0&&o>0&&o>=r-20)},[e,t,n]),sy(e&&(!t||o),r)}const uy=Zt(function(e,t){var n;const{render:r,className:o,anchor:i,positionMethod:l="absolute",side:s="bottom",align:a="center",sideOffset:u=0,alignOffset:c=0,collisionBoundary:d="clipping-ancestors",collisionPadding:f=5,arrowPadding:h=5,sticky:p=!1,disableAnchorTracking:g=!1,collisionAvoidance:m=Rp,style:v,...y}=e,b=Sm(),{filteredItems:w}=Cm(),_=xm(),S=function(){const e=It(Wv);if(void 0===e)throw new Error(Vc(20));return e}(),x=id(b,Dm.modal),C=id(b,Dm.open),E=id(b,Dm.mounted),I=id(b,Dm.openMethod),R=id(b,Dm.positionerElement),k=id(b,Dm.triggerElement),P=id(b,Dm.inputElement),O=id(b,Dm.inputGroupElement),M=id(b,Dm.inputInsidePopup),T=id(b,Dm.transitionStatus),A=0===w.length,F=Yv({anchor:null!=i?i:M?k:null!=O?O:P,floatingRootContext:_,positionMethod:l,mounted:E,side:s,sideOffset:u,align:a,alignOffset:c,arrowPadding:h,collisionBoundary:d,collisionPadding:f,sticky:p,disableAnchorTracking:g,keepMounted:S,collisionAvoidance:m,lazyFlip:!0});ay(C&&x,"touch"===I,R,k);const N={open:C,side:F.side,align:F.align,anchorHidden:F.anchorHidden,empty:A};_c(()=>{b.set("popupSide",F.side)},[b,F.side]);const z=kc(e=>{b.set("positionerElement",e)}),D=ny(e,N,{styles:F.positionerStyles,transitionStatus:T,props:y,refs:[t,z],hidden:!E,inert:!C});return Zo.jsxs(Cv.Provider,{value:F,children:[E&&x&&Zo.jsx(ey,{inert:Bv(!C),cutout:null!==(n=null!=O?O:P)&&void 0!==n?n:k}),D]})}),cy={..._v,...zg},dy=Zt(function(e,t){var n;const{render:r,className:o,style:i,initialFocus:l,finalFocus:s,...a}=e,u=Sm(),c=Ev(),d=xm(),{filteredItems:f}=Cm(),h=id(u,Dm.mounted),p=id(u,Dm.open),g=id(u,Dm.openMethod),m=id(u,Dm.transitionStatus),v=id(u,Dm.inputInsidePopup),y=id(u,Dm.inputElement),b=id(u,Dm.modal),w=id(u,Dm.id),_=0===f.length,S=null!==(n=a.id)&&void 0!==n?n:v?Ym(w):void 0;_c(()=>{var e;return u.set("popupId",(null===(e=u.state.popupRef.current)||void 0===e?void 0:e.id)||S),()=>{u.set("popupId",void 0)}},[u,S]),Lg({open:p,ref:u.state.popupRef,onComplete(){p&&u.state.onOpenChangeComplete(!0)}});const x=Cp("div",e,{state:{open:p,side:c.side,align:c.align,anchorHidden:c.anchorHidden,transitionStatus:m,empty:_},ref:[t,u.state.popupRef],props:[{id:S,role:v?"dialog":"presentation",tabIndex:-1,onFocus(e){const t=Sf(e.nativeEvent);var n;"touch"===g||!_f(u.state.listElement,t)&&t!==e.currentTarget||null===(n=u.state.inputRef.current)||void 0===n||n.focus()}},ty(m),a],stateAttributesMapping:cy}),C=void 0===l?!!v&&(e=>"touch"===e?u.state.popupRef.current:y):l;let E;E=null!=s?s:!!v&&void 0;const I=!v||b;return Zo.jsx(Kp,{context:d,disabled:!h,modal:I,openInteractionType:g,initialFocus:C,returnFocus:E,getInsideElements:()=>[u.state.startDismissRef.current,u.state.endDismissRef.current],children:Zo.jsxs(Ae,{children:[x,I&&Zo.jsx(Ov,{ref:u.state.endDismissRef})]})})});let fy=function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e}({});function hy(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:o,index:i}=e,{register:l,unregister:s,subscribeMapChange:a,elementsRef:u,labelsRef:c,nextIndexRef:d}=It(zv),f=St(-1),[h,p]=yt(null!=i?i:o===fy.GuessFromOrder?()=>{if(-1===f.current){const e=d.current;d.current+=1,f.current=e}return f.current}:-1),g=St(null),m=Et(e=>{if(g.current=e,-1!==h&&null!==e&&(u.current[h]=e,c)){var n,o;const i=void 0!==t;c.current[h]=i?t:null!==(n=null==r||null===(o=r.current)||void 0===o?void 0:o.textContent)&&void 0!==n?n:e.textContent}},[h,u,c,t,r]);return _c(()=>{if(null!=i)return;const e=g.current;return e?(l(e,n),()=>{s(e)}):void 0},[i,l,s,n]),_c(()=>{if(null==i)return a(e=>{var t;const n=g.current?null===(t=e.get(g.current))||void 0===t?void 0:t.index:null;null!=n&&p(n)})},[i,a,p]),{ref:m,index:h}}const py=rt(void 0);function gy(){const e=It(py);if(!e)throw new Error(Vc(19));return e}const my=rt(!1);function vy(e){const{componentProps:t,forwardedRef:n,virtualized:r,indexFromFilter:o}=e,{render:i,className:l,style:s,value:a=null,index:u,disabled:c=!1,nativeButton:d=!1,...f}=t,h=St(!1),p=St(null),g=hy({index:u,textRef:p,indexGuessBehavior:fy.GuessFromOrder}),m=Sm(),v=It(my),y=It(wm),b=id(m,Dm.open),w=id(m,Dm.selectionMode),_=id(m,Dm.readOnly),S=id(m,Dm.isItemEqualToValue),x="none"!==w,C=null!=u?u:r?null!=o?o:-1:g.index,E=-1!==g.index,I=id(m,Dm.id),R=id(m,Dm.isActive,C),k=id(m,Dm.isSelected,a),P=id(m,Dm.itemProps),O=St(null),M=null!=I&&E?`${I}-${C}`:void 0,T=k&&x;_c(()=>{if(!E||!r&&null==u)return;const e=m.state.listRef.current;return e[C]=O.current,()=>{delete e[C]}},[E,r,C,u,m]),_c(()=>{if(!E||y)return;const e=m.state.valuesRef.current;return e[C]=a,"none"!==w&&m.state.allValuesRef.current.push(a),()=>{delete e[C]}},[E,y,C,a,m,w]),_c(()=>{if(!b)return void(h.current=!1);if(!E||y)return;const e=m.state.selectedValue,t=Array.isArray(e)?e[e.length-1]:e;Rm(a,t,S)&&m.set("selectedIndex",C)},[E,y,b,m,C,a,S]);const{getButtonProps:A,buttonRef:F}=kv({disabled:c,focusableWhenDisabled:!0,native:d,composite:!0}),N={disabled:c,selected:T,highlighted:R};function z(e){function t(){m.state.handleSelection(e,a)}m.state.submitOnItemClick?(Fn(t),m.state.requestSubmit()):t()}const D={id:M,role:v?"gridcell":"option","aria-selected":x?T:void 0,tabIndex:void 0,onPointerDownCapture(e){h.current=!0,e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){c||_||z(e.nativeEvent)},onMouseUp(e){const t=h.current;h.current=!1,c||_||0!==e.button||t||!R||z(e.nativeEvent)}},L=Cp("div",t,{ref:[F,n,g.ref,O],state:N,props:[P,D,f,A]}),V=Ct(()=>({selected:T,textRef:p}),[T,p]);return Zo.jsx(py.Provider,{value:V,children:L})}function yy(e){var t;const{componentProps:n,forwardedRef:r}=e,o=id(Sm(),Dm.isItemEqualToValue),{flatFilteredItems:i}=Cm(),l=Pm(i,null!==(t=n.value)&&void 0!==t?t:null,o);return Zo.jsx(vy,{componentProps:n,forwardedRef:r,virtualized:!0,indexFromFilter:l})}const by=Ut(Zt(function(e,t){const n=id(Sm(),Dm.virtualized);return n&&null==e.index?Zo.jsx(yy,{componentProps:e,forwardedRef:t}):Zo.jsx(vy,{componentProps:e,forwardedRef:t,virtualized:n,indexFromFilter:void 0})})),wy=Zt(function(e,t){var n;const r=null!==(n=e.keepMounted)&&void 0!==n&&n,{selected:o}=gy();return r||o?Zo.jsx(_y,{...e,ref:t}):null}),_y=Ut(Zt((e,t)=>{const{render:n,className:r,style:o,keepMounted:i,...l}=e,{selected:s}=gy(),a=St(null),{transitionStatus:u,setMounted:c}=Tg(s),d=Cp("span",e,{ref:[t,a],state:{selected:s,transitionStatus:u},props:[{"aria-hidden":!0,children:"✔️"},l],stateAttributesMapping:zg});return Lg({open:s,ref:a,onComplete(){s||c(!1)}}),d})),Sy=Zt(function(e,t){const{render:n,className:r,style:o,children:i,...l}=e,{filteredItems:s}=Cm(),a=Sm(),u=function(){const e=qd(),t=St(null);return wt(()=>{var n;if(ef)return;const r=t.current;if(null==r)return;const o=function(e){const t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);let n=null;for(;t.nextNode();){const e=t.currentNode;""!==e.nodeValue&&(n=e)}return n}(r);if(null==o)return;const i=null!==(n=o.nodeValue)&&void 0!==n?n:"",l=`${i}⁠`;return o.nodeValue=l,e.start(200,()=>{o.nodeValue===l&&(o.nodeValue=i)}),()=>{e.clear(),o.nodeValue===l&&(o.nodeValue=i)}},[t,e]),t}(),c=0===s.length?i:null;return Cp("div",e,{ref:[t,a.state.emptyRef,u],props:[{children:c,role:"status","aria-live":"polite","aria-atomic":!0},l]})}),xy={...zg,...bv},Cy=Zt(function(e,t){const{render:n,className:r,disabled:o=!1,nativeButton:i=!0,keepMounted:l=!1,style:s,...a}=e,{disabled:u}=Bm(),c=Sm(),d=id(c,Dm.selectionMode),f=id(c,Dm.disabled),h=id(c,Dm.readOnly),p=id(c,Dm.open),g=id(c,Dm.selectedValue),m=id(c,Dm.hasSelectionChips),v=Em();let y=!1;y="none"===d?""!==v:"single"===d?null!=g:m;const b=u||f||o,{buttonRef:w,getButtonProps:_}=kv({native:i,disabled:b}),{mounted:S,transitionStatus:x,setMounted:C}=Tg(y),E={disabled:b,visible:y,open:p,transitionStatus:x};Lg({open:y,ref:c.state.clearRef,onComplete(){y||C(!1)}});const I=Cp("button",e,{state:E,ref:[t,w,c.state.clearRef],props:[{tabIndex:-1,children:"x",onMouseDown(e){e.preventDefault()},onClick(e){var t;if(b||h)return;const n=c.state.keyboardActiveRef;c.state.setInputValue("",Gf(Lf,e.nativeEvent)),"none"!==d?(c.state.setSelectedValue(Array.isArray(g)?[]:null,Gf(Lf,e.nativeEvent)),c.state.setIndices({activeIndex:null,selectedIndex:null,type:n.current?"keyboard":"pointer"})):c.state.setIndices({activeIndex:null,type:n.current?"keyboard":"pointer"}),null===(t=c.state.inputRef.current)||void 0===t||t.focus()}},a,_],stateAttributesMapping:xy});return l||S?I:null}),Ey=Zt(function(e,t){const{className:n,render:r,orientation:o="horizontal",style:i,...l}=e;return Cp("div",e,{state:{orientation:o},ref:t,props:[{role:"separator","aria-orientation":o},l]})});function Iy(e){return Wo("svg",{fill:"currentcolor",width:"10",height:"10",viewBox:"0 0 10 10",...e,children:Wo("path",{d:"M9.1603 1.12218C9.50684 1.34873 9.60427 1.81354 9.37792 2.16038L5.13603 8.66012C5.01614 8.8438 4.82192 8.96576 4.60451 8.99384C4.3871 9.02194 4.1683 8.95335 4.00574 8.80615L1.24664 6.30769C0.939709 6.02975 0.916013 5.55541 1.19372 5.24822C1.47142 4.94102 1.94536 4.91731 2.2523 5.19524L4.36085 7.10461L8.12299 1.33999C8.34934 0.993152 8.81376 0.895638 9.1603 1.12218Z"})})}function Ry(e){return Wo("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[Wo("path",{d:"M18 6L6 18"}),Wo("path",{d:"M6 6l12 12"})]})}function ky(e){return Wo("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:Wo("path",{d:"M6 9l6 6 6-6"})})}function Py(e){return Wo("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",...e,children:[Wo("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),Wo("path",{d:"M9.5 9.5L12.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function Oy(e,t=0,n){const r=[];for(const o of e)r.push({...o,level:t,parentValue:n}),o.children&&o.children.length>0&&r.push(...Oy(o.children,t+1,o.value));return r}function My(e,t){var n;return null==e||null===(n=e[t])||void 0===n?void 0:n.items}function Ty({options:e,filterCounts:t,value:n,multiple:r=!1}){const o=Ct(()=>Oy(e),[e]),i=Ct(()=>function(e,t){if(!t||0===t.length)return e;const n=function(e){const t=new Map;for(const n of e)t.set(n.value,n.count);return t}(t);return e.map(e=>{var t;return{...e,count:null!==(t=n.get(e.value))&&void 0!==t?t:0}})}(o.map(e=>({value:e.value,label:e.label,level:e.level})),t),[o,t]),l=Ct(()=>{if(!n)return new Set;const e=Array.isArray(n)?n:[n];return new Set(e)},[n]),s=Ct(()=>r?function(e,t){return e.some(e=>void 0!==e.count)?e.filter(e=>!!t.has(e.value)||void 0===e.count||0!==e.count):e}(i,l):function(e){return e.some(e=>void 0!==e.count)?e.filter(e=>void 0===e.count||e.count>0):e}(i),[i,l,r]),a=Ct(()=>0===l.size?[]:s.filter(e=>l.has(e.value)),[l,s]),u=Ct(()=>r?function(e,t){return[...e.filter(e=>t.has(e.value)),...e.filter(e=>!t.has(e.value))]}(s,l):s,[s,r,l]),c=Ct(()=>r?a.length:-1,[r,a.length]),d=r&&a.length>0&&u.length>a.length;return{items:s,sortedItems:u,selectedValues:l,selectedItems:a,firstUnselectedIndex:c,showSeparator:d}}function Ay({className:e="barn2-multiselect-separator"}){return Wo("div",{className:e,role:"separator","aria-hidden":"true"})}function Fy({item:e,className:t="barn2-select-item-text",prefixClassName:n="barn2-select-hierarchy-prefix",countClassName:r="barn2-select-item-count",showCounts:o=!0}){return Wo("div",{className:t,children:[e.level>0&&Wo("span",{className:n,"aria-hidden":"true",children:[(i=e.level,"—".repeat(i))," "]}),Wo("span",{children:e.label}),o&&void 0!==e.count&&Wo("span",{className:r,children:["(",e.count,")"]})]});var i}const Ny=({filter:e,value:t,onChange:n,disabled:r=!1,filterCounts:o,showCounts:i=!0})=>{const l=kt(),{displayMode:s,i18n:a}=si(),{items:u,selectedItems:c}=Ty({options:e.options,filterCounts:o,value:t,multiple:!1}),d=c.length>0?c[0]:null,f=u.length>9;return Wo("div",{className:"select-filter-wrapper",style:r?{pointerEvents:"none"}:void 0,children:Wo(cv,{items:u,value:d,onValueChange:Et(e=>{n(null==e?null:e.value)},[n]),itemToStringLabel:Et(e=>e?e.label||String(e.value):"",[]),children:[Wo("div",{className:"select-label",children:Wo("div",{className:"select-display-wrapper",children:[Wo(Av,{className:"select-display-trigger","aria-label":a.selectFilter({filterName:e.name}),children:Wo("span",{className:"select-display-text",children:d?d.label:e.name})}),Wo("div",{className:"select-action-buttons",children:[d&&Wo(Cy,{className:"select-clear","aria-label":a.clearSelection,children:Wo(Ry,{className:"select-clear-icon"})}),Wo(ky,{className:"select-trigger-icon"})]})]})}),Wo(Hv,{children:Wo(uy,{className:"barn2-select-positioner",positionMethod:"fixed",sideOffset:4,children:Wo(dy,{className:"barn2-select-popup","data-display-mode":s,children:[f&&Wo("div",{className:"barn2-select-popup-input-wrapper",children:[Wo(Py,{className:"barn2-select-search-icon"}),Wo(Mv,{id:l,className:"barn2-select-popup-input",placeholder:a.searchFilterPlaceholder({filterName:e.name}),"aria-label":a.searchFilter({filterName:e.name})})]}),Wo(Sy,{className:"barn2-select-empty",children:a.noResultsFound}),Wo(jv,{className:"barn2-select-list",children:e=>Wo(by,{value:e,className:"barn2-select-item",children:[Wo(wy,{className:"barn2-select-item-indicator",children:Wo(Iy,{"aria-hidden":"true",className:"barn2-select-item-indicator-icon"})}),Wo(Fy,{item:e,showCounts:i})]},String(e.value))})]})})})]},d?String(d.value):"empty")})},zy=({filter:e,value:t,onChange:n,disabled:r=!1,filterCounts:o,showCounts:i=!0})=>{const{displayMode:l,i18n:s}=si(),{sortedItems:a,selectedItems:u,firstUnselectedIndex:c,showSeparator:d}=Ty({options:e.options,filterCounts:o,value:t,multiple:!0}),f=a.length>9;return Wo("div",{className:"select-filter-wrapper multiselect",style:r?{pointerEvents:"none"}:void 0,children:Wo(cv,{multiple:!0,items:a,value:u,onValueChange:Et(e=>{e&&0!==e.length?n(e.map(e=>e.value)):n(null)},[n]),itemToStringLabel:Et(e=>e?e.label||String(e.value):"",[]),children:[Wo("div",{className:"multiselect-display-wrapper",children:[Wo(Av,{className:"multiselect-trigger","aria-label":`${e.name} filter`,children:Wo("span",{className:"multiselect-display-text",children:[e.name,u.length>0&&Wo("span",{className:"multiselect-count-badge",children:["(",u.length,")"]})]})}),Wo("div",{className:"multiselect-actions",children:[u.length>0&&Wo(Cy,{className:"select-clear","aria-label":s.clearAllSelections,children:Wo(Ry,{className:"select-clear-icon"})}),Wo(ky,{className:"select-trigger-icon"})]})]}),Wo(Hv,{children:Wo(uy,{className:"barn2-select-positioner",positionMethod:"fixed",sideOffset:4,children:Wo(dy,{className:"barn2-select-popup barn2-multiselect-popup","data-display-mode":l,children:[f&&Wo("div",{className:"barn2-select-popup-input-wrapper",children:[Wo(Py,{className:"barn2-select-search-icon"}),Wo(Mv,{className:"barn2-select-popup-input",placeholder:s.searchFilterPlaceholder({filterName:e.name}),"aria-label":s.searchFilter({filterName:e.name})})]}),Wo(Sy,{className:"barn2-select-empty",children:s.noResultsFound}),Wo(jv,{className:"barn2-select-list barn2-multiselect-list",children:(e,t)=>Wo(Ae,{children:[t.index===c&&d&&Wo(Ay,{}),Wo(by,{value:e,className:"barn2-select-item barn2-multiselect-item",children:[Wo("div",{className:"barn2-filter-checkbox",children:Wo(wy,{children:Wo(Iy,{})})}),Wo(Fy,{item:e,showCounts:i})]},String(e.value))]})})]})})})]})})},Dy=({onReset:e,hasActiveFilters:t,label:n,className:r})=>{const{i18n:o}=si(),i=null!=n?n:o.resetFilters;return t?Wo("button",{type:"button",onClick:e,className:ri("filter-reset-btn",r),"aria-label":i,title:i,children:[Wo("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"filter-reset-icon","aria-hidden":"true",children:[Wo("circle",{cx:"6",cy:"19",r:"3"}),Wo("path",{d:"M9 19h8.5c.4 0 .9-.1 1.3-.2"}),Wo("path",{d:"M5.2 5.2A3.5 3.53 0 0 0 6.5 12H12"}),Wo("path",{d:"m2 2 20 20"}),Wo("path",{d:"M21 15.3a3.5 3.5 0 0 0-3.3-3.3"}),Wo("path",{d:"M15 5h-4.3"}),Wo("circle",{cx:"18",cy:"5",r:"3"})]}),Wo("span",{children:o.reset})]}):null},Ly=()=>Wo("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[Wo("path",{d:"M18 6 6 18"}),Wo("path",{d:"m6 6 12 12"})]}),Vy=({filters:e,search:t,filterConfigs:n,onRemoveFilter:r,onClearSearch:o,className:i})=>{const{i18n:l}=si(),s=function(e){const t=new Map;for(const n of e){const e=Oy(n.options);for(const n of e)t.set(n.value,n.label)}return t}(n),a=function(e,t,n,r){const o=[];t.query&&t.query.trim().length>0&&o.push({id:"search",label:r.activeSearch({query:t.query}),type:"search"});for(const t of e){const e=Array.isArray(t.value)?t.value:[t.value];for(const r of e){const e=n.get(r)||String(r);o.push({id:`${t.id}-${r}`,label:e,type:"filter",filterId:t.id,value:r})}}return o}(e,t,s,l);return 0===a.length?null:Wo("div",{className:ri("active-filters",i),children:a.map(e=>Wo("span",{className:ri("active-filter-badge","search"===e.type&&"active-filter-badge--search"),children:[Wo("span",{className:"active-filter-badge-label",children:e.label}),Wo("button",{type:"button",onClick:()=>(e=>{"search"===e.type?o():e.filterId&&void 0!==e.value&&r(e.filterId,e.value)})(e),className:"active-filter-badge-remove","aria-label":l.removeActiveItem({label:e.label}),children:Wo(Ly,{})})]},e.id))})},$y=rt(null),jy=rt(null);function Wy(){const e=It($y);if(null===e)throw new Error(Vc(60));return e}function Hy(){const e=It(jy);if(null===e)throw new Error(Vc(61));return e}const By={id:$c(e=>e.id),labelId:$c(e=>e.labelId),modal:$c(e=>e.modal),multiple:$c(e=>e.multiple),items:$c(e=>e.items),itemToStringLabel:$c(e=>e.itemToStringLabel),itemToStringValue:$c(e=>e.itemToStringValue),isItemEqualToValue:$c(e=>e.isItemEqualToValue),value:$c(e=>e.value),hasSelectedValue:$c(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return null!=t&&(n&&Array.isArray(t)?t.length>0:""!==Nm(t,r))}),hasNullItemLabel:$c((e,t)=>!!t&&Am(e.items)),open:$c(e=>e.open),mounted:$c(e=>e.mounted),forceMount:$c(e=>e.forceMount),transitionStatus:$c(e=>e.transitionStatus),openMethod:$c(e=>e.openMethod),activeIndex:$c(e=>e.activeIndex),selectedIndex:$c(e=>e.selectedIndex),isActive:$c((e,t)=>e.activeIndex===t),isSelected:$c((e,t)=>{const n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>Rm(t,e,n)):Rm(t,r,n)}),isSelectedByFocus:$c((e,t)=>e.selectedIndex===t),popupProps:$c(e=>e.popupProps),triggerProps:$c(e=>e.triggerProps),triggerElement:$c(e=>e.triggerElement),positionerElement:$c(e=>e.positionerElement),listElement:$c(e=>e.listElement),popupSide:$c(e=>e.popupSide),scrollUpArrowVisible:$c(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:$c(e=>e.scrollDownArrowVisible),hasScrollArrows:$c(e=>e.hasScrollArrows)};function Uy(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function qy(e,t){return Math.max(0,e-t)}function Gy(e){var t,n;const{id:r,value:o,defaultValue:i=null,onValueChange:l,open:s,defaultOpen:a=!1,onOpenChange:u,name:c,form:d,autoComplete:f,disabled:h=!1,readOnly:p=!1,required:g=!1,modal:m=!0,actionsRef:v,inputRef:y,onOpenChangeComplete:b,items:w,multiple:_=!1,itemToStringLabel:S,itemToStringValue:x,isItemEqualToValue:C=Im,highlightItemOnHover:E=!0,children:I}=e,{clearErrors:R}=Gm(),{setDirty:k,setTouched:P,setFocused:O,validityData:M,setFilled:T,name:A,disabled:F,validation:N,validationMode:z}=Bm(),D=Xm({id:r}),L=F||h,V=null!=A?A:c,[$,j]=wc({controlled:o,default:_?null!=i?i:ud:i,name:"Select",state:"value"}),[W,H]=wc({controlled:s,default:a,name:"Select",state:"open"}),B=St([]),U=St([]),q=St(null),G=St(null),Z=St(0),K=St(null),J=St([]),X=St(!1),Y=St(null),Q=St(null),ee=St({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),te=St(!1),{mounted:ne,setMounted:re,transitionStatus:oe}=Tg(W),{openMethod:ie,triggerProps:le}=rv(W),se=Ec(()=>new sd({id:D,labelId:void 0,modal:m,multiple:_,itemToStringLabel:S,itemToStringValue:x,isItemEqualToValue:C,value:$,open:W,mounted:ne,transitionStatus:oe,items:w,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ae=id(se,By.activeIndex),ue=id(se,By.selectedIndex),ce=id(se,By.triggerElement),de=id(se,By.positionerElement),fe=function(e){const[t,n]=yt({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}(ie),he=null!==(t=null!=ie?ie:fe)&&void 0!==t?t:null,pe=Ct(()=>_?"":Nm($,x),[_,$,x]),ge=Ct(()=>_&&Array.isArray($)?$.map(e=>Nm(e,x)):Nm($,x),[_,$,x]),me=Fc(se.state.triggerElement),ve=kc(()=>ge);Um(me,D,$,ve,!L,c);const ye=St($),be=_?Array.isArray($)&&$.length>0:null!=$&&""!==Nm($,x);_c(()=>{$!==ye.current&&se.set("forceMount",!0)},[se,$]),_c(()=>{T(be)},[be,T]),_c(function(){const e=J.current;let t;if(_){const n=Array.isArray($)?$:[];if(0===n.length)t=null;else{const r=Pm(e,n[n.length-1],C);t=-1===r?null:r}}else{const n=Pm(e,$,C);t=-1===n?null:n}null===t&&(Q.current=null),W||se.set("selectedIndex",t)},[be,_,W,$,J,C,se,Q]),nv($,()=>{R(V),k(function(e){const t=M.initialValue;return Array.isArray(e)&&Array.isArray(t)?!ov(e,t,(e,t)=>Rm(e,t,C)):e!==t}($)),N.change($)});const we=kc((e,t)=>{null==u||u(e,t),t.isCanceled||(H(e),e||t.reason!==jf&&t.reason!==Nf||(P(!0),O(!1),"onBlur"===z&&N.commit($)))}),_e=kc(()=>{re(!1),se.update({activeIndex:null,openMethod:null}),null==b||b(!1)});Lg({enabled:!v,open:W,ref:q,onComplete(){W||_e()}}),xt(v,()=>({unmount:_e}),[_e]);const Se=kc((e,t)=>{null==l||l(e,t),t.isCanceled||j(e)}),xe=kc(()=>{const e=se.state.listElement||q.current;if(!e)return;const t=qy(e.scrollHeight,e.clientHeight),n=function(e,t){if(t<=0)return 0;const n=Uy(e,0,t),r=t-n,o=n<=1,i=r<=1;return o&&i?n<=r?0:t:o?0:i?t:n}(e.scrollTop,t),r=n>0,o=n<t;se.state.scrollUpArrowVisible!==r&&se.set("scrollUpArrowVisible",r),se.state.scrollDownArrowVisible!==o&&se.set("scrollDownArrowVisible",o)}),Ce=Xg({open:W,onOpenChange:we,elements:{reference:ce,floating:de}}),Ee=Jp(Ce,{enabled:!p&&!L,event:"mousedown"}),Ie=Yp(Ce),Re=am(Ce,{enabled:!p&&!L,listRef:B,activeIndex:ae,selectedIndex:ue,disabledIndices:ud,onNavigate(e){(null!==e||W)&&se.set("activeIndex",e)},focusItemOnHover:E}),ke=um(Ce,{enabled:!p&&!L&&(W||!_),listRef:U,activeIndex:ae,selectedIndex:ue,disabledIndices:e=>{return null==(t=B.current[e])||t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled");var t},onMatch(e){W?se.set("activeIndex",e):Se(J.current[e],Gf("none"))},onTyping(e){X.current=e}}),Pe=Ct(()=>{const e=hp(ke.reference,Re.reference,Ie.reference,Ee.reference,le);return D&&(e.id=D),e},[Ee.reference,ke.reference,Re.reference,Ie.reference,le,D]),Oe=Ct(()=>hp(Vg,ke.floating,Re.floating,Ie.floating),[ke.floating,Re.floating,Ie.floating]),Me=null!==(n=Re.item)&&void 0!==n?n:cd;Sc(()=>{se.update({popupProps:Oe,triggerProps:Pe})}),_c(()=>{se.update({id:D,modal:m,multiple:_,value:$,open:W,mounted:ne,transitionStatus:oe,popupProps:Oe,triggerProps:Pe,items:w,itemToStringLabel:S,itemToStringValue:x,isItemEqualToValue:C,openMethod:he})},[se,D,m,_,$,W,ne,oe,Oe,Pe,w,S,x,C,he]);const Te=Ct(()=>({store:se,name:V,required:g,disabled:L,readOnly:p,multiple:_,highlightItemOnHover:E,setValue:Se,setOpen:we,listRef:B,popupRef:q,scrollHandlerRef:G,handleScrollArrowVisibility:xe,scrollArrowsMountedCountRef:Z,itemProps:Me,valueRef:K,valuesRef:J,labelsRef:U,typingRef:X,selectionRef:ee,firstItemTextRef:Y,selectedItemTextRef:Q,validation:N,onOpenChangeComplete:b,alignItemWithTriggerActiveRef:te,initialValueRef:ye}),[se,V,g,L,p,_,E,Se,we,Me,N,b,xe]),Ae=Mc(y,N.inputRef),Fe=_&&Array.isArray($)&&$.length>0,Ne=_?void 0:V,ze=Ct(()=>_&&Array.isArray($)&&V?$.map(e=>{const t=Nm(e,x);return Zo.jsx("input",{type:"hidden",form:d,name:V,value:t,disabled:L},t)}):null,[_,$,d,V,x,L]);return Zo.jsx($y.Provider,{value:Te,children:Zo.jsxs(jy.Provider,{value:Ce,children:[I,Zo.jsx("input",{...N.getValidationProps(L,{onFocus(){var e;null===(e=se.state.triggerElement)||void 0===e||e.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||L||p)return;const t=e.currentTarget.value,n=Gf(Mf,e.nativeEvent);se.set("forceMount",!0),queueMicrotask(function(){if(_)return;const e=t.toLowerCase();let r=J.current.findIndex(t=>Nm(t,x).toLowerCase()===e||Fm(t,S).toLowerCase()===e);-1===r&&(r=J.current.findIndex((t,n)=>{const r=U.current[n];return null!=r&&r.toLowerCase()===e}));const o=-1===r?void 0:J.current[r];null!=o&&Se(o,n)})}}),id:D&&null==Ne?`${D}-hidden-input`:void 0,form:d,name:Ne,autoComplete:f,value:pe,disabled:L,required:g&&!Fe,readOnly:p,ref:Ae,style:V?Lc:Dc,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),ze]})})}const Zy={...wv,...jm,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},Ky=Zt(function(e,t){var n,r;const{render:o,className:i,id:l,disabled:s=!1,nativeButton:a=!0,style:u,...c}=e,{setTouched:d,setFocused:f,validationMode:h,state:p,disabled:g}=Bm(),{labelId:m}=Jm(),{store:v,setOpen:y,selectionRef:b,validation:w,readOnly:_,required:S,alignItemWithTriggerActiveRef:x,disabled:C}=Wy(),E=g||C||s,I=id(v,By.open),R=id(v,By.mounted),k=id(v,By.value),P=id(v,By.triggerProps),O=id(v,By.positionerElement),M=id(v,By.listElement),T=id(v,By.popupSide),A=id(v,By.id),F=id(v,By.labelId),N=id(v,By.hasSelectedValue),z=R&&O?T:null,D=null!=l?l:A,L=dv(m,F);Xm({id:D});const V=Fc(O),$=St(null),{getButtonProps:j,buttonRef:W}=kv({disabled:E,native:a}),H=kc(e=>{v.set("triggerElement",e)}),B=qd(),U=qd(),q=qd();wt(()=>{if(I)return q.start(400,()=>{b.current.allowUnselectedMouseUp=!0,b.current.allowSelectedMouseUp=!0}),()=>{q.clear()};b.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},U.clear()},[I,b,U,q]);const G=hp(P,{id:D,role:"combobox","aria-expanded":I?"true":"false","aria-haspopup":"listbox","aria-controls":I?null!==(n=null==M?void 0:M.id)&&void 0!==n?n:null===(r=Rf(O))||void 0===r?void 0:r.id:void 0,"aria-labelledby":L,"aria-readonly":_||void 0,"aria-required":S||void 0,tabIndex:E?-1:0,onFocus(e){f(!0),I&&x.current&&y(!1,Gf(Mf,e.nativeEvent)),B.start(0,()=>{v.set("forceMount",!0)})},onBlur(e){_f(O,e.relatedTarget)||(d(!0),f(!1),"onBlur"===h&&w.commit(k))},onMouseDown(e){if(I)return;const t=Dd(e.currentTarget);function n(e){if(!$.current)return;const t=e.target;if(_f($.current,t)||_f(V.current,t))return;const n=Tv($.current);e.clientX>=n.left-2&&e.clientX<=n.right+2&&e.clientY>=n.top-2&&e.clientY<=n.bottom+2||y(!1,Gf(Bf,e))}U.start(0,()=>{t.addEventListener("mouseup",n,{once:!0})})}},c,j),Z=w.getValidationProps(E,G);Z.role="combobox";const K={...p,open:I,disabled:E,value:k,readOnly:_,popupSide:z,placeholder:!N};return Cp("button",e,{ref:[t,$,W,H],state:K,stateAttributesMapping:Zy,props:Z})}),Jy={value:()=>null},Xy=Zt(function(e,t){const{className:n,render:r,children:o,placeholder:i,style:l,...s}=e,{store:a,valueRef:u}=Wy(),c=id(a,By.value),d=id(a,By.items),f=id(a,By.itemToStringLabel),h=id(a,By.hasSelectedValue),p=!h&&null!=i&&null==o,g=id(a,By.hasNullItemLabel,p),m={value:c,placeholder:!h};let v=null;return v="function"==typeof o?o(c):null!=o?o:h||null==i||g?Array.isArray(c)?function(e,t,n){return e.reduce((e,r,o)=>(o>0&&e.push(", "),e.push(Zo.jsx(Ae,{children:zm(r,t,n)},o)),e),[])}(c,d,f):zm(c,d,f):i,Cp("span",e,{state:m,ref:[t,u],props:[{children:v},s],stateAttributesMapping:Jy})}),Yy=Zt(function(e,t){const{render:n,className:r,style:o,...i}=e,{store:l}=Wy();return Cp("span",e,{state:{open:id(l,By.open)},ref:t,props:[{"aria-hidden":!0,children:"▼"},i],stateAttributesMapping:bv})}),Qy=rt(void 0),eb=Zt(function(e,t){const{store:n}=Wy(),r=id(n,By.mounted),o=id(n,By.forceMount);return r||o?Zo.jsx(Qy.Provider,{value:!0,children:Zo.jsx(Ap,{ref:t,...e})}):null}),tb=rt(void 0);function nb(e,t){e&&Object.assign(e.style,t)}const rb={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},ob={position:"fixed"},ib=Zt(function(e,t){const{anchor:n,positionMethod:r="absolute",className:o,render:i,side:l="bottom",align:s="center",sideOffset:a=0,alignOffset:u=0,collisionBoundary:c="clipping-ancestors",collisionPadding:d,arrowPadding:f=5,sticky:h=!1,disableAnchorTracking:p,alignItemWithTrigger:g=!0,collisionAvoidance:m=Rp,style:v,...y}=e,{store:b,listRef:w,labelsRef:_,alignItemWithTriggerActiveRef:S,selectedItemTextRef:x,valuesRef:C,initialValueRef:E,popupRef:I,setValue:R}=Wy(),k=Hy(),P=id(b,By.open),O=id(b,By.mounted),M=id(b,By.modal),T=id(b,By.value),A=id(b,By.openMethod),F=id(b,By.positionerElement),N=id(b,By.triggerElement),z=id(b,By.isItemEqualToValue),D=id(b,By.transitionStatus),L=St(null),V=St(null),[$,j]=yt(g),W=O&&$&&"touch"!==A;O||$===g||j(g),_c(()=>{O||(By.scrollUpArrowVisible(b.state)&&b.set("scrollUpArrowVisible",!1),By.scrollDownArrowVisible(b.state)&&b.set("scrollDownArrowVisible",!1))},[b,O]),xt(S,()=>W),ay((W||M)&&P,"touch"===A,F,N);const H=Yv({anchor:n,floatingRootContext:k,positionMethod:r,mounted:O,side:l,sideOffset:a,align:s,alignOffset:u,arrowPadding:f,collisionBoundary:c,collisionPadding:d,sticky:h,disableAnchorTracking:null!=p?p:W,collisionAvoidance:m,keepMounted:!0}),B=W?"none":H.side,U=W?ob:H.positionerStyles,q={open:P,side:B,align:H.align,anchorHidden:H.anchorHidden};_c(()=>{b.set("popupSide",H.side)},[b,H.side]);const G=kc(e=>{b.set("positionerElement",e)}),Z=ny(e,q,{styles:U,transitionStatus:D,props:y,refs:[t,G],hidden:!O,inert:!P}),K=St(0),J=kc(e=>{if(0===e.size&&0===K.current)return;if(0===C.current.length)return;const t=K.current;if(K.current=e.size,e.size===t)return;const n=Gf(Mf);if(0!==t&&!b.state.multiple&&null!==T&&-1===Pm(C.current,T,z)){const e=E.current,t=null!=e&&-1!==Pm(C.current,e,z)?e:null;R(t,n),null===t&&(b.set("selectedIndex",null),x.current=null)}if(0!==t&&b.state.multiple&&Array.isArray(T)){const e=e=>-1!==Pm(C.current,e,z),t=T.filter(t=>e(t));(t.length!==T.length||t.some(e=>!km(T,e,z)))&&(R(t,n),0===t.length&&(b.set("selectedIndex",null),x.current=null))}if(P&&W){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const e={height:""};nb(F,e),nb(I.current,e)}}),X=Ct(()=>({...H,side:B,alignItemWithTriggerActive:W,setControlledAlignItemWithTrigger:j,scrollUpArrowRef:L,scrollDownArrowRef:V}),[H,B,W,j]);return Zo.jsx(Dv,{elementsRef:w,labelsRef:_,onMapChange:J,children:Zo.jsxs(tb.Provider,{value:X,children:[O&&M&&Zo.jsx(ey,{inert:Bv(!P),cutout:N}),Z]})})}),lb="base-ui-disable-scrollbar",sb=lb,ab=e=>Zo.jsx("style",{nonce:e,href:lb,precedence:"base-ui:low",children:`.${lb}{scrollbar-width:none}.${lb}::-webkit-scrollbar{display:none}`}),ub=rt(void 0);function cb(e){return It(ub)}const db=new Set(["ArrowLeft","ArrowRight"]),fb=new Set(["ArrowUp","ArrowDown"]),hb=new Set([...db,...fb]),pb=new Set([...hb,"Home","End"]),gb=rt(void 0),mb={disableStyleElements:!1},vb={..._v,...zg},yb=Zt(function(e,t){const{render:n,className:r,style:o,finalFocus:i,...l}=e,{store:s,popupRef:a,onOpenChangeComplete:u,setOpen:c,valueRef:d,firstItemTextRef:f,selectedItemTextRef:h,multiple:p,handleScrollArrowVisibility:g,scrollHandlerRef:m,listRef:v,highlightItemOnHover:y}=Wy(),{side:b,align:w,alignItemWithTriggerActive:_,isPositioned:S,setControlledAlignItemWithTrigger:x}=function(){const e=It(tb);if(!e)throw new Error(Vc(59));return e}(),C=null!=cb(),E=Hy(),I=av(),{nonce:R,disableStyleElements:k}=null!==(P=It(gb))&&void 0!==P?P:mb;var P;const O=id(s,By.id),M=id(s,By.open),T=id(s,By.openMethod),A=id(s,By.mounted),F=id(s,By.popupProps),N=id(s,By.transitionStatus),z=id(s,By.triggerElement),D=id(s,By.positionerElement),L=id(s,By.listElement),V=St(!1),$=St(!1),j=St({}),W=Bd(),H=kc(e=>{if(!D||!a.current||!$.current)return;if(V.current||!_)return void g();const t="0px"===D.style.top,n="0px"===D.style.bottom;if(!t&&!n)return void g();const r=_b(D),o=Sb(D.getBoundingClientRect().height,"y",r),i=Dd(D),l=pd(D),s=l.getComputedStyle(D),u=parseFloat(s.marginTop),c=parseFloat(s.marginBottom),d=bb(l.getComputedStyle(a.current)),f=Math.min(i.documentElement.clientHeight-u-c,d),h=e.scrollTop,p=wb(e);let m=0,v=null,y=!1,b=!1;const w=e=>{D.style.height=`${e}px`},S=t?p-h:h,x=Math.min(o+S,f);if(m=x,S<=1)((t,n)=>{const r=Uy(t,0,f-o);r>0&&w(o+r),e.scrollTop=n,f-(o+r)<=1&&(V.current=!0),g()})(S,t?p:0);else{if(f-x>1?t?b=!0:v=0:(y=!0,n&&h<p&&(v=h-(S-(o+S-f)))),m=Math.ceil(m),0!==m&&w(m),b||null!=v){const t=wb(e),n=b?t:Uy(v,0,t);Math.abs(e.scrollTop-n)>1&&(e.scrollTop=n)}(y||m>=f-1)&&(V.current=!0),g()}});xt(m,()=>H,[H]),Lg({open:M,ref:a,onComplete(){M&&(null==u||u(!0))}});const B={open:M,transitionStatus:N,side:b,align:w};_c(()=>{D&&a.current&&!Object.keys(j.current).length&&(j.current={top:D.style.top||"0",left:D.style.left||"0",right:D.style.right,height:D.style.height,bottom:D.style.bottom,minHeight:D.style.minHeight,maxHeight:D.style.maxHeight,marginTop:D.style.marginTop,marginBottom:D.style.marginBottom})},[a,D]),_c(()=>{M||_||($.current=!1,V.current=!1,nb(D,j.current))},[M,_,D,a]),_c(()=>{const e=a.current;if(!M||!z||!D||!e||_&&!S||"ending"===s.state.transitionStatus)return;if(!_)return $.current=!0,W.request(g),void e.style.removeProperty("--transform-origin");const t=function(e){const{style:t}=e,n={};for(const[e,r]of Cb)n[e]=t.getPropertyValue(e),t.setProperty(e,r,"important");return()=>{for(const[e]of Cb){const r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}(e);e.style.removeProperty("--transform-origin");try{var n,r,o;let t=h.current;var i;if(null===(n=t)||void 0===n||!n.isConnected)t=!By.hasSelectedValue(s.state)&&null!==(i=f.current)&&void 0!==i&&i.isConnected?f.current:null;const l=d.current,a=pd(D),u=a.getComputedStyle(D),c=a.getComputedStyle(e),p=Dd(z),m=_b(z),b=xb(z.getBoundingClientRect(),m),w=xb(D.getBoundingClientRect(),m),_=b.height,S=L||e,C=S.scrollHeight,E=parseFloat(c.borderBottomWidth),R=parseFloat(u.marginTop)||10,k=parseFloat(u.marginBottom)||10,P=parseFloat(u.minHeight)||100,O=bb(c),M=5,T=5,A=20,F=p.documentElement.clientHeight-R-k,N=p.documentElement.clientWidth,W=F-b.bottom+_;let H,B="rtl"===I?b.right-w.width:b.left,U=0;if(t&&l){const e=xb(l.getBoundingClientRect(),m);H=xb(t.getBoundingClientRect(),m),B=w.left+("rtl"===I?e.right-H.right:e.left-H.left);const n=e.top-b.top+e.height/2;U=H.top-w.top+H.height/2-n}const q=W+U+k+E;let G=Math.min(F,q);const Z=F-R-k,K=q-G,J=N-T;D.style.left=`${Uy(B,M,J-w.width)}px`,D.style.height=`${G}px`,D.style.maxHeight="none",D.style.marginTop=`${R}px`,D.style.marginBottom=`${k}px`,e.style.height="100%";const X=wb(S),Y=K>=X-1;Y&&(G=Math.min(F,w.height)-(K-X));const Q=b.top<A||b.bottom>F-A||Math.ceil(G)+1<Math.min(C,P),ee=1!==(null!==(r=null===(o=a.visualViewport)||void 0===o?void 0:o.scale)&&void 0!==r?r:1)&&lf;if(Q||ee)return $.current=!0,nb(D,j.current),void x(!1);const te=Math.max(P,G);if(Y){const e=Math.max(0,F-q);D.style.top=w.height>=Z?"0":`${e}px`,D.style.height=`${G}px`,S.scrollTop=wb(S)}else D.style.bottom="0",S.scrollTop=K;if(H){const t=w.top,n=w.height,r=H.top+H.height/2,o=Uy(n>0?(r-t)/n*100:50,0,100);e.style.setProperty("--transform-origin",`50% ${o}%`)}(te===F||G>=O)&&(V.current=!0),g(),y&&null===s.state.selectedIndex&&null===s.state.activeIndex&&null!=v.current[0]&&s.set("activeIndex",0),$.current=!0}finally{t()}},[s,M,D,z,d,f,h,a,g,_,x,W,L,v,y,I,S]),wt(()=>{if(_&&D&&M)return Ld(pd(D),"resize",function(e){c(!1,Gf("window-resize",e))})},[c,_,D,M]);const U={...L?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":p||void 0,id:`${O}-list`},onKeyDown(e){C&&pb.has(e.key)&&e.stopPropagation()},onScroll(e){L||H(e.currentTarget)},..._&&{style:L?{height:"100%"}:rb}},q=Cp("div",e,{ref:[t,a],state:B,stateAttributesMapping:vb,props:[F,U,ty(N),{className:!L&&_?sb:void 0},l]});return Zo.jsxs(Ae,{children:[!k&&ab(R),Zo.jsx(Kp,{context:E,modal:!1,disabled:!A,openInteractionType:T,returnFocus:i,restoreFocus:!0,children:q})]})});function bb(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function wb(e){return qy(e.scrollHeight,e.clientHeight)}function _b(e){return yg.getScale(e)}function Sb(e,t,n){return e/n[t]}function xb(e,t){return yh({x:Sb(e.x,"x",t),y:Sb(e.y,"y",t),width:Sb(e.width,"x",t),height:Sb(e.height,"y",t)})}const Cb=[["transform","none"],["scale","1"],["translate","0 0"]],Eb=rt(void 0),Ib=Ut(Zt(function(e,t){const{render:n,className:r,style:o,value:i=null,label:l,disabled:s=!1,nativeButton:a=!1,...u}=e,c=St(null),d=hy({label:l,textRef:c,indexGuessBehavior:fy.GuessFromOrder}),{store:f,itemProps:h,setOpen:p,setValue:g,selectionRef:m,typingRef:v,valuesRef:y,multiple:b,selectedItemTextRef:w,disabled:_,readOnly:S}=Wy(),x=id(f,By.isActive,d.index),C=id(f,By.open),E=id(f,By.isSelected,i),I=id(f,By.isSelectedByFocus,d.index),R=id(f,By.isItemEqualToValue),k=d.index,P=-1!==k,O=St(null);_c(()=>{if(!P)return;const e=y.current;return e[k]=i,()=>{delete e[k]}},[P,k,i,y]),_c(()=>{if(!P)return;const e=f.state.value;let t=e;b&&Array.isArray(e)&&(t=e.length>0?e[e.length-1]:void 0),void 0!==t&&Rm(i,t,R)&&(f.set("selectedIndex",k),c.current&&(w.current=c.current))},[P,k,b,R,f,i,w]);const M=St(null),T=St("mouse"),A=St(!1),{getButtonProps:F,buttonRef:N}=kv({disabled:s,focusableWhenDisabled:!0,native:a,composite:!0}),z={disabled:s,selected:E,highlighted:x};function D(){m.current.dragY=0}const L={role:"option","aria-selected":E,tabIndex:C&&x?0:-1,onKeyDown(e){M.current=e.key,f.set("activeIndex",k)," "===e.key&&v.current&&e.preventDefault()},onClick(e){const t="click"===e.type&&"touch"!==T.current,n=e.nativeEvent.pointerType,r=t&&df(e.nativeEvent)&&(void 0!==n||x),o=t&&!r&&!A.current;A.current=!1,"keydown"===e.type&&null===M.current||s||"keydown"===e.type&&" "===M.current&&v.current||o||(M.current=null,function(e){if(_||S)return;const t=f.state.value;if(b){const n=Array.isArray(t)?t:[],r=E?Om(n,i,R):[...n,i];g(r,Gf(zf,e))}else g(i,Gf(zf,e)),p(!1,Gf(zf,e))}(e.nativeEvent))},onPointerEnter(e){T.current=e.pointerType},onPointerMove(e){if("mouse"===e.pointerType&&1===e.buttons){const t=m.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){T.current=e.pointerType,A.current=!0,D()},onMouseUp(){var e;if(D(),s||"touch"===T.current)return;if(A.current)return;const t=!m.current.allowSelectedMouseUp&&E,n=!m.current.allowUnselectedMouseUp&&!E;t||n||(A.current=!0,null===(e=O.current)||void 0===e||e.click(),A.current=!1)}},V=Cp("div",e,{ref:[N,t,d.ref,O],state:z,props:[h,L,u,F]}),$=Ct(()=>({selected:E,index:k,textRef:c,selectedByFocus:I,hasRegistered:P}),[E,k,c,I,P]);return Zo.jsx(Eb.Provider,{value:$,children:V})})),Rb=Ut(Zt(function(e,t){const{index:n,textRef:r,selectedByFocus:o,hasRegistered:i}=function(){const e=It(Eb);if(!e)throw new Error(Vc(57));return e}(),{firstItemTextRef:l,selectedItemTextRef:s}=Wy(),{render:a,className:u,style:c,...d}=e;return Cp("div",e,{ref:[Et(e=>{e&&(i&&0===n&&(l.current=e),i&&o&&(s.current=e))},[l,s,n,o,i]),t,r],props:d})})),kb=({pageSize:e,rowsPerPageOptions:t=[10,25,50,100],onPageSizeChange:n,className:r,disabled:o=!1})=>{const{displayMode:i,i18n:l}=si(),s=Et(e=>-1===("number"==typeof e?e:parseInt(e,10))?l.all:String(e),[l.all]),a=Et(e=>{if(null===e)return;const t=parseInt(e,10);isNaN(t)||n(t)},[n]);return Wo("div",{className:ri("per-page-selector",r),children:[Wo("span",{className:"per-page-selector-label",children:l.show}),Wo(Gy,{value:String(e),onValueChange:a,disabled:o,children:[Wo(Ky,{className:"per-page-selector-trigger",children:[Wo(Xy,{children:t=>s(null!=t?t:e)}),Wo(Yy,{className:"per-page-selector-icon",children:Wo(ky,{})})]}),Wo(eb,{children:Wo(ib,{className:"barn2-select-positioner",positionMethod:"fixed",sideOffset:4,alignItemWithTrigger:!1,children:Wo(yb,{className:"barn2-select-popup per-page-popup","data-display-mode":i,children:t.map(e=>Wo(Ib,{value:String(e),className:"barn2-select-item per-page-item",children:Wo(Rb,{children:s(e)})},e))})})})]}),Wo("span",{className:"per-page-selector-label",children:l.perPage})]})},Pb=({currentPage:e,pageSize:t,totalRows:n,className:r,infiniteScrollMode:o=!1})=>{const{i18n:i}=si(),{startRow:l,endRow:s}=Ct(()=>o?{startRow:t>0?1:0,endRow:t}:-1===t?{startRow:1,endRow:n}:{startRow:e*t+1,endRow:Math.min((e+1)*t,n)},[e,t,n,o]);return 0===n?null:Wo("div",{className:ri("document-count",r),children:Wo("span",{className:"document-count-text",children:i.showingRangeOfTotal({start:l,end:s,total:n})})})},Ob=({currentPage:e,totalPages:t,paginationType:n="full_numbers",onPageChange:r,className:o,disabled:i=!1})=>{const{i18n:l}=si(),s=Et(()=>["simple","simple_numbers","full","full_numbers"].includes(n),[n]),a=Et(()=>["full","full_numbers"].includes(n),[n]),u=Et(()=>["numbers","simple_numbers","full_numbers"].includes(n),[n]),c=Et(()=>{const n=[];if(t<=7)for(let e=0;e<t;e++)n.push(e);else if(e<=2){for(let e=0;e<5;e++)n.push(e);n.push("..."),n.push(t-1)}else if(e>=t-3){n.push(0),n.push("...");for(let e=t-5;e<t;e++)n.push(e)}else{n.push(0),n.push("...");for(let t=e-1;t<=e+1;t++)n.push(t);n.push("..."),n.push(t-1)}return n},[e,t]);return t<=1?null:Wo("div",{className:ri("page-navigation",o),style:i?{pointerEvents:"none"}:void 0,children:Wo("div",{className:"page-navigation-buttons",children:[a()&&Wo("button",{type:"button",onClick:()=>r(0),disabled:0===e,className:"pagination-btn pagination-btn-first","aria-label":l.firstPage,children:Wo("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Wo("path",{d:"M11 12L7 8L11 4M5 12V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),s()&&Wo("button",{type:"button",onClick:()=>r(Math.max(e-1,0)),disabled:0===e,className:"pagination-btn pagination-btn-prev","aria-label":l.previousPage,children:Wo("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Wo("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),u()&&Wo("div",{className:"pagination-pages",children:c().map((t,n)=>{if("..."===t)return Wo("span",{className:"pagination-ellipsis",children:"…"},`ellipsis-${n}`);const o=t;return Wo("button",{type:"button",onClick:()=>r(o),className:ri("pagination-btn","pagination-btn-page",o===e&&"pagination-btn-active"),"aria-label":l.page({page:o+1}),"aria-current":o===e?"page":void 0,children:o+1},o)})}),s()&&Wo("button",{type:"button",onClick:()=>r(Math.min(e+1,t-1)),disabled:e>=t-1,className:"pagination-btn pagination-btn-next","aria-label":l.nextPage,children:Wo("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Wo("path",{d:"M6 12L10 8L6 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),a()&&Wo("button",{type:"button",onClick:()=>r(t-1),disabled:e>=t-1,className:"pagination-btn pagination-btn-last","aria-label":l.lastPage,children:Wo("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Wo("path",{d:"M5 12L9 8L5 4M11 4V12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})})},Mb=({currentPage:e,pageSize:t,totalRows:n,rowsPerPageOptions:r=[10,25,50,100],onPageSizeChange:o,className:i,disabled:l=!1})=>{const{i18n:s}=si(),a=-1===t?1:e*t+1,u=-1===t?n:Math.min((e+1)*t,n);return Wo("div",{className:ri("pagination-controls-info",i),style:l?{pointerEvents:"none"}:void 0,children:[Wo("span",{className:"pagination-controls-text",children:s.showingRangeToTotal({start:a,end:u,total:n})}),Wo("select",{id:"page-size",value:t,onChange:e=>{const t=parseInt(e.target.value,10);o(t)},className:"pagination-controls-select",children:r.map(e=>Wo("option",{value:e,children:-1===e?s.all:s.itemsPerPageOption({count:e})},e))})]})},Tb=()=>Wo("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Wo("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),Wo("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),Wo("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]}),Ab=()=>Wo("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Wo("rect",{x:"3",y:"3",width:"7",height:"7"}),Wo("rect",{x:"14",y:"3",width:"7",height:"7"}),Wo("rect",{x:"3",y:"14",width:"7",height:"7"}),Wo("rect",{x:"14",y:"14",width:"7",height:"7"})]}),Fb=({currentView:e,onViewChange:t,className:n,disabled:r=!1})=>{const{i18n:o}=si();return Wo("div",{className:ri("view-switcher",n),children:[Wo("button",{type:"button",onClick:()=>t("table"),className:ri("view-switcher-btn","table"===e&&"active"),disabled:r,"aria-label":o.tableView,title:o.tableView,children:Wo(Tb,{})}),Wo("button",{type:"button",onClick:()=>t("grid"),className:ri("view-switcher-btn","grid"===e&&"active"),disabled:r,"aria-label":o.gridView,title:o.gridView,children:Wo(Ab,{})})]})},Nb=({label:e,labelOverrideSignal:t,selectedCount:n,onClick:r,isLoading:o=!1,className:i})=>{const l=null==t?void 0:t.value,s=null!=l,a=null!=l?l:e,u=0===n||o,c=!s&&n>0&&!o,d=s?a:n>0?`${a} (${n})`:a;return Wo("button",{type:"button",className:ri("dv-action-button",u&&"dv-action-button-disabled",o&&"dv-action-button-loading",i),disabled:u,onClick:r,"aria-label":d,"aria-busy":o,children:[o&&Wo("span",{className:"dv-action-button-spinner","aria-hidden":"true"}),Wo("span",{className:"dv-action-button-label",children:a}),c&&Wo("span",{className:"dv-action-button-badge",children:n})]})},zb="data-dv-row-selection-id",Db=`input[type="checkbox"][${zb}]`;function Lb(e){const t={};for(const n of Array.from(e.attributes))n.name.startsWith("data-")&&(t[n.name.slice(5).replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]=n.value);return t}function Vb(e,t){return"function"==typeof e?e(t):e}function $b(e,t){return n=>{t.setState(t=>({...t,[e]:Vb(n,t[e])}))}}function jb(e){return e instanceof Function}function Wb(e,t,n){let r,o=[];return i=>{let l;n.key&&n.debug&&(l=Date.now());const s=e(i),a=s.length!==o.length||s.some((e,t)=>o[t]!==e);if(!a)return r;let u;if(o=s,n.key&&n.debug&&(u=Date.now()),r=t(...s),null==n||null==n.onChange||n.onChange(r),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-l))/100,t=Math.round(100*(Date.now()-u))/100,r=t/16,o=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${o(t,5)} /${o(e,5)} ms`,`\n            font-size: .6rem;\n            font-weight: bold;\n            color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==n?void 0:n.key)}return r}}function Hb(e,t,n,r){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:r}}const Bb="debugHeaders";function Ub(e,t,n){var r;let o={id:null!=(r=n.id)?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(o),e},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(t=>{null==t.createHeader||t.createHeader(o,e)}),o}const qb={createTable:e=>{e.getHeaderGroups=Wb(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,l;const s=null!=(i=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?i:[],a=null!=(l=null==o?void 0:o.map(e=>n.find(t=>t.id===e)).filter(Boolean))?l:[];return Gb(t,[...s,...n.filter(e=>!(null!=r&&r.includes(e.id)||null!=o&&o.includes(e.id))),...a],e)},Hb(e.options,Bb)),e.getCenterHeaderGroups=Wb(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>Gb(t,n=n.filter(e=>!(null!=r&&r.includes(e.id)||null!=o&&o.includes(e.id))),e,"center"),Hb(e.options,Bb)),e.getLeftHeaderGroups=Wb(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=null!=(o=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?o:[];return Gb(t,i,e,"left")},Hb(e.options,Bb)),e.getRightHeaderGroups=Wb(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=null!=(o=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?o:[];return Gb(t,i,e,"right")},Hb(e.options,Bb)),e.getFooterGroups=Wb(()=>[e.getHeaderGroups()],e=>[...e].reverse(),Hb(e.options,Bb)),e.getLeftFooterGroups=Wb(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),Hb(e.options,Bb)),e.getCenterFooterGroups=Wb(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),Hb(e.options,Bb)),e.getRightFooterGroups=Wb(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),Hb(e.options,Bb)),e.getFlatHeaders=Wb(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),Hb(e.options,Bb)),e.getLeftFlatHeaders=Wb(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),Hb(e.options,Bb)),e.getCenterFlatHeaders=Wb(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),Hb(e.options,Bb)),e.getRightFlatHeaders=Wb(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),Hb(e.options,Bb)),e.getCenterLeafHeaders=Wb(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),Hb(e.options,Bb)),e.getLeftLeafHeaders=Wb(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),Hb(e.options,Bb)),e.getRightLeafHeaders=Wb(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),Hb(e.options,Bb)),e.getLeafHeaders=Wb(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>{var r,o,i,l,s,a;return[...null!=(r=null==(o=e[0])?void 0:o.headers)?r:[],...null!=(i=null==(l=t[0])?void 0:l.headers)?i:[],...null!=(s=null==(a=n[0])?void 0:a.headers)?s:[]].map(e=>e.getLeafHeaders()).flat()},Hb(e.options,Bb))}};function Gb(e,t,n,r){var o,i;let l=0;const s=function(e,t){void 0===t&&(t=1),l=Math.max(l,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;null!=(n=e.columns)&&n.length&&s(e.columns,t+1)},0)};s(e);let a=[];const u=(e,t)=>{const o={depth:t,id:[r,`${t}`].filter(Boolean).join("_"),headers:[]},i=[];e.forEach(e=>{const l=[...i].reverse()[0];let s,a=!1;if(e.column.depth===o.depth&&e.column.parent?s=e.column.parent:(s=e.column,a=!0),l&&(null==l?void 0:l.column)===s)l.subHeaders.push(e);else{const o=Ub(n,s,{id:[r,t,s.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:a,placeholderId:a?`${i.filter(e=>e.column===s).length}`:void 0,depth:t,index:i.length});o.subHeaders.push(e),i.push(o)}o.headers.push(e),e.headerGroup=o}),a.push(o),t>0&&u(i,t-1)},c=t.map((e,t)=>Ub(n,e,{depth:l,index:t}));u(c,l-1),a.reverse();const d=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,r=[0];return e.subHeaders&&e.subHeaders.length?(r=[],d(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:o}=e;t+=n,r.push(o)})):t=1,n+=Math.min(...r),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return d(null!=(o=null==(i=a[0])?void 0:i.headers)?o:[]),a}const Zb=(e,t,n,r,o,i,l)=>{let s={id:t,index:r,original:n,depth:o,parentId:l,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?(s._valuesCache[t]=n.accessorFn(s.original,r),s._valuesCache[t]):void 0},getUniqueValues:t=>{if(s._uniqueValuesCache.hasOwnProperty(t))return s._uniqueValuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?n.columnDef.getUniqueValues?(s._uniqueValuesCache[t]=n.columnDef.getUniqueValues(s.original,r),s._uniqueValuesCache[t]):(s._uniqueValuesCache[t]=[s.getValue(t)],s._uniqueValuesCache[t]):void 0},renderValue:t=>{var n;return null!=(n=s.getValue(t))?n:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>function(e){const t=[],n=e=>{e.forEach(e=>{t.push(e);const r=(e=>e.subRows)(e);null!=r&&r.length&&n(r)})};return n(e),t}(s.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let e=[],t=s;for(;;){const n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:Wb(()=>[e.getAllLeafColumns()],t=>t.map(t=>function(e,t,n,r){const o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:()=>{var t;return null!=(t=o.getValue())?t:e.options.renderFallbackValue},getContext:Wb(()=>[e,n,t,o],(e,t,n,r)=>({table:e,column:t,row:n,cell:r,getValue:r.getValue,renderValue:r.renderValue}),Hb(e.options,"debugCells"))};return e._features.forEach(r=>{null==r.createCell||r.createCell(o,n,t,e)},{}),o}(e,s,t,t.id)),Hb(e.options,"debugRows")),_getAllCellsByColumnId:Wb(()=>[s.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),Hb(e.options,"debugRows"))};for(let t=0;t<e._features.length;t++){const n=e._features[t];null==n||null==n.createRow||n.createRow(s,e)}return s},Kb={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Jb=(e,t,n)=>{var r,o;const i=null==n||null==(r=n.toString())?void 0:r.toLowerCase();return Boolean(null==(o=e.getValue(t))||null==(o=o.toString())||null==(o=o.toLowerCase())?void 0:o.includes(i))};Jb.autoRemove=e=>lw(e);const Xb=(e,t,n)=>{var r;return Boolean(null==(r=e.getValue(t))||null==(r=r.toString())?void 0:r.includes(n))};Xb.autoRemove=e=>lw(e);const Yb=(e,t,n)=>{var r;return(null==(r=e.getValue(t))||null==(r=r.toString())?void 0:r.toLowerCase())===(null==n?void 0:n.toLowerCase())};Yb.autoRemove=e=>lw(e);const Qb=(e,t,n)=>{var r;return null==(r=e.getValue(t))?void 0:r.includes(n)};Qb.autoRemove=e=>lw(e);const ew=(e,t,n)=>!n.some(n=>{var r;return!(null!=(r=e.getValue(t))&&r.includes(n))});ew.autoRemove=e=>lw(e)||!(null!=e&&e.length);const tw=(e,t,n)=>n.some(n=>{var r;return null==(r=e.getValue(t))?void 0:r.includes(n)});tw.autoRemove=e=>lw(e)||!(null!=e&&e.length);const nw=(e,t,n)=>e.getValue(t)===n;nw.autoRemove=e=>lw(e);const rw=(e,t,n)=>e.getValue(t)==n;rw.autoRemove=e=>lw(e);const ow=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};ow.resolveFilterValue=e=>{let[t,n]=e,r="number"!=typeof t?parseFloat(t):t,o="number"!=typeof n?parseFloat(n):n,i=null===t||Number.isNaN(r)?-1/0:r,l=null===n||Number.isNaN(o)?1/0:o;if(i>l){const e=i;i=l,l=e}return[i,l]},ow.autoRemove=e=>lw(e)||lw(e[0])&&lw(e[1]);const iw={includesString:Jb,includesStringSensitive:Xb,equalsString:Yb,arrIncludes:Qb,arrIncludesAll:ew,arrIncludesSome:tw,equals:nw,weakEquals:rw,inNumberRange:ow};function lw(e){return null==e||""===e}const sw={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:$b("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=null==n?void 0:n.getValue(e.id);return"string"==typeof r?iw.includesString:"number"==typeof r?iw.inNumberRange:"boolean"==typeof r||null!==r&&"object"==typeof r?iw.equals:Array.isArray(r)?iw.arrIncludes:iw.weakEquals},e.getFilterFn=()=>{var n,r;return jb(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(r=t.options.filterFns)?void 0:r[e.columnDef.filterFn])?n:iw[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(r=t.options.enableColumnFilters)||r)&&(null==(o=t.options.enableFilters)||o)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return null==(n=t.getState().columnFilters)||null==(n=n.find(t=>t.id===e.id))?void 0:n.value},e.getFilterIndex=()=>{var n,r;return null!=(n=null==(r=t.getState().columnFilters)?void 0:r.findIndex(t=>t.id===e.id))?n:-1},e.setFilterValue=n=>{t.setColumnFilters(t=>{const r=e.getFilterFn(),o=null==t?void 0:t.find(t=>t.id===e.id),i=Vb(n,o?o.value:void 0);var l;if(aw(r,i,e))return null!=(l=null==t?void 0:t.filter(t=>t.id!==e.id))?l:[];const s={id:e.id,value:i};var a;return o?null!=(a=null==t?void 0:t.map(t=>t.id===e.id?s:t))?a:[]:null!=t&&t.length?[...t,s]:[s]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange(e=>{var r;return null==(r=Vb(t,e))?void 0:r.filter(e=>{const t=n.find(t=>t.id===e.id);return!t||!aw(t.getFilterFn(),e.value,t)})})},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function aw(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}const uw={sum:(e,t,n)=>n.reduce((t,n)=>{const r=n.getValue(e);return t+("number"==typeof r?r:0)},0),min:(e,t,n)=>{let r;return n.forEach(t=>{const n=t.getValue(e);null!=n&&(r>n||void 0===r&&n>=n)&&(r=n)}),r},max:(e,t,n)=>{let r;return n.forEach(t=>{const n=t.getValue(e);null!=n&&(r<n||void 0===r&&n>=n)&&(r=n)}),r},extent:(e,t,n)=>{let r,o;return n.forEach(t=>{const n=t.getValue(e);null!=n&&(void 0===r?n>=n&&(r=o=n):(r>n&&(r=n),o<n&&(o=n)))}),[r,o]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(t=>{let o=t.getValue(e);null!=o&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},median:(e,t)=>{if(!t.length)return;const n=t.map(t=>t.getValue(e));if(!function(e){return Array.isArray(e)&&e.every(e=>"number"==typeof e)}(n))return;if(1===n.length)return n[0];const r=Math.floor(n.length/2),o=n.sort((e,t)=>e-t);return n.length%2!=0?o[r]:(o[r-1]+o[r])/2},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},cw={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:$b("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>null!=t&&t.includes(e.id)?t.filter(t=>t!==e.id):[...null!=t?t:[],e.id])},e.getCanGroup=()=>{var n,r;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(r=t.options.enableGrouping)||r)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=null==n?void 0:n.getValue(e.id);return"number"==typeof r?uw.sum:"[object Date]"===Object.prototype.toString.call(r)?uw.extent:void 0},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return jb(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(r=t.options.aggregationFns)?void 0:r[e.columnDef.aggregationFn])?n:uw[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return null!=r&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}}},dw={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:$b("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Wb(e=>[yw(t,e)],t=>t.findIndex(t=>t.id===e.id),Hb(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return(null==(r=yw(t,n)[0])?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=yw(t,n);return(null==(r=o[o.length-1])?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=Wb(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>r=>{let o=[];if(null!=e&&e.length){const t=[...e],n=[...r];for(;n.length&&t.length;){const e=t.shift(),r=n.findIndex(t=>t.id===e);r>-1&&o.push(n.splice(r,1)[0])}o=[...o,...n]}else o=r;return function(e,t,n){if(null==t||!t.length||!n)return e;const r=e.filter(e=>!t.includes(e.id));if("remove"===n)return r;const o=t.map(t=>e.find(e=>e.id===t)).filter(Boolean);return[...o,...r]}(o,t,n)},Hb(e.options,"debugTable"))}},fw={getInitialState:e=>({columnPinning:{left:[],right:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:$b("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>{var t,o,i,l,s,a;return"right"===n?{left:(null!=(i=null==e?void 0:e.left)?i:[]).filter(e=>!(null!=r&&r.includes(e))),right:[...(null!=(l=null==e?void 0:e.right)?l:[]).filter(e=>!(null!=r&&r.includes(e))),...r]}:"left"===n?{left:[...(null!=(s=null==e?void 0:e.left)?s:[]).filter(e=>!(null!=r&&r.includes(e))),...r],right:(null!=(a=null==e?void 0:e.right)?a:[]).filter(e=>!(null!=r&&r.includes(e)))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter(e=>!(null!=r&&r.includes(e))),right:(null!=(o=null==e?void 0:e.right)?o:[]).filter(e=>!(null!=r&&r.includes(e)))}})},e.getCanPin=()=>e.getLeafColumns().some(e=>{var n,r,o;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(r=null!=(o=t.options.enableColumnPinning)?o:t.options.enablePinning)||r)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(e=>e.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(e=>null==r?void 0:r.includes(e)),l=n.some(e=>null==o?void 0:o.includes(e));return i?"left":!!l&&"right"},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?null!=(n=null==(r=t.getState().columnPinning)||null==(r=r[o])?void 0:r.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Wb(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{const r=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!r.includes(e.column.id))},Hb(t.options,"debugRows")),e.getLeftVisibleCells=Wb(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>{const n=(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"left"}));return n},Hb(t.options,"debugRows")),e.getRightVisibleCells=Wb(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>{const n=(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"right"}));return n},Hb(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?{left:[],right:[]}:null!=(n=null==(r=e.initialState)?void 0:r.columnPinning)?n:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;var o,i;return t?Boolean(null==(n=r[t])?void 0:n.length):Boolean((null==(o=r.left)?void 0:o.length)||(null==(i=r.right)?void 0:i.length))},e.getLeftLeafColumns=Wb(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),Hb(e.options,"debugColumns")),e.getRightLeafColumns=Wb(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),Hb(e.options,"debugColumns")),e.getCenterLeafColumns=Wb(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{const r=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!r.includes(e.id))},Hb(e.options,"debugColumns"))}},hw={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},pw={getDefaultColumnDef:()=>hw,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:$b("columnSizing",e),onColumnSizingInfoChange:$b("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:hw.minSize,null!=(r=null!=i?i:e.columnDef.size)?r:hw.size),null!=(o=e.columnDef.maxSize)?o:hw.maxSize)},e.getStart=Wb(e=>[e,yw(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),Hb(t.options,"debugColumns")),e.getAfter=Wb(e=>[e,yw(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),Hb(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...r}=t;return r})},e.getCanResize=()=>{var n,r;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(r=t.options.enableColumnResizing)||r)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const n=e=>{var r;e.subHeaders.length?e.subHeaders.forEach(n):t+=null!=(r=e.column.getSize())?r:0};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=null==r?void 0:r.getCanResize();return i=>{if(!r||!o)return;if(null==i.persist||i.persist(),mw(i)&&i.touches&&i.touches.length>1)return;const l=e.getSize(),s=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[r.id,r.getSize()]],a=mw(i)?Math.round(i.touches[0].clientX):i.clientX,u={},c=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo(e=>{var r,o;const i="rtl"===t.options.columnResizeDirection?-1:1,l=(n-(null!=(r=null==e?void 0:e.startOffset)?r:0))*i,s=Math.max(l/(null!=(o=null==e?void 0:e.startSize)?o:0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;u[t]=Math.round(100*Math.max(n+n*s,0))/100}),{...e,deltaOffset:l,deltaPercentage:s}}),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing(e=>({...e,...u})))},d=e=>c("move",e),f=e=>{c("end",e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||("undefined"!=typeof document?document:null),p={moveHandler:e=>d(e.clientX),upHandler:e=>{null==h||h.removeEventListener("mousemove",p.moveHandler),null==h||h.removeEventListener("mouseup",p.upHandler),f(e.clientX)}},g={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1),upHandler:e=>{var t;null==h||h.removeEventListener("touchmove",g.moveHandler),null==h||h.removeEventListener("touchend",g.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),f(null==(t=e.touches[0])?void 0:t.clientX)}},m=!!function(){if("boolean"==typeof gw)return gw;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch(t){e=!1}return gw=e,gw}()&&{passive:!1};mw(i)?(null==h||h.addEventListener("touchmove",g.moveHandler,m),null==h||h.addEventListener("touchend",g.upHandler,m)):(null==h||h.addEventListener("mousemove",p.moveHandler,m),null==h||h.addEventListener("mouseup",p.upHandler,m)),t.setColumnSizingInfo(e=>({...e,startOffset:a,startSize:l,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:null!=(n=e.initialState.columnSizingInfo)?n:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0}}};let gw=null;function mw(e){return"touchstart"===e.type}const vw={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:$b("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return null==(n=o.length?o.some(e=>e.getIsVisible()):null==(r=t.getState().columnVisibility)?void 0:r[e.id])||n},e.getCanHide=()=>{var n,r;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(r=t.options.enableHiding)||r)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Wb(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),Hb(t.options,"debugRows")),e.getVisibleCells=Wb(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],Hb(t.options,"debugRows"))},createTable:e=>{const t=(t,n)=>Wb(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join("_")],e=>e.filter(e=>null==e.getIsVisible?void 0:e.getIsVisible()),Hb(e.options,"debugColumns"));e.getVisibleFlatColumns=t(0,()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t(0,()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t(0,()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t(0,()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t(0,()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(null!=e.getIsVisible&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>null==e.getIsVisible?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}};function yw(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const bw={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:$b("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(t){if(null!=(r=null!=(o=e.options.autoResetAll)?o:e.options.autoResetExpanded)?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}}else e._queue(()=>{t=!0})},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,r;e.setExpanded(t?{}:null!=(n=null==(r=e.initialState)?void 0:r.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand ()),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some(e=>!e.getIsExpanded())},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{const n=e.split(".");t=Math.max(t,n.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=!0===r||!(null==r||!r[e.id]);let l={};if(!0===r?Object.keys(t.getRowModel().rowsById).forEach(e=>{l[e]=!0}):l=r,n=null!=(o=n)?o:!i,!i&&n)return{...l,[e.id]:!0};if(i&&!n){const{[e.id]:t,...n}=l;return n}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===r||(null==r?void 0:r[e.id]))},e.getCanExpand=()=>{var n,r,o;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand (e))?n:(null==(r=t.options.enableExpanding)||r)&&!(null==(o=e.subRows)||!o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand ();return()=>{t&&e.toggleExpanded()}}}},ww={getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:$b("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(t){if(null!=(r=null!=(o=e.options.autoResetAll)?o:e.options.autoResetPageIndex)?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}}else e._queue(()=>{t=!0})},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange(e=>Vb(t,e)),e.resetPagination=t=>{var n;e.setPagination(t?{pageIndex:0,pageSize:10}:null!=(n=e.initialState.pagination)?n:{pageIndex:0,pageSize:10})},e.setPageIndex=t=>{e.setPagination(n=>{let r=Vb(t,n.pageIndex);const o=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return r=Math.max(0,Math.min(r,o)),{...n,pageIndex:r}})},e.resetPageIndex=t=>{var n,r;e.setPageIndex(t?0:null!=(n=null==(r=e.initialState)||null==(r=r.pagination)?void 0:r.pageIndex)?n:0)},e.resetPageSize=t=>{var n,r;e.setPageSize(t?10:null!=(n=null==(r=e.initialState)||null==(r=r.pagination)?void 0:r.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination(e=>{const n=Math.max(1,Vb(t,e.pageSize)),r=e.pageSize*e.pageIndex,o=Math.floor(r/n);return{...e,pageIndex:o,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{var r;let o=Vb(t,null!=(r=e.options.pageCount)?r:-1);return"number"==typeof o&&(o=Math.max(-1,o)),{...n,pageCount:o}}),e.getPageOptions=Wb(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map((e,t)=>t)),t},Hb(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},_w={getInitialState:e=>({rowPinning:{top:[],bottom:[]},...e}),getDefaultOptions:e=>({onRowPinningChange:$b("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],l=o?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],s=new Set([...l,e.id,...i]);t.setRowPinning(e=>{var t,r,o,i,l,a;return"bottom"===n?{top:(null!=(o=null==e?void 0:e.top)?o:[]).filter(e=>!(null!=s&&s.has(e))),bottom:[...(null!=(i=null==e?void 0:e.bottom)?i:[]).filter(e=>!(null!=s&&s.has(e))),...Array.from(s)]}:"top"===n?{top:[...(null!=(l=null==e?void 0:e.top)?l:[]).filter(e=>!(null!=s&&s.has(e))),...Array.from(s)],bottom:(null!=(a=null==e?void 0:e.bottom)?a:[]).filter(e=>!(null!=s&&s.has(e)))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter(e=>!(null!=s&&s.has(e))),bottom:(null!=(r=null==e?void 0:e.bottom)?r:[]).filter(e=>!(null!=s&&s.has(e)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return"function"==typeof r?r(e):null==(n=null!=r?r:o)||n},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(e=>null==r?void 0:r.includes(e)),l=n.some(e=>null==o?void 0:o.includes(e));return i?"top":!!l&&"bottom"},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=null==(n="top"===o?t.getTopRows():t.getBottomRows())?void 0:n.map(e=>{let{id:t}=e;return t});return null!=(r=null==i?void 0:i.indexOf(e.id))?r:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(n=null==(r=e.initialState)?void 0:r.rowPinning)?n:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;var o,i;return t?Boolean(null==(n=r[t])?void 0:n.length):Boolean((null==(o=r.top)?void 0:o.length)||(null==(i=r.bottom)?void 0:i.length))},e._getPinnedRows=(t,n,r)=>{var o;return(null==(o=e.options.keepPinnedRows)||o?(null!=n?n:[]).map(t=>{const n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(null!=n?n:[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:r}))},e.getTopRows=Wb(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Hb(e.options,"debugRows")),e.getBottomRows=Wb(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Hb(e.options,"debugRows")),e.getCenterRows=Wb(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{const r=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter(e=>!r.has(e.id))},Hb(e.options,"debugRows"))}},Sw={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:$b("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(e=>{e.getCanSelect()&&(r[e.id]=!0)}):o.forEach(e=>{delete r[e.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=void 0!==t?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(t=>{xw(o,t.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Wb(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Cw(e,n):{rows:[],flatRows:[],rowsById:{}},Hb(e.options,"debugTable")),e.getFilteredSelectedRowModel=Wb(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Cw(e,n):{rows:[],flatRows:[],rowsById:{}},Hb(e.options,"debugTable")),e.getGroupedSelectedRowModel=Wb(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Cw(e,n):{rows:[],flatRows:[],rowsById:{}},Hb(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=Boolean(t.length&&Object.keys(n).length);return r&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(e=>!n[e.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var l;if(n=void 0!==n?n:!o,e.getCanSelect()&&o===n)return i;const s={...i};return xw(s,e.id,n,null==(l=null==r?void 0:r.selectChildren)||l,t),s})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Ew(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return"some"===Iw(e,n)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return"all"===Iw(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var r;t&&e.toggleSelected(null==(r=n.target)?void 0:r.checked)}}}},xw=(e,t,n,r,o)=>{var i;const l=o.getRow(t,!0);n?(l.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),l.getCanSelect()&&(e[t]=!0)):delete e[t],r&&null!=(i=l.subRows)&&i.length&&l.getCanSelectSubRows()&&l.subRows.forEach(t=>xw(e,t.id,n,r,o))};function Cw(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(e,t){return e.map(e=>{var t;const l=Ew(e,n);if(l&&(r.push(e),o[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:i(e.subRows)}),l)return e}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function Ew(e,t){var n;return null!=(n=t[e.id])&&n}function Iw(e,t,n){var r;if(null==(r=e.subRows)||!r.length)return!1;let o=!0,i=!1;return e.subRows.forEach(e=>{if((!i||o)&&(e.getCanSelect()&&(Ew(e,t)?i=!0:o=!1),e.subRows&&e.subRows.length)){const n=Iw(e,t);"all"===n?i=!0:"some"===n?(i=!0,o=!1):o=!1}}),o?"all":!!i&&"some"}const Rw=/([0-9]+)/gm;function kw(e,t){return e===t?0:e>t?1:-1}function Pw(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function Ow(e,t){const n=e.split(Rw).filter(Boolean),r=t.split(Rw).filter(Boolean);for(;n.length&&r.length;){const e=n.shift(),t=r.shift(),o=parseInt(e,10),i=parseInt(t,10),l=[o,i].sort();if(isNaN(l[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(l[1]))return isNaN(o)?-1:1;if(o>i)return 1;if(i>o)return-1}}return n.length-r.length}const Mw={alphanumeric:(e,t,n)=>Ow(Pw(e.getValue(n)).toLowerCase(),Pw(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>Ow(Pw(e.getValue(n)),Pw(t.getValue(n))),text:(e,t,n)=>kw(Pw(e.getValue(n)).toLowerCase(),Pw(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>kw(Pw(e.getValue(n)),Pw(t.getValue(n))),datetime:(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},basic:(e,t,n)=>kw(e.getValue(n),t.getValue(n))},Tw={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:$b("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const t of n){const n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return Mw.datetime;if("string"==typeof n&&(r=!0,n.split(Rw).length>1))return Mw.alphanumeric}return r?Mw.text:Mw.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return jb(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(r=t.options.sortingFns)?void 0:r[e.columnDef.sortingFn])?n:Mw[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=null!=n;t.setSorting(l=>{const s=null==l?void 0:l.find(t=>t.id===e.id),a=null==l?void 0:l.findIndex(t=>t.id===e.id);let u,c=[],d=i?n:"desc"===o;var f;return u=null!=l&&l.length&&e.getCanMultiSort()&&r?s?"toggle":"add":null!=l&&l.length&&a!==l.length-1?"replace":s?"toggle":"replace","toggle"===u&&(i||o||(u="remove")),"add"===u?(c=[...l,{id:e.id,desc:d}],c.splice(0,c.length-(null!=(f=t.options.maxMultiSortColCount)?f:Number.MAX_SAFE_INTEGER))):c="toggle"===u?l.map(t=>t.id===e.id?{...t,desc:d}:t):"remove"===u?l.filter(t=>t.id!==e.id):[{id:e.id,desc:d}],c})},e.getFirstSortDir=()=>{var n,r;return(null!=(n=null!=(r=e.columnDef.sortDescFirst)?r:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),l=e.getIsSorted();return l?!!(l===i||null!=(r=t.options.enableSortingRemoval)&&!r||n&&null!=(o=t.options.enableMultiRemove)&&!o)&&("desc"===l?"asc":"desc"):i},e.getCanSort=()=>{var n,r;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(r=t.options.enableSorting)||r)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return null!=(n=null!=(r=e.columnDef.enableMultiSort)?r:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=null==(n=t.getState().sorting)?void 0:n.find(t=>t.id===e.id);return!!r&&(r.desc?"desc":"asc")},e.getSortIndex=()=>{var n,r;return null!=(n=null==(r=t.getState().sorting)?void 0:r.findIndex(t=>t.id===e.id))?n:-1},e.clearSorting=()=>{t.setSorting(t=>null!=t&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(null==r.persist||r.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(r))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Aw=[qb,vw,dw,fw,Kb,sw,{createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},{getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:$b("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof r||"number"==typeof r}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(r=t.options.enableGlobalFilter)||r)&&(null==(o=t.options.enableFilters)||o)&&(null==(i=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||i)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>iw.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return jb(r)?r:"auto"===r?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[r])?t:iw[r]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Tw,cw,bw,ww,_w,Sw,pw];function Fw(e){var t,n;const r=[...Aw,...null!=(t=e._features)?t:[]];let o={_features:r};const i=o._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(o)),{});let l={...null!=(n=e.initialState)?n:{}};o._features.forEach(e=>{var t;l=null!=(t=null==e.getInitialState?void 0:e.getInitialState(l))?t:l});const s=[];let a=!1;const u={_features:r,options:{...i,...e},initialState:l,_queue:e=>{s.push(e),a||(a=!0,Promise.resolve().then(()=>{for(;s.length;)s.shift()();a=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{o.setState(o.initialState)},setOptions:e=>{const t=Vb(e,o.options);o.options=(e=>o.options.mergeOptions?o.options.mergeOptions(i,e):{...i,...e})(t)},getState:()=>o.options.state,setState:e=>{null==o.options.onStateChange||o.options.onStateChange(e)},_getRowId:(e,t,n)=>{var r;return null!=(r=null==o.options.getRowId?void 0:o.options.getRowId(e,t,n))?r:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?o.getPrePaginationRowModel():o.getRowModel()).rowsById[e];if(!n&&(n=o.getCoreRowModel().rowsById[e],!n))throw new Error;return n},_getDefaultColumnDef:Wb(()=>[o.options.defaultColumn],e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...o._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef()),{}),...e}},Hb(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:Wb(()=>[o._getColumnDefs()],e=>{const t=function(e,n,r){return void 0===r&&(r=0),e.map(e=>{const i=function(e,t,n,r){var o,i;const l={...e._getDefaultColumnDef(),...t},s=l.accessorKey;let a,u=null!=(o=null!=(i=l.id)?i:s?"function"==typeof String.prototype.replaceAll?s.replaceAll(".","_"):s.replace(/\./g,"_"):void 0)?o:"string"==typeof l.header?l.header:void 0;if(l.accessorFn?a=l.accessorFn:s&&(a=s.includes(".")?e=>{let t=e;for(const e of s.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[l.accessorKey]),!u)throw new Error;let c={id:`${String(u)}`,accessorFn:a,parent:r,depth:n,columnDef:l,columns:[],getFlatColumns:Wb(()=>[!0],()=>{var e;return[c,...null==(e=c.columns)?void 0:e.flatMap(e=>e.getFlatColumns())]},Hb(e.options,"debugColumns")),getLeafColumns:Wb(()=>[e._getOrderColumnsFn()],e=>{var t;if(null!=(t=c.columns)&&t.length){let t=c.columns.flatMap(e=>e.getLeafColumns());return e(t)}return[c]},Hb(e.options,"debugColumns"))};for(const t of e._features)null==t.createColumn||t.createColumn(c,e);return c}(o,e,r,n),l=e;return i.columns=l.columns?t(l.columns,i,r+1):[],i})};return t(e)},Hb(e,"debugColumns")),getAllFlatColumns:Wb(()=>[o.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),Hb(e,"debugColumns")),_getAllFlatColumnsById:Wb(()=>[o.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),Hb(e,"debugColumns")),getAllLeafColumns:Wb(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),Hb(e,"debugColumns")),getColumn:e=>o._getAllFlatColumnsById()[e]};Object.assign(o,u);for(let e=0;e<o._features.length;e++){const t=o._features[e];null==t||null==t.createTable||t.createTable(o)}return o}function Nw(e,t){return e?function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(n=e)||"function"==typeof n||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(n)?Oe(e,t):e:null;var n}function zw(e,t,n){var r;let o,i=null!==(r=n.initialDeps)&&void 0!==r?r:[],l=!0;function s(){const r=e(),s=r.length!==i.length||r.some((e,t)=>i[t]!==e);return s?(i=r,o=t(...r),!(null==n?void 0:n.onChange)||l&&n.skipInitialOnChange||n.onChange(o),l=!1,o):o}return s.updateDeps=e=>{i=e},s}function Dw(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const Lw=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}};let Vw;const $w=()=>{if(void 0!==Vw)return Vw;if("undefined"==typeof navigator)return Vw=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Vw=!0;const e=navigator.maxTouchPoints;return Vw="MacIntel"===navigator.platform&&void 0!==e&&e>0},jw=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Ww=e=>e,Hw=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=new Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},Bw=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=e=>{const{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(o(jw(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(t=>{const r=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void o({width:t.inlineSize,height:t.blockSize})}o(jw(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},Uw={passive:!0},qw="undefined"==typeof window||"onscrollend"in window,Gw=(e,t)=>((e,t,n)=>{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;const i=e.options.useScrollendEvent&&qw;let l=0;const s=i?null:Lw(o,()=>t(l,!1),e.options.isScrollingResetDelay),a=e=>()=>{l=n(r),null==s||s(),t(l,e)},u=a(!0),c=a(!1);return r.addEventListener("scroll",u,Uw),i&&r.addEventListener("scrollend",c,Uw),()=>{r.removeEventListener("scroll",u),i&&r.removeEventListener("scrollend",c)}})(e,t,t=>{const{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r?-1:1):t.scrollTop}),Zw=(e,t,n)=>{if(n.options.useCachedMeasurements){var r;const t=n.indexFromElement(e),o=n.options.getItemKey(t);return null!==(r=n.itemSizeCache.get(o))&&void 0!==r?r:n.options.estimateSize(t)}if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const t=n.indexFromElement(e),r=n.options.getItemKey(t),o=n.itemSizeCache.get(r);if(void 0!==o)return o}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},Kw=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;null==(i=null==(o=r.scrollElement)?void 0:o.scrollTo)||i.call(o,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})};class Jw{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e,t,n,r;return null!==(e=null==(r=null==(n=null==(t=this.targetWindow)?void 0:t.performance)?void 0:n.now)?void 0:r.call(n))&&void 0!==e?e:Date.now()},this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{const t=()=>{const t=e.target,n=this.indexFromElement(t);if(t.isConnected)this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this));else{this.observer.unobserve(t);for(const[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}}};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var n;null==(n=t())||n.disconnect(),e=null},observe:e=>{var n;return null==(n=t())?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null==(n=t())?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{var t,n;const r={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ww,rangeExtractor:Hw,onChange:()=>{},measureElement:Zw,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const t in e){const n=e[t];void 0!==n&&(r[t]=n)}const o=this.options;let i=null,l=null,s=!1;if(void 0!==o&&o.enabled&&r.enabled&&"end"===r.anchorTo&&null!==this.scrollElement){var a,u;const e=o.count,d=r.count,f=this.getMeasurements(),h=e>0?null!==(a=null==(t=f[0])?void 0:t.key)&&void 0!==a?a:o.getItemKey(0):null,p=e>0?null!==(u=null==(n=f[e-1])?void 0:n.key)&&void 0!==u?u:o.getItemKey(e-1):null;if(d!==e||e>0&&d>0&&(r.getItemKey(0)!==h||r.getItemKey(d-1)!==p)){var c;s=!0;const t=e>0?null!==(c=this.getVirtualItemForOffset(this.getScrollOffset()))&&void 0!==c?c:f[0]:null;t&&(i=[t.key,this.getScrollOffset()-t.start]);const n=!0===r.followOnAppend?"auto":r.followOnAppend||null;n&&d>e&&this.isAtEnd(o.scrollEndThreshold)&&(0===e||r.getItemKey(d-1)!==p)&&(l=n)}}this.options=r,s&&(this.pendingMin=0,this.itemSizeCacheVersion++);let d=!1,f=0;if(i&&null!==this.scrollOffset){const[e,t]=i,n=this.getMeasurements(),{count:r,getItemKey:o}=this.options;let l=0;for(;l<r&&o(l)!==e;)l++;if(l<r){const e=n[l];if(e){const n=e.start+t;n!==this.scrollOffset&&(f=n-this.scrollOffset,this.scrollOffset=n,d=!0)}}}(d||l)&&(this.pendingScrollAnchor=[d?i[0]:null,d?i[1]:0,l,f])},this.notify=e=>{var t,n;null==(n=(t=this.options).onChange)||n.call(t,this,e)},this.maybeNotify=zw(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();var n;if(this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=null!==(n=null==(e=this.scrollElement)?void 0:e.window)&&void 0!==n?n:null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{t&&null===this._intendedScrollOffset&&e===this.scrollOffset||(null!==this._intendedScrollOffset&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify())})),"addEventListener"in this.scrollElement){const e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,null!==this._iosTouchEndTimerId&&null!=this.targetWindow&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,$w()&&null!=this.targetWindow&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener("touchstart",t,Uw),e.addEventListener("touchend",n,Uw),this.unsubs.push(()=>{e.removeEventListener("touchstart",t),e.removeEventListener("touchend",n),null!==this._iosTouchEndTimerId&&null!=this.targetWindow&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const r=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,r&&this.scrollElement&&this.options.enabled){const[e,t,n,o]=r;null===e||n||($w()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?0!==o&&(this._iosDeferredAdjustment+=o):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),n&&this.scrollToEnd({behavior:n})}},this._flushIosDeferredIfReady=()=>{if(0===this._iosDeferredAdjustment)return;if(this.isScrolling)return;if(this._iosTouching)return;if(this._iosJustTouchEnded)return;const e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;const n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>{var e;return this.options.enabled?(this.scrollRect=null!==(e=this.scrollRect)&&void 0!==e?e:this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0)},this.getScrollOffset=()=>{var e;return this.options.enabled?(this.scrollOffset=null!==(e=this.scrollOffset)&&void 0!==e?e:"function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset,this.scrollOffset):(this.scrollOffset=null,0)},this.getFurthestMeasurement=(e,t)=>{const n=new Map,r=new Map;for(let o=t-1;o>=0;o--){const t=e[o];if(n.has(t.lane))continue;const i=r.get(t.lane);if(null==i||t.end>i.end?r.set(t.lane,t):t.end<i.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=zw(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,o,i,l)=>(void 0!==this.prevLanes&&this.prevLanes!==i&&(this.lanesChangedFlag=!0),this.prevLanes=i,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:o,lanes:i,laneAssignmentMode:l}),{key:!1}),this.getMeasurements=zw(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:o,lanes:i,laneAssignmentMode:l},s)=>{var a;const u=this.itemSizeCache;if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));const c=this.lanesSettling?0:null!==(a=this.pendingMin)&&void 0!==a?a:0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),1===i){const o=this.options.gap,i=2*e;let l,s=this._flatMeasurements;if(!s||s.length<i){const e=new Float64Array(i);s&&c>0&&e.set(s.subarray(0,2*c)),s=e,this._flatMeasurements=s}if(0===c)l=t+n;else{const e=c-1;l=s[2*e]+s[2*e+1]+o}for(let t=c;t<e;t++){const e=r(t),n=u.get(e),i="number"==typeof n?n:this.options.estimateSize(t);s[2*t]=l,s[2*t+1]=i,l+=i+o}const a=function(e,t,n){const r=new Array(e);return new Proxy(r,{get(r,o,i){if("string"==typeof o){const i=o.charCodeAt(0);if(i>=48&&i<=57){const i=+o;if(Number.isInteger(i)&&i>=0&&i<e){let e=r[i];if(!e){const o=t[2*i];e=r[i]={index:i,key:n(i),start:o,size:t[2*i+1],end:o+t[2*i+1],lane:0}}return e}}if("length"===o)return e}return Reflect.get(r,o,i)}})}(e,s,r);return this.measurementsCache=a,a}const d=this.measurementsCache.slice(0,c),f=new Array(i).fill(void 0);for(let e=0;e<c;e++){const t=d[e];t&&(f[t.lane]=e)}for(let o=c;o<e;o++){const e=r(o),i=this.laneAssignments.get(o);let s,a;const c="estimate"===l||u.has(e);if(void 0!==i&&this.options.lanes>1){s=i;const e=f[s],r=void 0!==e?d[e]:void 0;a=r?r.end+this.options.gap:t+n}else{const e=1===this.options.lanes?d[o-1]:this.getFurthestMeasurement(d,o);a=e?e.end+this.options.gap:t+n,s=e?e.lane:o%this.options.lanes,this.options.lanes>1&&c&&this.laneAssignments.set(o,s)}const h=u.get(e),p="number"==typeof h?h:this.options.estimateSize(o),g=a+p;d[o]={index:o,start:a,size:p,end:g,key:e,lane:s},f[s]=o}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=zw(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:o}){const i=e.length-1,l=o?e=>o[2*e]:t=>e[t].start,s=o?e=>o[2*e]+o[2*e+1]:t=>e[t].end;if(e.length<=r)return{startIndex:0,endIndex:i};let a=Xw(0,i,l,n),u=a;if(1===r)for(;u<i&&s(u)<n+t;)u++;else if(r>1){const o=Array(r).fill(0);for(;u<i&&o.some(e=>e<n+t);){const t=e[u];o[t.lane]=t.end,u++}const l=Array(r).fill(n+t);for(;a>=0&&l.some(e=>e>=n);){const t=e[a];l[t.lane]=t.start,a--}a=Math.max(0,a-a%r),u=Math.min(i,u+(r-1-u%r))}return{startIndex:a,endIndex:u}}({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:1===r&&null!=this._flatMeasurements?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=zw(()=>{let e=null,t=null;const n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,o)=>null===r||null===o?[]:e({startIndex:r,endIndex:o,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var t,n;if(!this.scrollState||"smooth"!==this.scrollState.behavior)return!0;const r=null!==(t=this.scrollState.index)&&void 0!==t?t:null==(n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))?void 0:n.index;if(void 0!==r&&this.range){const t=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),n=Math.max(0,r-t),o=Math.min(this.options.count-1,r+t);return e>=n&&e<=o}return!0},this.measureElement=e=>{if(!e)return void this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});const t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),this.isScrolling&&!this.scrollState||!this.shouldMeasureDuringScroll(t)||this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var n,r,o;if(e<0||e>=this.options.count)return;let i,l,s;const a=this._flatMeasurements;if(1===this.options.lanes&&null!==a)s=this.options.getItemKey(e),l=a[2*e],i=a[2*e+1];else{const t=this.measurementsCache[e];if(!t)return;s=t.key,l=t.start,i=t.size}const u=t-(null!==(n=this.itemSizeCache.get(s))&&void 0!==n?n:i);if(0!==u){var c;const n="end"===this.options.anchorTo&&"smooth"!==(null==(r=this.scrollState)?void 0:r.behavior)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,a=n?this.getTotalSize():0,d="smooth"!==(null==(o=this.scrollState)?void 0:o.behavior)&&(void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(null!==(c=this.measurementsCache[e])&&void 0!==c?c:{index:e,key:s,start:l,size:i,end:l+i,lane:0},u,this):l<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(s)||"backward"!==this.scrollDirection));(null===this.pendingMin||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(s,t),this.itemSizeCacheVersion++,n?this.applyScrollAdjustment(this.getTotalSize()-a):d&&this.applyScrollAdjustment(u),this.notify(!1)}},this.getVirtualItems=zw(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{const n=[];for(let r=0,o=e.length;r<o;r++){const o=t[e[r]];n.push(o)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0===t.length)return;const n=this._flatMeasurements,r=1===this.options.lanes&&null!=n,o=Xw(0,t.length-1,r?e=>n[2*e]:e=>Dw(t[e]).start,e);return Dw(t[o])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;const r=this.getSize(),o=this.getScrollOffset();"auto"===t&&(t=e>=o+r?"end":"start"),"center"===t?e+=(n-r)/2:"end"===t&&(e-=r);const i=this.getMaxScrollOffset();return Math.max(Math.min(i,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.getSize(),r=this.getScrollOffset(),o=this.measurementsCache[e];if(!o)return;if("auto"===t)if(o.end>=r+n-this.options.scrollPaddingEnd)t="end";else{if(!(o.start<=r+this.options.scrollPaddingStart))return[r,t];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];const i="end"===t?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,t,o.size),t]},this.scrollToOffset=(e,{align:t="start",behavior:n="auto"}={})=>{const r=this.getOffsetForAlignment(e,t),o=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:o,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t="auto",behavior:n="auto"}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));const r=this.getOffsetForIndex(e,t);if(!r)return;const[o,i]=r,l=this.now();this.scrollState={index:e,align:i,behavior:n,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t="auto"}={})=>{const n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:"start",behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e="auto"}={})=>{this.options.count>0?this.scrollToIndex(this.options.count-1,{align:"end",behavior:e}):this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let n;if(0===t.length)n=this.options.paddingStart;else if(1===this.options.lanes){const o=t.length-1,i=this._flatMeasurements;var r;n=null!=i?i[2*o]+i[2*o+1]:null!==(r=null==(e=t[o])?void 0:e.end)&&void 0!==r?r:0}else{const e=Array(this.options.lanes).fill(null);let r=t.length-1;for(;r>=0&&e.some(e=>null===e);){const n=t[r];null===e[n.lane]&&(e[n.lane]=n.end),r--}n=Math.max(...e.filter(e=>null!==e))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const e=[];if(0===this.itemSizeCache.size)return e;const t=this.getMeasurements();for(const n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(null!=t?t:0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){0!==e&&($w()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),null!==this.scrollOffset&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){this.targetWindow?null==this.rafId&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})):this.scrollState=null}reconcileScroll(){if(!this.scrollState)return;if(!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3)return void(this.scrollState=null);const e=null!=this.scrollState.index?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&((e,t)=>Math.abs(e-t)<1.01)(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1)return this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:"auto"}),void(this.scrollState=null)}else if(this.scrollState.stableFrames=0,n){const e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r="smooth"===this.scrollState.behavior&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior="auto"),this._scrollToOffset(t,{adjustments:void 0,behavior:r?"smooth":"auto"})}this.scheduleScrollReconcile()}}const Xw=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else{if(!(i>r))return o;t=o-1}}return e>0?e-1:0},Yw="undefined"!=typeof document?_t:wt;const Qw=/[^a-zA-Z0-9_-]/g,e_="http://www.w3.org/2000/svg";function t_(e){const t=Array.from(e.querySelectorAll("button, a.button, .multi-cart-check, .wpt-multi-checkbox"));if(t.length<2)return 0;let n=0;for(let e=0;e<t.length;e++)for(let r=e+1;r<t.length;r++){const o=t[e],i=t[r];if(o.contains(i)||i.contains(o))continue;const l=o.getBoundingClientRect(),s=i.getBoundingClientRect();if(l.width<=0||l.height<=0||s.width<=0||s.height<=0)continue;if(Math.min(l.bottom,s.bottom)-Math.max(l.top,s.top)<=0)continue;const a=Math.min(l.right,s.right)-Math.max(l.left,s.left);a>0&&(n=Math.max(n,a+4))}return Math.ceil(n)}const n_=e=>{const t=parseFloat(e);return Number.isFinite(t)?t:0},r_=e=>e.replace(/<[^>]*>/g,""),o_=e=>"object"==typeof e&&null!==e&&"taxonomy"===e.dataType&&Array.isArray(e.items),i_=e=>{const t=e.split(/\s+/).filter(Boolean);return 0===t.length?0:t.reduce((e,t)=>Math.max(e,t.length),0)},l_=e=>e&&"__responsive_control__"!==e?`col-${e.replace(Qw,"")}`:"",s_=e=>e?e.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/\s(id|name)\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/\son[a-z]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,""):"",a_=(e,t)=>{const n=t.trim();if(!n||e.has(n))return;const r=r_(n).replace(/\s+/g," ").trim();e.set(n,{value:n,rawLength:n.length,visibleLength:r.length,longestWordLength:i_(r)})},u_=e=>Array.from(e.values()).sort((e,t)=>t.longestWordLength!==e.longestWordLength?t.longestWordLength-e.longestWordLength:t.visibleLength!==e.visibleLength?t.visibleLength-e.visibleLength:t.rawLength-e.rawLength).slice(0,12).map(e=>e.value),c_=e=>e.nodeType===Node.ELEMENT_NODE&&(e.matches('a[rel~="tag"]')||e.matches("span[data-slug]")),d_=e=>{const t=e.cloneNode(!0);var n;return[...(n=t).matches(".combined-column")?[n]:[],...Array.from(n.querySelectorAll(".combined-column"))].forEach(e=>{const t=Array.from(e.childNodes);if(t.filter(c_).length<2)return;const n=document.createDocumentFragment();let r=0;for(;r<t.length;){const e=t[r];if(!c_(e)){n.appendChild(e),r++;continue}const o=document.createElement("span");for(o.className="taxonomy-term-group",o.appendChild(e),r++;r<t.length&&!c_(t[r]);)o.appendChild(t[r]),r++;n.appendChild(o)}e.appendChild(n)}),t.outerHTML},f_=e=>{const t=e.trim();if(!t||!t.includes("combined-column"))return[];const n=document.createElement("template");n.innerHTML=s_(t);const r=Array.from(n.content.querySelectorAll(".combined-column-block"));return(r.length>0?r:Array.from(n.content.querySelectorAll(".combined-column"))).map(d_).filter(Boolean)},h_=e=>f_(e).length>0,p_=e=>"number"==typeof e||"string"==typeof e&&e.endsWith("px"),g_=e=>{const t=new Set,n=[];return e.forEach(e=>{t.has(e.id)||(t.add(e.id),n.push(e))}),n},m_=e=>{var t;return!(!1===e.visible||null!==(t=e.responsive)&&void 0!==t&&t.never)},v_=({columnsToMeasure:e,htmlColumnIds:t,htmlMeasureCandidates:n,textMeasureContent:r,pixelColumnIds:o,contentLineColumnIds:i,suppressContentLineHeaders:l=!1,mode:s,constrainedWidth:a})=>{const u=document.createElement("table");u.className=`data-table measurement-table measurement-table--${s}`,u.style.cssText="legacyFit"===s?"table-layout: auto; width: 100%; max-width: 100%;":"table-layout: auto; width: auto; max-width: none;";const c=document.createElement("thead"),d=document.createElement("tr");e.forEach(e=>{const t=document.createElement("th"),n=l_(e.id),r=l&&i.has(e.id),o=r?"":String(e.header||""),s=!1!==e.sortable&&!r;if(t.className=["table-header-cell",n].filter(Boolean).join(" "),t.setAttribute("data-column-id",e.id),s){const e=document.createElement("div");e.className="table-header-cell-wrapper";const n=document.createElement("div");n.className="table-header-content clickable";const r=document.createElement("span");r.className="table-header-label",r.textContent=o,n.appendChild(r);const i=document.createElement("div");i.className="header-menu";const l=document.createElement("button");l.type="button",l.className="header-menu-trigger header-menu-trigger-indicator-only",l.tabIndex=-1,l.setAttribute("aria-hidden","true"),l.appendChild((()=>{const e=document.createElementNS(e_,"svg");return e.setAttribute("width","14"),e.setAttribute("height","14"),e.setAttribute("viewBox","0 0 14 14"),e.setAttribute("fill","none"),e.setAttribute("class","header-menu-icon header-menu-icon-none"),e.setAttribute("aria-hidden","true"),[{x:"1",y:"2.75",width:"12"},{x:"3",y:"6.25",width:"8"},{x:"5",y:"9.75",width:"4"}].forEach(t=>{const n=document.createElementNS(e_,"rect");n.setAttribute("x",t.x),n.setAttribute("y",t.y),n.setAttribute("width",t.width),n.setAttribute("height","1.5"),n.setAttribute("rx","0.75"),n.setAttribute("fill","currentColor"),e.appendChild(n)}),e})()),i.appendChild(l),e.appendChild(n),e.appendChild(i),t.appendChild(e)}else t.textContent=o;d.appendChild(t)}),c.appendChild(d),u.appendChild(c);const f=document.createElement("tbody"),h=e.reduce((e,r)=>{var o;if(!t.has(r.id))return e;const i=(null===(o=n[r.id])||void 0===o?void 0:o.length)||1;return Math.max(e,i)},1);for(let i=0;i<h;i++){const l=document.createElement("tr");l.className="table-row measurement-row",e.forEach(e=>{var a;const u=document.createElement("td"),c=l_(e.id);u.className=["table-cell",c].filter(Boolean).join(" "),u.setAttribute("data-column-id",e.id);const d=document.createElement("div");if(d.className="cell-content","responsiveFit"!==s&&o.has(e.id)&&"button"!==e.dataType){var f;let t=0;"image"===e.dataType&&null!==(f=e.imageSize)&&void 0!==f&&f.width?t=e.imageSize.width:"number"==typeof e.width?t=e.width:"string"==typeof e.width&&e.width.endsWith("px")&&(t=parseFloat(e.width.slice(0,-2)));const n=document.createElement("div");n.style.cssText=`width: ${t}px; height: ${t}px; display: inline-block;`,d.appendChild(n)}else if("responsiveFit"===s&&"image"===e.dataType&&null!==(a=e.imageSize)&&void 0!==a&&a.width){var h;const t=document.createElement("div");t.style.cssText=`width: ${e.imageSize.width}px; height: ${null!==(h=e.imageSize.height)&&void 0!==h?h:e.imageSize.width}px; display: inline-block;`,d.appendChild(t)}else if(t.has(e.id)){var p,g;const t=n[e.id]||[],r=null!==(p=null!==(g=t[i])&&void 0!==g?g:t[0])&&void 0!==p?p:"";d.innerHTML=s_(r)}else d.textContent=r[e.id]||"";u.appendChild(d),l.appendChild(u)}),f.appendChild(l)}if(u.appendChild(f),"legacyFit"===s){const e=document.createElement("div");return e.style.cssText=`width: ${null!=a?a:0}px; max-width: ${null!=a?a:0}px;`,e.appendChild(u),{hostNode:e,table:u}}return{hostNode:u,table:u}},y_=(e,t)=>{const n={},r={},o=new Set,i=e.querySelectorAll("th[data-column-id]"),l=e.querySelectorAll("td[data-column-id]");i.forEach(e=>{const t=e.getAttribute("data-column-id");if(!t)return;const o=e.getBoundingClientRect().width;r[t]=Math.max(r[t]||0,(e=>{const t=getComputedStyle(e),n=n_(t.paddingLeft)+n_(t.paddingRight),r=e.querySelector(".table-header-cell-wrapper"),o=(e=>{const t=e.textContent||"";if(0===t.trim().length)return 0;const n=document.createElement("span"),r=getComputedStyle(e);n.textContent=t,n.style.position="absolute",n.style.visibility="hidden",n.style.pointerEvents="none",n.style.whiteSpace="nowrap",n.style.overflowWrap="normal",n.style.wordBreak="normal",n.style.display="inline-block",n.style.width="auto",n.style.maxWidth="none",n.style.font=r.font,n.style.letterSpacing=r.letterSpacing,n.style.textTransform=r.textTransform,document.body.appendChild(n);const o=n.getBoundingClientRect().width;return n.remove(),o})((r||e).querySelector(".table-header-label")||e);if(o<=0)return 0;const i=null==r?void 0:r.querySelector(".header-menu"),l=null==r?void 0:r.querySelector(".header-menu-trigger"),s=Math.max((null==i?void 0:i.getBoundingClientRect().width)||0,(null==l?void 0:l.getBoundingClientRect().width)||0),a=r?getComputedStyle(r):null,u=r&&s>0?n_((null==a?void 0:a.columnGap)||(null==a?void 0:a.gap)||"0"):0;return Math.ceil(o+s+u+n)})(e)),n[t]=Math.max(n[t]||0,o)}),l.forEach(e=>{const r=e.getAttribute("data-column-id");if(!r)return;if("responsiveFit"===t)return;if("natural"===t){const t=(e=>{const t=e.getBoundingClientRect();if(t.width<=0)return{requiredWidth:0,shouldAvoidExpansion:!1};let n=t.left,r=t.right;e.querySelectorAll("*").forEach(e=>{const t=getComputedStyle(e);if("none"===t.display||"hidden"===t.visibility)return;const o=e.getBoundingClientRect();o.width<=0||o.height<=0||(n=Math.min(n,o.left),r=Math.max(r,o.right))});const o=Math.max(0,t.left-n),i=Math.max(0,r-t.right),l=t_(e),s=null!==e.querySelector("button, a.button"),a=null!==e.querySelector('.multi-cart-check, .wpt-multi-checkbox, input[type="checkbox"]');return{requiredWidth:t.width+o+i+l,shouldAvoidExpansion:s&&a}})(e),i=t.requiredWidth;return n[r]=Math.max(n[r]||0,i),void(t.shouldAvoidExpansion&&o.add(r))}const i=e.getBoundingClientRect().width;n[r]=Math.max(n[r]||0,i)});let s=24;if("natural"===t){const e=l[0];if(e){const t=getComputedStyle(e);s=(parseFloat(t.paddingLeft)||0)+(parseFloat(t.paddingRight)||0)}}const a=e.offsetWidth,u=Object.values(n).reduce((e,t)=>e+t,0),c=Math.max(0,a-u);return{widths:n,headerIntrinsicWidths:r,cellPadding:s,borderOverhead:c,noExpandColumnIds:o}};function b_(e,t,n,r){const[o,i]=yt({}),[l,s]=yt({}),[a,u]=yt({}),[c,d]=yt({}),[f,h]=yt(24),[p,g]=yt(0),[m,v]=yt(!1),[y,b]=yt(new Set),w=St(0),_=Ct(()=>{const t=new Set;return e.forEach(e=>{"button"===e.dataType&&t.add(e.id)}),t},[e]),S=St(!1),x=St({}),C=St({}),E=Ct(()=>e.map(e=>{var t,n,r;return`${e.id}:${null!==(t=e.width)&&void 0!==t?t:"auto"}:${null!==(n=null===(r=e.imageSize)||void 0===r?void 0:r.width)&&void 0!==n?n:""}`}).join("|"),[e]),I=Ct(()=>r<=0?0:Math.max(10,10*Math.round(r/10)),[r]),R=St(E);return _t(()=>{E!==R.current&&(S.current=!1,x.current={},C.current={},i({}),s({}),u({}),d({}),b(new Set),v(!1),R.current=E)},[E]),_t(()=>{if(0===t.length)return void v(!0);if(!n.current||0===r||0===I)return;const o=`${E}:${I}`,l=x.current[o],a=C.current[o],c=!S.current;if(!c&&l&&a)return u(l),d(a),void v(!0);c&&v(!1);const f=e.filter(e=>{const t=e.width;return!t||"auto"===t||!p_(t)&&!(e=>"string"==typeof e&&e.endsWith("%"))(t)}),p=e.filter(e=>p_(e.width)),m=e.filter(m_),y=g_([...f,...p]),_=g_([...y,...m]),R=new Set(p.map(e=>e.id));if(0===y.length&&0===m.length){c&&(i({}),s({}),b(new Set),S.current=!0);const e=l||{};return l||(x.current[o]=e),a||(C.current[o]=e),u(e),d(a||e),void v(!0)}const k={},P={},O=new Set,M=new Set(_.filter(e=>"html"===e.dataType||"button"===e.dataType).map(e=>e.id));_.forEach(e=>{const n=e.accessor||e.id;if(M.has(e.id)){const o=[];t.forEach(e=>{const t=(e=>null==e?null:o_(e)?(e=>{var t;if(!o_(e)||0===e.items.length)return null;const n=String(null!==(t=e.separator)&&void 0!==t?t:", ").replace(/\s+$/,"");return e.items.map((t,r)=>{var o;const i=(e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"))(String(null!==(o=t.name)&&void 0!==o?o:""));return i?`<span class="taxonomy-term-group"><span>${i}</span>${r===e.items.length-1?"":`<span class="taxonomy-separator">${s_(n)}</span> `}</span>`:""}).join("")})(e):"object"==typeof e?null:String(e))(e[n]);null!==t&&o.push(t)});const i="combined-column"===(null===(r=e.metadata)||void 0===r?void 0:r.measurement)||o.some(h_),l=i?(e=>{const t=new Map;return e.forEach(e=>{f_(e).forEach(e=>{a_(t,e)})}),u_(t)})(o):[],s=l.length>0?l:(e=>{const t=new Map;return e.forEach(e=>{a_(t,e)}),u_(t)})(o);return i&&O.add(e.id),void(P[e.id]=s.length>0?s:[i?"":String(e.header||"Column")])}var r;let o=0,i="";const l=String(e.header||"");l.length>o&&(o=l.length,i=l),t.forEach(e=>{const t=(e=>{if(null==e)return"";if(o_(e)){var t;const n=r_(String(null!==(t=e.separator)&&void 0!==t?t:", ")).replace(/\s+$/,""),r=n?`${n} `:" ";return e.items.map(e=>{var t;return String(null!==(t=e.name)&&void 0!==t?t:"")}).filter(Boolean).join(r)}return"object"==typeof e?"[object]":r_(String(e))})(e[n]);t.length>o&&(o=t.length,i=t)}),k[e.id]=i||e.header||"Column"});const T=document.createElement("div");T.style.cssText="position: absolute; visibility: hidden; pointer-events: none; z-index: -1000; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clear: both;",T.className="barn2-dataview measurement-wrapper";let A=null;if(c&&y.length>0){const e=v_({columnsToMeasure:y,htmlColumnIds:M,htmlMeasureCandidates:P,textMeasureContent:k,pixelColumnIds:R,contentLineColumnIds:O,mode:"natural"});A=e.table,T.appendChild(e.hostNode)}let F=null;if(!l&&y.length>0){const e=v_({columnsToMeasure:y,htmlColumnIds:M,htmlMeasureCandidates:P,textMeasureContent:k,pixelColumnIds:R,contentLineColumnIds:O,mode:"legacyFit",constrainedWidth:I});F=e.table,T.appendChild(e.hostNode)}let N=null;if(!a&&m.length>0){const e=v_({columnsToMeasure:m,htmlColumnIds:M,htmlMeasureCandidates:P,textMeasureContent:k,pixelColumnIds:R,contentLineColumnIds:O,mode:"responsiveFit"});N=e.table,T.appendChild(e.hostNode)}const z=++w.current;return n.current.appendChild(T),requestAnimationFrame(()=>{if(z===w.current)try{if(c){if(A){const e=y_(A,"natural");i(e.widths),s(e.headerIntrinsicWidths),b(e.noExpandColumnIds),h(e.cellPadding),g(e.borderOverhead)}else i({}),s({}),b(new Set);S.current=!0}let e=l||{};l||(F&&(e=y_(F,"legacyFit").widths),x.current[o]=e);let t=a||e;a||(N&&(t=((e,t)=>{const n={...e.headerIntrinsicWidths};return t.forEach(t=>{if("image"!==t.dataType&&"button"!==t.dataType)return;const r=e.widths[t.id]||0;r>0&&(n[t.id]=Math.max(n[t.id]||0,r))}),n})(y_(N,"responsiveFit"),m)),C.current[o]=t),!l&&O.size>0&&Object.keys(e).length>0&&(e=((e,t,n)=>{const r={...e};let o=0;if(t.forEach(e=>{r[e]>0&&(r[e]+=48,o+=48)}),o<=0)return r;const i=Object.keys(r).filter(e=>!t.has(e)&&!n.has(e)&&r[e]>50);let l=o;for(;l>.01&&i.length>0;){const e=i.map(e=>({columnId:e,capacity:Math.max(0,r[e]-50)})),t=e.reduce((e,t)=>e+t.capacity,0);if(t<=0)break;let n=0;if(e.forEach(({columnId:e,capacity:o})=>{if(o<=0)return;const i=Math.min(o,l*o/t);r[e]-=i,n+=i}),n<=0)break;l-=n}return r})(e,O,R),x.current[o]=e),u(e),d(t)}catch{const e=l||{},t=a||e;c&&(S.current=!0),x.current[o]=e,C.current[o]=t,u(e),d(t)}finally{T.remove(),v(!0)}else T.remove()}),()=>{T.parentNode&&T.remove()}},[e,t,n,r,I,E,o]),{naturalWidths:o,headerIntrinsicWidths:l,legacyFitWidths:a,responsiveFitWidths:c,cellPadding:f,borderOverhead:p,ready:m,noExpandColumnIds:Ct(()=>0===_.size?y:0===y.size?_:new Set([...y,..._]),[y,_])}}const w_=50;function S_(e,t,n,r,o=24,i=0){const l=t-i,s=Et(e=>{var t;if("image"===e.dataType&&null!==(t=e.imageSize)&&void 0!==t&&t.width)return{type:"pixel",value:e.imageSize.width+o};const n=e.width;return n&&"auto"!==n?"number"==typeof n?{type:"pixel",value:n}:"string"==typeof n&&n.endsWith("%")?{type:"percentage",value:parseFloat(n.slice(0,-1))}:"string"==typeof n&&n.endsWith("px")?{type:"pixel",value:parseFloat(n.slice(0,-2))}:{type:"auto",value:0}:{type:"auto",value:0}},[o]),a=Et(e=>Math.max(0,(null==n?void 0:n[e])||0),[n]),u=Et(e=>Math.max(w_,a(e)),[a]),c=Et(e=>Math.min(u(e),120),[u]),d=Et(e=>!("__responsive_control__"===e.id||null!=r&&r.has(e.id))&&"button"!==e.dataType&&"image"!==e.dataType,[r]),f=Et(e=>"__responsive_control__"!==e.id,[]),h=Et(e=>{if("__responsive_control__"===e.id)return e.parsedWidth.value||w_;if("button"===e.dataType||"image"===e.dataType||null!=r&&r.has(e.id)){const t=a(e.id);return t>0&&"pixel"===e.parsedWidth.type?Math.min(e.parsedWidth.value,t):"pixel"===e.parsedWidth.type?e.parsedWidth.value:w_}return w_},[a,r]),p=Et((e,t)=>{const n={};if(0===e.length||t<=0)return n;const r=e.map(e=>({id:e.id,weight:u(e.id)})),o=r.reduce((e,t)=>e+t.weight,0);return r.forEach(r=>{n[r.id]=o>0?t*r.weight/o:t/e.length}),n},[u]),g=Et((e,t)=>{const n={};if(0===e.length||t<=0)return n;const r=e.map(e=>({id:e.id,minimum:c(e.id),weight:u(e.id)})),o=r.reduce((e,t)=>e+t.minimum,0);if(o>=t){const o=r.reduce((e,t)=>e+t.minimum,0);return r.forEach(r=>{n[r.id]=o>0?t*r.minimum/o:t/e.length}),n}r.forEach(e=>{n[e.id]=e.minimum});const i=t-o,l=r.reduce((e,t)=>e+t.weight,0);return r.forEach(t=>{const r=l>0?t.weight/l:1/e.length;n[t.id]+=i*r}),n},[c,u]),m=Et((e,t,n)=>{const r=e.reduce((e,n)=>e+(t[n.id]||0),0);if(r<=n+.5)return t;const o={...t};let i=r-n,l=e.filter(f).map(e=>({id:e.id,capacity:Math.max(0,(o[e.id]||0)-h(e))})).filter(e=>e.capacity>0);for(;i>.5&&l.length>0;){const e=l.reduce((e,t)=>e+t.capacity,0);if(e<=0)break;let t=0;if(l=l.map(n=>{const r=Math.min(n.capacity,i*n.capacity/e);return o[n.id]-=r,t+=r,{...n,capacity:n.capacity-r}}).filter(e=>e.capacity>.5),t<=0)break;i-=t}return o},[f,h]),v=Et((e,t,n)=>{const r=e.reduce((e,n)=>e+(t[n.id]||0),0);if(r<=0||Math.abs(r-n)<=.5)return t;const o={...t};if(r<n){const t=e.filter(d);if(0===t.length)return o;const i=n-r,l=t.reduce((e,t)=>e+Math.max(w_,o[t.id]||0),0);return t.forEach(e=>{const n=Math.max(w_,o[e.id]||0),r=l>0?n/l:1/t.length;o[e.id]=(o[e.id]||0)+i*r}),o}return m(e,o,n)},[d,m]),y=Et(t=>{if(!t||0===e.length)return{};const n=e.map(e=>({...e,parsedWidth:s(e)})),r=n.some(e=>"percentage"===e.parsedWidth.type),o=n.some(e=>"pixel"===e.parsedWidth.type),i=n.filter(e=>"auto"===e.parsedWidth.type),l=n.filter(e=>"pixel"===e.parsedWidth.type),a=n.filter(e=>"percentage"===e.parsedWidth.type),u=a.reduce((e,t)=>e+t.parsedWidth.value,0);if(!r&&!o)return p(n,t);if(r){const e={};let r=0;l.forEach(t=>{e[t.id]=t.parsedWidth.value,r+=t.parsedWidth.value});const s=i.reduce((e,t)=>e+c(t.id),0),d=l.reduce((e,t)=>e+h(t),0),f=t*u/100,p=Math.max(0,t-d-s);let y=f;if(o||0!==i.length?f>p&&(y=p):y=t,u>0&&a.forEach(t=>{e[t.id]=y*t.parsedWidth.value/u}),l.length>0){const n=Math.max(0,t-y-s);r>n&&Object.assign(e,m(l,e,n))}if(i.length>0){const n=Math.max(0,t-Object.values(e).reduce((e,t)=>e+t,0)),r=g(i,n);Object.assign(e,r)}return v(n,e,t)}if(o){const e={};let r=0;if(l.forEach(t=>{e[t.id]=t.parsedWidth.value,r+=t.parsedWidth.value}),i.length>0){const n=Math.max(0,t-r),o=g(i,n);Object.assign(e,o)}return v(n,e,t)}return{}},[e,s,p,c,g,v]);return{widths:Ct(()=>y(l),[l,y]),tableWidth:l}}const x_={desktop:1/0,"tablet-l":1024,"tablet-p":768,"mobile-l":480,"mobile-p":320},C_=(e,t)=>{const n=Object.entries(t).sort((e,t)=>e[1]-t[1]);for(const[t,r]of n)if(e<=r)return t;return"desktop"},E_=e=>e.trim().toLowerCase().replace(/_/g,"-"),I_=e=>e?(e=>{const t=[];for(const n of e){const e=n.match(/^not-(.+)$/),r=n.match(/^min-(.+)$/),o=n.match(/^max-(.+)$/);if(e){const r=e[1];"tablet"===r?t.push("not-tablet-l","not-tablet-p"):"mobile"===r?t.push("not-mobile-l","not-mobile-p"):t.push(n)}else if(r){const e=r[1];"tablet"===e?t.push("min-tablet-p"):"mobile"===e?t.push("min-mobile-p"):t.push(n)}else if(o){const e=o[1];"tablet"===e?t.push("max-tablet-l"):"mobile"===e?t.push("max-mobile-l"):t.push(n)}else"tablet"===n?t.push("tablet-l","tablet-p"):"mobile"===n?t.push("mobile-l","mobile-p"):t.push(n)}return t})((Array.isArray(e)?e.flatMap(e=>String(e).split(/[\s,]+/)):e.split(/[\s,]+/)).map(E_).filter(Boolean).filter(e=>"default"!==e)):[],R_=(e,t,n)=>{if(0===e.length)return null;if(e.includes("never"))return"never";if(e.includes("all"))return!0;if(e.includes("none"))return!1;const r=(e=>Object.entries(e).sort((e,t)=>e[1]-t[1]).map(([e])=>e))(n),o=r.indexOf(t);for(const n of e)if(n.startsWith("not-")&&n.slice(4)===t)return!1;for(const t of e)if(t.startsWith("min-")){const e=t.slice(4);if(o>=r.indexOf(e))return!0}for(const t of e)if(t.startsWith("max-")){const e=t.slice(4);if(o<=r.indexOf(e))return!0}return!!e.some(e=>r.includes(e)&&e===t)||!e.some(e=>r.includes(e)||e.startsWith("not-")||e.startsWith("min-")||e.startsWith("max-"))},k_=(e,t,n,r,o=100)=>{const i=r[e];if(i&&i>0)return i;const l=t.width;if("number"==typeof l||"string"==typeof l&&(l.endsWith("px")||l.endsWith("%")))return o;const s=n[e];return s&&s>0?Math.max(s,o):o},P_=(e,t,n,r,o,i={})=>{const l=new Set,s=new Set,a=new Set,u=[];for(const n of e){var c,d;if(null!==(c=n.responsive)&&void 0!==c&&c.never){a.add(n.id);continue}const e=I_(null===(d=n.responsive)||void 0===d?void 0:d.breakpoints),r=R_(e,t,o);"never"===r?a.add(n.id):null===r?u.push(n):!0===r?l.add(n.id):s.add(n.id)}if(u.length>0){let t=0;for(const n of l){const o=e.find(e=>e.id===n);t+=o?k_(n,o,r,i,100):i[n]||r[n]||100}const o=((e,t,n,r={})=>{const o=(e=>e.map(e=>{var t,n;return{...e,priority:null!==(t=null===(n=e.column.responsive)||void 0===n?void 0:n.priority)&&void 0!==t?t:1e4+e.index}}).sort((e,t)=>e.priority!==t.priority?e.priority-t.priority:e.index-t.index))(e.map((e,t)=>({column:e,index:t}))),i=new Set;let l=0;for(const{column:e}of o){const o=k_(e.id,e,n,r,100);if(!(l+o<=t))break;i.add(e.id),l+=o}return 0===i.size&&o.length>0&&i.add(o[0].column.id),i})(u,n-t,r,i);for(const e of u)o.has(e.id)?l.add(e.id):s.add(e.id)}return{visibleColumns:l,hiddenColumns:s,neverColumns:a}},O_=()=>"undefined"==typeof window?1024:window.innerWidth||document.documentElement.clientWidth,M_=(e,t)=>{const n="undefined"==typeof window?"":window.location.hash.replace(/^#/,""),r=new URLSearchParams(n);r.delete("page"),r.set(`_${e}`,String(t));const o=r.toString();return"undefined"==typeof window?o?`#${o}`:"#":`${window.location.pathname}${window.location.search}${o?`#${o}`:""}`},T_=e=>{if(!e)return[];const t=String(e);return t.includes(", ")?t.split(", ").map(e=>e.trim()):t.includes(",")?t.split(",").map(e=>e.trim()):t.includes(" | ")?t.split(" | ").map(e=>e.trim()):t.includes("|")?t.split("|").map(e=>e.trim()):t.includes("; ")?t.split("; ").map(e=>e.trim()):t.includes(";")?t.split(";").map(e=>e.trim()):[t.trim()]},A_=({value:e,filterOptions:t,filterId:n,onFilterClick:r,valueParser:o,currentFilterValue:i})=>{const{i18n:l}=si(),s=Ct(()=>(o||T_)(e),[e,o]),a=Ct(()=>(e=>{const t=[],n=e=>{e.forEach(e=>{t.push(e),e.children&&n(e.children)})};return n(e),t})(t),[t]),u=Ct(()=>{const e=new Map;return a.forEach(t=>{e.set(t.label.toLowerCase(),t.value)}),e},[a]),c=Ct(()=>{if(!i)return new Set;const e=Array.isArray(i)?i:[i];return new Set(e)},[i]),d=e=>{const t=e.toLowerCase(),n=u.get(t);return void 0!==n?n:null},f=e=>c.has(e);if(1===s.length){const e=s[0],t=d(e);return null===t||f(t)?Wo(Ae,{children:e}):Wo("a",{href:M_(n,t),className:"clickable-filter-term",onClick:e=>{e.preventDefault(),r(t)},"aria-label":l.filterByTerm({term:e}),children:e})}return Wo(Ae,{children:s.map((e,t)=>{const o=d(e),i=t===s.length-1;return Wo(Ae,null!==o?f(o)?{children:[Wo("span",{children:e}),!i&&Wo("span",{children:", "})]}:{children:[Wo("a",{href:M_(n,o),className:"clickable-filter-term",onClick:e=>{e.preventDefault(),r(o)},"aria-label":l.filterByTerm({term:e}),children:e}),!i&&Wo("span",{children:", "})]}:{children:[Wo("span",{children:e}),!i&&Wo("span",{children:", "})]},t)})})},F_="carousel",N_="controller",z_="portal",D_="toolbar",L_="fullscreen",V_="thumbnails",$_="loading",j_="error",W_="complete",H_="flex_center",B_="no_scroll_padding",U_="slide",q_="prev",G_="next",Z_="swipe",K_="close",J_="onPointerDown",X_="onPointerMove",Y_="onPointerUp",Q_="onPointerLeave",eS="onPointerCancel",tS="onKeyDown",nS="onWheel",rS="icon",oS="contain",iS="cover",lS="yarl__";function sS(...e){return e.filter(Boolean).join(" ")}function aS(e){return`${lS}${e}`}function uS(e){return`--${lS}${e}`}function cS(e,t){return`${e}${t?`_${t}`:""}`}function dS(e){return t=>cS(e,t)}function fS(e,t){var n;return null!==(n=null==e?void 0:e[t])&&void 0!==n?n:t}function hS(e,t,n){return fS(e,"{index} of {total}").replace(/\{index}/g,`${_S(n,t.length)+1}`).replace(/\{total}/g,`${t.length}`)}function pS(...e){return()=>{e.forEach(e=>{e()})}}function gS(e,t,n){return()=>{const r=It(n);if(!r)throw new Error(`${e} must be used within a ${t}.Provider`);return r}}function mS(){return"undefined"!=typeof window}function vS(e){return void 0===e.type||"image"===e.type}function yS(e){return"string"==typeof e?Number.parseInt(e,10):e}function bS(e){if("number"==typeof e)return{pixel:e};if("string"==typeof e){const t=yS(e);return e.endsWith("%")?{percent:t}:{pixel:t}}return{pixel:0}}function wS(e,t){const n=bS(t),r=void 0!==n.percent?e.width/100*n.percent:n.pixel;return{width:Math.max(e.width-2*r,0),height:Math.max(e.height-2*r,0)}}function _S(e,t){return t>0?(e%t+t)%t:0}function SS(e){return e.length>0}function xS(e,t){return e[_S(t,e.length)]}function CS(e,t){return SS(e)?xS(e,t):void 0}function ES(e){return vS(e)?e.src:void 0}function IS(e,t,n){if(!n)return e;const{buttons:r,...o}=e,i=r.findIndex(e=>e===t),l=kn(n)?Mn(n,{key:t},null):n;if(i>=0){const e=[...r];return e.splice(i,1,l),{buttons:e,...o}}return{buttons:[l,...r],...o}}const RS=Number(In.split(".")[0])>=19,kS={open:!1,close:()=>{},index:0,slides:[],render:{},plugins:[],toolbar:{buttons:[K_]},labels:{},animation:{fade:250,swipe:500,easing:{fade:"ease",swipe:"ease-out",navigation:"ease-in-out"}},carousel:{finite:!1,preload:2,padding:"16px",spacing:"30%",imageFit:oS,imageProps:{}},controller:{ref:null,focus:!0,aria:!1,touchAction:"none",closeOnPullUp:!1,closeOnPullDown:!1,closeOnBackdropClick:!1,closeOnEscape:!0,preventDefaultWheelX:!0,preventDefaultWheelY:!1,disableSwipeNavigation:!1},portal:{},noScroll:{disabled:!1},on:{},styles:{},className:""};function PS(e,t){return{name:e,component:t}}function OS(e,t){return{module:e,children:t}}function MS(e,t,n){return e.module.name===t?n(e):e.children?[OS(e.module,e.children.flatMap(e=>{var r;return null!==(r=MS(e,t,n))&&void 0!==r?r:[]}))]:[e]}function TS(e,t,n){return e.flatMap(e=>{var r;return null!==(r=MS(e,t,n))&&void 0!==r?r:[]})}const AS=rt(null),FS=gS("useA11yContext","A11yContext",AS);function NS({children:e}){const[t,n]=yt(!1),[r,o]=yt(!1),i=Ct(()=>({focusWithin:t,trackFocusWithin:(e,t)=>{const r=r=>o=>{var i;o.currentTarget.contains(o.relatedTarget)||n(r),null===(i=r?e:t)||void 0===i||i(o)};return{onFocus:r(!0),onBlur:r(!1)}},autoPlaying:r,setAutoPlaying:o}),[t,r]);return Oe(AS.Provider,{value:i},e)}const zS=rt(null),DS=gS("useDocument","DocumentContext",zS);function LS({nodeRef:e,children:t}){const n=Ct(()=>{const t=t=>{var n;return(null===(n=t||e.current)||void 0===n?void 0:n.ownerDocument)||document};return{getOwnerDocument:t,getOwnerWindow:e=>{var n;return(null===(n=t(e))||void 0===n?void 0:n.defaultView)||window}}},[e]);return Oe(zS.Provider,{value:n},t)}const VS=rt(null),$S=gS("useEvents","EventsContext",VS);function jS({children:e}){const[t]=yt({});wt(()=>()=>{Object.keys(t).forEach(e=>delete t[e])},[t]);const n=Ct(()=>{const e=(e,n)=>{var r;null===(r=t[e])||void 0===r||r.splice(0,t[e].length,...t[e].filter(e=>e!==n))};return{publish:(...[e,n])=>{var r;null===(r=t[e])||void 0===r||r.forEach(e=>e(n))},subscribe:(n,r)=>(t[n]||(t[n]=[]),t[n].push(r),()=>e(n,r)),unsubscribe:e}},[t]);return Oe(VS.Provider,{value:n},e)}const WS=rt(null),HS=gS("useLightboxProps","LightboxPropsContext",WS);function BS({children:e,...t}){return Oe(WS.Provider,{value:t},e)}const US=rt(null),qS=gS("useLightboxState","LightboxStateContext",US),GS=rt(null),ZS=gS("useLightboxDispatch","LightboxDispatchContext",GS);function KS(e,t){switch(t.type){case"swipe":{const{slides:n}=e,r=(null==t?void 0:t.increment)||0,o=e.globalIndex+r,i=_S(o,n.length);return{slides:n,currentIndex:i,globalIndex:o,currentSlide:CS(n,i),animation:r||void 0!==t.duration?{increment:r,duration:t.duration,easing:t.easing}:void 0}}case"update":return t.slides!==e.slides||t.index!==e.currentIndex?{slides:t.slides,currentIndex:t.index,globalIndex:t.index,currentSlide:CS(t.slides,t.index)}:e;default:throw new Error("Unknown action type")}}function JS({slides:e,index:t,children:n}){const[r,o]=bt(KS,{slides:e,currentIndex:t,globalIndex:t,currentSlide:CS(e,t)}),[i,l]=yt(e),[s,a]=yt(t);e===i&&t===s||(l(e),a(t),o({type:"update",slides:e,index:t}));const u=Ct(()=>({...r,state:r,dispatch:o}),[r,o]);return Oe(GS.Provider,{value:o},Oe(US.Provider,{value:u},n))}const XS=rt(null),YS=gS("useRTLContext","RTLContext",XS);function QS({isRTL:e,children:t}){const n=Ct(()=>({isRTL:e}),[e]);return Oe(XS.Provider,{value:n},t)}const ex=rt(null),tx=gS("useTimeouts","TimeoutsContext",ex);function nx({children:e}){const[t]=yt([]);wt(()=>()=>{t.forEach(e=>window.clearTimeout(e)),t.splice(0,t.length)},[t]);const n=Ct(()=>{const e=e=>{t.splice(0,t.length,...t.filter(t=>t!==e))};return{setTimeout:(n,r)=>{const o=window.setTimeout(()=>{e(o),n()},r);return t.push(o),o},clearTimeout:t=>{void 0!==t&&(e(t),window.clearTimeout(t))}}},[t]);return Oe(ex.Provider,{value:n},e)}const rx=Zt(function({label:e,className:t,icon:n,renderIcon:r,onClick:o,style:i,...l},s){const{styles:a,labels:u}=HS(),c=fS(u,e);return Oe("button",{ref:s,type:"button",title:c,"aria-label":c,className:sS(aS("button"),t),onClick:o,style:{...i,...a.button},...l},r?r():Oe(n,{className:aS(rS),style:a.icon}))});function ox(e,t){return function(e,t){const n=e=>Oe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",...e},t);return n.displayName=e,n}(e,Oe("g",{fill:"currentColor"},Oe("path",{d:"M0 0h24v24H0z",fill:"none"}),t))}const ix=ox("Close",Oe("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),lx=ox("Previous",Oe("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),sx=ox("Next",Oe("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),ax=ox("Loading",Oe(Ae,null,Array.from({length:8}).map((e,t,n)=>Oe("line",{key:t,x1:"12",y1:"6.5",x2:"12",y2:"1.8",strokeLinecap:"round",strokeWidth:"2.6",stroke:"currentColor",strokeOpacity:1/n.length*(t+1),transform:`rotate(${360/n.length*t}, 12, 12)`})))),ux=ox("Error",Oe("path",{d:"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z"})),cx=mS()?_t:wt;function dx(){const[e,t]=yt(!1);return wt(()=>{var e,n;const r=null===(e=window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-reduced-motion: reduce)");t(null==r?void 0:r.matches);const o=e=>t(e.matches);return null===(n=null==r?void 0:r.addEventListener)||void 0===n||n.call(r,"change",o),()=>{var e;return null===(e=null==r?void 0:r.removeEventListener)||void 0===e?void 0:e.call(r,"change",o)}},[]),e}function fx(e,t){const n=St(void 0),r=St(void 0),o=dx();return cx(()=>{var i,l,s;if(e.current&&void 0!==n.current&&!o){const{keyframes:o,duration:a,easing:u,onfinish:c}=t(n.current,e.current.getBoundingClientRect(),function(e){let t=0,n=0,r=0;const o=window.getComputedStyle(e).transform.match(/matrix.*\((.+)\)/);if(o){const e=o[1].split(",").map(yS);6===e.length?(t=e[4],n=e[5]):16===e.length&&(t=e[12],n=e[13],r=e[14])}return{x:t,y:n,z:r}}(e.current))||{};if(o&&a){null===(i=r.current)||void 0===i||i.cancel(),r.current=void 0;try{r.current=null===(s=(l=e.current).animate)||void 0===s?void 0:s.call(l,o,{duration:a,easing:u})}catch(e){console.error(e)}r.current&&(r.current.onfinish=()=>{r.current=void 0,null==c||c()})}}n.current=void 0}),{prepareAnimation:e=>{n.current=e},isAnimationPlaying:()=>{var e;return"running"===(null===(e=r.current)||void 0===e?void 0:e.playState)}}}function hx(){const e=St(null),t=St(void 0),[n,r]=yt(),o=Et(n=>{e.current=n,t.current&&(t.current.disconnect(),t.current=void 0);const o=()=>{if(n){const e=window.getComputedStyle(n),t=e=>parseFloat(e)||0;r({width:Math.round(n.clientWidth-t(e.paddingLeft)-t(e.paddingRight)),height:Math.round(n.clientHeight-t(e.paddingTop)-t(e.paddingBottom))})}else r(void 0)};o(),n&&"undefined"!=typeof ResizeObserver&&(t.current=new ResizeObserver(o),t.current.observe(n))},[]);return{setContainerRef:o,containerRef:e,containerRect:n}}function px(){const e=St(void 0),{setTimeout:t,clearTimeout:n}=tx();return Et((r,o)=>{n(e.current),e.current=t(r,o>0?o:0)},[t,n])}function gx(e){const t=St(e);return cx(()=>{t.current=e}),Et((...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)},[])}function mx(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function vx(e,t){return Ct(()=>null==e&&null==t?null:n=>{mx(e,n),mx(t,n)},[e,t])}function yx(e,t=!1){const n=St(!1);return cx(()=>{t&&n.current&&(n.current=!1,e())},[t,e]),{onFocus:Et(()=>{n.current=!0},[]),onBlur:Et(()=>{n.current=!1},[])}}function bx(){return YS().isRTL}function wx(e,t){const n=St(0),r=px(),o=gx((...t)=>{n.current=Date.now(),e(t)});return Et((...e)=>{r(()=>{o(e)},t-(Date.now()-n.current))},[t,o,r])}const Sx=dS("slide"),xx=dS("slide_image");function Cx({slide:e,offset:t,render:n,rect:r,imageFit:o,imageProps:i,onClick:l,onLoad:s,onError:a,style:u}){var c,d,f,h,p,g,m,v;const[y,b]=yt($_),{publish:w}=$S(),{setTimeout:_}=tx(),S=St(null);wt(()=>{0===t&&w((e=>`active-slide-${e}`)(y))},[t,y,w]);const x=gx(e=>{("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{e.parentNode&&(b(W_),_(()=>{null==s||s(e)},0))})}),C=Et(e=>{S.current=e,(null==e?void 0:e.complete)&&x(e)},[x]),E=Et(e=>{x(e.currentTarget)},[x]),I=gx(()=>{b(j_),null==a||a()}),R=function(e,t){return e.imageFit===iS||e.imageFit!==oS&&t===iS}(e,o),k=(e,t)=>Number.isFinite(e)?e:t,P=k(Math.max(...(null!==(d=null===(c=e.srcSet)||void 0===c?void 0:c.map(e=>e.width))&&void 0!==d?d:[]).concat(e.width?[e.width]:[]).filter(Boolean)),(null===(f=S.current)||void 0===f?void 0:f.naturalWidth)||0),O=k(Math.max(...(null!==(p=null===(h=e.srcSet)||void 0===h?void 0:h.map(e=>e.height))&&void 0!==p?p:[]).concat(e.height?[e.height]:[]).filter(Boolean)),(null===(g=S.current)||void 0===g?void 0:g.naturalHeight)||0),M=P&&O?{maxWidth:`min(${P}px, 100%)`,maxHeight:`min(${O}px, 100%)`}:{maxWidth:"100%",maxHeight:"100%"},T=null===(m=e.srcSet)||void 0===m?void 0:m.slice().sort((e,t)=>e.width-t.width).map(e=>`${e.src} ${e.width}w`).join(", "),A=T&&r&&mS()?`${Math.round(Math.min(r&&!R&&e.width&&e.height?r.height/e.height*e.width:Number.MAX_VALUE,r.width))}px`:void 0,{style:F,className:N,...z}=("function"==typeof i?i(e):i)||{};return Oe(Ae,null,Oe("img",{ref:C,onLoad:E,onError:I,onClick:l,draggable:!1,className:sS(aS(xx()),R&&aS(xx("cover")),y!==W_&&aS(xx("loading")),N),style:{...M,...u,...F},...z,alt:null!==(v=e.alt)&&void 0!==v?v:"",sizes:A,srcSet:T,src:e.src}),y!==W_&&Oe("div",{className:aS(Sx("placeholder"))},y===$_&&((null==n?void 0:n.iconLoading)?n.iconLoading():Oe(ax,{className:sS(aS(rS),aS(Sx($_)))})),y===j_&&((null==n?void 0:n.iconError)?n.iconError():Oe(ux,{className:sS(aS(rS),aS(Sx(j_)))}))))}const Ex=Zt(function({className:e,children:t,onFocus:n,onBlur:r,...o},i){const l=St(null),[s,a]=yt(!1),{trackFocusWithin:u}=FS();return wt(gx(()=>{if(l.current){const e="rtl"===window.getComputedStyle(l.current).direction;e!==s&&a(e)}})),Oe(LS,{nodeRef:l},Oe(QS,{isRTL:s},Oe("div",{ref:vx(i,l),className:sS(aS("root"),e),...u(n,r),...o},t)))});var Ix,Rx;!function(e){e[e.NONE=0]="NONE",e[e.SWIPE=1]="SWIPE",e[e.PULL=2]="PULL",e[e.ANIMATION=3]="ANIMATION"}(Ix||(Ix={})),function(e){e[e.NONE=0]="NONE",e[e.SWIPE=1]="SWIPE",e[e.PULL=2]="PULL"}(Rx||(Rx={}));const kx=dS("container"),Px=rt(null),Ox=gS("useController","ControllerContext",Px),Mx=PS(N_,function({children:e,...t}){var n;const{carousel:r,animation:o,controller:i,on:l,styles:s,render:a}=t,{closeOnPullUp:u,closeOnPullDown:c,preventDefaultWheelX:d,preventDefaultWheelY:f}=i,[h,p]=yt(),g=qS(),m=ZS(),[v,y]=yt(Ix.NONE),b=St(0),w=St(0),_=St(1),{registerSensors:S,subscribeSensors:x}=function(){const[e]=yt({}),t=Et((t,n)=>{var r;null===(r=e[t])||void 0===r||r.forEach(e=>{n.isPropagationStopped()||e(n)})},[e]);return{registerSensors:Ct(()=>({onPointerDown:e=>t(J_,e),onPointerMove:e=>t(X_,e),onPointerUp:e=>t(Y_,e),onPointerLeave:e=>t(Q_,e),onPointerCancel:e=>t(eS,e),onKeyDown:e=>t(tS,e),onKeyUp:e=>t("onKeyUp",e),onWheel:e=>t(nS,e)}),[t]),subscribeSensors:Et((t,n)=>(e[t]||(e[t]=[]),e[t].unshift(n),()=>{const r=e[t];r&&r.splice(0,r.length,...r.filter(e=>e!==n))}),[e])}}(),{subscribe:C,publish:E}=$S(),I=px(),R=px(),k=px(),{containerRef:P,setContainerRef:O,containerRect:M}=hx(),T=vx(function({preventDefaultWheelX:e,preventDefaultWheelY:t}){const n=St(null),r=gx(n=>{const r=Math.abs(n.deltaX)>Math.abs(n.deltaY);(r&&e||!r&&t||n.ctrlKey)&&n.preventDefault()});return Et(e=>{var t;e?e.addEventListener("wheel",r,{passive:!1}):null===(t=n.current)||void 0===t||t.removeEventListener("wheel",r),n.current=e},[r])}({preventDefaultWheelX:d,preventDefaultWheelY:f}),O),A=St(null),F=vx(A,void 0),{getOwnerDocument:N}=DS(),z=bx(),D=e=>(z?-1:1)*("number"==typeof e?e:1),L=gx(()=>{var e;return null===(e=P.current)||void 0===e?void 0:e.focus()}),V=gx(()=>t),$=gx(()=>g),j=Et(e=>E(q_,e),[E]),W=Et(e=>E(G_,e),[E]),H=Et(()=>E(K_),[E]),B=e=>!(r.finite&&(D(e)>0&&0===g.currentIndex||D(e)<0&&g.currentIndex===g.slides.length-1)),U=e=>{var t;b.current=e,null===(t=P.current)||void 0===t||t.style.setProperty(uS("swipe_offset"),`${Math.round(e)}px`)},q=e=>{var t,n;w.current=e,_.current=(()=>{const t=c&&e>0?e:u&&e<0?-e:0;return Math.min(Math.max(function(e,t=0){const n=10**t;return Math.round((e+Number.EPSILON)*n)/n}(1-t/60*.5,2),.5),1)})(),null===(t=P.current)||void 0===t||t.style.setProperty(uS("pull_offset"),`${Math.round(e)}px`),null===(n=P.current)||void 0===n||n.style.setProperty(uS("pull_opacity"),`${_.current}`)},{prepareAnimation:G}=fx(A,(e,t,n)=>{if(A.current&&M)return{keyframes:[{transform:`translate(0, ${e.rect.y-t.y+n.y}px)`,opacity:e.opacity},{transform:"translate(0, 0)",opacity:1}],duration:e.duration,easing:o.easing.fade}}),Z=(e,t)=>{if(u||c){q(e);let n=0;A.current&&(n=o.fade*(t?2:1),G({rect:A.current.getBoundingClientRect(),opacity:_.current,duration:n})),k(()=>{q(0),y(Ix.NONE)},n),y(Ix.ANIMATION),t||H()}},{prepareAnimation:K,isAnimationPlaying:J}=fx(A,(e,t,n)=>{var o;if(A.current&&M&&(null===(o=g.animation)||void 0===o?void 0:o.duration)){const o=bS(r.spacing),i=(o.percent?o.percent*M.width/100:o.pixel)||0;return{keyframes:[{transform:`translate(${D(g.globalIndex-e.index)*(M.width+i)+e.rect.x-t.x+n.x}px, 0)`},{transform:"translate(0, 0)"}],duration:g.animation.duration,easing:g.animation.easing}}}),X=gx(e=>{var t,n;const r=e.offset||0,i=r?o.swipe:null!==(t=o.navigation)&&void 0!==t?t:o.swipe,l=r||J()?o.easing.swipe:o.easing.navigation;let{direction:s}=e;const a=null!==(n=e.count)&&void 0!==n?n:1;let u=Ix.ANIMATION,c=i*a;if(!s){const t=null==M?void 0:M.width,n=e.duration||0,o=t?i/t*Math.abs(r):i;0!==a?(n<o?c=c/o*Math.max(n,o/5):t&&(c=i/t*(t-Math.abs(r))),s=D(r)>0?q_:G_):c=i/2}let d=0;s===q_?B(D(1))?d=-a:(u=Ix.NONE,c=i):s===G_&&(B(D(-1))?d=a:(u=Ix.NONE,c=i)),c=Math.round(c),R(()=>{U(0),y(Ix.NONE)},c),A.current&&K({rect:A.current.getBoundingClientRect(),index:g.globalIndex}),y(u),E(Z_,{type:"swipe",increment:d,duration:c,easing:l})});wt(()=>{var e,t;(null===(e=g.animation)||void 0===e?void 0:e.increment)&&(null===(t=g.animation)||void 0===t?void 0:t.duration)&&I(()=>m({type:"swipe",increment:0}),g.animation.duration)},[g.animation,m,I]);const Y=[x,B,(null==M?void 0:M.width)||0,o.swipe,()=>y(Ix.SWIPE),e=>U(e),(e,t)=>X({offset:e,duration:t,count:1}),e=>X({offset:e,count:0})],Q=[()=>{c&&y(Ix.PULL)},e=>q(e),e=>Z(e),e=>Z(e,!0)];(function({disableSwipeNavigation:e,closeOnBackdropClick:t},n,r,o,i,l,s,a,u,c,d,f,h,p,g,m){const v=St(0),y=St([]),b=St(void 0),w=St(0),_=St(Rx.NONE),S=Et(e=>{b.current===e.pointerId&&(b.current=void 0,_.current=Rx.NONE);const t=y.current;t.splice(0,t.length,...t.filter(t=>t.pointerId!==e.pointerId))},[]),x=Et(e=>{S(e),e.persist(),y.current.push(e)},[S]),C=Et(e=>y.current.find(({pointerId:t})=>e.pointerId===t),[]),E=gx(e=>{x(e)}),I=(e,t)=>d&&e>t||c&&e<-t,R=gx(e=>{const n=C(e);if(n)if(b.current===e.pointerId){const e=Date.now()-w.current,t=v.current;_.current===Rx.SWIPE?Math.abs(t)>.3*o||Math.abs(t)>5&&e<i?a(t,e):u(t):_.current===Rx.PULL&&(I(t,60)?p(t,e):g(t)),v.current=0,_.current=Rx.NONE}else{const{target:r}=e;t&&r instanceof HTMLElement&&r===n.target&&(r.classList.contains(aS(U_))||r.classList.contains(aS("slide_wrapper")))&&m()}S(e)});!function(e,t,n,r){wt(()=>pS(e(J_,t),e(X_,n),e(Y_,r),e(Q_,r),e(eS,r)),[e,t,n,r,void 0])}(n,E,gx(t=>{const n=C(t);if(n){const o=b.current===t.pointerId;if(0===t.buttons)return void(o&&0!==v.current?R(t):S(n));const i=t.clientX-n.clientX,a=t.clientY-n.clientY;if(void 0===b.current){const n=e=>{x(t),b.current=t.pointerId,w.current=Date.now(),_.current=e};Math.abs(i)>Math.abs(a)&&Math.abs(i)>30&&r(i)?e||(n(Rx.SWIPE),l()):Math.abs(a)>Math.abs(i)&&I(a,30)&&(n(Rx.PULL),f())}else o&&(_.current===Rx.SWIPE?(v.current=i,s(i)):_.current===Rx.PULL&&(v.current=a,h(a)))}}),R)})(i,...Y,u,c,...Q,H),function(e,t,n,r,o,i,l,s,a){const u=St(0),c=St(0),d=St(void 0),f=St(void 0),h=St(0),p=St(void 0),g=St(0),{setTimeout:m,clearTimeout:v}=tx(),y=Et(()=>{d.current&&(v(d.current),d.current=void 0)},[v]),b=Et(()=>{f.current&&(v(f.current),f.current=void 0)},[v]),w=gx(()=>{e!==Ix.SWIPE&&(u.current=0,g.current=0,y(),b())});wt(w,[e,w]);const _=gx(e=>{f.current=void 0,u.current===e&&a(u.current)}),S=gx(t=>{if(t.ctrlKey)return;if(Math.abs(t.deltaY)>Math.abs(t.deltaX))return;const a=e=>{h.current=e,v(p.current),p.current=e>0?m(()=>{h.current=0,p.current=void 0},300):void 0};if(e===Ix.NONE){if(Math.abs(t.deltaX)<=1.2*Math.abs(h.current))return void a(t.deltaX);if(!n(-t.deltaX))return;if(c.current+=t.deltaX,y(),Math.abs(c.current)>30)c.current=0,a(0),g.current=Date.now(),i();else{const e=c.current;d.current=m(()=>{d.current=void 0,e===c.current&&(c.current=0)},o)}}else if(e===Ix.SWIPE){let e=u.current-t.deltaX;if(e=Math.min(Math.abs(e),r)*Math.sign(e),u.current=e,l(e),b(),Math.abs(e)>.2*r)return a(t.deltaX),void s(e,Date.now()-g.current);f.current=m(()=>_(e),2*o)}else a(t.deltaX)});wt(()=>t(nS,S),[t,S])}(v,...Y);const ee=gx(()=>{i.focus&&N().querySelector(`.${aS(z_)} .${aS(kx())}`)&&L()});wt(ee,[ee]);const te=gx(()=>{var e;null===(e=l.view)||void 0===e||e.call(l,{index:g.currentIndex})});wt(te,[g.globalIndex,te]),wt(()=>pS(C(q_,e=>X({direction:q_,...e})),C(G_,e=>X({direction:G_,...e})),C(Z_,e=>m(e))),[C,X,m]);const ne=Ct(()=>({prev:j,next:W,close:H,focus:L,slideRect:M?wS(M,r.padding):{width:0,height:0},containerRect:M||{width:0,height:0},subscribeSensors:x,containerRef:P,setCarouselRef:F,toolbarWidth:h,setToolbarWidth:p}),[j,W,H,L,x,M,P,F,h,p,r.padding]);return xt(i.ref,()=>({prev:j,next:W,close:H,focus:L,getLightboxProps:V,getLightboxState:$}),[j,W,H,L,V,$]),Oe("div",{ref:T,className:sS(aS(kx()),aS(H_)),style:{...v===Ix.SWIPE?{[uS("swipe_offset")]:`${Math.round(b.current)}px`}:null,...v===Ix.PULL?{[uS("pull_offset")]:`${Math.round(w.current)}px`,[uS("pull_opacity")]:`${_.current}`}:null,..."none"!==i.touchAction?{[uS("controller_touch_action")]:i.touchAction}:null,...s.container},tabIndex:-1,...S},M&&Oe(Px.Provider,{value:ne},e,null===(n=a.controls)||void 0===n?void 0:n.call(a)))});function Tx(e){return cS(F_,e)}function Ax(e){return cS(U_,e)}function Fx({slide:e,offset:t}){const n=St(null),{currentIndex:r,slides:o}=qS(),{slideRect:i,focus:l}=Ox(),{render:s,carousel:{imageFit:a,imageProps:u},on:{click:c},styles:{slide:d},labels:f}=HS(),{getOwnerDocument:h}=DS(),p=0!==t;return wt(()=>{var e;p&&(null===(e=n.current)||void 0===e?void 0:e.contains(h().activeElement))&&l()},[p,l,h]),Oe("div",{ref:n,className:sS(aS(Ax()),!p&&aS(Ax("current")),aS(H_)),...(g=p,{inert:RS?g:g?"":void 0}),style:d,role:"group","aria-roledescription":fS(f,"Slide"),"aria-label":hS(f,o,r+t)},(()=>{var n,o,l,d;let f=null===(n=s.slide)||void 0===n?void 0:n.call(s,{slide:e,offset:t,rect:i});return!f&&vS(e)&&(f=Oe(Cx,{slide:e,offset:t,render:s,rect:i,imageFit:a,imageProps:u,onClick:p?void 0:()=>null==c?void 0:c({index:r})})),f?Oe(Ae,null,null===(o=s.slideHeader)||void 0===o?void 0:o.call(s,{slide:e}),(null!==(l=s.slideContainer)&&void 0!==l?l:({children:e})=>e)({slide:e,children:f}),null===(d=s.slideFooter)||void 0===d?void 0:d.call(s,{slide:e})):null})());var g}function Nx(){const e=HS().styles.slide;return Oe("div",{className:aS(U_),style:e})}const zx=PS(F_,function({carousel:e,labels:t}){const{slides:n,currentIndex:r,globalIndex:o}=qS(),{setCarouselRef:i}=Ox(),{autoPlaying:l,focusWithin:s}=FS(),a=bS(e.spacing),u=bS(e.padding),c=function(e,t,n=0){return Math.min(e.preload,Math.max(e.finite?t.length-1:Math.floor(t.length/2),n))}(e,n,1),d=[];if(SS(n))for(let t=r-c;t<=r+c;t+=1){const i=xS(n,t),l=o-r+t,s=e.finite&&(t<0||t>n.length-1);d.push(s?{key:l}:{key:[`${l}`,ES(i)].filter(Boolean).join("|"),offset:t-r,slide:i})}return Oe("div",{ref:i,className:sS(aS(Tx()),d.length>0&&aS(Tx("with_slides"))),style:{[`${uS(Tx("slides_count"))}`]:d.length,[`${uS(Tx("spacing_px"))}`]:a.pixel||0,[`${uS(Tx("spacing_percent"))}`]:a.percent||0,[`${uS(Tx("padding_px"))}`]:u.pixel||0,[`${uS(Tx("padding_percent"))}`]:u.percent||0},role:"region","aria-live":l&&!s?"off":"polite","aria-roledescription":fS(t,"Carousel"),"aria-label":fS(t,"Photo gallery")},d.map(({key:e,slide:t,offset:n})=>t?Oe(Fx,{key:e,slide:t,offset:n}):Oe(Nx,{key:e})))});function Dx(){const{carousel:e}=HS(),{slides:t,currentIndex:n}=qS();return{prevDisabled:0===t.length||e.finite&&0===n,nextDisabled:0===t.length||e.finite&&n===t.length-1}}function Lx({label:e,icon:t,renderIcon:n,action:r,onClick:o,disabled:i,style:l}){return Oe(rx,{label:e,icon:t,renderIcon:n,className:aS(`navigation_${r}`),disabled:i,onClick:o,style:l,...yx(Ox().focus,i)})}const Vx=PS("navigation",function({render:{buttonPrev:e,buttonNext:t,iconPrev:n,iconNext:r},styles:o}){const{prev:i,next:l,subscribeSensors:s}=Ox(),{prevDisabled:a,nextDisabled:u}=Dx();return function(e){var t;const n=bx(),{publish:r}=$S(),{animation:o,controller:i}=HS(),{prevDisabled:l,nextDisabled:s}=Dx(),a=(null!==(t=o.navigation)&&void 0!==t?t:o.swipe)/2,u=wx(()=>r(q_),a),c=wx(()=>r(G_),a),d=gx(e=>{switch(e.key){case"Escape":if(!i.closeOnEscape)return;r(K_);break;case"ArrowLeft":(n?s:l)||(n?c:u)();break;case"ArrowRight":(n?l:s)||(n?u:c)();break;default:return}e.stopPropagation()});wt(()=>e(tS,d),[e,d])}(s),Oe(Ae,null,e?e():Oe(Lx,{label:"Previous",action:q_,icon:lx,renderIcon:n,style:o.navigationPrev,disabled:a,onClick:i}),t?t():Oe(Lx,{label:"Next",action:G_,icon:sx,renderIcon:r,style:o.navigationNext,disabled:u,onClick:l}))}),$x=aS("no_scroll"),jx=aS(B_);function Wx(e){return"style"in e}function Hx(e,t,n){const r=window.getComputedStyle(e),o=n?"padding-left":"padding-right",i=n?r.paddingLeft:r.paddingRight,l=e.style.getPropertyValue(o);return e.style.setProperty(o,`${(yS(i)||0)+t}px`),()=>{l?e.style.setProperty(o,l):e.style.removeProperty(o)}}const Bx=PS("no-scroll",function({noScroll:{disabled:e},children:t}){const n=bx(),{getOwnerDocument:r,getOwnerWindow:o}=DS();return wt(()=>{if(e)return()=>{};const t=[],i=o(),{body:l,documentElement:s}=r(),a=Math.round(i.innerWidth-s.clientWidth);if(a>0){t.push(Hx(l,a,n));const e=l.getElementsByTagName("*");for(let r=0;r<e.length;r+=1){const o=e[r];Wx(o)&&"fixed"===i.getComputedStyle(o).getPropertyValue("position")&&!o.classList.contains(jx)&&t.push(Hx(o,a,n))}}return l.classList.add($x),()=>{l.classList.remove($x),t.forEach(e=>e())}},[n,e,r,o]),Oe(Ae,null,t)});function Ux(e){return cS(z_,e)}function qx(e,t,n){const r=e.getAttribute(t);return e.setAttribute(t,n),()=>{r?e.setAttribute(t,r):e.removeAttribute(t)}}const Gx=PS(z_,function({portal:{root:e,container:{className:t,style:n,...r}={}},animation:o,styles:i,className:l,on:s,close:a,labels:u,children:c}){const[d,f]=yt(!1),[h,p]=yt(!1),g=St([]),m=St(null),{setTimeout:v}=tx(),{subscribe:y}=$S(),b=dx()?0:o.fade;wt(()=>(f(!0),()=>{f(!1),p(!1)}),[]);const w=gx(()=>{g.current.forEach(e=>e()),g.current=[]}),_=gx(()=>{var e;p(!1),w(),null===(e=s.exiting)||void 0===e||e.call(s),v(()=>{var e;null===(e=s.exited)||void 0===e||e.call(s),a()},b)});wt(()=>y(K_,_),[y,_]);const S=gx(e=>{var t,n,r;!function(e){e.scrollTop}(e),p(!0),null===(t=s.entering)||void 0===t||t.call(s);const o=null!==(r=null===(n=e.parentNode)||void 0===n?void 0:n.children)&&void 0!==r?r:[];for(let t=0;t<o.length;t+=1){const n=o[t];-1===["TEMPLATE","SCRIPT","STYLE"].indexOf(n.tagName)&&n!==e&&(g.current.push(qx(n,"inert","")),g.current.push(qx(n,"aria-hidden","true")))}g.current.push(()=>{var e,t;null===(t=null===(e=m.current)||void 0===e?void 0:e.focus)||void 0===t||t.call(e)}),v(()=>{var e;null===(e=s.entered)||void 0===e||e.call(s)},b)}),x=Et(e=>{e?S(e):w()},[S,w]);return d?un(Oe(Ex,{ref:x,className:sS(l,t,aS(Ux()),aS(B_),h&&aS(Ux("open"))),"aria-modal":!0,role:"dialog","aria-label":fS(u,"Lightbox"),style:{...o.fade!==kS.animation.fade?{[uS("fade_animation_duration")]:`${b}ms`}:null,...o.easing.fade!==kS.animation.easing.fade?{[uS("fade_animation_timing_function")]:o.easing.fade}:null,...i.root,...n},onFocus:e=>{m.current||(m.current=e.relatedTarget)},...r},c),("function"==typeof e?e():e)||document.body):null}),Zx=PS("root",function({children:e}){return Oe(Ae,null,e)}),Kx=PS(D_,function({toolbar:{buttons:e},render:{buttonClose:t,iconClose:n},styles:r}){const{close:o,setToolbarWidth:i}=Ox(),{setContainerRef:l,containerRect:s}=hx();return cx(()=>{i(null==s?void 0:s.width)},[i,null==s?void 0:s.width]),Oe("div",{ref:l,style:r.toolbar,className:aS(cS(D_,undefined))},null==e?void 0:e.map(e=>e===K_?t?t():Oe(rx,{key:K_,label:"Close",icon:ix,renderIcon:n,onClick:o}):e))});function Jx(e,t){var n;return Oe(e.module.component,{key:e.module.name,...t},null===(n=e.children)||void 0===n?void 0:n.map(e=>Jx(e,t)))}function Xx(e,t={}){const{easing:n,...r}=e,{easing:o,...i}=t;return{easing:{...n,...o},...r,...i}}function Yx({carousel:e,animation:t,render:n,toolbar:r,controller:o,noScroll:i,on:l,plugins:s,slides:a,index:u,...c}){const{animation:d,carousel:f,render:h,toolbar:p,controller:g,noScroll:m,on:v,slides:y,index:b,plugins:w,..._}=kS,{config:S,augmentation:x}=function(e,t=[],n=[]){let r=e;const o=e=>{const t=[...r];for(;t.length>0;){const n=t.pop();if((null==n?void 0:n.module.name)===e)return!0;(null==n?void 0:n.children)&&t.push(...n.children)}return!1},i=(e,t)=>{r=""!==e?TS(r,e,e=>[OS(t,[e])]):[OS(t,r)]},l=(e,t)=>{r=TS(r,e,e=>[OS(e.module,[OS(t,e.children)])])},s=(e,t,n)=>{r=TS(r,e,e=>{var r;return[OS(e.module,[...n?[OS(t)]:[],...null!==(r=e.children)&&void 0!==r?r:[],...n?[]:[OS(t)]])]})},a=(e,t,n)=>{r=TS(r,e,e=>[...n?[OS(t)]:[],e,...n?[]:[OS(t)]])},u=e=>{l(N_,e)},c=(e,t)=>{r=TS(r,e,e=>[OS(t,e.children)])},d=e=>{r=TS(r,e,e=>e.children)},f=e=>{n.push(e)};return t.forEach(e=>{e({contains:o,addParent:i,append:l,addChild:s,addSibling:a,addModule:u,replace:c,remove:d,augment:f})}),{config:r,augmentation:e=>n.reduce((e,t)=>t(e),e)}}([OS(Gx,[OS(Bx,[OS(Mx,[OS(zx),OS(Kx),OS(Vx)])])])],s||w),C=x({animation:Xx(d,t),carousel:{...f,...e},render:{...h,...n},toolbar:{...p,...r},controller:{...g,...o},noScroll:{...m,...i},on:{...v,...l},..._,...c});return C.open?Oe(BS,{...C},Oe(JS,{slides:a||y,index:yS(u||b)},Oe(nx,null,Oe(jS,null,Oe(NS,null,Jx(OS(Zx,S),C)))))):null}const Qx={auto:!1,ref:null},eC=e=>({...Qx,...e}),tC=rt(null),nC=gS("useFullscreen","FullscreenContext",tC);function rC({fullscreen:e,on:t,children:n}){const{auto:r,ref:o}=eC(e),i=St(null),[l,s]=yt(),[a,u]=yt(!1),c=St(!1),{getOwnerDocument:d}=DS();cx(()=>{var e,t,n,r;const o=d();s(!(null!==(r=null!==(n=null!==(t=null!==(e=o.fullscreenEnabled)&&void 0!==e?e:o.webkitFullscreenEnabled)&&void 0!==t?t:o.mozFullScreenEnabled)&&void 0!==n?n:o.msFullscreenEnabled)&&void 0!==r&&r))},[d]);const f=Et(()=>{var e;const t=d(),n=t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement;return(null===(e=null==n?void 0:n.shadowRoot)||void 0===e?void 0:e.fullscreenElement)||n},[d]),h=Et(()=>{const e=i.current;try{e.requestFullscreen?e.requestFullscreen().catch(()=>{}):e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()}catch(e){}},[]),p=Et(()=>{if(!f())return;const e=d();try{e.exitFullscreen?e.exitFullscreen().catch(()=>{}):e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.msExitFullscreen&&e.msExitFullscreen()}catch(e){}},[f,d]);wt(()=>{const e=d(),t=()=>{u(f()===i.current)};return pS(...["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].map(n=>(e.addEventListener(n,t),()=>e.removeEventListener(n,t))))},[f,d]);const g=gx(()=>{var e;return null===(e=t.enterFullscreen)||void 0===e?void 0:e.call(t)}),m=gx(()=>{var e;return null===(e=t.exitFullscreen)||void 0===e?void 0:e.call(t)});wt(()=>{a&&(c.current=!0),c.current&&(a?g:m)()},[a,g,m]);const v=gx(()=>{var e;return null===(e=r?h:null)||void 0===e||e(),p});wt(v,[v]);const y=Ct(()=>({fullscreen:a,disabled:l,enter:h,exit:p}),[a,l,h,p]);return xt(o,()=>y,[y]),Oe("div",{ref:i,className:sS(aS(L_),aS("fullsize"))},Oe(tC.Provider,{value:y},n))}const oC=ox("EnterFullscreen",Oe("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})),iC=ox("ExitFullscreen",Oe("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}));function lC(){var e;const{fullscreen:t,disabled:n,enter:r,exit:o}=nC(),{render:i}=HS();return n?null:i.buttonFullscreen?Oe(Ae,null,null===(e=i.buttonFullscreen)||void 0===e?void 0:e.call(i,{fullscreen:t,disabled:n,enter:r,exit:o})):Oe(rx,{disabled:n,label:t?"Exit Fullscreen":"Enter Fullscreen",icon:t?iC:oC,renderIcon:t?i.iconExitFullscreen:i.iconEnterFullscreen,onClick:t?o:r})}function sC({augment:e,contains:t,addParent:n}){e(({fullscreen:e,toolbar:t,...n})=>({toolbar:IS(t,L_,Oe(lC,null)),fullscreen:eC(e),...n})),n(t(V_)?V_:N_,PS(L_,rC))}function aC({isOpen:e,imageUrl:t,caption:n,enableFullscreen:r=!0,onClose:o}){const{i18n:i}=si();if(wt(()=>{if(!e)return;const t=e=>{"Escape"===e.key&&o()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,o]),!e||!t)return null;const l={src:t,alt:n||i.image,title:n||void 0};return Wo(Yx,{open:e,close:o,slides:[l],plugins:r?[sC]:[],render:{slideFooter:n?()=>Wo("div",{className:"yarl__caption",children:Wo("div",{className:"yarl__caption_container",children:n})}):void 0,buttonPrev:()=>null,buttonNext:()=>null},carousel:{finite:!0},controller:{closeOnBackdropClick:!0},styles:{root:{"--yarl__color_backdrop":"rgba(0, 0, 0, 0.9)"}}})}const uC=({thumbnailUrl:e,largeImageUrl:t,alt:n="",caption:r,width:o=70,height:i=70,className:l=""})=>{const{i18n:s}=si(),[a,u]=yt(!1),c=t||e,d=n||s.image,f=e=>{e.stopPropagation(),c&&u(!0)};return Wo(Ae,{children:[Wo("span",{className:`clickable-lightbox-image ${l}`,onClick:f,role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),f(e))},"aria-label":s.openLightboxFor({label:d}),style:{cursor:"pointer",display:"inline-block"},children:Wo("img",{src:e,alt:n,loading:"lazy",width:o,height:i,style:{display:"block",maxWidth:"100%",height:"auto"}})}),a&&Wo(aC,{isOpen:a,imageUrl:c,caption:r||n,onClose:()=>{u(!1)}})]})},cC=({data:e,columnId:t,clickToFilter:n=!1,filterOptions:r=[],onFilterChange:o,currentFilterValue:i})=>{const{i18n:l}=si(),{separator:s,items:a}=e;if(!a||0===a.length)return null;const u=s.replace(/\s+$/,""),c=Ct(()=>(e=>{const t=[],n=e=>{for(const r of e)t.push(r),r.children&&n(r.children)};return n(e),t})(r),[r]),d=Ct(()=>{if(!i)return new Set;const e=Array.isArray(i)?i:[i];return new Set(e)},[i]);return Wo(Ae,{children:a.map((e,r)=>{const i=r===a.length-1,s=n?((e,t)=>t.find(t=>t.value===e.slug)||t.find(t=>t.label.toLowerCase()===e.name.toLowerCase()))(e,c):void 0,f=!!s&&d.has(s.value);let h;return h=s&&o&&!f?Wo("a",{href:e.link||M_(t,s.value),rel:e.link?"tag":void 0,className:"clickable-filter-term",onClick:e=>{e.preventDefault(),o(t,s.value)},"aria-label":l.filterByTerm({term:e.name}),children:e.name}):n?Wo("span",{children:e.name}):e.link?Wo("a",{href:e.link,rel:"tag",children:e.name}):Wo("span",{children:e.name}),Wo(Ae,{children:[Wo("span",{className:"taxonomy-term-group",children:[h,!i&&Wo("span",{className:"taxonomy-separator",dangerouslySetInnerHTML:{__html:u}})]}),!i&&" "]},e.id)})})},dC=({isExpanded:e,onClick:t,type:n,hasHiddenColumns:r})=>{const{i18n:o}=si();return r?Wo("button",{type:"button",className:ri("responsive-control",n,e&&"expanded"),onClick:e=>{e.stopPropagation(),t()},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),t())},"aria-expanded":e,"aria-label":e?o.collapseRowDetails:o.expandRowDetails,tabIndex:0,children:Wo("span",{className:"responsive-control-icon","aria-hidden":"true",children:Wo("svg",e?{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:Wo("path",{d:"M3 8h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})}:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:Wo("path",{d:"M8 3v10M3 8h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})})})}):null},fC="__responsive_control__",hC={width:70,height:70},pC=e=>"object"==typeof e&&null!==e&&"dataType"in e&&"string"==typeof e.dataType,gC=e=>!(!e||"object"!=typeof e)&&(pC(e)&&"image"===e.dataType?"thumbnail"in e:"thumbnail"in e&&"string"==typeof e.thumbnail),mC=e=>pC(e)&&"taxonomy"===e.dataType&&"items"in e&&Array.isArray(e.items),vC=e=>e?gC(e)?e.thumbnail:"string"==typeof e?e:null:null,yC=e=>gC(e)&&e.alt||"",bC={text:e=>e||"",number:e=>(e=>{if(null==e)return"";const t=Number(e);return isNaN(t)?String(e):t.toLocaleString("en-US")})(e),date:e=>(e=>{if(!e)return"";try{const t=new Date(e);return isNaN(t.getTime())?String(e):t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return String(e)}})(e),html:e=>Wo("div",{dangerouslySetInnerHTML:{__html:e||""}}),image:(e,t)=>{const n=vC(e);if(!n)return null;const r=(null==t?void 0:t.imageSize)||hC,o=Wo("img",{src:n,alt:yC(e),style:{width:`${r.width}px`,height:`${r.height}px`,objectFit:"contain"}}),i=(e=>{if(gC(e))return e.link})(e);return i?Wo("a",{href:i,children:o}):o},button:e=>Wo("div",{dangerouslySetInnerHTML:{__html:e||""}})},wC=e=>{const t=(e=>e&&"auto"!==e?"number"==typeof e?{type:"pixel",value:e,original:e}:"string"==typeof e&&e.endsWith("%")?{type:"percentage",value:parseFloat(e.slice(0,-1)),original:e}:"string"==typeof e&&e.endsWith("px")?{type:"pixel",value:parseFloat(e.slice(0,-2)),original:e}:{type:"auto",value:0,original:e}:{type:"auto",value:0,original:e})(e);return"pixel"===t.type?t.value:150},_C=(e,t)=>null==e?void 0:e.find(e=>e.id===t||e.columnId===t),SC=(e,t)=>{var n;return null==e||null===(n=e.find(e=>e.id===t))||void 0===n?void 0:n.value},xC=[{name:"customRenderer",shouldApply:e=>!!e.customRenderer,createRenderer:e=>t=>Wo(e.customRenderer,{value:t.getValue(),row:t.row.original,column:e})},{name:"structuredTaxonomy",shouldApply:e=>("image"!==e.dataType||!e.lightbox)&&!1!==e.filterable,createRenderer:(e,t)=>{const n=!!e.clickToFilter&&!1!==t.allowClickToFilter,r="object"==typeof e.clickToFilter?e.clickToFilter:{},o=r.filterTarget||e.id;return i=>{var l;const s=i.getValue();if(!mC(s)){if(n&&t.filters&&t.onFilterChange){var a;const e=_C(t.filters,o),n=(null==e?void 0:e.options)||[],i=null!==(a=null==e?void 0:e.id)&&void 0!==a?a:o;if(n.length>0){const e=SC(t.currentFilters,i);return Wo(A_,{value:s,filterOptions:n,filterId:i,onFilterClick:e=>t.onFilterChange(i,e),valueParser:r.valueParser,currentFilterValue:e})}}return(0,bC[e.dataType])(s,e)}const u=_C(t.filters,o),c=(null==u?void 0:u.options)||[],d=null!==(l=null==u?void 0:u.id)&&void 0!==l?l:o,f=SC(t.currentFilters,d);return Wo(cC,{data:s,columnId:d,clickToFilter:n,filterOptions:c,onFilterChange:n?t.onFilterChange:void 0,currentFilterValue:f})}}},{name:"clickToFilter",shouldApply:(e,t)=>{if(!e.clickToFilter||!t.filters||!t.onFilterChange||!1===t.allowClickToFilter)return!1;const n=("object"==typeof e.clickToFilter?e.clickToFilter:{}).filterTarget||e.id,r=_C(t.filters,n);return((null==r?void 0:r.options)||[]).length>0},createRenderer:(e,t)=>n=>{var r;const o=n.getValue(),i="object"==typeof e.clickToFilter?e.clickToFilter:{},l=i.filterTarget||e.id,s=i.valueParser,a=_C(t.filters,l),u=(null==a?void 0:a.options)||[],c=null!==(r=null==a?void 0:a.id)&&void 0!==r?r:l,d=SC(t.currentFilters,c);return Wo(A_,{value:o,filterOptions:u,filterId:c,onFilterClick:e=>t.onFilterChange(c,e),valueParser:s,currentFilterValue:d})}},{name:"lightbox",shouldApply:e=>"image"===e.dataType&&!!e.lightbox,createRenderer:e=>t=>{var n,r;const o=t.getValue(),i=vC(o);if(!i)return null;const l="object"==typeof e.lightbox?e.lightbox:{},s=e.imageSize||hC,a=(e=>gC(e)?e.large||e.thumbnail:vC(e))(o)||(null===(n=l.getLargeImageUrl)||void 0===n?void 0:n.call(l,t.row.original))||i,u=(e=>{if(gC(e))return e.caption})(o)||(null===(r=l.getCaption)||void 0===r?void 0:r.call(l,t.row.original)),c=yC(o);return Wo(uC,{thumbnailUrl:i,largeImageUrl:a,alt:c,caption:u,width:s.width,height:s.height})}},{name:"default",shouldApply:()=>!0,createRenderer:e=>t=>(0,bC[e.dataType])(t.getValue(),e)}],CC=(e,t)=>{const n=(e=>null!=e?e:{})(t);for(const t of xC)if(t.shouldApply(e,n))return t.createRenderer(e,n);return()=>null},EC=(e,t)=>!(e.id!==fC&&!t.has(e.id))||"button"===e.dataType||"image"===e.dataType;function IC({columns:e,data:t,containerRef:n,containerWidth:r,responsiveConfig:o,loading:i,dataStateKey:l}){const s=null!==o,[a,u]=yt({}),c=St({key:"",passes:0});wt(()=>{u({}),c.current={key:"",passes:0}},[Ct(()=>e.map(e=>{var t;return`${e.id}:${null!==(t=e.width)&&void 0!==t?t:"auto"}`}).join("|"),[e])]);const{naturalWidths:d,headerIntrinsicWidths:f,legacyFitWidths:h,responsiveFitWidths:p,cellPadding:g,borderOverhead:m,ready:v,noExpandColumnIds:y}=b_(e,t,n,r),b=Ct(()=>Object.keys(h).length>0?h:d,[h,d]),w=Ct(()=>{const e=Object.keys(a).length>0,t=y.size>0&&Object.keys(d).length>0;if(!e&&!t)return b;const n={...b};return t&&y.forEach(e=>{const t=d[e];t>0&&n[e]>t&&(n[e]=t)}),e&&Object.entries(a).forEach(([e,t])=>{n[e]=Math.max(n[e]||0,t)}),n},[b,a,y,d]),{widths:_}=S_(e,r,w,y,g,m),S="column"===(null==o?void 0:o.control)?Math.max(0,r-50):r,x=(e=>{const{config:t,columns:n,columnWidths:r,measuredWidths:o={},containerWidth:i,data:l}=e,s=Ct(()=>{return e=null==t?void 0:t.breakpoints,{...x_,...e};var e},[null==t?void 0:t.breakpoints]),[a,u]=yt(()=>{const e=O_();return C_(e,s)}),[c,d]=yt(new Set),f=St(s);wt(()=>{f.current=s},[s]);const h=Ct(()=>{const e=n.map((e,t)=>({column:e,index:t}));return e.map(e=>{var t,n;return{...e,priority:null!==(t=null===(n=e.column.responsive)||void 0===n?void 0:n.priority)&&void 0!==t?t:1e4}}).sort((e,t)=>e.priority-t.priority)},[n]),{visibleColumns:p,hiddenColumns:g,neverColumns:m}=Ct(()=>{const e=10*Math.round(i/10),l=P_(n,a,e,r,s,o);if("inline"!==(null==t?void 0:t.control)||0===l.hiddenColumns.size)return l;const u=Math.max(0,e-36);return u===e?l:P_(n,a,u,r,s,o)},[n,a,i,r,s,o,null==t?void 0:t.control,h]),v=g.size>0,y=Et(()=>{const e=O_(),t=C_(e,f.current);u(e=>t!==e?t:e)},[]),b=Ct(()=>(e=>{let t=null;return(...n)=>{t&&clearTimeout(t),t=setTimeout(()=>{e(...n)},150)}})(y),[y]);wt(()=>(y(),window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b)}),[b,y]);const w=Et(e=>{d(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),_=Et(e=>"childRowVisible"===(null==t?void 0:t.display)||c.has(e),[c,null==t?void 0:t.display]),S=Ct(()=>{const e=[];return n.forEach((t,n)=>{g.has(t.id)&&!m.has(t.id)&&e.push({id:t.id,index:n,header:t.header,accessor:t.accessor})}),e},[n,g,m]),x=Ct(()=>{const e=[];return n.forEach((t,n)=>{m.has(t.id)||"__responsive_control__"===t.id||e.push({id:t.id,index:n,header:t.header,accessor:t.accessor})}),e},[n,m]),C=Et((e,t)=>S.map(t=>{const n=t.accessor?e[t.accessor]:e[t.id];return{columnId:t.id,columnIndex:t.index,title:t.header,data:n}}),[S]),E=Et((e,t)=>x.map(t=>{const n=t.accessor?e[t.accessor]:e[t.id];return{columnId:t.id,columnIndex:t.index,title:t.header,data:n}}),[x]),I=v;return wt(()=>{if("childRowVisible"===(null==t?void 0:t.display)&&v){const e=l.map((e,t)=>String(e&&"object"==typeof e&&"id"in e?e.id:t));d(t=>{const n=new Set(t);return e.forEach(e=>n.add(e)),n})}else"childRowVisible"!==(null==t?void 0:t.display)&&d(new Set)},[null==t?void 0:t.display,v,l]),{responsiveState:{currentBreakpoint:a,visibleColumns:p,hiddenColumns:g,neverColumns:m,expandedRows:c,isResponsiveMode:v},toggleRow:w,isRowExpanded:_,getHiddenColumnsForRow:C,getAllColumnsForRow:E,shouldShowControl:I}})({config:o,columns:e,columnWidths:_,measuredWidths:p,containerWidth:S,data:t}),C=Ct(()=>{let t=[...e];return t=t.filter(e=>!1!==e.visible),s&&(t=t.filter(e=>x.responsiveState.visibleColumns.has(e.id)),"column"===(null==o?void 0:o.control)&&x.shouldShowControl&&(t=[{id:"__responsive_control__",header:"",dataType:"html",width:50,sortable:!1,filterable:!1,searchable:!1},...t])),t},[e,s,o,x.responsiveState.visibleColumns,x.shouldShowControl]),E=Ct(()=>{if(!o||"inline"!==o.control||!x.shouldShowControl)return w;const e=C.find(e=>"__responsive_control__"!==e.id);if(!e)return w;const t=w[e.id]||0,n=(a[e.id]||0)>0;let r=t+36;if("image"===e.dataType&&!n){var i;const t=d[e.id]||0,n=null!==(i=e.imageSize)&&void 0!==i&&i.width?e.imageSize.width+g:0,o=Math.max(t,n);o>0&&(r=o+36+8)}return{...w,[e.id]:r}},[w,o,x.shouldShowControl,C,a,d,g]),{widths:I}=S_(C,r,E,y,g,m),R=Ct(()=>{const e={...f,...p};if("inline"===(null==o?void 0:o.control)&&x.shouldShowControl){const t=C.find(e=>"__responsive_control__"!==e.id);if(t){const n=e[t.id]||0;e[t.id]=n+36}}return((e,t,n,r,o,i={})=>{if(n<=0||0===e.length)return t;const l=Math.max(0,n-r),s=e.reduce((e,n)=>{const r=i[n.id]||0,l=EC(n,o)?t[n.id]||0:50;return e+Math.max(l,r)},0)<=l+.5,a={...t};s&&e.forEach(e=>{const t=i[e.id]||0;t>0&&(a[e.id]=Math.max(a[e.id]||0,t))});let u=e.reduce((e,t)=>e+(a[t.id]||0),0)-l;if(u<=.5)return a;const c=e.filter(e=>!EC(e,o)).map(e=>({id:e.id,capacity:Math.max(0,(a[e.id]||0)-(s?Math.max(50,i[e.id]||0):50))})).filter(e=>e.capacity>0);if(0===c.length)return a;let d=c;for(;u>.5&&d.length>0;){const e=d.reduce((e,t)=>e+t.capacity,0);if(e<=0)break;let t=0;const n=[];if(d.forEach(r=>{const o=u*r.capacity/e,i=Math.min(r.capacity,o);a[r.id]-=i,t+=i;const l=r.capacity-i;l>.5&&n.push({id:r.id,capacity:l})}),t<=0)break;u-=t,d=n}return a})(C,I,r,m,y,e)},[C,I,r,m,y,f,p,o,x.shouldShowControl]),k=Ct(()=>JSON.stringify({dataStateKey:l,visibleColumns:C.map(e=>e.id),dataLength:t.length}),[l,C,t.length]);wt(()=>{if(!v||i||0===t.length||!n.current)return;if(c.current.key!==k&&(c.current={key:k,passes:0}),c.current.passes>=2)return;const e=n.current.querySelectorAll("tbody td.table-cell[data-column-id] .cell-content"),r={};e.forEach(e=>{const t=e.closest("td[data-column-id]"),n=null==t?void 0:t.getAttribute("data-column-id");if(!t||!n||n===fC)return;const o=e.scrollWidth-e.clientWidth,i=t_(e),l=Math.max(o,i);if(l<=1)return;const s=R[n]||t.getBoundingClientRect().width,a=Math.ceil(s+l+4);r[n]=Math.max(r[n]||0,a)}),0!==Object.keys(r).length?(c.current.passes+=1,u(e=>{const t={...e};let n=!1;return Object.entries(r).forEach(([e,r])=>{r>(t[e]||0)&&(t[e]=r,n=!0)}),n?t:e})):c.current.passes=2},[v,i,t.length,R,k]);const P=x.responsiveState.hiddenColumns.size>0;return{visibleColumnConfigs:C,columnWidths:R,widthsReady:v,responsiveState:x.responsiveState,responsiveEnabled:s,hasHiddenColumns:P,shouldShowControl:x.shouldShowControl,isRowExpanded:x.isRowExpanded,toggleRow:x.toggleRow,getHiddenColumnsForRow:x.getHiddenColumnsForRow,getAllColumnsForRow:x.getAllColumnsForRow,responsiveConfig:o}}function RC({enabled:e,offset:t=0,targetRef:n,stateKey:r,loading:o=!1}){const i=St(r),l=St(!0);wt(()=>{if(l.current)return l.current=!1,void(i.current=r);if(!e)return;if(i.current===r)return;if(i.current=r,o)return;if(null==n||!n.current)return;const s=n.current.getBoundingClientRect();if(!(s.top>=t)){const e=window.pageYOffset+s.top-t;window.scrollTo({top:Math.max(0,e),behavior:"smooth"})}},[r,o,e,t,n])}function kC({columnId:e,label:t}){const{i18n:n}=si(),{containerRef:r,selectedItems:o,selectAll:i,deselectAll:l,isActionLoading:s}=It(ai),[a,u]=yt(new Map),c=St(null),d=Et(()=>{const t=null==r?void 0:r.current;u(t?((e,t)=>{const n=new Map;return e.querySelectorAll(Db).forEach(e=>{if(e.disabled)return;const r=e.closest("td[data-column-id]");if(!r||r.getAttribute("data-column-id")!==t)return;const o=e.getAttribute(zb);o&&!n.has(o)&&n.set(o,{id:o,attributes:Lb(e)})}),n})(t,e):new Map)},[r,e]);wt(()=>{d()},[d]),wt(()=>{const e=null==r?void 0:r.current;if(!e)return;let t=null;const n=()=>{null!==t&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>{t=null,d()})},o=new MutationObserver(n);return o.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["disabled","data-column-id",zb]}),n(),()=>{o.disconnect(),null!==t&&cancelAnimationFrame(t)}},[r,d]);const f=Ct(()=>Array.from(a.keys()),[a]),h=Ct(()=>f.reduce((e,t)=>e+(o.has(t)?1:0),0),[f,o]),p=f.length,g=p>0&&h===p,m=h>0&&h<p;wt(()=>{c.current&&(c.current.indeterminate=m)},[m]);const v=Et(e=>{e.currentTarget.checked?0!==a.size&&i(Array.from(a.values())):l()},[l,i,a]),y=Et(e=>{e.stopPropagation()},[]),b=Ct(()=>"dv-select-all"+(s?" is-disabled":""),[s]);return 0===p?null:Wo("label",{className:b,onClick:y,children:[Wo("span",{className:"dv-select-all__text",children:null!=t?t:n.selectAll}),Wo("span",{className:"dv-select-all__toggle",children:Wo("input",{ref:c,type:"checkbox",className:"dv-select-all__input",checked:g,onClick:y,onChange:v,disabled:s})})]})}const PC=rt(void 0);function OC(e){const t=It(PC);if(void 0===t&&!e)throw new Error(Vc(33));return t}const MC=rt(void 0);function TC(e){const t=It(MC);if(void 0===t&&!e)throw new Error(Vc(36));return t}const AC=rt(void 0);function FC(e=!0){const t=It(AC);if(void 0===t&&!e)throw new Error(Vc(25));return t}const NC={type:"regular-item"};const zC=rt(void 0),DC=Zt(function(e,t){const{render:n,className:r,style:o,...i}=e,[l,s]=yt(void 0),a=Cp("div",e,{ref:t,props:{role:"group","aria-labelledby":l,...i}});return Zo.jsx(zC.Provider,{value:s,children:a})}),LC=Zt(function(e,t){const{render:n,className:r,style:o,id:i,...l}=e,s=Zm(i),a=function(){const e=It(zC);if(void 0===e)throw new Error(Vc(31));return e}();return _c(()=>(a(s),()=>{a(void 0)}),[a,s]),Cp("div",e,{ref:t,props:{id:s,role:"presentation",...l}})}),VC=Zt(function(e,t){const{render:n,className:r,id:o,label:i,nativeButton:l=!1,disabled:s=!1,closeOnClick:a=!0,style:u,...c}=e,d=hy({label:i}),f=OC(!0),h=Zm(o),{store:p}=TC(),g=p.useState("isActive",d.index),m=p.useState("itemProps"),{getItemProps:v,itemRef:y}=function(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:o,store:i,typingRef:l=i.context.typingRef,nativeButton:s,itemMetadata:a,nodeId:u}=e,c=i.useState("disabled"),d=n||c,f=St(null),{getButtonProps:h,buttonRef:p}=kv({disabled:d,focusableWhenDisabled:!0,native:s,composite:!0}),g=function(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:o,store:i,typingRef:l,itemRef:s,itemMetadata:a}=e,{events:u}=i.useState("floatingTreeRoot"),c=i.useState("open"),d=FC(!0),f=void 0!==d;return Ct(()=>({id:r,role:"menuitem",tabIndex:c&&n?0:-1,onKeyDown(e){" "===e.key&&null!=l&&l.current&&e.preventDefault()},onMouseMove(e){o&&u.emit("itemhover",{nodeId:o,target:e.currentTarget})},onClick(e){t&&u.emit("close",{domEvent:e,reason:zf})},onMouseUp(e){if(d){const 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)return;if(f&&!rf&&2===e.button)return}!s.current||!i.context.allowMouseUpTriggerRef.current||f&&2!==e.button||a&&"regular-item"!==a.type||s.current.click()}}),[t,n,r,u,o,c,i,l,s,d,f,a])}({closeOnClick:t,highlighted:r,id:o,nodeId:u,store:i,typingRef:l,itemRef:f,itemMetadata:a}),m=Et(e=>hp(g,{onMouseEnter(){"submenu-trigger"===a.type&&a.setActive()}},e,h),[g,h,a]),v=Mc(f,p);return Ct(()=>({getItemProps:m,itemRef:v}),[m,v])}({closeOnClick:a,disabled:s,highlighted:g,id:h,store:p,nativeButton:l,nodeId:null==f?void 0:f.context.nodeId,itemMetadata:NC});return Cp("div",e,{state:{disabled:s,highlighted:g},props:[m,c,v],ref:[y,t,d.ref]})}),$C={..._v,...zg},jC=Zt(function(e,t){const{render:n,className:r,style:o,finalFocus:i,...l}=e,{store:s}=TC(),{side:a,align:u}=OC(),c=null!=cb(),d=s.useState("open"),f=s.useState("transitionStatus"),h=s.useState("popupProps"),p=s.useState("mounted"),g=s.useState("instantType"),m=s.useState("activeTriggerElement"),v=s.useState("parent"),y=s.useState("lastOpenChangeReason"),b=s.useState("rootId"),w=s.useState("floatingRootContext"),_=s.useState("floatingTreeRoot"),S=s.useState("closeDelay"),x=s.useState("activeTriggerElement"),C=s.useState("hoverEnabled"),E=s.useState("disabled"),I=s.useState("openMethod"),R="context-menu"===v.type;Lg({open:d,ref:s.context.popupRef,onComplete(){var e,t;d&&(null===(e=(t=s.context).onOpenChangeComplete)||void 0===e||e.call(t,!0))}}),wt(()=>{function e(e){s.setOpen(!1,Gf(e.reason,e.domEvent))}return _.events.on("close",e),()=>{_.events.off("close",e)}},[_.events,s]),function(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:o}=t,i="rootStore"in e?e.rootStore:e,l=i.useState("open"),s=i.useState("floatingElement"),a=i.useState("domReferenceElement"),{dataRef:u}=i.context,c=Vp(),d=Lp(),f=rm(i),h=qd(),p=kc(()=>{var e;return Of(null===(e=u.current.openEvent)||void 0===e?void 0:e.type,f.interactedInside)}),g=kc(()=>{var e,t;return(null==(t=null===(e=u.current.openEvent)||void 0===e?void 0:e.type)?void 0:t.includes("mouse"))&&"mousedown"!==t}),m=kc(()=>{tm(f)});_c(()=>{l||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,m())},[l,f,m]),wt(()=>m,[m]),_c(()=>{var e;if(n&&l&&null!==(e=f.handleCloseOptions)&&void 0!==e&&e.blockPointerEvents&&g()&&vd(a)&&s){var t,r,o,i,u,h,p;const e=a,n=s,l=Dd(s),g=null==c||null===(t=c.nodesRef.current.find(e=>e.id===d))||void 0===t||null===(t=t.context)||void 0===t?void 0:t.elements.floating;g&&(g.style.pointerEvents="");const v=f.pointerEventsScopeElement!==n?f.pointerEventsScopeElement:null,y=g!==n?g:null,b=null!==(r=null!==(o=null!==(i=null!==(u=null===(h=f.handleCloseOptions)||void 0===h||null===(p=h.getScope)||void 0===p?void 0:p.call(h))&&void 0!==u?u:v)&&void 0!==i?i:y)&&void 0!==o?o:e.closest("[data-rootownerid]"))&&void 0!==r?r:l.body;return nm(f,{scopeElement:b,referenceElement:e,floatingElement:n}),()=>{m()}}},[n,l,a,s,f,g,c,d,m]),wt(()=>{if(!n)return;function e(){return!!(c&&d&&qh(c.nodesRef.current,d).length>0)}function t(n){c&&d&&!e()&&h.start(0,()=>{c.events.off("floating.closed",t),i.setOpen(!1,Gf(Af,n)),c.events.emit("floating.closed",n)})}const l=s;return zd(l&&Ld(l,"mouseenter",function(){f.openChangeTimeout.clear(),h.clear(),null==c||c.events.off("floating.closed",t),m()}),l&&Ld(l,"mouseleave",function(n){var l,s;if(e()&&c)return void c.events.on("floating.closed",t);if(xf(n.relatedTarget,i.context.triggerElements))return;const a=null!==(l=null===(s=u.current.floatingContext)||void 0===s?void 0:s.nodeId)&&void 0!==l?l:o,d=n.relatedTarget;c&&a&&vd(d)&&qh(c.nodesRef.current,a,!1).some(e=>{var t;return _f(null===(t=e.context)||void 0===t?void 0:t.elements.floating,d)})||(f.handler?f.handler(n):(m(),g()&&!p()&&function(e){const t=kf(r,"close",f.pointerType),n=()=>{i.setOpen(!1,Gf(Af,e)),null==c||c.events.emit("floating.closed",e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}(n)))}),l&&Ld(l,"pointerdown",function(e){const t=Sf(e);var n;null!=(null==(n=t)?void 0:n.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${gf}`))?f.interactedInside=null!=(null==t?void 0:t.closest("[aria-haspopup]")):f.interactedInside=!1},!0),()=>{null==c||c.events.off("floating.closed",t)})},[n,s,i,u,r,o,g,p,m,f,c,d,h])}(w,{enabled:C&&!E&&!R&&"menubar"!==v.type,closeDelay:S});const k=Et(e=>{s.set("popupElement",e)},[s]),P=Cp("div",e,{state:{transitionStatus:f,side:a,align:u,open:d,nested:"menu"===v.type,instant:g},ref:[t,s.context.popupRef,k],stateAttributesMapping:$C,props:[h,{onKeyDown(e){c&&pb.has(e.key)&&e.stopPropagation()}},ty(f),l,{"data-rootownerid":b}]});let O=void 0===v.type||R;return(m||"menubar"===v.type&&y!==Nf)&&(O=!0),Zo.jsx(Kp,{context:w,openInteractionType:I,modal:R,disabled:!p,returnFocus:void 0===i?O:i,initialFocus:"menu"!==v.type,restoreFocus:!0,externalTree:"menubar"!==v.type?_:void 0,previousFocusableElement:x,nextFocusableElement:void 0===v.type?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:void 0===v.type?s.context.beforeContentFocusGuardRef:void 0,children:P})}),WC=rt(void 0),HC=Zt(function(e,t){const{keepMounted:n=!1,...r}=e,{store:o}=TC();return o.useState("mounted")||n?Zo.jsx(WC.Provider,{value:n,children:Zo.jsx(Ap,{ref:t,...r})}):null}),BC=Zt(function(e,t){const{anchor:n,positionMethod:r="absolute",className:o,render:i,side:l,align:s,sideOffset:a=0,alignOffset:u=0,collisionBoundary:c="clipping-ancestors",collisionPadding:d=5,arrowPadding:f=5,sticky:h=!1,disableAnchorTracking:p=!1,collisionAvoidance:g=Rp,style:m,...v}=e,{store:y}=TC(),b=function(){const e=It(WC);if(void 0===e)throw new Error(Vc(32));return e}(),w=FC(!0),_=y.useState("parent"),S=y.useState("floatingRootContext"),x=y.useState("floatingTreeRoot"),C=y.useState("mounted"),E=y.useState("open"),I=y.useState("modal"),R=y.useState("openMethod"),k=y.useState("activeTriggerElement"),P=y.useState("transitionStatus"),O=y.useState("positionerElement"),M=y.useState("instantType"),T=y.useState("hasViewport"),A=y.useState("lastOpenChangeReason"),F=y.useState("floatingNodeId"),N=y.useState("floatingParentNodeId"),z=S.useState("domReferenceElement"),D=St(null),L=Dg(O,!1,!1);let V=n,$=a,j=u,W=s,H=g;var B,U,q;"context-menu"===_.type&&(V=null!=n?n:null===(B=_.context)||void 0===B?void 0:B.anchor,W=null!=W?W:"start",l||"center"===W||(j=null!==(U=e.alignOffset)&&void 0!==U?U:2,$=null!==(q=e.sideOffset)&&void 0!==q?q:-5));let G=l,Z=W;var K;"menu"===_.type?(G=null!=G?G:"inline-end",Z=null!=Z?Z:"start",H=null!==(K=e.collisionAvoidance)&&void 0!==K?K:kp):"menubar"===_.type&&(G=null!=G?G:"vertical"===_.context.orientation?"inline-end":"bottom",Z=null!=Z?Z:"start");const J="context-menu"===_.type,X=Yv({anchor:V,floatingRootContext:S,positionMethod:w?"fixed":r,mounted:C,side:G,sideOffset:$,align:Z,alignOffset:j,arrowPadding:J?0:f,collisionBoundary:c,collisionPadding:d,sticky:h,nodeId:F,keepMounted:b,disableAnchorTracking:p,collisionAvoidance:H,shiftCrossAxis:J&&!("side"in H&&"flip"===H.side),externalTree:x,adaptiveOrigin:T?Kv:void 0});wt(()=>{function e(e){e.open&&(e.parentNodeId===F&&y.set("hoverEnabled",!1),e.nodeId!==F&&e.parentNodeId===y.select("floatingParentNodeId")&&y.setOpen(!1,Gf(Uf)))}return x.events.on("menuopenchange",e),()=>{x.events.off("menuopenchange",e)}},[y,x.events,F]),wt(()=>{if(null!=y.select("floatingParentNodeId"))return x.events.on("menuopenchange",e),()=>{x.events.off("menuopenchange",e)};function e(e){var t;if(e.open||e.nodeId!==y.select("floatingParentNodeId"))return;const n=null!==(t=e.reason)&&void 0!==t?t:Uf;y.setOpen(!1,Gf(n))}},[x.events,y]);const Y=qd();wt(()=>{E||Y.clear()},[E,Y]),wt(()=>{function e(e){if(E&&e.nodeId===y.select("floatingParentNodeId"))if(e.target&&k&&k!==e.target){const e=y.select("closeDelay");e>0?Y.isStarted()||Y.start(e,()=>{y.setOpen(!1,Gf(Uf))}):y.setOpen(!1,Gf(Uf))}else Y.clear()}return x.events.on("itemhover",e),()=>{x.events.off("itemhover",e)}},[x.events,E,k,y,Y]),wt(()=>{const e={open:E,nodeId:F,parentNodeId:N,reason:y.select("lastOpenChangeReason")};x.events.emit("menuopenchange",e)},[x.events,E,y,F,N]),_c(()=>{const e=z,t=D.current;if(e&&(D.current=e),t&&e&&e!==t){y.set("instantType",void 0);const e=new AbortController;return L(()=>{y.set("instantType","trigger-change")},e.signal),()=>{e.abort()}}},[z,L,y]);const Q={open:E,side:X.side,align:X.align,anchorHidden:X.anchorHidden,nested:"menu"===_.type,instant:M},ee="menubar"===_.type&&_.context.modal;ay(E&&(ee||I&&A!==Af),"touch"===R,O,k);const te=ny(e,Q,{styles:X.positionerStyles,transitionStatus:P,props:v,refs:[t,y.useStateSetter("positionerElement")],hidden:!C,inert:!E}),ne=C&&"menu"!==_.type&&("menubar"!==_.type&&I&&A!==Af||"menubar"===_.type&&_.context.modal);let re=null;return"menubar"===_.type?re=_.context.contentElement:void 0===_.type&&(re=k),Zo.jsxs(PC.Provider,{value:X,children:[ne&&Zo.jsx(ey,{ref:"context-menu"===_.type||"nested-context-menu"===_.type?_.context.internalBackdropRef:null,inert:Bv(!E),cutout:re}),Zo.jsx(jp,{id:F,children:Zo.jsx(Dv,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,children:te})})]})}),UC=rt(null);function qC(e){return It(UC)}const GC={...Jg,disabled:$c(e=>"menubar"===e.parent.type&&e.parent.context.disabled||e.disabled),modal:$c(e=>{var t;return(void 0===e.parent.type||"context-menu"===e.parent.type)&&(null===(t=e.modal)||void 0===t||t)}),openMethod:$c(e=>e.openMethod),allowMouseEnter:$c(e=>e.allowMouseEnter),highlightItemOnHover:$c(e=>e.highlightItemOnHover),stickIfOpen:$c(e=>e.stickIfOpen),parent:$c(e=>e.parent),rootId:$c(e=>"menu"===e.parent.type?e.parent.store.select("rootId"):void 0!==e.parent.type?e.parent.context.rootId:e.rootId),activeIndex:$c(e=>e.activeIndex),isActive:$c((e,t)=>e.activeIndex===t),hoverEnabled:$c(e=>e.hoverEnabled),instantType:$c(e=>e.instantType),lastOpenChangeReason:$c(e=>e.openChangeReason),floatingTreeRoot:$c(e=>"menu"===e.parent.type?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:$c(e=>e.floatingNodeId),floatingParentNodeId:$c(e=>e.floatingParentNodeId),itemProps:$c(e=>e.itemProps),closeDelay:$c(e=>e.closeDelay),hasViewport:$c(e=>e.hasViewport),keyboardEventRelay:$c(e=>e.keyboardEventRelay?e.keyboardEventRelay:"menu"===e.parent.type?e.parent.store.select("keyboardEventRelay"):void 0)};class ZC extends dd{constructor(e){super({...{...Ug(),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 Np,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:cd,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1},...e},{positionerRef:Te(),popupRef:Te(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:Te(),beforeContentFocusGuardRef:Te(),onOpenChangeComplete:void 0,triggerElements:new Bg},GC),te(this,"unsubscribeParentListener",null),this.unsubscribeParentListener=this.observe("parent",e=>{var t;if(null===(t=this.unsubscribeParentListener)||void 0===t||t.call(this),"menu"===e.type){let t=e.store.select("rootId"),n=e.store.select("floatingTreeRoot"),r=e.store.select("keyboardEventRelay");return this.unsubscribeParentListener=e.store.subscribe(()=>{const o=e.store.select("rootId"),i=e.store.select("floatingTreeRoot"),l=e.store.select("keyboardEventRelay");t===o&&n===i&&r===l||(t=o,n=i,r=l,this.notifyAll())}),void(this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef)}void 0!==e.type&&(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(e,t){const n=Ec(()=>new ZC(t)).current;return null!=e?e:n}}const KC=rt(void 0),JC=nd(function(e){var t,n,r;const{children:o,open:i,onOpenChange:l,onOpenChangeComplete:s,defaultOpen:a=!1,disabled:u=!1,modal:c,loopFocus:d=!0,orientation:f="vertical",actionsRef:h,closeParentOnEsc:p=!1,handle:g,triggerId:m,defaultTriggerId:v=null,highlightItemOnHover:y=!0}=e,b=FC(!0),w=TC(!0),_=qC(),S=It(KC),x=Ct(()=>S&&w?{type:"menu",store:w.store}:_?{type:"menubar",context:_}:b&&!w?{type:"context-menu",context:b}:{type:void 0},[b,w,_,S]),C=ZC.useStore(null==g?void 0:g.store,{open:a,openProp:i,activeTriggerId:v,triggerIdProp:m,parent:x});!function(e,t,n,r){Sc(()=>{void 0===t&&!1===e.state.open&&n&&(e.state={...e.state,open:!0,activeTriggerId:r,preventUnmountingOnClose:!1})})}(C,i,a,v),C.useControlledProp("openProp",i),C.useControlledProp("triggerIdProp",m),C.useContextCallback("onOpenChangeComplete",s);const E=up(),I=up(),R=C.useState("floatingTreeRoot"),k=$p(R),P=Lp(),O=C.useState("open"),M=C.useState("activeTriggerElement"),T=C.useState("positionerElement"),A=C.useState("hoverEnabled"),F=C.useState("disabled"),N=C.useState("lastOpenChangeReason"),z=C.useState("parent"),D=C.useState("activeIndex"),L=C.useState("payload"),V=C.useState("floatingParentNodeId"),$=St(null),j=St("context-menu"!==z.type),W=qd(),H=St(!0),B=qd(),U=null!=V,{openMethod:q,triggerProps:G}=rv(O);C.useSyncedValues({disabled:u,highlightItemOnHover:y,modal:void 0===z.type?c:void 0,openMethod:q,rootId:E}),jg(C);const{forceUnmount:Z}=Wg(O,C,()=>{C.update({allowMouseEnter:!1,stickIfOpen:!0})});_c(()=>{b&&!w?C.update({parent:{type:"context-menu",context:b},floatingNodeId:k,floatingParentNodeId:P}):w&&C.update({floatingNodeId:k,floatingParentNodeId:P})},[b,w,k,P,C]),wt(()=>{if(O||($.current=null),"context-menu"===z.type)return O?void W.start(500,()=>{j.current=!0}):(W.clear(),void(j.current=!1))},[W,O,z.type]),_c(()=>{O||A||C.set("hoverEnabled",!0)},[O,A,C]);const K=kc((e,t)=>{var n;const r=t.reason;if(O===e&&t.trigger===M&&N===r)return;const o=function(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}(t);if(e||null!=t.trigger||(t.trigger=null!=M?M:void 0),null==l||l(e,t),t.isCanceled)return;C.state.floatingRootContext.dispatchOpenChange(e,t);const i=t.event;if(!1===e&&"click"===(null==i?void 0:i.type)&&"touch"===i.pointerType&&!H.current)return;e&&r===Ff?(H.current=!1,B.start(300,()=>{H.current=!0})):(H.current=!0,B.clear());const s=(r===Tf||r===zf)&&0===i.detail&&(null==i?void 0:i.isTrusted),a=!e&&(r===Wf||null==r),u={open:e,openChangeReason:r};$.current=null!==(n=t.event)&&void 0!==n?n:null,$g(u,e,t.trigger,o()),C.update(u),"menubar"!==z.type||r!==Ff&&r!==jf&&r!==Af&&r!==Hf&&r!==Uf?s||a?C.set("instantType",s?"click":"dismiss"):C.set("instantType",void 0):C.set("instantType","group")}),J=Mg({popupStore:C,floatingId:I,nested:null!=P,onOpenChange:K}),X=J.context.events;wt(()=>{const e=({open:e,eventDetails:t})=>K(e,t);return X.on("setOpen",e),()=>{null==X||X.off("setOpen",e)}},[X,K]);const Y=Et(()=>{C.setOpen(!1,Gf(qf))},[C]);let Q;xt(h,()=>({unmount:Z,close:Y}),[Z,Y]),"context-menu"===z.type&&(Q=z.context),xt(null===(t=Q)||void 0===t?void 0:t.positionerRef,()=>T,[T]),xt(null===(n=Q)||void 0===n?void 0:n.actionsRef,()=>({setOpen:K}),[K]);const ee=Yp(J,{enabled:!F,bubbles:{escapeKey:p&&"menu"===z.type},outsidePress(){var e;return"context-menu"!==z.type||"contextmenu"===(null===(e=$.current)||void 0===e?void 0:e.type)||j.current},externalTree:U?R:void 0}),te=av(),ne=Et(e=>{C.select("activeIndex")!==e&&C.set("activeIndex",e)},[C]),re=am(J,{enabled:!F,listRef:C.context.itemDomElements,activeIndex:D,nested:void 0!==z.type,loopFocus:d,orientation:f,parentOrientation:"menubar"===z.type?z.context.orientation:void 0,rtl:"rtl"===te,disabledIndices:ud,onNavigate:ne,openOnArrowKeyDown:"context-menu"!==z.type,externalTree:U?R:void 0,focusItemOnHover:y}),oe=Et(e=>{C.context.typingRef.current=e},[C]),ie=um(J,{enabled:!F,listRef:C.context.itemLabels,elementsRef:C.context.itemDomElements,activeIndex:D,resetMs:500,onMatch:e=>{O&&e!==D&&C.set("activeIndex",e)},onTyping:oe}),le=Ct(()=>{const e=hp(ie.reference,re.reference,ee.reference,{onMouseMove(){C.set("allowMouseEnter",!0)}},G);return e["aria-haspopup"]="menu",e["aria-expanded"]=O,e},[C,ie.reference,re.reference,ee.reference,G,O]),se=Ct(()=>{const e=hp(re.trigger,ee.trigger,G);return e["aria-haspopup"]="menu",e["aria-expanded"]=!1,e},[re.trigger,ee.trigger,G]),ae=Ct(()=>hp(Vg,{id:I,role:"menu","aria-labelledby":null==M?void 0:M.id,onMouseMove(){C.set("allowMouseEnter",!0),"menu"===z.type&&C.set("hoverEnabled",!1)},onClick(){C.select("hoverEnabled")&&C.set("hoverEnabled",!1)},onKeyDown(e){const t=C.select("keyboardEventRelay");t&&!e.isPropagationStopped()&&t(e)}},ie.floating,re.floating,ee.floating),[M,I,z.type,C,ie.floating,re.floating,ee.floating]),ue=null!==(r=re.item)&&void 0!==r?r:cd;Hg(C,{floatingRootContext:J,activeTriggerProps:le,inactiveTriggerProps:se,popupProps:ae,itemProps:ue});const ce=Ct(()=>({store:C,parent:x}),[C,x]),de=Zo.jsx(MC.Provider,{value:ce,children:"function"==typeof o?o({payload:L}):o});return void 0===z.type||"context-menu"===z.type?Zo.jsx(Wp,{externalTree:R,children:de}):de});function XC(e){const{render:t,className:n,style:r,state:o=cd,props:i=ud,refs:l=ud,metadata:s,stateAttributesMapping:a,tag:u="div",...c}=e,{compositeProps:d,compositeRef:f}=function(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Rv(),{ref:o,index:i}=hy(e),l=n===i,s=St(null),a=Mc(o,s);return{compositeProps:{tabIndex:l?0:-1,onFocus(){r(i)},onMouseMove(){const e=s.current;if(!t||!e)return;const n=e.hasAttribute("disabled")||"true"===e.ariaDisabled;l||n||e.focus()}},compositeRef:a,index:i}}({metadata:s});return Cp(u,e,{state:o,ref:[...l,f],props:[d,...i,c],stateAttributesMapping:a})}function YC(e){var t;return yd(e)&&e.hasAttribute("data-rootownerid")?null!==(t=e.getAttribute("data-rootownerid"))&&void 0!==t?t:void 0:Pd(e)?void 0:YC(Td(e))}const QC=Zt(nd(function(e,t){var n;const{render:r,className:o,style:i,disabled:l=!1,nativeButton:s=!0,id:a,openOnHover:u,delay:c=100,closeDelay:d=0,handle:f,payload:h,...p}=e,g=TC(!0),m=null!==(n=null==f?void 0:f.store)&&void 0!==n?n:null==g?void 0:g.store;if(!m)throw new Error(Vc(85));const v=Zm(a),y=m.useState("isTriggerActive",v),b=m.useState("floatingRootContext"),w=m.useState("isOpenedByTrigger",v),_=m.useState("triggerPopupId",v),S=St(null),x=function(){const e=FC(!0),t=TC(!0),n=qC();return Ct(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}(),C=Rv(!0),E=Vp(),I=Ct(()=>null!=E?E:new Np,[E]),R=$p(I),k=Lp(),{registerTrigger:P,isMountedByThisTrigger:O}=function(e,t,n,r){const o=n.useState("isMountedByTrigger",e),i=function(e,t){const n=St(null),r=St(null);return Et(o=>{if(void 0===e)return;let i=!1;if(null!==n.current){const e=n.current,o=r.current,l=t.context.triggerElements.getById(e);o&&l===o&&(t.context.triggerElements.delete(e),i=!0),n.current=null,r.current=null}if(null!==o&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o),i=!0),i){const e=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==e&&t.set("triggerCount",e)}},[t,e])}(e,n),l=kc(t=>{if(i(t),!t)return;const o=n.select("open"),l=n.select("activeTriggerId");l!==e?null==l&&o&&n.update({activeTriggerId:e,activeTriggerElement:t,...r}):n.update({activeTriggerElement:t,...o?r:null})});return _c(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:o}}(v,S,m,{payload:h,closeDelay:d,parent:x,floatingTreeRoot:I,floatingNodeId:R,floatingParentNodeId:k,keyboardEventRelay:null==C?void 0:C.relayKeyboardEvent}),M="menubar"===x.type,T=m.useState("disabled"),A=l||T||M&&x.context.disabled,{getButtonProps:F,buttonRef:N}=kv({disabled:A,native:s});wt(()=>{w||void 0!==x.type||(m.context.allowMouseUpTriggerRef.current=!1)},[m,w,x.type]);const z=St(null),D=qd(),L=kc(e=>{if(!z.current)return;D.clear(),m.context.allowMouseUpTriggerRef.current=!1;const t=e.target;if(_f(z.current,t)||_f(m.select("positionerElement"),t)||t===z.current)return;if(null!=t&&YC(t)===m.select("rootId"))return;const n=Tv(z.current);e.clientX>=n.left-2&&e.clientX<=n.right+2&&e.clientY>=n.top-2&&e.clientY<=n.bottom+2||I.events.emit("close",{domEvent:e,reason:Bf})});wt(()=>{w&&m.select("lastOpenChangeReason")===Af&&Dd(z.current).addEventListener("mouseup",L,{once:!0})},[w,L,m]);const V=M&&x.context.hasSubmenuOpen,$=function(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:o=null,mouseOnly:i=!1,restMs:l=0,move:s=!0,triggerElementRef:a=om,externalTree:u,isActiveTrigger:c=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:h}=t,p="rootStore"in e?e.rootStore:e,{dataRef:g,events:m}=p.context,v=Vp(u),y=rm(p),b=St(!1),w=Fc(o),_=Fc(r),S=Fc(l),x=Fc(n),C=Fc(h),E=Fc(f),I=kc(()=>{var e;return Of(null===(e=g.current.openEvent)||void 0===e?void 0:e.type,y.interactedInside)}),R=kc(()=>{var e;return!1!==(null===(e=C.current)||void 0===e?void 0:e.call(C))}),k=kc((e,t,n)=>{const r=p.context.triggerElements;if(r.hasElement(t))return!e||!_f(e,t);if(!vd(n))return!1;const o=n;return r.hasMatchingElement(e=>_f(e,o))&&(!e||!_f(e,o))}),P=kc(()=>{y.handler&&(Dd(p.select("domReferenceElement")).removeEventListener("mousemove",y.handler),y.handler=void 0)}),O=kc(()=>{tm(y)});var M;return c&&(y.handleCloseOptions=null===(M=w.current)||void 0===M?void 0:M.__options),wt(()=>P,[P]),wt(()=>{if(n)return m.on("openchange",e),()=>{m.off("openchange",e)};function e(e){e.open?b.current=!1:(b.current=e.reason===Af,P(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}},[n,m,y,P]),wt(()=>{var e;if(!n)return;function t(e,t=!0){const n=kf(_.current,"close",y.pointerType);n?y.openChangeTimeout.start(n,()=>{p.setOpen(!1,Gf(Af,e)),null==v||v.events.emit("floating.closed",e)}):t&&(y.openChangeTimeout.clear(),p.setOpen(!1,Gf(Af,e)),null==v||v.events.emit("floating.closed",e))}const r=null!==(e=a.current)&&void 0!==e?e:c?p.select("domReferenceElement"):null;if(vd(r))return s?zd(Ld(r,"mousemove",o,{once:!0}),Ld(r,"mouseenter",o),Ld(r,"mouseleave",l)):zd(Ld(r,"mouseenter",o),Ld(r,"mouseleave",l));function o(e){var t,n,r;if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,i&&!hf(y.pointerType))return;const o=Pf(S.current),l=kf(_.current,"open",y.pointerType),s=Sf(e),a=null!==(t=e.currentTarget)&&void 0!==t?t:null,u=p.select("domReferenceElement");let c=a;if(vd(s)&&!p.context.triggerElements.hasElement(s))for(const e of p.context.triggerElements.elements())if(_f(e,s)){c=e;break}vd(a)&&vd(u)&&!p.context.triggerElements.hasElement(a)&&_f(a,u)&&(c=u);const d=null!=c&&k(u,c,s),f=p.select("open"),h=null!==(n=null===(r=E.current)||void 0===r?void 0:r.call(E))&&void 0!==n?n:"ending"===p.select("transitionStatus"),g=!f&&h&&b.current,m=!d&&vd(c)&&vd(u)&&_f(u,c)&&g,v=o>0&&!l,w=!f||d;d&&(f||g)||m?R()&&p.setOpen(!0,Gf(Af,e,c)):v||(l?y.openChangeTimeout.start(l,()=>{w&&R()&&p.setOpen(!0,Gf(Af,e,c))}):w&&R()&&p.setOpen(!0,Gf(Af,e,c)))}function l(e){var n;if(I())return void O();P();const r=Dd(p.select("domReferenceElement"));y.restTimeout.clear(),y.restTimeoutPending=!1;const o=null!==(n=g.current.floatingContext)&&void 0!==n?n:null==d?void 0:d();if(!xf(e.relatedTarget,p.context.triggerElements)){if(w.current&&o){p.select("open")||y.openChangeTimeout.clear();const n=a.current;return y.handler=w.current({...o,tree:v,x:e.clientX,y:e.clientY,onClose(){O(),P(),x.current&&!I()&&n===p.select("domReferenceElement")&&t(e,!0)}}),r.addEventListener("mousemove",y.handler),void y.handler(e)}("touch"!==y.pointerType||!_f(p.select("floatingElement"),e.relatedTarget))&&t(e)}}},[P,O,g,_,p,n,w,y,c,k,I,i,s,S,a,v,x,d,E,R]),Ct(()=>{if(n)return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){var t;const{nativeEvent:n}=e,r=e.currentTarget,o=p.select("domReferenceElement"),l=p.select("open"),s=k(o,r,e.target);if(i&&!hf(y.pointerType))return;if(l&&s&&null!==(t=y.handleCloseOptions)&&void 0!==t&&t.blockPointerEvents){const e=p.select("floatingElement");if(e){var a,u,c;const t=null!==(a=null===(u=y.handleCloseOptions)||void 0===u||null===(c=u.getScope)||void 0===c?void 0:c.call(u))&&void 0!==a?a:r.ownerDocument.body;nm(y,{scopeElement:t,referenceElement:r,floatingElement:e})}}const d=Pf(S.current);function f(){if(y.restTimeoutPending=!1,I())return;const e=p.select("open");y.blockMouseMove||e&&!s||!R()||p.setOpen(!0,Gf(Af,n,r))}l&&!s||0===d||!s&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2||(y.restTimeout.clear(),"touch"===y.pointerType?Fn(()=>{f()}):s&&l?f():(y.restTimeoutPending=!0,y.restTimeout.start(d,f)))}};function e(e){y.pointerType=e.pointerType}},[n,y,I,k,i,p,S,R])}(b,{enabled:(null!=u?u:V)&&!A&&"context-menu"!==x.type&&(!M||V&&!O),handleClose:gm({blockPointerEvents:!M}),mouseOnly:!0,move:!1,restMs:void 0===x.type?c:void 0,delay:{close:d},triggerElementRef:S,externalTree:I,isActiveTrigger:y,isClosing:()=>"ending"===m.select("transitionStatus")}),j=function(e,t){const n=qd(),[r,o]=yt(!1);return _c(()=>{e&&"trigger-hover"===t?(o(!0),n.start(500,()=>{o(!1)})):e||(n.clear(),o(!1))},[e,t,n]),r}(w,m.select("lastOpenChangeReason")),W=Jp(b,{enabled:!A&&"context-menu"!==x.type,event:w&&M?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:void 0===x.type&&j}),H=function(e,t={}){const{enabled:n=!0,delay:r}=t,o="rootStore"in e?e.rootStore:e,{events:i,dataRef:l}=o.context,s=St(!1),a=St(null),u=St(!0),c=qd();wt(()=>{const e=o.select("domReferenceElement");if(!n)return;const t=pd(e);return zd(Ld(t,"blur",function(){const e=o.select("domReferenceElement");!o.select("open")&&yd(e)&&e===wf(Dd(e))&&(s.current=!0)}),Yg&&Ld(t,"keydown",function(){u.current=!0},!0),Yg&&Ld(t,"pointerdown",function(){u.current=!1},!0))},[o,n]),wt(()=>{if(n)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){if(e.reason===Tf||e.reason===Wf){const e=o.select("domReferenceElement");vd(e)&&(a.current=e,s.current=!0)}}},[i,n,o]);const d=Ct(()=>{function e(){s.current=!1,a.current=null}return{onMouseLeave(){e()},onFocus(t){const n=t.currentTarget;if(s.current){if(a.current===n)return;e()}const i=Sf(t.nativeEvent);if(vd(i))if(Yg&&!t.relatedTarget){if(!u.current&&!Ef(i))return}else if(!function(e){if(!e||uf)return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}(i))return;const l=xf(t.relatedTarget,o.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,h="function"==typeof r?r():r;o.select("open")&&l||0===h||void 0===h?o.setOpen(!0,Gf(Ff,d,f)):c.start(h,()=>{s.current||o.setOpen(!0,Gf(Ff,d,f))})},onBlur(t){e();const n=t.relatedTarget,r=t.nativeEvent,i=vd(n)&&n.hasAttribute(Zh("focus-guard"))&&"outside"===n.getAttribute("data-type");c.start(0,()=>{var e;const t=o.select("domReferenceElement"),s=wf(Dd(t));(n||s!==t)&&(_f(null===(e=l.current.floatingContext)||void 0===e?void 0:e.refs.floating.current,s)||_f(t,s)||i||xf(null!=n?n:s,o.context.triggerElements)||o.setOpen(!1,Gf(Ff,r)))})}}},[l,r,o,c]);return Ct(()=>n?{reference:d,trigger:d}:{},[n,d])}(b,{enabled:!A&&V}),B=function(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,o=St(!1);return Ct(()=>t?{onMouseDown:e=>{("open"===n&&!r||"close"===n&&r)&&(o.current=!0,Dd(e.currentTarget).addEventListener("click",()=>{o.current=!1},{once:!0}))},onClick:e=>{o.current&&(o.current=!1,e.preventBaseUIHandler())}}:cd,[t,n,r])}({open:w,enabled:M,mouseDownAction:"open"}),U=Ct(()=>hp(H.reference,W.reference),[H.reference,W.reference]),q=m.useState("triggerProps",O),{preFocusGuardRef:G,handlePreFocusGuardFocus:Z,handleFocusTargetFocus:K}=function(e,t){const n=St(null);return{preFocusGuardRef:n,handlePreFocusGuardFocus:function(t){Fn(()=>{e.setOpen(!1,Gf(jf,t.nativeEvent,t.currentTarget))});const r=Hh(n.current,-1);null==r||r.focus()},handleFocusTargetFocus:function(n){const r=e.select("positionerElement");if(r&&Bh(n,r)){var o;null===(o=e.context.beforeContentFocusGuardRef.current)||void 0===o||o.focus()}else{var i;Fn(()=>{e.setOpen(!1,Gf(jf,n.nativeEvent,n.currentTarget))});let o=Hh(e.context.triggerFocusTargetRef.current||t.current,1);for(;null!==o&&_f(r,o);){const e=o;if(o=jh(o),o===e)break}null===(i=o)||void 0===i||i.focus()}}}}(m,S),J={disabled:A,open:w},X=[z,t,N,P,S],Y=[U,null!=$?$:cd,q,{"aria-haspopup":"menu","aria-controls":_,id:v,onMouseDown:e=>{m.select("open")||(D.start(200,()=>{m.context.allowMouseUpTriggerRef.current=!0}),Dd(e.currentTarget).addEventListener("mouseup",L,{once:!0}))}},M?{role:"menuitem"}:{},B,p,F],Q=Cp("button",e,{enabled:!M,stateAttributesMapping:wv,state:J,ref:X,props:Y});return M?Zo.jsx(XC,{tag:"button",render:r,className:o,style:i,state:J,refs:X,props:Y,stateAttributesMapping:wv}):w?Zo.jsxs(Ae,{children:[Zo.jsx(Kf,{ref:G,onFocus:Z},`${v}-pre-focus-guard`),Zo.jsx(Ae,{children:Q},v),Zo.jsx(Kf,{ref:m.context.triggerFocusTargetRef,onFocus:K},`${v}-post-focus-guard`)]}):Zo.jsx(Ae,{children:Q},v)})),eE=({columnId:e,columnName:t,canSort:n,multiSortEnabled:r,sorting:o,onSortingChange:i})=>{var l,s;const{i18n:a}=si(),u=Ct(()=>o.find(t=>t.id===e),[o,e]),c=Ct(()=>o.findIndex(t=>t.id===e),[o,e]),d=u&&!u.desc,f=u&&u.desc,h=(null===(l=o[0])||void 0===l?void 0:l.columnName)||"",p=(null===(s=o[1])||void 0===s?void 0:s.columnName)||"",g=Et(n=>{const l=n?d:f,s={id:e,columnName:t,desc:n},a=r?2:1;if(n?f:d)i(o.filter(t=>t.id!==e));else if(l){const t=o.map(t=>t.id===e?{...t,desc:n}:t);i(t)}else{const e=r&&o.length>0?[o[0],s]:[s];i(((e,t)=>{const n=new Set,r=[];for(const o of e)if(!n.has(o.id)&&(n.add(o.id),r.push(o),r.length>=t))break;return r})(e,a))}},[e,t,o,i,d,f,r]),m=Et(()=>{var n;const r=null!==(n=null==u?void 0:u.desc)&&void 0!==n&&n;if(u&&1===c){const e=[...o],t=e[0];e[0]={...u,desc:r},e[1]=t,i(e)}else u||1!==o.length||i([{id:e,columnName:t,desc:!1},...o])},[e,t,u,c,o,i]),v=Et(()=>{var n;const r=null!==(n=null==u?void 0:u.desc)&&void 0!==n&&n;if(u&&0===c){const e=[...o],t=e[1];e[1]={...u,desc:r},e[0]=t,i(e)}else u||1!==o.length||i([...o,{id:e,columnName:t,desc:!1}])},[e,t,u,c,o,i]),y=Et(()=>{const n=[...o];n[0]={id:e,columnName:t,desc:!1},i(n)},[e,t,o,i]),b=Et(()=>{const n=[...o];n[1]={id:e,columnName:t,desc:!1},i(n)},[e,t,o,i]),w=Ct(()=>r?0===o.length?{switchToPrimary:!1,switchToSecondary:!1,addAsPrimary:!1,addAsSecondary:!1,replacePrimary:!1,replaceSecondary:!1}:u?2===o.length?{switchToPrimary:1===c,switchToSecondary:0===c,addAsPrimary:!1,addAsSecondary:!1,replacePrimary:!1,replaceSecondary:!1}:{switchToPrimary:!1,switchToSecondary:!1,addAsPrimary:!1,addAsSecondary:!1,replacePrimary:!1,replaceSecondary:!1}:1===o.length?{switchToPrimary:!1,switchToSecondary:!1,addAsPrimary:!0,addAsSecondary:!0,replacePrimary:!1,replaceSecondary:!1}:2===o.length?{switchToPrimary:!1,switchToSecondary:!1,addAsPrimary:!1,addAsSecondary:!1,replacePrimary:!0,replaceSecondary:!0}:{switchToPrimary:!1,switchToSecondary:!1,addAsPrimary:!1,addAsSecondary:!1,replacePrimary:!1,replaceSecondary:!1}:{switchToPrimary:!1,switchToSecondary:!1,addAsPrimary:!1,addAsSecondary:!1,replacePrimary:!1,replaceSecondary:!1},[u,r,c,o.length]);return n?Wo(DC,{className:"barn2-sort-section",children:[Wo(LC,{className:"barn2-sort-section-header",render:Wo("div",{}),children:Wo("span",{className:"barn2-sort-section-label",children:a.sort})}),Wo(VC,{className:ri("barn2-sort-menu-item",d&&"barn2-sort-menu-item-active"),onClick:()=>g(!1),children:[Wo("span",{children:a.sortAscending}),d&&Wo(Iy,{className:"barn2-sort-menu-check"})]}),Wo(VC,{className:ri("barn2-sort-menu-item",f&&"barn2-sort-menu-item-active"),onClick:()=>g(!0),children:[Wo("span",{children:a.sortDescending}),f&&Wo(Iy,{className:"barn2-sort-menu-check"})]}),w.switchToPrimary&&Wo(VC,{className:"barn2-sort-menu-item",onClick:m,children:Wo("span",{children:a.switchToPrimarySort})}),w.switchToSecondary&&Wo(VC,{className:"barn2-sort-menu-item",onClick:v,children:Wo("span",{children:a.switchToSecondarySort})}),w.addAsPrimary&&Wo(VC,{className:"barn2-sort-menu-item",onClick:m,children:Wo("span",{children:a.setAsPrimarySort})}),w.addAsSecondary&&Wo(VC,{className:"barn2-sort-menu-item",onClick:v,children:Wo("span",{children:a.setAsSecondarySort})}),w.replacePrimary&&Wo(VC,{className:"barn2-sort-menu-item",onClick:y,children:Wo("span",{children:a.replacePrimarySort({columnName:h})})}),w.replaceSecondary&&Wo(VC,{className:"barn2-sort-menu-item",onClick:b,children:Wo("span",{children:a.replaceSecondarySort({columnName:p})})})]}):null},tE=({filter:e,value:t,onChange:n,filterCounts:r,showCounts:o=!0})=>{const{i18n:i}=si(),l=St(null),[s,a]=yt(""),u=!0===e.multiple,{sortedItems:c,selectedItems:d,selectedValues:f,firstUnselectedIndex:h,showSeparator:p}=Ty({options:e.options,filterCounts:r,value:t,multiple:!0}),g=Et(e=>{a(""),e&&0!==e.length?n(e.map(e=>e.value)):n(null)},[n]),m=Et(e=>{a(""),n(e?e.value:null)},[n]),v=Et(e=>e?e.label||String(e.value):"",[]),y=Et(e=>{e.preventDefault(),e.stopPropagation(),n(null)},[n]),b=Et(e=>{e.stopPropagation()},[]),w=Et(e=>{const t=c.some(t=>(t.label||String(t.value))===e);a(t?"":e)},[c]),_=f.size>0,S=c.length>9;if(u)return Wo("div",{className:"barn2-filter-section",onKeyDown:b,ref:l,children:Wo(cv,{multiple:!0,open:!0,items:c,value:d,onValueChange:g,itemToStringLabel:v,inputValue:s,onInputValueChange:w,children:[Wo("div",{className:"barn2-filter-section-header",children:[Wo("span",{className:"barn2-filter-section-label",children:i.filterBy({filterName:e.name})}),_&&Wo("button",{type:"button",className:"barn2-filter-clear-btn",onClick:y,children:i.clear})]}),S&&Wo("div",{className:"barn2-filter-search-wrapper",children:[Wo(Py,{className:"barn2-filter-search-icon"}),Wo(Mv,{className:"barn2-filter-search-input",placeholder:i.searchFilterPlaceholder({filterName:e.name}),"aria-label":i.searchFilter({filterName:e.name})})]}),Wo("div",{className:"barn2-filter-options-list barn2-filter-popup--embedded",children:[Wo(Sy,{className:"barn2-filter-empty",children:i.noResultsFound}),Wo(jv,{className:"barn2-filter-list",children:(e,t)=>Wo(Ae,{children:[t.index===h&&p&&Wo(Ay,{className:"barn2-filter-separator"}),Wo(by,{value:e,className:"barn2-filter-option",children:[Wo("div",{className:"barn2-filter-checkbox",children:Wo(wy,{children:Wo(Iy,{"aria-hidden":"true"})})}),Wo(Fy,{item:e,className:"barn2-filter-option-text",prefixClassName:"barn2-filter-hierarchy-prefix",countClassName:"barn2-filter-item-count",showCounts:o})]},String(e.value))]})})]})]})});const x=d.length>0?d[0]:null;return Wo("div",{className:"barn2-filter-section",onKeyDown:b,ref:l,children:Wo(cv,{open:!0,items:c,value:x,onValueChange:m,itemToStringLabel:v,inputValue:s,onInputValueChange:w,children:[Wo("div",{className:"barn2-filter-section-header",children:[Wo("span",{className:"barn2-filter-section-label",children:i.filterBy({filterName:e.name})}),_&&Wo("button",{type:"button",className:"barn2-filter-clear-btn",onClick:y,children:i.clear})]}),S&&Wo("div",{className:"barn2-filter-search-wrapper",children:[Wo(Py,{className:"barn2-filter-search-icon"}),Wo(Mv,{className:"barn2-filter-search-input",placeholder:i.searchFilterPlaceholder({filterName:e.name}),"aria-label":i.searchFilter({filterName:e.name})})]}),Wo("div",{className:"barn2-filter-options-list barn2-filter-popup--embedded",children:[Wo(Sy,{className:"barn2-filter-empty",children:i.noResultsFound}),Wo(jv,{className:"barn2-filter-list",children:(e,t)=>Wo(Ae,{children:[t.index===h&&p&&Wo(Ay,{className:"barn2-filter-separator"}),Wo(by,{value:e,className:"barn2-filter-option",children:[Wo(wy,{className:"barn2-filter-indicator",children:Wo(Iy,{"aria-hidden":"true"})}),Wo(Fy,{item:e,className:"barn2-filter-option-text",prefixClassName:"barn2-filter-hierarchy-prefix",countClassName:"barn2-filter-item-count",showCounts:o})]},String(e.value))]})})]})]})})},nE=({column:e,columnName:t,sorting:n,multiSortEnabled:r,onSortingChange:o,onSingleSortClick:i,inlineFilter:l,filterValue:s,onFilterChange:a,filterCounts:u,showCounts:c=!0})=>{const d=e.id,{displayMode:f,i18n:h}=si(),p=e.getCanSort(),g=Ct(()=>n.find(e=>e.id===d),[n,d]),m=!!g,v=null!=g&&g.desc?"desc":g?"asc":"none",y=r||l,b=Et(e=>{e.stopPropagation()},[]),w=Et(t=>{if(t.stopPropagation(),!p)return;if(!y&&i)return void i(d);const n=e.getToggleSortingHandler();n&&n(t)},[p,e,d,i,y]),_=p&&l;return Wo("div",y?{className:"header-menu",onClick:b,children:Wo(JC,{modal:!1,children:[Wo(QC,{className:ri("header-menu-trigger",m&&"header-menu-trigger-active"),"aria-label":h.columnOptionsFor({columnName:t}),children:Wo(rE,{direction:v})}),Wo(HC,{children:Wo(BC,{className:"barn2-header-menu-positioner",positionMethod:"fixed",sideOffset:4,side:"bottom",align:"end",children:Wo(jC,{className:"barn2-header-menu-popup","data-display-mode":f,children:[p&&Wo(eE,{columnId:d,columnName:t,canSort:p,multiSortEnabled:r,sorting:n,onSortingChange:o}),_&&Wo(Ey,{className:"barn2-header-menu-separator"}),l&&a&&Wo(tE,{filter:l,value:null!=s?s:null,onChange:a,filterCounts:u,showCounts:c})]})})})]})}:{className:"header-menu",children:Wo("button",{type:"button",className:ri("header-menu-trigger","header-menu-trigger-indicator-only",m&&"header-menu-trigger-active"),onClick:w,"aria-label":h.sortByColumn({columnName:t}),children:Wo(rE,{direction:v})})})},rE=({direction:e})=>Wo("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:ri("header-menu-icon",`header-menu-icon-${e}`),"aria-hidden":"true",children:[Wo("rect",{x:"1",y:"2.75",width:"12",height:"1.5",rx:"0.75",fill:"currentColor"}),Wo("rect",{x:"3",y:"6.25",width:"8",height:"1.5",rx:"0.75",fill:"currentColor"}),Wo("rect",{x:"5",y:"9.75",width:"4",height:"1.5",rx:"0.75",fill:"currentColor"})]});function oE({header:e,columnWidths:t,shouldShowDropdown:n,getColumnName:r,sortItems:o,multiSortEnabled:i,onSortingChange:l,onSingleSortClick:s,inlineFilterMap:a,currentFilters:u,onFilterChange:c,filterCounts:d,showCounts:f}){var h;const p=e.column.getCanSort(),g=e.column.id,m=a.get(g),v=n(g,p),y=t[g]||e.getSize(),b=m?null===(h=u.find(e=>e.id===m.id))||void 0===h?void 0:h.value:void 0,w=v&&(i||!!m),_=St(null),S=Et(()=>{var e;const t=null===(e=_.current)||void 0===e?void 0:e.querySelector(".header-menu-trigger");t instanceof HTMLElement&&t.click()},[]),x=w?S:p?()=>s(g):void 0;return Wo("th",{className:ri("table-header-cell",p&&"sortable",g&&"__responsive_control__"!==g?`col-${g.replace(/[^a-zA-Z0-9_-]/g,"")}`:""),"data-column-id":g,style:{width:y,maxWidth:y},children:e.isPlaceholder?null:Wo("div",{ref:v?_:void 0,className:v?"table-header-cell-wrapper":void 0,children:[Wo("div",{className:ri("table-header-content",(p||w)&&"clickable"),onClick:x,children:Wo("span",{className:"table-header-label",children:Nw(e.column.columnDef.header,e.getContext())})}),v&&Wo(nE,{column:e.column,columnName:r(g),sorting:o,multiSortEnabled:i,onSortingChange:l,onSingleSortClick:s,inlineFilter:m,filterValue:null!=b?b:null,onFilterChange:m?e=>c(m.id,e):void 0,filterCounts:m?My(d,m.id):void 0,showCounts:f})]})})}const iE=Ut(function({headerGroups:e,hidden:t,isSticky:n,stickyEnabled:r,asFooter:o,columnWidths:i,shouldShowDropdown:l,getColumnName:s,sortItems:a,multiSortEnabled:u,onSortingChange:c,onSingleSortClick:d,inlineFilterMap:f,currentFilters:h,onFilterChange:p,filterCounts:g,showCounts:m,style:v,className:y}){if(t)return null;const b=Wo(Ae,{children:e.map(e=>Wo("tr",{className:"table-header-row",children:e.headers.map(e=>Wo(oE,{header:e,columnWidths:i,shouldShowDropdown:l,getColumnName:s,sortItems:a,multiSortEnabled:u,onSortingChange:c,onSingleSortClick:d,inlineFilterMap:f,currentFilters:h,onFilterChange:p,filterCounts:g,showCounts:m},e.id))},e.id))});return Wo(o?"tfoot":"thead",{className:ri("table-header",o&&"table-footer",!r&&"table-header-not-sticky",n&&"table-header-fixed",y),style:v,children:b})}),lE=({value:e,rowData:t,className:n,columnConfig:r,filters:o,currentFilters:i,onFilterChange:l,allowClickToFilter:s=!0})=>{const a=Ct(()=>r?CC(r,{filters:o,onFilterChange:l,currentFilters:i,allowClickToFilter:s}):null,[r,o,l,i,s]);if(null==e||""===e)return Wo("div",{className:n,children:"—"});const u=a?a({getValue:()=>e,row:{original:t}}):(e=>{if("string"==typeof e)return Wo("span",{dangerouslySetInnerHTML:{__html:e}});if(mC(e))return Wo(cC,{data:e,columnId:"",clickToFilter:!1});if(gC(e)){const t=e;return t.thumbnail?Wo("img",{src:t.thumbnail,alt:t.alt||"",style:{width:"70px",height:"70px",objectFit:"contain"}}):null}return"boolean"==typeof e?e?"true":"false":"number"==typeof e||"bigint"==typeof e||kn(e)?e:null})(e);return Wo("div",null==u||""===u?{className:n,children:"—"}:{className:n,children:u})},sE=({hiddenColumns:e,rowData:t,columnConfigById:n,filters:r,currentFilters:o,onFilterChange:i,rowIndex:l})=>0===e.length?null:Wo("ul",{className:"child-row-list","data-row-index":l,children:e.map(e=>Wo("li",{className:ri("child-row-item",e.columnId?`col-${e.columnId.replace(/[^a-zA-Z0-9_-]/g,"")}`:""),"data-column-id":e.columnId,children:[Wo("span",{className:"child-row-title",children:e.title}),Wo(lE,{value:e.data,rowData:t,className:"child-row-data",columnConfig:n.get(e.columnId),filters:r,currentFilters:o,onFilterChange:i,allowClickToFilter:!0})]},e.columnId))}),aE=({hiddenColumns:e,rowData:t,columnConfigById:n,filters:r,currentFilters:o,onFilterChange:i,rowIndex:l,visibleColumnCount:s,isVisible:a,display:u})=>{const{i18n:c}=si();return a||"childRowVisible"===u?0===e.length?null:Wo("tr",{className:ri("child-row","childRowVisible"===u&&"always-visible",a&&"shown"),"data-parent-row":l,role:"region","aria-label":c.additionalRowDetails,children:Wo("td",{colSpan:s,className:"child-row-cell",children:Wo("div",{className:"child-row-content",children:Wo(sE,{hiddenColumns:e,rowData:t,columnConfigById:n,filters:r,currentFilters:o,onFilterChange:i,rowIndex:l})})})}):null},uE=rt(!1),cE=rt(void 0);function dE(e){const t=It(cE);if(!1===e&&void 0===t)throw new Error(Vc(27));return t}const fE={..._v,...zg},hE=Zt(function(e,t){const{render:n,className:r,style:o,forceRender:i=!1,...l}=e,{store:s}=dE(),a=s.useState("open"),u=s.useState("nested"),c=s.useState("mounted");return Cp("div",e,{state:{open:a,transitionStatus:s.useState("transitionStatus")},ref:[s.context.backdropRef,t],stateAttributesMapping:fE,props:[{role:"presentation",hidden:!c,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:i||!u})}),pE=Zt(function(e,t){const{render:n,className:r,style:o,disabled:i=!1,nativeButton:l=!0,...s}=e,{store:a}=dE(),u=a.useState("open"),{getButtonProps:c,buttonRef:d}=kv({disabled:i,native:l});return Cp("button",e,{state:{disabled:i},ref:[t,d],props:[{onClick:function(e){u&&a.setOpen(!1,Gf(Df,e.nativeEvent))}},s,c]})});let gE=function(e){return e.nestedDialogs="--nested-dialogs",e}({}),mE=function(e){return e[e.open=fv.open]="open",e[e.closed=fv.closed]="closed",e[e.startingStyle=fv.startingStyle]="startingStyle",e[e.endingStyle=fv.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e}({});const vE=rt(void 0),yE={..._v,...zg,nestedDialogOpen:e=>e?{[mE.nestedDialogOpen]:""}:null},bE=Zt(function(e,t){var n;const{render:r,className:o,style:i,finalFocus:l,initialFocus:s,...a}=e,{store:u}=dE(),c=u.useState("descriptionElementId"),d=u.useState("disablePointerDismissal"),f=u.useState("floatingRootContext"),h=u.useState("popupProps"),p=u.useState("modal"),g=u.useState("mounted"),m=u.useState("nested"),v=u.useState("nestedOpenDialogCount"),y=u.useState("open"),b=u.useState("openMethod"),w=u.useState("titleElementId"),_=u.useState("transitionStatus"),S=u.useState("role"),x=f.useState("floatingId"),C=null!==(n=a.id)&&void 0!==n?n:x;!function(){if(void 0===It(vE))throw new Error(Vc(26))}(),Lg({open:y,ref:u.context.popupRef,onComplete(){var e,t;y&&(null===(e=(t=u.context).onOpenChangeComplete)||void 0===e||e.call(t,!0))}});const E=void 0===s?(I=u.context.popupRef,e=>"touch"!==e||I.current):s;var I;const R=v>0,k=u.useStateSetter("popupElement"),P=Cp("div",e,{state:{open:y,nested:m,transitionStatus:_,nestedDialogOpen:R},props:[h,{id:C,"aria-labelledby":null!=w?w:void 0,"aria-describedby":null!=c?c:void 0,role:S,...Vg,hidden:!g,onKeyDown(e){pb.has(e.key)&&e.stopPropagation()},style:{[gE.nestedDialogs]:v}},a],ref:[t,u.context.popupRef,k],stateAttributesMapping:yE});return Zo.jsx(Kp,{context:f,openInteractionType:b,disabled:!g,closeOnFocusOut:!d,initialFocus:E,returnFocus:l,modal:!1!==p,restoreFocus:"popup",children:P})}),wE=Zt(function(e,t){const{keepMounted:n=!1,...r}=e,{store:o}=dE(),i=o.useState("mounted"),l=o.useState("modal"),s=o.useState("open");return i||n?Zo.jsx(vE.Provider,{value:n,children:Zo.jsxs(Ap,{ref:t,...r,children:[i&&!0===l&&Zo.jsx(ey,{ref:o.context.internalBackdropRef,inert:Bv(!s)}),e.children]})}):null});function _E({store:e,parentContext:t,isDrawer:n}){var r,o,i;const l=e.useState("open"),s=e.useState("disablePointerDismissal"),a=e.useState("modal"),u=e.useState("popupElement"),c=e.useState("floatingRootContext"),[d,f]=yt(0),[h,p]=yt(0),g=0===d,m=Yp(c,{outsidePressEvent:()=>e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:"trap-focus"===a?"sloppy":"intentional",touch:"sloppy"},outsidePress(t){if(!e.context.outsidePressEnabledRef.current)return!1;if("button"in t&&0!==t.button)return!1;if("touches"in t&&1!==t.touches.length)return!1;const n=Sf(t);return!(!g||s)&&(!a||!e.context.internalBackdropRef.current&&!e.context.backdropRef.current||e.context.internalBackdropRef.current===n||e.context.backdropRef.current===n||_f(n,u)&&!(null!=n&&n.hasAttribute("data-base-ui-portal")))},escapeKey:g});sy(l&&!0===a,u),e.useContextCallback("onNestedDialogOpen",(e,t)=>{f(e),p(t)}),e.useContextCallback("onNestedDialogClose",()=>{f(0),p(0)}),wt(()=>(null!=t&&t.onNestedDialogOpen&&l&&t.onNestedDialogOpen(d+1,h+(n?1:0)),null!=t&&t.onNestedDialogClose&&!l&&t.onNestedDialogClose(),()=>{null!=t&&t.onNestedDialogClose&&l&&t.onNestedDialogClose()}),[n,l,d,h,t]);const v=null!==(r=m.reference)&&void 0!==r?r:cd,y=null!==(o=m.trigger)&&void 0!==o?o:cd,b=null!==(i=m.floating)&&void 0!==i?i:cd;return Hg(e,{activeTriggerProps:v,inactiveTriggerProps:y,popupProps:b,nestedOpenDialogCount:d,nestedOpenDrawerCount:h}),null}const SE={...Jg,modal:$c(e=>e.modal),nested:$c(e=>e.nested),nestedOpenDialogCount:$c(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:$c(e=>e.nestedOpenDrawerCount),disablePointerDismissal:$c(e=>e.disablePointerDismissal),openMethod:$c(e=>e.openMethod),descriptionElementId:$c(e=>e.descriptionElementId),titleElementId:$c(e=>e.titleElementId),viewportElement:$c(e=>e.viewportElement),role:$c(e=>e.role)};class xE extends dd{constructor(e,t,n=!1){const r=new Bg,o=function(e={}){return{...Ug(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}(e);o.floatingRootContext=function(e,t,n=!1){return new Og({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}(r,t,n),super(o,{popupRef:Te(),backdropRef:Te(),internalBackdropRef:Te(),outsidePressEnabledRef:{current:!0},triggerElements:r,onOpenChange:void 0,onOpenChangeComplete:void 0},SE),te(this,"setOpen",(e,t)=>{var n,r,o;if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},e||null!=t.trigger||null==this.state.activeTriggerId||(t.trigger=null!==(o=this.state.activeTriggerElement)&&void 0!==o?o:void 0),null===(n=(r=this.context).onOpenChange)||void 0===n||n.call(r,e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);const i={open:e};$g(i,e,t.trigger),this.update(i)})}static useStore(e,t){const n=function(e,t,n=!1){const r=up(),o=null!=Lp(),i=St(null);void 0===e&&null===i.current&&(i.current=t(r,o));const l=null!=e?e:i.current;return Mg({popupStore:l,treatPopupAsFloatingElement:n,floatingRootContext:l.state.floatingRootContext,floatingId:r,nested:o,onOpenChange:l.setOpen}),{store:l,internalStore:i.current}}(e,(e,n)=>new xE(t,e,n),!0).store;return n}}function CE(e){return function(e,t="dialog"){const{children:n,open:r,defaultOpen:o=!1,onOpenChange:i,onOpenChangeComplete:l,disablePointerDismissal:s=!1,modal:a=!0,actionsRef:u,handle:c,triggerId:d,defaultTriggerId:f=null}=e,h="drawer"===t,p="alert-dialog"===t,g=!!p||a,m=p||s,v=p?"alertdialog":"dialog",y=dE(!0),b={modal:g,disablePointerDismissal:m,nested:Boolean(y),role:v},w=xE.useStore(null==c?void 0:c.store,{open:o,openProp:r,activeTriggerId:f,triggerIdProp:d,...b});Sc(()=>{const e=void 0===r&&!1===w.state.open&&!0===o?{open:!0,activeTriggerId:f}:null;p?w.update(e?{...b,...e}:b):e&&w.update(e)}),w.useControlledProp("openProp",r),w.useControlledProp("triggerIdProp",d),w.useSyncedValues(b),w.useContextCallback("onOpenChange",i),w.useContextCallback("onOpenChangeComplete",l);const _=w.useState("open"),S=w.useState("mounted"),x=w.useState("payload");!function(e){const{store:t,actionsRef:n}=e,r=t.useState("open");!function(e,t){_c(()=>{t||null===e.state.openMethod||e.set("openMethod",null)},[t,e]),_c(()=>()=>{null!==e.state.openMethod&&e.set("openMethod",null)},[e])}(t,r),jg(t);const{forceUnmount:o}=Wg(r,t),i=Et(()=>{t.setOpen(!1,Gf(qf))},[t]);xt(n,()=>({unmount:o,close:i}),[o,i])}({store:w,actionsRef:u});const C=_||S,E=Ct(()=>({store:w}),[w]);return Zo.jsx(uE.Provider,{value:!1,children:Zo.jsxs(cE.Provider,{value:E,children:[C&&Zo.jsx(_E,{store:w,parentContext:null==y?void 0:y.store.context,isDrawer:h}),"function"==typeof n?n({payload:x}):n]})})}(e,It(uE)?"drawer":"dialog")}const EE=Zt(function(e,t){const{render:n,className:r,style:o,id:i,...l}=e,{store:s}=dE(),a=Zm(i);return s.useSyncedValueWithCleanup("titleElementId",a),Cp("h2",e,{ref:t,props:[{id:a},l]})}),IE=({allColumns:e,rowData:t,columnConfigById:n,filters:r,currentFilters:o,onFilterChange:i,allowClickToFilter:l=!1,isOpen:s,onClose:a,rowIndex:u=0,title:c})=>{const{displayMode:d,i18n:f}=si(),h=Ct(()=>c?e.filter(e=>"title"!==e.columnId):e,[e,c]);return 0===e.length?null:Wo(CE,{open:s,onOpenChange:e=>!e&&a(),children:Wo(wE,{children:[Wo(hE,{className:"barn2-responsive-modal-backdrop"}),Wo(bE,{className:"barn2-responsive-modal-popup","data-display-mode":d,children:Wo("div",{className:"barn2-responsive-modal-content",children:[Wo("div",{className:"barn2-responsive-modal-header",children:[Wo(EE,c?{className:"barn2-responsive-modal-title",dangerouslySetInnerHTML:{__html:c}}:{className:"barn2-responsive-modal-title",children:f.details}),Wo(pE,{className:"barn2-responsive-modal-close","aria-label":f.close,children:Wo(Ry,{})})]}),Wo("div",{className:"barn2-responsive-modal-body",children:Wo("ul",{className:"modal-details-list","data-row-index":u,children:h.map(e=>Wo("li",{className:ri("modal-details-item",e.columnId?`col-${e.columnId.replace(/[^a-zA-Z0-9_-]/g,"")}`:""),"data-column-id":e.columnId,children:[Wo("span",{className:"modal-details-title",children:e.title}),Wo(lE,{value:e.data,rowData:t,className:"modal-details-data",columnConfig:n.get(e.columnId),filters:r,currentFilters:o,onFilterChange:i,allowClickToFilter:l})]},e.columnId))})})]})})]})})};function RE({data:e,columns:t,features:n,state:r,totalPages:o,containerWidth:i,filters:l,filterCounts:s,onFilterChange:a,onSortingChange:u,onPaginationChange:c,onRowClick:d,wrapperRef:f,loading:h,rowSelection:p,infiniteScroll:g}){var m,v,y;const{i18n:b}=si(),w=St(null),_=null!==p,S=!1!==(null==p?void 0:p.selectAll.enabled),x=null!==(m=null==p?void 0:p.selectAll.label)&&void 0!==m?m:void 0,C=Ct(()=>JSON.stringify({pageIndex:r.pagination.pageIndex,sorting:r.sorting,filters:r.filters,search:r.search.query}),[r.pagination.pageIndex,r.sorting,r.filters,r.search.query]),E=n.header,I=n.scrollToTop,R=void 0!==g,{visibleColumnConfigs:k,columnWidths:P,widthsReady:O,responsiveEnabled:M,hasHiddenColumns:T,shouldShowControl:A,isRowExpanded:F,toggleRow:N,getHiddenColumnsForRow:z,getAllColumnsForRow:D,responsiveConfig:L}=IC({columns:t,data:e,containerRef:w,containerWidth:i,responsiveConfig:n.responsive,loading:h,dataStateKey:C}),{isSticky:V,stickyStyle:$}=function({enabled:e,offset:t=0,tableRef:n}){const[r,o]=yt(!1),[i,l]=yt({}),[s,a]=yt([]),u=St(null),c=Et(()=>{if(!e||!n.current)return void o(!1);const r=n.current.querySelector("table"),i=null==r?void 0:r.querySelector("thead");if(!r||!i)return void o(!1);u.current=i;const s=r.getBoundingClientRect(),a=i.getBoundingClientRect(),c=a.bottom<t&&s.bottom>t+a.height;o(c),c&&l({position:"fixed",top:t,left:s.left,width:s.width,zIndex:1e3})},[e,t,n]),d=Et(()=>{if(!u.current)return;const e=u.current.querySelectorAll("th"),t=[];e.forEach(e=>{t.push(e.offsetWidth)}),a(t)},[]);return wt(()=>{if(!e||!n.current)return;c(),d();const t=()=>{c()},r=()=>{d(),c()};window.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",r);const o=n.current.querySelector("table");let i=null;return o&&(i=new ResizeObserver(()=>{d(),c()}),i.observe(o)),()=>{var e;window.removeEventListener("scroll",t),window.removeEventListener("resize",r),null===(e=i)||void 0===e||e.disconnect()}},[e,n,c,d]),wt(()=>{r&&d()},[r,d]),{isSticky:r,stickyStyle:i,columnWidths:s}}({enabled:E.sticky&&!E.hidden,offset:null!==(v=null==I?void 0:I.offset)&&void 0!==v?v:0,tableRef:w});RC({enabled:null!==I,offset:null!==(y=null==I?void 0:I.offset)&&void 0!==y?y:0,targetRef:f,stateKey:JSON.stringify({...!R&&{page:r.pagination.pageIndex},filters:r.filters,search:r.search.query}),loading:h});const[j,W]=yt(null),H=Ct(()=>(e=>{const t=new Map;return e.forEach(e=>{t.set(e.id,e)}),t})(t),[t]),B=Ct(()=>{if(!n.filtering.column||!l)return new Map;const e=new Map;return l.forEach(t=>{var n;const r=null!==(n=t.columnId)&&void 0!==n?n:t.id;H.has(r)&&e.set(r,t)}),e},[n.filtering.column,l,H]),U=Et(e=>{const t=H.get(e);return(null==t?void 0:t.header)||e},[H]),q=Ct(()=>((e,t)=>e.map(e=>({id:e.id,columnName:t(e.id),desc:e.desc})))(r.sorting,U),[r.sorting,U]),G=Et(e=>{u(e.map(({id:e,desc:t})=>({id:e,desc:t})))},[u]),Z=Et(e=>{const t=r.sorting.find(t=>t.id===e);u(t?[{id:e,desc:!t.desc}]:[{id:e,desc:!1}])},[u,r.sorting]),K=Et((e,t)=>B.has(e)||t,[B]),J=St(new Map),X=(re={count:e.length,estimateSize:()=>52,getScrollElement:()=>w.current,overscan:5,measureElement:"undefined"!=typeof window?e=>{if(!e)return 0;let t=e.getBoundingClientRect().height;const n=e.nextElementSibling;return n&&n.classList.contains("child-row")&&(t+=n.getBoundingClientRect().height),t}:void 0},function({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const o=bt(e=>e+1,0)[1],i=St({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=t,i.current.mode=n;const l=e=>{const t=i.current;if(!t.enabled||!t.container)return;const n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;const r=e.options.horizontal?"width":"height";t.container.style[r]=`${n}px`}const r=!!e.options.horizontal,o="transform"===t.mode,l=r?"left":"top",s=e.options.scrollMargin,a=e.getVirtualItems();for(const n of a){const i=n.start-s,a=e.elementsCache.get(n.key);a&&t.lastPositions.get(a)!==i&&(t.lastPositions.set(a,i),o?a.style.transform=r?`translate3d(${i}px, 0, 0)`:`translate3d(0, ${i}px, 0)`:a.style[l]=`${i}px`)}},s={...r,onChange:(t,n)=>{var s;const a=i.current;let u=!0;if(a.enabled){l(t);const e=t.range,n=a.prevRange;u=!n||n.isScrolling!==t.isScrolling||n.startIndex!==(null==e?void 0:e.startIndex)||n.endIndex!==(null==e?void 0:e.endIndex),u&&(a.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}u&&(e&&n?Fn(o):o()),null==(s=r.onChange)||s.call(r,t,n)}},[a]=yt(()=>{const e=new Jw(s);return Object.assign(e,{containerRef:t=>{const n=i.current;if(n.container=t,n.lastSize=null,t&&n.enabled){const r=e.getTotalSize();n.lastSize=r;const o=e.options.horizontal?"width":"height";t.style[o]=`${r}px`}}})});return a.setOptions(s),Yw(()=>a._didMount(),[]),Yw(()=>a._willUpdate()),Yw(()=>{l(a)}),a}({observeElementRect:Bw,observeElementOffset:Gw,scrollToFn:Kw,...re})),Y=Et(e=>{N(e),requestAnimationFrame(()=>{const t=J.current.get(e);t&&X.measureElement(t)})},[N,X]),Q=Ct(()=>{if(!_||!S)return null;const t=k.filter(e=>e.id!==fC),n=Math.min(e.length,50);for(const r of t){const t=r.accessor||r.id;for(let o=0;o<n;o++){const n=e[o],i=null==n?void 0:n[t];if("string"==typeof i&&i.includes("data-dv-row-selection-id"))return r.id}}for(const e of["buy","link"])if(t.some(t=>t.id===e))return e;return null},[_,S,k,e]),ee=Ct(()=>{var e,t;const n=((e,t)=>e.map(e=>((e,t)=>{const n={id:e.id,header:e.header,size:wC(e.width),enableSorting:!1!==e.sortable,enableHiding:!0,meta:{dataType:e.dataType,filterable:!1!==e.filterable,searchable:!1!==e.searchable,...e.metadata}};return e.accessor?n.accessorKey=e.accessor:n.accessorKey=e.id,n.cell=CC(e,t),e.tanstackColumn&&Object.assign(n,e.tanstackColumn),n})(e,t)))(k.filter(e=>e.id!==fC),{filters:l,onFilterChange:a,currentFilters:r.filters}),o=_&&S&&Q?n.map(e=>{if(e.id!==Q)return e;const t=e.header,n=null!=t;return{...e,header:e=>Wo("span",{className:ri("dv-select-all-header",n&&"dv-select-all-header--with-title"),children:[n&&Wo("span",{className:"dv-select-all-header__title",children:"function"==typeof t?t(e):t}),Wo(kC,{columnId:Q,label:x})]})}}):n,i=(e=>{const t=[],n=e.responsive;return n&&n.enabled&&"column"===n.controlType&&n.shouldShowControl&&t.push({id:fC,header:()=>null,cell:({row:e})=>Wo(dC,{isExpanded:n.isRowExpanded(e.id),onClick:()=>{"modal"===n.displayMode?n.onOpenModal(e.index):n.onToggleRow(e.id)},type:"column",hasHiddenColumns:n.hasHiddenColumns}),size:50,enableSorting:!1,enableHiding:!1,meta:{isResponsiveControl:!0}}),t})({responsive:M?{enabled:M,controlType:null!==(e=null==L?void 0:L.control)&&void 0!==e?e:"inline",displayMode:null!==(t=null==L?void 0:L.display)&&void 0!==t?t:"childRow",shouldShowControl:A,hasHiddenColumns:T,isRowExpanded:F,onToggleRow:Y,onOpenModal:W}:null});return i.length>0?[...i,...o]:o},[k,l,a,r.filters,_,S,x,Q,M,L,A,F,T,Y,W]),te=function(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=yt(()=>({current:Fw(t)})),[r,o]=yt(()=>n.current.initialState);return n.current.setOptions(t=>({...t,...e,state:{...r,...e.state},onStateChange:t=>{o(t),null==e.onStateChange||e.onStateChange(t)}})),n.current}({data:e,columns:ee,getCoreRowModel:e=>Wb(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(t,o,i){void 0===o&&(o=0);const l=[];for(let a=0;a<t.length;a++){const u=Zb(e,e._getRowId(t[a],a,i),t[a],a,o,0,null==i?void 0:i.id);var s;n.flatRows.push(u),n.rowsById[u.id]=u,l.push(u),e.options.getSubRows&&(u.originalSubRows=e.options.getSubRows(t[a],a),null!=(s=u.originalSubRows)&&s.length&&(u.subRows=r(u.originalSubRows,o+1,u)))}return l};return n.rows=r(t),n},Hb(e.options,"debugTable",0,()=>e._autoResetPageIndex())),getSortedRowModel:e=>Wb(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const r=e.getState().sorting,o=[],i=r.filter(t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()}),l={};i.forEach(t=>{const n=e.getColumn(t.id);n&&(l[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})});const s=e=>{const t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let r=0;r<i.length;r+=1){var n;const o=i[r],s=l[o.id],a=s.sortUndefined,u=null!=(n=null==o?void 0:o.desc)&&n;let c=0;if(a){const n=void 0===e.getValue(o.id),r=void 0===t.getValue(o.id);if(n||r){if("first"===a)return n?-1:1;if("last"===a)return n?1:-1;c=n&&r?0:n?a:-a}}if(0===c&&(c=s.sortingFn(e,t,o.id)),0!==c)return u&&(c*=-1),s.invertSorting&&(c*=-1),c}return e.index-t.index}),t.forEach(e=>{var t;o.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=s(e.subRows))}),t};return{rows:s(n.rows),flatRows:o,rowsById:n.rowsById}},Hb(e.options,"debugTable",0,()=>e._autoResetPageIndex())),getFilteredRowModel:e=>Wb(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||(null==n||!n.length)&&!r){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const o=[],i=[];(null!=n?n:[]).forEach(t=>{var n;const r=e.getColumn(t.id);if(!r)return;const i=r.getFilterFn();i&&o.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value})});const l=(null!=n?n:[]).map(e=>e.id),s=e.getGlobalFilterFn(),a=e.getAllLeafColumns().filter(e=>e.getCanGlobalFilter());let u,c;r&&s&&a.length&&(l.push("__global__"),a.forEach(e=>{var t;i.push({id:e.id,filterFn:s,resolvedValue:null!=(t=null==s.resolveFilterValue?void 0:s.resolveFilterValue(r))?t:r})}));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},o.length)for(let e=0;e<o.length;e++){u=o[e];const t=u.id;n.columnFilters[t]=u.filterFn(n,t,u.resolvedValue,e=>{n.columnFiltersMeta[t]=e})}if(i.length){for(let e=0;e<i.length;e++){c=i[e];const t=c.id;if(c.filterFn(n,t,c.resolvedValue,e=>{n.columnFiltersMeta[t]=e})){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return function(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){var r;const o=[],i={},l=null!=(r=n.options.maxLeafRowFilterDepth)?r:100,s=function(e,r){void 0===r&&(r=0);const a=[];for(let c=0;c<e.length;c++){var u;let d=e[c];const f=Zb(n,d.id,d.original,d.index,d.depth,0,d.parentId);if(f.columnFilters=d.columnFilters,null!=(u=d.subRows)&&u.length&&r<l){if(f.subRows=s(d.subRows,r+1),d=f,t(d)&&!f.subRows.length){a.push(d),i[d.id]=d,o.push(d);continue}if(t(d)||f.subRows.length){a.push(d),i[d.id]=d,o.push(d);continue}}else d=f,t(d)&&(a.push(d),i[d.id]=d,o.push(d))}return a};return{rows:s(e),flatRows:o,rowsById:i}}(e,t,n):function(e,t,n){var r;const o=[],i={},l=null!=(r=n.options.maxLeafRowFilterDepth)?r:100,s=function(e,r){void 0===r&&(r=0);const a=[];for(let c=0;c<e.length;c++){let d=e[c];if(t(d)){var u;if(null!=(u=d.subRows)&&u.length&&r<l){const e=Zb(n,d.id,d.original,d.index,d.depth,0,d.parentId);e.subRows=s(d.subRows,r+1),d=e}a.push(d),o.push(d),i[d.id]=d}}return a};return{rows:s(e),flatRows:o,rowsById:i}}(e,t,n)}(t.rows,e=>{for(let t=0;t<l.length;t++)if(!1===e.columnFilters[l[t]])return!1;return!0},e)},Hb(e.options,"debugTable",0,()=>e._autoResetPageIndex())),manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableMultiSort:n.sorting.multi,maxMultiSortColCount:n.sorting.multi?2:1,pageCount:o,getRowId:(e,t)=>String(e&&"object"==typeof e&&"id"in e?e.id:t),state:{pagination:r.pagination,sorting:r.sorting.map(e=>({id:e.id,desc:e.desc}))},onSortingChange:e=>{const t=r.sorting.map(e=>({id:e.id,desc:e.desc})),n="function"==typeof e?e(t):e;u(n)},onPaginationChange:e=>{const t="function"==typeof e?e(r.pagination):e;c(t)}}),ne=Et(e=>{if(e&&R&&null!=g&&g.fetchNextPage){const{scrollHeight:t,scrollTop:n,clientHeight:r}=e;t-n-r<500&&!g.isFetchingNextPage&&g.hasNextPage&&g.fetchNextPage()}},[g,R]);var re;wt(()=>{if(!R)return;const e=w.current;if(!e)return;const t=()=>ne(e);return e.addEventListener("scroll",t,{passive:!0}),()=>e.removeEventListener("scroll",t)},[R,ne]),wt(()=>{e.length>0&&X&&requestAnimationFrame(()=>{J.current.forEach(e=>{X.measureElement(e)})})},[e,X]);const oe=Et(()=>{var e;const{rows:t}=te.getRowModel(),n=X.getVirtualItems(),o=X.getTotalSize(),i=n[0],s=n[n.length-1],u=null!==(e=null==i?void 0:i.start)&&void 0!==e?e:0,c=s?Math.max(o-s.end,0):0,f=te.getVisibleLeafColumns().length||k.length,h=(e,t)=>t<=0?null:Wo("tr",{className:"virtual-spacer-row","aria-hidden":"true",children:Wo("td",{colSpan:f,style:{border:0,height:`${t}px`,lineHeight:0,padding:0}})},e);return Wo("tbody",{children:[h("top-spacer",u),n.map(e=>{const n=t[e.index];if(!n)return null;const o=n.id,i=F(o),s=z(n.original,n.index),u=n.original.rowClass||"",c=e.index%2==1;return Wo(Ae,{children:[Wo("tr",{"data-index":e.index,"data-row-id":n.original.id||n.id,ref:e=>{e?(J.current.set(o,e),X.measureElement(e)):J.current.delete(o)},onClick:()=>null==d?void 0:d(n.original),className:ri("table-row",c?"odd":"even",u,d&&"table-row-clickable",M&&T&&"responsive-parent",i&&"expanded"),children:n.getVisibleCells().map((e,t)=>{const r=0===t,l=M&&"inline"===(null==L?void 0:L.control)&&r&&A;return Wo("td",{className:ri("table-cell",e.column.id&&"__responsive_control__"!==e.column.id?`col-${e.column.id.replace(/[^a-zA-Z0-9_-]/g,"")}`:""),"data-column-id":e.column.id,style:{width:P[e.column.id]||e.column.getSize(),maxWidth:P[e.column.id]||e.column.getSize()},children:Wo("div",{className:ri("cell-content",l&&"has-responsive-control"),children:[l&&Wo(dC,{isExpanded:i,onClick:()=>{"modal"===(null==L?void 0:L.display)?W(n.index):Y(o)},type:"inline",hasHiddenColumns:T}),Nw(e.column.columnDef.cell,e.getContext())]})},e.id)})}),M&&L&&("childRow"===L.display||"childRowVisible"===L.display)&&Wo(aE,{hiddenColumns:s,rowData:n.original,columnConfigById:H,filters:l,currentFilters:r.filters,onFilterChange:a,rowIndex:n.index,visibleColumnCount:n.getVisibleCells().length,isVisible:i,display:null==L?void 0:L.display},`${n.id}-child`)]},n.id)}),h("bottom-spacer",c)]})},[te,X,k.length,F,z,T,A,M,L,P,d,Y,H,l,r.filters,a]),ie=E.location,le="top"===ie||"both"===ie,se="bottom"===ie||"both"===ie,ae=E.hidden,ue=Ct(()=>({headerGroups:te.getHeaderGroups(),hidden:ae,stickyEnabled:E.sticky,asFooter:!1,columnWidths:P,shouldShowDropdown:K,getColumnName:U,sortItems:q,multiSortEnabled:n.sorting.multi,onSortingChange:G,onSingleSortClick:Z,inlineFilterMap:B,currentFilters:r.filters,onFilterChange:a,filterCounts:s,showCounts:n.filtering.showCounts}),[te,ae,E.sticky,P,K,U,q,n.sorting.multi,G,Z,B,r.filters,a,s,n.filtering.showCounts]),ce=Ct(()=>({...ue,hidden:!1,asFooter:!0}),[ue]),de=Et(()=>Wo(Ae,{children:[Wo("table",{className:"data-table",children:[le&&Wo(iE,{...ue,isSticky:!1}),oe(),se&&Wo(iE,{...ce,isSticky:!1})]}),V&&le&&Wo("div",{className:"barn2-table-header-fixed-wrapper is-visible",style:$,children:Wo("table",{className:"data-table",children:Wo(iE,{...ue,isSticky:!0})})}),R&&Wo("div",{className:"infinite-scroll-status",style:{textAlign:"center",padding:"20px",fontSize:"14px",color:"#666"},children:[(null==g?void 0:g.isFetchingNextPage)&&Wo("div",{children:b.loadingMoreItems}),!(null!=g&&g.hasNextPage)&&!(null!=g&&g.isFetchingNextPage)&&Wo("div",{children:b.allItemsLoaded})]}),!h&&0===e.length&&Wo("div",{className:"no-data",children:b.noDataAvailable})]}),[ue,ce,oe,V,$,R,g,e.length,le,se,b]),fe=Et(()=>{if(!M||"modal"!==(null==L?void 0:L.display)||null===j)return null;const t=e[j],n=null!=t&&t.title?String(t.title):void 0;return Wo(IE,{allColumns:D(t,j),rowData:t,columnConfigById:H,filters:l,currentFilters:r.filters,onFilterChange:a,allowClickToFilter:!1,isOpen:null!==j,onClose:()=>W(null),rowIndex:j,title:n})},[M,L,j,D,e,H,l,r.filters,a]);return{containerRef:w,renderContent:de,renderModal:fe,widthsReady:O}}const kE=({onLoadMore:e,hasMore:t,isLoading:n,loadingMessage:r,endMessage:o})=>{const{i18n:i}=si(),l=null!=r?r:i.loadingMore,s=null!=o?o:i.noMoreItemsToLoad,a=St(null);return wt(()=>{const r=a.current;if(!r)return;const o=new IntersectionObserver(r=>{r[0].isIntersecting&&t&&!n&&e()},{root:null,rootMargin:"500px",threshold:0});return o.observe(r),()=>{o.disconnect()}},[e,t,n]),Wo("div",t||n?{ref:a,className:"infinite-scroll-trigger",style:{textAlign:"center",padding:"20px",minHeight:"1px",display:"block"},children:n&&Wo("div",{className:"infinite-scroll-loading",style:{fontSize:"14px",color:"#666"},children:l})}:{className:"infinite-scroll-end",style:{textAlign:"center",padding:"20px",color:"#666",fontSize:"14px"},children:s})},PE={type:"full_numbers",perPageSelector:"bottom",documentCount:"bottom",pageNavigation:"bottom"},OE={adjacentPages:!0},ME={threshold:.8,pageSize:10,height:"70vh"},TE={control:"inline",display:"childRow",breakpoints:{}},AE={minCardWidth:226,gap:25,columns:"autosize"},FE={enabled:!0,offset:15};function NE(e){return!1===e?{adjacentPages:!1}:"object"==typeof e?{adjacentPages:null!==(t=e.adjacentPages)&&void 0!==t?t:OE.adjacentPages}:{...OE};var t}function zE(e){var t;const n=!1!==(null==e?void 0:e.stickyHeader),r=!0===(null==e?void 0:e.hideHeader),o=null!==(t=null==e?void 0:e.headerLocation)&&void 0!==t?t:"top";return{sticky:n&&"bottom"!==o,hidden:r,location:o}}function DE(e){return!1===e?null:void 0===e||!0===e?{...FE}:"object"==typeof e?!1===e.enabled?null:{enabled:!0,offset:null!==(t=e.offset)&&void 0!==t?t:FE.offset}:{...FE};var t}function LE(e){return{enabled:!1!==(null==e?void 0:e.sorting),multi:!0===(null==e?void 0:e.multiSort)}}function VE(e){var t,n;const r=null==e?void 0:e.filtering;if("object"!=typeof r)return{enabled:!1!==r,above:!1!==r,column:!1,showCounts:!0};const o=!1!==r.enabled;return{enabled:o,above:o&&(null===(t=r.above)||void 0===t||t),column:o&&null!==(n=r.column)&&void 0!==n&&n,showCounts:!1!==r.showCounts}}function $E(e){return void 0===e||!1===e?null:"object"==typeof e?{enabled:!1!==e.enabled}:{enabled:!0}}function jE(e,t){if("grid"===t)return null;if(void 0===e||!1===e)return null;if(!0===e)return{enabled:!0,actionButton:null,selectAll:{enabled:!0,label:null}};if("object"==typeof e){var n,r;if(!1===e.enabled)return null;const t=!1===e.selectAll?{enabled:!1,label:null}:!0===e.selectAll||void 0===e.selectAll?{enabled:!0,label:null}:{enabled:!1!==e.selectAll.enabled,label:null!==(n=e.selectAll.label)&&void 0!==n?n:null};return{enabled:!0,actionButton:e.actionButton?{label:e.actionButton.label,position:null!==(r=e.actionButton.position)&&void 0!==r?r:"top"}:null,selectAll:t}}return null}const WE=({config:e,className:t,containerStyle:n,onStateChange:r,onAction:o,actionLoading:i,initialSelections:l,onSelectionChange:s,actionButtonLabelOverride:a,features:u,onDisplayModeChange:c})=>{var d;const f=St(null),{displayMode:h,infiniteScroll:p,grid:g,hasLightboxColumn:m,prefetch:v}=u,y=null!==p,b="grid"===h,[w,_]=yt(0),S=Ct(()=>{var t,n,r,o;return{pagination:(null===(t=e.defaultState)||void 0===t?void 0:t.pagination)||{pageIndex:0,pageSize:(null==p?void 0:p.pageSize)||10},sorting:(null===(n=e.defaultState)||void 0===n?void 0:n.sorting)||[],filters:(null===(r=e.defaultState)||void 0===r?void 0:r.filters)||[],search:(null===(o=e.defaultState)||void 0===o?void 0:o.search)||{query:""}}},[e,null==p?void 0:p.pageSize]),{data:x,cardHtml:C,loading:E,isFetching:I,error:R,totalRows:k,totalPages:P,state:O,setState:M,refetch:T,hasNextPage:A,fetchNextPage:F,isFetchingNextPage:N,filterCounts:z}=(e=>{var t;const{serverUrl:n,fetchData:r,viewId:o,state:i,enabled:l=!0,refetchInterval:s,urlSync:a,infiniteScroll:u,prefetchAdjacentPages:c=!0,displayMode:d,extraRequestData:f}=e;if(u)return uc(e);const[h,p]=yt(0),g=St(r);wt(()=>{g.current!==r&&(g.current=r,p(e=>e+1))},[r]);const m=r?"fetchData":n||"missing-data-source",v=St(i||{pagination:{pageIndex:0,pageSize:10},sorting:[],filters:[],search:{query:""}}),y=Jo(),b=Ct(()=>{const e=v.current;if(null==a||!a.enabled)return e;const t=ic();if(!t)return e;const n=a.syncParams||["page","pageSize","filters","search","sorting"],r=oc(t,n,e);return{...e,...r,pagination:r.pagination?{...e.pagination,...r.pagination}:e.pagination,sorting:void 0!==r.sorting?r.sorting:e.sorting}},[]),[w,_]=yt(b);lc(w,_,a||{enabled:!1,syncParams:[]},v.current);const S=Et(e=>{_(t=>({...t,...e,pagination:e.filters||e.search||e.sorting?{...t.pagination,pageIndex:0,...e.pagination||{}}:{...t.pagination,...e.pagination||{}}}))},[]),{data:x,isLoading:C,isFetching:E,isPlaceholderData:I,error:R,refetch:k}=function(e){return ti(e,po)}({queryKey:dc(m,h,w,d,o),queryFn:()=>hc(fc(w,d,o),r,n,f),enabled:l,refetchInterval:s,placeholderData:e=>e,refetchOnWindowFocus:!1,staleTime:6e4,gcTime:3e5});return wt(()=>{if(!w.pagination)return;const e=w.pagination.pageIndex,t=(null==x?void 0:x.totalPages)||0;if((r||n)&&c){if(e<t-1){const t={...w,pagination:{...w.pagination,pageIndex:e+1}};y.prefetchQuery({queryKey:dc(m,h,t,d,o),queryFn:()=>hc(fc(t,d,o),r,n,f),staleTime:6e4})}if(e>0){const t={...w,pagination:{...w.pagination,pageIndex:e-1}};y.prefetchQuery({queryKey:dc(m,h,t,d,o),queryFn:()=>hc(fc(t,d,o),r,n,f),staleTime:6e4})}}},[null===(t=w.pagination)||void 0===t?void 0:t.pageIndex,null==x?void 0:x.totalPages,m,h,r,n,c,w,y,d,o,f]),Ct(()=>({data:(null==x?void 0:x.data)||[],cardHtml:null==x?void 0:x.cardHtml,loading:C,isFetching:E,isPlaceholderData:I,error:R,totalRows:(null==x?void 0:x.totalRows)||0,totalPages:(null==x?void 0:x.totalPages)||0,state:w,setState:S,refetch:k,filterCounts:null==x?void 0:x.filterCounts}),[x,C,E,I,R,w,S,k])})({serverUrl:e.serverUrl,fetchData:e.fetchData,viewId:e.viewId,state:S,enabled:!0,urlSync:e.urlSync,infiniteScroll:y,prefetchAdjacentPages:v.adjacentPages,displayMode:h,extraRequestData:e.extraRequestData});wt(()=>{null==r||r(O)},[O,r]);const D=Et((e,t)=>{const n=[...O.filters],r=n.findIndex(t=>t.id===e);null==t||Array.isArray(t)&&0===t.length?r>=0&&n.splice(r,1):r>=0?n[r]={id:e,value:t}:n.push({id:e,value:t}),M({filters:n})},[M,O.filters]),L=Et(e=>{M({search:{...O.search,query:e}})},[M,O.search]),V=Et(()=>{T()},[T]),$=Et(()=>{M({filters:[],search:{query:""}})},[M]),j=Et((e,t)=>{const n=O.filters.map(n=>{if(n.id!==e)return n;if(Array.isArray(n.value)){const e=n.value.filter(e=>e!==t);return e.length>0?{...n,value:e}:null}return null}).filter(e=>null!==e);M({filters:n})},[O.filters,M]),W=Et(()=>{M({search:{query:""}})},[M]),H=O.filters.length>0||O.search.query.length>0,B=null!==u.rowSelection,U=function({enabled:e,isActionLoading:t,initialSelections:n,onSelectionChange:r}){const[o,i]=yt(()=>null!=n?n:new Map),l=St(r);l.current=r,wt(()=>{var e;null===(e=l.current)||void 0===e||e.call(l,o)},[o]);const s=Et(t=>{e&&i(e=>{const n=new Map(e);return n.set(t.id,t),n})},[e]),a=Et(t=>{e&&i(e=>{const n=new Map(e);return n.delete(t),n})},[e]),u=Et(t=>{e&&0!==t.length&&i(e=>{const n=new Map(e);return t.forEach(e=>{n.set(e.id,e)}),n})},[e]),c=Et(()=>{e&&i(()=>new Map)},[e]),d=o.size;return Ct(()=>({selectedItems:o,selectItem:s,deselectItem:a,selectAll:u,deselectAll:c,containerRef:null,selectedCount:d,isActionLoading:t}),[o,s,a,u,c,d,t])}({enabled:B,isActionLoading:null!=i&&i,initialSelections:l,onSelectionChange:s}),q=Et(()=>{if(o){const e=Array.from(U.selectedItems.values());o({items:e,count:e.length})}},[o,U.selectedItems]),G=Et(e=>{M({sorting:e})},[M]),Z=Et(e=>{M({pagination:e})},[M]),K=Ct(()=>{if(b||!u.filtering.column||!e.filters)return new Map;const t=new Map,n=new Set(e.columns.map(e=>e.id));return e.filters.forEach(e=>{var r;const o=null!==(r=e.columnId)&&void 0!==r?r:e.id;n.has(o)&&t.set(o,e)}),t},[b,u.filtering.column,e.filters,e.columns]),J=Ct(()=>({handleSearch:L,handleSearchExecute:V,handleFilterChange:D,handleResetFilters:$,handleRemoveFilterValue:j,handleClearSearch:W,setDisplayMode:c,setPageSize:e=>M({pagination:{pageIndex:0,pageSize:e}}),setPage:e=>M({pagination:{...O.pagination,pageIndex:e}}),handleActionClick:q}),[L,V,D,$,j,W,q,c,M,O.pagination]),X=function({features:e,state:t,totalPages:n,totalRows:r,hasActiveFilters:o,filters:i,filterCounts:l,rowsPerPageOptions:s,customLayout:a,inlineFilterMap:u,rowSelection:c,selectedCount:d,isActionLoading:f,actionButtonLabelOverride:h,handlers:p}){return Ct(()=>{var u,g,m,v;const y=[],{pagination:b,viewSwitcherEnabled:w,displayMode:_}=e,S=null!==b,x=null!==(u=null==b?void 0:b.perPageSelector)&&void 0!==u?u:"bottom",C=null!==(g=null==b?void 0:b.documentCount)&&void 0!==g?g:"bottom",E=null!==(m=null==b?void 0:b.pageNavigation)&&void 0!==m?m:"bottom",I=(e,t,n,r,o)=>{!1!==n&&("both"!==n&&"top"!==n||y.push(vc(`${e}-top`,t,"top",r,o)),"both"!==n&&"bottom"!==n||y.push(vc(`${e}-bottom`,t,"bottom",r,o)))};if(e.searching&&y.push(vc("search",bc,"top",1,{slot:"search",value:t.search.query,onChange:p.handleSearch,onSearch:p.handleSearchExecute})),e.filtering.above&&i&&i.forEach((n,r)=>{var o;const i=n.multiple?zy:Ny,s=My(l,n.id);y.push(vc(`filter-${n.id}`,i,"top",2+r,{slot:"filters",filter:n,value:null===(o=t.filters.find(e=>e.id===n.id))||void 0===o?void 0:o.value,onChange:e=>p.handleFilterChange(n.id,e),onReset:()=>p.handleFilterChange(n.id,null),filterCounts:s,showCounts:e.filtering.showCounts}))}),w&&y.push(vc("view-switcher",Fb,"top",99,{slot:"actions",currentView:_,onViewChange:p.setDisplayMode})),e.filtering.enabled&&o&&y.push(vc("filter-reset",Dy,"top",52,{slot:"reset",onReset:p.handleResetFilters,hasActiveFilters:o})),null!==(v=e.activeFilters)&&void 0!==v&&v.enabled&&o&&y.push(vc("active-filters",Vy,"top",51,{slot:"active",filters:t.filters,search:t.search,filterConfigs:i||[],onRemoveFilter:p.handleRemoveFilterValue,onClearSearch:p.handleClearSearch})),S&&!1===x&&!1===C&&!1===E&&y.push(vc("table-info",Mb,"bottom",1,{currentPage:t.pagination.pageIndex,pageSize:t.pagination.pageSize,totalRows:r,rowsPerPageOptions:s,onPageSizeChange:p.setPageSize})),S&&b&&(I("per-page-selector",kb,x,1,{pageSize:t.pagination.pageSize,rowsPerPageOptions:s,onPageSizeChange:p.setPageSize}),I("document-count",Pb,C,2,{currentPage:t.pagination.pageIndex,pageSize:t.pagination.pageSize,totalRows:r}),n>1&&I("page-navigation",Ob,E,3,{currentPage:t.pagination.pageIndex,totalPages:n,paginationType:b.type,onPageChange:p.setPage})),null!=c&&c.actionButton&&"table"===_){var R;const e=c.actionButton,t={slot:"actions",label:e.label,labelOverrideSignal:h,selectedCount:null!=d?d:0,onClick:null!==(R=p.handleActionClick)&&void 0!==R?R:()=>{},isLoading:null!=f&&f};I("action-button",Nb,e.position,100,t)}return{...mc,...a,components:[...y,...(null==a?void 0:a.components)||[]]}},[e,t,n,r,o,i,l,s,a,u,c,d,f,h,p])}({features:u,state:O,totalPages:P,totalRows:k,hasActiveFilters:H,filters:e.filters,filterCounts:z,rowsPerPageOptions:e.rowsPerPageOptions,customLayout:e.layout,inlineFilterMap:K,rowSelection:u.rowSelection,selectedCount:U.selectedCount,isActionLoading:U.isActionLoading,actionButtonLabelOverride:a,handlers:J}),Y=RE({data:x,columns:e.columns,features:u,state:O,totalPages:P,containerWidth:w,filters:e.filters,filterCounts:z,onFilterChange:D,onSortingChange:G,onPaginationChange:Z,onRowClick:e.onRowClick,wrapperRef:f,loading:E,rowSelection:u.rowSelection,infiniteScroll:y?{hasNextPage:null!=A&&A,isFetchingNextPage:null!=N&&N,fetchNextPage:null!=F?F:()=>{}}:void 0}),Q=function({cardHtml:e,config:t,loading:n,enableLightbox:r=!1,infiniteScroll:o,scrollToTop:i,wrapperRef:l,state:s}){var a,u,c,d;const{i18n:f}=si(),h=St(null),p=null!==(a=t.gap)&&void 0!==a?a:25,g=null!==(u=t.columns)&&void 0!==u?u:"autosize",m=null!==(c=null==o?void 0:o.enabled)&&void 0!==c&&c;RC({enabled:null!=i,offset:null!==(d=null==i?void 0:i.offset)&&void 0!==d?d:0,targetRef:null!=l?l:h,stateKey:s?JSON.stringify({...!m&&{page:s.pagination.pageIndex},filters:s.filters,search:s.search.query,sorting:s.sorting}):"",loading:n});const[v,y]=yt({isOpen:!1,imageUrl:null,caption:null}),b=Et(()=>{null!=o&&o.fetchNextPage&&!o.isFetchingNextPage&&o.fetchNextPage()},[o]),w=Et(e=>{if(!r)return;const t=e.target.closest("img");if(!t)return;const n=t.dataset.lightboxUrl||t.src,o=t.alt||"";y({isOpen:!0,imageUrl:n,caption:o})},[r]),_=Et(()=>{y({isOpen:!1,imageUrl:null,caption:null})},[]),S=`grid-container dlp-grid-documents ${((e="autosize")=>"autosize"===e?"grid-autosize":`columns-${e}`)(g)}`,x=Et(()=>n||0!==e.length?Wo("div",{className:"grid-wrapper",children:[Wo("div",{className:S,style:{gap:`${p}px`},onClick:w,children:e.map((e,t)=>Wo("div",{className:"grid-card",dangerouslySetInnerHTML:{__html:e}},t))}),(null==o?void 0:o.enabled)&&Wo(kE,{onLoadMore:b,hasMore:o.hasNextPage,isLoading:o.isFetchingNextPage,loadingMessage:f.loadingMoreItems,endMessage:f.noMoreItemsToLoad}),v.isOpen&&Wo(aC,{isOpen:v.isOpen,imageUrl:v.imageUrl,caption:v.caption,onClose:_})]}):Wo("div",{className:"grid-empty",children:[Wo("div",{className:"grid-empty-title",children:f.noItemsFound}),Wo("div",{className:"grid-empty-message",children:f.adjustFiltersOrSearch})]}),[n,e,S,p,w,o,b,v,_,f]);return{containerRef:h,renderContent:x}}({cardHtml:C||[],config:g||{gap:25,columns:"autosize"},loading:E,enableLightbox:m,infiniteScroll:y?{enabled:!0,hasNextPage:null!=A&&A,isFetchingNextPage:null!=N&&N,fetchNextPage:null!=F?F:()=>{}}:void 0,scrollToTop:u.scrollToTop,wrapperRef:f,state:O}),ee=b?Q:Y,te=Ct(()=>({...U,containerRef:ee.containerRef}),[U,ee.containerRef]),ne=E&&0===x.length||!b&&!Y.widthsReady;!function({enabled:e,containerRef:t,selectedItems:n,onSelect:r,onDeselect:o,data:i,contentRendered:l}){const s=St(null),a=St(new Set),u=St(r);u.current=r;const c=St(o);c.current=o;const d=St(n);d.current=n,wt(()=>{a.current=new Set(n.keys())},[n]);const f=Et(()=>{const e=t.current;e&&e.querySelectorAll(Db).forEach(e=>{const t=e.getAttribute(zb);if(!t)return;const n=d.current.has(t);e.checked!==n&&(e.checked=n,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))})},[t]),h=Et((e,n)=>{const r=t.current;r&&r.querySelectorAll(Db).forEach(t=>{t.getAttribute(zb)===e&&(t.checked=n)})},[t]),p=Et(e=>{if(!(e instanceof Element))return null;if(e instanceof HTMLInputElement&&e.matches(Db))return e;const t=e.closest(Db);if(t instanceof HTMLInputElement)return t;const n=e.closest("label");if(n){const e=n.querySelector(Db);if(e)return e}const r=e.closest(".multi-cart-check, .wpt-multi-checkbox");return r?r.querySelector(Db):null},[]),g=Et(()=>{null!==s.current&&cancelAnimationFrame(s.current),s.current=requestAnimationFrame(()=>{s.current=null,f()})},[f]),m=Et(e=>{const t=e.getAttribute(zb);if(!t)return;const n=e.checked;h(t,n),a.current.has(t)!==n&&(n?(a.current.add(t),u.current({id:t,attributes:Lb(e)})):(a.current.delete(t),c.current(t)))},[h]);wt(()=>{if(e&&l)return g(),()=>{null!==s.current&&(cancelAnimationFrame(s.current),s.current=null)}},[e,l,n,g,i]),wt(()=>{if(!e||!l)return;const n=t.current;if(!n)return void g();const r=e=>{const t=p(e.target);t&&n.contains(t)&&m(t)},o=e=>{const t=p(e.target);t&&n.contains(t)&&requestAnimationFrame(()=>{m(t)})},i=new MutationObserver(()=>{g()});return n.addEventListener("change",r,!0),n.addEventListener("input",r,!0),n.addEventListener("click",o,!0),i.observe(n,{childList:!0,subtree:!0}),g(),()=>{i.disconnect(),n.removeEventListener("change",r,!0),n.removeEventListener("input",r,!0),n.removeEventListener("click",o,!0),null!==s.current&&(cancelAnimationFrame(s.current),s.current=null)}},[e,l,t,g,m,p])}({enabled:B,containerRef:ee.containerRef,selectedItems:U.selectedItems,onSelect:U.selectItem,onDeselect:U.deselectItem,data:x,contentRendered:!ne}),wt(()=>{if(ne||I)return;const e=ee.containerRef.current;if(!e)return;let t=!1;const n=requestAnimationFrame(()=>{requestAnimationFrame(()=>{t||e.dispatchEvent(new CustomEvent("contentRendered",{bubbles:!0,detail:{container:e,displayMode:h,itemCount:x.length,state:O}}))})});return()=>{t=!0,cancelAnimationFrame(n)}},[ne,I,ee.containerRef,h,x.length,O]);const re=y?{maxHeight:null!==(d=null==p?void 0:p.height)&&void 0!==d?d:"70vh"}:null;if(wt(()=>{const e=ee.containerRef.current;if(!e)return;const t=e.offsetWidth;_(t);const n=new ResizeObserver(e=>{for(const t of e){const e=t.contentRect.width;_(e)}});return n.observe(e),()=>{n.disconnect()}},[ee.containerRef]),wt(()=>{R&&console.warn("DataView: failed to load data",R)},[R]),R)return null;const oe=I&&x.length>0,ie=ne||oe;return Wo(ui,{value:te,children:Wo("div",{ref:f,className:ri("barn2-dataview","data-view",t),"data-display-mode":h,children:[Wo(gc,{config:X,hideControls:ne,children:Wo("div",{ref:ee.containerRef,className:ri("dataview-container",ie&&"loading",b&&"grid-mode",y&&"infinite-scroll-mode",!y&&!b&&"paginated-mode"),style:{...n,...re,position:"relative"},children:[ie&&Wo("div",{className:"data-view-loading-overlay",children:Wo("div",{className:"loading-spinner dv-loading-spinner"})}),!ne&&ee.renderContent()]})}),!b&&Y.renderModal()]})})},HE=e=>{var t;const{config:n}=e,r=(null===(t=n.features)||void 0===t?void 0:t.displayMode)||"table",[o,i]=yt(r),l=Ct(()=>function(e,t){const n=e.features||{},r=!0===n.viewSwitcher,o=n.displayMode||"table",i=r&&t?t:o,l=void 0===(s=n.grid)||!1===s?null:"object"==typeof s?{minCardWidth:null!==(a=s.minCardWidth)&&void 0!==a?a:AE.minCardWidth,gap:null!==(u=s.gap)&&void 0!==u?u:AE.gap,columns:null!==(c=s.columns)&&void 0!==c?c:AE.columns}:{...AE};var s,a,u,c;const d=function(e){return void 0===e||!1===e?null:"object"==typeof e?{threshold:null!==(t=e.threshold)&&void 0!==t?t:ME.threshold,pageSize:null!==(n=e.pageSize)&&void 0!==n?n:ME.pageSize,height:null!==(r=e.height)&&void 0!==r?r:ME.height}:{...ME};var t,n,r}(n.infiniteScroll),f=null!==d,h=function(e,t){return t||!1===e?null:"object"==typeof e?{type:null!==(n=e.type)&&void 0!==n?n:PE.type,perPageSelector:null!==(r=e.perPageSelector)&&void 0!==r?r:PE.perPageSelector,documentCount:null!==(o=e.documentCount)&&void 0!==o?o:PE.documentCount,pageNavigation:null!==(i=e.pageNavigation)&&void 0!==i?i:PE.pageNavigation}:{...PE};var n,r,o,i}(n.pagination,f),p=function(e,t){return"grid"===t||void 0===e||!1===e?null:"object"==typeof e?{control:null!==(o=e.control)&&void 0!==o?o:TE.control,display:(n=e.display,n&&null!==(r={child_row:"childRow",childRow:"childRow",child_row_visible:"childRowVisible",childRowVisible:"childRowVisible",modal:"modal"}[n])&&void 0!==r?r:TE.display),breakpoints:null!==(i=e.breakpoints)&&void 0!==i?i:TE.breakpoints}:{...TE};var n,r,o,i}(n.responsive,i);return{displayMode:i,viewSwitcherEnabled:r&&null!==l,pagination:h,prefetch:NE(n.prefetch),infiniteScroll:d,responsive:p,grid:l,sorting:LE(n),filtering:VE(n),searching:!1!==n.searching,header:zE(n),scrollToTop:DE(n.scrollToTop),hasLightboxColumn:(g=e.columns,g.some(e=>"image"===e.dataType&&e.lightbox)),activeFilters:$E(n.activeFilters),rowSelection:jE(n.rowSelection,i)};var g}(n,o),[n,o]),s=Ct(()=>(e=>{if(!e)return oi;const t=Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e));return{...oi,...t}})(n.i18n),[n.i18n]);return Wo(li,{value:{displayMode:l.displayMode,i18n:s},children:Wo(WE,{...e,features:l,onDisplayModeChange:i})})};class BE{constructor(e,t){if(this.mounted=!1,this.eventHandlers=new Map,this.selections=new Map,this.actionLoading=!1,this.actionButtonLabelOverride=Xn(null),this.contentRenderedListener=null,"string"==typeof e){const t=document.querySelector(e);if(!t)throw new Error(`Container not found: ${e}`);this.container=t}else this.container=e;this.id=t.id||this.generateId(),this.config=Xn(t),this.queryClient=new Fo({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!0,staleTime:6e4,gcTime:3e5}}}),this.mount(),BE.instances.set(this.id,this)}renderApp(){mn(Oe(Xo,{client:this.queryClient},Oe(HE,{config:this.config.value,onStateChange:e=>this.emit("stateChange",e),onAction:e=>this.emit("rowSelectionAction",e),actionLoading:this.actionLoading,initialSelections:this.selections,onSelectionChange:e=>{this.selections=e},actionButtonLabelOverride:this.actionButtonLabelOverride})),this.container)}mount(){try{this.renderApp(),this.mounted=!0,this.contentRenderedListener=e=>{this.emit("contentRendered",e.detail)},this.container.addEventListener("contentRendered",this.contentRenderedListener)}catch(e){throw this.emit("error",e),e}}updateConfig(e){this.config.value={...this.config.value,...e},this.emit("configUpdate",e),this.refresh()}setFilters(e){const t=this.config.value;this.config.value={...t,defaultState:{...t.defaultState,filters:Object.entries(e).map(([e,t])=>({id:e,value:t}))}}}refresh(){this.mounted&&(this.unmount(),this.mount())}setActionLoading(e){this.actionLoading!==e&&(this.actionLoading=e,this.mounted&&this.renderApp())}setActionButtonLabel(e){const t=null===e?null:String(e);this.actionButtonLabelOverride.value!==t&&(this.actionButtonLabelOverride.value=t)}destroy(){this.unmount(),this.queryClient.clear(),BE.instances.delete(this.id),this.eventHandlers.clear()}unmount(){this.mounted&&(this.contentRenderedListener&&(this.container.removeEventListener("contentRendered",this.contentRenderedListener),this.contentRenderedListener=null),mn(null,this.container),this.mounted=!1)}on(e,t){this.eventHandlers.has(e)||this.eventHandlers.set(e,new Set),this.eventHandlers.get(e).add(t)}off(e,t){var n;null===(n=this.eventHandlers.get(e))||void 0===n||n.delete(t)}emit(e,t){var n;null===(n=this.eventHandlers.get(e))||void 0===n||n.forEach(e=>e(t))}generateId(){return`dataview-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}getId(){return this.id}getConfig(){return this.config.value}getContainer(){return this.container}static getInstance(e){return BE.instances.get(e)}static getAllInstances(){return Array.from(BE.instances.values())}static destroyAll(){BE.instances.forEach(e=>e.destroy())}}BE.instances=new Map;const UE=["show","perPage","all","firstPage","previousPage","nextPage","lastPage","tableView","gridView","selectAll","resetFilters","reset","searchPlaceholder","searchTableData","clearSearch","clearSelection","clearAllSelections","noResultsFound","clear","sort","sortAscending","sortDescending","switchToPrimarySort","switchToSecondarySort","setAsPrimarySort","setAsSecondarySort","loadingMore","loadingMoreItems","noMoreItemsToLoad","allItemsLoaded","noDataAvailable","noItemsFound","adjustFiltersOrSearch","details","close","additionalRowDetails","expandRowDetails","collapseRowDetails","image"],qE=(BE.getInstance,BE.getAllInstances,BE.destroyAll,window.wp.i18n);var GE;const ZE=(({strings:e={},sprintf:t})=>{const n={};for(const t of UE){const r=e[t];void 0!==r&&(n[t]=r)}return void 0!==e.showingRangeOfTotal&&(n.showingRangeOfTotal=({start:n,end:r,total:o})=>t(e.showingRangeOfTotal,n,r,o)),void 0!==e.showingRangeToTotal&&(n.showingRangeToTotal=({start:n,end:r,total:o})=>t(e.showingRangeToTotal,n,r,o)),void 0!==e.itemsPerPageOption&&(n.itemsPerPageOption=({count:n})=>t(e.itemsPerPageOption,n)),void 0!==e.page&&(n.page=({page:n})=>t(e.page,n)),void 0!==e.selectFilter&&(n.selectFilter=({filterName:n})=>t(e.selectFilter,n)),void 0!==e.searchFilter&&(n.searchFilter=({filterName:n})=>t(e.searchFilter,n)),void 0!==e.searchFilterPlaceholder&&(n.searchFilterPlaceholder=({filterName:n})=>t(e.searchFilterPlaceholder,n)),void 0!==e.activeSearch&&(n.activeSearch=({query:n})=>t(e.activeSearch,n)),void 0!==e.removeActiveItem&&(n.removeActiveItem=({label:n})=>t(e.removeActiveItem,n)),void 0!==e.filterBy&&(n.filterBy=({filterName:n})=>t(e.filterBy,n)),void 0!==e.sortByColumn&&(n.sortByColumn=({columnName:n})=>t(e.sortByColumn,n)),void 0!==e.columnOptionsFor&&(n.columnOptionsFor=({columnName:n})=>t(e.columnOptionsFor,n)),void 0!==e.replacePrimarySort&&(n.replacePrimarySort=({columnName:n})=>t(e.replacePrimarySort,n)),void 0!==e.replaceSecondarySort&&(n.replaceSecondarySort=({columnName:n})=>t(e.replaceSecondarySort,n)),void 0!==e.openLightboxFor&&(n.openLightboxFor=({label:n})=>t(e.openLightboxFor,n)),void 0!==e.filterByTerm&&(n.filterByTerm=({term:n})=>t(e.filterByTerm,n)),n})({strings:null!==(GE=window.PostsTableProDVF?.i18n)&&void 0!==GE?GE:{},sprintf:qE.sprintf});document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll('.ptp-dataview[data-frontend="dataviews"]').forEach(e=>{const t=JSON.parse(e.dataset.config);t.i18n=ZE,new BE(e,t)})})})();