opencami 1.8.13 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +4 -2
  2. package/dist/client/assets/{CSPContext-DATmz4sz.js → CSPContext-B3PAVjBL.js} +1 -1
  3. package/dist/client/assets/{DirectionContext-FHFKdJq_.js → DirectionContext-CR5CCisG.js} +1 -1
  4. package/dist/client/assets/_sessionKey-Bg_9uype.js +23 -0
  5. package/dist/client/assets/agents-BiTHBb6Z.js +2 -0
  6. package/dist/client/assets/{agents-screen-C58VLjES.js → agents-screen--ZMzN5cB.js} +1 -1
  7. package/dist/client/assets/bots-DxhRnQp5.js +2 -0
  8. package/dist/client/assets/{bots-screen-B8h4Y1VL.js → bots-screen-C_uJBNwI.js} +1 -1
  9. package/dist/client/assets/{button-BcUmP7JL.js → button-BciDmec0.js} +1 -1
  10. package/dist/client/assets/{composite--BBbKdxm.js → composite-DArWbFHm.js} +1 -1
  11. package/dist/client/assets/{connect-BmwKnEFP.js → connect-B48HecjN.js} +1 -1
  12. package/dist/client/assets/{dashboard-BWQl_-2-.js → dashboard-BVKx9FMy.js} +1 -1
  13. package/dist/client/assets/{event-BxzjTPjG.js → event-BCwqPPkP.js} +1 -1
  14. package/dist/client/assets/{file-explorer-screen-BAbbb_R4.js → file-explorer-screen-DPs-FWeA.js} +1 -1
  15. package/dist/client/assets/files-SEycwYCa.js +2 -0
  16. package/dist/client/assets/{follow-up-suggestions-Bq-xR5GV.js → follow-up-suggestions-BPjWBpiy.js} +1 -1
  17. package/dist/client/assets/{index-rOr2i8gW.js → index-0gdwm1_H.js} +1 -1
  18. package/dist/client/assets/{index-BTtT4Vbb.js → index-CGeJcqZ3.js} +1 -1
  19. package/dist/client/assets/{keyboard-shortcuts-dialog-BA8cBwWm.js → keyboard-shortcuts-dialog-CK_XTzLr.js} +1 -1
  20. package/dist/client/assets/{main-_1IghVZn.js → main-B2CrcRuC.js} +3 -3
  21. package/dist/client/assets/{markdown-CqIcraPO.js → markdown-CdkuX06F.js} +1 -1
  22. package/dist/client/assets/memory-C7lKdkmc.js +2 -0
  23. package/dist/client/assets/{memory-screen-GBzowsnE.js → memory-screen-C1RfLy-d.js} +1 -1
  24. package/dist/client/assets/{menu--FXN_JCl.js → menu-CIwnliij.js} +1 -1
  25. package/dist/client/assets/{opencami-logo-BFo87CeM.js → opencami-logo-SVuYD55V.js} +1 -1
  26. package/dist/client/assets/{proxy-CJ6-TEKD.js → proxy-BijR8W1L.js} +1 -1
  27. package/dist/client/assets/{react-BRYbnjMp.js → react-DWx7OvUo.js} +1 -1
  28. package/dist/client/assets/{search-dialog-CJS2GUnE.js → search-dialog-CB4KE8ec.js} +1 -1
  29. package/dist/client/assets/{search-sources-badge-D0YArqfp.js → search-sources-badge-B8Z-8sSf.js} +1 -1
  30. package/dist/client/assets/{session-export-dialog-Bc9YEPLs.js → session-export-dialog-tDiFuv3a.js} +1 -1
  31. package/dist/client/assets/{settings-dialog-SDzqDXsx.js → settings-dialog-aL-AH4Rt.js} +1 -1
  32. package/dist/client/assets/skills-D1T6uemU.js +2 -0
  33. package/dist/client/assets/{skills-panel-DIalYvpW.js → skills-panel-fjJQVMog.js} +1 -1
  34. package/dist/client/assets/styles-D0L88B64.css +1 -0
  35. package/dist/client/assets/{switch-BwmDNR0d.js → switch-Bn5uei2k.js} +1 -1
  36. package/dist/client/assets/{tabs-T1fJbUsm.js → tabs-DOBNAUVE.js} +1 -1
  37. package/dist/client/assets/{thinking-DUdE6Iej.js → thinking-dfGrFAMV.js} +1 -1
  38. package/dist/client/assets/{tooltip-DexBPu8g.js → tooltip-DOKkNFvu.js} +1 -1
  39. package/dist/client/assets/{use-file-explorer-state-eXs92yKN.js → use-file-explorer-state-BAa6Cxyr.js} +1 -1
  40. package/dist/client/assets/{useBaseUiId-DN9cOflS.js → useBaseUiId-DFpBD0sg.js} +1 -1
  41. package/dist/client/assets/{useCompositeItem-B_J-cnZX.js → useCompositeItem-B-Axq9-D.js} +1 -1
  42. package/dist/client/assets/{useControlled-DeDLOsPR.js → useControlled-CQHE0ITz.js} +1 -1
  43. package/dist/client/assets/{useMutation-TzgejsE_.js → useMutation-BFl-7GnD.js} +1 -1
  44. package/dist/client/assets/{useOnFirstRender-S4-xcV93.js → useOnFirstRender-DlXHIIGk.js} +1 -1
  45. package/dist/client/assets/{useQuery-BdjM5kzn.js → useQuery-D-sF8Tld.js} +1 -1
  46. package/dist/server/assets/{_sessionKey-DBzlGMo3.js → _sessionKey-D8TGrDRM.js} +429 -131
  47. package/dist/server/assets/{_tanstack-start-manifest_v-CX4xb59U.js → _tanstack-start-manifest_v-DalBo2bY.js} +1 -1
  48. package/dist/server/assets/{follow-up-suggestions-BmSFSY87.js → follow-up-suggestions-C65ptDij.js} +2 -2
  49. package/dist/server/assets/{index-C1dylvu-.js → index-gRco4Ina.js} +1 -1
  50. package/dist/server/assets/{router-CL6A11qi.js → router-DaKDqc9w.js} +72 -251
  51. package/dist/server/assets/{search-dialog-D8DvpPZw.js → search-dialog-DSSK93kq.js} +2 -2
  52. package/dist/server/assets/{settings-dialog-CeP-J_NJ.js → settings-dialog-DyWNblva.js} +2 -2
  53. package/dist/server/assets/{thinking-ClIWjSbx.js → thinking-CU0FRlzT.js} +2 -2
  54. package/dist/server/server.js +2 -2
  55. package/package.json +1 -1
  56. package/dist/client/assets/_sessionKey-D2ZMdqJ0.js +0 -23
  57. package/dist/client/assets/agents-9A0buuwT.js +0 -2
  58. package/dist/client/assets/bots-Lqt92ma0.js +0 -2
  59. package/dist/client/assets/files-DvIFms9G.js +0 -2
  60. package/dist/client/assets/memory-B3LyVZwO.js +0 -2
  61. package/dist/client/assets/skills-BVLjvrPU.js +0 -2
  62. package/dist/client/assets/styles-b2XYKZYx.css +0 -1
@@ -1 +1 @@
1
- import{u as w,p as Me,g as Y,j as At,a as E,O as Ft,r as Lt,d as B,w as Ce,x as Dt,i as jt,h as _t,o as Vt,E as Ie,t as We,H as Ht,n as qt}from"./useBaseUiId-DN9cOflS.js";import{C as X,ab as ue,ag as Bt,ac as Kt,ai as zt,af as Wt}from"./button-BcUmP7JL.js";import{r as d,j as D,w as Ae,x as Ut,y as Yt}from"./main-_1IghVZn.js";import{u as Qe,e as ee,o as G,d as Gt,v as $t,w as Xt,k as U,x as Zt,y as A,f as Jt,F as Qt,z as et,S as tt}from"./event-BxzjTPjG.js";import{a as en}from"./visuallyHidden-COI6QeQH.js";const Sr=500,Tr=500,Rr={style:{transition:"none"}},Cr="data-base-ui-click-trigger",Ir={fallbackAxisSide:"none"},xr={fallbackAxisSide:"end"},tn={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Q=0;class me{static create(){return new me}currentId=Q;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Q,n()},e)}isStarted(){return this.currentId!==Q}clear=()=>{this.currentId!==Q&&(clearTimeout(this.currentId),this.currentId=Q)};disposeEffect=()=>this.clear}function Ue(){const t=X(me.create).current;return Qe(t.disposeEffect),t}const se=null;class nn{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let s=0;s<n.length;s+=1)n[s]?.(e)};request(e){const n=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(e){const n=e-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const ie=new nn;class L{static create(){return new L}static request(e){return ie.request(e)}static cancel(e){return ie.cancel(e)}currentId=se;request(e){this.cancel(),this.currentId=ie.request(()=>{this.currentId=se,e()})}cancel=()=>{this.currentId!==se&&(ie.cancel(this.currentId),this.currentId=se)};disposeEffect=()=>this.cancel}function rn(){const t=X(L.create).current;return Qe(t.disposeEffect),t}function Or(t){const e=X(sn,t).current;return e.next=t,w(e.effect),e}function sn(t){const e={current:t,next:t,effect:()=>{e.current=e.next}};return e}function le(t,e,n=!0){return t.filter(s=>s.parentId===e&&(!n||s.context?.open)).flatMap(s=>[s,...le(t,s.id,n)])}function wr(t,e){let n=[],r=t.find(s=>s.id===e)?.parentId;for(;r;){const s=t.find(i=>i.id===r);r=s?.parentId,s&&(n=n.concat(s))}return n}var on=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],fe=on.join(","),nt=typeof Element>"u",$=nt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,de=!nt&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},pe=function(e,n){var r;n===void 0&&(n=!0);var s=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),i=s===""||s==="true",a=i||n&&e&&(typeof e.closest=="function"?e.closest("[inert]"):pe(e.parentNode));return a},an=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},rt=function(e,n,r){if(pe(e))return[];var s=Array.prototype.slice.apply(e.querySelectorAll(fe));return n&&$.call(e,fe)&&s.unshift(e),s=s.filter(r),s},ge=function(e,n,r){for(var s=[],i=Array.from(e);i.length;){var a=i.shift();if(!pe(a,!1))if(a.tagName==="SLOT"){var o=a.assignedElements(),l=o.length?o:a.children,c=ge(l,!0,r);r.flatten?s.push.apply(s,c):s.push({scopeParent:a,candidates:c})}else{var g=$.call(a,fe);g&&r.filter(a)&&(n||!e.includes(a))&&s.push(a);var f=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),b=!pe(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(f&&b){var v=ge(f===!0?a.children:f.children,!0,r);r.flatten?s.push.apply(s,v):s.push({scopeParent:a,candidates:v})}else i.unshift.apply(i,a.children)}}return s},st=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},it=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||an(e))&&!st(e)?0:e.tabIndex},cn=function(e,n){var r=it(e);return r<0&&n&&!st(e)?0:r},un=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},ot=function(e){return e.tagName==="INPUT"},ln=function(e){return ot(e)&&e.type==="hidden"},fn=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},dn=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},pn=function(e){if(!e.name)return!0;var n=e.form||de(e),r=function(o){return n.querySelectorAll('input[type="radio"][name="'+o+'"]')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=r(window.CSS.escape(e.name));else try{s=r(e.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var i=dn(s,e.form);return!i||i===e},gn=function(e){return ot(e)&&e.type==="radio"},hn=function(e){return gn(e)&&!pn(e)},mn=function(e){var n,r=e&&de(e),s=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==e){var a,o,l;for(i=!!((a=s)!==null&&a!==void 0&&(o=a.ownerDocument)!==null&&o!==void 0&&o.contains(s)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!i&&s;){var c,g,f;r=de(s),s=(c=r)===null||c===void 0?void 0:c.host,i=!!((g=s)!==null&&g!==void 0&&(f=g.ownerDocument)!==null&&f!==void 0&&f.contains(s))}}return i},Ye=function(e){var n=e.getBoundingClientRect(),r=n.width,s=n.height;return r===0&&s===0},bn=function(e,n){var r=n.displayCheck,s=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in e){var i=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(e).visibility==="hidden")return!0;var a=$.call(e,"details>summary:first-of-type"),o=a?e.parentElement:e;if($.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof s=="function"){for(var l=e;e;){var c=e.parentElement,g=de(e);if(c&&!c.shadowRoot&&s(c)===!0)return Ye(e);e.assignedSlot?e=e.assignedSlot:!c&&g!==e.ownerDocument?e=g.host:e=c}e=l}if(mn(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Ye(e);return!1},vn=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var s=n.children.item(r);if(s.tagName==="LEGEND")return $.call(n,"fieldset[disabled] *")?!0:!s.contains(e)}return!0}n=n.parentElement}return!1},Oe=function(e,n){return!(n.disabled||ln(n)||bn(n,e)||fn(n)||vn(n))},we=function(e,n){return!(hn(n)||it(n)<0||!Oe(e,n))},En=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},at=function(e){var n=[],r=[];return e.forEach(function(s,i){var a=!!s.scopeParent,o=a?s.scopeParent:s,l=cn(o,a),c=a?at(s.candidates):o;l===0?a?n.push.apply(n,c):n.push(o):r.push({documentOrder:i,tabIndex:l,item:s,isScope:a,content:c})}),r.sort(un).reduce(function(s,i){return i.isScope?s.push.apply(s,i.content):s.push(i.content),s},[]).concat(n)},Fe=function(e,n){n=n||{};var r;return n.getShadowRoot?r=ge([e],n.includeContainer,{filter:we.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:En}):r=rt(e,n.includeContainer,we.bind(null,n)),at(r)},Pr=function(e,n){n=n||{};var r;return n.getShadowRoot?r=ge([e],n.includeContainer,{filter:Oe.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=rt(e,n.includeContainer,Oe.bind(null,n)),r},kr=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return $.call(e,fe)===!1?!1:we(n,e)};const Le=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ct(t,e){const n=Fe(t,Le()),r=n.length;if(r===0)return;const s=Gt(G(t)),i=n.indexOf(s),a=i===-1?e===1?0:r-1:i+e;return n[a]}function yn(t){return ct(G(t).body,1)||t}function Sn(t){return ct(G(t).body,-1)||t}function ut(t,e){if(!t)return null;const n=Fe(G(t).body,Le()),r=n.length;if(r===0)return null;const s=n.indexOf(t);if(s===-1)return null;const i=(s+e+r)%r;return n[i]}function Nr(t){return ut(t,1)}function Mr(t){return ut(t,-1)}function xe(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!ee(n,r)}function Tn(t){Fe(t,Le()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Ge(t){t.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function lt(){const t=new Map;return{emit(e,n){t.get(e)?.forEach(r=>r(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){t.get(e)?.delete(n)}}}class Rn{nodesRef={current:[]};events=lt();addNode(e){this.nodesRef.current.push(e)}removeNode(e){const n=this.nodesRef.current.findIndex(r=>r===e);n!==-1&&this.nodesRef.current.splice(n,1)}}const ft=d.createContext(null),dt=d.createContext(null),De=()=>d.useContext(ft)?.id||null,pt=t=>{const e=d.useContext(dt);return t??e};function Ar(t){const e=Me(),n=pt(t),r=De();return w(()=>{if(!e)return;const s={id:e,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,e,r]),e}function Fr(t){const{children:e,id:n}=t,r=De();return D.jsx(ft.Provider,{value:d.useMemo(()=>({id:n,parentId:r}),[n,r]),children:e})}function Lr(t){const{children:e,externalTree:n}=t,r=X(()=>n??new Rn).current;return D.jsx(dt.Provider,{value:r,children:e})}function gt(t){return`data-base-ui-${t}`}const $e=d.forwardRef(function(e,n){const[r,s]=d.useState();w(()=>{$t&&s("button")},[]);const i={tabIndex:0,role:r};return D.jsx("span",{...e,ref:n,style:en,"aria-hidden":r?void 0:!0,...i,"data-base-ui-focus-guard":""})}),ht=d.createContext(null),Cn=()=>d.useContext(ht),In=gt("portal");function xn(t={}){const{ref:e,container:n,componentProps:r=ue,elementProps:s}=t,i=Me(),o=Cn()?.portalNode,[l,c]=d.useState(null),[g,f]=d.useState(null),b=E(P=>{P!==null&&f(P)}),v=d.useRef(null);w(()=>{if(n===null){v.current&&(v.current=null,f(null),c(null));return}if(i==null)return;const P=(n&&(Ft(n)?n:n.current))??o??document.body;if(P==null){v.current&&(v.current=null,f(null),c(null));return}v.current!==P&&(v.current=P,f(null),c(P))},[n,o,i]);const S=Bt("div",r,{ref:[e,b],props:[{id:i,[In]:""},s]});return{portalNode:g,portalSubtree:l&&S?Ae.createPortal(S,l):null}}const Dr=d.forwardRef(function(e,n){const{children:r,container:s,className:i,render:a,renderGuards:o,...l}=e,{portalNode:c,portalSubtree:g}=xn({container:s,ref:n,componentProps:e,elementProps:l}),f=d.useRef(null),b=d.useRef(null),v=d.useRef(null),S=d.useRef(null),[y,P]=d.useState(null),j=y?.modal,k=y?.open,_=typeof o=="boolean"?o:!!y&&!y.modal&&y.open&&!!c;d.useEffect(()=>{if(!c||j)return;function R(N){c&&N.relatedTarget&&xe(N)&&(N.type==="focusin"?Ge:Tn)(c)}return c.addEventListener("focusin",R,!0),c.addEventListener("focusout",R,!0),()=>{c.removeEventListener("focusin",R,!0),c.removeEventListener("focusout",R,!0)}},[c,j]),d.useEffect(()=>{!c||k||Ge(c)},[k,c]);const F=d.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:b,beforeInsideRef:v,afterInsideRef:S,portalNode:c,setFocusManagerState:P}),[c]);return D.jsxs(d.Fragment,{children:[g,D.jsxs(ht.Provider,{value:F,children:[_&&c&&D.jsx($e,{"data-type":"outside",ref:f,onFocus:R=>{if(xe(R,c))v.current?.focus();else{const N=y?y.domReference:null;Sn(N)?.focus()}}}),_&&c&&D.jsx("span",{"aria-owns":c.id,style:tn}),c&&Ae.createPortal(r,c),_&&c&&D.jsx($e,{"data-type":"outside",ref:b,onFocus:R=>{if(xe(R,c))S.current?.focus();else{const N=y?y.domReference:null;yn(N)?.focus(),y?.closeOnFocusOut&&y?.onOpenChange(!1,Y(At,R.nativeEvent))}}})]})]})});function On(t){return t==null?t:"current"in t?t.current:t}const wn={intentional:"onClick",sloppy:"onPointerDown"};function Pn(t){return{escapeKey:typeof t=="boolean"?t:t?.escapeKey??!1,outsidePress:typeof t=="boolean"?t:t?.outsidePress??!0}}function jr(t,e={}){const n="rootStore"in t?t.rootStore:t,r=n.useState("open"),s=n.useState("floatingElement"),i=n.useState("referenceElement"),a=n.useState("domReferenceElement"),{onOpenChange:o,dataRef:l}=n.context,{enabled:c=!0,escapeKey:g=!0,outsidePress:f=!0,outsidePressEvent:b="sloppy",referencePress:v=!1,referencePressEvent:S="sloppy",ancestorScroll:y=!1,bubbles:P,externalTree:j}=e,k=pt(j),_=E(typeof f=="function"?f:()=>!1),F=typeof f=="function"?_:f,R=d.useRef(!1),{escapeKey:N,outsidePress:Z}=Pn(P),I=d.useRef(null),ne=Ue(),_e=Ue(),K=E(()=>{_e.clear(),l.current.insideReactTree=!1}),be=d.useRef(!1),Ve=d.useRef(""),ve=E(u=>{Ve.current=u.pointerType}),z=E(()=>{const u=Ve.current,h=u==="pen"||!u?"mouse":u,p=typeof b=="function"?b():b;return typeof p=="string"?p:p[h]}),V=E(u=>{if(!r||!c||!g||u.key!=="Escape"||be.current)return;const h=l.current.floatingContext?.nodeId,p=k?le(k.nodesRef.current,h):[];if(!N&&p.length>0){let x=!0;if(p.forEach(C=>{C.context?.open&&!C.context.dataRef.current.__escapeKeyBubbles&&(x=!1)}),!x)return}const M=Xt(u)?u.nativeEvent:u,m=Y(Lt,M);n.setOpen(!1,m),!N&&!m.isPropagationAllowed&&u.stopPropagation()}),St=E(u=>{const h=z();return h==="intentional"&&u.type!=="click"||h==="sloppy"&&u.type==="click"}),H=E(()=>{l.current.insideReactTree=!0,_e.start(0,K)}),J=E((u,h=!1)=>{if(St(u)){K();return}if(l.current.insideReactTree){K();return}if(z()==="intentional"&&h||typeof F=="function"&&!F(u))return;const p=U(u),M=`[${gt("inert")}]`,m=G(n.select("floatingElement")).querySelectorAll(M),x=n.context.triggerElements;if(p&&(x.hasElement(p)||x.hasMatchingElement(O=>ee(O,p))))return;let C=B(p)?p:null;for(;C&&!Ce(C);){const O=Dt(C);if(Ce(O)||!B(O))break;C=O}if(m.length&&B(p)&&!Zt(p)&&!ee(p,n.select("floatingElement"))&&Array.from(m).every(O=>!ee(C,O)))return;if(jt(p)&&!("touches"in u)){const O=Ce(p),W=_t(p),ze=/auto|scroll/,xt=O||ze.test(W.overflowX),Ot=O||ze.test(W.overflowY),wt=xt&&p.clientWidth>0&&p.scrollWidth>p.clientWidth,Pt=Ot&&p.clientHeight>0&&p.scrollHeight>p.clientHeight,kt=W.direction==="rtl",Nt=Pt&&(kt?u.offsetX<=p.offsetWidth-p.clientWidth:u.offsetX>p.clientWidth),Mt=wt&&u.offsetY>p.clientHeight;if(Nt||Mt)return}const Be=l.current.floatingContext?.nodeId,It=k&&le(k.nodesRef.current,Be).some(O=>A(u,O.context?.elements.floating));if(A(u,n.select("floatingElement"))||A(u,n.select("domReferenceElement"))||It)return;const Ke=k?le(k.nodesRef.current,Be):[];if(Ke.length>0){let O=!0;if(Ke.forEach(W=>{W.context?.open&&!W.context.dataRef.current.__outsidePressBubbles&&(O=!1)}),!O)return}n.setOpen(!1,Y(Vt,u)),K()}),He=E(u=>{z()!=="sloppy"||u.pointerType==="touch"||!n.select("open")||!c||A(u,n.select("floatingElement"))||A(u,n.select("domReferenceElement"))||J(u)}),Tt=E(u=>{if(z()!=="sloppy"||!n.select("open")||!c||A(u,n.select("floatingElement"))||A(u,n.select("domReferenceElement")))return;const h=u.touches[0];h&&(I.current={startTime:Date.now(),startX:h.clientX,startY:h.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},ne.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}),Ee=E(u=>{const h=U(u);function p(){Tt(u),h?.removeEventListener(u.type,p)}h?.addEventListener(u.type,p)}),q=E(u=>{const h=R.current;if(R.current=!1,ne.clear(),u.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const p=U(u);function M(){u.type==="pointerdown"?He(u):J(u,h),p?.removeEventListener(u.type,M)}p?.addEventListener(u.type,M)}),Rt=E(u=>{if(z()!=="sloppy"||!I.current||A(u,n.select("floatingElement"))||A(u,n.select("domReferenceElement")))return;const h=u.touches[0];if(!h)return;const p=Math.abs(h.clientX-I.current.startX),M=Math.abs(h.clientY-I.current.startY),m=Math.sqrt(p*p+M*M);m>5&&(I.current.dismissOnTouchEnd=!0),m>10&&(J(u),ne.clear(),I.current=null)}),ye=E(u=>{const h=U(u);function p(){Rt(u),h?.removeEventListener(u.type,p)}h?.addEventListener(u.type,p)}),Ct=E(u=>{z()!=="sloppy"||!I.current||A(u,n.select("floatingElement"))||A(u,n.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&J(u),ne.clear(),I.current=null)}),Se=E(u=>{const h=U(u);function p(){Ct(u),h?.removeEventListener(u.type,p)}h?.addEventListener(u.type,p)});d.useEffect(()=>{if(!r||!c)return;l.current.__escapeKeyBubbles=N,l.current.__outsidePressBubbles=Z;const u=new me;function h(C){n.setOpen(!1,Y(qt,C))}function p(){u.clear(),be.current=!0}function M(){u.start(Ht()?5:0,()=>{be.current=!1})}const m=G(s);m.addEventListener("pointerdown",ve,!0),g&&(m.addEventListener("keydown",V),m.addEventListener("compositionstart",p),m.addEventListener("compositionend",M)),F&&(m.addEventListener("click",q,!0),m.addEventListener("pointerdown",q,!0),m.addEventListener("touchstart",Ee,!0),m.addEventListener("touchmove",ye,!0),m.addEventListener("touchend",Se,!0),m.addEventListener("mousedown",q,!0));let x=[];return y&&(B(a)&&(x=Ie(a)),B(s)&&(x=x.concat(Ie(s))),!B(i)&&i&&i.contextElement&&(x=x.concat(Ie(i.contextElement)))),x=x.filter(C=>C!==m.defaultView?.visualViewport),x.forEach(C=>{C.addEventListener("scroll",h,{passive:!0})}),()=>{m.removeEventListener("pointerdown",ve,!0),g&&(m.removeEventListener("keydown",V),m.removeEventListener("compositionstart",p),m.removeEventListener("compositionend",M)),F&&(m.removeEventListener("click",q,!0),m.removeEventListener("pointerdown",q,!0),m.removeEventListener("touchstart",Ee,!0),m.removeEventListener("touchmove",ye,!0),m.removeEventListener("touchend",Se,!0),m.removeEventListener("mousedown",q,!0)),x.forEach(C=>{C.removeEventListener("scroll",h)}),u.clear(),R.current=!1}},[l,s,i,a,g,F,r,o,y,c,N,Z,V,J,q,He,Ee,ye,Se,ve,n]),d.useEffect(K,[F,K]);const Te=d.useMemo(()=>({onKeyDown:V,...v&&{[wn[S]]:u=>{n.setOpen(!1,Y(We,u.nativeEvent))},...S!=="intentional"&&{onClick(u){n.setOpen(!1,Y(We,u.nativeEvent))}}}}),[V,n,v,S]),re=E(u=>{const h=U(u.nativeEvent);!ee(n.select("floatingElement"),h)||u.button!==0||(R.current=!0)}),Re=E(u=>{!r||!c||u.button!==0||(R.current=!0)}),qe=d.useMemo(()=>({onKeyDown:V,onPointerDown:re,onMouseDown:re,onMouseUp:re,onClickCapture:H,onMouseDownCapture(u){H(),Re(u)},onPointerDownCapture(u){H(),Re(u)},onMouseUpCapture:H,onTouchEndCapture:H,onTouchMoveCapture:H}),[V,re,H,Re]);return d.useMemo(()=>c?{reference:Te,floating:qe,trigger:Te}:{},[c,Te,qe])}var he=Symbol("NOT_FOUND");function kn(t,e=`expected a function, instead received ${typeof t}`){if(typeof t!="function")throw new TypeError(e)}function Nn(t,e=`expected an object, instead received ${typeof t}`){if(typeof t!="object")throw new TypeError(e)}function Mn(t,e="expected all items to be functions, instead received the following types: "){if(!t.every(n=>typeof n=="function")){const n=t.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${e}[${n}]`)}}var Xe=t=>Array.isArray(t)?t:[t];function An(t){const e=Array.isArray(t[0])?t[0]:t;return Mn(e,"createSelector expects all input-selectors to be functions, but received the following types: "),e}function Fn(t,e){const n=[],{length:r}=t;for(let s=0;s<r;s++)n.push(t[s].apply(null,e));return n}function Ln(t){let e;return{get(n){return e&&t(e.key,n)?e.value:he},put(n,r){e={key:n,value:r}},getEntries(){return e?[e]:[]},clear(){e=void 0}}}function Dn(t,e){let n=[];function r(o){const l=n.findIndex(c=>e(o,c.key));if(l>-1){const c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return he}function s(o,l){r(o)===he&&(n.unshift({key:o,value:l}),n.length>t&&n.pop())}function i(){return n}function a(){n=[]}return{get:r,put:s,getEntries:i,clear:a}}var jn=(t,e)=>t===e;function _n(t){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:s}=n;for(let i=0;i<s;i++)if(!t(n[i],r[i]))return!1;return!0}}function Vn(t,e){const n=typeof e=="object"?e:{equalityCheck:e},{equalityCheck:r=jn,maxSize:s=1,resultEqualityCheck:i}=n,a=_n(r);let o=0;const l=s<=1?Ln(a):Dn(s,a);function c(){let g=l.get(arguments);if(g===he){if(g=t.apply(null,arguments),o++,i){const b=l.getEntries().find(v=>i(v.value,g));b&&(g=b.value,o!==0&&o--)}l.put(arguments,g)}return g}return c.clearCache=()=>{l.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var Hn=class{constructor(t){this.value=t}deref(){return this.value}},qn=typeof WeakRef<"u"?WeakRef:Hn,Bn=0,Ze=1;function oe(){return{s:Bn,v:void 0,o:null,p:null}}function mt(t,e={}){let n=oe();const{resultEqualityCheck:r}=e;let s,i=0;function a(){let o=n;const{length:l}=arguments;for(let f=0,b=l;f<b;f++){const v=arguments[f];if(typeof v=="function"||typeof v=="object"&&v!==null){let S=o.o;S===null&&(o.o=S=new WeakMap);const y=S.get(v);y===void 0?(o=oe(),S.set(v,o)):o=y}else{let S=o.p;S===null&&(o.p=S=new Map);const y=S.get(v);y===void 0?(o=oe(),S.set(v,o)):o=y}}const c=o;let g;if(o.s===Ze)g=o.v;else if(g=t.apply(null,arguments),i++,r){const f=s?.deref?.()??s;f!=null&&r(f,g)&&(g=f,i!==0&&i--),s=typeof g=="object"&&g!==null||typeof g=="function"?new qn(g):g}return c.s=Ze,c.v=g,g}return a.clearCache=()=>{n=oe(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function bt(t,...e){const n=typeof t=="function"?{memoize:t,memoizeOptions:e}:t,r=(...s)=>{let i=0,a=0,o,l={},c=s.pop();typeof c=="object"&&(l=c,c=s.pop()),kn(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const g={...n,...l},{memoize:f,memoizeOptions:b=[],argsMemoize:v=mt,argsMemoizeOptions:S=[]}=g,y=Xe(b),P=Xe(S),j=An(s),k=f(function(){return i++,c.apply(null,arguments)},...y),_=v(function(){a++;const R=Fn(j,arguments);return o=k.apply(null,R),o},...P);return Object.assign(_,{resultFunc:c,memoizedResultFunc:k,dependencies:j,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>o,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:f,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var Kn=bt(mt),zn=Object.assign((t,e=Kn)=>{Nn(t,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof t}`);const n=Object.keys(t),r=n.map(i=>t[i]);return e(r,(...i)=>i.reduce((a,o,l)=>(a[n[l]]=o,a),{}))},{withTypes:()=>zn});bt({memoize:Vn,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const T=(t,e,n,r,s,i,...a)=>{if(a.length>0)throw new Error(Kt(1));let o;if(t)o=t;else throw new Error("Missing arguments");return o};var vt=Ut();const Pe=[];let ke;function Wn(){return ke}function Un(t){Pe.push(t)}function Yn(t){const e=(n,r)=>{const s=X(Gn).current;let i;try{ke=s;for(const a of Pe)a.before(s);i=t(n,r);for(const a of Pe)a.after(s);s.didInitialize=!0}finally{ke=void 0}return i};return e.displayName=t.displayName||t.name,e}function _r(t){return d.forwardRef(Yn(t))}function Gn(){return{didInitialize:!1}}const $n=zt(19),Xn=$n?Jn:Qn;function Et(t,e,n,r,s){return Xn(t,e,n,r,s)}function Zn(t,e,n,r,s){const i=d.useCallback(()=>e(t.getSnapshot(),n,r,s),[t,e,n,r,s]);return vt.useSyncExternalStore(t.subscribe,i,i)}Un({before(t){t.syncIndex=0,t.didInitialize||(t.syncTick=1,t.syncHooks=[],t.didChangeStore=!0,t.getSnapshot=()=>{let e=!1;for(let n=0;n<t.syncHooks.length;n+=1){const r=t.syncHooks[n],s=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,s))&&(e=!0,r.value=s,r.didChange=!1)}return e&&(t.syncTick+=1),t.syncTick})},after(t){t.syncHooks.length>0&&(t.didChangeStore&&(t.didChangeStore=!1,t.subscribe=e=>{const n=new Set;for(const s of t.syncHooks)n.add(s.store);const r=[];for(const s of n)r.push(s.subscribe(e));return()=>{for(const s of r)s()}}),vt.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot))}});function Jn(t,e,n,r,s){const i=Wn();if(!i)return Zn(t,e,n,r,s);const a=i.syncIndex;i.syncIndex+=1;let o;return i.didInitialize?(o=i.syncHooks[a],(o.store!==t||o.selector!==e||!Object.is(o.a1,n)||!Object.is(o.a2,r)||!Object.is(o.a3,s))&&(o.store!==t&&(i.didChangeStore=!0),o.store=t,o.selector=e,o.a1=n,o.a2=r,o.a3=s,o.didChange=!0)):(o={store:t,selector:e,a1:n,a2:r,a3:s,value:e(t.getSnapshot(),n,r,s),didChange:!1},i.syncHooks.push(o)),o.value}function Qn(t,e,n,r,s){return Yt.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,i=>e(i,n,r,s))}class er{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(e)}}update(e){for(const n in e)if(!Object.is(this.state[n],e[n])){this.setState({...this.state,...e});return}}set(e,n){Object.is(this.state[e],n)||this.setState({...this.state,[e]:n})}notifyAll(){const e={...this.state};this.setState(e)}use(e,n,r,s){return Et(this,e,n,r,s)}}class tr extends er{constructor(e,n={},r){super(e),this.context=n,this.selectors=r}useSyncedValue(e,n){d.useDebugValue(e),w(()=>{this.state[e]!==n&&this.set(e,n)},[e,n])}useSyncedValueWithCleanup(e,n){const r=this;w(()=>(r.state[e]!==n&&r.set(e,n),()=>{r.set(e,void 0)}),[r,e,n])}useSyncedValues(e){const n=this,r=Object.values(e);w(()=>{n.update(e)},[n,...r])}useControlledProp(e,n){d.useDebugValue(e);const r=n!==void 0;w(()=>{r&&!Object.is(this.state[e],n)&&super.setState({...this.state,[e]:n})},[e,n,r])}select(e,n,r,s){const i=this.selectors[e];return i(this.state,n,r,s)}useState(e,n,r,s){return d.useDebugValue(e),Et(this,this.selectors[e],n,r,s)}useContextCallback(e,n){d.useDebugValue(e);const r=E(n??Wt);this.context[e]=r}useStateSetter(e){const n=d.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(e,r)}),n.current}observe(e,n){let r;typeof e=="function"?r=e:r=this.selectors[e];let s=r(this.state);return n(s,s,this),this.subscribe(i=>{const a=r(i);if(!Object.is(s,a)){const o=s;s=a,n(a,o,this)}})}}const nr={open:T(t=>t.open),domReferenceElement:T(t=>t.domReferenceElement),referenceElement:T(t=>t.positionReference??t.referenceElement),floatingElement:T(t=>t.floatingElement),floatingId:T(t=>t.floatingId)};class yt extends tr{constructor(e){const{nested:n,noEmit:r,onOpenChange:s,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:lt(),nested:n,noEmit:r,triggerElements:i},nr)}setOpen=(e,n)=>{if((!e||!this.state.open||Jt(n.event))&&(this.context.dataRef.current.openEvent=e?n.event:void 0),!this.context.noEmit){const r={open:e,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(e,n)}}function rr(t,e=!1,n=!1){const[r,s]=d.useState(t&&e?"idle":void 0),[i,a]=d.useState(t);return t&&!i&&(a(!0),s("starting")),!t&&i&&r!=="ending"&&!n&&s("ending"),!t&&!i&&r==="ending"&&s(void 0),w(()=>{if(!t&&i&&r!=="ending"&&n){const o=L.request(()=>{s("ending")});return()=>{L.cancel(o)}}},[t,i,r,n]),w(()=>{if(!t||e)return;const o=L.request(()=>{s(void 0)});return()=>{L.cancel(o)}},[e,t]),w(()=>{if(!t||!e)return;t&&i&&r!=="idle"&&s("starting");const o=L.request(()=>{s("idle")});return()=>{L.cancel(o)}},[e,t,i,s,r]),d.useMemo(()=>({mounted:i,setMounted:a,transitionStatus:r}),[i,r])}let te=(function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t})({});const sr={[te.startingStyle]:""},ir={[te.endingStyle]:""},Vr={transitionStatus(t){return t==="starting"?sr:t==="ending"?ir:null}};function or(t,e=!1,n=!0){const r=rn();return E((s,i=null)=>{r.cancel();function a(){Ae.flushSync(s)}const o=On(t);if(o==null)return;const l=o;if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)s();else{let c=function(){const f=te.startingStyle;if(!l.hasAttribute(f)){r.request(g);return}const b=new MutationObserver(()=>{l.hasAttribute(f)||(b.disconnect(),g())});b.observe(l,{attributes:!0,attributeFilter:[f]}),i?.addEventListener("abort",()=>b.disconnect(),{once:!0})},g=function(){Promise.all(l.getAnimations().map(f=>f.finished)).then(()=>{i?.aborted||a()}).catch(()=>{const f=l.getAnimations();if(n){if(i?.aborted)return;a()}else f.length>0&&f.some(b=>b.pending||b.playState!=="finished")&&g()})};if(e){c();return}r.request(g)}})}function ar(t){const{enabled:e=!0,open:n,ref:r,onComplete:s}=t,i=E(s),a=or(r,n,!1);d.useEffect(()=>{if(!e)return;const o=new AbortController;return a(i,o.signal),()=>{o.abort()}},[e,n,i,a])}function cr(t,e){const n=d.useRef(null),r=d.useRef(null);return d.useCallback(s=>{if(t!==void 0){if(n.current!==null){const i=n.current,a=r.current,o=e.context.triggerElements.getById(i);a&&o===a&&e.context.triggerElements.delete(i),n.current=null,r.current=null}s!==null&&(n.current=t,r.current=s,e.context.triggerElements.add(t,s))}},[e,t])}function Hr(t,e,n,r){const s=n.useState("isMountedByTrigger",t),i=cr(t,n),a=E(o=>{if(i(o),!o||!n.select("open"))return;const l=n.select("activeTriggerId");if(l===t){n.update({activeTriggerElement:o,...r});return}l==null&&n.update({activeTriggerId:t,activeTriggerElement:o,...r})});return w(()=>{s&&n.update({activeTriggerElement:e.current,...r})},[s,n,e,...Object.values(r)]),{registerTrigger:a,isMountedByThisTrigger:s}}function qr(t){const e=t.useState("open");w(()=>{if(e&&!t.select("activeTriggerId")&&t.context.triggerElements.size===1){const n=t.context.triggerElements.entries().next();if(!n.done){const[r,s]=n.value;t.update({activeTriggerId:r,activeTriggerElement:s})}}},[e,t])}function Br(t,e,n){const{mounted:r,setMounted:s,transitionStatus:i}=rr(t);e.useSyncedValues({mounted:r,transitionStatus:i});const a=E(()=>{s(!1),e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),e.context.onOpenChangeComplete?.(!1)}),o=e.useState("preventUnmountingOnClose");return ar({enabled:!o,open:t,ref:e.context.popupRef,onComplete(){t||a()}}),{forceUnmount:a,transitionStatus:i}}class ur{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,n){const r=this.idMap.get(e);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(e,n))}delete(e){const n=this.idMap.get(e);n&&(this.elementsSet.delete(n),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(const n of this.elementsSet)if(e(n))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 lr(){return new yt({open:!1,floatingElement:null,referenceElement:null,triggerElements:new ur,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Kr(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:lr(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ue,inactiveTriggerProps:ue,popupProps:ue}}const ae=T(t=>t.triggerIdProp??t.activeTriggerId),zr={open:T(t=>t.openProp??t.open),mounted:T(t=>t.mounted),transitionStatus:T(t=>t.transitionStatus),floatingRootContext:T(t=>t.floatingRootContext),preventUnmountingOnClose:T(t=>t.preventUnmountingOnClose),payload:T(t=>t.payload),activeTriggerId:ae,activeTriggerElement:T(t=>t.mounted?t.activeTriggerElement:null),isTriggerActive:T((t,e)=>e!==void 0&&ae(t)===e),isOpenedByTrigger:T((t,e)=>e!==void 0&&ae(t)===e&&t.open),isMountedByTrigger:T((t,e)=>e!==void 0&&ae(t)===e&&t.mounted),triggerProps:T((t,e)=>e?t.activeTriggerProps:t.inactiveTriggerProps),popupProps:T(t=>t.popupProps),popupElement:T(t=>t.popupElement),positionerElement:T(t=>t.positionerElement)};function Wr(t){const{popupStore:e,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:s}=t,i=Me(),a=De()!=null,o=e.useState("open"),l=e.useState("activeTriggerElement"),c=e.useState(r?"popupElement":"positionerElement"),g=e.context.triggerElements,f=X(()=>new yt({open:o,referenceElement:l,floatingElement:c,triggerElements:g,onOpenChange:s,floatingId:i,nested:a,noEmit:n})).current;return w(()=>{const b={open:o,floatingId:i,referenceElement:l,floatingElement:c};B(l)&&(b.domReferenceElement=l),f.state.positionReference===f.state.referenceElement&&(b.positionReference=l),f.update(b)},[o,i,l,c,f]),f.context.onOpenChange=s,f.context.nested=a,f.context.noEmit=n,f}function Ur(t=[]){const e=t.map(c=>c?.reference),n=t.map(c=>c?.floating),r=t.map(c=>c?.item),s=t.map(c=>c?.trigger),i=d.useCallback(c=>ce(c,t,"reference"),e),a=d.useCallback(c=>ce(c,t,"floating"),n),o=d.useCallback(c=>ce(c,t,"item"),r),l=d.useCallback(c=>ce(c,t,"trigger"),s);return d.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o,getTriggerProps:l}),[i,a,o,l])}function ce(t,e,n){const r=new Map,s=n==="item",i={};n==="floating"&&(i.tabIndex=-1,i[Qt]="");for(const a in t)s&&t&&(a===et||a===tt)||(i[a]=t[a]);for(let a=0;a<e.length;a+=1){let o;const l=e[a]?.[n];typeof l=="function"?o=t?l(t):null:o=l,o&&Je(i,o,s,r)}return Je(i,t,s,r),i}function Je(t,e,n,r){for(const s in e){const i=e[s];n&&(s===et||s===tt)||(s.startsWith("on")?(r.has(s)||r.set(s,[]),typeof i=="function"&&(r.get(s)?.push(i),t[s]=(...a)=>r.get(s)?.map(o=>o(...a)).find(o=>o!==void 0))):t[s]=i)}}let je=(function(t){return t.open="data-open",t.closed="data-closed",t[t.startingStyle=te.startingStyle]="startingStyle",t[t.endingStyle=te.endingStyle]="endingStyle",t.anchorHidden="data-anchor-hidden",t.side="data-side",t.align="data-align",t})({}),Ne=(function(t){return t.popupOpen="data-popup-open",t.pressed="data-pressed",t})({});const fr={[Ne.popupOpen]:""},dr={[Ne.popupOpen]:"",[Ne.pressed]:""},pr={[je.open]:""},gr={[je.closed]:""},hr={[je.anchorHidden]:""},Yr={open(t){return t?fr:null}},Gr={open(t){return t?dr:null}},$r={open(t){return t?pr:gr},anchorHidden(t){return t?hr:null}};function Xr(t){const e=d.useRef(!0);e.current&&(e.current=!1,t())}export{Ne as $,xe as A,Nr as B,yn as C,Ir as D,Gr as E,Dr as F,$e as G,Tr as H,me as I,L as J,Cn as K,Fe as L,Le as M,gt as N,wr as O,xr as P,On as Q,tr as R,le as S,Sr as T,Sn as U,Cr as V,kr as W,Pr as X,je as Y,yt as Z,Rr as _,Ue as a,Yr as a0,xn as a1,rr as a2,or as a3,te as a4,Or as b,De as c,pt as d,ar as e,Fr as f,ur as g,zr as h,Rn as i,Kr as j,T as k,Yn as l,Xr as m,Ar as n,qr as o,$r as p,Br as q,Wr as r,jr as s,Vr as t,rn as u,Ur as v,Lr as w,_r as x,Hr as y,Mr as z};
1
+ import{u as w,p as Me,g as Y,j as At,a as E,O as Ft,r as Lt,d as B,w as Ce,x as Dt,i as jt,h as _t,o as Vt,E as Ie,t as We,H as Ht,n as qt}from"./useBaseUiId-DFpBD0sg.js";import{C as X,ab as ue,ag as Bt,ac as Kt,ai as zt,af as Wt}from"./button-BciDmec0.js";import{r as d,j as D,w as Ae,x as Ut,y as Yt}from"./main-B2CrcRuC.js";import{u as Qe,e as ee,o as G,d as Gt,v as $t,w as Xt,k as U,x as Zt,y as A,f as Jt,F as Qt,z as et,S as tt}from"./event-BCwqPPkP.js";import{a as en}from"./visuallyHidden-COI6QeQH.js";const Sr=500,Tr=500,Rr={style:{transition:"none"}},Cr="data-base-ui-click-trigger",Ir={fallbackAxisSide:"none"},xr={fallbackAxisSide:"end"},tn={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Q=0;class me{static create(){return new me}currentId=Q;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Q,n()},e)}isStarted(){return this.currentId!==Q}clear=()=>{this.currentId!==Q&&(clearTimeout(this.currentId),this.currentId=Q)};disposeEffect=()=>this.clear}function Ue(){const t=X(me.create).current;return Qe(t.disposeEffect),t}const se=null;class nn{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let s=0;s<n.length;s+=1)n[s]?.(e)};request(e){const n=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(e){const n=e-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const ie=new nn;class L{static create(){return new L}static request(e){return ie.request(e)}static cancel(e){return ie.cancel(e)}currentId=se;request(e){this.cancel(),this.currentId=ie.request(()=>{this.currentId=se,e()})}cancel=()=>{this.currentId!==se&&(ie.cancel(this.currentId),this.currentId=se)};disposeEffect=()=>this.cancel}function rn(){const t=X(L.create).current;return Qe(t.disposeEffect),t}function Or(t){const e=X(sn,t).current;return e.next=t,w(e.effect),e}function sn(t){const e={current:t,next:t,effect:()=>{e.current=e.next}};return e}function le(t,e,n=!0){return t.filter(s=>s.parentId===e&&(!n||s.context?.open)).flatMap(s=>[s,...le(t,s.id,n)])}function wr(t,e){let n=[],r=t.find(s=>s.id===e)?.parentId;for(;r;){const s=t.find(i=>i.id===r);r=s?.parentId,s&&(n=n.concat(s))}return n}var on=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],fe=on.join(","),nt=typeof Element>"u",$=nt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,de=!nt&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},pe=function(e,n){var r;n===void 0&&(n=!0);var s=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),i=s===""||s==="true",a=i||n&&e&&(typeof e.closest=="function"?e.closest("[inert]"):pe(e.parentNode));return a},an=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},rt=function(e,n,r){if(pe(e))return[];var s=Array.prototype.slice.apply(e.querySelectorAll(fe));return n&&$.call(e,fe)&&s.unshift(e),s=s.filter(r),s},ge=function(e,n,r){for(var s=[],i=Array.from(e);i.length;){var a=i.shift();if(!pe(a,!1))if(a.tagName==="SLOT"){var o=a.assignedElements(),l=o.length?o:a.children,c=ge(l,!0,r);r.flatten?s.push.apply(s,c):s.push({scopeParent:a,candidates:c})}else{var g=$.call(a,fe);g&&r.filter(a)&&(n||!e.includes(a))&&s.push(a);var f=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),b=!pe(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(f&&b){var v=ge(f===!0?a.children:f.children,!0,r);r.flatten?s.push.apply(s,v):s.push({scopeParent:a,candidates:v})}else i.unshift.apply(i,a.children)}}return s},st=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},it=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||an(e))&&!st(e)?0:e.tabIndex},cn=function(e,n){var r=it(e);return r<0&&n&&!st(e)?0:r},un=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},ot=function(e){return e.tagName==="INPUT"},ln=function(e){return ot(e)&&e.type==="hidden"},fn=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},dn=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},pn=function(e){if(!e.name)return!0;var n=e.form||de(e),r=function(o){return n.querySelectorAll('input[type="radio"][name="'+o+'"]')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=r(window.CSS.escape(e.name));else try{s=r(e.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var i=dn(s,e.form);return!i||i===e},gn=function(e){return ot(e)&&e.type==="radio"},hn=function(e){return gn(e)&&!pn(e)},mn=function(e){var n,r=e&&de(e),s=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==e){var a,o,l;for(i=!!((a=s)!==null&&a!==void 0&&(o=a.ownerDocument)!==null&&o!==void 0&&o.contains(s)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!i&&s;){var c,g,f;r=de(s),s=(c=r)===null||c===void 0?void 0:c.host,i=!!((g=s)!==null&&g!==void 0&&(f=g.ownerDocument)!==null&&f!==void 0&&f.contains(s))}}return i},Ye=function(e){var n=e.getBoundingClientRect(),r=n.width,s=n.height;return r===0&&s===0},bn=function(e,n){var r=n.displayCheck,s=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in e){var i=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(e).visibility==="hidden")return!0;var a=$.call(e,"details>summary:first-of-type"),o=a?e.parentElement:e;if($.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof s=="function"){for(var l=e;e;){var c=e.parentElement,g=de(e);if(c&&!c.shadowRoot&&s(c)===!0)return Ye(e);e.assignedSlot?e=e.assignedSlot:!c&&g!==e.ownerDocument?e=g.host:e=c}e=l}if(mn(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Ye(e);return!1},vn=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var s=n.children.item(r);if(s.tagName==="LEGEND")return $.call(n,"fieldset[disabled] *")?!0:!s.contains(e)}return!0}n=n.parentElement}return!1},Oe=function(e,n){return!(n.disabled||ln(n)||bn(n,e)||fn(n)||vn(n))},we=function(e,n){return!(hn(n)||it(n)<0||!Oe(e,n))},En=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},at=function(e){var n=[],r=[];return e.forEach(function(s,i){var a=!!s.scopeParent,o=a?s.scopeParent:s,l=cn(o,a),c=a?at(s.candidates):o;l===0?a?n.push.apply(n,c):n.push(o):r.push({documentOrder:i,tabIndex:l,item:s,isScope:a,content:c})}),r.sort(un).reduce(function(s,i){return i.isScope?s.push.apply(s,i.content):s.push(i.content),s},[]).concat(n)},Fe=function(e,n){n=n||{};var r;return n.getShadowRoot?r=ge([e],n.includeContainer,{filter:we.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:En}):r=rt(e,n.includeContainer,we.bind(null,n)),at(r)},Pr=function(e,n){n=n||{};var r;return n.getShadowRoot?r=ge([e],n.includeContainer,{filter:Oe.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=rt(e,n.includeContainer,Oe.bind(null,n)),r},kr=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return $.call(e,fe)===!1?!1:we(n,e)};const Le=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ct(t,e){const n=Fe(t,Le()),r=n.length;if(r===0)return;const s=Gt(G(t)),i=n.indexOf(s),a=i===-1?e===1?0:r-1:i+e;return n[a]}function yn(t){return ct(G(t).body,1)||t}function Sn(t){return ct(G(t).body,-1)||t}function ut(t,e){if(!t)return null;const n=Fe(G(t).body,Le()),r=n.length;if(r===0)return null;const s=n.indexOf(t);if(s===-1)return null;const i=(s+e+r)%r;return n[i]}function Nr(t){return ut(t,1)}function Mr(t){return ut(t,-1)}function xe(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!ee(n,r)}function Tn(t){Fe(t,Le()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Ge(t){t.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function lt(){const t=new Map;return{emit(e,n){t.get(e)?.forEach(r=>r(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){t.get(e)?.delete(n)}}}class Rn{nodesRef={current:[]};events=lt();addNode(e){this.nodesRef.current.push(e)}removeNode(e){const n=this.nodesRef.current.findIndex(r=>r===e);n!==-1&&this.nodesRef.current.splice(n,1)}}const ft=d.createContext(null),dt=d.createContext(null),De=()=>d.useContext(ft)?.id||null,pt=t=>{const e=d.useContext(dt);return t??e};function Ar(t){const e=Me(),n=pt(t),r=De();return w(()=>{if(!e)return;const s={id:e,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,e,r]),e}function Fr(t){const{children:e,id:n}=t,r=De();return D.jsx(ft.Provider,{value:d.useMemo(()=>({id:n,parentId:r}),[n,r]),children:e})}function Lr(t){const{children:e,externalTree:n}=t,r=X(()=>n??new Rn).current;return D.jsx(dt.Provider,{value:r,children:e})}function gt(t){return`data-base-ui-${t}`}const $e=d.forwardRef(function(e,n){const[r,s]=d.useState();w(()=>{$t&&s("button")},[]);const i={tabIndex:0,role:r};return D.jsx("span",{...e,ref:n,style:en,"aria-hidden":r?void 0:!0,...i,"data-base-ui-focus-guard":""})}),ht=d.createContext(null),Cn=()=>d.useContext(ht),In=gt("portal");function xn(t={}){const{ref:e,container:n,componentProps:r=ue,elementProps:s}=t,i=Me(),o=Cn()?.portalNode,[l,c]=d.useState(null),[g,f]=d.useState(null),b=E(P=>{P!==null&&f(P)}),v=d.useRef(null);w(()=>{if(n===null){v.current&&(v.current=null,f(null),c(null));return}if(i==null)return;const P=(n&&(Ft(n)?n:n.current))??o??document.body;if(P==null){v.current&&(v.current=null,f(null),c(null));return}v.current!==P&&(v.current=P,f(null),c(P))},[n,o,i]);const S=Bt("div",r,{ref:[e,b],props:[{id:i,[In]:""},s]});return{portalNode:g,portalSubtree:l&&S?Ae.createPortal(S,l):null}}const Dr=d.forwardRef(function(e,n){const{children:r,container:s,className:i,render:a,renderGuards:o,...l}=e,{portalNode:c,portalSubtree:g}=xn({container:s,ref:n,componentProps:e,elementProps:l}),f=d.useRef(null),b=d.useRef(null),v=d.useRef(null),S=d.useRef(null),[y,P]=d.useState(null),j=y?.modal,k=y?.open,_=typeof o=="boolean"?o:!!y&&!y.modal&&y.open&&!!c;d.useEffect(()=>{if(!c||j)return;function R(N){c&&N.relatedTarget&&xe(N)&&(N.type==="focusin"?Ge:Tn)(c)}return c.addEventListener("focusin",R,!0),c.addEventListener("focusout",R,!0),()=>{c.removeEventListener("focusin",R,!0),c.removeEventListener("focusout",R,!0)}},[c,j]),d.useEffect(()=>{!c||k||Ge(c)},[k,c]);const F=d.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:b,beforeInsideRef:v,afterInsideRef:S,portalNode:c,setFocusManagerState:P}),[c]);return D.jsxs(d.Fragment,{children:[g,D.jsxs(ht.Provider,{value:F,children:[_&&c&&D.jsx($e,{"data-type":"outside",ref:f,onFocus:R=>{if(xe(R,c))v.current?.focus();else{const N=y?y.domReference:null;Sn(N)?.focus()}}}),_&&c&&D.jsx("span",{"aria-owns":c.id,style:tn}),c&&Ae.createPortal(r,c),_&&c&&D.jsx($e,{"data-type":"outside",ref:b,onFocus:R=>{if(xe(R,c))S.current?.focus();else{const N=y?y.domReference:null;yn(N)?.focus(),y?.closeOnFocusOut&&y?.onOpenChange(!1,Y(At,R.nativeEvent))}}})]})]})});function On(t){return t==null?t:"current"in t?t.current:t}const wn={intentional:"onClick",sloppy:"onPointerDown"};function Pn(t){return{escapeKey:typeof t=="boolean"?t:t?.escapeKey??!1,outsidePress:typeof t=="boolean"?t:t?.outsidePress??!0}}function jr(t,e={}){const n="rootStore"in t?t.rootStore:t,r=n.useState("open"),s=n.useState("floatingElement"),i=n.useState("referenceElement"),a=n.useState("domReferenceElement"),{onOpenChange:o,dataRef:l}=n.context,{enabled:c=!0,escapeKey:g=!0,outsidePress:f=!0,outsidePressEvent:b="sloppy",referencePress:v=!1,referencePressEvent:S="sloppy",ancestorScroll:y=!1,bubbles:P,externalTree:j}=e,k=pt(j),_=E(typeof f=="function"?f:()=>!1),F=typeof f=="function"?_:f,R=d.useRef(!1),{escapeKey:N,outsidePress:Z}=Pn(P),I=d.useRef(null),ne=Ue(),_e=Ue(),K=E(()=>{_e.clear(),l.current.insideReactTree=!1}),be=d.useRef(!1),Ve=d.useRef(""),ve=E(u=>{Ve.current=u.pointerType}),z=E(()=>{const u=Ve.current,h=u==="pen"||!u?"mouse":u,p=typeof b=="function"?b():b;return typeof p=="string"?p:p[h]}),V=E(u=>{if(!r||!c||!g||u.key!=="Escape"||be.current)return;const h=l.current.floatingContext?.nodeId,p=k?le(k.nodesRef.current,h):[];if(!N&&p.length>0){let x=!0;if(p.forEach(C=>{C.context?.open&&!C.context.dataRef.current.__escapeKeyBubbles&&(x=!1)}),!x)return}const M=Xt(u)?u.nativeEvent:u,m=Y(Lt,M);n.setOpen(!1,m),!N&&!m.isPropagationAllowed&&u.stopPropagation()}),St=E(u=>{const h=z();return h==="intentional"&&u.type!=="click"||h==="sloppy"&&u.type==="click"}),H=E(()=>{l.current.insideReactTree=!0,_e.start(0,K)}),J=E((u,h=!1)=>{if(St(u)){K();return}if(l.current.insideReactTree){K();return}if(z()==="intentional"&&h||typeof F=="function"&&!F(u))return;const p=U(u),M=`[${gt("inert")}]`,m=G(n.select("floatingElement")).querySelectorAll(M),x=n.context.triggerElements;if(p&&(x.hasElement(p)||x.hasMatchingElement(O=>ee(O,p))))return;let C=B(p)?p:null;for(;C&&!Ce(C);){const O=Dt(C);if(Ce(O)||!B(O))break;C=O}if(m.length&&B(p)&&!Zt(p)&&!ee(p,n.select("floatingElement"))&&Array.from(m).every(O=>!ee(C,O)))return;if(jt(p)&&!("touches"in u)){const O=Ce(p),W=_t(p),ze=/auto|scroll/,xt=O||ze.test(W.overflowX),Ot=O||ze.test(W.overflowY),wt=xt&&p.clientWidth>0&&p.scrollWidth>p.clientWidth,Pt=Ot&&p.clientHeight>0&&p.scrollHeight>p.clientHeight,kt=W.direction==="rtl",Nt=Pt&&(kt?u.offsetX<=p.offsetWidth-p.clientWidth:u.offsetX>p.clientWidth),Mt=wt&&u.offsetY>p.clientHeight;if(Nt||Mt)return}const Be=l.current.floatingContext?.nodeId,It=k&&le(k.nodesRef.current,Be).some(O=>A(u,O.context?.elements.floating));if(A(u,n.select("floatingElement"))||A(u,n.select("domReferenceElement"))||It)return;const Ke=k?le(k.nodesRef.current,Be):[];if(Ke.length>0){let O=!0;if(Ke.forEach(W=>{W.context?.open&&!W.context.dataRef.current.__outsidePressBubbles&&(O=!1)}),!O)return}n.setOpen(!1,Y(Vt,u)),K()}),He=E(u=>{z()!=="sloppy"||u.pointerType==="touch"||!n.select("open")||!c||A(u,n.select("floatingElement"))||A(u,n.select("domReferenceElement"))||J(u)}),Tt=E(u=>{if(z()!=="sloppy"||!n.select("open")||!c||A(u,n.select("floatingElement"))||A(u,n.select("domReferenceElement")))return;const h=u.touches[0];h&&(I.current={startTime:Date.now(),startX:h.clientX,startY:h.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},ne.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}),Ee=E(u=>{const h=U(u);function p(){Tt(u),h?.removeEventListener(u.type,p)}h?.addEventListener(u.type,p)}),q=E(u=>{const h=R.current;if(R.current=!1,ne.clear(),u.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const p=U(u);function M(){u.type==="pointerdown"?He(u):J(u,h),p?.removeEventListener(u.type,M)}p?.addEventListener(u.type,M)}),Rt=E(u=>{if(z()!=="sloppy"||!I.current||A(u,n.select("floatingElement"))||A(u,n.select("domReferenceElement")))return;const h=u.touches[0];if(!h)return;const p=Math.abs(h.clientX-I.current.startX),M=Math.abs(h.clientY-I.current.startY),m=Math.sqrt(p*p+M*M);m>5&&(I.current.dismissOnTouchEnd=!0),m>10&&(J(u),ne.clear(),I.current=null)}),ye=E(u=>{const h=U(u);function p(){Rt(u),h?.removeEventListener(u.type,p)}h?.addEventListener(u.type,p)}),Ct=E(u=>{z()!=="sloppy"||!I.current||A(u,n.select("floatingElement"))||A(u,n.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&J(u),ne.clear(),I.current=null)}),Se=E(u=>{const h=U(u);function p(){Ct(u),h?.removeEventListener(u.type,p)}h?.addEventListener(u.type,p)});d.useEffect(()=>{if(!r||!c)return;l.current.__escapeKeyBubbles=N,l.current.__outsidePressBubbles=Z;const u=new me;function h(C){n.setOpen(!1,Y(qt,C))}function p(){u.clear(),be.current=!0}function M(){u.start(Ht()?5:0,()=>{be.current=!1})}const m=G(s);m.addEventListener("pointerdown",ve,!0),g&&(m.addEventListener("keydown",V),m.addEventListener("compositionstart",p),m.addEventListener("compositionend",M)),F&&(m.addEventListener("click",q,!0),m.addEventListener("pointerdown",q,!0),m.addEventListener("touchstart",Ee,!0),m.addEventListener("touchmove",ye,!0),m.addEventListener("touchend",Se,!0),m.addEventListener("mousedown",q,!0));let x=[];return y&&(B(a)&&(x=Ie(a)),B(s)&&(x=x.concat(Ie(s))),!B(i)&&i&&i.contextElement&&(x=x.concat(Ie(i.contextElement)))),x=x.filter(C=>C!==m.defaultView?.visualViewport),x.forEach(C=>{C.addEventListener("scroll",h,{passive:!0})}),()=>{m.removeEventListener("pointerdown",ve,!0),g&&(m.removeEventListener("keydown",V),m.removeEventListener("compositionstart",p),m.removeEventListener("compositionend",M)),F&&(m.removeEventListener("click",q,!0),m.removeEventListener("pointerdown",q,!0),m.removeEventListener("touchstart",Ee,!0),m.removeEventListener("touchmove",ye,!0),m.removeEventListener("touchend",Se,!0),m.removeEventListener("mousedown",q,!0)),x.forEach(C=>{C.removeEventListener("scroll",h)}),u.clear(),R.current=!1}},[l,s,i,a,g,F,r,o,y,c,N,Z,V,J,q,He,Ee,ye,Se,ve,n]),d.useEffect(K,[F,K]);const Te=d.useMemo(()=>({onKeyDown:V,...v&&{[wn[S]]:u=>{n.setOpen(!1,Y(We,u.nativeEvent))},...S!=="intentional"&&{onClick(u){n.setOpen(!1,Y(We,u.nativeEvent))}}}}),[V,n,v,S]),re=E(u=>{const h=U(u.nativeEvent);!ee(n.select("floatingElement"),h)||u.button!==0||(R.current=!0)}),Re=E(u=>{!r||!c||u.button!==0||(R.current=!0)}),qe=d.useMemo(()=>({onKeyDown:V,onPointerDown:re,onMouseDown:re,onMouseUp:re,onClickCapture:H,onMouseDownCapture(u){H(),Re(u)},onPointerDownCapture(u){H(),Re(u)},onMouseUpCapture:H,onTouchEndCapture:H,onTouchMoveCapture:H}),[V,re,H,Re]);return d.useMemo(()=>c?{reference:Te,floating:qe,trigger:Te}:{},[c,Te,qe])}var he=Symbol("NOT_FOUND");function kn(t,e=`expected a function, instead received ${typeof t}`){if(typeof t!="function")throw new TypeError(e)}function Nn(t,e=`expected an object, instead received ${typeof t}`){if(typeof t!="object")throw new TypeError(e)}function Mn(t,e="expected all items to be functions, instead received the following types: "){if(!t.every(n=>typeof n=="function")){const n=t.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${e}[${n}]`)}}var Xe=t=>Array.isArray(t)?t:[t];function An(t){const e=Array.isArray(t[0])?t[0]:t;return Mn(e,"createSelector expects all input-selectors to be functions, but received the following types: "),e}function Fn(t,e){const n=[],{length:r}=t;for(let s=0;s<r;s++)n.push(t[s].apply(null,e));return n}function Ln(t){let e;return{get(n){return e&&t(e.key,n)?e.value:he},put(n,r){e={key:n,value:r}},getEntries(){return e?[e]:[]},clear(){e=void 0}}}function Dn(t,e){let n=[];function r(o){const l=n.findIndex(c=>e(o,c.key));if(l>-1){const c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return he}function s(o,l){r(o)===he&&(n.unshift({key:o,value:l}),n.length>t&&n.pop())}function i(){return n}function a(){n=[]}return{get:r,put:s,getEntries:i,clear:a}}var jn=(t,e)=>t===e;function _n(t){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:s}=n;for(let i=0;i<s;i++)if(!t(n[i],r[i]))return!1;return!0}}function Vn(t,e){const n=typeof e=="object"?e:{equalityCheck:e},{equalityCheck:r=jn,maxSize:s=1,resultEqualityCheck:i}=n,a=_n(r);let o=0;const l=s<=1?Ln(a):Dn(s,a);function c(){let g=l.get(arguments);if(g===he){if(g=t.apply(null,arguments),o++,i){const b=l.getEntries().find(v=>i(v.value,g));b&&(g=b.value,o!==0&&o--)}l.put(arguments,g)}return g}return c.clearCache=()=>{l.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var Hn=class{constructor(t){this.value=t}deref(){return this.value}},qn=typeof WeakRef<"u"?WeakRef:Hn,Bn=0,Ze=1;function oe(){return{s:Bn,v:void 0,o:null,p:null}}function mt(t,e={}){let n=oe();const{resultEqualityCheck:r}=e;let s,i=0;function a(){let o=n;const{length:l}=arguments;for(let f=0,b=l;f<b;f++){const v=arguments[f];if(typeof v=="function"||typeof v=="object"&&v!==null){let S=o.o;S===null&&(o.o=S=new WeakMap);const y=S.get(v);y===void 0?(o=oe(),S.set(v,o)):o=y}else{let S=o.p;S===null&&(o.p=S=new Map);const y=S.get(v);y===void 0?(o=oe(),S.set(v,o)):o=y}}const c=o;let g;if(o.s===Ze)g=o.v;else if(g=t.apply(null,arguments),i++,r){const f=s?.deref?.()??s;f!=null&&r(f,g)&&(g=f,i!==0&&i--),s=typeof g=="object"&&g!==null||typeof g=="function"?new qn(g):g}return c.s=Ze,c.v=g,g}return a.clearCache=()=>{n=oe(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function bt(t,...e){const n=typeof t=="function"?{memoize:t,memoizeOptions:e}:t,r=(...s)=>{let i=0,a=0,o,l={},c=s.pop();typeof c=="object"&&(l=c,c=s.pop()),kn(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const g={...n,...l},{memoize:f,memoizeOptions:b=[],argsMemoize:v=mt,argsMemoizeOptions:S=[]}=g,y=Xe(b),P=Xe(S),j=An(s),k=f(function(){return i++,c.apply(null,arguments)},...y),_=v(function(){a++;const R=Fn(j,arguments);return o=k.apply(null,R),o},...P);return Object.assign(_,{resultFunc:c,memoizedResultFunc:k,dependencies:j,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>o,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:f,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var Kn=bt(mt),zn=Object.assign((t,e=Kn)=>{Nn(t,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof t}`);const n=Object.keys(t),r=n.map(i=>t[i]);return e(r,(...i)=>i.reduce((a,o,l)=>(a[n[l]]=o,a),{}))},{withTypes:()=>zn});bt({memoize:Vn,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const T=(t,e,n,r,s,i,...a)=>{if(a.length>0)throw new Error(Kt(1));let o;if(t)o=t;else throw new Error("Missing arguments");return o};var vt=Ut();const Pe=[];let ke;function Wn(){return ke}function Un(t){Pe.push(t)}function Yn(t){const e=(n,r)=>{const s=X(Gn).current;let i;try{ke=s;for(const a of Pe)a.before(s);i=t(n,r);for(const a of Pe)a.after(s);s.didInitialize=!0}finally{ke=void 0}return i};return e.displayName=t.displayName||t.name,e}function _r(t){return d.forwardRef(Yn(t))}function Gn(){return{didInitialize:!1}}const $n=zt(19),Xn=$n?Jn:Qn;function Et(t,e,n,r,s){return Xn(t,e,n,r,s)}function Zn(t,e,n,r,s){const i=d.useCallback(()=>e(t.getSnapshot(),n,r,s),[t,e,n,r,s]);return vt.useSyncExternalStore(t.subscribe,i,i)}Un({before(t){t.syncIndex=0,t.didInitialize||(t.syncTick=1,t.syncHooks=[],t.didChangeStore=!0,t.getSnapshot=()=>{let e=!1;for(let n=0;n<t.syncHooks.length;n+=1){const r=t.syncHooks[n],s=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,s))&&(e=!0,r.value=s,r.didChange=!1)}return e&&(t.syncTick+=1),t.syncTick})},after(t){t.syncHooks.length>0&&(t.didChangeStore&&(t.didChangeStore=!1,t.subscribe=e=>{const n=new Set;for(const s of t.syncHooks)n.add(s.store);const r=[];for(const s of n)r.push(s.subscribe(e));return()=>{for(const s of r)s()}}),vt.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot))}});function Jn(t,e,n,r,s){const i=Wn();if(!i)return Zn(t,e,n,r,s);const a=i.syncIndex;i.syncIndex+=1;let o;return i.didInitialize?(o=i.syncHooks[a],(o.store!==t||o.selector!==e||!Object.is(o.a1,n)||!Object.is(o.a2,r)||!Object.is(o.a3,s))&&(o.store!==t&&(i.didChangeStore=!0),o.store=t,o.selector=e,o.a1=n,o.a2=r,o.a3=s,o.didChange=!0)):(o={store:t,selector:e,a1:n,a2:r,a3:s,value:e(t.getSnapshot(),n,r,s),didChange:!1},i.syncHooks.push(o)),o.value}function Qn(t,e,n,r,s){return Yt.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,i=>e(i,n,r,s))}class er{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(e)}}update(e){for(const n in e)if(!Object.is(this.state[n],e[n])){this.setState({...this.state,...e});return}}set(e,n){Object.is(this.state[e],n)||this.setState({...this.state,[e]:n})}notifyAll(){const e={...this.state};this.setState(e)}use(e,n,r,s){return Et(this,e,n,r,s)}}class tr extends er{constructor(e,n={},r){super(e),this.context=n,this.selectors=r}useSyncedValue(e,n){d.useDebugValue(e),w(()=>{this.state[e]!==n&&this.set(e,n)},[e,n])}useSyncedValueWithCleanup(e,n){const r=this;w(()=>(r.state[e]!==n&&r.set(e,n),()=>{r.set(e,void 0)}),[r,e,n])}useSyncedValues(e){const n=this,r=Object.values(e);w(()=>{n.update(e)},[n,...r])}useControlledProp(e,n){d.useDebugValue(e);const r=n!==void 0;w(()=>{r&&!Object.is(this.state[e],n)&&super.setState({...this.state,[e]:n})},[e,n,r])}select(e,n,r,s){const i=this.selectors[e];return i(this.state,n,r,s)}useState(e,n,r,s){return d.useDebugValue(e),Et(this,this.selectors[e],n,r,s)}useContextCallback(e,n){d.useDebugValue(e);const r=E(n??Wt);this.context[e]=r}useStateSetter(e){const n=d.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(e,r)}),n.current}observe(e,n){let r;typeof e=="function"?r=e:r=this.selectors[e];let s=r(this.state);return n(s,s,this),this.subscribe(i=>{const a=r(i);if(!Object.is(s,a)){const o=s;s=a,n(a,o,this)}})}}const nr={open:T(t=>t.open),domReferenceElement:T(t=>t.domReferenceElement),referenceElement:T(t=>t.positionReference??t.referenceElement),floatingElement:T(t=>t.floatingElement),floatingId:T(t=>t.floatingId)};class yt extends tr{constructor(e){const{nested:n,noEmit:r,onOpenChange:s,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:lt(),nested:n,noEmit:r,triggerElements:i},nr)}setOpen=(e,n)=>{if((!e||!this.state.open||Jt(n.event))&&(this.context.dataRef.current.openEvent=e?n.event:void 0),!this.context.noEmit){const r={open:e,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(e,n)}}function rr(t,e=!1,n=!1){const[r,s]=d.useState(t&&e?"idle":void 0),[i,a]=d.useState(t);return t&&!i&&(a(!0),s("starting")),!t&&i&&r!=="ending"&&!n&&s("ending"),!t&&!i&&r==="ending"&&s(void 0),w(()=>{if(!t&&i&&r!=="ending"&&n){const o=L.request(()=>{s("ending")});return()=>{L.cancel(o)}}},[t,i,r,n]),w(()=>{if(!t||e)return;const o=L.request(()=>{s(void 0)});return()=>{L.cancel(o)}},[e,t]),w(()=>{if(!t||!e)return;t&&i&&r!=="idle"&&s("starting");const o=L.request(()=>{s("idle")});return()=>{L.cancel(o)}},[e,t,i,s,r]),d.useMemo(()=>({mounted:i,setMounted:a,transitionStatus:r}),[i,r])}let te=(function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t})({});const sr={[te.startingStyle]:""},ir={[te.endingStyle]:""},Vr={transitionStatus(t){return t==="starting"?sr:t==="ending"?ir:null}};function or(t,e=!1,n=!0){const r=rn();return E((s,i=null)=>{r.cancel();function a(){Ae.flushSync(s)}const o=On(t);if(o==null)return;const l=o;if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)s();else{let c=function(){const f=te.startingStyle;if(!l.hasAttribute(f)){r.request(g);return}const b=new MutationObserver(()=>{l.hasAttribute(f)||(b.disconnect(),g())});b.observe(l,{attributes:!0,attributeFilter:[f]}),i?.addEventListener("abort",()=>b.disconnect(),{once:!0})},g=function(){Promise.all(l.getAnimations().map(f=>f.finished)).then(()=>{i?.aborted||a()}).catch(()=>{const f=l.getAnimations();if(n){if(i?.aborted)return;a()}else f.length>0&&f.some(b=>b.pending||b.playState!=="finished")&&g()})};if(e){c();return}r.request(g)}})}function ar(t){const{enabled:e=!0,open:n,ref:r,onComplete:s}=t,i=E(s),a=or(r,n,!1);d.useEffect(()=>{if(!e)return;const o=new AbortController;return a(i,o.signal),()=>{o.abort()}},[e,n,i,a])}function cr(t,e){const n=d.useRef(null),r=d.useRef(null);return d.useCallback(s=>{if(t!==void 0){if(n.current!==null){const i=n.current,a=r.current,o=e.context.triggerElements.getById(i);a&&o===a&&e.context.triggerElements.delete(i),n.current=null,r.current=null}s!==null&&(n.current=t,r.current=s,e.context.triggerElements.add(t,s))}},[e,t])}function Hr(t,e,n,r){const s=n.useState("isMountedByTrigger",t),i=cr(t,n),a=E(o=>{if(i(o),!o||!n.select("open"))return;const l=n.select("activeTriggerId");if(l===t){n.update({activeTriggerElement:o,...r});return}l==null&&n.update({activeTriggerId:t,activeTriggerElement:o,...r})});return w(()=>{s&&n.update({activeTriggerElement:e.current,...r})},[s,n,e,...Object.values(r)]),{registerTrigger:a,isMountedByThisTrigger:s}}function qr(t){const e=t.useState("open");w(()=>{if(e&&!t.select("activeTriggerId")&&t.context.triggerElements.size===1){const n=t.context.triggerElements.entries().next();if(!n.done){const[r,s]=n.value;t.update({activeTriggerId:r,activeTriggerElement:s})}}},[e,t])}function Br(t,e,n){const{mounted:r,setMounted:s,transitionStatus:i}=rr(t);e.useSyncedValues({mounted:r,transitionStatus:i});const a=E(()=>{s(!1),e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),e.context.onOpenChangeComplete?.(!1)}),o=e.useState("preventUnmountingOnClose");return ar({enabled:!o,open:t,ref:e.context.popupRef,onComplete(){t||a()}}),{forceUnmount:a,transitionStatus:i}}class ur{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,n){const r=this.idMap.get(e);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(e,n))}delete(e){const n=this.idMap.get(e);n&&(this.elementsSet.delete(n),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(const n of this.elementsSet)if(e(n))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 lr(){return new yt({open:!1,floatingElement:null,referenceElement:null,triggerElements:new ur,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Kr(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:lr(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ue,inactiveTriggerProps:ue,popupProps:ue}}const ae=T(t=>t.triggerIdProp??t.activeTriggerId),zr={open:T(t=>t.openProp??t.open),mounted:T(t=>t.mounted),transitionStatus:T(t=>t.transitionStatus),floatingRootContext:T(t=>t.floatingRootContext),preventUnmountingOnClose:T(t=>t.preventUnmountingOnClose),payload:T(t=>t.payload),activeTriggerId:ae,activeTriggerElement:T(t=>t.mounted?t.activeTriggerElement:null),isTriggerActive:T((t,e)=>e!==void 0&&ae(t)===e),isOpenedByTrigger:T((t,e)=>e!==void 0&&ae(t)===e&&t.open),isMountedByTrigger:T((t,e)=>e!==void 0&&ae(t)===e&&t.mounted),triggerProps:T((t,e)=>e?t.activeTriggerProps:t.inactiveTriggerProps),popupProps:T(t=>t.popupProps),popupElement:T(t=>t.popupElement),positionerElement:T(t=>t.positionerElement)};function Wr(t){const{popupStore:e,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:s}=t,i=Me(),a=De()!=null,o=e.useState("open"),l=e.useState("activeTriggerElement"),c=e.useState(r?"popupElement":"positionerElement"),g=e.context.triggerElements,f=X(()=>new yt({open:o,referenceElement:l,floatingElement:c,triggerElements:g,onOpenChange:s,floatingId:i,nested:a,noEmit:n})).current;return w(()=>{const b={open:o,floatingId:i,referenceElement:l,floatingElement:c};B(l)&&(b.domReferenceElement=l),f.state.positionReference===f.state.referenceElement&&(b.positionReference=l),f.update(b)},[o,i,l,c,f]),f.context.onOpenChange=s,f.context.nested=a,f.context.noEmit=n,f}function Ur(t=[]){const e=t.map(c=>c?.reference),n=t.map(c=>c?.floating),r=t.map(c=>c?.item),s=t.map(c=>c?.trigger),i=d.useCallback(c=>ce(c,t,"reference"),e),a=d.useCallback(c=>ce(c,t,"floating"),n),o=d.useCallback(c=>ce(c,t,"item"),r),l=d.useCallback(c=>ce(c,t,"trigger"),s);return d.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o,getTriggerProps:l}),[i,a,o,l])}function ce(t,e,n){const r=new Map,s=n==="item",i={};n==="floating"&&(i.tabIndex=-1,i[Qt]="");for(const a in t)s&&t&&(a===et||a===tt)||(i[a]=t[a]);for(let a=0;a<e.length;a+=1){let o;const l=e[a]?.[n];typeof l=="function"?o=t?l(t):null:o=l,o&&Je(i,o,s,r)}return Je(i,t,s,r),i}function Je(t,e,n,r){for(const s in e){const i=e[s];n&&(s===et||s===tt)||(s.startsWith("on")?(r.has(s)||r.set(s,[]),typeof i=="function"&&(r.get(s)?.push(i),t[s]=(...a)=>r.get(s)?.map(o=>o(...a)).find(o=>o!==void 0))):t[s]=i)}}let je=(function(t){return t.open="data-open",t.closed="data-closed",t[t.startingStyle=te.startingStyle]="startingStyle",t[t.endingStyle=te.endingStyle]="endingStyle",t.anchorHidden="data-anchor-hidden",t.side="data-side",t.align="data-align",t})({}),Ne=(function(t){return t.popupOpen="data-popup-open",t.pressed="data-pressed",t})({});const fr={[Ne.popupOpen]:""},dr={[Ne.popupOpen]:"",[Ne.pressed]:""},pr={[je.open]:""},gr={[je.closed]:""},hr={[je.anchorHidden]:""},Yr={open(t){return t?fr:null}},Gr={open(t){return t?dr:null}},$r={open(t){return t?pr:gr},anchorHidden(t){return t?hr:null}};function Xr(t){const e=d.useRef(!0);e.current&&(e.current=!1,t())}export{Ne as $,xe as A,Nr as B,yn as C,Ir as D,Gr as E,Dr as F,$e as G,Tr as H,me as I,L as J,Cn as K,Fe as L,Le as M,gt as N,wr as O,xr as P,On as Q,tr as R,le as S,Sr as T,Sn as U,Cr as V,kr as W,Pr as X,je as Y,yt as Z,Rr as _,Ue as a,Yr as a0,xn as a1,rr as a2,or as a3,te as a4,Or as b,De as c,pt as d,ar as e,Fr as f,ur as g,zr as h,Rn as i,Kr as j,T as k,Yn as l,Xr as m,Ar as n,qr as o,$r as p,Br as q,Wr as r,jr as s,Vr as t,rn as u,Ur as v,Lr as w,_r as x,Hr as y,Mr as z};
@@ -1 +1 @@
1
- import{S as G,p as N,e as l,s as Q,f as g,b as M,i as x,k as B,t as J,l as C,m as X,o as Y,q as A,n as z,r as d,c as V,u as Z}from"./main-_1IghVZn.js";var $=class extends G{constructor(t,e){super(),this.options=e,this.#s=t,this.#i=null,this.#r=N(),this.bindMethods(),this.setOptions(e)}#s;#t=void 0;#p=void 0;#e=void 0;#a;#u;#r;#i;#b;#l;#d;#o;#h;#n;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),j(this.#t,this.options)?this.#c():this.updateResult(),this.#g())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#y(),this.#S(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,s=this.#t;if(this.options=this.#s.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof l(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#O(),this.#t.setOptions(this.options),e._defaulted&&!Q(this.options,e)&&this.#s.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&H(this.#t,s,this.options,e)&&this.#c(),this.updateResult(),r&&(this.#t!==s||l(this.options.enabled,this.#t)!==l(e.enabled,this.#t)||g(this.options.staleTime,this.#t)!==g(e.staleTime,this.#t))&&this.#R();const i=this.#v();r&&(this.#t!==s||l(this.options.enabled,this.#t)!==l(e.enabled,this.#t)||i!==this.#n)&&this.#m(i)}getOptimisticResult(t){const e=this.#s.getQueryCache().build(this.#s,t),s=this.createResult(e,t);return tt(this,s)&&(this.#e=s,this.#u=this.options,this.#a=this.#t.state),s}getCurrentResult(){return this.#e}trackResult(t,e){return new Proxy(t,{get:(s,r)=>(this.trackProp(r),e?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#r.status==="pending"&&this.#r.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,r))})}trackProp(t){this.#f.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#s.defaultQueryOptions(t),s=this.#s.getQueryCache().build(this.#s,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#c({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#e))}#c(t){this.#O();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(M)),e}#R(){this.#y();const t=g(this.options.staleTime,this.#t);if(x||this.#e.isStale||!B(t))return;const s=J(this.#e.dataUpdatedAt,t)+1;this.#o=C.setTimeout(()=>{this.#e.isStale||this.updateResult()},s)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#m(t){this.#S(),this.#n=t,!(x||l(this.options.enabled,this.#t)===!1||!B(this.#n)||this.#n===0)&&(this.#h=C.setInterval(()=>{(this.options.refetchIntervalInBackground||X.isFocused())&&this.#c()},this.#n))}#g(){this.#R(),this.#m(this.#v())}#y(){this.#o&&(C.clearTimeout(this.#o),this.#o=void 0)}#S(){this.#h&&(C.clearInterval(this.#h),this.#h=void 0)}createResult(t,e){const s=this.#t,r=this.options,i=this.#e,u=this.#a,a=this.#u,R=t!==s?t.state:this.#p,{state:h}=t;let n={...h},v=!1,o;if(e._optimisticResults){const c=this.hasListeners(),m=!c&&j(t,e),S=c&&H(t,s,e,r);(m||S)&&(n={...n,...Y(h.data,t.options)}),e._optimisticResults==="isRestoring"&&(n.fetchStatus="idle")}let{error:y,errorUpdatedAt:U,status:b}=n;o=n.data;let D=!1;if(e.placeholderData!==void 0&&o===void 0&&b==="pending"){let c;i?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(c=i.data,D=!0):c=typeof e.placeholderData=="function"?e.placeholderData(this.#d?.state.data,this.#d):e.placeholderData,c!==void 0&&(b="success",o=A(i?.data,c,e),v=!0)}if(e.select&&o!==void 0&&!D)if(i&&o===u?.data&&e.select===this.#b)o=this.#l;else try{this.#b=e.select,o=e.select(o),o=A(i?.data,o,e),this.#l=o,this.#i=null}catch(c){this.#i=c}this.#i&&(y=this.#i,o=this.#l,U=Date.now(),b="error");const I=n.fetchStatus==="fetching",T=b==="pending",w=b==="error",F=T&&I,k=o!==void 0,p={status:b,fetchStatus:n.fetchStatus,isPending:T,isSuccess:b==="success",isError:w,isInitialLoading:F,isLoading:F,data:o,dataUpdatedAt:n.dataUpdatedAt,error:y,errorUpdatedAt:U,failureCount:n.fetchFailureCount,failureReason:n.fetchFailureReason,errorUpdateCount:n.errorUpdateCount,isFetched:n.dataUpdateCount>0||n.errorUpdateCount>0,isFetchedAfterMount:n.dataUpdateCount>R.dataUpdateCount||n.errorUpdateCount>R.errorUpdateCount,isFetching:I,isRefetching:I&&!T,isLoadingError:w&&!k,isPaused:n.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:w&&k,isStale:P(t,e),refetch:this.refetch,promise:this.#r,isEnabled:l(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const c=p.data!==void 0,m=p.status==="error"&&!c,S=E=>{m?E.reject(p.error):c&&E.resolve(p.data)},L=()=>{const E=this.#r=p.promise=N();S(E)},O=this.#r;switch(O.status){case"pending":t.queryHash===s.queryHash&&S(O);break;case"fulfilled":(m||p.data!==O.value)&&L();break;case"rejected":(!m||p.error!==O.reason)&&L();break}}return p}updateResult(){const t=this.#e,e=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#u=this.options,this.#a.data!==void 0&&(this.#d=this.#t),Q(e,t))return;this.#e=e;const s=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#f.size)return!0;const u=new Set(i??this.#f);return this.options.throwOnError&&u.add("error"),Object.keys(this.#e).some(a=>{const f=a;return this.#e[f]!==t[f]&&u.has(f)})};this.#E({listeners:s()})}#O(){const t=this.#s.getQueryCache().build(this.#s,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#p=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#g()}#E(t){z.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#e)}),this.#s.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function q(t,e){return l(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function j(t,e){return q(t,e)||t.state.data!==void 0&&_(t,e,e.refetchOnMount)}function _(t,e,s){if(l(e.enabled,t)!==!1&&g(e.staleTime,t)!=="static"){const r=typeof s=="function"?s(t):s;return r==="always"||r!==!1&&P(t,e)}return!1}function H(t,e,s,r){return(t!==e||l(r.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&P(t,s)}function P(t,e){return l(e.enabled,t)!==!1&&t.isStaleByTime(g(e.staleTime,t))}function tt(t,e){return!Q(t.getCurrentResult(),e)}var K=d.createContext(!1),et=()=>d.useContext(K);K.Provider;function st(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var rt=d.createContext(st()),it=()=>d.useContext(rt),nt=(t,e,s)=>{const r=s?.state.error&&typeof t.throwOnError=="function"?V(t.throwOnError,[s.state.error,s]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},at=t=>{d.useEffect(()=>{t.clearReset()},[t])},ot=({result:t,errorResetBoundary:e,throwOnError:s,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||V(s,[t.error,r])),ht=t=>{if(t.suspense){const s=i=>i==="static"?i:Math.max(i??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...i)=>s(r(...i)):s(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},ct=(t,e)=>t.isLoading&&t.isFetching&&!e,ut=(t,e)=>t?.suspense&&e.isPending,W=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function lt(t,e,s){const r=et(),i=it(),u=Z(),a=u.defaultQueryOptions(t);u.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const f=u.getQueryCache().get(a.queryHash);a._optimisticResults=r?"isRestoring":"optimistic",ht(a),nt(a,i,f),at(i);const R=!u.getQueryCache().get(a.queryHash),[h]=d.useState(()=>new e(u,a)),n=h.getOptimisticResult(a),v=!r&&t.subscribed!==!1;if(d.useSyncExternalStore(d.useCallback(o=>{const y=v?h.subscribe(z.batchCalls(o)):M;return h.updateResult(),y},[h,v]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),d.useEffect(()=>{h.setOptions(a)},[a,h]),ut(a,n))throw W(a,h,i);if(ot({result:n,errorResetBoundary:i,throwOnError:a.throwOnError,query:f,suspense:a.suspense}))throw n.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(a,n),a.experimental_prefetchInRender&&!x&&ct(n,r)&&(R?W(a,h,i):f?.promise)?.catch(M).finally(()=>{h.updateResult()}),a.notifyOnChangeProps?n:h.trackResult(n)}function pt(t,e){return lt(t,$)}export{pt as u};
1
+ import{S as G,p as N,e as l,s as Q,f as g,b as M,i as x,k as B,t as J,l as C,m as X,o as Y,q as A,n as z,r as d,c as V,u as Z}from"./main-B2CrcRuC.js";var $=class extends G{constructor(t,e){super(),this.options=e,this.#s=t,this.#i=null,this.#r=N(),this.bindMethods(),this.setOptions(e)}#s;#t=void 0;#p=void 0;#e=void 0;#a;#u;#r;#i;#b;#l;#d;#o;#h;#n;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),j(this.#t,this.options)?this.#c():this.updateResult(),this.#g())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#y(),this.#S(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,s=this.#t;if(this.options=this.#s.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof l(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#O(),this.#t.setOptions(this.options),e._defaulted&&!Q(this.options,e)&&this.#s.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&H(this.#t,s,this.options,e)&&this.#c(),this.updateResult(),r&&(this.#t!==s||l(this.options.enabled,this.#t)!==l(e.enabled,this.#t)||g(this.options.staleTime,this.#t)!==g(e.staleTime,this.#t))&&this.#R();const i=this.#v();r&&(this.#t!==s||l(this.options.enabled,this.#t)!==l(e.enabled,this.#t)||i!==this.#n)&&this.#m(i)}getOptimisticResult(t){const e=this.#s.getQueryCache().build(this.#s,t),s=this.createResult(e,t);return tt(this,s)&&(this.#e=s,this.#u=this.options,this.#a=this.#t.state),s}getCurrentResult(){return this.#e}trackResult(t,e){return new Proxy(t,{get:(s,r)=>(this.trackProp(r),e?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#r.status==="pending"&&this.#r.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,r))})}trackProp(t){this.#f.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#s.defaultQueryOptions(t),s=this.#s.getQueryCache().build(this.#s,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#c({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#e))}#c(t){this.#O();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(M)),e}#R(){this.#y();const t=g(this.options.staleTime,this.#t);if(x||this.#e.isStale||!B(t))return;const s=J(this.#e.dataUpdatedAt,t)+1;this.#o=C.setTimeout(()=>{this.#e.isStale||this.updateResult()},s)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#m(t){this.#S(),this.#n=t,!(x||l(this.options.enabled,this.#t)===!1||!B(this.#n)||this.#n===0)&&(this.#h=C.setInterval(()=>{(this.options.refetchIntervalInBackground||X.isFocused())&&this.#c()},this.#n))}#g(){this.#R(),this.#m(this.#v())}#y(){this.#o&&(C.clearTimeout(this.#o),this.#o=void 0)}#S(){this.#h&&(C.clearInterval(this.#h),this.#h=void 0)}createResult(t,e){const s=this.#t,r=this.options,i=this.#e,u=this.#a,a=this.#u,R=t!==s?t.state:this.#p,{state:h}=t;let n={...h},v=!1,o;if(e._optimisticResults){const c=this.hasListeners(),m=!c&&j(t,e),S=c&&H(t,s,e,r);(m||S)&&(n={...n,...Y(h.data,t.options)}),e._optimisticResults==="isRestoring"&&(n.fetchStatus="idle")}let{error:y,errorUpdatedAt:U,status:b}=n;o=n.data;let D=!1;if(e.placeholderData!==void 0&&o===void 0&&b==="pending"){let c;i?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(c=i.data,D=!0):c=typeof e.placeholderData=="function"?e.placeholderData(this.#d?.state.data,this.#d):e.placeholderData,c!==void 0&&(b="success",o=A(i?.data,c,e),v=!0)}if(e.select&&o!==void 0&&!D)if(i&&o===u?.data&&e.select===this.#b)o=this.#l;else try{this.#b=e.select,o=e.select(o),o=A(i?.data,o,e),this.#l=o,this.#i=null}catch(c){this.#i=c}this.#i&&(y=this.#i,o=this.#l,U=Date.now(),b="error");const I=n.fetchStatus==="fetching",T=b==="pending",w=b==="error",F=T&&I,k=o!==void 0,p={status:b,fetchStatus:n.fetchStatus,isPending:T,isSuccess:b==="success",isError:w,isInitialLoading:F,isLoading:F,data:o,dataUpdatedAt:n.dataUpdatedAt,error:y,errorUpdatedAt:U,failureCount:n.fetchFailureCount,failureReason:n.fetchFailureReason,errorUpdateCount:n.errorUpdateCount,isFetched:n.dataUpdateCount>0||n.errorUpdateCount>0,isFetchedAfterMount:n.dataUpdateCount>R.dataUpdateCount||n.errorUpdateCount>R.errorUpdateCount,isFetching:I,isRefetching:I&&!T,isLoadingError:w&&!k,isPaused:n.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:w&&k,isStale:P(t,e),refetch:this.refetch,promise:this.#r,isEnabled:l(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const c=p.data!==void 0,m=p.status==="error"&&!c,S=E=>{m?E.reject(p.error):c&&E.resolve(p.data)},L=()=>{const E=this.#r=p.promise=N();S(E)},O=this.#r;switch(O.status){case"pending":t.queryHash===s.queryHash&&S(O);break;case"fulfilled":(m||p.data!==O.value)&&L();break;case"rejected":(!m||p.error!==O.reason)&&L();break}}return p}updateResult(){const t=this.#e,e=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#u=this.options,this.#a.data!==void 0&&(this.#d=this.#t),Q(e,t))return;this.#e=e;const s=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#f.size)return!0;const u=new Set(i??this.#f);return this.options.throwOnError&&u.add("error"),Object.keys(this.#e).some(a=>{const f=a;return this.#e[f]!==t[f]&&u.has(f)})};this.#E({listeners:s()})}#O(){const t=this.#s.getQueryCache().build(this.#s,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#p=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#g()}#E(t){z.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#e)}),this.#s.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function q(t,e){return l(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function j(t,e){return q(t,e)||t.state.data!==void 0&&_(t,e,e.refetchOnMount)}function _(t,e,s){if(l(e.enabled,t)!==!1&&g(e.staleTime,t)!=="static"){const r=typeof s=="function"?s(t):s;return r==="always"||r!==!1&&P(t,e)}return!1}function H(t,e,s,r){return(t!==e||l(r.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&P(t,s)}function P(t,e){return l(e.enabled,t)!==!1&&t.isStaleByTime(g(e.staleTime,t))}function tt(t,e){return!Q(t.getCurrentResult(),e)}var K=d.createContext(!1),et=()=>d.useContext(K);K.Provider;function st(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var rt=d.createContext(st()),it=()=>d.useContext(rt),nt=(t,e,s)=>{const r=s?.state.error&&typeof t.throwOnError=="function"?V(t.throwOnError,[s.state.error,s]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},at=t=>{d.useEffect(()=>{t.clearReset()},[t])},ot=({result:t,errorResetBoundary:e,throwOnError:s,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||V(s,[t.error,r])),ht=t=>{if(t.suspense){const s=i=>i==="static"?i:Math.max(i??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...i)=>s(r(...i)):s(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},ct=(t,e)=>t.isLoading&&t.isFetching&&!e,ut=(t,e)=>t?.suspense&&e.isPending,W=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function lt(t,e,s){const r=et(),i=it(),u=Z(),a=u.defaultQueryOptions(t);u.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const f=u.getQueryCache().get(a.queryHash);a._optimisticResults=r?"isRestoring":"optimistic",ht(a),nt(a,i,f),at(i);const R=!u.getQueryCache().get(a.queryHash),[h]=d.useState(()=>new e(u,a)),n=h.getOptimisticResult(a),v=!r&&t.subscribed!==!1;if(d.useSyncExternalStore(d.useCallback(o=>{const y=v?h.subscribe(z.batchCalls(o)):M;return h.updateResult(),y},[h,v]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),d.useEffect(()=>{h.setOptions(a)},[a,h]),ut(a,n))throw W(a,h,i);if(ot({result:n,errorResetBoundary:i,throwOnError:a.throwOnError,query:f,suspense:a.suspense}))throw n.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(a,n),a.experimental_prefetchInRender&&!x&&ct(n,r)&&(R?W(a,h,i):f?.promise)?.catch(M).finally(()=>{h.updateResult()}),a.notifyOnChangeProps?n:h.trackResult(n)}function pt(t,e){return lt(t,$)}export{pt as u};