@enonic/ui 1.0.4 → 1.0.5

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.
@@ -1,6 +1,6 @@
1
1
  import{options as e,Fragment as t}from"preact";import{createContext as n,useContext as r,useState as o,useCallback as a,forwardRef as i,useMemo as s,useEffect as l,createElement as c,useRef as d,useLayoutEffect as u,Fragment as m,isValidElement as f,cloneElement as p,Children as g,createPortal as b}from"react";import{createPortal as v}from"react-dom";import{Slot as h,Root as y}from"@radix-ui/react-slot";import{FocusTrap as w}from"focus-trap-react";var x=0;function I(t,n,r,o,a,i){n||(n={});var s,l,c=n;if("ref"in c)for(l in c={},n)"ref"==l?s=n[l]:c[l]=n[l];var d={type:t,props:c,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--x,__i:-1,__u:0,__source:a,__self:i};if("function"==typeof t&&(s=t.defaultProps))for(l in s)void 0===c[l]&&(c[l]=s[l]);return e.vnode&&e.vnode(d),d}function N(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=N(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function k(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=N(e))&&(r&&(r+=" "),r+=t);return r}const C=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,D=k,S=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return D(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(e=>{const t=null==n?void 0:n[e],r=null==a?void 0:a[e];if(null===t)return null;const i=C(t)||C(r);return o[e][i]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),l=null==t||null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...o}=t;return Object.entries(o).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...s}[t]):{...a,...s}[t]===n})?[...e,n,r]:e},[]);return D(e,i,l,null==n?void 0:n.class,null==n?void 0:n.className)},M=n(void 0),R=({value:e,children:t})=>/* @__PURE__ */I(M.Provider,{value:e,children:t});R.displayName="AvatarProvider";const A=()=>{const e=r(M);if(!e)throw new Error("useAvatar must be used within an Avatar");return e},P=n(void 0),T=({value:e,children:t})=>/* @__PURE__ */I(P.Provider,{value:e,children:t});T.displayName="ComboboxProvider";const O=()=>{const e=r(P);if(!e)throw new Error("useCombobox must be used within a ComboboxProvider");return e},z=n(void 0),E=({value:e,children:t})=>/* @__PURE__ */I(z.Provider,{value:e,children:t}),L=()=>{const e=r(z);if(!e)throw new Error("useContextMenuContent must be used within a ContextMenu.Content or ContextMenu.SubContent");return e},$=n(void 0),V=({value:e,children:t})=>/* @__PURE__ */I($.Provider,{value:e,children:t}),F=()=>{const e=r($);if(!e)throw new Error("useContextMenu must be used within a ContextMenuProvider");return e},K=n(void 0),H=K.Provider,G=()=>{const e=r(K);if(!e)throw new Error("useContextMenuSub must be used within a ContextMenu.Sub");return e},B=()=>r(K),j=n(void 0),q=({value:e,children:t})=>/* @__PURE__ */I(j.Provider,{value:e,children:t});q.displayName="DatePickerProvider";const W=()=>{const e=r(j);if(!e)throw new Error("useDatePicker must be used within DatePickerProvider");return e},_=n(void 0),Y=({value:e,children:t})=>/* @__PURE__ */I(_.Provider,{value:e,children:t});Y.displayName="DialogProvider";const U=()=>{const e=r(_);if(!e)throw new Error("useDialog must be used within a DialogProvider");return e},Z=n(null),X=()=>r(Z),J=n(void 0),Q=({value:e,children:t})=>/* @__PURE__ */I(J.Provider,{value:e,children:t});Q.displayName="GridListProvider";const ee=()=>{const e=r(J);if(!e)throw new Error("useGridList must be used within a GridList");return e},te=n(void 0),ne=({value:e,children:t})=>/* @__PURE__ */I(te.Provider,{value:e,children:t});ne.displayName="GridListRowProvider";const re=()=>{const e=r(te);if(!e)throw new Error("useGridListRow must be used within a GridList.Row");return e},oe=n(void 0),ae=({children:e,prefix:t})=>/* @__PURE__ */I(oe.Provider,{value:{prefix:t},children:e});ae.displayName="IdProvider";const ie=Math.random().toString(36).slice(2,8).padEnd(6,"0");let se=0;const le=(e,t)=>{const[n]=o(()=>`id-${ie}-${++se}`),a=e??n,i=r(oe);return[i?.prefix,t,a].filter(Boolean).join("-")},ce=n(void 0),de=({value:e,children:t})=>/* @__PURE__ */I(ce.Provider,{value:e,children:t});de.displayName="ListboxProvider";const ue=()=>{const e=r(ce);if(!e)throw new Error("useListbox must be used within a Listbox");return e},me=n(void 0),fe=({value:e,children:t})=>/* @__PURE__ */I(me.Provider,{value:e,children:t}),pe=()=>{const e=r(me);if(!e)throw new Error("useMenu must be used within a MenuProvider");return e},ge=n(void 0),be=ge.Provider;function ve(){const e=r(ge);if(!e)throw new Error("useMenubarMenu must be used within a Menubar.Menu component");return e}function he(){return r(ge)}const ye=n(void 0),we=({value:e,children:t})=>/* @__PURE__ */I(ye.Provider,{value:e,children:t});we.displayName="MenubarProvider";const xe=()=>{const e=r(ye);if(!e)throw new Error("useMenubar must be used within a MenubarProvider");return e},Ie=()=>r(ye),Ne=n(void 0),ke=({value:e,children:t})=>/* @__PURE__ */I(Ne.Provider,{value:e,children:t});ke.displayName="RadioGroupProvider";const Ce=()=>{const e=r(Ne);if(!e)throw new Error("useRadioGroup must be used within a RadioGroupProvider");return e},De=n(void 0),Se=({value:e,children:t})=>/* @__PURE__ */I(De.Provider,{value:e,children:t});Se.displayName="SearchFieldProvider";const Me=()=>{const e=r(De);if(!e)throw new Error("useSearchField must be used within a SearchFieldProvider");return e},Re=n(void 0),Ae=({value:e,children:t})=>/* @__PURE__ */I(Re.Provider,{value:e,children:t});Ae.displayName="SelectorProvider";const Pe=()=>{const e=r(Re);if(!e)throw new Error("useSelector must be used within a SelectorProvider");return e},Te=n(void 0),Oe=({value:e,children:t})=>/* @__PURE__ */I(Te.Provider,{value:e,children:t});Oe.displayName="StepperProvider";const ze=()=>{const e=r(Te);if(!e)throw new Error("useStepper must be used within a StepperProvider");return e},Ee=n(void 0),Le=({value:e,children:t})=>/* @__PURE__ */I(Ee.Provider,{value:e,children:t});Le.displayName="TabProvider";const $e=()=>{const e=r(Ee);if(!e)throw new Error("useTab must be used within a TabProvider");return e},Ve=n(void 0),Fe=({value:e,children:t})=>/* @__PURE__ */I(Ve.Provider,{value:e,children:t});Fe.displayName="TimePickerProvider";const Ke=()=>{const e=r(Ve);if(!e)throw new Error("useTimePicker must be used within TimePickerProvider");return e},He=n(void 0),Ge=({value:e,children:t})=>/* @__PURE__ */I(He.Provider,{value:e,children:t});Ge.displayName="ToastProvider";const Be=()=>{const e=r(He);if(!e)throw new Error("useToast must be used within a ToastProvider");return e},je=n(void 0),qe=({value:e,children:t})=>/* @__PURE__ */I(je.Provider,{value:e,children:t}),We=()=>{const e=r(je);if(!e)throw new Error("useToggleGroup must be used within a ToggleGroupProvider");return e},_e=n(void 0),Ye=({value:e,children:t})=>/* @__PURE__ */I(_e.Provider,{value:e,children:t}),Ue=()=>{const e=r(_e);if(!e)throw new Error("useTreeList must be used within a TreeListProvider");return e},Ze=n(void 0),Xe=({value:e,children:t})=>/* @__PURE__ */I(Ze.Provider,{value:e,children:t}),Je=()=>{const e=r(Ze);if(!e)throw new Error("useVirtualizedTreeList must be used within a VirtualizedTreeListProvider");return e};function Qe(e,t){return`${e}-${t}`}function et(e,t){return t.reduce((t,n)=>(t[n]=Qe(e,n),t),{})}function tt(e,t,n){return`${e}-${t}-item-${n}`}function nt(e,t,n){if(n)return tt(e,t,n)}const rt=(e=/* @__PURE__ */new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ot="-",at=[],it=e=>{const t=ct(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return lt(e);const n=e.split(ot),r=""===n[0]&&n.length>1?1:0;return st(n,r,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=r[e],o=n[e];return t?o?((e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n})(o,t):t:o||at}return n[e]||at}}},st=(e,t,n)=>{if(0===e.length-t)return n.classGroupId;const r=e[t],o=n.nextPart.get(r);if(o){const n=st(e,t+1,o);if(n)return n}const a=n.validators;if(null===a)return;const i=0===t?e.join(ot):e.slice(t).join(ot),s=a.length;for(let l=0;l<s;l++){const e=a[l];if(e.validator(i))return e.classGroupId}},lt=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?"arbitrary.."+r:void 0})(),ct=e=>{const{theme:t,classGroups:n}=e;return dt(n,t)},dt=(e,t)=>{const n=rt();for(const r in e){const o=e[r];ut(o,n,r,t)}return n},ut=(e,t,n,r)=>{const o=e.length;for(let a=0;a<o;a++){const o=e[a];mt(o,t,n,r)}},mt=(e,t,n,r)=>{"string"!=typeof e?"function"!=typeof e?gt(e,t,n,r):pt(e,t,n,r):ft(e,t,n)},ft=(e,t,n)=>{(""===e?t:bt(t,e)).classGroupId=n},pt=(e,t,n,r)=>{vt(e)?ut(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},gt=(e,t,n,r)=>{const o=Object.entries(e),a=o.length;for(let i=0;i<a;i++){const[e,a]=o[i];ut(a,bt(t,e),n,r)}},bt=(e,t)=>{let n=e;const r=t.split(ot),o=r.length;for(let a=0;a<o;a++){const e=r[a];let t=n.nextPart.get(e);t||(t=rt(),n.nextPart.set(e,t)),n=t}return n},vt=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,ht=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=/* @__PURE__ */Object.create(null),r=/* @__PURE__ */Object.create(null);const o=(o,a)=>{n[o]=a,t++,t>e&&(t=0,r=n,n=/* @__PURE__ */Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(o(e,t),t):void 0},set(e,t){e in n?n[e]=t:o(e,t)}}},yt=[],wt=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),xt=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,o=0,a=0;const i=e.length;for(let d=0;d<i;d++){const i=e[d];if(0===r&&0===o){if(":"===i){t.push(e.slice(a,d)),a=d+1;continue}if("/"===i){n=d;continue}}"["===i?r++:"]"===i?r--:"("===i?o++:")"===i&&o--}const s=0===t.length?e:e.slice(a);let l=s,c=!1;s.endsWith("!")?(l=s.slice(0,-1),c=!0):s.startsWith("!")&&(l=s.slice(1),c=!0);return wt(t,c,l,n&&n>a?n-a:void 0)};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):wt(yt,!1,t,void 0,!0)}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},It=e=>{const t=/* @__PURE__ */new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{const n=[];let r=[];for(let o=0;o<e.length;o++){const a=e[o],i="["===a[0],s=t.has(a);i||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Nt=/\s+/,kt=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=kt(e[r]))&&(n&&(n+=" "),n+=t);return n},Ct=[],Dt=e=>{const t=t=>t[e]||Ct;return t.isThemeGetter=!0,t},St=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Mt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Rt=/^\d+\/\d+$/,At=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Pt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Tt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ot=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Et=e=>Rt.test(e),Lt=e=>!!e&&!Number.isNaN(Number(e)),$t=e=>!!e&&Number.isInteger(Number(e)),Vt=e=>e.endsWith("%")&&Lt(e.slice(0,-1)),Ft=e=>At.test(e),Kt=()=>!0,Ht=e=>Pt.test(e)&&!Tt.test(e),Gt=()=>!1,Bt=e=>Ot.test(e),jt=e=>zt.test(e),qt=e=>!_t(e)&&!Qt(e),Wt=e=>sn(e,un,Gt),_t=e=>St.test(e),Yt=e=>sn(e,mn,Ht),Ut=e=>sn(e,fn,Lt),Zt=e=>sn(e,cn,Gt),Xt=e=>sn(e,dn,jt),Jt=e=>sn(e,gn,Bt),Qt=e=>Mt.test(e),en=e=>ln(e,mn),tn=e=>ln(e,pn),nn=e=>ln(e,cn),rn=e=>ln(e,un),on=e=>ln(e,dn),an=e=>ln(e,gn,!0),sn=(e,t,n)=>{const r=St.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},ln=(e,t,n=!1)=>{const r=Mt.exec(e);return!!r&&(r[1]?t(r[1]):n)},cn=e=>"position"===e||"percentage"===e,dn=e=>"image"===e||"url"===e,un=e=>"length"===e||"size"===e||"bg-size"===e,mn=e=>"length"===e,fn=e=>"number"===e,pn=e=>"family-name"===e,gn=e=>"shadow"===e,bn=/* @__PURE__ */((e,...t)=>{let n,r,o,a;const i=e=>{const t=r(e);if(t)return t;const a=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:a}=t,i=[],s=e.trim().split(Nt);let l="";for(let c=s.length-1;c>=0;c-=1){const e=s[c],{isExternal:t,modifiers:d,hasImportantModifier:u,baseClassName:m,maybePostfixModifierPosition:f}=n(e);if(t){l=e+(l.length>0?" "+l:l);continue}let p=!!f,g=r(p?m.substring(0,f):m);if(!g){if(!p){l=e+(l.length>0?" "+l:l);continue}if(g=r(m),!g){l=e+(l.length>0?" "+l:l);continue}p=!1}const b=0===d.length?"":1===d.length?d[0]:a(d).join(":"),v=u?b+"!":b,h=v+g;if(i.indexOf(h)>-1)continue;i.push(h);const y=o(g,p);for(let n=0;n<y.length;++n){const e=y[n];i.push(v+e)}l=e+(l.length>0?" "+l:l)}return l})(e,n);return o(e,a),a};return a=s=>{const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:ht(e.cacheSize),parseClassName:xt(e),sortModifiers:It(e),...it(e)}))(l),r=n.cache.get,o=n.cache.set,a=i,i(s)},(...e)=>a(((...e)=>{let t,n,r=0,o="";for(;r<e.length;)(t=e[r++])&&(n=kt(t))&&(o&&(o+=" "),o+=n);return o})(...e))})(()=>{const e=Dt("color"),t=Dt("font"),n=Dt("text"),r=Dt("font-weight"),o=Dt("tracking"),a=Dt("leading"),i=Dt("breakpoint"),s=Dt("container"),l=Dt("spacing"),c=Dt("radius"),d=Dt("shadow"),u=Dt("inset-shadow"),m=Dt("text-shadow"),f=Dt("drop-shadow"),p=Dt("blur"),g=Dt("perspective"),b=Dt("aspect"),v=Dt("ease"),h=Dt("animate"),y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Qt,_t],w=()=>[Qt,_t,l],x=()=>[Et,"full","auto",...w()],I=()=>[$t,"none","subgrid",Qt,_t],N=()=>["auto",{span:["full",$t,Qt,_t]},$t,Qt,_t],k=()=>[$t,"auto",Qt,_t],C=()=>["auto","min","max","fr",Qt,_t],D=()=>["auto",...w()],S=()=>[Et,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],M=()=>[e,Qt,_t],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",nn,Zt,{position:[Qt,_t]}],A=()=>["auto","cover","contain",rn,Wt,{size:[Qt,_t]}],P=()=>[Vt,en,Yt],T=()=>["","none","full",c,Qt,_t],O=()=>["",Lt,en,Yt],z=()=>[Lt,Vt,nn,Zt],E=()=>["","none",p,Qt,_t],L=()=>["none",Lt,Qt,_t],$=()=>["none",Lt,Qt,_t],V=()=>[Lt,Qt,_t],F=()=>[Et,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ft],breakpoint:[Ft],color:[Kt],container:[Ft],"drop-shadow":[Ft],ease:["in","out","in-out"],font:[qt],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ft],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ft],shadow:[Ft],spacing:["px",Lt],text:[Ft],"text-shadow":[Ft],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Et,_t,Qt,b]}],container:["container"],columns:[{columns:[Lt,_t,Qt,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{start:x()}],end:[{end:x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[$t,"auto",Qt,_t]}],basis:[{basis:[Et,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Lt,Et,"auto","initial","none",_t]}],grow:[{grow:["",Lt,Qt,_t]}],shrink:[{shrink:["",Lt,Qt,_t]}],order:[{order:[$t,"first","last","none",Qt,_t]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:S()}],w:[{w:[s,"screen",...S()]}],"min-w":[{"min-w":[s,"screen","none",...S()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...S()]}],h:[{h:["screen","lh",...S()]}],"min-h":[{"min-h":["screen","lh","none",...S()]}],"max-h":[{"max-h":["screen","lh",...S()]}],"font-size":[{text:["base",n,en,Yt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Qt,Ut]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Vt,_t]}],"font-family":[{font:[tn,_t,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Qt,_t]}],"line-clamp":[{"line-clamp":[Lt,"none",Qt,Ut]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":["none",Qt,_t]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Qt,_t]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Lt,"from-font","auto",Qt,Yt]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[Lt,"auto",Qt,_t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Qt,_t]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Qt,_t]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$t,Qt,_t],radial:["",Qt,_t],conic:[$t,Qt,_t]},on,Xt]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:T()}],"rounded-s":[{"rounded-s":T()}],"rounded-e":[{"rounded-e":T()}],"rounded-t":[{"rounded-t":T()}],"rounded-r":[{"rounded-r":T()}],"rounded-b":[{"rounded-b":T()}],"rounded-l":[{"rounded-l":T()}],"rounded-ss":[{"rounded-ss":T()}],"rounded-se":[{"rounded-se":T()}],"rounded-ee":[{"rounded-ee":T()}],"rounded-es":[{"rounded-es":T()}],"rounded-tl":[{"rounded-tl":T()}],"rounded-tr":[{"rounded-tr":T()}],"rounded-br":[{"rounded-br":T()}],"rounded-bl":[{"rounded-bl":T()}],"border-w":[{border:O()}],"border-w-x":[{"border-x":O()}],"border-w-y":[{"border-y":O()}],"border-w-s":[{"border-s":O()}],"border-w-e":[{"border-e":O()}],"border-w-t":[{"border-t":O()}],"border-w-r":[{"border-r":O()}],"border-w-b":[{"border-b":O()}],"border-w-l":[{"border-l":O()}],"divide-x":[{"divide-x":O()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":O()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Lt,Qt,_t]}],"outline-w":[{outline:["",Lt,en,Yt]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",d,an,Jt]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",u,an,Jt]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[Lt,Yt]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":O()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",m,an,Jt]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[Lt,Qt,_t]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Lt]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Qt,_t]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Lt]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Qt,_t]}],filter:[{filter:["","none",Qt,_t]}],blur:[{blur:E()}],brightness:[{brightness:[Lt,Qt,_t]}],contrast:[{contrast:[Lt,Qt,_t]}],"drop-shadow":[{"drop-shadow":["","none",f,an,Jt]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",Lt,Qt,_t]}],"hue-rotate":[{"hue-rotate":[Lt,Qt,_t]}],invert:[{invert:["",Lt,Qt,_t]}],saturate:[{saturate:[Lt,Qt,_t]}],sepia:[{sepia:["",Lt,Qt,_t]}],"backdrop-filter":[{"backdrop-filter":["","none",Qt,_t]}],"backdrop-blur":[{"backdrop-blur":E()}],"backdrop-brightness":[{"backdrop-brightness":[Lt,Qt,_t]}],"backdrop-contrast":[{"backdrop-contrast":[Lt,Qt,_t]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Lt,Qt,_t]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Lt,Qt,_t]}],"backdrop-invert":[{"backdrop-invert":["",Lt,Qt,_t]}],"backdrop-opacity":[{"backdrop-opacity":[Lt,Qt,_t]}],"backdrop-saturate":[{"backdrop-saturate":[Lt,Qt,_t]}],"backdrop-sepia":[{"backdrop-sepia":["",Lt,Qt,_t]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Qt,_t]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Lt,"initial",Qt,_t]}],ease:[{ease:["linear","initial",v,Qt,_t]}],delay:[{delay:[Lt,Qt,_t]}],animate:[{animate:["none",h,Qt,_t]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,Qt,_t]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:L()}],"rotate-x":[{"rotate-x":L()}],"rotate-y":[{"rotate-y":L()}],"rotate-z":[{"rotate-z":L()}],scale:[{scale:$()}],"scale-x":[{"scale-x":$()}],"scale-y":[{"scale-y":$()}],"scale-z":[{"scale-z":$()}],"scale-3d":["scale-3d"],skew:[{skew:V()}],"skew-x":[{"skew-x":V()}],"skew-y":[{"skew-y":V()}],transform:[{transform:[Qt,_t,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:F()}],"translate-x":[{"translate-x":F()}],"translate-y":[{"translate-y":F()}],"translate-z":[{"translate-z":F()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Qt,_t]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Qt,_t]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[Lt,en,Yt,Ut]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function vn(...e){return bn(k(e))}const hn=(e,t)=>(e.addEventListener("change",t),()=>e.removeEventListener("change",t)),yn=()=>{if("undefined"==typeof window)return!1;const e=navigator;return"boolean"==typeof e.userAgentData?.mobile?e.userAgentData.mobile:window.matchMedia("(pointer: coarse)").matches||window.matchMedia("(max-width: 640px)").matches},wn=e=>{if("undefined"==typeof window)return()=>{};const t=window.matchMedia("(pointer: coarse)"),n=window.matchMedia("(max-width: 640px)"),r=()=>{e(t.matches||n.matches)};r();const o=hn(t,r),a=hn(n,r);return()=>{o(),a()}};function xn(e,t){if(e)if("function"==typeof e)e(t);else if(function(e){return null!==e&&"object"==typeof e&&"current"in e}(e))try{e.current=t}catch{}}function In(...e){return a(t=>{e.forEach(e=>{xn(e,t)})},e)}const Nn=(()=>{if("undefined"==typeof document)return!1;let e=!1;const t={};Object.defineProperty(t,"container",{get:()=>(e=!0,"nearest")});try{document.documentElement.scrollIntoView(t)}catch{}return e})();function kn(e){Nn?e.scrollIntoView({block:"center",container:"nearest"}):e.scrollIntoView({block:"nearest"})}function Cn(e){return function(e){return!!(e&&"object"==typeof e&&"value"in e&&"peek"in e&&"function"==typeof e.peek&&"subscribe"in e&&"function"==typeof e.subscribe)}(e)?e.value:e}const Dn=S("relative flex shrink-0 overflow-hidden",{variants:{size:{sm:"size-6 text-xs",md:"size-8 text-sm",lg:"size-12 text-base"},shape:{circle:"rounded-full",square:"rounded-md"}},defaultVariants:{size:"md",shape:"circle"}}),Sn=i(({children:e,className:t,size:n,shape:r,...i},l)=>{const[c,d]=o("idle"),u=a(e=>{d(e)},[]),m=s(()=>({imageLoadingStatus:c,onImageLoadingStatusChange:u}),[c,u]);/* @__PURE__ */
2
2
  return I(R,{value:m,children:/* @__PURE__ */I("span",{"data-component":"Avatar.Root",ref:l,className:vn(Dn({size:n,shape:r}),t),...i,children:e})})});Sn.displayName="Avatar";const Mn=i(({src:e,alt:t,className:n,onLoadingStatusChange:r,...a},i)=>{const{imageLoadingStatus:s,onImageLoadingStatusChange:c}=A(),[d,u]=o(!1);return l(()=>{if(u(!1),!e)return;c("loading"),r?.("loading");const t=new Image,n=()=>{c("loaded"),r?.("loaded")},o=()=>{u(!0),c("error"),r?.("error")};return t.addEventListener("load",n),t.addEventListener("error",o),t.src=e,()=>{t.removeEventListener("load",n),t.removeEventListener("error",o)}},[e,c,r]),!e||d||"error"===s?null:/* @__PURE__ */I("img",{"data-component":"Avatar.Image",ref:i,src:e,alt:t,className:vn("aspect-square h-full w-full object-cover",n),...a})});Mn.displayName="Avatar.Image";const Rn=i(({children:e,className:t,delayMs:n=0,...r},a)=>{const{imageLoadingStatus:i}=A(),[s,c]=o(0===n);l(()=>{if(0===n)return;const e=setTimeout(()=>{c(!0)},n);return()=>{clearTimeout(e)}},[n]);return s&&("idle"===i||"error"===i)?/* @__PURE__ */I("span",{"data-component":"Avatar.Fallback",ref:a,className:vn("flex h-full w-full items-center justify-center","cursor-default bg-avatar-fallback font-medium text-alt uppercase",t),...r,children:e}):null});Rn.displayName="Avatar.Fallback";const An=Object.assign(Sn,{Root:Sn,Image:Mn,Fallback:Rn}),Pn=S(["inline-flex items-center justify-center","font-semibold text-main","box-border rounded-sm transition-highlight","focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring focus-visible:ring-offset-3 focus-visible:ring-offset-ring-offset","group-data-[tone=inverse]:[--color-ring-offset:var(--color-surface-selected)] group-data-[tone=inverse]:[--color-ring:var(--color-ring-alt)]","active:bg-btn-active active:text-alt data-[active=true]:bg-btn-active data-[active=true]:text-alt","disabled:pointer-events-none disabled:select-none disabled:opacity-30","cursor-pointer overflow-hidden text-ellipsis whitespace-nowrap"],{variants:{variant:{text:"bg-btn-primary hover:bg-btn-primary-hover hover:text-main",filled:"bg-btn-secondary hover:bg-btn-secondary-hover hover:text-main",solid:"bg-btn-tertiary text-alt hover:bg-btn-tertiary-hover",outline:"border border-bdr-strong bg-btn-primary hover:bg-btn-primary-hover"},size:{sm:"h-9 gap-2 px-3.5 text-sm",md:"h-10 gap-2.5 px-3.5 text-base",lg:"h-11.5 gap-3 px-4 text-lg"}},defaultVariants:{variant:"text",size:"md"}}),Tn=i(({className:e,variant:t="text",size:n="md",iconSize:r,iconStrokeWidth:o=1.5,startIconClassName:a,endIconClassName:i,startIcon:s,label:l,endIcon:c,title:d,children:u,disabled:m,...f},p)=>{const g=s,b=c,v=(e=>{if("number"==typeof e)return e;switch(e){case"sm":return 14;case"md":return 20;case"lg":return 24}})(r??n??"md");/* @__PURE__ */
3
- return I("button",{"data-component":"Button",ref:p,type:"button",className:vn(Pn({variant:t,size:n}),e),title:d,"aria-label":d??l,"aria-disabled":m,"data-disabled":m??void 0,disabled:m,...f,children:[g&&/* @__PURE__ */I(g,{className:a,size:v,strokeWidth:o}),u,l,b&&/* @__PURE__ */I(b,{className:i,size:v,strokeWidth:o})]})});Tn.displayName="Button";const On=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},zn=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),En=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var Ln={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const $n=i(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:a,iconNode:i,...s},l)=>c("svg",{ref:l,...Ln,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:zn("lucide",o),...!a&&!En(s)&&{"aria-hidden":"true"},...s},[...i.map(([e,t])=>c(e,t)),...Array.isArray(a)?a:[a]])),Vn=(e,t)=>{const n=i(({className:n,...r},o)=>{return c($n,{ref:o,iconNode:t,className:zn(`lucide-${a=On(e),a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...r});var a});return n.displayName=On(e),n},Fn=Vn("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),Kn=Vn("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),Hn=Vn("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Gn=Vn("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Bn=Vn("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),jn=Vn("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),qn=Vn("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),Wn=Vn("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),_n=Vn("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]),Yn=Vn("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),Un=Vn("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Zn=Vn("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Xn=Vn("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),Jn=Vn("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Qn=Vn("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),er=Vn("lock-keyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]),tr=Vn("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),nr=Vn("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),rr=Vn("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function or({ref:e,isActive:t,disabled:n,focusMode:r="roving-tabindex",checkFocusWithin:o}){l(()=>{if(e?.current&&"activedescendant"!==r&&!n&&t&&document.activeElement!==e.current){if(o?.enabled){const t=e.current.closest(`[role="${o.containerRole}"]`),n=t?.contains(document.activeElement);if(!n)return}"function"==typeof e.current.focus&&e.current.focus({focusVisible:!0})}},[t,n,r,o?.enabled,o?.containerRole,e])}function ar({open:e,selection:t,setActive:n,getItems:r,isItemDisabled:o,containerRef:a,buildElementId:i,enabled:s=!0}){const l=d(!1),c=d(!1);u(()=>{if(!s||!e)return l.current=e,void(c.current=!1);const d=!l.current;if(l.current=!0,d&&(c.current=!1),c.current)return;const u=r();if(0===u.length)return;const m=u.find(e=>t.has(e)&&!o(e));if(m){n(m),c.current=!0;const e=a?.current;if(e){const t=i?i(m):m,n=e.querySelector(`#${CSS.escape(t)}`);n&&kn(n)}return}const f=u.find(e=>!o(e));f&&(n(f),c.current=!0)},[e,s,t,n,r,o,a,i])}const ir="input-blink-attention",sr=(e,t,{scrollIntoView:n=!0}={})=>{const[r,a]=o(!1);return l(()=>{if(!t)return;const r=e.current;if(null==r)return;n&&r.scrollIntoView({behavior:"smooth",block:"center"}),r.classList.remove(ir),r.offsetWidth,r.classList.add(ir),a(!0);const o=window.setTimeout(()=>{a(!1),e.current?.classList.remove(ir)},1200);return()=>{window.clearTimeout(o)}},[t,n,e]),r};function lr({enabled:e,contentRef:t,excludeRefs:n=[],onPointerDownOutside:r,onInteractOutside:o,closeOn:i="pointerdown",onClose:s}){const c=d(!1),u=d(t),m=d(n),f=d(r),p=d(o),g=d(s),b=d(i);u.current=t,m.current=n,f.current=r,p.current=o,g.current=s,b.current=i;const v=a(e=>{const t=e.composedPath(),n=t[0],r=u.current;if(!(n instanceof Node))return!1;if(r.current&&t.includes(r.current))return!1;for(const o of m.current){const e=o?.current;if(e&&t.includes(e))return!1}return!t.some(e=>e instanceof Element&&e.hasAttribute("data-click-outside-ignore"))},[]),h=a(e=>{c.current=!1;const t=b.current;v(e)&&(f.current?.(e),p.current?.(e),"pointerdown"!==t?e.defaultPrevented||(c.current=!0):e.defaultPrevented||g.current?.())},[v]),y=a(e=>{const t=c.current;c.current=!1,"click"===b.current&&t&&v(e)&&(e.defaultPrevented||g.current?.())},[v]);l(()=>{if(e)return document.addEventListener("pointerdown",h),"click"===i&&document.addEventListener("click",y),()=>{document.removeEventListener("pointerdown",h),document.removeEventListener("click",y)}},[i,e,y,h]),l(()=>{e&&"click"===i||(c.current=!1)},[e,i])}function cr(e,t,n,r=void 0!==e){const[i,s]=o(t),c=r?e:i,u=d(e),m=d(r);l(()=>{r&&e!==u.current&&void 0!==e&&s(e),m.current&&!r&&s(t),u.current=e,m.current=r},[r,e,t]);const f=d(c),p=d(r),g=d(n);f.current=c,p.current=r,g.current=n;return[c,a(e=>{const t=f.current,n=function(e){return"function"==typeof e}(e)?e(t):e;f.current=n,p.current||s(n),g.current?.(n)},[])]}function dr(e,t,n){const r=void 0!==e,o=null===e?void 0:e,i=d(n);i.current=n;const s=a(e=>{i.current?.(e??null)},[]),[l,c]=cr(o,t,s,r);return[l,a(e=>{c("function"==typeof e?t=>e(t)??void 0:e??void 0)},[c])]}const ur=10;function mr({enabled:e,anchorRef:t,contentRef:n,side:r="bottom",align:a="start"}){const[i,s]=o(null);return l(()=>{if(!e||!t?.current||!n?.current)return;const o=()=>{if(!t.current||!n.current)return;const e=t.current.getBoundingClientRect(),o=n.current.offsetWidth,i=n.current.offsetHeight,l=window.innerWidth,c=window.innerHeight;let d,u,m,f=r;if("top"===r||"bottom"===r){if("bottom"===r){if(d=e.bottom,d+i>c-ur){const t=e.top-i;t>=ur&&(d=t,f="top")}}else if(d=e.top-i,d<ur){const t=e.bottom;t+i<=c-ur&&(d=t,f="bottom")}"start"===a?(u=e.left,u+o>l-ur&&(u=void 0,m=l-e.right)):(m=l-e.right,e.right-o<ur&&(m=void 0,u=e.left))}else{if("right"===r){if(u=e.right,u+o>l-ur){const t=e.left-o;t>=ur&&(u=t,f="left")}}else{const t=e.left-o;if(t<ur){const n=e.right;n+o<=l-ur?(u=n,f="right"):u=t}else u=t}"start"===a?(d=e.top,d+i>c-ur&&(d=Math.max(ur,c-i-ur))):(d=e.bottom-i,d<ur&&(d=ur))}s({top:d,left:u,right:m,side:f})};o();const i=new ResizeObserver(o);return i.observe(n.current),i.observe(t.current),window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),()=>{i.disconnect(),window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0)}},[e,r,a,t,n]),i}const fr=()=>!0;function pr(e){const{getRows:t,getCellCount:n,isRowDisabled:r,isCellDisabled:o,isCellInteractive:i=fr,activeCell:s,setActiveCell:l,loop:c=!1,onActivate:u,onEscape:m}=e,f=d(0),p=a((e,t,n)=>{let o=e,a=0;const i=n.length;for(;a<i;){if(c)o<0?o=n.length-1:o>=n.length&&(o=0);else if(o<0||o>=n.length)return null;const e=n[o];if(e&&!r(e))return o;o+=t,a++}return null},[c,r]),g=a((e,t,n,r)=>{let a=t,s=0;for(;s<r;){if(c)a<0?a=r-1:a>=r&&(a=0);else if(a<0||a>=r)return null;if(!o(e,a)&&i(e,a))return a;a+=n,s++}return null},[c,o,i]),b=a(e=>{const r=t();if(!r.length)return;const o=s?r.indexOf(s.row):-1;let a;a=-1===o?e>0?0:r.length-1:o+e;const i=p(a,e,r);if(null===i)return;const c=r[i];if(!c)return;const d=n(c),u=Math.min(f.current,d-1),m=g(c,u,1,d);null!==m&&l({row:c,col:m})},[t,s,n,p,g,l]),v=a(e=>{if(!s){const e=t();if(!e.length)return;const r=p(0,1,e);if(null===r)return;const o=e[r];if(!o)return;const a=n(o),i=g(o,0,1,a);return void(null!==i&&(f.current=i,l({row:o,col:i})))}const r=n(s.row),o=s.col+e,a=g(s.row,o,e,r);null!==a&&(f.current=a,l({row:s.row,col:a}))},[s,t,n,p,g,l]),h=a(e=>{const a=t();if(a.length)switch(e.key){case"ArrowDown":e.preventDefault(),b(1);break;case"ArrowUp":e.preventDefault(),b(-1);break;case"ArrowRight":e.preventDefault(),v(1);break;case"ArrowLeft":e.preventDefault(),v(-1);break;case"Home":if(e.preventDefault(),e.ctrlKey||e.metaKey){const e=p(0,1,a);if(null!==e){const t=a[e];if(t){const e=n(t),r=g(t,0,1,e);null!==r&&(f.current=r,l({row:t,col:r}))}}}else if(s){const e=n(s.row),t=g(s.row,0,1,e);null!==t&&(f.current=t,l({row:s.row,col:t}))}break;case"End":if(e.preventDefault(),e.ctrlKey||e.metaKey){const e=p(a.length-1,-1,a);if(null!==e){const t=a[e];if(t){const e=n(t),r=g(t,e-1,-1,e);null!==r&&(f.current=r,l({row:t,col:r}))}}}else if(s){const e=n(s.row),t=g(s.row,e-1,-1,e);null!==t&&(f.current=t,l({row:s.row,col:t}))}break;case"Enter":case" ":e.preventDefault(),!s||r(s.row)||o(s.row,s.col)||u?.(s.row,s.col);break;case"Escape":e.preventDefault(),m?.()}},[t,s,b,v,n,p,g,l,r,o,u,m]);return{moveRow:b,moveCol:v,handleKeyDown:h}}function gr(){const e=d(/* @__PURE__ */new Map),[t,n]=o(0),r=d(null),i=d(!1),s=a(()=>{i.current||(i.current=!0,queueMicrotask(()=>{i.current=!1,n(e=>e+1)}))},[]);return{registerItem:a((t,n=!1,r=null)=>{const o=e.current.get(t);o&&o.disabled===n&&o.element===r||(e.current.set(t,{disabled:n,element:r}),s())},[s]),unregisterItem:a(t=>{e.current.delete(t)&&s()},[s]),getItems:a(()=>{if(r.current?.version===t)return[...r.current.ids];const n=Array.from(e.current.entries()),o=/* @__PURE__ */new Map;for(const[e,t]of n)if(t.element)o.set(e,t.element);else{const t=document.querySelector(`[data-registry-id="${e}"]`)??document.getElementById(e);o.set(e,t)}const a=n.map(([e])=>e).sort((e,t)=>{const n=o.get(e),r=o.get(t);if(!n||!r)return 0;const a=n.compareDocumentPosition(r);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0});return r.current={version:t,ids:a},[...a]},[t]),isItemDisabled:a(t=>e.current.get(t)?.disabled??!1,[]),getItemElement:a(t=>e.current.get(t)?.element??null,[]),registryVersion:t}}function br(){const e=d(/* @__PURE__ */new Map);return{registerItemText:a((t,n)=>{e.current.set(t,n)},[]),unregisterItemText:a(t=>{e.current.delete(t)},[]),getItemText:a(t=>e.current.get(t),[])}}function vr(e){const{getItems:t,isItemDisabled:n,isItemVisible:r=()=>!0,active:o,setActive:i,loop:s=!1,orientation:l="vertical",onSelect:c,onEscape:d}=e,u=a(e=>!n(e)&&r(e),[n,r]),m=a(e=>{const n=t();if(!n.length)return;const r=o?n.indexOf(o):-1;let a,l=0;const c=n.length;for(a=-1===r?e>0?0:n.length-1:r+e;l<c;){if(s)a<0?a=n.length-1:a>=n.length&&(a=0);else if(a<0||a>=n.length)return;const t=n[a];if(t&&u(t))return void i(t);a+=e,l++}},[t,o,i,s,u]),f=a(e=>{const r=t();if(!r.length)return;const a="vertical"===l,s=a?"ArrowDown":"ArrowRight",f=a?"ArrowUp":"ArrowLeft";switch(e.key){case s:e.preventDefault(),m(1);break;case f:e.preventDefault(),m(-1);break;case"Home":e.preventDefault();{const e=r.find(u);e&&i(e)}break;case"End":e.preventDefault();{const e=[...r].reverse().find(u);e&&i(e)}break;case"Enter":case" ":e.preventDefault(),o&&!n(o)&&c?.(o);break;case"Escape":e.preventDefault(),d?.()}},[t,o,m,i,n,u,l,c,d]);return{moveActive:m,handleKeyDown:f}}const hr={canScrollLeft:!1,canScrollRight:!1,hasOverflow:!1};function yr(e){const[t,n]=o(hr),r=d(0),i=a(()=>{const t=e.current;if(!t)return void n(hr);n({hasOverflow:t.scrollWidth-t.clientWidth>1,canScrollLeft:t.scrollLeft>1,canScrollRight:t.scrollLeft<t.scrollWidth-t.clientWidth-1})},[e]),s=a(()=>{cancelAnimationFrame(r.current),r.current=requestAnimationFrame(i)},[i]);l(()=>{const t=e.current;if(!t)return;i(),t.addEventListener("scroll",s,{passive:!0});const n=new ResizeObserver(s);n.observe(t);const o=()=>{for(let e=0;e<t.children.length;e++){const r=t.children[e];r&&n.observe(r)}};o();const a=new MutationObserver(()=>{o(),s()});return a.observe(t,{childList:!0,subtree:!0}),()=>{t.removeEventListener("scroll",s),n.disconnect(),a.disconnect(),cancelAnimationFrame(r.current)}},[e,i,s]);return{...t,scrollBy:a(t=>{e.current?.scrollBy({left:t,behavior:"smooth"})},[e])}}const wr=10;function xr({enabled:e,mousePosition:t,contentRef:n}){const[r,a]=o(null);return l(()=>{if(!e||!t||!n?.current)return;const r=()=>{if(!n.current)return;const e=n.current.getBoundingClientRect(),r=window.innerWidth,o=window.innerHeight;let i=t.y,s=t.x;if(i+e.height>o-wr){const n=t.y-e.height;i=n>=wr?n:Math.max(wr,o-e.height-wr)}if(s+e.width>r-wr){const n=t.x-e.width;s=n>=wr?n:Math.max(wr,r-e.width-wr)}a({top:i,left:s})};return r(),window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[e,t,n]),l(()=>{e||a(null)},[e]),r}const Ir=(e,t)=>{const n=X();l(()=>{const r=e.current;if(r&&t&&n)return n.register(r),()=>n.unregister(r)},[e,t,n])};function Nr(e){const{baseId:t,getItems:n,getItemId:r,value:o,onValueChange:i,isItemDisabled:s,loop:l=!1,orientation:c="vertical"}=e,d=a(e=>{e&&(i(e),r&&requestAnimationFrame(()=>{document.getElementById(r(t,e))?.focus()}))},[t,i,r]),{handleKeyDown:u}=vr({getItems:n,isItemDisabled:s,active:o,setActive:d,loop:l,orientation:c});return{handleKeyDown:u}}function kr({id:e,active:t,disabled:n,getItems:r,isItemDisabled:o,focusMode:a="roving-tabindex"}){return s(()=>{if("activedescendant"===a)return{isFocusable:!1,tabIndex:-1};if(n)return{isFocusable:!1,tabIndex:-1};const i=r(),s=i.length>0?i[0]:void 0,l=((t&&i.includes(t)?t:void 0)??i.find(e=>!o(e))??s??e)===e;return{isFocusable:l,tabIndex:l?0:-1}},[e,t,n,r,o,a])}function Cr({containerRef:e,activeId:t,orientation:n="vertical",buildElementId:r}){u(()=>{if(!t||!e?.current)return;const o=r?r(t):t,a=e.current.querySelector(`#${CSS.escape(o)}`);a&&a.scrollIntoView({block:"nearest",inline:"horizontal"===n?"nearest":void 0,behavior:"auto"})},[t,e,n,r])}const Dr=(e,t)=>{l(()=>{if(!e)return;const n=t??document.body,r=n.style.overflow;return n.style.overflow="hidden",()=>{n.style.overflow=r}},[e,t])};function Sr({open:e,selectedId:t,setActive:n,items:r,virtuosoRef:o}){const a=d(!1);u(()=>{if(!e)return void(a.current=!1);const i=!a.current;if(a.current=!0,!i)return;if(!t)return;const s=r.findIndex(e=>e.id===t);if(s<0)return;n(t);let l=0,c=0;const d=()=>{const e=o?.current;e?e.scrollToIndex({index:s,align:"center",behavior:"auto"}):l++>=8||(c=requestAnimationFrame(d))};return d(),()=>{c&&cancelAnimationFrame(c)}},[e,t,r,n,o])}function Mr(e){const{getItems:t,isItemDisabled:n,getItemText:r,active:o,setActive:i,onMatch:s,timeout:l=500}=e,c=d(""),u=d(null),m=a(()=>{c.current="",u.current&&(clearTimeout(u.current),u.current=null)},[]);return{handleTypeAhead:a(e=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{c.current="",u.current=null},l);const a=t();if(!a.length)return;const d=e.toLowerCase(),m=c.current+d;c.current=m;if(m.length>1&&m.split("").every(e=>e===d)){for(const o of a){if(n(o))continue;const e=r(o);if(e?.toLowerCase().startsWith(m))return i(o),void s?.(o)}const e=a.filter(e=>{if(n(e))return!1;const t=r(e);return t?.toLowerCase().startsWith(d)});if(0===e.length)return;const t=o?e.indexOf(o):-1,l=e[(t+1)%e.length];l&&(i(l),s?.(l))}else{const e=o?a.indexOf(o):-1,t=e>=0?[...a.slice(e+1),...a.slice(0,e+1)]:a;for(const o of t){if(n(o))continue;const e=r(o);if(e?.toLowerCase().startsWith(m))return i(o),void s?.(o)}if(m.length>1)for(const o of a){if(n(o))continue;const e=r(o);if(e?.toLowerCase().startsWith(d))return c.current=d,i(o),void s?.(o)}}},[t,n,r,o,i,s,l]),resetSearch:m}}function Rr(e){const{getItems:t,isItemDisabled:n,getItemText:r,active:o,setActive:i,value:s,open:l,setOpenInternal:c,closeWithFocus:d,disabled:u,onSelect:m}=e,{handleKeyDown:f}=vr({getItems:t,isItemDisabled:n,active:o,setActive:i,loop:!1,orientation:"vertical",onSelect:m,onEscape:d}),{handleTypeAhead:p}=Mr({getItems:t,isItemDisabled:n,getItemText:r,active:o,setActive:i});return{keyHandler:a(e=>{if(!u){if(!l&&["ArrowDown","ArrowUp","Enter"," ","Home","End"].includes(e.key)){e.preventDefault(),c(!0);const r="End"===e.key,o=10;let a=0;const l=()=>{const e=t();if(e.length>0)if(r){const t=[...e].reverse().find(e=>!n(e));t&&i(t)}else{const t=(s&&e.includes(s)&&!n(s)?s:null)||e.find(e=>!n(e));t&&i(t)}else a<o&&(a++,requestAnimationFrame(l))};return void requestAnimationFrame(l)}if(l&&"Tab"===e.key)o?m(o):d();else{if(l&&("PageUp"===e.key||"PageDown"===e.key)){e.preventDefault();const r=t();if(0===r.length)return;const a=o?r.indexOf(o):-1,s="PageDown"===e.key?10:-10;let l=a+s;l<0&&(l=0),l>=r.length&&(l=r.length-1);const c=s>0?1:-1;let d=r[l];for(;l>=0&&l<r.length&&d&&n(d);)l+=c,d=r[l];return void(l>=0&&l<r.length&&d&&!n(d)&&i(d))}if(1!==e.key.length||" "===e.key||e.ctrlKey||e.metaKey||e.altKey)f(e);else if(e.preventDefault(),l)p(e.key);else{c(!0);const n=10;let r=0;const o=()=>{t().length>0?p(e.key):r<n&&(r++,requestAnimationFrame(o))};requestAnimationFrame(o)}}}},[u,l,o,s,t,n,c,d,i,m,p,f])}}function Ar(e){const{baseId:t,getItems:n,getNextFocusable:r,value:o,onValueChange:i,isItemDisabled:l,registryVersion:c}=e,d=s(()=>n(),[n,c]),u=a(e=>{i(e),r&&requestAnimationFrame(()=>{document.getElementById(r(t,e))?.focus()})},[t,i,r]),m=null!=o?d.indexOf(o):-1,f=0===m,p=m===d.length-1,g=s(()=>{if(-1===m||p)return!1;const e=d[m+1];return null!=e&&!l(e)},[m,p,d,l]),b=s(()=>{if(m<=0)return!1;const e=d[m-1];return null!=e&&!l(e)},[m,d,l]),v=a(e=>{-1!==d.indexOf(e)&&(l(e)||u(e))},[d,l,u]),h=a(()=>{if(-1===m||p)return;const e=d[m+1];null==e||l(e)||u(e)},[m,p,d,l,u]),y=a(()=>{if(m<=0)return;const e=d[m-1];null==e||l(e)||u(e)},[m,d,l,u]),w=a(()=>{const e=d.find(e=>!l(e));null!=e&&u(e)},[d,l,u]),x=a(()=>{const e=[...d].reverse().find(e=>!l(e));null!=e&&u(e)},[d,l,u]),I=a(e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),y();break;case"ArrowRight":e.preventDefault(),h();break;case"Home":e.preventDefault(),w();break;case"End":e.preventDefault(),x()}},[h,y,w,x]);return{goToNext:h,goToPrevious:y,goToFirst:w,goToLast:x,goTo:v,handleKeyDown:I,isFirst:f,isLast:p,canGoNext:g,canGoPrevious:b,currentIndex:m,items:d}}function Pr({enabled:e,submenuRef:t,side:n,graceMs:r=300}){const o=d(null),i=d(0);l(()=>{if(!e)return o.current=null,void(i.current=0);i.current=Date.now();const t=e=>{o.current={x:e.clientX,y:e.clientY},i.current=Date.now()};return document.addEventListener("pointermove",t,{passive:!0}),()=>{document.removeEventListener("pointermove",t)}},[e]);return{isInSafeArea:a((a,s)=>{if(!e)return!1;const l=t.current?.getBoundingClientRect();if(!l)return!1;const c=o.current;if(!c)return Date.now()-i.current<r;const d="right"===n?l.left:l.right,u={x:d,y:l.top},m={x:d,y:l.bottom};return!("right"===n&&a>=d)&&(!("left"===n&&a<=d)&&function(e,t,n,r){const o=(e,t,n)=>(e.x-n.x)*(t.y-n.y)-(t.x-n.x)*(e.y-n.y),a=o(e,t,n),i=o(e,n,r),s=o(e,r,t);return!((a<0||i<0||s<0)&&(a>0||i>0||s>0))}({x:a,y:s},c,u,m))},[e,t,n,r])}}const Tr=(e,t)=>{l(()=>{const n=Cn(e);n&&t(n)},[e,t])};function Or(e){const{items:t,activeIndex:n,setActiveIndex:r,scrollToIndex:o,onExpand:i,onCollapse:s,onSelect:l,onEscape:c,loop:d=!1,isItemDisabled:u=()=>!1,getPageSize:m}=e,f=a(e=>{if(!t.length)return;const a=n??-1;let i,s=0;const l=t.length;for(i=-1===a?e>0?0:t.length-1:a+e;s<l;){if(d)i<0?i=t.length-1:i>=t.length&&(i=0);else if(i<0||i>=t.length)return;const n=t[i];if(n&&!u(n))return r(i),void o(i);i+=e,s++}},[t,n,r,o,d,u]),p=a(e=>e.parentId?t.findIndex(t=>t.id===e.parentId):null,[t]),g=a((e,n)=>{const r=t[n+1];return r?.parentId===e?n+1:null},[t]),b=a(e=>{if(!t.length)return;const a=null!==n?t[n]:null;switch(e.key){case"ArrowDown":e.preventDefault(),f(1);break;case"ArrowUp":e.preventDefault(),f(-1);break;case"ArrowRight":if(e.preventDefault(),a&&null!==n)if(a.hasChildren&&!a.isExpanded)i?.(a.id);else if(a.isExpanded){const e=g(a.id,n),i=null!==e?t[e]:void 0;null!==e&&i&&!u(i)&&(r(e),o(e))}break;case"ArrowLeft":if(e.preventDefault(),a)if(a.isExpanded)s?.(a.id);else{const e=p(a),n=null!==e?t[e]:void 0;null!==e&&n&&!u(n)&&(r(e),o(e))}break;case"Home":e.preventDefault();{const e=t.findIndex(e=>!u(e));-1!==e&&(r(e),o(e))}break;case"End":e.preventDefault();for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&!u(n)){r(e),o(e);break}}break;case"PageUp":e.preventDefault();{const e=m?.()??10;f(-e)}break;case"PageDown":e.preventDefault();{const e=m?.()??10;f(e)}break;case"Enter":case" ":e.preventDefault(),a&&null!==n&&!u(a)&&l?.(a.id,n);break;case"Escape":e.preventDefault(),c?.()}},[t,n,f,r,o,i,s,l,c,u,p,g,m]);return{moveActive:f,handleKeyDown:b}}const zr=i(({size:e=24,className:t,...n},r)=>/* @__PURE__ */I("svg",{ref:r,xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:vn("lucide lucide-circle-disc",Cn(t)),"aria-hidden":"true",...n,children:[
3
+ return I("button",{"data-component":"Button",ref:p,type:"button",className:vn(Pn({variant:t,size:n}),e),title:d,"aria-label":d??l,"aria-disabled":m,"data-disabled":m??void 0,disabled:m,...f,children:[g&&/* @__PURE__ */I(g,{className:a,size:v,strokeWidth:o}),u,l,b&&/* @__PURE__ */I(b,{className:i,size:v,strokeWidth:o})]})});Tn.displayName="Button";const On=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},zn=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),En=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var Ln={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const $n=i(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:a,iconNode:i,...s},l)=>c("svg",{ref:l,...Ln,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:zn("lucide",o),...!a&&!En(s)&&{"aria-hidden":"true"},...s},[...i.map(([e,t])=>c(e,t)),...Array.isArray(a)?a:[a]])),Vn=(e,t)=>{const n=i(({className:n,...r},o)=>{return c($n,{ref:o,iconNode:t,className:zn(`lucide-${a=On(e),a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...r});var a});return n.displayName=On(e),n},Fn=Vn("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),Kn=Vn("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),Hn=Vn("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Gn=Vn("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Bn=Vn("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),jn=Vn("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),qn=Vn("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),Wn=Vn("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),_n=Vn("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]),Yn=Vn("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),Un=Vn("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Zn=Vn("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Xn=Vn("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),Jn=Vn("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Qn=Vn("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),er=Vn("lock-keyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]),tr=Vn("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),nr=Vn("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),rr=Vn("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function or({ref:e,isActive:t,disabled:n,focusMode:r="roving-tabindex",checkFocusWithin:o,onProgrammaticFocus:a}){l(()=>{if(e?.current&&"activedescendant"!==r&&!n&&t&&document.activeElement!==e.current){if(o?.enabled){const t=e.current.closest(`[role="${o.containerRole}"]`),n=t?.contains(document.activeElement);if(!n)return}"function"==typeof e.current.focus&&(a?.(),e.current.focus({focusVisible:!0}))}},[t,n,r,o?.enabled,o?.containerRole,e,a])}function ar({open:e,selection:t,setActive:n,getItems:r,isItemDisabled:o,containerRef:a,buildElementId:i,enabled:s=!0}){const l=d(!1),c=d(!1);u(()=>{if(!s||!e)return l.current=e,void(c.current=!1);const d=!l.current;if(l.current=!0,d&&(c.current=!1),c.current)return;const u=r();if(0===u.length)return;const m=u.find(e=>t.has(e)&&!o(e));if(m){n(m),c.current=!0;const e=a?.current;if(e){const t=i?i(m):m,n=e.querySelector(`#${CSS.escape(t)}`);n&&kn(n)}return}const f=u.find(e=>!o(e));f&&(n(f),c.current=!0)},[e,s,t,n,r,o,a,i])}const ir="input-blink-attention",sr=(e,t,{scrollIntoView:n=!0}={})=>{const[r,a]=o(!1);return l(()=>{if(!t)return;const r=e.current;if(null==r)return;n&&r.scrollIntoView({behavior:"smooth",block:"center"}),r.classList.remove(ir),r.offsetWidth,r.classList.add(ir),a(!0);const o=window.setTimeout(()=>{a(!1),e.current?.classList.remove(ir)},1200);return()=>{window.clearTimeout(o)}},[t,n,e]),r};function lr({enabled:e,contentRef:t,excludeRefs:n=[],onPointerDownOutside:r,onInteractOutside:o,closeOn:i="pointerdown",onClose:s}){const c=d(!1),u=d(t),m=d(n),f=d(r),p=d(o),g=d(s),b=d(i);u.current=t,m.current=n,f.current=r,p.current=o,g.current=s,b.current=i;const v=a(e=>{const t=e.composedPath(),n=t[0],r=u.current;if(!(n instanceof Node))return!1;if(r.current&&t.includes(r.current))return!1;for(const o of m.current){const e=o?.current;if(e&&t.includes(e))return!1}return!t.some(e=>e instanceof Element&&e.hasAttribute("data-click-outside-ignore"))},[]),h=a(e=>{c.current=!1;const t=b.current;v(e)&&(f.current?.(e),p.current?.(e),"pointerdown"!==t?e.defaultPrevented||(c.current=!0):e.defaultPrevented||g.current?.())},[v]),y=a(e=>{const t=c.current;c.current=!1,"click"===b.current&&t&&v(e)&&(e.defaultPrevented||g.current?.())},[v]);l(()=>{if(e)return document.addEventListener("pointerdown",h),"click"===i&&document.addEventListener("click",y),()=>{document.removeEventListener("pointerdown",h),document.removeEventListener("click",y)}},[i,e,y,h]),l(()=>{e&&"click"===i||(c.current=!1)},[e,i])}function cr(e,t,n,r=void 0!==e){const[i,s]=o(t),c=r?e:i,u=d(e),m=d(r);l(()=>{r&&e!==u.current&&void 0!==e&&s(e),m.current&&!r&&s(t),u.current=e,m.current=r},[r,e,t]);const f=d(c),p=d(r),g=d(n);f.current=c,p.current=r,g.current=n;return[c,a(e=>{const t=f.current,n=function(e){return"function"==typeof e}(e)?e(t):e;f.current=n,p.current||s(n),g.current?.(n)},[])]}function dr(e,t,n){const r=void 0!==e,o=null===e?void 0:e,i=d(n);i.current=n;const s=a(e=>{i.current?.(e??null)},[]),[l,c]=cr(o,t,s,r);return[l,a(e=>{c("function"==typeof e?t=>e(t)??void 0:e??void 0)},[c])]}const ur=10;function mr({enabled:e,anchorRef:t,contentRef:n,side:r="bottom",align:a="start"}){const[i,s]=o(null);return l(()=>{if(!e||!t?.current||!n?.current)return;const o=()=>{if(!t.current||!n.current)return;const e=t.current.getBoundingClientRect(),o=n.current.offsetWidth,i=n.current.offsetHeight,l=window.innerWidth,c=window.innerHeight;let d,u,m,f=r;if("top"===r||"bottom"===r){if("bottom"===r){if(d=e.bottom,d+i>c-ur){const t=e.top-i;t>=ur&&(d=t,f="top")}}else if(d=e.top-i,d<ur){const t=e.bottom;t+i<=c-ur&&(d=t,f="bottom")}"start"===a?(u=e.left,u+o>l-ur&&(u=void 0,m=l-e.right)):(m=l-e.right,e.right-o<ur&&(m=void 0,u=e.left))}else{if("right"===r){if(u=e.right,u+o>l-ur){const t=e.left-o;t>=ur&&(u=t,f="left")}}else{const t=e.left-o;if(t<ur){const n=e.right;n+o<=l-ur?(u=n,f="right"):u=t}else u=t}"start"===a?(d=e.top,d+i>c-ur&&(d=Math.max(ur,c-i-ur))):(d=e.bottom-i,d<ur&&(d=ur))}s({top:d,left:u,right:m,side:f})};o();const i=new ResizeObserver(o);return i.observe(n.current),i.observe(t.current),window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),()=>{i.disconnect(),window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0)}},[e,r,a,t,n]),i}const fr=()=>!0;function pr(e){const{getRows:t,getCellCount:n,isRowDisabled:r,isCellDisabled:o,isCellInteractive:i=fr,activeCell:s,setActiveCell:l,loop:c=!1,onActivate:u,onEscape:m}=e,f=d(0),p=a((e,t,n)=>{let o=e,a=0;const i=n.length;for(;a<i;){if(c)o<0?o=n.length-1:o>=n.length&&(o=0);else if(o<0||o>=n.length)return null;const e=n[o];if(e&&!r(e))return o;o+=t,a++}return null},[c,r]),g=a((e,t,n,r)=>{let a=t,s=0;for(;s<r;){if(c)a<0?a=r-1:a>=r&&(a=0);else if(a<0||a>=r)return null;if(!o(e,a)&&i(e,a))return a;a+=n,s++}return null},[c,o,i]),b=a(e=>{const r=t();if(!r.length)return;const o=s?r.indexOf(s.row):-1;let a;a=-1===o?e>0?0:r.length-1:o+e;const i=p(a,e,r);if(null===i)return;const c=r[i];if(!c)return;const d=n(c),u=Math.min(f.current,d-1),m=g(c,u,1,d);null!==m&&l({row:c,col:m})},[t,s,n,p,g,l]),v=a(e=>{if(!s){const e=t();if(!e.length)return;const r=p(0,1,e);if(null===r)return;const o=e[r];if(!o)return;const a=n(o),i=g(o,0,1,a);return void(null!==i&&(f.current=i,l({row:o,col:i})))}const r=n(s.row),o=s.col+e,a=g(s.row,o,e,r);null!==a&&(f.current=a,l({row:s.row,col:a}))},[s,t,n,p,g,l]),h=a(e=>{const a=t();if(a.length)switch(e.key){case"ArrowDown":e.preventDefault(),b(1);break;case"ArrowUp":e.preventDefault(),b(-1);break;case"ArrowRight":e.preventDefault(),v(1);break;case"ArrowLeft":e.preventDefault(),v(-1);break;case"Home":if(e.preventDefault(),e.ctrlKey||e.metaKey){const e=p(0,1,a);if(null!==e){const t=a[e];if(t){const e=n(t),r=g(t,0,1,e);null!==r&&(f.current=r,l({row:t,col:r}))}}}else if(s){const e=n(s.row),t=g(s.row,0,1,e);null!==t&&(f.current=t,l({row:s.row,col:t}))}break;case"End":if(e.preventDefault(),e.ctrlKey||e.metaKey){const e=p(a.length-1,-1,a);if(null!==e){const t=a[e];if(t){const e=n(t),r=g(t,e-1,-1,e);null!==r&&(f.current=r,l({row:t,col:r}))}}}else if(s){const e=n(s.row),t=g(s.row,e-1,-1,e);null!==t&&(f.current=t,l({row:s.row,col:t}))}break;case"Enter":case" ":e.preventDefault(),!s||r(s.row)||o(s.row,s.col)||u?.(s.row,s.col);break;case"Escape":e.preventDefault(),m?.()}},[t,s,b,v,n,p,g,l,r,o,u,m]);return{moveRow:b,moveCol:v,handleKeyDown:h}}function gr(){const e=d(/* @__PURE__ */new Map),[t,n]=o(0),r=d(null),i=d(!1),s=a(()=>{i.current||(i.current=!0,queueMicrotask(()=>{i.current=!1,n(e=>e+1)}))},[]);return{registerItem:a((t,n=!1,r=null)=>{const o=e.current.get(t);o&&o.disabled===n&&o.element===r||(e.current.set(t,{disabled:n,element:r}),s())},[s]),unregisterItem:a(t=>{e.current.delete(t)&&s()},[s]),getItems:a(()=>{if(r.current?.version===t)return[...r.current.ids];const n=Array.from(e.current.entries()),o=/* @__PURE__ */new Map;for(const[e,t]of n)if(t.element)o.set(e,t.element);else{const t=document.querySelector(`[data-registry-id="${e}"]`)??document.getElementById(e);o.set(e,t)}const a=n.map(([e])=>e).sort((e,t)=>{const n=o.get(e),r=o.get(t);if(!n||!r)return 0;const a=n.compareDocumentPosition(r);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0});return r.current={version:t,ids:a},[...a]},[t]),isItemDisabled:a(t=>e.current.get(t)?.disabled??!1,[]),getItemElement:a(t=>e.current.get(t)?.element??null,[]),registryVersion:t}}function br(){const e=d(/* @__PURE__ */new Map);return{registerItemText:a((t,n)=>{e.current.set(t,n)},[]),unregisterItemText:a(t=>{e.current.delete(t)},[]),getItemText:a(t=>e.current.get(t),[])}}function vr(e){const{getItems:t,isItemDisabled:n,isItemVisible:r=()=>!0,active:o,setActive:i,loop:s=!1,orientation:l="vertical",onSelect:c,onEscape:d}=e,u=a(e=>!n(e)&&r(e),[n,r]),m=a(e=>{const n=t();if(!n.length)return;const r=o?n.indexOf(o):-1;let a,l=0;const c=n.length;for(a=-1===r?e>0?0:n.length-1:r+e;l<c;){if(s)a<0?a=n.length-1:a>=n.length&&(a=0);else if(a<0||a>=n.length)return;const t=n[a];if(t&&u(t))return void i(t);a+=e,l++}},[t,o,i,s,u]),f=a(e=>{const r=t();if(!r.length)return;const a="vertical"===l,s=a?"ArrowDown":"ArrowRight",f=a?"ArrowUp":"ArrowLeft";switch(e.key){case s:e.preventDefault(),m(1);break;case f:e.preventDefault(),m(-1);break;case"Home":e.preventDefault();{const e=r.find(u);e&&i(e)}break;case"End":e.preventDefault();{const e=[...r].reverse().find(u);e&&i(e)}break;case"Enter":case" ":e.preventDefault(),o&&!n(o)&&c?.(o);break;case"Escape":e.preventDefault(),d?.()}},[t,o,m,i,n,u,l,c,d]);return{moveActive:m,handleKeyDown:f}}const hr={canScrollLeft:!1,canScrollRight:!1,hasOverflow:!1};function yr(e){const[t,n]=o(hr),r=d(0),i=a(()=>{const t=e.current;if(!t)return void n(hr);n({hasOverflow:t.scrollWidth-t.clientWidth>1,canScrollLeft:t.scrollLeft>1,canScrollRight:t.scrollLeft<t.scrollWidth-t.clientWidth-1})},[e]),s=a(()=>{cancelAnimationFrame(r.current),r.current=requestAnimationFrame(i)},[i]);l(()=>{const t=e.current;if(!t)return;i(),t.addEventListener("scroll",s,{passive:!0});const n=new ResizeObserver(s);n.observe(t);const o=()=>{for(let e=0;e<t.children.length;e++){const r=t.children[e];r&&n.observe(r)}};o();const a=new MutationObserver(()=>{o(),s()});return a.observe(t,{childList:!0,subtree:!0}),()=>{t.removeEventListener("scroll",s),n.disconnect(),a.disconnect(),cancelAnimationFrame(r.current)}},[e,i,s]);return{...t,scrollBy:a(t=>{e.current?.scrollBy({left:t,behavior:"smooth"})},[e])}}const wr=10;function xr({enabled:e,mousePosition:t,contentRef:n}){const[r,a]=o(null);return l(()=>{if(!e||!t||!n?.current)return;const r=()=>{if(!n.current)return;const e=n.current.getBoundingClientRect(),r=window.innerWidth,o=window.innerHeight;let i=t.y,s=t.x;if(i+e.height>o-wr){const n=t.y-e.height;i=n>=wr?n:Math.max(wr,o-e.height-wr)}if(s+e.width>r-wr){const n=t.x-e.width;s=n>=wr?n:Math.max(wr,r-e.width-wr)}a({top:i,left:s})};return r(),window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[e,t,n]),l(()=>{e||a(null)},[e]),r}const Ir=(e,t)=>{const n=X();l(()=>{const r=e.current;if(r&&t&&n)return n.register(r),()=>n.unregister(r)},[e,t,n])};function Nr(e){const{baseId:t,getItems:n,getItemId:r,value:o,onValueChange:i,isItemDisabled:s,loop:l=!1,orientation:c="vertical"}=e,d=a(e=>{e&&(i(e),r&&requestAnimationFrame(()=>{document.getElementById(r(t,e))?.focus()}))},[t,i,r]),{handleKeyDown:u}=vr({getItems:n,isItemDisabled:s,active:o,setActive:d,loop:l,orientation:c});return{handleKeyDown:u}}function kr({id:e,active:t,disabled:n,getItems:r,isItemDisabled:o,focusMode:a="roving-tabindex"}){return s(()=>{if("activedescendant"===a)return{isFocusable:!1,tabIndex:-1};if(n)return{isFocusable:!1,tabIndex:-1};const i=r(),s=i.length>0?i[0]:void 0,l=((t&&i.includes(t)?t:void 0)??i.find(e=>!o(e))??s??e)===e;return{isFocusable:l,tabIndex:l?0:-1}},[e,t,n,r,o,a])}function Cr({containerRef:e,activeId:t,orientation:n="vertical",buildElementId:r}){u(()=>{if(!t||!e?.current)return;const o=r?r(t):t,a=e.current.querySelector(`#${CSS.escape(o)}`);a&&a.scrollIntoView({block:"nearest",inline:"horizontal"===n?"nearest":void 0,behavior:"auto"})},[t,e,n,r])}const Dr=(e,t)=>{l(()=>{if(!e)return;const n=t??document.body,r=n.style.overflow;return n.style.overflow="hidden",()=>{n.style.overflow=r}},[e,t])};function Sr({open:e,selectedId:t,setActive:n,items:r,virtuosoRef:o}){const a=d(!1);u(()=>{if(!e)return void(a.current=!1);const i=!a.current;if(a.current=!0,!i)return;if(!t)return;const s=r.findIndex(e=>e.id===t);if(s<0)return;n(t);let l=0,c=0;const d=()=>{const e=o?.current;e?e.scrollToIndex({index:s,align:"center",behavior:"auto"}):l++>=8||(c=requestAnimationFrame(d))};return d(),()=>{c&&cancelAnimationFrame(c)}},[e,t,r,n,o])}function Mr(e){const{getItems:t,isItemDisabled:n,getItemText:r,active:o,setActive:i,onMatch:s,timeout:l=500}=e,c=d(""),u=d(null),m=a(()=>{c.current="",u.current&&(clearTimeout(u.current),u.current=null)},[]);return{handleTypeAhead:a(e=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{c.current="",u.current=null},l);const a=t();if(!a.length)return;const d=e.toLowerCase(),m=c.current+d;c.current=m;if(m.length>1&&m.split("").every(e=>e===d)){for(const o of a){if(n(o))continue;const e=r(o);if(e?.toLowerCase().startsWith(m))return i(o),void s?.(o)}const e=a.filter(e=>{if(n(e))return!1;const t=r(e);return t?.toLowerCase().startsWith(d)});if(0===e.length)return;const t=o?e.indexOf(o):-1,l=e[(t+1)%e.length];l&&(i(l),s?.(l))}else{const e=o?a.indexOf(o):-1,t=e>=0?[...a.slice(e+1),...a.slice(0,e+1)]:a;for(const o of t){if(n(o))continue;const e=r(o);if(e?.toLowerCase().startsWith(m))return i(o),void s?.(o)}if(m.length>1)for(const o of a){if(n(o))continue;const e=r(o);if(e?.toLowerCase().startsWith(d))return c.current=d,i(o),void s?.(o)}}},[t,n,r,o,i,s,l]),resetSearch:m}}function Rr(e){const{getItems:t,isItemDisabled:n,getItemText:r,active:o,setActive:i,value:s,open:l,setOpenInternal:c,closeWithFocus:d,disabled:u,onSelect:m}=e,{handleKeyDown:f}=vr({getItems:t,isItemDisabled:n,active:o,setActive:i,loop:!1,orientation:"vertical",onSelect:m,onEscape:d}),{handleTypeAhead:p}=Mr({getItems:t,isItemDisabled:n,getItemText:r,active:o,setActive:i});return{keyHandler:a(e=>{if(!u){if(!l&&["ArrowDown","ArrowUp","Enter"," ","Home","End"].includes(e.key)){e.preventDefault(),c(!0);const r="End"===e.key,o=10;let a=0;const l=()=>{const e=t();if(e.length>0)if(r){const t=[...e].reverse().find(e=>!n(e));t&&i(t)}else{const t=(s&&e.includes(s)&&!n(s)?s:null)||e.find(e=>!n(e));t&&i(t)}else a<o&&(a++,requestAnimationFrame(l))};return void requestAnimationFrame(l)}if(l&&"Tab"===e.key)o?m(o):d();else{if(l&&("PageUp"===e.key||"PageDown"===e.key)){e.preventDefault();const r=t();if(0===r.length)return;const a=o?r.indexOf(o):-1,s="PageDown"===e.key?10:-10;let l=a+s;l<0&&(l=0),l>=r.length&&(l=r.length-1);const c=s>0?1:-1;let d=r[l];for(;l>=0&&l<r.length&&d&&n(d);)l+=c,d=r[l];return void(l>=0&&l<r.length&&d&&!n(d)&&i(d))}if(1!==e.key.length||" "===e.key||e.ctrlKey||e.metaKey||e.altKey)f(e);else if(e.preventDefault(),l)p(e.key);else{c(!0);const n=10;let r=0;const o=()=>{t().length>0?p(e.key):r<n&&(r++,requestAnimationFrame(o))};requestAnimationFrame(o)}}}},[u,l,o,s,t,n,c,d,i,m,p,f])}}function Ar(e){const{baseId:t,getItems:n,getNextFocusable:r,value:o,onValueChange:i,isItemDisabled:l,registryVersion:c}=e,d=s(()=>n(),[n,c]),u=a(e=>{i(e),r&&requestAnimationFrame(()=>{document.getElementById(r(t,e))?.focus()})},[t,i,r]),m=null!=o?d.indexOf(o):-1,f=0===m,p=m===d.length-1,g=s(()=>{if(-1===m||p)return!1;const e=d[m+1];return null!=e&&!l(e)},[m,p,d,l]),b=s(()=>{if(m<=0)return!1;const e=d[m-1];return null!=e&&!l(e)},[m,d,l]),v=a(e=>{-1!==d.indexOf(e)&&(l(e)||u(e))},[d,l,u]),h=a(()=>{if(-1===m||p)return;const e=d[m+1];null==e||l(e)||u(e)},[m,p,d,l,u]),y=a(()=>{if(m<=0)return;const e=d[m-1];null==e||l(e)||u(e)},[m,d,l,u]),w=a(()=>{const e=d.find(e=>!l(e));null!=e&&u(e)},[d,l,u]),x=a(()=>{const e=[...d].reverse().find(e=>!l(e));null!=e&&u(e)},[d,l,u]),I=a(e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),y();break;case"ArrowRight":e.preventDefault(),h();break;case"Home":e.preventDefault(),w();break;case"End":e.preventDefault(),x()}},[h,y,w,x]);return{goToNext:h,goToPrevious:y,goToFirst:w,goToLast:x,goTo:v,handleKeyDown:I,isFirst:f,isLast:p,canGoNext:g,canGoPrevious:b,currentIndex:m,items:d}}function Pr({enabled:e,submenuRef:t,side:n,graceMs:r=300}){const o=d(null),i=d(0);l(()=>{if(!e)return o.current=null,void(i.current=0);i.current=Date.now();const t=e=>{o.current={x:e.clientX,y:e.clientY},i.current=Date.now()};return document.addEventListener("pointermove",t,{passive:!0}),()=>{document.removeEventListener("pointermove",t)}},[e]);return{isInSafeArea:a((a,s)=>{if(!e)return!1;const l=t.current?.getBoundingClientRect();if(!l)return!1;const c=o.current;if(!c)return Date.now()-i.current<r;const d="right"===n?l.left:l.right,u={x:d,y:l.top},m={x:d,y:l.bottom};return!("right"===n&&a>=d)&&(!("left"===n&&a<=d)&&function(e,t,n,r){const o=(e,t,n)=>(e.x-n.x)*(t.y-n.y)-(t.x-n.x)*(e.y-n.y),a=o(e,t,n),i=o(e,n,r),s=o(e,r,t);return!((a<0||i<0||s<0)&&(a>0||i>0||s>0))}({x:a,y:s},c,u,m))},[e,t,n,r])}}const Tr=(e,t)=>{l(()=>{const n=Cn(e);n&&t(n)},[e,t])};function Or(e){const{items:t,activeIndex:n,setActiveIndex:r,scrollToIndex:o,onExpand:i,onCollapse:s,onSelect:l,onEscape:c,loop:d=!1,isItemDisabled:u=()=>!1,getPageSize:m}=e,f=a(e=>{if(!t.length)return;const a=n??-1;let i,s=0;const l=t.length;for(i=-1===a?e>0?0:t.length-1:a+e;s<l;){if(d)i<0?i=t.length-1:i>=t.length&&(i=0);else if(i<0||i>=t.length)return;const n=t[i];if(n&&!u(n))return r(i),void o(i);i+=e,s++}},[t,n,r,o,d,u]),p=a(e=>e.parentId?t.findIndex(t=>t.id===e.parentId):null,[t]),g=a((e,n)=>{const r=t[n+1];return r?.parentId===e?n+1:null},[t]),b=a(e=>{if(!t.length)return;const a=null!==n?t[n]:null;switch(e.key){case"ArrowDown":e.preventDefault(),f(1);break;case"ArrowUp":e.preventDefault(),f(-1);break;case"ArrowRight":if(e.preventDefault(),a&&null!==n)if(a.hasChildren&&!a.isExpanded)i?.(a.id);else if(a.isExpanded){const e=g(a.id,n),i=null!==e?t[e]:void 0;null!==e&&i&&!u(i)&&(r(e),o(e))}break;case"ArrowLeft":if(e.preventDefault(),a)if(a.isExpanded)s?.(a.id);else{const e=p(a),n=null!==e?t[e]:void 0;null!==e&&n&&!u(n)&&(r(e),o(e))}break;case"Home":e.preventDefault();{const e=t.findIndex(e=>!u(e));-1!==e&&(r(e),o(e))}break;case"End":e.preventDefault();for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&!u(n)){r(e),o(e);break}}break;case"PageUp":e.preventDefault();{const e=m?.()??10;f(-e)}break;case"PageDown":e.preventDefault();{const e=m?.()??10;f(e)}break;case"Enter":case" ":e.preventDefault(),a&&null!==n&&!u(a)&&l?.(a.id,n);break;case"Escape":e.preventDefault(),c?.()}},[t,n,f,r,o,i,s,l,c,u,p,g,m]);return{moveActive:f,handleKeyDown:b}}const zr=i(({size:e=24,className:t,...n},r)=>/* @__PURE__ */I("svg",{ref:r,xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:vn("lucide lucide-circle-disc",Cn(t)),"aria-hidden":"true",...n,children:[
4
4
  /* @__PURE__ */I("circle",{cx:"12",cy:"12",r:"10"}),
5
5
  /* @__PURE__ */I("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"})]}));zr.displayName="CircleDisc";const Er=zr,Lr=i(({size:e=24,className:t,...n},r)=>/* @__PURE__ */I("svg",{ref:r,xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",className:vn("lucide lucide-filled-circle-alert",Cn(t)),"aria-hidden":"true",...n,children:/* @__PURE__ */I("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM12 6.46429C12.5917 6.46429 13.0714 6.94398 13.0714 7.53571V12.1786C13.0714 12.7703 12.5917 13.25 12 13.25C11.4083 13.25 10.9286 12.7703 10.9286 12.1786V7.53571C10.9286 6.94398 11.4083 6.46429 12 6.46429ZM13.4286 16.1071C13.4286 16.8962 12.7889 17.5357 12 17.5357C11.2111 17.5357 10.5714 16.8962 10.5714 16.1071C10.5714 15.3181 11.2111 14.6786 12 14.6786C12.7889 14.6786 13.4286 15.3181 13.4286 16.1071Z",fill:"currentColor"})}));Lr.displayName="FilledCircleAlert";const $r=Lr,Vr=i(({size:e=24,className:t,...n},r)=>/* @__PURE__ */I("svg",{ref:r,xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",className:vn("lucide lucide-filled-circle-check",Cn(t)),"aria-hidden":"true",...n,children:/* @__PURE__ */I("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM17.004 9.45502C17.3736 8.99296 17.2988 8.31872 16.8366 7.94907C16.3746 7.57942 15.7003 7.65433 15.3307 8.1164L10.2651 14.4483L8.23872 12.9286C7.76534 12.5735 7.09378 12.6695 6.73872 13.1428C6.3837 13.6162 6.47962 14.2878 6.95302 14.6428L9.81016 16.7857C10.2731 17.133 10.9282 17.0497 11.2897 16.5978L17.004 9.45502Z",fill:"currentColor"})}));Vr.displayName="FilledCircleCheck";const Fr=Vr,Kr=i(({size:e=24,className:t,...n},r)=>/* @__PURE__ */I("svg",{ref:r,xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",className:vn("lucide lucide-filled-circle-info",Cn(t)),"aria-hidden":"true",...n,children:/* @__PURE__ */I("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM9.85714 15.3929C9.36402 15.3929 8.96429 15.7926 8.96429 16.2857C8.96429 16.7788 9.36402 17.1786 9.85714 17.1786H14.1429C14.636 17.1786 15.0357 16.7788 15.0357 16.2857C15.0357 15.7926 14.636 15.3929 14.1429 15.3929H12.8929V11.2857C12.8929 10.7926 12.4931 10.3929 12 10.3929H10.5714C10.0783 10.3929 9.67857 10.7926 9.67857 11.2857C9.67857 11.7788 10.0783 12.1786 10.5714 12.1786H11.1071V15.3929H9.85714ZM13.4286 7.71429C13.4286 8.50325 12.7889 9.14286 12 9.14286C11.2111 9.14286 10.5714 8.50325 10.5714 7.71429C10.5714 6.92532 11.2111 6.28571 12 6.28571C12.7889 6.28571 13.4286 6.92532 13.4286 7.71429Z",fill:"currentColor"})}));Kr.displayName="FilledCircleInfo";const Hr=Kr,Gr=i(({size:e=24,className:t,...n},r)=>/* @__PURE__ */I("svg",{ref:r,xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",className:vn("lucide lucide-filled-circle-x",Cn(t)),"aria-hidden":"true",...n,children:/* @__PURE__ */I("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM7.67101 7.67101C8.08942 7.2526 8.76782 7.2526 9.18624 7.67101L12 10.4848L14.8138 7.67101C15.2322 7.2526 15.9106 7.2526 16.329 7.67101C16.7474 8.08942 16.7474 8.76782 16.329 9.18624L13.5152 12L16.329 14.8138C16.7474 15.2322 16.7474 15.9106 16.329 16.329C15.9106 16.7474 15.2322 16.7474 14.8138 16.329L12 13.5152L9.18624 16.329C8.76782 16.7474 8.08942 16.7474 7.67101 16.329C7.2526 15.9106 7.2526 15.2322 7.67101 14.8138L10.4848 12L7.67101 9.18624C7.2526 8.76782 7.2526 8.08942 7.67101 7.67101Z",fill:"currentColor"})}));Gr.displayName="FilledCircleX";const Br=Gr,jr=i(({size:e=24,className:t,...n},r)=>/* @__PURE__ */I("svg",{ref:r,xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",className:vn("lucide lucide-filled-octagon-alert",Cn(t)),"aria-hidden":"true",...n,children:/* @__PURE__ */I("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2zM12 6.46429C12.5917 6.46429 13.0714 6.94398 13.0714 7.53571V12.1786C13.0714 12.7703 12.5917 13.25 12 13.25C11.4083 13.25 10.9286 12.7703 10.9286 12.1786V7.53571C10.9286 6.94398 11.4083 6.46429 12 6.46429ZM13.4286 16.1071C13.4286 16.8962 12.7889 17.5357 12 17.5357C11.2111 17.5357 10.5714 16.8962 10.5714 16.1071C10.5714 15.3181 11.2111 14.6786 12 14.6786C12.7889 14.6786 13.4286 15.3181 13.4286 16.1071Z",fill:"currentColor"})}));jr.displayName="FilledOctagonAlert";const qr=jr,Wr=i(({size:e=24,className:t,...n},r)=>/* @__PURE__ */I("svg",{ref:r,xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",className:vn("lucide lucide-filled-square-check",Cn(t)),"aria-hidden":"true",...n,children:/* @__PURE__ */I("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.3 2H19.7C20.9703 2 22 3.02974 22 4.3V19.7C22 20.9703 20.9703 22 19.7 22H4.3C3.02974 22 2 20.9703 2 19.7V4.3C2 3.02974 3.02974 2 4.3 2ZM17.3886 8.25926C17.7868 7.76164 17.7061 7.03555 17.2085 6.63746C16.711 6.23937 15.9848 6.32005 15.5867 6.81766L10.1315 13.6367L7.94921 12C7.43942 11.6176 6.71618 11.721 6.33383 12.2308C5.95148 12.7406 6.0548 13.4638 6.56459 13.8462L9.64152 16.1538C10.1401 16.5278 10.8455 16.4382 11.2348 15.9515L17.3886 8.25926Z",fill:"currentColor"})}));Wr.displayName="FilledSquareCheck";const _r=Wr,Yr=i(({size:e=24,className:t,...n},r)=>/* @__PURE__ */I("svg",{ref:r,xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",className:vn("lucide lucide-filled-square-minus",Cn(t)),"aria-hidden":"true",...n,children:/* @__PURE__ */I("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 2h16a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2ZM7 10.75h10a1 1 0 0 1 1 1v0.5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1v-0.5a1 1 0 0 1 1-1Z",fill:"currentColor"})}));Yr.displayName="FilledSquareMinus";const Ur=Yr,Zr=S(["inline-flex shrink-0"],{variants:{labeled:{true:"",false:'after:-inset-1 after:-z-10 relative z-0 after:pointer-events-auto after:absolute after:rounded-sm after:content-[""]'}},defaultVariants:{labeled:!1}}),Xr=i(({id:e,className:t,name:n,label:r,defaultChecked:o=!1,checked:a,align:i="left",error:s,disabled:l,readOnly:c,required:d,value:u="on",onCheckedChange:m,errorMessage:f,onClick:p,onClickCapture:g,onMouseDown:b,...v},h)=>{const y=le(Cn(e)),w=s?"error":"default",x=!l&&!c,N=!!r,[k,C]=cr(a,o,m),D="indeterminate"===k,S=!0===k;/* @__PURE__ */
6
6
  return I("div",{"data-component":"Checkbox",className:"flex w-fit flex-col gap-1",children:[
@@ -9,9 +9,9 @@ return I("div",{"data-component":"Checkbox",className:"flex w-fit flex-col gap-1
9
9
  /* @__PURE__ */I("span",{className:Zr({labeled:N}),"aria-hidden":"true",children:D?/* @__PURE__ */I(Yr,{className:vn("size-4 rounded-sm transition-highlight",!x&&"opacity-30","error"===w?"text-error":"text-main group-data-[tone=inverse]:text-alt"),"data-slot":"checkbox-indicator"}):S?/* @__PURE__ */I(Wr,{className:vn("size-4 rounded-sm transition-highlight",!x&&"opacity-30","error"===w?"text-error":"text-main group-data-[tone=inverse]:text-alt"),"data-slot":"checkbox-indicator"}):/* @__PURE__ */I(nr,{className:vn("size-4 rounded-sm transition-highlight focus:outline-none",!x&&"opacity-30","error"===w?"text-error":"text-main group-data-[tone=inverse]:text-alt"),"data-slot":"checkbox-indicator"})}),r&&/* @__PURE__ */I("span",{className:vn("text-main group-data-[tone=inverse]:text-alt",l&&"opacity-30"),children:r})]}),"error"===w&&f&&/* @__PURE__ */I("div",{className:vn("flex items-center gap-2 text-error leading-5",l&&"opacity-30"),children:[
10
10
  /* @__PURE__ */I(jr,{size:14}),f]})]})});Xr.displayName="Checkbox";const Jr=S(["p-0"],{variants:{size:{sm:"size-9",md:"size-10",lg:"h-11.5 w-11.5"},shape:{square:"rounded-sm",round:"rounded-full"}},defaultVariants:{size:"md",shape:"square"}}),Qr=i(({className:e,variant:t="text",size:n="md",shape:r="square",icon:o,iconClassName:a,...i},s)=>/* @__PURE__ */I(Tn,{"data-component":"IconButton",ref:s,className:vn(Jr({size:n,shape:r}),e),variant:t,size:n,startIcon:o,startIconClassName:a,label:"",...i}));Qr.displayName="IconButton";const eo=[],to=({baseId:e,selection:t,defaultSelection:n=eo,onSelectionChange:r,active:i,defaultActive:l,setActive:c,selectionMode:d="single",focusMode:u="roving-tabindex",disabled:m,children:f,keyHandler:p,registerItem:g,unregisterItem:b,getItems:v,isItemDisabled:h,autoActiveOnOpen:y=!0})=>{const w=le(),x=e??w,[N,k]=o(()=>new Set(n)),C=void 0!==t,D=s(()=>C?new Set(t):N,[C,t,N]),[S,M]=dr(i,l,c),R=gr(),A=g??R.registerItem,P=b??R.unregisterItem,T=v??R.getItems,O=h??R.isItemDisabled,z=a(e=>{const t=D.has(e),n=new Set(D);"single"===d?(n.clear(),t||n.add(e)):t?n.delete(e):n.add(e),C||k(n),r?.(Array.from(n)),M(e)},[D,d,C,r,M]),E=s(()=>({active:S,selection:D,selectionMode:d,focusMode:u,disabled:m,setActive:M,toggleValue:z,baseId:x,keyHandler:p,registerItem:A,unregisterItem:P,getItems:T,isItemDisabled:O,autoActiveOnOpen:y}),[S,D,d,u,m,M,z,x,p,A,P,T,O,y]);/* @__PURE__ */
11
11
  return I(de,{value:E,children:f})};to.displayName="Listbox";const no=i(({className:e,label:t,children:n,...r},o)=>{const i=d(null),{active:s,disabled:l,setActive:c,toggleValue:u,baseId:m,selection:f,selectionMode:p,keyHandler:g,focusMode:b="roving-tabindex",getItems:v,isItemDisabled:h,autoActiveOnOpen:y}=ue(),{handleKeyDown:w}=vr({getItems:v,isItemDisabled:h,active:s,setActive:c,loop:!1,orientation:"vertical",onSelect:e=>{u(e)}}),x=g??w,N=a(()=>{if("activedescendant"===b&&!s&&!l){const e=v().find(e=>!h(e));e&&c(e)}},[b,s,l,c,v,h]),k=a(e=>`${m}-listbox-option-${e}`,[m]);return ar({open:!0,selection:f,setActive:c,getItems:v,isItemDisabled:h,containerRef:i,buildElementId:k,enabled:y&&!l}),Cr({containerRef:i,activeId:s??void 0,orientation:"vertical",buildElementId:k}),
12
- /* @__PURE__ */I("div",{"data-component":"Listbox.Content",ref:In(o,i),id:`${m}-listbox`,className:vn("flex flex-col items-start gap-y-1 p-1","overflow-y-auto","outline-none","transition-highlight",l&&"pointer-events-none select-none opacity-30",e),role:"listbox","aria-disabled":l,"aria-label":t,"aria-multiselectable":"multiple"===p||void 0,"aria-activedescendant":"activedescendant"===b&&s?`${m}-listbox-option-${s}`:void 0,tabIndex:"activedescendant"!==b||l?void 0:0,onFocus:"activedescendant"===b?N:void 0,onKeyDown:x,...r,children:n})});no.displayName="Listbox.Content";const ro=S(["group relative z-0 flex w-full cursor-pointer items-center gap-x-2.5 px-4.5 py-1 outline-none transition-highlight",'after:-inset-y-0.5 after:-z-10 after:pointer-events-auto after:absolute after:inset-x-0 after:rounded-sm after:content-[""]'],{variants:{selected:{true:"bg-surface-selected text-alt hover:bg-surface-selected-hover",false:"hover:bg-surface-neutral-hover"},disabled:{true:"pointer-events-none cursor-not-allowed opacity-30",false:""},focusMode:{"roving-tabindex":["focus-visible:ring-3 focus-visible:ring-ring-offset focus-visible:ring-inset","focus-visible:ring-offset-3 focus-visible:ring-offset-ring"],activedescendant:["data-[active=true]:ring-3 data-[active=true]:ring-ring-offset data-[active=true]:ring-inset","data-[active=true]:ring-offset-3 data-[active=true]:ring-offset-ring"]}},defaultVariants:{selected:!1,disabled:!1,focusMode:"roving-tabindex"}}),oo=({value:e,disabled:t=!1,children:n,className:r,...o})=>{const i=ue(),{disabled:s,toggleValue:c,baseId:u,active:m,setActive:f,focusMode:p="roving-tabindex",registerItem:g,unregisterItem:b,getItems:v,isItemDisabled:h}=i,y=i.selection.has(e),w=m===e,x=t||!!s,N=d(null);l(()=>(g(e,x,N.current),()=>b(e)),[e,x,g,b]);const{tabIndex:k}=kr({id:e,active:m,disabled:x,getItems:v,isItemDisabled:h,focusMode:p});or({ref:N,isActive:w,disabled:x,focusMode:p,checkFocusWithin:{enabled:!0,containerRole:"listbox"}});const C=a(()=>{x||c(e)},[x,c,e]),D=a(()=>{x||f(e)},[x,f,e]);
12
+ /* @__PURE__ */I("div",{"data-component":"Listbox.Content",ref:In(o,i),id:`${m}-listbox`,className:vn("flex flex-col items-start gap-y-1 p-1","overflow-y-auto","outline-none","transition-highlight",l&&"pointer-events-none select-none opacity-30",e),role:"listbox","aria-disabled":l,"aria-label":t,"aria-multiselectable":"multiple"===p||void 0,"aria-activedescendant":"activedescendant"===b&&s?`${m}-listbox-option-${s}`:void 0,tabIndex:"activedescendant"!==b||l?void 0:0,onFocus:"activedescendant"===b?N:void 0,onKeyDown:x,...r,children:n})});no.displayName="Listbox.Content";const ro=S(["group relative z-0 flex w-full cursor-pointer items-center gap-x-2.5 px-4.5 py-1 outline-none transition-highlight",'after:-inset-y-0.5 after:-z-10 after:pointer-events-auto after:absolute after:inset-x-0 after:rounded-sm after:content-[""]'],{variants:{selected:{true:"bg-surface-selected text-alt hover:bg-surface-selected-hover",false:"hover:bg-surface-neutral-hover"},disabled:{true:"pointer-events-none cursor-not-allowed opacity-30",false:""},focusMode:{"roving-tabindex":["focus-visible:ring-3 focus-visible:ring-ring-offset focus-visible:ring-inset","focus-visible:ring-offset-3 focus-visible:ring-offset-ring"],activedescendant:["data-[active=true]:ring-3 data-[active=true]:ring-ring-offset data-[active=true]:ring-inset","data-[active=true]:ring-offset-3 data-[active=true]:ring-offset-ring"]}},defaultVariants:{selected:!1,disabled:!1,focusMode:"roving-tabindex"}}),oo=({value:e,disabled:t=!1,children:n,className:r,...o})=>{const i=ue(),{disabled:s,toggleValue:c,baseId:u,active:m,setActive:f,focusMode:p="roving-tabindex",registerItem:g,unregisterItem:b,getItems:v,isItemDisabled:h}=i,y=i.selection.has(e),w=m===e,x=t||!!s,N=d(null),k=d(!1);l(()=>(g(e,x,N.current),()=>b(e)),[e,x,g,b]);const{tabIndex:C}=kr({id:e,active:m,disabled:x,getItems:v,isItemDisabled:h,focusMode:p}),D=a(()=>{k.current=!0},[]);or({ref:N,isActive:w,disabled:x,focusMode:p,checkFocusWithin:{enabled:!0,containerRole:"listbox"},onProgrammaticFocus:D});const S=a(()=>{x||c(e)},[x,c,e]),M=a(()=>{x||(k.current?k.current=!1:f(e))},[x,f,e]);
13
13
  /* @__PURE__ */
14
- return I("div",{"data-component":"Listbox.Item",ref:N,id:`${u}-listbox-option-${e}`,className:vn(ro({selected:y,disabled:x,focusMode:p}),r),role:"option","aria-selected":y,"aria-disabled":x||void 0,tabIndex:"roving-tabindex"===p?k:void 0,"data-value":e,"data-active":w||void 0,"data-tone":y?"inverse":void 0,onClick:C,onFocus:"roving-tabindex"===p?D:void 0,...o,children:n})};oo.displayName="Listbox.Item";const ao=Object.assign(to,{Root:to,Content:no,Item:oo}),io=({id:e,value:t,defaultValue:n="",onChange:r,placeholder:a="Search",clearLabel:i="Clear",disabled:l,readOnly:c,children:u,className:m,...f})=>{const p=le(Cn(e)),[g,b]=o(p),v=d(null),[h,y]=cr(t,n,r),w=s(()=>({id:g,setId:b,value:h,setValue:y,disabled:l,readOnly:c,placeholder:a,clearLabel:i,inputRef:v}),[g,h,y,l,c,a,i]);/* @__PURE__ */
14
+ return I("div",{"data-component":"Listbox.Item",ref:N,id:`${u}-listbox-option-${e}`,className:vn(ro({selected:y,disabled:x,focusMode:p}),r),role:"option","aria-selected":y,"aria-disabled":x||void 0,tabIndex:"roving-tabindex"===p?C:void 0,"data-value":e,"data-active":w||void 0,"data-tone":y?"inverse":void 0,onClick:S,onFocus:"roving-tabindex"===p?M:void 0,...o,children:n})};oo.displayName="Listbox.Item";const ao=Object.assign(to,{Root:to,Content:no,Item:oo}),io=({id:e,value:t,defaultValue:n="",onChange:r,placeholder:a="Search",clearLabel:i="Clear",disabled:l,readOnly:c,children:u,className:m,...f})=>{const p=le(Cn(e)),[g,b]=o(p),v=d(null),[h,y]=cr(t,n,r),w=s(()=>({id:g,setId:b,value:h,setValue:y,disabled:l,readOnly:c,placeholder:a,clearLabel:i,inputRef:v}),[g,h,y,l,c,a,i]);/* @__PURE__ */
15
15
  return I(Se,{value:w,children:/* @__PURE__ */I("div",{"data-component":"SearchField.Root",className:vn("relative flex items-center gap-2.5 overflow-hidden rounded-sm","h-11.5 px-4.5 py-3","border border-bdr-subtle","hover:outline-2 hover:outline-bdr-subtle","focus-within:outline-none focus-within:ring-3 focus-within:ring-ring focus-within:ring-offset-3 focus-within:ring-offset-ring-offset","transition-highlight",c?"bg-surface-primary":"bg-surface-neutral",c&&"hover:outline-none hover:outline-offset-0",l&&"pointer-events-none select-none opacity-30 focus-within:outline-none hover:outline-none",m),...f,children:u})})};io.displayName="SearchField";const so=({className:e,...t})=>/* @__PURE__ */I(tr,{"data-component":"SearchField.Icon",className:vn("flex size-5.5 shrink-0 items-center justify-center text-subtle",e),strokeWidth:1.5,...t});so.displayName="SearchField.Icon";const lo=i(({id:e,className:t,...n},r)=>{const{id:o,setId:a,value:i,disabled:s,readOnly:c,placeholder:d,setValue:u,inputRef:m}=Me(),f=Cn(e);l(()=>{f&&a(f)},[f,a]);/* @__PURE__ */
16
16
  return I("input",{"data-component":"SearchField.Input",ref:In(r,m),id:o,className:vn("h-5.5 w-full border-0 text-base","bg-surface-neutral text-main","placeholder:text-subtle","focus:outline-none","enabled:read-only:bg-surface-primary",t),value:i,onChange:e=>{u(e.currentTarget.value)},readOnly:c,disabled:s,placeholder:d,"aria-label":"Search","aria-disabled":s,...n})});lo.displayName="SearchField.Input";const co=({className:e,...t})=>{const{value:n,disabled:r,readOnly:o,clearLabel:a,setValue:i,inputRef:s}=Me();if(!n||r||o)return null;/* @__PURE__ */
17
17
  return I(Qr,{"data-component":"SearchField.Clear",className:vn("-mx-1.5 flex size-7 shrink-0 items-center justify-center text-subtle",e),icon:rr,title:a,onClick:()=>{i(""),s.current?.focus()},disabled:r,iconSize:28,iconStrokeWidth:1.25,...t})};co.displayName="SearchField.Clear";const uo=Object.assign(io,{Root:io,Icon:so,Input:lo,Clear:co});function mo(e,t,n="any"){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;const r="any"===n?[...e].sort():e,o="any"===n?[...t].sort():t;for(let a=0;a<r.length;a+=1)if(r[a]!==o[a])return!1;return!0}const fo=[],po=e=>t=>mo(t,e)?t:e,go=(e,t)=>t instanceof Node&&!!e.current?.contains(t),bo=()=>{const{setOpen:e,closeOnBlur:t,contentRef:n,popupRef:r,applyRef:o,ignoreFocusExitCloseRef:i}=O(),s=a(e=>go(n,e)||go(r,e)||go(o,e),[n,r,o]);return{closeOnFocusExit:a(n=>{!n.defaultPrevented&&t&&window.setTimeout(()=>{i.current||s(document.activeElement)||e(!1,{restoreFocus:!1})},0)},[e,t,s,i])}},vo=({children:e,open:t,defaultOpen:n=!1,onOpenChange:r,closeOnBlur:i=!0,value:c,defaultValue:u="",onChange:m,disabled:f=!1,error:p=!1,selectionMode:g="single",selection:b,defaultSelection:v=fo,onSelectionChange:h,active:y,defaultActive:w,setActive:x,contentType:N="auto"})=>{const k=le(),C=d(null),D=d(null),S=d(null),M=d(null),R=d(!0),A=d(!1),[P,O]=cr(t,n,r),[z,E]=cr(c,u,m);l(()=>{P&&(R.current=!0,A.current=!1)},[P]);const L="single"!==g,$="staged"===g,[V,F]=o(()=>new Set(v)),K=void 0!==b,H=s(()=>K?new Set(b):V,[K,b,V]),G=s(()=>Array.from(H),[H]),[B,j]=o(G);l(()=>{j($?po(G):G)},[G,$]);const q=$?B:G,W=s(()=>new Set(q),[q]),_=s(()=>$&&!mo(B,G),[$,B,G]),Y=a(()=>{$&&j(po(G))},[$,G]),[U,Z]=dr(y,w,x),{registerItem:X,unregisterItem:J,getItems:Q,isItemDisabled:ee}=gr(),te=void 0===y&&!f,[ne,re]=o(!1),oe=a(e=>{E(e),R.current=!0,O(!0)},[E,O]),ae=a((e,t)=>{R.current=e||!1!==t?.restoreFocus,O(e),e||Y()},[O,Y]),ie=a(e=>{const t=new Set(e);K||F(t),h?.(e),"single"===g&&O(!1)},[K,h,g,O]),se=a(e=>{$?j(e):ie(e)},[$,ie]),ce=a(()=>{$&&(A.current=!0,R.current=!0,mo(B,G)||ie(B),O(!1))},[$,B,G,ie,O]),de=a(()=>{requestAnimationFrame(()=>{const e=document.getElementById(`${k}-tree`),t=e?.querySelector('[role="tree"]');t?.focus({focusVisible:!0})})},[k]),ue=a(()=>{requestAnimationFrame(()=>{const e=document.getElementById(`${k}-listbox`),t=e?.querySelector('[role="option"][tabindex="0"]');t?.focus({focusVisible:!0})})},[k]),me=a(e=>{if(!f)return"Enter"===e.key&&P?(e.preventDefault(),void($?ce():ae(!1))):"ArrowDown"===e.key||"ArrowUp"===e.key?(e.preventDefault(),P||ae(!0),void("tree"===N?de():ue())):"Escape"===e.key?(e.preventDefault(),void ae(!1)):void 0},[f,P,ae,N,de,ue,$,ce]),fe=s(()=>({open:P,setOpen:ae,inputValue:z,setInputValue:oe,baseId:k,contentRef:C,controlRef:D,applyRef:S,popupRef:M,restoreFocusOnCloseRef:R,ignoreFocusExitCloseRef:A,active:U,setActive:Z,disabled:f,error:p,closeOnBlur:i,keyHandler:me,selection:W,appliedSelection:G,stagedSelection:B,stagingEnabled:$,hasStagedChanges:_,applyStagedSelection:ce,resetStagedSelection:Y,contentType:N,selectionMode:L?"multiple":"single",onSelectionChange:se,registerItem:X,unregisterItem:J,getItems:Q,isItemDisabled:ee,hasValue:ne,setHasValue:re,autoActiveOnOpen:te}),[P,ae,i,me,z,oe,U,Z,k,f,p,W,G,B,$,_,ce,Y,N,L,se,X,J,Q,ee,ne,te]);/* @__PURE__ */
@@ -27,6 +27,12 @@ export type UseActiveItemFocusConfig = {
27
27
  /** ARIA role of the container to check (e.g., 'listbox', 'menu') */
28
28
  containerRole: string;
29
29
  };
30
+ /**
31
+ * Invoked synchronously right before the programmatic `.focus()` call, so a
32
+ * consumer's `onFocus` handler can distinguish hook-driven focus from a user
33
+ * gesture and skip redundant state updates.
34
+ */
35
+ onProgrammaticFocus?: () => void;
30
36
  };
31
37
  /**
32
38
  * Automatically focuses an element when it becomes active, typically used
@@ -80,4 +86,4 @@ export type UseActiveItemFocusConfig = {
80
86
  * }
81
87
  * ```
82
88
  */
83
- export declare function useActiveItemFocus({ ref, isActive, disabled, focusMode, checkFocusWithin, }: UseActiveItemFocusConfig): void;
89
+ export declare function useActiveItemFocus({ ref, isActive, disabled, focusMode, checkFocusWithin, onProgrammaticFocus, }: UseActiveItemFocusConfig): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enonic/ui",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Enonic UI Component Library",
5
5
  "author": "Enonic",
6
6
  "license": "Apache-2.0",