UNPKG

@rdsaude/pulso-react-components

Version:

Biblioteca de componentes React do Pulso Design System da RD Saúde oferece componentes consistentes e de alto desempenho, alinhados com os padrões da RDSaúde. Ideal para desenvolver aplicações modernas e acessíveis.

18 lines 188 kB
"use strict";var mf=Object.create;var cr=Object.defineProperty,bf=Object.defineProperties,hf=Object.getOwnPropertyDescriptor,xf=Object.getOwnPropertyDescriptors,vf=Object.getOwnPropertyNames,kr=Object.getOwnPropertySymbols,gf=Object.getPrototypeOf,Lo=Object.prototype.hasOwnProperty,Ia=Object.prototype.propertyIsEnumerable;var Ta=(e,t,r)=>t in e?cr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,h=(e,t)=>{for(var r in t||(t={}))Lo.call(t,r)&&Ta(e,r,t[r]);if(kr)for(var r of kr(t))Ia.call(t,r)&&Ta(e,r,t[r]);return e},v=(e,t)=>bf(e,xf(t));var C=(e,t)=>{var r={};for(var o in e)Lo.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&kr)for(var o of kr(e))t.indexOf(o)<0&&Ia.call(e,o)&&(r[o]=e[o]);return r};var yf=(e,t)=>{for(var r in t)cr(e,r,{get:t[r],enumerable:!0})},$a=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of vf(t))!Lo.call(e,n)&&n!==r&&cr(e,n,{get:()=>t[n],enumerable:!(o=hf(t,n))||o.enumerable});return e};var j=(e,t,r)=>(r=e!=null?mf(gf(e)):{},$a(t||!e||!e.__esModule?cr(r,"default",{value:e,enumerable:!0}):r,e)),Sf=e=>$a(cr({},"__esModule",{value:!0}),e);var ye=(e,t,r)=>new Promise((o,n)=>{var a=l=>{try{i(r.next(l))}catch(c){n(c)}},s=l=>{try{i(r.throw(l))}catch(c){n(c)}},i=l=>l.done?o(l.value):Promise.resolve(l.value).then(a,s);i((r=r.apply(e,t)).next())});var sh={};yf(sh,{Button:()=>D,CardCategory:()=>zp,CardInformative:()=>dp,CardShape:()=>rd,Checkbox:()=>ls,Chips:()=>Zt,Content:()=>Ep,Icon:()=>E,InputMultiSelect:()=>Le,InputSelect:()=>fb,InputText:()=>Ge,Link:()=>Ht,Modal:()=>au,OptionMenu:()=>Ae,Pagination:()=>wc,ProgressIndicator:()=>Pt,Radio:()=>Dc,Refresh:()=>Rt,SearchBar:()=>Gd,Select:()=>wo,Snackbar:()=>Fu,Stepper:()=>va,Switch:()=>xd,Tag:()=>ju,ThemeProvider:()=>Na,Toast:()=>vu});module.exports=Sf(sh);var Fa=require("react"),Ha=require("@radix-ui/react-context");var Ra=require("tailwind-variants"),f=(0,Ra.createTV)({twMergeConfig:{extend:{classGroups:{"font-size":[{text:["threepulse","threeandhalfpulse"]}],"border-width":[{border:["quarterpulse","halfpulse"]}],"--tw-ring-inset":[{ring:["none","quarterpulse","halfpulse"]}]}}}});var Ea=f({base:` tracking inline-flex items-center justify-center gap-twopulse rounded-pill border-quarterpulse border-[transparent] font-bold font-rdmodern text-threeandhalfpulse truncate`,variants:{variant:{"brand-primary":`bg-action-fill-brand-primary-enabled text-text-neutral-inverse enabled:active:bg-action-fill-brand-primary-pressed enabled:hover:bg-action-fill-brand-primary-hovered`,"neutral-secondary":`border-action-border-neutral-secondary-enabled bg-action-fill-neutral-secondary-enabled text-text-neutral enabled:active:border-action-border-neutral-secondary-pressed enabled:active:bg-action-fill-neutral-secondary-pressed enabled:hover:bg-action-fill-neutral-secondary-hovered`,"neutral-tertiary":`border-action-border-neutral-tertiary-enabled bg-action-fill-neutral-tertiary-enabled text-text-neutral enabled:active:bg-action-fill-neutral-tertiary-pressed enabled:hover:bg-action-fill-neutral-tertiary-hovered`},size:{md:"h-medium min-w-medium px-fourpulse text-threepulse leading-medium",ml:"h-mediumlarge min-w-mediumlarge px-fourpulse leading-small",lg:"h-large min-w-large px-fivepulse leading-small",xl:"h-extralarge min-w-extralarge px-sixpulse leading-small"},disabled:{true:"cursor-not-allowed text-text-neutral-disabled outline-none",false:"outline-action-border-focused outline-offset-4 focus-visible:outline-1"},full:{true:"w-full"},asIconOnly:{true:"aspect-square px-none"}},compoundVariants:[{variant:"brand-primary",disabled:!0,class:"border-action-border-brand-primary-disabled bg-action-fill-brand-primary-disabled"},{variant:"neutral-secondary",disabled:!0,class:"border-action-border-neutral-secondary-disabled bg-action-fill-neutral-secondary-disabled"},{variant:"neutral-tertiary",disabled:!0,class:"border-action-fill-neutral-tertiary-disabled bg-action-fill-neutral-tertiary-enabled"}],defaultVariants:{variant:"brand-primary",size:"ml"}});var Se=require("@raiadrogasil/pulso-design-tokens"),ka=require("react");var Ar=require("react"),Oa=require("react/jsx-runtime"),Vo=(0,Ar.createContext)({});function Na({children:e,theme:t}){return(0,Ar.useEffect)(()=>{var r,o;return t&&document&&((o=(r=document==null?void 0:document.documentElement)==null?void 0:r.classList)==null||o.add(t)),()=>{var n,a;(a=(n=document==null?void 0:document.documentElement)==null?void 0:n.classList)==null||a.remove(t)}},[t]),(0,Oa.jsx)(Vo.Provider,{value:{currentTheme:t},children:e})}function et(){let{currentTheme:e}=(0,ka.useContext)(Vo);return h(h({},{rdsaudesistemas:Se.RDSAUDESISTEMAS_TOKENS,drogasil:Se.DROGASIL_TOKENS,raia:Se.RAIA_TOKENS,subscription:Se.SUBSCRIPTION_TOKENS,prime:Se.PRIME_TOKENS}[e]),Se.GLOBALS_TOKENS)}function Aa(e){let t=et();return Object.keys(t).reduce((n,a)=>{if(a.includes("color")){let s=a;n[s]=t[s]}return n},{})[e]}var Ma={tiny:"var(--sizing-tiny)","extra-small":"var(--sizing-extrasmall)",small:"var(--sizing-small)",medium:"var(--sizing-medium)"};var _a=require("react/jsx-runtime");function E(n){var a=n,{symbol:e="rdicon-default",size:t="small",color:r="colorActionFillBrandPrimaryEnabled"}=a,o=C(a,["symbol","size","color"]);let s=e.replace("rdicon","").trim();return(0,_a.jsx)("i",v(h({},o),{title:s,className:e,style:{fontSize:Ma[t],color:Aa(r)}}))}var La=require("react/jsx-runtime");function Mr(e){let l=e,{__scopeButton:t}=l,r=C(l,["__scopeButton"]),{variant:o,size:n,disabled:a}=_r("ButtonIcon",t),s={"brand-primary":"colorTextNeutralInverse","neutral-secondary":"colorTextNeutralDefault","neutral-tertiary":"colorTextNeutralDefault"},i={md:"extra-small",ml:"small",lg:"small",xl:"small"};return(0,La.jsx)(E,v(h({},r),{color:a?"colorTextNeutralDisabled":s[o],size:i[n]}))}function Va(e){let t=et();return{brand:t.colorActionFillBrandPrimaryEnabled,neutral:t.colorTextNeutralReadonly,black:t.colorTextNeutralDefault,white:t.colorTextNeutralInverse}[e]}var $t=require("react/jsx-runtime");function Rt({color:e="brand",srText:t}){return(0,$t.jsx)("div",{role:"status",className:"grid size-eightpulse place-items-center","aria-label":t,children:(0,$t.jsxs)("svg",{className:"size-sixpulse animate-spin fill-none",viewBox:"0 0 24 24",children:[(0,$t.jsx)("path",{fillRule:"evenodd",d:"M0 12c0 6.627 5.373 12 12 12s12-5.373 12-12S18.627 0 12 0v2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12H0z",clipRule:"evenodd",fill:Va(e)}),(0,$t.jsx)("title",{children:t})]})})}var za=require("react/jsx-runtime");function Da(e){let a=e,{__scopeButton:t}=a,r=C(a,["__scopeButton"]),{variant:o}=_r("ButtonRefresh",t),n={"brand-primary":"white","neutral-secondary":"neutral","neutral-tertiary":"black"};return(0,za.jsx)(Rt,v(h({},r),{color:n[o]}))}var Do=j(require("react"),1);function Ba(e){return Do.default.Children.count(e)===1&&Do.default.isValidElement(e)?e.type===Mr:!1}var Lr=require("react/jsx-runtime"),zo="Button",Wa=(0,Fa.forwardRef)((e,t)=>{let{children:r,variant:o="brand-primary",size:n="ml",loading:a=!1,disabled:s=!1,full:i,className:l,__scopeButton:c}=e,u=a||s;return(0,Lr.jsx)(Cf,{scope:c,variant:o,size:n,disabled:s,children:(0,Lr.jsx)("button",v(h({},e),{ref:t,className:Ea({variant:o,size:n,disabled:s,full:i,className:l,asIconOnly:Ba(r)}),disabled:u,"aria-disabled":s,children:a?(0,Lr.jsx)(Da,{}):r}))})});Wa.displayName=zo;var[wf]=(0,Ha.createContextScope)(zo),[Cf,_r]=wf(zo),D={Root:Wa,Icon:Mr};var ae=require("react");var qa=f({base:"flex flex-col items-start justify-center gap-none rounded-pill font-rdmodern",variants:{size:{md:"",ml:"",lg:"",xl:""},hasError:{true:"h-full",false:""},hasReadonly:{true:"border-action-border-neutral-tertiary-readonly border-none bg-action-fill-neutral-tertiary-readonly",false:""},hasDisabled:{true:"border-none bg-action-fill-neutral-tertiary-disabled",false:""}},defaultVariants:{size:"md"}}),Ya=f({base:"flex items-center justify-center",variants:{size:{md:"pr-onepulse",ml:"pr-twopulse",lg:"pr-twopulse",xl:"pr-twopulse"}},defaultVariants:{size:"md",hasLabelText:!0}}),Ua=f({base:"flex items-center justify-center",variants:{size:{md:"h-tiny w-tiny pr-none",ml:"h-small w-small pr-none",lg:"h-medium w-medium pr-none",xl:"h-medium w-medium pr-none"}},defaultVariants:{size:"md"}}),Ga=f({base:`mb-twopulse flex cursor-pointer items-center justify-center rounded-pill p-halfpulse text-text-neutral focus:border-halfpulse focus:bg-action-fill-neutral-tertiary-enabled`,variants:{size:{md:"",ml:"",lg:"",xl:""},hasError:{true:"border-forms-border-error border-halfpulse focus:border-forms-border-error",false:`hover:border-action-border-neutral-tertiary-hovered focus:border-action-border-focused active:bg-action-fill-neutral-tertiary-pressed active:border-action-border-neutral-tertiary-pressed`}},defaultVariants:{size:"md"}}),Ka=f({base:`flex bg-action-fill-neutral-tertiary-enabled rounded-pill min-w-[128px] border-action-border-neutral-tertiary-enabled hover:bg-action-fill-neutral-tertiary-hovered hover:border-action-fill-neutral-tertiary-hovered active:outline-none active:border-action-border-neutral-tertiary-pressed `,variants:{size:{md:"min-h-medium px-fourpulse py-onepulse",ml:"min-h-mediumlarge px-fourpulse py-twopulse",lg:"min-h-large px-fivepulse py-twopulse",xl:"min-h-extralarge px-sixpulse py-threepulse"},hasReadonly:{true:`border-action-border-neutral-tertiary-readonly border-none bg-action-fill-neutral-tertiary-readonly text-text-neutral-readonly hover:bg-action-fill-neutral-tertiary-readonly active:bg-action-fill-neutral-tertiary-readonly`},hasDisabled:{true:`border-action-border-neutral-tertiary-disabled border-none bg-action-fill-neutral-tertiary-disabled text-text-neutral-disabled hover:bg-action-fill-neutral-tertiary-disabled active:bg-action-fill-neutral-tertiary-disabled`},hasError:{true:"h-full",false:""}},defaultVariants:{size:"md"}}),ja=f({base:`w-full flex bg-action-fill-neutral-tertiary-enabled rounded-pill focus:border-action-border-neutral-focused focus:border-halfpulse hover:bg-action-fill-neutral-tertiary-hovered active:bg-action-fill-neutral-tertiary-pressed active:border-action-border-neutral-tertiary-pressed`,variants:{size:{md:"p-twopulse",ml:"p-twopulse",lg:"p-twopulse",xl:"p-threepulse"},hasReadonly:{true:`border-action-border-neutral-tertiary-readonly border-none bg-action-fill-neutral-tertiary-readonly text-text-neutral-readonly hover:bg-action-fill-neutral-tertiary-readonly active:bg-action-fill-neutral-tertiary-readonly`},hasDisabled:{true:`border-action-border-neutral-tertiary-disabled border-none bg-action-fill-neutral-tertiary-disabled text-text-neutral-disabled hover:bg-action-fill-neutral-tertiary-disabled active:bg-action-fill-neutral-tertiary-disabled`},hasError:{true:"h-full",false:""}},defaultVariants:{size:"md"}}),Xa=f({base:"ml-halfpulse flex items-center bg-transparent",variants:{size:{md:"px-fourpulse",ml:"px-fourpulse",lg:"px-fivepulse",xl:"px-sixpulse"},hasError:{true:"font-semibold text-threepulse leading-medium tracking-tiny",false:"font-semibold text-threepulse leading-medium tracking-tiny"}},defaultVariants:{size:"md"}}),Qa=f({base:"flex items-center bg-transparent",variants:{size:{md:"px-threepulse",ml:"px-fourpulse",lg:"px-fivepulse",xl:"px-sixpulse"},hasError:{true:"font-semibold text-text-danger-alternative text-threepulse leading-medium tracking-tiny"}},defaultVariants:{size:"md"}}),Za=f({base:"flex flex-col pl-eightpulse",variants:{size:{md:"",ml:"",lg:"",xl:""}},defaultVariants:{size:"md"}});var Ja=f({base:"line-clamp-4 min-h-small overflow-hidden text-left font-family-modern font-regular text-neutral-default",variants:{size:{md:"pt-halfpulse text-threepulse leading-medium",ml:"pt-halfpulse text-threeandhalfpulse leading-small",lg:"pt-onepulse text-fourpulse leading-small",xl:"pt-onepulse text-fourpulse leading-small"},hasError:{true:"font-semibold"},hasDisabled:{true:"text-neutral-disabled"},hasReadonly:{true:"text-neutral-readonly"}},defaultVariants:{size:"md"}});var es=require("react/jsx-runtime");function Vr({children:e,size:t="md",error:r=!1,disabled:o=!1,readonly:n=!1}){return(0,es.jsx)("span",{className:Ja({size:t,hasError:r,hasDisabled:o,hasReadonly:n}),children:e})}var ts=f({base:"flex flex-row items-center justify-start gap-half-pulse text-ellipsis"}),rs=f({base:"line-clamp-2 pl-onepulse text-left font-family-modern font-semibold text-text-neutral"}),os=f({base:"line-clamp-2 pl-onepulse text-left font-family-modern font-semibold text-text-danger-alternative"});var dr=require("react/jsx-runtime");function Dr({icon:e,children:t,isError:r=!1}){return(0,dr.jsxs)("div",{className:ts(),children:[e&&(0,dr.jsx)(E,{size:"tiny",symbol:e,color:r?"colorTextDangerAlternative":"colorTextNeutralDefault"}),(0,dr.jsx)("span",{className:r?os():rs(),children:t})]})}var we=require("react/jsx-runtime"),Pf="Checkbox",Tf=e=>({md:"tiny",ml:"small",lg:"medium",xl:"medium"})[e]||"medium",ns=({symbol:e,size:t="md",disabled:r,readonly:o,hasLabelText:n})=>{let a=Tf(t),s=n?Ya({size:t}):Ua({size:t});return(0,we.jsx)("div",{className:s,children:(0,we.jsx)(E,{symbol:e,size:a,color:r?"colorTextNeutralDisabled":o?"colorTextNeutralReadonly":"colorTextNeutralDefault"})})},as=({children:e,size:t,disabled:r,readonly:o,error:n})=>{let s=!!ae.Children.toArray(e).find(i=>(0,ae.isValidElement)(i)&&i.type===Vr&&i.props.children)?Ka({size:t,hasDisabled:r,hasReadonly:o,hasError:!!n}):ja({size:t,hasDisabled:r,hasReadonly:o,hasError:!!n});return(0,we.jsx)("div",{className:Ga({size:t,hasError:!!n}),children:(0,we.jsx)("div",{className:s,children:e})})},ss=(0,ae.forwardRef)((e,t)=>{let N=e,{size:r="md",checked:o=!1,indeterminate:n=!1,onClick:a,error:s,disabled:i,readonly:l,children:c,feedbackMessage:u,hasFeedbackMessage:d=!0,icon:x}=N,b=C(N,["size","checked","indeterminate","onClick","error","disabled","readonly","children","feedbackMessage","hasFeedbackMessage","icon"]),g=n?"rdicon-checkbox-indeterminate":o?"rdicon-checkbox-checked":"rdicon-checkbox-unchecked",m=$=>{$.stopPropagation(),!(i||l)&&typeof a=="function"&&a(!o)},p=ae.Children.toArray(c).find($=>(0,ae.isValidElement)($)&&$.type===Vr),w=ae.Children.toArray(c).find($=>(0,ae.isValidElement)($)&&$.type===Dr),y=ae.Children.toArray(c).find($=>(0,ae.isValidElement)($)&&$.type===is),R=b,{feedbackMessage:P}=R,I=C(R,["feedbackMessage"]),O=s||d&&u;return(0,we.jsxs)("div",v(h({ref:t},I),{role:"checkbox","aria-checked":o||n,"aria-disabled":i||l,onClick:m,className:qa({size:r,hasError:!!s,hasDisabled:!!i,hasReadonly:!!l}),children:[(0,we.jsxs)(as,{size:r,disabled:i,readonly:l,error:s,children:[(0,we.jsx)(ns,{symbol:g,size:r,disabled:i,readonly:l,hasLabelText:!!(p!=null&&p.props.children)}),p&&(0,ae.cloneElement)(p,{size:r,disabled:i,readonly:l,error:s})]}),(w||O)&&(0,we.jsx)("div",{className:w!=null&&w.props.children||O?Xa({size:r,hasError:!!s}):Qa({size:r,hasError:!!s}),children:(0,ae.cloneElement)(w||(0,we.jsx)(Dr,{icon:s?"rdicon-warning-circle":x,isError:s,children:u}),{size:r})}),y&&(0,ae.cloneElement)(y,{size:r,disabled:i||l,error:s})]}))}),is=({children:e,size:t="md"})=>(0,we.jsx)("div",{className:Za({size:t}),children:e});ss.displayName=Pf;var ls={Root:ss,Label:Vr,HelperText:Dr,Parent:is,Actions:as,IconCheck:ns};function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)({}).hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},W.apply(null,arguments)}var T=require("react"),yn=require("react-dom");function Bo(e,[t,r]){return Math.min(r,Math.max(t,e))}function ve(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e==null||e(n),r===!1||!n.defaultPrevented)return t==null?void 0:t(n)}}var $e=j(require("react"),1),ds=require("@radix-ui/react-context");var cs=require("react");function If(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function $f(...e){return t=>e.forEach(r=>If(r,t))}function re(...e){return(0,cs.useCallback)($f(...e),e)}var Fo=require("@radix-ui/react-slot");function us(e){let t=e+"CollectionProvider",[r,o]=(0,ds.createContextScope)(t),[n,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=b=>{let{scope:g,children:m}=b,p=$e.default.useRef(null),w=$e.default.useRef(new Map).current;return $e.default.createElement(n,{scope:g,itemMap:w,collectionRef:p},m)},i=e+"CollectionSlot",l=$e.default.forwardRef((b,g)=>{let{scope:m,children:p}=b,w=a(i,m),y=re(g,w.collectionRef);return $e.default.createElement(Fo.Slot,{ref:y},p)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",d=$e.default.forwardRef((b,g)=>{let I=b,{scope:m,children:p}=I,w=C(I,["scope","children"]),y=$e.default.useRef(null),S=re(g,y),P=a(c,m);return $e.default.useEffect(()=>(P.itemMap.set(y,h({ref:y},w)),()=>void P.itemMap.delete(y))),$e.default.createElement(Fo.Slot,{[u]:"",ref:S},p)});function x(b){let g=a(e+"CollectionConsumer",b);return $e.default.useCallback(()=>{let p=g.collectionRef.current;if(!p)return[];let w=Array.from(p.querySelectorAll(`[${u}]`));return Array.from(g.itemMap.values()).sort((P,I)=>w.indexOf(P.ref.current)-w.indexOf(I.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},x,o]}var il=require("@radix-ui/react-context");var ur=require("react"),Rf=(0,ur.createContext)(void 0);function ps(e){let t=(0,ur.useContext)(Rf);return e||t||"ltr"}var Z=require("react");function zr(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e==null||e(n),r===!1||!n.defaultPrevented)return t==null?void 0:t(n)}}var Et=require("react"),fs=require("react-dom"),ms=require("@radix-ui/react-slot");var Ef=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],oe=Ef.reduce((e,t)=>{let r=(0,Et.forwardRef)((o,n)=>{let l=o,{asChild:a}=l,s=C(l,["asChild"]),i=a?ms.Slot:t;return(0,Et.useEffect)(()=>{window[Symbol.for("radix-ui")]=!0},[]),(0,Et.createElement)(i,W({},s,{ref:n}))});return r.displayName=`Primitive.${t}`,v(h({},e),{[t]:r})},{});function bs(e,t){e&&(0,fs.flushSync)(()=>e.dispatchEvent(t))}var Nt=require("react");function de(e){let t=(0,Nt.useRef)(e);return(0,Nt.useEffect)(()=>{t.current=e}),(0,Nt.useMemo)(()=>(...r)=>{var o;return(o=t.current)===null||o===void 0?void 0:o.call(t,...r)},[])}var hs=require("react");function xs(e,t=globalThis==null?void 0:globalThis.document){let r=de(e);(0,hs.useEffect)(()=>{let o=n=>{n.key==="Escape"&&r(n)};return t.addEventListener("keydown",o),()=>t.removeEventListener("keydown",o)},[r,t])}var Ho="dismissableLayer.update",Nf="dismissableLayer.pointerDownOutside",Of="dismissableLayer.focusOutside",vs,kf=(0,Z.createContext)({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ys=(0,Z.forwardRef)((e,t)=>{var r;let R=e,{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:i,onDismiss:l}=R,c=C(R,["disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss"]),u=(0,Z.useContext)(kf),[d,x]=(0,Z.useState)(null),b=(r=d==null?void 0:d.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,g]=(0,Z.useState)({}),m=re(t,$=>x($)),p=Array.from(u.layers),[w]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(w),S=d?p.indexOf(d):-1,P=u.layersWithOutsidePointerEventsDisabled.size>0,I=S>=y,O=Af($=>{let V=$.target,z=[...u.branches].some(B=>B.contains(V));!I||z||(a==null||a($),i==null||i($),$.defaultPrevented||l==null||l())},b),N=Mf($=>{let V=$.target;[...u.branches].some(B=>B.contains(V))||(s==null||s($),i==null||i($),$.defaultPrevented||l==null||l())},b);return xs($=>{S===u.layers.size-1&&(n==null||n($),!$.defaultPrevented&&l&&($.preventDefault(),l()))},b),(0,Z.useEffect)(()=>{if(d)return o&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(vs=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),gs(),()=>{o&&u.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=vs)}},[d,b,o,u]),(0,Z.useEffect)(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),gs())},[d,u]),(0,Z.useEffect)(()=>{let $=()=>g({});return document.addEventListener(Ho,$),()=>document.removeEventListener(Ho,$)},[]),(0,Z.createElement)(oe.div,W({},c,{ref:m,style:h({pointerEvents:P?I?"auto":"none":void 0},e.style),onFocusCapture:zr(e.onFocusCapture,N.onFocusCapture),onBlurCapture:zr(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:zr(e.onPointerDownCapture,O.onPointerDownCapture)}))});function Af(e,t=globalThis==null?void 0:globalThis.document){let r=de(e),o=(0,Z.useRef)(!1),n=(0,Z.useRef)(()=>{});return(0,Z.useEffect)(()=>{let a=i=>{if(i.target&&!o.current){let u=function(){Ss(Nf,r,c,{discrete:!0})};var l=u;let c={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",n.current),n.current=u,t.addEventListener("click",n.current,{once:!0})):u()}o.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",a),t.removeEventListener("click",n.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function Mf(e,t=globalThis==null?void 0:globalThis.document){let r=de(e),o=(0,Z.useRef)(!1);return(0,Z.useEffect)(()=>{let n=a=>{a.target&&!o.current&&Ss(Of,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",n),()=>t.removeEventListener("focusin",n)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function gs(){let e=new CustomEvent(Ho);document.dispatchEvent(e)}function Ss(e,t,r,{discrete:o}){let n=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),o?bs(n,a):n.dispatchEvent(a)}var Cs=require("react"),Wo=0;function Ps(){(0,Cs.useEffect)(()=>{var e,t;let r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=r[0])!==null&&e!==void 0?e:ws()),document.body.insertAdjacentElement("beforeend",(t=r[1])!==null&&t!==void 0?t:ws()),Wo++,()=>{Wo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(o=>o.remove()),Wo--}},[])}function ws(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var be=require("react");var qo="focusScope.autoFocusOnMount",Yo="focusScope.autoFocusOnUnmount",Ts={bubbles:!1,cancelable:!0};var Es=(0,be.forwardRef)((e,t)=>{let m=e,{loop:r=!1,trapped:o=!1,onMountAutoFocus:n,onUnmountAutoFocus:a}=m,s=C(m,["loop","trapped","onMountAutoFocus","onUnmountAutoFocus"]),[i,l]=(0,be.useState)(null),c=de(n),u=de(a),d=(0,be.useRef)(null),x=re(t,p=>l(p)),b=(0,be.useRef)({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;(0,be.useEffect)(()=>{if(o){let S=function(N){if(b.paused||!i)return;let R=N.target;i.contains(R)?d.current=R:tt(d.current,{select:!0})},P=function(N){if(b.paused||!i)return;let R=N.relatedTarget;R!==null&&(i.contains(R)||tt(d.current,{select:!0}))},I=function(N){let R=document.activeElement;for(let $ of N)$.removedNodes.length>0&&(i!=null&&i.contains(R)||tt(i))};var p=S,w=P,y=I;document.addEventListener("focusin",S),document.addEventListener("focusout",P);let O=new MutationObserver(I);return i&&O.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",P),O.disconnect()}}},[o,i,b.paused]),(0,be.useEffect)(()=>{if(i){$s.add(b);let p=document.activeElement;if(!i.contains(p)){let y=new CustomEvent(qo,Ts);i.addEventListener(qo,c),i.dispatchEvent(y),y.defaultPrevented||(_f(Bf(Ns(i)),{select:!0}),document.activeElement===p&&tt(i))}return()=>{i.removeEventListener(qo,c),setTimeout(()=>{let y=new CustomEvent(Yo,Ts);i.addEventListener(Yo,u),i.dispatchEvent(y),y.defaultPrevented||tt(p!=null?p:document.body,{select:!0}),i.removeEventListener(Yo,u),$s.remove(b)},0)}}},[i,c,u,b]);let g=(0,be.useCallback)(p=>{if(!r&&!o||b.paused)return;let w=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(w&&y){let S=p.currentTarget,[P,I]=Lf(S);P&&I?!p.shiftKey&&y===I?(p.preventDefault(),r&&tt(P,{select:!0})):p.shiftKey&&y===P&&(p.preventDefault(),r&&tt(I,{select:!0})):y===S&&p.preventDefault()}},[r,o,b.paused]);return(0,be.createElement)(oe.div,W({tabIndex:-1},s,{ref:x,onKeyDown:g}))});function _f(e,{select:t=!1}={}){let r=document.activeElement;for(let o of e)if(tt(o,{select:t}),document.activeElement!==r)return}function Lf(e){let t=Ns(e),r=Is(t,e),o=Is(t.reverse(),e);return[r,o]}function Ns(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{let n=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||n?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Is(e,t){for(let r of e)if(!Vf(r,{upTo:t}))return r}function Vf(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Df(e){return e instanceof HTMLInputElement&&"select"in e}function tt(e,{select:t=!1}={}){if(e&&e.focus){let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Df(e)&&t&&e.select()}}var $s=zf();function zf(){let e=[];return{add(t){let r=e[0];t!==r&&(r==null||r.pause()),e=Rs(e,t),e.unshift(t)},remove(t){var r;e=Rs(e,t),(r=e[0])===null||r===void 0||r.resume()}}}function Rs(e,t){let r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function Bf(e){return e.filter(t=>t.tagName!=="A")}var Br=j(require("react"),1);var Os=require("react"),ge=globalThis!=null&&globalThis.document?Os.useLayoutEffect:()=>{};var Ff=Br.useId||(()=>{}),Hf=0;function Uo(e){let[t,r]=Br.useState(Ff());return ge(()=>{e||r(o=>o!=null?o:String(Hf++))},[e]),e||(t?`radix-${t}`:"")}var ne=require("react");var ks=["top","right","bottom","left"];var Ve=Math.min,ue=Math.max,fr=Math.round,mr=Math.floor,Re=e=>({x:e,y:e}),Wf={left:"right",right:"left",bottom:"top",top:"bottom"},qf={start:"end",end:"start"};function Hr(e,t,r){return ue(e,Ve(t,r))}function De(e,t){return typeof e=="function"?e(t):e}function ze(e){return e.split("-")[0]}function ct(e){return e.split("-")[1]}function Wr(e){return e==="x"?"y":"x"}function qr(e){return e==="y"?"height":"width"}function qe(e){return["top","bottom"].includes(ze(e))?"y":"x"}function Yr(e){return Wr(qe(e))}function As(e,t,r){r===void 0&&(r=!1);let o=ct(e),n=Yr(e),a=qr(n),s=n==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=pr(s)),[s,pr(s)]}function Ms(e){let t=pr(e);return[Fr(e),t,Fr(t)]}function Fr(e){return e.replace(/start|end/g,t=>qf[t])}function Yf(e,t,r){let o=["left","right"],n=["right","left"],a=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return r?t?n:o:t?o:n;case"left":case"right":return t?a:s;default:return[]}}function _s(e,t,r,o){let n=ct(e),a=Yf(ze(e),r==="start",o);return n&&(a=a.map(s=>s+"-"+n),t&&(a=a.concat(a.map(Fr)))),a}function pr(e){return e.replace(/left|right|bottom|top/g,t=>Wf[t])}function Uf(e){return h({top:0,right:0,bottom:0,left:0},e)}function Go(e){return typeof e!="number"?Uf(e):{top:e,right:e,bottom:e,left:e}}function dt(e){let{x:t,y:r,width:o,height:n}=e;return{width:o,height:n,top:r,left:t,right:t+o,bottom:r+n,x:t,y:r}}function Ls(e,t,r){let{reference:o,floating:n}=e,a=qe(t),s=Yr(t),i=qr(s),l=ze(t),c=a==="y",u=o.x+o.width/2-n.width/2,d=o.y+o.height/2-n.height/2,x=o[i]/2-n[i]/2,b;switch(l){case"top":b={x:u,y:o.y-n.height};break;case"bottom":b={x:u,y:o.y+o.height};break;case"right":b={x:o.x+o.width,y:d};break;case"left":b={x:o.x-n.width,y:d};break;default:b={x:o.x,y:o.y}}switch(ct(t)){case"start":b[s]-=x*(r&&c?-1:1);break;case"end":b[s]+=x*(r&&c?-1:1);break}return b}var zs=(e,t,r)=>ye(void 0,null,function*(){let{placement:o="bottom",strategy:n="absolute",middleware:a=[],platform:s}=r,i=a.filter(Boolean),l=yield s.isRTL==null?void 0:s.isRTL(t),c=yield s.getElementRects({reference:e,floating:t,strategy:n}),{x:u,y:d}=Ls(c,o,l),x=o,b={},g=0;for(let m=0;m<i.length;m++){let{name:p,fn:w}=i[m],{x:y,y:S,data:P,reset:I}=yield w({x:u,y:d,initialPlacement:o,placement:x,strategy:n,middlewareData:b,rects:c,platform:s,elements:{reference:e,floating:t}});u=y!=null?y:u,d=S!=null?S:d,b=v(h({},b),{[p]:h(h({},b[p]),P)}),I&&g<=50&&(g++,typeof I=="object"&&(I.placement&&(x=I.placement),I.rects&&(c=I.rects===!0?yield s.getElementRects({reference:e,floating:t,strategy:n}):I.rects),{x:u,y:d}=Ls(c,x,l)),m=-1)}return{x:u,y:d,placement:x,strategy:n,middlewareData:b}});function Ot(e,t){return ye(this,null,function*(){var r;t===void 0&&(t={});let{x:o,y:n,platform:a,rects:s,elements:i,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:x=!1,padding:b=0}=De(t,e),g=Go(b),p=i[x?d==="floating"?"reference":"floating":d],w=dt(yield a.getClippingRect({element:(r=yield a.isElement==null?void 0:a.isElement(p))==null||r?p:p.contextElement||(yield a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:c,rootBoundary:u,strategy:l})),y=d==="floating"?{x:o,y:n,width:s.floating.width,height:s.floating.height}:s.reference,S=yield a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating),P=(yield a.isElement==null?void 0:a.isElement(S))?(yield a.getScale==null?void 0:a.getScale(S))||{x:1,y:1}:{x:1,y:1},I=dt(a.convertOffsetParentRelativeRectToViewportRelativeRect?yield a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:y,offsetParent:S,strategy:l}):y);return{top:(w.top-I.top+g.top)/P.y,bottom:(I.bottom-w.bottom+g.bottom)/P.y,left:(w.left-I.left+g.left)/P.x,right:(I.right-w.right+g.right)/P.x}})}var Bs=e=>({name:"arrow",options:e,fn(r){return ye(this,null,function*(){let{x:o,y:n,placement:a,rects:s,platform:i,elements:l,middlewareData:c}=r,{element:u,padding:d=0}=De(e,r)||{};if(u==null)return{};let x=Go(d),b={x:o,y:n},g=Yr(a),m=qr(g),p=yield i.getDimensions(u),w=g==="y",y=w?"top":"left",S=w?"bottom":"right",P=w?"clientHeight":"clientWidth",I=s.reference[m]+s.reference[g]-b[g]-s.floating[m],O=b[g]-s.reference[g],N=yield i.getOffsetParent==null?void 0:i.getOffsetParent(u),R=N?N[P]:0;(!R||!(yield i.isElement==null?void 0:i.isElement(N)))&&(R=l.floating[P]||s.floating[m]);let $=I/2-O/2,V=R/2-p[m]/2-1,z=Ve(x[y],V),B=Ve(x[S],V),_=z,ee=R-p[m]-B,A=R/2-p[m]/2+$,L=Hr(_,A,ee),X=!c.arrow&&ct(a)!=null&&A!==L&&s.reference[m]/2-(A<_?z:B)-p[m]/2<0,M=X?A<_?A-_:A-ee:0;return{[g]:b[g]+M,data:h({[g]:L,centerOffset:A-L-M},X&&{alignmentOffset:M}),reset:X}})}});var Fs=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(r){return ye(this,null,function*(){var o,n;let{placement:a,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:u}=r,A=De(e,r),{mainAxis:d=!0,crossAxis:x=!0,fallbackPlacements:b,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0}=A,w=C(A,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((o=s.arrow)!=null&&o.alignmentOffset)return{};let y=ze(a),S=qe(l),P=ze(l)===l,I=yield c.isRTL==null?void 0:c.isRTL(u.floating),O=b||(P||!p?[pr(l)]:Ms(l)),N=m!=="none";!b&&N&&O.push(..._s(l,p,m,I));let R=[l,...O],$=yield Ot(r,w),V=[],z=((n=s.flip)==null?void 0:n.overflows)||[];if(d&&V.push($[y]),x){let L=As(a,i,I);V.push($[L[0]],$[L[1]])}if(z=[...z,{placement:a,overflows:V}],!V.every(L=>L<=0)){var B,_;let L=(((B=s.flip)==null?void 0:B.index)||0)+1,X=R[L];if(X)return{data:{index:L,overflows:z},reset:{placement:X}};let M=(_=z.filter(Q=>Q.overflows[0]<=0).sort((Q,K)=>Q.overflows[1]-K.overflows[1])[0])==null?void 0:_.placement;if(!M)switch(g){case"bestFit":{var ee;let Q=(ee=z.filter(K=>{if(N){let pe=qe(K.placement);return pe===S||pe==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(pe=>pe>0).reduce((pe,We)=>pe+We,0)]).sort((K,pe)=>K[1]-pe[1])[0])==null?void 0:ee[0];Q&&(M=Q);break}case"initialPlacement":M=l;break}if(a!==M)return{reset:{placement:M}}}return{}})}}};function Vs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ds(e){return ks.some(t=>e[t]>=0)}var Hs=function(e){return e===void 0&&(e={}),{name:"hide",options:e,fn(r){return ye(this,null,function*(){let{rects:o}=r,s=De(e,r),{strategy:n="referenceHidden"}=s,a=C(s,["strategy"]);switch(n){case"referenceHidden":{let i=yield Ot(r,v(h({},a),{elementContext:"reference"})),l=Vs(i,o.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Ds(l)}}}case"escaped":{let i=yield Ot(r,v(h({},a),{altBoundary:!0})),l=Vs(i,o.floating);return{data:{escapedOffsets:l,escaped:Ds(l)}}}default:return{}}})}}};function Gf(e,t){return ye(this,null,function*(){let{placement:r,platform:o,elements:n}=e,a=yield o.isRTL==null?void 0:o.isRTL(n.floating),s=ze(r),i=ct(r),l=qe(r)==="y",c=["left","top"].includes(s)?-1:1,u=a&&l?-1:1,d=De(t,e),{mainAxis:x,crossAxis:b,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return i&&typeof g=="number"&&(b=i==="end"?g*-1:g),l?{x:b*u,y:x*c}:{x:x*c,y:b*u}})}var Ws=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(r){return ye(this,null,function*(){var o,n;let{x:a,y:s,placement:i,middlewareData:l}=r,c=yield Gf(r,e);return i===((o=l.offset)==null?void 0:o.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:a+c.x,y:s+c.y,data:v(h({},c),{placement:i})}})}}},qs=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(r){return ye(this,null,function*(){let{x:o,y:n,placement:a}=r,w=De(e,r),{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:y=>{let{x:S,y:P}=y;return{x:S,y:P}}}}=w,c=C(w,["mainAxis","crossAxis","limiter"]),u={x:o,y:n},d=yield Ot(r,c),x=qe(ze(a)),b=Wr(x),g=u[b],m=u[x];if(s){let y=b==="y"?"top":"left",S=b==="y"?"bottom":"right",P=g+d[y],I=g-d[S];g=Hr(P,g,I)}if(i){let y=x==="y"?"top":"left",S=x==="y"?"bottom":"right",P=m+d[y],I=m-d[S];m=Hr(P,m,I)}let p=l.fn(v(h({},r),{[b]:g,[x]:m}));return v(h({},p),{data:{x:p.x-o,y:p.y-n,enabled:{[b]:s,[x]:i}}})})}}},Ys=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:r,y:o,placement:n,rects:a,middlewareData:s}=t,{offset:i=0,mainAxis:l=!0,crossAxis:c=!0}=De(e,t),u={x:r,y:o},d=qe(n),x=Wr(d),b=u[x],g=u[d],m=De(i,t),p=typeof m=="number"?{mainAxis:m,crossAxis:0}:h({mainAxis:0,crossAxis:0},m);if(l){let S=x==="y"?"height":"width",P=a.reference[x]-a.floating[S]+p.mainAxis,I=a.reference[x]+a.reference[S]-p.mainAxis;b<P?b=P:b>I&&(b=I)}if(c){var w,y;let S=x==="y"?"width":"height",P=["top","left"].includes(ze(n)),I=a.reference[d]-a.floating[S]+(P&&((w=s.offset)==null?void 0:w[d])||0)+(P?0:p.crossAxis),O=a.reference[d]+a.reference[S]+(P?0:((y=s.offset)==null?void 0:y[d])||0)-(P?p.crossAxis:0);g<I?g=I:g>O&&(g=O)}return{[x]:b,[d]:g}}}},Us=function(e){return e===void 0&&(e={}),{name:"size",options:e,fn(r){return ye(this,null,function*(){var o,n;let{placement:a,rects:s,platform:i,elements:l}=r,z=De(e,r),{apply:c=()=>{}}=z,u=C(z,["apply"]),d=yield Ot(r,u),x=ze(a),b=ct(a),g=qe(a)==="y",{width:m,height:p}=s.floating,w,y;x==="top"||x==="bottom"?(w=x,y=b===((yield i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(y=x,w=b==="end"?"top":"bottom");let S=p-d.top-d.bottom,P=m-d.left-d.right,I=Ve(p-d[w],S),O=Ve(m-d[y],P),N=!r.middlewareData.shift,R=I,$=O;if((o=r.middlewareData.shift)!=null&&o.enabled.x&&($=P),(n=r.middlewareData.shift)!=null&&n.enabled.y&&(R=S),N&&!b){let B=ue(d.left,0),_=ue(d.right,0),ee=ue(d.top,0),A=ue(d.bottom,0);g?$=m-2*(B!==0||_!==0?B+_:ue(d.left,d.right)):R=p-2*(ee!==0||A!==0?ee+A:ue(d.top,d.bottom))}yield c(v(h({},r),{availableWidth:$,availableHeight:R}));let V=yield i.getDimensions(l.floating);return m!==V.width||p!==V.height?{reset:{rects:!0}}:{}})}}};function Ur(){return typeof window!="undefined"}function pt(e){return Ks(e)?(e.nodeName||"").toLowerCase():"#document"}function he(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ee(e){var t;return(t=(Ks(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ks(e){return Ur()?e instanceof Node||e instanceof he(e).Node:!1}function Ce(e){return Ur()?e instanceof Element||e instanceof he(e).Element:!1}function Ne(e){return Ur()?e instanceof HTMLElement||e instanceof he(e).HTMLElement:!1}function Gs(e){return!Ur()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof he(e).ShadowRoot}function kt(e){let{overflow:t,overflowX:r,overflowY:o,display:n}=Pe(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&!["inline","contents"].includes(n)}function js(e){return["table","td","th"].includes(pt(e))}function br(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(r){return!1}})}function Gr(e){let t=Kr(),r=Ce(e)?Pe(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(r.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(r.contain||"").includes(o))}function Xs(e){let t=Ye(e);for(;Ne(t)&&!ft(t);){if(Gr(t))return t;if(br(t))return null;t=Ye(t)}return null}function Kr(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ft(e){return["html","body","#document"].includes(pt(e))}function Pe(e){return he(e).getComputedStyle(e)}function hr(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ye(e){if(pt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Gs(e)&&e.host||Ee(e);return Gs(t)?t.host:t}function Qs(e){let t=Ye(e);return ft(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ne(t)&&kt(t)?t:Qs(t)}function ut(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);let n=Qs(e),a=n===((o=e.ownerDocument)==null?void 0:o.body),s=he(n);if(a){let i=jr(s);return t.concat(s,s.visualViewport||[],kt(n)?n:[],i&&r?ut(i):[])}return t.concat(n,ut(n,[],r))}function jr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ei(e){let t=Pe(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,n=Ne(e),a=n?e.offsetWidth:r,s=n?e.offsetHeight:o,i=fr(r)!==a||fr(o)!==s;return i&&(r=a,o=s),{width:r,height:o,$:i}}function jo(e){return Ce(e)?e:e.contextElement}function At(e){let t=jo(e);if(!Ne(t))return Re(1);let r=t.getBoundingClientRect(),{width:o,height:n,$:a}=ei(t),s=(a?fr(r.width):r.width)/o,i=(a?fr(r.height):r.height)/n;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}var Kf=Re(0);function ti(e){let t=he(e);return!Kr()||!t.visualViewport?Kf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jf(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==he(e)?!1:t}function mt(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);let n=e.getBoundingClientRect(),a=jo(e),s=Re(1);t&&(o?Ce(o)&&(s=At(o)):s=At(e));let i=jf(a,r,o)?ti(a):Re(0),l=(n.left+i.x)/s.x,c=(n.top+i.y)/s.y,u=n.width/s.x,d=n.height/s.y;if(a){let x=he(a),b=o&&Ce(o)?he(o):o,g=x,m=jr(g);for(;m&&o&&b!==g;){let p=At(m),w=m.getBoundingClientRect(),y=Pe(m),S=w.left+(m.clientLeft+parseFloat(y.paddingLeft))*p.x,P=w.top+(m.clientTop+parseFloat(y.paddingTop))*p.y;l*=p.x,c*=p.y,u*=p.x,d*=p.y,l+=S,c+=P,g=he(m),m=jr(g)}}return dt({width:u,height:d,x:l,y:c})}function Xo(e,t){let r=hr(e).scrollLeft;return t?t.left+r:mt(Ee(e)).left+r}function ri(e,t,r){r===void 0&&(r=!1);let o=e.getBoundingClientRect(),n=o.left+t.scrollLeft-(r?0:Xo(e,o)),a=o.top+t.scrollTop;return{x:n,y:a}}function Xf(e){let{elements:t,rect:r,offsetParent:o,strategy:n}=e,a=n==="fixed",s=Ee(o),i=t?br(t.floating):!1;if(o===s||i&&a)return r;let l={scrollLeft:0,scrollTop:0},c=Re(1),u=Re(0),d=Ne(o);if((d||!d&&!a)&&((pt(o)!=="body"||kt(s))&&(l=hr(o)),Ne(o))){let b=mt(o);c=At(o),u.x=b.x+o.clientLeft,u.y=b.y+o.clientTop}let x=s&&!d&&!a?ri(s,l,!0):Re(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+x.x,y:r.y*c.y-l.scrollTop*c.y+u.y+x.y}}function Qf(e){return Array.from(e.getClientRects())}function Zf(e){let t=Ee(e),r=hr(e),o=e.ownerDocument.body,n=ue(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=ue(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),s=-r.scrollLeft+Xo(e),i=-r.scrollTop;return Pe(o).direction==="rtl"&&(s+=ue(t.clientWidth,o.clientWidth)-n),{width:n,height:a,x:s,y:i}}function Jf(e,t){let r=he(e),o=Ee(e),n=r.visualViewport,a=o.clientWidth,s=o.clientHeight,i=0,l=0;if(n){a=n.width,s=n.height;let c=Kr();(!c||c&&t==="fixed")&&(i=n.offsetLeft,l=n.offsetTop)}return{width:a,height:s,x:i,y:l}}function em(e,t){let r=mt(e,!0,t==="fixed"),o=r.top+e.clientTop,n=r.left+e.clientLeft,a=Ne(e)?At(e):Re(1),s=e.clientWidth*a.x,i=e.clientHeight*a.y,l=n*a.x,c=o*a.y;return{width:s,height:i,x:l,y:c}}function Zs(e,t,r){let o;if(t==="viewport")o=Jf(e,r);else if(t==="document")o=Zf(Ee(e));else if(Ce(t))o=em(t,r);else{let n=ti(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return dt(o)}function oi(e,t){let r=Ye(e);return r===t||!Ce(r)||ft(r)?!1:Pe(r).position==="fixed"||oi(r,t)}function tm(e,t){let r=t.get(e);if(r)return r;let o=ut(e,[],!1).filter(i=>Ce(i)&&pt(i)!=="body"),n=null,a=Pe(e).position==="fixed",s=a?Ye(e):e;for(;Ce(s)&&!ft(s);){let i=Pe(s),l=Gr(s);!l&&i.position==="fixed"&&(n=null),(a?!l&&!n:!l&&i.position==="static"&&!!n&&["absolute","fixed"].includes(n.position)||kt(s)&&!l&&oi(e,s))?o=o.filter(u=>u!==s):n=i,s=Ye(s)}return t.set(e,o),o}function rm(e){let{element:t,boundary:r,rootBoundary:o,strategy:n}=e,s=[...r==="clippingAncestors"?br(t)?[]:tm(t,this._c):[].concat(r),o],i=s[0],l=s.reduce((c,u)=>{let d=Zs(t,u,n);return c.top=ue(d.top,c.top),c.right=Ve(d.right,c.right),c.bottom=Ve(d.bottom,c.bottom),c.left=ue(d.left,c.left),c},Zs(t,i,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function om(e){let{width:t,height:r}=ei(e);return{width:t,height:r}}function nm(e,t,r){let o=Ne(t),n=Ee(t),a=r==="fixed",s=mt(e,!0,a,t),i={scrollLeft:0,scrollTop:0},l=Re(0);if(o||!o&&!a)if((pt(t)!=="body"||kt(n))&&(i=hr(t)),o){let x=mt(t,!0,a,t);l.x=x.x+t.clientLeft,l.y=x.y+t.clientTop}else n&&(l.x=Xo(n));let c=n&&!o&&!a?ri(n,i):Re(0),u=s.left+i.scrollLeft-l.x-c.x,d=s.top+i.scrollTop-l.y-c.y;return{x:u,y:d,width:s.width,height:s.height}}function Ko(e){return Pe(e).position==="static"}function Js(e,t){if(!Ne(e)||Pe(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ee(e)===r&&(r=r.ownerDocument.body),r}function ni(e,t){let r=he(e);if(br(e))return r;if(!Ne(e)){let n=Ye(e);for(;n&&!ft(n);){if(Ce(n)&&!Ko(n))return n;n=Ye(n)}return r}let o=Js(e,t);for(;o&&js(o)&&Ko(o);)o=Js(o,t);return o&&ft(o)&&Ko(o)&&!Gr(o)?r:o||Xs(e)||r}var am=function(e){return ye(this,null,function*(){let t=this.getOffsetParent||ni,r=this.getDimensions,o=yield r(e.floating);return{reference:nm(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function sm(e){return Pe(e).direction==="rtl"}var ai={convertOffsetParentRelativeRectToViewportRelativeRect:Xf,getDocumentElement:Ee,getClippingRect:rm,getOffsetParent:ni,getElementRects:am,getClientRects:Qf,getDimensions:om,getScale:At,isElement:Ce,isRTL:sm};function im(e,t){let r=null,o,n=Ee(e);function a(){var i;clearTimeout(o),(i=r)==null||i.disconnect(),r=null}function s(i,l){i===void 0&&(i=!1),l===void 0&&(l=1),a();let{left:c,top:u,width:d,height:x}=e.getBoundingClientRect();if(i||t(),!d||!x)return;let b=mr(u),g=mr(n.clientWidth-(c+d)),m=mr(n.clientHeight-(u+x)),p=mr(c),y={rootMargin:-b+"px "+-g+"px "+-m+"px "+-p+"px",threshold:ue(0,Ve(1,l))||1},S=!0;function P(I){let O=I[0].intersectionRatio;if(O!==l){if(!S)return s();O?s(!1,O):o=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{r=new IntersectionObserver(P,v(h({},y),{root:n.ownerDocument}))}catch(I){r=new IntersectionObserver(P,y)}r.observe(e)}return s(!0),a}function Qo(e,t,r,o){o===void 0&&(o={});let{ancestorScroll:n=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=jo(e),u=n||a?[...c?ut(c):[],...ut(t)]:[];u.forEach(w=>{n&&w.addEventListener("scroll",r,{passive:!0}),a&&w.addEventListener("resize",r)});let d=c&&i?im(c,r):null,x=-1,b=null;s&&(b=new ResizeObserver(w=>{let[y]=w;y&&y.target===c&&b&&(b.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var S;(S=b)==null||S.observe(t)})),r()}),c&&!l&&b.observe(c),b.observe(t));let g,m=l?mt(e):null;l&&p();function p(){let w=mt(e);m&&(w.x!==m.x||w.y!==m.y||w.width!==m.width||w.height!==m.height)&&r(),m=w,g=requestAnimationFrame(p)}return r(),()=>{var w;u.forEach(y=>{n&&y.removeEventListener("scroll",r),a&&y.removeEventListener("resize",r)}),d==null||d(),(w=b)==null||w.disconnect(),b=null,l&&cancelAnimationFrame(g)}}var si=Ws;var ii=qs,li=Fs,ci=Us,di=Hs,Zo=Bs;var ui=Ys,Jo=(e,t,r)=>{let o=new Map,n=h({platform:ai},r),a=v(h({},n.platform),{_c:o});return zs(e,t,v(h({},n),{platform:a}))};var te=j(require("react"),1),Zr=require("react"),fi=j(require("react-dom"),1);var Xr=typeof document!="undefined"?Zr.useLayoutEffect:Zr.useEffect;function Qr(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 r,o,n;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(o=r;o--!==0;)if(!Qr(e[o],t[o]))return!1;return!0}if(n=Object.keys(e),r=n.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!{}.hasOwnProperty.call(t,n[o]))return!1;for(o=r;o--!==0;){let a=n[o];if(!(a==="_owner"&&e.$$typeof)&&!Qr(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function mi(e){return typeof window=="undefined"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pi(e,t){let r=mi(e);return Math.round(t*r)/r}function en(e){let t=te.useRef(e);return Xr(()=>{t.current=e}),t}function bi(e){e===void 0&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:o=[],platform:n,elements:{reference:a,floating:s}={},transform:i=!0,whileElementsMounted:l,open:c}=e,[u,d]=te.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[x,b]=te.useState(o);Qr(x,o)||b(o);let[g,m]=te.useState(null),[p,w]=te.useState(null),y=te.useCallback(M=>{M!==O.current&&(O.current=M,m(M))},[]),S=te.useCallback(M=>{M!==N.current&&(N.current=M,w(M))},[]),P=a||g,I=s||p,O=te.useRef(null),N=te.useRef(null),R=te.useRef(u),$=l!=null,V=en(l),z=en(n),B=en(c),_=te.useCallback(()=>{if(!O.current||!N.current)return;let M={placement:t,strategy:r,middleware:x};z.current&&(M.platform=z.current),Jo(O.current,N.current,M).then(Q=>{let K=v(h({},Q),{isPositioned:B.current!==!1});ee.current&&!Qr(R.current,K)&&(R.current=K,fi.flushSync(()=>{d(K)}))})},[x,t,r,z,B]);Xr(()=>{c===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,d(M=>v(h({},M),{isPositioned:!1})))},[c]);let ee=te.useRef(!1);Xr(()=>(ee.current=!0,()=>{ee.current=!1}),[]),Xr(()=>{if(P&&(O.current=P),I&&(N.current=I),P&&I){if(V.current)return V.current(P,I,_);_()}},[P,I,_,V,$]);let A=te.useMemo(()=>({reference:O,floating:N,setReference:y,setFloating:S}),[y,S]),L=te.useMemo(()=>({reference:P,floating:I}),[P,I]),X=te.useMemo(()=>{let M={position:r,left:0,top:0};if(!L.floating)return M;let Q=pi(L.floating,u.x),K=pi(L.floating,u.y);return i?h(v(h({},M),{transform:"translate("+Q+"px, "+K+"px)"}),mi(L.floating)>=1.5&&{willChange:"transform"}):{position:r,left:Q,top:K}},[r,i,L.floating,u.x,u.y]);return te.useMemo(()=>v(h({},u),{update:_,refs:A,elements:L,floatingStyles:X}),[u,_,A,L,X])}var lm=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){let{element:o,padding:n}=typeof e=="function"?e(r):e;return o&&t(o)?o.current!=null?Zo({element:o.current,padding:n}).fn(r):{}:o?Zo({element:o,padding:n}).fn(r):{}}}},hi=(e,t)=>v(h({},si(e)),{options:[e,t]}),xi=(e,t)=>v(h({},ii(e)),{options:[e,t]}),vi=(e,t)=>v(h({},ui(e)),{options:[e,t]}),gi=(e,t)=>v(h({},li(e)),{options:[e,t]}),yi=(e,t)=>v(h({},ci(e)),{options:[e,t]});var Si=(e,t)=>v(h({},di(e)),{options:[e,t]});var wi=(e,t)=>v(h({},lm(e)),{options:[e,t]});var Ti=require("@radix-ui/react-context");var Ci=require("react");function Pi(e){let[t,r]=(0,Ci.useState)(void 0);return ge(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let o=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;let a=n[0],s,i;if("borderBoxSize"in a){let l=a.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,i=c.blockSize}else s=e.offsetWidth,i=e.offsetHeight;r({width:s,height:i})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),t}var Ii="Popper",[$i,tn]=(0,Ti.createContextScope)(Ii),[cm,Ri]=$i(Ii),dm=e=>{let{__scopePopper:t,children:r}=e,[o,n]=(0,ne.useState)(null);return(0,ne.createElement)(cm,{scope:t,anchor:o,onAnchorChange:n},r)},um="PopperAnchor",pm=(0,ne.forwardRef)((e,t)=>{let l=e,{__scopePopper:r,virtualRef:o}=l,n=C(l,["__scopePopper","virtualRef"]),a=Ri(um,r),s=(0,ne.useRef)(null),i=re(t,s);return(0,ne.useEffect)(()=>{a.onAnchorChange((o==null?void 0:o.current)||s.current)}),o?null:(0,ne.createElement)(oe.div,W({},n,{ref:i}))}),Ei="PopperContent",[fm,Cv]=$i(Ei),mm=(0,ne.forwardRef)((e,t)=>{var r,o,n,a,s,i,l,c;let me=e,{__scopePopper:u,side:d="bottom",sideOffset:x=0,align:b="center",alignOffset:g=0,arrowPadding:m=0,collisionBoundary:p=[],collisionPadding:w=0,sticky:y="partial",hideWhenDetached:S=!1,avoidCollisions:P=!0,onPlaced:I}=me,O=C(me,["__scopePopper","side","sideOffset","align","alignOffset","arrowPadding","collisionBoundary","collisionPadding","sticky","hideWhenDetached","avoidCollisions","onPlaced"]),N=Ri(Ei,u),[R,$]=(0,ne.useState)(null),V=re(t,ce=>$(ce)),[z,B]=(0,ne.useState)(null),_=Pi(z),ee=(r=_==null?void 0