@connectycube/chat-widget 0.39.5 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +699 -690
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -58,7 +58,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
|
|
|
58
58
|
font-size: ${t.fontSize??xu};
|
|
59
59
|
font-weight: ${t.fontWeight??Su};
|
|
60
60
|
}
|
|
61
|
-
`),document.adoptedStyleSheets=[...document.adoptedStyleSheets,d]},[]),c.jsx("div",{onMouseEnter:l,onMouseLeave:V,className:s,style:a,children:q})};var vf={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Mf=E.createContext&&E.createContext(vf),yT=["attr","size","title"];function vT(q,e){if(q==null)return{};var t=MT(q,e),n,r;if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(q);for(r=0;r<A.length;r++)n=A[r],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(q,n)&&(t[n]=q[n])}return t}function MT(q,e){if(q==null)return{};var t={};for(var n in q)if(Object.prototype.hasOwnProperty.call(q,n)){if(e.indexOf(n)>=0)continue;t[n]=q[n]}return t}function Sa(){return Sa=Object.assign?Object.assign.bind():function(q){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(q[n]=t[n])}return q},Sa.apply(this,arguments)}function Ef(q,e){var t=Object.keys(q);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(q);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(q,r).enumerable})),t.push.apply(t,n)}return t}function ka(q){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ef(Object(t),!0).forEach(function(n){ET(q,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(q,Object.getOwnPropertyDescriptors(t)):Ef(Object(t)).forEach(function(n){Object.defineProperty(q,n,Object.getOwnPropertyDescriptor(t,n))})}return q}function ET(q,e,t){return e=bT(e),e in q?Object.defineProperty(q,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):q[e]=t,q}function bT(q){var e=CT(q,"string");return typeof e=="symbol"?e:e+""}function CT(q,e){if(typeof q!="object"||!q)return q;var t=q[Symbol.toPrimitive];if(t!==void 0){var n=t.call(q,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(q)}function bf(q){return q&&q.map((e,t)=>E.createElement(e.tag,ka({key:t},e.attr),bf(e.child)))}function rn(q){return e=>E.createElement(xT,Sa({attr:ka({},q.attr)},e),bf(q.child))}function xT(q){var e=t=>{var{attr:n,size:r,title:A}=q,o=vT(q,yT),a=r||t.size||"1em",s;return t.className&&(s=t.className),q.className&&(s=(s?s+" ":"")+q.className),E.createElement("svg",Sa({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,n,o,{className:s,style:ka(ka({color:q.color||t.color},t.style),q.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),A&&E.createElement("title",null,A),q.children)};return Mf!==void 0?E.createElement(Mf.Consumer,null,t=>e(t)):e(vf)}function Cf(q){return rn({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M217.9 256L345 129c9.4-9.4 9.4-24.6 0-33.9-9.4-9.4-24.6-9.3-34 0L167 239c-9.1 9.1-9.3 23.7-.7 33.1L310.9 417c4.7 4.7 10.9 7 17 7s12.3-2.3 17-7c9.4-9.4 9.4-24.6 0-33.9L217.9 256z"},child:[]}]})(q)}function ST(q){return rn({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M312 372c-7.7 0-14 6.3-14 14 0 9.9-8.1 18-18 18H94c-9.9 0-18-8.1-18-18V126c0-9.9 8.1-18 18-18h186c9.9 0 18 8.1 18 18 0 7.7 6.3 14 14 14s14-6.3 14-14c0-25.4-20.6-46-46-46H94c-25.4 0-46 20.6-46 46v260c0 25.4 20.6 46 46 46h186c25.4 0 46-20.6 46-46 0-7.7-6.3-14-14-14z"},child:[]},{tag:"path",attr:{d:"M372.9 158.1c-2.6-2.6-6.1-4.1-9.9-4.1-3.7 0-7.3 1.4-9.9 4.1-5.5 5.5-5.5 14.3 0 19.8l65.2 64.2H162c-7.7 0-14 6.3-14 14s6.3 14 14 14h256.6L355 334.2c-5.4 5.4-5.4 14.3 0 19.8l.1.1c2.7 2.5 6.2 3.9 9.8 3.9 3.8 0 7.3-1.4 9.9-4.1l82.6-82.4c4.3-4.3 6.5-9.3 6.5-14.7 0-5.3-2.3-10.3-6.5-14.5l-84.5-84.2z"},child:[]}]})(q)}function kT(q,e=[]){let t=[];function n(A,o){const a=p.createContext(o);a.displayName=A+"Context";const s=t.length;t=[...t,o];const i=V=>{const{scope:d,children:u,...f}=V,g=d?.[q]?.[s]||a,h=p.useMemo(()=>f,Object.values(f));return c.jsx(g.Provider,{value:h,children:u})};i.displayName=A+"Provider";function l(V,d){const u=d?.[q]?.[s]||a,f=p.useContext(u);if(f)return f;if(o!==void 0)return o;throw new Error(`\`${V}\` must be used within \`${A}\``)}return[i,l]}const r=()=>{const A=t.map(o=>p.createContext(o));return function(a){const s=a?.[q]||A;return p.useMemo(()=>({[`__scope${q}`]:{...a,[q]:s}}),[a,s])}};return r.scopeName=q,[n,IT(r,...e)]}function IT(...q){const e=q[0];if(q.length===1)return e;const t=()=>{const n=q.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(A){const o=n.reduce((a,{useScope:s,scopeName:i})=>{const V=s(A)[`__scope${i}`];return{...a,...V}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}var TT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kV=TT.reduce((q,e)=>{const t=MV(`Primitive.${e}`),n=p.forwardRef((r,A)=>{const{asChild:o,...a}=r,s=o?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(s,{...a,ref:A})});return n.displayName=`Primitive.${e}`,{...q,[e]:n}},{});function BT(){return bu.useSyncExternalStore(NT,()=>!0,()=>!1)}function NT(){return()=>{}}var IV="Avatar",[DT]=kT(IV),[UT,xf]=DT(IV),Sf=p.forwardRef((q,e)=>{const{__scopeAvatar:t,...n}=q,[r,A]=p.useState("idle");return c.jsx(UT,{scope:t,imageLoadingStatus:r,onImageLoadingStatusChange:A,children:c.jsx(kV.span,{...n,ref:e})})});Sf.displayName=IV;var kf="AvatarImage",If=p.forwardRef((q,e)=>{const{__scopeAvatar:t,src:n,onLoadingStatusChange:r=()=>{},...A}=q,o=xf(kf,t),a=RT(n,A),s=Rt(i=>{r(i),o.onImageLoadingStatusChange(i)});return Ut(()=>{a!=="idle"&&s(a)},[a,s]),a==="loaded"?c.jsx(kV.img,{...A,ref:e,src:n}):null});If.displayName=kf;var Tf="AvatarFallback",Bf=p.forwardRef((q,e)=>{const{__scopeAvatar:t,delayMs:n,...r}=q,A=xf(Tf,t),[o,a]=p.useState(n===void 0);return p.useEffect(()=>{if(n!==void 0){const s=window.setTimeout(()=>a(!0),n);return()=>window.clearTimeout(s)}},[n]),o&&A.imageLoadingStatus!=="loaded"?c.jsx(kV.span,{...r,ref:e}):null});Bf.displayName=Tf;function Nf(q,e){return q?e?(q.src!==e&&(q.src=e),q.complete&&q.naturalWidth>0?"loaded":"loading"):"error":"idle"}function RT(q,{referrerPolicy:e,crossOrigin:t}){const n=BT(),r=p.useRef(null),A=n?(r.current||(r.current=new window.Image),r.current):null,[o,a]=p.useState(()=>Nf(A,q));return Ut(()=>{a(Nf(A,q))},[A,q]),Ut(()=>{const s=V=>()=>{a(V)};if(!A)return;const i=s("loaded"),l=s("error");return A.addEventListener("load",i),A.addEventListener("error",l),e&&(A.referrerPolicy=e),typeof t=="string"&&(A.crossOrigin=t),()=>{A.removeEventListener("load",i),A.removeEventListener("error",l)}},[A,t,e]),o}var OT=Sf,QT=If,jT=Bf;function TV({status:q,...e}){switch(q){case"available":return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...e,className:H("rounded-full size-4.5 text-green-600 bg-white",e?.className),children:c.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"})});case"busy":return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...e,className:H("rounded-full size-4.5 text-red-600 bg-white",e?.className),children:c.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M4.5 7.5a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1z"})});case"away":return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...e,className:H("rounded-full size-4.5 text-yellow-500 bg-white",e?.className),children:c.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71z"})});case"unknown":return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...e,className:H("rounded-full size-4.5 text-gray-500 bg-white",e?.className),children:c.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M5.496 6.033h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286a.237.237 0 0 0 .241.247m2.325 6.443c.61 0 1.029-.394 1.029-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94 0 .533.425.927 1.01.927z"})});default:return null}}TV.displayName="PresenceBadge";function GA({badge:q=!0,status:e,label:t,badgeProps:n,labelProps:r,...A}){const o=QA(t||e);return c.jsxs("div",{...A,className:H("flex items-center gap-2",A?.className),children:[q&&c.jsx(TV,{status:e,...n}),c.jsx("span",{...r,children:o})]})}GA.displayName="Presence";function GT(q){const e=q?.trim().split(/\s+/).filter(Boolean)??[];return(e.length>1?`${e[0]?.[0]}${e[1]?.[0]}`:e[0]?.slice(0,2)??"NA").toUpperCase()}function FT({src:q,name:e="NA",fallbackIconElement:t,online:n,presence:r,className:A,onlineProps:o,presenceProps:a,imageProps:s,fallbackProps:i,...l},V){const d=GT(e);return c.jsxs(OT,{ref:V,...l,className:H("relative flex size-8 shrink-0 rounded-full",A),children:[c.jsx(QT,{...s,src:q,className:H("aspect-square size-full rounded-full overflow-hidden object-cover",s?.className)}),c.jsx(jT,{...i,className:H("bg-muted size-full rounded-full flex items-center justify-center",i?.className),children:t||d}),n&&c.jsx("div",{...o,className:H("absolute top-0 right-0 rounded-full border-2 bg-green-600 border-green-200 size-3.5",o?.className)}),c.jsx(TV,{status:r,...a,className:H("absolute bottom-0 right-0",a?.className)})]})}const An=p.memo(p.forwardRef(FT));An.displayName="Avatar";function Df(q){const e=LT(q),t=p.forwardRef((n,r)=>{const{children:A,...o}=n,a=p.Children.toArray(A),s=a.find(zT);if(s){const i=s.props.children,l=a.map(V=>V===s?p.Children.count(i)>1?p.Children.only(null):p.isValidElement(i)?i.props.children:null:V);return c.jsx(e,{...o,ref:r,children:p.isValidElement(i)?p.cloneElement(i,void 0,l):null})}return c.jsx(e,{...o,ref:r,children:A})});return t.displayName=`${q}.Slot`,t}function LT(q){const e=p.forwardRef((t,n)=>{const{children:r,...A}=t;if(p.isValidElement(r)){const o=KT(r),a=PT(A,r.props);return r.type!==p.Fragment&&(a.ref=n?Kn(n,o):o),p.cloneElement(r,a)}return p.Children.count(r)>1?p.Children.only(null):null});return e.displayName=`${q}.SlotClone`,e}var YT=Symbol("radix.slottable");function zT(q){return p.isValidElement(q)&&typeof q.type=="function"&&"__radixId"in q.type&&q.type.__radixId===YT}function PT(q,e){const t={...e};for(const n in e){const r=q[n],A=e[n];/^on[A-Z]/.test(n)?r&&A?t[n]=(...a)=>{const s=A(...a);return r(...a),s}:r&&(t[n]=r):n==="style"?t[n]={...r,...A}:n==="className"&&(t[n]=[r,A].filter(Boolean).join(" "))}return{...q,...t}}function KT(q){let e=Object.getOwnPropertyDescriptor(q.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?q.ref:(e=Object.getOwnPropertyDescriptor(q,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?q.props.ref:q.props.ref||q.ref)}function Uf(q){const e=q+"CollectionProvider",[t,n]=Dt(e),[r,A]=t(e,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:h,children:m}=g,w=E.useRef(null),y=E.useRef(new Map).current;return c.jsx(r,{scope:h,itemMap:y,collectionRef:w,children:m})};o.displayName=e;const a=q+"CollectionSlot",s=Df(a),i=E.forwardRef((g,h)=>{const{scope:m,children:w}=g,y=A(a,m),v=re(h,y.collectionRef);return c.jsx(s,{ref:v,children:w})});i.displayName=a;const l=q+"CollectionItemSlot",V="data-radix-collection-item",d=Df(l),u=E.forwardRef((g,h)=>{const{scope:m,children:w,...y}=g,v=E.useRef(null),M=re(h,v),x=A(l,m);return E.useEffect(()=>(x.itemMap.set(v,{ref:v,...y}),()=>{x.itemMap.delete(v)})),c.jsx(d,{[V]:"",ref:M,children:w})});u.displayName=l;function f(g){const h=A(q+"CollectionConsumer",g);return E.useCallback(()=>{const w=h.collectionRef.current;if(!w)return[];const y=Array.from(w.querySelectorAll(`[${V}]`));return Array.from(h.itemMap.values()).sort((x,b)=>y.indexOf(x.ref.current)-y.indexOf(b.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:o,Slot:i,ItemSlot:u},f,n]}var JT=p.createContext(void 0);function BV(q){const e=p.useContext(JT);return q||e||"ltr"}const WT=["top","right","bottom","left"],_n=Math.min,dt=Math.max,Ia=Math.round,Ta=Math.floor,on=q=>({x:q,y:q}),ZT={left:"right",right:"left",bottom:"top",top:"bottom"},HT={start:"end",end:"start"};function NV(q,e,t){return dt(q,_n(e,t))}function xn(q,e){return typeof q=="function"?q(e):q}function Sn(q){return q.split("-")[0]}function Hr(q){return q.split("-")[1]}function DV(q){return q==="x"?"y":"x"}function UV(q){return q==="y"?"height":"width"}const XT=new Set(["top","bottom"]);function an(q){return XT.has(Sn(q))?"y":"x"}function RV(q){return DV(an(q))}function _T(q,e,t){t===void 0&&(t=!1);const n=Hr(q),r=RV(q),A=UV(r);let o=r==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[A]>e.floating[A]&&(o=Ba(o)),[o,Ba(o)]}function $T(q){const e=Ba(q);return[OV(q),e,OV(e)]}function OV(q){return q.replace(/start|end/g,e=>HT[e])}const Rf=["left","right"],Of=["right","left"],qB=["top","bottom"],eB=["bottom","top"];function tB(q,e,t){switch(q){case"top":case"bottom":return t?e?Of:Rf:e?Rf:Of;case"left":case"right":return e?qB:eB;default:return[]}}function nB(q,e,t,n){const r=Hr(q);let A=tB(Sn(q),t==="start",n);return r&&(A=A.map(o=>o+"-"+r),e&&(A=A.concat(A.map(OV)))),A}function Ba(q){return q.replace(/left|right|bottom|top/g,e=>ZT[e])}function rB(q){return{top:0,right:0,bottom:0,left:0,...q}}function Qf(q){return typeof q!="number"?rB(q):{top:q,right:q,bottom:q,left:q}}function Na(q){const{x:e,y:t,width:n,height:r}=q;return{width:n,height:r,top:t,left:e,right:e+n,bottom:t+r,x:e,y:t}}function jf(q,e,t){let{reference:n,floating:r}=q;const A=an(e),o=RV(e),a=UV(o),s=Sn(e),i=A==="y",l=n.x+n.width/2-r.width/2,V=n.y+n.height/2-r.height/2,d=n[a]/2-r[a]/2;let u;switch(s){case"top":u={x:l,y:n.y-r.height};break;case"bottom":u={x:l,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:V};break;case"left":u={x:n.x-r.width,y:V};break;default:u={x:n.x,y:n.y}}switch(Hr(e)){case"start":u[o]-=d*(t&&i?-1:1);break;case"end":u[o]+=d*(t&&i?-1:1);break}return u}async function AB(q,e){var t;e===void 0&&(e={});const{x:n,y:r,platform:A,rects:o,elements:a,strategy:s}=q,{boundary:i="clippingAncestors",rootBoundary:l="viewport",elementContext:V="floating",altBoundary:d=!1,padding:u=0}=xn(e,q),f=Qf(u),h=a[d?V==="floating"?"reference":"floating":V],m=Na(await A.getClippingRect({element:(t=await(A.isElement==null?void 0:A.isElement(h)))==null||t?h:h.contextElement||await(A.getDocumentElement==null?void 0:A.getDocumentElement(a.floating)),boundary:i,rootBoundary:l,strategy:s})),w=V==="floating"?{x:n,y:r,width:o.floating.width,height:o.floating.height}:o.reference,y=await(A.getOffsetParent==null?void 0:A.getOffsetParent(a.floating)),v=await(A.isElement==null?void 0:A.isElement(y))?await(A.getScale==null?void 0:A.getScale(y))||{x:1,y:1}:{x:1,y:1},M=Na(A.convertOffsetParentRelativeRectToViewportRelativeRect?await A.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:y,strategy:s}):w);return{top:(m.top-M.top+f.top)/v.y,bottom:(M.bottom-m.bottom+f.bottom)/v.y,left:(m.left-M.left+f.left)/v.x,right:(M.right-m.right+f.right)/v.x}}const oB=async(q,e,t)=>{const{placement:n="bottom",strategy:r="absolute",middleware:A=[],platform:o}=t,a=A.filter(Boolean),s=await(o.isRTL==null?void 0:o.isRTL(e));let i=await o.getElementRects({reference:q,floating:e,strategy:r}),{x:l,y:V}=jf(i,n,s),d=n,u={},f=0;for(let h=0;h<a.length;h++){var g;const{name:m,fn:w}=a[h],{x:y,y:v,data:M,reset:x}=await w({x:l,y:V,initialPlacement:n,placement:d,strategy:r,middlewareData:u,rects:i,platform:{...o,detectOverflow:(g=o.detectOverflow)!=null?g:AB},elements:{reference:q,floating:e}});l=y??l,V=v??V,u={...u,[m]:{...u[m],...M}},x&&f<=50&&(f++,typeof x=="object"&&(x.placement&&(d=x.placement),x.rects&&(i=x.rects===!0?await o.getElementRects({reference:q,floating:e,strategy:r}):x.rects),{x:l,y:V}=jf(i,d,s)),h=-1)}return{x:l,y:V,placement:d,strategy:r,middlewareData:u}},aB=q=>({name:"arrow",options:q,async fn(e){const{x:t,y:n,placement:r,rects:A,platform:o,elements:a,middlewareData:s}=e,{element:i,padding:l=0}=xn(q,e)||{};if(i==null)return{};const V=Qf(l),d={x:t,y:n},u=RV(r),f=UV(u),g=await o.getDimensions(i),h=u==="y",m=h?"top":"left",w=h?"bottom":"right",y=h?"clientHeight":"clientWidth",v=A.reference[f]+A.reference[u]-d[u]-A.floating[f],M=d[u]-A.reference[u],x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(i));let b=x?x[y]:0;(!b||!await(o.isElement==null?void 0:o.isElement(x)))&&(b=a.floating[y]||A.floating[f]);const k=v/2-M/2,U=b/2-g[f]/2-1,T=_n(V[m],U),O=_n(V[w],U),N=T,B=b-g[f]-O,j=b/2-g[f]/2+k,K=NV(N,j,B),Q=!s.arrow&&Hr(r)!=null&&j!==K&&A.reference[f]/2-(j<N?T:O)-g[f]/2<0,z=Q?j<N?j-N:j-B:0;return{[u]:d[u]+z,data:{[u]:K,centerOffset:j-K-z,...Q&&{alignmentOffset:z}},reset:Q}}}),sB=function(q){return q===void 0&&(q={}),{name:"flip",options:q,async fn(e){var t,n;const{placement:r,middlewareData:A,rects:o,initialPlacement:a,platform:s,elements:i}=e,{mainAxis:l=!0,crossAxis:V=!0,fallbackPlacements:d,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...h}=xn(q,e);if((t=A.arrow)!=null&&t.alignmentOffset)return{};const m=Sn(r),w=an(a),y=Sn(a)===a,v=await(s.isRTL==null?void 0:s.isRTL(i.floating)),M=d||(y||!g?[Ba(a)]:$T(a)),x=f!=="none";!d&&x&&M.push(...nB(a,g,f,v));const b=[a,...M],k=await s.detectOverflow(e,h),U=[];let T=((n=A.flip)==null?void 0:n.overflows)||[];if(l&&U.push(k[m]),V){const j=_T(r,o,v);U.push(k[j[0]],k[j[1]])}if(T=[...T,{placement:r,overflows:U}],!U.every(j=>j<=0)){var O,N;const j=(((O=A.flip)==null?void 0:O.index)||0)+1,K=b[j];if(K&&(!(V==="alignment"?w!==an(K):!1)||T.every(G=>an(G.placement)===w?G.overflows[0]>0:!0)))return{data:{index:j,overflows:T},reset:{placement:K}};let Q=(N=T.filter(z=>z.overflows[0]<=0).sort((z,G)=>z.overflows[1]-G.overflows[1])[0])==null?void 0:N.placement;if(!Q)switch(u){case"bestFit":{var B;const z=(B=T.filter(G=>{if(x){const L=an(G.placement);return L===w||L==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(L=>L>0).reduce((L,J)=>L+J,0)]).sort((G,L)=>G[1]-L[1])[0])==null?void 0:B[0];z&&(Q=z);break}case"initialPlacement":Q=a;break}if(r!==Q)return{reset:{placement:Q}}}return{}}}};function Gf(q,e){return{top:q.top-e.height,right:q.right-e.width,bottom:q.bottom-e.height,left:q.left-e.width}}function Ff(q){return WT.some(e=>q[e]>=0)}const iB=function(q){return q===void 0&&(q={}),{name:"hide",options:q,async fn(e){const{rects:t,platform:n}=e,{strategy:r="referenceHidden",...A}=xn(q,e);switch(r){case"referenceHidden":{const o=await n.detectOverflow(e,{...A,elementContext:"reference"}),a=Gf(o,t.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Ff(a)}}}case"escaped":{const o=await n.detectOverflow(e,{...A,altBoundary:!0}),a=Gf(o,t.floating);return{data:{escapedOffsets:a,escaped:Ff(a)}}}default:return{}}}}},Lf=new Set(["left","top"]);async function VB(q,e){const{placement:t,platform:n,elements:r}=q,A=await(n.isRTL==null?void 0:n.isRTL(r.floating)),o=Sn(t),a=Hr(t),s=an(t)==="y",i=Lf.has(o)?-1:1,l=A&&s?-1:1,V=xn(e,q);let{mainAxis:d,crossAxis:u,alignmentAxis:f}=typeof V=="number"?{mainAxis:V,crossAxis:0,alignmentAxis:null}:{mainAxis:V.mainAxis||0,crossAxis:V.crossAxis||0,alignmentAxis:V.alignmentAxis};return a&&typeof f=="number"&&(u=a==="end"?f*-1:f),s?{x:u*l,y:d*i}:{x:d*i,y:u*l}}const lB=function(q){return q===void 0&&(q=0),{name:"offset",options:q,async fn(e){var t,n;const{x:r,y:A,placement:o,middlewareData:a}=e,s=await VB(e,q);return o===((t=a.offset)==null?void 0:t.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:A+s.y,data:{...s,placement:o}}}}},cB=function(q){return q===void 0&&(q={}),{name:"shift",options:q,async fn(e){const{x:t,y:n,placement:r,platform:A}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:m=>{let{x:w,y}=m;return{x:w,y}}},...i}=xn(q,e),l={x:t,y:n},V=await A.detectOverflow(e,i),d=an(Sn(r)),u=DV(d);let f=l[u],g=l[d];if(o){const m=u==="y"?"top":"left",w=u==="y"?"bottom":"right",y=f+V[m],v=f-V[w];f=NV(y,f,v)}if(a){const m=d==="y"?"top":"left",w=d==="y"?"bottom":"right",y=g+V[m],v=g-V[w];g=NV(y,g,v)}const h=s.fn({...e,[u]:f,[d]:g});return{...h,data:{x:h.x-t,y:h.y-n,enabled:{[u]:o,[d]:a}}}}}},uB=function(q){return q===void 0&&(q={}),{options:q,fn(e){const{x:t,y:n,placement:r,rects:A,middlewareData:o}=e,{offset:a=0,mainAxis:s=!0,crossAxis:i=!0}=xn(q,e),l={x:t,y:n},V=an(r),d=DV(V);let u=l[d],f=l[V];const g=xn(a,e),h=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(s){const y=d==="y"?"height":"width",v=A.reference[d]-A.floating[y]+h.mainAxis,M=A.reference[d]+A.reference[y]-h.mainAxis;u<v?u=v:u>M&&(u=M)}if(i){var m,w;const y=d==="y"?"width":"height",v=Lf.has(Sn(r)),M=A.reference[V]-A.floating[y]+(v&&((m=o.offset)==null?void 0:m[V])||0)+(v?0:h.crossAxis),x=A.reference[V]+A.reference[y]+(v?0:((w=o.offset)==null?void 0:w[V])||0)-(v?h.crossAxis:0);f<M?f=M:f>x&&(f=x)}return{[d]:u,[V]:f}}}},dB=function(q){return q===void 0&&(q={}),{name:"size",options:q,async fn(e){var t,n;const{placement:r,rects:A,platform:o,elements:a}=e,{apply:s=()=>{},...i}=xn(q,e),l=await o.detectOverflow(e,i),V=Sn(r),d=Hr(r),u=an(r)==="y",{width:f,height:g}=A.floating;let h,m;V==="top"||V==="bottom"?(h=V,m=d===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(m=V,h=d==="end"?"top":"bottom");const w=g-l.top-l.bottom,y=f-l.left-l.right,v=_n(g-l[h],w),M=_n(f-l[m],y),x=!e.middlewareData.shift;let b=v,k=M;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(k=y),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(b=w),x&&!d){const T=dt(l.left,0),O=dt(l.right,0),N=dt(l.top,0),B=dt(l.bottom,0);u?k=f-2*(T!==0||O!==0?T+O:dt(l.left,l.right)):b=g-2*(N!==0||B!==0?N+B:dt(l.top,l.bottom))}await s({...e,availableWidth:k,availableHeight:b});const U=await o.getDimensions(a.floating);return f!==U.width||g!==U.height?{reset:{rects:!0}}:{}}}};function Da(){return typeof window<"u"}function Xr(q){return Yf(q)?(q.nodeName||"").toLowerCase():"#document"}function gt(q){var e;return(q==null||(e=q.ownerDocument)==null?void 0:e.defaultView)||window}function sn(q){var e;return(e=(Yf(q)?q.ownerDocument:q.document)||window.document)==null?void 0:e.documentElement}function Yf(q){return Da()?q instanceof Node||q instanceof gt(q).Node:!1}function Qt(q){return Da()?q instanceof Element||q instanceof gt(q).Element:!1}function Vn(q){return Da()?q instanceof HTMLElement||q instanceof gt(q).HTMLElement:!1}function zf(q){return!Da()||typeof ShadowRoot>"u"?!1:q instanceof ShadowRoot||q instanceof gt(q).ShadowRoot}const gB=new Set(["inline","contents"]);function FA(q){const{overflow:e,overflowX:t,overflowY:n,display:r}=jt(q);return/auto|scroll|overlay|hidden|clip/.test(e+n+t)&&!gB.has(r)}const fB=new Set(["table","td","th"]);function pB(q){return fB.has(Xr(q))}const hB=[":popover-open",":modal"];function Ua(q){return hB.some(e=>{try{return q.matches(e)}catch{return!1}})}const mB=["transform","translate","scale","rotate","perspective"],wB=["transform","translate","scale","rotate","perspective","filter"],yB=["paint","layout","strict","content"];function QV(q){const e=jV(),t=Qt(q)?jt(q):q;return mB.some(n=>t[n]?t[n]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||wB.some(n=>(t.willChange||"").includes(n))||yB.some(n=>(t.contain||"").includes(n))}function vB(q){let e=$n(q);for(;Vn(e)&&!_r(e);){if(QV(e))return e;if(Ua(e))return null;e=$n(e)}return null}function jV(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const MB=new Set(["html","body","#document"]);function _r(q){return MB.has(Xr(q))}function jt(q){return gt(q).getComputedStyle(q)}function Ra(q){return Qt(q)?{scrollLeft:q.scrollLeft,scrollTop:q.scrollTop}:{scrollLeft:q.scrollX,scrollTop:q.scrollY}}function $n(q){if(Xr(q)==="html")return q;const e=q.assignedSlot||q.parentNode||zf(q)&&q.host||sn(q);return zf(e)?e.host:e}function Pf(q){const e=$n(q);return _r(e)?q.ownerDocument?q.ownerDocument.body:q.body:Vn(e)&&FA(e)?e:Pf(e)}function LA(q,e,t){var n;e===void 0&&(e=[]),t===void 0&&(t=!0);const r=Pf(q),A=r===((n=q.ownerDocument)==null?void 0:n.body),o=gt(r);if(A){const a=GV(o);return e.concat(o,o.visualViewport||[],FA(r)?r:[],a&&t?LA(a):[])}return e.concat(r,LA(r,[],t))}function GV(q){return q.parent&&Object.getPrototypeOf(q.parent)?q.frameElement:null}function Kf(q){const e=jt(q);let t=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const r=Vn(q),A=r?q.offsetWidth:t,o=r?q.offsetHeight:n,a=Ia(t)!==A||Ia(n)!==o;return a&&(t=A,n=o),{width:t,height:n,$:a}}function FV(q){return Qt(q)?q:q.contextElement}function $r(q){const e=FV(q);if(!Vn(e))return on(1);const t=e.getBoundingClientRect(),{width:n,height:r,$:A}=Kf(e);let o=(A?Ia(t.width):t.width)/n,a=(A?Ia(t.height):t.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const EB=on(0);function Jf(q){const e=gt(q);return!jV()||!e.visualViewport?EB:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function bB(q,e,t){return e===void 0&&(e=!1),!t||e&&t!==gt(q)?!1:e}function Er(q,e,t,n){e===void 0&&(e=!1),t===void 0&&(t=!1);const r=q.getBoundingClientRect(),A=FV(q);let o=on(1);e&&(n?Qt(n)&&(o=$r(n)):o=$r(q));const a=bB(A,t,n)?Jf(A):on(0);let s=(r.left+a.x)/o.x,i=(r.top+a.y)/o.y,l=r.width/o.x,V=r.height/o.y;if(A){const d=gt(A),u=n&&Qt(n)?gt(n):n;let f=d,g=GV(f);for(;g&&n&&u!==f;){const h=$r(g),m=g.getBoundingClientRect(),w=jt(g),y=m.left+(g.clientLeft+parseFloat(w.paddingLeft))*h.x,v=m.top+(g.clientTop+parseFloat(w.paddingTop))*h.y;s*=h.x,i*=h.y,l*=h.x,V*=h.y,s+=y,i+=v,f=gt(g),g=GV(f)}}return Na({width:l,height:V,x:s,y:i})}function Oa(q,e){const t=Ra(q).scrollLeft;return e?e.left+t:Er(sn(q)).left+t}function Wf(q,e){const t=q.getBoundingClientRect(),n=t.left+e.scrollLeft-Oa(q,t),r=t.top+e.scrollTop;return{x:n,y:r}}function CB(q){let{elements:e,rect:t,offsetParent:n,strategy:r}=q;const A=r==="fixed",o=sn(n),a=e?Ua(e.floating):!1;if(n===o||a&&A)return t;let s={scrollLeft:0,scrollTop:0},i=on(1);const l=on(0),V=Vn(n);if((V||!V&&!A)&&((Xr(n)!=="body"||FA(o))&&(s=Ra(n)),Vn(n))){const u=Er(n);i=$r(n),l.x=u.x+n.clientLeft,l.y=u.y+n.clientTop}const d=o&&!V&&!A?Wf(o,s):on(0);return{width:t.width*i.x,height:t.height*i.y,x:t.x*i.x-s.scrollLeft*i.x+l.x+d.x,y:t.y*i.y-s.scrollTop*i.y+l.y+d.y}}function xB(q){return Array.from(q.getClientRects())}function SB(q){const e=sn(q),t=Ra(q),n=q.ownerDocument.body,r=dt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),A=dt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+Oa(q);const a=-t.scrollTop;return jt(n).direction==="rtl"&&(o+=dt(e.clientWidth,n.clientWidth)-r),{width:r,height:A,x:o,y:a}}const Zf=25;function kB(q,e){const t=gt(q),n=sn(q),r=t.visualViewport;let A=n.clientWidth,o=n.clientHeight,a=0,s=0;if(r){A=r.width,o=r.height;const l=jV();(!l||l&&e==="fixed")&&(a=r.offsetLeft,s=r.offsetTop)}const i=Oa(n);if(i<=0){const l=n.ownerDocument,V=l.body,d=getComputedStyle(V),u=l.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,f=Math.abs(n.clientWidth-V.clientWidth-u);f<=Zf&&(A-=f)}else i<=Zf&&(A+=i);return{width:A,height:o,x:a,y:s}}const IB=new Set(["absolute","fixed"]);function TB(q,e){const t=Er(q,!0,e==="fixed"),n=t.top+q.clientTop,r=t.left+q.clientLeft,A=Vn(q)?$r(q):on(1),o=q.clientWidth*A.x,a=q.clientHeight*A.y,s=r*A.x,i=n*A.y;return{width:o,height:a,x:s,y:i}}function Hf(q,e,t){let n;if(e==="viewport")n=kB(q,t);else if(e==="document")n=SB(sn(q));else if(Qt(e))n=TB(e,t);else{const r=Jf(q);n={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Na(n)}function Xf(q,e){const t=$n(q);return t===e||!Qt(t)||_r(t)?!1:jt(t).position==="fixed"||Xf(t,e)}function BB(q,e){const t=e.get(q);if(t)return t;let n=LA(q,[],!1).filter(a=>Qt(a)&&Xr(a)!=="body"),r=null;const A=jt(q).position==="fixed";let o=A?$n(q):q;for(;Qt(o)&&!_r(o);){const a=jt(o),s=QV(o);!s&&a.position==="fixed"&&(r=null),(A?!s&&!r:!s&&a.position==="static"&&!!r&&IB.has(r.position)||FA(o)&&!s&&Xf(q,o))?n=n.filter(l=>l!==o):r=a,o=$n(o)}return e.set(q,n),n}function NB(q){let{element:e,boundary:t,rootBoundary:n,strategy:r}=q;const o=[...t==="clippingAncestors"?Ua(e)?[]:BB(e,this._c):[].concat(t),n],a=o[0],s=o.reduce((i,l)=>{const V=Hf(e,l,r);return i.top=dt(V.top,i.top),i.right=_n(V.right,i.right),i.bottom=_n(V.bottom,i.bottom),i.left=dt(V.left,i.left),i},Hf(e,a,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function DB(q){const{width:e,height:t}=Kf(q);return{width:e,height:t}}function UB(q,e,t){const n=Vn(e),r=sn(e),A=t==="fixed",o=Er(q,!0,A,e);let a={scrollLeft:0,scrollTop:0};const s=on(0);function i(){s.x=Oa(r)}if(n||!n&&!A)if((Xr(e)!=="body"||FA(r))&&(a=Ra(e)),n){const u=Er(e,!0,A,e);s.x=u.x+e.clientLeft,s.y=u.y+e.clientTop}else r&&i();A&&!n&&r&&i();const l=r&&!n&&!A?Wf(r,a):on(0),V=o.left+a.scrollLeft-s.x-l.x,d=o.top+a.scrollTop-s.y-l.y;return{x:V,y:d,width:o.width,height:o.height}}function LV(q){return jt(q).position==="static"}function _f(q,e){if(!Vn(q)||jt(q).position==="fixed")return null;if(e)return e(q);let t=q.offsetParent;return sn(q)===t&&(t=t.ownerDocument.body),t}function $f(q,e){const t=gt(q);if(Ua(q))return t;if(!Vn(q)){let r=$n(q);for(;r&&!_r(r);){if(Qt(r)&&!LV(r))return r;r=$n(r)}return t}let n=_f(q,e);for(;n&&pB(n)&&LV(n);)n=_f(n,e);return n&&_r(n)&&LV(n)&&!QV(n)?t:n||vB(q)||t}const RB=async function(q){const e=this.getOffsetParent||$f,t=this.getDimensions,n=await t(q.floating);return{reference:UB(q.reference,await e(q.floating),q.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function OB(q){return jt(q).direction==="rtl"}const QB={convertOffsetParentRelativeRectToViewportRelativeRect:CB,getDocumentElement:sn,getClippingRect:NB,getOffsetParent:$f,getElementRects:RB,getClientRects:xB,getDimensions:DB,getScale:$r,isElement:Qt,isRTL:OB};function qp(q,e){return q.x===e.x&&q.y===e.y&&q.width===e.width&&q.height===e.height}function jB(q,e){let t=null,n;const r=sn(q);function A(){var a;clearTimeout(n),(a=t)==null||a.disconnect(),t=null}function o(a,s){a===void 0&&(a=!1),s===void 0&&(s=1),A();const i=q.getBoundingClientRect(),{left:l,top:V,width:d,height:u}=i;if(a||e(),!d||!u)return;const f=Ta(V),g=Ta(r.clientWidth-(l+d)),h=Ta(r.clientHeight-(V+u)),m=Ta(l),y={rootMargin:-f+"px "+-g+"px "+-h+"px "+-m+"px",threshold:dt(0,_n(1,s))||1};let v=!0;function M(x){const b=x[0].intersectionRatio;if(b!==s){if(!v)return o();b?o(!1,b):n=setTimeout(()=>{o(!1,1e-7)},1e3)}b===1&&!qp(i,q.getBoundingClientRect())&&o(),v=!1}try{t=new IntersectionObserver(M,{...y,root:r.ownerDocument})}catch{t=new IntersectionObserver(M,y)}t.observe(q)}return o(!0),A}function GB(q,e,t,n){n===void 0&&(n={});const{ancestorScroll:r=!0,ancestorResize:A=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:s=!1}=n,i=FV(q),l=r||A?[...i?LA(i):[],...LA(e)]:[];l.forEach(m=>{r&&m.addEventListener("scroll",t,{passive:!0}),A&&m.addEventListener("resize",t)});const V=i&&a?jB(i,t):null;let d=-1,u=null;o&&(u=new ResizeObserver(m=>{let[w]=m;w&&w.target===i&&u&&(u.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var y;(y=u)==null||y.observe(e)})),t()}),i&&!s&&u.observe(i),u.observe(e));let f,g=s?Er(q):null;s&&h();function h(){const m=Er(q);g&&!qp(g,m)&&t(),g=m,f=requestAnimationFrame(h)}return t(),()=>{var m;l.forEach(w=>{r&&w.removeEventListener("scroll",t),A&&w.removeEventListener("resize",t)}),V?.(),(m=u)==null||m.disconnect(),u=null,s&&cancelAnimationFrame(f)}}const FB=lB,LB=cB,YB=sB,zB=dB,PB=iB,ep=aB,KB=uB,JB=(q,e,t)=>{const n=new Map,r={platform:QB,...t},A={...r.platform,_c:n};return oB(q,e,{...r,platform:A})};var WB=typeof document<"u",ZB=function(){},Qa=WB?E.useLayoutEffect:ZB;function ja(q,e){if(q===e)return!0;if(typeof q!=typeof e)return!1;if(typeof q=="function"&&q.toString()===e.toString())return!0;let t,n,r;if(q&&e&&typeof q=="object"){if(Array.isArray(q)){if(t=q.length,t!==e.length)return!1;for(n=t;n--!==0;)if(!ja(q[n],e[n]))return!1;return!0}if(r=Object.keys(q),t=r.length,t!==Object.keys(e).length)return!1;for(n=t;n--!==0;)if(!{}.hasOwnProperty.call(e,r[n]))return!1;for(n=t;n--!==0;){const A=r[n];if(!(A==="_owner"&&q.$$typeof)&&!ja(q[A],e[A]))return!1}return!0}return q!==q&&e!==e}function tp(q){return typeof window>"u"?1:(q.ownerDocument.defaultView||window).devicePixelRatio||1}function np(q,e){const t=tp(q);return Math.round(e*t)/t}function YV(q){const e=p.useRef(q);return Qa(()=>{e.current=q}),e}function HB(q){q===void 0&&(q={});const{placement:e="bottom",strategy:t="absolute",middleware:n=[],platform:r,elements:{reference:A,floating:o}={},transform:a=!0,whileElementsMounted:s,open:i}=q,[l,V]=p.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[d,u]=p.useState(n);ja(d,n)||u(n);const[f,g]=p.useState(null),[h,m]=p.useState(null),w=p.useCallback(G=>{G!==x.current&&(x.current=G,g(G))},[]),y=p.useCallback(G=>{G!==b.current&&(b.current=G,m(G))},[]),v=A||f,M=o||h,x=p.useRef(null),b=p.useRef(null),k=p.useRef(l),U=s!=null,T=YV(s),O=YV(r),N=YV(i),B=p.useCallback(()=>{if(!x.current||!b.current)return;const G={placement:e,strategy:t,middleware:d};O.current&&(G.platform=O.current),JB(x.current,b.current,G).then(L=>{const J={...L,isPositioned:N.current!==!1};j.current&&!ja(k.current,J)&&(k.current=J,_c.flushSync(()=>{V(J)}))})},[d,e,t,O,N]);Qa(()=>{i===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,V(G=>({...G,isPositioned:!1})))},[i]);const j=p.useRef(!1);Qa(()=>(j.current=!0,()=>{j.current=!1}),[]),Qa(()=>{if(v&&(x.current=v),M&&(b.current=M),v&&M){if(T.current)return T.current(v,M,B);B()}},[v,M,B,T,U]);const K=p.useMemo(()=>({reference:x,floating:b,setReference:w,setFloating:y}),[w,y]),Q=p.useMemo(()=>({reference:v,floating:M}),[v,M]),z=p.useMemo(()=>{const G={position:t,left:0,top:0};if(!Q.floating)return G;const L=np(Q.floating,l.x),J=np(Q.floating,l.y);return a?{...G,transform:"translate("+L+"px, "+J+"px)",...tp(Q.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:L,top:J}},[t,a,Q.floating,l.x,l.y]);return p.useMemo(()=>({...l,update:B,refs:K,elements:Q,floatingStyles:z}),[l,B,K,Q,z])}const XB=q=>{function e(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:q,fn(t){const{element:n,padding:r}=typeof q=="function"?q(t):q;return n&&e(n)?n.current!=null?ep({element:n.current,padding:r}).fn(t):{}:n?ep({element:n,padding:r}).fn(t):{}}}},_B=(q,e)=>({...FB(q),options:[q,e]}),$B=(q,e)=>({...LB(q),options:[q,e]}),q1=(q,e)=>({...KB(q),options:[q,e]}),e1=(q,e)=>({...YB(q),options:[q,e]}),t1=(q,e)=>({...zB(q),options:[q,e]}),n1=(q,e)=>({...PB(q),options:[q,e]}),r1=(q,e)=>({...XB(q),options:[q,e]});var A1="Arrow",rp=p.forwardRef((q,e)=>{const{children:t,width:n=10,height:r=5,...A}=q;return c.jsx(Yq.svg,{...A,ref:e,width:n,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:q.asChild?t:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});rp.displayName=A1;var o1=rp;function zV(q){const[e,t]=p.useState(void 0);return Ut(()=>{if(q){t({width:q.offsetWidth,height:q.offsetHeight});const n=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const A=r[0];let o,a;if("borderBoxSize"in A){const s=A.borderBoxSize,i=Array.isArray(s)?s[0]:s;o=i.inlineSize,a=i.blockSize}else o=q.offsetWidth,a=q.offsetHeight;t({width:o,height:a})});return n.observe(q,{box:"border-box"}),()=>n.unobserve(q)}else t(void 0)},[q]),e}var PV="Popper",[Ap,Ga]=Dt(PV),[a1,op]=Ap(PV),ap=q=>{const{__scopePopper:e,children:t}=q,[n,r]=p.useState(null);return c.jsx(a1,{scope:e,anchor:n,onAnchorChange:r,children:t})};ap.displayName=PV;var sp="PopperAnchor",ip=p.forwardRef((q,e)=>{const{__scopePopper:t,virtualRef:n,...r}=q,A=op(sp,t),o=p.useRef(null),a=re(e,o),s=p.useRef(null);return p.useEffect(()=>{const i=s.current;s.current=n?.current||o.current,i!==s.current&&A.onAnchorChange(s.current)}),n?null:c.jsx(Yq.div,{...r,ref:a})});ip.displayName=sp;var KV="PopperContent",[s1,i1]=Ap(KV),Vp=p.forwardRef((q,e)=>{const{__scopePopper:t,side:n="bottom",sideOffset:r=0,align:A="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:s=!0,collisionBoundary:i=[],collisionPadding:l=0,sticky:V="partial",hideWhenDetached:d=!1,updatePositionStrategy:u="optimized",onPlaced:f,...g}=q,h=op(KV,t),[m,w]=p.useState(null),y=re(e,wq=>w(wq)),[v,M]=p.useState(null),x=zV(v),b=x?.width??0,k=x?.height??0,U=n+(A!=="center"?"-"+A:""),T=typeof l=="number"?l:{top:0,right:0,bottom:0,left:0,...l},O=Array.isArray(i)?i:[i],N=O.length>0,B={padding:T,boundary:O.filter(l1),altBoundary:N},{refs:j,floatingStyles:K,placement:Q,isPositioned:z,middlewareData:G}=HB({strategy:"fixed",placement:U,whileElementsMounted:(...wq)=>GB(...wq,{animationFrame:u==="always"}),elements:{reference:h.anchor},middleware:[_B({mainAxis:r+k,alignmentAxis:o}),s&&$B({mainAxis:!0,crossAxis:!1,limiter:V==="partial"?q1():void 0,...B}),s&&e1({...B}),t1({...B,apply:({elements:wq,rects:_,availableWidth:dq,availableHeight:bq})=>{const{width:Fq,height:Gq}=_.reference,te=wq.floating.style;te.setProperty("--radix-popper-available-width",`${dq}px`),te.setProperty("--radix-popper-available-height",`${bq}px`),te.setProperty("--radix-popper-anchor-width",`${Fq}px`),te.setProperty("--radix-popper-anchor-height",`${Gq}px`)}}),v&&r1({element:v,padding:a}),c1({arrowWidth:b,arrowHeight:k}),d&&n1({strategy:"referenceHidden",...B})]}),[L,J]=up(Q),oq=Rt(f);Ut(()=>{z&&oq?.()},[z,oq]);const Cq=G.arrow?.x,rq=G.arrow?.y,gq=G.arrow?.centerOffset!==0,[Vq,fq]=p.useState();return Ut(()=>{m&&fq(window.getComputedStyle(m).zIndex)},[m]),c.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:z?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Vq,"--radix-popper-transform-origin":[G.transformOrigin?.x,G.transformOrigin?.y].join(" "),...G.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:q.dir,children:c.jsx(s1,{scope:t,placedSide:L,onArrowChange:M,arrowX:Cq,arrowY:rq,shouldHideArrow:gq,children:c.jsx(Yq.div,{"data-side":L,"data-align":J,...g,ref:y,style:{...g.style,animation:z?void 0:"none"}})})})});Vp.displayName=KV;var lp="PopperArrow",V1={top:"bottom",right:"left",bottom:"top",left:"right"},cp=p.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,A=i1(lp,n),o=V1[A.placedSide];return c.jsx("span",{ref:A.onArrowChange,style:{position:"absolute",left:A.arrowX,top:A.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[A.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[A.placedSide],visibility:A.shouldHideArrow?"hidden":void 0},children:c.jsx(o1,{...r,ref:t,style:{...r.style,display:"block"}})})});cp.displayName=lp;function l1(q){return q!==null}var c1=q=>({name:"transformOrigin",options:q,fn(e){const{placement:t,rects:n,middlewareData:r}=e,o=r.arrow?.centerOffset!==0,a=o?0:q.arrowWidth,s=o?0:q.arrowHeight,[i,l]=up(t),V={start:"0%",center:"50%",end:"100%"}[l],d=(r.arrow?.x??0)+a/2,u=(r.arrow?.y??0)+s/2;let f="",g="";return i==="bottom"?(f=o?V:`${d}px`,g=`${-s}px`):i==="top"?(f=o?V:`${d}px`,g=`${n.floating.height+s}px`):i==="right"?(f=`${-s}px`,g=o?V:`${u}px`):i==="left"&&(f=`${n.floating.width+s}px`,g=o?V:`${u}px`),{data:{x:f,y:g}}}});function up(q){const[e,t="center"]=q.split("-");return[e,t]}var JV=ap,dp=ip,gp=Vp,fp=cp,WV="rovingFocusGroup.onEntryFocus",u1={bubbles:!1,cancelable:!0},YA="RovingFocusGroup",[ZV,pp,d1]=Uf(YA),[g1,Fa]=Dt(YA,[d1]),[f1,p1]=g1(YA),hp=p.forwardRef((q,e)=>c.jsx(ZV.Provider,{scope:q.__scopeRovingFocusGroup,children:c.jsx(ZV.Slot,{scope:q.__scopeRovingFocusGroup,children:c.jsx(h1,{...q,ref:e})})}));hp.displayName=YA;var h1=p.forwardRef((q,e)=>{const{__scopeRovingFocusGroup:t,orientation:n,loop:r=!1,dir:A,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:s,onEntryFocus:i,preventScrollOnEntryFocus:l=!1,...V}=q,d=p.useRef(null),u=re(e,d),f=BV(A),[g,h]=Jn({prop:o,defaultProp:a??null,onChange:s,caller:YA}),[m,w]=p.useState(!1),y=Rt(i),v=pp(t),M=p.useRef(!1),[x,b]=p.useState(0);return p.useEffect(()=>{const k=d.current;if(k)return k.addEventListener(WV,y),()=>k.removeEventListener(WV,y)},[y]),c.jsx(f1,{scope:t,orientation:n,dir:f,loop:r,currentTabStopId:g,onItemFocus:p.useCallback(k=>h(k),[h]),onItemShiftTab:p.useCallback(()=>w(!0),[]),onFocusableItemAdd:p.useCallback(()=>b(k=>k+1),[]),onFocusableItemRemove:p.useCallback(()=>b(k=>k-1),[]),children:c.jsx(Yq.div,{tabIndex:m||x===0?-1:0,"data-orientation":n,...V,ref:u,style:{outline:"none",...q.style},onMouseDown:pq(q.onMouseDown,()=>{M.current=!0}),onFocus:pq(q.onFocus,k=>{const U=!M.current;if(k.target===k.currentTarget&&U&&!m){const T=new CustomEvent(WV,u1);if(k.currentTarget.dispatchEvent(T),!T.defaultPrevented){const O=v().filter(Q=>Q.focusable),N=O.find(Q=>Q.active),B=O.find(Q=>Q.id===g),K=[N,B,...O].filter(Boolean).map(Q=>Q.ref.current);yp(K,l)}}M.current=!1}),onBlur:pq(q.onBlur,()=>w(!1))})})}),mp="RovingFocusGroupItem",wp=p.forwardRef((q,e)=>{const{__scopeRovingFocusGroup:t,focusable:n=!0,active:r=!1,tabStopId:A,children:o,...a}=q,s=en(),i=A||s,l=p1(mp,t),V=l.currentTabStopId===i,d=pp(t),{onFocusableItemAdd:u,onFocusableItemRemove:f,currentTabStopId:g}=l;return p.useEffect(()=>{if(n)return u(),()=>f()},[n,u,f]),c.jsx(ZV.ItemSlot,{scope:t,id:i,focusable:n,active:r,children:c.jsx(Yq.span,{tabIndex:V?0:-1,"data-orientation":l.orientation,...a,ref:e,onMouseDown:pq(q.onMouseDown,h=>{n?l.onItemFocus(i):h.preventDefault()}),onFocus:pq(q.onFocus,()=>l.onItemFocus(i)),onKeyDown:pq(q.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){l.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const m=y1(h,l.orientation,l.dir);if(m!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let y=d().filter(v=>v.focusable).map(v=>v.ref.current);if(m==="last")y.reverse();else if(m==="prev"||m==="next"){m==="prev"&&y.reverse();const v=y.indexOf(h.currentTarget);y=l.loop?v1(y,v+1):y.slice(v+1)}setTimeout(()=>yp(y))}}),children:typeof o=="function"?o({isCurrentTabStop:V,hasTabStop:g!=null}):o})})});wp.displayName=mp;var m1={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function w1(q,e){return e!=="rtl"?q:q==="ArrowLeft"?"ArrowRight":q==="ArrowRight"?"ArrowLeft":q}function y1(q,e,t){const n=w1(q.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return m1[n]}function yp(q,e=!1){const t=document.activeElement;for(const n of q)if(n===t||(n.focus({preventScroll:e}),document.activeElement!==t))return}function v1(q,e){return q.map((t,n)=>q[(e+n)%q.length])}var vp=hp,Mp=wp;function M1(q){const e=E1(q),t=p.forwardRef((n,r)=>{const{children:A,...o}=n,a=p.Children.toArray(A),s=a.find(C1);if(s){const i=s.props.children,l=a.map(V=>V===s?p.Children.count(i)>1?p.Children.only(null):p.isValidElement(i)?i.props.children:null:V);return c.jsx(e,{...o,ref:r,children:p.isValidElement(i)?p.cloneElement(i,void 0,l):null})}return c.jsx(e,{...o,ref:r,children:A})});return t.displayName=`${q}.Slot`,t}function E1(q){const e=p.forwardRef((t,n)=>{const{children:r,...A}=t;if(p.isValidElement(r)){const o=S1(r),a=x1(A,r.props);return r.type!==p.Fragment&&(a.ref=n?Kn(n,o):o),p.cloneElement(r,a)}return p.Children.count(r)>1?p.Children.only(null):null});return e.displayName=`${q}.SlotClone`,e}var b1=Symbol("radix.slottable");function C1(q){return p.isValidElement(q)&&typeof q.type=="function"&&"__radixId"in q.type&&q.type.__radixId===b1}function x1(q,e){const t={...e};for(const n in e){const r=q[n],A=e[n];/^on[A-Z]/.test(n)?r&&A?t[n]=(...a)=>{const s=A(...a);return r(...a),s}:r&&(t[n]=r):n==="style"?t[n]={...r,...A}:n==="className"&&(t[n]=[r,A].filter(Boolean).join(" "))}return{...q,...t}}function S1(q){let e=Object.getOwnPropertyDescriptor(q.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?q.ref:(e=Object.getOwnPropertyDescriptor(q,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?q.props.ref:q.props.ref||q.ref)}var HV=["Enter"," "],k1=["ArrowDown","PageUp","Home"],Ep=["ArrowUp","PageDown","End"],I1=[...k1,...Ep],T1={ltr:[...HV,"ArrowRight"],rtl:[...HV,"ArrowLeft"]},B1={ltr:["ArrowLeft"],rtl:["ArrowRight"]},zA="Menu",[PA,N1,D1]=Uf(zA),[br,bp]=Dt(zA,[D1,Ga,Fa]),KA=Ga(),Cp=Fa(),[xp,qr]=br(zA),[U1,JA]=br(zA),Sp=q=>{const{__scopeMenu:e,open:t=!1,children:n,dir:r,onOpenChange:A,modal:o=!0}=q,a=KA(e),[s,i]=p.useState(null),l=p.useRef(!1),V=Rt(A),d=BV(r);return p.useEffect(()=>{const u=()=>{l.current=!0,document.addEventListener("pointerdown",f,{capture:!0,once:!0}),document.addEventListener("pointermove",f,{capture:!0,once:!0})},f=()=>l.current=!1;return document.addEventListener("keydown",u,{capture:!0}),()=>{document.removeEventListener("keydown",u,{capture:!0}),document.removeEventListener("pointerdown",f,{capture:!0}),document.removeEventListener("pointermove",f,{capture:!0})}},[]),c.jsx(JV,{...a,children:c.jsx(xp,{scope:e,open:t,onOpenChange:V,content:s,onContentChange:i,children:c.jsx(U1,{scope:e,onClose:p.useCallback(()=>V(!1),[V]),isUsingKeyboardRef:l,dir:d,modal:o,children:n})})})};Sp.displayName=zA;var R1="MenuAnchor",XV=p.forwardRef((q,e)=>{const{__scopeMenu:t,...n}=q,r=KA(t);return c.jsx(dp,{...r,...n,ref:e})});XV.displayName=R1;var _V="MenuPortal",[O1,kp]=br(_V,{forceMount:void 0}),Ip=q=>{const{__scopeMenu:e,forceMount:t,children:n,container:r}=q,A=qr(_V,e);return c.jsx(O1,{scope:e,forceMount:t,children:c.jsx(Mt,{present:t||A.open,children:c.jsx(Va,{asChild:!0,container:r,children:n})})})};Ip.displayName=_V;var bt="MenuContent",[Q1,$V]=br(bt),Tp=p.forwardRef((q,e)=>{const t=kp(bt,q.__scopeMenu),{forceMount:n=t.forceMount,...r}=q,A=qr(bt,q.__scopeMenu),o=JA(bt,q.__scopeMenu);return c.jsx(PA.Provider,{scope:q.__scopeMenu,children:c.jsx(Mt,{present:n||A.open,children:c.jsx(PA.Slot,{scope:q.__scopeMenu,children:o.modal?c.jsx(j1,{...r,ref:e}):c.jsx(G1,{...r,ref:e})})})})}),j1=p.forwardRef((q,e)=>{const t=qr(bt,q.__scopeMenu),n=p.useRef(null),r=re(e,n);return p.useEffect(()=>{const A=n.current;if(A)return Hd(A)},[]),c.jsx(ql,{...q,ref:r,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:pq(q.onFocusOutside,A=>A.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),G1=p.forwardRef((q,e)=>{const t=qr(bt,q.__scopeMenu);return c.jsx(ql,{...q,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),F1=M1("MenuContent.ScrollLock"),ql=p.forwardRef((q,e)=>{const{__scopeMenu:t,loop:n=!1,trapFocus:r,onOpenAutoFocus:A,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:s,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:V,onInteractOutside:d,onDismiss:u,disableOutsideScroll:f,...g}=q,h=qr(bt,t),m=JA(bt,t),w=KA(t),y=Cp(t),v=N1(t),[M,x]=p.useState(null),b=p.useRef(null),k=re(e,b,h.onContentChange),U=p.useRef(0),T=p.useRef(""),O=p.useRef(0),N=p.useRef(null),B=p.useRef("right"),j=p.useRef(0),K=f?uV:p.Fragment,Q=f?{as:F1,allowPinchZoom:!0}:void 0,z=L=>{const J=T.current+L,oq=v().filter(wq=>!wq.disabled),Cq=document.activeElement,rq=oq.find(wq=>wq.ref.current===Cq)?.textValue,gq=oq.map(wq=>wq.textValue),Vq=$1(gq,J,rq),fq=oq.find(wq=>wq.textValue===Vq)?.ref.current;(function wq(_){T.current=_,window.clearTimeout(U.current),_!==""&&(U.current=window.setTimeout(()=>wq(""),1e3))})(J),fq&&setTimeout(()=>fq.focus())};p.useEffect(()=>()=>window.clearTimeout(U.current),[]),Ud();const G=p.useCallback(L=>B.current===N.current?.side&&eN(L,N.current?.area),[]);return c.jsx(Q1,{scope:t,searchRef:T,onItemEnter:p.useCallback(L=>{G(L)&&L.preventDefault()},[G]),onItemLeave:p.useCallback(L=>{G(L)||(b.current?.focus(),x(null))},[G]),onTriggerLeave:p.useCallback(L=>{G(L)&&L.preventDefault()},[G]),pointerGraceTimerRef:O,onPointerGraceIntentChange:p.useCallback(L=>{N.current=L},[]),children:c.jsx(K,{...Q,children:c.jsx(aV,{asChild:!0,trapped:r,onMountAutoFocus:pq(A,L=>{L.preventDefault(),b.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:c.jsx(ia,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:V,onInteractOutside:d,onDismiss:u,children:c.jsx(vp,{asChild:!0,...y,dir:m.dir,orientation:"vertical",loop:n,currentTabStopId:M,onCurrentTabStopIdChange:x,onEntryFocus:pq(s,L=>{m.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(gp,{role:"menu","aria-orientation":"vertical","data-state":Zp(h.open),"data-radix-menu-content":"",dir:m.dir,...w,...g,ref:k,style:{outline:"none",...g.style},onKeyDown:pq(g.onKeyDown,L=>{const oq=L.target.closest("[data-radix-menu-content]")===L.currentTarget,Cq=L.ctrlKey||L.altKey||L.metaKey,rq=L.key.length===1;oq&&(L.key==="Tab"&&L.preventDefault(),!Cq&&rq&&z(L.key));const gq=b.current;if(L.target!==gq||!I1.includes(L.key))return;L.preventDefault();const fq=v().filter(wq=>!wq.disabled).map(wq=>wq.ref.current);Ep.includes(L.key)&&fq.reverse(),X1(fq)}),onBlur:pq(q.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(U.current),T.current="")}),onPointerMove:pq(q.onPointerMove,ZA(L=>{const J=L.target,oq=j.current!==L.clientX;if(L.currentTarget.contains(J)&&oq){const Cq=L.clientX>j.current?"right":"left";B.current=Cq,j.current=L.clientX}}))})})})})})})});Tp.displayName=bt;var L1="MenuGroup",el=p.forwardRef((q,e)=>{const{__scopeMenu:t,...n}=q;return c.jsx(Yq.div,{role:"group",...n,ref:e})});el.displayName=L1;var Y1="MenuLabel",Bp=p.forwardRef((q,e)=>{const{__scopeMenu:t,...n}=q;return c.jsx(Yq.div,{...n,ref:e})});Bp.displayName=Y1;var La="MenuItem",Np="menu.itemSelect",Ya=p.forwardRef((q,e)=>{const{disabled:t=!1,onSelect:n,...r}=q,A=p.useRef(null),o=JA(La,q.__scopeMenu),a=$V(La,q.__scopeMenu),s=re(e,A),i=p.useRef(!1),l=()=>{const V=A.current;if(!t&&V){const d=new CustomEvent(Np,{bubbles:!0,cancelable:!0});V.addEventListener(Np,u=>n?.(u),{once:!0}),bd(V,d),d.defaultPrevented?i.current=!1:o.onClose()}};return c.jsx(Dp,{...r,ref:s,disabled:t,onClick:pq(q.onClick,l),onPointerDown:V=>{q.onPointerDown?.(V),i.current=!0},onPointerUp:pq(q.onPointerUp,V=>{i.current||V.currentTarget?.click()}),onKeyDown:pq(q.onKeyDown,V=>{const d=a.searchRef.current!=="";t||d&&V.key===" "||HV.includes(V.key)&&(V.currentTarget.click(),V.preventDefault())})})});Ya.displayName=La;var Dp=p.forwardRef((q,e)=>{const{__scopeMenu:t,disabled:n=!1,textValue:r,...A}=q,o=$V(La,t),a=Cp(t),s=p.useRef(null),i=re(e,s),[l,V]=p.useState(!1),[d,u]=p.useState("");return p.useEffect(()=>{const f=s.current;f&&u((f.textContent??"").trim())},[A.children]),c.jsx(PA.ItemSlot,{scope:t,disabled:n,textValue:r??d,children:c.jsx(Mp,{asChild:!0,...a,focusable:!n,children:c.jsx(Yq.div,{role:"menuitem","data-highlighted":l?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...A,ref:i,onPointerMove:pq(q.onPointerMove,ZA(f=>{n?o.onItemLeave(f):(o.onItemEnter(f),f.defaultPrevented||f.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:pq(q.onPointerLeave,ZA(f=>o.onItemLeave(f))),onFocus:pq(q.onFocus,()=>V(!0)),onBlur:pq(q.onBlur,()=>V(!1))})})})}),z1="MenuCheckboxItem",Up=p.forwardRef((q,e)=>{const{checked:t=!1,onCheckedChange:n,...r}=q;return c.jsx(Gp,{scope:q.__scopeMenu,checked:t,children:c.jsx(Ya,{role:"menuitemcheckbox","aria-checked":za(t)?"mixed":t,...r,ref:e,"data-state":rl(t),onSelect:pq(r.onSelect,()=>n?.(za(t)?!0:!t),{checkForDefaultPrevented:!1})})})});Up.displayName=z1;var Rp="MenuRadioGroup",[P1,K1]=br(Rp,{value:void 0,onValueChange:()=>{}}),Op=p.forwardRef((q,e)=>{const{value:t,onValueChange:n,...r}=q,A=Rt(n);return c.jsx(P1,{scope:q.__scopeMenu,value:t,onValueChange:A,children:c.jsx(el,{...r,ref:e})})});Op.displayName=Rp;var Qp="MenuRadioItem",jp=p.forwardRef((q,e)=>{const{value:t,...n}=q,r=K1(Qp,q.__scopeMenu),A=t===r.value;return c.jsx(Gp,{scope:q.__scopeMenu,checked:A,children:c.jsx(Ya,{role:"menuitemradio","aria-checked":A,...n,ref:e,"data-state":rl(A),onSelect:pq(n.onSelect,()=>r.onValueChange?.(t),{checkForDefaultPrevented:!1})})})});jp.displayName=Qp;var tl="MenuItemIndicator",[Gp,J1]=br(tl,{checked:!1}),Fp=p.forwardRef((q,e)=>{const{__scopeMenu:t,forceMount:n,...r}=q,A=J1(tl,t);return c.jsx(Mt,{present:n||za(A.checked)||A.checked===!0,children:c.jsx(Yq.span,{...r,ref:e,"data-state":rl(A.checked)})})});Fp.displayName=tl;var W1="MenuSeparator",Lp=p.forwardRef((q,e)=>{const{__scopeMenu:t,...n}=q;return c.jsx(Yq.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});Lp.displayName=W1;var Z1="MenuArrow",Yp=p.forwardRef((q,e)=>{const{__scopeMenu:t,...n}=q,r=KA(t);return c.jsx(fp,{...r,...n,ref:e})});Yp.displayName=Z1;var nl="MenuSub",[H1,zp]=br(nl),Pp=q=>{const{__scopeMenu:e,children:t,open:n=!1,onOpenChange:r}=q,A=qr(nl,e),o=KA(e),[a,s]=p.useState(null),[i,l]=p.useState(null),V=Rt(r);return p.useEffect(()=>(A.open===!1&&V(!1),()=>V(!1)),[A.open,V]),c.jsx(JV,{...o,children:c.jsx(xp,{scope:e,open:n,onOpenChange:V,content:i,onContentChange:l,children:c.jsx(H1,{scope:e,contentId:en(),triggerId:en(),trigger:a,onTriggerChange:s,children:t})})})};Pp.displayName=nl;var WA="MenuSubTrigger",Kp=p.forwardRef((q,e)=>{const t=qr(WA,q.__scopeMenu),n=JA(WA,q.__scopeMenu),r=zp(WA,q.__scopeMenu),A=$V(WA,q.__scopeMenu),o=p.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:s}=A,i={__scopeMenu:q.__scopeMenu},l=p.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return p.useEffect(()=>l,[l]),p.useEffect(()=>{const V=a.current;return()=>{window.clearTimeout(V),s(null)}},[a,s]),c.jsx(XV,{asChild:!0,...i,children:c.jsx(Dp,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":r.contentId,"data-state":Zp(t.open),...q,ref:Kn(e,r.onTriggerChange),onClick:V=>{q.onClick?.(V),!(q.disabled||V.defaultPrevented)&&(V.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:pq(q.onPointerMove,ZA(V=>{A.onItemEnter(V),!V.defaultPrevented&&!q.disabled&&!t.open&&!o.current&&(A.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{t.onOpenChange(!0),l()},100))})),onPointerLeave:pq(q.onPointerLeave,ZA(V=>{l();const d=t.content?.getBoundingClientRect();if(d){const u=t.content?.dataset.side,f=u==="right",g=f?-5:5,h=d[f?"left":"right"],m=d[f?"right":"left"];A.onPointerGraceIntentChange({area:[{x:V.clientX+g,y:V.clientY},{x:h,y:d.top},{x:m,y:d.top},{x:m,y:d.bottom},{x:h,y:d.bottom}],side:u}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>A.onPointerGraceIntentChange(null),300)}else{if(A.onTriggerLeave(V),V.defaultPrevented)return;A.onPointerGraceIntentChange(null)}})),onKeyDown:pq(q.onKeyDown,V=>{const d=A.searchRef.current!=="";q.disabled||d&&V.key===" "||T1[n.dir].includes(V.key)&&(t.onOpenChange(!0),t.content?.focus(),V.preventDefault())})})})});Kp.displayName=WA;var Jp="MenuSubContent",Wp=p.forwardRef((q,e)=>{const t=kp(bt,q.__scopeMenu),{forceMount:n=t.forceMount,...r}=q,A=qr(bt,q.__scopeMenu),o=JA(bt,q.__scopeMenu),a=zp(Jp,q.__scopeMenu),s=p.useRef(null),i=re(e,s);return c.jsx(PA.Provider,{scope:q.__scopeMenu,children:c.jsx(Mt,{present:n||A.open,children:c.jsx(PA.Slot,{scope:q.__scopeMenu,children:c.jsx(ql,{id:a.contentId,"aria-labelledby":a.triggerId,...r,ref:i,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:l=>{o.isUsingKeyboardRef.current&&s.current?.focus(),l.preventDefault()},onCloseAutoFocus:l=>l.preventDefault(),onFocusOutside:pq(q.onFocusOutside,l=>{l.target!==a.trigger&&A.onOpenChange(!1)}),onEscapeKeyDown:pq(q.onEscapeKeyDown,l=>{o.onClose(),l.preventDefault()}),onKeyDown:pq(q.onKeyDown,l=>{const V=l.currentTarget.contains(l.target),d=B1[o.dir].includes(l.key);V&&d&&(A.onOpenChange(!1),a.trigger?.focus(),l.preventDefault())})})})})})});Wp.displayName=Jp;function Zp(q){return q?"open":"closed"}function za(q){return q==="indeterminate"}function rl(q){return za(q)?"indeterminate":q?"checked":"unchecked"}function X1(q){const e=document.activeElement;for(const t of q)if(t===e||(t.focus(),document.activeElement!==e))return}function _1(q,e){return q.map((t,n)=>q[(e+n)%q.length])}function $1(q,e,t){const r=e.length>1&&Array.from(e).every(i=>i===e[0])?e[0]:e,A=t?q.indexOf(t):-1;let o=_1(q,Math.max(A,0));r.length===1&&(o=o.filter(i=>i!==t));const s=o.find(i=>i.toLowerCase().startsWith(r.toLowerCase()));return s!==t?s:void 0}function qN(q,e){const{x:t,y:n}=q;let r=!1;for(let A=0,o=e.length-1;A<e.length;o=A++){const a=e[A],s=e[o],i=a.x,l=a.y,V=s.x,d=s.y;l>n!=d>n&&t<(V-i)*(n-l)/(d-l)+i&&(r=!r)}return r}function eN(q,e){if(!e)return!1;const t={x:q.clientX,y:q.clientY};return qN(t,e)}function ZA(q){return e=>e.pointerType==="mouse"?q(e):void 0}var tN=Sp,nN=XV,rN=Ip,AN=Tp,oN=el,aN=Bp,sN=Ya,iN=Up,VN=Op,lN=jp,cN=Fp,uN=Lp,dN=Yp,gN=Pp,fN=Kp,pN=Wp,Pa="DropdownMenu",[hN]=Dt(Pa,[bp]),Pe=bp(),[mN,Hp]=hN(Pa),Xp=q=>{const{__scopeDropdownMenu:e,children:t,dir:n,open:r,defaultOpen:A,onOpenChange:o,modal:a=!0}=q,s=Pe(e),i=p.useRef(null),[l,V]=Jn({prop:r,defaultProp:A??!1,onChange:o,caller:Pa});return c.jsx(mN,{scope:e,triggerId:en(),triggerRef:i,contentId:en(),open:l,onOpenChange:V,onOpenToggle:p.useCallback(()=>V(d=>!d),[V]),modal:a,children:c.jsx(tN,{...s,open:l,onOpenChange:V,dir:n,modal:a,children:t})})};Xp.displayName=Pa;var _p="DropdownMenuTrigger",$p=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,disabled:n=!1,...r}=q,A=Hp(_p,t),o=Pe(t);return c.jsx(nN,{asChild:!0,...o,children:c.jsx(Yq.button,{type:"button",id:A.triggerId,"aria-haspopup":"menu","aria-expanded":A.open,"aria-controls":A.open?A.contentId:void 0,"data-state":A.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...r,ref:Kn(e,A.triggerRef),onPointerDown:pq(q.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(A.onOpenToggle(),A.open||a.preventDefault())}),onKeyDown:pq(q.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&A.onOpenToggle(),a.key==="ArrowDown"&&A.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});$p.displayName=_p;var wN="DropdownMenuPortal",qh=q=>{const{__scopeDropdownMenu:e,...t}=q,n=Pe(e);return c.jsx(rN,{...n,...t})};qh.displayName=wN;var eh="DropdownMenuContent",th=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Hp(eh,t),A=Pe(t),o=p.useRef(!1);return c.jsx(AN,{id:r.contentId,"aria-labelledby":r.triggerId,...A,...n,ref:e,onCloseAutoFocus:pq(q.onCloseAutoFocus,a=>{o.current||r.triggerRef.current?.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:pq(q.onInteractOutside,a=>{const s=a.detail.originalEvent,i=s.button===0&&s.ctrlKey===!0,l=s.button===2||i;(!r.modal||l)&&(o.current=!0)}),style:{...q.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});th.displayName=eh;var yN="DropdownMenuGroup",nh=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(oN,{...r,...n,ref:e})});nh.displayName=yN;var vN="DropdownMenuLabel",MN=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(aN,{...r,...n,ref:e})});MN.displayName=vN;var EN="DropdownMenuItem",rh=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(sN,{...r,...n,ref:e})});rh.displayName=EN;var bN="DropdownMenuCheckboxItem",CN=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(iN,{...r,...n,ref:e})});CN.displayName=bN;var xN="DropdownMenuRadioGroup",SN=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(VN,{...r,...n,ref:e})});SN.displayName=xN;var kN="DropdownMenuRadioItem",IN=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(lN,{...r,...n,ref:e})});IN.displayName=kN;var TN="DropdownMenuItemIndicator",BN=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(cN,{...r,...n,ref:e})});BN.displayName=TN;var NN="DropdownMenuSeparator",DN=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(uN,{...r,...n,ref:e})});DN.displayName=NN;var UN="DropdownMenuArrow",RN=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(dN,{...r,...n,ref:e})});RN.displayName=UN;var ON=q=>{const{__scopeDropdownMenu:e,children:t,open:n,onOpenChange:r,defaultOpen:A}=q,o=Pe(e),[a,s]=Jn({prop:n,defaultProp:A??!1,onChange:r,caller:"DropdownMenuSub"});return c.jsx(gN,{...o,open:a,onOpenChange:s,children:t})},QN="DropdownMenuSubTrigger",Ah=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(fN,{...r,...n,ref:e})});Ah.displayName=QN;var jN="DropdownMenuSubContent",oh=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(pN,{...r,...n,ref:e,style:{...q.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});oh.displayName=jN;var GN=Xp,FN=$p,LN=qh,YN=th,zN=nh,PN=rh,KN=ON,JN=Ah,WN=oh;function Ka({...q}){return c.jsx(GN,{"data-slot":"dropdown-menu",...q})}function Al({...q}){return q.container=Pn(e=>e.shadowPortal),c.jsx(LN,{"data-slot":"dropdown-menu-portal",...q})}function Ja({...q}){return c.jsx(FN,{"data-slot":"dropdown-menu-trigger",...q})}function Wa({className:q,sideOffset:e=4,...t}){return c.jsx(Al,{children:c.jsx(YN,{"data-slot":"dropdown-menu-content",sideOffset:e,className:Ae("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8em] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",q),...t})})}function ZN({...q}){return c.jsx(zN,{"data-slot":"dropdown-menu-group",...q})}function Vt({className:q,inset:e,variant:t="default",...n}){return c.jsx(PN,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":t,className:Ae("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4",q),...n})}function ah({...q}){return c.jsx(KN,{"data-slot":"dropdown-menu-sub",...q})}function sh({className:q,inset:e,children:t,...n}){return c.jsxs(JN,{"data-slot":"dropdown-menu-sub-trigger","data-inset":e,className:Ae("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",q),...n,children:[t,c.jsx(sI,{className:"ml-auto size-4"})]})}function ih({className:q,...e}){return c.jsx(WN,{"data-slot":"dropdown-menu-sub-content",className:Ae("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8em] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",q),...e})}function HN({title:q="",description:e="",cancelTitle:t="Cancel",actionTitle:n="Confirm",onCancel:r=()=>{},onConfirm:A=()=>{},rootProps:o,triggerElement:a,triggerProps:s,open:i,onOpenChange:l,portalProps:V,overlayProps:d,contentProps:u,headerProps:f,titleProps:g,descriptionProps:h,footerProps:m,cancelProps:w,cancelButtonProps:y,actionProps:v,actionButtonProps:M,...x},b){return c.jsx("div",{ref:b,...x,children:c.jsxs(Ng,{open:i,onOpenChange:l,...o,children:[a!=null&&c.jsx(ZS,{asChild:!0,...s,children:a}),c.jsxs(Dg,{...V,children:[c.jsx(Ug,{...d,className:H("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",d?.className)}),c.jsxs(Rg,{...u,className:H("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2em)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",u?.className),children:[c.jsxs("div",{...f,className:H("flex flex-col gap-2 text-center sm:text-left",f?.className),children:[c.jsx(Og,{...g,className:H("text-lg font-semibold",g?.className),children:q}),c.jsx(_S,{...h,className:H("text-muted-foreground text-sm",h?.className),children:e})]}),c.jsxs("div",{...m,className:H("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",m?.className),children:[c.jsx(XS,{...w,onClick:r,children:c.jsx(at,{variant:"outline",...y,children:t})}),c.jsx(HS,{...v,onClick:A,children:c.jsx(at,{...M,children:n})})]})]})]})]})})}const Za=p.forwardRef(HN);Za.displayName="AlertDialog";const XN=()=>{const{t:q}=Qq(),{selectedDialog:e,leaveGroupChat:t}=Jq(),{startVideoCall:n,startAudioCall:r}=XC(),A=fe(h=>h.enableCalls),o=Pn(h=>h.shadowPortal),[a,s]=Qe(Eq(h=>[h.singleView,h.showChatActionsAsMenu])),[i,l]=E.useState(!1),V=A&&e?.type===F.DialogType.PRIVATE,d=!a,u=E.useCallback(()=>{t(),l(!1)},[t]),f=c.jsxs(Ka,{modal:!1,children:[c.jsx(Ja,{className:"group p-2 rounded-full cursor-pointer hover:bg-ring/10 transition-all duration-200 ease-out",children:c.jsx(VI,{className:"text-foreground transition-all duration-200 ease-out group-hover:scale-110 group-hover:rotate-90 group-data-[state=open]:rotate-90 group-data-[state=open]:scale-110"})}),c.jsxs(Wa,{align:"start",className:"transition-all duration-200 ease-out",children:[V&&c.jsxs(c.Fragment,{children:[c.jsxs(Vt,{className:"group cursor-pointer gap-2 transition-all duration-200 ease-out",onClick:r,children:[c.jsx(jA,{className:"text-foreground group-hover:text-blue-700 group-hover:scale-110 transition-all duration-200 ease-out size-5 shrink-0"}),c.jsx("span",{children:q("Call")})]}),c.jsxs(Vt,{className:"group cursor-pointer gap-2 transition-all duration-200 ease-out",onClick:n,children:[c.jsx(bV,{className:"text-foreground group-hover:text-blue-700 group-hover:scale-110 transition-all duration-200 ease-out size-5 shrink-0"}),c.jsx("span",{children:q("Video")})]})]}),d&&c.jsxs(Vt,{className:"group cursor-pointer gap-2 transition-all duration-200 ease-out",onClick:()=>l(!0),children:[c.jsx(EV,{className:"text-foreground group-hover:text-blue-700 group-hover:scale-110 transition-all duration-200 ease-out size-5 shrink-0"}),c.jsx("span",{children:q("ExitChat")})]})]})]}),g=c.jsxs(c.Fragment,{children:[V&&c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"group p-2 rounded-full cursor-pointer hover:bg-ring/10 transition-all duration-200 ease-out",onClick:r,children:c.jsx(jA,{className:"text-foreground group-hover:scale-110 transition-all duration-200 ease-out"})}),c.jsx("button",{className:"group p-2 rounded-full cursor-pointer hover:bg-ring/10 transition-all duration-200 ease-out",onClick:n,children:c.jsx(bV,{className:"text-foreground group-hover:scale-110 transition-all duration-200 ease-out"})})]}),d&&c.jsx("div",{className:"group p-2 rounded-full cursor-pointer hover:bg-ring/10 transition-all duration-200 ease-out",onClick:()=>l(!0),children:c.jsx(EV,{className:"text-foreground group-hover:scale-110 transition-all duration-200 ease-out size-6"})})]});return c.jsxs("div",{className:"flex flex-row",children:[s?f:g,d&&c.jsx(Za,{open:i,onOpenChange:l,onConfirm:u,triggerElement:s?void 0:c.jsx("div",{className:"group p-2 rounded-full cursor-pointer hover:bg-ring/10 transition-all duration-200 ease-out",children:c.jsx(EV,{className:"text-foreground group-hover:scale-110 transition-all duration-200 ease-out size-6"})}),title:q("ExitChat"),description:q("ExitChatConfirm"),cancelTitle:q("Cancel"),actionTitle:q("ExitChat"),portalProps:{container:o},actionButtonProps:{className:"bg-blue-500 hover:bg-blue-700"}})]})},_N=()=>{const{t:q}=Qq(),e=UA(w=>w.showProfile),[t,n]=fe(Eq(w=>[w.enableUserStatuses,w.enableLastSeen])),r=Qe(w=>w.singleView),{users:A,selectedDialog:o,lastActivity:a,getDialogOpponentId:s,unselectDialog:i}=Jq(),l=s(),V=vd(o),d=n&&l&&a[l],u=d==="Online",f=d==="Online"?q("Online"):d,g=V||f,h=t&&l&&u?BA(A[l]):void 0,m=()=>{e(l)};return c.jsxs("div",{className:"flex justify-between relative items-center",children:[c.jsxs("div",{className:"flex items-center relative",children:[!r&&c.jsx(Cf,{onClick:()=>{i()},className:"mr-2 cursor-pointer block min-w-6 size-6"}),c.jsx("div",{className:"flex items-center justify-center mr-3 size-13 rounded-full cursor-pointer",onClick:m,children:c.jsx(An,{src:Nt(o?.photo),name:o?.name,className:`size-13 ${o?.photo?"bg-blue-100":"bg-blue-300"}`,online:u,presence:h})}),c.jsxs("div",{className:"flex flex-col items-start",children:[c.jsx("span",{className:"text-black font-medium cursor-pointer line-clamp-1 break-all",onClick:m,children:o?.name??""}),!r&&c.jsx("div",{className:"flex items-center pt-1 max-h-5",children:c.jsx("span",{className:"text-xs text-gray-500 italic line-clamp-2 min-h-5 text-left leading-none pl-0.5",children:g})})]})]}),c.jsx(XN,{})]})},$N=E.memo(_N);var qD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],eD=qD.reduce((q,e)=>{const t=MV(`Primitive.${e}`),n=p.forwardRef((r,A)=>{const{asChild:o,...a}=r,s=o?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(s,{...a,ref:A})});return n.displayName=`Primitive.${e}`,{...q,[e]:n}},{}),tD="Label",Vh=p.forwardRef((q,e)=>c.jsx(eD.label,{...q,ref:e,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(q.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Vh.displayName=tD;var nD=Vh;function rD({...q},e){return c.jsx(nD,{ref:e,...q,className:H("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",q?.className)})}const Gt=p.forwardRef(rD);Gt.displayName="Label";const AD=(q,e)=>{if(q.length===0)return!1;const t=typeof e=="string"?e.split(/\s*,\s*|\s+/).map(n=>n.toLowerCase().trim()):null;return t===null||t.length===0?!1:q.every(n=>{const{type:r,size:A}=n;if(typeof r!="string"||typeof A!="number"||A<=0||r.length===0)return!1;const o=r.toLowerCase(),[a,s]=o.split("/");return t.some(i=>i.startsWith("*")||i===o||a&&i.endsWith("/*")&&i.startsWith(a)||i.startsWith(".")&&i.slice(1)===s)})},lh=(q,e,t,n,r)=>{const A=Array.from(q||[]).filter(Boolean);if(A.length===0)return;AD(A,e)?n(t?A:A[0]?[A[0]]:[]):r()};function oD({onSelectFile:q=()=>{},onInvalidFile:e=()=>{},multiple:t=!1,accept:n="*/*",iconElement:r,labelProps:A,iconProps:o,...a},s){const i=l=>{lh(l.currentTarget.files,n,t,q,e),l.currentTarget.value=""};return c.jsxs(Gt,{...A,htmlFor:"file-uploader",className:H("group p-2 rounded-full hover:bg-ring/10 transition-all duration-200 ease-out cursor-pointer",A?.className),children:[r||c.jsx(yI,{...o,className:H("text-foreground group-hover:scale-110 transition-all duration-200 ease-out",o?.className)}),c.jsx("input",{ref:s,id:"file-uploader",type:"file",multiple:t,accept:n,onChange:i,...a,className:H("hidden",a?.className)})]})}const ch=p.forwardRef(oD);ch.displayName="FilePickerInput";function aD({onSelectFile:q=()=>{},onInvalidFile:e=()=>{},multiple:t=!1,accept:n="*/*",children:r,iconElement:A,placeholder:o,dropZoneProps:a,placeholderContainerProps:s,iconProps:i,placeholderProps:l,...V},d){const[u,f]=p.useState(!1),g=y=>{y.preventDefault(),y.stopPropagation()},h=y=>{g(y),f(!1),lh(y.dataTransfer.files,n,t,q,e),y.dataTransfer.clearData()},m=y=>{g(y),y.dataTransfer.items&&y.dataTransfer.items.length>0&&f(!0)},w=y=>{y.currentTarget.contains(y.relatedTarget)||f(!1)};return c.jsxs("div",{ref:d,onDragEnter:m,onDragLeave:w,onDragOver:g,...V,className:H("relative size-full min-h-0",V?.className),children:[r,c.jsx("div",{onDrop:h,...a,className:H("absolute top-0 left-0 size-full","flex items-center justify-center","transition-all duration-300 ease-out","border-2 border-dashed border-ring bg-ring/25 rounded-md",u?"opacity-100 pointer-events-auto visible scale-100":"opacity-0 pointer-events-none invisible scale-98",a?.className),children:c.jsxs("div",{...s,className:H("bg-muted flex flex-row items-center gap-2 rounded-full py-2 px-4 transition-all",u?"scale-100":"scale-90",s?.className),children:[A||c.jsx(lI,{absoluteStrokeWidth:!0,...i,className:H("text-ring size-6",i?.className)}),c.jsx("span",{...l,className:H("text-ring text-md font-bold",l?.className),children:o||"Drop files here"})]})})]})}const uh=p.forwardRef(aD);uh.displayName="FilePickerDropzone";var dh="vercel.ai.error",sD=Symbol.for(dh),gh,fh,mq=class TE extends(fh=Error,gh=sD,fh){constructor({name:e,message:t,cause:n}){super(t),this[gh]=!0,this.name=e,this.cause=n}static isInstance(e){return TE.hasMarker(e,dh)}static hasMarker(e,t){const n=Symbol.for(t);return e!=null&&typeof e=="object"&&n in e&&typeof e[n]=="boolean"&&e[n]===!0}},ph="AI_APICallError",hh=`vercel.ai.error.${ph}`,iD=Symbol.for(hh),mh,wh,Ke=class extends(wh=mq,mh=iD,wh){constructor({message:q,url:e,requestBodyValues:t,statusCode:n,responseHeaders:r,responseBody:A,cause:o,isRetryable:a=n!=null&&(n===408||n===409||n===429||n>=500),data:s}){super({name:ph,message:q,cause:o}),this[mh]=!0,this.url=e,this.requestBodyValues=t,this.statusCode=n,this.responseHeaders=r,this.responseBody=A,this.isRetryable=a,this.data=s}static isInstance(q){return mq.hasMarker(q,hh)}},yh="AI_EmptyResponseBodyError",vh=`vercel.ai.error.${yh}`,VD=Symbol.for(vh),Mh,Eh,lD=class extends(Eh=mq,Mh=VD,Eh){constructor({message:q="Empty response body"}={}){super({name:yh,message:q}),this[Mh]=!0}static isInstance(q){return mq.hasMarker(q,vh)}};function HA(q){return q==null?"unknown error":typeof q=="string"?q:q instanceof Error?q.message:JSON.stringify(q)}var bh="AI_InvalidArgumentError",Ch=`vercel.ai.error.${bh}`,cD=Symbol.for(Ch),xh,Sh,kh=class extends(Sh=mq,xh=cD,Sh){constructor({message:e,cause:t,argument:n}){super({name:bh,message:e,cause:t}),this[xh]=!0,this.argument=n}static isInstance(e){return mq.hasMarker(e,Ch)}},Ih="AI_InvalidPromptError",Th=`vercel.ai.error.${Ih}`,uD=Symbol.for(Th),Bh,Nh,qA=class extends(Nh=mq,Bh=uD,Nh){constructor({prompt:q,message:e,cause:t}){super({name:Ih,message:`Invalid prompt: ${e}`,cause:t}),this[Bh]=!0,this.prompt=q}static isInstance(q){return mq.hasMarker(q,Th)}},Dh="AI_JSONParseError",Uh=`vercel.ai.error.${Dh}`,dD=Symbol.for(Uh),Rh,Oh,Ha=class extends(Oh=mq,Rh=dD,Oh){constructor({text:q,cause:e}){super({name:Dh,message:`JSON parsing failed: Text: ${q}.
|
|
61
|
+
`),document.adoptedStyleSheets=[...document.adoptedStyleSheets,d]},[]),c.jsx("div",{onMouseEnter:l,onMouseLeave:V,className:s,style:a,children:q})};var vf={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Mf=E.createContext&&E.createContext(vf),yT=["attr","size","title"];function vT(q,e){if(q==null)return{};var t=MT(q,e),n,r;if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(q);for(r=0;r<A.length;r++)n=A[r],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(q,n)&&(t[n]=q[n])}return t}function MT(q,e){if(q==null)return{};var t={};for(var n in q)if(Object.prototype.hasOwnProperty.call(q,n)){if(e.indexOf(n)>=0)continue;t[n]=q[n]}return t}function Sa(){return Sa=Object.assign?Object.assign.bind():function(q){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(q[n]=t[n])}return q},Sa.apply(this,arguments)}function Ef(q,e){var t=Object.keys(q);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(q);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(q,r).enumerable})),t.push.apply(t,n)}return t}function ka(q){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ef(Object(t),!0).forEach(function(n){ET(q,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(q,Object.getOwnPropertyDescriptors(t)):Ef(Object(t)).forEach(function(n){Object.defineProperty(q,n,Object.getOwnPropertyDescriptor(t,n))})}return q}function ET(q,e,t){return e=bT(e),e in q?Object.defineProperty(q,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):q[e]=t,q}function bT(q){var e=CT(q,"string");return typeof e=="symbol"?e:e+""}function CT(q,e){if(typeof q!="object"||!q)return q;var t=q[Symbol.toPrimitive];if(t!==void 0){var n=t.call(q,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(q)}function bf(q){return q&&q.map((e,t)=>E.createElement(e.tag,ka({key:t},e.attr),bf(e.child)))}function rn(q){return e=>E.createElement(xT,Sa({attr:ka({},q.attr)},e),bf(q.child))}function xT(q){var e=t=>{var{attr:n,size:r,title:A}=q,o=vT(q,yT),a=r||t.size||"1em",s;return t.className&&(s=t.className),q.className&&(s=(s?s+" ":"")+q.className),E.createElement("svg",Sa({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,n,o,{className:s,style:ka(ka({color:q.color||t.color},t.style),q.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),A&&E.createElement("title",null,A),q.children)};return Mf!==void 0?E.createElement(Mf.Consumer,null,t=>e(t)):e(vf)}function Cf(q){return rn({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M217.9 256L345 129c9.4-9.4 9.4-24.6 0-33.9-9.4-9.4-24.6-9.3-34 0L167 239c-9.1 9.1-9.3 23.7-.7 33.1L310.9 417c4.7 4.7 10.9 7 17 7s12.3-2.3 17-7c9.4-9.4 9.4-24.6 0-33.9L217.9 256z"},child:[]}]})(q)}function ST(q){return rn({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M312 372c-7.7 0-14 6.3-14 14 0 9.9-8.1 18-18 18H94c-9.9 0-18-8.1-18-18V126c0-9.9 8.1-18 18-18h186c9.9 0 18 8.1 18 18 0 7.7 6.3 14 14 14s14-6.3 14-14c0-25.4-20.6-46-46-46H94c-25.4 0-46 20.6-46 46v260c0 25.4 20.6 46 46 46h186c25.4 0 46-20.6 46-46 0-7.7-6.3-14-14-14z"},child:[]},{tag:"path",attr:{d:"M372.9 158.1c-2.6-2.6-6.1-4.1-9.9-4.1-3.7 0-7.3 1.4-9.9 4.1-5.5 5.5-5.5 14.3 0 19.8l65.2 64.2H162c-7.7 0-14 6.3-14 14s6.3 14 14 14h256.6L355 334.2c-5.4 5.4-5.4 14.3 0 19.8l.1.1c2.7 2.5 6.2 3.9 9.8 3.9 3.8 0 7.3-1.4 9.9-4.1l82.6-82.4c4.3-4.3 6.5-9.3 6.5-14.7 0-5.3-2.3-10.3-6.5-14.5l-84.5-84.2z"},child:[]}]})(q)}function kT(q,e=[]){let t=[];function n(A,o){const a=p.createContext(o);a.displayName=A+"Context";const s=t.length;t=[...t,o];const i=V=>{const{scope:d,children:u,...f}=V,g=d?.[q]?.[s]||a,h=p.useMemo(()=>f,Object.values(f));return c.jsx(g.Provider,{value:h,children:u})};i.displayName=A+"Provider";function l(V,d){const u=d?.[q]?.[s]||a,f=p.useContext(u);if(f)return f;if(o!==void 0)return o;throw new Error(`\`${V}\` must be used within \`${A}\``)}return[i,l]}const r=()=>{const A=t.map(o=>p.createContext(o));return function(a){const s=a?.[q]||A;return p.useMemo(()=>({[`__scope${q}`]:{...a,[q]:s}}),[a,s])}};return r.scopeName=q,[n,IT(r,...e)]}function IT(...q){const e=q[0];if(q.length===1)return e;const t=()=>{const n=q.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(A){const o=n.reduce((a,{useScope:s,scopeName:i})=>{const V=s(A)[`__scope${i}`];return{...a,...V}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}var TT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kV=TT.reduce((q,e)=>{const t=MV(`Primitive.${e}`),n=p.forwardRef((r,A)=>{const{asChild:o,...a}=r,s=o?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(s,{...a,ref:A})});return n.displayName=`Primitive.${e}`,{...q,[e]:n}},{});function BT(){return bu.useSyncExternalStore(NT,()=>!0,()=>!1)}function NT(){return()=>{}}var IV="Avatar",[DT]=kT(IV),[UT,xf]=DT(IV),Sf=p.forwardRef((q,e)=>{const{__scopeAvatar:t,...n}=q,[r,A]=p.useState("idle");return c.jsx(UT,{scope:t,imageLoadingStatus:r,onImageLoadingStatusChange:A,children:c.jsx(kV.span,{...n,ref:e})})});Sf.displayName=IV;var kf="AvatarImage",If=p.forwardRef((q,e)=>{const{__scopeAvatar:t,src:n,onLoadingStatusChange:r=()=>{},...A}=q,o=xf(kf,t),a=RT(n,A),s=Rt(i=>{r(i),o.onImageLoadingStatusChange(i)});return Ut(()=>{a!=="idle"&&s(a)},[a,s]),a==="loaded"?c.jsx(kV.img,{...A,ref:e,src:n}):null});If.displayName=kf;var Tf="AvatarFallback",Bf=p.forwardRef((q,e)=>{const{__scopeAvatar:t,delayMs:n,...r}=q,A=xf(Tf,t),[o,a]=p.useState(n===void 0);return p.useEffect(()=>{if(n!==void 0){const s=window.setTimeout(()=>a(!0),n);return()=>window.clearTimeout(s)}},[n]),o&&A.imageLoadingStatus!=="loaded"?c.jsx(kV.span,{...r,ref:e}):null});Bf.displayName=Tf;function Nf(q,e){return q?e?(q.src!==e&&(q.src=e),q.complete&&q.naturalWidth>0?"loaded":"loading"):"error":"idle"}function RT(q,{referrerPolicy:e,crossOrigin:t}){const n=BT(),r=p.useRef(null),A=n?(r.current||(r.current=new window.Image),r.current):null,[o,a]=p.useState(()=>Nf(A,q));return Ut(()=>{a(Nf(A,q))},[A,q]),Ut(()=>{const s=V=>()=>{a(V)};if(!A)return;const i=s("loaded"),l=s("error");return A.addEventListener("load",i),A.addEventListener("error",l),e&&(A.referrerPolicy=e),typeof t=="string"&&(A.crossOrigin=t),()=>{A.removeEventListener("load",i),A.removeEventListener("error",l)}},[A,t,e]),o}var OT=Sf,QT=If,jT=Bf;function TV({status:q,...e}){switch(q){case"available":return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...e,className:H("rounded-full size-4.5 text-green-600 bg-white",e?.className),children:c.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"})});case"busy":return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...e,className:H("rounded-full size-4.5 text-red-600 bg-white",e?.className),children:c.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M4.5 7.5a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1z"})});case"away":return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...e,className:H("rounded-full size-4.5 text-yellow-500 bg-white",e?.className),children:c.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71z"})});case"unknown":return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...e,className:H("rounded-full size-4.5 text-gray-500 bg-white",e?.className),children:c.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M5.496 6.033h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286a.237.237 0 0 0 .241.247m2.325 6.443c.61 0 1.029-.394 1.029-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94 0 .533.425.927 1.01.927z"})});default:return null}}TV.displayName="PresenceBadge";function GA({badge:q=!0,status:e,label:t,badgeProps:n,labelProps:r,...A}){const o=QA(t||e);return c.jsxs("div",{...A,className:H("flex items-center gap-2",A?.className),children:[q&&c.jsx(TV,{status:e,...n}),c.jsx("span",{...r,children:o})]})}GA.displayName="Presence";function GT(q){const e=q?.trim().split(/\s+/).filter(Boolean)??[];return(e.length>1?`${e[0]?.[0]}${e[1]?.[0]}`:e[0]?.slice(0,2)??"NA").toUpperCase()}function FT({src:q,name:e="NA",fallbackIconElement:t,online:n,presence:r,className:A,onlineProps:o,presenceProps:a,imageProps:s,fallbackProps:i,...l},V){const d=GT(e);return c.jsxs(OT,{ref:V,...l,className:H("relative flex size-8 shrink-0 rounded-full",A),children:[c.jsx(QT,{...s,src:q,className:H("aspect-square size-full rounded-full overflow-hidden object-cover",s?.className)}),c.jsx(jT,{...i,className:H("bg-muted size-full rounded-full flex items-center justify-center",i?.className),children:t||d}),n&&c.jsx("div",{...o,className:H("absolute top-0 right-0 rounded-full border-2 bg-green-600 border-green-200 size-3.5",o?.className)}),c.jsx(TV,{status:r,...a,className:H("absolute bottom-0 right-0",a?.className)})]})}const An=p.memo(p.forwardRef(FT));An.displayName="Avatar";function Df(q){const e=LT(q),t=p.forwardRef((n,r)=>{const{children:A,...o}=n,a=p.Children.toArray(A),s=a.find(zT);if(s){const i=s.props.children,l=a.map(V=>V===s?p.Children.count(i)>1?p.Children.only(null):p.isValidElement(i)?i.props.children:null:V);return c.jsx(e,{...o,ref:r,children:p.isValidElement(i)?p.cloneElement(i,void 0,l):null})}return c.jsx(e,{...o,ref:r,children:A})});return t.displayName=`${q}.Slot`,t}function LT(q){const e=p.forwardRef((t,n)=>{const{children:r,...A}=t;if(p.isValidElement(r)){const o=KT(r),a=PT(A,r.props);return r.type!==p.Fragment&&(a.ref=n?Kn(n,o):o),p.cloneElement(r,a)}return p.Children.count(r)>1?p.Children.only(null):null});return e.displayName=`${q}.SlotClone`,e}var YT=Symbol("radix.slottable");function zT(q){return p.isValidElement(q)&&typeof q.type=="function"&&"__radixId"in q.type&&q.type.__radixId===YT}function PT(q,e){const t={...e};for(const n in e){const r=q[n],A=e[n];/^on[A-Z]/.test(n)?r&&A?t[n]=(...a)=>{const s=A(...a);return r(...a),s}:r&&(t[n]=r):n==="style"?t[n]={...r,...A}:n==="className"&&(t[n]=[r,A].filter(Boolean).join(" "))}return{...q,...t}}function KT(q){let e=Object.getOwnPropertyDescriptor(q.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?q.ref:(e=Object.getOwnPropertyDescriptor(q,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?q.props.ref:q.props.ref||q.ref)}function Uf(q){const e=q+"CollectionProvider",[t,n]=Dt(e),[r,A]=t(e,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:h,children:m}=g,w=E.useRef(null),y=E.useRef(new Map).current;return c.jsx(r,{scope:h,itemMap:y,collectionRef:w,children:m})};o.displayName=e;const a=q+"CollectionSlot",s=Df(a),i=E.forwardRef((g,h)=>{const{scope:m,children:w}=g,y=A(a,m),v=re(h,y.collectionRef);return c.jsx(s,{ref:v,children:w})});i.displayName=a;const l=q+"CollectionItemSlot",V="data-radix-collection-item",d=Df(l),u=E.forwardRef((g,h)=>{const{scope:m,children:w,...y}=g,v=E.useRef(null),M=re(h,v),x=A(l,m);return E.useEffect(()=>(x.itemMap.set(v,{ref:v,...y}),()=>{x.itemMap.delete(v)})),c.jsx(d,{[V]:"",ref:M,children:w})});u.displayName=l;function f(g){const h=A(q+"CollectionConsumer",g);return E.useCallback(()=>{const w=h.collectionRef.current;if(!w)return[];const y=Array.from(w.querySelectorAll(`[${V}]`));return Array.from(h.itemMap.values()).sort((x,b)=>y.indexOf(x.ref.current)-y.indexOf(b.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:o,Slot:i,ItemSlot:u},f,n]}var JT=p.createContext(void 0);function BV(q){const e=p.useContext(JT);return q||e||"ltr"}const WT=["top","right","bottom","left"],_n=Math.min,dt=Math.max,Ia=Math.round,Ta=Math.floor,on=q=>({x:q,y:q}),ZT={left:"right",right:"left",bottom:"top",top:"bottom"},HT={start:"end",end:"start"};function NV(q,e,t){return dt(q,_n(e,t))}function xn(q,e){return typeof q=="function"?q(e):q}function Sn(q){return q.split("-")[0]}function Hr(q){return q.split("-")[1]}function DV(q){return q==="x"?"y":"x"}function UV(q){return q==="y"?"height":"width"}const XT=new Set(["top","bottom"]);function an(q){return XT.has(Sn(q))?"y":"x"}function RV(q){return DV(an(q))}function _T(q,e,t){t===void 0&&(t=!1);const n=Hr(q),r=RV(q),A=UV(r);let o=r==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[A]>e.floating[A]&&(o=Ba(o)),[o,Ba(o)]}function $T(q){const e=Ba(q);return[OV(q),e,OV(e)]}function OV(q){return q.replace(/start|end/g,e=>HT[e])}const Rf=["left","right"],Of=["right","left"],qB=["top","bottom"],eB=["bottom","top"];function tB(q,e,t){switch(q){case"top":case"bottom":return t?e?Of:Rf:e?Rf:Of;case"left":case"right":return e?qB:eB;default:return[]}}function nB(q,e,t,n){const r=Hr(q);let A=tB(Sn(q),t==="start",n);return r&&(A=A.map(o=>o+"-"+r),e&&(A=A.concat(A.map(OV)))),A}function Ba(q){return q.replace(/left|right|bottom|top/g,e=>ZT[e])}function rB(q){return{top:0,right:0,bottom:0,left:0,...q}}function Qf(q){return typeof q!="number"?rB(q):{top:q,right:q,bottom:q,left:q}}function Na(q){const{x:e,y:t,width:n,height:r}=q;return{width:n,height:r,top:t,left:e,right:e+n,bottom:t+r,x:e,y:t}}function jf(q,e,t){let{reference:n,floating:r}=q;const A=an(e),o=RV(e),a=UV(o),s=Sn(e),i=A==="y",l=n.x+n.width/2-r.width/2,V=n.y+n.height/2-r.height/2,d=n[a]/2-r[a]/2;let u;switch(s){case"top":u={x:l,y:n.y-r.height};break;case"bottom":u={x:l,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:V};break;case"left":u={x:n.x-r.width,y:V};break;default:u={x:n.x,y:n.y}}switch(Hr(e)){case"start":u[o]-=d*(t&&i?-1:1);break;case"end":u[o]+=d*(t&&i?-1:1);break}return u}async function AB(q,e){var t;e===void 0&&(e={});const{x:n,y:r,platform:A,rects:o,elements:a,strategy:s}=q,{boundary:i="clippingAncestors",rootBoundary:l="viewport",elementContext:V="floating",altBoundary:d=!1,padding:u=0}=xn(e,q),f=Qf(u),h=a[d?V==="floating"?"reference":"floating":V],m=Na(await A.getClippingRect({element:(t=await(A.isElement==null?void 0:A.isElement(h)))==null||t?h:h.contextElement||await(A.getDocumentElement==null?void 0:A.getDocumentElement(a.floating)),boundary:i,rootBoundary:l,strategy:s})),w=V==="floating"?{x:n,y:r,width:o.floating.width,height:o.floating.height}:o.reference,y=await(A.getOffsetParent==null?void 0:A.getOffsetParent(a.floating)),v=await(A.isElement==null?void 0:A.isElement(y))?await(A.getScale==null?void 0:A.getScale(y))||{x:1,y:1}:{x:1,y:1},M=Na(A.convertOffsetParentRelativeRectToViewportRelativeRect?await A.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:y,strategy:s}):w);return{top:(m.top-M.top+f.top)/v.y,bottom:(M.bottom-m.bottom+f.bottom)/v.y,left:(m.left-M.left+f.left)/v.x,right:(M.right-m.right+f.right)/v.x}}const oB=async(q,e,t)=>{const{placement:n="bottom",strategy:r="absolute",middleware:A=[],platform:o}=t,a=A.filter(Boolean),s=await(o.isRTL==null?void 0:o.isRTL(e));let i=await o.getElementRects({reference:q,floating:e,strategy:r}),{x:l,y:V}=jf(i,n,s),d=n,u={},f=0;for(let h=0;h<a.length;h++){var g;const{name:m,fn:w}=a[h],{x:y,y:v,data:M,reset:x}=await w({x:l,y:V,initialPlacement:n,placement:d,strategy:r,middlewareData:u,rects:i,platform:{...o,detectOverflow:(g=o.detectOverflow)!=null?g:AB},elements:{reference:q,floating:e}});l=y??l,V=v??V,u={...u,[m]:{...u[m],...M}},x&&f<=50&&(f++,typeof x=="object"&&(x.placement&&(d=x.placement),x.rects&&(i=x.rects===!0?await o.getElementRects({reference:q,floating:e,strategy:r}):x.rects),{x:l,y:V}=jf(i,d,s)),h=-1)}return{x:l,y:V,placement:d,strategy:r,middlewareData:u}},aB=q=>({name:"arrow",options:q,async fn(e){const{x:t,y:n,placement:r,rects:A,platform:o,elements:a,middlewareData:s}=e,{element:i,padding:l=0}=xn(q,e)||{};if(i==null)return{};const V=Qf(l),d={x:t,y:n},u=RV(r),f=UV(u),g=await o.getDimensions(i),h=u==="y",m=h?"top":"left",w=h?"bottom":"right",y=h?"clientHeight":"clientWidth",v=A.reference[f]+A.reference[u]-d[u]-A.floating[f],M=d[u]-A.reference[u],x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(i));let b=x?x[y]:0;(!b||!await(o.isElement==null?void 0:o.isElement(x)))&&(b=a.floating[y]||A.floating[f]);const k=v/2-M/2,U=b/2-g[f]/2-1,T=_n(V[m],U),O=_n(V[w],U),N=T,B=b-g[f]-O,j=b/2-g[f]/2+k,K=NV(N,j,B),Q=!s.arrow&&Hr(r)!=null&&j!==K&&A.reference[f]/2-(j<N?T:O)-g[f]/2<0,z=Q?j<N?j-N:j-B:0;return{[u]:d[u]+z,data:{[u]:K,centerOffset:j-K-z,...Q&&{alignmentOffset:z}},reset:Q}}}),sB=function(q){return q===void 0&&(q={}),{name:"flip",options:q,async fn(e){var t,n;const{placement:r,middlewareData:A,rects:o,initialPlacement:a,platform:s,elements:i}=e,{mainAxis:l=!0,crossAxis:V=!0,fallbackPlacements:d,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...h}=xn(q,e);if((t=A.arrow)!=null&&t.alignmentOffset)return{};const m=Sn(r),w=an(a),y=Sn(a)===a,v=await(s.isRTL==null?void 0:s.isRTL(i.floating)),M=d||(y||!g?[Ba(a)]:$T(a)),x=f!=="none";!d&&x&&M.push(...nB(a,g,f,v));const b=[a,...M],k=await s.detectOverflow(e,h),U=[];let T=((n=A.flip)==null?void 0:n.overflows)||[];if(l&&U.push(k[m]),V){const j=_T(r,o,v);U.push(k[j[0]],k[j[1]])}if(T=[...T,{placement:r,overflows:U}],!U.every(j=>j<=0)){var O,N;const j=(((O=A.flip)==null?void 0:O.index)||0)+1,K=b[j];if(K&&(!(V==="alignment"?w!==an(K):!1)||T.every(G=>an(G.placement)===w?G.overflows[0]>0:!0)))return{data:{index:j,overflows:T},reset:{placement:K}};let Q=(N=T.filter(z=>z.overflows[0]<=0).sort((z,G)=>z.overflows[1]-G.overflows[1])[0])==null?void 0:N.placement;if(!Q)switch(u){case"bestFit":{var B;const z=(B=T.filter(G=>{if(x){const L=an(G.placement);return L===w||L==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(L=>L>0).reduce((L,J)=>L+J,0)]).sort((G,L)=>G[1]-L[1])[0])==null?void 0:B[0];z&&(Q=z);break}case"initialPlacement":Q=a;break}if(r!==Q)return{reset:{placement:Q}}}return{}}}};function Gf(q,e){return{top:q.top-e.height,right:q.right-e.width,bottom:q.bottom-e.height,left:q.left-e.width}}function Ff(q){return WT.some(e=>q[e]>=0)}const iB=function(q){return q===void 0&&(q={}),{name:"hide",options:q,async fn(e){const{rects:t,platform:n}=e,{strategy:r="referenceHidden",...A}=xn(q,e);switch(r){case"referenceHidden":{const o=await n.detectOverflow(e,{...A,elementContext:"reference"}),a=Gf(o,t.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Ff(a)}}}case"escaped":{const o=await n.detectOverflow(e,{...A,altBoundary:!0}),a=Gf(o,t.floating);return{data:{escapedOffsets:a,escaped:Ff(a)}}}default:return{}}}}},Lf=new Set(["left","top"]);async function VB(q,e){const{placement:t,platform:n,elements:r}=q,A=await(n.isRTL==null?void 0:n.isRTL(r.floating)),o=Sn(t),a=Hr(t),s=an(t)==="y",i=Lf.has(o)?-1:1,l=A&&s?-1:1,V=xn(e,q);let{mainAxis:d,crossAxis:u,alignmentAxis:f}=typeof V=="number"?{mainAxis:V,crossAxis:0,alignmentAxis:null}:{mainAxis:V.mainAxis||0,crossAxis:V.crossAxis||0,alignmentAxis:V.alignmentAxis};return a&&typeof f=="number"&&(u=a==="end"?f*-1:f),s?{x:u*l,y:d*i}:{x:d*i,y:u*l}}const lB=function(q){return q===void 0&&(q=0),{name:"offset",options:q,async fn(e){var t,n;const{x:r,y:A,placement:o,middlewareData:a}=e,s=await VB(e,q);return o===((t=a.offset)==null?void 0:t.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:A+s.y,data:{...s,placement:o}}}}},cB=function(q){return q===void 0&&(q={}),{name:"shift",options:q,async fn(e){const{x:t,y:n,placement:r,platform:A}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:m=>{let{x:w,y}=m;return{x:w,y}}},...i}=xn(q,e),l={x:t,y:n},V=await A.detectOverflow(e,i),d=an(Sn(r)),u=DV(d);let f=l[u],g=l[d];if(o){const m=u==="y"?"top":"left",w=u==="y"?"bottom":"right",y=f+V[m],v=f-V[w];f=NV(y,f,v)}if(a){const m=d==="y"?"top":"left",w=d==="y"?"bottom":"right",y=g+V[m],v=g-V[w];g=NV(y,g,v)}const h=s.fn({...e,[u]:f,[d]:g});return{...h,data:{x:h.x-t,y:h.y-n,enabled:{[u]:o,[d]:a}}}}}},uB=function(q){return q===void 0&&(q={}),{options:q,fn(e){const{x:t,y:n,placement:r,rects:A,middlewareData:o}=e,{offset:a=0,mainAxis:s=!0,crossAxis:i=!0}=xn(q,e),l={x:t,y:n},V=an(r),d=DV(V);let u=l[d],f=l[V];const g=xn(a,e),h=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(s){const y=d==="y"?"height":"width",v=A.reference[d]-A.floating[y]+h.mainAxis,M=A.reference[d]+A.reference[y]-h.mainAxis;u<v?u=v:u>M&&(u=M)}if(i){var m,w;const y=d==="y"?"width":"height",v=Lf.has(Sn(r)),M=A.reference[V]-A.floating[y]+(v&&((m=o.offset)==null?void 0:m[V])||0)+(v?0:h.crossAxis),x=A.reference[V]+A.reference[y]+(v?0:((w=o.offset)==null?void 0:w[V])||0)-(v?h.crossAxis:0);f<M?f=M:f>x&&(f=x)}return{[d]:u,[V]:f}}}},dB=function(q){return q===void 0&&(q={}),{name:"size",options:q,async fn(e){var t,n;const{placement:r,rects:A,platform:o,elements:a}=e,{apply:s=()=>{},...i}=xn(q,e),l=await o.detectOverflow(e,i),V=Sn(r),d=Hr(r),u=an(r)==="y",{width:f,height:g}=A.floating;let h,m;V==="top"||V==="bottom"?(h=V,m=d===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(m=V,h=d==="end"?"top":"bottom");const w=g-l.top-l.bottom,y=f-l.left-l.right,v=_n(g-l[h],w),M=_n(f-l[m],y),x=!e.middlewareData.shift;let b=v,k=M;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(k=y),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(b=w),x&&!d){const T=dt(l.left,0),O=dt(l.right,0),N=dt(l.top,0),B=dt(l.bottom,0);u?k=f-2*(T!==0||O!==0?T+O:dt(l.left,l.right)):b=g-2*(N!==0||B!==0?N+B:dt(l.top,l.bottom))}await s({...e,availableWidth:k,availableHeight:b});const U=await o.getDimensions(a.floating);return f!==U.width||g!==U.height?{reset:{rects:!0}}:{}}}};function Da(){return typeof window<"u"}function Xr(q){return Yf(q)?(q.nodeName||"").toLowerCase():"#document"}function gt(q){var e;return(q==null||(e=q.ownerDocument)==null?void 0:e.defaultView)||window}function sn(q){var e;return(e=(Yf(q)?q.ownerDocument:q.document)||window.document)==null?void 0:e.documentElement}function Yf(q){return Da()?q instanceof Node||q instanceof gt(q).Node:!1}function Qt(q){return Da()?q instanceof Element||q instanceof gt(q).Element:!1}function Vn(q){return Da()?q instanceof HTMLElement||q instanceof gt(q).HTMLElement:!1}function zf(q){return!Da()||typeof ShadowRoot>"u"?!1:q instanceof ShadowRoot||q instanceof gt(q).ShadowRoot}const gB=new Set(["inline","contents"]);function FA(q){const{overflow:e,overflowX:t,overflowY:n,display:r}=jt(q);return/auto|scroll|overlay|hidden|clip/.test(e+n+t)&&!gB.has(r)}const fB=new Set(["table","td","th"]);function pB(q){return fB.has(Xr(q))}const hB=[":popover-open",":modal"];function Ua(q){return hB.some(e=>{try{return q.matches(e)}catch{return!1}})}const mB=["transform","translate","scale","rotate","perspective"],wB=["transform","translate","scale","rotate","perspective","filter"],yB=["paint","layout","strict","content"];function QV(q){const e=jV(),t=Qt(q)?jt(q):q;return mB.some(n=>t[n]?t[n]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||wB.some(n=>(t.willChange||"").includes(n))||yB.some(n=>(t.contain||"").includes(n))}function vB(q){let e=$n(q);for(;Vn(e)&&!_r(e);){if(QV(e))return e;if(Ua(e))return null;e=$n(e)}return null}function jV(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const MB=new Set(["html","body","#document"]);function _r(q){return MB.has(Xr(q))}function jt(q){return gt(q).getComputedStyle(q)}function Ra(q){return Qt(q)?{scrollLeft:q.scrollLeft,scrollTop:q.scrollTop}:{scrollLeft:q.scrollX,scrollTop:q.scrollY}}function $n(q){if(Xr(q)==="html")return q;const e=q.assignedSlot||q.parentNode||zf(q)&&q.host||sn(q);return zf(e)?e.host:e}function Pf(q){const e=$n(q);return _r(e)?q.ownerDocument?q.ownerDocument.body:q.body:Vn(e)&&FA(e)?e:Pf(e)}function LA(q,e,t){var n;e===void 0&&(e=[]),t===void 0&&(t=!0);const r=Pf(q),A=r===((n=q.ownerDocument)==null?void 0:n.body),o=gt(r);if(A){const a=GV(o);return e.concat(o,o.visualViewport||[],FA(r)?r:[],a&&t?LA(a):[])}return e.concat(r,LA(r,[],t))}function GV(q){return q.parent&&Object.getPrototypeOf(q.parent)?q.frameElement:null}function Kf(q){const e=jt(q);let t=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const r=Vn(q),A=r?q.offsetWidth:t,o=r?q.offsetHeight:n,a=Ia(t)!==A||Ia(n)!==o;return a&&(t=A,n=o),{width:t,height:n,$:a}}function FV(q){return Qt(q)?q:q.contextElement}function $r(q){const e=FV(q);if(!Vn(e))return on(1);const t=e.getBoundingClientRect(),{width:n,height:r,$:A}=Kf(e);let o=(A?Ia(t.width):t.width)/n,a=(A?Ia(t.height):t.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const EB=on(0);function Jf(q){const e=gt(q);return!jV()||!e.visualViewport?EB:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function bB(q,e,t){return e===void 0&&(e=!1),!t||e&&t!==gt(q)?!1:e}function Er(q,e,t,n){e===void 0&&(e=!1),t===void 0&&(t=!1);const r=q.getBoundingClientRect(),A=FV(q);let o=on(1);e&&(n?Qt(n)&&(o=$r(n)):o=$r(q));const a=bB(A,t,n)?Jf(A):on(0);let s=(r.left+a.x)/o.x,i=(r.top+a.y)/o.y,l=r.width/o.x,V=r.height/o.y;if(A){const d=gt(A),u=n&&Qt(n)?gt(n):n;let f=d,g=GV(f);for(;g&&n&&u!==f;){const h=$r(g),m=g.getBoundingClientRect(),w=jt(g),y=m.left+(g.clientLeft+parseFloat(w.paddingLeft))*h.x,v=m.top+(g.clientTop+parseFloat(w.paddingTop))*h.y;s*=h.x,i*=h.y,l*=h.x,V*=h.y,s+=y,i+=v,f=gt(g),g=GV(f)}}return Na({width:l,height:V,x:s,y:i})}function Oa(q,e){const t=Ra(q).scrollLeft;return e?e.left+t:Er(sn(q)).left+t}function Wf(q,e){const t=q.getBoundingClientRect(),n=t.left+e.scrollLeft-Oa(q,t),r=t.top+e.scrollTop;return{x:n,y:r}}function CB(q){let{elements:e,rect:t,offsetParent:n,strategy:r}=q;const A=r==="fixed",o=sn(n),a=e?Ua(e.floating):!1;if(n===o||a&&A)return t;let s={scrollLeft:0,scrollTop:0},i=on(1);const l=on(0),V=Vn(n);if((V||!V&&!A)&&((Xr(n)!=="body"||FA(o))&&(s=Ra(n)),Vn(n))){const u=Er(n);i=$r(n),l.x=u.x+n.clientLeft,l.y=u.y+n.clientTop}const d=o&&!V&&!A?Wf(o,s):on(0);return{width:t.width*i.x,height:t.height*i.y,x:t.x*i.x-s.scrollLeft*i.x+l.x+d.x,y:t.y*i.y-s.scrollTop*i.y+l.y+d.y}}function xB(q){return Array.from(q.getClientRects())}function SB(q){const e=sn(q),t=Ra(q),n=q.ownerDocument.body,r=dt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),A=dt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+Oa(q);const a=-t.scrollTop;return jt(n).direction==="rtl"&&(o+=dt(e.clientWidth,n.clientWidth)-r),{width:r,height:A,x:o,y:a}}const Zf=25;function kB(q,e){const t=gt(q),n=sn(q),r=t.visualViewport;let A=n.clientWidth,o=n.clientHeight,a=0,s=0;if(r){A=r.width,o=r.height;const l=jV();(!l||l&&e==="fixed")&&(a=r.offsetLeft,s=r.offsetTop)}const i=Oa(n);if(i<=0){const l=n.ownerDocument,V=l.body,d=getComputedStyle(V),u=l.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,f=Math.abs(n.clientWidth-V.clientWidth-u);f<=Zf&&(A-=f)}else i<=Zf&&(A+=i);return{width:A,height:o,x:a,y:s}}const IB=new Set(["absolute","fixed"]);function TB(q,e){const t=Er(q,!0,e==="fixed"),n=t.top+q.clientTop,r=t.left+q.clientLeft,A=Vn(q)?$r(q):on(1),o=q.clientWidth*A.x,a=q.clientHeight*A.y,s=r*A.x,i=n*A.y;return{width:o,height:a,x:s,y:i}}function Hf(q,e,t){let n;if(e==="viewport")n=kB(q,t);else if(e==="document")n=SB(sn(q));else if(Qt(e))n=TB(e,t);else{const r=Jf(q);n={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Na(n)}function Xf(q,e){const t=$n(q);return t===e||!Qt(t)||_r(t)?!1:jt(t).position==="fixed"||Xf(t,e)}function BB(q,e){const t=e.get(q);if(t)return t;let n=LA(q,[],!1).filter(a=>Qt(a)&&Xr(a)!=="body"),r=null;const A=jt(q).position==="fixed";let o=A?$n(q):q;for(;Qt(o)&&!_r(o);){const a=jt(o),s=QV(o);!s&&a.position==="fixed"&&(r=null),(A?!s&&!r:!s&&a.position==="static"&&!!r&&IB.has(r.position)||FA(o)&&!s&&Xf(q,o))?n=n.filter(l=>l!==o):r=a,o=$n(o)}return e.set(q,n),n}function NB(q){let{element:e,boundary:t,rootBoundary:n,strategy:r}=q;const o=[...t==="clippingAncestors"?Ua(e)?[]:BB(e,this._c):[].concat(t),n],a=o[0],s=o.reduce((i,l)=>{const V=Hf(e,l,r);return i.top=dt(V.top,i.top),i.right=_n(V.right,i.right),i.bottom=_n(V.bottom,i.bottom),i.left=dt(V.left,i.left),i},Hf(e,a,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function DB(q){const{width:e,height:t}=Kf(q);return{width:e,height:t}}function UB(q,e,t){const n=Vn(e),r=sn(e),A=t==="fixed",o=Er(q,!0,A,e);let a={scrollLeft:0,scrollTop:0};const s=on(0);function i(){s.x=Oa(r)}if(n||!n&&!A)if((Xr(e)!=="body"||FA(r))&&(a=Ra(e)),n){const u=Er(e,!0,A,e);s.x=u.x+e.clientLeft,s.y=u.y+e.clientTop}else r&&i();A&&!n&&r&&i();const l=r&&!n&&!A?Wf(r,a):on(0),V=o.left+a.scrollLeft-s.x-l.x,d=o.top+a.scrollTop-s.y-l.y;return{x:V,y:d,width:o.width,height:o.height}}function LV(q){return jt(q).position==="static"}function _f(q,e){if(!Vn(q)||jt(q).position==="fixed")return null;if(e)return e(q);let t=q.offsetParent;return sn(q)===t&&(t=t.ownerDocument.body),t}function $f(q,e){const t=gt(q);if(Ua(q))return t;if(!Vn(q)){let r=$n(q);for(;r&&!_r(r);){if(Qt(r)&&!LV(r))return r;r=$n(r)}return t}let n=_f(q,e);for(;n&&pB(n)&&LV(n);)n=_f(n,e);return n&&_r(n)&&LV(n)&&!QV(n)?t:n||vB(q)||t}const RB=async function(q){const e=this.getOffsetParent||$f,t=this.getDimensions,n=await t(q.floating);return{reference:UB(q.reference,await e(q.floating),q.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function OB(q){return jt(q).direction==="rtl"}const QB={convertOffsetParentRelativeRectToViewportRelativeRect:CB,getDocumentElement:sn,getClippingRect:NB,getOffsetParent:$f,getElementRects:RB,getClientRects:xB,getDimensions:DB,getScale:$r,isElement:Qt,isRTL:OB};function qp(q,e){return q.x===e.x&&q.y===e.y&&q.width===e.width&&q.height===e.height}function jB(q,e){let t=null,n;const r=sn(q);function A(){var a;clearTimeout(n),(a=t)==null||a.disconnect(),t=null}function o(a,s){a===void 0&&(a=!1),s===void 0&&(s=1),A();const i=q.getBoundingClientRect(),{left:l,top:V,width:d,height:u}=i;if(a||e(),!d||!u)return;const f=Ta(V),g=Ta(r.clientWidth-(l+d)),h=Ta(r.clientHeight-(V+u)),m=Ta(l),y={rootMargin:-f+"px "+-g+"px "+-h+"px "+-m+"px",threshold:dt(0,_n(1,s))||1};let v=!0;function M(x){const b=x[0].intersectionRatio;if(b!==s){if(!v)return o();b?o(!1,b):n=setTimeout(()=>{o(!1,1e-7)},1e3)}b===1&&!qp(i,q.getBoundingClientRect())&&o(),v=!1}try{t=new IntersectionObserver(M,{...y,root:r.ownerDocument})}catch{t=new IntersectionObserver(M,y)}t.observe(q)}return o(!0),A}function GB(q,e,t,n){n===void 0&&(n={});const{ancestorScroll:r=!0,ancestorResize:A=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:s=!1}=n,i=FV(q),l=r||A?[...i?LA(i):[],...LA(e)]:[];l.forEach(m=>{r&&m.addEventListener("scroll",t,{passive:!0}),A&&m.addEventListener("resize",t)});const V=i&&a?jB(i,t):null;let d=-1,u=null;o&&(u=new ResizeObserver(m=>{let[w]=m;w&&w.target===i&&u&&(u.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var y;(y=u)==null||y.observe(e)})),t()}),i&&!s&&u.observe(i),u.observe(e));let f,g=s?Er(q):null;s&&h();function h(){const m=Er(q);g&&!qp(g,m)&&t(),g=m,f=requestAnimationFrame(h)}return t(),()=>{var m;l.forEach(w=>{r&&w.removeEventListener("scroll",t),A&&w.removeEventListener("resize",t)}),V?.(),(m=u)==null||m.disconnect(),u=null,s&&cancelAnimationFrame(f)}}const FB=lB,LB=cB,YB=sB,zB=dB,PB=iB,ep=aB,KB=uB,JB=(q,e,t)=>{const n=new Map,r={platform:QB,...t},A={...r.platform,_c:n};return oB(q,e,{...r,platform:A})};var WB=typeof document<"u",ZB=function(){},Qa=WB?E.useLayoutEffect:ZB;function ja(q,e){if(q===e)return!0;if(typeof q!=typeof e)return!1;if(typeof q=="function"&&q.toString()===e.toString())return!0;let t,n,r;if(q&&e&&typeof q=="object"){if(Array.isArray(q)){if(t=q.length,t!==e.length)return!1;for(n=t;n--!==0;)if(!ja(q[n],e[n]))return!1;return!0}if(r=Object.keys(q),t=r.length,t!==Object.keys(e).length)return!1;for(n=t;n--!==0;)if(!{}.hasOwnProperty.call(e,r[n]))return!1;for(n=t;n--!==0;){const A=r[n];if(!(A==="_owner"&&q.$$typeof)&&!ja(q[A],e[A]))return!1}return!0}return q!==q&&e!==e}function tp(q){return typeof window>"u"?1:(q.ownerDocument.defaultView||window).devicePixelRatio||1}function np(q,e){const t=tp(q);return Math.round(e*t)/t}function YV(q){const e=p.useRef(q);return Qa(()=>{e.current=q}),e}function HB(q){q===void 0&&(q={});const{placement:e="bottom",strategy:t="absolute",middleware:n=[],platform:r,elements:{reference:A,floating:o}={},transform:a=!0,whileElementsMounted:s,open:i}=q,[l,V]=p.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[d,u]=p.useState(n);ja(d,n)||u(n);const[f,g]=p.useState(null),[h,m]=p.useState(null),w=p.useCallback(G=>{G!==x.current&&(x.current=G,g(G))},[]),y=p.useCallback(G=>{G!==b.current&&(b.current=G,m(G))},[]),v=A||f,M=o||h,x=p.useRef(null),b=p.useRef(null),k=p.useRef(l),U=s!=null,T=YV(s),O=YV(r),N=YV(i),B=p.useCallback(()=>{if(!x.current||!b.current)return;const G={placement:e,strategy:t,middleware:d};O.current&&(G.platform=O.current),JB(x.current,b.current,G).then(L=>{const J={...L,isPositioned:N.current!==!1};j.current&&!ja(k.current,J)&&(k.current=J,_c.flushSync(()=>{V(J)}))})},[d,e,t,O,N]);Qa(()=>{i===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,V(G=>({...G,isPositioned:!1})))},[i]);const j=p.useRef(!1);Qa(()=>(j.current=!0,()=>{j.current=!1}),[]),Qa(()=>{if(v&&(x.current=v),M&&(b.current=M),v&&M){if(T.current)return T.current(v,M,B);B()}},[v,M,B,T,U]);const K=p.useMemo(()=>({reference:x,floating:b,setReference:w,setFloating:y}),[w,y]),Q=p.useMemo(()=>({reference:v,floating:M}),[v,M]),z=p.useMemo(()=>{const G={position:t,left:0,top:0};if(!Q.floating)return G;const L=np(Q.floating,l.x),J=np(Q.floating,l.y);return a?{...G,transform:"translate("+L+"px, "+J+"px)",...tp(Q.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:L,top:J}},[t,a,Q.floating,l.x,l.y]);return p.useMemo(()=>({...l,update:B,refs:K,elements:Q,floatingStyles:z}),[l,B,K,Q,z])}const XB=q=>{function e(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:q,fn(t){const{element:n,padding:r}=typeof q=="function"?q(t):q;return n&&e(n)?n.current!=null?ep({element:n.current,padding:r}).fn(t):{}:n?ep({element:n,padding:r}).fn(t):{}}}},_B=(q,e)=>({...FB(q),options:[q,e]}),$B=(q,e)=>({...LB(q),options:[q,e]}),q1=(q,e)=>({...KB(q),options:[q,e]}),e1=(q,e)=>({...YB(q),options:[q,e]}),t1=(q,e)=>({...zB(q),options:[q,e]}),n1=(q,e)=>({...PB(q),options:[q,e]}),r1=(q,e)=>({...XB(q),options:[q,e]});var A1="Arrow",rp=p.forwardRef((q,e)=>{const{children:t,width:n=10,height:r=5,...A}=q;return c.jsx(Yq.svg,{...A,ref:e,width:n,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:q.asChild?t:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});rp.displayName=A1;var o1=rp;function zV(q){const[e,t]=p.useState(void 0);return Ut(()=>{if(q){t({width:q.offsetWidth,height:q.offsetHeight});const n=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const A=r[0];let o,a;if("borderBoxSize"in A){const s=A.borderBoxSize,i=Array.isArray(s)?s[0]:s;o=i.inlineSize,a=i.blockSize}else o=q.offsetWidth,a=q.offsetHeight;t({width:o,height:a})});return n.observe(q,{box:"border-box"}),()=>n.unobserve(q)}else t(void 0)},[q]),e}var PV="Popper",[Ap,Ga]=Dt(PV),[a1,op]=Ap(PV),ap=q=>{const{__scopePopper:e,children:t}=q,[n,r]=p.useState(null);return c.jsx(a1,{scope:e,anchor:n,onAnchorChange:r,children:t})};ap.displayName=PV;var sp="PopperAnchor",ip=p.forwardRef((q,e)=>{const{__scopePopper:t,virtualRef:n,...r}=q,A=op(sp,t),o=p.useRef(null),a=re(e,o),s=p.useRef(null);return p.useEffect(()=>{const i=s.current;s.current=n?.current||o.current,i!==s.current&&A.onAnchorChange(s.current)}),n?null:c.jsx(Yq.div,{...r,ref:a})});ip.displayName=sp;var KV="PopperContent",[s1,i1]=Ap(KV),Vp=p.forwardRef((q,e)=>{const{__scopePopper:t,side:n="bottom",sideOffset:r=0,align:A="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:s=!0,collisionBoundary:i=[],collisionPadding:l=0,sticky:V="partial",hideWhenDetached:d=!1,updatePositionStrategy:u="optimized",onPlaced:f,...g}=q,h=op(KV,t),[m,w]=p.useState(null),y=re(e,wq=>w(wq)),[v,M]=p.useState(null),x=zV(v),b=x?.width??0,k=x?.height??0,U=n+(A!=="center"?"-"+A:""),T=typeof l=="number"?l:{top:0,right:0,bottom:0,left:0,...l},O=Array.isArray(i)?i:[i],N=O.length>0,B={padding:T,boundary:O.filter(l1),altBoundary:N},{refs:j,floatingStyles:K,placement:Q,isPositioned:z,middlewareData:G}=HB({strategy:"fixed",placement:U,whileElementsMounted:(...wq)=>GB(...wq,{animationFrame:u==="always"}),elements:{reference:h.anchor},middleware:[_B({mainAxis:r+k,alignmentAxis:o}),s&&$B({mainAxis:!0,crossAxis:!1,limiter:V==="partial"?q1():void 0,...B}),s&&e1({...B}),t1({...B,apply:({elements:wq,rects:_,availableWidth:dq,availableHeight:bq})=>{const{width:Fq,height:Gq}=_.reference,te=wq.floating.style;te.setProperty("--radix-popper-available-width",`${dq}px`),te.setProperty("--radix-popper-available-height",`${bq}px`),te.setProperty("--radix-popper-anchor-width",`${Fq}px`),te.setProperty("--radix-popper-anchor-height",`${Gq}px`)}}),v&&r1({element:v,padding:a}),c1({arrowWidth:b,arrowHeight:k}),d&&n1({strategy:"referenceHidden",...B})]}),[L,J]=up(Q),oq=Rt(f);Ut(()=>{z&&oq?.()},[z,oq]);const Cq=G.arrow?.x,rq=G.arrow?.y,gq=G.arrow?.centerOffset!==0,[Vq,fq]=p.useState();return Ut(()=>{m&&fq(window.getComputedStyle(m).zIndex)},[m]),c.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:z?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Vq,"--radix-popper-transform-origin":[G.transformOrigin?.x,G.transformOrigin?.y].join(" "),...G.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:q.dir,children:c.jsx(s1,{scope:t,placedSide:L,onArrowChange:M,arrowX:Cq,arrowY:rq,shouldHideArrow:gq,children:c.jsx(Yq.div,{"data-side":L,"data-align":J,...g,ref:y,style:{...g.style,animation:z?void 0:"none"}})})})});Vp.displayName=KV;var lp="PopperArrow",V1={top:"bottom",right:"left",bottom:"top",left:"right"},cp=p.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,A=i1(lp,n),o=V1[A.placedSide];return c.jsx("span",{ref:A.onArrowChange,style:{position:"absolute",left:A.arrowX,top:A.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[A.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[A.placedSide],visibility:A.shouldHideArrow?"hidden":void 0},children:c.jsx(o1,{...r,ref:t,style:{...r.style,display:"block"}})})});cp.displayName=lp;function l1(q){return q!==null}var c1=q=>({name:"transformOrigin",options:q,fn(e){const{placement:t,rects:n,middlewareData:r}=e,o=r.arrow?.centerOffset!==0,a=o?0:q.arrowWidth,s=o?0:q.arrowHeight,[i,l]=up(t),V={start:"0%",center:"50%",end:"100%"}[l],d=(r.arrow?.x??0)+a/2,u=(r.arrow?.y??0)+s/2;let f="",g="";return i==="bottom"?(f=o?V:`${d}px`,g=`${-s}px`):i==="top"?(f=o?V:`${d}px`,g=`${n.floating.height+s}px`):i==="right"?(f=`${-s}px`,g=o?V:`${u}px`):i==="left"&&(f=`${n.floating.width+s}px`,g=o?V:`${u}px`),{data:{x:f,y:g}}}});function up(q){const[e,t="center"]=q.split("-");return[e,t]}var JV=ap,dp=ip,gp=Vp,fp=cp,WV="rovingFocusGroup.onEntryFocus",u1={bubbles:!1,cancelable:!0},YA="RovingFocusGroup",[ZV,pp,d1]=Uf(YA),[g1,Fa]=Dt(YA,[d1]),[f1,p1]=g1(YA),hp=p.forwardRef((q,e)=>c.jsx(ZV.Provider,{scope:q.__scopeRovingFocusGroup,children:c.jsx(ZV.Slot,{scope:q.__scopeRovingFocusGroup,children:c.jsx(h1,{...q,ref:e})})}));hp.displayName=YA;var h1=p.forwardRef((q,e)=>{const{__scopeRovingFocusGroup:t,orientation:n,loop:r=!1,dir:A,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:s,onEntryFocus:i,preventScrollOnEntryFocus:l=!1,...V}=q,d=p.useRef(null),u=re(e,d),f=BV(A),[g,h]=Jn({prop:o,defaultProp:a??null,onChange:s,caller:YA}),[m,w]=p.useState(!1),y=Rt(i),v=pp(t),M=p.useRef(!1),[x,b]=p.useState(0);return p.useEffect(()=>{const k=d.current;if(k)return k.addEventListener(WV,y),()=>k.removeEventListener(WV,y)},[y]),c.jsx(f1,{scope:t,orientation:n,dir:f,loop:r,currentTabStopId:g,onItemFocus:p.useCallback(k=>h(k),[h]),onItemShiftTab:p.useCallback(()=>w(!0),[]),onFocusableItemAdd:p.useCallback(()=>b(k=>k+1),[]),onFocusableItemRemove:p.useCallback(()=>b(k=>k-1),[]),children:c.jsx(Yq.div,{tabIndex:m||x===0?-1:0,"data-orientation":n,...V,ref:u,style:{outline:"none",...q.style},onMouseDown:pq(q.onMouseDown,()=>{M.current=!0}),onFocus:pq(q.onFocus,k=>{const U=!M.current;if(k.target===k.currentTarget&&U&&!m){const T=new CustomEvent(WV,u1);if(k.currentTarget.dispatchEvent(T),!T.defaultPrevented){const O=v().filter(Q=>Q.focusable),N=O.find(Q=>Q.active),B=O.find(Q=>Q.id===g),K=[N,B,...O].filter(Boolean).map(Q=>Q.ref.current);yp(K,l)}}M.current=!1}),onBlur:pq(q.onBlur,()=>w(!1))})})}),mp="RovingFocusGroupItem",wp=p.forwardRef((q,e)=>{const{__scopeRovingFocusGroup:t,focusable:n=!0,active:r=!1,tabStopId:A,children:o,...a}=q,s=en(),i=A||s,l=p1(mp,t),V=l.currentTabStopId===i,d=pp(t),{onFocusableItemAdd:u,onFocusableItemRemove:f,currentTabStopId:g}=l;return p.useEffect(()=>{if(n)return u(),()=>f()},[n,u,f]),c.jsx(ZV.ItemSlot,{scope:t,id:i,focusable:n,active:r,children:c.jsx(Yq.span,{tabIndex:V?0:-1,"data-orientation":l.orientation,...a,ref:e,onMouseDown:pq(q.onMouseDown,h=>{n?l.onItemFocus(i):h.preventDefault()}),onFocus:pq(q.onFocus,()=>l.onItemFocus(i)),onKeyDown:pq(q.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){l.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const m=y1(h,l.orientation,l.dir);if(m!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let y=d().filter(v=>v.focusable).map(v=>v.ref.current);if(m==="last")y.reverse();else if(m==="prev"||m==="next"){m==="prev"&&y.reverse();const v=y.indexOf(h.currentTarget);y=l.loop?v1(y,v+1):y.slice(v+1)}setTimeout(()=>yp(y))}}),children:typeof o=="function"?o({isCurrentTabStop:V,hasTabStop:g!=null}):o})})});wp.displayName=mp;var m1={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function w1(q,e){return e!=="rtl"?q:q==="ArrowLeft"?"ArrowRight":q==="ArrowRight"?"ArrowLeft":q}function y1(q,e,t){const n=w1(q.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return m1[n]}function yp(q,e=!1){const t=document.activeElement;for(const n of q)if(n===t||(n.focus({preventScroll:e}),document.activeElement!==t))return}function v1(q,e){return q.map((t,n)=>q[(e+n)%q.length])}var vp=hp,Mp=wp;function M1(q){const e=E1(q),t=p.forwardRef((n,r)=>{const{children:A,...o}=n,a=p.Children.toArray(A),s=a.find(C1);if(s){const i=s.props.children,l=a.map(V=>V===s?p.Children.count(i)>1?p.Children.only(null):p.isValidElement(i)?i.props.children:null:V);return c.jsx(e,{...o,ref:r,children:p.isValidElement(i)?p.cloneElement(i,void 0,l):null})}return c.jsx(e,{...o,ref:r,children:A})});return t.displayName=`${q}.Slot`,t}function E1(q){const e=p.forwardRef((t,n)=>{const{children:r,...A}=t;if(p.isValidElement(r)){const o=S1(r),a=x1(A,r.props);return r.type!==p.Fragment&&(a.ref=n?Kn(n,o):o),p.cloneElement(r,a)}return p.Children.count(r)>1?p.Children.only(null):null});return e.displayName=`${q}.SlotClone`,e}var b1=Symbol("radix.slottable");function C1(q){return p.isValidElement(q)&&typeof q.type=="function"&&"__radixId"in q.type&&q.type.__radixId===b1}function x1(q,e){const t={...e};for(const n in e){const r=q[n],A=e[n];/^on[A-Z]/.test(n)?r&&A?t[n]=(...a)=>{const s=A(...a);return r(...a),s}:r&&(t[n]=r):n==="style"?t[n]={...r,...A}:n==="className"&&(t[n]=[r,A].filter(Boolean).join(" "))}return{...q,...t}}function S1(q){let e=Object.getOwnPropertyDescriptor(q.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?q.ref:(e=Object.getOwnPropertyDescriptor(q,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?q.props.ref:q.props.ref||q.ref)}var HV=["Enter"," "],k1=["ArrowDown","PageUp","Home"],Ep=["ArrowUp","PageDown","End"],I1=[...k1,...Ep],T1={ltr:[...HV,"ArrowRight"],rtl:[...HV,"ArrowLeft"]},B1={ltr:["ArrowLeft"],rtl:["ArrowRight"]},zA="Menu",[PA,N1,D1]=Uf(zA),[br,bp]=Dt(zA,[D1,Ga,Fa]),KA=Ga(),Cp=Fa(),[xp,qr]=br(zA),[U1,JA]=br(zA),Sp=q=>{const{__scopeMenu:e,open:t=!1,children:n,dir:r,onOpenChange:A,modal:o=!0}=q,a=KA(e),[s,i]=p.useState(null),l=p.useRef(!1),V=Rt(A),d=BV(r);return p.useEffect(()=>{const u=()=>{l.current=!0,document.addEventListener("pointerdown",f,{capture:!0,once:!0}),document.addEventListener("pointermove",f,{capture:!0,once:!0})},f=()=>l.current=!1;return document.addEventListener("keydown",u,{capture:!0}),()=>{document.removeEventListener("keydown",u,{capture:!0}),document.removeEventListener("pointerdown",f,{capture:!0}),document.removeEventListener("pointermove",f,{capture:!0})}},[]),c.jsx(JV,{...a,children:c.jsx(xp,{scope:e,open:t,onOpenChange:V,content:s,onContentChange:i,children:c.jsx(U1,{scope:e,onClose:p.useCallback(()=>V(!1),[V]),isUsingKeyboardRef:l,dir:d,modal:o,children:n})})})};Sp.displayName=zA;var R1="MenuAnchor",XV=p.forwardRef((q,e)=>{const{__scopeMenu:t,...n}=q,r=KA(t);return c.jsx(dp,{...r,...n,ref:e})});XV.displayName=R1;var _V="MenuPortal",[O1,kp]=br(_V,{forceMount:void 0}),Ip=q=>{const{__scopeMenu:e,forceMount:t,children:n,container:r}=q,A=qr(_V,e);return c.jsx(O1,{scope:e,forceMount:t,children:c.jsx(Mt,{present:t||A.open,children:c.jsx(Va,{asChild:!0,container:r,children:n})})})};Ip.displayName=_V;var bt="MenuContent",[Q1,$V]=br(bt),Tp=p.forwardRef((q,e)=>{const t=kp(bt,q.__scopeMenu),{forceMount:n=t.forceMount,...r}=q,A=qr(bt,q.__scopeMenu),o=JA(bt,q.__scopeMenu);return c.jsx(PA.Provider,{scope:q.__scopeMenu,children:c.jsx(Mt,{present:n||A.open,children:c.jsx(PA.Slot,{scope:q.__scopeMenu,children:o.modal?c.jsx(j1,{...r,ref:e}):c.jsx(G1,{...r,ref:e})})})})}),j1=p.forwardRef((q,e)=>{const t=qr(bt,q.__scopeMenu),n=p.useRef(null),r=re(e,n);return p.useEffect(()=>{const A=n.current;if(A)return Hd(A)},[]),c.jsx(ql,{...q,ref:r,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:pq(q.onFocusOutside,A=>A.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),G1=p.forwardRef((q,e)=>{const t=qr(bt,q.__scopeMenu);return c.jsx(ql,{...q,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),F1=M1("MenuContent.ScrollLock"),ql=p.forwardRef((q,e)=>{const{__scopeMenu:t,loop:n=!1,trapFocus:r,onOpenAutoFocus:A,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:s,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:V,onInteractOutside:d,onDismiss:u,disableOutsideScroll:f,...g}=q,h=qr(bt,t),m=JA(bt,t),w=KA(t),y=Cp(t),v=N1(t),[M,x]=p.useState(null),b=p.useRef(null),k=re(e,b,h.onContentChange),U=p.useRef(0),T=p.useRef(""),O=p.useRef(0),N=p.useRef(null),B=p.useRef("right"),j=p.useRef(0),K=f?uV:p.Fragment,Q=f?{as:F1,allowPinchZoom:!0}:void 0,z=L=>{const J=T.current+L,oq=v().filter(wq=>!wq.disabled),Cq=document.activeElement,rq=oq.find(wq=>wq.ref.current===Cq)?.textValue,gq=oq.map(wq=>wq.textValue),Vq=$1(gq,J,rq),fq=oq.find(wq=>wq.textValue===Vq)?.ref.current;(function wq(_){T.current=_,window.clearTimeout(U.current),_!==""&&(U.current=window.setTimeout(()=>wq(""),1e3))})(J),fq&&setTimeout(()=>fq.focus())};p.useEffect(()=>()=>window.clearTimeout(U.current),[]),Ud();const G=p.useCallback(L=>B.current===N.current?.side&&eN(L,N.current?.area),[]);return c.jsx(Q1,{scope:t,searchRef:T,onItemEnter:p.useCallback(L=>{G(L)&&L.preventDefault()},[G]),onItemLeave:p.useCallback(L=>{G(L)||(b.current?.focus(),x(null))},[G]),onTriggerLeave:p.useCallback(L=>{G(L)&&L.preventDefault()},[G]),pointerGraceTimerRef:O,onPointerGraceIntentChange:p.useCallback(L=>{N.current=L},[]),children:c.jsx(K,{...Q,children:c.jsx(aV,{asChild:!0,trapped:r,onMountAutoFocus:pq(A,L=>{L.preventDefault(),b.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:c.jsx(ia,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:V,onInteractOutside:d,onDismiss:u,children:c.jsx(vp,{asChild:!0,...y,dir:m.dir,orientation:"vertical",loop:n,currentTabStopId:M,onCurrentTabStopIdChange:x,onEntryFocus:pq(s,L=>{m.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(gp,{role:"menu","aria-orientation":"vertical","data-state":Zp(h.open),"data-radix-menu-content":"",dir:m.dir,...w,...g,ref:k,style:{outline:"none",...g.style},onKeyDown:pq(g.onKeyDown,L=>{const oq=L.target.closest("[data-radix-menu-content]")===L.currentTarget,Cq=L.ctrlKey||L.altKey||L.metaKey,rq=L.key.length===1;oq&&(L.key==="Tab"&&L.preventDefault(),!Cq&&rq&&z(L.key));const gq=b.current;if(L.target!==gq||!I1.includes(L.key))return;L.preventDefault();const fq=v().filter(wq=>!wq.disabled).map(wq=>wq.ref.current);Ep.includes(L.key)&&fq.reverse(),X1(fq)}),onBlur:pq(q.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(U.current),T.current="")}),onPointerMove:pq(q.onPointerMove,ZA(L=>{const J=L.target,oq=j.current!==L.clientX;if(L.currentTarget.contains(J)&&oq){const Cq=L.clientX>j.current?"right":"left";B.current=Cq,j.current=L.clientX}}))})})})})})})});Tp.displayName=bt;var L1="MenuGroup",el=p.forwardRef((q,e)=>{const{__scopeMenu:t,...n}=q;return c.jsx(Yq.div,{role:"group",...n,ref:e})});el.displayName=L1;var Y1="MenuLabel",Bp=p.forwardRef((q,e)=>{const{__scopeMenu:t,...n}=q;return c.jsx(Yq.div,{...n,ref:e})});Bp.displayName=Y1;var La="MenuItem",Np="menu.itemSelect",Ya=p.forwardRef((q,e)=>{const{disabled:t=!1,onSelect:n,...r}=q,A=p.useRef(null),o=JA(La,q.__scopeMenu),a=$V(La,q.__scopeMenu),s=re(e,A),i=p.useRef(!1),l=()=>{const V=A.current;if(!t&&V){const d=new CustomEvent(Np,{bubbles:!0,cancelable:!0});V.addEventListener(Np,u=>n?.(u),{once:!0}),bd(V,d),d.defaultPrevented?i.current=!1:o.onClose()}};return c.jsx(Dp,{...r,ref:s,disabled:t,onClick:pq(q.onClick,l),onPointerDown:V=>{q.onPointerDown?.(V),i.current=!0},onPointerUp:pq(q.onPointerUp,V=>{i.current||V.currentTarget?.click()}),onKeyDown:pq(q.onKeyDown,V=>{const d=a.searchRef.current!=="";t||d&&V.key===" "||HV.includes(V.key)&&(V.currentTarget.click(),V.preventDefault())})})});Ya.displayName=La;var Dp=p.forwardRef((q,e)=>{const{__scopeMenu:t,disabled:n=!1,textValue:r,...A}=q,o=$V(La,t),a=Cp(t),s=p.useRef(null),i=re(e,s),[l,V]=p.useState(!1),[d,u]=p.useState("");return p.useEffect(()=>{const f=s.current;f&&u((f.textContent??"").trim())},[A.children]),c.jsx(PA.ItemSlot,{scope:t,disabled:n,textValue:r??d,children:c.jsx(Mp,{asChild:!0,...a,focusable:!n,children:c.jsx(Yq.div,{role:"menuitem","data-highlighted":l?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...A,ref:i,onPointerMove:pq(q.onPointerMove,ZA(f=>{n?o.onItemLeave(f):(o.onItemEnter(f),f.defaultPrevented||f.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:pq(q.onPointerLeave,ZA(f=>o.onItemLeave(f))),onFocus:pq(q.onFocus,()=>V(!0)),onBlur:pq(q.onBlur,()=>V(!1))})})})}),z1="MenuCheckboxItem",Up=p.forwardRef((q,e)=>{const{checked:t=!1,onCheckedChange:n,...r}=q;return c.jsx(Gp,{scope:q.__scopeMenu,checked:t,children:c.jsx(Ya,{role:"menuitemcheckbox","aria-checked":za(t)?"mixed":t,...r,ref:e,"data-state":rl(t),onSelect:pq(r.onSelect,()=>n?.(za(t)?!0:!t),{checkForDefaultPrevented:!1})})})});Up.displayName=z1;var Rp="MenuRadioGroup",[P1,K1]=br(Rp,{value:void 0,onValueChange:()=>{}}),Op=p.forwardRef((q,e)=>{const{value:t,onValueChange:n,...r}=q,A=Rt(n);return c.jsx(P1,{scope:q.__scopeMenu,value:t,onValueChange:A,children:c.jsx(el,{...r,ref:e})})});Op.displayName=Rp;var Qp="MenuRadioItem",jp=p.forwardRef((q,e)=>{const{value:t,...n}=q,r=K1(Qp,q.__scopeMenu),A=t===r.value;return c.jsx(Gp,{scope:q.__scopeMenu,checked:A,children:c.jsx(Ya,{role:"menuitemradio","aria-checked":A,...n,ref:e,"data-state":rl(A),onSelect:pq(n.onSelect,()=>r.onValueChange?.(t),{checkForDefaultPrevented:!1})})})});jp.displayName=Qp;var tl="MenuItemIndicator",[Gp,J1]=br(tl,{checked:!1}),Fp=p.forwardRef((q,e)=>{const{__scopeMenu:t,forceMount:n,...r}=q,A=J1(tl,t);return c.jsx(Mt,{present:n||za(A.checked)||A.checked===!0,children:c.jsx(Yq.span,{...r,ref:e,"data-state":rl(A.checked)})})});Fp.displayName=tl;var W1="MenuSeparator",Lp=p.forwardRef((q,e)=>{const{__scopeMenu:t,...n}=q;return c.jsx(Yq.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});Lp.displayName=W1;var Z1="MenuArrow",Yp=p.forwardRef((q,e)=>{const{__scopeMenu:t,...n}=q,r=KA(t);return c.jsx(fp,{...r,...n,ref:e})});Yp.displayName=Z1;var nl="MenuSub",[H1,zp]=br(nl),Pp=q=>{const{__scopeMenu:e,children:t,open:n=!1,onOpenChange:r}=q,A=qr(nl,e),o=KA(e),[a,s]=p.useState(null),[i,l]=p.useState(null),V=Rt(r);return p.useEffect(()=>(A.open===!1&&V(!1),()=>V(!1)),[A.open,V]),c.jsx(JV,{...o,children:c.jsx(xp,{scope:e,open:n,onOpenChange:V,content:i,onContentChange:l,children:c.jsx(H1,{scope:e,contentId:en(),triggerId:en(),trigger:a,onTriggerChange:s,children:t})})})};Pp.displayName=nl;var WA="MenuSubTrigger",Kp=p.forwardRef((q,e)=>{const t=qr(WA,q.__scopeMenu),n=JA(WA,q.__scopeMenu),r=zp(WA,q.__scopeMenu),A=$V(WA,q.__scopeMenu),o=p.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:s}=A,i={__scopeMenu:q.__scopeMenu},l=p.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return p.useEffect(()=>l,[l]),p.useEffect(()=>{const V=a.current;return()=>{window.clearTimeout(V),s(null)}},[a,s]),c.jsx(XV,{asChild:!0,...i,children:c.jsx(Dp,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":r.contentId,"data-state":Zp(t.open),...q,ref:Kn(e,r.onTriggerChange),onClick:V=>{q.onClick?.(V),!(q.disabled||V.defaultPrevented)&&(V.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:pq(q.onPointerMove,ZA(V=>{A.onItemEnter(V),!V.defaultPrevented&&!q.disabled&&!t.open&&!o.current&&(A.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{t.onOpenChange(!0),l()},100))})),onPointerLeave:pq(q.onPointerLeave,ZA(V=>{l();const d=t.content?.getBoundingClientRect();if(d){const u=t.content?.dataset.side,f=u==="right",g=f?-5:5,h=d[f?"left":"right"],m=d[f?"right":"left"];A.onPointerGraceIntentChange({area:[{x:V.clientX+g,y:V.clientY},{x:h,y:d.top},{x:m,y:d.top},{x:m,y:d.bottom},{x:h,y:d.bottom}],side:u}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>A.onPointerGraceIntentChange(null),300)}else{if(A.onTriggerLeave(V),V.defaultPrevented)return;A.onPointerGraceIntentChange(null)}})),onKeyDown:pq(q.onKeyDown,V=>{const d=A.searchRef.current!=="";q.disabled||d&&V.key===" "||T1[n.dir].includes(V.key)&&(t.onOpenChange(!0),t.content?.focus(),V.preventDefault())})})})});Kp.displayName=WA;var Jp="MenuSubContent",Wp=p.forwardRef((q,e)=>{const t=kp(bt,q.__scopeMenu),{forceMount:n=t.forceMount,...r}=q,A=qr(bt,q.__scopeMenu),o=JA(bt,q.__scopeMenu),a=zp(Jp,q.__scopeMenu),s=p.useRef(null),i=re(e,s);return c.jsx(PA.Provider,{scope:q.__scopeMenu,children:c.jsx(Mt,{present:n||A.open,children:c.jsx(PA.Slot,{scope:q.__scopeMenu,children:c.jsx(ql,{id:a.contentId,"aria-labelledby":a.triggerId,...r,ref:i,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:l=>{o.isUsingKeyboardRef.current&&s.current?.focus(),l.preventDefault()},onCloseAutoFocus:l=>l.preventDefault(),onFocusOutside:pq(q.onFocusOutside,l=>{l.target!==a.trigger&&A.onOpenChange(!1)}),onEscapeKeyDown:pq(q.onEscapeKeyDown,l=>{o.onClose(),l.preventDefault()}),onKeyDown:pq(q.onKeyDown,l=>{const V=l.currentTarget.contains(l.target),d=B1[o.dir].includes(l.key);V&&d&&(A.onOpenChange(!1),a.trigger?.focus(),l.preventDefault())})})})})})});Wp.displayName=Jp;function Zp(q){return q?"open":"closed"}function za(q){return q==="indeterminate"}function rl(q){return za(q)?"indeterminate":q?"checked":"unchecked"}function X1(q){const e=document.activeElement;for(const t of q)if(t===e||(t.focus(),document.activeElement!==e))return}function _1(q,e){return q.map((t,n)=>q[(e+n)%q.length])}function $1(q,e,t){const r=e.length>1&&Array.from(e).every(i=>i===e[0])?e[0]:e,A=t?q.indexOf(t):-1;let o=_1(q,Math.max(A,0));r.length===1&&(o=o.filter(i=>i!==t));const s=o.find(i=>i.toLowerCase().startsWith(r.toLowerCase()));return s!==t?s:void 0}function qN(q,e){const{x:t,y:n}=q;let r=!1;for(let A=0,o=e.length-1;A<e.length;o=A++){const a=e[A],s=e[o],i=a.x,l=a.y,V=s.x,d=s.y;l>n!=d>n&&t<(V-i)*(n-l)/(d-l)+i&&(r=!r)}return r}function eN(q,e){if(!e)return!1;const t={x:q.clientX,y:q.clientY};return qN(t,e)}function ZA(q){return e=>e.pointerType==="mouse"?q(e):void 0}var tN=Sp,nN=XV,rN=Ip,AN=Tp,oN=el,aN=Bp,sN=Ya,iN=Up,VN=Op,lN=jp,cN=Fp,uN=Lp,dN=Yp,gN=Pp,fN=Kp,pN=Wp,Pa="DropdownMenu",[hN]=Dt(Pa,[bp]),Pe=bp(),[mN,Hp]=hN(Pa),Xp=q=>{const{__scopeDropdownMenu:e,children:t,dir:n,open:r,defaultOpen:A,onOpenChange:o,modal:a=!0}=q,s=Pe(e),i=p.useRef(null),[l,V]=Jn({prop:r,defaultProp:A??!1,onChange:o,caller:Pa});return c.jsx(mN,{scope:e,triggerId:en(),triggerRef:i,contentId:en(),open:l,onOpenChange:V,onOpenToggle:p.useCallback(()=>V(d=>!d),[V]),modal:a,children:c.jsx(tN,{...s,open:l,onOpenChange:V,dir:n,modal:a,children:t})})};Xp.displayName=Pa;var _p="DropdownMenuTrigger",$p=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,disabled:n=!1,...r}=q,A=Hp(_p,t),o=Pe(t);return c.jsx(nN,{asChild:!0,...o,children:c.jsx(Yq.button,{type:"button",id:A.triggerId,"aria-haspopup":"menu","aria-expanded":A.open,"aria-controls":A.open?A.contentId:void 0,"data-state":A.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...r,ref:Kn(e,A.triggerRef),onPointerDown:pq(q.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(A.onOpenToggle(),A.open||a.preventDefault())}),onKeyDown:pq(q.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&A.onOpenToggle(),a.key==="ArrowDown"&&A.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});$p.displayName=_p;var wN="DropdownMenuPortal",qh=q=>{const{__scopeDropdownMenu:e,...t}=q,n=Pe(e);return c.jsx(rN,{...n,...t})};qh.displayName=wN;var eh="DropdownMenuContent",th=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Hp(eh,t),A=Pe(t),o=p.useRef(!1);return c.jsx(AN,{id:r.contentId,"aria-labelledby":r.triggerId,...A,...n,ref:e,onCloseAutoFocus:pq(q.onCloseAutoFocus,a=>{o.current||r.triggerRef.current?.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:pq(q.onInteractOutside,a=>{const s=a.detail.originalEvent,i=s.button===0&&s.ctrlKey===!0,l=s.button===2||i;(!r.modal||l)&&(o.current=!0)}),style:{...q.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});th.displayName=eh;var yN="DropdownMenuGroup",nh=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(oN,{...r,...n,ref:e})});nh.displayName=yN;var vN="DropdownMenuLabel",MN=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(aN,{...r,...n,ref:e})});MN.displayName=vN;var EN="DropdownMenuItem",rh=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(sN,{...r,...n,ref:e})});rh.displayName=EN;var bN="DropdownMenuCheckboxItem",CN=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(iN,{...r,...n,ref:e})});CN.displayName=bN;var xN="DropdownMenuRadioGroup",SN=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(VN,{...r,...n,ref:e})});SN.displayName=xN;var kN="DropdownMenuRadioItem",IN=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(lN,{...r,...n,ref:e})});IN.displayName=kN;var TN="DropdownMenuItemIndicator",BN=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(cN,{...r,...n,ref:e})});BN.displayName=TN;var NN="DropdownMenuSeparator",DN=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(uN,{...r,...n,ref:e})});DN.displayName=NN;var UN="DropdownMenuArrow",RN=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(dN,{...r,...n,ref:e})});RN.displayName=UN;var ON=q=>{const{__scopeDropdownMenu:e,children:t,open:n,onOpenChange:r,defaultOpen:A}=q,o=Pe(e),[a,s]=Jn({prop:n,defaultProp:A??!1,onChange:r,caller:"DropdownMenuSub"});return c.jsx(gN,{...o,open:a,onOpenChange:s,children:t})},QN="DropdownMenuSubTrigger",Ah=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(fN,{...r,...n,ref:e})});Ah.displayName=QN;var jN="DropdownMenuSubContent",oh=p.forwardRef((q,e)=>{const{__scopeDropdownMenu:t,...n}=q,r=Pe(t);return c.jsx(pN,{...r,...n,ref:e,style:{...q.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});oh.displayName=jN;var GN=Xp,FN=$p,LN=qh,YN=th,zN=nh,PN=rh,KN=ON,JN=Ah,WN=oh;function Ka({...q}){return c.jsx(GN,{"data-slot":"dropdown-menu",...q})}function Al({...q}){return q.container=Pn(e=>e.shadowPortal),c.jsx(LN,{"data-slot":"dropdown-menu-portal",...q})}function Ja({...q}){return c.jsx(FN,{"data-slot":"dropdown-menu-trigger",...q})}function Wa({className:q,sideOffset:e=4,...t}){return c.jsx(Al,{children:c.jsx(YN,{"data-slot":"dropdown-menu-content",sideOffset:e,className:Ae("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8em] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",q),...t})})}function ZN({...q}){return c.jsx(zN,{"data-slot":"dropdown-menu-group",...q})}function Vt({className:q,inset:e,variant:t="default",...n}){return c.jsx(PN,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":t,className:Ae("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4",q),...n})}function ah({...q}){return c.jsx(KN,{"data-slot":"dropdown-menu-sub",...q})}function sh({className:q,inset:e,children:t,...n}){return c.jsxs(JN,{"data-slot":"dropdown-menu-sub-trigger","data-inset":e,className:Ae("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",q),...n,children:[t,c.jsx(sI,{className:"ml-auto size-4"})]})}function ih({className:q,...e}){return c.jsx(WN,{"data-slot":"dropdown-menu-sub-content",className:Ae("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8em] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",q),...e})}function HN({title:q="",description:e="",cancelTitle:t="Cancel",actionTitle:n="Confirm",onCancel:r=()=>{},onConfirm:A=()=>{},rootProps:o,triggerElement:a,triggerProps:s,open:i,onOpenChange:l,portalProps:V,overlayProps:d,contentProps:u,headerProps:f,titleProps:g,descriptionProps:h,footerProps:m,cancelProps:w,cancelButtonProps:y,actionProps:v,actionButtonProps:M,...x},b){return c.jsx("div",{ref:b,...x,children:c.jsxs(Ng,{...o,...i!==void 0&&{open:i},...l!==void 0&&{onOpenChange:l},children:[a!=null&&c.jsx(ZS,{asChild:!0,...s,children:a}),c.jsxs(Dg,{...V,children:[c.jsx(Ug,{...d,className:H("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",d?.className)}),c.jsxs(Rg,{...u,className:H("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2em)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",u?.className),children:[c.jsxs("div",{...f,className:H("flex flex-col gap-2 text-center sm:text-left",f?.className),children:[c.jsx(Og,{...g,className:H("text-lg font-semibold",g?.className),children:q}),c.jsx(_S,{...h,className:H("text-muted-foreground text-sm",h?.className),children:e})]}),c.jsxs("div",{...m,className:H("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",m?.className),children:[c.jsx(XS,{...w,onClick:r,children:c.jsx(at,{variant:"outline",...y,children:t})}),c.jsx(HS,{...v,onClick:A,children:c.jsx(at,{...M,children:n})})]})]})]})]})})}const Za=p.forwardRef(HN);Za.displayName="AlertDialog";const XN=()=>{const{t:q}=Qq(),{selectedDialog:e,leaveGroupChat:t}=Jq(),{startVideoCall:n,startAudioCall:r}=XC(),A=fe(h=>h.enableCalls),o=Pn(h=>h.shadowPortal),[a,s]=Qe(Eq(h=>[h.singleView,h.showChatActionsAsMenu])),[i,l]=E.useState(!1),V=A&&e?.type===F.DialogType.PRIVATE,d=!a,u=E.useCallback(()=>{t(),l(!1)},[t]),f=c.jsxs(Ka,{modal:!1,children:[c.jsx(Ja,{className:"group p-2 rounded-full cursor-pointer hover:bg-ring/10 transition-all duration-200 ease-out",children:c.jsx(VI,{className:"text-foreground transition-all duration-200 ease-out group-hover:scale-110 group-hover:rotate-90 group-data-[state=open]:rotate-90 group-data-[state=open]:scale-110"})}),c.jsxs(Wa,{align:"start",className:"transition-all duration-200 ease-out",children:[V&&c.jsxs(c.Fragment,{children:[c.jsxs(Vt,{className:"group cursor-pointer gap-2 transition-all duration-200 ease-out",onClick:r,children:[c.jsx(jA,{className:"text-foreground group-hover:text-blue-700 group-hover:scale-110 transition-all duration-200 ease-out size-5 shrink-0"}),c.jsx("span",{children:q("Call")})]}),c.jsxs(Vt,{className:"group cursor-pointer gap-2 transition-all duration-200 ease-out",onClick:n,children:[c.jsx(bV,{className:"text-foreground group-hover:text-blue-700 group-hover:scale-110 transition-all duration-200 ease-out size-5 shrink-0"}),c.jsx("span",{children:q("Video")})]})]}),d&&c.jsxs(Vt,{className:"group cursor-pointer gap-2 transition-all duration-200 ease-out",onClick:()=>l(!0),children:[c.jsx(EV,{className:"text-foreground group-hover:text-blue-700 group-hover:scale-110 transition-all duration-200 ease-out size-5 shrink-0"}),c.jsx("span",{children:q("ExitChat")})]})]})]}),g=c.jsxs(c.Fragment,{children:[V&&c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"group p-2 rounded-full cursor-pointer hover:bg-ring/10 transition-all duration-200 ease-out",onClick:r,children:c.jsx(jA,{className:"text-foreground group-hover:scale-110 transition-all duration-200 ease-out"})}),c.jsx("button",{className:"group p-2 rounded-full cursor-pointer hover:bg-ring/10 transition-all duration-200 ease-out",onClick:n,children:c.jsx(bV,{className:"text-foreground group-hover:scale-110 transition-all duration-200 ease-out"})})]}),d&&c.jsx("div",{className:"group p-2 rounded-full cursor-pointer hover:bg-ring/10 transition-all duration-200 ease-out",onClick:()=>l(!0),children:c.jsx(EV,{className:"text-foreground group-hover:scale-110 transition-all duration-200 ease-out size-6"})})]});return c.jsxs("div",{className:"flex flex-row",children:[V||d?s?f:g:null,d&&c.jsx(Za,{open:i,onOpenChange:l,onConfirm:u,triggerElement:s?void 0:c.jsx("div",{className:"group p-2 rounded-full cursor-pointer hover:bg-ring/10 transition-all duration-200 ease-out",children:c.jsx(EV,{className:"text-foreground group-hover:scale-110 transition-all duration-200 ease-out size-6"})}),title:q("ExitChat"),description:q("ExitChatConfirm"),cancelTitle:q("Cancel"),actionTitle:q("ExitChat"),portalProps:{container:o},actionButtonProps:{className:"bg-blue-500 hover:bg-blue-700"}})]})},_N=()=>{const{t:q}=Qq(),e=UA(w=>w.showProfile),[t,n]=fe(Eq(w=>[w.enableUserStatuses,w.enableLastSeen])),r=Qe(w=>w.singleView),{users:A,selectedDialog:o,lastActivity:a,getDialogOpponentId:s,unselectDialog:i}=Jq(),l=s(),V=vd(o),d=n&&l&&a[l],u=d==="Online",f=d==="Online"?q("Online"):d,g=V||f,h=t&&l&&u?BA(A[l]):void 0,m=()=>{e(l)};return c.jsxs("div",{className:"flex justify-between relative items-center",children:[c.jsxs("div",{className:"flex items-center relative",children:[!r&&c.jsx(Cf,{onClick:()=>{i()},className:"mr-2 cursor-pointer block min-w-6 size-6"}),c.jsx("div",{className:"flex items-center justify-center mr-3 size-13 rounded-full cursor-pointer",onClick:m,children:c.jsx(An,{src:Nt(o?.photo),name:o?.name,className:`size-13 ${o?.photo?"bg-blue-100":"bg-blue-300"}`,online:u,presence:h})}),c.jsxs("div",{className:"flex flex-col items-start",children:[c.jsx("span",{className:"text-black font-medium cursor-pointer line-clamp-1 break-all",onClick:m,children:o?.name??""}),!r&&c.jsx("div",{className:"flex items-center pt-1 max-h-5",children:c.jsx("span",{className:"text-xs text-gray-500 italic line-clamp-2 min-h-5 text-left leading-none pl-0.5",children:g})})]})]}),c.jsx(XN,{})]})},$N=E.memo(_N);var qD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],eD=qD.reduce((q,e)=>{const t=MV(`Primitive.${e}`),n=p.forwardRef((r,A)=>{const{asChild:o,...a}=r,s=o?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(s,{...a,ref:A})});return n.displayName=`Primitive.${e}`,{...q,[e]:n}},{}),tD="Label",Vh=p.forwardRef((q,e)=>c.jsx(eD.label,{...q,ref:e,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(q.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Vh.displayName=tD;var nD=Vh;function rD({...q},e){return c.jsx(nD,{ref:e,...q,className:H("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",q?.className)})}const Gt=p.forwardRef(rD);Gt.displayName="Label";const AD=(q,e)=>{if(q.length===0)return!1;const t=typeof e=="string"?e.split(/\s*,\s*|\s+/).map(n=>n.toLowerCase().trim()):null;return t===null||t.length===0?!1:q.every(n=>{const{type:r,size:A}=n;if(typeof r!="string"||typeof A!="number"||A<=0||r.length===0)return!1;const o=r.toLowerCase(),[a,s]=o.split("/");return t.some(i=>i.startsWith("*")||i===o||a&&i.endsWith("/*")&&i.startsWith(a)||i.startsWith(".")&&i.slice(1)===s)})},lh=(q,e,t,n,r)=>{const A=Array.from(q||[]).filter(Boolean);if(A.length===0)return;AD(A,e)?n(t?A:A[0]?[A[0]]:[]):r()};function oD({onSelectFile:q=()=>{},onInvalidFile:e=()=>{},multiple:t=!1,accept:n="*/*",iconElement:r,labelProps:A,iconProps:o,...a},s){const i=l=>{lh(l.currentTarget.files,n,t,q,e),l.currentTarget.value=""};return c.jsxs(Gt,{...A,htmlFor:"file-uploader",className:H("group p-2 rounded-full hover:bg-ring/10 transition-all duration-200 ease-out cursor-pointer",A?.className),children:[r||c.jsx(yI,{...o,className:H("text-foreground group-hover:scale-110 transition-all duration-200 ease-out",o?.className)}),c.jsx("input",{ref:s,id:"file-uploader",type:"file",multiple:t,accept:n,onChange:i,...a,className:H("hidden",a?.className)})]})}const ch=p.forwardRef(oD);ch.displayName="FilePickerInput";function aD({onSelectFile:q=()=>{},onInvalidFile:e=()=>{},multiple:t=!1,accept:n="*/*",children:r,iconElement:A,placeholder:o,dropZoneProps:a,placeholderContainerProps:s,iconProps:i,placeholderProps:l,...V},d){const[u,f]=p.useState(!1),g=y=>{y.preventDefault(),y.stopPropagation()},h=y=>{g(y),f(!1),lh(y.dataTransfer.files,n,t,q,e),y.dataTransfer.clearData()},m=y=>{g(y),y.dataTransfer.items&&y.dataTransfer.items.length>0&&f(!0)},w=y=>{y.currentTarget.contains(y.relatedTarget)||f(!1)};return c.jsxs("div",{ref:d,onDragEnter:m,onDragLeave:w,onDragOver:g,...V,className:H("relative size-full min-h-0",V?.className),children:[r,c.jsx("div",{onDrop:h,...a,className:H("absolute top-0 left-0 size-full","flex items-center justify-center","transition-all duration-300 ease-out","border-2 border-dashed border-ring bg-ring/25 rounded-md",u?"opacity-100 pointer-events-auto visible scale-100":"opacity-0 pointer-events-none invisible scale-98",a?.className),children:c.jsxs("div",{...s,className:H("bg-muted flex flex-row items-center gap-2 rounded-full py-2 px-4 transition-all",u?"scale-100":"scale-90",s?.className),children:[A||c.jsx(lI,{absoluteStrokeWidth:!0,...i,className:H("text-ring size-6",i?.className)}),c.jsx("span",{...l,className:H("text-ring text-md font-bold",l?.className),children:o||"Drop files here"})]})})]})}const uh=p.forwardRef(aD);uh.displayName="FilePickerDropzone";var dh="vercel.ai.error",sD=Symbol.for(dh),gh,fh,mq=class TE extends(fh=Error,gh=sD,fh){constructor({name:e,message:t,cause:n}){super(t),this[gh]=!0,this.name=e,this.cause=n}static isInstance(e){return TE.hasMarker(e,dh)}static hasMarker(e,t){const n=Symbol.for(t);return e!=null&&typeof e=="object"&&n in e&&typeof e[n]=="boolean"&&e[n]===!0}},ph="AI_APICallError",hh=`vercel.ai.error.${ph}`,iD=Symbol.for(hh),mh,wh,Ke=class extends(wh=mq,mh=iD,wh){constructor({message:q,url:e,requestBodyValues:t,statusCode:n,responseHeaders:r,responseBody:A,cause:o,isRetryable:a=n!=null&&(n===408||n===409||n===429||n>=500),data:s}){super({name:ph,message:q,cause:o}),this[mh]=!0,this.url=e,this.requestBodyValues=t,this.statusCode=n,this.responseHeaders=r,this.responseBody=A,this.isRetryable=a,this.data=s}static isInstance(q){return mq.hasMarker(q,hh)}},yh="AI_EmptyResponseBodyError",vh=`vercel.ai.error.${yh}`,VD=Symbol.for(vh),Mh,Eh,lD=class extends(Eh=mq,Mh=VD,Eh){constructor({message:q="Empty response body"}={}){super({name:yh,message:q}),this[Mh]=!0}static isInstance(q){return mq.hasMarker(q,vh)}};function HA(q){return q==null?"unknown error":typeof q=="string"?q:q instanceof Error?q.message:JSON.stringify(q)}var bh="AI_InvalidArgumentError",Ch=`vercel.ai.error.${bh}`,cD=Symbol.for(Ch),xh,Sh,kh=class extends(Sh=mq,xh=cD,Sh){constructor({message:e,cause:t,argument:n}){super({name:bh,message:e,cause:t}),this[xh]=!0,this.argument=n}static isInstance(e){return mq.hasMarker(e,Ch)}},Ih="AI_InvalidPromptError",Th=`vercel.ai.error.${Ih}`,uD=Symbol.for(Th),Bh,Nh,qA=class extends(Nh=mq,Bh=uD,Nh){constructor({prompt:q,message:e,cause:t}){super({name:Ih,message:`Invalid prompt: ${e}`,cause:t}),this[Bh]=!0,this.prompt=q}static isInstance(q){return mq.hasMarker(q,Th)}},Dh="AI_JSONParseError",Uh=`vercel.ai.error.${Dh}`,dD=Symbol.for(Uh),Rh,Oh,Ha=class extends(Oh=mq,Rh=dD,Oh){constructor({text:q,cause:e}){super({name:Dh,message:`JSON parsing failed: Text: ${q}.
|
|
62
62
|
Error message: ${HA(e)}`,cause:e}),this[Rh]=!0,this.text=q}static isInstance(q){return mq.hasMarker(q,Uh)}},Qh="AI_LoadAPIKeyError",jh=`vercel.ai.error.${Qh}`,gD=Symbol.for(jh),Gh,Fh,Xa=class extends(Fh=mq,Gh=gD,Fh){constructor({message:q}){super({name:Qh,message:q}),this[Gh]=!0}static isInstance(q){return mq.hasMarker(q,jh)}},Lh="AI_TooManyEmbeddingValuesForCallError",Yh=`vercel.ai.error.${Lh}`,fD=Symbol.for(Yh),zh,Ph,pD=class extends(Ph=mq,zh=fD,Ph){constructor(q){super({name:Lh,message:`Too many values for a single embedding call. The ${q.provider} model "${q.modelId}" can only embed up to ${q.maxEmbeddingsPerCall} values per call, but ${q.values.length} values were provided.`}),this[zh]=!0,this.provider=q.provider,this.modelId=q.modelId,this.maxEmbeddingsPerCall=q.maxEmbeddingsPerCall,this.values=q.values}static isInstance(q){return mq.hasMarker(q,Yh)}},Kh="AI_TypeValidationError",Jh=`vercel.ai.error.${Kh}`,hD=Symbol.for(Jh),Wh,Zh,Cr=class Hc extends(Zh=mq,Wh=hD,Zh){constructor({value:e,cause:t,context:n}){let r="Type validation failed";if(n?.field&&(r+=` for ${n.field}`),n?.entityName||n?.entityId){r+=" (";const A=[];n.entityName&&A.push(n.entityName),n.entityId&&A.push(`id: "${n.entityId}"`),r+=A.join(", "),r+=")"}super({name:Kh,message:`${r}: Value: ${JSON.stringify(e)}.
|
|
63
63
|
Error message: ${HA(t)}`,cause:t}),this[Wh]=!0,this.value=e,this.context=n}static isInstance(e){return mq.hasMarker(e,Jh)}static wrap({value:e,cause:t,context:n}){var r,A,o;return Hc.isInstance(t)&&t.value===e&&((r=t.context)==null?void 0:r.field)===n?.field&&((A=t.context)==null?void 0:A.entityName)===n?.entityName&&((o=t.context)==null?void 0:o.entityId)===n?.entityId?t:new Hc({value:e,cause:t,context:n})}},Hh="AI_UnsupportedFunctionalityError",Xh=`vercel.ai.error.${Hh}`,mD=Symbol.for(Xh),_h,$h,ol=class extends($h=mq,_h=mD,$h){constructor({functionality:q,message:e=`'${q}' functionality not supported.`}){super({name:Hh,message:e}),this[_h]=!0,this.functionality=q}static isInstance(q){return mq.hasMarker(q,Xh)}};function P(q,e,t){function n(a,s){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:s,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(q))return;a._zod.traits.add(q),e(a,s);const i=o.prototype,l=Object.keys(i);for(let V=0;V<l.length;V++){const d=l[V];d in a||(a[d]=i[d].bind(a))}}const r=t?.Parent??Object;class A extends r{}Object.defineProperty(A,"name",{value:q});function o(a){var s;const i=t?.Parent?new A:this;n(i,a),(s=i._zod).deferred??(s.deferred=[]);for(const l of i._zod.deferred)l();return i}return Object.defineProperty(o,"init",{value:n}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>t?.Parent&&a instanceof t.Parent?!0:a?._zod?.traits?.has(q)}),Object.defineProperty(o,"name",{value:q}),o}class eA extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class qm extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const em={};function er(q){return em}function tm(q){const e=Object.values(q).filter(n=>typeof n=="number");return Object.entries(q).filter(([n,r])=>e.indexOf(+n)===-1).map(([n,r])=>r)}function al(q,e){return typeof e=="bigint"?e.toString():e}function _a(q){return{get value(){{const e=q();return Object.defineProperty(this,"value",{value:e}),e}}}}function sl(q){return q==null}function il(q){const e=q.startsWith("^")?1:0,t=q.endsWith("$")?q.length-1:q.length;return q.slice(e,t)}function wD(q,e){const t=(q.toString().split(".")[1]||"").length,n=e.toString();let r=(n.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(n)){const s=n.match(/\d?e-(\d?)/);s?.[1]&&(r=Number.parseInt(s[1]))}const A=t>r?t:r,o=Number.parseInt(q.toFixed(A).replace(".","")),a=Number.parseInt(e.toFixed(A).replace(".",""));return o%a/10**A}const nm=Symbol("evaluating");function Rq(q,e,t){let n;Object.defineProperty(q,e,{get(){if(n!==nm)return n===void 0&&(n=nm,n=t()),n},set(r){Object.defineProperty(q,e,{value:r})},configurable:!0})}function xr(q,e,t){Object.defineProperty(q,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function tr(...q){const e={};for(const t of q){const n=Object.getOwnPropertyDescriptors(t);Object.assign(e,n)}return Object.defineProperties({},e)}function rm(q){return JSON.stringify(q)}function yD(q){return q.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Am="captureStackTrace"in Error?Error.captureStackTrace:(...q)=>{};function XA(q){return typeof q=="object"&&q!==null&&!Array.isArray(q)}const vD=_a(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const q=Function;return new q(""),!0}catch{return!1}});function tA(q){if(XA(q)===!1)return!1;const e=q.constructor;if(e===void 0||typeof e!="function")return!0;const t=e.prototype;return!(XA(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function om(q){return tA(q)?{...q}:Array.isArray(q)?[...q]:q}const MD=new Set(["string","number","symbol"]);function nA(q){return q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function nr(q,e,t){const n=new q._zod.constr(e??q._zod.def);return(!e||t?.parent)&&(n._zod.parent=q),n}function uq(q){const e=q;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function ED(q){return Object.keys(q).filter(e=>q[e]._zod.optin==="optional"&&q[e]._zod.optout==="optional")}const bD={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function CD(q,e){const t=q._zod.def,n=t.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const A=tr(q._zod.def,{get shape(){const o={};for(const a in e){if(!(a in t.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(o[a]=t.shape[a])}return xr(this,"shape",o),o},checks:[]});return nr(q,A)}function xD(q,e){const t=q._zod.def,n=t.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const A=tr(q._zod.def,{get shape(){const o={...q._zod.def.shape};for(const a in e){if(!(a in t.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete o[a]}return xr(this,"shape",o),o},checks:[]});return nr(q,A)}function SD(q,e){if(!tA(e))throw new Error("Invalid input to extend: expected a plain object");const t=q._zod.def.checks;if(t&&t.length>0){const A=q._zod.def.shape;for(const o in e)if(Object.getOwnPropertyDescriptor(A,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=tr(q._zod.def,{get shape(){const A={...q._zod.def.shape,...e};return xr(this,"shape",A),A}});return nr(q,r)}function kD(q,e){if(!tA(e))throw new Error("Invalid input to safeExtend: expected a plain object");const t=tr(q._zod.def,{get shape(){const n={...q._zod.def.shape,...e};return xr(this,"shape",n),n}});return nr(q,t)}function ID(q,e){const t=tr(q._zod.def,{get shape(){const n={...q._zod.def.shape,...e._zod.def.shape};return xr(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:[]});return nr(q,t)}function TD(q,e,t){const r=e._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=tr(e._zod.def,{get shape(){const a=e._zod.def.shape,s={...a};if(t)for(const i in t){if(!(i in a))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(s[i]=q?new q({type:"optional",innerType:a[i]}):a[i])}else for(const i in a)s[i]=q?new q({type:"optional",innerType:a[i]}):a[i];return xr(this,"shape",s),s},checks:[]});return nr(e,o)}function BD(q,e,t){const n=tr(e._zod.def,{get shape(){const r=e._zod.def.shape,A={...r};if(t)for(const o in t){if(!(o in A))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(A[o]=new q({type:"nonoptional",innerType:r[o]}))}else for(const o in r)A[o]=new q({type:"nonoptional",innerType:r[o]});return xr(this,"shape",A),A}});return nr(e,n)}function rA(q,e=0){if(q.aborted===!0)return!0;for(let t=e;t<q.issues.length;t++)if(q.issues[t]?.continue!==!0)return!0;return!1}function AA(q,e){return e.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(q),t})}function $a(q){return typeof q=="string"?q:q?.message}function rr(q,e,t){const n={...q,path:q.path??[]};if(!q.message){const r=$a(q.inst?._zod.def?.error?.(q))??$a(e?.error?.(q))??$a(t.customError?.(q))??$a(t.localeError?.(q))??"Invalid input";n.message=r}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}function Vl(q){return Array.isArray(q)?"array":typeof q=="string"?"string":"unknown"}function _A(...q){const[e,t,n]=q;return typeof e=="string"?{message:e,code:"custom",input:t,inst:n}:{...e}}const am=(q,e)=>{q.name="$ZodError",Object.defineProperty(q,"_zod",{value:q._zod,enumerable:!1}),Object.defineProperty(q,"issues",{value:e,enumerable:!1}),q.message=JSON.stringify(e,al,2),Object.defineProperty(q,"toString",{value:()=>q.message,enumerable:!1})},sm=P("$ZodError",am),im=P("$ZodError",am,{Parent:Error});function ND(q,e=t=>t.message){const t={},n=[];for(const r of q.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}function DD(q,e=t=>t.message){const t={_errors:[]},n=r=>{for(const A of r.issues)if(A.code==="invalid_union"&&A.errors.length)A.errors.map(o=>n({issues:o}));else if(A.code==="invalid_key")n({issues:A.issues});else if(A.code==="invalid_element")n({issues:A.issues});else if(A.path.length===0)t._errors.push(e(A));else{let o=t,a=0;for(;a<A.path.length;){const s=A.path[a];a===A.path.length-1?(o[s]=o[s]||{_errors:[]},o[s]._errors.push(e(A))):o[s]=o[s]||{_errors:[]},o=o[s],a++}}};return n(q),t}const ll=q=>(e,t,n,r)=>{const A=n?Object.assign(n,{async:!1}):{async:!1},o=e._zod.run({value:t,issues:[]},A);if(o instanceof Promise)throw new eA;if(o.issues.length){const a=new(r?.Err??q)(o.issues.map(s=>rr(s,A,er())));throw Am(a,r?.callee),a}return o.value},cl=q=>async(e,t,n,r)=>{const A=n?Object.assign(n,{async:!0}):{async:!0};let o=e._zod.run({value:t,issues:[]},A);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new(r?.Err??q)(o.issues.map(s=>rr(s,A,er())));throw Am(a,r?.callee),a}return o.value},qs=q=>(e,t,n)=>{const r=n?{...n,async:!1}:{async:!1},A=e._zod.run({value:t,issues:[]},r);if(A instanceof Promise)throw new eA;return A.issues.length?{success:!1,error:new(q??sm)(A.issues.map(o=>rr(o,r,er())))}:{success:!0,data:A.value}},UD=qs(im),es=q=>async(e,t,n)=>{const r=n?Object.assign(n,{async:!0}):{async:!0};let A=e._zod.run({value:t,issues:[]},r);return A instanceof Promise&&(A=await A),A.issues.length?{success:!1,error:new q(A.issues.map(o=>rr(o,r,er())))}:{success:!0,data:A.value}},RD=es(im),OD=q=>(e,t,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ll(q)(e,t,r)},QD=q=>(e,t,n)=>ll(q)(e,t,n),jD=q=>async(e,t,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return cl(q)(e,t,r)},GD=q=>async(e,t,n)=>cl(q)(e,t,n),FD=q=>(e,t,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return qs(q)(e,t,r)},LD=q=>(e,t,n)=>qs(q)(e,t,n),YD=q=>async(e,t,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return es(q)(e,t,r)},zD=q=>async(e,t,n)=>es(q)(e,t,n),PD=/^[cC][^\s-]{8,}$/,KD=/^[0-9a-z]+$/,JD=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,WD=/^[0-9a-vA-V]{20}$/,ZD=/^[A-Za-z0-9]{27}$/,HD=/^[a-zA-Z0-9_-]{21}$/,XD=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,_D=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Vm=q=>q?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${q}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,$D=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,qU="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function eU(){return new RegExp(qU,"u")}const tU=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nU=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,rU=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,AU=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,oU=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,lm=/^[A-Za-z0-9_-]*$/,aU=/^\+[1-9]\d{6,14}$/,cm="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",sU=new RegExp(`^${cm}$`);function um(q){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof q.precision=="number"?q.precision===-1?`${e}`:q.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${q.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function iU(q){return new RegExp(`^${um(q)}$`)}function VU(q){const e=um({precision:q.precision}),t=["Z"];q.local&&t.push(""),q.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${e}(?:${t.join("|")})`;return new RegExp(`^${cm}T(?:${n})$`)}const lU=q=>{const e=q?`[\\s\\S]{${q?.minimum??0},${q?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},cU=/^-?\d+$/,dm=/^-?\d+(?:\.\d+)?$/,uU=/^(?:true|false)$/i,dU=/^null$/i,gU=/^[^A-Z]*$/,fU=/^[^a-z]*$/,lt=P("$ZodCheck",(q,e)=>{var t;q._zod??(q._zod={}),q._zod.def=e,(t=q._zod).onattach??(t.onattach=[])}),gm={number:"number",bigint:"bigint",object:"date"},fm=P("$ZodCheckLessThan",(q,e)=>{lt.init(q,e);const t=gm[typeof e.value];q._zod.onattach.push(n=>{const r=n._zod.bag,A=(e.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<A&&(e.inclusive?r.maximum=e.value:r.exclusiveMaximum=e.value)}),q._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:t,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:q,continue:!e.abort})}}),pm=P("$ZodCheckGreaterThan",(q,e)=>{lt.init(q,e);const t=gm[typeof e.value];q._zod.onattach.push(n=>{const r=n._zod.bag,A=(e.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>A&&(e.inclusive?r.minimum=e.value:r.exclusiveMinimum=e.value)}),q._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:t,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:q,continue:!e.abort})}}),pU=P("$ZodCheckMultipleOf",(q,e)=>{lt.init(q,e),q._zod.onattach.push(t=>{var n;(n=t._zod.bag).multipleOf??(n.multipleOf=e.value)}),q._zod.check=t=>{if(typeof t.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%e.value===BigInt(0):wD(t.value,e.value)===0)||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:e.value,input:t.value,inst:q,continue:!e.abort})}}),hU=P("$ZodCheckNumberFormat",(q,e)=>{lt.init(q,e),e.format=e.format||"float64";const t=e.format?.includes("int"),n=t?"int":"number",[r,A]=bD[e.format];q._zod.onattach.push(o=>{const a=o._zod.bag;a.format=e.format,a.minimum=r,a.maximum=A,t&&(a.pattern=cU)}),q._zod.check=o=>{const a=o.value;if(t){if(!Number.isInteger(a)){o.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:a,inst:q});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:q,origin:n,inclusive:!0,continue:!e.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:q,origin:n,inclusive:!0,continue:!e.abort});return}}a<r&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:r,inclusive:!0,inst:q,continue:!e.abort}),a>A&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:A,inclusive:!0,inst:q,continue:!e.abort})}}),mU=P("$ZodCheckMaxLength",(q,e)=>{var t;lt.init(q,e),(t=q._zod.def).when??(t.when=n=>{const r=n.value;return!sl(r)&&r.length!==void 0}),q._zod.onattach.push(n=>{const r=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(n._zod.bag.maximum=e.maximum)}),q._zod.check=n=>{const r=n.value;if(r.length<=e.maximum)return;const o=Vl(r);n.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:q,continue:!e.abort})}}),wU=P("$ZodCheckMinLength",(q,e)=>{var t;lt.init(q,e),(t=q._zod.def).when??(t.when=n=>{const r=n.value;return!sl(r)&&r.length!==void 0}),q._zod.onattach.push(n=>{const r=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(n._zod.bag.minimum=e.minimum)}),q._zod.check=n=>{const r=n.value;if(r.length>=e.minimum)return;const o=Vl(r);n.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:q,continue:!e.abort})}}),yU=P("$ZodCheckLengthEquals",(q,e)=>{var t;lt.init(q,e),(t=q._zod.def).when??(t.when=n=>{const r=n.value;return!sl(r)&&r.length!==void 0}),q._zod.onattach.push(n=>{const r=n._zod.bag;r.minimum=e.length,r.maximum=e.length,r.length=e.length}),q._zod.check=n=>{const r=n.value,A=r.length;if(A===e.length)return;const o=Vl(r),a=A>e.length;n.issues.push({origin:o,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:q,continue:!e.abort})}}),ts=P("$ZodCheckStringFormat",(q,e)=>{var t,n;lt.init(q,e),q._zod.onattach.push(r=>{const A=r._zod.bag;A.format=e.format,e.pattern&&(A.patterns??(A.patterns=new Set),A.patterns.add(e.pattern))}),e.pattern?(t=q._zod).check??(t.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:e.format,input:r.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:q,continue:!e.abort})}):(n=q._zod).check??(n.check=()=>{})}),vU=P("$ZodCheckRegex",(q,e)=>{ts.init(q,e),q._zod.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:e.pattern.toString(),inst:q,continue:!e.abort})}}),MU=P("$ZodCheckLowerCase",(q,e)=>{e.pattern??(e.pattern=gU),ts.init(q,e)}),EU=P("$ZodCheckUpperCase",(q,e)=>{e.pattern??(e.pattern=fU),ts.init(q,e)}),bU=P("$ZodCheckIncludes",(q,e)=>{lt.init(q,e);const t=nA(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=n,q._zod.onattach.push(r=>{const A=r._zod.bag;A.patterns??(A.patterns=new Set),A.patterns.add(n)}),q._zod.check=r=>{r.value.includes(e.includes,e.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:r.value,inst:q,continue:!e.abort})}}),CU=P("$ZodCheckStartsWith",(q,e)=>{lt.init(q,e);const t=new RegExp(`^${nA(e.prefix)}.*`);e.pattern??(e.pattern=t),q._zod.onattach.push(n=>{const r=n._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(t)}),q._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:q,continue:!e.abort})}}),xU=P("$ZodCheckEndsWith",(q,e)=>{lt.init(q,e);const t=new RegExp(`.*${nA(e.suffix)}$`);e.pattern??(e.pattern=t),q._zod.onattach.push(n=>{const r=n._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(t)}),q._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:q,continue:!e.abort})}}),SU=P("$ZodCheckOverwrite",(q,e)=>{lt.init(q,e),q._zod.check=t=>{t.value=e.tx(t.value)}});class kU{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const n=e.split(`
|
|
64
64
|
`).filter(o=>o),r=Math.min(...n.map(o=>o.length-o.trimStart().length)),A=n.map(o=>o.slice(r)).map(o=>" ".repeat(this.indent*2)+o);for(const o of A)this.content.push(o)}compile(){const e=Function,t=this?.args,r=[...(this?.content??[""]).map(A=>` ${A}`)];return new e(...t,r.join(`
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@connectycube/chat-widget",
|
|
3
3
|
"description": "A customizable React chat widget built on the ConnectyCube platform, enabling real-time messaging, calls, and user engagement in any web app.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.40.0",
|
|
5
5
|
"license": "GPL-3.0-only",
|
|
6
6
|
"homepage": "https://github.com/ConnectyCube/connectycube-chat-widget/chat-widget#readme",
|
|
7
7
|
"bugs": {
|