Scripts/resources/[sna]/sna-sync/nui/label-979d47e9.js
2024-12-29 21:01:18 +01:00

2 lines
40 KiB
JavaScript

import{r as l,$ as G,b as _e,j as k,o as st,d as Ut}from"./index-f45b8810.js";import{P as z}from"./fetch.client-5aab1c76.js";var Vt=["color","size","title"];function Ae(){return Ae=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ae.apply(this,arguments)}function Kt(e,t){if(e==null)return{};var n=Xt(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function Xt(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var Me=l.forwardRef(function(e,t){var n=e.color,o=e.size,r=e.title,i=Kt(e,Vt);return G.createElement("svg",Ae({ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:o,height:o,fill:n},i),r?G.createElement("title",null,r):null,G.createElement("path",{d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"}))});Me.propTypes={color:z.string,size:z.oneOfType([z.string,z.number]),title:z.string};Me.defaultProps={color:"currentColor",size:"1em",title:null};const Yt=Me;var qt=["color","size","title"];function Re(){return Re=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Re.apply(this,arguments)}function Zt(e,t){if(e==null)return{};var n=Gt(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function Gt(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var ke=l.forwardRef(function(e,t){var n=e.color,o=e.size,r=e.title,i=Zt(e,qt);return G.createElement("svg",Re({ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:o,height:o,fill:n},i),r?G.createElement("title",null,r):null,G.createElement("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),G.createElement("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"}))});ke.propTypes={color:z.string,size:z.oneOfType([z.string,z.number]),title:z.string};ke.defaultProps={color:"currentColor",size:"1em",title:null};const Jt=ke;function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},H.apply(this,arguments)}function F(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function ct(e,t=[]){let n=[];function o(i,s){const a=l.createContext(s),c=n.length;n=[...n,s];function f(u){const{scope:h,children:d,...m}=u,g=(h==null?void 0:h[e][c])||a,w=l.useMemo(()=>m,Object.values(m));return l.createElement(g.Provider,{value:w},d)}function p(u,h){const d=(h==null?void 0:h[e][c])||a,m=l.useContext(d);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${u}\` must be used within \`${i}\``)}return f.displayName=i+"Provider",[f,p]}const r=()=>{const i=n.map(s=>l.createContext(s));return function(a){const c=(a==null?void 0:a[e])||i;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return r.scopeName=e,[o,Qt(r,...t)]}function Qt(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const s=o.reduce((a,{useScope:c,scopeName:f})=>{const u=c(i)[`__scope${f}`];return{...a,...u}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function ne(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>(...n)=>{var o;return(o=t.current)===null||o===void 0?void 0:o.call(t,...n)},[])}function en({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,r]=tn({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:o,a=ne(n),c=l.useCallback(f=>{if(i){const u=typeof f=="function"?f(e):f;u!==e&&a(u)}else r(f)},[i,e,r,a]);return[s,c]}function tn({defaultProp:e,onChange:t}){const n=l.useState(e),[o]=n,r=l.useRef(o),i=ne(t);return l.useEffect(()=>{r.current!==o&&(i(o),r.current=o)},[o,r,i]),n}function nn(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function at(...e){return t=>e.forEach(n=>nn(n,t))}function ae(...e){return l.useCallback(at(...e),e)}const on=["top","right","bottom","left"],Y=Math.min,L=Math.max,ve=Math.round,me=Math.floor,q=e=>({x:e,y:e}),rn={left:"right",right:"left",bottom:"top",top:"bottom"},sn={start:"end",end:"start"};function Se(e,t,n){return L(e,Y(t,n))}function j(e,t){return typeof e=="function"?e(t):e}function B(e){return e.split("-")[0]}function oe(e){return e.split("-")[1]}function Fe(e){return e==="x"?"y":"x"}function He(e){return e==="y"?"height":"width"}function re(e){return["top","bottom"].includes(B(e))?"y":"x"}function Ie(e){return Fe(re(e))}function cn(e,t,n){n===void 0&&(n=!1);const o=oe(e),r=Ie(e),i=He(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=we(s)),[s,we(s)]}function an(e){const t=we(e);return[Te(e),t,Te(t)]}function Te(e){return e.replace(/start|end/g,t=>sn[t])}function ln(e,t,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:o:t?o:r;case"left":case"right":return t?i:s;default:return[]}}function fn(e,t,n,o){const r=oe(e);let i=ln(B(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(Te)))),i}function we(e){return e.replace(/left|right|bottom|top/g,t=>rn[t])}function un(e){return{top:0,right:0,bottom:0,left:0,...e}}function lt(e){return typeof e!="number"?un(e):{top:e,right:e,bottom:e,left:e}}function xe(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function qe(e,t,n){let{reference:o,floating:r}=e;const i=re(t),s=Ie(t),a=He(s),c=B(t),f=i==="y",p=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,h=o[a]/2-r[a]/2;let d;switch(c){case"top":d={x:p,y:o.y-r.height};break;case"bottom":d={x:p,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:u};break;case"left":d={x:o.x-r.width,y:u};break;default:d={x:o.x,y:o.y}}switch(oe(t)){case"start":d[s]-=h*(n&&f?-1:1);break;case"end":d[s]+=h*(n&&f?-1:1);break}return d}const dn=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let f=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:p,y:u}=qe(f,o,c),h=o,d={},m=0;for(let g=0;g<a.length;g++){const{name:w,fn:v}=a[g],{x:y,y:b,data:$,reset:x}=await v({x:p,y:u,initialPlacement:o,placement:h,strategy:r,middlewareData:d,rects:f,platform:s,elements:{reference:e,floating:t}});if(p=y??p,u=b??u,d={...d,[w]:{...d[w],...$}},x&&m<=50){m++,typeof x=="object"&&(x.placement&&(h=x.placement),x.rects&&(f=x.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):x.rects),{x:p,y:u}=qe(f,h,c)),g=-1;continue}}return{x:p,y:u,placement:h,strategy:r,middlewareData:d}};async function se(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:u="floating",altBoundary:h=!1,padding:d=0}=j(t,e),m=lt(d),w=a[h?u==="floating"?"reference":"floating":u],v=xe(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:f,rootBoundary:p,strategy:c})),y=u==="floating"?{...s.floating,x:o,y:r}:s.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),$=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},x=xe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:b,strategy:c}):y);return{top:(v.top-x.top+m.top)/$.y,bottom:(x.bottom-v.bottom+m.bottom)/$.y,left:(v.left-x.left+m.left)/$.x,right:(x.right-v.right+m.right)/$.x}}const Ze=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:a}=t,{element:c,padding:f=0}=j(e,t)||{};if(c==null)return{};const p=lt(f),u={x:n,y:o},h=Ie(r),d=He(h),m=await s.getDimensions(c),g=h==="y",w=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",b=i.reference[d]+i.reference[h]-u[h]-i.floating[d],$=u[h]-i.reference[h],x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let E=x?x[y]:0;(!E||!await(s.isElement==null?void 0:s.isElement(x)))&&(E=a.floating[y]||i.floating[d]);const R=b/2-$/2,O=E/2-m[d]/2-1,S=Y(p[w],O),D=Y(p[v],O),A=S,N=E-m[d]-D,T=E/2-m[d]/2+R,P=Se(A,T,N),C=oe(r)!=null&&T!=P&&i.reference[d]/2-(T<A?S:D)-m[d]/2<0?T<A?A-T:N-T:0;return{[h]:u[h]-C,data:{[h]:P,centerOffset:T-P+C}}}}),pn=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:o,middlewareData:r,rects:i,initialPlacement:s,platform:a,elements:c}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:u,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:m=!0,...g}=j(e,t),w=B(o),v=B(s)===s,y=await(a.isRTL==null?void 0:a.isRTL(c.floating)),b=u||(v||!m?[we(s)]:an(s));!u&&d!=="none"&&b.push(...fn(s,m,d,y));const $=[s,...b],x=await se(t,g),E=[];let R=((n=r.flip)==null?void 0:n.overflows)||[];if(f&&E.push(x[w]),p){const A=cn(o,i,y);E.push(x[A[0]],x[A[1]])}if(R=[...R,{placement:o,overflows:E}],!E.every(A=>A<=0)){var O,S;const A=(((O=r.flip)==null?void 0:O.index)||0)+1,N=$[A];if(N)return{data:{index:A,overflows:R},reset:{placement:N}};let T=(S=R.filter(P=>P.overflows[0]<=0).sort((P,M)=>P.overflows[1]-M.overflows[1])[0])==null?void 0:S.placement;if(!T)switch(h){case"bestFit":{var D;const P=(D=R.map(M=>[M.placement,M.overflows.filter(C=>C>0).reduce((C,K)=>C+K,0)]).sort((M,C)=>M[1]-C[1])[0])==null?void 0:D[0];P&&(T=P);break}case"initialPlacement":T=s;break}if(o!==T)return{reset:{placement:T}}}return{}}}};function Ge(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Je(e){return on.some(t=>e[t]>=0)}const mn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=j(e,t);switch(o){case"referenceHidden":{const i=await se(t,{...r,elementContext:"reference"}),s=Ge(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Je(s)}}}case"escaped":{const i=await se(t,{...r,altBoundary:!0}),s=Ge(i,n.floating);return{data:{escapedOffsets:s,escaped:Je(s)}}}default:return{}}}}};async function hn(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=B(n),a=oe(n),c=re(n)==="y",f=["left","top"].includes(s)?-1:1,p=i&&c?-1:1,u=j(t,e);let{mainAxis:h,crossAxis:d,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&typeof m=="number"&&(d=a==="end"?m*-1:m),c?{x:d*p,y:h*f}:{x:h*f,y:d*p}}const gn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:o}=t,r=await hn(t,e);return{x:n+r.x,y:o+r.y,data:r}}}},vn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:w=>{let{x:v,y}=w;return{x:v,y}}},...c}=j(e,t),f={x:n,y:o},p=await se(t,c),u=re(B(r)),h=Fe(u);let d=f[h],m=f[u];if(i){const w=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=d+p[w],b=d-p[v];d=Se(y,d,b)}if(s){const w=u==="y"?"top":"left",v=u==="y"?"bottom":"right",y=m+p[w],b=m-p[v];m=Se(y,m,b)}const g=a.fn({...t,[h]:d,[u]:m});return{...g,data:{x:g.x-n,y:g.y-o}}}}},wn=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:c=!0,crossAxis:f=!0}=j(e,t),p={x:n,y:o},u=re(r),h=Fe(u);let d=p[h],m=p[u];const g=j(a,t),w=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const b=h==="y"?"height":"width",$=i.reference[h]-i.floating[b]+w.mainAxis,x=i.reference[h]+i.reference[b]-w.mainAxis;d<$?d=$:d>x&&(d=x)}if(f){var v,y;const b=h==="y"?"width":"height",$=["top","left"].includes(B(r)),x=i.reference[u]-i.floating[b]+($&&((v=s.offset)==null?void 0:v[u])||0)+($?0:w.crossAxis),E=i.reference[u]+i.reference[b]+($?0:((y=s.offset)==null?void 0:y[u])||0)-($?w.crossAxis:0);m<x?m=x:m>E&&(m=E)}return{[h]:d,[u]:m}}}},xn=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:r,elements:i}=t,{apply:s=()=>{},...a}=j(e,t),c=await se(t,a),f=B(n),p=oe(n),u=re(n)==="y",{width:h,height:d}=o.floating;let m,g;f==="top"||f==="bottom"?(m=f,g=p===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(g=f,m=p==="end"?"top":"bottom");const w=d-c[m],v=h-c[g],y=!t.middlewareData.shift;let b=w,$=v;if(u){const E=h-c.left-c.right;$=p||y?Y(v,E):E}else{const E=d-c.top-c.bottom;b=p||y?Y(w,E):E}if(y&&!p){const E=L(c.left,0),R=L(c.right,0),O=L(c.top,0),S=L(c.bottom,0);u?$=h-2*(E!==0||R!==0?E+R:L(c.left,c.right)):b=d-2*(O!==0||S!==0?O+S:L(c.top,c.bottom))}await s({...t,availableWidth:$,availableHeight:b});const x=await r.getDimensions(i.floating);return h!==x.width||d!==x.height?{reset:{rects:!0}}:{}}}};function Z(e){return ft(e)?(e.nodeName||"").toLowerCase():"#document"}function _(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function V(e){var t;return(t=(ft(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ft(e){return e instanceof Node||e instanceof _(e).Node}function U(e){return e instanceof Element||e instanceof _(e).Element}function W(e){return e instanceof HTMLElement||e instanceof _(e).HTMLElement}function Qe(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _(e).ShadowRoot}function le(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=I(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function yn(e){return["table","td","th"].includes(Z(e))}function ze(e){const t=We(),n=I(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function bn(e){let t=te(e);for(;W(t)&&!Ee(t);){if(ze(t))return t;t=te(t)}return null}function We(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ee(e){return["html","body","#document"].includes(Z(e))}function I(e){return _(e).getComputedStyle(e)}function Oe(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function te(e){if(Z(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Qe(e)&&e.host||V(e);return Qe(t)?t.host:t}function ut(e){const t=te(e);return Ee(t)?e.ownerDocument?e.ownerDocument.body:e.body:W(t)&&le(t)?t:ut(t)}function ye(e,t){var n;t===void 0&&(t=[]);const o=ut(e),r=o===((n=e.ownerDocument)==null?void 0:n.body),i=_(o);return r?t.concat(i,i.visualViewport||[],le(o)?o:[]):t.concat(o,ye(o))}function dt(e){const t=I(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=W(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=ve(n)!==i||ve(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function je(e){return U(e)?e:e.contextElement}function ee(e){const t=je(e);if(!W(t))return q(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=dt(t);let s=(i?ve(n.width):n.width)/o,a=(i?ve(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const $n=q(0);function pt(e){const t=_(e);return!We()||!t.visualViewport?$n:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function En(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_(e)?!1:t}function J(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=je(e);let s=q(1);t&&(o?U(o)&&(s=ee(o)):s=ee(e));const a=En(i,n,o)?pt(i):q(0);let c=(r.left+a.x)/s.x,f=(r.top+a.y)/s.y,p=r.width/s.x,u=r.height/s.y;if(i){const h=_(i),d=o&&U(o)?_(o):o;let m=h.frameElement;for(;m&&o&&d!==h;){const g=ee(m),w=m.getBoundingClientRect(),v=I(m),y=w.left+(m.clientLeft+parseFloat(v.paddingLeft))*g.x,b=w.top+(m.clientTop+parseFloat(v.paddingTop))*g.y;c*=g.x,f*=g.y,p*=g.x,u*=g.y,c+=y,f+=b,m=_(m).frameElement}}return xe({width:p,height:u,x:c,y:f})}function On(e){let{rect:t,offsetParent:n,strategy:o}=e;const r=W(n),i=V(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=q(1);const c=q(0);if((r||!r&&o!=="fixed")&&((Z(n)!=="body"||le(i))&&(s=Oe(n)),W(n))){const f=J(n);a=ee(n),c.x=f.x+n.clientLeft,c.y=f.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+c.x,y:t.y*a.y-s.scrollTop*a.y+c.y}}function Cn(e){return Array.from(e.getClientRects())}function mt(e){return J(V(e)).left+Oe(e).scrollLeft}function Pn(e){const t=V(e),n=Oe(e),o=e.ownerDocument.body,r=L(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=L(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+mt(e);const a=-n.scrollTop;return I(o).direction==="rtl"&&(s+=L(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}function An(e,t){const n=_(e),o=V(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,c=0;if(r){i=r.width,s=r.height;const f=We();(!f||f&&t==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}return{width:i,height:s,x:a,y:c}}function Rn(e,t){const n=J(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=W(e)?ee(e):q(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=r*i.x,f=o*i.y;return{width:s,height:a,x:c,y:f}}function et(e,t,n){let o;if(t==="viewport")o=An(e,n);else if(t==="document")o=Pn(V(e));else if(U(t))o=Rn(t,n);else{const r=pt(e);o={...t,x:t.x-r.x,y:t.y-r.y}}return xe(o)}function ht(e,t){const n=te(e);return n===t||!U(n)||Ee(n)?!1:I(n).position==="fixed"||ht(n,t)}function Sn(e,t){const n=t.get(e);if(n)return n;let o=ye(e).filter(a=>U(a)&&Z(a)!=="body"),r=null;const i=I(e).position==="fixed";let s=i?te(e):e;for(;U(s)&&!Ee(s);){const a=I(s),c=ze(s);!c&&a.position==="fixed"&&(r=null),(i?!c&&!r:!c&&a.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||le(s)&&!c&&ht(e,s))?o=o.filter(p=>p!==s):r=a,s=te(s)}return t.set(e,o),o}function Tn(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?Sn(t,this._c):[].concat(n),o],a=s[0],c=s.reduce((f,p)=>{const u=et(t,p,r);return f.top=L(u.top,f.top),f.right=Y(u.right,f.right),f.bottom=Y(u.bottom,f.bottom),f.left=L(u.left,f.left),f},et(t,a,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Dn(e){return dt(e)}function Nn(e,t,n){const o=W(t),r=V(t),i=n==="fixed",s=J(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=q(0);if(o||!o&&!i)if((Z(t)!=="body"||le(r))&&(a=Oe(t)),o){const f=J(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else r&&(c.x=mt(r));return{x:s.left+a.scrollLeft-c.x,y:s.top+a.scrollTop-c.y,width:s.width,height:s.height}}function tt(e,t){return!W(e)||I(e).position==="fixed"?null:t?t(e):e.offsetParent}function gt(e,t){const n=_(e);if(!W(e))return n;let o=tt(e,t);for(;o&&yn(o)&&I(o).position==="static";)o=tt(o,t);return o&&(Z(o)==="html"||Z(o)==="body"&&I(o).position==="static"&&!ze(o))?n:o||bn(e)||n}const Ln=async function(e){let{reference:t,floating:n,strategy:o}=e;const r=this.getOffsetParent||gt,i=this.getDimensions;return{reference:Nn(t,await r(n),o),floating:{x:0,y:0,...await i(n)}}};function _n(e){return I(e).direction==="rtl"}const Mn={convertOffsetParentRelativeRectToViewportRelativeRect:On,getDocumentElement:V,getClippingRect:Tn,getOffsetParent:gt,getElementRects:Ln,getClientRects:Cn,getDimensions:Dn,getScale:ee,isElement:U,isRTL:_n};function kn(e,t){let n=null,o;const r=V(e);function i(){clearTimeout(o),n&&n.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const{left:f,top:p,width:u,height:h}=e.getBoundingClientRect();if(a||t(),!u||!h)return;const d=me(p),m=me(r.clientWidth-(f+u)),g=me(r.clientHeight-(p+h)),w=me(f),y={rootMargin:-d+"px "+-m+"px "+-g+"px "+-w+"px",threshold:L(0,Y(1,c))||1};let b=!0;function $(x){const E=x[0].intersectionRatio;if(E!==c){if(!b)return s();E?s(!1,E):o=setTimeout(()=>{s(!1,1e-7)},100)}b=!1}try{n=new IntersectionObserver($,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver($,y)}n.observe(e)}return s(!0),i}function Fn(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,f=je(e),p=r||i?[...f?ye(f):[],...ye(t)]:[];p.forEach(v=>{r&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const u=f&&a?kn(f,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(v=>{let[y]=v;y&&y.target===f&&d&&(d.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{d&&d.observe(t)})),n()}),f&&!c&&d.observe(f),d.observe(t));let m,g=c?J(e):null;c&&w();function w(){const v=J(e);g&&(v.x!==g.x||v.y!==g.y||v.width!==g.width||v.height!==g.height)&&n(),g=v,m=requestAnimationFrame(w)}return n(),()=>{p.forEach(v=>{r&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),u&&u(),d&&d.disconnect(),d=null,c&&cancelAnimationFrame(m)}}const Hn=(e,t,n)=>{const o=new Map,r={platform:Mn,...n},i={...r.platform,_c:o};return dn(e,t,{...r,platform:i})},In=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Ze({element:o.current,padding:r}).fn(n):{}:o?Ze({element:o,padding:r}).fn(n):{}}}};var ge=typeof document<"u"?l.useLayoutEffect:l.useEffect;function be(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(o=n;o--!==0;)if(!be(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!be(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function vt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nt(e,t){const n=vt(e);return Math.round(t*n)/n}function ot(e){const t=l.useRef(e);return ge(()=>{t.current=e}),t}function zn(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:c,open:f}=e,[p,u]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,d]=l.useState(o);be(h,o)||d(o);const[m,g]=l.useState(null),[w,v]=l.useState(null),y=l.useCallback(C=>{C!=E.current&&(E.current=C,g(C))},[g]),b=l.useCallback(C=>{C!==R.current&&(R.current=C,v(C))},[v]),$=i||m,x=s||w,E=l.useRef(null),R=l.useRef(null),O=l.useRef(p),S=ot(c),D=ot(r),A=l.useCallback(()=>{if(!E.current||!R.current)return;const C={placement:t,strategy:n,middleware:h};D.current&&(C.platform=D.current),Hn(E.current,R.current,C).then(K=>{const X={...K,isPositioned:!0};N.current&&!be(O.current,X)&&(O.current=X,_e.flushSync(()=>{u(X)}))})},[h,t,n,D]);ge(()=>{f===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,u(C=>({...C,isPositioned:!1})))},[f]);const N=l.useRef(!1);ge(()=>(N.current=!0,()=>{N.current=!1}),[]),ge(()=>{if($&&(E.current=$),x&&(R.current=x),$&&x){if(S.current)return S.current($,x,A);A()}},[$,x,A,S]);const T=l.useMemo(()=>({reference:E,floating:R,setReference:y,setFloating:b}),[y,b]),P=l.useMemo(()=>({reference:$,floating:x}),[$,x]),M=l.useMemo(()=>{const C={position:n,left:0,top:0};if(!P.floating)return C;const K=nt(P.floating,p.x),X=nt(P.floating,p.y);return a?{...C,transform:"translate("+K+"px, "+X+"px)",...vt(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:X}},[n,a,P.floating,p.x,p.y]);return l.useMemo(()=>({...p,update:A,refs:T,elements:P,floatingStyles:M}),[p,A,T,P,M])}const wt=l.forwardRef((e,t)=>{const{children:n,...o}=e,r=l.Children.toArray(n),i=r.find(jn);if(i){const s=i.props.children,a=r.map(c=>c===i?l.Children.count(s)>1?l.Children.only(null):l.isValidElement(s)?s.props.children:null:c);return l.createElement(De,H({},o,{ref:t}),l.isValidElement(s)?l.cloneElement(s,void 0,a):null)}return l.createElement(De,H({},o,{ref:t}),n)});wt.displayName="Slot";const De=l.forwardRef((e,t)=>{const{children:n,...o}=e;return l.isValidElement(n)?l.cloneElement(n,{...Bn(o,n.props),ref:t?at(t,n.ref):n.ref}):l.Children.count(n)>1?l.Children.only(null):null});De.displayName="SlotClone";const Wn=({children:e})=>l.createElement(l.Fragment,null,e);function jn(e){return l.isValidElement(e)&&e.type===Wn}function Bn(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{i(...a),r(...a)}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}const Un=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ce=Un.reduce((e,t)=>{const n=l.forwardRef((o,r)=>{const{asChild:i,...s}=o,a=i?wt:t;return l.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),l.createElement(a,H({},s,{ref:r}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Vn(e,t){e&&_e.flushSync(()=>e.dispatchEvent(t))}const ce=globalThis!=null&&globalThis.document?l.useLayoutEffect:()=>{};function Kn(e){const[t,n]=l.useState(void 0);return ce(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let s,a;if("borderBoxSize"in i){const c=i.borderBoxSize,f=Array.isArray(c)?c[0]:c;s=f.inlineSize,a=f.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}const xt="Popper",[yt,bt]=ct(xt),[Xn,$t]=yt(xt),Yn=e=>{const{__scopePopper:t,children:n}=e,[o,r]=l.useState(null);return l.createElement(Xn,{scope:t,anchor:o,onAnchorChange:r},n)},qn="PopperAnchor",Zn=l.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=$t(qn,n),s=l.useRef(null),a=ae(t,s);return l.useEffect(()=>{i.onAnchorChange((o==null?void 0:o.current)||s.current)}),o?null:l.createElement(Ce.div,H({},r,{ref:a}))}),Et="PopperContent",[Gn,So]=yt(Et),Jn=l.forwardRef((e,t)=>{var n,o,r,i,s,a,c,f;const{__scopePopper:p,side:u="bottom",sideOffset:h=0,align:d="center",alignOffset:m=0,arrowPadding:g=0,avoidCollisions:w=!0,collisionBoundary:v=[],collisionPadding:y=0,sticky:b="partial",hideWhenDetached:$=!1,updatePositionStrategy:x="optimized",onPlaced:E,...R}=e,O=$t(Et,p),[S,D]=l.useState(null),A=ae(t,ie=>D(ie)),[N,T]=l.useState(null),P=Kn(N),M=(n=P==null?void 0:P.width)!==null&&n!==void 0?n:0,C=(o=P==null?void 0:P.height)!==null&&o!==void 0?o:0,K=u+(d!=="center"?"-"+d:""),X=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},Ve=Array.isArray(v)?v:[v],Dt=Ve.length>0,fe={padding:X,boundary:Ve.filter(Qn),altBoundary:Dt},{refs:Nt,floatingStyles:Ke,placement:Lt,isPositioned:ue,middlewareData:Q}=zn({strategy:"fixed",placement:K,whileElementsMounted:(...ie)=>Fn(...ie,{animationFrame:x==="always"}),elements:{reference:O.anchor},middleware:[gn({mainAxis:h+C,alignmentAxis:m}),w&&vn({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?wn():void 0,...fe}),w&&pn({...fe}),xn({...fe,apply:({elements:ie,rects:Ye,availableWidth:zt,availableHeight:Wt})=>{const{width:jt,height:Bt}=Ye.reference,pe=ie.floating.style;pe.setProperty("--radix-popper-available-width",`${zt}px`),pe.setProperty("--radix-popper-available-height",`${Wt}px`),pe.setProperty("--radix-popper-anchor-width",`${jt}px`),pe.setProperty("--radix-popper-anchor-height",`${Bt}px`)}}),N&&In({element:N,padding:g}),eo({arrowWidth:M,arrowHeight:C}),$&&mn({strategy:"referenceHidden",...fe})]}),[Xe,_t]=Ot(Lt),de=ne(E);ce(()=>{ue&&(de==null||de())},[ue,de]);const Mt=(r=Q.arrow)===null||r===void 0?void 0:r.x,kt=(i=Q.arrow)===null||i===void 0?void 0:i.y,Ft=((s=Q.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[Ht,It]=l.useState();return ce(()=>{S&&It(window.getComputedStyle(S).zIndex)},[S]),l.createElement("div",{ref:Nt.setFloating,"data-radix-popper-content-wrapper":"",style:{...Ke,transform:ue?Ke.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ht,"--radix-popper-transform-origin":[(a=Q.transformOrigin)===null||a===void 0?void 0:a.x,(c=Q.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")},dir:e.dir},l.createElement(Gn,{scope:p,placedSide:Xe,onArrowChange:T,arrowX:Mt,arrowY:kt,shouldHideArrow:Ft},l.createElement(Ce.div,H({"data-side":Xe,"data-align":_t},R,{ref:A,style:{...R.style,animation:ue?void 0:"none",opacity:(f=Q.hide)!==null&&f!==void 0&&f.referenceHidden?0:void 0}}))))});function Qn(e){return e!==null}const eo=e=>({name:"transformOrigin",options:e,fn(t){var n,o,r,i,s;const{placement:a,rects:c,middlewareData:f}=t,u=((n=f.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,h=u?0:e.arrowWidth,d=u?0:e.arrowHeight,[m,g]=Ot(a),w={start:"0%",center:"50%",end:"100%"}[g],v=((o=(r=f.arrow)===null||r===void 0?void 0:r.x)!==null&&o!==void 0?o:0)+h/2,y=((i=(s=f.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+d/2;let b="",$="";return m==="bottom"?(b=u?w:`${v}px`,$=`${-d}px`):m==="top"?(b=u?w:`${v}px`,$=`${c.floating.height+d}px`):m==="right"?(b=`${-d}px`,$=u?w:`${y}px`):m==="left"&&(b=`${c.floating.width+d}px`,$=u?w:`${y}px`),{data:{x:b,y:$}}}});function Ot(e){const[t,n="center"]=e.split("-");return[t,n]}const to=Yn,no=Zn,oo=Jn;function ro(e,t){return l.useReducer((n,o)=>{const r=t[n][o];return r??n},e)}const Ct=e=>{const{present:t,children:n}=e,o=io(t),r=typeof n=="function"?n({present:o.isPresent}):l.Children.only(n),i=ae(o.ref,r.ref);return typeof n=="function"||o.isPresent?l.cloneElement(r,{ref:i}):null};Ct.displayName="Presence";function io(e){const[t,n]=l.useState(),o=l.useRef({}),r=l.useRef(e),i=l.useRef("none"),s=e?"mounted":"unmounted",[a,c]=ro(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{const f=he(o.current);i.current=a==="mounted"?f:"none"},[a]),ce(()=>{const f=o.current,p=r.current;if(p!==e){const h=i.current,d=he(f);e?c("MOUNT"):d==="none"||(f==null?void 0:f.display)==="none"?c("UNMOUNT"):c(p&&h!==d?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),ce(()=>{if(t){const f=u=>{const d=he(o.current).includes(u.animationName);u.target===t&&d&&_e.flushSync(()=>c("ANIMATION_END"))},p=u=>{u.target===t&&(i.current=he(o.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:l.useCallback(f=>{f&&(o.current=getComputedStyle(f)),n(f)},[])}}function he(e){return(e==null?void 0:e.animationName)||"none"}function so(e,t=globalThis==null?void 0:globalThis.document){const n=ne(e);l.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o),()=>t.removeEventListener("keydown",o)},[n,t])}const Ne="dismissableLayer.update",co="dismissableLayer.pointerDownOutside",ao="dismissableLayer.focusOutside";let rt;const lo=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),fo=l.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...f}=e,p=l.useContext(lo),[u,h]=l.useState(null),d=(n=u==null?void 0:u.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,m]=l.useState({}),g=ae(t,O=>h(O)),w=Array.from(p.layers),[v]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),y=w.indexOf(v),b=u?w.indexOf(u):-1,$=p.layersWithOutsidePointerEventsDisabled.size>0,x=b>=y,E=uo(O=>{const S=O.target,D=[...p.branches].some(A=>A.contains(S));!x||D||(i==null||i(O),a==null||a(O),O.defaultPrevented||c==null||c())},d),R=po(O=>{const S=O.target;[...p.branches].some(A=>A.contains(S))||(s==null||s(O),a==null||a(O),O.defaultPrevented||c==null||c())},d);return so(O=>{b===p.layers.size-1&&(r==null||r(O),!O.defaultPrevented&&c&&(O.preventDefault(),c()))},d),l.useEffect(()=>{if(u)return o&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(rt=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(u)),p.layers.add(u),it(),()=>{o&&p.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=rt)}},[u,d,o,p]),l.useEffect(()=>()=>{u&&(p.layers.delete(u),p.layersWithOutsidePointerEventsDisabled.delete(u),it())},[u,p]),l.useEffect(()=>{const O=()=>m({});return document.addEventListener(Ne,O),()=>document.removeEventListener(Ne,O)},[]),l.createElement(Ce.div,H({},f,{ref:g,style:{pointerEvents:$?x?"auto":"none":void 0,...e.style},onFocusCapture:F(e.onFocusCapture,R.onFocusCapture),onBlurCapture:F(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:F(e.onPointerDownCapture,E.onPointerDownCapture)}))});function uo(e,t=globalThis==null?void 0:globalThis.document){const n=ne(e),o=l.useRef(!1),r=l.useRef(()=>{});return l.useEffect(()=>{const i=a=>{if(a.target&&!o.current){let f=function(){Pt(co,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=f,t.addEventListener("click",r.current,{once:!0})):f()}else t.removeEventListener("click",r.current);o.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function po(e,t=globalThis==null?void 0:globalThis.document){const n=ne(e),o=l.useRef(!1);return l.useEffect(()=>{const r=i=>{i.target&&!o.current&&Pt(ao,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function it(){const e=new CustomEvent(Ne);document.dispatchEvent(e)}function Pt(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Vn(r,i):r.dispatchEvent(i)}let Pe;const At="HoverCard",[Rt,To]=ct(At,[bt]),Be=bt(),[mo,Ue]=Rt(At),ho=e=>{const{__scopeHoverCard:t,children:n,open:o,defaultOpen:r,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,c=Be(t),f=l.useRef(0),p=l.useRef(0),u=l.useRef(!1),h=l.useRef(!1),[d=!1,m]=en({prop:o,defaultProp:r,onChange:i}),g=l.useCallback(()=>{clearTimeout(p.current),f.current=window.setTimeout(()=>m(!0),s)},[s,m]),w=l.useCallback(()=>{clearTimeout(f.current),!u.current&&!h.current&&(p.current=window.setTimeout(()=>m(!1),a))},[a,m]),v=l.useCallback(()=>m(!1),[m]);return l.useEffect(()=>()=>{clearTimeout(f.current),clearTimeout(p.current)},[]),l.createElement(mo,{scope:t,open:d,onOpenChange:m,onOpen:g,onClose:w,onDismiss:v,hasSelectionRef:u,isPointerDownOnContentRef:h},l.createElement(to,c,n))},go="HoverCardTrigger",vo=l.forwardRef((e,t)=>{const{__scopeHoverCard:n,...o}=e,r=Ue(go,n),i=Be(n);return l.createElement(no,H({asChild:!0},i),l.createElement(Ce.a,H({"data-state":r.open?"open":"closed"},o,{ref:t,onPointerEnter:F(e.onPointerEnter,$e(r.onOpen)),onPointerLeave:F(e.onPointerLeave,$e(r.onClose)),onFocus:F(e.onFocus,r.onOpen),onBlur:F(e.onBlur,r.onClose),onTouchStart:F(e.onTouchStart,s=>s.preventDefault())})))}),wo="HoverCardPortal",[Do,xo]=Rt(wo,{forceMount:void 0}),Le="HoverCardContent",yo=l.forwardRef((e,t)=>{const n=xo(Le,e.__scopeHoverCard),{forceMount:o=n.forceMount,...r}=e,i=Ue(Le,e.__scopeHoverCard);return l.createElement(Ct,{present:o||i.open},l.createElement(bo,H({"data-state":i.open?"open":"closed"},r,{onPointerEnter:F(e.onPointerEnter,$e(i.onOpen)),onPointerLeave:F(e.onPointerLeave,$e(i.onClose)),ref:t})))}),bo=l.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:s,...a}=e,c=Ue(Le,n),f=Be(n),p=l.useRef(null),u=ae(t,p),[h,d]=l.useState(!1);return l.useEffect(()=>{if(h){const m=document.body;return Pe=m.style.userSelect||m.style.webkitUserSelect,m.style.userSelect="none",m.style.webkitUserSelect="none",()=>{m.style.userSelect=Pe,m.style.webkitUserSelect=Pe}}},[h]),l.useEffect(()=>{if(p.current){const m=()=>{d(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var g;((g=document.getSelection())===null||g===void 0?void 0:g.toString())!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",m),()=>{document.removeEventListener("pointerup",m),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),l.useEffect(()=>{p.current&&$o(p.current).forEach(g=>g.setAttribute("tabindex","-1"))}),l.createElement(fo,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:F(i,m=>{m.preventDefault()}),onDismiss:c.onDismiss},l.createElement(oo,H({},f,a,{onPointerDown:F(a.onPointerDown,m=>{m.currentTarget.contains(m.target)&&d(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:u,style:{...a.style,userSelect:h?"text":void 0,WebkitUserSelect:h?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})))});function $e(e){return t=>t.pointerType==="touch"?void 0:e()}function $o(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}const Eo=ho,Oo=vo,St=yo,Co=Oo;function Po(e){return k.jsx(Eo,{closeDelay:100,openDelay:0,...e})}const Tt=l.forwardRef(({className:e,align:t="center",sideOffset:n=4,pointerEvents:o=!1,...r},i)=>k.jsx(St,{ref:i,align:t,sideOffset:n,className:st(o?"pointer-events-auto":"pointer-events-none","bg-gray-200 dark:border dark:border-secondary dark:bg-tertiary shadow-lg w-full max-w-lg p-3 rounded-md dark:text-white hover-card animate-enter z-50",e),...r}));Tt.displayName=St.displayName;function No(e){return k.jsxs("span",{...e.errorMessageProps,className:"h-full flex items-start gap-1 mt-1 font-medium text-red-500",children:[k.jsx(Yt,{className:"mt-1.5 mr-1","aria-hidden":"true"}),e.errorMessage]})}function Lo(e){const n=Ut.useTranslations("Common")("optionalField"),o=e.element??"label";return l.createElement(o,{...e.labelProps,className:st("mb-1 dark:text-white flex items-center gap-1",e.hiddenLabel&&"sr-only",e.labelClassnames)},k.jsxs(k.Fragment,{children:[e.label," ",e.isOptional?k.jsxs("span",{className:"text-sm italic",children:["(",n,")"]}):null,e.description?k.jsx("span",{className:"ml-1",children:k.jsxs(Po,{children:[k.jsx(Co,{asChild:!0,children:k.jsx(Jt,{width:14,height:14})}),k.jsx(Tt,{pointerEvents:!0,children:e.description})]})}):null]}))}export{No as E,Po as H,Lo as L,Co as a,Tt as b};